diff --git a/CHANGELOG.md b/CHANGELOG.md index 98e9f35..76f42d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # 更新日志 +## 1.1.0 — 2026-11-12 + +### 修复 +- 文件夹配置读取区分 loading / ready / error:HTTP 503、非成功状态与解析异常不再伪装成空分组;首次失败只显示错误与重试,已有确认数据时保留并提示刷新失败;自动重试有界退避,网络恢复后重新读取。 +- 文件夹保存改为串行队列:保存期间保留上一次服务端确认状态,成功后采用宿主回包,失败回滚;409 冲突同时保留服务端版本与未保存草稿,可显式重放,绝不静默覆盖。 +- 基础目录行使用工作区确认标题(自定义名/远程目录名),不再把本地镜像 basename(如 `w123`)当远程工作区名称;成员行优先远程目录名;路径身份不变。 +- 右侧文件树根标签改为按完整 `title` 路径精确匹配镜像路径,移除 basename + `padding-left:6px` 的脆弱 DOM 猜测;同名本地目录不会被误改。 +- 远程路径防重:新输入与历史记录都走同一规范化(`~`/相对路径/绝对路径 + 远端 `pwd -P`);目录身份包含连接 ID;SSH 解析失败时明确报“无法确认是否重复”并拒绝创建,不再 fail-open 制造重复。 +- 复用已有远程记录时保留用户自定义标题,不被新输入的路径段覆盖。 + ## 1.0.0 — 2026-10-28 首个本地稳定版本,包名 `workspace-groups-local`。基于原项目扩展,保留原 MIT 许可证与版权声明。 diff --git a/lib/client.js b/lib/client.js index b65b0ef..be02bb9 100644 --- a/lib/client.js +++ b/lib/client.js @@ -1475,8 +1475,10 @@ window.__ModuleLoader__.load({ * is collapsed", which is both the default view and what search uses so every * hit is visible without another click. */ - function applyFolders(workspaceId, workspacePath, sessions, list, entry, collapsedFolders) { + function applyFolders(workspaceId, workspacePath, workspaceTitle, sessions, list, entry, collapsedFolders) { const labels = memberFolderLabels(entry); + const title = workspaceTitle.trim(); + if (title !== "") labels.set(workspacePath, title); const extras = effectiveFolders(workspacePath, entry).slice(1); if (extras.length === 0) return { sessions }; const root = rootOf(workspacePath, entry); @@ -1566,7 +1568,7 @@ window.__ModuleLoader__.load({ const sessions = sessionsWithMembers(list, workspace, members.byOwner.get(workspace.workspaceId) ?? [], archived, descendants, statuses, current); const wsExpanded = expandedWorkspaces.has(workspace.workspaceId); const wsContainsCurrent = workspace.workspaceId === currentWorkspaceId; - const partitioned = applyFolders(workspace.workspaceId, workspace.path, sessions, list, entryFor(folders, workspace.workspaceId), collapsedFolders); + const partitioned = applyFolders(workspace.workspaceId, workspace.path, workspace.title, sessions, list, entryFor(folders, workspace.workspaceId), collapsedFolders); if (wsContainsCurrent) containsCurrent = true; workspaceNodes.push({ workspaceId: workspace.workspaceId, @@ -1615,7 +1617,7 @@ window.__ModuleLoader__.load({ if (workspace === void 0) continue; const sessions = sessionsWithMembers(list, workspace, members.byOwner.get(workspaceId) ?? [], archived, descendants, statuses, current); const wsExpanded = expandedWorkspaces.has(workspaceId); - const partitioned = applyFolders(workspace.workspaceId, workspace.path, sessions, list, entryFor(folders, workspaceId), collapsedFolders); + const partitioned = applyFolders(workspace.workspaceId, workspace.path, workspace.title, sessions, list, entryFor(folders, workspaceId), collapsedFolders); nodes.push({ workspaceId: workspace.workspaceId, path: workspace.path, @@ -1658,7 +1660,7 @@ window.__ModuleLoader__.load({ const ownerMembers = memberWorkspaces(workspaces, folders).byOwner.get(workspace.workspaceId) ?? []; const sessions = sessionsWithMembers(list, workspace, ownerMembers, archived, descendants, statuses, current); const wsExpanded = expandedWorkspaces.has(workspace.workspaceId); - const partitioned = applyFolders(workspace.workspaceId, workspace.path, sessions, list, entryFor(folders, workspace.workspaceId), collapsedFolders); + const partitioned = applyFolders(workspace.workspaceId, workspace.path, workspace.title, sessions, list, entryFor(folders, workspace.workspaceId), collapsedFolders); return { workspaceId: workspace.workspaceId, path: workspace.path, @@ -1778,7 +1780,7 @@ window.__ModuleLoader__.load({ }); } if (nodes.length === 0) continue; - const partitioned = applyFolders(workspace.workspaceId, workspace.path, nodes, list, entryFor(folders, workspace.workspaceId), void 0); + const partitioned = applyFolders(workspace.workspaceId, workspace.path, workspace.title, nodes, list, entryFor(folders, workspace.workspaceId), void 0); const node = { workspaceId: workspace.workspaceId, path: workspace.path, @@ -3892,28 +3894,58 @@ window.__ModuleLoader__.load({ } /** * Fetch the stored folder overlay. + * + * A non-2xx response, a malformed body or a transport error is returned as + * `ok:false` with the reason. The empty document is still present for callers + * that only need a safe value, but `ok` is the authority: the browser must not + * treat a failed read as "no folders". * @param fetchImpl - fetch implementation (injectable for tests). - * @returns the overlay plus the reported mirror base; the empty document on any - * failure. + * @param signal - optional cancellation for a superseded read/retry. */ - async function loadFolders(fetchImpl = fetch) { + async function loadFolders(fetchImpl = fetch, signal) { try { const response = await fetchImpl(FOLDERS_ROUTE, { method: "GET", - cache: "no-store" + cache: "no-store", + ...signal === void 0 ? {} : { signal } }); - if (!response.ok) return { document: EMPTY_FOLDERS_DOCUMENT }; + if (!response.ok) return { + ok: false, + document: EMPTY_FOLDERS_DOCUMENT, + error: `HTTP ${response.status}` + }; const body = await response.json(); - if (typeof body !== "object" || body === null) return { document: EMPTY_FOLDERS_DOCUMENT }; + if (typeof body !== "object" || body === null) return { + ok: false, + document: EMPTY_FOLDERS_DOCUMENT, + error: "响应不是 JSON 对象" + }; const source = body; const remoteBase = typeof source.remoteBase === "string" && source.remoteBase.trim() !== "" ? source.remoteBase.trim() : void 0; const base = remoteBase === void 0 ? {} : { remoteBase }; + const document = parseWireDocument(source); + if (document === null) return { + ok: false, + document: EMPTY_FOLDERS_DOCUMENT, + ...base, + error: "文件夹文档格式无效" + }; return { - document: parseWireDocument(source) ?? EMPTY_FOLDERS_DOCUMENT, + ok: true, + document, ...base }; - } catch { - return { document: EMPTY_FOLDERS_DOCUMENT }; + } catch (error) { + if (signal?.aborted === true) return { + ok: false, + document: EMPTY_FOLDERS_DOCUMENT, + error: "aborted" + }; + return { + ok: false, + document: EMPTY_FOLDERS_DOCUMENT, + error: error instanceof Error ? error.message : String(error) + }; } } /** @@ -3948,10 +3980,13 @@ window.__ModuleLoader__.load({ */ var FoldersConflictError = class extends Error { current; - constructor(current) { + /** The unsaved document the failed PUT attempted to write. */ + attempted; + constructor(current, attempted = current) { super("folder overlay changed in another window"); this.name = "FoldersConflictError"; this.current = current; + this.attempted = attempted; } }; /** @@ -3973,7 +4008,7 @@ window.__ModuleLoader__.load({ }); if (response.status === 409) { const body = await response.json().catch(() => null); - throw new FoldersConflictError((typeof body === "object" && body !== null ? parseWireDocument(body) : null) ?? EMPTY_FOLDERS_DOCUMENT); + throw new FoldersConflictError((typeof body === "object" && body !== null ? parseWireDocument(body) : null) ?? EMPTY_FOLDERS_DOCUMENT, document); } if (!response.ok) throw new Error(`PUT ${FOLDERS_ROUTE}: ${response.status}`); const body = await response.json().catch(() => null); @@ -5777,8 +5812,8 @@ window.__ModuleLoader__.load({ function at(tabs, target) { return tabs.findIndex((tab) => tab.sessionId === target.sessionId); } - // \0dsh-workspace-groups-inline-css:/home/hatch/workspace/dsh-workspace-groups-remote/src/client/styles.css.mjs - var styles_css_default = ".wgRoot{box-sizing:border-box;flex-direction:column;flex:1;width:100%;min-width:0;min-height:0;display:flex;overflow:hidden}.wgRoot [data-rssh-globe]{display:none!important}.wgSectionHeader{flex:none;align-items:center;gap:4px;height:36px;padding:0 12px;display:flex}.wgSectionLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:45%;color:var(--dsw-fg-1,inherit);flex:none;font-size:12px;font-weight:600;overflow:hidden}.wgIconButton{width:26px;height:26px;color:var(--dsw-fg-2,inherit);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;padding:0;display:inline-flex}.wgIconButton:hover{background:var(--dsw-bg-hover,#7f7f7f1f);color:var(--dsw-fg-1,inherit)}.wgIconButton:disabled{opacity:.5;cursor:default}.wgSearch{flex:1;align-items:center;min-width:0;max-width:28px;margin-left:auto;transition:max-width .18s;display:flex}.wgSearchExpanded{max-width:100%}.wgSearchInput{min-width:0;color:var(--dsw-fg-1,inherit);background:0 0;border:none;outline:none;flex:1;padding:0;font-size:12px}.wgTreeBody{flex:1;min-width:0;min-height:0;padding:0 8px 8px;overflow:hidden auto}.wgDock{border-top:1px solid var(--dsw-alias-border-l2,#7f7f7f47);flex-direction:column;flex:0 auto;min-width:0;min-height:84px;max-height:min(62vh,560px);display:flex;overflow:hidden}.wgDockBucket{flex:none;min-width:0;min-height:0;max-height:min(26vh,200px);padding:4px 8px 0;overflow:hidden auto}.wgDockBucket+.wgDefaultWorkspaceBar{border-top:1px solid var(--dsw-alias-border-l2,#7f7f7f47)}.wgRail .wgDock{display:none}.wgDefaultWorkspaceBar{flex-direction:column;flex:auto;min-width:0;min-height:0;padding:6px 8px 8px;display:flex;overflow:hidden}.wgDockSessions{flex:auto;min-width:0;min-height:0;max-height:min(26vh,400px);overflow:hidden auto}.wgDefaultWorkspaceBar .wgProjectRow{flex:none;margin-bottom:2px}.wgTreeWrap,.wgList,.wgRows,.wgRowsInner,.wgTreeChildren{min-width:0;max-width:100%}.wgCategoryRow,.wgProjectRow,.wgFolderRow,.wgSessionRow{box-sizing:border-box;width:100%;min-width:0;max-width:100%}.wgRowActions:last-child{margin-left:auto}.wgList{flex-direction:column;gap:1px;display:flex}.wgEmpty{text-align:center;color:var(--dsw-fg-3,#7f7f7fcc);padding:16px 8px;font-size:12px}.wgCategoryRow{cursor:pointer;user-select:none;border-radius:6px;align-items:center;gap:4px;height:28px;padding:0 4px;display:flex;position:relative}[data-wg-color=red]{--wg-group-tint:#d9534f}[data-wg-color=orange]{--wg-group-tint:#e08a3c}[data-wg-color=amber]{--wg-group-tint:#d9a521}[data-wg-color=green]{--wg-group-tint:#3fa45b}[data-wg-color=teal]{--wg-group-tint:#2f9e93}[data-wg-color=blue]{--wg-group-tint:#4a90d9}[data-wg-color=indigo]{--wg-group-tint:#5b6fd6}[data-wg-color=purple]{--wg-group-tint:#9a63c9}[data-wg-color=pink]{--wg-group-tint:#d4659c}[data-wg-color=gray]{--wg-group-tint:#8a8a8a}.wgCategoryRow[data-wg-color]{box-shadow:inset 2px 0 0 var(--wg-group-tint)}.wgCategoryRow[data-wg-color] .wgCategoryIcon{color:var(--wg-group-tint)}.wgCategoryRow:hover{background:var(--dsw-bg-hover,#7f7f7f1f)}.wgCategoryRow:hover .wgRowActions,.wgCategoryRow:focus-within .wgRowActions{opacity:1}.wgDropTarget{background:var(--dsw-bg-selected,#4a90d92e);outline:1px dashed var(--dsw-accent,#4a90d9);outline-offset:-1px}.wgInsertBefore:before,.wgInsertAfter:after{content:\"\";background:var(--dsw-accent,#4a90d9);height:2px;box-shadow:0 0 0 1px color-mix(in srgb, var(--dsw-accent,#4a90d9) 25%, transparent);pointer-events:none;z-index:6;border-radius:1px;position:absolute;left:2px;right:2px}.wgInsertBefore:before{top:-1px}.wgInsertAfter:after{bottom:-1px}.wgChevron{width:14px;height:14px;color:var(--dsw-fg-3,#7f7f7fcc);flex:none;justify-content:center;align-items:center;transition:transform .12s;display:inline-flex;overflow:hidden}.wgChevron>svg:not(:first-child){display:none}.wgChevronOpen{transform:rotate(90deg)}.wgCategoryIcon{color:var(--dsw-fg-2,inherit);flex:none;justify-content:center;align-items:center;width:16px;height:16px;display:inline-flex}.wgCategoryIcon>svg{flex:none;width:16px;height:16px;display:block}.wgCategoryLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-fg-1,inherit);flex:1;font-size:12px;font-weight:600;overflow:hidden}.wgCategoryCount,.wgProjectCount{color:var(--dsw-fg-3,#7f7f7fcc);flex:none;font-size:11px}.wgCategoryGlyph{font-size:12px;line-height:1}.wgCategoryPin{color:var(--dsw-fg-3,#7f7f7fcc);flex:none;display:inline-flex}.wgProjectRow{cursor:pointer;user-select:none;border-radius:6px;align-items:center;gap:4px;height:28px;padding:0 4px 0 20px;display:flex;position:relative}.wgProjectFlat{padding-left:4px}.wgTopLevelArea{margin-top:2px;padding-bottom:10px}.wgTopLevelEmpty{border-radius:4px;height:14px;position:relative}.wgTopLevelEmptyLine{background:var(--dsw-accent,#4a90d9);height:2px;box-shadow:0 0 0 1px color-mix(in srgb, var(--dsw-accent,#4a90d9) 25%, transparent);pointer-events:none;border-radius:1px;position:absolute;top:50%;left:2px;right:2px}.wgTopLevelEmptyActive{background:var(--dsw-bg-selected,#4a90d92e)}.wgProjectRow:hover{background:var(--dsw-bg-hover,#7f7f7f1f)}.wgProjectActive .wgProjectLabel{font-weight:700}.wgProjectLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));flex:1;font-size:12px;font-weight:500;overflow:hidden}.wgRowActions{opacity:0;flex:none;align-items:center;gap:2px;display:inline-flex}.wgRowTrail{flex:none;place-items:center end;margin-left:auto;display:grid}.wgRowTrail>*{grid-area:1/1}.wgProjectRow:hover .wgRowActions,.wgProjectRow:focus-within .wgRowActions{opacity:1}.wgFolderRow{cursor:pointer;user-select:none;border-radius:6px;align-items:center;gap:4px;height:28px;padding:0 4px 0 38px;display:flex;position:relative}.wgFolderRow:hover{background:var(--dsw-bg-hover,#7f7f7f1f)}.wgFolderRow:hover .wgRowActions,.wgFolderRow:focus-within .wgRowActions{opacity:1}.wgFolderLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));flex:1;font-size:12px;font-weight:500;overflow:hidden}.wgFolderBase .wgFolderLabel{font-weight:600}.wgFolderRoot{color:var(--dsw-accent,#4a90d9);flex:none;font-size:11px;line-height:1}.wgFolderCount{color:var(--dsw-fg-3,#7f7f7fcc);flex:none;font-size:11px}.wgCategoryCount,.wgFolderCount,.wgProjectCount,.wgSessionTime{transition:opacity .12s}.wgCategoryRow:hover .wgCategoryCount,.wgCategoryRow:focus-within .wgCategoryCount,.wgFolderRow:hover .wgFolderCount,.wgFolderRow:focus-within .wgFolderCount,.wgProjectRow:hover .wgProjectCount,.wgProjectRow:focus-within .wgProjectCount,.wgSessionRow:hover .wgSessionTime,.wgSessionRow:focus-within .wgSessionTime{opacity:0;visibility:hidden}.wgSessionNested{padding-left:70px}.wgTreeWrap{position:relative}.wgBranch{z-index:2;pointer-events:none;transition:opacity .12s;position:absolute;top:0;left:0;overflow:visible}.wgTreeWrap:has([data-wg-animating]) .wgBranch{opacity:0}.wgTreeWrap>.wgList{z-index:1;position:relative}.wgFlowerArt{transform-box:fill-box;transform-origin:50%;animation:4s linear infinite paused wg-flower-spin}.wgFlowerSpinning .wgFlowerArt{animation-play-state:running}@keyframes wg-flower-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.wgFlowerArt,.wgRowsOpening,.wgRowsClosing{animation:none}.wgBranch{transition:none}}.wgRows{grid-template-rows:1fr;grid-template-columns:minmax(0,1fr);display:grid}.wgRowsInner{min-height:0}.wgRowsOpening{animation:.18s cubic-bezier(.2,.8,.2,1) wg-rows-in}.wgRowsClosing{pointer-events:none;animation:.16s cubic-bezier(.4,0,1,1) forwards wg-rows-out}.wgRowsOpening .wgRowsInner,.wgRowsClosing .wgRowsInner{overflow:hidden}@keyframes wg-rows-in{0%{opacity:.35;grid-template-rows:0fr}to{opacity:1;grid-template-rows:1fr}}@keyframes wg-rows-out{0%{opacity:1;grid-template-rows:1fr}to{opacity:0;grid-template-rows:0fr}}.wgTreeChildren{position:relative}.wgSessionRow{cursor:pointer;user-select:none;border-radius:6px;align-items:center;gap:6px;height:28px;padding:0 4px 0 54px;display:flex}.wgSessionRow:hover{background:var(--dsw-bg-hover,#7f7f7f1f)}.wgSessionRow:hover .wgRowActions,.wgSessionRow:focus-within .wgRowActions{opacity:1}.wgSelected{background:var(--dsw-bg-selected,#4a90d92e)}.wgStatusSlot{flex:none;justify-content:center;align-items:center;width:14px;height:14px;display:inline-flex}.wgSessionTitle{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-secondary,var(--dsw-fg-2,inherit));flex:1;font-size:12px;overflow:hidden}.wgSelected .wgSessionTitle{color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));font-weight:500}.wgSessionTime{color:var(--dsw-fg-3,#7f7f7fcc);flex:none;font-size:11px}.wgVisuallyHidden{clip:rect(0 0 0 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.wgMatched{background:var(--dsw-bg-selected,#4a90d92e)}.wgSessionSnippet{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-fg-3,#7f7f7fcc);flex:1;font-size:11px;overflow:hidden}.wgSearchStatus{color:var(--dsw-fg-3,#7f7f7fcc);text-align:center;padding:8px;font-size:11px}.wgManualError{color:var(--dsw-fg-1,inherit);text-align:left;word-break:break-word}.wgRail{flex-direction:column;align-items:center;gap:12px;padding:8px 0 0;display:flex;overflow:hidden}.wgRail .wgSectionHeader{flex-direction:column;align-self:center;align-items:center;gap:12px;width:36px;height:auto;padding:0}.wgRail .wgIconButton{border-radius:50%;width:36px;height:36px}.wgRail .wgTreeBody{display:none}.wgAddError{color:var(--dsw-fg-1,inherit);white-space:pre-wrap;word-break:break-word;max-height:200px;font-size:12px;overflow-y:auto}.wgRenameInput{border:1px solid var(--dsw-border,#7f7f7f4d);background:var(--dsw-bg-1,transparent);width:100%;color:var(--dsw-fg-1,inherit);border-radius:6px;outline:none;padding:6px 8px;font-size:13px}.wgRenameInput:focus{border-color:var(--dsw-accent,#4a90d9)}.wgFolderBody{flex-direction:column;gap:14px;display:flex}.wgFolderHead{flex-direction:column;gap:2px;min-width:0;display:flex}.wgFolderHeadName{color:var(--dsw-fg-1,inherit);text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;overflow:hidden}.wgFolderHeadPath{color:var(--dsw-alias-label-secondary,inherit);font-family:var(--dsw-font-mono,ui-monospace,SFMono-Regular,monospace);opacity:.65;text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.wgFolderSection{flex-direction:column;gap:6px;min-width:0;display:flex}.wgFolderSectionTitle{color:var(--dsw-alias-label-secondary,inherit);letter-spacing:.03em;opacity:.7;font-size:11px;font-weight:600}.wgFolderList{flex-direction:column;gap:4px;max-height:280px;margin:0 -2px;padding:2px;display:flex;overflow:auto}.wgFolderListRow{background:#7f7f7f1a;border:1px solid #0000;border-radius:8px;align-items:center;gap:8px;padding:7px 8px;transition:background .12s,border-color .12s;display:flex}.wgFolderListRow:hover{background:var(--dsw-bg-hover,#7f7f7f2e)}.wgFolderListRow[data-active=true]{border-color:var(--dsw-alias-border-l2,#7f7f7f40);background:var(--dsw-bg-hover,#7f7f7f1f)}.wgFolderRootPick{cursor:pointer;flex:none;align-items:center;display:inline-flex}.wgFolderRadio{appearance:none;border:1.5px solid var(--dsw-alias-border-l2,#7f7f7f80);cursor:pointer;background:0 0;border-radius:50%;place-content:center;width:14px;height:14px;margin:0;transition:border-color .12s;display:grid}.wgFolderRadio:hover,.wgFolderRadio:checked{border-color:var(--dsw-accent,#4a90d9)}.wgFolderRadio:checked:after{content:\"\";background:var(--dsw-accent,#4a90d9);border-radius:50%;width:7px;height:7px}.wgFolderRadio:focus-visible{outline:2px solid var(--dsw-accent,#4a90d9);outline-offset:2px}.wgFolderEntry{flex-direction:column;flex:auto;gap:1px;min-width:0;display:flex}.wgFolderListLabel{color:var(--dsw-fg-1,inherit);text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;font-weight:500;line-height:1.35;overflow:hidden}.wgFolderListPath{color:var(--dsw-alias-label-secondary,inherit);font-family:var(--dsw-font-mono,ui-monospace,SFMono-Regular,monospace);opacity:.6;text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:1.35;overflow:hidden}.wgFolderListTags{flex:none;align-items:center;gap:4px;display:inline-flex}.wgFolderListTag{border:1px solid var(--dsw-alias-border-l2,#7f7f7f40);color:var(--dsw-alias-label-secondary,inherit);white-space:nowrap;border-radius:999px;padding:2px 6px;font-size:10px;line-height:1.4}.wgFolderListTag[data-tone=base]{border-style:dashed}.wgFolderListTag[data-tone=root]{color:var(--dsw-fg-1,inherit);background:#4a90d92e;border-color:#0000}.wgFolderListTag[data-tone=cloud],.wgFolderListTag[data-tone=local]{opacity:.85}.wgFolderListTag[data-tone=danger]{color:#e08a8a;border-color:#d464644d}.wgFolderListActions{opacity:.5;flex:none;align-items:center;gap:2px;transition:opacity .12s;display:inline-flex}.wgFolderListRow:hover .wgFolderListActions,.wgFolderListRow:focus-within .wgFolderListActions{opacity:1}.wgFolderEmpty{border:1px dashed var(--dsw-alias-border-l2,#7f7f7f40);color:var(--dsw-alias-label-secondary,inherit);opacity:.75;border-radius:8px;margin:0;padding:10px 12px;font-size:11.5px;line-height:1.5}.wgFolderConfirm{border:1px solid var(--dsw-alias-border-l2,#7f7f7f40);border-radius:8px;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:4px 0 6px;padding:8px 10px;font-size:11.5px;line-height:1.5;display:flex}.wgFolderConfirmText{flex:220px}.wgFolderConfirmActions{gap:6px;display:flex}.wgFolderConfirmButton{border:1px solid var(--dsw-alias-border-l2,#7f7f7f40);color:inherit;font:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:3px 9px}.wgFolderConfirmButton[data-tone=danger]{color:var(--dsw-alias-status-danger,#d13438);border-color:var(--dsw-alias-status-danger,#d13438)}.wgFolderAdd{border-top:1px solid var(--dsw-alias-border-l2,#7f7f7f33);flex-direction:column;gap:8px;padding-top:12px;display:flex}.wgFolderSegmented{background:#7f7f7f29;border-radius:999px;align-self:flex-start;gap:2px;padding:2px;display:inline-flex}.wgFolderTab{color:var(--dsw-alias-label-secondary,inherit);font:inherit;cursor:pointer;white-space:nowrap;background:0 0;border:0;border-radius:999px;padding:4px 12px;font-size:12px;transition:background .12s,color .12s}.wgFolderTab:hover{color:var(--dsw-fg-1,inherit)}.wgFolderTab[aria-selected=true]{color:var(--dsw-fg-1,inherit);background:#ffffff2b;font-weight:600;box-shadow:inset 0 0 0 1px #ffffff1f}.wgFolderLocalPane{flex-direction:column;gap:6px;display:flex}.wgFolderPick{border:1px dashed var(--dsw-alias-border-l2,#7f7f7f59);width:100%;color:var(--dsw-fg-1,inherit);font:inherit;text-align:left;cursor:pointer;white-space:nowrap;background:0 0;border-radius:8px;align-items:center;gap:8px;padding:9px 12px;font-size:12.5px;font-weight:500;transition:border-color .12s,background .12s;display:flex}.wgFolderPick:hover:not(:disabled){border-color:var(--dsw-accent,#4a90d9);background:#4a90d91a}.wgFolderPick:disabled{opacity:.5;cursor:default}.wgFolderPickPlus{color:var(--dsw-accent,#4a90d9);flex:none;font-size:13px;line-height:1}.wgFolderHint{color:var(--dsw-alias-label-secondary,inherit);opacity:.7;margin:0;font-size:11px;line-height:1.55}.wgFolderActions{gap:6px;display:flex}.wgFolderActions>button{justify-content:center;width:100%}.wgFolderStack{flex-direction:column;gap:6px;display:flex}.wgFolderField{align-items:center;display:flex;position:relative}.wgFolderField .wgFolderFieldInput{width:100%;padding-right:30px}.wgFolderFieldAction{width:22px;height:22px;color:var(--dsw-fg-3,#a6abc4);cursor:pointer;background:0 0;border:0;border-radius:5px;justify-content:center;align-items:center;padding:0;display:inline-flex;position:absolute;top:50%;right:4px;transform:translateY(-50%)}.wgFolderFieldAction:hover:not(:disabled){background:var(--dsw-bg-hover,#ffffff1f);color:var(--dsw-fg-1,inherit)}.wgFolderFieldAction:disabled{opacity:.4;cursor:default}.wgFolderAddRow{align-items:center;gap:6px;margin-top:6px;display:flex}.wgFolderAddRow>button{white-space:nowrap;flex:none}.wgFolderNote{color:var(--dsw-alias-label-secondary,inherit);opacity:.8;margin:0;font-size:11px;line-height:1.5}.wgRemoteBar{align-items:center;gap:6px;margin-bottom:8px;display:flex}.wgRemotePath{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--dsw-font-mono,ui-monospace,monospace);color:var(--dsw-fg-1,inherit);flex:auto;font-size:12px;overflow:hidden}.wgRemoteActions{flex:none;gap:4px;display:inline-flex}.wgRemoteList{border:1px solid var(--dsw-alias-border-l2,#7f7f7f33);border-radius:8px;max-height:260px;margin:0 0 8px;padding:4px;overflow:auto}.wgRemoteRow{width:100%;color:var(--dsw-fg-1,inherit);font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:6px;align-items:center;gap:6px;padding:5px 6px;font-size:12px;display:flex}.wgRemoteRow:hover{background:var(--dsw-bg-hover,#7f7f7f1f)}.wgRemoteName{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.wgFolderSelect{flex:auto;width:100%;min-width:0}.wgFolderSubpathInput{border:1px solid var(--dsw-alias-border-l2,#7f7f7f40);background:var(--dsw-alias-bg-base,transparent);min-width:0;color:inherit;font:inherit;border-radius:6px;flex:auto;padding:4px 8px;font-size:13px}.wgFolderSubpathInput:focus{border-color:var(--dsw-alias-label-primary,currentColor);outline:none}.wgAppearanceBody{flex-direction:column;gap:16px;display:flex}.wgAppearanceDialog{max-height:100%}.wgAppearanceContent{min-height:0;overflow:hidden auto}.wgAppearanceContent>:first-child{z-index:1;background:var(--dsw-alias-bg-layer-2,transparent);position:sticky;top:0}.wgAppearanceSection{flex-direction:column;gap:6px;display:flex}.wgAppearanceLabel{color:var(--dsw-fg-3,#7f7f7fcc);font-size:11px;font-weight:600}.wgSwatchRow{flex-wrap:wrap;gap:6px;display:flex}.wgSwatch{cursor:pointer;border:1px solid var(--dsw-alias-border-l2,#7f7f7f47);border-radius:5px;width:20px;height:20px;padding:0}.wgSwatch[data-wg-color]{background:var(--wg-group-tint)}.wgSwatch:disabled{cursor:default;opacity:.5}.wgSwatchActive{outline:2px solid var(--dsw-accent,#4a90d9);outline-offset:1px}.wgSwatchDefault{background:var(--dsw-bg-hover,#7f7f7f1f)}.wgIconSections{scrollbar-gutter:stable;flex-direction:column;gap:10px;max-height:216px;padding:4px;display:flex;overflow-y:auto}.wgIconSection{flex-direction:column;gap:4px;display:flex}.wgIconSectionLabel{color:var(--dsw-fg-3,#7f7f7fcc);font-size:11px;font-weight:600;line-height:14px}.wgIconGrid{grid-template-columns:repeat(auto-fill,minmax(28px,1fr));gap:4px;padding:1px;display:grid}.wgEmojiGrid .wgIconCell{font-size:18px}.wgIconCustom{align-items:center;gap:8px;margin-top:2px;display:flex}.wgIconCustom .wgRenameInput{flex:1;min-width:0}.wgIconCell.wgIconDefault{width:auto;padding:0 8px}.wgIconCell{cursor:pointer;color:var(--dsw-fg-2,inherit);background:0 0;border:0;border-radius:5px;justify-content:center;align-items:center;width:28px;height:28px;padding:0;display:inline-flex}.wgIconCell:hover:not(:disabled){background:var(--dsw-bg-hover,#7f7f7f1f)}.wgIconCell[aria-pressed=true]{background:var(--dsw-bg-selected,#4a90d92e);box-shadow:inset 0 0 0 1px var(--dsw-accent,#4a90d9)}.wgIconCell:focus-visible{outline:2px solid var(--dsw-accent,#4a90d9);outline-offset:1px}.wgIconCell:disabled{cursor:default;opacity:.5}.wgQuickOverlay{z-index:1100;background:var(--dsw-alias-bg-mask-1,#00000052);backdrop-filter:var(--dsw-mask-blur,blur(2px));justify-content:center;align-items:flex-start;padding:10vh 24px 24px;display:flex;position:fixed;inset:0}.wgQuickCard{border:1px solid var(--dsw-border,#7f7f7f33);background:var(--dsw-alias-bg-layer-2,var(--dsw-bg-1,#fff));width:min(640px,100%);max-height:min(560px,90vh - 48px);box-shadow:var(--dsw-elevation-prominent,0 16px 48px #00000040);box-sizing:border-box;border-radius:12px;flex-direction:column;gap:10px;padding:14px;display:flex;overflow:hidden}.wgQuickHeader{flex:none;justify-content:space-between;align-items:center;gap:12px;display:flex}.wgQuickTitle{color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));font-size:13px;font-weight:600}.wgQuickTabs{gap:2px;display:flex}.wgQuickTab{color:var(--dsw-alias-label-secondary,var(--dsw-fg-2,inherit));cursor:pointer;background:0 0;border:none;border-radius:6px;align-items:center;gap:6px;padding:4px 12px;font-family:inherit;font-size:12px;display:inline-flex}.wgQuickTab:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-bg-hover,#7f7f7f1f))}.wgQuickTabActive{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-bg-selected,#4a90d92e));color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));font-weight:600}.wgQuickTabCount{background:var(--dsw-accent,#4a90d9);color:#fff;text-align:center;border-radius:8px;min-width:16px;height:16px;padding:0 4px;font-size:10px;font-weight:600;line-height:16px}.wgQuickSearchWrap{flex:none}.wgQuickSearch{border:1px solid var(--dsw-border,#7f7f7f4d);background:var(--dsw-bg-1,transparent);width:100%;height:34px;color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));box-sizing:border-box;border-radius:8px;outline:none;padding:0 10px;font-family:inherit;font-size:13px}.wgQuickSearch:focus{border-color:var(--dsw-accent,#4a90d9)}.wgQuickList{flex-direction:column;flex:auto;gap:2px;min-height:64px;padding-right:2px;display:flex;overflow-y:auto}.wgQuickRow{cursor:pointer;text-align:left;box-sizing:border-box;background:0 0;border:none;border-radius:8px;flex-direction:column;flex:none;gap:2px;width:100%;padding:7px 10px;font-family:inherit;display:flex}.wgQuickRow:hover,.wgQuickRowActive{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-bg-hover,#7f7f7f1f))}.wgQuickRowSelected,.wgQuickRowCurrent{background:var(--dsw-bg-selected,#4a90d92e)}.wgQuickRowMain{align-items:center;gap:8px;width:100%;min-width:0;display:flex}.wgQuickRowTitle{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));flex:1;font-size:13px;font-weight:500;overflow:hidden}.wgQuickRunBadge{color:var(--dsw-accent,#4a90d9);flex:none;font-size:11px}.wgQuickTime{color:var(--dsw-alias-label-secondary,var(--dsw-fg-3,#7f7f7fcc));flex:none;font-size:11px}.wgQuickRowSub{min-width:0;display:flex}.wgQuickRowPath{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-secondary,var(--dsw-fg-3,#7f7f7fcc));flex:1;font-size:11px;overflow:hidden}.wgQuickEmpty{text-align:center;color:var(--dsw-alias-label-secondary,var(--dsw-fg-3,#7f7f7fcc));padding:24px 8px;font-size:12px}.wgQuickFooter{flex:none;align-items:center;gap:8px;padding-top:2px;display:flex}.wgQuickSelected{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-secondary,var(--dsw-fg-3,#7f7f7fcc));flex:1;font-size:12px;overflow:hidden}.wgQuickHint{text-align:center;color:var(--dsw-alias-label-secondary,var(--dsw-fg-3,#7f7f7fcc));flex:none;font-size:11px}.wgTabs{box-sizing:border-box;border-bottom:1px solid var(--dsw-alias-border-l2,#7f7f7f33);background:0 0;flex:none;align-items:stretch;gap:4px;min-width:0;height:56px;padding:8px 10px;display:flex}.wgTabsScroll{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;box-sizing:border-box;flex:auto;align-items:stretch;gap:6px;min-width:0;padding:1px 0;display:flex;overflow:auto hidden}.wgTabsScroll::-webkit-scrollbar{width:0;height:0;display:none}.wgTab{min-width:0;max-width:240px;box-shadow:inset 0 0 0 1px var(--dsw-alias-border-l2,#7f7f7f2e);color:var(--dsw-alias-label-secondary,var(--dsw-fg-2,inherit));border-radius:8px;flex:none;align-items:center;padding:0 6px 0 10px;transition:background .12s,box-shadow .12s;display:inline-flex}.wgTabText{flex-direction:column;flex:auto;justify-content:center;align-items:flex-start;gap:3px;min-width:0;height:100%;display:flex}.wgTabProject{text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:100%;font-family:var(--dsw-font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);letter-spacing:.02em;color:var(--dsw-alias-label-secondary,var(--dsw-fg-3,inherit));opacity:.85;flex:none;font-size:10px;line-height:13px;overflow:hidden}.wgTab:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-bg-hover,#7f7f7f1f))}.wgTabActive{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-bg-hover,#7f7f7f1f));box-shadow:inset 0 0 0 1px var(--dsw-alias-label-secondary,#7f7f7f73);color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit))}.wgTabActive .wgTabProject{opacity:1}.wgTabMain{box-sizing:border-box;min-width:0;height:100%;color:inherit;cursor:pointer;background:0 0;border:none;flex:auto;align-items:center;gap:8px;padding:6px 0;font-family:inherit;font-size:12px;display:inline-flex}.wgTabStatus{flex:none;justify-content:center;align-items:center;width:12px;height:12px;display:inline-flex}.wgTabStatus[data-tab-state=idle]{opacity:.45}.wgTabLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:100%;color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));flex:none;font-size:12px;line-height:16px;overflow:hidden}.wgTabText>.wgTabLabel:only-child{align-self:center}.wgTabClose{width:20px;height:20px;color:inherit;cursor:pointer;opacity:0;background:0 0;border:none;border-radius:5px;flex:none;justify-content:center;align-items:center;margin-left:2px;padding:0;transition:opacity .12s,background .12s;display:inline-flex}.wgTab:hover .wgTabClose,.wgTab:focus-within .wgTabClose,.wgTabActive .wgTabClose{opacity:1}.wgTabClose:hover{background:var(--dsw-alias-interactive-bg-hover-solid,#7f7f7f33)}.wgTab{position:relative}.wgTabPinned{box-shadow:inset 0 0 0 1px var(--dsw-alias-label-secondary,#7f7f7f73)}.wgTabPin{opacity:.55;width:12px;height:12px;color:inherit;flex:none;justify-content:center;align-items:center;margin-left:4px;display:inline-flex}.wgTabDragging{opacity:.42}.wgTabDropBefore:before,.wgTabDropAfter:before{content:\"\";background:var(--dsw-alias-label-primary,var(--dsw-fg-1,#4a90d9));border-radius:2px;width:2px;position:absolute;top:2px;bottom:2px}.wgTabDropBefore:before{left:-4px}.wgTabDropAfter:before{right:-4px}.wgTabRename{box-sizing:border-box;min-width:88px;height:100%;color:inherit;background:var(--dsw-alias-bg-elevated,var(--dsw-bg-1,transparent));border:1px solid var(--dsw-alias-label-secondary,#7f7f7f73);border-radius:6px;outline:none;flex:auto;margin:2px 0;padding:0 6px;font-family:inherit;font-size:12px}.wgTabMenu{z-index:2147483000;box-sizing:border-box;background:var(--dsw-alias-bg-popup,var(--dsw-bg-2,#1e1e1e));border:1px solid var(--dsw-alias-border-l2,#7f7f7f33);border-radius:8px;flex-direction:column;min-width:196px;padding:4px;display:flex;position:fixed;box-shadow:0 8px 24px #0003,0 1px 2px #0000001f}.wgTabMenuItem{width:100%;color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));text-align:left;cursor:pointer;background:0 0;border:none;border-radius:5px;padding:6px 10px;font-family:inherit;font-size:12px;line-height:16px}.wgTabMenuItem:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,var(--dsw-bg-hover,#7f7f7f1f))}.wgTabMenuItem:disabled{cursor:default;opacity:.4}.wgTabMenuDanger{color:var(--dsw-alias-label-error,var(--dsw-fg-error,#d9534f))}.wgTabMenuSeparator{background:var(--dsw-alias-border-l2,#7f7f7f33);height:1px;margin:4px 6px}"; + // \0dsh-workspace-groups-inline-css:C:\Users\qyh15\Documents\deepseek-harness\default-workspace\10-projects\dsh-org-fixes\workspace-groups-remote\src\client\styles.css.mjs + var styles_css_default = ".wgRoot{box-sizing:border-box;flex-direction:column;flex:1;width:100%;min-width:0;height:100%;min-height:0;max-height:100%;display:flex;overflow:hidden}.wgRoot [data-rssh-globe]{display:none!important}.wgSectionHeader{flex:none;align-items:center;gap:4px;height:36px;padding:0 12px;display:flex}.wgSectionLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:45%;color:var(--dsw-fg-1,inherit);flex:none;font-size:12px;font-weight:600;overflow:hidden}.wgIconButton{width:26px;height:26px;color:var(--dsw-fg-2,inherit);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;padding:0;display:inline-flex}.wgIconButton:hover{background:var(--dsw-bg-hover,#7f7f7f1f);color:var(--dsw-fg-1,inherit)}.wgIconButton:disabled{opacity:.5;cursor:default}.wgSearch{flex:1;align-items:center;min-width:0;max-width:28px;margin-left:auto;transition:max-width .18s;display:flex}.wgSearchExpanded{max-width:100%}.wgSearchInput{min-width:0;color:var(--dsw-fg-1,inherit);background:0 0;border:none;outline:none;flex:1;padding:0;font-size:12px}.wgTreeBody{flex:1;min-width:0;min-height:0;padding:0 8px 8px;overflow:hidden auto}.wgDock{border-top:1px solid var(--dsw-alias-border-l2,#7f7f7f47);flex-direction:column;flex:0 auto;min-width:0;min-height:84px;max-height:min(62vh,560px);display:flex;overflow:hidden}.wgDockBucket{flex:none;min-width:0;min-height:0;max-height:min(26vh,200px);padding:4px 8px 0;overflow:hidden auto}.wgDockBucket+.wgDefaultWorkspaceBar{border-top:1px solid var(--dsw-alias-border-l2,#7f7f7f47)}.wgRail .wgDock{display:none}.wgDefaultWorkspaceBar{flex-direction:column;flex:auto;min-width:0;min-height:0;padding:6px 8px 8px;display:flex;overflow:hidden}.wgDockSessions{flex:auto;min-width:0;min-height:0;max-height:min(26vh,400px);overflow:hidden auto}.wgDefaultWorkspaceBar .wgProjectRow{flex:none;margin-bottom:2px}.wgTreeWrap,.wgList,.wgRows,.wgRowsInner,.wgTreeChildren{min-width:0;max-width:100%}.wgCategoryRow,.wgProjectRow,.wgFolderRow,.wgSessionRow{box-sizing:border-box;width:100%;min-width:0;max-width:100%}.wgRowActions:last-child{margin-left:auto}.wgList{flex-direction:column;gap:1px;display:flex}.wgEmpty{text-align:center;color:var(--dsw-fg-3,#7f7f7fcc);padding:16px 8px;font-size:12px}.wgCategoryRow{cursor:pointer;user-select:none;border-radius:6px;align-items:center;gap:4px;height:28px;padding:0 4px;display:flex;position:relative}[data-wg-color=red]{--wg-group-tint:#d9534f}[data-wg-color=orange]{--wg-group-tint:#e08a3c}[data-wg-color=amber]{--wg-group-tint:#d9a521}[data-wg-color=green]{--wg-group-tint:#3fa45b}[data-wg-color=teal]{--wg-group-tint:#2f9e93}[data-wg-color=blue]{--wg-group-tint:#4a90d9}[data-wg-color=indigo]{--wg-group-tint:#5b6fd6}[data-wg-color=purple]{--wg-group-tint:#9a63c9}[data-wg-color=pink]{--wg-group-tint:#d4659c}[data-wg-color=gray]{--wg-group-tint:#8a8a8a}.wgCategoryRow[data-wg-color]{box-shadow:inset 2px 0 0 var(--wg-group-tint)}.wgCategoryRow[data-wg-color] .wgCategoryIcon{color:var(--wg-group-tint)}.wgCategoryRow:hover{background:var(--dsw-bg-hover,#7f7f7f1f)}.wgCategoryRow:hover .wgRowActions,.wgCategoryRow:focus-within .wgRowActions{opacity:1}.wgDropTarget{background:var(--dsw-bg-selected,#4a90d92e);outline:1px dashed var(--dsw-accent,#4a90d9);outline-offset:-1px}.wgInsertBefore:before,.wgInsertAfter:after{content:\"\";background:var(--dsw-accent,#4a90d9);height:2px;box-shadow:0 0 0 1px color-mix(in srgb, var(--dsw-accent,#4a90d9) 25%, transparent);pointer-events:none;z-index:6;border-radius:1px;position:absolute;left:2px;right:2px}.wgInsertBefore:before{top:-1px}.wgInsertAfter:after{bottom:-1px}.wgChevron{width:14px;height:14px;color:var(--dsw-fg-3,#7f7f7fcc);flex:none;justify-content:center;align-items:center;transition:transform .12s;display:inline-flex;overflow:hidden}.wgChevron>svg:not(:first-child){display:none}.wgChevronOpen{transform:rotate(90deg)}.wgCategoryIcon{color:var(--dsw-fg-2,inherit);flex:none;justify-content:center;align-items:center;width:16px;height:16px;display:inline-flex}.wgCategoryIcon>svg{flex:none;width:16px;height:16px;display:block}.wgCategoryLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-fg-1,inherit);flex:1;font-size:12px;font-weight:600;overflow:hidden}.wgCategoryCount,.wgProjectCount{color:var(--dsw-fg-3,#7f7f7fcc);flex:none;font-size:11px}.wgCategoryGlyph{font-size:12px;line-height:1}.wgCategoryPin{color:var(--dsw-fg-3,#7f7f7fcc);flex:none;display:inline-flex}.wgProjectRow{cursor:pointer;user-select:none;border-radius:6px;align-items:center;gap:4px;height:28px;padding:0 4px 0 20px;display:flex;position:relative}.wgProjectFlat{padding-left:4px}.wgTopLevelArea{margin-top:2px;padding-bottom:10px}.wgTopLevelEmpty{border-radius:4px;height:14px;position:relative}.wgTopLevelEmptyLine{background:var(--dsw-accent,#4a90d9);height:2px;box-shadow:0 0 0 1px color-mix(in srgb, var(--dsw-accent,#4a90d9) 25%, transparent);pointer-events:none;border-radius:1px;position:absolute;top:50%;left:2px;right:2px}.wgTopLevelEmptyActive{background:var(--dsw-bg-selected,#4a90d92e)}.wgProjectRow:hover{background:var(--dsw-bg-hover,#7f7f7f1f)}.wgProjectActive .wgProjectLabel{font-weight:700}.wgProjectLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));flex:1;font-size:12px;font-weight:500;overflow:hidden}.wgRowActions{opacity:0;flex:none;align-items:center;gap:2px;display:inline-flex}.wgRowTrail{flex:none;place-items:center end;margin-left:auto;display:grid}.wgRowTrail>*{grid-area:1/1}.wgProjectRow:hover .wgRowActions,.wgProjectRow:focus-within .wgRowActions{opacity:1}.wgFolderRow{cursor:pointer;user-select:none;border-radius:6px;align-items:center;gap:4px;height:28px;padding:0 4px 0 38px;display:flex;position:relative}.wgFolderRow:hover{background:var(--dsw-bg-hover,#7f7f7f1f)}.wgFolderRow:hover .wgRowActions,.wgFolderRow:focus-within .wgRowActions{opacity:1}.wgFolderLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));flex:1;font-size:12px;font-weight:500;overflow:hidden}.wgFolderBase .wgFolderLabel{font-weight:600}.wgFolderRoot{color:var(--dsw-accent,#4a90d9);flex:none;font-size:11px;line-height:1}.wgFolderCount{color:var(--dsw-fg-3,#7f7f7fcc);flex:none;font-size:11px}.wgCategoryCount,.wgFolderCount,.wgProjectCount,.wgSessionTime{transition:opacity .12s}.wgCategoryRow:hover .wgCategoryCount,.wgCategoryRow:focus-within .wgCategoryCount,.wgFolderRow:hover .wgFolderCount,.wgFolderRow:focus-within .wgFolderCount,.wgProjectRow:hover .wgProjectCount,.wgProjectRow:focus-within .wgProjectCount,.wgSessionRow:hover .wgSessionTime,.wgSessionRow:focus-within .wgSessionTime{opacity:0;visibility:hidden}.wgSessionNested{padding-left:70px}.wgTreeWrap{position:relative}.wgBranch{z-index:2;pointer-events:none;transition:opacity .12s;position:absolute;top:0;left:0;overflow:visible}.wgTreeWrap:has([data-wg-animating]) .wgBranch{opacity:0}.wgTreeWrap>.wgList{z-index:1;position:relative}.wgFlowerArt{transform-box:fill-box;transform-origin:50%;animation:4s linear infinite paused wg-flower-spin}.wgFlowerSpinning .wgFlowerArt{animation-play-state:running}@keyframes wg-flower-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.wgFlowerArt,.wgRowsOpening,.wgRowsClosing{animation:none}.wgBranch{transition:none}}.wgRows{grid-template-rows:1fr;grid-template-columns:minmax(0,1fr);display:grid}.wgRowsInner{min-height:0}.wgRowsOpening{animation:.18s cubic-bezier(.2,.8,.2,1) wg-rows-in}.wgRowsClosing{pointer-events:none;animation:.16s cubic-bezier(.4,0,1,1) forwards wg-rows-out}.wgRowsOpening .wgRowsInner,.wgRowsClosing .wgRowsInner{overflow:hidden}@keyframes wg-rows-in{0%{opacity:.35;grid-template-rows:0fr}to{opacity:1;grid-template-rows:1fr}}@keyframes wg-rows-out{0%{opacity:1;grid-template-rows:1fr}to{opacity:0;grid-template-rows:0fr}}.wgTreeChildren{position:relative}.wgSessionRow{cursor:pointer;user-select:none;border-radius:6px;align-items:center;gap:6px;height:28px;padding:0 4px 0 54px;display:flex}.wgSessionRow:hover{background:var(--dsw-bg-hover,#7f7f7f1f)}.wgSessionRow:hover .wgRowActions,.wgSessionRow:focus-within .wgRowActions{opacity:1}.wgSelected{background:var(--dsw-bg-selected,#4a90d92e)}.wgStatusSlot{flex:none;justify-content:center;align-items:center;width:14px;height:14px;display:inline-flex}.wgSessionTitle{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-secondary,var(--dsw-fg-2,inherit));flex:1;font-size:12px;overflow:hidden}.wgSelected .wgSessionTitle{color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));font-weight:500}.wgSessionTime{color:var(--dsw-fg-3,#7f7f7fcc);flex:none;font-size:11px}.wgVisuallyHidden{clip:rect(0 0 0 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.wgMatched{background:var(--dsw-bg-selected,#4a90d92e)}.wgSessionSnippet{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-fg-3,#7f7f7fcc);flex:1;font-size:11px;overflow:hidden}.wgSearchStatus{color:var(--dsw-fg-3,#7f7f7fcc);text-align:center;padding:8px;font-size:11px}.wgManualError{color:var(--dsw-fg-1,inherit);text-align:left;word-break:break-word}.wgSmallAction{border:1px solid var(--dsw-border-1,#7f7f7f55);color:inherit;font:inherit;cursor:pointer;background:0 0;border-radius:4px;padding:3px 6px;font-size:10.5px;line-height:1}.wgSmallAction:hover{border-color:var(--dsw-accent,#4c8dff)}.wgRail{flex-direction:column;align-items:center;gap:12px;padding:8px 0 0;display:flex;overflow:hidden}.wgRail .wgSectionHeader{flex-direction:column;align-self:center;align-items:center;gap:12px;width:36px;height:auto;padding:0}.wgRail .wgIconButton{border-radius:50%;width:36px;height:36px}.wgRail .wgTreeBody{display:none}.wgAddError{color:var(--dsw-fg-1,inherit);white-space:pre-wrap;word-break:break-word;max-height:200px;font-size:12px;overflow-y:auto}.wgRenameInput{border:1px solid var(--dsw-border,#7f7f7f4d);background:var(--dsw-bg-1,transparent);width:100%;color:var(--dsw-fg-1,inherit);border-radius:6px;outline:none;padding:6px 8px;font-size:13px}.wgRenameInput:focus{border-color:var(--dsw-accent,#4a90d9)}.wgFolderBody{flex-direction:column;gap:14px;display:flex}.wgFolderHead{flex-direction:column;gap:2px;min-width:0;display:flex}.wgFolderHeadName{color:var(--dsw-fg-1,inherit);text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;overflow:hidden}.wgFolderHeadPath{color:var(--dsw-alias-label-secondary,inherit);font-family:var(--dsw-font-mono,ui-monospace,SFMono-Regular,monospace);opacity:.65;text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.wgFolderSection{flex-direction:column;gap:6px;min-width:0;display:flex}.wgFolderSectionTitle{color:var(--dsw-alias-label-secondary,inherit);letter-spacing:.03em;opacity:.7;font-size:11px;font-weight:600}.wgFolderList{flex-direction:column;gap:4px;max-height:280px;margin:0 -2px;padding:2px;display:flex;overflow:auto}.wgFolderListRow{background:#7f7f7f1a;border:1px solid #0000;border-radius:8px;align-items:center;gap:8px;padding:7px 8px;transition:background .12s,border-color .12s;display:flex}.wgFolderListRow:hover{background:var(--dsw-bg-hover,#7f7f7f2e)}.wgFolderListRow[data-active=true]{border-color:var(--dsw-alias-border-l2,#7f7f7f40);background:var(--dsw-bg-hover,#7f7f7f1f)}.wgFolderRootPick{cursor:pointer;flex:none;align-items:center;display:inline-flex}.wgFolderRadio{appearance:none;border:1.5px solid var(--dsw-alias-border-l2,#7f7f7f80);cursor:pointer;background:0 0;border-radius:50%;place-content:center;width:14px;height:14px;margin:0;transition:border-color .12s;display:grid}.wgFolderRadio:hover,.wgFolderRadio:checked{border-color:var(--dsw-accent,#4a90d9)}.wgFolderRadio:checked:after{content:\"\";background:var(--dsw-accent,#4a90d9);border-radius:50%;width:7px;height:7px}.wgFolderRadio:focus-visible{outline:2px solid var(--dsw-accent,#4a90d9);outline-offset:2px}.wgFolderEntry{flex-direction:column;flex:auto;gap:1px;min-width:0;display:flex}.wgFolderListLabel{color:var(--dsw-fg-1,inherit);text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;font-weight:500;line-height:1.35;overflow:hidden}.wgFolderListPath{color:var(--dsw-alias-label-secondary,inherit);font-family:var(--dsw-font-mono,ui-monospace,SFMono-Regular,monospace);opacity:.6;text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:1.35;overflow:hidden}.wgFolderListTags{flex:none;align-items:center;gap:4px;display:inline-flex}.wgFolderListTag{border:1px solid var(--dsw-alias-border-l2,#7f7f7f40);color:var(--dsw-alias-label-secondary,inherit);white-space:nowrap;border-radius:999px;padding:2px 6px;font-size:10px;line-height:1.4}.wgFolderListTag[data-tone=base]{border-style:dashed}.wgFolderListTag[data-tone=root]{color:var(--dsw-fg-1,inherit);background:#4a90d92e;border-color:#0000}.wgFolderListTag[data-tone=cloud],.wgFolderListTag[data-tone=local]{opacity:.85}.wgFolderListTag[data-tone=danger]{color:#e08a8a;border-color:#d464644d}.wgFolderListActions{opacity:.5;flex:none;align-items:center;gap:2px;transition:opacity .12s;display:inline-flex}.wgFolderListRow:hover .wgFolderListActions,.wgFolderListRow:focus-within .wgFolderListActions{opacity:1}.wgFolderEmpty{border:1px dashed var(--dsw-alias-border-l2,#7f7f7f40);color:var(--dsw-alias-label-secondary,inherit);opacity:.75;border-radius:8px;margin:0;padding:10px 12px;font-size:11.5px;line-height:1.5}.wgFolderConfirm{border:1px solid var(--dsw-alias-border-l2,#7f7f7f40);border-radius:8px;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:4px 0 6px;padding:8px 10px;font-size:11.5px;line-height:1.5;display:flex}.wgFolderConfirmText{flex:220px}.wgFolderConfirmActions{gap:6px;display:flex}.wgFolderConfirmButton{border:1px solid var(--dsw-alias-border-l2,#7f7f7f40);color:inherit;font:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:3px 9px}.wgFolderConfirmButton[data-tone=danger]{color:var(--dsw-alias-status-danger,#d13438);border-color:var(--dsw-alias-status-danger,#d13438)}.wgFolderAdd{border-top:1px solid var(--dsw-alias-border-l2,#7f7f7f33);flex-direction:column;gap:8px;padding-top:12px;display:flex}.wgFolderSegmented{background:#7f7f7f29;border-radius:999px;align-self:flex-start;gap:2px;padding:2px;display:inline-flex}.wgFolderTab{color:var(--dsw-alias-label-secondary,inherit);font:inherit;cursor:pointer;white-space:nowrap;background:0 0;border:0;border-radius:999px;padding:4px 12px;font-size:12px;transition:background .12s,color .12s}.wgFolderTab:hover{color:var(--dsw-fg-1,inherit)}.wgFolderTab[aria-selected=true]{color:var(--dsw-fg-1,inherit);background:#ffffff2b;font-weight:600;box-shadow:inset 0 0 0 1px #ffffff1f}.wgFolderLocalPane{flex-direction:column;gap:6px;display:flex}.wgFolderPick{border:1px dashed var(--dsw-alias-border-l2,#7f7f7f59);width:100%;color:var(--dsw-fg-1,inherit);font:inherit;text-align:left;cursor:pointer;white-space:nowrap;background:0 0;border-radius:8px;align-items:center;gap:8px;padding:9px 12px;font-size:12.5px;font-weight:500;transition:border-color .12s,background .12s;display:flex}.wgFolderPick:hover:not(:disabled){border-color:var(--dsw-accent,#4a90d9);background:#4a90d91a}.wgFolderPick:disabled{opacity:.5;cursor:default}.wgFolderPickPlus{color:var(--dsw-accent,#4a90d9);flex:none;font-size:13px;line-height:1}.wgFolderHint{color:var(--dsw-alias-label-secondary,inherit);opacity:.7;margin:0;font-size:11px;line-height:1.55}.wgFolderActions{gap:6px;display:flex}.wgFolderActions>button{justify-content:center;width:100%}.wgFolderStack{flex-direction:column;gap:6px;display:flex}.wgFolderField{align-items:center;display:flex;position:relative}.wgFolderField .wgFolderFieldInput{width:100%;padding-right:30px}.wgFolderFieldAction{width:22px;height:22px;color:var(--dsw-fg-3,#a6abc4);cursor:pointer;background:0 0;border:0;border-radius:5px;justify-content:center;align-items:center;padding:0;display:inline-flex;position:absolute;top:50%;right:4px;transform:translateY(-50%)}.wgFolderFieldAction:hover:not(:disabled){background:var(--dsw-bg-hover,#ffffff1f);color:var(--dsw-fg-1,inherit)}.wgFolderFieldAction:disabled{opacity:.4;cursor:default}.wgFolderAddRow{align-items:center;gap:6px;margin-top:6px;display:flex}.wgFolderAddRow>button{white-space:nowrap;flex:none}.wgFolderNote{color:var(--dsw-alias-label-secondary,inherit);opacity:.8;margin:0;font-size:11px;line-height:1.5}.wgRemoteBar{align-items:center;gap:6px;margin-bottom:8px;display:flex}.wgRemotePath{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--dsw-font-mono,ui-monospace,monospace);color:var(--dsw-fg-1,inherit);flex:auto;font-size:12px;overflow:hidden}.wgRemoteActions{flex:none;gap:4px;display:inline-flex}.wgRemoteList{border:1px solid var(--dsw-alias-border-l2,#7f7f7f33);border-radius:8px;max-height:260px;margin:0 0 8px;padding:4px;overflow:auto}.wgRemoteRow{width:100%;color:var(--dsw-fg-1,inherit);font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:6px;align-items:center;gap:6px;padding:5px 6px;font-size:12px;display:flex}.wgRemoteRow:hover{background:var(--dsw-bg-hover,#7f7f7f1f)}.wgRemoteName{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.wgFolderSelect{flex:auto;width:100%;min-width:0}.wgFolderSubpathInput{border:1px solid var(--dsw-alias-border-l2,#7f7f7f40);background:var(--dsw-alias-bg-base,transparent);min-width:0;color:inherit;font:inherit;border-radius:6px;flex:auto;padding:4px 8px;font-size:13px}.wgFolderSubpathInput:focus{border-color:var(--dsw-alias-label-primary,currentColor);outline:none}.wgAppearanceBody{flex-direction:column;gap:16px;display:flex}.wgAppearanceDialog{max-height:100%}.wgAppearanceContent{min-height:0;overflow:hidden auto}.wgAppearanceContent>:first-child{z-index:1;background:var(--dsw-alias-bg-layer-2,transparent);position:sticky;top:0}.wgAppearanceSection{flex-direction:column;gap:6px;display:flex}.wgAppearanceLabel{color:var(--dsw-fg-3,#7f7f7fcc);font-size:11px;font-weight:600}.wgSwatchRow{flex-wrap:wrap;gap:6px;display:flex}.wgSwatch{cursor:pointer;border:1px solid var(--dsw-alias-border-l2,#7f7f7f47);border-radius:5px;width:20px;height:20px;padding:0}.wgSwatch[data-wg-color]{background:var(--wg-group-tint)}.wgSwatch:disabled{cursor:default;opacity:.5}.wgSwatchActive{outline:2px solid var(--dsw-accent,#4a90d9);outline-offset:1px}.wgSwatchDefault{background:var(--dsw-bg-hover,#7f7f7f1f)}.wgIconSections{scrollbar-gutter:stable;flex-direction:column;gap:10px;max-height:216px;padding:4px;display:flex;overflow-y:auto}.wgIconSection{flex-direction:column;gap:4px;display:flex}.wgIconSectionLabel{color:var(--dsw-fg-3,#7f7f7fcc);font-size:11px;font-weight:600;line-height:14px}.wgIconGrid{grid-template-columns:repeat(auto-fill,minmax(28px,1fr));gap:4px;padding:1px;display:grid}.wgEmojiGrid .wgIconCell{font-size:18px}.wgIconCustom{align-items:center;gap:8px;margin-top:2px;display:flex}.wgIconCustom .wgRenameInput{flex:1;min-width:0}.wgIconCell.wgIconDefault{width:auto;padding:0 8px}.wgIconCell{cursor:pointer;color:var(--dsw-fg-2,inherit);background:0 0;border:0;border-radius:5px;justify-content:center;align-items:center;width:28px;height:28px;padding:0;display:inline-flex}.wgIconCell:hover:not(:disabled){background:var(--dsw-bg-hover,#7f7f7f1f)}.wgIconCell[aria-pressed=true]{background:var(--dsw-bg-selected,#4a90d92e);box-shadow:inset 0 0 0 1px var(--dsw-accent,#4a90d9)}.wgIconCell:focus-visible{outline:2px solid var(--dsw-accent,#4a90d9);outline-offset:1px}.wgIconCell:disabled{cursor:default;opacity:.5}.wgQuickOverlay{z-index:1100;background:var(--dsw-alias-bg-mask-1,#00000052);backdrop-filter:var(--dsw-mask-blur,blur(2px));justify-content:center;align-items:flex-start;padding:10vh 24px 24px;display:flex;position:fixed;inset:0}.wgQuickCard{border:1px solid var(--dsw-border,#7f7f7f33);background:var(--dsw-alias-bg-layer-2,var(--dsw-bg-1,#fff));width:min(640px,100%);max-height:min(560px,90vh - 48px);box-shadow:var(--dsw-elevation-prominent,0 16px 48px #00000040);box-sizing:border-box;border-radius:12px;flex-direction:column;gap:10px;padding:14px;display:flex;overflow:hidden}.wgQuickHeader{flex:none;justify-content:space-between;align-items:center;gap:12px;display:flex}.wgQuickTitle{color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));font-size:13px;font-weight:600}.wgQuickTabs{gap:2px;display:flex}.wgQuickTab{color:var(--dsw-alias-label-secondary,var(--dsw-fg-2,inherit));cursor:pointer;background:0 0;border:none;border-radius:6px;align-items:center;gap:6px;padding:4px 12px;font-family:inherit;font-size:12px;display:inline-flex}.wgQuickTab:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-bg-hover,#7f7f7f1f))}.wgQuickTabActive{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-bg-selected,#4a90d92e));color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));font-weight:600}.wgQuickTabCount{background:var(--dsw-accent,#4a90d9);color:#fff;text-align:center;border-radius:8px;min-width:16px;height:16px;padding:0 4px;font-size:10px;font-weight:600;line-height:16px}.wgQuickSearchWrap{flex:none}.wgQuickSearch{border:1px solid var(--dsw-border,#7f7f7f4d);background:var(--dsw-bg-1,transparent);width:100%;height:34px;color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));box-sizing:border-box;border-radius:8px;outline:none;padding:0 10px;font-family:inherit;font-size:13px}.wgQuickSearch:focus{border-color:var(--dsw-accent,#4a90d9)}.wgQuickList{flex-direction:column;flex:auto;gap:2px;min-height:64px;padding-right:2px;display:flex;overflow-y:auto}.wgQuickRow{cursor:pointer;text-align:left;box-sizing:border-box;background:0 0;border:none;border-radius:8px;flex-direction:column;flex:none;gap:2px;width:100%;padding:7px 10px;font-family:inherit;display:flex}.wgQuickRow:hover,.wgQuickRowActive{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-bg-hover,#7f7f7f1f))}.wgQuickRowSelected,.wgQuickRowCurrent{background:var(--dsw-bg-selected,#4a90d92e)}.wgQuickRowMain{align-items:center;gap:8px;width:100%;min-width:0;display:flex}.wgQuickRowTitle{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));flex:1;font-size:13px;font-weight:500;overflow:hidden}.wgQuickRunBadge{color:var(--dsw-accent,#4a90d9);flex:none;font-size:11px}.wgQuickTime{color:var(--dsw-alias-label-secondary,var(--dsw-fg-3,#7f7f7fcc));flex:none;font-size:11px}.wgQuickRowSub{min-width:0;display:flex}.wgQuickRowPath{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-secondary,var(--dsw-fg-3,#7f7f7fcc));flex:1;font-size:11px;overflow:hidden}.wgQuickEmpty{text-align:center;color:var(--dsw-alias-label-secondary,var(--dsw-fg-3,#7f7f7fcc));padding:24px 8px;font-size:12px}.wgQuickFooter{flex:none;align-items:center;gap:8px;padding-top:2px;display:flex}.wgQuickSelected{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-secondary,var(--dsw-fg-3,#7f7f7fcc));flex:1;font-size:12px;overflow:hidden}.wgQuickHint{text-align:center;color:var(--dsw-alias-label-secondary,var(--dsw-fg-3,#7f7f7fcc));flex:none;font-size:11px}.wgTabs{box-sizing:border-box;border-bottom:1px solid var(--dsw-alias-border-l2,#7f7f7f33);background:0 0;flex:none;align-items:stretch;gap:4px;min-width:0;height:56px;padding:8px 10px;display:flex}.wgTabsScroll{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;box-sizing:border-box;flex:auto;align-items:stretch;gap:6px;min-width:0;padding:1px 0;display:flex;overflow:auto hidden}.wgTabsScroll::-webkit-scrollbar{width:0;height:0;display:none}.wgTab{min-width:0;max-width:240px;box-shadow:inset 0 0 0 1px var(--dsw-alias-border-l2,#7f7f7f2e);color:var(--dsw-alias-label-secondary,var(--dsw-fg-2,inherit));border-radius:8px;flex:none;align-items:center;padding:0 6px 0 10px;transition:background .12s,box-shadow .12s;display:inline-flex}.wgTabText{flex-direction:column;flex:auto;justify-content:center;align-items:flex-start;gap:3px;min-width:0;height:100%;display:flex}.wgTabProject{text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:100%;font-family:var(--dsw-font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);letter-spacing:.02em;color:var(--dsw-alias-label-secondary,var(--dsw-fg-3,inherit));opacity:.85;flex:none;font-size:10px;line-height:13px;overflow:hidden}.wgTab:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-bg-hover,#7f7f7f1f))}.wgTabActive{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-bg-hover,#7f7f7f1f));box-shadow:inset 0 0 0 1px var(--dsw-alias-label-secondary,#7f7f7f73);color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit))}.wgTabActive .wgTabProject{opacity:1}.wgTabMain{box-sizing:border-box;min-width:0;height:100%;color:inherit;cursor:pointer;background:0 0;border:none;flex:auto;align-items:center;gap:8px;padding:6px 0;font-family:inherit;font-size:12px;display:inline-flex}.wgTabStatus{flex:none;justify-content:center;align-items:center;width:12px;height:12px;display:inline-flex}.wgTabStatus[data-tab-state=idle]{opacity:.45}.wgTabLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;max-width:100%;color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));flex:none;font-size:12px;line-height:16px;overflow:hidden}.wgTabText>.wgTabLabel:only-child{align-self:center}.wgTabClose{width:20px;height:20px;color:inherit;cursor:pointer;opacity:0;background:0 0;border:none;border-radius:5px;flex:none;justify-content:center;align-items:center;margin-left:2px;padding:0;transition:opacity .12s,background .12s;display:inline-flex}.wgTab:hover .wgTabClose,.wgTab:focus-within .wgTabClose,.wgTabActive .wgTabClose{opacity:1}.wgTabClose:hover{background:var(--dsw-alias-interactive-bg-hover-solid,#7f7f7f33)}.wgTab{position:relative}.wgTabPinned{box-shadow:inset 0 0 0 1px var(--dsw-alias-label-secondary,#7f7f7f73)}.wgTabPin{opacity:.55;width:12px;height:12px;color:inherit;flex:none;justify-content:center;align-items:center;margin-left:4px;display:inline-flex}.wgTabDragging{opacity:.42}.wgTabDropBefore:before,.wgTabDropAfter:before{content:\"\";background:var(--dsw-alias-label-primary,var(--dsw-fg-1,#4a90d9));border-radius:2px;width:2px;position:absolute;top:2px;bottom:2px}.wgTabDropBefore:before{left:-4px}.wgTabDropAfter:before{right:-4px}.wgTabRename{box-sizing:border-box;min-width:88px;height:100%;color:inherit;background:var(--dsw-alias-bg-elevated,var(--dsw-bg-1,transparent));border:1px solid var(--dsw-alias-label-secondary,#7f7f7f73);border-radius:6px;outline:none;flex:auto;margin:2px 0;padding:0 6px;font-family:inherit;font-size:12px}.wgTabMenu{z-index:2147483000;box-sizing:border-box;background:var(--dsw-alias-bg-popup,var(--dsw-bg-2,#1e1e1e));border:1px solid var(--dsw-alias-border-l2,#7f7f7f33);border-radius:8px;flex-direction:column;min-width:196px;padding:4px;display:flex;position:fixed;box-shadow:0 8px 24px #0003,0 1px 2px #0000001f}.wgTabMenuItem{width:100%;color:var(--dsw-alias-label-primary,var(--dsw-fg-1,inherit));text-align:left;cursor:pointer;background:0 0;border:none;border-radius:5px;padding:6px 10px;font-family:inherit;font-size:12px;line-height:16px}.wgTabMenuItem:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,var(--dsw-bg-hover,#7f7f7f1f))}.wgTabMenuItem:disabled{cursor:default;opacity:.4}.wgTabMenuDanger{color:var(--dsw-alias-label-error,var(--dsw-fg-error,#d9534f))}.wgTabMenuSeparator{background:var(--dsw-alias-border-l2,#7f7f7f33);height:1px;margin:4px 6px}"; // src/client/GroupsBrowser.tsx /** * The workspace-groups browsing region filling the sidebar shell's @@ -5998,6 +6033,14 @@ window.__ModuleLoader__.load({ const [manualError, setManualError] = (0, react.useState)(null); const [manualSaving, setManualSaving] = (0, react.useState)(false); const [foldersDoc, setFoldersDoc] = (0, react.useState)(EMPTY_FOLDERS_DOCUMENT); + const [foldersPhase, setFoldersPhase] = (0, react.useState)("loading"); + const [foldersError, setFoldersError] = (0, react.useState)(null); + const [foldersRetryToken, setFoldersRetryToken] = (0, react.useState)(0); + const [foldersConflict, setFoldersConflict] = (0, react.useState)(null); + const foldersConfirmedRef = (0, react.useRef)(EMPTY_FOLDERS_DOCUMENT); + const foldersHasDataRef = (0, react.useRef)(false); + const foldersPendingRef = (0, react.useRef)(null); + const foldersSavingRef = (0, react.useRef)(false); const [collapsedFolderKeys, setCollapsedFolderKeys] = (0, react.useState)([]); const [foldersTarget, setFoldersTarget] = (0, react.useState)(null); const [foldersBusy, setFoldersBusy] = (0, react.useState)(false); @@ -6006,15 +6049,51 @@ window.__ModuleLoader__.load({ const [foldersRemoteBase, setFoldersRemoteBase] = (0, react.useState)(null); (0, react.useEffect)(() => { let cancelled = false; - loadFolders().then((snapshot) => { + const controller = new AbortController(); + let timer = null; + let retries = 0; + const attempt = async () => { + const snapshot = await loadFolders(fetch, controller.signal); if (cancelled) return; - setFoldersDoc(snapshot.document); - setFoldersRemoteBase(snapshot.remoteBase ?? null); - }); + if (snapshot.error === "aborted") return; + if (snapshot.ok) { + foldersConfirmedRef.current = snapshot.document; + foldersHasDataRef.current = true; + setFoldersDoc(snapshot.document); + setFoldersRemoteBase(snapshot.remoteBase ?? null); + setFoldersPhase("ready"); + setFoldersError(null); + return; + } + const reason = snapshot.error ?? "unknown error"; + if (foldersHasDataRef.current) { + setFoldersPhase("ready"); + setFoldersError(reason); + } else { + setFoldersPhase("error"); + setFoldersError(reason); + } + if (retries < 5) { + const delay = Math.min(15e3, 1e3 * 2 ** retries); + retries += 1; + timer = setTimeout(() => { + attempt(); + }, delay); + } + }; + attempt(); + const onOnline = () => { + retries = 0; + attempt(); + }; + window.addEventListener("online", onOnline); return () => { cancelled = true; + controller.abort(); + if (timer !== null) clearTimeout(timer); + window.removeEventListener("online", onOnline); }; - }, []); + }, [foldersRetryToken]); const workspaces = useWorkspaces((state) => state.items); const workspacePhase = useWorkspaces((state) => state.phase); const archivedSessionIds = useWorkspaces((state) => state.archivedSessionIds); @@ -6418,18 +6497,67 @@ window.__ModuleLoader__.load({ text }); }; - const persistFolders = (next) => { - setFoldersDoc(next); - saveFolders(next).then((stored) => { - setFoldersDoc(stored); - }).catch((reason) => { - if (reason instanceof FoldersConflictError) { - setFoldersDoc(reason.current); - notifyFolder(t("folder.conflict")); - return; + /** + * Serialize folder saves. A save always sends the LAST confirmed revision and + * the latest pending document; a newer edit made while a request is in flight + * is coalesced and sent only after the previous result settles. This keeps an + * older response from ever overwriting a newer state. + */ + const drainFolders = async () => { + if (foldersSavingRef.current) return; + foldersSavingRef.current = true; + try { + while (foldersPendingRef.current !== null) { + const draft = foldersPendingRef.current; + foldersPendingRef.current = null; + const payload = { + ...draft, + revision: foldersConfirmedRef.current.revision ?? 0 + }; + try { + const stored = await saveFolders(payload); + foldersConfirmedRef.current = stored; + setFoldersError(null); + if (foldersPendingRef.current === null) setFoldersDoc(stored); + } catch (reason) { + if (reason instanceof FoldersConflictError) { + foldersConfirmedRef.current = reason.current; + setFoldersDoc(reason.current); + setFoldersConflict({ + current: reason.current, + draft: reason.attempted ?? draft + }); + notifyFolder(t("folder.conflict")); + } else { + const detail = reason instanceof Error ? reason.message : String(reason); + setFoldersDoc(foldersConfirmedRef.current); + notifyFolder(`${t("folder.saveError")}: ${detail}`); + } + foldersPendingRef.current = null; + break; + } } - const detail = reason instanceof Error ? reason.message : String(reason); - notifyFolder(`${t("folder.saveError")}: ${detail}`); + } finally { + foldersSavingRef.current = false; + if (foldersPendingRef.current !== null) drainFolders(); + } + }; + const persistFolders = (next) => { + if (foldersPhase !== "ready") { + notifyFolder(t("folder.notReady")); + return; + } + foldersPendingRef.current = next; + setFoldersDoc(next); + drainFolders(); + }; + const retryFolderConflict = () => { + if (foldersConflict === null) return; + const draft = foldersConflict.draft; + setFoldersConflict(null); + persistFolders({ + ...draft, + revision: foldersConflict.current.revision ?? 0 }); }; /** @@ -7313,6 +7441,86 @@ window.__ModuleLoader__.load({ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { className: "wgTreeBody", children: [ + foldersPhase === "loading" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { + className: "wgSearchStatus", + role: "status", + children: t("folder.loadingState") + }), + foldersPhase === "error" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { + className: "wgSearchStatus wgManualError", + role: "alert", + children: [ + t("folder.loadError"), + ":", + foldersError, + " ", + /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { + type: "button", + className: "wgSmallAction", + onClick: () => { + setFoldersRetryToken((value) => value + 1); + }, + children: t("folder.retry") + }) + ] + }), + foldersPhase === "ready" && foldersError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { + className: "wgSearchStatus", + role: "status", + children: [ + t("folder.refreshError"), + ":", + foldersError, + " ", + /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { + type: "button", + className: "wgSmallAction", + onClick: () => { + setFoldersRetryToken((value) => value + 1); + }, + children: t("folder.retry") + }) + ] + }), + foldersConflict !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { + className: "wgSearchStatus wgManualError", + role: "alert", + children: [ + /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: t("folder.conflictDetail") }), + /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { + style: { + marginTop: "4px", + fontSize: "10.5px" + }, + children: [ + "server revision ", + foldersConflict.current.revision ?? 0, + " · draft revision ", + foldersConflict.draft.revision ?? 0 + ] + }), + /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { + style: { marginTop: "4px" }, + children: [ + /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { + type: "button", + className: "wgSmallAction", + onClick: retryFolderConflict, + children: t("folder.retryDraft") + }), + " ", + /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", { + type: "button", + className: "wgSmallAction", + onClick: () => { + setFoldersConflict(null); + }, + children: t("folder.discardDraft") + }) + ] + }) + ] + }), configError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "wgSearchStatus", role: "status", @@ -7327,7 +7535,7 @@ window.__ModuleLoader__.load({ manualError ] }), - wide && normalizedQuery !== "" && searchTreeForBody !== void 0 && searchMatches !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchBody, { + foldersPhase !== "ready" ? null : wide && normalizedQuery !== "" && searchTreeForBody !== void 0 && searchMatches !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchBody, { tree: searchTreeForBody, matches: searchMatches, status: activeRemoteSearch.status, @@ -8384,6 +8592,13 @@ window.__ModuleLoader__.load({ "folder.home": "主目录", "folder.refresh": "刷新", "folder.loading": "正在读取远端目录…", + "folder.loadingState": "正在读取文件夹配置…", + "folder.loadError": "文件夹配置读取失败(未显示为空分组)", + "folder.refreshError": "文件夹配置刷新失败,继续显示上次确认的配置", + "folder.retry": "重试", + "folder.retryDraft": "重新应用我的修改", + "folder.discardDraft": "保留服务端版本", + "folder.conflictDetail": "文件夹已被另一个窗口修改:下面是服务端当前版本;你未保存的修改仍保留在此处,可重新应用。", "folder.emptyDir": "这个目录下没有子目录", "group.create": "新建分组", "group.createTitle": "新建分组", @@ -8567,6 +8782,13 @@ window.__ModuleLoader__.load({ "folder.home": "Home", "folder.refresh": "Refresh", "folder.loading": "Reading the remote directory…", + "folder.loadingState": "Reading folder configuration…", + "folder.loadError": "Could not read folder configuration (not shown as an empty grouping)", + "folder.refreshError": "Could not refresh folder configuration; showing the last confirmed state", + "folder.retry": "Retry", + "folder.retryDraft": "Reapply my changes", + "folder.discardDraft": "Keep server version", + "folder.conflictDetail": "Folders changed in another window. The server version is shown below; your unsaved changes are kept here and can be reapplied.", "folder.emptyDir": "No subdirectories here", "group.create": "New group", "group.createTitle": "New group", @@ -10550,45 +10772,54 @@ window.__ModuleLoader__.load({ }; } catch (e) {} var watchedRootLabels = []; + var rootLabels = {}; + function normRemotePath(value) { + return String(value == null ? "" : value).replace(/[\\/]+$/, ""); + } function refreshRootLabels(workspaces) { var next = {}; for (var i = 0; i < (workspaces || []).length; i++) { var w = workspaces[i] || {}; - var mirror = String(w.mirrorPath || "").replace(/[\\/]+$/, ""); - var remote = String(w.remotePath || "").replace(/[\\/]+$/, ""); + var mirror = normRemotePath(w.mirrorPath); + var remote = normRemotePath(w.remotePath); if (!mirror || !remote) continue; - var mb = mirror.split(/[\\/]/).pop(); - var rb = remote.split(/[\\/]/).pop(); - if (mb && rb && mb !== rb) next[mb] = { - label: rb, - remotePath: remote + var label = normTitle(w.title) || remote.split(/[\\/]/).pop(); + if (label) next[mirror] = { + label, + remotePath: remote, + mirrorPath: mirror }; } rootLabels = next; } - /** 根行判据:自身或 ≤3 层祖先带内联 padding-left:6px(better-sidebar 根行样式)。 */ - function isRootRow(el) { - var node = el; - for (var hop = 0; hop < 3 && node; hop++) { - var style = node.getAttribute ? node.getAttribute("style") : null; - if (style && /padding-left:\s*6px/i.test(String(style))) return true; - node = node.parentElement; - } - return false; + /** The root row's own full path, from the explicit attributes only. */ + function rootPathOf(el) { + var explicit = el && el.getAttribute ? el.getAttribute("data-rssh-root-mirror") : null; + if (explicit) return normRemotePath(explicit); + var title = el && el.getAttribute ? el.getAttribute("title") : null; + return title ? normRemotePath(title) : ""; } - /** 单个标签替换:纯文本 + 命中镜像 basename + 位于根行 → 换成远程目录名。 */ + /** Direct leaf that prints the folder name (no nested markup). */ + function rootLabelSpanOf(el) { + var children = el && el.children ? el.children : []; + for (var i = 0; i < children.length; i++) if (String(children[i].tagName || "").toLowerCase() === "span" && children[i].childElementCount === 0) return children[i]; + return null; + } + /** Exact full-path hit → replace only the leaf name span. */ function fixRootLabel(el) { - var text = (el.textContent || "").trim(); - if (!text) return false; - var hit = rootLabels[text]; - if (hit === void 0) return el.getAttribute && el.getAttribute("data-rssh-root-label") === "1"; - if (el.childElementCount > 0) return false; - if (!isRootRow(el)) return false; - el.textContent = hit.label; - if (el.setAttribute) { - el.setAttribute("data-rssh-root-label", "1"); - el.setAttribute("title", hit.remotePath); - } + if (!el || !el.getAttribute) return false; + var path = rootPathOf(el); + if (!path) return false; + var hit = rootLabels[path]; + if (hit === void 0) return false; + var span = rootLabelSpanOf(el); + if (!span) return false; + var base = path.split(/[\\/]/).pop(); + if (normTitle(span.textContent) !== base && el.getAttribute("data-rssh-root-label") !== "1") return false; + span.textContent = hit.label; + el.setAttribute("data-rssh-root-label", "1"); + el.setAttribute("data-rssh-root-mirror", hit.mirrorPath); + el.setAttribute("title", hit.remotePath); watchRootLabel(el); return true; } @@ -10609,7 +10840,7 @@ window.__ModuleLoader__.load({ function applyRootLabelsIn(root) { if (!root || !root.querySelectorAll) return; try { - var nodes = root.querySelectorAll("span,div"); + var nodes = root.querySelectorAll("[title]"); for (var i = 0; i < nodes.length; i++) fixRootLabel(nodes[i]); if (root.nodeType === 1) fixRootLabel(root); } catch (e) {} diff --git a/lib/client.js.map b/lib/client.js.map index d8e50ce..4d388db 100644 --- a/lib/client.js.map +++ b/lib/client.js.map @@ -1 +1 @@ -{"version":3,"file":"client.js","names":["defineStore","defineStore","useRef","useCallback","useSyncExternalStore","IconFolderCloseMedium","IconWorkspaceTreeOutlineMedium","IconCodeOutlineMedium","IconCordisPluginOutlineMedium","IconSkillOutlineMedium","IconDataOutlineMedium","IconDatabaseOutlineMedium","IconApiOutlineMedium","IconPlanOutlineMedium","IconGoalOutlineMedium","IconLightOutlineMedium","IconGlobeOutlineMedium","IconArchiveOutlineMedium","IconBranchOutlineMedium","IconUsersOutlineMedium","IconClockOutlineMedium","IconShieldOutlineMedium","IconChecklistOutlineMedium","IconSparkleMedium","IconTreeCornerMedium","IconNewChatOutlineMedium","IconSearchOutlineMedium","IconSettingsOutlineMedium","IconDeliverDocMedium","IconEditOutlineMedium","IconThinkOutlineMedium","IconAgentPresetOutlineMedium","IconBrowseOutlineMedium","IconContextInjectionOutlineMedium","IconLinkOutlineMedium","IconShareOutlineMedium","IconUserOutlineMedium","IconPaperPlaneOutlineMedium","IconPaperclipOutlineMedium","IconDownloadOutlineMedium","IconPlayOutlineMedium","IconPersonalizationOutlineMedium","IconDarkOutlineMedium","IconFollowsystemOutlineMedium","IconGaugeOutlineMedium","IconQueueOutlineMedium","IconListPenOutlineMedium","IconInspectOutlineMedium","IconQuestionOutlineMedium","IconInfoOutlineMedium","IconAlarmClockOutlineMedium","IconCompareSplitOutlineMedium","IconCheckCircleOutlineMedium","IconPinOutlineMedium","IconMicrophoneOutlineMedium","useState","IconPinFillMedium","IconPinOutlineRegular","IconSlidersTwoOutlineRegular","IconEditOutlineRegular","IconTrashOutlineRegular","IconFolderOpenMedium","IconPlusOutlineRegular","Menu","IconEllipsisOutlineRegular","IconFolderOpenOutlineRegular","IconRightUpOutlineRegular","IconProjectAddOutlineMedium","useRef","IconBranchOutlineRegular","IconArchiveOutlineRegular","StateDot","useState","Modal","Button","IconFolderOpenOutlineRegular","IconTrashOutlineRegular","useState","useRef","useMemo","createPortal","Button","StateDot","useMemo","useState","useRef","StateDot","IconPinFillMedium","Tooltip","IconCloseFillMedium","createPortal","css","useState","useRef","useMemo","IconSearchOutlineRegular","IconCloseFillMedium","Tooltip","IconFolderOpenOutlineRegular","IconProjectAddOutlineRegular","Modal","Button","Toast","IconWarningOutlineRegular","apply","require","remoteSshFactory"],"sources":["../src/client/store-core.ts","../src/client/stores.ts","../src/client/tabs.ts","../src/client/tab-store.ts","../src/client/tab-persist.ts","../src/client/store-hook.ts","../src/core/types.ts","../src/core/matcher.ts","../src/client/subagent-lineage.ts","../src/core/default-workspace.ts","../src/core/folders.ts","../src/client/tree.ts","../src/client/FlowerBranch.tsx","../src/client/group-icons-science.tsx","../src/client/rows.tsx","../src/client/group-icon-labels.ts","../src/client/folders-persist.ts","../src/client/folder-directory.ts","../src/client/open-folder.ts","../src/client/FoldersDialog.tsx","../src/client/quick.ts","../src/client/QuickPanel.tsx","../src/client/tab-seat.ts","../src/client/SessionTabs.tsx","../src/client/GroupsBrowser.tsx","../src/client/directory-flow.ts","../src/client/locales.ts","../src/client/groups-client.ts","../src/client/remote-ssh-factory.generated.mjs","../src/client/index.ts"],"sourcesContent":["/**\n * Pure expansion-state transforms for the workspace-groups store. Kept free\n * of any runtime import so both the store (which binds them via defineStore)\n * and unit tests (which exercise them directly) share one implementation.\n *\n * Expansion semantics follow the official ui-workspace store: collapse\n * WRITES `false` (never deletes the key). The browser's auto-expand guard\n * uses `Object.hasOwn` — a present `false` means \"user deliberately\n * collapsed this\" and must NOT be re-expanded; only a fully absent key means\n * \"never touched\" and may auto-expand. (Earlier versions deleted the key on\n * collapse, which made the current category/workspace impossible to fold.)\n */\n\n/** Workspace-groups browser viewing state persisted across surface remounts and reloads. */\nexport interface GroupsViewState {\n /** Category folder expansion keyed by category label (absent = never touched). */\n categoryExpansion: Record\n /** Workspace folder expansion keyed by workspace id (absent = never touched). */\n workspaceExpansion: Record\n}\n\n/** Collapse writes `false` (key retained); expand writes `true`. */\nexport function setCategoryExpandedImpl(state: GroupsViewState, key: string, expanded: boolean): void {\n state.categoryExpansion[key] = expanded\n}\n\n/** Collapse writes `false` (key retained); expand writes `true`. */\nexport function setWorkspaceExpandedImpl(state: GroupsViewState, key: string, expanded: boolean): void {\n state.workspaceExpansion[key] = expanded\n}\n\n/** Drop expansion keys that no longer exist (renames/deletes/config edits). */\nexport function retainKeysImpl(\n state: GroupsViewState,\n categoryKeys: readonly string[],\n workspaceKeys: readonly string[],\n): void {\n state.categoryExpansion = Object.fromEntries(\n Object.entries(state.categoryExpansion).filter(([key]) => categoryKeys.includes(key)),\n )\n state.workspaceExpansion = Object.fromEntries(\n Object.entries(state.workspaceExpansion).filter(([key]) => workspaceKeys.includes(key)),\n )\n}\n","/**\n * The workspace-groups viewing store: category / workspace folder expansion,\n * persisted across reloads under an independent key (the official\n * ui-workspace store keeps its own `dsh.workspace.view.v5` — we never touch\n * it). Module level exports the factory only (a module-level handle would pin\n * the store identity across plugin reloads); register() receives the factory\n * and the browser derives its PropsStore share from the return type.\n *\n * The action implementations live in `store-core.ts` (pure, runtime-free) so\n * unit tests exercise the real semantics without a browser module loader;\n * this file only binds them through defineStore.\n */\nimport { defineStore, type EngineStoreHandle } from '@deepseek-ai/dsh-client-store'\nimport {\n retainKeysImpl,\n setCategoryExpandedImpl,\n setWorkspaceExpandedImpl,\n type GroupsViewState,\n} from './store-core.ts'\n\n/** Annotation twin of the actions literal below (structural type, satisfies `ActionsDecl`). */\ntype GroupsViewActions = {\n setCategoryExpanded: typeof setCategoryExpandedImpl\n setWorkspaceExpanded: typeof setWorkspaceExpandedImpl\n retainKeys: typeof retainKeysImpl\n}\n\n/**\n * Create the workspace-groups viewing store handle.\n * @returns the store handle (spec + type + identity + factory in one).\n */\nexport function createGroupsViewStore(): EngineStoreHandle {\n return defineStore({\n init: () => ({ categoryExpansion: {}, workspaceExpansion: {} }),\n persist: 'dsh.workspace.groups.view.v1',\n actions: {\n setCategoryExpanded: setCategoryExpandedImpl,\n setWorkspaceExpanded: setWorkspaceExpandedImpl,\n retainKeys: retainKeysImpl,\n },\n })\n}\n\nexport type { GroupsViewState } from './store-core.ts'\n","/**\n * Pure session-tab state: the ordered strip of sessions the user has opened,\n * the active one, and each tab's derived presentation.\n *\n * Position model: a tab's place in the strip is decided when it is first opened\n * and otherwise only moves when the USER moves it. Switching to a tab, or\n * re-opening a session that already has one, leaves the strip exactly as it was\n * — so clicking a chip never moves the chip out from under the pointer. The\n * order changes on: a session opening for the FIRST time (append), a tab closing\n * (remove), a drag (move), and a pin toggle (which carries the chip across the\n * pinned boundary).\n *\n * The array IS the display order, with one invariant the transforms maintain:\n * every pinned tab sits before every unpinned one. New tabs therefore append at\n * the end (the unpinned block) and pinning/unpinning re-inserts at the boundary\n * between the two blocks. A stored strip from an older build has no `pinned`\n * flag, which reads as \"unpinned\" and satisfies the invariant as-is.\n *\n * Runtime-free on purpose (same discipline as `store-core.ts` / `quick.ts`):\n * the component owns the ref + React state, this module owns every rule, and\n * unit tests exercise the real semantics without a browser module loader.\n *\n * Retention note: a tab outlives whatever it points at. The strip is a list of\n * things the USER opened, so nothing here consults the session catalog — a tab\n * whose session is gone stays visible until the user closes it, and no\n * background sweep ever trims the strip.\n */\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\nimport type { SessionSummary } from '@deepseek-ai/dsh-api-session-controller/client'\nimport type { SessionStatus } from '@deepseek-ai/dsh-client-ui-session/client'\n\n/** One open tab: a session id plus its arrival key (React list identity). */\nexport interface SessionTab {\n /** The session the tab shows. */\n readonly sessionId: SessionId\n /**\n * Monotonic arrival key. It doubles as the React `key`, so it must stay\n * attached to the session for the tab's whole life — a reused key would make\n * React move an existing chip's DOM node instead of reconciling it in place.\n */\n readonly order: number\n /**\n * Pinned tabs stay at the front of the strip and survive `close others`.\n *\n * Absent means unpinned: that is both the `false` case and the shape an older\n * build's stored strip has, so no migration step is needed to read one back.\n */\n readonly pinned?: boolean\n /**\n * A label the user typed for THIS tab, overriding the session's title.\n *\n * Kept separate from the session title on purpose: renaming a tab here must\n * not rewrite the conversation's own name (which the sidebar and the search\n * results show). Absent/empty means \"follow the session\".\n */\n readonly title?: string\n}\n\n/** Feature switch: whether opening a session also surfaces a tab. */\nexport type TabOpenMode = 'auto' | 'manual'\n\n/** Per-tab indicator derived from the catalog summary and the live UI status. */\nexport interface SessionTabIndicator {\n /** A domain request is waiting for the user (approval / plan review / question). */\n readonly attention: boolean\n /** The agent is producing output, or a descendant subagent is. */\n readonly running: boolean\n /** The turn finished while the tab was in the background and was never looked at. */\n readonly unread: boolean\n /** Idle tab whose session already has a title (a settled conversation). */\n readonly settled: boolean\n}\n\n/**\n * Add a session to the strip, or leave an existing entry exactly where it is.\n *\n * Arrival order is the strip's only order, so re-opening a session that already\n * has a tab is a NO-OP: the tab keeps its position and its arrival key. Moving\n * it to the front here would fight the whole point of stable positions — a user\n * clicking through sessions would watch the strip reshuffle on every click.\n *\n * @param tabs - current strip (oldest first).\n * @param sessionId - arriving session.\n * @param nextOrder - monotonic arrival counter to spend when appending.\n * @returns the strip, unchanged (same array) when the session already has a tab.\n */\nexport function appendTab(tabs: readonly SessionTab[], sessionId: SessionId, nextOrder: number): SessionTab[] {\n const existing = tabs.find(tab => tab.sessionId === sessionId)\n if (existing !== undefined) return tabs as SessionTab[]\n return [...tabs, { sessionId, order: nextOrder }]\n}\n\n/**\n * Remove one session's tab. An absent session leaves the strip untouched.\n * @param tabs - current strip.\n * @param sessionId - session whose tab closes.\n * @returns a new strip.\n */\nexport function removeTab(tabs: readonly SessionTab[], sessionId: SessionId): SessionTab[] {\n return tabs.filter(tab => tab.sessionId !== sessionId)\n}\n\n/**\n * Whether a tab is pinned (absent counts as unpinned).\n * @param tab - the tab.\n * @returns true when the tab belongs in the pinned block.\n */\nfunction isPinned(tab: SessionTab): boolean {\n return tab.pinned === true\n}\n\n/**\n * Count the leading pinned block.\n *\n * The transforms keep every pinned tab before every unpinned one, so the pinned\n * block is always a prefix and its length is the single index that separates\n * the two blocks — which is exactly where a chip lands when it changes sides.\n *\n * @param tabs - strip in display order.\n * @returns how many leading tabs are pinned.\n */\nexport function pinnedCount(tabs: readonly SessionTab[]): number {\n let count = 0\n while (count < tabs.length && isPinned(tabs[count] as SessionTab)) count += 1\n return count\n}\n\n/**\n * Stable-partition a strip so every pinned tab precedes every unpinned one.\n *\n * Needed by the restore path: stored tabs are merged onto whatever the startup\n * flow already opened, and an append would otherwise park a pinned tab at the\n * end of the strip. Already-normalized strips come back as a copy.\n *\n * @param tabs - any strip.\n * @returns a strip satisfying the pinned-first invariant.\n */\nexport function normalizeTabs(tabs: readonly SessionTab[]): SessionTab[] {\n const pinned = tabs.filter(isPinned)\n if (pinned.length === 0 || pinned.length === tabs.length) return [...tabs]\n return [...pinned, ...tabs.filter(tab => !isPinned(tab))]\n}\n\n/**\n * Move one tab to a new place in the strip (drag and drop).\n *\n * `targetIndex` is an index in the RESULTING strip. The move is clamped to the\n * tab's own block — a dragged chip can be reordered within the pinned block or\n * within the unpinned one, but never carried across that boundary. Crossing it\n * is `togglePinTab`'s job, because it changes the tab's meaning rather than\n * just its position: pinning is what makes a tab survive `close others`.\n *\n * @param tabs - strip in display order.\n * @param sessionId - the tab being moved.\n * @param targetIndex - desired index in the resulting strip.\n * @returns a new strip, or the same array when nothing moved.\n */\nexport function moveTab(\n tabs: readonly SessionTab[],\n sessionId: SessionId,\n targetIndex: number,\n): SessionTab[] {\n const from = tabs.findIndex(tab => tab.sessionId === sessionId)\n if (from < 0) return tabs as SessionTab[]\n const moving = tabs[from] as SessionTab\n const rest = tabs.filter(tab => tab.sessionId !== sessionId)\n const boundary = pinnedCount(rest)\n const min = isPinned(moving) ? 0 : boundary\n const max = isPinned(moving) ? boundary : rest.length\n const clamped = Math.min(Math.max(Math.trunc(targetIndex), min), max)\n if (clamped === from) return tabs as SessionTab[]\n return [...rest.slice(0, clamped), moving, ...rest.slice(clamped)]\n}\n\n/**\n * Pin or unpin one tab, re-inserting it at the boundary between the blocks.\n *\n * Pinning puts the chip at the END of the pinned block (next to the other\n * kept tabs) and unpinning at the START of the unpinned one, so a toggle never\n * throws a chip to the far end of the strip.\n *\n * @param tabs - strip in display order.\n * @param sessionId - the tab to toggle.\n * @returns a new strip, or the same array when the tab is absent.\n */\nexport function togglePinTab(tabs: readonly SessionTab[], sessionId: SessionId): SessionTab[] {\n const from = tabs.findIndex(tab => tab.sessionId === sessionId)\n if (from < 0) return tabs as SessionTab[]\n const moving = tabs[from] as SessionTab\n const rest = tabs.filter(tab => tab.sessionId !== sessionId)\n const boundary = pinnedCount(rest)\n const repinned: SessionTab = isPinned(moving)\n ? { sessionId: moving.sessionId, order: moving.order, ...(moving.title !== undefined ? { title: moving.title } : {}) }\n : { sessionId: moving.sessionId, order: moving.order, pinned: true, ...(moving.title !== undefined ? { title: moving.title } : {}) }\n return [...rest.slice(0, boundary), repinned, ...rest.slice(boundary)]\n}\n\n/**\n * Set or clear one tab's own label.\n *\n * A blank value CLEARS the override (the chip falls back to the session title)\n * rather than storing an empty label, so \"rename to nothing\" and \"rename back to\n * the session title\" are the same gesture.\n *\n * @param tabs - strip.\n * @param sessionId - the tab to relabel.\n * @param title - the new label; blank clears it.\n * @returns a new strip, or the same array when the tab is absent.\n */\nexport function renameTab(\n tabs: readonly SessionTab[],\n sessionId: SessionId,\n title: string | undefined,\n): SessionTab[] {\n const from = tabs.findIndex(tab => tab.sessionId === sessionId)\n if (from < 0) return tabs as SessionTab[]\n const trimmed = title?.trim() ?? ''\n // No change: return the same array so the store can skip the write.\n if ((tabs[from]?.title ?? '') === trimmed) return tabs as SessionTab[]\n return tabs.map((tab) => {\n if (tab.sessionId !== sessionId) return tab\n if (trimmed === '') {\n const { title: _cleared, ...rest } = tab\n void _cleared\n return rest\n }\n return { ...tab, title: trimmed }\n })\n}\n\n/**\n * Close every tab except one — pinned tabs stay.\n *\n * Pinning is exactly how a user says \"keep this no matter what\"; letting\n * `close others` eat the pinned block would make the flag pointless.\n *\n * @param tabs - strip.\n * @param keepSessionId - the tab to keep (plus every pinned one).\n * @returns a new strip.\n */\nexport function closeOtherTabs(tabs: readonly SessionTab[], keepSessionId: SessionId): SessionTab[] {\n if (!tabs.some(tab => tab.sessionId === keepSessionId)) return tabs as SessionTab[]\n return tabs.filter(tab => isPinned(tab) || tab.sessionId === keepSessionId)\n}\n\n/**\n * Close every tab after one in display order.\n *\n * \"After\" is display order (pinned block first), which is the order the user\n * sees; a pinned tab is never after an unpinned one, so this cannot silently\n * drop the kept block.\n *\n * @param tabs - strip in display order.\n * @param sessionId - the last tab that stays.\n * @returns a new strip, or the same array when the tab is absent.\n */\nexport function closeTabsAfter(tabs: readonly SessionTab[], sessionId: SessionId): SessionTab[] {\n const from = tabs.findIndex(tab => tab.sessionId === sessionId)\n if (from < 0) return tabs as SessionTab[]\n return tabs.slice(0, from + 1)\n}\n\n/**\n * Order the strip for display: strictly by arrival, regardless of which tab is\n * active.\n *\n * Position is a property of the TAB, not of the selection. Switching to a tab\n * must not move it — an earlier version pulled the active tab to the front,\n * which made every click reshuffle the strip and slid the chip out from under\n * the pointer that had just clicked it.\n *\n * `activeId` is therefore accepted only to document that \"active\" deliberately\n * does NOT participate in ordering; it is unused. The returned array is a copy\n * so callers cannot mutate the store's state through it.\n *\n * @param tabs - strip in arrival order.\n * @param activeId - the open session, if it has a tab (intentionally unused).\n * @returns a new array in arrival order.\n */\nexport function orderedTabs(tabs: readonly SessionTab[], activeId: SessionId | undefined): SessionTab[] {\n void activeId\n return [...tabs]\n}\n\n/**\n * Whether the open session must surface a tab.\n *\n * A tab means \"this conversation is in play right now\", not \"I once opened\n * this\". Browsing history is what the sidebar is for; opening an old\n * conversation to read it should not litter the strip, which is the whole point\n * of the strip being a working set rather than a second session list.\n *\n * A session therefore earns a tab only once a conversation has actually STARTED\n * in it and is still engaged, which is any of:\n * - **running** — the agent is producing output (including subagents);\n * - **waiting on you** — an approval / plan review / question is pending;\n * - **unseen completion** — it finished while you were elsewhere, so the tab is\n * the thing that tells you to come back.\n *\n * A still-blank draft gets NO tab: the tab appears the moment the first message\n * is sent (which is when the controller flips `blank` on `turn/start`). Once the\n * turn ends and you have read the result, the session is settled history and\n * does not earn a tab — so clicking through finished conversations leaves the\n * strip alone. Tabs already opened stay open: this gate only decides whether a\n * NEW tab appears, never whether an existing one closes.\n *\n * `blank` (from `sessionListMetadata`) is exactly \"no turn has started\": the\n * controller flips it to false on `turn/start`. It is the right signal for\n * \"has this conversation begun\", and the wrong one ALONE — a conversation\n * finished a week ago is also non-blank, which is why the earlier `!blank` rule\n * surfaced every old conversation the user clicked.\n *\n * @param mode - feature switch ('auto' applies the engagement rule).\n * @param summary - the session's catalog row (absent while the catalog has not\n * caught up with a just-created session).\n * @param status - the session's unified UI status (absent → no live signal).\n * @returns true when a tab belongs in the strip.\n */\nexport function shouldOpenTab(\n mode: TabOpenMode,\n summary: SessionSummary | undefined,\n status: SessionStatus | undefined,\n): boolean {\n if (mode === 'manual') return false\n if (summary === undefined) return false\n // No turn yet: a scratch draft is not a conversation, so it holds no tab. The\n // first message flips `blank`, and the tab appears then.\n if (summary.blank) return false\n // A conversation has begun. Keep the tab only while it is still in play.\n if (summary.running) return true\n if (status?.running === true) return true\n if (status?.pendingInteraction !== undefined) return true\n if (status?.completionUnread === true) return true\n // Begun, but quiet and read: settled history, not a working tab.\n return false\n}\n\n/**\n * Derive one tab's indicators from the catalog row and the unified UI status.\n * @param summary - the tab session's catalog row (absent → inert indicators).\n * @param status - the tab session's unified UI status (absent → idle).\n * @returns the indicator quadruple.\n */\nexport function tabIndicator(\n summary: SessionSummary | undefined,\n status: SessionStatus | undefined,\n): SessionTabIndicator {\n const pending = status?.pendingInteraction !== undefined\n const running = status?.running === true || summary?.running === true\n const unread = status?.completionUnread === true\n const blank = summary?.blank !== false\n return {\n attention: pending,\n running,\n unread,\n settled: !pending && !running && !unread && summary !== undefined && !blank,\n }\n}\n\n/**\n * Where one session lives: the project (workspace) that accounts for it.\n *\n * Tabs carry this because a strip of bare session titles is ambiguous once\n * several projects are open — two checkouts both named \"api\", or a session\n * titled after a file, give no hint which project it belongs to.\n */\nexport interface TabProject {\n /** Stable workspace id. */\n readonly workspaceId: string\n /** Display label: the workspace title, falling back to its directory name. */\n readonly label: string\n /** Canonical directory path, for the tooltip. */\n readonly path: string\n}\n\n/**\n * Index sessions by the project that owns them.\n *\n * Membership comes from the workspace registry (`sessionIds`), which is the same\n * authority the sidebar tree uses — a tab and its sidebar row therefore agree on\n * the project without a second derivation.\n *\n * Built once per render pass rather than scanned per tab: a strip of N tabs over\n * M projects is O(N×M) with a naive `find` per tab.\n *\n * @param workspaces - workspace views from the controller snapshot.\n * @returns a session id → project map; sessions in no workspace are absent.\n */\nexport function projectIndex(\n workspaces: readonly WorkspaceViewLike[],\n): ReadonlyMap {\n const index = new Map()\n for (const workspace of workspaces) {\n const label = projectLabel(workspace)\n const project: TabProject = {\n workspaceId: workspace.workspaceId,\n label,\n path: workspace.path,\n }\n for (const sessionId of workspace.sessionIds) {\n // First writer wins: a session wrongly listed by two workspaces keeps the\n // first, so the tab never flickers between labels across renders.\n if (!index.has(sessionId)) index.set(sessionId, project)\n }\n }\n return index\n}\n\n/** Minimal workspace shape this module needs (keeps it importable in tests). */\nexport interface WorkspaceViewLike {\n readonly workspaceId: string\n readonly path: string\n readonly title: string\n readonly sessionIds: readonly SessionId[]\n}\n\n/**\n * Display label for a project: its title, else the directory basename.\n * @param workspace - workspace view.\n * @returns a non-empty label, falling back to the raw path.\n */\nexport function projectLabel(workspace: Pick): string {\n const title = workspace.title.trim()\n if (title !== '') return title\n // Both separators: the host path may be Windows or POSIX.\n const parts = workspace.path.split(/[\\\\/]/).filter(part => part !== '')\n return parts[parts.length - 1] ?? workspace.path\n}\n\n/**\n * Whether two strips are the same sequence of sessions (arrival keys ignored).\n * @param left - previous strip.\n * @param right - next strip.\n * @returns true when no entry was added, removed, or reordered.\n */\nexport function sameTabs(left: readonly SessionTab[], right: readonly SessionTab[]): boolean {\n return left.length === right.length\n && left.every((tab, index) => right[index]?.sessionId === tab.sessionId)\n}\n\n/** Session-tab strip state (the shape the store persists). */\nexport interface SessionTabsState {\n /** Open tabs in arrival order — the strip's one and only order. */\n tabs: SessionTab[]\n /** Monotonic arrival counter; each FIRST-time session spends one. */\n order: number\n}\n\n/**\n * Store transform: add the open session, or leave its existing tab in place.\n *\n * Live here rather than in `tab-store.ts` so unit tests can exercise the real\n * semantics without importing `@deepseek-ai/dsh-client-store` (which pulls\n * `zustand` into the test process). The store module binds these into its\n * actions table.\n *\n * The no-op guard matters: this runs on EVERY catalog change for the open\n * session, so an unguarded write would wake the strip and spend arrival keys on\n * every projection tick.\n *\n * @param state - store draft, mutated in place.\n * @param sessionId - the session that just became open.\n */\nexport function touchTabImpl(state: SessionTabsState, sessionId: SessionId): void {\n const next = appendTab(state.tabs, sessionId, state.order + 1)\n // Same array => the session already had a tab; nothing changed, so nothing is\n // written and no subscriber wakes.\n if (next === state.tabs) return\n state.order += 1\n state.tabs = next\n}\n\n/**\n * Store transform: close one tab. Closing a session that has no tab is not a\n * state change, so it writes nothing.\n * @param state - store draft, mutated in place.\n * @param sessionId - the tab to close.\n */\nexport function closeTabImpl(state: SessionTabsState, sessionId: SessionId): void {\n const next = removeTab(state.tabs, sessionId)\n if (next.length === state.tabs.length) return\n state.tabs = next\n}\n\n/**\n * Store transform: adopt tabs loaded from the host, MERGING with whatever is\n * already in the strip.\n *\n * Async by nature (the host read is a `fetch`), so it can land after the browser\n * has already opened a tab for the current session. Merging — rather than\n * \"ignore the read if the strip is non-empty\" — is what makes a restart safe:\n * the tab opened during startup survives AND the stored tabs still come back.\n * (Bailing on a non-empty strip would silently drop every stored tab whenever\n * the startup tab won the race, which is the common case for a session that is\n * running or unread.)\n *\n * The arrival counter is lifted above every restored key so a tab opened later\n * cannot reuse one; a reused key makes React move a chip's DOM node instead of\n * reconciling it.\n *\n * @param state - store draft, mutated in place.\n * @param tabs - tabs read from the host, oldest first.\n */\nexport function restoreTabsImpl(state: SessionTabsState, tabs: readonly SessionTab[]): void {\n if (tabs.length === 0) return\n const present = new Set(state.tabs.map(tab => tab.sessionId))\n const additions: SessionTab[] = []\n let order = state.order\n for (const tab of tabs) {\n // Never duplicate: a session already in the strip keeps its existing entry\n // and position.\n if (present.has(tab.sessionId)) continue\n present.add(tab.sessionId)\n // Re-key onto a fresh, monotonically increasing counter so a restored key\n // can never collide with one already spent.\n order += 1\n // Carry the chip's own presentation across the restore: a pinned tab or a\n // custom label that came back unpinned/untitled would silently lose the\n // user's configuration on every restart.\n additions.push({\n sessionId: tab.sessionId,\n order,\n ...(tab.pinned === true ? { pinned: true } : {}),\n ...(tab.title !== undefined ? { title: tab.title } : {}),\n })\n }\n if (additions.length > 0) {\n const merged = [...state.tabs, ...additions]\n // Restored tabs can be pinned, and appending them would park a pinned chip\n // past the unpinned ones. Re-establish the pinned-first invariant.\n state.tabs = merged.some(isPinned) ? normalizeTabs(merged) : merged\n }\n state.order = order\n}\n\n/**\n * Store transform: pin or unpin one tab.\n * @param state - store draft, mutated in place.\n * @param sessionId - the tab to toggle.\n */\nexport function pinTabImpl(state: SessionTabsState, sessionId: SessionId): void {\n const next = togglePinTab(state.tabs, sessionId)\n if (next === state.tabs) return\n state.tabs = next\n}\n\n/**\n * Store transform: move one tab to a new index (drag and drop).\n * @param state - store draft, mutated in place.\n * @param sessionId - the tab being moved.\n * @param targetIndex - desired index in the resulting strip.\n */\nexport function moveTabImpl(state: SessionTabsState, sessionId: SessionId, targetIndex: number): void {\n const next = moveTab(state.tabs, sessionId, targetIndex)\n if (next === state.tabs) return\n state.tabs = next\n}\n\n/**\n * Store transform: set or clear one tab's own label.\n * @param state - store draft, mutated in place.\n * @param sessionId - the tab to relabel.\n * @param title - the new label; blank clears it.\n */\nexport function renameTabImpl(state: SessionTabsState, sessionId: SessionId, title: string | undefined): void {\n const next = renameTab(state.tabs, sessionId, title)\n if (next === state.tabs) return\n state.tabs = next\n}\n\n/**\n * Store transform: close every unlisted tab, keeping the pinned ones.\n * @param state - store draft, mutated in place.\n * @param keepSessionId - the tab to keep.\n */\nexport function closeOthersImpl(state: SessionTabsState, keepSessionId: SessionId): void {\n const next = closeOtherTabs(state.tabs, keepSessionId)\n if (next.length === state.tabs.length) return\n state.tabs = next\n}\n\n/**\n * Store transform: close every tab after one in display order.\n * @param state - store draft, mutated in place.\n * @param sessionId - the last tab that stays.\n */\nexport function closeAfterImpl(state: SessionTabsState, sessionId: SessionId): void {\n const next = closeTabsAfter(state.tabs, sessionId)\n if (next.length === state.tabs.length) return\n state.tabs = next\n}\n","/**\n * The session-tab store: the `defineStore` binding and nothing else.\n *\n * The action TRANSFORMS live in `tabs.ts` (pure, runtime-free), so unit tests\n * exercise the real semantics without pulling in the store engine — this module\n * is the only place that needs `@deepseek-ai/dsh-client-store`, and importing it\n * from a test would drag `zustand` into the test process.\n *\n * One handle, one scope: the tab store is seated by the `sidebar.workspaces`\n * entry alone. The tab strip is a CHILD of that entry (rendered through a DOM\n * portal into the conversation column), not a second slot registration, so the\n * handle is never mounted under a second, differently-scoped slot — which the\n * registry rejects outright (\"one handle, one scope\").\n *\n * Placement is navigation, not data: the strip derives its active chip from the\n * open session, and arrival order is the strip's only order, so nothing here\n * mirrors selection.\n */\nimport { defineStore, type EngineStoreHandle, type StoreHandle } from '@deepseek-ai/dsh-client-store'\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\nimport {\n closeAfterImpl,\n closeOthersImpl,\n closeTabImpl,\n moveTabImpl,\n pinTabImpl,\n renameTabImpl,\n restoreTabsImpl,\n touchTabImpl,\n type SessionTab,\n type SessionTabsState,\n} from './tabs.ts'\n\nexport type { SessionTabsState }\n\n/**\n * Session-tab strip actions (bound by the framework, handed to the browser).\n *\n * There is deliberately NO \"drop tabs whose session vanished\" action. An open\n * tab is closed by the USER and by nothing else — a program that trims the strip\n * on its own eventually eats tabs the user wanted, and the whole point of the\n * strip is that it holds what you opened.\n *\n * This is also why the store needs no catalog at all: it never consults one.\n */\nexport interface SessionTabsActions {\n /** Add the open session, or leave its existing tab untouched in place. */\n touch: (sessionId: SessionId) => void\n /** Close one tab; navigation is untouchable from here (the caller decides). */\n close: (sessionId: SessionId) => void\n /**\n * Replace the strip with tabs loaded from the host.\n *\n * The host read is a `fetch`, so it cannot happen inside `init()`. This action\n * is how the async result lands, and it is a no-op once the user has already\n * opened a tab — a slow response must never discard what they just did.\n */\n restore: (tabs: readonly SessionTab[]) => void\n /** Pin or unpin one tab (re-inserts it at the block boundary). */\n pin: (sessionId: SessionId) => void\n /** Move one tab to an index in the resulting strip (drag and drop). */\n move: (sessionId: SessionId, targetIndex: number) => void\n /** Set (or clear, with a blank value) one tab's own label. */\n rename: (sessionId: SessionId, title: string | undefined) => void\n /** Close everything except one tab; pinned tabs are kept. */\n closeOthers: (sessionId: SessionId) => void\n /** Close every tab after one in display order. */\n closeAfter: (sessionId: SessionId) => void\n}\n\n/** Annotation twin of the actions literal below (structural `ActionsDecl`). */\ntype SessionTabsActionsDecl = {\n touch: typeof touchTabImpl\n close: typeof closeTabImpl\n restore: typeof restoreTabsImpl\n pin: typeof pinTabImpl\n move: typeof moveTabImpl\n rename: typeof renameTabImpl\n closeOthers: typeof closeOthersImpl\n closeAfter: typeof closeAfterImpl\n}\n\n/**\n * The tab store's registered handle: identity + spec + the instance factory the\n * framework resolves per entry x scope. It deliberately does NOT claim the live\n * instance's faces (`getSnapshot` / `actions`) — `defineStore`'s concrete return\n * is structurally narrower, and this alias has to stay a type that value can be\n * assigned to.\n */\nexport type SessionTabsStoreHandle = StoreHandle\n\n/**\n * The live tab store value: the handle's `create()` product, which carries the\n * baked write set and the snapshot source. Named here so the registrations and\n * the strip's props can share one type without importing the store engine.\n */\nexport type SessionTabsInstance = ReturnType['create']>\n\n/**\n * Create the session-tab store handle.\n *\n * The strip starts EMPTY and is hydrated by the caller through the `restore`\n * action: persistence lives on the host behind a `fetch`, which cannot run\n * during `init()`. Browser storage is deliberately not used — the origin\n * includes the port, and every launch picks a new one, so `localStorage` and\n * `sessionStorage` both start empty on the next start.\n *\n * @returns the store handle (spec + type + identity + factory in one).\n */\nexport function createSessionTabsStore(): EngineStoreHandle {\n return defineStore({\n init: (): SessionTabsState => ({ tabs: [], order: 0 }),\n actions: {\n touch: touchTabImpl,\n close: closeTabImpl,\n restore: restoreTabsImpl,\n pin: pinTabImpl,\n move: moveTabImpl,\n rename: renameTabImpl,\n closeOthers: closeOthersImpl,\n closeAfter: closeAfterImpl,\n },\n })\n}\n\nexport type { SessionTab }","/**\n * Client side of the session-tab persistence, talking to\n * `GET|PUT /workspace-groups/tabs` on the host.\n *\n * Why not browser storage: **the origin includes the PORT**, and every `dsh web`\n * / `dsh test` / desktop launch picks a different one. `localStorage` and\n * `sessionStorage` are both scoped to the origin, so they start empty on the\n * next launch — a tab list kept there survives a reload only when the port\n * happens to match. The host's JSON sidecar has no such problem, which is why\n * the strip is stored there and read back verbatim.\n *\n * There is deliberately no per-browser-session marker. A marker has to live in\n * browser storage, which the port invalidates, so every restart looked like a\n * fresh session and silently discarded the user's tabs — the exact failure this\n * module exists to prevent.\n *\n * Every call is best-effort: a failed read means \"no tabs\" and a failed write is\n * swallowed, because the strip is a convenience and must never break the app.\n */\n\n/** Host route holding the strip. */\nexport const TABS_ROUTE = '/workspace-groups/tabs'\n\n/** One tab as it crosses the wire. */\nexport interface WireTab {\n readonly sessionId: string\n readonly order: number\n /** Pinned tabs are restored at the front of the strip. */\n readonly pinned?: boolean\n /** A label the user typed for the tab itself (absent = follow the session). */\n readonly title?: string\n}\n\n/**\n * Read one tab row off the wire, dropping the row when it is unusable.\n * @param entry - one element of the stored `tabs` array.\n * @returns the tab, or null for a malformed row.\n */\nfunction parseWireTab(entry: unknown): WireTab | null {\n if (typeof entry !== 'object' || entry === null) return null\n const row = entry as Record\n if (typeof row.sessionId !== 'string' || row.sessionId === '') return null\n if (typeof row.order !== 'number' || !Number.isFinite(row.order)) return null\n const pinned = row.pinned === true\n const title = typeof row.title === 'string' && row.title.trim() !== '' ? row.title.trim() : undefined\n return {\n sessionId: row.sessionId,\n order: row.order,\n ...(pinned ? { pinned: true } : {}),\n ...(title !== undefined ? { title } : {}),\n }\n}\n\n/**\n * Fetch the stored strip.\n * @param fetchImpl - fetch implementation (injectable for tests).\n * @returns the tabs, oldest first; empty on any failure.\n */\nexport async function loadTabs(fetchImpl: typeof fetch = fetch): Promise {\n try {\n const response = await fetchImpl(TABS_ROUTE, {\n method: 'GET',\n // Per-session state; a cached response would restore stale tabs.\n cache: 'no-store',\n })\n if (!response.ok) return []\n const body: unknown = await response.json()\n if (typeof body !== 'object' || body === null) return []\n const list = (body as { tabs?: unknown }).tabs\n if (!Array.isArray(list)) return []\n const tabs: WireTab[] = []\n for (const entry of list) {\n const tab = parseWireTab(entry)\n if (tab !== null) tabs.push(tab)\n }\n return tabs\n } catch {\n return []\n }\n}\n\n/**\n * Store the strip. Failures are swallowed.\n * @param state - the client's current strip and its arrival counter.\n * @param fetchImpl - fetch implementation (injectable for tests).\n */\nexport async function saveTabs(\n state: { order: number; tabs: readonly WireTab[] },\n fetchImpl: typeof fetch = fetch,\n): Promise {\n try {\n await fetchImpl(TABS_ROUTE, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ order: state.order, tabs: state.tabs }),\n cache: 'no-store',\n // Survive a navigation that happens while the request is in flight; the\n // write is idempotent so a re-send is harmless.\n keepalive: true,\n })\n } catch {\n // Offline or the host is restarting: the next change writes the full state\n // again, so nothing is lost beyond this tick.\n }\n}\n","/**\n * A framework-shaped selector hook over a store instance.\n *\n * The renderer builds this hook for slot seats (`bindSnapshotSelector` in\n * ui-renderer, wrapping React's `useSyncExternalStoreWithSelector`), but the tab\n * strip is NOT a slot occupant: it renders through a DOM seat as a child of this\n * plugin's own `sidebar.workspaces` occupant, so it receives its store face as a\n * plain prop and needs the equivalent binding here.\n *\n * The implementation mirrors React's `useSyncExternalStoreWithSelector` without\n * depending on the `use-sync-external-store` package (it is not resolvable from\n * this plugin). The two behaviours that matter:\n *\n * - identity-stable subscribe/getSnapshot closures, so the strip never\n * resubscribes across renders;\n * - a memoized selection: the selector re-runs only when the state reference\n * changes, and an equal result (by `eq`, defaulting to `Object.is`) returns\n * the PREVIOUS reference, so a selector allocating a fresh array or object\n * does not spin the render loop.\n *\n * The hook must be called unconditionally (Rules of Hooks).\n */\nimport { useCallback, useRef, useSyncExternalStore } from 'react'\nimport type { ActionsDecl, StoreInstance } from '@deepseek-ai/dsh-client-store'\n\n/** One memory cell: the state it was derived from, and the value it produced. */\ninterface Selection {\n state: T\n value: S\n /** Whether `value` was produced by the selector (vs. carried over as equal). */\n hasValue: boolean\n}\n\n/**\n * Build a selector hook bound to one store instance.\n * @param instance - the live store instance (snapshot source).\n * @returns a `SnapshotSelectorHook`-compatible hook over that instance.\n */\nexport function createStoreHook>(\n instance: StoreInstance,\n): (selector: (state: T) => S, eq?: (a: S, b: S) => boolean) => S {\n // Captured once: stable closures keep uSES from resubscribing every render.\n const subscribe = (onChange: () => void): (() => void) => instance.subscribe(onChange)\n const getState = (): T => instance.getSnapshot()\n\n return function useSelector(\n selector: (state: T) => S,\n eq?: (a: S, b: S) => boolean,\n ): S {\n // Seeded eagerly so the first render selects without an extra pass.\n const memory = useRef | null>(null)\n\n // Re-select the value for the current state. Called by uSES on every\n // notification AND on every render; the memory makes it cheap and\n // reference-stable.\n const getSelection = useCallback((): S => {\n const state = getState()\n const previous = memory.current\n\n // Same state object => the previous value is still valid. This is the\n // path that lets an allocating selector stay reference-stable.\n if (previous !== null && previous.hasValue && Object.is(previous.state, state)) {\n return previous.value\n }\n\n const value = selector(state)\n\n // New state, but an equal value: carry the old reference forward so uSES\n // sees no change and skips the re-render.\n if (previous !== null && previous.hasValue) {\n const equal = eq !== undefined ? eq(previous.value, value) : Object.is(previous.value, value)\n if (equal) {\n memory.current = { state, value: previous.value, hasValue: true }\n return previous.value\n }\n }\n\n memory.current = { state, value, hasValue: true }\n return value\n }, [selector, eq])\n\n // The third argument is the server snapshot; the client plugin never\n // server-renders, so the same getter is correct for both.\n return useSyncExternalStore(subscribe, getSelection, getSelection)\n }\n}\n","/**\n * Shared config types for @dsh-xhl/workspace-groups. Pure types (zero runtime\n * deps) so both halves — the node half (sidecar YAML reading) and the\n * browser half (tree derivation) — compile against the same contract.\n */\n\n/** One classification rule: any rule that matches places the workspace in the category. */\nexport interface GroupRule {\n /** Absolute path prefix match (normalized, case-sensitive). */\n pathPrefix?: string\n /** Case-insensitive substring match against the workspace display title. */\n nameContains?: string\n /** Case-insensitive substring match against the workspace directory basename. */\n basenameContains?: string\n /** Exact absolute path match (normalized). */\n pathExact?: string\n}\n\n/** One category folder in the sidebar tree. */\nexport interface GroupCategory {\n /** Display label of the category folder. */\n name: string\n /** Rules; a workspace is classified here when ANY rule matches. */\n rules: GroupRule[]\n}\n\n/** Theme-safe palette id for a group's accent. */\nexport type GroupColor =\n | 'red' | 'orange' | 'amber' | 'green' | 'teal'\n | 'blue' | 'indigo' | 'purple' | 'pink' | 'gray'\n\n/** Whitelist shared by the host write-validation and the client picker. */\nexport const GROUP_COLORS: readonly GroupColor[] = [\n 'red', 'orange', 'amber', 'green', 'teal',\n 'blue', 'indigo', 'purple', 'pink', 'gray',\n]\n\n/** Curated icon ids (rendered from @deepseek-ai/dsh-client-ui-primitives). */\nexport const GROUP_ICON_IDS = [\n 'folder', 'workspace', 'code', 'plugin', 'skill', 'data',\n 'database', 'api', 'plan', 'goal', 'light', 'globe',\n 'archive', 'branch', 'users', 'clock', 'shield', 'checklist',\n 'sparkle', 'tree',\n 'chat', 'search', 'settings', 'document', 'edit', 'think',\n 'agent', 'browse', 'context', 'link', 'share', 'user',\n 'send', 'attachment', 'download', 'play', 'design', 'moon',\n 'monitor', 'gauge', 'queue', 'notes', 'inspect', 'help',\n 'info', 'alarm', 'compare', 'done', 'pin', 'microphone',\n // Materials & Lab family (appended: the first 50 ids keep their order because\n // saved configs address icons by id, never by position).\n // Lab operations\n 'test-tube', 'flask', 'pipette', 'dropper', 'stirrer', 'hotplate', 'centrifuge', 'balance',\n // Material structures\n 'atom', 'molecule', 'lattice', 'layered', 'framework', 'thin-film', 'fiber', 'hydrogel',\n // Characterization\n 'microscope', 'xrd', 'spectrum', 'tensile', 'electrode', 'iv-curve',\n // Functional devices\n 'illumination', 'temperature', 'humidity', 'actuator', 'flex-sensor', 'battery',\n] as const\n\n/** Derived from the shared registry so host validation and UI cannot drift. */\nexport type GroupIconId = (typeof GROUP_ICON_IDS)[number]\n\n/**\n * Presentation metadata for one group. Every field optional.\n *\n * The explicit `| undefined` on each field is what lets a UI patch clear a\n * value (`pruneAppearance` then drops it): under `exactOptionalPropertyTypes`\n * a bare `color?: GroupColor` would reject `{ color: undefined }`.\n */\nexport interface CategoryAppearance {\n /** Palette id; the CSS palette lives in styles.css `[data-wg-color]`. */\n color?: GroupColor | undefined\n /** `GroupIconId` preset id, or a short glyph (1–4 Unicode code points, emoji/latin). */\n icon?: string | undefined\n /** Pinned groups sort before unpinned ones (within the manual order). */\n pinned?: boolean | undefined\n}\n\n/** The full sidecar configuration (mirrors workspace-groups.yaml). */\nexport interface GroupsConfig {\n /** Category folders, in render order. First match wins. */\n categories: GroupCategory[]\n /**\n * Runtime grouping overlay (manual groups + per-workspace overrides).\n * Optional: the YAML file itself never carries it — the host GET route\n * merges it from `workspace-groups.manual.json`, and the browser PUT route\n * replaces it whole.\n */\n manual?: ManualGroups\n}\n\n/**\n * Runtime-managed grouping overlay: groups created in the sidebar UI plus\n * per-workspace category overrides and user-controlled ordering. Owned by the\n * plugin (JSON sidecar, `$DSH_HOME/workspace-groups.manual.json`), never\n * written back into the operator YAML.\n *\n * All new fields are optional for backward compatibility (files written by\n * older plugin versions keep working); rendering falls back to sensible\n * defaults when they are absent. Note that an older plugin version writes the\n * whole file back, which silently drops fields it does not know about — e.g.\n * `appearance` (group color / icon / pin) is lost after a downgrade.\n */\nexport interface ManualGroups {\n /**\n * Monotonic write counter, owned by the host (same contract as the folder\n * overlay): a PUT whose revision does not match the stored one is\n * rejected with 409 instead of silently overwriting another window's\n * edits. Absent in files written before revisions existed — read as 0.\n */\n revision?: number\n /**\n * Manually created category folder names. These have no rules — they render\n * even while empty (a new group appears before anything is dragged into\n * it) and hold only workspaces assigned to them.\n */\n categories: string[]\n /**\n * Per-workspace category override, keyed by workspace id. Value is a\n * category display name (rule or manual), or `null` to force the workspace\n * into the uncategorized bucket even when a rule would match. An absent\n * key means \"classify by rules\".\n */\n assignments: Record\n /**\n * Display order of all category keys (rule display names + manual names).\n * The uncategorized bucket is never listed — it always renders last.\n * Absent = rule categories first (YAML order), manual groups appended in\n * creation order.\n */\n categoryOrder?: string[]\n /**\n * Per-category ordered workspace ids (user drag-reorder within a group).\n * Keyed by category display name; absent key = host registration order.\n */\n workspaceOrder?: Record\n /**\n * Rule category rename overrides: original YAML rule category name →\n * display name (UI rename of a rule group). Rules still classify by the\n * original name; only the rendered label/keys change.\n */\n renamed?: Record\n /**\n * Rule category original names hidden by a UI delete. Hidden rules are\n * inert: workspaces matching them become top-level (ungrouped).\n */\n hidden?: string[]\n /**\n * Per-group presentation, keyed by category DISPLAY name (same key space as\n * `categoryOrder`). Optional per field; an absent group has no presentation.\n * Dangling keys (a YAML category that no longer exists) are tolerated on read\n * and on write — see validateManualGroups.\n */\n appearance?: Record\n}\n\n/**\n * Legacy label of the fallback bucket. The top-level (ungrouped) concept\n * replaced the rendered \"未分类\" bucket: workspaces in no group render as\n * top-level rows beside the group folders. The constant survives for data\n * compatibility (reserved name, assignment null marker).\n */\nexport const UNCATEGORIZED_LABEL = '未分类'\n\n/**\n * Reserved key under `workspaceOrder` holding the manual order of TOP-LEVEL\n * (ungrouped) project rows. Distinct from any real group display name (a group\n * may not be named this), so it can never collide; the top-level list's order\n * is preserved exactly like a group's, and top-level rows can be reordered by\n * dragging.\n */\nexport const TOP_LEVEL_ORDER_KEY = '__topLevel__'\n\n/** Normalize a path for prefix matching: trailing slashes stripped. */\nexport function normalizePath(path: string): string {\n return path.replace(/[/\\\\]+$/, '')\n}\n","/**\n * Pure classification + ordering logic: decides which category a workspace\n * belongs to and how categories/workspaces are ordered. Shared by the host\n * half (validation) and the client half (tree derivation), so the semantics\n * can never drift between the config surface and the rendered tree.\n *\n * Category identity: a category's STABLE origin is its YAML rule category\n * name (or a manual-group name). Its DISPLAY key is what the tree renders and\n * what assignments reference — for rule categories that is the rename\n * override when present. Hidden rule categories are inert: workspaces that\n * would match them become top-level (ungrouped).\n */\nimport {\n normalizePath,\n UNCATEGORIZED_LABEL,\n type CategoryAppearance,\n type GroupCategory,\n type GroupRule,\n type GroupsConfig,\n type ManualGroups,\n} from './types.ts'\n\n/** One rule match against a workspace's path and title. */\nfunction ruleMatches(rule: GroupRule, path: string, title: string): boolean {\n const normalized = normalizePath(path)\n if (rule.pathPrefix !== undefined && normalized.startsWith(normalizePath(rule.pathPrefix))) return true\n if (rule.pathExact !== undefined && normalized === normalizePath(rule.pathExact)) return true\n if (rule.nameContains !== undefined && title.toLowerCase().includes(rule.nameContains.toLowerCase())) return true\n if (rule.basenameContains !== undefined) {\n const base = path.replace(/[/\\\\]+$/, '').split(/[/\\\\]/).pop() ?? ''\n if (base.toLowerCase().includes(rule.basenameContains.toLowerCase())) return true\n }\n return false\n}\n\n/** Classify a workspace by rules only; hidden categories are inert. */\nexport function classify(categories: readonly GroupCategory[], path: string, title: string): GroupCategory | undefined {\n for (const category of categories) {\n if (category.rules.some(rule => ruleMatches(rule, path, title))) return category\n }\n return undefined\n}\n\n/** Display name of a rule category: the rename override when present. */\nexport function ruleDisplayName(manual: ManualGroups | undefined, originalName: string): string {\n return manual?.renamed?.[originalName] ?? originalName\n}\n\n/** Whether a rule category has been hidden by a UI delete. */\nexport function isHiddenRule(manual: ManualGroups | undefined, originalName: string): boolean {\n return manual?.hidden?.includes(originalName) ?? false\n}\n\n/** Presentation for a category display key, or undefined when unset. */\nexport function categoryAppearance(\n manual: ManualGroups | undefined,\n key: string,\n): CategoryAppearance | undefined {\n return manual?.appearance?.[key]\n}\n\n/** Whether a category display key is pinned. */\nexport function isCategoryPinned(manual: ManualGroups | undefined, key: string): boolean {\n return categoryAppearance(manual, key)?.pinned === true\n}\n\n/**\n * Drop empty presentation fields: `undefined` values, `pinned: false`, `icon: ''`.\n * Returns undefined when nothing is left, so callers can delete the whole entry.\n */\nexport function pruneAppearance(value: CategoryAppearance): CategoryAppearance | undefined {\n const result: CategoryAppearance = {}\n if (value.color !== undefined) result.color = value.color\n if (value.icon !== undefined && value.icon.trim() !== '') result.icon = value.icon\n if (value.pinned === true) result.pinned = true\n return Object.keys(result).length === 0 ? undefined : result\n}\n\n/** Rule category display names, in YAML render order (hidden ones excluded). */\nexport function ruleDisplayNames(categories: readonly GroupCategory[], manual: ManualGroups | undefined): string[] {\n const names: string[] = []\n for (const category of categories) {\n if (isHiddenRule(manual, category.name)) continue\n names.push(ruleDisplayName(manual, category.name))\n }\n return names\n}\n\n/** Original YAML rule name whose display name equals `key` (undefined when none). */\nexport function originalRuleNameForDisplay(\n categories: readonly GroupCategory[],\n manual: ManualGroups | undefined,\n key: string,\n): string | undefined {\n return categories.find(c => ruleDisplayName(manual, c.name) === key)?.name\n}\n\n/**\n * Effective category entries in display order: rule categories (YAML order,\n * hidden skipped, renamed applied) first, then manual-only groups in\n * creation order — unless `manual.categoryOrder` overrides the sequence.\n * Top-level (ungrouped) workspaces are never included; they render as\n * separate top-level rows after the group folders.\n *\n * The pin partition is part of DISPLAY ORDER, not a render-time concern:\n * pinned groups sort before unpinned ones *within* the manual order, and both\n * the tree and the drag-drop landing neighbours read this list, so they can\n * never disagree about what sits next to what.\n */\nexport interface EffectiveCategory {\n /** Display key (what the tree renders and assignments reference). */\n key: string\n /** Origin: a YAML rule category or a manual group. */\n source: 'rule' | 'manual'\n}\n\n/** Apply `manual.categoryOrder` to the default sequence (stable). */\nfunction orderByCategoryOrder(\n entries: EffectiveCategory[],\n order: readonly string[] | undefined,\n): EffectiveCategory[] {\n if (order === undefined || order.length === 0) return entries\n // Stable sort by position in categoryOrder; entries absent from the order\n // keep their relative default position after all ordered ones.\n const position = new Map(order.map((key, index) => [key, index]))\n return [...entries].sort((a, b) => {\n const pa = position.get(a.key)\n const pb = position.get(b.key)\n if (pa !== undefined && pb !== undefined) return pa - pb\n if (pa !== undefined) return -1\n if (pb !== undefined) return 1\n return 0\n })\n}\n\n/** Stable partition: pinned groups first, unpinned ones keep their order. */\nfunction pinnedFirst(entries: EffectiveCategory[], manual: ManualGroups | undefined): EffectiveCategory[] {\n if (manual?.appearance === undefined) return entries\n const pinned = (entry: EffectiveCategory): number => Number(isCategoryPinned(manual, entry.key))\n return [...entries].sort((a, b) => pinned(b) - pinned(a))\n}\n\nexport function effectiveCategories(\n config: GroupsConfig,\n manual: ManualGroups | undefined,\n): EffectiveCategory[] {\n const entries: EffectiveCategory[] = []\n const seen = new Set()\n for (const category of config.categories) {\n if (isHiddenRule(manual, category.name)) continue\n const key = ruleDisplayName(manual, category.name)\n if (seen.has(key)) continue\n seen.add(key)\n entries.push({ key, source: 'rule' })\n }\n for (const name of manual?.categories ?? []) {\n if (seen.has(name)) continue\n seen.add(name)\n entries.push({ key: name, source: 'manual' })\n }\n return pinnedFirst(orderByCategoryOrder(entries, manual?.categoryOrder), manual)\n}\n\n/** Display keys of all effective categories (top-level workspaces excluded). */\nexport function displayCategoryKeys(config: GroupsConfig, manual: ManualGroups | undefined): string[] {\n return effectiveCategories(config, manual).map(e => e.key)\n}\n\n/**\n * Resolve the category key a workspace renders under, or `undefined` when it\n * is top-level (ungrouped). Precedence: manual override (`null` = forced\n * top-level) → rule classification (hidden rules inert) → top-level.\n */\nexport function resolveCategory(\n config: GroupsConfig,\n manual: ManualGroups | undefined,\n workspaceId: string,\n path: string,\n title: string,\n): string | undefined {\n const override = manual?.assignments[workspaceId]\n if (override !== undefined) return override ?? undefined // null forces top-level\n const matched = classify(config.categories, path, title)\n if (matched === undefined) return undefined\n if (isHiddenRule(manual, matched.name)) return undefined\n return ruleDisplayName(manual, matched.name)\n}\n\n/** Whether a category key is a manual-only group (manageable via list). */\nexport function isManualOnlyCategory(\n config: GroupsConfig,\n manual: ManualGroups | undefined,\n key: string,\n): boolean {\n return (manual?.categories.includes(key) ?? false) && !ruleDisplayNames(config.categories, manual).includes(key)\n}\n\n/**\n * Names that may not be used for a new/renamed group: the legacy reserved\n * label plus every current display key.\n */\nexport function takenCategoryNames(config: GroupsConfig, manual: ManualGroups | undefined): Set {\n const taken = new Set(displayCategoryKeys(config, manual))\n taken.add(UNCATEGORIZED_LABEL)\n return taken\n}\n\n/**\n * Order a bucket of workspace ids: the stored per-category order first\n * (filtered to actual members), then any remaining members in `fallback`\n * (host) order. Deterministic; the renderer never re-sorts on its own.\n */\nexport function orderedWorkspaceIds(\n manual: ManualGroups | undefined,\n categoryKey: string,\n members: readonly string[],\n): string[] {\n const stored = manual?.workspaceOrder?.[categoryKey]\n if (stored === undefined || stored.length === 0) return [...members]\n const memberSet = new Set(members)\n const ordered: string[] = []\n const seen = new Set()\n for (const id of stored) {\n if (!memberSet.has(id) || seen.has(id)) continue\n seen.add(id)\n ordered.push(id)\n }\n for (const id of members) {\n if (seen.has(id)) continue\n ordered.push(id)\n }\n return ordered\n}\n\n/** Move `id` before `beforeId` (undefined = append) within an ordered list. */\nexport function moveBefore(list: readonly string[], id: string, beforeId: string | undefined): string[] {\n const rest = list.filter(x => x !== id)\n if (beforeId === undefined) return [...rest, id]\n const index = rest.indexOf(beforeId)\n if (index === -1) return [...rest, id]\n rest.splice(index, 0, id)\n return rest\n}\n\n/** Move `id` after `afterId` (undefined = append) within an ordered list. */\nexport function moveAfter(list: readonly string[], id: string, afterId: string | undefined): string[] {\n const rest = list.filter(x => x !== id)\n if (afterId === undefined) return [...rest, id]\n const index = rest.indexOf(afterId)\n if (index === -1) return [...rest, id]\n rest.splice(index + 1, 0, id)\n return rest\n}\n","/**\n * Plugin-owned projection of descendant counts from Session summaries.\n *\n * 0.1.2 移除了 `@deepseek-ai/dsh-client-runtime/client`(平台模块表不再提供\n * `indexSubagentDescendants`),官方 ui-workspace 改为各自持有本地副本\n * (packages/client/ui-workspace/src/client/subagent-lineage.ts,MIT)。这里\n * 保持同一实现,使运行中的子代理会话数在树行上继续可见。\n */\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\n\ninterface LineageEntry {\n readonly id: SessionId\n readonly parentId?: SessionId\n readonly origin?: 'subagent'\n readonly running: boolean\n}\n\n/** Descendant counts for one possible parent Session. */\nexport interface SubagentDescendantSummary {\n readonly count: number\n readonly runningCount: number\n}\n\n/**\n * Index uninterrupted subagent descendants under each ancestor.\n * @param summaries - Session summaries keyed by id.\n * @returns descendant totals keyed by possible parent id.\n */\nexport function indexSubagentDescendants(\n summaries: Readonly>,\n): ReadonlyMap {\n const indexed = new Map()\n for (const descendant of Object.values(summaries)) {\n if (descendant.origin !== 'subagent') continue\n const seen = new Set()\n let current: LineageEntry | undefined = descendant\n while (current?.origin === 'subagent' && current.parentId !== undefined && !seen.has(current.id)) {\n seen.add(current.id)\n const aggregate = indexed.get(current.parentId)\n if (aggregate === undefined) {\n indexed.set(current.parentId, { count: 1, runningCount: descendant.running ? 1 : 0 })\n } else {\n aggregate.count += 1\n if (descendant.running) aggregate.runningCount += 1\n }\n current = summaries[current.parentId]\n }\n }\n return indexed\n}\n","/**\n * Recognising the Host's own default workspace (\"默认工作区\").\n *\n * The workspace snapshot carries no `isDefault` flag, so the only Host-owned\n * signal is the one the Host itself uses: the registry title. Its\n * `workspaceDisplayTitle()` treats a title equal to `DEFAULT_WORKSPACE_DIRECTORY`\n * as \"the default workspace\" and swaps in a localized label. That constant lives\n * in the workspace-controller package, which this plugin must not import at\n * runtime (it is a client bundle), so the string is mirrored here.\n *\n * Two Host signals are combined:\n * - the registry title (primary: exactly what the Host substitutes for);\n * - the Host's own directory layout (`/deepseek-harness/default-workspace`),\n * which still identifies the workspace after the user renames it.\n * A user-created directory that merely happens to be called \"default-workspace\"\n * somewhere else on disk is NOT treated as the default workspace, and no single\n * directory name is used as the sole test.\n */\n\n/** Directory name the Host uses for its default workspace (host mirror). */\nexport const DEFAULT_WORKSPACE_TITLE = 'default-workspace'\n\n/** Parent directory the Host creates inside for its state. */\nconst HOST_STATE_DIRECTORY = 'deepseek-harness'\n\n/** The fields the identification needs from a workspace snapshot. */\nexport interface DefaultWorkspaceIdentity {\n /** Registry title (`WorkspaceView.title`). */\n title?: string | undefined\n /** Absolute workspace directory (`WorkspaceView.path`). */\n path?: string | undefined\n}\n\n/**\n * Whether a workspace snapshot is the Host's default workspace.\n * @param workspace - workspace snapshot (title is the primary signal, path the fallback).\n */\nexport function isDefaultWorkspace(workspace: DefaultWorkspaceIdentity): boolean {\n if (workspace.title?.trim().toLowerCase() === DEFAULT_WORKSPACE_TITLE) return true\n const path = (workspace.path ?? '').replace(/[/\\\\]+$/u, '')\n if (path === '') return false\n const segments = path.split(/[/\\\\]+/u)\n const base = segments[segments.length - 1]?.toLowerCase()\n return base === DEFAULT_WORKSPACE_TITLE\n && segments.some(segment => segment.toLowerCase() === HOST_STATE_DIRECTORY)\n}\n","/**\n * Pure folder-list logic for per-workspace multi-root folders.\n *\n * DSH core gives a workspace exactly ONE canonical directory\n * (`WorkspaceView.path`). This module layers a plugin-owned list of EXTRA\n * folders on top of it, plus one designated root folder per workspace:\n *\n * - the canonical directory is always folder #0 (the \"base\"); it cannot be\n * removed and may be the root;\n * - `root` is stored only when it names an EXTRA folder — \"base is the root\"\n * is expressed by omitting the key, so the base path is never duplicated\n * into the sidecar;\n * - a session whose recorded `cwd` lives inside an extra folder belongs to\n * that folder, not to the project row.\n *\n * Everything here is pure and platform-agnostic: it imports no React, no DOM\n * and no cordis so plain Node (the verifier, the host route) can load it.\n */\n\n/** Kind of a member folder: a plain local directory, or an SSH-mirrored one. */\nexport type FolderMemberKind = 'local' | 'remote'\n\n/**\n * A folder row that is backed by its OWN DSH workspace (\"member\").\n *\n * Plain extra folders ( {@link WorkspaceFolderEntry.folders} ) live inside the\n * owner's canonical directory tree and their sessions run with the OWNER's\n * workspace id. A member has a directory the owner cannot reach that way — a\n * remote (mirror-backed) folder, or a local directory added to a remote project\n * — so the platform registers a real workspace for it and the row delegates\n * session creation to that workspace id. The member's own workspace row is\n * hidden from the sidebar while some entry lists it (see\n * {@link absorbedWorkspaceIds}), so the project reads as one project with both\n * kinds of folders.\n */\nexport interface FolderMember {\n /** Absolute LOCAL path of the member workspace (its canonical directory). */\n readonly path: string\n /** Native DSH workspace id backing this folder row. */\n readonly workspaceId: string\n readonly kind: FolderMemberKind\n /** Remote root, when `kind` is 'remote' (`~`, `~/proj`, `/srv/proj`). */\n readonly remotePath?: string\n /** SSH connection profile id, when `kind` is 'remote'. */\n readonly profileId?: string\n /** remote-ssh's own record id, when `kind` is 'remote'. */\n readonly recordId?: string\n /** Display title the platform gave the member workspace. */\n readonly title?: string\n}\n\n/** Folders attached to one workspace: EXTRA folders only (the base is implicit). */\nexport interface WorkspaceFolderEntry {\n /**\n * Plain local extra folders: directories the owner workspace can address\n * directly, so their sessions keep the owner's workspace id.\n */\n readonly folders: readonly string[]\n /** Workspace-backed extra folders (remote mirrors, or local on a remote owner). */\n readonly members?: readonly FolderMember[]\n readonly root?: string\n}\n\n/** The whole `workspace-groups.folders.json` document. */\nexport interface FoldersDocument {\n readonly version: 1\n /**\n * Monotonic write counter, owned by the host: every accepted PUT bumps it\n * and a PUT whose revision does not match the stored one is rejected\n * (409), so two windows can no longer silently overwrite each other's\n * edits. Absent in documents written before revisions existed — read as 0.\n */\n readonly revision?: number\n readonly workspaces: Readonly>\n}\n\n/** Canonical empty document, shared so callers need not allocate one each time. */\nexport const EMPTY_FOLDERS_DOCUMENT: FoldersDocument = { version: 1, revision: 0, workspaces: {} }\n\n/** `C:\\…` or `C:/…` — a drive-rooted Windows path. */\nconst WINDOWS_DRIVE = /^[A-Za-z]:[\\\\/]/u\n\n/** `\\\\server\\share` — a Windows UNC path. */\nconst WINDOWS_UNC = /^\\\\\\\\/u\n\n/** True for both Windows path spellings accepted by the write validator. */\nfunction isWindowsStyle(path: string): boolean {\n return WINDOWS_DRIVE.test(path) || WINDOWS_UNC.test(path)\n}\n\n/**\n * One path with trailing separators removed, spelling preserved (no case\n * folding) — the form to STORE. A drive/UNC/root prefix keeps its separator.\n * @param path - raw path.\n */\nfunction withoutTrailingSeparator(path: string): string {\n if (isWindowsStyle(path)) {\n let value = path.replaceAll('/', '\\\\')\n while (value.length > 3 && value.endsWith('\\\\')) value = value.slice(0, -1)\n return value\n }\n let value = path\n while (value.length > 1 && value.endsWith('/')) value = value.slice(0, -1)\n return value\n}\n\n/**\n * Comparison form of one path: trimmed, separator-normalized and, for Windows\n * spellings, lower-cased (drive letters and file names are case-insensitive\n * there). Trailing separators are dropped except for a drive/UNC/root prefix.\n * @param path - raw path as stored or picked.\n * @returns the canonical comparison form.\n */\nfunction canonicalPath(path: string): string {\n const trimmed = path.trim()\n const value = withoutTrailingSeparator(trimmed)\n return isWindowsStyle(trimmed) ? value.toLowerCase() : value\n}\n\n/**\n * Path equality: case-insensitive for Windows-style paths, tolerant of\n * trailing separators, exact for POSIX paths.\n * @param a - first path.\n * @param b - second path.\n */\nexport function samePath(a: string, b: string): boolean {\n return canonicalPath(a) === canonicalPath(b)\n}\n\n/**\n * Look up the folder entry saved for one workspace.\n * @param doc - folders document.\n * @param workspaceId - host workspace id.\n * @returns the entry, or undefined when the workspace has none.\n */\nexport function entryFor(doc: FoldersDocument, workspaceId: string): WorkspaceFolderEntry | undefined {\n return doc.workspaces[workspaceId]\n}\n\n/**\n * The workspace's effective folder list, base first. The base cannot be\n * duplicated and blank extra entries are dropped.\n * @param workspacePath - canonical directory of the workspace.\n * @param entry - saved folder entry, if any.\n */\nexport function effectiveFolders(\n workspacePath: string,\n entry: WorkspaceFolderEntry | undefined,\n): readonly string[] {\n const extras: string[] = []\n const candidates: string[] = [\n ...(entry?.folders ?? []),\n ...(entry?.members ?? []).map(member => member.path),\n ]\n for (const folder of candidates) {\n if (folder.trim() === '') continue\n if (samePath(folder, workspacePath)) continue\n if (extras.some(existing => samePath(existing, folder))) continue\n extras.push(folder)\n }\n return [workspacePath, ...extras]\n}\n\n/**\n * The member record behind one folder path, when that folder is workspace-backed.\n * @param entry - saved folder entry, if any.\n * @param path - folder path as stored.\n */\nexport function memberOf(entry: WorkspaceFolderEntry | undefined, path: string): FolderMember | undefined {\n return (entry?.members ?? []).find(member => samePath(member.path, path))\n}\n\n/**\n * Light canonical form of a REMOTE path (POSIX — the server's filesystem):\n * trimmed, trailing slashes removed. Deliberately string-only: the client\n * cannot resolve `~` or symlinks; the remote-ssh host canonicalizes fully\n * at registration time. This is the second line of defense, catching the\n * spelling variants a user can type into the add-cloud-folder dialog.\n * @param raw - remote path as typed or as stored.\n */\nexport function lightRemotePath(raw: string): string {\n const trimmed = raw.trim()\n return trimmed.length > 1 ? trimmed.replace(/\\/+$/, '') : trimmed\n}\n\n/**\n * Whether two remote paths name the same directory under {@link lightRemotePath}.\n * @param a - first remote path.\n * @param b - second remote path.\n */\nexport function sameRemotePath(a: string, b: string): boolean {\n return lightRemotePath(a) === lightRemotePath(b)\n}\n\n/**\n * The member backed by one native workspace id, when one exists.\n * @param entry - saved folder entry, if any.\n * @param workspaceId - native workspace id backing the member.\n */\nexport function memberByWorkspaceId(entry: WorkspaceFolderEntry | undefined, workspaceId: string): FolderMember | undefined {\n return (entry?.members ?? []).find(member => member.workspaceId === workspaceId)\n}\n\n/**\n * The remote member for one connection + remote directory, when one exists.\n * @param entry - saved folder entry, if any.\n * @param profileId - remote-ssh connection id.\n * @param remotePath - remote directory to look up.\n */\nexport function findRemoteMember(entry: WorkspaceFolderEntry | undefined, profileId: string, remotePath: string): FolderMember | undefined {\n return (entry?.members ?? []).find(member =>\n member.kind === 'remote'\n && member.profileId === profileId\n && member.remotePath !== undefined\n && sameRemotePath(member.remotePath, remotePath))\n}\n\n/**\n * Every member folder of one owner workspace, in stored order.\n * @param doc - folders document.\n * @param ownerWorkspaceId - workspace the members hang off.\n */\nexport function membersOf(doc: FoldersDocument, ownerWorkspaceId: string): readonly FolderMember[] {\n return entryFor(doc, ownerWorkspaceId)?.members ?? []\n}\n\n/**\n * Member workspace id → owning workspace id.\n *\n * These are the workspaces whose own row disappears from the sidebar: their\n * sessions render under the owning project's folder row instead. A workspace\n * that is itself an owner (it carries an entry) is never absorbed — absorbing\n * it would hide a project together with the folders nested below it.\n * @param doc - folders document.\n */\nexport function absorbedWorkspaceIds(doc: FoldersDocument): ReadonlyMap {\n const owners = new Set(Object.keys(doc.workspaces))\n const absorbed = new Map()\n for (const [ownerId, entry] of Object.entries(doc.workspaces)) {\n for (const member of entry.members ?? []) {\n if (member.workspaceId === '' || member.workspaceId === ownerId) continue\n if (owners.has(member.workspaceId)) continue\n if (!absorbed.has(member.workspaceId)) absorbed.set(member.workspaceId, ownerId)\n }\n }\n return absorbed\n}\n\n/**\n * True when the entry carries neither a plain folder nor a member, i.e. it can\n * be dropped from the sidecar instead of being written empty.\n * @param entry - folder entry.\n */\nexport function isEmptyEntry(entry: WorkspaceFolderEntry | undefined): boolean {\n return (entry?.folders.length ?? 0) === 0 && (entry?.members?.length ?? 0) === 0\n}\n\n/**\n * The folder new sessions start in by default.\n * @param workspacePath - canonical directory of the workspace.\n * @param entry - saved folder entry, if any.\n * @returns the stored root when it names an effective extra folder, else the\n * workspace's own directory.\n */\nexport function rootOf(workspacePath: string, entry: WorkspaceFolderEntry | undefined): string {\n const root = entry?.root\n if (root === undefined) return workspacePath\n const folders = effectiveFolders(workspacePath, entry)\n return folders.find(folder => samePath(folder, root)) ?? workspacePath\n}\n\n/**\n * Owning folder of a session cwd: the most specific (longest) effective folder\n * that equals the cwd or is a proper path ancestor of it.\n * @param cwd - recorded session cwd; undefined means \"the workspace itself\".\n * @param workspacePath - canonical directory of the workspace.\n * @param entry - saved folder entry, if any.\n * @returns the owning folder, or the workspace path when nothing matches.\n */\nexport function folderOfCwd(\n cwd: string | undefined,\n workspacePath: string,\n entry: WorkspaceFolderEntry | undefined,\n): string {\n if (cwd === undefined) return workspacePath\n const target = canonicalPath(cwd)\n let best: string | undefined\n let bestLength = -1\n for (const folder of effectiveFolders(workspacePath, entry)) {\n const root = canonicalPath(folder)\n if (root === '') continue\n const separator = isWindowsStyle(root) ? '\\\\' : '/'\n const prefix = root.endsWith(separator) ? root : `${root}${separator}`\n if (target !== root && !target.startsWith(prefix)) continue\n if (root.length > bestLength) {\n best = folder\n bestLength = root.length\n }\n }\n return best ?? workspacePath\n}\n\n/**\n * Append an extra folder. Idempotent under `samePath`, and the stored root (if\n * any) survives untouched.\n * @param entry - current entry, or undefined for a workspace with no extras.\n * @param path - folder path to append.\n */\nexport function addFolder(entry: WorkspaceFolderEntry | undefined, path: string): WorkspaceFolderEntry {\n const folders = entry?.folders ?? []\n const members = entry?.members ?? []\n const root = entry?.root\n const trimmed = path.trim()\n const keepRoot = root === undefined ? {} : { root }\n const keepMembers = members.length === 0 ? {} : { members: [...members] }\n if (trimmed === '' || folders.some(folder => samePath(folder, trimmed))\n || members.some(member => samePath(member.path, trimmed))) {\n return { folders: [...folders], ...keepMembers, ...keepRoot }\n }\n return { folders: [...folders, trimmed], ...keepMembers, ...keepRoot }\n}\n\n/**\n * Append a workspace-backed folder. Idempotent under `samePath`: a later call\n * for the same path replaces the stored member (so a re-registered workspace id\n * wins) instead of stacking a duplicate row.\n * @param entry - current entry, or undefined for a workspace with no extras.\n * @param member - member record to store.\n */\nexport function addMember(entry: WorkspaceFolderEntry | undefined, member: FolderMember): WorkspaceFolderEntry {\n const folders = (entry?.folders ?? []).filter(folder => !samePath(folder, member.path))\n const members = (entry?.members ?? []).filter(existing => !samePath(existing.path, member.path))\n const root = entry?.root\n // The root survives even when it names the member's own path: the member\n // replaces the plain folder at that path, so the root still resolves —\n // dropping it would silently change where new sessions start.\n const keepRoot = root === undefined ? {} : { root }\n return { folders: [...folders], members: [...members, member], ...keepRoot }\n}\n\n/**\n * Drop an extra folder, plain or workspace-backed. A root that pointed at it is\n * cleared, so the workspace falls back to its own directory instead of\n * referencing a folder it no longer has.\n * @param entry - current entry, or undefined.\n * @param path - folder path to drop.\n */\nexport function removeFolder(entry: WorkspaceFolderEntry | undefined, path: string): WorkspaceFolderEntry {\n const folders = (entry?.folders ?? []).filter(folder => !samePath(folder, path))\n const members = (entry?.members ?? []).filter(member => !samePath(member.path, path))\n const root = entry?.root\n const keepRoot = root !== undefined && !samePath(root, path)\n const keepMembers = members.length === 0 ? {} : { members }\n return { folders: folders, ...keepMembers, ...(keepRoot ? { root } : {}) }\n}\n\n/**\n * Designate the root folder. Only an extra folder can be stored: naming the\n * base directory means \"no explicit root\", which is represented by clearing\n * the key.\n * @param entry - current entry, or undefined.\n * @param path - folder to make the root.\n */\nexport function setRoot(entry: WorkspaceFolderEntry | undefined, path: string): WorkspaceFolderEntry {\n const folders = entry?.folders ?? []\n const members = entry?.members ?? []\n const keepMembers = members.length === 0 ? {} : { members: [...members] }\n const match = [...folders, ...members.map(member => member.path)]\n .find(folder => samePath(folder, path))\n if (match === undefined) return { folders: [...folders], ...keepMembers }\n return { folders: [...folders], ...keepMembers, root: match }\n}\n\n/**\n * True when `path` is `base` itself or lives somewhere below it, with the same\n * separator and case rules as {@link samePath}.\n * @param path - candidate path.\n * @param base - containing directory.\n */\nexport function isUnderBase(path: string, base: string): boolean {\n const root = canonicalPath(base)\n const target = canonicalPath(path)\n if (root === '' || target === '') return false\n if (target === root) return true\n const separator = isWindowsStyle(root) ? '\\\\' : '/'\n const prefix = root.endsWith(separator) ? root : `${root}${separator}`\n return target.startsWith(prefix)\n}\n\n/**\n * Resolve a user-typed SUBPATH against a base directory.\n *\n * This is what remote (mirror-backed) workspaces need: their canonical\n * directory is a local mirror of a remote root, so an extra folder must be a\n * directory INSIDE the mirror — that is the only spelling that also exists on\n * the remote side. Absolute input and `..` escapes are rejected outright so a\n * typo cannot smuggle in an unrelated local directory.\n * @param base - the workspace's canonical directory.\n * @param relative - typed subpath, either separator style.\n * @returns the joined path, or null when the input is empty, absolute, or\n * escapes the base.\n */\nexport function joinSubpath(base: string, relative: string): string | null {\n const root = base.trim()\n const raw = relative.trim()\n if (root === '' || raw === '') return null\n if (WINDOWS_DRIVE.test(raw) || WINDOWS_UNC.test(raw) || raw.startsWith('/')) return null\n const segments = raw.split(/[\\\\/]+/u).filter(segment => segment !== '' && segment !== '.')\n if (segments.length === 0) return null\n if (segments.includes('..')) return null\n const windows = isWindowsStyle(root)\n const separator = windows ? '\\\\' : '/'\n return `${withoutTrailingSeparator(root)}${separator}${segments.join(separator)}`\n}\n","/**\n * Derives the three-level workspace-groups tree: 分类文件夹 → 项目文件夹 →\n * 会话行. Pure derivation — all inputs are snapshots; the renderer never\n * scans. Session visibility rules mirror the official ui-workspace tree\n * (blank rows only when current, archived excluded, subagent rows excluded).\n */\nimport type {\n SessionListState,\n SessionSearchResultItem,\n SessionSummary,\n} from '@deepseek-ai/dsh-api-session-controller/client'\nimport type { WorkspaceId, WorkspaceView } from '@deepseek-ai/dsh-api-workspace-controller/client'\n// Type-only: the unified UI status snapshot. 0.1.6 把 running / pendingInteraction /\n// 未读完成提示收敛为 ui-session 的 SessionStatusSnapshot;SessionSummary.completed\n// 与 SessionListState.current 同时移除,当前会话改由 `mainView` 保留位推导。\nimport type { SessionStatus, SessionStatusSnapshot } from '@deepseek-ai/dsh-client-ui-session/client'\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\nimport { indexSubagentDescendants, type SubagentDescendantSummary } from './subagent-lineage.ts'\nimport { isDefaultWorkspace } from '../core/default-workspace.ts'\nimport { categoryAppearance, effectiveCategories, orderedWorkspaceIds, resolveCategory } from '../core/matcher.ts'\nimport {\n absorbedWorkspaceIds,\n EMPTY_FOLDERS_DOCUMENT,\n effectiveFolders,\n entryFor,\n folderOfCwd,\n rootOf,\n samePath,\n type FoldersDocument,\n type WorkspaceFolderEntry,\n} from '../core/folders.ts'\nimport {\n TOP_LEVEL_ORDER_KEY,\n UNCATEGORIZED_LABEL,\n type CategoryAppearance,\n type GroupsConfig,\n type ManualGroups,\n} from '../core/types.ts'\n\n/** Pending interaction kinds with dedicated Workspace-row presentation. */\nexport type SessionPendingInteractionStatus = 'approval' | 'plan-review' | 'question'\n\n/** Current unified UI status by Session (ui-session snapshot). */\ntype SessionStatuses = SessionStatusSnapshot\n\n/**\n * The Session the Conversation is currently showing.\n *\n * 0.1.6 removed `SessionListState.current`: selection is expressed as the\n * Session retained through the `mainView` reference source (the ui-workspace\n * navigation holds exactly one). Same read the official browser performs.\n * @param list - sessions list snapshot.\n * @returns the retained Session id, or undefined while no Session is selected.\n */\nexport function currentSessionId(list: SessionListState): SessionId | undefined {\n return Object.values(list.byId).find(session => (session.retainedBy?.mainView ?? 0) > 0)?.id\n}\n\n/** Keep navigation presentation independent from domain-owned interaction objects. */\nfunction visiblePendingKind(kind: string | undefined): SessionPendingInteractionStatus | undefined {\n switch (kind) {\n case 'approval':\n case 'plan-review':\n case 'question':\n return kind\n default:\n return undefined\n }\n}\n\n/** One top-level session row inside a workspace folder. */\nexport interface SessionNode {\n id: SessionId\n /** Stored display title; blank rows show the localized New Session label. */\n title: string\n /** The provisional blank session (renderer shows the localized New Session title). */\n blank: boolean\n pendingInteraction?: SessionPendingInteractionStatus\n running: boolean\n /** Running descendants connected through uninterrupted subagent-origin lineage. */\n runningSubagentCount: number\n /** Finished running while not selected and not yet opened (the green \"done\" reminder dot). */\n completed: boolean\n updatedAt: number\n /** Search-hit marker (rendered with a highlighted tint in search mode). */\n matched?: boolean\n /** Content-match snippet from the Host search (search mode only). */\n snippet?: string\n}\n\n/** One folder row inside a workspace folder (base or extra). */\nexport interface FolderNode {\n /** Absolute folder path. */\n path: string\n /** Display label: last path segment, or the whole path for drive roots. */\n label: string\n /** The workspace's default target for new sessions (★). */\n isRoot: boolean\n expanded: boolean\n /** The workspace's own canonical directory (folder #0); cannot be removed. */\n isBase: boolean\n /** Visible sessions whose recorded cwd lives inside this folder. */\n sessions: readonly SessionNode[]\n}\n\n/** One workspace folder row inside a category folder. */\nexport interface WorkspaceGroupNode {\n workspaceId: WorkspaceId\n /** Canonical host directory path. */\n path: string\n /** Display title. */\n label: string\n /** Workspace creation time (epoch ms). */\n createdAt: number\n /** Total visible sessions in the folder (every folder included). */\n sessionCount: number\n expanded: boolean\n /** The folder contains the selected session (active folder tint). */\n containsCurrent: boolean\n /** Base-owned visible session rows (empty while the folder is folded). */\n sessions: readonly SessionNode[]\n /**\n * Folder rows, present only when the workspace carries at least one extra\n * folder: root first, then stored order, base included. Absent means \"this\n * workspace has exactly one directory\", the plain pre-folders node shape.\n */\n folders?: readonly FolderNode[]\n}\n\n/** One category folder at the top of the tree. */\nexport interface CategoryNode {\n /** Stable category key: the configured label, or the uncategorized bucket. */\n key: string\n /** Display label. */\n label: string\n expanded: boolean\n /** The category contains the selected session (active folder tint). */\n containsCurrent: boolean\n /** Workspace folders in host order. */\n workspaces: readonly WorkspaceGroupNode[]\n /** Presentation (color / icon / pin) for this category, when configured. */\n appearance?: CategoryAppearance\n}\n\n/** Viewing state consumed by the derivation. */\nexport interface GroupsTreeView {\n expandedCategories: readonly string[]\n expandedWorkspaces: readonly string[]\n /**\n * Collapsed folder rows, keyed by `folderKey(workspaceId, path)`. Folders are\n * expanded by default: adding a folder must never hide the sessions that used\n * to show flat under the project.\n */\n collapsedFolders?: readonly string[]\n}\n\n/** Key of the uncategorized bucket (matches the config fallback label). */\nexport const UNCATEGORIZED_KEY = UNCATEGORIZED_LABEL\n\n/**\n * Names the \"not sorted yet\" bucket commonly gets. A group whose key matches one\n * of these is docked to the bottom of the sidebar (above the default-workspace\n * row) instead of taking a slot in the tree, so the workspaces a user has not\n * classified yet never push the classified tree around.\n */\nconst DOCKED_CATEGORY_PATTERN = /^(?:未归类|未分类|未分组|未排序|待归类|ungrouped|uncategorized|unsorted)$/iu\n\n/** Whether this category key names the \"not yet classified\" bucket. */\nexport function isDockedCategoryKey(key: string): boolean {\n return DOCKED_CATEGORY_PATTERN.test(key.trim())\n}\n\n/** Directory display label: basename of the path (both separators accepted). */\nexport function workspaceLabel(cwd: string | undefined): string {\n if (cwd === undefined || cwd === '') return UNCATEGORIZED_LABEL\n const base = cwd.replace(/[/\\\\]+$/, '').split(/[/\\\\]/).pop()\n return base !== undefined && base !== '' ? base : cwd\n}\n\n/** Ordinary sessions are visible; blank only when current; archived/subagent never. */\nfunction sessionVisible(session: SessionSummary, current: SessionId | undefined, archived: ReadonlySet): boolean {\n return session.origin !== 'subagent'\n && !archived.has(session.id)\n && (!session.blank || session.id === current)\n}\n\n/** Blank rows display the localized New Session label (never enters search). */\nfunction sessionTitle(session: SessionSummary): string {\n return session.blank ? 'New Session' : session.displayTitle\n}\n\nfunction sessionNode(\n s: SessionSummary,\n descendants: ReadonlyMap,\n statuses: SessionStatuses,\n): SessionNode {\n // `SessionStatusSnapshot` is typed as ReadonlyMap, but the framework binds a\n // plain record at runtime (client.js: `statuses[sessionId]`). Read both shapes\n // so a hook backed by an object never throws \"statuses.get is not a function\".\n const status = typeof (statuses as { get?: unknown } | undefined)?.get === 'function'\n ? statuses.get(s.id)\n : (statuses as unknown as Record)[s.id]\n const pending = visiblePendingKind(status?.pendingInteraction?.kind)\n return {\n id: s.id,\n title: sessionTitle(s),\n blank: s.blank,\n running: status?.running ?? s.running,\n runningSubagentCount: descendants.get(s.id)?.runningCount ?? 0,\n completed: status?.completionUnread === true,\n updatedAt: s.updatedAt,\n ...(pending === undefined ? {} : { pendingInteraction: pending }),\n }\n}\n\n/** Visible sessions of one workspace in its stored account order. */\nfunction workspaceSessions(\n list: SessionListState,\n workspace: WorkspaceView,\n archived: ReadonlySet,\n descendants: ReadonlyMap,\n statuses: SessionStatuses,\n current: SessionId | undefined,\n): SessionNode[] {\n const nodes: SessionNode[] = []\n for (const id of workspace.sessionIds) {\n const summary = list.byId[id]\n if (summary === undefined) continue // account may lead the list pull; appears when the summary lands\n if (!sessionVisible(summary, current, archived)) continue\n nodes.push(sessionNode(summary, descendants, statuses))\n }\n return nodes\n}\n\n/** A workspace-backed (\"member\") folder resolved against the workspace list. */\nexport interface MemberWorkspaces {\n /** Member workspace id → owning workspace id (the rows to hide). */\n absorbed: ReadonlyMap\n /** Owning workspace id → member workspaces in stored folder order. */\n byOwner: ReadonlyMap\n}\n\n/**\n * Resolve the workspace-backed folders of every project.\n *\n * A member folder is a real DSH workspace whose OWN row must disappear: its\n * sessions are rendered under its owner's folder row instead, so one project can\n * carry local and cloud (SSH-mirrored) folders at once. Members the Host no\n * longer knows are dropped from the index — the folder row survives (its path is\n * still stored) but shows no sessions.\n * @param workspaces - real workspaces in Host order.\n * @param folders - per-workspace extra folders + members + root.\n */\nexport function memberWorkspaces(\n workspaces: readonly WorkspaceView[],\n folders: FoldersDocument = EMPTY_FOLDERS_DOCUMENT,\n): MemberWorkspaces {\n const byId = new Map()\n for (const workspace of workspaces) byId.set(workspace.workspaceId as string, workspace)\n // Only an owner that still exists may hide a row: if the project itself is gone,\n // its members must come back as their own rows instead of staying invisible. A\n // chained member (an absorbed project that owns members of its own) is refused\n // for the same reason — nesting would swallow the inner sessions.\n const stored = absorbedWorkspaceIds(folders)\n const absorbed = new Map()\n for (const [memberId, ownerId] of stored) {\n if (!byId.has(ownerId) || stored.has(ownerId)) continue\n absorbed.set(memberId, ownerId)\n }\n const byOwner = new Map()\n for (const [ownerId, entry] of Object.entries(folders.workspaces)) {\n for (const member of entry.members ?? []) {\n if (absorbed.get(member.workspaceId) !== ownerId) continue\n const view = byId.get(member.workspaceId)\n if (view === undefined) continue\n const bucket = byOwner.get(ownerId)\n if (bucket === undefined) byOwner.set(ownerId, [view])\n else bucket.push(view)\n }\n }\n return { absorbed, byOwner }\n}\n\n/** Visible sessions of a project: its own rows plus every member folder's rows. */\nfunction sessionsWithMembers(\n list: SessionListState,\n workspace: WorkspaceView,\n members: readonly WorkspaceView[],\n archived: ReadonlySet,\n descendants: ReadonlyMap,\n statuses: SessionStatuses,\n current: SessionId | undefined,\n): SessionNode[] {\n if (members.length === 0) {\n return workspaceSessions(list, workspace, archived, descendants, statuses, current)\n }\n const nodes = workspaceSessions(list, workspace, archived, descendants, statuses, current)\n for (const member of members) {\n nodes.push(...workspaceSessions(list, member, archived, descendants, statuses, current))\n }\n return nodes\n}\n\n/** Whether a session lives in this project or in one of its member folders. */\nfunction projectHoldsSession(\n workspace: WorkspaceView,\n members: readonly WorkspaceView[],\n sessionId: SessionId | undefined,\n): boolean {\n if (sessionId === undefined) return false\n if (workspace.sessionIds.includes(sessionId)) return true\n return members.some(member => member.sessionIds.includes(sessionId))\n}\n\n/**\n * Display label of one folder: the last path segment. A drive root (`C:\\`) or\n * the POSIX root has no segment, so the whole path is the honest label.\n * @param path - absolute folder path.\n */export function folderLabel(path: string): string {\n const trimmed = path.replace(/[/\\\\]+$/u, '')\n if (trimmed === '' || /^[A-Za-z]:$/u.test(trimmed)) return path\n const base = trimmed.split(/[/\\\\]/u).pop()\n return base !== undefined && base !== '' ? base : path\n}\n\n/** Stable identity of one folder row (same path may live under two workspaces). */\nexport function folderKey(workspaceId: WorkspaceId, path: string): string {\n return `${workspaceId}\\u0000${path}`\n}\n\n/**\n * Display labels for member folders.\n *\n * A cloud member's directory is a locally generated mirror id (`wabc123`), which\n * says nothing to the user: its REMOTE path or title is the honest label. Local\n * members keep the last path segment, like every other folder.\n * @param folders - per-workspace folders + members.\n */\nfunction memberFolderLabels(entry: WorkspaceFolderEntry | undefined): Map {\n const labels = new Map()\n for (const member of entry?.members ?? []) {\n const label = member.kind === 'remote'\n ? (member.title ?? folderLabel(member.remotePath ?? member.path))\n : folderLabel(member.path)\n if (label !== '') labels.set(member.path, label)\n }\n return labels\n}\n\n/**\n * Split a workspace's visible sessions between its base directory and its extra\n * folders. Sessions keep the order they already had inside their owner, and a\n * workspace with no extra folder returns its sessions untouched — the pre-\n * folders node shape (no `folders` key at all).\n * @param workspaceId - owning workspace.\n * @param workspacePath - canonical directory (folder #0).\n * @param sessions - every visible session of the workspace, in host order.\n * @param list - sessions list snapshot (records each session's cwd).\n * @param entry - saved extra folders + root for this workspace.\n * @param collapsedFolders - collapsed folder-row keys. Undefined means \"nothing\n * is collapsed\", which is both the default view and what search uses so every\n * hit is visible without another click.\n */\nfunction applyFolders(\n workspaceId: WorkspaceId,\n workspacePath: string,\n sessions: readonly SessionNode[],\n list: SessionListState,\n entry: WorkspaceFolderEntry | undefined,\n collapsedFolders: ReadonlySet | undefined,\n): { sessions: readonly SessionNode[]; folders?: readonly FolderNode[] } {\n const labels = memberFolderLabels(entry)\n const extras = effectiveFolders(workspacePath, entry).slice(1)\n if (extras.length === 0) return { sessions }\n const root = rootOf(workspacePath, entry)\n const base: SessionNode[] = []\n const byFolder = new Map()\n for (const node of sessions) {\n const owner = folderOfCwd(list.byId[node.id]?.cwd, workspacePath, entry)\n if (samePath(owner, workspacePath)) {\n base.push(node)\n continue\n }\n const bucket = byFolder.get(owner)\n if (bucket === undefined) byFolder.set(owner, [node])\n else bucket.push(node)\n }\n const folderNode = (path: string, isBase: boolean): FolderNode => {\n const owned = isBase ? base : (byFolder.get(path) ?? [])\n return {\n path,\n label: labels.get(path) ?? folderLabel(path),\n isRoot: samePath(path, root),\n expanded: collapsedFolders === undefined || !collapsedFolders.has(folderKey(workspaceId, path)),\n isBase,\n // Every owned session is kept on the node so the row's count stays honest\n // while the folder is collapsed; the RowGroup does the hiding.\n sessions: owned,\n }\n }\n const folders: FolderNode[] = [\n folderNode(workspacePath, true),\n ...extras.map(path => folderNode(path, false)),\n ]\n // Root first, then stored order: moving the root row to the front keeps the\n // remaining rows (base included) in their stored order.\n const rootIndex = folders.findIndex(folder => folder.isRoot)\n if (rootIndex > 0) {\n const [rootFolder] = folders.splice(rootIndex, 1)\n if (rootFolder !== undefined) folders.unshift(rootFolder)\n }\n return { sessions: base, folders }\n}\n\n/**\n * Derive the three-level tree.\n * @param list - sessions list snapshot (`current` feeds containsCurrent).\n * @param workspaces - real workspaces in stable Host order.\n * @param archivedSessionIds - registry-global archive set.\n * @param config - sidecar grouping config (rule categories).\n * @param view - local expansion arrays.\n * @param manual - runtime overlay (manual groups + overrides). A workspace's\n * manual override wins over rule classification; removing it reverts to rules.\n * @param statuses - unified UI status by Session (drives the running / warning\n * / unread-completion row indicators); defaults to none (tests).\n * @param folders - per-workspace extra folders + root. A workspace with extras\n * gains folder rows and its extra-folder sessions move under them; a workspace\n * without extras keeps exactly the pre-folders node shape.\n * @returns category sections in render order (rule categories first, then\n * manual-only ones, uncategorized last). Manual groups render even while\n * empty; empty rule buckets stay hidden.\n */\nexport function deriveGroups(\n list: SessionListState,\n workspaces: readonly WorkspaceView[],\n archivedSessionIds: readonly SessionId[],\n config: GroupsConfig,\n view: GroupsTreeView,\n manual: ManualGroups,\n statuses: SessionStatuses = new Map(),\n folders: FoldersDocument = EMPTY_FOLDERS_DOCUMENT,\n): CategoryNode[] {\n const archived = new Set(archivedSessionIds)\n const expandedCategories = new Set(view.expandedCategories)\n const expandedWorkspaces = new Set(view.expandedWorkspaces)\n const collapsedFolders = new Set(view.collapsedFolders ?? [])\n const descendants = indexSubagentDescendants(list.byId)\n const current = currentSessionId(list)\n const members = memberWorkspaces(workspaces, folders)\n\n // Bucket workspaces by display key. Seed with every effective category so\n // manual groups render while empty. Top-level (ungrouped) workspaces are\n // handled by deriveTopLevel and never land here.\n const byCategory = new Map()\n for (const { key } of effectiveCategories(config, manual)) {\n byCategory.set(key, [])\n }\n for (const workspace of workspaces) {\n // The Host default workspace is pinned to its own bottom bar, never grouped.\n if (isDefaultWorkspace(workspace)) continue\n // Member folders render inside their owner; their own row is not a project.\n if (members.absorbed.has(workspace.workspaceId as string)) continue\n const key = resolveCategory(config, manual, workspace.workspaceId, workspace.path, workspace.title)\n if (key === undefined) continue // top-level — rendered by deriveTopLevel\n if (!byCategory.has(key)) byCategory.set(key, [])\n byCategory.get(key)!.push(workspace)\n }\n\n const manualCategories = new Set(manual.categories)\n const currentWorkspaceId = current === undefined\n ? undefined\n : workspaces.find(w => !members.absorbed.has(w.workspaceId as string)\n && projectHoldsSession(w, members.byOwner.get(w.workspaceId as string) ?? [], current))?.workspaceId\n\n const nodes: CategoryNode[] = []\n // Effective categories in display order (categoryOrder applied).\n for (const key of effectiveCategories(config, manual).map(e => e.key)) {\n const bucket = byCategory.get(key) ?? []\n // Manual groups stay visible while empty; everything else hides when empty.\n if (bucket.length === 0 && !manualCategories.has(key)) continue\n const expanded = expandedCategories.has(key)\n const ordered = orderedWorkspaceIds(manual, key, bucket.map(w => w.workspaceId as string))\n const workspaceNodes: WorkspaceGroupNode[] = []\n let containsCurrent = false\n for (const workspaceId of ordered) {\n const workspace = bucket.find(w => w.workspaceId === workspaceId)\n if (workspace === undefined) continue\n const ownerMembers = members.byOwner.get(workspace.workspaceId as string) ?? []\n const sessions = sessionsWithMembers(list, workspace, ownerMembers, archived, descendants, statuses, current)\n const wsExpanded = expandedWorkspaces.has(workspace.workspaceId as string)\n const wsContainsCurrent = workspace.workspaceId === currentWorkspaceId\n const partitioned = applyFolders(\n workspace.workspaceId,\n workspace.path,\n sessions,\n list,\n entryFor(folders, workspace.workspaceId as string),\n collapsedFolders,\n )\n if (wsContainsCurrent) containsCurrent = true\n workspaceNodes.push({\n workspaceId: workspace.workspaceId,\n path: workspace.path,\n label: workspace.title,\n createdAt: Date.parse(workspace.createdAt),\n sessionCount: sessions.length,\n expanded: wsExpanded,\n containsCurrent: wsContainsCurrent,\n sessions: wsExpanded ? partitioned.sessions : [],\n ...(partitioned.folders === undefined ? {} : { folders: partitioned.folders }),\n })\n }\n const appearance = categoryAppearance(manual, key)\n nodes.push({\n key,\n label: key,\n expanded,\n containsCurrent,\n workspaces: workspaceNodes,\n ...(appearance === undefined ? {} : { appearance }),\n })\n }\n return nodes\n}\n\n/**\n * Top-level (ungrouped) workspace rows: workspaces resolving to no category\n * (no manual override and no matching rule, or a forced `null` override).\n * Rendered after the group folders as plain project rows (not inside any\n * folder), in manual top-level order (`workspaceOrder[TOP_LEVEL_ORDER_KEY]`),\n * falling back to host registration order.\n */\nexport function deriveTopLevel(\n list: SessionListState,\n workspaces: readonly WorkspaceView[],\n archivedSessionIds: readonly SessionId[],\n config: GroupsConfig,\n view: GroupsTreeView,\n manual: ManualGroups,\n statuses: SessionStatuses = new Map(),\n folders: FoldersDocument = EMPTY_FOLDERS_DOCUMENT,\n): WorkspaceGroupNode[] {\n const archived = new Set(archivedSessionIds)\n const expandedWorkspaces = new Set(view.expandedWorkspaces)\n const collapsedFolders = new Set(view.collapsedFolders ?? [])\n const descendants = indexSubagentDescendants(list.byId)\n const current = currentSessionId(list)\n const members = memberWorkspaces(workspaces, folders)\n const currentWorkspaceId = current === undefined\n ? undefined\n : workspaces.find(w => !members.absorbed.has(w.workspaceId as string)\n && projectHoldsSession(w, members.byOwner.get(w.workspaceId as string) ?? [], current))?.workspaceId\n\n const topLevelIds = workspaces\n .filter(w => !isDefaultWorkspace(w))\n .filter(w => !members.absorbed.has(w.workspaceId as string))\n .filter(w => resolveCategory(config, manual, w.workspaceId, w.path, w.title) === undefined)\n .map(w => w.workspaceId as string)\n const ordered = orderedWorkspaceIds(manual, TOP_LEVEL_ORDER_KEY, topLevelIds)\n\n const nodes: WorkspaceGroupNode[] = []\n for (const workspaceId of ordered) {\n const workspace = workspaces.find(w => w.workspaceId === workspaceId)\n if (workspace === undefined) continue\n const ownerMembers = members.byOwner.get(workspaceId) ?? []\n const sessions = sessionsWithMembers(list, workspace, ownerMembers, archived, descendants, statuses, current)\n const wsExpanded = expandedWorkspaces.has(workspaceId)\n const partitioned = applyFolders(\n workspace.workspaceId,\n workspace.path,\n sessions,\n list,\n entryFor(folders, workspaceId),\n collapsedFolders,\n )\n nodes.push({\n workspaceId: workspace.workspaceId,\n path: workspace.path,\n label: workspace.title,\n createdAt: Date.parse(workspace.createdAt),\n sessionCount: sessions.length,\n expanded: wsExpanded,\n containsCurrent: workspace.workspaceId === currentWorkspaceId,\n sessions: wsExpanded ? partitioned.sessions : [],\n ...(partitioned.folders === undefined ? {} : { folders: partitioned.folders }),\n })\n }\n return nodes\n}\n\n/**\n * The Host's default workspace as a standalone node for the pinned bottom bar.\n *\n * The default workspace is not part of the grouping tree (it is excluded from\n * `deriveGroups`, `deriveTopLevel` and the search results), yet it keeps the\n * full workspace-row behaviour: expansion, session count, its sessions and its\n * extra folders. This derives exactly that node, reusing the same visibility,\n * folder partitioning and current-session marking as the tree.\n *\n * @param list - sessions list snapshot.\n * @param workspaces - real workspaces in stable Host order.\n * @param archivedSessionIds - registry-global archive set.\n * @param view - local expansion arrays.\n * @param statuses - unified UI status by Session.\n * @param folders - per-workspace extra folders + root.\n * @returns the default workspace node, or undefined when the Host has none.\n */\nexport function deriveDefaultWorkspace(\n list: SessionListState,\n workspaces: readonly WorkspaceView[],\n archivedSessionIds: readonly SessionId[],\n view: GroupsTreeView,\n statuses: SessionStatuses = new Map(),\n folders: FoldersDocument = EMPTY_FOLDERS_DOCUMENT,\n): WorkspaceGroupNode | undefined {\n const workspace = workspaces.find(w => isDefaultWorkspace(w))\n if (workspace === undefined) return undefined\n const archived = new Set(archivedSessionIds)\n const expandedWorkspaces = new Set(view.expandedWorkspaces)\n const collapsedFolders = new Set(view.collapsedFolders ?? [])\n const descendants = indexSubagentDescendants(list.byId)\n const current = currentSessionId(list)\n const members = memberWorkspaces(workspaces, folders)\n const ownerMembers = members.byOwner.get(workspace.workspaceId as string) ?? []\n const sessions = sessionsWithMembers(list, workspace, ownerMembers, archived, descendants, statuses, current)\n const wsExpanded = expandedWorkspaces.has(workspace.workspaceId as string)\n const partitioned = applyFolders(\n workspace.workspaceId,\n workspace.path,\n sessions,\n list,\n entryFor(folders, workspace.workspaceId as string),\n collapsedFolders,\n )\n return {\n workspaceId: workspace.workspaceId,\n path: workspace.path,\n label: workspace.title,\n createdAt: Date.parse(workspace.createdAt),\n sessionCount: sessions.length,\n expanded: wsExpanded,\n containsCurrent: projectHoldsSession(workspace, ownerMembers, current),\n sessions: wsExpanded ? partitioned.sessions : [],\n ...(partitioned.folders === undefined ? {} : { folders: partitioned.folders }),\n }\n}\n\n/** Recency comparator: newest first, id as the deterministic tiebreak. */\nfunction byRecency(a: SessionSummary, b: SessionSummary): number {\n if (b.updatedAt !== a.updatedAt) return b.updatedAt - a.updatedAt\n return a.id < b.id ? -1 : 1\n}\n\n/** Bounded set of matched sessions plus content snippets (feeds the search tree). */\nexport interface SearchMatchSet {\n /** Session ids that matched (local metadata hits + Host content hits). */\n matchedIds: ReadonlySet\n /** Content-match snippets keyed by session id (Host search only). */\n snippetsBySession: ReadonlyMap\n hasMore: boolean\n}\n\n/**\n * Compute the matched-session set: immediate title/Workspace substring matches\n * from the local list, merged with ranked Host content matches. The consumer\n * (SearchBody) derives the pruned three-level tree from these ids.\n */\nexport function deriveSearchMatches(\n list: SessionListState,\n workspaces: readonly WorkspaceView[],\n config: GroupsConfig,\n query: string,\n archivedSessionIds: readonly SessionId[],\n content: { items: readonly SessionSearchResultItem[]; hasMore: boolean },\n limit: number,\n folders: FoldersDocument = EMPTY_FOLDERS_DOCUMENT,\n): SearchMatchSet {\n const q = query.trim().toLowerCase()\n if (q === '') return { matchedIds: new Set(), snippetsBySession: new Map(), hasMore: false }\n const archived = new Set(archivedSessionIds)\n const descendants = indexSubagentDescendants(list.byId)\n const current = currentSessionId(list)\n const members = memberWorkspaces(workspaces, folders)\n\n // A member folder's sessions search as part of the project that shows them.\n const workspaceBySession = new Map()\n for (const workspace of workspaces) {\n if (members.absorbed.has(workspace.workspaceId as string)) continue\n const owner = workspace\n for (const sessionId of workspace.sessionIds) {\n if (!workspaceBySession.has(sessionId)) workspaceBySession.set(sessionId, owner)\n }\n for (const member of members.byOwner.get(workspace.workspaceId as string) ?? []) {\n for (const sessionId of member.sessionIds) {\n if (!workspaceBySession.has(sessionId)) workspaceBySession.set(sessionId, owner)\n }\n }\n }\n const labelOf = (summary: SessionSummary): string =>\n workspaceBySession.get(summary.id)?.title ?? workspaceLabel(summary.cwd)\n\n const local: SessionSummary[] = []\n for (const id of list.ids) {\n const summary = list.byId[id]\n if (summary === undefined || summary.blank || !sessionVisible(summary, current, archived)) continue\n if (\n sessionTitle(summary).toLowerCase().includes(q)\n || labelOf(summary).toLowerCase().includes(q)\n ) {\n local.push(summary)\n }\n }\n local.sort(byRecency)\n\n const ordered: SessionSummary[] = []\n const included = new Set()\n const include = (summary: SessionSummary): void => {\n if (included.has(summary.id)) return\n included.add(summary.id)\n ordered.push(summary)\n }\n for (const summary of local) include(summary)\n for (const item of content.items) {\n const summary = list.byId[item.sessionId]\n if (summary !== undefined && !summary.blank && sessionVisible(summary, current, archived)) include(summary)\n }\n\n const snippets = new Map()\n for (const item of content.items) {\n if (item.snippet !== undefined) snippets.set(item.sessionId, item.snippet)\n }\n\n return {\n matchedIds: ordered.slice(0, limit).reduce((set, summary) => { set.add(summary.id); return set }, new Set()),\n snippetsBySession: snippets,\n hasMore: content.hasMore || ordered.length > limit,\n }\n}\n\n/** Search tree: group folders plus top-level (ungrouped) matched workspaces. */\nexport interface SearchTree {\n /** Group folders containing matched sessions, in display order. */\n categories: CategoryNode[]\n /** Top-level (ungrouped) workspaces holding matched sessions. */\n topLevel: WorkspaceGroupNode[]\n /**\n * The Host default workspace's matched branch, when it has a hit. It is\n * rendered in the pinned bottom bar instead of the results list, so a hit\n * never makes the default workspace appear twice.\n */\n defaultWorkspace?: WorkspaceGroupNode\n}\n\n/**\n * Build a three-level search tree containing ONLY the branches that hold a\n * matched session: 分类文件夹 → 项目文件夹 → 命中会话行. Every matched\n * session carries `matched: true` so rows render with the search-hit tint.\n * Classification uses the same precedence as the idle tree (manual override →\n * rules), so search shows the same grouping the user sees. Matched top-level\n * workspaces are returned separately (rendered as plain rows).\n *\n * @param list - sessions list snapshot.\n * @param workspaces - real workspaces in stable Host order.\n * @param config - sidecar grouping config.\n * @param matchedIds - set of session ids that matched the query.\n * @param archivedSessionIds - registry-global archive set.\n * @param manual - runtime overlay (manual groups + overrides).\n * @param snippetsBySession - optional content-match snippets keyed by session id.\n * @param statuses - unified UI status by Session (drives the running / warning\n * / unread-completion row indicators); defaults to none (tests).\n * @param folders - per-workspace extra folders + root, so a hit inside an extra\n * folder surfaces under that folder instead of flat under the project.\n * @returns group folders in render order plus top-level matched workspaces,\n * pruned to matched branches only.\n */\nexport function deriveSearchGroups(\n list: SessionListState,\n workspaces: readonly WorkspaceView[],\n config: GroupsConfig,\n matchedIds: ReadonlySet,\n archivedSessionIds: readonly SessionId[],\n manual: ManualGroups,\n snippetsBySession?: ReadonlyMap,\n statuses: SessionStatuses = new Map(),\n folders: FoldersDocument = EMPTY_FOLDERS_DOCUMENT,\n): SearchTree {\n const archived = new Set(archivedSessionIds)\n const descendants = indexSubagentDescendants(list.byId)\n const current = currentSessionId(list)\n const members = memberWorkspaces(workspaces, folders)\n\n const byCategory = new Map()\n for (const key of effectiveCategories(config, manual).map(e => e.key)) byCategory.set(key, [])\n\n const topLevel: WorkspaceGroupNode[] = []\n let defaultWorkspace: WorkspaceGroupNode | undefined\n for (const workspace of workspaces) {\n // A member's own row is folded into its owner's folder row below.\n if (members.absorbed.has(workspace.workspaceId as string)) continue\n // Only sessions that matched the query and are visible in this folder.\n const nodes: SessionNode[] = []\n const sources = [workspace, ...(members.byOwner.get(workspace.workspaceId as string) ?? [])]\n for (const source of sources) {\n for (const id of source.sessionIds) {\n const summary = list.byId[id]\n if (summary === undefined || !matchedIds.has(id)) continue\n if (!sessionVisible(summary, current, archived)) continue\n const node = sessionNode(summary, descendants, statuses)\n const snippet = snippetsBySession?.get(id)\n nodes.push({\n ...node,\n matched: true,\n ...(snippet === undefined ? {} : { snippet }),\n })\n }\n }\n if (nodes.length === 0) continue\n\n const partitioned = applyFolders(\n workspace.workspaceId,\n workspace.path,\n nodes,\n list,\n entryFor(folders, workspace.workspaceId as string),\n undefined,\n )\n const node: WorkspaceGroupNode = {\n workspaceId: workspace.workspaceId,\n path: workspace.path,\n label: workspace.title,\n createdAt: Date.parse(workspace.createdAt),\n sessionCount: nodes.length,\n expanded: true,\n containsCurrent: false,\n sessions: partitioned.sessions,\n ...(partitioned.folders === undefined ? {} : { folders: partitioned.folders }),\n }\n if (isDefaultWorkspace(workspace)) {\n defaultWorkspace = node\n continue\n }\n const key = resolveCategory(config, manual, workspace.workspaceId, workspace.path, workspace.title)\n if (key === undefined) {\n topLevel.push(node)\n continue\n }\n if (!byCategory.has(key)) byCategory.set(key, [])\n byCategory.get(key)!.push(node)\n }\n\n const categories: CategoryNode[] = []\n // Same display order as the idle tree.\n for (const key of effectiveCategories(config, manual).map(e => e.key)) {\n const workspaceNodes = byCategory.get(key)\n if (workspaceNodes === undefined || workspaceNodes.length === 0) continue\n const appearance = categoryAppearance(manual, key)\n categories.push({\n key,\n label: key,\n expanded: true,\n containsCurrent: false,\n workspaces: workspaceNodes,\n ...(appearance === undefined ? {} : { appearance }),\n })\n }\n return {\n categories,\n topLevel,\n ...(defaultWorkspace === undefined ? {} : { defaultWorkspace }),\n }\n}\n","/**\n * The flower marker: an SVG overlay that draws a single bloom on the row you are\n * currently on.\n *\n * Originally ported from the RewampUI *Flower Sidebar* reference, which drew a\n * continuous curly stem down the whole tree — a dashed \"ghost\" route plus a\n * solid stroke \"grown\" to the active row — with a dot on every row and the bloom\n * at its tip. **The stem and the dots are gone**: they read as a stray black line\n * down the sidebar, and depth is already carried by the row indentation. Only the\n * bloom remains, still spinning while the current session works and resting when\n * it is idle.\n *\n * The SVG is `pointer-events: none` and `overflow: visible`, so it is pure\n * decoration over the real rows and never intercepts a click.\n *\n * Measurement, not layout: the rows are rendered by the tree itself (they carry\n * drag handlers, menus and hover state), so this component reads each row's\n * vertical centre and anchor from the DOM and feeds plain numbers to\n * `buildBranch`. That keeps the geometry unit-tested (`branch.ts`) while the SVG\n * stays a dumb renderer of it — and leaves the branch math intact should the stem\n * ever come back.\n *\n * Re-measured on: row count changes (expand/collapse, new session), the active\n * row changing, and container resize. A `ResizeObserver` on the scroll body\n * covers the last one without a window listener.\n *\n * The bloom's spin is NOT re-measured here: it arrives as the `spinning` prop\n * and is applied as a class, so a status flip never re-runs the DOM measurement\n * above (the tree is the expensive part, not the class swap).\n */\nimport { useEffect, useRef, useState } from 'react'\nimport { buildBranch, type Branch, type BranchRow } from './branch.ts'\n\n/**\n * Attribute the tree puts on every row the branch should connect. */\nexport const BRANCH_ROW_ATTRIBUTE = 'data-wg-branch-row'\n\n/**\n * Attribute marking the row the stem should grow to.\n *\n * Only the DEEPEST row gets this (the session). Its ancestors — the project and\n * the category that contain it — deliberately do NOT, because a session belongs\n * to both and marking all three would make \"which row is active?\" ambiguous.\n * When several rows do carry it, the deepest (last in document order) wins.\n */\nexport const BRANCH_ACTIVE_ATTRIBUTE = 'data-wg-branch-active'\n\n/** Row kind marker: a group boundary kinks the stem. */\nexport const BRANCH_GROUP_ATTRIBUTE = 'data-wg-branch-group'\n\n/**\n * The bloom's petal outline, in the 1024-unit box the artwork was drawn in.\n *\n * This is the user's own flower glyph verbatim: an eight-petal bloom around a\n * ringed center. Kept as a path (not a component) because it is a constant.\n */\nconst FLOWER_PATH = 'M375.3728 841.8432c92.96-12.5184 203.8784-71.264 299.5456-166.9248 22.6112-22.6112 43.1616-46.08 61.5232-69.952C712.7616 786.3936 621.2608 921.6 512 921.6c-51.1488 0-98.4-29.632-136.6272-79.7568z m-87.808-422.8096C311.2384 237.6064 402.7328 102.4 512 102.4c51.1488 0 98.4 29.632 136.6272 79.7568-92.96 12.5184-203.8784 71.264-299.5456 166.9248a719.1232 719.1232 0 0 0-61.5232 69.952z m-129.536 139.5648c57.3248 74.2464 163.6608 140.9344 294.336 175.9488a719.1232 719.1232 0 0 0 91.3472 18.304c-168.9664 70.208-331.808 58.5728-386.432-36.0512-25.5744-44.288-23.5456-100.032 0.7552-158.2016z m322.2592-287.4496c168.9664-70.208 331.808-58.5728 386.432 36.0512 25.5744 44.288 23.5456 100.032-0.7552 158.2016-57.3184-74.2464-163.648-140.9344-294.336-175.9488a719.1232 719.1232 0 0 0-91.3408-18.304zM294.656 228.7552c-35.6352 86.7648-40.224 212.1984-5.2032 342.8736a719.1232 719.1232 0 0 0 29.8176 88.256C173.9904 548.6592 102.6432 401.824 157.2736 307.2c25.5744-44.288 74.8608-70.4 137.3824-78.4448z m410.0736 135.36c145.28 111.2256 216.6272 258.0608 161.9968 352.6848-25.5744 44.288-74.8608 70.4-137.3824 78.4448 35.6352-86.7648 40.224-212.1984 5.2032-342.8736a719.1232 719.1232 0 0 0-29.8176-88.256zM512 678.4c-88.3648 0-160-71.6352-160-160s71.6352-160 160-160 160 71.6352 160 160-71.6352 160-160 160z m0-83.2c42.4128 0 76.8-34.3872 76.8-76.8s-34.3872-76.8-76.8-76.8-76.8 34.3872-76.8 76.8 34.3872 76.8 76.8 76.8z'\n\n/** Petal colour: the accent the glyph was drawn in. */\nconst FLOWER_PETAL = '#fa541c'\n\n/**\n * Rendered size of the bloom, as a scale factor over the authored 1024 box.\n *\n * 17 / 1024 ≈ 0.0166 puts the flower at ~17px: clear of neighbouring rows (rows\n * are 28px tall) while still reading as a flower rather than a dot at the end of\n * the stem.\n */\nconst FLOWER_SCALE = 17 / 1024\n\n/**\n * Centre of the artwork inside its own 1024-unit box, measured from the path.\n *\n * Both the recentring AND the rotation are expressed with this ONE pair of user\n * units, so neither depends on a percentage or on a reference box. Verified\n * against the live DOM: the path's own `getBBox()` centre is exactly (512, 512).\n */\nconst FLOWER_CENTRE = 512\n\n/**\n * The bloom at the branch's endpoint.\n *\n * Anchoring is done entirely by these transforms, in this order:\n *\n * 1. `translate(cx cy)` — put the origin on the stem's tip (the endpoint of\n * the grown stroke).\n * 2. `scale(FLOWER_SCALE)` — shrink the 1024-unit artwork about that origin.\n * 3. `translate(-512 -512)` — bring the glyph's own centre (512, 512) onto the\n * origin, so the flower is centred on the tip.\n *\n * The spin is applied by `wgFlowerArt` in CSS as a `rotate()` composed AFTER\n * that recentring (`translate(-512 -512) rotate(...)`), so the bloom turns about\n * its own centre and the recentring never drifts as it rotates.\n *\n * Note what is deliberately NOT used here: a percentage `translate(-50%, -50%)`\n * or `transform-box: fill-box` + percentage `transform-origin`. Measured on the\n * live page, the percentage form resolved against the SVG VIEWPORT rather than\n * the path's box, translating by (-24, -409.5) instead of (-373, -409.6) and\n * parking the bloom well right of the stem. Explicit user units remove the\n * question: 512 is the measured centre, not an inferred one.\n *\n * The flower rests while the session is idle and turns while it works: one\n * animation, paused rather than removed, so a state flip resumes the turn\n * instead of snapping the petals back to 0deg.\n *\n * @param props - endpoint coordinates and whether the session is working.\n * @returns the bloom group.\n */\n/** In-flow session marker: its position follows the row, including disclosure animations. */\nexport function SessionFlower({ spinning }: { spinning: boolean }) {\n return (\n \n \n \n )\n}\n\nfunction Flower({ cx, cy, spinning }: { cx: number; cy: number; spinning: boolean }) {\n return (\n \n \n \n )\n}\n\n/**\n * Render the branch for the rows currently inside `scope`.\n * @param props - the element to measure, and whether the open session is working.\n * @returns the SVG overlay, or null until at least one row is measured.\n */\nexport function FlowerBranch({ scope, spinning }: { scope: HTMLElement | null; spinning: boolean }) {\n const [rows, setRows] = useState([])\n\n // A cheap change key: the caller cannot tell us when a row expanded, so we\n // watch the attribute count and the active row instead of diffing every node.\n const measureKey = useRef('')\n // The measured pixel pitch is per-list, not the module default: our rows are\n // 28/30px tall in places, and assuming 32 would drift the dots off the rows.\n const [branch, setBranch] = useState(null)\n\n useEffect(() => {\n if (scope === null) {\n setRows([])\n setBranch(null)\n return\n }\n\n const measure = (): void => {\n const nodes = Array.from(scope.querySelectorAll(`[${BRANCH_ROW_ATTRIBUTE}]`))\n const first = nodes[0]\n if (first === undefined) {\n if (measureKey.current !== '') {\n measureKey.current = ''\n setRows([])\n setBranch(null)\n }\n return\n }\n\n // Exactly one row carries the marker (the session); if a caller ever marks\n // several, the deepest wins so the stem still lands on a real leaf.\n const activeIndex = nodes.reduce(\n (found, node, index) => (node.hasAttribute(BRANCH_ACTIVE_ATTRIBUTE) ? index : found),\n -1,\n )\n const kinds = nodes.map(n => (n.hasAttribute(BRANCH_GROUP_ATTRIBUTE) ? 'group' : 'item')).join('')\n const key = `${nodes.length}|${activeIndex}|${kinds}|${Math.round(scope.clientWidth)}`\n if (key === measureKey.current) return\n measureKey.current = key\n\n // Each row carries its OWN measured anchor: y because the tree mixes row\n // heights, x because it indents per row via padding (a folder's chevron and\n // a session's text do not share an x).\n const measured: BranchRow[] = nodes.map((node, index) => ({\n key: `${index}`,\n y: center(node),\n x: anchorX(node),\n kind: node.hasAttribute(BRANCH_GROUP_ATTRIBUTE) ? 'group' : 'item',\n active: index === activeIndex,\n }))\n\n setRows(measured)\n setBranch(buildBranch(measured))\n }\n\n /** Vertical centre of a node, relative to the scope box. */\n function center(node: HTMLElement): number {\n const r = node.getBoundingClientRect()\n const s = (scope as HTMLElement).getBoundingClientRect()\n return r.top - s.top + r.height / 2\n }\n\n /**\n * Horizontal anchor of a row, relative to the scope box.\n *\n * A row with a chevron anchors to that triangle's CENTRE: it is the marker\n * the user already reads as \"this row opens\", so the stem hangs off it\n * instead of floating beside it. A chevron-less row (a session) has no\n * marker, so it anchors to where its own content starts — the status dot's\n * centre, which is the first thing in the row.\n */\n function anchorX(node: HTMLElement): number {\n const s = (scope as HTMLElement).getBoundingClientRect()\n const marker = node.querySelector('.wgChevron')\n ?? node.querySelector('[class*=\"wgStatusSlot\"]')\n ?? node.querySelector('[class*=\"wgCategoryIcon\"]')\n ?? node.querySelector('[class*=\"wgRowIcon\"]')\n const box = (marker ?? node).getBoundingClientRect()\n return box.left - s.left + box.width / 2\n }\n\n measure()\n\n // Row set changes (expand/collapse/new session) arrive as childList edits.\n const observer = new MutationObserver(measure)\n observer.observe(scope, { childList: true, subtree: true, attributes: true, attributeFilter: [BRANCH_ACTIVE_ATTRIBUTE] })\n\n // Width changes reflow row heights in the rail/wide layouts.\n const resizer = new ResizeObserver(measure)\n resizer.observe(scope)\n\n return () => {\n observer.disconnect()\n resizer.disconnect()\n }\n }, [scope])\n\n if (branch === null || rows.length === 0) return null\n\n // Only the bloom is drawn. The stem (ghost + grown stroke) and the per-row\n // dots were removed on request: they read as a stray black line down the\n // sidebar and the depth is already carried by the indentation, so the flower\n // alone marks the row you are on. `branch` is still BUILT from the measured\n // rows — it is what gives the bloom its position — but its path geometry is\n // no longer rendered.\n if (branch.flower === null) return null\n\n return (\n \n \n \n )\n}\n","/**\n * Self-drawn monochrome artwork for the \"Materials & Lab\" icon family.\n *\n * The Host primitive package only ships product/generic glyphs, so the 28\n * research icons are drawn here in the exact same visual language as the Host\n * ones: a 16x16 viewBox, `currentColor` stroke, 1.3 stroke width (Host\n * `ICON_MEDIUM_STROKE`), round caps/joins and no fill. Keeping the artwork as\n * primitive data (instead of one opaque `` per icon) lets the icon test\n * assert every coordinate stays inside the viewBox and that each id has\n * artwork — a hand-tuned path string could silently drift out of frame.\n */\nimport type { ReactElement } from 'react'\n\n/** One drawable primitive of a 16x16 icon; coordinates are in viewBox units. */\nexport type SciencePrimitive =\n | { readonly kind: 'line'; readonly x1: number; readonly y1: number; readonly x2: number; readonly y2: number }\n | {\n readonly kind: 'rect'\n readonly x: number\n readonly y: number\n readonly width: number\n readonly height: number\n readonly radius?: number\n }\n | { readonly kind: 'circle'; readonly cx: number; readonly cy: number; readonly radius: number; readonly filled?: boolean }\n | {\n readonly kind: 'ellipse'\n readonly cx: number\n readonly cy: number\n readonly rx: number\n readonly ry: number\n /** Rotation around the icon centre (8,8), in degrees. */\n readonly rotate?: number\n }\n | { readonly kind: 'path'; readonly d: string }\n\n/** Ids appended to the shared registry; order is the picker's section order. */\nexport const SCIENCE_ICON_IDS = [\n // Lab operations\n 'test-tube', 'flask', 'pipette', 'dropper', 'stirrer', 'hotplate', 'centrifuge', 'balance',\n // Material structures\n 'atom', 'molecule', 'lattice', 'layered', 'framework', 'thin-film', 'fiber', 'hydrogel',\n // Characterization\n 'microscope', 'xrd', 'spectrum', 'tensile', 'electrode', 'iv-curve',\n // Functional devices\n 'illumination', 'temperature', 'humidity', 'actuator', 'flex-sensor', 'battery',\n] as const\n\n/** Union of the research icon ids (a subset of the shared `GroupIconId`). */\nexport type ScienceIconId = (typeof SCIENCE_ICON_IDS)[number]\n\n/** The picker's section split of the research family. */\nexport const SCIENCE_ICON_SECTIONS = [\n { key: 'lab', ids: ['test-tube', 'flask', 'pipette', 'dropper', 'stirrer', 'hotplate', 'centrifuge', 'balance'] },\n { key: 'materials', ids: ['atom', 'molecule', 'lattice', 'layered', 'framework', 'thin-film', 'fiber', 'hydrogel'] },\n { key: 'characterization', ids: ['microscope', 'xrd', 'spectrum', 'tensile', 'electrode', 'iv-curve'] },\n { key: 'devices', ids: ['illumination', 'temperature', 'humidity', 'actuator', 'flex-sensor', 'battery'] },\n] as const satisfies readonly { readonly key: string; readonly ids: readonly ScienceIconId[] }[]\n\n/** Primitive artwork per research icon. */\nexport const SCIENCE_ICON_ART: Record = {\n // ---- Lab operations ------------------------------------------------------\n 'test-tube': [\n { kind: 'path', d: 'M5.2 2.8v7.6a2.8 2.8 0 0 0 5.6 0V2.8' },\n { kind: 'line', x1: 4.5, y1: 2.8, x2: 11.5, y2: 2.8 },\n { kind: 'line', x1: 5.2, y1: 8.4, x2: 10.8, y2: 8.4 },\n ],\n flask: [\n { kind: 'path', d: 'M6.2 2.4v3.4L3 11.6a1.6 1.6 0 0 0 1.4 2.4h7.2a1.6 1.6 0 0 0 1.4-2.4L9.8 5.8V2.4' },\n { kind: 'line', x1: 5.2, y1: 2.4, x2: 10.8, y2: 2.4 },\n { kind: 'line', x1: 5.2, y1: 9.8, x2: 10.8, y2: 9.8 },\n ],\n pipette: [\n { kind: 'line', x1: 8, y1: 1.5, x2: 8, y2: 2.4 },\n { kind: 'rect', x: 6.1, y: 2.5, width: 3.8, height: 6.4, radius: 1.1 },\n { kind: 'line', x1: 6.1, y1: 4.6, x2: 7.2, y2: 4.6 },\n { kind: 'line', x1: 6.1, y1: 6.1, x2: 7.2, y2: 6.1 },\n { kind: 'path', d: 'M7.3 8.9L8 13.2L8.7 8.9' },\n ],\n dropper: [\n { kind: 'rect', x: 5.1, y: 2.1, width: 5.8, height: 4.2, radius: 2.1 },\n { kind: 'line', x1: 6.6, y1: 6.3, x2: 6.6, y2: 10.3 },\n { kind: 'line', x1: 9.4, y1: 6.3, x2: 9.4, y2: 10.3 },\n { kind: 'path', d: 'M6.6 10.3L8 13.4L9.4 10.3' },\n { kind: 'circle', cx: 11.9, cy: 12.2, radius: 0.95, filled: true },\n ],\n stirrer: [\n { kind: 'circle', cx: 8, cy: 6.1, radius: 2.5 },\n { kind: 'path', d: 'M6.4 6.1c1-.9 2.2-.9 3.2 0' },\n { kind: 'rect', x: 2, y: 9.6, width: 12, height: 4.2, radius: 1.2 },\n { kind: 'circle', cx: 11.4, cy: 11.7, radius: 0.85, filled: true },\n ],\n hotplate: [\n { kind: 'path', d: 'M5.4 8.4c1.2-.9 1.2-2.1 0-3' },\n { kind: 'path', d: 'M8 8.4c1.2-.9 1.2-2.1 0-3' },\n { kind: 'path', d: 'M10.6 8.4c1.2-.9 1.2-2.1 0-3' },\n { kind: 'rect', x: 2, y: 9.6, width: 12, height: 4.2, radius: 1.2 },\n { kind: 'circle', cx: 11.4, cy: 11.7, radius: 0.85, filled: true },\n ],\n centrifuge: [\n { kind: 'circle', cx: 8, cy: 5.6, radius: 3.4 },\n { kind: 'line', x1: 8, y1: 5.6, x2: 8, y2: 2.3 },\n { kind: 'line', x1: 8, y1: 5.6, x2: 5.1, y2: 7.3 },\n { kind: 'line', x1: 8, y1: 5.6, x2: 10.9, y2: 7.3 },\n { kind: 'circle', cx: 8, cy: 5.6, radius: 0.9, filled: true },\n { kind: 'line', x1: 8, y1: 9, x2: 8, y2: 9.8 },\n { kind: 'rect', x: 2.6, y: 9.8, width: 10.8, height: 3.4, radius: 1 },\n ],\n balance: [\n { kind: 'path', d: 'M4.1 7.8h7.8' },\n { kind: 'path', d: 'M5 7.8a3 3 0 0 0 6 0' },\n { kind: 'line', x1: 8, y1: 9.3, x2: 8, y2: 10.4 },\n { kind: 'rect', x: 2.2, y: 10.4, width: 11.6, height: 3.2, radius: 1 },\n { kind: 'rect', x: 9.6, y: 11.2, width: 2.6, height: 1.5, radius: 0.3 },\n ],\n\n // ---- Material structures -------------------------------------------------\n atom: [\n { kind: 'ellipse', cx: 8, cy: 8, rx: 6.2, ry: 2.5 },\n { kind: 'ellipse', cx: 8, cy: 8, rx: 6.2, ry: 2.5, rotate: 60 },\n { kind: 'ellipse', cx: 8, cy: 8, rx: 6.2, ry: 2.5, rotate: -60 },\n { kind: 'circle', cx: 8, cy: 8, radius: 1.05, filled: true },\n ],\n molecule: [\n { kind: 'line', x1: 5, y1: 4.2, x2: 11, y2: 4.2 },\n { kind: 'line', x1: 4.5, y1: 5.4, x2: 6.9, y2: 9.7 },\n { kind: 'line', x1: 11.5, y1: 5.4, x2: 9.1, y2: 9.7 },\n { kind: 'circle', cx: 3.6, cy: 4.2, radius: 1.35 },\n { kind: 'circle', cx: 12.4, cy: 4.2, radius: 1.35 },\n { kind: 'circle', cx: 8, cy: 11.6, radius: 1.35 },\n ],\n lattice: [\n { kind: 'line', x1: 3.6, y1: 3.6, x2: 3.6, y2: 12.4 },\n { kind: 'line', x1: 8, y1: 3.6, x2: 8, y2: 12.4 },\n { kind: 'line', x1: 12.4, y1: 3.6, x2: 12.4, y2: 12.4 },\n { kind: 'line', x1: 3.6, y1: 3.6, x2: 12.4, y2: 3.6 },\n { kind: 'line', x1: 3.6, y1: 8, x2: 12.4, y2: 8 },\n { kind: 'line', x1: 3.6, y1: 12.4, x2: 12.4, y2: 12.4 },\n { kind: 'circle', cx: 3.6, cy: 3.6, radius: 0.85, filled: true },\n { kind: 'circle', cx: 8, cy: 3.6, radius: 0.85, filled: true },\n { kind: 'circle', cx: 12.4, cy: 3.6, radius: 0.85, filled: true },\n { kind: 'circle', cx: 3.6, cy: 8, radius: 0.85, filled: true },\n { kind: 'circle', cx: 8, cy: 8, radius: 0.85, filled: true },\n { kind: 'circle', cx: 12.4, cy: 8, radius: 0.85, filled: true },\n { kind: 'circle', cx: 3.6, cy: 12.4, radius: 0.85, filled: true },\n { kind: 'circle', cx: 8, cy: 12.4, radius: 0.85, filled: true },\n { kind: 'circle', cx: 12.4, cy: 12.4, radius: 0.85, filled: true },\n ],\n layered: [\n { kind: 'rect', x: 2.6, y: 3, width: 10.8, height: 2.3, radius: 0.6 },\n { kind: 'rect', x: 3.6, y: 6.85, width: 10.8, height: 2.3, radius: 0.6 },\n { kind: 'rect', x: 2.6, y: 10.7, width: 10.8, height: 2.3, radius: 0.6 },\n ],\n framework: [\n { kind: 'rect', x: 2.6, y: 2.8, width: 10.8, height: 10.4, radius: 0.8 },\n { kind: 'line', x1: 8, y1: 2.8, x2: 8, y2: 13.2 },\n { kind: 'line', x1: 2.6, y1: 8, x2: 13.4, y2: 8 },\n { kind: 'circle', cx: 5.3, cy: 5.3, radius: 0.8, filled: true },\n { kind: 'circle', cx: 10.7, cy: 5.3, radius: 0.8, filled: true },\n { kind: 'circle', cx: 5.3, cy: 10.7, radius: 0.8, filled: true },\n { kind: 'circle', cx: 10.7, cy: 10.7, radius: 0.8, filled: true },\n ],\n 'thin-film': [\n { kind: 'path', d: 'M2.6 7.6q1.35-1.6 2.7 0t2.7 0t2.7 0t2.7 0' },\n { kind: 'line', x1: 2.6, y1: 9.4, x2: 13.4, y2: 9.4 },\n { kind: 'rect', x: 2.6, y: 10.6, width: 10.8, height: 2.6, radius: 0.6 },\n ],\n fiber: [\n { kind: 'path', d: 'M5 2.4c1 1.6-1 2.4 0 4s-1 2.4 0 4 0 1.6 0 3.2' },\n { kind: 'path', d: 'M8 2.4c1 1.6-1 2.4 0 4s-1 2.4 0 4 0 1.6 0 3.2' },\n { kind: 'path', d: 'M11 2.4c1 1.6-1 2.4 0 4s-1 2.4 0 4 0 1.6 0 3.2' },\n { kind: 'rect', x: 2.9, y: 7.2, width: 10.2, height: 1.8, radius: 0.9 },\n ],\n hydrogel: [\n { kind: 'rect', x: 2.4, y: 4.4, width: 11.2, height: 8.4, radius: 4.2 },\n { kind: 'path', d: 'M5.4 7.3L8 9.4L10.6 6.9L5.4 7.3' },\n { kind: 'circle', cx: 5.4, cy: 7.3, radius: 0.8, filled: true },\n { kind: 'circle', cx: 8, cy: 9.4, radius: 0.8, filled: true },\n { kind: 'circle', cx: 10.6, cy: 6.9, radius: 0.8, filled: true },\n ],\n\n // ---- Characterization ----------------------------------------------------\n microscope: [\n { kind: 'line', x1: 5.9, y1: 2.1, x2: 8.9, y2: 5.1 },\n { kind: 'circle', cx: 5.4, cy: 1.9, radius: 0.9 },\n { kind: 'circle', cx: 9.5, cy: 7.4, radius: 1.1 },\n { kind: 'path', d: 'M11 6.6c1.5 1.5 1.5 3.8 0 5.3' },\n { kind: 'line', x1: 4.2, y1: 10.4, x2: 11.6, y2: 10.4 },\n { kind: 'line', x1: 9.9, y1: 10.4, x2: 9.9, y2: 13.2 },\n { kind: 'line', x1: 3, y1: 13.2, x2: 12.6, y2: 13.2 },\n ],\n xrd: [\n { kind: 'path', d: 'M2.6 13.2V2.9h11' },\n {\n kind: 'path',\n d: 'M3.4 12.4h1.9l.6-4.6.6 4.6h1.9l.7-2.6.6 2.6h1.9l.9-6.1.7 6.1h1.3',\n },\n ],\n spectrum: [\n { kind: 'path', d: 'M6.6 4.4L9.8 10.6H3.4z' },\n { kind: 'line', x1: 1.2, y1: 8.4, x2: 4.4, y2: 8.4 },\n { kind: 'line', x1: 9.2, y1: 9.2, x2: 13.4, y2: 4.8 },\n { kind: 'line', x1: 9.6, y1: 10, x2: 13.7, y2: 6.4 },\n { kind: 'line', x1: 9.8, y1: 10.6, x2: 13.8, y2: 8.6 },\n ],\n tensile: [\n { kind: 'rect', x: 5.8, y: 7.2, width: 4.4, height: 1.6, radius: 0.4 },\n { kind: 'line', x1: 4.4, y1: 5.8, x2: 4.4, y2: 10.2 },\n { kind: 'line', x1: 11.6, y1: 5.8, x2: 11.6, y2: 10.2 },\n { kind: 'path', d: 'M2.4 8h1.7' },\n { kind: 'path', d: 'M3.3 7.2l.8.8-.8.8' },\n { kind: 'path', d: 'M13.6 8h-1.7' },\n { kind: 'path', d: 'M12.7 7.2l-.8.8.8.8' },\n { kind: 'line', x1: 8, y1: 4.9, x2: 8, y2: 3.2 },\n { kind: 'path', d: 'M7.2 4l.8-.8.8.8' },\n { kind: 'line', x1: 8, y1: 11.1, x2: 8, y2: 12.8 },\n { kind: 'path', d: 'M7.2 12l.8.8.8-.8' },\n ],\n electrode: [\n { kind: 'path', d: 'M3.2 8.6v4.4a1.2 1.2 0 0 0 1.2 1.2h7.2a1.2 1.2 0 0 0 1.2-1.2V8.6' },\n { kind: 'line', x1: 3.2, y1: 10.6, x2: 12.8, y2: 10.6 },\n { kind: 'line', x1: 6, y1: 2.4, x2: 6, y2: 10.6 },\n { kind: 'line', x1: 10, y1: 2.4, x2: 10, y2: 10.6 },\n { kind: 'line', x1: 5.2, y1: 2.4, x2: 6.8, y2: 2.4 },\n { kind: 'line', x1: 9.2, y1: 2.4, x2: 10.8, y2: 2.4 },\n ],\n 'iv-curve': [\n { kind: 'path', d: 'M2.8 13.2V3.2h10.4' },\n { kind: 'path', d: 'M3.6 12.4c2.6 0 2.7-4.6 5-5.6s3.4-2.6 4.3-3.4' },\n { kind: 'circle', cx: 8.6, cy: 6.8, radius: 0.8, filled: true },\n ],\n\n // ---- Functional devices --------------------------------------------------\n illumination: [\n { kind: 'rect', x: 4.6, y: 1.8, width: 6.8, height: 2.6, radius: 0.7 },\n { kind: 'line', x1: 6.2, y1: 4.9, x2: 4.6, y2: 8.4 },\n { kind: 'line', x1: 8, y1: 4.9, x2: 8, y2: 9 },\n { kind: 'line', x1: 9.8, y1: 4.9, x2: 11.4, y2: 8.4 },\n { kind: 'line', x1: 2.6, y1: 12.6, x2: 13.4, y2: 12.6 },\n ],\n temperature: [\n { kind: 'rect', x: 6.9, y: 2.4, width: 2.2, height: 8.2, radius: 1.1 },\n { kind: 'circle', cx: 8, cy: 12.2, radius: 1.9 },\n { kind: 'line', x1: 8, y1: 6.4, x2: 8, y2: 11.4 },\n { kind: 'line', x1: 9.1, y1: 4.8, x2: 10, y2: 4.8 },\n { kind: 'line', x1: 9.1, y1: 7, x2: 10, y2: 7 },\n { kind: 'line', x1: 9.1, y1: 9.2, x2: 10, y2: 9.2 },\n ],\n humidity: [\n { kind: 'path', d: 'M8 2.1c0 0-4.2 5-4.2 7.9a4.2 4.2 0 0 0 8.4 0C12.2 7.1 8 2.1 8 2.1z' },\n { kind: 'path', d: 'M6 10.2c1.3-1 2.7-1 4 0' },\n ],\n actuator: [\n { kind: 'path', d: 'M2.6 12.6c6 .4 9.2-1.8 10.2-6.4' },\n { kind: 'path', d: 'M2.6 10.6c5.2.3 7.8-1.6 8.6-5.2' },\n { kind: 'line', x1: 2.6, y1: 9.6, x2: 2.6, y2: 14 },\n ],\n 'flex-sensor': [\n { kind: 'path', d: 'M2.8 4.2v8.2h3.4V4.2h3.4v8.2h3.4V4.2' },\n { kind: 'circle', cx: 2.8, cy: 3.2, radius: 0.8, filled: true },\n { kind: 'circle', cx: 13, cy: 3.2, radius: 0.8, filled: true },\n { kind: 'circle', cx: 8, cy: 8.2, radius: 1.1 },\n ],\n battery: [\n { kind: 'rect', x: 1.8, y: 5.4, width: 11, height: 5.4, radius: 1 },\n { kind: 'rect', x: 12.8, y: 7.1, width: 1.6, height: 2, radius: 0.4 },\n { kind: 'path', d: 'M8.8 6.3L6.8 8.8h2.2l-1.4 2.5' },\n ],\n}\n\n/** Research icon id → picker section key. */\nexport const SCIENCE_ICON_SECTION_OF: Record = {\n 'test-tube': 'lab', flask: 'lab', pipette: 'lab', dropper: 'lab',\n stirrer: 'lab', hotplate: 'lab', centrifuge: 'lab', balance: 'lab',\n atom: 'materials', molecule: 'materials', lattice: 'materials', layered: 'materials',\n framework: 'materials', 'thin-film': 'materials', fiber: 'materials', hydrogel: 'materials',\n microscope: 'characterization', xrd: 'characterization', spectrum: 'characterization',\n tensile: 'characterization', electrode: 'characterization', 'iv-curve': 'characterization',\n illumination: 'devices', temperature: 'devices', humidity: 'devices',\n actuator: 'devices', 'flex-sensor': 'devices', battery: 'devices',\n}\n\nfunction Primitive({ primitive }: { primitive: SciencePrimitive }): ReactElement {\n switch (primitive.kind) {\n case 'line':\n return \n case 'rect':\n return (\n \n )\n case 'circle':\n return (\n \n )\n case 'ellipse':\n return (\n \n )\n case 'path':\n return \n }\n}\n\n/**\n * Render one research icon in the Host glyph's visual language: 16x16,\n * `currentColor` stroke, 1.3px, round joins, decorative for screen readers (the\n * row/picker button already carries the bilingual name).\n * @param props.icon - research icon id.\n * @param props.size - rendered square size in CSS pixels (default 16, like Host glyphs).\n */\nexport function ScienceGlyph({ icon, size = 16 }: { icon: ScienceIconId; size?: number }): ReactElement {\n return (\n \n {SCIENCE_ICON_ART[icon].map((primitive, index) => (\n \n ))}\n \n )\n}\n\n/** Research icon id → rendered node, merged into the row icon registry. */\nexport function scienceIconNodes(): Record {\n const nodes: Partial> = {}\n for (const id of SCIENCE_ICON_IDS) nodes[id] = \n return nodes as Record\n}\n","/**\n * Row components for the workspace-groups tree. Kept dependency-light: they\n * consume only React, primitives (StateDot/Menu/icons), and the shared CSS\n * string. Each row owns its hover actions menu; dialogs live in the browser\n * root so they survive row unmounts during collapse.\n *\n * Drag & drop: workspace rows are draggable sources; category rows (and\n * workspace rows, standing for their containing category) are drop targets.\n * The payload is a custom dataTransfer type so only in-plugin drags land.\n */\nimport { useEffect, useRef, useState, type AnimationEvent, type DragEvent, type ReactNode } from 'react'\nimport {\n IconNewChatOutlineMedium,\n IconSearchOutlineMedium,\n IconSettingsOutlineMedium,\n IconDeliverDocMedium,\n IconEditOutlineMedium,\n IconThinkOutlineMedium,\n IconAgentPresetOutlineMedium,\n IconBrowseOutlineMedium,\n IconContextInjectionOutlineMedium,\n IconLinkOutlineMedium,\n IconShareOutlineMedium,\n IconUserOutlineMedium,\n IconPaperPlaneOutlineMedium,\n IconPaperclipOutlineMedium,\n IconDownloadOutlineMedium,\n IconPlayOutlineMedium,\n IconPersonalizationOutlineMedium,\n IconDarkOutlineMedium,\n IconFollowsystemOutlineMedium,\n IconGaugeOutlineMedium,\n IconQueueOutlineMedium,\n IconListPenOutlineMedium,\n IconInspectOutlineMedium,\n IconQuestionOutlineMedium,\n IconInfoOutlineMedium,\n IconAlarmClockOutlineMedium,\n IconCompareSplitOutlineMedium,\n IconCheckCircleOutlineMedium,\n IconPinOutlineMedium,\n IconMicrophoneOutlineMedium,\n IconApiOutlineMedium,\n IconArchiveOutlineRegular,\n IconArchiveOutlineMedium,\n IconBranchOutlineMedium,\n IconBranchOutlineRegular,\n IconChecklistOutlineMedium,\n IconClockOutlineMedium,\n IconCodeOutlineMedium,\n IconCordisPluginOutlineMedium,\n IconDataOutlineMedium,\n IconDatabaseOutlineMedium,\n IconEditOutlineRegular,\n IconEllipsisOutlineRegular,\n IconFolderCloseMedium,\n IconFolderOpenMedium,\n IconFolderOpenOutlineRegular,\n IconGlobeOutlineMedium,\n IconGoalOutlineMedium,\n IconLightOutlineMedium,\n IconPinFillMedium,\n IconPinOutlineRegular,\n IconPlanOutlineMedium,\n IconPlusOutlineRegular,\n IconProjectAddOutlineMedium,\n IconRightUpOutlineRegular,\n IconShieldOutlineMedium,\n IconSkillOutlineMedium,\n IconSlidersTwoOutlineRegular,\n IconSparkleMedium,\n IconTreeCornerMedium,\n IconTrashOutlineRegular,\n IconUsersOutlineMedium,\n IconWorkspaceTreeOutlineMedium,\n Menu,\n StateDot,\n type MenuEntry,\n type StateDotState,\n} from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { WorkspaceGroupsKey } from './locales.ts'\nimport { SessionFlower } from './FlowerBranch.tsx'\nimport { scienceIconNodes, type ScienceIconId } from './group-icons-science.tsx'\nimport type { GroupIconId } from '../core/types.ts'\nimport type { CategoryNode, FolderNode, SessionNode, WorkspaceGroupNode } from './tree.ts'\n\ntype T = TranslateNS<'workspaceGroups'>\n\n/** dataTransfer type carrying the dragged workspace id (in-plugin drags only). */\nexport const DND_WORKSPACE_TYPE = 'application/x-dsh-workspace-groups'\n/** dataTransfer type carrying the dragged category key (group reorder). */\nexport const DND_CATEGORY_TYPE = 'application/x-dsh-workspace-groups-category'\n\n/** Whether a drag carries any of the plugin's payloads (drop targets accept both). */\nexport function hasPluginDragType(types: DOMStringList | readonly string[]): boolean {\n const list = Array.from(types as Iterable)\n return list.includes(DND_WORKSPACE_TYPE) || list.includes(DND_CATEGORY_TYPE)\n}\n\n/** Pending interaction status → primitives StateDot state. */\nfunction pendingState(status: SessionNode['pendingInteraction']): StateDotState | undefined {\n switch (status) {\n case 'approval':\n case 'plan-review':\n case 'question':\n return 'warning'\n default:\n return undefined\n }\n}\n\n/** Primary status dot state for a session row. */\nexport function sessionDotState(node: Pick): StateDotState {\n if (pendingState(node.pendingInteraction) !== undefined) return 'warning'\n if (node.running || node.runningSubagentCount > 0) return 'ongoing'\n return node.completed ? 'done' : 'done'\n}\n\n/** Compact relative time (\"now\"/\"5min\"/\"3h\"/\"2d\"/\"4mo\"/\"1y\"). */\nexport function relativeTimeLabel(updatedAt: number, now: number): string {\n const diff = Math.max(0, now - updatedAt)\n const MIN = 60_000\n const HOUR = 3_600_000\n const DAY = 86_400_000\n if (diff < MIN) return 'now'\n if (diff < HOUR) return `${Math.floor(diff / MIN)}min`\n if (diff < DAY) return `${Math.floor(diff / HOUR)}h`\n if (diff < 30 * DAY) return `${Math.floor(diff / DAY)}d`\n if (diff < 365 * DAY) return `${Math.floor(diff / (30 * DAY))}mo`\n return `${Math.floor(diff / (365 * DAY))}y`\n}\n\n/** Drop-target props shared by category and workspace rows (all optional). */\nexport interface RowDropProps {\n /** Row is under the dragged workspace — show the drop highlight. */\n dropActive?: boolean\n /** Insertion indicator: a line above (before) or below (after) this row. */\n insertLine?: 'before' | 'after'\n /** Accept a drag over this row (must preventDefault to allow the drop). */\n onRowDragOver?: (event: DragEvent) => void\n /** Clear the highlight when the pointer leaves the row. */\n onRowDragLeave?: (event: DragEvent) => void\n /** Drop a workspace onto this row. */\n onRowDrop?: (event: DragEvent) => void\n}\n\n/**\n * Preset group icon ids → primitives artwork. Medium stroke to match the\n * folder glyph used by unprefixed groups. Keyed by plain string so an id from\n * a newer host (or a hand-edited JSON file) degrades instead of throwing.\n */\nconst HOST_CATEGORY_ICONS = {\n folder: ,\n workspace: ,\n code: ,\n plugin: ,\n skill: ,\n data: ,\n database: ,\n api: ,\n plan: ,\n goal: ,\n light: ,\n globe: ,\n archive: ,\n branch: ,\n users: ,\n clock: ,\n shield: ,\n checklist: ,\n sparkle: ,\n tree: ,\n chat: ,\n search: ,\n settings: ,\n document: ,\n edit: ,\n think: ,\n agent: ,\n browse: ,\n context: ,\n link: ,\n share: ,\n user: ,\n send: ,\n attachment: ,\n download: ,\n play: ,\n design: ,\n moon: ,\n monitor: ,\n gauge: ,\n queue: ,\n notes: ,\n inspect: ,\n help: ,\n info: ,\n alarm: ,\n compare: ,\n done: ,\n pin: ,\n microphone: ,\n} satisfies Record, ReactNode>\n\n/**\n * Registered icon id → rendered artwork. The research family is merged in from\n * its own module: those glyphs are drawn locally (the Host primitive package\n * ships no lab/material icons) but must render through the very same path.\n */\nconst CATEGORY_ICONS: Record = {\n ...HOST_CATEGORY_ICONS,\n ...scienceIconNodes(),\n}\n\n/**\n * Resolve a stored `appearance.icon` value: a preset id renders the artwork,\n * a 1–4 character glyph renders as text, and anything else returns null so the\n * caller keeps the default folder icon.\n */\nfunction resolveCategoryIcon(icon: string | undefined): ReactNode | null {\n if (icon === undefined || icon === '') return null\n const preset = Object.prototype.hasOwnProperty.call(CATEGORY_ICONS, icon) ? CATEGORY_ICONS[icon] : undefined\n if (preset !== undefined) return preset\n return Array.from(icon).length <= 4 ? {icon} : null\n}\n\n/**\n * Render one stored icon value (preset artwork or a short glyph). Shared by the\n * category row's icon slot and the appearance picker grid, so both show exactly\n * the same artwork. `fallback` renders when the value is empty or unknown.\n */\nexport function CategoryGlyph({ icon, fallback = null }: { icon: string | undefined; fallback?: ReactNode }): JSX.Element {\n return <>{resolveCategoryIcon(icon) ?? fallback}\n}\n\n/**\n * One category folder row: toggle, rename/delete menu (every group — rule\n * groups via overlay renames/hides), draggable source for group reorder and\n * drop target for both workspace moves and group reorders.\n */\nexport function CategoryRow({ node, t, onToggle, onAddWorkspace, addingWorkspace = false, onRename, onDelete, onTogglePin, onEditAppearance, dropActive = false, insertLine, onRowDragOver, onRowDragLeave, onRowDrop, onDragStartCategory }: {\n node: CategoryNode\n t: T\n onToggle: () => void\n /** Create and assign a workspace directly to this category. */\n onAddWorkspace?: () => void\n addingWorkspace?: boolean\n /** Rename/delete actions; the hover menu renders only when both provided. */\n onRename?: () => void\n onDelete?: () => void\n /** Pin/unpin this group (menu row). */\n onTogglePin?: () => void\n /** Open the appearance dialog (menu row). */\n onEditAppearance?: () => void\n /** Group reorder source; the row becomes draggable only when provided. */\n onDragStartCategory?: (event: DragEvent) => void\n} & RowDropProps) {\n const [menuOpen, setMenuOpen] = useState(false)\n const count = node.workspaces.length\n const manageable = onRename !== undefined && onDelete !== undefined\n const pinned = node.appearance?.pinned === true\n const menuItems: MenuEntry[] = [\n ...(onTogglePin === undefined\n ? []\n : [{\n id: 'pin',\n label: pinned ? t('group.unpin') : t('group.pin'),\n icon: pinned ? : ,\n }]),\n ...(onEditAppearance === undefined\n ? []\n : [{ id: 'appearance', label: t('group.appearance'), icon: }]),\n { type: 'separator', id: 'group-menu-separator' },\n { id: 'rename', label: t('group.rename'), icon: },\n { id: 'delete', label: t('group.delete'), icon: , danger: true },\n ]\n return (\n \n \n \n \n \n : }\n />\n \n {node.label}\n {pinned && (\n \n \n \n )}\n {/* One trailing slot for both states: the count and the hover buttons are\n stacked in the same grid cell pinned to the row's right edge, so the\n count is right-aligned exactly where the buttons appear and the swap\n never moves a box (see .wgRowTrail in styles.css). */}\n \n {count}\n \n {onAddWorkspace !== undefined && (\n \n )}\n {manageable && (\n { setMenuOpen(false) }}\n items={menuItems}\n onSelect={(id) => {\n setMenuOpen(false)\n if (id === 'pin') onTogglePin?.()\n if (id === 'appearance') onEditAppearance?.()\n if (id === 'rename') onRename()\n if (id === 'delete') onDelete()\n }}\n portal\n closeOnPointerLeave\n anchor={(\n { e.stopPropagation(); setMenuOpen(v => !v) }}\n >\n \n \n )}\n />\n )}\n \n \n \n )\n}\n\n/** One workspace folder row inside a category: draggable source + drop target. */\nexport function WorkspaceRow({ node, t, onToggle, onNewSession, onRename, onDelete, canMoveOut = false, onMoveOut, onManageFolders, onOpenInFolder, flat = false, dropActive = false, insertLine, onRowDragOver, onRowDragLeave, onRowDrop, onDragStartExtra }: {\n node: WorkspaceGroupNode\n t: T\n onToggle: () => void\n onNewSession: () => void\n onRename: () => void\n onDelete: () => void\n /** Project currently sits inside a group — offer \"move out of group\". */\n canMoveOut?: boolean\n onMoveOut?: () => void\n /** Open the folder-management dialog (extra folders + root). */\n onManageFolders?: () => void\n /**\n * Open the project directory in the host's file manager. Omitted when the\n * host resolved no folder application (no capability, or a remote launch),\n * which keeps the entry out of the menu entirely.\n */\n onOpenInFolder?: () => void\n /** Render as a top-level row (no folder indentation). */\n flat?: boolean\n /** Extra dragstart hook (e.g. collapse all expanded projects while dragging). */\n onDragStartExtra?: () => void\n} & RowDropProps) {\n const [menuOpen, setMenuOpen] = useState(false)\n const menuItems: MenuEntry[] = [\n ...(onOpenInFolder !== undefined\n ? [{ id: 'openInFolder', label: t('workspace.openInFolder'), icon: }]\n : []),\n ...(canMoveOut && onMoveOut !== undefined\n ? [{ id: 'moveOut', label: t('workspace.moveOutOfGroup'), icon: }]\n : []),\n ...(onManageFolders !== undefined\n ? [{ id: 'folders', label: t('folder.manage'), icon: }]\n : []),\n { id: 'rename', label: t('workspace.rename'), icon: },\n { id: 'delete', label: t('workspace.delete'), icon: , danger: true },\n ]\n const onDragStart = (event: DragEvent): void => {\n event.dataTransfer.setData(DND_WORKSPACE_TYPE, node.workspaceId)\n event.dataTransfer.effectAllowed = 'move'\n onDragStartExtra?.()\n }\n return (\n \n \n \n \n \n {/* Project rows use the project glyph (same as the official workspace\n browser) so groups (folder glyph) and projects stay distinguishable.\n Medium stroke like every other row glyph: the thin Regular artwork\n turns into a grey blob once the sidebar shrinks it. */}\n \n \n {node.label}\n {/* Same trailing-slot contract as groups and folders: the count and the\n hover buttons share one right-aligned grid cell, so the count sits where\n the buttons appear and the swap never moves either box. */}\n \n {node.sessionCount}\n {/* Action order is uniform across every row kind: new-session + first,\n menu ⋯ second (see CategoryRow). */}\n \n { e.stopPropagation(); onNewSession() }}\n >\n \n \n { setMenuOpen(false) }}\n items={menuItems}\n onSelect={(id) => {\n setMenuOpen(false)\n if (id === 'openInFolder') onOpenInFolder?.()\n if (id === 'moveOut') onMoveOut?.()\n if (id === 'folders') onManageFolders?.()\n if (id === 'rename') onRename()\n if (id === 'delete') onDelete()\n }}\n portal\n closeOnPointerLeave\n anchor={(\n { e.stopPropagation(); setMenuOpen(v => !v) }}\n >\n \n \n )}\n />\n \n \n \n )\n}\n\n/**\n * One folder row under a project: the base directory (folder #0) plus every\n * extra folder of that workspace. Sits at the session indent level so the\n * 42/58/74 ladder is preserved, and its own session rows indent one step\n * deeper (see `.wgSessionNested`).\n *\n * Deliberately NOT a drag source or drop target: folders are a fixed,\n * host-ordered list; reordering them would need a write path this feature does\n * not have.\n */\nexport function FolderRow({ node, t, onToggle, onNewSession, onSetRoot, onRemove, onOpenInFolder, creating = false }: {\n node: FolderNode\n t: T\n onToggle: () => void\n onNewSession: () => void\n onSetRoot: () => void\n onRemove: () => void\n /** Absent when the host resolved no folder application. */\n onOpenInFolder?: () => void\n /** A session is being created here: the hover + stays disabled. */\n creating?: boolean\n}) {\n const [menuOpen, setMenuOpen] = useState(false)\n const menuItems: MenuEntry[] = [\n { id: 'newSession', label: t('session.new'), icon: },\n ...(onOpenInFolder !== undefined\n ? [{ id: 'openInFolder', label: t('workspace.openInFolder'), icon: }]\n : []),\n ...(node.isRoot\n ? []\n : [{ id: 'setRoot', label: t('folder.setRoot'), icon: }]),\n ...(node.isBase\n ? []\n : [\n { type: 'separator' as const, id: 'folder-menu-separator' },\n { id: 'remove', label: t('folder.remove'), icon: , danger: true },\n ]),\n ]\n return (\n \n \n \n \n \n {node.expanded ? : }\n \n {node.label}\n {node.isRoot && (\n ★\n )}\n {/* Count and hover buttons share the same right-aligned cell (as on every\n other row): the count is flush with the row's right edge and yields to\n the buttons without any reflow. */}\n \n {node.sessions.length}\n {/* Same + then ⋯ order as groups and workspaces. */}\n \n { e.stopPropagation(); onNewSession() }}\n >\n \n \n { setMenuOpen(false) }}\n items={menuItems}\n onSelect={(id) => {\n setMenuOpen(false)\n if (id === 'newSession') onNewSession()\n if (id === 'openInFolder') onOpenInFolder?.()\n if (id === 'setRoot') onSetRoot()\n if (id === 'remove') onRemove()\n }}\n portal\n closeOnPointerLeave\n anchor={(\n { e.stopPropagation(); setMenuOpen(v => !v) }}\n >\n \n \n )}\n />\n \n \n \n )\n}\n\n/**\n * Children container for one folder's rows.\n *\n * Keeps the tree's `role=\"group\"` semantics and gives the rows a single\n * positioned ancestor. It used to draw a per-folder guide rail; that is now the\n * flower branch's job (one continuous stem for the whole tree, see\n * `FlowerBranch.tsx`), so this is structure only.\n */\nexport function TreeChildren({ children }: { children: ReactNode }) {\n return (\n
\n {children}\n
\n )\n}\n\n/** Keyframe names the disclosure animation relies on (styles.css). */\nconst ROW_GROUP_OPEN_ANIMATION = 'wg-rows-in'\nconst ROW_GROUP_CLOSE_ANIMATION = 'wg-rows-out'\n\n/** Upper bound for one disclosure animation (180ms open / 160ms close). */\nconst ROW_GROUP_ANIMATION_FALLBACK_MS = 400\n\n/** Lifecycle of one animated disclosure body. */\ntype RowGroupPhase = 'opening' | 'open' | 'closing' | 'closed'\n\n/** Whether the user asked the OS to reduce motion (no sync unmount without it). */\nfunction prefersReducedMotion(): boolean {\n return typeof window !== 'undefined'\n && typeof window.matchMedia === 'function'\n && window.matchMedia('(prefers-reduced-motion: reduce)').matches\n}\n\n/**\n * Animated disclosure body shared by the category and project levels.\n *\n * Collapsed state renders nothing at all (same DOM as the old\n * `{expanded && …}`), so hidden subtrees cost no layout. Expanding plays a\n * 0fr→1fr grid animation; collapsing keeps the rows mounted for one closing\n * animation and unmounts on its `animationend`. `prefers-reduced-motion`\n * unmounts synchronously instead — waiting for an `animationend` that CSS\n * disabled would leave the group stuck half-closed.\n *\n * The flower-branch overlay cannot follow a moving row box, so the animation\n * phase exposes `data-wg-animating` (styles.css fades the vine while it is\n * present).\n */\nexport function RowGroup({ expanded, className, animate = true, children }: {\n expanded: boolean\n className?: string\n /** Disable the animation for huge subtrees or during drag folding. */\n animate?: boolean\n children: ReactNode\n}): JSX.Element | null {\n const [phase, setPhase] = useState(expanded ? 'open' : 'closed')\n const previousExpanded = useRef(expanded)\n // Adjust state while rendering (React's documented prop-change pattern) so a\n // reduced-motion collapse unmounts in the same commit instead of flashing\n // the old rows for a frame.\n if (previousExpanded.current !== expanded) {\n previousExpanded.current = expanded\n if (expanded) setPhase(animate && !prefersReducedMotion() ? 'opening' : 'open')\n else setPhase(animate && !prefersReducedMotion() ? 'closing' : 'closed')\n }\n // Insurance against a missing `animationend` (interrupted or skipped\n // animation): the animating phase holds `pointer-events:none` and keeps a\n // collapsed body mounted, so it must always settle on its own.\n useEffect(() => {\n if (phase !== 'opening' && phase !== 'closing') return undefined\n const timer = window.setTimeout(() => {\n setPhase(phase === 'opening' ? 'open' : 'closed')\n }, ROW_GROUP_ANIMATION_FALLBACK_MS)\n return () => { window.clearTimeout(timer) }\n }, [phase])\n if (phase === 'closed') return null\n const animating = phase === 'opening' || phase === 'closing'\n const classes = `wgRows${className === undefined ? '' : ` ${className}`}${phase === 'opening' ? ' wgRowsOpening' : ''}${phase === 'closing' ? ' wgRowsClosing' : ''}`\n const onAnimationEnd = (event: AnimationEvent): void => {\n if (event.target !== event.currentTarget) return\n if (phase === 'opening' && event.animationName === ROW_GROUP_OPEN_ANIMATION) setPhase('open')\n if (phase === 'closing' && event.animationName === ROW_GROUP_CLOSE_ANIMATION) setPhase('closed')\n }\n return (\n \n
{children}
\n \n )\n}\n\n/** One session leaf row. */\nexport function SessionRow({ node, currentId, now, t, onOpen, onRename, onFork, onArchive, nested = false }: {\n node: SessionNode\n currentId: string | undefined\n now: number\n t: T\n onOpen: (id: SessionNode['id']) => void\n onRename: (id: SessionNode['id'], currentTitle: string) => void\n onFork: (id: SessionNode['id']) => void\n onArchive: (id: SessionNode['id']) => void\n /** Rendered under a folder row: one indent step deeper than a plain session. */\n nested?: boolean\n}) {\n const selected = node.id === currentId\n const [menuOpen, setMenuOpen] = useState(false)\n // Keep the active flower inside its own status slot, never in a measured\n // overlay: scrolling and expanding ancestors must move it with this row.\n const menuItems = [\n { id: 'rename', label: t('session.rename'), icon: },\n { id: 'fork', label: t('session.fork'), icon: },\n { id: 'archive', label: t('session.archive'), icon: },\n ]\n return (\n { onOpen(node.id) }}\n >\n \n {selected\n ? 0} />\n : }\n \n {node.title}\n {node.snippet !== undefined && (\n {node.snippet}\n )}\n {/* Same trailing slot as groups, workspaces and folders: the time is\n right-aligned on the row's right edge and yields to the ⋯ button on\n hover/focus without moving either box (see .wgRowTrail in styles.css). */}\n {!node.blank && (\n \n {relativeTimeLabel(node.updatedAt, now)}\n \n { setMenuOpen(false) }}\n items={menuItems}\n onSelect={(id) => {\n setMenuOpen(false)\n if (id === 'rename') onRename(node.id, node.title)\n if (id === 'fork') onFork(node.id)\n if (id === 'archive') onArchive(node.id)\n }}\n portal\n closeOnPointerLeave\n anchor={(\n { e.stopPropagation(); setMenuOpen(v => !v) }}\n >\n \n \n )}\n />\n \n \n )}\n \n )\n}\n\nexport type { T }\n","import type { GroupIconId } from '../core/types.ts'\n\n/** Bilingual accessible names also make native browser tooltips recognizable in either locale. */\nexport const GROUP_ICON_LABELS: Record = {\n folder: '文件夹 / Folder', workspace: '工作区 / Workspace', code: '代码 / Code',\n plugin: '插件 / Plugin', skill: '技能 / Skill', data: '数据 / Data',\n database: '数据库 / Database', api: '接口 / API', plan: '计划 / Plan',\n goal: '目标 / Goal', light: '日光 / Sun', globe: '全球 / Globe',\n archive: '归档 / Archive', branch: '分支 / Branch', users: '团队 / Team',\n clock: '时间 / Clock', shield: '安全 / Security', checklist: '清单 / Checklist',\n sparkle: '灵感 / Sparkle', tree: '层级 / Tree',\n chat: '对话 / Chat', search: '搜索 / Search', settings: '设置 / Settings',\n document: '文档 / Document', edit: '编辑 / Edit', think: '思考 / Think',\n agent: '智能体 / Agent', browse: '浏览 / Browse', context: '上下文 / Context',\n link: '链接 / Link', share: '分享 / Share', user: '个人 / Personal',\n send: '发送 / Send', attachment: '附件 / Attachment', download: '下载 / Download',\n play: '运行 / Run', design: '设计 / Design', moon: '夜间 / Moon',\n monitor: '桌面 / Desktop', gauge: '性能 / Performance', queue: '队列 / Queue',\n notes: '笔记 / Notes', inspect: '检查 / Inspect', help: '帮助 / Help',\n info: '信息 / Information', alarm: '提醒 / Reminder', compare: '对比 / Compare',\n done: '完成 / Done', pin: '重点 / Pin', microphone: '语音 / Voice',\n // Materials & Lab family\n 'test-tube': '试管 / Test tube', flask: '烧瓶 / Flask', pipette: '移液枪 / Pipette',\n dropper: '滴液 / Dropper', stirrer: '磁力搅拌 / Magnetic stirrer', hotplate: '加热台 / Hot plate',\n centrifuge: '离心机 / Centrifuge', balance: '电子天平 / Balance',\n atom: '原子 / Atom', molecule: '分子 / Molecule', lattice: '晶格 / Crystal lattice',\n layered: '层状材料 / Layered material', framework: '多孔框架 / Porous framework',\n 'thin-film': '薄膜 / Thin film', fiber: '纤维 / Fiber', hydrogel: '水凝胶 / Hydrogel',\n microscope: '显微镜 / Microscope', xrd: 'XRD 衍射峰 / XRD pattern', spectrum: '光谱 / Spectrum',\n tensile: '拉伸测试 / Tensile test', electrode: '电极 / Electrode', 'iv-curve': '电学曲线 / I–V curve',\n illumination: '光照 / Illumination', temperature: '温度 / Temperature', humidity: '湿度 / Humidity',\n actuator: '弯曲驱动器 / Bending actuator', 'flex-sensor': '柔性传感器 / Flexible sensor',\n battery: '电池 / Battery',\n}\n\n/** All presets satisfy the existing host's 1–4 Unicode-code-point custom-glyph rule. */\nexport const GROUP_EMOJI_ICONS = [\n { icon: '🚀', label: '启动 / Launch' },\n { icon: '📚', label: '学习 / Learning' },\n { icon: '🔬', label: '科研 / Research' },\n { icon: '🧪', label: '实验 / Experiment' },\n { icon: '🎨', label: '创作 / Art' },\n { icon: '🎯', label: '目标 / Target' },\n { icon: '💡', label: '想法 / Idea' },\n { icon: '🛠️', label: '工具 / Tools' },\n { icon: '🌱', label: '成长 / Growth' },\n { icon: '🏠', label: '生活 / Home' },\n { icon: '💼', label: '工作 / Work' },\n { icon: '🎮', label: '游戏 / Games' },\n { icon: '🎵', label: '音乐 / Music' },\n { icon: '❤️', label: '收藏 / Favorites' },\n { icon: '⭐', label: '星标 / Star' },\n { icon: '🔥', label: '热门 / Hot' },\n] as const\n","/**\n * Client side of the per-workspace folder list, talking to\n * `GET|PUT /workspace-groups/folders` on the host.\n *\n * The document is the host's JSON sidecar verbatim (`version` + `workspaces`),\n * so the client and the host agree on one shape: `folders` holds EXTRA folders\n * only — the workspace's canonical directory is implicit folder #0 — and\n * `root` names one of those extras (absent means \"the workspace itself\").\n *\n * Reads are best-effort, like the manual overlay and the tab strip: a failed\n * read means \"no extra folders\". A failed write, however, rejects so the caller\n * can say so — a folder row that silently forgot its edit would be worse than\n * the toast.\n */\nimport {\n EMPTY_FOLDERS_DOCUMENT,\n type FolderMember,\n type FoldersDocument,\n type WorkspaceFolderEntry,\n} from '../core/folders.ts'\n\n/** Host route holding the folder overlay. */\nexport const FOLDERS_ROUTE = '/workspace-groups/folders'\n\n/** One successful read: the overlay plus the mirror base the host reported. */\nexport interface FoldersSnapshot {\n readonly document: FoldersDocument\n /**\n * Local mirror root of the remote-ssh plugin, when the host named one.\n * Workspaces whose directory lives below it are remote mirrors, so their extra\n * folders must be subdirectories of that same mirror.\n */\n readonly remoteBase?: string\n}\n\n/** One non-empty string field, or undefined when it is absent or blank. */\nfunction wireText(value: unknown): string | undefined {\n if (typeof value !== 'string') return undefined\n const trimmed = value.trim()\n return trimmed === '' ? undefined : trimmed\n}\n\n/**\n * Read one member (a folder backed by its own workspace) off the wire.\n * @param value - one value of the stored `members` list.\n * @returns the member, or null for a malformed one.\n */\nfunction parseWireMember(value: unknown): FolderMember | null {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return null\n const row = value as Record\n const path = wireText(row.path)\n const workspaceId = wireText(row.workspaceId)\n // A member without a directory or without its workspace cannot run a session,\n // so it is not worth a row.\n if (path === undefined || workspaceId === undefined) return null\n const remotePath = wireText(row.remotePath)\n const profileId = wireText(row.profileId)\n const recordId = wireText(row.recordId)\n const title = wireText(row.title)\n return {\n path,\n workspaceId,\n kind: row.kind === 'remote' ? 'remote' : 'local',\n ...(remotePath === undefined ? {} : { remotePath }),\n ...(profileId === undefined ? {} : { profileId }),\n ...(recordId === undefined ? {} : { recordId }),\n ...(title === undefined ? {} : { title }),\n }\n}\n\n/**\n * Read one workspace entry off the wire, dropping the entry when it is\n * unusable.\n *\n * `members` must survive this round trip: the client owns the whole document\n * (the PUT sends it back verbatim), so an entry parsed without its members is\n * not merely a display gap — the next folder edit would rewrite the sidecar and\n * erase every member-backed folder for good.\n * @param value - one value of the stored `workspaces` mapping.\n * @returns the entry, or null for a malformed one.\n */\nfunction parseWireEntry(value: unknown): WorkspaceFolderEntry | null {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return null\n const row = value as Record\n const folders: string[] = []\n if (Array.isArray(row.folders)) {\n for (const candidate of row.folders) {\n const path = wireText(candidate)\n if (path !== undefined) folders.push(path)\n }\n }\n const members: FolderMember[] = []\n if (Array.isArray(row.members)) {\n for (const candidate of row.members) {\n const member = parseWireMember(candidate)\n if (member !== null) members.push(member)\n }\n }\n if (folders.length === 0 && members.length === 0) return null\n const root = wireText(row.root)\n return {\n folders,\n ...(members.length === 0 ? {} : { members }),\n ...(root === undefined ? {} : { root }),\n }\n}\n\n/**\n * Fetch the stored folder overlay.\n * @param fetchImpl - fetch implementation (injectable for tests).\n * @returns the overlay plus the reported mirror base; the empty document on any\n * failure.\n */\nexport async function loadFolders(fetchImpl: typeof fetch = fetch): Promise {\n try {\n const response = await fetchImpl(FOLDERS_ROUTE, {\n method: 'GET',\n // Folders are user state; a cached response would show stale rows.\n cache: 'no-store',\n })\n if (!response.ok) return { document: EMPTY_FOLDERS_DOCUMENT }\n const body: unknown = await response.json()\n if (typeof body !== 'object' || body === null) return { document: EMPTY_FOLDERS_DOCUMENT }\n const source = body as Record\n const remoteBase = typeof source.remoteBase === 'string' && source.remoteBase.trim() !== ''\n ? source.remoteBase.trim()\n : undefined\n const base = remoteBase === undefined ? {} : { remoteBase }\n const document = parseWireDocument(source)\n return { document: document ?? EMPTY_FOLDERS_DOCUMENT, ...base }\n } catch {\n return { document: EMPTY_FOLDERS_DOCUMENT }\n }\n}\n\n/**\n * Read a whole folder document off the wire (GET response, PUT echo or the\n * 409 conflict body), or null when it is not a version-1 document.\n * @param source - parsed JSON body.\n */\nexport function parseWireDocument(source: Record): FoldersDocument | null {\n if (source.version !== 1) return null\n const revision = typeof source.revision === 'number' && Number.isSafeInteger(source.revision) && source.revision >= 0\n ? source.revision\n : 0\n if (typeof source.workspaces !== 'object' || source.workspaces === null || Array.isArray(source.workspaces)) {\n return { version: 1, revision, workspaces: {} }\n }\n const workspaces: Record = {}\n for (const [workspaceId, value] of Object.entries(source.workspaces)) {\n if (workspaceId === '__proto__') continue // assigning it would mutate the record's prototype\n const entry = parseWireEntry(value)\n if (entry !== null) workspaces[workspaceId] = entry\n }\n return { version: 1, revision, workspaces }\n}\n\n/**\n * A save rejected because another window wrote first (HTTP 409). Carries the\n * host's current document so the caller can adopt it and resync its state\n * instead of leaving the user looking at a phantom edit.\n */\nexport class FoldersConflictError extends Error {\n readonly current: FoldersDocument\n constructor(current: FoldersDocument) {\n super('folder overlay changed in another window')\n this.name = 'FoldersConflictError'\n this.current = current\n }\n}\n\n/**\n * Store the whole folder overlay.\n *\n * Unlike the tab strip this does NOT swallow failures: folder edits are explicit\n * row/dialog actions, so the caller turns a rejection into a toast instead of\n * leaving the user with a row that silently forgot its folder.\n * @param document - the client's current document.\n * @param fetchImpl - fetch implementation (injectable for tests).\n */\nexport async function saveFolders(\n document: FoldersDocument,\n fetchImpl: typeof fetch = fetch,\n): Promise {\n const response = await fetchImpl(FOLDERS_ROUTE, {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(document),\n cache: 'no-store',\n // The write is idempotent, so surviving a navigation with keepalive is\n // safe and avoids losing the just-added folder.\n keepalive: true,\n })\n if (response.status === 409) {\n const body: unknown = await response.json().catch(() => null)\n const current = typeof body === 'object' && body !== null\n ? parseWireDocument(body as Record)\n : null\n throw new FoldersConflictError(current ?? EMPTY_FOLDERS_DOCUMENT)\n }\n if (!response.ok) throw new Error(`PUT ${FOLDERS_ROUTE}: ${response.status}`)\n // Adopt the host's echo: it is the normalized document (with the bumped\n // revision) that was actually stored.\n const body: unknown = await response.json().catch(() => null)\n const stored = typeof body === 'object' && body !== null\n ? parseWireDocument(body as Record)\n : null\n return stored ?? document\n}\n","/** One directory operation for local DSH and optional remote-ssh workspaces.\n * Never send remote writes through the sidebar route: without its SSH interceptor\n * that route can create a LOCAL directory instead. Use the SSH-owned API instead.\n */\nimport { isUnderBase, joinSubpath, samePath } from '../core/folders.ts'\n\nexport interface RemoteFolderWorkspace {\n mirrorPath: string\n remotePath: string\n profileId: string\n /** Native DSH workspace registered for the mirror root ('' when unregistered). */\n workspaceId: string\n /** remote-ssh's own record id ('' when it cannot be resolved). */\n recordId: string\n}\n\ntype JsonObject = Record\nfunction object(value: unknown): JsonObject | undefined {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? value as JsonObject : undefined\n}\nfunction message(value: JsonObject | undefined): string {\n const error = value?.error\n return typeof error === 'string' ? error\n : typeof object(error)?.message === 'string' ? String(object(error)?.message)\n : typeof value?.stderr === 'string' && value.stderr !== '' ? value.stderr\n : 'Remote SSH request failed'\n}\n\nasync function rpc(method: string, body: JsonObject, fetchImpl: typeof fetch): Promise {\n const response = await fetchImpl(`/remote-ssh/api/${method}`, {\n method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Requested-With': 'XMLHttpRequest' },\n body: JSON.stringify(body), cache: 'no-store', signal: AbortSignal.timeout(30000),\n })\n // Only catalog absence denotes an optional plugin not installed/running.\n if (response.status === 404 && method === 'listWorkspaces') return null\n if (!response.ok) throw new Error(`Remote SSH ${method}: HTTP ${response.status}`)\n const envelope = object(await response.json())\n const value = object(envelope?.value)\n if (envelope?.ok !== true || value?.ok !== true) throw new Error(message(value ?? envelope))\n return value\n}\n\n/** A marker is only a refusal hint, never authority to execute remote commands. */\nasync function refuseMarkedLocalPath(path: string, fetchImpl: typeof fetch): Promise {\n const response = await fetchImpl(`/workspace-groups/remote-hint?path=${encodeURIComponent(path)}`, {\n cache: 'no-store', signal: AbortSignal.timeout(10000),\n })\n if (!response.ok) throw new Error(`Cannot verify local directory: HTTP ${response.status}`)\n const body = object(await response.json())\n if (typeof body?.remoteHint !== 'boolean') throw new Error('Invalid directory safety response')\n if (body.remoteHint) throw new Error('SSH marker detected but no active registered remote workspace; refusing local operation')\n}\n\n/** One SSH connection the remote plugin offers, as the picker needs it. */\nexport interface RemoteProfileSummary {\n id: string\n name: string\n host: string\n user: string\n /** Directory the connection opens on (`~` when the plugin leaves it empty). */\n remoteRoot: string\n}\n\n/** One row of a remote directory listing. */\nexport interface RemoteDirEntry {\n name: string\n type: 'directory' | 'file'\n size: number\n}\n\n/** A remote directory and its children, as the cloud folder picker needs them. */\nexport interface RemoteDirListing {\n /** Path as requested (`~`, a relative name or an absolute path). */\n requested: string\n /** Absolute path the remote shell resolved it to (`requested` when unknown). */\n resolved: string\n entries: readonly RemoteDirEntry[]\n}\n\n/** Single-quote one POSIX shell word; `~` expands only when it stays unquoted. */\nfunction shellWord(path: string): string {\n return `'${path.replace(/'/gu, `'\\\\''`)}'`\n}\n\n/** Quote a remote path for `sh`, keeping a leading `~` expandable. */\nfunction shellPath(path: string): string {\n if (path === '~') return '~'\n if (path.startsWith('~/')) return `~/${shellWord(path.slice(2))}`\n return shellWord(path)\n}\n\n/** Parent of a directory path, or null where going up stops (`~`, `/`, root). */\nexport function remoteDirParent(path: string): string | null {\n const trimmed = path.trim().replace(/\\/+$/u, '')\n if (trimmed === '' || trimmed === '~' || trimmed === '.') return null\n const cut = trimmed.lastIndexOf('/')\n if (cut < 0) return null\n if (cut === 0) return '/'\n return trimmed.slice(0, cut)\n}\n\n/** Join a child directory name onto a remote directory path. */\nexport function remoteDirJoin(base: string, name: string): string {\n if (base === '') return name\n return base.endsWith('/') ? `${base}${name}` : `${base}/${name}`\n}\n\n/**\n * List one remote directory through the SSH plugin's own pooled session, so\n * password auth, ProxyJump and host-key handling stay where they already work.\n * @param profileId - SSH connection to browse.\n * @param path - directory to list; empty means the connection's remote root.\n * @param fetchImpl - fetch implementation (tests inject one).\n */\nexport async function listRemoteDirectory(\n profileId: string, path: string, fetchImpl: typeof fetch = fetch,\n): Promise {\n const requested = path.trim() === '' ? '~' : path.trim()\n const value = await rpc('listDir', { profileId, path: requested }, fetchImpl)\n if (value === null) throw new Error('The SSH plugin is unavailable; cannot browse that connection')\n const rows = Array.isArray(value.entries) ? value.entries : []\n const entries: RemoteDirEntry[] = []\n for (const raw of rows) {\n const row = object(raw)\n if (row === undefined || typeof row.name !== 'string' || row.name === '') continue\n entries.push({\n name: row.name,\n type: row.type === 'directory' ? 'directory' : 'file',\n size: typeof row.size === 'number' && Number.isFinite(row.size) ? row.size : 0,\n })\n }\n return { requested, resolved: await resolveRemoteDirectory(profileId, requested, fetchImpl) ?? requested, entries }\n}\n\n/** Absolute form of a remote path, or null when the remote shell cannot resolve it. */\nasync function resolveRemoteDirectory(\n profileId: string, path: string, fetchImpl: typeof fetch,\n): Promise {\n try {\n const value = await rpc('remoteExec', { profileId, command: `cd ${shellPath(path)} && pwd -P` }, fetchImpl)\n const stdout = typeof value?.stdout === 'string' ? value.stdout.trim() : ''\n const line = stdout.split('\\n').filter(text => text.trim() !== '').pop()\n return line === undefined ? null : line.trim()\n } catch {\n // Listing succeeded but the path cannot be named (a shell without cd): keep browsing.\n return null\n }\n}\n\n/** A newly registered remote (mirror-backed) folder workspace. */\nexport interface CreatedRemoteFolder {\n /** Absolute LOCAL mirror path — the member workspace's canonical directory. */\n path: string\n /** Native DSH workspace id that now backs the folder row. */\n workspaceId: string\n /** remote-ssh's own record id (used to delete the record again). */\n recordId: string\n remotePath: string\n profileId: string\n title: string\n /** True when an existing record for the same profile + remote path was taken over. */\n reused: boolean\n}\n\n/**\n * The SSH connections available for a cloud folder, or null when the\n * `@zhangfengshun/dsh-remote-ssh` plugin does not answer at all.\n * @param fetchImpl - fetch implementation (tests inject one).\n */\nexport async function listRemoteProfiles(\n fetchImpl: typeof fetch = fetch,\n): Promise {\n let value: JsonObject | null\n try {\n value = await rpc('listProfiles', {}, fetchImpl)\n } catch (reason) {\n // A missing plugin answers HTTP 404 with no JSON envelope at all.\n if (reason instanceof Error && reason.message.includes('HTTP 404')) return null\n throw reason\n }\n if (value === null) return null\n const rows = Array.isArray(value.profiles) ? value.profiles : []\n const profiles: RemoteProfileSummary[] = []\n for (const raw of rows) {\n const row = object(raw)\n if (row === undefined || typeof row.id !== 'string' || row.id === '') continue\n profiles.push({\n id: row.id,\n name: typeof row.name === 'string' && row.name !== '' ? row.name : row.id,\n host: typeof row.host === 'string' ? row.host : '',\n user: typeof row.user === 'string' ? row.user : '',\n remoteRoot: typeof row.remoteRoot === 'string' && row.remoteRoot !== '' ? row.remoteRoot : '~',\n })\n }\n return profiles\n}\n\n/**\n * Register one cloud folder: the SSH plugin creates the local mirror, writes the\n * connection marker and registers a real DSH workspace for it — exactly what its\n * own \"new remote workspace\" flow does. The returned native workspace id backs\n * the folder row, and the workspace's own sidebar row is hidden once the entry\n * lists it (see `absorbedWorkspaceIds`).\n * @param profileId - SSH connection to use.\n * @param remotePath - remote directory (`~`, `~/proj`, `/srv/proj`).\n * @param title - optional display title; the plugin derives one from the path.\n * @param fetchImpl - fetch implementation (tests inject one).\n */\nexport async function createRemoteFolder(\n profileId: string,\n remotePath: string,\n title?: string,\n fetchImpl: typeof fetch = fetch,\n): Promise {\n const trimmedPath = remotePath.trim()\n if (profileId.trim() === '' || trimmedPath === '') throw new Error('Pick a connection and enter a remote path')\n const value = await rpc('createRemoteWorkspace', {\n profileId,\n remotePath: trimmedPath,\n ...(title === undefined || title.trim() === '' ? {} : { title: title.trim() }),\n }, fetchImpl)\n if (value === null) throw new Error('The SSH plugin is unavailable; cannot add a cloud folder')\n const record = object(value.workspace) ?? {}\n const workspaceId = typeof value.workspaceId === 'string' ? value.workspaceId : ''\n const mirrorPath = typeof value.mirrorPath === 'string' ? value.mirrorPath : ''\n const recordId = typeof record.id === 'string' ? record.id : ''\n if (workspaceId === '' || mirrorPath === '') {\n throw new Error('The SSH plugin did not register a workspace for this folder')\n }\n return {\n path: mirrorPath,\n workspaceId,\n recordId,\n remotePath: typeof record.remotePath === 'string' ? record.remotePath : trimmedPath,\n profileId: typeof record.profileId === 'string' ? record.profileId : profileId,\n title: typeof record.title === 'string' && record.title !== '' ? record.title : trimmedPath,\n reused: value.reused === true,\n }\n}\n\n/**\n * Delete one remote workspace record through the SSH plugin: it removes the\n * record, unregisters the native workspace behind it (that workspace's\n * sessions go with it) and cleans up the mirror — the counterpart of\n * {@link createRemoteFolder}, for when a member folder is removed for good.\n * @param recordId - remote-ssh record id stored on the member.\n * @param fetchImpl - fetch implementation (tests inject one).\n */\nexport async function deleteRemoteWorkspaceRecord(\n recordId: string,\n fetchImpl: typeof fetch = fetch,\n): Promise {\n if (recordId.trim() === '') throw new Error('No remote workspace record to delete')\n const value = await rpc('deleteWorkspace', { id: recordId }, fetchImpl)\n if (value === null) throw new Error('The SSH plugin is unavailable; cannot delete the remote workspace')\n}\n\n/** Resolve against the SSH plugin's registered mirrors, not copied marker files. */\nexport async function remoteFolderWorkspace(\n path: string, remoteBase: string | null, fetchImpl: typeof fetch = fetch,\n): Promise {\n const value = await rpc('listWorkspaces', {}, fetchImpl)\n const knownMirror = remoteBase !== null && isUnderBase(path, remoteBase)\n if (value === null) {\n if (knownMirror) throw new Error('SSH plugin is unavailable; refusing a local operation in a remote mirror')\n await refuseMarkedLocalPath(path, fetchImpl)\n return null\n }\n if (!Array.isArray(value.workspaces)) throw new Error('Invalid SSH workspace catalog')\n const matches: RemoteFolderWorkspace[] = []\n for (const raw of value.workspaces) {\n const row = object(raw)\n if (!row || typeof row.mirrorPath !== 'string' || typeof row.remotePath !== 'string'\n || typeof row.profileId !== 'string' || !row.mirrorPath || !row.remotePath || !row.profileId) {\n throw new Error('Invalid SSH workspace entry')\n }\n if (samePath(path, row.mirrorPath) || isUnderBase(path, row.mirrorPath)) {\n matches.push({\n mirrorPath: row.mirrorPath,\n remotePath: row.remotePath,\n profileId: row.profileId,\n workspaceId: typeof row.shellWorkspaceId === 'string' ? row.shellWorkspaceId : '',\n recordId: typeof row.id === 'string' ? row.id : '',\n })\n }\n }\n if (matches.length > 1) throw new Error('Overlapping SSH workspaces are not supported safely')\n if (matches.length === 1) return matches[0]!\n if (knownMirror) throw new Error('Remote mirror is not registered with the SSH plugin')\n await refuseMarkedLocalPath(path, fetchImpl)\n return null\n}\n\n/** Single-segment names match DSH createDirectory(path, name). */\nexport function validateFolderName(raw: string): string {\n const name = raw.trim()\n if (!name || name === '.' || name === '..' || /[\\\\/\\u0000-\\u001f]/u.test(name)) {\n throw new Error('Enter a single folder name, not an absolute path or nested path')\n }\n return name\n}\n\nexport async function createWorkspaceDirectory(\n parent: string, rawName: string, remoteBase: string | null,\n createLocal: (path: string, name: string) => Promise, fetchImpl: typeof fetch = fetch,\n): Promise<{ path: string; remote: boolean }> {\n const name = validateFolderName(rawName)\n const path = joinSubpath(parent, name)\n if (path === null) throw new Error('Invalid folder name')\n const remote = await remoteFolderWorkspace(parent, remoteBase, fetchImpl)\n if (!remote) return { path: await createLocal(parent, name), remote: false }\n // Names with shell expansions are rejected defensively for older SSH wrappers.\n if (/[\\u0000-\\u001f`$\"\\\\]/u.test(name)) throw new Error('Unsupported remote folder name')\n const normalizedParent = parent.trim().replace(/\\\\/gu, '/').replace(/\\/+$/u, '')\n const normalizedRoot = remote.mirrorPath.trim().replace(/\\\\/gu, '/').replace(/\\/+$/u, '')\n const suffix = normalizedParent.slice(normalizedRoot.length).replace(/^\\/+/, '')\n if (suffix.split('/').some(part => part === '..' || part === '.')) throw new Error('Invalid mirror path')\n const root = remote.remotePath.replace(/\\/+$/u, '')\n const remotePath = `${root}/${suffix ? `${suffix}/` : ''}${name}`\n await rpc('mkdir', { profileId: remote.profileId, path: remotePath }, fetchImpl)\n return { path, remote: true }\n}\n","/**\n * Transport for the official open-in-app host routes served by\n * `@deepseek-ai/dsh-host-open-in-app`. The project row offers \"open this\n * project's folder\" by asking that host half for the applications it verified\n * as installed, then POSTing the launcher it already resolved — this plugin\n * never probes or spawns a launcher itself, and a host without the capability\n * (no resolved application, e.g. an SSH launch) simply yields no menu entry.\n */\n\n/** GET route serving the probed application ids (host-owned constant). */\nexport const OPEN_IN_APP_APPS_ROUTE = '/open-in-app/apps'\n\n/** POST route launching one resolved application on one absolute directory. */\nexport const OPEN_IN_APP_OPEN_ROUTE = '/open-in-app/open'\n\n/**\n * Catalog ids that open a directory in the platform file manager, most\n * specific first (the official catalog names one per platform: `explorer` on\n * Windows, `finder` on macOS, `filemanager` on Linux).\n */\nconst FOLDER_APP_IDS = ['explorer', 'finder', 'filemanager'] as const\n\n/**\n * The installed file-manager id for this host, or undefined when the host\n * resolved none (the row then offers no \"open in folder\" entry).\n * @param apps - installed catalog ids from the apps route.\n * @returns the preferred available id.\n */\nexport function folderAppId(apps: readonly string[]): string | undefined {\n for (const id of FOLDER_APP_IDS) {\n if (apps.includes(id)) return id\n }\n return undefined\n}\n\n/**\n * Resolve the browser's Host base with the connection carrier's null-origin\n * fallback (same rule the official button uses): a sandboxed document reports\n * the literal origin \"null\", which cannot address the host.\n * @returns the absolute base URL of the current Host.\n */\nfunction hostBase(): string {\n const origin = globalThis.location?.origin\n return origin !== undefined && origin !== 'null' ? origin : 'http://dsh.internal'\n}\n\n/**\n * Read the host's installed-application ids. A host without the capability\n * (or one that refuses) reads as an empty list rather than an error, so the\n * caller can treat \"no apps\" and \"no route\" identically.\n * @param signal - aborts the read when the browser half unmounts.\n * @returns installed catalog ids, in host menu order.\n */\nexport async function fetchOpenInApps(signal?: AbortSignal): Promise {\n const response = await fetch(new URL(OPEN_IN_APP_APPS_ROUTE, hostBase()), {\n headers: { accept: 'application/json' },\n cache: 'no-store',\n ...(signal === undefined ? {} : { signal }),\n })\n if (!response.ok) throw new Error(`open-in-app apps request failed: ${response.status}`)\n const payload: unknown = await response.json()\n const apps = (payload as { apps?: unknown }).apps\n return Array.isArray(apps) ? apps.filter((id): id is string => typeof id === 'string') : []\n}\n\n/**\n * Launch one installed application on one absolute directory.\n * @param appId - catalog id from the apps route.\n * @param path - the project's absolute directory.\n * @returns after the host acknowledged the launch; rejects on any refusal.\n */\nexport async function openPathInApp(appId: string, path: string): Promise {\n const response = await fetch(new URL(OPEN_IN_APP_OPEN_ROUTE, hostBase()), {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ app: appId, path }),\n })\n if (!response.ok) throw new Error(`open-in-app launch failed: ${response.status}`)\n}\n","/**\n * The folder dialog of one workspace row: the base folder first, then every\n * extra folder in stored order. A row is chosen as the root (the folder new\n * sessions default to); open/remove act per row, and the base folder is never\n * removable because the workspace's canonical directory cannot be dropped.\n *\n * Folders come in two kinds, and the add area switches between them:\n * · local — a directory picked on this machine (`pickDirectory`);\n * · cloud — a directory on an SSH host, browsed through the SSH plugin's own\n * pooled session, then registered as a mirror-backed workspace.\n *\n * Cloud browsing lives here rather than behind a second modal: the dialog body\n * swaps to the remote tree, so no stacked overlays are needed and the current\n * location stays readable at the top.\n */\nimport { useEffect, useState } from 'react'\nimport {\n Button,\n IconFolderOpenOutlineRegular,\n IconTrashOutlineRegular,\n Modal,\n} from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { WorkspaceView } from '@deepseek-ai/dsh-api-workspace-controller/client'\nimport { effectiveFolders, memberOf, rootOf, samePath, type WorkspaceFolderEntry } from '../core/folders.ts'\nimport type { GroupsBrowserProps } from './contract.ts'\nimport { folderLabel } from './tree.ts'\nimport {\n listRemoteDirectory,\n remoteDirJoin,\n remoteDirParent,\n type RemoteDirEntry,\n type RemoteProfileSummary,\n} from './folder-directory.ts'\n\n/** Which kind of folder the add area currently offers. */\ntype AddMode = 'local' | 'cloud'\n\n/** Relative path of `picked` inside `root`: '' for the root itself, null outside. */\nfunction subfolderOf(root: string | null, picked: string): string | null {\n if (root === null) return null\n const base = root.trim().replace(/\\/+$/u, '')\n if (base === '') return null\n if (picked === base) return ''\n return picked.startsWith(`${base}/`) ? picked.slice(base.length + 1) : null\n}\n\nexport function FoldersDialog({ workspace, entry, t, busy, canOpen, remote, ownerRemotePath, profiles, profilesError, knownWorkspaceIds, onClose, onAddFolder, onAddRemote, onAddSubpath, onSetRoot, onRemove, onOpenFolder }: {\n workspace: WorkspaceView\n entry: WorkspaceFolderEntry | undefined\n t: GroupsBrowserProps['t']\n busy: boolean\n canOpen: boolean\n /** Remote (mirror-backed) workspace: extra folders can also be typed subpaths. */\n remote: boolean\n /** Remote root of a cloud owner, so a browsed subdirectory joins as a subfolder. */\n ownerRemotePath: string | null\n /** SSH connections, `null` while loading or when the remote-ssh plugin is absent. */\n profiles: readonly RemoteProfileSummary[] | null\n profilesError: string | null\n /** Live workspace ids, so a member whose workspace is gone can say so. */\n knownWorkspaceIds: readonly string[]\n onClose: () => void\n /** Pick any directory (local or an already-mirrored cloud folder). */\n onAddFolder: () => void\n /** Register one cloud folder: returns true once it is stored. */\n onAddRemote: (profileId: string, remotePath: string) => Promise\n onAddSubpath: (relative: string) => Promise\n onSetRoot: (path: string) => void\n onRemove: (path: string, deleteRecord: boolean) => void\n onOpenFolder: (path: string) => void\n}) {\n const folders = effectiveFolders(workspace.path, entry)\n const root = rootOf(workspace.path, entry)\n const [addMode, setAddMode] = useState('local')\n // Path of the remote member whose removal awaits the delete-record choice.\n const [confirmRemovePath, setConfirmRemovePath] = useState(null)\n const [profileId, setProfileId] = useState('')\n const [remotePath, setRemotePath] = useState('')\n const [browsing, setBrowsing] = useState(false)\n const [notice, setNotice] = useState(null)\n const profileChoices = profiles ?? []\n const knownIds = new Set(knownWorkspaceIds)\n const selectedProfile = profileChoices.some(profile => profile.id === profileId)\n ? profileId\n : (profileChoices[0]?.id ?? '')\n const currentProfile = profileChoices.find(profile => profile.id === selectedProfile)\n /** One field, two shapes: a bare name creates a subdirectory inside THIS\n * project's remote root, anything with a separator registers a new cloud\n * workspace. Keeping them in one field removed a whole extra row from a\n * ~330px wide dialog. */\n const typed = remotePath.trim()\n const asSubfolder = remote && typed !== '' && !/[/\\\\~]/u.test(typed)\n const submitAdd = (): void => {\n if (typed === '' || busy) return\n if (asSubfolder) {\n void onAddSubpath(typed).then(success => { if (success) setRemotePath('') })\n return\n }\n if (selectedProfile === '') return\n void onAddRemote(selectedProfile, typed).then((success) => {\n if (!success) return\n setRemotePath('')\n setBrowsing(false)\n })\n }\n\n if (browsing && currentProfile !== undefined) {\n return (\n {\n const relative = subfolderOf(ownerRemotePath, picked)\n if (relative === '' && ownerRemotePath !== null) {\n // Already this project's base folder: nothing to add, say so.\n setNotice(t('folder.alreadyRoot'))\n setBrowsing(false)\n return\n }\n if (relative !== null) {\n // Inside the owner's remote root: one folder of this mirror, no second copy.\n void onAddSubpath(relative).then((success) => {\n if (success) {\n setNotice(null)\n setBrowsing(false)\n }\n })\n return\n }\n setRemotePath(picked)\n setBrowsing(false)\n }}\n onCancel={() => { setBrowsing(false) }}\n />\n )\n }\n\n const cloudAvailable = profiles !== null\n const extraFolders = folders.length > 1\n // A cloud project's directory is a generated mirror id, so the header names the\n // place a human recognises: the remote root, when we managed to read it.\n const ownerPath = remote ? (ownerRemotePath ?? workspace.path) : workspace.path\n return (\n {t('folder.done')}\n )}\n >\n
\n
\n {workspace.title}\n {ownerPath}\n
\n\n
\n
{t('folder.sectionList')}
\n
\n {folders.map((path, index) => {\n const isBase = index === 0\n const isRoot = samePath(path, root)\n const member = memberOf(entry, path)\n // A cloud member's directory is a generated mirror id, so the dialog\n // names it by its remote path/title, exactly like the sidebar row does.\n // The base folder is named by the workspace title for the same reason.\n const label = isBase\n ? workspace.title\n : member?.kind === 'remote'\n ? (member.title ?? folderLabel(member.remotePath ?? path))\n : folderLabel(path)\n const displayPath = member === undefined\n ? (isBase ? ownerPath : path)\n : (member.remotePath ?? member.path)\n // A member whose own workspace disappeared (deleted outside this\n // overlay, or an SSH record the plugin dropped) keeps its row so the\n // user can still remove it, but says that it cannot run sessions.\n const memberGone = member !== undefined && !knownIds.has(member.workspaceId)\n const canDeleteRecord = member?.kind === 'remote' && member.recordId !== undefined && member.recordId !== ''\n return (\n
\n
\n \n \n {label}\n {displayPath}\n \n \n {isBase && {t('folder.base')}}\n {isRoot && {t('folder.rootBadge')}}\n {member !== undefined && (\n \n {member.kind === 'remote' ? t('folder.cloudTag') : t('folder.localTag')}\n \n )}\n {memberGone && (\n {t('folder.memberMissing')}\n )}\n \n \n {canOpen && (\n { onOpenFolder(path) }}\n >\n \n \n )}\n {!isBase && (\n {\n // A remote member can take its backing workspace\n // with it; ask which removal the user means first.\n if (canDeleteRecord) setConfirmRemovePath(path)\n else onRemove(path, false)\n }}\n >\n \n \n )}\n \n
\n {confirmRemovePath === path && (\n
\n {t('folder.removeRemotePrompt')}\n \n { setConfirmRemovePath(null); onRemove(path, true) }}\n >\n {t('folder.removeRemoteDelete')}\n \n { setConfirmRemovePath(null); onRemove(path, false) }}\n >\n {t('folder.removeRemoteOnly')}\n \n { setConfirmRemovePath(null) }}\n >\n {t('cancel')}\n \n \n
\n )}\n
\n )\n })}\n
\n {!extraFolders &&

{t('folder.emptyHint')}

}\n
\n\n
\n
{t('folder.sectionAdd')}
\n
\n { setAddMode('local'); setNotice(null) }}\n >\n {t('folder.tabLocal')}\n \n {cloudAvailable && (\n { setAddMode('cloud'); setNotice(null) }}\n >\n {t('folder.tabCloud')}\n \n )}\n
\n {notice !== null &&

{notice}

}\n\n {addMode === 'local'\n ? (\n
\n {/* Full width, own line: the action used to share a row with the\n consequence text and the label wrapped onto two lines. */}\n \n

{remote ? t('folder.localIntoRemote') : t('folder.localNote')}

\n
\n )\n : (\n <>\n {/* One control per line: the dialog body is only ~330px wide, so a\n profile select, a path field and a labelled button cannot share\n a row without squeezing one of them. Browsing therefore docks\n into the path field as an icon instead of its own button. */}\n
\n {profileChoices.length === 0\n ?

{t('folder.noProfiles')}

\n : (\n setProfileId(event.target.value)}\n >\n {profileChoices.map(profile => (\n \n ))}\n \n )}\n
\n setRemotePath(event.target.value)}\n onKeyDown={(event) => {\n if (event.key !== 'Enter') return\n event.preventDefault()\n submitAdd()\n }}\n />\n { setBrowsing(true) }}\n >\n \n \n
\n
\n \n {t(asSubfolder ? 'folder.createAndAdd' : 'folder.addRemote')}\n \n
\n
\n

{t(remote ? 'folder.cloudNoteBoth' : 'folder.cloudNote')}

\n \n )}\n {profilesError !== null && (\n

{t('folder.profilesError')}: {profilesError}

\n )}\n
\n
\n \n )\n}\n\n/**\n * Browse one SSH host and pick a directory. Entries come from the SSH plugin's\n * `listDir`, so the local machine never runs a copy of the remote tree and the\n * connection's own auth (key, password, ProxyJump) is reused unchanged.\n */\nfunction RemoteFolderPicker({ profile, startPath, t, busy, onPick, onCancel }: {\n profile: RemoteProfileSummary\n startPath: string\n t: GroupsBrowserProps['t']\n busy: boolean\n onPick: (path: string) => void\n onCancel: () => void\n}) {\n const [path, setPath] = useState(startPath)\n const [resolved, setResolved] = useState(startPath)\n const [entries, setEntries] = useState([])\n const [error, setError] = useState(null)\n const [loading, setLoading] = useState(true)\n const [reloadKey, setReloadKey] = useState(0)\n\n useEffect(() => {\n let live = true\n setLoading(true)\n setError(null)\n void listRemoteDirectory(profile.id, path).then(\n (listing) => {\n if (!live) return\n setEntries(listing.entries)\n setResolved(listing.resolved)\n setLoading(false)\n // The shell resolved `~` or a relative name: browse the real place next\n // so \"up\" and the children join behave like an absolute path.\n if (listing.resolved !== path) setPath(listing.resolved)\n },\n (reason: unknown) => {\n if (!live) return\n setError(reason instanceof Error ? reason.message : String(reason))\n setLoading(false)\n },\n )\n return () => { live = false }\n }, [profile.id, path, reloadKey])\n\n const parent = remoteDirParent(resolved)\n const directories = entries.filter(entry => entry.type === 'directory')\n const choose = (): void => { onPick(resolved) }\n return (\n \n \n \n \n )}\n >\n
\n {resolved}\n \n \n \n \n \n
\n
\n {loading &&

{t('folder.loading')}

}\n {!loading && error !== null && (\n

{t('folder.browseFailed')}: {error}

\n )}\n {!loading && error === null && directories.length === 0 && (\n

{t('folder.emptyDir')}

\n )}\n {!loading && error === null && directories.map(entry => (\n { setPath(remoteDirJoin(resolved, entry.name)) }}\n >\n \n {entry.name}\n \n ))}\n
\n

{t('folder.browseNote')}

\n \n )\n}\n","/**\n * Pure data shaping for the Ctrl+R quick switch panel. Runtime-free (same\n * discipline as store-core.ts): unit tests exercise the real semantics\n * without a browser module loader; the panel only binds them to the\n * framework's global hooks.\n */\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\nimport type { SessionListState, SessionSummary } from '@deepseek-ai/dsh-api-session-controller/client'\nimport type { WorkspaceView } from '@deepseek-ai/dsh-api-workspace-controller/client'\n\n/** A session row eligible for quick switching: running, top-level, real. */\nfunction quickEligible(summary: SessionSummary): boolean {\n return summary.running === true && summary.origin !== 'subagent' && !summary.blank\n}\n\n/**\n * Running quick-switchable sessions across the whole list, newest first.\n * @param list - sessions list snapshot.\n * @param archived - registry-global archive set (archived rows never surface).\n * @returns running summaries in recency order (id as deterministic tiebreak).\n */\nexport function runningSessions(list: SessionListState, archived: ReadonlySet): SessionSummary[] {\n const out: SessionSummary[] = []\n for (const id of list.ids) {\n if (archived.has(id)) continue\n const summary = list.byId[id]\n if (summary !== undefined && quickEligible(summary)) out.push(summary)\n }\n out.sort((a, b) => (b.updatedAt !== a.updatedAt ? b.updatedAt - a.updatedAt : (a.id < b.id ? -1 : 1)))\n return out\n}\n\n/**\n * Every quick-switchable session across the whole list — the sessions tab's\n * data: running rows pinned on top, everything else under them, both groups\n * newest first. Visibility mirrors the tree (subagent rows never; archived\n * never; a blank row only while it is the open session).\n * @param list - sessions list snapshot.\n * @param archived - registry-global archive set (archived rows never surface).\n * @param current - the selected session (`mainView` retention; keeps its blank row visible).\n * @returns summaries with running first, then recency (id as deterministic tiebreak).\n */\nexport function allSessions(\n list: SessionListState,\n archived: ReadonlySet,\n current: SessionId | undefined,\n): SessionSummary[] {\n const out: SessionSummary[] = []\n for (const id of list.ids) {\n if (archived.has(id)) continue\n const summary = list.byId[id]\n if (summary === undefined) continue\n if (summary.origin === 'subagent') continue\n if (summary.blank && summary.id !== current) continue\n out.push(summary)\n }\n out.sort((a, b) => {\n if (a.running !== b.running) return a.running ? -1 : 1\n return b.updatedAt !== a.updatedAt ? b.updatedAt - a.updatedAt : (a.id < b.id ? -1 : 1)\n })\n return out\n}\n\n/**\n * Session search for the quick panel: display-title or owning-workspace-title\n * substring match (trimmed, case-insensitive). Filters only — the incoming\n * running-first/recency order is preserved verbatim, so \"running on top\"\n * survives any query.\n * @param sessions - allSessions() output (running pinned on top, then recency).\n * @param query - raw query.\n * @param workspaceTitleOf - owning workspace title resolver (sub-line source).\n * @param limit - hard render cap.\n * @returns matching sessions in the given order.\n */\nexport function filterSessions(\n sessions: readonly SessionSummary[],\n query: string,\n workspaceTitleOf: (session: SessionSummary) => string | undefined,\n limit = 200,\n): SessionSummary[] {\n const q = query.trim().toLowerCase()\n if (q === '') return sessions.slice(0, limit)\n const out: SessionSummary[] = []\n for (const session of sessions) {\n const workspace = workspaceTitleOf(session)?.toLowerCase() ?? ''\n if (session.displayTitle.toLowerCase().includes(q) || workspace.includes(q)) out.push(session)\n }\n return out.slice(0, limit)\n}\n\n/**\n * Most recently updated running session inside one workspace.\n * @param list - sessions list snapshot.\n * @param workspace - target workspace (its session account order is irrelevant;\n * recency picks the row).\n * @returns the session id, or undefined when nothing in the workspace runs.\n */\nexport function latestRunningInWorkspace(list: SessionListState, workspace: WorkspaceView): SessionId | undefined {\n let best: SessionId | undefined\n let bestTime = Number.NEGATIVE_INFINITY\n for (const id of workspace.sessionIds) {\n const summary = list.byId[id]\n if (summary === undefined || !quickEligible(summary)) continue\n if (summary.updatedAt > bestTime) {\n best = summary.id\n bestTime = summary.updatedAt\n }\n }\n return best\n}\n\n/**\n * Running-session count per workspace id (badge on the workspace tab rows).\n * @param running - runningSessions() output.\n * @param workspaces - real workspaces in stable Host order.\n * @returns counts keyed by workspace id; absent key = none running.\n */\nexport function runningCountByWorkspace(\n running: readonly SessionSummary[],\n workspaces: readonly WorkspaceView[],\n): Map {\n const counts = new Map()\n if (running.length === 0) return counts\n const runningIds = new Set(running.map(s => s.id))\n for (const workspace of workspaces) {\n let count = 0\n for (const sessionId of workspace.sessionIds) {\n if (runningIds.has(sessionId)) count += 1\n }\n if (count > 0) counts.set(workspace.workspaceId as string, count)\n }\n return counts\n}\n\n/**\n * The workspace that owns the currently open session.\n * @param workspaces - real workspaces in stable Host order.\n * @param currentSessionId - the selected session (`mainView` retention); may be undefined\n * (no session open, cleared selection) or an id no listed workspace holds\n * (e.g. an addressed subagent session).\n * @returns the workspace id, or undefined when there is no active workspace.\n */\nexport function activeWorkspaceId(\n workspaces: readonly WorkspaceView[],\n currentSessionId: SessionId | undefined,\n): string | undefined {\n if (currentSessionId === undefined) return undefined\n const workspace = workspaces.find(w => w.sessionIds.includes(currentSessionId))\n return workspace?.workspaceId as string | undefined\n}\n\n/**\n * Workspace search for the quick panel: title prefix → title substring →\n * category label substring → path substring; ties keep host order via a\n * stable title compare inside one rank.\n * @param workspaces - real workspaces in stable Host order.\n * @param query - raw query (trimmed, case-insensitive).\n * @param categoryLabelOf - category label resolver (grouped workspaces only).\n * @param limit - hard render cap.\n * @returns ranked matches; an empty query returns host order.\n */\nexport function filterWorkspaces(\n workspaces: readonly WorkspaceView[],\n query: string,\n categoryLabelOf?: (workspace: WorkspaceView) => string | undefined,\n limit = 50,\n): WorkspaceView[] {\n const q = query.trim().toLowerCase()\n if (q === '') return workspaces.slice(0, limit)\n const scored: { workspace: WorkspaceView; score: number }[] = []\n for (const workspace of workspaces) {\n const title = workspace.title.toLowerCase()\n const path = workspace.path.toLowerCase()\n const category = (categoryLabelOf?.(workspace) ?? '').toLowerCase()\n let score: number | undefined\n if (title.startsWith(q)) score = 0\n else if (title.includes(q)) score = 1\n else if (category !== '' && category.includes(q)) score = 2\n else if (path.includes(q)) score = 3\n if (score !== undefined) scored.push({ workspace, score })\n }\n scored.sort((a, b) => (a.score !== b.score\n ? a.score - b.score\n : a.workspace.title.localeCompare(b.workspace.title)))\n return scored.slice(0, limit).map(entry => entry.workspace)\n}\n","/**\n * Ctrl+R quick switch panel: two tabs over the framework's global hooks.\n *\n * - Workspaces tab: search real Workspaces, select one, then either start a\n * New Session in it or jump straight to its most recently updated running\n * session (the button reads the none-running state and disables).\n * - Sessions tab: every top-level session across workspaces — running ones\n * pinned on top, everything else under them, both groups newest first; one\n * click (or Enter) opens it. The shared search input filters by session or\n * workspace title and never re-sorts, so the running-first order survives.\n *\n * Current-row marker: the open workspace (workspaces tab) and the open\n * session (sessions tab) render `.wgQuickRowCurrent`; with no current\n * session — or one no listed workspace holds — nothing is marked.\n *\n * Mount discipline: the parent conditionally mounts this component, so every\n * open starts from a fresh query/selection (quick-switcher semantics). The\n * overlay portals to document.body (sidebar ancestors clip `fixed`), sizes\n * itself like a launcher (top-anchored, 640px) instead of the host Modal's\n * 380px dialog, and handles Escape / mask click by itself. Pure data shaping\n * lives in quick.ts; this file only binds hooks + actions.\n */\nimport { useEffect, useMemo, useRef, useState, type KeyboardEvent, type MouseEvent } from 'react'\nimport { createPortal } from 'react-dom'\nimport { Button, StateDot } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { SessionListState } from '@deepseek-ai/dsh-api-session-controller/client'\nimport type { WorkspaceId, WorkspaceView } from '@deepseek-ai/dsh-api-workspace-controller/client'\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\nimport { activeWorkspaceId, allSessions, filterSessions, filterWorkspaces, latestRunningInWorkspace, runningCountByWorkspace, runningSessions } from './quick.ts'\nimport { relativeTimeLabel } from './rows.tsx'\n\n/** Which surface of the quick panel is active. */\nexport type QuickTab = 'workspaces' | 'sessions'\n\n/** The locale seat's translate function (same shape GroupsBrowser receives). */\ntype Translate = PropsLocale<'workspaceGroups'>['t']\n\n/** Quick panel props: hooks snapshots + the two injected verbs + shared CSS context. */\nexport type QuickPanelProps = {\n /** Close request (Escape, mask click, action completed, or parent Ctrl+R toggle). */\n onClose: () => void\n /** Sessions list snapshot (drives running detection). */\n list: SessionListState\n /** Real workspaces in stable Host order. */\n workspaces: readonly WorkspaceView[]\n /** Registry-global archive set. */\n archivedSessionIds: readonly SessionId[]\n /** Category label per grouped workspace id (badge column; top-level absent). */\n categoryByWorkspace: ReadonlyMap\n /** The Session the Conversation currently shows (mainView retention), if any. */\n current: SessionId | undefined\n /** Start a New Session in a workspace (injected share verb). */\n startSession: (workspaceId?: WorkspaceId) => void\n /** Open a real Session (injected share verb). */\n openSession: (sessionId: SessionId) => void\n /** Render clock for relative times (parent refreshes per render). */\n now: number\n /** Dictionary accessor (workspaceGroups namespace). */\n t: Translate\n}\n\n/** Basename of a host path (both separators; shortens the workspace row sub-line). */\nfunction pathBasename(path: string): string {\n const trimmed = path.replace(/[/\\\\]+$/, '')\n const base = trimmed.split(/[/\\\\]/).pop()\n return base !== undefined && base !== '' ? base : trimmed\n}\n\n/**\n * Render the quick switch panel (portaled overlay).\n * @param props - hooks snapshots + injected verbs.\n * @returns the panel element tree.\n */\nexport function QuickPanel({\n onClose,\n list,\n workspaces,\n archivedSessionIds,\n categoryByWorkspace,\n current: currentSessionId,\n startSession,\n openSession,\n now,\n t,\n}: QuickPanelProps) {\n const [tab, setTab] = useState('workspaces')\n const [query, setQuery] = useState('')\n const [selectedId, setSelectedId] = useState(null)\n const [activeIndex, setActiveIndex] = useState(0)\n const inputRef = useRef(null)\n const activeRowRef = useRef(null)\n\n const archived = useMemo(() => new Set(archivedSessionIds), [archivedSessionIds])\n const running = useMemo(() => runningSessions(list, archived), [list, archived])\n const runCounts = useMemo(() => runningCountByWorkspace(running, workspaces), [running, workspaces])\n const filtered = useMemo(\n () => filterWorkspaces(workspaces, query, ws => categoryByWorkspace.get(ws.workspaceId as string)),\n [workspaces, query, categoryByWorkspace],\n )\n\n // Where the user is right now: the open session and its owning workspace.\n // Both may be absent (no mainView retention, or a session no listed\n // workspace holds) — the current-row marker simply never renders then.\n const currentWorkspaceId = useMemo(\n () => activeWorkspaceId(workspaces, currentSessionId),\n [workspaces, currentSessionId],\n )\n\n // Sessions tab data: every top-level session, running pinned on top then\n // recency, filtered by the shared search query (filter never re-sorts).\n const sessions = useMemo(\n () => allSessions(list, archived, currentSessionId),\n [list, archived, currentSessionId],\n )\n // Owning workspace title per session id (row sub-line + search field);\n // first workspace wins — a session lives in exactly one.\n const workspaceTitleBySession = useMemo(() => {\n const map = new Map()\n for (const workspace of workspaces) {\n for (const sessionId of workspace.sessionIds) {\n if (!map.has(sessionId)) map.set(sessionId, workspace.title)\n }\n }\n return map\n }, [workspaces])\n const filteredSessions = useMemo(\n () => filterSessions(sessions, query, s => workspaceTitleBySession.get(s.id)),\n [sessions, query, workspaceTitleBySession],\n )\n\n const selected = selectedId === null\n ? undefined\n : workspaces.find(w => (w.workspaceId as string) === selectedId)\n const selectedRunningId = selected === undefined ? undefined : latestRunningInWorkspace(list, selected)\n\n // Focus the search input whenever a tab becomes reachable (both tabs own it).\n useEffect(() => {\n inputRef.current?.focus()\n }, [tab])\n\n // Keep the keyboard-active row visible while arrowing through the list.\n useEffect(() => {\n activeRowRef.current?.scrollIntoView({ block: 'nearest' })\n }, [activeIndex])\n\n /** Select the workspace and close (New Session verb). */\n const launchNewSession = (workspace: WorkspaceView): void => {\n startSession(workspace.workspaceId)\n onClose()\n }\n\n /** Open a session row and close (sessions tab click or Enter). */\n const launchSession = (sessionId: SessionId): void => {\n openSession(sessionId)\n onClose()\n }\n\n /** Switch tabs; the query carries over, the per-tab selection resets. */\n const switchTab = (next: QuickTab): void => {\n setTab(next)\n setSelectedId(null)\n setActiveIndex(0)\n }\n\n /** Search-input keyboard: arrows move the active row; Enter confirms it. */\n const onSearchKeyDown = (e: KeyboardEvent): void => {\n if (e.key === 'ArrowDown') {\n e.preventDefault()\n const max = (tab === 'workspaces' ? filtered.length : filteredSessions.length) - 1\n setActiveIndex(i => Math.min(i + 1, Math.max(max, 0)))\n } else if (e.key === 'ArrowUp') {\n e.preventDefault()\n setActiveIndex(i => Math.max(i - 1, 0))\n } else if (e.key === 'Enter') {\n e.preventDefault()\n if (tab === 'workspaces') {\n if (selected === undefined) {\n const target = filtered[activeIndex]\n if (target !== undefined) setSelectedId(target.workspaceId as string)\n } else {\n launchNewSession(selected)\n }\n } else {\n const target = filteredSessions[activeIndex]\n if (target !== undefined) launchSession(target.id)\n }\n }\n }\n\n /** Escape closes (capture so row buttons and the input can't swallow it). */\n const onCardKeyDown = (e: KeyboardEvent): void => {\n if (e.key === 'Escape') {\n e.preventDefault()\n e.stopPropagation()\n onClose()\n }\n }\n\n /** Mask click closes; clicks inside the card never reach the mask. */\n const onOverlayMouseDown = (e: MouseEvent): void => {\n if (e.target === e.currentTarget) onClose()\n }\n\n const selectWorkspace = (id: string): void => {\n setSelectedId(id)\n inputRef.current?.focus()\n }\n\n return createPortal(\n
\n \n
\n {t('quick.title')}\n
\n { switchTab('workspaces') }}\n >\n {t('quick.tab.workspaces')}\n \n { switchTab('sessions') }}\n >\n {t('quick.tab.sessions')}\n {running.length > 0 && {running.length}}\n \n
\n
\n\n {/* Shared search: workspaces on one tab, sessions on the other. */}\n
\n {\n setQuery(e.target.value)\n setSelectedId(null)\n setActiveIndex(0)\n }}\n onKeyDown={onSearchKeyDown}\n />\n
\n {tab === 'workspaces' ? (\n <>\n
\n {filtered.map((workspace, i) => {\n const id = workspace.workspaceId as string\n const count = runCounts.get(id) ?? 0\n const category = categoryByWorkspace.get(id)\n const isCurrent = id === currentWorkspaceId\n return (\n { setActiveIndex(i) }}\n onClick={() => { selectWorkspace(id) }}\n >\n \n {workspace.title}\n {count > 0 && ● {count}}\n \n \n \n {category !== undefined ? `${category} · ${pathBasename(workspace.path)}` : pathBasename(workspace.path)}\n \n \n \n )\n })}\n {filtered.length === 0 &&
{t('quick.empty.workspaces')}
}\n
\n
\n \n {selected === undefined ? t('quick.select.hint') : selected.title}\n \n { if (selectedRunningId !== undefined) launchSession(selectedRunningId) }}\n >\n {selectedRunningId !== undefined ? t('quick.action.running') : t('quick.action.noneRunning')}\n \n { if (selected !== undefined) launchNewSession(selected) }}\n >\n {t('quick.action.newSession')}\n \n
\n \n ) : (\n
\n {filteredSessions.map((session, i) => {\n const workspaceTitle = workspaceTitleBySession.get(session.id) ?? ''\n const isCurrent = session.id === currentSessionId\n return (\n { setActiveIndex(i) }}\n onClick={() => { launchSession(session.id) }}\n >\n \n \n {session.blank ? t('newSession') : session.displayTitle}\n {relativeTimeLabel(session.updatedAt, now)}\n \n \n {workspaceTitle}\n \n \n )\n })}\n {filteredSessions.length === 0 &&
{t('quick.empty.sessions')}
}\n
\n )}\n\n
{t('quick.hint')}
\n
\n ,\n document.body,\n )\n}\n","/**\n * DOM seat for the session tab strip.\n *\n * Why this exists instead of a slot: the strip belongs at the very top of the\n * conversation column — `pI_x6G_centerCol` (ui-layout's AppFrame `.centerCol`,\n * a hashed CSS-Modules class). That column declares NO child slots: its only\n * child is the `main` slot's occupant (`renderSlot('main', …)`, the\n * Conversation or a global panel), so there is nowhere to register. The\n * shipped slot in that neighbourhood — `conversation.composer.dock` — is the\n * band UNDER the composer card, a different place entirely.\n *\n * So the strip gets a real DOM seat: this module finds the column, prepends a\n * `
` to it, and hands that element to a React portal. The element is\n * OURS, never React's: it is inserted outside the column's child list that\n * React reconciles, and it is re-inserted if React (or a theme/titlebar\n * re-render) ever drops it.\n *\n * Two hazards this module is built around:\n *\n * 1. `centerCol` is a hashed class name (`pI_x6G_centerCol`) that changes when\n * the package is rebuilt. Matching is therefore done on the *structural*\n * contract — a grid-item column that holds the `main` panel — plus a\n * `[class*=\"_centerCol\"]` probe, never on the exact hash.\n * 2. The column mounts after the client plugin's `apply()` runs. Discovery is\n * therefore a MutationObserver on `document.body` plus a `requestAnimationFrame`\n * retry, and both are torn down when the owning effect disposes.\n */\n\n/** Persistent marker for the injected container (survives React re-renders). */\nconst SEAT_ATTRIBUTE = 'data-wg-tab-seat'\n\n/** Sentinel attribute on the container so discovery can skip our own node. */\nconst SEAT_SELECTOR = `[${SEAT_ATTRIBUTE}]`\n\n/**\n * Match the conversation column by its hashed CSS-Modules class.\n *\n * The hash prefix (`pI_x6G_`) is build-dependent, so the probe matches the\n * `_centerCol` suffix that the Modules transform always preserves. A plain\n * `class*=\"centerCol\"` scan would risk matching unrelated utility classes, so\n * the leading underscore is required.\n * @param root - subtree to scan (normally `document`).\n * @returns the column element, or null while it has not mounted.\n */\nfunction findCenterColumn(root: ParentNode): HTMLElement | null {\n // Fast path: the seat is already in place and still attached, which is the\n // steady state on every re-render (portal into an existing element).\n const existing = root.querySelector(SEAT_SELECTOR)\n if (existing?.isConnected === true) return existing.parentElement\n\n // Structural probe: the column is the direct child of the app frame grid\n // that contains the `main` panel. Querying the class suffix first keeps this\n // to one selector evaluation in the common case.\n const column = root.querySelector('[class*=\"_centerCol\"]')\n if (column !== null) return column\n\n // Nothing matched: either the shell has not mounted yet, or the Modules hash\n // convention changed. Returning null keeps the caller in its wait loop\n // instead of guessing at a wrong node (which would visually corrupt the\n // shell). The strip simply appears once the frame is up.\n return null\n}\n\n/** A mounted seat: the host element plus the disposer that removes it. */\nexport interface TabSeat {\n /**\n * The element the React portal renders into — null until the conversation\n * column mounts. The portal is simply not rendered while this is null.\n */\n readonly host: HTMLElement | null\n /** Remove the seat and stop watching for the column. */\n dispose: () => void\n}\n\n/**\n * Ensure a seat exists as the FIRST child of the conversation column, creating\n * it if needed, and keep it there for as long as the returned handle is live.\n *\n * The seat element is created once and reused: a portal that re-mounts into a\n * fresh node on every shell re-render would drop the tab strip's React state\n * and visible focus. If React removes the node (it owns the column's child\n * list, and our node is not part of it), the observer re-inserts the SAME\n * element, so the portal's subtree moves with it.\n *\n * @param onReady - called with the host element each time it becomes attached\n * (once immediately when the column already exists). Used to seed React\n * state; may fire more than once if the column is remounted.\n * @returns the seat handle. `host` is null until the column appears, so the\n * caller renders nothing meanwhile and starts rendering when `onReady`\n * fires. Never null: a missing column must degrade to \"no strip\", not to a\n * thrown error that would take the whole client plugin down.\n */\nexport function mountTabSeat(onReady: (host: HTMLElement) => void): TabSeat {\n let host: HTMLElement | null = null\n let column: HTMLElement | null = null\n let observer: MutationObserver | null = null\n let raf = 0\n let attempts = 0\n let disposed = false\n\n // Bounded retry: ~5s at 60fps. The shell mounts well inside this; the bound\n // exists so a missing column degrades to \"no strip\" instead of a permanent\n // frame loop.\n const MAX_ATTEMPTS = 300\n\n /**\n * Put the seat at the head of the column, creating it on first success.\n * Idempotent: a seat already first is left untouched, so repeated calls from\n * the observer cause no DOM churn (and therefore no observer feedback loop —\n * our insertion schedules one more callback, which then takes this early\n * return instead of re-inserting).\n */\n const place = (target: HTMLElement): void => {\n if (disposed) return\n if (host === null) {\n host = document.createElement('div')\n host.setAttribute(SEAT_ATTRIBUTE, '')\n }\n if (target.firstChild === host) return\n target.insertBefore(host, target.firstChild)\n }\n\n /** Locate the column and, on success, seat the host and notify the caller. */\n const tryMount = (): boolean => {\n if (disposed) return true\n // Steady state: the column we already found is still attached.\n if (column !== null && column.isConnected) {\n place(column)\n return true\n }\n const found = findCenterColumn(document)\n if (found === null) return false\n // A different column than last time (shell remount): re-seat AND re-notify,\n // because the caller may hold a stale host element from the old tree.\n const changed = found !== column\n column = found\n place(found)\n if (changed) onReady(host as HTMLElement)\n return true\n }\n\n const tick = (): void => {\n if (disposed) return\n raf = 0\n if (tryMount()) return\n attempts += 1\n if (attempts >= MAX_ATTEMPTS) return\n raf = requestAnimationFrame(tick)\n }\n\n // The observer covers both \"column mounts later\" and \"React dropped our\n // node\": either way the child list changes and we re-seat. `requestAnimationFrame`\n // alone would miss a removal that happens after the retry budget is spent.\n observer = new MutationObserver(() => {\n if (disposed) return\n if (tryMount()) return\n if (raf === 0 && attempts < MAX_ATTEMPTS) raf = requestAnimationFrame(tick)\n })\n observer.observe(document.body, { childList: true, subtree: true })\n\n if (!tryMount() && raf === 0) raf = requestAnimationFrame(tick)\n\n return {\n get host(): HTMLElement | null {\n // Null until the column mounts; the caller's `onReady` fires at the same\n // moment this becomes non-null, so the two never disagree.\n return host\n },\n dispose: () => {\n disposed = true\n if (raf !== 0) cancelAnimationFrame(raf)\n raf = 0\n observer?.disconnect()\n observer = null\n host?.remove()\n host = null\n column = null\n },\n } as TabSeat\n}\n","/**\n * The session tab strip: one chip per opened conversation, rendered into the\n * DOM seat at the head of the conversation column (see `tab-seat.ts` for why\n * this is a DOM injection rather than a slot).\n *\n * A tab is a *view* of the open session, not a second navigation model:\n * clicking a chip navigates through `ctx.uiWorkspace.openSession`, which is the\n * one path that retains a target session; the owning component derives the\n * strip from the open session plus the tab store.\n *\n * The active chip is derived, never stored: it is the chip whose session is the\n * open one, so clicking a background chip immediately shows that chip active.\n *\n * Every affordance beyond \"click to switch\" is an explicit USER gesture, and\n * each one maps to exactly one store action: middle-click closes, the context\n * menu pins / renames / closes a range, a drag reorders, and a double-click\n * edits the tab's own label. None of them can run on their own — the strip stays\n * a record of what the user opened.\n */\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport {\n IconCloseFillMedium,\n IconPinFillMedium,\n StateDot,\n Tooltip,\n type StateDotState,\n} from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\nimport type { SessionsTabsProps } from './contract.ts'\nimport { mountTabSeat } from './tab-seat.ts'\nimport {\n orderedTabs,\n projectIndex,\n tabIndicator,\n type SessionTab,\n type SessionTabIndicator,\n} from './tabs.ts'\nimport { currentSessionId } from './tree.ts'\n\n/** Dot state for one tab (the sidebar's session rows share this vocabulary). */\nfunction dotState(indicator: SessionTabIndicator): StateDotState {\n if (indicator.attention) return 'warning'\n if (indicator.running) return 'ongoing'\n return 'done'\n}\n\n/** Where the context menu is pinned, and which chip it belongs to. */\ninterface MenuAnchor {\n readonly sessionId: SessionId\n readonly x: number\n readonly y: number\n}\n\n/** Which chip a drag is hovering, and which half of it. */\ninterface DropTarget {\n readonly sessionId: SessionId\n readonly side: 'before' | 'after'\n}\n\n/** In-flight inline label edit. */\ninterface LabelEdit {\n readonly sessionId: SessionId\n readonly draft: string\n}\n\n/** One row of the tab context menu. */\nfunction MenuRow({\n label,\n onSelect,\n disabled = false,\n danger = false,\n}: {\n readonly label: string\n readonly onSelect: () => void\n readonly disabled?: boolean\n readonly danger?: boolean\n}) {\n return (\n \n {label}\n \n )\n}\n\n/**\n * Render the session tab strip into the conversation column's head seat.\n * @param props - tab store, catalog/status hooks, navigation, locale.\n * @returns the portal (or null until the column has mounted).\n */\nexport function SessionTabs({\n useTabs,\n actions,\n useSessions,\n useSessionStatus,\n useWorkspaces,\n activate,\n rename,\n t,\n}: SessionsTabsProps) {\n const tabs = useTabs(s => s.tabs)\n const list = useSessions(s => s)\n const statuses = useSessionStatus(s => s)\n const currentId = useSessions(s => currentSessionId(s))\n const workspaces = useWorkspaces(s => s.items)\n\n // Session → owning project, in one pass over the workspace registry. This is\n // what lets each chip name its project; without it a strip of session titles\n // is ambiguous as soon as two projects are open.\n const projects = useMemo(() => projectIndex(workspaces), [workspaces])\n\n // The seat is a DOM node outside React's tree, so it cannot arrive through\n // props; it is discovered once per mount and held in state to trigger the\n // portal's first render when the column appears.\n const [seat, setSeat] = useState(null)\n // The scrolling row, for wheel redirection and keep-active-in-view.\n const scrollRef = useRef(null)\n // The open context menu, its chip, and its viewport position.\n const [menu, setMenu] = useState(null)\n // The chip whose label is being typed into, plus the in-progress text.\n const [editing, setEditing] = useState(null)\n // The chip being dragged and the chip/half it would land on.\n const [dragging, setDragging] = useState(null)\n const [dropTarget, setDropTarget] = useState(null)\n // Timestamp of the last drag end: a drop must not also count as a click on\n // the chip it landed on (which would navigate away from what was just moved).\n const dragEndedAt = useRef(0)\n\n useEffect(() => {\n const mounted = mountTabSeat(setSeat)\n // The column may already exist, in which case onReady fired synchronously\n // during mountTabSeat and setSeat is already queued; adopt it here too so\n // the very first paint has a host instead of waiting a frame.\n if (mounted.host !== null) setSeat(mounted.host)\n return () => {\n mounted.dispose()\n // The portal must stop targeting a removed node before the next mount.\n setSeat(null)\n }\n }, [])\n\n // The strip renders exactly the tabs the store holds. There is deliberately NO\n // filtering against the session catalog and no \"close tabs whose session\n // vanished\" sweep: a tab is removed when the USER closes it, and by nothing\n // else. Trimming automatically also misfires — the catalog is briefly empty on\n // every load, which deleted restored tabs before the sessions arrived.\n const display = useMemo(() => orderedTabs(tabs, currentId), [tabs, currentId])\n const index = useMemo(() => new Map(display.map((tab, at) => [tab.sessionId, at])), [display])\n\n // With the row scrollable, the active chip can sit outside the viewport —\n // e.g. after clicking a session in the sidebar that has a tab far to the\n // right. Bring it into view on selection change. `block: 'nearest'` keeps\n // this a horizontal-only scroll, and `inline: 'nearest'` avoids nudging the\n // row when the chip is already fully visible.\n useEffect(() => {\n const el = scrollRef.current\n if (el === null || currentId === undefined) return\n const chip = el.querySelector(`[data-tab-session=\"${CSS.escape(currentId)}\"]`)\n chip?.scrollIntoView({ block: 'nearest', inline: 'nearest' })\n }, [currentId, display.length])\n\n // Dismiss the context menu on any interaction outside it. Pointerdown covers\n // both buttons; Escape and a viewport change (which would leave a fixed menu\n // pointing at the wrong chip) close it too. `capture` matters for the scroll\n // case: the strip's own row scrolls without bubbling a scroll event up.\n useEffect(() => {\n if (menu === null) return\n const dismiss = (): void => { setMenu(null) }\n const onPointerDown = (event: PointerEvent): void => {\n const target = event.target\n if (target instanceof Element && target.closest('.wgTabMenu') !== null) return\n dismiss()\n }\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') dismiss()\n }\n document.addEventListener('pointerdown', onPointerDown, true)\n document.addEventListener('keydown', onKeyDown)\n window.addEventListener('resize', dismiss)\n window.addEventListener('scroll', dismiss, true)\n return () => {\n document.removeEventListener('pointerdown', onPointerDown, true)\n document.removeEventListener('keydown', onKeyDown)\n window.removeEventListener('resize', dismiss)\n window.removeEventListener('scroll', dismiss, true)\n }\n }, [menu])\n\n if (seat === null || display.length === 0) return null\n\n /** Commit the in-flight label edit (blank clears the override). */\n const commitEdit = (): void => {\n if (editing === null) return\n actions.rename(editing.sessionId, editing.draft)\n setEditing(null)\n }\n\n /** Start editing a tab's own label, pre-filled with what the chip shows. */\n const startEdit = (sessionId: SessionId, current: string): void => {\n setMenu(null)\n setEditing({ sessionId, draft: current })\n }\n\n /** Translate a drop onto `target` into an index in the resulting strip. */\n const dropIndexFor = (draggedSessionId: SessionId, target: DropTarget): number | null => {\n const from = index.get(draggedSessionId)\n const at = index.get(target.sessionId)\n if (from === undefined || at === undefined || from === at) return null\n // Insertion index in the CURRENT strip, then corrected for the removal the\n // move implies: removing a chip before the insertion point shifts it left.\n const insertion = at + (target.side === 'after' ? 1 : 0)\n return from < insertion ? insertion - 1 : insertion\n }\n\n const chips = display.map((tab: SessionTab, at: number) => {\n const summary = list.byId[tab.sessionId]\n // A restored tab can render before its catalog row arrives. Show the\n // session id meanwhile rather than an empty chip — the tab is real, and\n // the title fills in as soon as the catalog catches up.\n const sessionLabel = summary === undefined\n ? tab.sessionId\n : summary.blank ? t('newSession') : summary.displayTitle\n // The user's own label wins over the session title; blank means \"follow the\n // session\", so the override is absent rather than empty.\n const label = tab.title ?? sessionLabel\n const active = tab.sessionId === currentId\n const pinned = tab.pinned === true\n const indicator = tabIndicator(summary, statuses.get(tab.sessionId))\n // The project this session belongs to. Absent for a session that is in\n // no workspace (a bare session, or one just created before the\n // registry caught up) — the chip then shows the title alone rather\n // than a placeholder.\n const project = projects.get(tab.sessionId)\n // Title attribute carries the full pair plus the directory, so the\n // truncated chip text is recoverable on hover.\n const tip = project === undefined\n ? label\n : `${project.label} · ${label}\\n${project.path}`\n const drop = dropTarget !== null && dropTarget.sessionId === tab.sessionId ? dropTarget.side : null\n const isEditing = editing !== null && editing.sessionId === tab.sessionId\n const draft = isEditing && editing !== null ? editing.draft : ''\n const className = [\n 'wgTab',\n active ? 'wgTabActive' : '',\n pinned ? 'wgTabPinned' : '',\n dragging === tab.sessionId ? 'wgTabDragging' : '',\n drop === 'before' ? 'wgTabDropBefore' : '',\n drop === 'after' ? 'wgTabDropAfter' : '',\n ].filter(part => part !== '').join(' ')\n return (\n {\n // Middle click closes, the way every other tab strip behaves. Only\n // button 1: a right click opens the menu instead.\n if (event.button !== 1) return\n event.preventDefault()\n actions.close(tab.sessionId)\n }}\n onContextMenu={(event) => {\n event.preventDefault()\n setEditing(null)\n setMenu({\n sessionId: tab.sessionId,\n // Clamp inside the viewport so a chip near the right edge does not\n // open a menu that runs off-screen.\n x: Math.min(event.clientX, window.innerWidth - 208),\n y: Math.min(event.clientY, window.innerHeight - 240),\n })\n }}\n onDragStart={(event) => {\n event.dataTransfer.effectAllowed = 'move'\n event.dataTransfer.setData('text/plain', tab.sessionId)\n setDragging(tab.sessionId)\n setMenu(null)\n }}\n onDragOver={(event) => {\n if (dragging === null || dragging === tab.sessionId) return\n event.preventDefault()\n event.dataTransfer.dropEffect = 'move'\n const rect = event.currentTarget.getBoundingClientRect()\n const side = event.clientX < rect.left + rect.width / 2 ? 'before' : 'after'\n setDropTarget({ sessionId: tab.sessionId, side })\n }}\n onDrop={(event) => {\n event.preventDefault()\n if (dragging !== null && dropTarget !== null) {\n const target = dropIndexFor(dragging, dropTarget)\n if (target !== null) actions.move(dragging, target)\n }\n setDragging(null)\n setDropTarget(null)\n dragEndedAt.current = Date.now()\n }}\n onDragEnd={() => {\n setDragging(null)\n setDropTarget(null)\n dragEndedAt.current = Date.now()\n }}\n >\n {isEditing ? (\n { event.currentTarget.select() }}\n onChange={(event) => { setEditing({ sessionId: tab.sessionId, draft: event.target.value }) }}\n onClick={(event) => { event.stopPropagation() }}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault()\n commitEdit()\n } else if (event.key === 'Escape') {\n event.preventDefault()\n setEditing(null)\n }\n }}\n onBlur={() => { commitEdit() }}\n />\n ) : (\n <>\n {\n if (Date.now() - dragEndedAt.current < 250) return\n activate(tab.sessionId)\n }}\n onDoubleClick={() => { startEdit(tab.sessionId, label) }}\n >\n \n \n \n {/* Two stacked lines, folder-style: the project (short, quiet)\n over the session title (long, primary). The project line is\n omitted for a session in no workspace, which lets the title\n use the full height rather than leaving a blank row. */}\n \n {project !== undefined && (\n {project.label}\n )}\n {label}\n \n \n {pinned && (\n \n \n \n )}\n \n {\n event.stopPropagation()\n actions.close(tab.sessionId)\n }}\n >\n \n \n \n \n )}\n
\n )\n })\n\n // The menu's chip, resolved against the current strip: a menu opened on a chip\n // that has since disappeared renders nothing rather than acting on a stale id.\n const menuTab = menu === null ? undefined : display.find(tab => tab.sessionId === menu.sessionId)\n const menuIndex = menuTab === undefined ? -1 : at(display, menuTab)\n const menuLabel = menuTab === undefined\n ? ''\n : menuTab.title ?? list.byId[menuTab.sessionId]?.displayTitle ?? menuTab.sessionId\n const menuPinned = menuTab?.pinned === true\n const canCloseRight = menuIndex >= 0 && menuIndex < display.length - 1\n\n return createPortal(\n <>\n
\n {\n // A plain wheel reports only `deltaY`, and the overflow here is\n // horizontal, so without this the wheel would do nothing over the\n // strip (or scroll the transcript behind it). Redirect the dominant\n // delta to scrollLeft, and only swallow the event once there is\n // somewhere left to scroll — otherwise a wheel at either end keeps\n // propagating and the page still scrolls normally.\n const el = event.currentTarget\n if (el.scrollWidth <= el.clientWidth) return\n const delta = Math.abs(event.deltaY) > Math.abs(event.deltaX) ? event.deltaY : event.deltaX\n if (delta === 0) return\n const atStart = el.scrollLeft <= 0 && delta < 0\n const atEnd = el.scrollLeft + el.clientWidth >= el.scrollWidth - 1 && delta > 0\n if (atStart || atEnd) return\n el.scrollLeft += delta\n event.preventDefault()\n }}\n >\n {chips}\n
\n \n {menu !== null && menuTab !== undefined && createPortal(\n \n {\n actions.pin(menu.sessionId)\n setMenu(null)\n }}\n />\n { startEdit(menu.sessionId, menuLabel) }}\n />\n {\n setMenu(null)\n rename(menu.sessionId, menuLabel)\n }}\n />\n
\n {\n setMenu(null)\n actions.close(menu.sessionId)\n }}\n />\n {\n setMenu(null)\n actions.closeOthers(menu.sessionId)\n }}\n />\n {\n setMenu(null)\n actions.closeAfter(menu.sessionId)\n }}\n />\n
,\n document.body,\n )}\n ,\n seat,\n )\n}\n\n/** Index of one tab in the strip, used by the menu's range actions. */\nfunction at(tabs: readonly SessionTab[], target: SessionTab): number {\n return tabs.findIndex(tab => tab.sessionId === target.sessionId)\n}\n","/**\n * The workspace-groups browsing region filling the sidebar shell's\n * `sidebar.workspaces` hole: section header (title + right-aligned search +\n * new-group + add workspace), the three-level tree (category —workspace — * session), group management dialogs, and the workspace/session dialogs. Wide\n * state renders the full browser; rail state renders the two region icons\n * (search / add workspace) as 36px controls on the shell's shared rail entry\n * path, each requesting expansion through the owner share.\n *\n * Data: workspaces/sessions via the framework global hooks; grouping config\n * via the host half's `/workspace-groups/config` route (refetched on mount).\n * Runtime group management (create/rename/delete any group, drag workspaces\n * between groups and into position, drag groups into position) persists\n * through `PUT /workspace-groups/manual`; the sidecar YAML is never rewritten\n * (rule-group rename/delete ride the overlay `renamed`/`hidden` maps).\n */\nimport { useEffect, useMemo, useRef, useState, type DragEvent, type ReactElement } from 'react'\nimport {\n Button,\n IconCloseFillMedium,\n IconFolderOpenOutlineRegular,\n IconProjectAddOutlineRegular,\n IconSearchOutlineRegular,\n IconWarningOutlineRegular,\n Modal,\n Toast,\n Tooltip,\n} from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\nimport type { SessionListState, SessionSearchResultItem } from '@deepseek-ai/dsh-api-session-controller/client'\nimport type { WorkspaceId, WorkspaceView } from '@deepseek-ai/dsh-api-workspace-controller/client'\nimport type { SessionStatusSnapshot } from '@deepseek-ai/dsh-client-ui-session/client'\nimport {\n displayCategoryKeys,\n isCategoryPinned,\n moveAfter,\n moveBefore,\n originalRuleNameForDisplay,\n pruneAppearance,\n resolveCategory,\n takenCategoryNames,\n} from '../core/matcher.ts'\nimport {\n GROUP_COLORS,\n GROUP_ICON_IDS,\n TOP_LEVEL_ORDER_KEY,\n UNCATEGORIZED_LABEL,\n type CategoryAppearance,\n type GroupColor,\n type GroupsConfig,\n type ManualGroups,\n} from '../core/types.ts'\nimport type { GroupsBrowserProps } from './contract.ts'\nimport { deriveDefaultWorkspace, deriveGroups, deriveSearchGroups, deriveSearchMatches, deriveTopLevel, currentSessionId, folderKey, isDockedCategoryKey, memberWorkspaces, UNCATEGORIZED_KEY, type CategoryNode, type SearchMatchSet, type SearchTree, type WorkspaceGroupNode } from './tree.ts'\nimport { CategoryGlyph, CategoryRow, DND_CATEGORY_TYPE, DND_WORKSPACE_TYPE, FolderRow, hasPluginDragType, RowGroup, SessionRow, WorkspaceRow } from './rows.tsx'\nimport type { WorkspaceGroupsKey } from './locales.ts'\nimport { GROUP_EMOJI_ICONS, GROUP_ICON_LABELS } from './group-icon-labels.ts'\nimport { SCIENCE_ICON_IDS, SCIENCE_ICON_SECTIONS } from './group-icons-science.tsx'\nimport { EMPTY_FOLDERS_DOCUMENT, addFolder, addMember, effectiveFolders, entryFor, isEmptyEntry, isUnderBase, memberByWorkspaceId, memberOf, findRemoteMember, removeFolder, rootOf, samePath, setRoot, type FolderMember, type FoldersDocument, type WorkspaceFolderEntry } from '../core/folders.ts'\nimport { FoldersConflictError, loadFolders, saveFolders } from './folders-persist.ts'\nimport { createRemoteFolder, createWorkspaceDirectory, deleteRemoteWorkspaceRecord, listRemoteProfiles, remoteFolderWorkspace, type RemoteFolderWorkspace, type RemoteProfileSummary } from './folder-directory.ts'\nimport { fetchOpenInApps, folderAppId, openPathInApp } from './open-folder.ts'\nimport { FoldersDialog } from './FoldersDialog.tsx'\nimport { QuickPanel } from './QuickPanel.tsx'\nimport { SessionTabs } from './SessionTabs.tsx'\nimport css from './styles.css?inline'\n\nconst SEARCH_DEBOUNCE_MS = 250\nconst SEARCH_QUERY_MAX_CODE_UNITS = 500\n\n/** Overlay with every optional field materialized (plain-object edits, no undefined spreads). */\ntype NormalizedManual = Required\n\nconst EMPTY_MANUAL: NormalizedManual = {\n revision: 0,\n categories: [], assignments: {}, categoryOrder: [], workspaceOrder: {}, renamed: {}, hidden: [], appearance: {},\n}\n\n/** Materialize optional overlay fields so every update is a plain object edit. */\nfunction normalizeManual(manual: ManualGroups): NormalizedManual {\n return {\n revision: manual.revision ?? 0,\n categories: manual.categories,\n assignments: manual.assignments,\n categoryOrder: manual.categoryOrder ?? [],\n workspaceOrder: manual.workspaceOrder ?? {},\n renamed: manual.renamed ?? {},\n hidden: manual.hidden ?? [],\n appearance: manual.appearance ?? {},\n }\n}\n\n/**\n * Largest subtree (rows including the level header) that still animates: a\n * 100-session project expanding with a grid animation janks the sidebar, so\n * wide subtrees snap open instead.\n */\nconst ANIMATION_ROW_CAP = 40\n\n/**\n * Mirrors the host icon validator (`parseAppearance`) so invalid custom glyphs\n * fail locally instead of turning the whole overlay PUT into a 400.\n */\nconst ICON_VALUE_PATTERN = /^(?:[a-z][a-z0-9-]{0,23}|[^\\s\\u0000-\\u001f\\u007f]{1,4})$/u\n\n/** Rows a group reveals when expanded (projects + their visible sessions). */\nfunction categoryRowCount(category: CategoryNode): number {\n return category.workspaces.reduce((total, workspace) => total + 1 + (workspace.expanded ? workspace.sessions.length : 0), 0)\n}\n\n/** Palette id —i18n key for the colour picker (keeps literal key types intact). */\nconst COLOR_LABEL_KEYS: Record = {\n red: 'color.red',\n orange: 'color.orange',\n amber: 'color.amber',\n green: 'color.green',\n teal: 'color.teal',\n blue: 'color.blue',\n indigo: 'color.indigo',\n purple: 'color.purple',\n pink: 'color.pink',\n gray: 'color.gray',\n}\n\n/** Research icon ids, matched against the shared registry for the picker split. */\nconst SCIENCE_ICON_ID_SET: ReadonlySet = new Set(SCIENCE_ICON_IDS)\n\n/** Picker section key —i18n key (keeps literal key types intact). */\nconst SCIENCE_SECTION_LABEL_KEYS: Record<'lab' | 'materials' | 'characterization' | 'devices', WorkspaceGroupsKey> = {\n lab: 'group.icon.section.lab',\n materials: 'group.icon.section.materials',\n characterization: 'group.icon.section.characterization',\n devices: 'group.icon.section.devices',\n}\n\n/** The pre-existing glyphs, shown as the picker's \"common\" section. */\nconst COMMON_ICON_IDS = GROUP_ICON_IDS.filter(id => !SCIENCE_ICON_ID_SET.has(id))\n\n/**\n * The same workspace node without its extra folders and session rows: used\n * while searching, so the pinned default-workspace bar never paints unrelated\n * sessions next to pruned search results.\n */\nfunction withoutSessions(node: WorkspaceGroupNode): WorkspaceGroupNode {\n return {\n workspaceId: node.workspaceId,\n path: node.path,\n label: node.label,\n createdAt: node.createdAt,\n sessionCount: node.sessionCount,\n expanded: node.expanded,\n containsCurrent: node.containsCurrent,\n sessions: [],\n }\n}\n\n/**\n * Split the derived categories into the tree and the docked \"not classified\n * yet\" bucket (see isDockedCategoryKey). The bucket keeps its own row and\n * children, only its position moves to the bottom dock.\n */\nfunction splitDockedCategory(categories: readonly CategoryNode[]): {\n treeGroups: readonly CategoryNode[]\n dockedCategory: CategoryNode | undefined\n} {\n const docked = categories.find(category => isDockedCategoryKey(category.key))\n return {\n treeGroups: docked === undefined ? categories : categories.filter(category => category !== docked),\n dockedCategory: docked,\n }\n}\n\n/** Whether a workspace node (or one of its folder rows) holds a matched session. */\nfunction workspaceHasMatchedSession(workspace: WorkspaceGroupNode, matched: ReadonlySet): boolean {\n if (workspace.sessions.some(session => matched.has(session.id))) return true\n return workspace.folders?.some(folder => folder.sessions.some(session => matched.has(session.id))) ?? false\n}\n\nfunction sanitizeSearchQuery(value: string): string {\n const withoutNul = value.replaceAll('\\0', '')\n if (withoutNul.length <= SEARCH_QUERY_MAX_CODE_UNITS) return withoutNul\n return withoutNul.slice(0, SEARCH_QUERY_MAX_CODE_UNITS)\n}\n\n/** Immutable membership toggle for the local expand-all array. */\nfunction toggled(list: readonly string[], key: string): string[] {\n return list.includes(key) ? list.filter(k => k !== key) : [...list, key]\n}\n\ninterface RemoteSearchState {\n query: string\n status: 'idle' | 'loading' | 'ready' | 'error'\n items: readonly SessionSearchResultItem[]\n hasMore: boolean\n}\n\n/** Light runtime guard for the manual overlay attached to the config fetch. */\nfunction isManualGroups(value: unknown): value is ManualGroups {\n if (typeof value !== 'object' || value === null) return false\n const candidate = value as { categories?: unknown; assignments?: unknown }\n return Array.isArray(candidate.categories) && typeof candidate.assignments === 'object' && candidate.assignments !== null\n}\n\n/** Minimal fetch of the grouping config + runtime overlay (no-cache revalidation). */\nasync function fetchGroupsConfig(): Promise<{ config: GroupsConfig; manual: NormalizedManual }> {\n const response = await fetch('/workspace-groups/config', { cache: 'no-cache' })\n if (!response.ok) throw new Error(`config request failed: ${response.status}`)\n const body = (await response.json()) as GroupsConfig\n const config: GroupsConfig = Array.isArray(body.categories) ? body : { categories: [] }\n return { config, manual: isManualGroups(body.manual) ? normalizeManual(body.manual) : EMPTY_MANUAL }\n}\n\n/** A manual-overlay save rejected because another window wrote first (HTTP 409). */\nclass ManualConflictError extends Error {\n readonly current: ManualGroups\n constructor(current: ManualGroups, message = 'group changes changed in another window') {\n super(message)\n this.name = 'ManualConflictError'\n this.current = current\n }\n}\n\n/**\n * Persist the whole runtime overlay (idempotent; the host validates + writes).\n * Resolves with the overlay as stored (host echo, revision bumped) so callers\n * adopt it instead of their own pre-save copy; a stale write rejects with\n * {@link ManualConflictError} carrying the host's current overlay.\n */\nasync function saveManualOverlay(manual: ManualGroups): Promise {\n const response = await fetch('/workspace-groups/manual', {\n method: 'PUT',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(manual),\n })\n if (response.status === 409) {\n const body: unknown = await response.json().catch(() => null)\n const current = typeof body === 'object' && body !== null && isManualGroups((body as { manual?: unknown }).manual)\n ? (body as { manual: ManualGroups }).manual\n : { categories: [], assignments: {} }\n throw new ManualConflictError(current)\n }\n if (!response.ok) {\n let message = `manual save failed: ${response.status}`\n try {\n const text = await response.text()\n if (text !== '') message = text\n } catch { /* keep the fallback message */ }\n throw new Error(message)\n }\n const body: unknown = await response.json().catch(() => null)\n const stored = typeof body === 'object' && body !== null && isManualGroups((body as { manual?: unknown }).manual)\n ? (body as { manual: ManualGroups }).manual\n : null\n return stored ?? manual\n}\n\n/** One group-management dialog state: create, or rename an existing group. */\ntype GroupDialogState = { mode: 'create' } | { mode: 'rename'; from: string } | null\n\n/** Row reference used by drop targets: which kind of row, which key. */\nexport type DropRowRef = { kind: 'category' | 'workspace' | 'topLevel'; key: string }\n\n/**\n * Which level's rows fold while a drag is in progress: dragging a project\n * folds every project row (grouped AND top-level), dragging a group folds\n * every group row. The other level keeps its expansion untouched.\n */\nexport type DragLevel = 'workspace' | 'category' | null\n\n/**\n * Current drop indicator. A `line` renders a 2px insertion line above/below a\n * row (project reorder inside a group, or group reorder); an `into` renders\n * the whole-row highlight used when dropping a project into a group. Drop\n * handlers re-derive before/after from the drop event itself, so the\n * indicator is purely visual and can never go stale.\n */\nexport type DragIndicator =\n | { mode: 'line'; row: DropRowRef; before: boolean }\n | { mode: 'into'; categoryKey: string }\n | null\n\n/**\n * Render the browsing region.\n * @param props - composed slot props (shell owner share + store + injected actions).\n * @returns the region element tree.\n */\nexport function GroupsBrowser({\n wide,\n expandSidebar,\n useSessions,\n useWorkspaces,\n useSessionStatus,\n useStore,\n actions,\n startSession,\n createSessionIn,\n open,\n renameSession,\n forkSession,\n renameWorkspace,\n deleteWorkspace,\n insertWorkspaceBefore,\n archiveSession,\n insertSessionBefore,\n createWorkspace,\n pickDirectory,\n getDirectoryFlow,\n createDirectory,\n searchSessions,\n searchResultLimit,\n openTab,\n useTabs,\n tabActions,\n t,\n}: GroupsBrowserProps) {\n // Inject the stylesheet once per fiber; dispose removes it (HMR safe).\n useEffect(() => {\n const style = document.createElement('style')\n style.setAttribute('data-plugin', 'dsh-workspace-groups')\n style.textContent = css\n document.head.append(style)\n return () => { style.remove() }\n }, [])\n\n // Ctrl+R toggles the quick switch panel. Capture phase + preventDefault:\n // beats the browser's page-reload default and any shell-level handler.\n const [quickOpen, setQuickOpen] = useState(false)\n useEffect(() => {\n const onKeyDown = (e: KeyboardEvent): void => {\n if (e.ctrlKey && !e.altKey && !e.metaKey && !e.shiftKey && (e.key === 'r' || e.key === 'R')) {\n e.preventDefault()\n e.stopPropagation()\n setQuickOpen(v => !v)\n }\n }\n window.addEventListener('keydown', onKeyDown, true)\n return () => window.removeEventListener('keydown', onKeyDown, true)\n }, [])\n\n // Grouping config from the host route + the runtime manual overlay.\n const [config, setConfig] = useState({ categories: [] })\n const [manual, setManual] = useState(EMPTY_MANUAL)\n const [configError, setConfigError] = useState(null)\n const reloadConfig = () => {\n setConfigError(null)\n fetchGroupsConfig().then(({ config: nextConfig, manual: nextManual }) => {\n setConfig(nextConfig)\n setManual(nextManual)\n }).catch((reason: unknown) => {\n setConfigError(reason instanceof Error ? reason.message : String(reason))\n })\n }\n useEffect(() => { reloadConfig() }, [])\n\n // Transient save errors for drag/menu group operations (dialog errors are local).\n const [manualError, setManualError] = useState(null)\n const [manualSaving, setManualSaving] = useState(false)\n\n // ---- Per-workspace folders (multi-root) -------------------------------------\n //\n // A second host sidecar (`/workspace-groups/folders`) lists each workspace's\n // extra folders plus the optional root folder. It is read once per mount and\n // written back whole, like the manual overlay above; a failed write is a\n // toast rather than a banner because every edit here is a one-off row action.\n const [foldersDoc, setFoldersDoc] = useState(EMPTY_FOLDERS_DOCUMENT)\n // Folder collapse is component state, not store state: it is a transient view\n // of the row list, like the quick panel, so it is deliberately NOT persisted\n // with the category/workspace expansion keys. Folders start expanded, so\n // attaching a folder never hides sessions the user could already see.\n const [collapsedFolderKeys, setCollapsedFolderKeys] = useState([])\n const [foldersTarget, setFoldersTarget] = useState(null)\n const [foldersBusy, setFoldersBusy] = useState(false)\n const createdFolderPendingSave = useRef<{ workspaceId: WorkspaceId; name: string; path: string } | null>(null)\n const [creatingSessionIn, setCreatingSessionIn] = useState(null)\n // Local mirror root of the remote-ssh plugin, as reported by the host. A\n // project whose directory lives below it is a REMOTE workspace: its folder is\n // a mirror of one remote root, so extra folders must be subdirectories of that\n // mirror —anything else would exist on this machine only.\n const [foldersRemoteBase, setFoldersRemoteBase] = useState(null)\n useEffect(() => {\n let cancelled = false\n void loadFolders().then((snapshot) => {\n if (cancelled) return\n setFoldersDoc(snapshot.document)\n setFoldersRemoteBase(snapshot.remoteBase ?? null)\n })\n return () => { cancelled = true }\n }, [])\n\n const workspaces = useWorkspaces(state => state.items)\n const workspacePhase = useWorkspaces(state => state.phase)\n const archivedSessionIds = useWorkspaces(state => state.archivedSessionIds)\n const categoryExpansion = useStore(s => s.categoryExpansion)\n const workspaceExpansion = useStore(s => s.workspaceExpansion)\n\n const list = useSessions(s => s)\n const statuses = useSessionStatus(s => s)\n // 0.1.6: the selected Session is the one retained through `mainView`, not a\n // `list.current` field (the list snapshot carries catalog facts only).\n const current = currentSessionId(list)\n // A member folder is backed by its own DSH workspace, whose sidebar row this\n // plugin hides: its sessions belong to the project that SHOWS the folder, so\n // \"current\" must resolve back to that owner for expansion and highlighting.\n const members = useMemo(() => memberWorkspaces(workspaces, foldersDoc), [workspaces, foldersDoc])\n const visibleWorkspaces = useMemo(\n () => workspaces.filter(w => !members.absorbed.has(w.workspaceId as string)),\n [workspaces, members],\n )\n const currentWorkspaceKey = useMemo(() => {\n if (current === undefined) return undefined\n const owner = workspaces.find(w => w.sessionIds.includes(current as SessionId))?.workspaceId as string | undefined\n if (owner === undefined) return undefined\n return members.absorbed.get(owner) ?? owner\n }, [current, workspaces, members])\n\n // Auto-expand the category + workspace containing the current session, but\n // ONLY when the user has never touched that key (`Object.hasOwn`): a\n // present `false` is a deliberate collapse and must stay folded. Without\n // this guard the effect re-expands the just-collapsed current category on\n // every store change (the reported \"cannot collapse\" bug).\n useEffect(() => {\n if (current === undefined || currentWorkspaceKey === undefined) return\n const category = categoriesForCurrent(config, workspaces, current, manual)\n if (category !== undefined && !Object.hasOwn(categoryExpansion, category)) {\n actions.setCategoryExpanded(category, true)\n }\n if (!Object.hasOwn(workspaceExpansion, currentWorkspaceKey)) {\n actions.setWorkspaceExpanded(currentWorkspaceKey, true)\n }\n }, [current, currentWorkspaceKey, config, workspaces, manual, categoryExpansion, workspaceExpansion, actions])\n\n // Drop expansion keys that no longer exist (group edits / workspace deletion).\n useEffect(() => {\n if (workspacePhase !== 'ready') return\n actions.retainKeys(\n displayCategoryKeys(config, manual),\n workspaces.map(w => w.workspaceId as string),\n )\n }, [actions, config, manual, workspacePhase, workspaces])\n\n // Session tabs: the strip lives in the conversation column, but its lifecycle\n // belongs here —the browser already derives the open session for its own tree,\n // so one effect covers every way a session can be opened (sidebar row,\n // workspace New Session, quick panel, conversation-header crumbs).\n //\n // `statuses` is a dependency on purpose: a session earns its tab when it\n // STARTS working, which is a status change, not a catalog change. Without it a\n // conversation that began while already open would never surface a tab.\n useEffect(() => {\n if (current === undefined) return\n openTab(current, statuses.get(current))\n }, [current, list, statuses, openTab])\n\n const [query, setQuery] = useState('')\n const [searchExpanded, setSearchExpanded] = useState(false)\n const normalizedQuery = sanitizeSearchQuery(query).trim()\n const [remoteSearch, setRemoteSearch] = useState({\n query: '', status: 'idle', items: [], hasMore: false,\n })\n const searchInput = useRef(null)\n const searchRoot = useRef(null)\n\n // Search debounce + abort, same posture as the official browser.\n useEffect(() => {\n if (normalizedQuery === '') {\n setRemoteSearch({ query: '', status: 'idle', items: [], hasMore: false })\n return\n }\n const controller = new AbortController()\n setRemoteSearch({ query: normalizedQuery, status: 'loading', items: [], hasMore: false })\n const timer = window.setTimeout(() => {\n searchSessions(normalizedQuery, controller.signal).then((result) => {\n if (controller.signal.aborted) return\n setRemoteSearch({ query: normalizedQuery, status: 'ready', items: result.items, hasMore: result.hasMore })\n }).catch(() => {\n if (controller.signal.aborted) return\n setRemoteSearch({ query: normalizedQuery, status: 'error', items: [], hasMore: false })\n })\n }, SEARCH_DEBOUNCE_MS)\n return () => {\n window.clearTimeout(timer)\n controller.abort()\n }\n }, [normalizedQuery, searchSessions])\n\n // Outside-click dismissal of the search box.\n useEffect(() => {\n if (!wide || !searchExpanded) return\n const onClick = (event: MouseEvent): void => {\n if (!(event.target instanceof Node) || searchRoot.current?.contains(event.target) === true) return\n searchInput.current?.blur()\n if (normalizedQuery !== '') return\n setSearchExpanded(false)\n }\n document.addEventListener('click', onClick)\n return () => { document.removeEventListener('click', onClick) }\n }, [normalizedQuery, wide, searchExpanded])\n\n const expandedCategories = useMemo(\n () => Object.entries(categoryExpansion).filter(([, v]) => v).map(([k]) => k),\n [categoryExpansion],\n )\n const expandedWorkspaces = useMemo(\n () => Object.entries(workspaceExpansion).filter(([, v]) => v).map(([k]) => k),\n [workspaceExpansion],\n )\n // Which level is being dragged: drives the top-level drop target (project\n // drags only) and which level's rows fold.\n const [dragging, setDragging] = useState(null)\n const groups = useMemo(\n () => deriveGroups(list, workspaces, archivedSessionIds, config, {\n expandedCategories,\n expandedWorkspaces,\n collapsedFolders: collapsedFolderKeys,\n }, manual, statuses, foldersDoc),\n [list, workspaces, archivedSessionIds, config, manual, statuses, expandedCategories, expandedWorkspaces, collapsedFolderKeys, foldersDoc],\n )\n // Top-level (ungrouped) workspace rows, rendered after the group folders.\n const topLevel = useMemo(\n () => deriveTopLevel(list, workspaces, archivedSessionIds, config, {\n expandedCategories,\n expandedWorkspaces,\n collapsedFolders: collapsedFolderKeys,\n }, manual, statuses, foldersDoc),\n [list, workspaces, archivedSessionIds, config, manual, statuses, expandedCategories, expandedWorkspaces, collapsedFolderKeys, foldersDoc],\n )\n // The Host's default workspace is not part of the grouping tree: it is pinned\n // to its own bar at the bottom of the sidebar (see deriveDefaultWorkspace and\n // the exclusions in tree.ts), while keeping the full workspace-row behaviour.\n const defaultWorkspace = useMemo(\n () => deriveDefaultWorkspace(list, workspaces, archivedSessionIds, {\n expandedCategories,\n expandedWorkspaces,\n collapsedFolders: collapsedFolderKeys,\n }, statuses, foldersDoc),\n [list, workspaces, archivedSessionIds, statuses, foldersDoc, expandedCategories, expandedWorkspaces, collapsedFolderKeys],\n )\n // Search derivation lives here (not inside SearchBody) so the pinned\n // default-workspace bar can show the very same pruned branch the results use.\n const activeRemoteSearch = useMemo(\n () => (remoteSearch.query === normalizedQuery\n ? remoteSearch\n : { query: normalizedQuery, status: 'loading', items: [], hasMore: false }),\n [remoteSearch, normalizedQuery],\n )\n const searchMatches = useMemo(\n () => (normalizedQuery === ''\n ? undefined\n : deriveSearchMatches(list, workspaces, config, normalizedQuery, archivedSessionIds, activeRemoteSearch, searchResultLimit, foldersDoc)),\n [list, workspaces, config, normalizedQuery, archivedSessionIds, activeRemoteSearch, searchResultLimit, foldersDoc],\n )\n const searchTree = useMemo(\n () => (searchMatches === undefined\n ? undefined\n : deriveSearchGroups(list, workspaces, config, searchMatches.matchedIds, archivedSessionIds, manual, searchMatches.snippetsBySession, statuses, foldersDoc)),\n [list, workspaces, config, searchMatches, archivedSessionIds, manual, statuses, foldersDoc],\n )\n // The \"not classified yet\" bucket leaves the tree and docks above the\n // default-workspace bar, so unsorted projects never take a tree slot.\n const { treeGroups, dockedCategory } = useMemo(() => splitDockedCategory(groups), [groups])\n // Search keeps the dock too, but pruned to the matching rows: a bucket with no\n // match is content, not a permanent anchor, so it simply does not show.\n const searchDockCategory = useMemo(() => {\n if (searchTree === undefined || searchMatches === undefined) return undefined\n const docked = searchTree.categories.find(category => isDockedCategoryKey(category.key))\n if (docked === undefined) return undefined\n const workspaces = docked.workspaces.filter(workspace => workspaceHasMatchedSession(workspace, searchMatches.matchedIds))\n return workspaces.length === 0 ? undefined : { ...docked, workspaces }\n }, [searchTree, searchMatches])\n // The results area must never repeat the docked bucket: drop it from the tree\n // handed to SearchBody (the dock renders it instead).\n const searchTreeForBody = useMemo(\n () => (searchTree === undefined\n ? undefined\n : { ...searchTree, categories: searchTree.categories.filter(category => !isDockedCategoryKey(category.key)) }),\n [searchTree],\n )\n // Quick panel (Ctrl+R): category label per grouped workspace id (the tree\n // derivation already resolved grouping; top-level workspaces stay absent).\n const categoryByWorkspace = useMemo(() => {\n const map = new Map()\n for (const category of groups) {\n for (const workspace of category.workspaces) map.set(workspace.workspaceId as string, category.label)\n }\n return map\n }, [groups])\n // While dragging a project, an empty top-level area must still show a landing\n // line —otherwise a project can never be dragged OUT of a group when every\n // project is currently grouped.\n const topLevelDropActive = dragging === 'workspace' && topLevel.length === 0\n // The top-level area is the move-out landing spot: rows reorder with an\n // insertion line (before/after), and the blank space below the last row\n // appends to the end of the list. No whole-area highlight box.\n const topLevelRef: DropRowRef = { kind: 'topLevel', key: UNCATEGORIZED_KEY }\n\n // Use the elected standard flow, including remote-ssh's local/remote picker.\n const [directoryFlowOpen, setDirectoryFlowOpen] = useState(false)\n const [directoryFlow, setDirectoryFlow] = useState>(null)\n const DirectoryFlow = directoryFlow?.component\n const directoryRequest = useRef<{\n resolve: (path: string | null) => void\n reject: (error: Error) => void\n } | null>(null)\n const finishDirectoryFlow = (path: string | null, error?: string): void => {\n const pending = directoryRequest.current\n directoryRequest.current = null\n setDirectoryFlowOpen(false)\n if (error !== undefined) pending?.reject(new Error(error))\n else pending?.resolve(path)\n }\n useEffect(() => () => {\n directoryRequest.current?.resolve(null)\n directoryRequest.current = null\n }, [])\n const pickWorkspaceDirectory = (): Promise => {\n const flow = getDirectoryFlow()\n if (!flow) return pickDirectory()\n if (directoryRequest.current) return Promise.resolve(null)\n setDirectoryFlow(flow)\n return new Promise((resolve, reject) => {\n directoryRequest.current = { resolve, reject }\n setDirectoryFlowOpen(true)\n })\n }\n const [adding, setAdding] = useState(false)\n const [addError, setAddError] = useState(null)\n const [addErrorOpen, setAddErrorOpen] = useState(false)\n const addCategoryRef = useRef(undefined)\n const currentGrouping = useRef({ manual, groups, manualSaving })\n currentGrouping.current = { manual, groups, manualSaving }\n const addWorkspace = async (categoryKey?: string): Promise => {\n if (adding || manualSaving) return\n addCategoryRef.current = categoryKey\n setAdding(true)\n setAddError(null)\n setAddErrorOpen(false)\n try {\n const path = await pickWorkspaceDirectory()\n if (path === null) return // cancelled\n const workspace = await createWorkspace({ path })\n if (categoryKey !== undefined) {\n // Use the returned ID: the workspace observable may not have caught up yet.\n const latest = currentGrouping.current\n if (latest.manualSaving || !latest.groups.some(group => group.key === categoryKey)) {\n throw new Error('The group changed while adding the workspace. Please retry from the target group.')\n }\n const workspaceId = workspace.workspaceId as string\n const workspaceOrder = Object.fromEntries(Object.entries(latest.manual.workspaceOrder)\n .map(([key, ids]) => [key, ids.filter(id => id !== workspaceId)]))\n workspaceOrder[categoryKey] = [...(workspaceOrder[categoryKey] ?? []), workspaceId]\n const next = { ...latest.manual, assignments: { ...latest.manual.assignments, [workspaceId]: categoryKey }, workspaceOrder }\n setManualSaving(true)\n try {\n await persistManual(next)\n actions.setCategoryExpanded(categoryKey, true)\n } finally {\n setManualSaving(false)\n }\n }\n startSession(workspace.workspaceId)\n } catch (reason) {\n const message = reason instanceof Error ? reason.message : String(reason)\n setAddError(message)\n setAddErrorOpen(true)\n } finally {\n setAdding(false)\n }\n }\n\n // Workspace rename dialog.\n const [renameTarget, setRenameTarget] = useState<{ workspaceId: WorkspaceId; currentTitle: string } | null>(null)\n const [renameDraft, setRenameDraft] = useState('')\n const [renaming, setRenaming] = useState(false)\n const [renameError, setRenameError] = useState(null)\n const renameTrimmed = renameDraft.trim()\n const renameDuplicate = renameTarget !== null && renameTrimmed !== '' && renameTrimmed !== renameTarget.currentTitle\n && workspaces.some(w => w.title === renameTrimmed)\n const renameBlocked = renaming || renameTrimmed === '' || renameTarget === null\n || renameTrimmed === renameTarget.currentTitle || renameDuplicate\n const confirmRename = () => {\n if (renameBlocked || renameTarget === null) return\n setRenaming(true)\n setRenameError(null)\n renameWorkspace(renameTarget.workspaceId, renameTrimmed).then(() => {\n setRenaming(false)\n setRenameTarget(null)\n }).catch((reason: unknown) => {\n setRenaming(false)\n setRenameError(reason instanceof Error ? reason.message : String(reason))\n })\n }\n\n // Workspace delete dialog.\n const [deleteTarget, setDeleteTarget] = useState<{ workspaceId: WorkspaceId; title: string } | null>(null)\n const [deleting, setDeleting] = useState(false)\n const [deleteError, setDeleteError] = useState(null)\n const confirmDelete = () => {\n if (deleting || deleteTarget === null) return\n setDeleting(true)\n setDeleteError(null)\n deleteWorkspace(deleteTarget.workspaceId).then(() => {\n setDeleting(false)\n setDeleteTarget(null)\n }).catch((reason: unknown) => {\n setDeleting(false)\n setDeleteError(reason instanceof Error ? reason.message : String(reason))\n })\n }\n\n // Session rename dialog.\n const [sessionRenameTarget, setSessionRenameTarget] = useState<{ sessionId: SessionId; currentTitle: string } | null>(null)\n const [sessionRenameDraft, setSessionRenameDraft] = useState('')\n const [sessionRenaming, setSessionRenaming] = useState(false)\n const [sessionRenameError, setSessionRenameError] = useState(null)\n const sessionRenameTrimmed = sessionRenameDraft.trim()\n const sessionRenameBlocked = sessionRenaming || sessionRenameTrimmed === '' || sessionRenameTarget === null\n const confirmSessionRename = () => {\n if (sessionRenameBlocked || sessionRenameTarget === null) return\n setSessionRenaming(true)\n setSessionRenameError(null)\n renameSession(sessionRenameTarget.sessionId, sessionRenameTrimmed).then(() => {\n setSessionRenaming(false)\n setSessionRenameTarget(null)\n }).catch((reason: unknown) => {\n setSessionRenaming(false)\n setSessionRenameError(reason instanceof Error ? reason.message : String(reason))\n })\n }\n const onSessionRename = (sessionId: SessionId, currentTitle: string) => {\n setSessionRenameTarget({ sessionId, currentTitle })\n setSessionRenameDraft(currentTitle)\n setSessionRenameError(null)\n }\n\n // The strip is a child of this component (rendered through a DOM portal), so\n // it shares this fiber's props directly: renames call the dialog owner here,\n // and activation goes through the same navigation verb the sidebar rows use.\n const activateTab = (sessionId: SessionId) => { open(sessionId) }\n\n const onSessionArchive = (sessionId: SessionId) => {\n archiveSession(sessionId).catch((reason: unknown) => {\n console.warn('session archive rejected:', reason)\n })\n }\n\n // \"Open in folder\": the host half of the official open-in-app plugin resolves\n // which applications it can launch; the project row then just posts the\n // project directory to that host's launch route. One availability read per\n // mount —a host without the capability (or a refused read) leaves\n // `folderApp` undefined, which drops the menu entry rather than failing.\n const [folderApp, setFolderApp] = useState(undefined)\n const [folderError, setFolderError] = useState<{ id: number; text: string } | null>(null)\n useEffect(() => {\n const controller = new AbortController()\n fetchOpenInApps(controller.signal).then((apps) => {\n if (controller.signal.aborted) return\n setFolderApp(folderAppId(apps))\n }).catch(() => { /* no capability: the row simply offers no folder entry */ })\n return () => { controller.abort() }\n }, [])\n\n const openInFolder = folderApp === undefined\n ? undefined\n : (workspaceId: WorkspaceId): void => {\n const workspace = workspaces.find(w => w.workspaceId === workspaceId)\n if (workspace === undefined) return\n openPathInApp(folderApp, workspace.path).catch((reason: unknown) => {\n const detail = reason instanceof Error ? reason.message : String(reason)\n setFolderError({ id: Date.now(), text: `${t('workspace.openInFolderError')}: ${detail}` })\n })\n }\n\n // ---- Folder overlay editing -------------------------------------------------\n\n const notifyFolder = (text: string): void => {\n setFolderError({ id: Date.now(), text })\n }\n\n const persistFolders = (next: FoldersDocument): void => {\n setFoldersDoc(next)\n saveFolders(next).then((stored) => {\n setFoldersDoc(stored)\n }).catch((reason: unknown) => {\n if (reason instanceof FoldersConflictError) {\n // Another window wrote first: adopt the host's current document so\n // the tree shows what is actually stored, and say the edit did not\n // land instead of leaving a phantom row behind.\n setFoldersDoc(reason.current)\n notifyFolder(t('folder.conflict'))\n return\n }\n const detail = reason instanceof Error ? reason.message : String(reason)\n notifyFolder(`${t('folder.saveError')}: ${detail}`)\n })\n }\n\n /**\n * Save the manual overlay and adopt the host's stored version (revision\n * bumped). On a conflict the host's current overlay is adopted instead, so\n * the tree resyncs to what is actually stored, and the caller still sees a\n * (localized) rejection it can surface in its own error area.\n */\n const persistManual = async (next: ManualGroups): Promise => {\n try {\n const stored = await saveManualOverlay(next)\n setManual(normalizeManual(stored))\n return stored\n } catch (reason) {\n if (reason instanceof ManualConflictError) {\n setManual(normalizeManual(reason.current))\n throw new ManualConflictError(reason.current, t('manual.conflict'))\n }\n throw reason\n }\n }\n\n /** Write one workspace's entry; an entry with nothing attached removes the key. */\n const writeFolderEntry = (workspaceId: WorkspaceId, entry: WorkspaceFolderEntry): void => {\n const next: Record = { ...foldersDoc.workspaces }\n const key = workspaceId as string\n if (isEmptyEntry(entry)) delete next[key]\n else next[key] = entry\n persistFolders({ version: 1, revision: foldersDoc.revision ?? 0, workspaces: next })\n }\n\n const toggleFolder = (workspaceId: WorkspaceId, path: string): void => {\n const key = folderKey(workspaceId, path)\n setCollapsedFolderKeys(keys => (keys.includes(key) ? keys.filter(k => k !== key) : [...keys, key]))\n }\n\n const isRemoteWorkspace = (workspace: WorkspaceView): boolean => (\n foldersRemoteBase !== null && isUnderBase(workspace.path, foldersRemoteBase)\n )\n\n // The dialog browses the cloud folder's own remote root so a picked subdirectory\n // becomes a folder of THIS project instead of a second mirror of the same tree.\n const [foldersOwnerRemote, setFoldersOwnerRemote] = useState(null)\n const foldersOwnerRequest = useRef('')\n\n /** Open the folder dialog and learn the owner's remote root (cloud owners only). */\n const openFoldersFor = (workspaceId: string): void => {\n foldersOwnerRequest.current = workspaceId\n setFoldersTarget(workspaceId as WorkspaceId)\n setFoldersOwnerRemote(null)\n const workspace = workspaces.find(row => (row.workspaceId as string) === workspaceId)\n if (workspace === undefined || !isRemoteWorkspace(workspace) || foldersRemoteBase === null) return\n void remoteFolderWorkspace(workspace.path, foldersRemoteBase).then(\n (record) => {\n if (foldersOwnerRequest.current !== workspaceId) return\n setFoldersOwnerRemote(record === null ? null : record.remotePath)\n },\n () => { if (foldersOwnerRequest.current === workspaceId) setFoldersOwnerRemote(null) },\n )\n }\n\n /** The overlay record for a picked path that the SSH plugin already mirrors. */\n const remoteMember = (target: RemoteFolderWorkspace): FolderMember => ({\n path: target.mirrorPath,\n workspaceId: target.workspaceId,\n kind: 'remote',\n remotePath: target.remotePath,\n profileId: target.profileId,\n ...(target.recordId === '' ? {} : { recordId: target.recordId }),\n })\n\n // SSH connections for the dialog's cloud section: read when the dialog opens,\n // `null` when the remote-ssh plugin is absent (no cloud folders then), and an\n // empty list when it is present but has no connection configured yet.\n const [remoteProfiles, setRemoteProfiles] = useState(null)\n const [remoteProfilesError, setRemoteProfilesError] = useState(null)\n useEffect(() => {\n if (foldersTarget === null) return\n let cancelled = false\n setRemoteProfilesError(null)\n void listRemoteProfiles().then((profiles) => {\n if (!cancelled) setRemoteProfiles(profiles)\n }).catch((reason: unknown) => {\n if (cancelled) return\n setRemoteProfiles(null)\n setRemoteProfilesError(reason instanceof Error ? reason.message : String(reason))\n })\n return () => { cancelled = true }\n }, [foldersTarget])\n\n /**\n * Resolve the member workspace that owns one folder living OUTSIDE this\n * project's own tree. DSH roots every session's file tools at its workspace,\n * so an outside folder is only readable by the agent once it is a workspace of\n * its own. A registered workspace already sitting on that exact path is reused\n * instead of forked; one that owns folders of its own is refused, because\n * nesting a folder tree inside another would hide the inner folders' sessions.\n */\n const memberWorkspaceFor = async (workspaceId: WorkspaceId, path: string): Promise => {\n const existing = workspaces.find(w => samePath(w.path, path) && w.workspaceId !== workspaceId)\n if (existing !== undefined) {\n if (!isEmptyEntry(entryFor(foldersDoc, existing.workspaceId as string))) {\n throw new Error(t('folder.memberNested'))\n }\n return { path, workspaceId: existing.workspaceId as string, kind: 'local' }\n }\n const created = await createWorkspace({ path })\n return { path, workspaceId: created.workspaceId as string, kind: 'local' }\n }\n\n /**\n * Whether an entry already holds a member backed by this workspace, or a\n * remote member naming the same connection + remote directory. Both add\n * flows (pick a local directory, create a cloud folder) run this check —\n * the remote-ssh side now reuses same-directory records, so the member\n * layer must refuse the second row itself.\n */\n const hasMemberClash = (\n entry: WorkspaceFolderEntry | undefined,\n candidate: { workspaceId: string; profileId?: string; remotePath?: string },\n ): boolean => memberByWorkspaceId(entry, candidate.workspaceId) !== undefined\n || (candidate.profileId !== undefined && candidate.remotePath !== undefined\n && findRemoteMember(entry, candidate.profileId, candidate.remotePath) !== undefined)\n\n const addFolderTo = async (workspaceId: WorkspaceId): Promise => {\n if (foldersBusy) return\n const workspace = workspaces.find(w => w.workspaceId === workspaceId)\n if (workspace === undefined) return\n setFoldersBusy(true)\n try {\n if (foldersRemoteBase === null) throw new Error(t('folder.notReady'))\n const path = await pickDirectory()\n if (path === null) return // cancelled\n const entry = entryFor(foldersDoc, workspaceId as string)\n if (effectiveFolders(workspace.path, entry).some(folder => samePath(folder, path))) {\n notifyFolder(t('folder.duplicate'))\n return\n }\n // The picked directory may BE a cloud folder (a registered SSH mirror): it\n // then joins the project as a cloud member, whichever side the project\n // itself lives on. A mirror subdirectory has no workspace of its own, so\n // that one still needs the subpath field instead.\n const target = await remoteFolderWorkspace(path, foldersRemoteBase)\n if (target !== null) {\n if (samePath(target.mirrorPath, path) && target.workspaceId !== ''\n && target.workspaceId !== (workspaceId as string)) {\n if (hasMemberClash(entry, target)) {\n notifyFolder(t('folder.duplicate'))\n return\n }\n writeFolderEntry(workspaceId, addMember(entry, remoteMember(target)))\n return\n }\n notifyFolder(t('folder.remoteNeedsSubpath'))\n return\n }\n // A folder outside this project's own tree becomes a member: its own\n // workspace is what makes it reachable for the agent, and a session started\n // there then runs natively with no cross-workspace cwd. Folders along the\n // tree stay plain — one cheap cwd gesture, grouped under this project.\n if (!isUnderBase(path, workspace.path)) {\n writeFolderEntry(workspaceId, addMember(entry, await memberWorkspaceFor(workspaceId, path)))\n return\n }\n writeFolderEntry(workspaceId, addFolder(entry, path))\n } catch (reason) {\n const detail = reason instanceof Error ? reason.message : String(reason)\n notifyFolder(`${t('folder.addError')}: ${detail}`)\n } finally {\n setFoldersBusy(false)\n }\n }\n\n /**\n * \"New cloud folder\" in the folder dialog: the SSH plugin creates the mirror,\n * registers a real workspace for it and returns both ids, so the folder joins\n * this project as a member and its own sidebar row stays hidden.\n */\n const addRemoteFolderTo = async (\n workspaceId: WorkspaceId, profileId: string, remotePath: string,\n ): Promise => {\n if (foldersBusy) return false\n const owner = workspaces.find(w => w.workspaceId === workspaceId)\n if (owner === undefined) return false\n setFoldersBusy(true)\n try {\n const created = await createRemoteFolder(profileId, remotePath)\n const entry = entryFor(foldersDoc, workspaceId as string)\n // Duplicate defenses. The first two compare identities the SSH plugin\n // returns; they only hold when it reuses the existing record for the\n // same remote directory (its host canonicalizes the path at\n // registration). The member checks below do not depend on that: a\n // folder for the same connection + remote directory, or backed by the\n // same workspace, is a duplicate no matter which mirror it points at.\n if (created.workspaceId === (workspaceId as string)) throw new Error(t('folder.duplicate'))\n if (hasMemberClash(entry, created)) throw new Error(t('folder.duplicate'))\n if (effectiveFolders(owner.path, entry).some(folder => samePath(folder, created.path))) {\n throw new Error(t('folder.duplicate'))\n }\n const member: FolderMember = {\n path: created.path,\n workspaceId: created.workspaceId,\n kind: 'remote',\n remotePath: created.remotePath,\n profileId: created.profileId,\n title: created.title,\n ...(created.recordId === '' ? {} : { recordId: created.recordId }),\n }\n const next: FoldersDocument = {\n version: 1,\n revision: foldersDoc.revision ?? 0,\n workspaces: { ...foldersDoc.workspaces, [workspaceId]: addMember(entry, member) },\n }\n // Like the subpath field: report success only once the overlay is durable.\n setFoldersDoc(await saveFolders(next))\n return true\n } catch (reason) {\n if (reason instanceof FoldersConflictError) setFoldersDoc(reason.current)\n notifyFolder(`${t('folder.addError')}: ${reason instanceof Error ? reason.message : String(reason)}`)\n return false\n } finally {\n setFoldersBusy(false)\n }\n }\n\n /** The same gesture routes through native local or SSH-owned mkdir APIs. */\n const addSubpathTo = async (workspaceId: WorkspaceId, name: string): Promise => {\n if (foldersBusy) return false\n const workspace = workspaces.find(w => w.workspaceId === workspaceId)\n if (workspace === undefined) return false\n setFoldersBusy(true)\n try {\n if (foldersRemoteBase === null) throw new Error(t('folder.notReady'))\n const pending = createdFolderPendingSave.current\n const created = pending !== null && pending.workspaceId === workspaceId && pending.name === name\n ? pending\n : await createWorkspaceDirectory(workspace.path, name, foldersRemoteBase, createDirectory)\n createdFolderPendingSave.current = { workspaceId, name, path: created.path }\n const entry = addFolder(entryFor(foldersDoc, workspaceId as string), created.path)\n const next: FoldersDocument = {\n version: 1,\n revision: foldersDoc.revision ?? 0,\n workspaces: { ...foldersDoc.workspaces, [workspaceId]: entry },\n }\n // Do not report success or clear the input until both operations succeed.\n // A failed overlay save does NOT delete the newly created user directory.\n setFoldersDoc(await saveFolders(next))\n createdFolderPendingSave.current = null\n return true\n } catch (reason) {\n if (reason instanceof FoldersConflictError) setFoldersDoc(reason.current)\n notifyFolder(`${t('folder.addError')}: ${reason instanceof Error ? reason.message : String(reason)}`)\n return false\n } finally {\n setFoldersBusy(false)\n }\n }\n\n const setFolderRoot = (workspaceId: WorkspaceId, path: string): void => {\n writeFolderEntry(workspaceId, setRoot(entryFor(foldersDoc, workspaceId as string), path))\n }\n\n /**\n * Remove one folder from a project. With `deleteRecord` set — only the\n * folder dialog offers it, behind an explicit confirm — a remote member's\n * backing record is deleted through the SSH plugin as well (record, native\n * workspace and mirror go away, sessions included); without it the removal\n * is overlay-only and the workspace survives as its own project. If the\n * record deletion fails, the member stays so the user can retry.\n */\n const removeFolderFrom = (workspaceId: WorkspaceId, path: string, deleteRecord = false): void => {\n const entry = entryFor(foldersDoc, workspaceId as string)\n const member = memberOf(entry, path)\n if (deleteRecord && member?.kind === 'remote' && member.recordId !== undefined && member.recordId !== '') {\n const recordId = member.recordId\n void (async () => {\n try {\n await deleteRemoteWorkspaceRecord(recordId)\n } catch (reason) {\n const detail = reason instanceof Error ? reason.message : String(reason)\n notifyFolder(`${t('folder.removeError')}: ${detail}`)\n return\n }\n writeFolderEntry(workspaceId, removeFolder(entry, path))\n })()\n return\n }\n writeFolderEntry(workspaceId, removeFolder(entry, path))\n }\n\n /**\n * \"New session here\": a member folder has its OWN workspace, so the session is\n * created there with no cwd override at all —that is what makes a cloud\n * folder and a local folder behave identically under one project row. A plain\n * extra folder keeps the cwd gesture. The base folder keeps the platform's own\n * gesture instead, because that one reuses the blank session it already opened;\n * creating a fresh Session on every click would pile up empty sessions. One\n * creation in flight at a time; a rejection surfaces the failure and creates\n * nothing else.\n */\n const startSessionInFolder = (workspaceId: WorkspaceId, path: string, isBase: boolean): void => {\n if (isBase) {\n startSession(workspaceId)\n return\n }\n if (creatingSessionIn !== null) return\n setCreatingSessionIn(folderKey(workspaceId, path))\n void (async () => {\n const workspace = workspaces.find(w => w.workspaceId === workspaceId)\n if (!workspace) throw new Error('Workspace not found')\n const member = memberOf(entryFor(foldersDoc, workspaceId as string), path)\n if (member !== undefined) {\n // The member's own workspace is what runs the session; if the user deleted\n // it outside this overlay, say so instead of failing inside the platform.\n if (!workspaces.some(w => w.workspaceId === member.workspaceId)) {\n throw new Error(t('folder.memberMissing'))\n }\n await createSessionIn(member.workspaceId as WorkspaceId)\n return\n }\n if (foldersRemoteBase === null) throw new Error(t('folder.notReady'))\n // Legacy overlay: a folder recorded before out-of-tree folders became\n // members has no workspace of its own, and a cwd override cannot escape\n // this project's root — so the agent would open the folder and see nothing.\n // Register the member now and run the session inside it.\n if (!isUnderBase(path, workspace.path)) {\n const entry = entryFor(foldersDoc, workspaceId as string)\n const attached = await memberWorkspaceFor(workspaceId, path)\n writeFolderEntry(workspaceId, addMember(entry, attached))\n await createSessionIn(attached.workspaceId as WorkspaceId)\n return\n }\n const remote = await remoteFolderWorkspace(workspace.path, foldersRemoteBase)\n const targetRemote = await remoteFolderWorkspace(path, foldersRemoteBase)\n if (remote || targetRemote) throw new Error(t('folder.remoteSessionUnsupported'))\n await createSessionIn(workspaceId, path)\n })().catch((reason: unknown) => {\n const detail = reason instanceof Error ? reason.message : String(reason)\n notifyFolder(`${t('folder.sessionError')}: ${detail}`)\n }).finally(() => {\n setCreatingSessionIn(null)\n })\n }\n\n /** A project row's plus button —starts in that workspace's root folder. */\n const startSessionAtRoot = (workspaceId?: WorkspaceId): void => {\n const workspace = workspaceId === undefined ? undefined : workspaces.find(w => w.workspaceId === workspaceId)\n if (workspace === undefined) {\n startSession(workspaceId)\n return\n }\n const root = rootOf(workspace.path, entryFor(foldersDoc, workspaceId as string))\n startSessionInFolder(workspaceId as WorkspaceId, root, samePath(root, workspace.path))\n }\n\n // Absent when the host offers no folder application: folder rows then drop\n // their \"open folder\" entry instead of failing at the click.\n const openFolderPath = folderApp === undefined\n ? undefined\n : (path: string): void => {\n openPathInApp(folderApp, path).catch((reason: unknown) => {\n const detail = reason instanceof Error ? reason.message : String(reason)\n notifyFolder(`${t('workspace.openInFolderError')}: ${detail}`)\n })\n }\n\n // ---- Runtime group management ----------------------------------------------\n\n const [groupDialog, setGroupDialog] = useState(null)\n const [groupDraft, setGroupDraft] = useState('')\n const [groupError, setGroupError] = useState(null)\n const [groupBusy, setGroupBusy] = useState(false)\n const [groupDeleteTarget, setGroupDeleteTarget] = useState(null)\n const [groupDeleting, setGroupDeleting] = useState(false)\n const [groupDeleteError, setGroupDeleteError] = useState(null)\n\n // Appearance dialog (color / icon / pin) for one group display key. Every\n // control applies immediately (optimistic merge + save); there is no OK, so\n // `appearanceTarget` also doubles as the open flag.\n const [appearanceTarget, setAppearanceTarget] = useState(null)\n const [appearanceDraft, setAppearanceDraft] = useState({})\n const [appearanceError, setAppearanceError] = useState(null)\n\n const takenNames = useMemo(() => takenCategoryNames(config, manual), [config, manual])\n\n const groupTrimmed = groupDraft.trim()\n const groupNameIssue = groupDialog !== null && groupTrimmed !== ''\n ? (groupTrimmed === UNCATEGORIZED_LABEL\n ? t('group.nameReserved')\n : (groupDialog.mode === 'rename' && groupTrimmed === groupDialog.from)\n ? null\n : takenNames.has(groupTrimmed) ? t('group.nameDuplicate') : null)\n : null\n const groupBlocked = groupBusy || groupTrimmed === '' || groupNameIssue !== null\n || (groupDialog !== null && groupDialog.mode === 'rename' && groupTrimmed === groupDialog.from)\n\n const confirmGroupDialog = () => {\n if (groupBlocked || groupDialog === null) return\n const name = groupTrimmed\n const from = groupDialog.mode === 'rename' ? groupDialog.from : undefined\n const renaming = groupDialog.mode === 'rename' && from !== name\n\n let next: NormalizedManual\n if (groupDialog.mode === 'create') {\n next = { ...manual, categories: [...manual.categories, name] }\n } else {\n // Rename: rule groups ride the `renamed` map, manual groups the list;\n // every reference (assignments / workspaceOrder / categoryOrder) follows.\n const originalRule = from !== undefined ? originalRuleNameForDisplay(config.categories, manual, from) : undefined\n next = {\n ...manual,\n ...(originalRule !== undefined\n ? { renamed: { ...manual.renamed, [originalRule]: name } }\n : { categories: manual.categories.map(c => c === from ? name : c) }),\n assignments: Object.fromEntries(\n Object.entries(manual.assignments).map(([id, category]): [string, string | null] => [id, category === from ? name : category]),\n ),\n workspaceOrder: Object.fromEntries(\n Object.entries(manual.workspaceOrder).map(([key, ids]): [string, string[]] => [key === from ? name : key, ids]),\n ),\n categoryOrder: manual.categoryOrder.map(key => key === from ? name : key),\n // Appearance is keyed by display name too: move the entry instead of\n // leaving the colour/icon/pin behind under the old name.\n appearance: from === undefined || from === name\n ? manual.appearance\n : Object.fromEntries(\n Object.entries(manual.appearance).map(([key, value]): [string, CategoryAppearance] => [key === from ? name : key, value]),\n ),\n }\n }\n\n setGroupBusy(true)\n setGroupError(null)\n persistManual(next).then(() => {\n setManualError(null)\n setGroupBusy(false)\n setGroupDialog(null)\n setGroupDraft('')\n // Keep the renamed group open (its old expansion key is dropped by retainKeys).\n if (renaming) actions.setCategoryExpanded(name, true)\n }).catch((reason: unknown) => {\n setGroupBusy(false)\n setGroupError(reason instanceof Error ? reason.message : String(reason))\n })\n }\n\n const confirmGroupDelete = () => {\n if (groupDeleting || groupDeleteTarget === null) return\n const name = groupDeleteTarget\n const originalRule = originalRuleNameForDisplay(config.categories, manual, name)\n\n // Every project currently in the group goes to the uncategorized bucket (forced, not rule-\n // reclassified), regardless of how it landed there.\n const assignments = { ...manual.assignments }\n for (const workspace of workspaces) {\n if (resolveCategory(config, manual, workspace.workspaceId, workspace.path, workspace.title) === name) {\n assignments[workspace.workspaceId] = null\n }\n }\n const workspaceOrder = Object.fromEntries(\n Object.entries(manual.workspaceOrder).filter(([key]) => key !== name),\n )\n const next: NormalizedManual = {\n ...manual,\n assignments,\n workspaceOrder,\n categoryOrder: manual.categoryOrder.filter(key => key !== name),\n // Drop the presentation entry with the group itself (a dangling key would\n // silently re-attach if a new group ever reused the name).\n appearance: Object.fromEntries(\n Object.entries(manual.appearance).filter(([key]) => key !== name),\n ),\n ...(originalRule !== undefined\n ? {\n renamed: Object.fromEntries(Object.entries(manual.renamed).filter(([key]) => key !== originalRule)),\n hidden: [...manual.hidden, originalRule],\n }\n : { categories: manual.categories.filter(c => c !== name) }),\n }\n\n setGroupDeleting(true)\n setGroupDeleteError(null)\n persistManual(next).then(() => {\n setManualError(null)\n setGroupDeleting(false)\n setGroupDeleteTarget(null)\n }).catch((reason: unknown) => {\n setGroupDeleting(false)\n setGroupDeleteError(reason instanceof Error ? reason.message : String(reason))\n })\n }\n\n // ---- Drag & drop (move/reorder workspaces, reorder groups) ------------------\n\n const [dragIndicator, setDragIndicator] = useState(null)\n\n // Expansion state taken at dragstart; dragend restores it so the folding\n // caused by a drag is always undone afterwards.\n const expansionSnapshot = useRef<{ categories: Record; workspaces: Record } | null>(null)\n // Live expansion state for the dragend restore (the document-level listener\n // is registered once, so it must read current values through a ref).\n const liveExpansionRef = useRef({ categoryExpansion, workspaceExpansion, actions })\n liveExpansionRef.current = { categoryExpansion, workspaceExpansion, actions }\n\n // Cancel any stale indicator when a drag ends outside a row (or is aborted),\n // and restore the expansion snapshot taken at dragstart.\n useEffect(() => {\n const clear = () => {\n setDragIndicator(null)\n setDragging(null)\n const snapshot = expansionSnapshot.current\n if (snapshot === null) return\n expansionSnapshot.current = null\n const { categoryExpansion: currentCategories, workspaceExpansion: currentWorkspaces, actions: currentActions } = liveExpansionRef.current\n for (const [key, value] of Object.entries(snapshot.categories)) {\n if (currentCategories[key] !== value) currentActions.setCategoryExpanded(key, value)\n }\n for (const [key, value] of Object.entries(snapshot.workspaces)) {\n if (currentWorkspaces[key] !== value) currentActions.setWorkspaceExpanded(key, value)\n }\n }\n document.addEventListener('dragend', clear)\n return () => { document.removeEventListener('dragend', clear) }\n }, [])\n\n /** Move a workspace into a category (or reorder inside it when `beforeWorkspaceId`/`afterWorkspaceId`). */\n const moveWorkspaceTo = async (workspaceId: string, categoryKey: string, beforeWorkspaceId?: string, afterWorkspaceId?: string): Promise => {\n if (manualSaving) return\n const workspace = workspaces.find(w => w.workspaceId === workspaceId)\n if (workspace === undefined) return\n setManualSaving(true)\n try {\n let next: NormalizedManual\n if (categoryKey === UNCATEGORIZED_KEY) {\n // Move to the TOP LEVEL: force ungrouped (null) and drop from every\n // group's order list, while recording the position inside the ordered\n // top-level list (`workspaceOrder[TOP_LEVEL_ORDER_KEY]`).\n const assignments = { ...manual.assignments, [workspaceId]: null }\n const workspaceOrder: Record = {}\n for (const [key, ids] of Object.entries(manual.workspaceOrder)) {\n if (key === TOP_LEVEL_ORDER_KEY) continue\n workspaceOrder[key] = ids.filter(id => id !== workspaceId)\n }\n const topLevelIds = workspaces\n .filter(w => w.workspaceId !== workspaceId && resolveCategory(config, manual, w.workspaceId, w.path, w.title) === undefined)\n .map(w => w.workspaceId as string)\n workspaceOrder[TOP_LEVEL_ORDER_KEY] = afterWorkspaceId !== undefined\n ? moveAfter(topLevelIds, workspaceId, afterWorkspaceId)\n : moveBefore(topLevelIds, workspaceId, beforeWorkspaceId)\n next = { ...manual, assignments, workspaceOrder }\n } else {\n const currentKey = resolveCategory(config, manual, workspaceId, workspace.path, workspace.title)\n const movingAcross = currentKey !== categoryKey\n const assignments = movingAcross\n ? { ...manual.assignments, [workspaceId]: categoryKey }\n : manual.assignments\n const targetOrder = afterWorkspaceId !== undefined\n ? moveAfter(manual.workspaceOrder[categoryKey] ?? [], workspaceId, afterWorkspaceId)\n : moveBefore(manual.workspaceOrder[categoryKey] ?? [], workspaceId, beforeWorkspaceId)\n const workspaceOrder = { ...manual.workspaceOrder, [categoryKey]: targetOrder }\n if (movingAcross && currentKey !== undefined && workspaceOrder[currentKey] !== undefined) {\n workspaceOrder[currentKey] = workspaceOrder[currentKey]!.filter(id => id !== workspaceId)\n }\n next = { ...manual, assignments, workspaceOrder }\n }\n await persistManual(next)\n setManualError(null)\n if (categoryKey !== UNCATEGORIZED_KEY) actions.setCategoryExpanded(categoryKey, true)\n } catch (reason) {\n setManualError(reason instanceof Error ? reason.message : String(reason))\n } finally {\n setManualSaving(false)\n }\n }\n\n /** Reorder groups: move `draggedKey` before `beforeKey` or after `afterKey` (no target = append). */\n const moveCategory = async (draggedKey: string, beforeKey?: string, afterKey?: string): Promise => {\n if (manualSaving || draggedKey === beforeKey || draggedKey === afterKey) return\n setManualSaving(true)\n try {\n const order = displayCategoryKeys(config, manual)\n const categoryOrder = afterKey !== undefined\n ? moveAfter(order, draggedKey, afterKey)\n : moveBefore(order, draggedKey, beforeKey)\n // Pinned groups sort before unpinned ones, so a drop across that boundary\n // only sticks when the dragged group adopts the neighbour's pin state in\n // the SAME write. Otherwise the derived order snaps it back and the drop\n // looks broken (spec §7.2).\n const neighbourKey = afterKey ?? beforeKey\n let appearance = manual.appearance\n if (neighbourKey !== undefined && isCategoryPinned(manual, neighbourKey) !== isCategoryPinned(manual, draggedKey)) {\n const cleaned = pruneAppearance({\n ...(manual.appearance[draggedKey] ?? {}),\n pinned: isCategoryPinned(manual, neighbourKey),\n })\n appearance = { ...manual.appearance }\n if (cleaned === undefined) delete appearance[draggedKey]\n else appearance[draggedKey] = cleaned\n }\n const next: NormalizedManual = { ...manual, categoryOrder, appearance }\n await persistManual(next)\n setManualError(null)\n } catch (reason) {\n setManualError(reason instanceof Error ? reason.message : String(reason))\n } finally {\n setManualSaving(false)\n }\n }\n\n /**\n * Merge a presentation patch for one group and persist the overlay.\n * Optimistic: the tree reflects the change immediately and rolls back if the\n * host refuses the write (the dialog has no confirm step).\n */\n const updateCategoryAppearance = async (key: string, patch: CategoryAppearance): Promise => {\n if (manualSaving) return\n setManualSaving(true)\n const previous = manual\n try {\n const merged: CategoryAppearance = { ...(manual.appearance[key] ?? {}), ...patch }\n const appearance = { ...manual.appearance }\n const cleaned = pruneAppearance(merged)\n if (cleaned === undefined) delete appearance[key]\n else appearance[key] = cleaned\n const next: NormalizedManual = { ...manual, appearance }\n setManual(next)\n await persistManual(next)\n setManualError(null)\n } catch (reason) {\n // On a conflict persistManual already adopted the host's current\n // overlay; rolling back to `previous` would resurrect the stale copy.\n if (!(reason instanceof ManualConflictError)) setManual(previous)\n setManualError(reason instanceof Error ? reason.message : String(reason))\n } finally {\n setManualSaving(false)\n }\n }\n\n /** Pin/unpin a group (pinned groups render above the normal order). */\n const toggleCategoryPinned = async (key: string): Promise => {\n await updateCategoryAppearance(key, { pinned: !isCategoryPinned(manual, key) })\n }\n\n /** Appearance currently shown in the dialog (empty while it is closed). */\n const appearanceCurrent: CategoryAppearance = appearanceTarget === null\n ? {}\n : (manual.appearance[appearanceTarget] ?? {})\n\n /**\n * Commit the custom-icon text field. Invalid input is blocked locally (the\n * host would 400 the whole overlay save); an empty field clears the icon.\n */\n const commitAppearanceIcon = (): void => {\n if (appearanceTarget === null) return\n const icon = (appearanceDraft.icon ?? '').trim()\n if (icon !== '' && !ICON_VALUE_PATTERN.test(icon)) {\n setAppearanceError(t('group.iconInvalid'))\n return\n }\n setAppearanceError(null)\n /* Blur fires before a neighbouring click and on every dialog close: skip\n the PUT when the field still matches the stored value. */\n if (icon === (appearanceCurrent.icon ?? '')) return\n void updateCategoryAppearance(appearanceTarget, { icon: icon === '' ? undefined : icon })\n }\n\n /**\n * Drop on a row. The insertion point is re-derived from the drop event's\n * position (top half = before, bottom half = after), so it always matches\n * the indicator the user last saw —even when dragover and drop arrive in\n * the same tick.\n */\n const onDropRow = (categoryKey: string, row: DropRowRef) => (event: DragEvent): void => {\n event.preventDefault()\n // Keep the drop from bubbling to the enclosing top-level area (which is\n // also a move-out target): a row drop and the area-drop below it must not\n // both fire moveWorkspaceTo.\n event.stopPropagation()\n setDragIndicator(null)\n setDragging(null)\n const draggedCategory = event.dataTransfer.getData(DND_CATEGORY_TYPE)\n if (draggedCategory !== '') {\n // Group reorder: only category rows are targets (project rows fold\n // during group drags); before/after follows the drop position.\n const rect = (event.currentTarget as HTMLElement).getBoundingClientRect()\n const before = event.clientY < rect.top + rect.height / 2\n const beforeKey = row.kind === 'category' && before ? row.key : undefined\n const afterKey = row.kind === 'category' && !before ? row.key : undefined\n void moveCategory(draggedCategory, beforeKey, afterKey)\n return\n }\n const workspaceId = event.dataTransfer.getData(DND_WORKSPACE_TYPE) || event.dataTransfer.getData('text/plain')\n if (workspaceId === '') return\n if (row.kind === 'topLevel') {\n // Top-level row / top-level blank drop = move OUT of any group (forced\n // top-level, rules ignored) and set the position inside the ordered\n // top-level list. A row drop re-derives before/after from the drop\n // position; a bare area drop (key = UNCATEGORIZED_KEY) appends to the end.\n const rect = (event.currentTarget as HTMLElement).getBoundingClientRect()\n const before = event.clientY < rect.top + rect.height / 2\n const specificKey = row.key === UNCATEGORIZED_KEY ? undefined : row.key\n void moveWorkspaceTo(workspaceId, UNCATEGORIZED_KEY, before ? specificKey : undefined, !before ? specificKey : undefined)\n return\n }\n // Project move/reorder: a line on a project row = reorder before/after it;\n // dropping anywhere else in a category = move into the group (its end).\n const rect = (event.currentTarget as HTMLElement).getBoundingClientRect()\n const before = event.clientY < rect.top + rect.height / 2\n const beforeWsid = row.kind === 'workspace' && before ? row.key : undefined\n const afterWsid = row.kind === 'workspace' && !before ? row.key : undefined\n void moveWorkspaceTo(workspaceId, categoryKey, beforeWsid, afterWsid)\n }\n\n const onDragOverRow = (row: DropRowRef) => (event: DragEvent): void => {\n if (!hasPluginDragType(event.dataTransfer.types)) return\n const draggingCategory = Array.from(event.dataTransfer.types as Iterable).includes(DND_CATEGORY_TYPE)\n if (draggingCategory && row.kind !== 'category') return // group drags target category rows only\n event.preventDefault()\n // Keep a row's dragover from bubbling to the enclosing top-level area\n // (which would interpret it as the end-of-list landing).\n event.stopPropagation()\n event.dataTransfer.dropEffect = 'move'\n const rect = (event.currentTarget as HTMLElement).getBoundingClientRect()\n const before = event.clientY < rect.top + rect.height / 2\n if (draggingCategory || row.kind === 'workspace' || row.kind === 'topLevel') {\n // Group reorder (line on a category row), project reorder inside a\n // group (line on a project row), or top-level reorder (line on a\n // top-level project row).\n setDragIndicator(prev =>\n prev?.mode === 'line' && prev.row.kind === row.kind && prev.row.key === row.key && prev.before === before\n ? prev\n : { mode: 'line', row, before })\n } else {\n // Dropping a project INTO a group: whole-row highlight.\n setDragIndicator(prev =>\n prev?.mode === 'into' && prev.categoryKey === row.key ? prev : { mode: 'into', categoryKey: row.key })\n }\n }\n\n const onDragLeaveRow = (event: DragEvent): void => {\n if (event.currentTarget.contains(event.relatedTarget as Node | null)) return\n setDragIndicator(null)\n }\n\n /**\n * Drag over the TOP-LEVEL AREA's blank space (not on a row ???rows stop\n * propagation). An insertion line shows the landing spot: empty top level — * a standalone line under the last group; non-empty —a line below the last\n * top-level row (end of the list).\n */\n const onDragOverTopLevelArea = (event: DragEvent): void => {\n if (!hasPluginDragType(event.dataTransfer.types)) return\n const draggingCategory = Array.from(event.dataTransfer.types as Iterable).includes(DND_CATEGORY_TYPE)\n if (draggingCategory) return // group drags never target the top-level area\n event.preventDefault()\n event.dataTransfer.dropEffect = 'move'\n const last = topLevel.length > 0 ? topLevel[topLevel.length - 1] : undefined\n if (last !== undefined) {\n setDragIndicator(prev =>\n prev?.mode === 'line' && prev.row.kind === 'topLevel' && prev.row.key === last.workspaceId && prev.before === false\n ? prev\n : { mode: 'line', row: { kind: 'topLevel', key: last.workspaceId }, before: false })\n } else {\n setDragIndicator(prev =>\n prev?.mode === 'line' && prev.row.kind === 'topLevel' && prev.row.key === topLevelRef.key && prev.before === false\n ? prev\n : { mode: 'line', row: topLevelRef, before: false })\n }\n }\n\n // While dragging a project, only PROJECT rows fold —every expanded\n // workspace collapses (inside groups AND top-level); group rows keep their\n // expansion so the user still sees where groups are. dragend restores the\n // snapshot taken here.\n const onDragStartWorkspace = (_workspaceId: string) => (): void => {\n setDragging('workspace')\n expansionSnapshot.current = {\n categories: { ...categoryExpansion },\n workspaces: { ...workspaceExpansion },\n }\n for (const key of Object.keys(workspaceExpansion)) {\n if (workspaceExpansion[key]) actions.setWorkspaceExpanded(key, false)\n }\n }\n\n // While dragging a group, only GROUP rows fold (their rows stay visible as\n // reorder targets); project rows keep their expansion. dragend restores the\n // snapshot taken here.\n const onDragStartCategory = (categoryKey: string) => (event: DragEvent): void => {\n event.dataTransfer.setData(DND_CATEGORY_TYPE, categoryKey)\n event.dataTransfer.effectAllowed = 'move'\n setDragging('category')\n expansionSnapshot.current = {\n categories: { ...categoryExpansion },\n workspaces: { ...workspaceExpansion },\n }\n for (const key of Object.keys(categoryExpansion)) {\n if (categoryExpansion[key]) actions.setCategoryExpanded(key, false)\n }\n }\n\n // Appearance picker cell: the same glyph button for every icon section\n // (common presets, the four research sections, and the emoji row).\n const renderIconCell = (id: string, label: string): ReactElement => (\n {\n setAppearanceDraft({ ...appearanceDraft, icon: id })\n setAppearanceError(null)\n if (appearanceTarget !== null) void updateCategoryAppearance(appearanceTarget, { icon: id })\n }}\n >\n \n \n )\n\n const now = Date.now()\n\n // Bottom-bar content. Idle: the default workspace with its real subtree.\n // Searching: the pruned branch (matched sessions only), or the bare row when\n // nothing matched —the results area never repeats this workspace.\n const defaultBarNode = defaultWorkspace === undefined\n ? undefined\n : normalizedQuery === ''\n ? defaultWorkspace\n : (searchTree?.defaultWorkspace ?? withoutSessions(defaultWorkspace))\n\n // Idle: the bucketed category as the tree derived it. Searching: the pruned\n // bucket (matched rows only), absent when nothing matched.\n const dockCategory = normalizedQuery === '' ? dockedCategory : searchDockCategory\n\n /**\n * One category section with every tree callback bound. Extracted so the docked\n * bucket is literally the same row/children component as a tree category — * drag, menu, rename, appearance, folder management all behave identically.\n */\n const categorySectionNode = (category: CategoryNode): JSX.Element => (\n { actions.setCategoryExpanded(category.key, !category.expanded) }}\n onToggleWorkspace={(key) => { actions.setWorkspaceExpanded(key, !workspaceExpansion[key]) }}\n onNewSession={startSessionAtRoot}\n onOpen={open}\n onToggleFolder={toggleFolder}\n onFolderNewSession={startSessionInFolder}\n onFolderSetRoot={setFolderRoot}\n onFolderRemove={removeFolderFrom}\n onOpenFolderPath={openFolderPath}\n onManageFolders={openFoldersFor}\n creatingFolderKey={creatingSessionIn}\n onRenameRequest={(workspaceId, title) => {\n setRenameTarget({ workspaceId, currentTitle: title })\n setRenameDraft(title)\n setRenameError(null)\n }}\n onDeleteRequest={(workspaceId, title) => {\n setDeleteTarget({ workspaceId, title })\n setDeleteError(null)\n }}\n onSessionRename={onSessionRename}\n onSessionArchive={onSessionArchive}\n onFork={forkSession}\n onAddWorkspace={() => { void addWorkspace(category.key) }}\n addingWorkspace={adding || manualSaving}\n onGroupRename={() => {\n setGroupDraft(category.key)\n setGroupError(null)\n setGroupDialog({ mode: 'rename', from: category.key })\n }}\n onGroupDelete={() => {\n setGroupDeleteTarget(category.key)\n setGroupDeleteError(null)\n }}\n onGroupTogglePin={() => { void toggleCategoryPinned(category.key) }}\n onGroupAppearance={() => {\n setAppearanceDraft(manual.appearance[category.key] ?? {})\n setAppearanceError(null)\n setAppearanceTarget(category.key)\n }}\n animate={dragging === null}\n onMoveOut={(workspaceId) => { void moveWorkspaceTo(workspaceId, UNCATEGORIZED_KEY) }}\n onOpenInFolder={openInFolder}\n canMoveOut={(workspaceId) => {\n // The menu \"Move out of group\" is offered for any project that\n // currently sits inside a group (rule-classified or manual) — // not just overridden ones. Top-level projects\n // (resolveCategory === undefined) don't need it.\n const workspace = workspaces.find(w => w.workspaceId === workspaceId)\n return workspace !== undefined\n && resolveCategory(config, manual, workspace.workspaceId, workspace.path, workspace.title) !== undefined\n }}\n />\n )\n\n return (\n
\n {/* The tab strip portals itself into the conversation column's head seat,\n so its position here is irrelevant to where it appears; rendering it\n from this component is what keeps it on this fiber (and therefore on\n this store's single scope) while still reaching the other column. */}\n \n
\n {wide && {t('section.workspaces')}}\n {wide && (\n
\n { setSearchExpanded(true) }}\n >\n \n \n {searchExpanded && (\n { setQuery(sanitizeSearchQuery(e.target.value)) }}\n onKeyDown={(e) => {\n if (e.key !== 'Escape') return\n setQuery('')\n setSearchExpanded(false)\n }}\n />\n )}\n {searchExpanded && (\n {\n e.stopPropagation()\n setQuery('')\n setSearchExpanded(false)\n }}\n >\n \n \n )}\n
\n )}\n \n {\n setGroupDraft('')\n setGroupError(null)\n setGroupDialog({ mode: 'create' })\n }}\n >\n \n \n \n \n { void addWorkspace() }}\n >\n \n \n \n
\n\n {!wide && (\n
\n \n { setSearchExpanded(true); expandSidebar() }}\n >\n \n \n \n
\n )}\n\n
\n {configError !== null && (\n
{t('configUnavailable')}
\n )}\n {manualError !== null && (\n
{t('manual.saveError')}: {manualError}
\n )}\n {wide && normalizedQuery !== '' && searchTreeForBody !== undefined && searchMatches !== undefined ? (\n \n ) : (\n /* The branch overlay lives beside the tree, not inside it: it measures\n the rows and paints behind them, so it must share their box without\n becoming a row itself (which would break role=\"tree\" semantics and\n the index-based measurement). */\n
\n
\n {/* The docked bucket and the pinned default workspace sit outside the\n tree's scroll area, so a tree holding nothing but them is not \"empty\". */}\n {treeGroups.length === 0 && topLevel.length === 0 && !topLevelDropActive && defaultBarNode === undefined && dockCategory === undefined && (\n
{workspacePhase === 'ready' ? t('empty.noWorkspaces') : t('empty.none')}
\n )}\n {treeGroups.map(categorySectionNode)}\n {/* Top-level (ungrouped) workspaces, rendered after the group\n folders. While dragging a project the whole area is the\n move-out landing spot (a line shows the insert position;\n an empty top level shows a line under the last group). */}\n {(topLevel.length > 0 || topLevelDropActive) && (\n { actions.setWorkspaceExpanded(key, !workspaceExpansion[key]) }}\n onNewSession={startSessionAtRoot}\n onOpen={open}\n onToggleFolder={toggleFolder}\n onFolderNewSession={startSessionInFolder}\n onFolderSetRoot={setFolderRoot}\n onFolderRemove={removeFolderFrom}\n onOpenFolderPath={openFolderPath}\n onManageFolders={openFoldersFor}\n creatingFolderKey={creatingSessionIn}\n onRenameRequest={(workspaceId, title) => {\n setRenameTarget({ workspaceId, currentTitle: title })\n setRenameDraft(title)\n setRenameError(null)\n }}\n onDeleteRequest={(workspaceId, title) => {\n setDeleteTarget({ workspaceId, title })\n setDeleteError(null)\n }}\n onSessionRename={onSessionRename}\n onSessionArchive={onSessionArchive}\n onFork={forkSession}\n onOpenInFolder={openInFolder}\n />\n )}\n
\n
\n )}\n
\n\n {/* Bottom dock: siblings of the tree's scroll area (not rows inside it), so\n a long session list can never push them away or scroll them out.\n - the \"not classified yet\" bucket keeps its own category row and\n children (same component, same drag/menu behaviour), capped in height\n with its own scroll so a big bucket cannot swallow the tree;\n - the Host default workspace keeps the whole workspace-row behaviour\n (toggle, new session, rename, delete, —menu, folder management) and\n its sessions still highlight as usual. */}\n {wide && (dockCategory !== undefined || defaultBarNode !== undefined) && (\n
\n {dockCategory !== undefined && (\n
\n {categorySectionNode(dockCategory)}\n
\n )}\n {defaultBarNode !== undefined && (\n
\n { actions.setWorkspaceExpanded(defaultBarNode.workspaceId as string, !workspaceExpansion[defaultBarNode.workspaceId]) }}\n onNewSession={() => { startSessionAtRoot(defaultBarNode.workspaceId) }}\n onRename={() => {\n setRenameTarget({ workspaceId: defaultBarNode.workspaceId, currentTitle: defaultBarNode.label })\n setRenameDraft(defaultBarNode.label)\n setRenameError(null)\n }}\n onDelete={() => {\n setDeleteTarget({ workspaceId: defaultBarNode.workspaceId, title: defaultBarNode.label })\n setDeleteError(null)\n }}\n {...(openInFolder !== undefined\n ? { onOpenInFolder: () => { openInFolder(defaultBarNode.workspaceId) } }\n : {})}\n onManageFolders={() => { openFoldersFor(defaultBarNode.workspaceId as string) }}\n />\n
\n \n
\n
\n )}\n
\n )}\n\n {/* Group create / rename dialog */}\n { setGroupDialog(null) }}\n closeLabel={t('close')}\n title={groupDialog?.mode === 'rename' ? t('group.renameTitle') : t('group.createTitle')}\n footer={(\n <>\n \n \n \n )}\n >\n { setGroupDraft(e.target.value); setGroupError(null) }}\n onKeyDown={(e) => { if (e.key === 'Enter') confirmGroupDialog() }}\n />\n {groupNameIssue !== null &&
{groupNameIssue}
}\n {groupError !== null &&
{groupError}
}\n \n\n {/* Group delete dialog */}\n { setGroupDeleteTarget(null) }}\n closeLabel={t('close')}\n title={t('group.deleteTitle')}\n footer={(\n <>\n \n \n \n )}\n >\n
{t('group.deleteConfirm')}
\n {groupDeleteError !== null &&
{groupDeleteError}
}\n \n\n {/* Group appearance dialog: every control writes immediately (optimistic\n patch + rollback banner), so the footer is only \"done\". The body is a\n single scroll column (the dialog caps itself at the viewport and keeps\n the footer outside the scroller), and the sections are spaced so a\n focused field's ring never touches the next control. */}\n { setAppearanceTarget(null) }}\n closeLabel={t('group.appearanceDone')}\n title={t('group.appearanceTitle')}\n className=\"wgAppearanceDialog\"\n contentClassName=\"wgAppearanceContent\"\n footer={(\n \n )}\n >\n {appearanceTarget !== null && (\n
\n
\n
{t('group.color')}
\n
\n { void updateCategoryAppearance(appearanceTarget, { color: undefined }) }}\n />\n {GROUP_COLORS.map((color) => {\n const active = appearanceCurrent.color === color\n return (\n { void updateCategoryAppearance(appearanceTarget, { color }) }}\n />\n )\n })}\n
\n
\n
\n
{t('group.icon')}
\n {/* Categorised picker: the pre-existing presets stay together as\n the common section, the research family is split into its four\n families, the emoji stay in their own row. The sections share\n one height-capped scroller so the footer button is never\n pushed out of the dialog. */}\n
\n
\n
{t('group.icon.section.common')}
\n
\n {COMMON_ICON_IDS.map(id => renderIconCell(id, GROUP_ICON_LABELS[id]))}\n
\n
\n {SCIENCE_ICON_SECTIONS.map(section => {\n const label = t(SCIENCE_SECTION_LABEL_KEYS[section.key])\n return (\n
\n
{label}
\n
\n {section.ids.map(id => renderIconCell(id, GROUP_ICON_LABELS[id]))}\n
\n
\n )\n })}\n
\n
{t('group.icon.section.emoji')}
\n
\n {GROUP_EMOJI_ICONS.map(({ icon, label }) => renderIconCell(icon, label))}\n
\n
\n
\n
\n {\n setAppearanceDraft({ ...appearanceDraft, icon: '' })\n setAppearanceError(null)\n void updateCategoryAppearance(appearanceTarget, { icon: undefined })\n }}\n >\n {t('group.iconDefault')}\n \n {\n setAppearanceDraft({ ...appearanceDraft, icon: e.target.value })\n setAppearanceError(null)\n }}\n onKeyDown={(e) => { if (e.key === 'Enter') commitAppearanceIcon() }}\n onBlur={(event) => {\n /* A swatch / preset click moves focus out of the field in the\n same gesture and writes its own patch —committing the stale\n draft here would race it and could overwrite the preset. */\n const next = event.relatedTarget\n if (next instanceof Element && next.closest('.wgSwatch, .wgIconCell') !== null) return\n commitAppearanceIcon()\n }}\n />\n
\n
\n
\n { void updateCategoryAppearance(appearanceTarget, { pinned: appearanceCurrent.pinned !== true }) }}\n >\n {appearanceCurrent.pinned === true ? t('group.unpin') : t('group.pin')}\n \n
\n {appearanceError !== null &&
{appearanceError}
}\n
\n )}\n \n\n {/* Per-workspace folders dialog: base + extra folders, root radio,\n open/remove per row. Mounted only while a project row asked for it. */}\n {foldersTarget !== null && (() => {\n const workspace = workspaces.find(w => w.workspaceId === foldersTarget)\n if (workspace === undefined) return null\n return (\n w.workspaceId as string)}\n onAddFolder={() => { void addFolderTo(foldersTarget) }}\n onAddRemote={(profileId, remotePath) => addRemoteFolderTo(foldersTarget, profileId, remotePath)}\n onAddSubpath={(relative) => addSubpathTo(foldersTarget, relative)}\n onSetRoot={(path) => { setFolderRoot(foldersTarget, path) }}\n onRemove={(path, deleteRecord) => { removeFolderFrom(foldersTarget, path, deleteRecord) }}\n onOpenFolder={(path) => { openFolderPath?.(path) }}\n onClose={() => { foldersOwnerRequest.current = ''; setFoldersTarget(null) }}\n />\n )\n })()}\n\n {/* Workspace rename dialog */}\n { setRenameTarget(null) }}\n closeLabel={t('close')}\n title={t('workspace.renameTitle')}\n footer={(\n <>\n \n \n \n )}\n >\n { setRenameDraft(e.target.value) }}\n onKeyDown={(e) => { if (e.key === \"Enter\") confirmRename() }}\n />\n {renameError !== null &&
{renameError}
}\n \n\n {/* Workspace delete dialog */}\n { setDeleteTarget(null) }}\n closeLabel={t('close')}\n title={t('workspace.deleteTitle')}\n footer={(\n <>\n \n \n \n )}\n >\n
{t('workspace.deleteConfirm')}
\n {deleteError !== null &&
{deleteError}
}\n \n\n {/* Session rename dialog */}\n { setSessionRenameTarget(null) }}\n closeLabel={t('close')}\n title={t('session.renameTitle')}\n footer={(\n <>\n \n \n \n )}\n >\n { setSessionRenameDraft(e.target.value) }}\n onKeyDown={(e) => { if (e.key === \"Enter\") confirmSessionRename() }}\n />\n {sessionRenameError !== null &&
{sessionRenameError}
}\n \n\n {/* Add workspace error dialog */}\n {directoryFlowOpen && DirectoryFlow && (\n { finishDirectoryFlow(path) }}\n onCancel={() => { finishDirectoryFlow(null) }}\n onError={message => { finishDirectoryFlow(null, message) }}\n />\n )}\n\n { setAddErrorOpen(false) }}\n closeLabel={t('close')}\n title={t('workspace.addErrorTitle')}\n footer={(\n <>\n \n \n \n )}\n >\n
{addError}
\n \n\n {/* \"Open in folder\" failure: transient banner, keyed per attempt so a\n repeat failure restarts the cycle. */}\n {folderError !== null && (\n }\n onDone={() => { setFolderError(null) }}\n />\n )}\n\n {/* Ctrl+R quick switch panel (conditionally mounted: fresh query per open). */}\n {quickOpen && (\n { setQuickOpen(false) }}\n list={list}\n workspaces={visibleWorkspaces}\n archivedSessionIds={archivedSessionIds}\n categoryByWorkspace={categoryByWorkspace}\n current={current}\n startSession={startSession}\n openSession={open}\n now={now}\n t={t}\n />\n )}\n
\n )\n}\n\n/** Resolve the category label containing the current session (auto-expand helper). */\nfunction categoriesForCurrent(\n config: GroupsConfig,\n workspaces: readonly WorkspaceView[],\n current: SessionId,\n manual: ManualGroups,\n): string | undefined {\n const workspace = workspaces.find(w => w.sessionIds.includes(current))\n if (workspace === undefined) return undefined\n return resolveCategory(config, manual, workspace.workspaceId, workspace.path, workspace.title)\n}\n\n/**\n * The expanded session rows of one project. Workspaces with extra folders get\n * one folder row per folder (root first) and hang their sessions off that\n * folder; a workspace without extra folders renders today's flat list, so the\n * common case is unchanged row-for-row.\n */\nfunction WorkspaceSubtree({ workspace, current, now, t, animate, onOpen, onSessionRename, onSessionArchive, onFork, onToggleFolder, onFolderNewSession, onFolderSetRoot, onFolderRemove, onOpenFolderPath, creatingFolderKey }: {\n workspace: WorkspaceGroupNode\n current: SessionId | undefined\n now: number\n t: GroupsBrowserProps['t']\n animate: boolean\n onOpen: (sessionId: SessionId) => void\n onSessionRename: (sessionId: SessionId, currentTitle: string) => void\n onSessionArchive: (sessionId: SessionId) => void\n onFork: (sessionId: SessionId) => void\n onToggleFolder: (workspaceId: WorkspaceId, path: string) => void\n onFolderNewSession: (workspaceId: WorkspaceId, path: string, isBase: boolean) => void\n onFolderSetRoot: (workspaceId: WorkspaceId, path: string) => void\n onFolderRemove: (workspaceId: WorkspaceId, path: string) => void\n onOpenFolderPath?: ((path: string) => void) | undefined\n creatingFolderKey: string | null\n}) {\n const folders = workspace.folders\n if (folders === undefined) {\n return (\n \n {workspace.sessions.map((session) => (\n \n ))}\n \n )\n }\n return (\n \n {folders.map((folder) => {\n const key = folderKey(workspace.workspaceId, folder.path)\n return (\n
\n { onToggleFolder(workspace.workspaceId, folder.path) }}\n onNewSession={() => { onFolderNewSession(workspace.workspaceId, folder.path, folder.isBase) }}\n onSetRoot={() => { onFolderSetRoot(workspace.workspaceId, folder.path) }}\n onRemove={() => { onFolderRemove(workspace.workspaceId, folder.path) }}\n {...(onOpenFolderPath !== undefined\n ? { onOpenInFolder: () => { onOpenFolderPath(folder.path) } }\n : {})}\n />\n \n {folder.sessions.map((session) => (\n \n ))}\n \n
\n )\n })}\n \n )\n}\n\n/** One category section: header row + expanded workspace folders. */\nfunction CategorySection({ category, current, now, t, dragIndicator, onDragOverRow, onDragLeaveRow, onDropRow, onDragStartCategory, onDragStartWorkspace, onToggleCategory, onToggleWorkspace, onNewSession, onOpen, onRenameRequest, onDeleteRequest, onSessionRename, onSessionArchive, onFork, onAddWorkspace, addingWorkspace, onGroupRename, onGroupDelete, onGroupTogglePin, onGroupAppearance, animate, onMoveOut, canMoveOut, onOpenInFolder, onToggleFolder, onFolderNewSession, onFolderSetRoot, onFolderRemove, onOpenFolderPath, onManageFolders, creatingFolderKey }: {\n category: CategoryNode\n current: SessionId | undefined\n now: number\n t: GroupsBrowserProps['t']\n dragIndicator: DragIndicator\n /** Whether the disclosure animation may play (false while a drag folds rows). */\n animate: boolean\n onDragOverRow: (row: DropRowRef) => (event: DragEvent) => void\n onDragLeaveRow: (event: DragEvent) => void\n /** Drop factory: bind the target category and the row kind (before/after re-derived at drop time). */\n onDropRow: (categoryKey: string, row: DropRowRef) => (event: DragEvent) => void\n onDragStartCategory: (event: DragEvent) => void\n onDragStartWorkspace: (workspaceId: WorkspaceId) => () => void\n onToggleCategory: () => void\n onToggleWorkspace: (key: string) => void\n onNewSession: (workspaceId?: WorkspaceId) => void\n onOpen: (sessionId: SessionId) => void\n onRenameRequest: (workspaceId: WorkspaceId, currentTitle: string) => void\n onDeleteRequest: (workspaceId: WorkspaceId, title: string) => void\n onSessionRename: (sessionId: SessionId, currentTitle: string) => void\n onSessionArchive: (sessionId: SessionId) => void\n onFork: (sessionId: SessionId) => void\n onAddWorkspace: () => void\n addingWorkspace: boolean\n onGroupRename: () => void\n onGroupDelete: () => void\n /** Pin/unpin this group from its row menu. */\n onGroupTogglePin: () => void\n /** Open the appearance dialog for this group. */\n onGroupAppearance: () => void\n onMoveOut: (workspaceId: WorkspaceId) => void\n canMoveOut: (workspaceId: WorkspaceId) => boolean\n onToggleFolder: (workspaceId: WorkspaceId, path: string) => void\n onFolderNewSession: (workspaceId: WorkspaceId, path: string, isBase: boolean) => void\n onFolderSetRoot: (workspaceId: WorkspaceId, path: string) => void\n onFolderRemove: (workspaceId: WorkspaceId, path: string) => void\n onManageFolders: (workspaceId: WorkspaceId) => void\n /** Creation in flight, keyed by `folderKey`; disables the row's controls */\n creatingFolderKey: string | null\n /** Absent when the host resolved no folder application. */\n onOpenInFolder?: ((workspaceId: WorkspaceId) => void) | undefined\n /** Absent when the host resolved no folder application. */\n onOpenFolderPath?: ((path: string) => void) | undefined\n}) {\n const categoryLine = dragIndicator?.mode === 'line' && dragIndicator.row.kind === 'category' && dragIndicator.row.key === category.key\n ? (dragIndicator.before ? 'before' : 'after')\n : undefined\n const categoryInto = dragIndicator?.mode === 'into' && dragIndicator.categoryKey === category.key\n return (\n
\n \n \n {category.workspaces.map((workspace) => (\n
\n { onToggleWorkspace(workspace.workspaceId as string) }}\n onNewSession={() => { onNewSession(workspace.workspaceId) }}\n onRename={() => { onRenameRequest(workspace.workspaceId, workspace.label) }}\n onDelete={() => { onDeleteRequest(workspace.workspaceId, workspace.label) }}\n canMoveOut={canMoveOut(workspace.workspaceId)}\n onMoveOut={() => { onMoveOut(workspace.workspaceId) }}\n {...(onOpenInFolder !== undefined\n ? { onOpenInFolder: () => { onOpenInFolder(workspace.workspaceId) } }\n : {})}\n dropActive={false}\n {...(dragIndicator?.mode === 'line' && dragIndicator.row.kind === 'workspace' && dragIndicator.row.key === workspace.workspaceId\n ? { insertLine: dragIndicator.before ? 'before' : 'after' }\n : {})}\n onRowDragOver={onDragOverRow({ kind: 'workspace', key: workspace.workspaceId })}\n onRowDragLeave={onDragLeaveRow}\n onRowDrop={onDropRow(category.key, { kind: 'workspace', key: workspace.workspaceId })}\n onDragStartExtra={onDragStartWorkspace(workspace.workspaceId)}\n onManageFolders={() => { onManageFolders(workspace.workspaceId) }}\n />\n \n
\n ))}\n \n
\n )\n}\n\n/**\n * Top-level (ungrouped) workspace rows rendered after the group folders. While\n * a project drag is in progress the WHOLE top-level area is the move-out\n * landing spot, shown with an insertion LINE (not a highlight box):\n * - a top-level row reorders before/after it (line above/below, like a group);\n * - the blank space below the last row appends to the end (line below the\n * last row);\n * - an empty top level shows a standalone line under the last group folder.\n */\nfunction TopLevelSection({ topLevel, current, now, t, dragging, dragIndicator, topLevelRef, onDragOverRow, onDragOverTopLevelArea, onDragLeaveRow, onDropRow, onDragStartWorkspace, onToggleWorkspace, onNewSession, onOpen, onRenameRequest, onDeleteRequest, onSessionRename, onSessionArchive, onFork, onOpenInFolder, onToggleFolder, onFolderNewSession, onFolderSetRoot, onFolderRemove, onOpenFolderPath, onManageFolders, creatingFolderKey }: {\n topLevel: readonly WorkspaceGroupNode[]\n current: SessionId | undefined\n now: number\n t: GroupsBrowserProps['t']\n /** A project drag is in progress (drives the empty-top-level landing line). */\n dragging: boolean\n dragIndicator: DragIndicator\n topLevelRef: DropRowRef\n onDragOverRow: (row: DropRowRef) => (event: DragEvent) => void\n onDragOverTopLevelArea: (event: DragEvent) => void\n onDragLeaveRow: (event: DragEvent) => void\n onDropRow: (categoryKey: string, row: DropRowRef) => (event: DragEvent) => void\n onDragStartWorkspace: (workspaceId: WorkspaceId) => () => void\n onToggleWorkspace: (key: string) => void\n onNewSession: (workspaceId?: WorkspaceId) => void\n onOpen: (sessionId: SessionId) => void\n onRenameRequest: (workspaceId: WorkspaceId, currentTitle: string) => void\n onDeleteRequest: (workspaceId: WorkspaceId, title: string) => void\n onSessionRename: (sessionId: SessionId, currentTitle: string) => void\n onSessionArchive: (sessionId: SessionId) => void\n onFork: (sessionId: SessionId) => void\n onToggleFolder: (workspaceId: WorkspaceId, path: string) => void\n onFolderNewSession: (workspaceId: WorkspaceId, path: string, isBase: boolean) => void\n onFolderSetRoot: (workspaceId: WorkspaceId, path: string) => void\n onFolderRemove: (workspaceId: WorkspaceId, path: string) => void\n onManageFolders: (workspaceId: WorkspaceId) => void\n creatingFolderKey: string | null\n /** Absent when the host resolved no folder application. */\n onOpenInFolder?: ((workspaceId: WorkspaceId) => void) | undefined\n /** Absent when the host resolved no folder application. */\n onOpenFolderPath?: ((path: string) => void) | undefined\n}) {\n const emptyLineActive = dragIndicator?.mode === 'line' && dragIndicator.row.kind === 'topLevel' && dragIndicator.row.key === topLevelRef.key\n return (\n \n {topLevel.length === 0 && dragging && (\n \n \n \n )}\n {topLevel.map((workspace) => (\n
\n { onToggleWorkspace(workspace.workspaceId as string) }}\n onNewSession={() => { onNewSession(workspace.workspaceId) }}\n onRename={() => { onRenameRequest(workspace.workspaceId, workspace.label) }}\n onDelete={() => { onDeleteRequest(workspace.workspaceId, workspace.label) }}\n {...(onOpenInFolder !== undefined\n ? { onOpenInFolder: () => { onOpenInFolder(workspace.workspaceId) } }\n : {})}\n {...(dragIndicator?.mode === 'line' && dragIndicator.row.kind === 'topLevel' && dragIndicator.row.key === workspace.workspaceId\n ? { insertLine: dragIndicator.before ? 'before' : 'after' }\n : {})}\n onRowDragOver={onDragOverRow({ kind: 'topLevel', key: workspace.workspaceId })}\n onRowDragLeave={onDragLeaveRow}\n onRowDrop={onDropRow(UNCATEGORIZED_KEY, { kind: 'topLevel', key: workspace.workspaceId })}\n onDragStartExtra={onDragStartWorkspace(workspace.workspaceId)}\n onManageFolders={() => { onManageFolders(workspace.workspaceId) }}\n />\n \n
\n ))}\n \n )\n}\n\n/**\n * Search hits inside one project. When the project owns extra folders the hits\n * keep their folder row (all expanded, since search prunes to matches) so a\n * match never loses the folder it came from.\n */\nfunction SearchSubtree({ workspace, current, now, open, t }: {\n workspace: WorkspaceGroupNode\n current: SessionId | undefined\n now: number\n open: (sessionId: SessionId) => void\n t: GroupsBrowserProps['t']\n}) {\n const folders = workspace.folders\n if (folders === undefined) {\n return (\n
\n {workspace.sessions.map((session) => (\n {}}\n onFork={() => {}}\n onArchive={() => {}}\n />\n ))}\n
\n )\n }\n return (\n
\n {folders.map((folder) => (\n
\n {}}\n onNewSession={() => {}}\n onSetRoot={() => {}}\n onRemove={() => {}}\n />\n
\n {folder.sessions.map((session) => (\n {}}\n onFork={() => {}}\n onArchive={() => {}}\n />\n ))}\n
\n
\n ))}\n
\n )\n}\n\n/**\n * Search body rendered as a three-level tree pruned to matched branches:\n * Only branches that contain a hit are rendered, which keeps a long list short. Reuses the same row components as\n * the idle tree, so search keeps the same folder hierarchy the user is used to.\n */\n/**\n * Search results, presentational only: the owner derives the tree and the\n * match set (so the pinned default-workspace bar can share that derivation).\n * This view never repeats the default workspace —tree.ts leaves it out of the\n * categories / top-level projections and hands it back as `tree.defaultWorkspace`.\n */\nfunction SearchBody({ tree, matches, status, current, now, open, t }: {\n tree: SearchTree\n matches: SearchMatchSet\n status: RemoteSearchState['status']\n current: SessionId | undefined\n now: number\n open: (sessionId: SessionId) => void\n t: GroupsBrowserProps['t']\n}) {\n const groups = tree.categories\n const searchTopLevel = tree.topLevel\n const pending = status === 'loading'\n const failed = status === 'error'\n return (\n
\n {groups.map((category) => (\n
\n {}} />\n
\n {category.workspaces.map((workspace) => (\n
\n {}}\n onNewSession={() => {}}\n onRename={() => {}}\n onDelete={() => {}}\n />\n \n
\n ))}\n
\n
\n ))}\n {searchTopLevel.map((workspace) => (\n
\n {}}\n onNewSession={() => {}}\n onRename={() => {}}\n onDelete={() => {}}\n />\n \n
\n ))}\n {pending &&
{t('search.pending')}
}\n {failed &&
{t('search.unavailable')}
}\n {!pending && groups.length === 0 && searchTopLevel.length === 0 && (\n
{t('search.noMatches')}
\n )}\n {matches.hasMore && (\n
{t('search.hasMore')}
\n )}\n
\n )\n}\n","import type { StoredEntry } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { GroupsBrowserInjected } from './contract.ts'\n\n/** Adapt the elected self-contained picker, without stealing its original slot. */\nexport function directoryFlowFromEntry(entry: StoredEntry | undefined): ReturnType {\n if (!entry) return null\n // Stateful/translated/nested seats need the full original renderer context.\n // Never silently drop them or fall back to a local picker for a remote request.\n if (entry.store || entry.locale || entry.children || typeof entry.component !== 'function') {\n throw new Error('This directory picker requires an unsupported renderer context.')\n }\n return {\n component: entry.component as NonNullable>['component'],\n injected: entry.inject?.() ?? {},\n }\n}\n","/**\n * Locale dictionaries for the workspace-groups browser. The namespace is\n * `workspaceGroups` (independent from ui-workspace's `workspace` namespace).\n */\nimport type { LocaleDictOf } from '@deepseek-ai/dsh-client-ui-slots'\n\n/** Dictionary keys of the workspaceGroups namespace (single source of truth). */\n\nexport type WorkspaceGroupsKey =\n | 'section.workspaces'\n | 'section.sessions'\n | 'search'\n | 'search.placeholder'\n | 'search.clear'\n | 'search.noMatches'\n | 'search.unavailable'\n | 'search.pending'\n | 'search.hasMore'\n | 'search.results.aria'\n | 'workspace.add'\n | 'workspace.addBusy'\n | 'workspace.addError'\n | 'workspace.addErrorTitle'\n | 'workspace.rename'\n | 'workspace.delete'\n | 'workspace.deleteTitle'\n | 'workspace.deleteConfirm'\n | 'workspace.deleteCancel'\n | 'workspace.renaming'\n | 'workspace.deleting'\n | 'workspace.renameTitle'\n | 'workspace.renamePlaceholder'\n | 'workspace.renameConfirm'\n | 'workspace.renameCancel'\n | 'workspace.moveOutOfGroup'\n | 'workspace.openInFolder'\n | 'workspace.openInFolderError'\n | 'folder.title'\n | 'folder.manage'\n | 'folder.listAria'\n | 'folder.sectionList'\n | 'folder.sectionAdd'\n | 'folder.emptyHint'\n | 'folder.base'\n | 'folder.setRoot'\n | 'folder.rootBadge'\n | 'folder.remove'\n | 'folder.add'\n | 'folder.done'\n | 'folder.duplicate'\n | 'folder.conflict'\n | 'folder.removeError'\n | 'folder.removeRemotePrompt'\n | 'folder.removeRemoteDelete'\n | 'folder.removeRemoteOnly'\n | 'folder.addError'\n | 'folder.sessionError'\n | 'folder.saveError'\n | 'folder.notReady'\n | 'folder.remoteSessionUnsupported'\n | 'folder.remoteHint'\n | 'folder.remoteNeedsSubpath'\n | 'folder.subpathLabel'\n | 'folder.subpathPlaceholder'\n | 'folder.addSubpath'\n | 'folder.subpathInvalid'\n | 'folder.cloudSection'\n | 'folder.profileLabel'\n | 'folder.remotePathLabel'\n | 'folder.remotePathPlaceholder'\n | 'folder.remotePathOrName'\n | 'folder.createAndAdd'\n | 'folder.cloudNoteBoth'\n | 'folder.addRemote'\n | 'folder.noProfiles'\n | 'folder.profilesError'\n | 'folder.cloudTag'\n | 'folder.localTag'\n | 'folder.memberMissing'\n | 'folder.memberNested'\n | 'folder.alreadyRoot'\n | 'folder.addAria'\n | 'folder.tabLocal'\n | 'folder.tabCloud'\n | 'folder.pickLocal'\n | 'folder.localNote'\n | 'folder.localIntoRemote'\n | 'folder.cloudNote'\n | 'folder.browse'\n | 'folder.browseTitle'\n | 'folder.browseListAria'\n | 'folder.browseNote'\n | 'folder.browseFailed'\n | 'folder.chooseHere'\n | 'folder.up'\n | 'folder.home'\n | 'folder.refresh'\n | 'folder.loading'\n | 'folder.emptyDir'\n | 'group.create'\n | 'group.createTitle'\n | 'group.createPlaceholder'\n | 'group.createConfirm'\n | 'group.createCancel'\n | 'group.rename'\n | 'group.renameTitle'\n | 'group.renameConfirm'\n | 'group.delete'\n | 'group.deleteTitle'\n | 'group.deleteConfirm'\n | 'group.deleteCancel'\n | 'group.nameDuplicate'\n | 'group.nameReserved'\n | 'group.pin'\n | 'group.unpin'\n | 'group.pinned'\n | 'group.appearance'\n | 'group.appearanceTitle'\n | 'group.appearanceDone'\n | 'group.color'\n | 'group.colorDefault'\n | 'group.icon'\n | 'group.iconDefault'\n | 'group.iconCustom'\n | 'group.iconInvalid'\n | 'group.icon.section.common'\n | 'group.icon.section.lab'\n | 'group.icon.section.materials'\n | 'group.icon.section.characterization'\n | 'group.icon.section.devices'\n | 'group.icon.section.emoji'\n | 'color.red'\n | 'color.orange'\n | 'color.amber'\n | 'color.green'\n | 'color.teal'\n | 'color.blue'\n | 'color.indigo'\n | 'color.purple'\n | 'color.pink'\n | 'color.gray'\n | 'section.topLevel'\n | 'section.defaultWorkspace'\n | 'manual.saveError'\n | 'manual.conflict'\n | 'session.new'\n | 'session.rename'\n | 'session.archive'\n | 'session.fork'\n | 'session.renameTitle'\n | 'session.renamePlaceholder'\n | 'session.renameConfirm'\n | 'session.renameCancel'\n | 'session.renaming'\n | 'uncategorized'\n | 'empty.none'\n | 'empty.noWorkspaces'\n | 'close'\n | 'cancel'\n | 'confirm'\n | 'retry'\n | 'configUnavailable'\n | 'collapse'\n | 'expandMore'\n | 'newSession'\n | 'quick.title'\n | 'quick.tab.workspaces'\n | 'quick.tab.sessions'\n | 'quick.search.placeholder'\n | 'quick.search.sessions'\n | 'quick.empty.workspaces'\n | 'quick.action.newSession'\n | 'quick.action.running'\n | 'quick.action.noneRunning'\n | 'quick.empty.sessions'\n | 'quick.select.hint'\n | 'quick.hint'\n | 'tabs.aria'\n | 'tabs.close'\n | 'tabs.archive'\n | 'tabs.pin'\n | 'tabs.unpin'\n | 'tabs.pinned'\n | 'tabs.rename'\n | 'tabs.renameSession'\n | 'tabs.renamePlaceholder'\n | 'tabs.closeOthers'\n | 'tabs.closeRight'\n | 'tabs.dragHint'\n\nexport type WorkspaceGroupsDict = LocaleDictOf<'workspaceGroups'>\n\n/** Simplified Chinese dictionary. */\nexport const zh: WorkspaceGroupsDict = {\n 'section.workspaces': '工作区',\n 'section.sessions': '会话',\n 'search': '搜索',\n 'search.placeholder': '搜索会话…',\n 'search.clear': '清除',\n 'search.noMatches': '没有匹配的会话',\n 'search.unavailable': '搜索不可用',\n 'search.pending': '搜索中…',\n 'search.hasMore': '结果过多,请细化关键词',\n 'search.results.aria': '搜索结果',\n 'workspace.add': '添加工作区',\n 'workspace.addBusy': '正在添加…',\n 'workspace.addError': '添加失败',\n 'workspace.addErrorTitle': '无法添加工作区',\n 'workspace.rename': '重命名',\n 'workspace.delete': '删除',\n 'workspace.deleteTitle': '删除工作区',\n 'workspace.deleteConfirm': '仅删除注册信息,目录与会话日志保留。确定删除?',\n 'workspace.deleteCancel': '取消删除',\n 'workspace.renaming': '重命名中…',\n 'workspace.deleting': '删除中…',\n 'workspace.renameTitle': '重命名工作区',\n 'workspace.renamePlaceholder': '工作区名称',\n 'workspace.renameConfirm': '重命名',\n 'workspace.renameCancel': '取消',\n 'workspace.moveOutOfGroup': '移出分组',\n 'workspace.openInFolder': '在文件夹中打开',\n 'workspace.openInFolderError': '打开文件夹失败',\n 'folder.title': '文件夹',\n 'folder.manage': '文件夹…',\n 'folder.listAria': '工作区文件夹',\n 'folder.sectionList': '项目文件夹',\n 'folder.sectionAdd': '添加文件夹',\n 'folder.emptyHint': '还没有额外文件夹。下面挂一个目录,它的会话会独立运行,模型也能直接读到里面的文件。',\n 'folder.base': '基础文件夹',\n 'folder.setRoot': '设为根目录',\n 'folder.rootBadge': '根目录',\n 'folder.remove': '从工作区移除',\n 'folder.add': '添加文件夹',\n 'folder.done': '完成',\n 'folder.duplicate': '该文件夹已在此工作区中',\n 'folder.conflict': '文件夹已被另一个窗口修改,已同步为最新状态,本次修改未保存,请重试',\n 'folder.removeError': '远程工作区删除失败',\n 'folder.removeRemotePrompt': '这个云端文件夹背后有一个工作区,移除时要连它一起删掉吗?删掉后它里面的会话也会消失。',\n 'folder.removeRemoteDelete': '连工作区一起删',\n 'folder.removeRemoteOnly': '只移除文件夹',\n 'folder.addError': '添加文件夹失败',\n 'folder.sessionError': '新建会话失败',\n 'folder.saveError': '文件夹保存失败',\n 'folder.notReady': '目录安全信息尚未加载,请重启 DSH 并刷新页面后重试',\n 'folder.remoteSessionUnsupported': '当前 SSH 插件不完整支持子目录会话,请从远程工作区根目录打开会话。不会退回本地终端。',\n 'folder.remoteHint': '输入一个文件夹名:本地使用 DSH 目录接口;远程使用 SSH 创建目录接口(远端同名目录已存在时复用)。SSH 不可用时不会在镜像里创建本地目录。',\n 'folder.remoteNeedsSubpath': '远程工作区请用子目录方式添加文件夹',\n 'folder.subpathLabel': '文件夹名称',\n 'folder.subpathPlaceholder': '例如 data',\n 'folder.addSubpath': '创建文件夹',\n 'folder.subpathInvalid': '路径无效:请填工作区内的相对路径,不能用绝对路径或 ..',\n 'folder.cloudSection': '云端文件夹',\n 'folder.profileLabel': 'SSH 连接',\n 'folder.remotePathLabel': '远端目录',\n 'folder.remotePathPlaceholder': '例如 ~/projects/app',\n 'folder.remotePathOrName': '例如 ~/projects/app,或新目录名',\n 'folder.createAndAdd': '新建并添加',\n 'folder.cloudNoteBoth': '填绝对路径:新建一个云端工作区(带本地镜像);只填名字:在项目云端根目录下新建该目录并挂进来',\n 'folder.addRemote': '添加云端文件夹',\n 'folder.noProfiles': '没有可用的 SSH 连接:请先在 remote-ssh 插件中配置连接',\n 'folder.profilesError': '读取 SSH 连接失败',\n 'folder.cloudTag': '云端',\n 'folder.localTag': '本地',\n 'folder.memberMissing': '该文件夹对应的独立工作区已不存在,请移除后重新添加',\n 'folder.memberNested': '该目录本身已是一个含文件夹的项目,不能作为文件夹加入',\n 'folder.alreadyRoot': '这就是项目的根目录,不能再作为一个文件夹加入',\n 'folder.addAria': '添加文件夹的方式',\n 'folder.tabLocal': '本地目录',\n 'folder.tabCloud': '云端目录',\n 'folder.pickLocal': '选择本地目录…',\n 'folder.localNote': '在本机选一个目录,作为这个项目的文件夹',\n 'folder.localIntoRemote': '这个项目在云端;本地目录会作为本地文件夹挂到这个项目里',\n 'folder.cloudNote': '会为该远端目录建立本地镜像,并注册成一个工作区供会话使用',\n 'folder.browse': '浏览…',\n 'folder.browseTitle': '选择云端文件夹',\n 'folder.browseListAria': '远端目录列表',\n 'folder.browseNote': '只列出目录:点目录进入,用底部按钮选择当前目录。',\n 'folder.browseFailed': '读取远端目录失败',\n 'folder.chooseHere': '选择此目录',\n 'folder.up': '上一级',\n 'folder.home': '主目录',\n 'folder.refresh': '刷新',\n 'folder.loading': '正在读取远端目录…',\n 'folder.emptyDir': '这个目录下没有子目录',\n 'group.create': '新建分组',\n 'group.createTitle': '新建分组',\n 'group.createPlaceholder': '分组名称',\n 'group.createConfirm': '创建',\n 'group.createCancel': '取消',\n 'group.rename': '重命名分组',\n 'group.renameTitle': '重命名分组',\n 'group.renameConfirm': '重命名',\n 'group.delete': '删除分组',\n 'group.deleteTitle': '删除分组',\n 'group.deleteConfirm': '删除后,该分组内的所有项目将移到顶层(不归组)。确定删除?',\n 'group.deleteCancel': '取消删除',\n 'group.nameDuplicate': '已存在同名分组',\n 'group.nameReserved': '该名称不可用',\n 'group.pin': '置顶分组',\n 'group.unpin': '取消置顶',\n 'group.pinned': '已置顶',\n 'group.appearance': '颜色与图标…',\n 'group.appearanceTitle': '分组外观',\n 'group.appearanceDone': '完成',\n 'group.color': '颜色',\n 'group.colorDefault': '默认',\n 'group.icon': '图标',\n 'group.iconDefault': '默认图标',\n 'group.iconCustom': '自定义字符',\n 'group.iconInvalid': '图标需为预设图标或 1–4 个字符',\n 'group.icon.section.common': '常用图标',\n 'group.icon.section.lab': '实验操作',\n 'group.icon.section.materials': '材料结构',\n 'group.icon.section.characterization': '表征测试',\n 'group.icon.section.devices': '功能器件',\n 'group.icon.section.emoji': '常用表情',\n 'color.red': '红色',\n 'color.orange': '橙色',\n 'color.amber': '琥珀',\n 'color.green': '绿色',\n 'color.teal': '青色',\n 'color.blue': '蓝色',\n 'color.indigo': '靛蓝',\n 'color.purple': '紫色',\n 'color.pink': '粉色',\n 'color.gray': '灰色',\n 'section.topLevel': '顶层项目',\n 'section.defaultWorkspace': '默认工作区',\n 'manual.saveError': '分组变更保存失败',\n 'manual.conflict': '分组已被另一个窗口修改,已同步为最新状态,本次修改未保存,请重试',\n 'session.new': '新建会话',\n 'session.rename': '重命名会话',\n 'session.archive': '归档',\n 'session.fork': '派生',\n 'session.renameTitle': '重命名会话',\n 'session.renamePlaceholder': '会话名称',\n 'session.renameConfirm': '重命名',\n 'session.renameCancel': '取消',\n 'session.renaming': '重命名中…',\n 'uncategorized': '未分类',\n 'empty.none': '暂无内容',\n 'empty.noWorkspaces': '还没有工作区',\n 'close': '关闭',\n 'cancel': '取消',\n 'confirm': '确定',\n 'retry': '重试',\n 'configUnavailable': '分组配置不可用',\n 'collapse': '折叠',\n 'expandMore': '展开全部',\n 'newSession': '新建会话',\n 'quick.title': '快速切换',\n 'quick.tab.workspaces': '工作区',\n 'quick.tab.sessions': '全部会话',\n 'quick.search.placeholder': '搜索工作区…',\n 'quick.search.sessions': '搜索会话…',\n 'quick.empty.workspaces': '没有匹配的工作区',\n 'quick.action.newSession': '新建会话',\n 'quick.action.running': '切到运行中的会话',\n 'quick.action.noneRunning': '没有正在运行的会话',\n 'quick.empty.sessions': '还没有会话',\n 'quick.select.hint': '在上方选择一个工作区',\n 'quick.hint': 'Ctrl+R 开关 · Enter 打开/新建 · Esc 关闭',\n 'tabs.aria': '已打开的会话',\n 'tabs.close': '关闭标签',\n 'tabs.archive': '归档',\n 'tabs.pin': '固定标签',\n 'tabs.unpin': '取消固定',\n 'tabs.pinned': '已固定(关闭其他时保留)',\n 'tabs.rename': '重命名标签',\n 'tabs.renameSession': '重命名会话…',\n 'tabs.renamePlaceholder': '标签名,留空恢复会话标题',\n 'tabs.closeOthers': '关闭其他标签',\n 'tabs.closeRight': '关闭右侧标签',\n 'tabs.dragHint': '拖动可排序',\n}\n\n/** English dictionary. */\nexport const en: WorkspaceGroupsDict = {\n 'section.workspaces': 'Workspaces',\n 'section.sessions': 'Sessions',\n 'search': 'Search',\n 'search.placeholder': 'Search sessions…',\n 'search.clear': 'Clear',\n 'search.noMatches': 'No matching sessions',\n 'search.unavailable': 'Search unavailable',\n 'search.pending': 'Searching…',\n 'search.hasMore': 'Too many results — refine the query',\n 'search.results.aria': 'Search results',\n 'workspace.add': 'Add workspace',\n 'workspace.addBusy': 'Adding…',\n 'workspace.addError': 'Add failed',\n 'workspace.addErrorTitle': 'Could not add workspace',\n 'workspace.rename': 'Rename',\n 'workspace.delete': 'Delete',\n 'workspace.deleteTitle': 'Delete workspace',\n 'workspace.deleteConfirm': 'Only the registration is removed; the directory and session logs stay. Delete?',\n 'workspace.deleteCancel': 'Cancel delete',\n 'workspace.renaming': 'Renaming…',\n 'workspace.deleting': 'Deleting…',\n 'workspace.renameTitle': 'Rename workspace',\n 'workspace.renamePlaceholder': 'Workspace name',\n 'workspace.renameConfirm': 'Rename',\n 'workspace.renameCancel': 'Cancel',\n 'workspace.moveOutOfGroup': 'Move out of group',\n 'workspace.openInFolder': 'Open in folder',\n 'workspace.openInFolderError': 'Could not open the folder',\n 'folder.title': 'Folders',\n 'folder.manage': 'Folders…',\n 'folder.listAria': 'Workspace folders',\n 'folder.sectionList': 'Project folders',\n 'folder.sectionAdd': 'Add a folder',\n 'folder.emptyHint': 'No extra folders yet. A folder added below runs its sessions on its own, so the agent can read the files inside it directly.',\n 'folder.base': 'Base folder',\n 'folder.setRoot': 'Set as root',\n 'folder.rootBadge': 'Root',\n 'folder.remove': 'Remove from workspace',\n 'folder.add': 'Add folder',\n 'folder.done': 'Done',\n 'folder.duplicate': 'That folder is already in this workspace',\n 'folder.conflict': 'Folders changed in another window; synced to the latest state, this edit was not saved — please retry',\n 'folder.removeError': 'Could not delete the remote workspace',\n 'folder.removeRemotePrompt': 'This cloud folder is backed by its own workspace. Remove the workspace along with it? Its sessions will be deleted too.',\n 'folder.removeRemoteDelete': 'Delete workspace too',\n 'folder.removeRemoteOnly': 'Remove folder only',\n 'folder.addError': 'Could not add the folder',\n 'folder.sessionError': 'Could not start a session',\n 'folder.saveError': 'Could not save folders',\n 'folder.notReady': 'Directory safety information is not loaded. Restart DSH and refresh the page before retrying.',\n 'folder.remoteSessionUnsupported': 'This SSH plugin does not fully support subdirectory sessions. Start from the remote workspace root instead; no local terminal fallback is allowed.',\n 'folder.remoteHint': 'Enter one folder name. Local workspaces use DSH; remote workspaces use SSH mkdir (existing remote directories are reused). Missing SSH never falls back to a local mirror write.',\n 'folder.remoteNeedsSubpath': 'Remote workspaces take a subdirectory, not a picked folder',\n 'folder.subpathLabel': 'Folder name',\n 'folder.subpathPlaceholder': 'e.g. data',\n 'folder.addSubpath': 'Create folder',\n 'folder.subpathInvalid': 'Invalid path: use a relative path inside the workspace (no absolute paths, no ..)',\n 'folder.cloudSection': 'Cloud folders',\n 'folder.profileLabel': 'SSH connection',\n 'folder.remotePathLabel': 'Remote directory',\n 'folder.remotePathPlaceholder': 'e.g. ~/projects/app',\n 'folder.remotePathOrName': 'e.g. ~/projects/app, or a new folder name',\n 'folder.createAndAdd': 'Create and add',\n 'folder.cloudNoteBoth': 'A path creates a new cloud workspace with its local mirror; a bare name creates that directory under this project’s remote root and attaches it',\n 'folder.addRemote': 'Add cloud folder',\n 'folder.noProfiles': 'No SSH connection available: configure one in the remote-ssh plugin first',\n 'folder.profilesError': 'Could not read SSH connections',\n 'folder.cloudTag': 'Cloud',\n 'folder.localTag': 'Local',\n 'folder.memberMissing': 'The standalone workspace behind this folder no longer exists. Remove the folder and add it again.',\n 'folder.memberNested': 'That directory is a project with folders of its own, so it cannot join as a folder.',\n 'folder.alreadyRoot': 'That is the root of this project, so it cannot join as a folder.',\n 'folder.addAria': 'Ways to add a folder',\n 'folder.tabLocal': 'Local directory',\n 'folder.tabCloud': 'Cloud directory',\n 'folder.pickLocal': 'Choose a local directory…',\n 'folder.localNote': 'Pick a directory on this machine to use as a folder of this project',\n 'folder.localIntoRemote': 'This project lives on the SSH host; a local directory joins it as a local folder',\n 'folder.cloudNote': 'Mirrors that remote directory locally and registers a workspace for its sessions',\n 'folder.browse': 'Browse…',\n 'folder.browseTitle': 'Choose a cloud folder',\n 'folder.browseListAria': 'Remote directory list',\n 'folder.browseNote': 'Only directories are listed: enter one, then choose the current directory with the button below.',\n 'folder.browseFailed': 'Could not read the remote directory',\n 'folder.chooseHere': 'Choose this directory',\n 'folder.up': 'Up',\n 'folder.home': 'Home',\n 'folder.refresh': 'Refresh',\n 'folder.loading': 'Reading the remote directory…',\n 'folder.emptyDir': 'No subdirectories here',\n 'group.create': 'New group',\n 'group.createTitle': 'New group',\n 'group.createPlaceholder': 'Group name',\n 'group.createConfirm': 'Create',\n 'group.createCancel': 'Cancel',\n 'group.rename': 'Rename group',\n 'group.renameTitle': 'Rename group',\n 'group.renameConfirm': 'Rename',\n 'group.delete': 'Delete group',\n 'group.deleteTitle': 'Delete group',\n 'group.deleteConfirm': 'Deleting removes this group; every project inside it moves to the top level (ungrouped). Delete?',\n 'group.deleteCancel': 'Cancel delete',\n 'group.nameDuplicate': 'A group with this name already exists',\n 'group.nameReserved': 'This name is not available',\n 'group.pin': 'Pin group',\n 'group.unpin': 'Unpin group',\n 'group.pinned': 'Pinned',\n 'group.appearance': 'Color & icon…',\n 'group.appearanceTitle': 'Group appearance',\n 'group.appearanceDone': 'Done',\n 'group.color': 'Color',\n 'group.colorDefault': 'Default',\n 'group.icon': 'Icon',\n 'group.iconDefault': 'Default icon',\n 'group.iconCustom': 'Custom character',\n 'group.iconInvalid': 'Use a preset icon or 1–4 characters',\n 'group.icon.section.common': 'Common icons',\n 'group.icon.section.lab': 'Lab operations',\n 'group.icon.section.materials': 'Material structures',\n 'group.icon.section.characterization': 'Characterization',\n 'group.icon.section.devices': 'Functional devices',\n 'group.icon.section.emoji': 'Emoji',\n 'color.red': 'Red',\n 'color.orange': 'Orange',\n 'color.amber': 'Amber',\n 'color.green': 'Green',\n 'color.teal': 'Teal',\n 'color.blue': 'Blue',\n 'color.indigo': 'Indigo',\n 'color.purple': 'Purple',\n 'color.pink': 'Pink',\n 'color.gray': 'Gray',\n 'section.topLevel': 'Top-level projects',\n 'section.defaultWorkspace': 'Default workspace',\n 'manual.saveError': 'Could not save group changes',\n 'manual.conflict': 'Groups changed in another window; synced to the latest state, this edit was not saved — please retry',\n 'session.new': 'New Session',\n 'session.rename': 'Rename session',\n 'session.archive': 'Archive',\n 'session.fork': 'Fork',\n 'session.renameTitle': 'Rename session',\n 'session.renamePlaceholder': 'Session name',\n 'session.renameConfirm': 'Rename',\n 'session.renameCancel': 'Cancel',\n 'session.renaming': 'Renaming…',\n 'uncategorized': 'Uncategorized',\n 'empty.none': 'Nothing here',\n 'empty.noWorkspaces': 'No workspaces yet',\n 'close': 'Close',\n 'cancel': 'Cancel',\n 'confirm': 'Confirm',\n 'retry': 'Retry',\n 'configUnavailable': 'Grouping config unavailable',\n 'collapse': 'Collapse',\n 'expandMore': 'Show all',\n 'newSession': 'New Session',\n 'quick.title': 'Quick switch',\n 'quick.tab.workspaces': 'Workspaces',\n 'quick.tab.sessions': 'All sessions',\n 'quick.search.placeholder': 'Search workspaces…',\n 'quick.search.sessions': 'Search sessions…',\n 'quick.empty.workspaces': 'No matching workspaces',\n 'quick.action.newSession': 'New Session',\n 'quick.action.running': 'Switch to running session',\n 'quick.action.noneRunning': 'No running session',\n 'quick.empty.sessions': 'No sessions yet',\n 'quick.select.hint': 'Pick a workspace above',\n 'quick.hint': 'Ctrl+R toggle · Enter open/new · Esc close',\n 'tabs.aria': 'Open sessions',\n 'tabs.close': 'Close tab',\n 'tabs.archive': 'Archive',\n 'tabs.pin': 'Pin tab',\n 'tabs.unpin': 'Unpin tab',\n 'tabs.pinned': 'Pinned (kept by Close others)',\n 'tabs.rename': 'Rename tab',\n 'tabs.renameSession': 'Rename session…',\n 'tabs.renamePlaceholder': 'Tab name — blank restores the session title',\n 'tabs.closeOthers': 'Close other tabs',\n 'tabs.closeRight': 'Close tabs to the right',\n 'tabs.dragHint': 'Drag to reorder',\n}\n","/**\n * @dsh-xhl/workspace-groups client half. ONE registration, plus a DOM-seated\n * view that hangs off it:\n *\n * The three-level grouped workspace browser into `sidebar.workspaces`,\n * shadowing the official ui-workspace browser.\n *\n * Shadowing mechanics (SlotCore semantics):\n * - `sidebar.workspaces` is a `single`/`root` slot. The official browser\n * registers at priority 0; this entry registers at priority -1, and the\n * single-cell shadow rule makes the LOWEST priority the winner — the\n * sidebar renders this browser instead of the official one.\n * - This entry deliberately declares NO child slots: the official entry\n * already declared `sidebar.workspaces.directoryFlow` (a second declaration\n * of an occupied child key throws). Add Workspace is therefore self-\n * contained — the shared navigation service + `workspaces.create()`, no\n * hole.\n *\n * The session tab strip is NOT a second registration. It renders into a DOM\n * seat at the head of the conversation column (`pI_x6G_centerCol`) because that\n * column declares no child slot — its only child is the `main` slot's occupant\n * — so there is nowhere to register. See `tab-seat.ts` for the injection and\n * `SessionTabs.tsx` for the portal.\n *\n * Two consequences of that choice, both deliberate:\n * - The strip is a CHILD of this entry's component, so it inherits this\n * fiber's frame; it needs no injected seam, no cross-entry callback set,\n * and the rename dialog stays owned by one place.\n * - The tab store is seated by exactly ONE entry. Registering one handle\n * under a second, differently-scoped slot throws inside the registry\n * (\"one handle, one scope\") and would abort this whole `apply()` — which\n * is precisely why the strip does not occupy a slot.\n *\n * 0.1.6 适配:导航(选中会话 / New Session / fork / archive / 目录选择)从\n * `ctx.sessions` 抽到 ui-workspace 提供的 `ctx.uiWorkspace` 服务\n * (`ISessions` 现在只有目录 / retain / search 能力,选中由 `mainView` 保留位\n * 表达)。本插件不再自建 connectWorkspace/recentWorkspace 语义,全部委托给该\n * 服务,只保留改名、删除、排序、搜索等数据动作。\n */\nimport type { Context } from '@deepseek-ai/cordis'\n// Type-only service merges: sessions/workspaces controllers, the ui-workspace\n// navigation service face (ctx.uiWorkspace), locale dictionary seat, the\n// SlotRegistry, and the sidebar SlotMap.\nimport type {} from '@deepseek-ai/dsh-api-session-controller/client'\nimport type {} from '@deepseek-ai/dsh-api-workspace-controller/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-workspace/client'\nimport type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-ui-slots'\n// `useWorkspaces` is contributed by the ui-workspace browser domain (same\n// declaration as the official ui-workspace client half).\nimport type { WorkspaceSnapshot } from '@deepseek-ai/dsh-api-workspace-controller/client'\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\nimport type { GroupsBrowserInjected } from './contract.ts'\nimport { createGroupsViewStore } from './stores.ts'\nimport { createSessionTabsStore } from './tab-store.ts'\nimport { loadTabs, saveTabs } from './tab-persist.ts'\nimport { createStoreHook } from './store-hook.ts'\nimport { shouldOpenTab, type TabOpenMode } from './tabs.ts'\nimport { GroupsBrowser } from './GroupsBrowser.tsx'\nimport { directoryFlowFromEntry } from './directory-flow.ts'\nimport { en, zh, type WorkspaceGroupsKey } from './locales.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** The workspace-groups browsing region copy. */\n workspaceGroups: WorkspaceGroupsKey\n }\n\n interface GlobalStandardProps {\n /** Selector hook over the pure Workspace Controller snapshot. */\n useWorkspaces: SnapshotSelectorHook\n }\n}\n\n/** Dictionary namespace owned by this plugin. */\nconst NS = 'workspaceGroups'\n\n/**\n * Tab visibility policy. `auto` is the behaviour the feature was asked for —\n * opening a session that has no tab yet adds one at the front of the strip;\n * `manual` leaves the strip to callers that drive `openTab` themselves.\n */\nconst TAB_OPEN_MODE: TabOpenMode = 'auto'\n\n/**\n * Required services (cordis fiber inject; 0.1.6 service roster). `uiWorkspace`\n * is the shipped navigation face this entry delegates selection to.\n */\nexport const inject = ['slots', 'sessions', 'workspaces', 'uiWorkspace', 'locale']\n\n/**\n * Register the grouped browser once the sidebar slot declaration is on the\n * ledger. Inject factory returns plain callbacks; data reads use the\n * framework's global hooks.\n * @param ctx - client root context.\n */\nexport function apply(ctx: Context): void {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), '@dsh-xhl/workspace-groups: dictionaries')\n\n // ONE store, ONE scope. The tab store is seated only by the\n // `sidebar.workspaces` entry below (scope root); the strip reads it as a\n // plain prop because it renders as a CHILD of that entry through a DOM\n // portal, not as a second slot occupant. Seating the same handle under a\n // session-scoped slot as well throws inside the registry\n // (one handle, one scope) and would abort this whole apply().\n const tabsStore = createSessionTabsStore()\n const tabInstance = tabsStore.create()\n const tabWrites = tabInstance.actions\n\n // Persist the strip on the HOST, not in browser storage: the origin includes\n // the port and every launch picks a new one, so localStorage/sessionStorage\n // both start empty next time.\n //\n // Writes are GATED until the initial restore has settled. The store starts\n // empty and the browser's own effects run before the host read resolves, so an\n // ungated subscriber would write that empty state over the stored tabs —\n // erasing exactly what it was supposed to restore. `hydrated` is the latch.\n let hydrated = false\n ctx.effect(() => {\n const stop = tabInstance.subscribe(() => {\n if (!hydrated) return\n void saveTabs({\n order: tabInstance.getSnapshot().order,\n tabs: tabInstance.getSnapshot().tabs,\n })\n })\n return () => { stop() }\n }, '@dsh-xhl/workspace-groups: tab persistence')\n\n // Hydrate once from the host, then open the write gate.\n //\n // `restore` is a no-op if the user already opened a tab while this was in\n // flight, so a slow response cannot discard live work. The settle deliberately\n // does NOT write: writing the strip here would erase the stored tabs whenever\n // the read came back empty for a transient reason (host still booting, a\n // dropped request). Only a real state CHANGE persists, via the subscriber.\n ctx.effect(() => {\n let cancelled = false\n void loadTabs().then((tabs) => {\n if (cancelled) return\n if (tabs.length > 0) {\n tabWrites.restore(tabs.map(tab => ({\n sessionId: tab.sessionId as SessionId,\n order: tab.order,\n ...(tab.pinned === true ? { pinned: true } : {}),\n ...(tab.title !== undefined ? { title: tab.title } : {}),\n })))\n }\n hydrated = true\n }).catch(() => {\n // The read failed; leave the gate open so the user's own actions persist,\n // but never write on the strength of a failed read.\n if (!cancelled) hydrated = true\n })\n return () => { cancelled = true }\n }, '@dsh-xhl/workspace-groups: tab restore')\n\n const searchSessions: GroupsBrowserInjected['searchSessions'] = async (query, signal) => {\n const result = await ctx.sessions.search(query, signal)\n if (!result.ok) throw new Error(result.error.message)\n return result.value\n }\n\n const browserInjected = (): GroupsBrowserInjected => ({\n // Navigation verbs belong to the shipped ui-workspace service: it owns the\n // retained `mainView` selection, supersession and pending-navigation\n // cancellation (0.1.6 moved them out of `ctx.sessions`).\n startSession: (workspaceId) => { ctx.uiWorkspace.startSession(workspaceId) },\n // Folder rows create a real Session rooted in that folder. `cwd` stays out\n // of the call for the base folder (the Workspace's canonical directory),\n // where the controller already defaults to `WorkspaceView.path`.\n createSessionIn: async (workspaceId, cwd) => {\n const sessionId = await ctx.sessions.create({\n workspaceId,\n ...(cwd === undefined ? {} : { cwd }),\n })\n ctx.uiWorkspace.openSession(sessionId)\n return sessionId\n },\n open: (sessionId) => { ctx.uiWorkspace.openSession(sessionId) },\n forkSession: (sessionId) => {\n ctx.uiWorkspace.forkSession(sessionId).catch((reason: unknown) => {\n console.warn('fork session failed:', reason)\n })\n },\n archiveSession: async (sessionId) => {\n await ctx.uiWorkspace.archiveSession(sessionId)\n // The tab is deliberately LEFT ALONE. Archiving hides the session from the\n // grouped surfaces, but a tab is something the user opened, and the rule\n // for this strip is that only they close one — an automatic close here\n // would silently drop work they were keeping an eye on. The chip keeps\n // rendering (falling back to the session id when the title no longer\n // resolves).\n },\n pickDirectory: () => ctx.uiWorkspace.pickDirectory(),\n // Our shadow entry cannot own/render the official browser's child slot.\n // Reuse the elected self-contained picker and its actual injected services.\n getDirectoryFlow: () => directoryFlowFromEntry(ctx.slots.entriesOfSlot('sidebar.workspaces.directoryFlow')[0]),\n createDirectory: (path, name) => ctx.uiWorkspace.createDirectory(path, name),\n searchSessions,\n searchResultLimit: ctx.sessions.searchResultLimit,\n // Directory-flow hole occupancy. The official ui-workspace browser gates\n // its \"Add workspace…\" affordance on the hole being occupied (the shipped\n // picker package's client half fills it); this browser drives the picker\n // itself through `pickDirectory`, so it must keep the hole occupied or the\n // official entry (still live at priority 0) would silently withdraw the\n // affordance.\n hooks: {\n directoryFlow: {\n getSnapshot: () => true,\n subscribe: () => () => {},\n },\n },\n // Data-only verbs stay on the controllers.\n renameSession: async (sessionId, title) => {\n const session = ctx.sessions.binding(sessionId)?.session\n if (session === undefined) throw new Error(`unknown session \"${sessionId}\"`)\n const result = await session.rename(title)\n if (!result.ok) throw new Error(result.error.message)\n },\n renameWorkspace: async (workspaceId, title) => { await ctx.workspaces.rename(workspaceId, title) },\n deleteWorkspace: async (workspaceId) => { await ctx.workspaces.delete(workspaceId) },\n insertWorkspaceBefore: async (workspaceId, beforeWorkspaceId) => {\n await ctx.workspaces.insertBefore(workspaceId, beforeWorkspaceId)\n },\n insertSessionBefore: async (workspaceId, sessionId, beforeSessionId) => {\n await ctx.workspaces.insertSessionBefore(workspaceId, sessionId, beforeSessionId)\n },\n createWorkspace: input => ctx.workspaces.create(input),\n // \"Show a tab for what I just opened\" — but only while it is actually in\n // play. The browser decides per session (see `shouldOpenTab`): a draft that\n // has not been talked to, and settled history, both stay out of the strip.\n // The status arrives from the caller because it is a live UI fact read\n // through a hook, which this (non-React) factory cannot reach.\n openTab: (sessionId, status) => {\n const summary = ctx.sessions.list.getSnapshot().byId[sessionId]\n if (shouldOpenTab(TAB_OPEN_MODE, summary, status)) tabWrites.touch(sessionId)\n },\n // The strip rides this entry's own store seat, so it needs both faces\n // explicitly: a selector hook over the one live instance, and the baked\n // writes. Both come from the same instance the browser writes through.\n useTabs: createStoreHook(tabInstance),\n tabActions: tabWrites,\n })\n\n // priority: -1 — lower than the official browser's default 0, so the\n // single-slot shadow rule elects this entry. No children declaration: the\n // official entry already owns `sidebar.workspaces.directoryFlow`.\n //\n // The official WorkspaceBrowser entry is NEVER disposed — shadowing only\n // changes which entry renders (activation just bumps the store's mount\n // count). Both entries live at the same cell, so if this one ever throws\n // during render the slot core retires it for the rest of its registration's\n // life and silently falls back to the official browser. Anything that can\n // throw belongs outside the hot path.\n ctx.slots.inject('sidebar.workspaces', () => ctx.slots.register(\n {\n name: 'sidebar.workspaces',\n priority: -1,\n store: createGroupsViewStore(),\n inject: browserInjected,\n locale: NS,\n registrant: 'workspace-groups-local',\n },\n GroupsBrowser,\n ))\n}\n","/**\n * @zhangfengshun/dsh-remote-ssh — Client 半边(静态 DSH Web 插件,浏览器 bundle)\n *\n * 远程文件与远程终端已合并到内置「文件」和「终端」页签:\n * - 远程文件:内置「文件」页签通过 fs.* 拦截直接 SSH 读写远程文件,无需同步。\n * 远程终端由内置「终端」页签提供(shell wrapper 自动 SSH)。\n * - 远程终端:shell wrapper 自动检测工作区 .remote-ssh.json,在远程工作区中打开 SSH 终端。\n * 需在 better-sidebar 设置中将 shell 指向 wrapper 脚本(见 README)。\n * 仍保留隐藏的 remssh:editor 页签用于远程文件编辑器。\n * 在 DSH 设置页注册「远程连接」小节管理连接配置和远程工作区;\n * 同时接管原生「添加工作区」流程提供「本地目录 / 远程目录」两选。\n */\n// --- merged-bundle transform (scripts/build-remote-ssh-client.mjs) ---\n// Upstream registers this factory under its own package id; the merged\n// package registers ONE client row, so the factory is exported instead\n// and applied by src/client/index.ts. Body below is upstream-verbatim.\nexport default (require) => {\n var module = { exports: {} };\n var exports = module.exports;\n var React = require(\"react\");\n var primitives = require(\"@deepseek-ai/dsh-client-ui-primitives\");\n var Modal = primitives.Modal;\n\n function h(tag, props) {\n var args = [tag, props];\n for (var i = 2; i < arguments.length; i++) args.push(arguments[i]);\n return React.createElement.apply(React, args);\n }\n\n var CSS =\n // 颜色全部使用 DSH 主题 token(--dsw-alias-*),跟随 body[data-ds-dark-theme] 自动切换明暗主题。\n \".rssh-row{margin:6px 0}.rssh-label{color:var(--dsw-alias-label-caption);font-size:11px;display:block;margin-bottom:2px}\" +\n \".rssh-input{width:100%;box-sizing:border-box;background:var(--dsw-specific-input-major);color:var(--dsw-alias-label-primary);border:1px solid var(--dsw-alias-border-l2);border-radius:4px;padding:5px 7px;margin:3px 0;font-size:12px}\" +\n \".rssh-select{width:100%;box-sizing:border-box;background:var(--dsw-specific-input-major);color:var(--dsw-alias-label-primary);border:1px solid var(--dsw-alias-border-l2);border-radius:4px;padding:5px 7px;margin:3px 0;font-size:12px}\" +\n \".rssh-btn{background:var(--dsw-alias-button-ghost-active-fill);color:var(--dsw-alias-label-primary);border:1px solid var(--dsw-alias-border-l2);border-radius:4px;padding:4px 9px;cursor:pointer;font-size:12px}\" +\n \".rssh-btn:hover{background:var(--dsw-alias-button-ghost-active-hover)}.rssh-btn:disabled{opacity:.5;cursor:default}\" +\n \".rssh-card{padding:8px 10px;border:1px solid var(--dsw-alias-border-l1);border-radius:6px;margin:8px 0;background:var(--dsw-alias-bg-layer-2)}\" +\n \".rssh-title{font-weight:600;font-size:13px}.rssh-sub{color:var(--dsw-alias-label-tertiary);font-size:11px}\" +\n \".rssh-actions{margin-top:6px;display:flex;gap:5px;flex-wrap:wrap}\" +\n \".rssh-tree-item{display:flex;align-items:center;gap:5px;padding:3px 5px;cursor:pointer;border-radius:3px}\" +\n \".rssh-tree-item:hover{background:var(--dsw-alias-interactive-bg-hover)}\" +\n \".rssh-tree-dir{color:var(--dsw-alias-state-business-primary)}.rssh-tree-file{color:var(--dsw-alias-label-primary)}\" +\n \".rssh-tree-size{color:var(--dsw-alias-label-caption);font-size:11px;margin-left:auto}\" +\n \".rssh-pathbar{display:flex;gap:4px;align-items:center;margin:4px 0}\" +\n \".rssh-pathbar .rssh-input{flex:1;margin:0}\" +\n \".rssh-content{white-space:pre-wrap;font-family:Consolas,monospace;font-size:12px;background:var(--dsw-alias-markdown-code-block);color:var(--dsw-alias-label-primary);padding:8px;border-radius:4px;margin-top:6px;max-height:400px;overflow:auto}\" +\n \".rssh-terminal{background:var(--dsw-alias-markdown-code-block);color:var(--dsw-alias-label-primary);border-radius:4px;padding:6px;margin-top:8px;font-family:Consolas,monospace;font-size:12px}\" +\n \".rssh-terminal-out{white-space:pre-wrap;max-height:320px;overflow:auto;min-height:120px;line-height:1.4}\" +\n \".rssh-terminal-bar{display:flex;gap:5px;align-items:center;margin-bottom:4px}\" +\n \".rssh-terminal-input-row{display:flex;gap:4px;margin-top:5px}.rssh-terminal-input-row .rssh-input{flex:1}\" +\n \".rssh-ok{color:var(--dsw-alias-state-success-primary)}.rssh-err{color:var(--dsw-alias-state-error-primary)}.rssh-muted{color:var(--dsw-alias-label-tertiary);font-size:12px;padding:6px 0}\" +\n \".rssh-empty{padding:12px;text-align:center;color:var(--dsw-alias-label-tertiary);font-size:12px}\" +\n \".rssh-flow-dialog{width:690px!important;max-width:94vw!important;min-width:460px;resize:horizontal;overflow:auto!important}\" +\n // 添加工作区弹窗:上方本地/远程分段切换 + 路径栏 + 文件树\n \".rssh-seg{display:flex;gap:0;margin-bottom:8px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;overflow:hidden}\" +\n \".rssh-seg-btn{flex:1;padding:7px 12px;text-align:center;cursor:pointer;font-size:12px;font-weight:500;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);border:none;transition:background .15s}\" +\n \".rssh-seg-btn:hover{background:var(--dsw-alias-interactive-bg-hover)}\" +\n \".rssh-seg-btn.active{background:var(--dsw-alias-state-business-primary);color:#fff}\" +\n \".rssh-pick-tree{border:1px solid var(--dsw-alias-border-l1);border-radius:4px;max-height:240px;overflow-y:auto;margin-top:4px;background:var(--dsw-alias-bg-layer-2)}\" +\n \".rssh-pick-empty{padding:12px;text-align:center;color:var(--dsw-alias-label-tertiary);font-size:11px}\";\n\n // ---- 国际化(跟随 DSH 设置中的语言自动切换)----\n var NS = \"dsh-remote-ssh\";\n var zh = {\n \"tabs.files\": \"远程文件\",\n \"tabs.term\": \"远程终端\",\n \"settings.nav\": \"远程连接\",\n \"settings.desc\": \"管理 Remote-SSH 的远程连接配置(SSH 密钥或密码认证)。\",\n \"settings.empty\": \"还没有连接配置。请在下方添加。\",\n \"settings.add\": \"添加连接\",\n \"settings.workspaces\": \"远程工作区\",\n \"settings.name\": \"名称\",\n \"settings.namePlaceholder\": \"如:我的超算\",\n \"settings.host\": \"主机 host\",\n \"settings.hostPlaceholder\": \"login.example.com\",\n \"settings.port\": \"端口 port\",\n \"settings.user\": \"用户名 user\",\n \"settings.userPlaceholder\": \"your-username\",\n \"settings.auth\": \"认证方式\",\n \"settings.key\": \"密钥 (推荐)\",\n \"settings.password\": \"密码\",\n \"settings.keyPath\": \"私钥路径 keyPath\",\n \"settings.keyPathPlaceholder\": \"~/.ssh/id_rsa\",\n \"settings.passwordField\": \"密码 password\",\n \"settings.remoteRoot\": \"远程根目录 remoteRoot\",\n \"settings.proxyJump\": \"跳板机 ProxyJump\",\n \"settings.test\": \"测试连接\",\n \"settings.saved\": \"已保存\",\n \"settings.connOk\": \"连接成功\",\n \"settings.connFail\": \"连接失败: \",\n \"settings.errSave\": \"保存失败\",\n \"settings.guards\": \"写回与终端(进阶)\",\n \"settings.guardsHint\": \"终端起不来时,把 node 可执行文件的绝对路径填在这里(issue #23);写回失败与远端新鲜度检查控制 agent 的 write/edit 要不要推到远端(issue #24)。\",\n \"settings.nodePath\": \"node 绝对路径 nodePath(留空 = 自动解析)\",\n \"settings.writeBackFailure\": \"写回推送失败时\",\n \"settings.wbError\": \"让模型看见(工具报错,推荐)\",\n \"settings.wbLog\": \"只写日志(不打扰模型)\",\n \"settings.writeBackFreshness\": \"推之前检查远端是否被改过(发现被改过就不推、并报告;推荐开着)\",\n \"settings.wsWriteBack\": \"该工作区启用写回(agent 的 write/edit 同步到远端)\",\n \"settings.wsWriteBackExclude\": \"写回排除(逗号或换行分隔,如 _patch/, *.log, wbdeep/**)\",\n \"settings.saveGuards\": \"保存这一项\",\n \"settings.wsSyncPaths\": \"同步范围(逗号或换行分隔,如 .dsh;留空 = 整树)\",\n \"settings.wsSyncExclude\": \"同步排除(逗号或换行分隔,如 data/, *.log)\",\n \"settings.wsSyncMaxBytes\": \"同步体积上限(GiB,留空 = 默认 2 GiB)\",\n \"settings.syncScope\": \"同步范围(进阶)\",\n \"settings.syncScopeHint\": \"只同步需要的子路径,避免整树 tar。对远程路径是 ~ 的工作区尤其重要:整树会先被体积上限拒绝(issue #28)。留空 = 整树。\",\n \"settings.defaultSyncPaths\": \"新工作区的默认同步范围(逗号或换行分隔)\",\n \"settings.defaultSyncExclude\": \"新工作区的默认同步排除\",\n \"settings.defaultSyncMaxBytes\": \"默认同步体积上限(GiB,留空 = 内置 2 GiB)\",\n \"sync.upDone\": \"推送完成\",\n \"sync.upFail\": \"推送失败: \",\n \"common.selectProfile\": \"— 选择连接 —\",\n \"common.profile\": \"连接配置\",\n \"common.save\": \"保存\",\n \"common.open\": \"打开\",\n \"common.close\": \"关闭\",\n \"common.noEntries\": \"(无子目录)\",\n \"common.delete\": \"删除\",\n \"common.up\": \"⬆ 上级\",\n \"common.loading\": \"加载中…\",\n \"common.processing\": \"处理中…\",\n \"common.errList\": \"读取目录失败\",\n \"files.workspace\": \"远程工作区\",\n \"files.selectWorkspace\": \"— 选择工作区 —\",\n \"files.orProfile\": \"或直接选连接配置\",\n \"files.defaultDir\": \"默认目录(打开该工作区时进入的远程目录)\",\n \"files.reading\": \"读取中…\",\n \"files.errRead\": \"读取失败\",\n \"files.errSave\": \"保存失败\",\n \"files.errSaveDefaultDir\": \"保存默认目录失败\",\n \"files.binary\": \"二进制文件,无法预览\",\n \"term.title\": \"终端 {id}\",\n \"term.exited\": \" (已退出)\",\n \"term.connecting\": \"正在连接…\",\n \"term.noOutput\": \"(无输出)\",\n \"term.inputPlaceholder\": \"输入命令后回车…\",\n \"term.send\": \"发送\",\n \"term.needProfile\": \"请先选择连接配置\",\n \"term.newTerminal\": \"+ 新建终端\",\n \"term.emptyHint\": \"从上面的连接配置新建一个终端,直接操作远程环境。\",\n \"term.errSpawn\": \"启动终端失败\",\n \"picker.dir\": \"目录\",\n \"picker.choose\": \"选择此目录\",\n \"picker.errNameEmpty\": \"目录名不能为空\",\n \"picker.errNameBad\": \"目录名不能包含 / 或 \\\\,也不能是 . 或 ..\",\n \"flow.localTitle\": \"选择本地目录\",\n \"flow.remoteTitle\": \"选择远程目录\",\n \"flow.localDir\": \"本地目录\",\n \"flow.remoteDir\": \"远程目录\",\n \"flow.addWsTitle\": \"添加工作区\",\n \"flow.localSeg\": \"📁 本地目录\",\n \"flow.remoteSeg\": \"🌐 远程目录\",\n \"flow.syncPaths\": \"同步范围(可选,留空 = 全局默认/整树)\",\n \"flow.browse\": \"浏览\",\n \"flow.chooseRemote\": \"选择远程目录…\",\n \"flow.backLocal\": \"← 选择本地目录\",\n \"flow.errCreate\": \"创建远程工作区失败\",\n \"flow.errMkdir\": \"新建目录失败\",\n \"settings.importSshConfig\": \"从 ~/.ssh/config 导入…\",\n \"settings.importTitle\": \"导入 ~/.ssh/config 主机\",\n \"settings.noneFound\": \"未在 ~/.ssh/config 中发现可用主机\",\n \"settings.imported\": \"已导入 {n} 个连接\",\n \"sync.down\": \"⬇ 同步\",\n \"sync.up\": \"⬆ 推送\",\n \"sync.syncing\": \"同步中…\",\n \"sync.pushing\": \"推送中…\",\n \"sync.done\": \"同步完成\",\n \"sync.fail\": \"同步失败\",\n \"ops.search\": \"🔍 搜索\",\n \"ops.find\": \"按名查找\",\n \"ops.searchPh\": \"正则或关键词…\",\n \"ops.globPh\": \"*.py\",\n \"ops.newDir\": \"📁 新建目录\",\n \"ops.newDirPh\": \"目录名\",\n \"ops.rename\": \"✏ 重命名/移动\",\n \"ops.renamePh\": \"目标路径\",\n \"ops.delete\": \"🗑 删除\",\n \"ops.confirmDel\": \"确认删除远程文件/目录?(不可恢复)\",\n \"ops.grepTitle\": \"远程内容搜索 (grep)\",\n \"ops.globTitle\": \"按文件名查找 (glob)\",\n \"ops.mkdirTitle\": \"新建远程目录\",\n \"ops.moveTitle\": \"移动/重命名\",\n \"ops.deleteTitle\": \"删除远程文件/目录\",\n \"ops.noMatch\": \"无匹配\",\n \"ops.done\": \"操作完成\",\n \"ops.fail\": \"操作失败\"\n };\n var en = {\n \"tabs.files\": \"Remote Files\",\n \"tabs.term\": \"Remote Terminal\",\n \"settings.nav\": \"Remote Connections\",\n \"settings.desc\": \"Manage Remote-SSH connection profiles (SSH key or password authentication).\",\n \"settings.empty\": \"No connection profiles yet. Add one below.\",\n \"settings.add\": \"Add Profile\",\n \"settings.workspaces\": \"Remote Workspaces\",\n \"settings.name\": \"Name\",\n \"settings.namePlaceholder\": \"e.g. My HPC\",\n \"settings.host\": \"Host\",\n \"settings.hostPlaceholder\": \"login.example.com\",\n \"settings.port\": \"Port\",\n \"settings.user\": \"User\",\n \"settings.userPlaceholder\": \"your-username\",\n \"settings.auth\": \"Authentication\",\n \"settings.key\": \"Key (recommended)\",\n \"settings.password\": \"Password\",\n \"settings.keyPath\": \"Private key path (keyPath)\",\n \"settings.keyPathPlaceholder\": \"~/.ssh/id_rsa\",\n \"settings.passwordField\": \"Password\",\n \"settings.remoteRoot\": \"Remote root (remoteRoot)\",\n \"settings.proxyJump\": \"ProxyJump (jump host)\",\n \"settings.test\": \"Test Connection\",\n \"settings.saved\": \"Saved\",\n \"settings.connOk\": \"Connected\",\n \"settings.connFail\": \"Connection failed: \",\n \"settings.errSave\": \"Save failed\",\n \"settings.guards\": \"Write-back & terminal (advanced)\",\n \"settings.guardsHint\": \"If the integrated terminal cannot start, put the absolute path of node here (issue #23). The other two control whether the agent's write/edit is pushed to the remote (issue #24).\",\n \"settings.nodePath\": \"Absolute path of node (nodePath; empty = auto-resolve)\",\n \"settings.writeBackFailure\": \"When a write-back push fails\",\n \"settings.wbError\": \"Make it visible to the model (tool error, recommended)\",\n \"settings.wbLog\": \"Log only (do not disturb the model)\",\n \"settings.writeBackFreshness\": \"Check the remote before pushing (skip + report if it changed remotely; recommended on)\",\n \"settings.wsWriteBack\": \"Enable write-back for this workspace (agent write/edit syncs to the remote)\",\n \"settings.wsWriteBackExclude\": \"Write-back excludes (comma or newline separated, e.g. _patch/, *.log, wbdeep/**)\",\n \"settings.saveGuards\": \"Save this item\",\n \"settings.wsSyncPaths\": \"Sync scope (comma or newline separated, e.g. .dsh; empty = whole tree)\",\n \"settings.wsSyncExclude\": \"Sync excludes (comma or newline separated, e.g. data/, *.log)\",\n \"settings.wsSyncMaxBytes\": \"Sync size limit (GiB, empty = default 2 GiB)\",\n \"settings.syncScope\": \"Sync scope (advanced)\",\n \"settings.syncScopeHint\": \"Sync only the sub-paths you need instead of a whole-tree tar. This matters for workspaces whose remote path is ~ — a whole-tree sync is refused by the size sentinel first (issue #28). Empty = whole tree.\",\n \"settings.defaultSyncPaths\": \"Default sync scope for new workspaces (comma or newline separated)\",\n \"settings.defaultSyncExclude\": \"Default sync excludes for new workspaces\",\n \"settings.defaultSyncMaxBytes\": \"Default sync size limit (GiB, empty = built-in 2 GiB)\",\n \"sync.upDone\": \"Push complete\",\n \"sync.upFail\": \"Push failed: \",\n \"common.selectProfile\": \"— Select profile —\",\n \"common.profile\": \"Profile\",\n \"common.save\": \"Save\",\n \"common.open\": \"Open\",\n \"common.close\": \"Close\",\n \"common.noEntries\": \"(no subdirectories)\",\n \"common.delete\": \"Delete\",\n \"common.up\": \"⬆ Up\",\n \"common.loading\": \"Loading…\",\n \"common.processing\": \"Processing…\",\n \"common.errList\": \"Failed to list directory\",\n \"files.workspace\": \"Remote Workspace\",\n \"files.selectWorkspace\": \"— Select workspace —\",\n \"files.orProfile\": \"or pick a profile directly\",\n \"files.defaultDir\": \"Default directory (entered when opening this workspace)\",\n \"files.reading\": \"Reading…\",\n \"files.errRead\": \"Failed to read\",\n \"files.errSave\": \"Failed to save\",\n \"files.errSaveDefaultDir\": \"Failed to save default directory\",\n \"files.binary\": \"Binary file — preview not available\",\n \"term.title\": \"Terminal {id}\",\n \"term.exited\": \" (exited)\",\n \"term.connecting\": \"Connecting…\",\n \"term.noOutput\": \"(no output)\",\n \"term.inputPlaceholder\": \"Type a command and press Enter…\",\n \"term.send\": \"Send\",\n \"term.needProfile\": \"Select a profile first\",\n \"term.newTerminal\": \"+ New terminal\",\n \"term.emptyHint\": \"Create a terminal from the profile above to operate the remote environment.\",\n \"term.errSpawn\": \"Failed to start terminal\",\n \"picker.dir\": \"Directory\",\n \"picker.choose\": \"Choose this directory\",\n \"picker.errNameEmpty\": \"Folder name cannot be empty\",\n \"picker.errNameBad\": \"Folder name cannot contain / or \\\\, nor be . or ..\",\n \"flow.localTitle\": \"Select Local Directory\",\n \"flow.remoteTitle\": \"Select Remote Directory\",\n \"flow.localDir\": \"Local directory\",\n \"flow.remoteDir\": \"Remote directory\",\n \"flow.addWsTitle\": \"Add Workspace\",\n \"flow.localSeg\": \"📁 Local\",\n \"flow.remoteSeg\": \"🌐 Remote\",\n \"flow.syncPaths\": \"Sync scope (optional, empty = global default / whole tree)\",\n \"flow.browse\": \"Browse\",\n \"flow.chooseRemote\": \"Choose remote directory…\",\n \"flow.backLocal\": \"← Choose local directory\",\n \"flow.errCreate\": \"Failed to create remote workspace\",\n \"flow.errMkdir\": \"Failed to create the folder\",\n \"settings.importSshConfig\": \"Import from ~/.ssh/config…\",\n \"settings.importTitle\": \"Import ~/.ssh/config hosts\",\n \"settings.noneFound\": \"No usable hosts found in ~/.ssh/config\",\n \"settings.imported\": \"Imported {n} connection(s)\",\n \"sync.down\": \"⬇ Sync\",\n \"sync.up\": \"⬆ Push\",\n \"sync.syncing\": \"Syncing…\",\n \"sync.pushing\": \"Pushing…\",\n \"sync.done\": \"Sync complete\",\n \"sync.fail\": \"Sync failed\",\n \"ops.search\": \"🔍 Search\",\n \"ops.find\": \"Find by name\",\n \"ops.searchPh\": \"regex or keyword…\",\n \"ops.globPh\": \"*.py\",\n \"ops.newDir\": \"📁 New dir\",\n \"ops.newDirPh\": \"dir name\",\n \"ops.rename\": \"✏ Rename/Move\",\n \"ops.renamePh\": \"target path\",\n \"ops.delete\": \"🗑 Delete\",\n \"ops.confirmDel\": \"Confirm delete remote file/dir? (irreversible)\",\n \"ops.grepTitle\": \"Remote content search (grep)\",\n \"ops.globTitle\": \"Find by name (glob)\",\n \"ops.mkdirTitle\": \"Create remote directory\",\n \"ops.moveTitle\": \"Move/Rename\",\n \"ops.deleteTitle\": \"Delete remote file/dir\",\n \"ops.noMatch\": \"No match\",\n \"ops.done\": \"Done\",\n \"ops.fail\": \"Operation failed\"\n };\n var i18n = {\n t: function (key) { return key; },\n subscribe: function () { return function () {}; },\n getSnapshot: function () { return 0; }\n };\n function useT() {\n var state = React.useState(0);\n var force = state[1];\n React.useEffect(function () {\n return i18n.subscribe(function () { force(function (n) { return n + 1; }); });\n }, []);\n return i18n.t;\n }\n\n // ---- 跨会话切换的状态记忆(按 sessionId 分桶,模块级存活,页面刷新即失效)----\n var memoryBySession = {};\n function useSessionMemory(sessionId, key, initial) {\n var sid = sessionId || \"global\";\n var bucket = memoryBySession[sid] || (memoryBySession[sid] = {});\n var state = React.useState(function () {\n if (Object.prototype.hasOwnProperty.call(bucket, key)) return bucket[key];\n var init = typeof initial === \"function\" ? initial() : initial;\n return bucket[key] = init;\n });\n var value = state[0], setValue = state[1];\n React.useEffect(function () { bucket[key] = value; }, [value]);\n return [value, setValue];\n }\n\n // ---- 与 Host 半边的 JSON RPC ----\n async function api(method, args) {\n try {\n var r = await fetch(\"/remote-ssh/api/\" + method, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\", \"x-requested-with\": \"XMLHttpRequest\" },\n body: JSON.stringify(args || {})\n });\n var j = await r.json();\n if (j && j.ok) return j.value;\n return { ok: false, error: (j && j.error && j.error.message) || (\"HTTP \" + r.status) };\n } catch (e) {\n return { ok: false, error: String(e && e.message ? e.message : e) };\n }\n }\n\n // ---- 跨页签「打开工作区」的轻量共享选择 ----\n var sel = { workspaceId: null };\n var selListeners = [];\n function setSelWorkspace(id) { sel.workspaceId = id; selListeners.forEach(function (fn) { fn(); }); }\n function subscribeSel(fn) { selListeners.push(fn); return function () { var i = selListeners.indexOf(fn); if (i >= 0) selListeners.splice(i, 1); }; }\n\n // ---- 通用:拉取连接配置(refreshKey 变化时重新拉取,避免缓存过期)----\n function useProfiles(refreshKey) {\n var state = React.useState([]);\n var profiles = state[0], setProfiles = state[1];\n React.useEffect(function () {\n api(\"listProfiles\").then(function (r) { if (r && r.ok) setProfiles(r.profiles || []); });\n }, [refreshKey]);\n return profiles;\n }\n\n function Field(props) {\n return h(\"div\", { className: \"rssh-row\" },\n h(\"span\", { className: \"rssh-label\" }, props.label),\n h(\"input\", { className: \"rssh-input\", type: props.type || \"text\", value: props.value, placeholder: props.placeholder,\n onChange: function (e) { props.onChange(e.target.value); } })\n );\n }\n\n // ---- 同步范围输入框 ↔ 宿主要的数据形状(issue #28)----\n // 输入框统一是「逗号或换行分隔」的文本,宿主存数组;体积上限界面按 GiB 填、宿主存字节。\n // 拆分语义要与宿主 normalizeSyncList 一致(逗号/换行/分号都认,去空白、丢空串)。\n\n /** 「逗号或换行分隔」的列表文本 → 数组。 */\n function splitList(value) {\n return String(value == null ? \"\" : value).split(/[\\n,;]/).map(function (s) { return s.trim(); }).filter(Boolean);\n }\n\n /** 字节数 → GiB 文本(空 = 用宿主内置默认上限)。 */\n function bytesToGibText(bytes) {\n var n = Number(bytes) || 0;\n if (!n) return \"\";\n return String(Math.round((n / 1073741824) * 100) / 100);\n }\n\n /** GiB 文本 → 字节;空/非法 → 0(= 用宿主内置默认上限)。 */\n function gibTextToBytes(text) {\n var n = parseFloat(String(text == null ? \"\" : text).replace(/[^0-9.]/g, \"\"));\n if (!isFinite(n) || n <= 0) return 0;\n return Math.round(n * 1073741824);\n }\n\n /** 宿主返回的偏好 → 界面状态(数组转文本,字节转 GiB)。 */\n function prefsForUi(p) {\n var v = p || {};\n return {\n nodePath: String(v.nodePath || \"\"),\n writeBackFailure: String(v.writeBackFailure || \"error\"),\n writeBackFreshness: v.writeBackFreshness !== false,\n defaultSyncPaths: (v.defaultSyncPaths || []).join(\", \"),\n defaultSyncExclude: (v.defaultSyncExclude || []).join(\", \"),\n defaultSyncMaxBytes: bytesToGibText(v.defaultSyncMaxBytes)\n };\n }\n\n // ======================================================================\n // 远程操作弹窗(grep / glob / mkdir / move / delete)\n // ======================================================================\n function OpsModal(props) {\n var d = props.opsDlg;\n var t = props.t;\n var patchOps = props.patchOps;\n var runOps = props.runOps;\n var title = ({\n grep: t(\"ops.grepTitle\"), glob: t(\"ops.globTitle\"), mkdir: t(\"ops.mkdirTitle\"),\n move: t(\"ops.moveTitle\"), delete: t(\"ops.deleteTitle\")\n })[d.type] || \"\";\n var isGrep = d.type === \"grep\";\n var isGlob = d.type === \"glob\";\n var isMove = d.type === \"move\";\n var isDel = d.type === \"delete\";\n // 结果渲染\n var resultEl = null;\n if (d.result) {\n var r = d.result;\n if (isGrep) {\n var ms = r.matches || [];\n resultEl = h(\"div\", { style: { maxHeight: 260, overflow: \"auto\", marginTop: 8, fontSize: 11, whiteSpace: \"pre-wrap\", fontFamily: \"monospace\" } },\n !r.ok ? h(\"div\", { className: \"rssh-err\" }, r.error || t(\"ops.fail\")) :\n ms.length === 0 ? h(\"div\", { className: \"rssh-muted\" }, t(\"ops.noMatch\")) :\n ms.map(function (m, i) { return h(\"div\", { key: i }, m.file + \":\" + m.line + \": \" + m.content); }),\n r.truncated ? h(\"div\", { className: \"rssh-muted\" }, \"…\") : null\n );\n } else if (isGlob) {\n var fs2 = r.files || [];\n resultEl = h(\"div\", { style: { maxHeight: 260, overflow: \"auto\", marginTop: 8, fontSize: 11, whiteSpace: \"pre-wrap\", fontFamily: \"monospace\" } },\n !r.ok ? h(\"div\", { className: \"rssh-err\" }, r.error || t(\"ops.fail\")) :\n fs2.length === 0 ? h(\"div\", { className: \"rssh-muted\" }, t(\"ops.noMatch\")) :\n fs2.map(function (f, i) { return h(\"div\", { key: i }, f); })\n );\n } else {\n // exec 结果(mkdir/move/delete)\n resultEl = h(\"div\", { style: { marginTop: 8 } },\n r.ok ? h(\"div\", { className: \"rssh-ok\" }, t(\"ops.done\") + (r.stderr ? \" \" + String(r.stderr).slice(0, 200) : \"\")) :\n h(\"div\", { className: \"rssh-err\" }, (r.error || r.stderr || t(\"ops.fail\")))\n );\n }\n }\n return h(Modal, { open: true, onClose: props.close, title: title, closeLabel: t(\"common.close\"), className: \"rssh-flow-dialog\" },\n h(\"div\", { style: { display: \"flex\", flexDirection: \"column\", gap: 6 } },\n h(\"input\", { className: \"rssh-input\", value: d.p1, onChange: function (e) { patchOps({ p1: e.target.value }); }, placeholder: isGrep ? t(\"ops.searchPh\") : (isGlob ? t(\"ops.globPh\") : t(\"ops.newDirPh\")) }),\n isGrep ? h(\"input\", { className: \"rssh-input\", value: d.p2, onChange: function (e) { patchOps({ p2: e.target.value }); }, placeholder: \"*.py (include)\" }) : null,\n isMove ? h(\"input\", { className: \"rssh-input\", value: d.p2, onChange: function (e) { patchOps({ p2: e.target.value }); }, placeholder: t(\"ops.renamePh\") }) : null,\n h(\"div\", { className: \"rssh-actions\" },\n h(\"button\", { className: \"rssh-btn\", onClick: runOps, disabled: d.busy }, d.busy ? t(\"common.processing\") : (isDel ? t(\"ops.delete\") : t(\"common.save\"))),\n h(\"button\", { className: \"rssh-btn\", onClick: props.close, disabled: d.busy }, t(\"common.close\"))\n ),\n resultEl\n )\n );\n }\n\n // ======================================================================\n // 远程文件页签\n // ======================================================================\n function FilesTab(props) {\n var t = useT();\n var sessionId = props.sessionId;\n var betterSidebar = props.betterSidebar;\n var [workspaces, setWorkspaces] = React.useState([]);\n var profiles = useProfiles();\n var [wsId, setWsId] = useSessionMemory(sessionId, \"wsId\", sel.workspaceId);\n var [profileId, setProfileId] = useSessionMemory(sessionId, \"profileId\", \"\");\n var [path, setPath] = useSessionMemory(sessionId, \"path\", \"\");\n var [entries, setEntries] = useSessionMemory(sessionId, \"entries\", []);\n var [err, setErr] = React.useState(null);\n var [loading, setLoading] = React.useState(false);\n var [defaultDir, setDefaultDir] = useSessionMemory(sessionId, \"defaultDir\", \"\");\n var [opsDlg, setOpsDlg] = React.useState(null); // { type, p1, p2, result, busy }\n\n React.useEffect(function () {\n api(\"listWorkspaces\").then(function (r) { if (r && r.ok) setWorkspaces(r.workspaces || []); });\n return subscribeSel(function () { setWsId(sel.workspaceId); });\n }, []);\n\n function load(targetProfile, targetPath) {\n setLoading(true); setErr(null);\n api(\"listDir\", { profileId: targetProfile, path: targetPath }).then(function (r) {\n setLoading(false);\n if (r && r.ok) { setEntries(r.entries || []); setPath(r.path || targetPath); }\n else setErr((r && r.error) || t(\"common.errList\"));\n });\n }\n\n // 工作区/配置选择变化时进入对应目录\n React.useEffect(function () {\n if (!wsId && !profileId) return;\n var pid = profileId;\n var rootPath = \"\";\n if (wsId) {\n var ws = workspaces.find(function (w) { return w.id === wsId; });\n if (ws) { pid = ws.profileId; rootPath = ws.remotePath; }\n }\n if (!pid) return;\n setProfileId(pid);\n load(pid, rootPath || undefined);\n }, [wsId, profileId, workspaces]);\n\n // 选中工作区时,把「默认目录」输入框同步为该工作区的 remotePath。\n React.useEffect(function () {\n if (wsId) {\n var ws = workspaces.find(function (w) { return w.id === wsId; });\n if (ws) setDefaultDir(ws.remotePath || \"\");\n }\n }, [wsId, workspaces]);\n\n function saveDefaultDir() {\n if (!wsId) return;\n api(\"updateWorkspace\", { id: wsId, remotePath: defaultDir }).then(function (r) {\n if (r && r.ok) { setWorkspaces(r.workspaces || []); setErr(null); }\n else setErr((r && r.error) || t(\"files.errSaveDefaultDir\"));\n });\n }\n\n function activeProfileId() {\n if (wsId) {\n var ws = workspaces.find(function (w) { return w.id === wsId; });\n if (ws) return ws.profileId;\n }\n return profileId;\n }\n function opsBase() {\n if (wsId) {\n var ws = workspaces.find(function (w) { return w.id === wsId; });\n if (ws) return ws.remotePath || path || \"~\";\n }\n return path || \"~\";\n }\n function openOps(type) {\n var init = { type: type, p1: \"\", p2: \"\", result: null, busy: false };\n if (type === \"mkdir\") init.p1 = path ? (path.replace(/\\/+$/, \"\") + \"/\") : \"\";\n if (type === \"move\") { init.p1 = path ? (path.replace(/\\/+$/, \"\") + \"/\") : \"\"; init.p2 = path ? (path.replace(/\\/+$/, \"\") + \"/\") : \"\"; }\n if (type === \"delete\") init.p1 = path ? (path.replace(/\\/+$/, \"\") + \"/\") : \"\";\n setOpsDlg(init);\n }\n function patchOps(patch) {\n setOpsDlg(function (d) { var n = {}; for (var k in d) n[k] = d[k]; for (var k2 in patch) n[k2] = patch[k2]; return n; });\n }\n function runOps() {\n if (!opsDlg) return;\n var pid = activeProfileId();\n if (!pid) { patchOps({ result: { ok: false, msg: t(\"ops.fail\") }, busy: false }); return; }\n var base = opsBase();\n var d = opsDlg;\n patchOps({ busy: true, result: null });\n function resolveP(p) {\n if (!p) return p;\n var c = String(p).charAt(0);\n if (c === \"/\" || c === \"~\") return p;\n return base.replace(/\\/+$/, \"\") + \"/\" + p;\n }\n if (d.type === \"grep\") {\n api(\"grep\", { profileId: pid, pattern: d.p1, path: base, include: d.p2 || undefined }).then(function (r) {\n patchOps({ busy: false, result: r });\n });\n } else if (d.type === \"glob\") {\n api(\"glob\", { profileId: pid, pattern: d.p1, path: base }).then(function (r) {\n patchOps({ busy: false, result: r });\n });\n } else if (d.type === \"mkdir\") {\n api(\"mkdir\", { profileId: pid, path: resolveP(d.p1) }).then(function (r) {\n patchOps({ busy: false, result: r });\n if (r && r.ok) { setErr(null); load(pid, path); }\n });\n } else if (d.type === \"move\") {\n api(\"move\", { profileId: pid, src: resolveP(d.p1), dst: resolveP(d.p2) }).then(function (r) {\n patchOps({ busy: false, result: r });\n if (r && r.ok) { setErr(null); load(pid, path); }\n });\n } else if (d.type === \"delete\") {\n api(\"deleteFile\", { profileId: pid, path: resolveP(d.p1) }).then(function (r) {\n patchOps({ busy: false, result: r });\n if (r && r.ok) { setErr(null); load(pid, path); }\n });\n }\n }\n\n function openEntry(e) {\n var base = path ? (path.replace(/\\/+$/, \"\") + \"/\" + e.name) : e.name;\n if (e.type === \"directory\") {\n setPath(base);\n load(profileId, base);\n } else {\n // 用独立页签预览远程文件(与内置「文件」页签一致),而非在文件树下方预览。\n if (betterSidebar && betterSidebar.openTab) {\n betterSidebar.openTab({\n type: \"remssh:editor\",\n id: \"remssh:editor:\" + profileId + \":\" + base,\n title: e.name,\n path: base,\n meta: { profileId: profileId, remotePath: base }\n }, { sessionId: sessionId });\n }\n }\n }\n\n function goUp() {\n if (!path) return;\n var parts = path.replace(/\\/+$/, \"\").split(\"/\");\n parts.pop();\n var up = parts.join(\"/\") || \"/\";\n setPath(up);\n load(profileId, up);\n }\n\n return h(\"div\", { style: { display: \"flex\", flexDirection: \"column\", flex: 1, minHeight: 0, overflow: \"hidden\" } },\n h(\"div\", { style: { flex: \"none\" } },\n h(\"div\", { className: \"rssh-row\" },\n h(\"span\", { className: \"rssh-label\" }, t(\"files.workspace\")),\n h(\"select\", { className: \"rssh-select\", value: wsId || \"\", onChange: function (e) { setWsId(e.target.value); setProfileId(\"\"); } },\n h(\"option\", { value: \"\" }, t(\"files.selectWorkspace\")),\n workspaces.map(function (w) { return h(\"option\", { key: w.id, value: w.id }, w.title); })\n )\n ),\n h(\"div\", { className: \"rssh-row\" },\n h(\"span\", { className: \"rssh-label\" }, t(\"files.orProfile\")),\n h(\"select\", { className: \"rssh-select\", value: profileId, onChange: function (e) { setProfileId(e.target.value); setWsId(\"\"); } },\n h(\"option\", { value: \"\" }, t(\"common.selectProfile\")),\n profiles.map(function (p) { return h(\"option\", { key: p.id, value: p.id }, p.name); })\n )\n ),\n wsId ? h(\"div\", { className: \"rssh-row\" },\n h(\"span\", { className: \"rssh-label\" }, t(\"files.defaultDir\")),\n h(\"div\", { className: \"rssh-pathbar\" },\n h(\"input\", { className: \"rssh-input\", value: defaultDir, onChange: function (e) { setDefaultDir(e.target.value); }, placeholder: \"/home/user/project\" }),\n h(\"button\", { className: \"rssh-btn\", onClick: saveDefaultDir }, t(\"common.save\"))\n )\n ) : null,\n h(\"div\", { className: \"rssh-pathbar\" },\n h(\"input\", { className: \"rssh-input\", value: path, onChange: function (e) { setPath(e.target.value); }, placeholder: \"/home/user\" }),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { load(profileId, path); } }, t(\"common.open\")),\n h(\"button\", { className: \"rssh-btn\", onClick: goUp }, t(\"common.up\"))\n ),\n wsId ? h(\"div\", { className: \"rssh-pathbar\", style: { flexWrap: \"wrap\" } },\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"grep\"); } }, t(\"ops.search\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"glob\"); } }, t(\"ops.find\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"mkdir\"); } }, t(\"ops.newDir\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"move\"); } }, t(\"ops.rename\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"delete\"); } }, t(\"ops.delete\"))\n ) : (wsId || profileId) ? h(\"div\", { className: \"rssh-pathbar\", style: { flexWrap: \"wrap\" } },\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"grep\"); } }, t(\"ops.search\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"glob\"); } }, t(\"ops.find\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"mkdir\"); } }, t(\"ops.newDir\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"move\"); } }, t(\"ops.rename\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"delete\"); } }, t(\"ops.delete\"))\n ) : null,\n loading ? h(\"div\", { className: \"rssh-muted\" }, t(\"common.loading\")) : null,\n err ? h(\"div\", { className: \"rssh-err\", style: { whiteSpace: \"pre-wrap\" } }, err) : null,\n opsDlg ? h(OpsModal, { opsDlg: opsDlg, patchOps: patchOps, runOps: runOps, close: function () { setOpsDlg(null); }, t: t }) : null\n ),\n h(\"div\", { style: { flex: 1, minHeight: 0, overflowY: \"auto\", marginTop: 6 } },\n entries.map(function (e) {\n return h(\"div\", { key: e.name, className: \"rssh-tree-item\", onClick: function () { openEntry(e); } },\n h(\"span\", { className: e.type === \"directory\" ? \"rssh-tree-dir\" : \"rssh-tree-file\" }, e.type === \"directory\" ? \"📁 \" + e.name : \"📄 \" + e.name),\n e.type === \"file\" ? h(\"span\", { className: \"rssh-tree-size\" }, String(e.size)) : null\n );\n })\n )\n );\n }\n\n // ======================================================================\n // 远程文件编辑器页签:点击文件树中的文件后单开一栏预览/编辑(与内置「文件」页签一致)\n // ======================================================================\n function RemoteEditor(props) {\n var t = useT();\n var tab = props.tab || {};\n var ctx = props.ctx;\n var meta = tab.meta || {};\n var profileId = meta.profileId || \"\";\n var remotePath = tab.path || meta.remotePath || \"\";\n var [data, setData] = React.useState({ loading: true, content: \"\", binary: false, dirty: false, error: null });\n\n React.useEffect(function () {\n var alive = true;\n setData({ loading: true, content: \"\", binary: false, dirty: false, error: null });\n api(\"readFile\", { profileId: profileId, path: remotePath }).then(function (r) {\n if (!alive) return;\n if (r && r.ok) setData({ loading: false, content: r.content || \"\", binary: !!r.binary, dirty: false, error: null });\n else setData({ loading: false, content: \"\", binary: false, dirty: false, error: (r && r.error) || t(\"files.errRead\") });\n });\n return function () { alive = false; };\n }, [profileId, remotePath]);\n\n function save() {\n api(\"writeFile\", { profileId: profileId, path: remotePath, content: data.content }).then(function (r) {\n if (r && r.ok) setData(Object.assign({}, data, { dirty: false, error: null }));\n else setData(Object.assign({}, data, { error: (r && r.error) || t(\"files.errSave\") }));\n });\n }\n\n function close() {\n if (ctx && ctx.betterSidebar && tab.id) ctx.betterSidebar.closeTab(tab.id);\n }\n\n if (data.loading) return h(\"div\", { className: \"rssh-muted\", style: { padding: 8 } }, t(\"files.reading\"));\n if (data.error) return h(\"div\", { className: \"rssh-err\", style: { padding: 8, whiteSpace: \"pre-wrap\" } }, data.error);\n if (data.binary) return h(\"div\", { className: \"rssh-muted\", style: { padding: 8 } }, t(\"files.binary\"));\n\n return h(\"div\", { style: { display: \"flex\", flexDirection: \"column\", flex: 1, minHeight: 0, padding: 8, overflow: \"hidden\" } },\n h(\"div\", { className: \"rssh-pathbar\", style: { flex: \"none\" } },\n h(\"span\", { className: \"rssh-title\", style: { flex: 1, wordBreak: \"break-all\" } }, remotePath),\n h(\"button\", { className: \"rssh-btn\", onClick: save }, t(\"common.save\")),\n h(\"button\", { className: \"rssh-btn\", onClick: close }, t(\"common.close\"))\n ),\n h(\"textarea\", { className: \"rssh-content\", style: { flex: 1, minHeight: 0, maxHeight: \"none\", width: \"100%\", boxSizing: \"border-box\", background: \"var(--dsw-alias-markdown-code-block)\", color: \"var(--dsw-alias-label-primary)\", border: \"1px solid var(--dsw-alias-border-l2)\" },\n value: data.content, onChange: function (e) { setData(Object.assign({}, data, { content: e.target.value, dirty: true })); } })\n );\n }\n\n // ======================================================================\n // 远程终端页签\n // ======================================================================\n function TerminalView(props) {\n var t = useT();\n var [data, setData] = React.useState(\"\");\n var [status, setStatus] = React.useState(\"running\");\n var [input, setInput] = React.useState(\"\");\n var endRef = React.useRef(null);\n\n React.useEffect(function () {\n var timer = setInterval(function () {\n api(\"terminalRead\", { id: props.id }).then(function (r) {\n if (r && r.ok) {\n if (r.data) setData(function (d) { return d + r.data; });\n if (r.status) setStatus(r.status);\n }\n });\n }, 200);\n return function () { clearInterval(timer); };\n }, [props.id]);\n\n React.useEffect(function () {\n if (endRef.current) endRef.current.scrollTop = endRef.current.scrollHeight;\n }, [data]);\n\n function send() {\n if (!input) return;\n api(\"terminalWrite\", { id: props.id, data: input + \"\\r\" });\n setInput(\"\");\n }\n\n return h(\"div\", { className: \"rssh-terminal\" },\n h(\"div\", { className: \"rssh-terminal-bar\" },\n h(\"span\", { style: { flex: 1, color: status === \"running\" ? \"var(--dsw-alias-state-success-primary)\" : \"var(--dsw-alias-state-error-primary)\" } }, t(\"term.title\", { id: props.id }) + (status === \"exited\" ? t(\"term.exited\") : \"\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { props.onClose(props.id); } }, t(\"common.close\"))\n ),\n h(\"div\", { className: \"rssh-terminal-out\", ref: endRef }, data || (status === \"running\" ? t(\"term.connecting\") : t(\"term.noOutput\"))),\n h(\"div\", { className: \"rssh-terminal-input-row\" },\n h(\"input\", { className: \"rssh-input\", value: input,\n onChange: function (e) { setInput(e.target.value); },\n onKeyDown: function (e) { if (e.key === \"Enter\") send(); },\n placeholder: t(\"term.inputPlaceholder\") }),\n h(\"button\", { className: \"rssh-btn\", onClick: send }, t(\"term.send\"))\n )\n );\n }\n\n function TerminalTab(props) {\n var t = useT();\n var sessionId = props.sessionId;\n var profiles = useProfiles();\n var [profileId, setProfileId] = useSessionMemory(sessionId, \"profileId\", \"\");\n var [terms, setTerms] = useSessionMemory(sessionId, \"terms\", []);\n var [err, setErr] = React.useState(null);\n\n function spawn() {\n if (!profileId) { setErr(t(\"term.needProfile\")); return; }\n setErr(null);\n api(\"spawnTerminal\", { profileId: profileId }).then(function (r) {\n if (r && r.ok) setTerms(function (list) { return list.concat([{ id: r.id }]); });\n else setErr((r && r.error) || t(\"term.errSpawn\"));\n });\n }\n\n function close(id) {\n api(\"terminalClose\", { id: id });\n setTerms(function (list) { return list.filter(function (x) { return x.id !== id; }); });\n }\n\n return h(\"div\", null,\n h(\"div\", { className: \"rssh-row\" },\n h(\"span\", { className: \"rssh-label\" }, t(\"common.profile\")),\n h(\"select\", { className: \"rssh-select\", value: profileId, onChange: function (e) { setProfileId(e.target.value); } },\n h(\"option\", { value: \"\" }, t(\"common.selectProfile\")),\n profiles.map(function (p) { return h(\"option\", { key: p.id, value: p.id }, p.name); })\n )\n ),\n h(\"button\", { className: \"rssh-btn\", onClick: spawn }, t(\"term.newTerminal\")),\n err ? h(\"div\", { className: \"rssh-err\", style: { marginTop: 6 } }, err) : null,\n terms.length === 0 ? h(\"div\", { className: \"rssh-empty\" }, t(\"term.emptyHint\")) : null,\n terms.map(function (term) { return h(TerminalView, { key: term.id, id: term.id, onClose: close }); })\n );\n }\n\n // ======================================================================\n // 目录选择器(供「添加工作区」弹窗流程使用:本地 browse / 远程 SSH)\n // ======================================================================\n // 本地目录列举:走 DSH browse 能力(无原生对话框时替代 pickDirectory)。\n function localListFn(workspaces, p) {\n // 走 better-sidebar 的 fs.tree 端点(已被本插件拦截,本地工作区走本地 fs)\n // 不依赖 workspaces.listDirectory(需要 browse capability,可能被禁用)\n return fetch(\"/sidebar/api/fs.tree\", {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify({ sessionId: \"\", path: p || \"\" })\n }).then(function (r) { return r.json(); }).then(function (j) {\n if (!j || !j.ok) return { ok: false, error: (j && j.error && j.error.message) || \"list failed\" };\n var v = j.value || {};\n return {\n ok: true,\n path: v.path || p || \"\",\n entries: (v.entries || []).filter(function (e) { return e.isDir; }).map(function (e) { return { name: e.name, type: \"directory\", path: e.path }; })\n };\n }).catch(function (e) {\n return { ok: false, error: String(e && e.message ? e.message : e) };\n });\n }\n\n // 远程目录列举:走本插件 SSH API,并为每条记录补全绝对 path。\n function remoteListFn(profileId, p) {\n return api(\"listDir\", { profileId: profileId, path: p }).then(function (r) {\n if (!(r && r.ok)) return r;\n var parent = r.path || \"\";\n var entries = (r.entries || []).map(function (e) {\n return { name: e.name, type: e.type, path: (parent ? parent.replace(/\\/+$/, \"\") + \"/\" : \"\") + e.name };\n });\n return { ok: true, path: r.path, entries: entries };\n });\n }\n\n // 计算父目录,兼容 Windows(\\\\) 与 POSIX(/) 分隔符。\n function parentOf(path) {\n if (!path) return null;\n var str = String(path).replace(/[\\/\\\\]+$/, \"\");\n if (str === \"\") return null;\n var idx = Math.max(str.lastIndexOf(\"/\"), str.lastIndexOf(\"\\\\\"));\n if (idx < 0) return null;\n var parent = str.slice(0, idx);\n if (/^[A-Za-z]:$/.test(parent)) return parent + \"\\\\\";\n if (parent === \"\") return \"/\";\n return parent;\n }\n\n // 新建目录名校验(issue #11):返回 i18n 键,合法则返回 null。\n // 只接受单个路径段——分隔符会让「在 path 下新建」变成任意位置写入。\n function newDirNameError(name) {\n var s = String(name == null ? \"\" : name).trim();\n if (!s) return \"picker.errNameEmpty\";\n if (s === \".\" || s === \"..\") return \"picker.errNameBad\";\n if (s.indexOf(\"/\") >= 0 || s.indexOf(\"\\\\\") >= 0) return \"picker.errNameBad\";\n return null;\n }\n\n // 把子目录名拼到基路径之后:沿用基路径的分隔符(Windows 反斜杠 / POSIX 斜杠),\n // 并保留根路径语义(\"/\" + name、\"C:\\\" + name)。\n function joinChild(base, name) {\n var raw = String(base == null ? \"\" : base);\n var b = raw.replace(/[\\/\\\\]+$/, \"\");\n if (!b) return (raw.charAt(0) === \"/\" ? \"/\" : \"\") + String(name);\n var sep = (b.indexOf(\"\\\\\") >= 0 && b.indexOf(\"/\") < 0) || /^[A-Za-z]:$/.test(b) ? \"\\\\\" : \"/\";\n return b + sep + String(name);\n }\n\n // 通用目录选择器:listFn(path) 返回 {ok, path, entries:[{name,type,path}]}。\n // resetKey 变化(如远程切换连接)时从根目录重新加载。\n // createFn(path, name)(可选):在当前目录下新建子目录,远程/本地由调用方分流(issue #11)。\n function DirPicker(props) {\n var t = useT();\n var [path, setPath] = React.useState(\"\");\n var [entries, setEntries] = React.useState([]);\n var [err, setErr] = React.useState(null);\n var [loading, setLoading] = React.useState(false);\n var [newDir, setNewDir] = React.useState(null); // { name, busy, error } | null\n\n var listFnRef = React.useRef(props.listFn);\n listFnRef.current = props.listFn;\n\n function load(p) {\n setLoading(true); setErr(null);\n listFnRef.current(p).then(function (r) {\n setLoading(false);\n if (r && r.ok) { setEntries(r.entries || []); setPath(r.path || p || \"\"); }\n else setErr((r && r.error) || t(\"common.errList\"));\n });\n }\n React.useEffect(function () { load(undefined); }, [props.resetKey]);\n\n function enterDir(e) { load(e.path); }\n function goUp() {\n var up = parentOf(path);\n if (up !== null) load(up);\n }\n\n // 打开按钮:按输入框路径加载该路径下的文件树。空路径时打开主目录。\n function open() {\n load(path || undefined);\n }\n\n // 在当前 path 下新建子目录(远程/本地由 createFn 分流),成功后进入该目录,\n // 便于紧接着点「选择此目录」——对齐 VSCode「新建文件夹」的交互预期(issue #11)。\n function submitNewDir() {\n if (!newDir || !props.createFn) return;\n var name = String(newDir.name || \"\").trim();\n var invalid = newDirNameError(name);\n if (invalid) { setNewDir({ name: name, busy: false, error: t(invalid) }); return; }\n setNewDir({ name: name, busy: true, error: null });\n Promise.resolve(props.createFn(path, name)).then(function (r) {\n if (r && r.ok) {\n setNewDir(null);\n load((r && r.path) || joinChild(path, name));\n } else {\n setNewDir({ name: name, busy: false, error: (r && r.error) || t(\"common.errList\") });\n }\n }).catch(function (e) {\n setNewDir({ name: name, busy: false, error: String(e && e.message ? e.message : e) });\n });\n }\n\n // 路径栏:输入框(回车导航)+ 打开按钮(紧挨在右侧)+ 上级\n return h(\"div\", null,\n h(\"div\", { className: \"rssh-pathbar\" },\n h(\"input\", { className: \"rssh-input\", value: path,\n onChange: function (e) { setPath(e.target.value); },\n onKeyDown: function (e) { if (e.key === \"Enter\") { e.preventDefault(); open(); } },\n placeholder: props.placeholder || t(\"picker.dir\") }),\n h(\"button\", { className: \"rssh-btn\", onClick: open, disabled: loading }, t(\"common.open\")),\n h(\"button\", { className: \"rssh-btn\", onClick: goUp }, t(\"common.up\"))\n ),\n // 新建目录输入行(点底部「新建目录」按钮后出现)\n newDir ? h(\"div\", { className: \"rssh-pathbar\", style: { marginTop: 6 } },\n h(\"input\", { className: \"rssh-input\", value: newDir.name, autoFocus: true,\n placeholder: t(\"ops.newDirPh\"),\n onChange: function (e) { setNewDir({ name: e.target.value, busy: false, error: null }); },\n onKeyDown: function (e) { if (e.key === \"Enter\") { e.preventDefault(); submitNewDir(); } } }),\n h(\"button\", { className: \"rssh-btn\", onClick: submitNewDir, disabled: newDir.busy }, newDir.busy ? t(\"common.processing\") : t(\"common.save\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { setNewDir(null); }, disabled: newDir.busy }, t(\"common.close\"))\n ) : null,\n newDir && newDir.error ? h(\"div\", { className: \"rssh-err\" }, newDir.error) : null,\n loading ? h(\"div\", { className: \"rssh-muted\" }, t(\"common.loading\")) : null,\n err ? h(\"div\", { className: \"rssh-err\" }, err) : null,\n // 当前路径下的文件树(仅目录可进入)\n h(\"div\", { className: \"rssh-pick-tree\" },\n (entries.filter(function (e) { return e.type === \"directory\"; })).length === 0 && !loading\n ? h(\"div\", { className: \"rssh-pick-empty\" }, t(\"common.noEntries\"))\n : entries.filter(function (e) { return e.type === \"directory\"; }).map(function (e) {\n return h(\"div\", { key: e.path || e.name, className: \"rssh-tree-item\", onClick: function () { enterDir(e); } },\n h(\"span\", { className: \"rssh-tree-dir\" }, \"📁 \" + e.name));\n })\n ),\n h(\"div\", { className: \"rssh-actions\", style: { marginTop: 8 } },\n h(\"button\", { className: \"rssh-btn\", disabled: !path || props.disabled, onClick: function () { props.onChoose(path); } }, t(\"picker.choose\")),\n props.createFn ? h(\"button\", { className: \"rssh-btn\",\n disabled: !path || loading || props.disabled || !!(newDir && newDir.busy),\n onClick: function () { setNewDir({ name: \"\", busy: false, error: null }); } }, t(\"ops.newDir\")) : null\n )\n );\n }\n\n function RemoteWorkspaceFlow(props) {\n var t = useT();\n var [mode, setMode] = React.useState(\"local\");\n var profiles = useProfiles(props.open);\n var [profileId, setProfileId] = React.useState(\"\");\n var [creating, setCreating] = React.useState(false);\n // 同步范围(issue #28 第 2 条):建区时就能定,留空 = 全局默认(再留空 = 整树)。\n var [syncPaths, setSyncPaths] = React.useState(\"\");\n\n // 每次打开流程时重置为「本地目录」起始界面。\n React.useEffect(function () {\n if (props.open) { setMode(\"local\"); setProfileId(\"\"); setSyncPaths(\"\"); }\n }, [props.open]);\n\n if (!props.open) return null;\n\n function chooseLocal(p) { props.onPicked(p); }\n\n function chooseRemote(remotePath) {\n setCreating(true);\n // 同步范围(issue #28):非空才传,空 = 让宿主用「全局默认」兜底(再空 = 整树)\n var payload = { profileId: profileId, remotePath: remotePath };\n var scope = splitList(syncPaths);\n if (scope.length) payload.syncPaths = scope;\n api(\"createRemoteWorkspace\", payload).then(function (r) {\n setCreating(false);\n if (r && r.ok && r.mirrorPath) props.onPicked(r.mirrorPath);\n else props.onError((r && r.error) || t(\"flow.errCreate\"));\n });\n }\n\n var canClose = !creating && !props.busy;\n var isRemote = mode === \"remote\";\n\n // 统一弹窗:上方本地/远程分段切换 → 远程时显示连接选择 → 路径栏(浏览按钮紧挨右侧)→ 文件树\n return h(Modal, { open: true, onClose: function () { if (canClose) props.onCancel(); }, title: t(\"flow.addWsTitle\"), closeLabel: t(\"common.close\"), className: \"rssh-flow-dialog\" },\n h(\"div\", { style: { padding: 8 } },\n creating || props.busy ? h(\"div\", { className: \"rssh-muted\" }, t(\"common.processing\")) : null,\n // 分段切换:本地 / 远程\n h(\"div\", { className: \"rssh-seg\" },\n h(\"button\", { className: \"rssh-seg-btn\" + (isRemote ? \"\" : \" active\"), onClick: function () { setMode(\"local\"); }, disabled: !!props.busy || creating }, t(\"flow.localSeg\")),\n h(\"button\", { className: \"rssh-seg-btn\" + (isRemote ? \" active\" : \"\"), onClick: function () { setMode(\"remote\"); }, disabled: !!props.busy || creating }, t(\"flow.remoteSeg\"))\n ),\n // 远程模式:连接配置选择\n isRemote ? h(\"div\", { className: \"rssh-row\" },\n h(\"span\", { className: \"rssh-label\" }, t(\"common.profile\")),\n h(\"select\", { className: \"rssh-select\", value: profileId, onChange: function (e) { setProfileId(e.target.value); }, disabled: creating },\n h(\"option\", { value: \"\" }, t(\"common.selectProfile\")),\n profiles.map(function (p) { return h(\"option\", { key: p.id, value: p.id }, p.name); })\n )\n ) : null,\n // 远程模式:同步范围(issue #28 第 2 条)——留空走全局默认,避免建完再手工补一遍\n isRemote ? Field({ label: t(\"flow.syncPaths\"), value: syncPaths, onChange: setSyncPaths, placeholder: \".dsh\" }) : null,\n // 目录选择器:远程需选好连接后才显示。\n // createFn:在当前目录下新建子目录(远程走 SSH 的 mkdir -p,本地走宿主 mkdirLocal),\n // 两个 tab 都提供——新建远程项目目录是本 issue 的痛点,本地顺手补齐(issue #11)。\n isRemote\n ? (profileId ? h(DirPicker, { resetKey: profileId, placeholder: t(\"flow.remoteDir\"),\n listFn: function (p) { return remoteListFn(profileId, p); },\n createFn: function (p, name) {\n var target = joinChild(p, name);\n return api(\"mkdir\", { profileId: profileId, path: target }).then(function (r) {\n return (r && r.ok) ? { ok: true, path: target } : { ok: false, error: (r && r.error) || t(\"flow.errMkdir\") };\n });\n },\n onChoose: chooseRemote, disabled: creating })\n : h(\"div\", { className: \"rssh-pick-empty\" }, t(\"common.selectProfile\")))\n : h(DirPicker, { resetKey: \"local\", placeholder: t(\"flow.localDir\"),\n listFn: function (p) { return localListFn(props.workspaces, p); },\n createFn: function (p, name) {\n var target = joinChild(p, name);\n return api(\"mkdirLocal\", { path: target }).then(function (r) {\n return (r && r.ok) ? { ok: true, path: target } : { ok: false, error: (r && r.error) || t(\"flow.errMkdir\") };\n });\n },\n onChoose: chooseLocal })\n )\n );\n }\n\n // ======================================================================\n // 设置页小节(连接配置管理)\n // ======================================================================\n function SettingsSection(props) {\n var t = useT();\n var [profiles, setProfiles] = React.useState([]);\n var [workspaces, setWorkspaces] = React.useState([]);\n var [form, setForm] = React.useState({ name: \"\", host: \"\", port: \"22\", user: \"\", authMethod: \"key\", keyPath: \"\", password: \"\", remoteRoot: \"~\", proxyJump: \"\" });\n var [result, setResult] = React.useState(null);\n var [busy, setBusy] = React.useState(false);\n var [importDlg, setImportDlg] = React.useState(null);\n // 进阶设置(issue #23/#24 的可达性):nodePath / writeBackFailure / writeBackFreshness\n // + issue #28 的全局默认同步范围(新建工作区时取作初始值)\n var [prefs, setPrefs] = React.useState(prefsForUi(null));\n var [guards, setGuards] = React.useState({}); // wsId → { writeBack, exclude, syncPaths, syncExclude, syncMaxBytes }\n var [prefsMsg, setPrefsMsg] = React.useState(null);\n // 正在同步/推送的工作区 id:同一个工作区的两个按钮在此期间都禁用 —— 两次 syncDown 并发\n // 会在同一镜像目录里各解一份临时树,纯属自己跟自己抢\n var [syncId, setSyncId] = React.useState(\"\");\n var set = function (k, v) { setForm(function (f) { var n = {}; for (var key in f) n[key] = f[key]; n[k] = v; return n; }); };\n var setPref = function (k, v) { setPrefs(function (p) { var n = {}; for (var key in p) n[key] = p[key]; n[k] = v; return n; }); };\n var setGuard = function (id, k, v) { setGuards(function (g) { var n = {}; for (var key in g) n[key] = g[key]; n[id] = Object.assign({}, n[id] || {}, { [k]: v }); return n; }); };\n\n function reload() {\n api(\"listProfiles\").then(function (r) { if (r && r.ok) setProfiles(r.profiles || []); });\n api(\"listWorkspaces\").then(function (r) {\n if (!r || !r.ok) return;\n var list = r.workspaces || [];\n setWorkspaces(list);\n var g = {};\n list.forEach(function (w) {\n g[w.id] = {\n writeBack: w.writeBack !== false,\n exclude: (w.writeBackExclude || []).join(\", \"),\n // 同步范围(issue #28):整树同步的排除、只同步的子路径、体积上限\n syncPaths: (w.syncPaths || []).join(\", \"),\n syncExclude: (w.syncExclude || []).join(\", \"),\n syncMaxBytes: bytesToGibText(w.syncMaxBytes)\n };\n });\n setGuards(g);\n });\n api(\"getPrefs\").then(function (r) { if (r && r.ok && r.prefs) setPrefs(prefsForUi(r.prefs)); });\n }\n React.useEffect(reload, []);\n\n /** 保存全局偏好(nodePath 是 #23 的逃生舱,writeBack* 是 #24 的开关,defaultSync* 是 #28 的默认范围)。 */\n function savePrefs() {\n setPrefsMsg(null);\n api(\"savePrefs\", {\n nodePath: String(prefs.nodePath || \"\"),\n writeBackFailure: String(prefs.writeBackFailure || \"error\"),\n writeBackFreshness: prefs.writeBackFreshness !== false,\n // 默认同步范围(issue #28):空 = 整树(旧行为)\n defaultSyncPaths: splitList(prefs.defaultSyncPaths),\n defaultSyncExclude: splitList(prefs.defaultSyncExclude),\n defaultSyncMaxBytes: gibTextToBytes(prefs.defaultSyncMaxBytes)\n }).then(function (r) {\n if (r && r.ok) { if (r.prefs) setPrefs(prefsForUi(r.prefs)); setPrefsMsg({ ok: true, msg: t(\"settings.saved\") }); }\n else setPrefsMsg({ ok: false, msg: (r && r.error) || t(\"settings.errSave\") });\n });\n }\n\n /** 保存单个工作区的写回护栏 + 同步范围(issue #24 护栏 A / issue #28)。 */\n function saveGuard(ws) {\n var g = guards[ws.id] || { writeBack: true, exclude: \"\", syncPaths: \"\", syncExclude: \"\", syncMaxBytes: \"\" };\n setPrefsMsg(null);\n api(\"updateWorkspaceGuards\", {\n id: ws.id,\n writeBack: g.writeBack !== false,\n writeBackExclude: splitList(g.exclude),\n // 同步范围(issue #28):空数组 = 整树(旧行为)\n syncPaths: splitList(g.syncPaths),\n syncExclude: splitList(g.syncExclude),\n syncMaxBytes: gibTextToBytes(g.syncMaxBytes)\n }).then(function (r) {\n if (r && r.ok) {\n setWorkspaces(r.workspaces || []);\n reload();\n setPrefsMsg({ ok: true, msg: t(\"settings.saved\") });\n } else setPrefsMsg({ ok: false, msg: (r && r.error) || t(\"settings.errSave\") });\n });\n }\n\n /** 手动同步(issue #28 第 4 条):复用已有的 syncDown / syncUp 端点,走该工作区的持久化范围。 */\n function runSync(ws, action) {\n if (syncId) return; // 已有同步在跑:别让两次同步在同一镜像目录里抢\n var down = action === \"syncDown\";\n setSyncId(ws.id);\n setPrefsMsg({ ok: true, msg: t(down ? \"sync.syncing\" : \"sync.pushing\") });\n api(action, { id: ws.id }).then(function (r) {\n setSyncId(\"\");\n if (r && r.ok) setPrefsMsg({ ok: true, msg: t(down ? \"sync.done\" : \"sync.upDone\") });\n else setPrefsMsg({ ok: false, msg: t(down ? \"sync.fail\" : \"sync.upFail\") + ((r && r.error) || \"\") });\n });\n }\n\n function profileName(id) {\n var p = profiles.find(function (x) { return x.id === id; });\n return p ? p.name : id;\n }\n function delWs(wsId) {\n api(\"deleteWorkspace\", { id: wsId }).then(function (r) { if (r && r.ok) setWorkspaces(r.workspaces || []); });\n }\n\n function save() {\n setBusy(true); setResult(null);\n api(\"saveProfile\", Object.assign({}, form, { port: parseInt(form.port, 10) || 22 })).then(function (r) {\n setBusy(false);\n if (r && r.ok) {\n setProfiles(r.profiles || []);\n setForm({ name: \"\", host: \"\", port: \"22\", user: \"\", authMethod: \"key\", keyPath: \"\", password: \"\", remoteRoot: \"~\", proxyJump: \"\" });\n setResult({ ok: true, msg: t(\"settings.saved\") });\n } else setResult({ ok: false, msg: (r && r.error) || t(\"settings.errSave\") });\n });\n }\n function test(p) {\n setBusy(true); setResult(null);\n api(\"testConnection\", { id: p.id }).then(function (r) {\n setBusy(false);\n if (r && r.ok) setResult({ ok: true, msg: t(\"settings.connOk\") + \"\\n\" + (r.warning ? r.warning + \"\\n\" : \"\") + (r.stdout || \"\") });\n else setResult({ ok: false, msg: t(\"settings.connFail\") + ((r && r.error) || (r && r.stderr) || \"\") });\n });\n }\n function del(p) {\n api(\"deleteProfile\", { id: p.id }).then(function (r) { if (r && r.ok) { setProfiles(r.profiles || []); } });\n }\n\n function openImport() {\n setImportDlg({ loading: true, hosts: [], selected: {} });\n api(\"listSshConfigHosts\").then(function (r) {\n if (r && r.ok) {\n var hosts = r.hosts || [];\n var sel = {};\n hosts.forEach(function (h) { sel[h.name + \"|\" + h.hostName] = true; });\n setImportDlg({ loading: false, hosts: hosts, selected: sel });\n } else {\n setImportDlg({ loading: false, hosts: [], selected: {}, error: (r && r.error) || t(\"settings.noneFound\") });\n }\n });\n }\n function toggleImport(key) {\n setImportDlg(function (d) {\n var sel = {}; for (var k in d.selected) sel[k] = d.selected[k];\n sel[key] = !sel[key];\n return Object.assign({}, d, { selected: sel });\n });\n }\n function doImport() {\n if (!importDlg) return;\n var picked = importDlg.hosts.filter(function (h) { return importDlg.selected[h.name + \"|\" + h.hostName]; });\n setBusy(true);\n var i = 0;\n function next() {\n if (i >= picked.length) {\n setBusy(false); setImportDlg(null);\n setResult({ ok: true, msg: t(\"settings.imported\").replace(\"{n}\", String(picked.length)) });\n reload();\n return;\n }\n var h = picked[i++];\n api(\"saveProfile\", {\n name: h.name, host: h.hostName, port: h.port || 22, user: h.user || \"\",\n authMethod: \"key\", keyPath: h.identityFile || \"\", password: \"\", remoteRoot: \"~\", proxyJump: h.proxyJump || \"\"\n }).then(next);\n }\n next();\n }\n\n return h(\"div\", null,\n h(\"p\", { className: \"rssh-muted\" }, t(\"settings.desc\")),\n profiles.map(function (p) {\n return h(\"div\", { key: p.id, className: \"rssh-card\" },\n h(\"div\", { className: \"rssh-title\" }, p.name),\n h(\"div\", { className: \"rssh-sub\" }, (p.user || \"\") + \"@\" + (p.host || \"\") + \":\" + (p.port || 22) + \" [\" + (p.authMethod || \"key\") + \"]\"),\n h(\"div\", { className: \"rssh-actions\" },\n h(\"button\", { className: \"rssh-btn\", onClick: function () { test(p); }, disabled: busy }, t(\"settings.test\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { del(p); } }, t(\"common.delete\"))\n )\n );\n }),\n profiles.length === 0 ? h(\"div\", { className: \"rssh-empty\" }, t(\"settings.empty\")) : null,\n workspaces.length > 0 ? h(\"div\", { className: \"rssh-card\" },\n h(\"div\", { className: \"rssh-title\" }, t(\"settings.workspaces\")),\n workspaces.map(function (ws) {\n var g = guards[ws.id] || { writeBack: true, exclude: \"\", syncPaths: \"\", syncExclude: \"\", syncMaxBytes: \"\" };\n return h(\"div\", { key: ws.id, className: \"rssh-card\", style: { marginBottom: 6 } },\n h(\"div\", { className: \"rssh-title\" }, ws.title || ws.id),\n h(\"div\", { className: \"rssh-sub\" }, profileName(ws.profileId) + \" → \" + (ws.remotePath || \"\")),\n h(\"label\", { className: \"rssh-tree-item\", style: { cursor: \"pointer\" } },\n h(\"input\", { type: \"checkbox\", checked: g.writeBack !== false, onChange: function (e) { setGuard(ws.id, \"writeBack\", !!e.target.checked); } }),\n h(\"span\", null, t(\"settings.wsWriteBack\"))\n ),\n Field({ label: t(\"settings.wsWriteBackExclude\"), value: g.exclude, onChange: function (v) { setGuard(ws.id, \"exclude\", v); }, placeholder: \"_patch/, *.log, wbdeep/**\" }),\n // 同步范围(issue #28):后端早就支持、GUI 一直没有入口 —— 结果每个新工作区\n // 都退化成整树同步,remotePath 是 ~ 的工作区直接被体积哨兵拒绝。\n h(\"div\", { className: \"rssh-muted\", style: { marginTop: 6 } }, t(\"settings.syncScopeHint\")),\n Field({ label: t(\"settings.wsSyncPaths\"), value: g.syncPaths, onChange: function (v) { setGuard(ws.id, \"syncPaths\", v); }, placeholder: \".dsh\" }),\n Field({ label: t(\"settings.wsSyncExclude\"), value: g.syncExclude, onChange: function (v) { setGuard(ws.id, \"syncExclude\", v); }, placeholder: \"data/, *.log\" }),\n Field({ label: t(\"settings.wsSyncMaxBytes\"), value: g.syncMaxBytes, onChange: function (v) { setGuard(ws.id, \"syncMaxBytes\", v); }, placeholder: \"2\" }),\n h(\"div\", { className: \"rssh-actions\" },\n h(\"button\", { className: \"rssh-btn\", onClick: function () { saveGuard(ws); } }, t(\"settings.saveGuards\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { runSync(ws, \"syncDown\"); }, disabled: !!syncId }, t(\"sync.down\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { runSync(ws, \"syncUp\"); }, disabled: !!syncId }, t(\"sync.up\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { delWs(ws.id); } }, t(\"common.delete\"))\n )\n );\n })\n ) : null,\n h(\"div\", { className: \"rssh-card\" },\n h(\"div\", { className: \"rssh-title\" }, t(\"settings.guards\")),\n h(\"div\", { className: \"rssh-muted\" }, t(\"settings.guardsHint\")),\n Field({ label: t(\"settings.nodePath\"), value: prefs.nodePath, onChange: function (v) { setPref(\"nodePath\", v); }, placeholder: \"C:\\\\Program Files\\\\nodejs\\\\node.exe\" }),\n h(\"div\", { className: \"rssh-row\" },\n h(\"span\", { className: \"rssh-label\" }, t(\"settings.writeBackFailure\")),\n h(\"select\", { className: \"rssh-select\", value: prefs.writeBackFailure || \"error\", onChange: function (e) { setPref(\"writeBackFailure\", e.target.value); } },\n h(\"option\", { value: \"error\" }, t(\"settings.wbError\")),\n h(\"option\", { value: \"log\" }, t(\"settings.wbLog\"))\n )\n ),\n h(\"label\", { className: \"rssh-tree-item\", style: { cursor: \"pointer\" } },\n h(\"input\", { type: \"checkbox\", checked: prefs.writeBackFreshness !== false, onChange: function (e) { setPref(\"writeBackFreshness\", !!e.target.checked); } }),\n h(\"span\", null, t(\"settings.writeBackFreshness\"))\n ),\n // 全局默认同步范围(issue #28 第 3 条):新建工作区时取作初始值,\n // 避免多远程工作区场景下每建一个区都要手工补一遍范围。\n h(\"div\", { className: \"rssh-title\", style: { marginTop: 10 } }, t(\"settings.syncScope\")),\n Field({ label: t(\"settings.defaultSyncPaths\"), value: prefs.defaultSyncPaths, onChange: function (v) { setPref(\"defaultSyncPaths\", v); }, placeholder: \".dsh\" }),\n Field({ label: t(\"settings.defaultSyncExclude\"), value: prefs.defaultSyncExclude, onChange: function (v) { setPref(\"defaultSyncExclude\", v); }, placeholder: \"data/, *.log\" }),\n Field({ label: t(\"settings.defaultSyncMaxBytes\"), value: prefs.defaultSyncMaxBytes, onChange: function (v) { setPref(\"defaultSyncMaxBytes\", v); }, placeholder: \"2\" }),\n h(\"div\", { className: \"rssh-actions\" },\n h(\"button\", { className: \"rssh-btn\", onClick: savePrefs }, t(\"common.save\"))\n )\n ),\n prefsMsg ? h(\"div\", { className: prefsMsg.ok ? \"rssh-ok\" : \"rssh-err\", style: { whiteSpace: \"pre-wrap\", marginTop: 6 } }, prefsMsg.msg) : null,\n h(\"div\", { className: \"rssh-card\" },\n h(\"div\", { className: \"rssh-title\" }, t(\"settings.add\")),\n Field({ label: t(\"settings.name\"), value: form.name, onChange: function (v) { set(\"name\", v); }, placeholder: t(\"settings.namePlaceholder\") }),\n Field({ label: t(\"settings.host\"), value: form.host, onChange: function (v) { set(\"host\", v); }, placeholder: t(\"settings.hostPlaceholder\") }),\n Field({ label: t(\"settings.port\"), value: form.port, onChange: function (v) { set(\"port\", v); } }),\n Field({ label: t(\"settings.user\"), value: form.user, onChange: function (v) { set(\"user\", v); }, placeholder: t(\"settings.userPlaceholder\") }),\n h(\"div\", { className: \"rssh-row\" },\n h(\"span\", { className: \"rssh-label\" }, t(\"settings.auth\")),\n h(\"select\", { className: \"rssh-select\", value: form.authMethod, onChange: function (e) { set(\"authMethod\", e.target.value); } },\n h(\"option\", { value: \"key\" }, t(\"settings.key\")),\n h(\"option\", { value: \"password\" }, t(\"settings.password\"))\n )\n ),\n form.authMethod === \"key\" ? Field({ label: t(\"settings.keyPath\"), value: form.keyPath, onChange: function (v) { set(\"keyPath\", v); }, placeholder: t(\"settings.keyPathPlaceholder\") }) : null,\n form.authMethod === \"password\" ? Field({ label: t(\"settings.passwordField\"), type: \"password\", value: form.password, onChange: function (v) { set(\"password\", v); } }) : null,\n Field({ label: t(\"settings.remoteRoot\"), value: form.remoteRoot, onChange: function (v) { set(\"remoteRoot\", v); }, placeholder: \"~/project\" }),\n Field({ label: t(\"settings.proxyJump\"), value: form.proxyJump, onChange: function (v) { set(\"proxyJump\", v); }, placeholder: \"bastion.example.com\" }),\n h(\"div\", { className: \"rssh-actions\" },\n h(\"button\", { className: \"rssh-btn\", onClick: save, disabled: busy }, busy ? t(\"common.processing\") : t(\"common.save\")),\n h(\"button\", { className: \"rssh-btn\", onClick: openImport, disabled: busy }, t(\"settings.importSshConfig\"))\n )\n ),\n result ? h(\"div\", { className: result.ok ? \"rssh-ok\" : \"rssh-err\", style: { whiteSpace: \"pre-wrap\", marginTop: 6 } }, result.msg) : null,\n importDlg ? h(Modal, { open: true, onClose: function () { if (!busy) setImportDlg(null); }, title: t(\"settings.importTitle\"), closeLabel: t(\"common.close\") },\n importDlg.loading ? h(\"div\", { className: \"rssh-muted\" }, t(\"common.loading\")) :\n importDlg.error ? h(\"div\", { className: \"rssh-err\" }, importDlg.error) :\n (importDlg.hosts.length === 0 ? h(\"div\", { className: \"rssh-muted\" }, t(\"settings.noneFound\")) :\n h(\"div\", null,\n importDlg.hosts.map(function (hh) {\n var key = hh.name + \"|\" + hh.hostName;\n return h(\"label\", { key: key, className: \"rssh-tree-item\", style: { cursor: \"pointer\" } },\n h(\"input\", { type: \"checkbox\", checked: !!importDlg.selected[key], onChange: function () { toggleImport(key); } }),\n h(\"span\", { className: \"rssh-tree-dir\" }, hh.name),\n h(\"span\", { className: \"rssh-sub\" }, (hh.user || \"?\") + \"@\" + hh.hostName + \":\" + (hh.port || 22) + (hh.proxyJump ? \" → \" + hh.proxyJump : \"\"))\n );\n }),\n h(\"div\", { className: \"rssh-actions\", style: { marginTop: 8 } },\n h(\"button\", { className: \"rssh-btn\", onClick: doImport, disabled: busy }, busy ? t(\"common.processing\") : t(\"common.save\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { setImportDlg(null); }, disabled: busy }, t(\"common.close\"))\n )\n )\n )\n ) : null\n );\n }\n\n // ======================================================================\n // apply\n // ======================================================================\n function apply(ctx) {\n var slots = ctx.slots;\n var locale = ctx.locale;\n\n // 兼容 DSH Desktop ≥2.0.4:shell 不再把客户端模块系统挂到\n // globalThis.__DSH_MODULES__,而 dsh-better-sidebar 0.15+ 的懒加载\n // chunk(editor 等)会回退到该全局——缺失时侧边栏面板打不开、报\n // \"chunk ... client module system unavailable\"。这里用内核提供的\n // modules 服务补挂该全局;better-sidebar 已注入则保持原值。\n try {\n if (typeof globalThis !== \"undefined\") {\n var fallbackModules = null;\n try { if (ctx.modules && typeof ctx.modules.import === \"function\") fallbackModules = ctx.modules; } catch (e) {}\n if (!fallbackModules && ctx.get && typeof ctx.get === \"function\") {\n try { fallbackModules = ctx.get(\"modules\"); } catch (e) { fallbackModules = null; }\n }\n // 定期兜底:better-sidebar 若把本插件应用时间之后的模块系统清掉,也补回。\n if (globalThis.__DSH_MODULES__ === undefined && fallbackModules === null) {\n var waitModules = 0;\n var waitTimer = setInterval(function () {\n waitModules += 1;\n try {\n var ms = (ctx.get && typeof ctx.get === \"function\") ? ctx.get(\"modules\") : null;\n if (ms && typeof ms.import === \"function\") {\n globalThis.__DSH_MODULES__ = ms;\n clearInterval(waitTimer);\n }\n } catch (e) {}\n if (globalThis.__DSH_MODULES__ !== undefined || waitModules > 40) clearInterval(waitTimer);\n }, 250);\n }\n if (!globalThis.__DSH_MODULES__ && fallbackModules && typeof fallbackModules.import === \"function\") {\n globalThis.__DSH_MODULES__ = fallbackModules;\n }\n }\n } catch (e) {}\n\n // 注册中英文词典并绑定当前语言;locale 切换时 i18n.subscribe 触发组件重渲染。\n if (locale) {\n ctx.effect(function () { return locale.register(NS, { zh: zh, en: en }); }, \"dsh-remote-ssh: dictionaries\");\n i18n.t = locale.bind(NS);\n i18n.subscribe = function (cb) { return locale.subscribe(cb); };\n i18n.getSnapshot = function () { return locale.getSnapshot(); };\n }\n\n ctx.effect(function () {\n var el = document.createElement(\"style\");\n el.textContent = CSS;\n document.head.appendChild(el);\n return function () { if (el.parentNode) el.parentNode.removeChild(el); };\n });\n\n // ---- 设置导航「远程连接」条目:把壳层默认齿轮换成真实显示器 SVG 图标 ----\n // 壳层对未知 settings.section 一律渲染齿轮图标(IconSettingsOutline16 兜底),\n // 且 settings.section 插槽契约暂不接受自定义图标(壳层注释:Desktop-owned display\n // glyph kept local until the upstream slot accepts icons),导航 CSS 类名是构建期哈希\n // 每版会变。这里沿既有 DOM 方案:按条目文本(settings.nav)定位设置导航按钮,把\n // 兜底齿轮 svg 原位替换为显示器图标(与 🖥️ 语义最接近的真实 SVG,非文字表情)。\n // replaceChild 后 React 只会对已脱离文档的旧齿轮节点做属性更新(无冲突),\n // 设置面板按需挂载、语言切换、React 重渲染由 MutationObserver + 1s 幂等复检兜底。\n if (slots) {\n function monitorIconSvg() {\n var NS = \"http://www.w3.org/2000/svg\";\n var svg = document.createElementNS(NS, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 16 16\");\n svg.setAttribute(\"width\", \"16\");\n svg.setAttribute(\"height\", \"16\");\n svg.setAttribute(\"fill\", \"none\");\n svg.setAttribute(\"data-rssh-monitor\", \"1\");\n function add(name, attrs) {\n var n = document.createElementNS(NS, name);\n for (var k in attrs) n.setAttribute(k, attrs[k]);\n svg.appendChild(n);\n }\n // 桌面显示器:圆角屏幕外框 + 支架 + 底座(轮廓线风格,与 DSH 原语一致)\n add(\"rect\", { x: \"1.5\", y: \"2.5\", width: \"13\", height: \"9\", rx: \"1\", stroke: \"currentColor\", \"stroke-width\": \"1.3\" });\n add(\"path\", { d: \"M8 11.5v3\", stroke: \"currentColor\", \"stroke-width\": \"1.3\", \"stroke-linecap\": \"round\" });\n add(\"path\", { d: \"M5.5 14.5h5\", stroke: \"currentColor\", \"stroke-width\": \"1.3\", \"stroke-linecap\": \"round\" });\n return svg;\n }\n function checkCell(btn) {\n var label = i18n.t(\"settings.nav\");\n var text = (btn.textContent || \"\").trim();\n if (text !== label.trim() || text === \"\") return false;\n var icon = btn.querySelector(\"svg\");\n if (!icon) return false;\n if (icon.getAttribute(\"data-rssh-monitor\") === \"1\") return true; // 已替换:幂等\n try { icon.parentNode.replaceChild(monitorIconSvg(), icon); } catch (e) {}\n return true;\n }\n function checkCellIn(root) {\n try {\n if (root.tagName && String(root.tagName).toLowerCase() === \"button\") checkCell(root);\n var cells = root.querySelectorAll(\"button\");\n for (var i = 0; i < cells.length; i++) checkCell(cells[i]);\n } catch (e) {}\n }\n function applyRemoteNavIcon() {\n try {\n var buttons = document.querySelectorAll(\"button\");\n for (var i = 0; i < buttons.length; i++) checkCell(buttons[i]);\n } catch (e) {}\n }\n // ---- 远程工作区图标:单个「地球角标文件夹」SVG 替换壳层默认纯文件夹图标 ----\n // 壳层工作区行的文件夹图标是固定原语(IconFolderOpen16/Close16),无 per-workspace\n // 图标 API;旧方案在标题里塞 🌐 emoji 造成「文件夹 + 地球」双重标识。现按标题文本\n // 定位远程工作区行,找到行首 slot.folder 槽位(标题的前兄弟),向其中的 svg\n // 追加地球经纬线组 —— 文件夹本体保持壳层默认原语几何,零改写零对账风险。\n var remoteTitles = new Set(); // 远程工作区标题(旧壳层按标题匹配时用,也用于诊断)\n var remoteRowKeys = new Set(); // `workspace:<原生工作区 id>`:issue #31 起的精确对齐依据\n var watchedRows = []; // 已加角标的行:定时幂等复检,抵消 React 重渲染对图标的还原\n var remoteWorkspaceCount = 0; // 远程工作区条目数(诊断用)\n var decoratedRows = 0; // 已加角标的行数(诊断用)\n /** 归一化标题文本:折叠空白(壳层可能插入换行/多空格),供匹配与诊断共用。 */\n function normTitle(s) { return String(s == null ? \"\" : s).replace(/\\s+/g, \" \").trim(); }\n /** 镜像目录 basename → { label: 远程目录 basename, remotePath }(issue #9)。 */\n var rootLabels = {};\n function refreshRemoteTitles() {\n api(\"listWorkspaces\").then(function (r) {\n if (!(r && r.ok && Array.isArray(r.workspaces))) return;\n var next = new Set();\n var keys = new Set();\n remoteWorkspaceCount = r.workspaces.length;\n for (var i = 0; i < r.workspaces.length; i++) {\n var w = r.workspaces[i] || {};\n var t = normTitle(w.title);\n if (t) { next.add(t); next.add(\"🌐 \" + t); } // 兼容自愈前的旧前缀标题\n // issue #31:壳层每个工作区行都带 data-row-key=\"workspace:<原生 id>\"。存下这个\n // id 才能**精确**认行 —— 只按标题文本会把「与远程同名」的本地项目也标上地球。\n // 旧记录没有该字段时,由宿主侧 listWorkspaces 按镜像路径回填(见 reconcileShellWorkspaceIds)。\n var sid = normTitle(w.shellWorkspaceId);\n if (sid) keys.add(\"workspace:\" + sid);\n }\n remoteTitles = next;\n remoteRowKeys = keys;\n refreshRootLabels(r.workspaces);\n swapWorkspaceIconsIn(document.body); // 标题集就绪后补一次全量替换\n applyRootLabelsIn(document.body); // 树根标签同样补一次全量替换\n }).catch(function () {});\n }\n /** 地球经纬线组(右下角、无圆盘底色):线色**跟随主题**(取文件夹 svg 自身的计算色,\n * 取不到时退回 currentColor);文件夹本体完全保留壳层默认原语(IconFolderOpen16/Close16\n * 原始路径与几何,零改写),仅向 svg 追加本组 —— appendChild 不触碰 React 管理的子节点。\n * ⚠️ 此前这里硬编码 `stroke=\"#ffffff\"`:在**浅色主题**下白线落在浅色侧边栏上几乎不可见,\n * 是\"换一台电脑就看不到地球角标\"的一个真实成因(与本文件里的显示器图标统一用 currentColor)。 */\n function globeGridElement(color) {\n var NS = \"http://www.w3.org/2000/svg\";\n var g = document.createElementNS(NS, \"g\");\n g.setAttribute(\"data-rssh-globe\", \"1\");\n g.setAttribute(\"fill\", \"none\");\n g.setAttribute(\"stroke\", color || \"currentColor\");\n g.setAttribute(\"stroke-width\", \"0.9\");\n function add(name, attrs) {\n var n = document.createElementNS(NS, name);\n for (var k in attrs) n.setAttribute(k, attrs[k]);\n g.appendChild(n);\n }\n add(\"circle\", { cx: \"11.6\", cy: \"11.9\", r: \"3.4\" }); // 地球轮廓\n add(\"ellipse\", { cx: \"11.6\", cy: \"11.9\", rx: \"1.6\", ry: \"3.4\" }); // 经线\n add(\"path\", { d: \"M8.2 11.9h6.8\" }); // 赤道(纬线)\n add(\"path\", { d: \"M8.7 9.6c0.9 0.65 1.85 0.97 2.9 0.97s2-0.32 2.9-0.97\" }); // 北纬弧\n add(\"path\", { d: \"M8.7 14.2c0.9-0.65 1.85-0.97 2.9-0.97s2 0.32 2.9 0.97\" }); // 南纬弧\n return g;\n }\n /** 取文件夹 svg 的**计算颜色**作为角标颜色:与图标本体同色 → 浅色/深色主题都可见。\n * 透明/取不到时返回 null(由 globeGridElement 退回 currentColor 继承行文本色)。 */\n function iconInkOf(el) {\n try {\n var win = el && el.ownerDocument && el.ownerDocument.defaultView;\n if (!win || !win.getComputedStyle) return null;\n var c = win.getComputedStyle(el).color;\n if (!c) return null;\n if (/^(transparent|rgba?\\(\\s*0\\s*,\\s*0\\s*,\\s*0\\s*,\\s*0\\s*\\))$/i.test(String(c).trim())) return null;\n return c;\n } catch (e) {\n return null;\n }\n }\n /** 幂等应用:React 还原/重建子节点会清掉本组 —— 以 [data-rssh-globe] 子节点\n * 存在性为状态判据(覆盖属性级还原与节点重建),缺席即追加。 */\n function applyFolderGlobe(slotSvg) {\n if (slotSvg.querySelector(\"[data-rssh-globe]\")) return;\n slotSvg.setAttribute(\"data-rssh-folder-globe\", \"1\");\n slotSvg.appendChild(globeGridElement(iconInkOf(slotSvg)));\n decoratedRows += 1;\n }\n /** 反向自愈(issue #31):不是远程工作区的行若还带着角标(升级前按标题误标),摘掉它。\n * 否则用户升级后仍会看到本地项目上的地球,只有等 React 重渲染才会消失。 */\n function removeFolderGlobe(slotSvg) {\n try {\n if (!slotSvg || !slotSvg.querySelector) return;\n var g = slotSvg.querySelector(\"[data-rssh-globe]\");\n if (!g) return;\n if (typeof slotSvg.removeChild === \"function\") slotSvg.removeChild(g);\n else if (g.parentNode && typeof g.parentNode.removeChild === \"function\") g.parentNode.removeChild(g);\n if (typeof slotSvg.removeAttribute === \"function\" && slotSvg.getAttribute(\"data-rssh-folder-globe\") === \"1\") {\n slotSvg.removeAttribute(\"data-rssh-folder-globe\");\n }\n decoratedRows = Math.max(0, decoratedRows - 1);\n } catch (e) {}\n }\n /** 行首槽位里的文件夹 svg(`row > span.slot.folder > svg`)。 */\n function folderSvgOfRow(row) {\n var first = row && row.children && row.children[0];\n return first && first.querySelector ? first.querySelector(\"svg\") : null;\n }\n /** 行 → 原生工作区键(`workspace:`);旧壳层没有该属性时返回 null。 */\n function rowKeyOfRow(row) {\n try {\n var k = row && row.getAttribute ? row.getAttribute(\"data-row-key\") : null;\n return k && String(k).indexOf(\"workspace:\") === 0 ? String(k) : null;\n } catch (e) { return null; }\n }\n /** 工作区行集合(root 自身是行时也算进来 —— MutationObserver 常把行本身当新增节点)。 */\n function workspaceRowsIn(root) {\n var list = [];\n try {\n if (!root || !root.querySelectorAll) return list;\n var found = root.querySelectorAll('[data-row-key^=\"workspace:\"]');\n for (var i = 0; i < found.length; i++) list.push(found[i]);\n var selfKey = rowKeyOfRow(root);\n if (selfKey && list.indexOf(root) < 0) list.unshift(root);\n } catch (e) {}\n return list;\n }\n /** 行首 svg 加/摘角标;返回 true 表示这一行加上了。 */\n function markRow(row, want) {\n var svg = folderSvgOfRow(row);\n if (!svg) return false;\n if (want) { applyFolderGlobe(svg); return true; }\n removeFolderGlobe(svg);\n return false;\n }\n /** 精确路径(issue #31):按 data-row-key 与 remoteRowKeys 对齐。\n * 同名本地项目行键不同 → 不会被标;曾误标的行会在这里被摘掉(自愈)。 */\n function applyRowGlobes(rows) {\n if (!rows || !rows.length) return 0;\n var applied = 0;\n for (var i = 0; i < rows.length; i++) {\n var key = rowKeyOfRow(rows[i]);\n var want = !!key && remoteRowKeys.has(key);\n if (markRow(rows[i], want)) applied += 1;\n if (want) watchRow(rows[i]);\n }\n return applied;\n }\n /** 向上 ≤4 层找到\"行\"元素(其首个子元素槽位里有 svg)—— 旧壳层回退用。 */\n function ownerRowOf(el) {\n var holder = el;\n for (var hop = 0; hop < 4 && holder && holder.parentElement; hop++) {\n var row = holder.parentElement;\n var first = row.children && row.children[0];\n if (first && first.querySelector && first.querySelector(\"svg\")) return row;\n holder = row;\n }\n return null;\n }\n /** 旧壳层回退:没有 data-row-key 时只能按标题匹配。\n * ⚠️ 同名行不止一行时**都不标** —— 无法区分哪一行是远程的,宁可漏标也不误标(issue #31)。 */\n function applyByTitle(root) {\n if (!remoteTitles.size) return;\n try {\n var nodes = root.querySelectorAll(\"span,div,button,a,p,[title],[aria-label]\");\n var rowsSeen = [];\n var titlesSeen = [];\n for (var i = 0; i < nodes.length; i++) {\n var el = nodes[i];\n if (el.childElementCount > 2) continue;\n var text = normTitle(el.textContent);\n var hit = remoteTitles.has(text);\n if (!hit) {\n // 容错:部分壳层/主题把标题放在 title / aria-label 属性上,文本另有装饰\n var attr = el.getAttribute ? (el.getAttribute(\"title\") || el.getAttribute(\"aria-label\")) : null;\n hit = !!attr && remoteTitles.has(normTitle(attr));\n }\n if (!hit) continue;\n var row = ownerRowOf(el);\n if (!row || rowsSeen.indexOf(row) >= 0) continue;\n rowsSeen.push(row);\n titlesSeen.push(normTitle(row.textContent));\n }\n for (var r = 0; r < rowsSeen.length; r++) {\n var same = 0;\n for (var q = 0; q < titlesSeen.length; q++) { if (titlesSeen[q] === titlesSeen[r]) same += 1; }\n if (same > 1) continue; // 同名(本地 + 远程)→ 不标\n if (markRow(rowsSeen[r], true)) watchRow(rowsSeen[r]);\n }\n } catch (e) {}\n }\n function watchRow(row) {\n for (var i = 0; i < watchedRows.length; i++) { if (watchedRows[i] === row) return; }\n watchedRows.push(row);\n }\n function recheckWatched() {\n // 精确路径:整份行集合复检(顺带把曾误标的行摘干净),行数通常 <20,1s 一次成本可忽略\n if (remoteRowKeys.size) {\n var rows = workspaceRowsIn(document.body);\n if (rows.length) { applyRowGlobes(rows); return; }\n }\n // 旧壳层:没有行键,只能按记录的标题元素复检\n for (var i = watchedRows.length - 1; i >= 0; i--) {\n var row = watchedRows[i];\n if (!row || !row.isConnected) { watchedRows.splice(i, 1); continue; }\n var svg = folderSvgOfRow(row);\n if (svg) applyFolderGlobe(svg);\n }\n }\n /** 该壳层是否支持行键(首次见到工作区行即置 true,之后永不再按标题猜)。 */\n var shellHasRowKeys = false;\n function swapWorkspaceIconsIn(root) {\n if (!remoteTitles.size && !remoteRowKeys.size) return;\n var rows = workspaceRowsIn(root);\n if (rows.length) { shellHasRowKeys = true; applyRowGlobes(rows); return; } // 2.4.37+:按行键精确对齐\n // 局部子树(例如标题 span 重渲染)里没有行 —— 但壳层本身支持行键时必须\"什么都不做\",\n // 否则会退回按标题猜,把同名本地项目的这一小块重新标上(issue #31 的坑)。\n if (!shellHasRowKeys) {\n var probe = workspaceRowsIn(document.body);\n if (probe.length) { shellHasRowKeys = true; applyRowGlobes(probe); return; }\n }\n if (shellHasRowKeys) return;\n applyByTitle(root); // 仅旧壳层(根本没有 data-row-key)才走标题回退\n }\n\n // ---- 角标自检:把\"该有却没有\"的情形直接打到控制台,便于在别的机器上定位 ----\n // 控制台可随时执行 window.__dshRemoteSshGlobeStats() 查看详情。\n var globeHealthWarned = false;\n function globeStats(withTitles) {\n var inDom = 0;\n try { inDom = document.querySelectorAll(\"[data-rssh-globe]\").length; } catch (e) {}\n var s = {\n loaded: true,\n remoteWorkspaces: remoteWorkspaceCount,\n decoratedRows: decoratedRows,\n globesInDom: inDom,\n watchedRows: watchedRows.length,\n titleKeys: remoteTitles.size,\n // issue #31:rowKeyKeys > 0 表示走的是「按行键精确对齐」,标题只是回退路径\n rowKeyKeys: remoteRowKeys.size,\n matchedBy: remoteRowKeys.size ? \"rowKey\" : \"title\",\n };\n if (withTitles) {\n try { s.titleSamples = Array.prototype.slice.call(remoteTitles).slice(0, 6); } catch (e) {}\n try { s.rowKeySamples = Array.prototype.slice.call(remoteRowKeys).slice(0, 6); } catch (e) {}\n }\n return s;\n }\n function checkGlobeHealth(verbose) {\n try {\n var s = globeStats(true);\n if (s.remoteWorkspaces === 0) {\n if (verbose) console.info(\"[dsh-remote-ssh] 宿主未返回远程工作区:地球角标与远程功能都未生效(请检查插件版本与 harness 兼容性,或先创建/迁移远程工作区)\", s);\n return s;\n }\n if (s.globesInDom === 0 && !globeHealthWarned) {\n globeHealthWarned = true;\n console.warn(\"[dsh-remote-ssh] 有 \" + s.remoteWorkspaces + \" 个远程工作区,但工作区行上没找到可加角标的图标:可能是壳层 DOM 结构变化。执行 window.__dshRemoteSshGlobeStats(true) 查看详情\", s);\n }\n } catch (e) {}\n return null;\n }\n // 自检入口(命名空间隔离,不影响宿主)\n try {\n if (typeof window !== \"undefined\") {\n window.__dshRemoteSshGlobeStats = function (withTitles) {\n var s = globeStats(withTitles === true);\n var health = checkGlobeHealth(true);\n console.info(\"[dsh-remote-ssh] 地球角标自检\", s, health ? health : \"\");\n return s;\n };\n }\n } catch (e) {}\n\n // ---- 文件树根标签:显示远程目录名,而不是本地镜像目录 ID(issue #9)----\n // better-sidebar「文件」页签的树根标签取自会话 cwd(= 本地镜像路径)的 basename,\n // 于是显示成镜像目录 ID(如 wmirror3)。这条链路不经过任何 fs.* 路由,\n // 而 Host 侧 session.cwd 虽然已返回 root 字段,客户端只消费 cwd\n // (client-registry 的 api.sessionCwd(...).then(r => setFetchedCwd(r.cwd)),\n // 另有 useSessionCwd 直接读客户端会话列表的 cwd),因此只能在渲染层替换文本。\n // 定位不依赖构建期哈希类名:根行是树里唯一带内联 padding-left:6px 的行,\n // 仅当该行内的纯文本节点 === 某远程工作区的镜像 basename 时才替换(幂等、可自愈)。\n var watchedRootLabels = []; // 已替换的标签元素:1s 幂等复检,抵消 React 重渲染\n function refreshRootLabels(workspaces) {\n var next = {};\n for (var i = 0; i < (workspaces || []).length; i++) {\n var w = workspaces[i] || {};\n var mirror = String(w.mirrorPath || \"\").replace(/[\\\\/]+$/, \"\");\n var remote = String(w.remotePath || \"\").replace(/[\\\\/]+$/, \"\");\n if (!mirror || !remote) continue;\n var mb = mirror.split(/[\\\\/]/).pop();\n var rb = remote.split(/[\\\\/]/).pop();\n if (mb && rb && mb !== rb) next[mb] = { label: rb, remotePath: remote };\n }\n rootLabels = next;\n }\n /** 根行判据:自身或 ≤3 层祖先带内联 padding-left:6px(better-sidebar 根行样式)。 */\n function isRootRow(el) {\n var node = el;\n for (var hop = 0; hop < 3 && node; hop++) {\n var style = node.getAttribute ? node.getAttribute(\"style\") : null;\n if (style && /padding-left:\\s*6px/i.test(String(style))) return true;\n node = node.parentElement;\n }\n return false;\n }\n /** 单个标签替换:纯文本 + 命中镜像 basename + 位于根行 → 换成远程目录名。 */\n function fixRootLabel(el) {\n var text = (el.textContent || \"\").trim();\n if (!text) return false;\n var hit = rootLabels[text];\n if (hit === undefined) {\n // 文本已是远程目录名(上一轮替换过)→ 幂等成功;否则与本插件无关\n return el.getAttribute && el.getAttribute(\"data-rssh-root-label\") === \"1\";\n }\n if (el.childElementCount > 0) return false; // 只改纯文本节点\n if (!isRootRow(el)) return false; // 非根行(例如同名子条目)不动\n el.textContent = hit.label;\n if (el.setAttribute) {\n el.setAttribute(\"data-rssh-root-label\", \"1\");\n el.setAttribute(\"title\", hit.remotePath); // 悬停可见完整远程路径\n }\n watchRootLabel(el);\n return true;\n }\n function watchRootLabel(el) {\n for (var i = 0; i < watchedRootLabels.length; i++) { if (watchedRootLabels[i] === el) return; }\n watchedRootLabels.push(el);\n }\n function recheckRootLabels() {\n for (var i = watchedRootLabels.length - 1; i >= 0; i--) {\n var el = watchedRootLabels[i];\n if (!el || !el.isConnected) { watchedRootLabels.splice(i, 1); continue; }\n fixRootLabel(el);\n }\n }\n function applyRootLabelsIn(root) {\n if (!root || !root.querySelectorAll) return;\n try {\n var nodes = root.querySelectorAll(\"span,div\");\n for (var i = 0; i < nodes.length; i++) fixRootLabel(nodes[i]);\n if (root.nodeType === 1) fixRootLabel(root);\n } catch (e) {}\n }\n ctx.effect(function () {\n if (typeof document === \"undefined\") return;\n applyRemoteNavIcon();\n refreshRemoteTitles();\n // 角标自检:等界面稳定后再判(避免行还没渲染就误报);仅在\"有远程工作区却没有角标\"时告警一次\n setTimeout(function () { checkGlobeHealth(false); }, 8000);\n setTimeout(function () { checkGlobeHealth(false); }, 25000);\n var titleTimer = setInterval(refreshRemoteTitles, 30000);\n var recheckTimer = setInterval(function () { recheckWatched(); recheckRootLabels(); }, 1000); // 抵消 React 属性还原\n var timer = null;\n var pendingRoots = null;\n var schedule = function (root) {\n if (root && root.nodeType === 1) (pendingRoots || (pendingRoots = [])).push(root);\n if (timer) return;\n timer = setTimeout(function () {\n timer = null;\n var roots = pendingRoots;\n pendingRoots = null;\n if (document.hidden) return; // 后台页签零开销\n if (roots && roots.length) {\n // 只扫新增子树:流式聊天期间不做全文档扫描(稳态成本≈0)\n // (设置导航图标与树根标签已在 MutationObserver 回调里同步替换,这里只补工作区角标)\n for (var i = 0; i < roots.length; i++) {\n if (roots[i].isConnected) swapWorkspaceIconsIn(roots[i]);\n }\n } else {\n applyRemoteNavIcon(); // 语言切换等无根场景全量扫一次\n swapWorkspaceIconsIn(document.body);\n applyRootLabelsIn(document.body);\n }\n }, 500);\n };\n var mo = new MutationObserver(function (muts) {\n for (var i = 0; i < muts.length; i++) {\n var added = muts[i].addedNodes;\n for (var j = 0; j < added.length; j++) {\n var node = added[j];\n // 设置导航图标:同步原位替换。MutationObserver 回调是微任务,\n // 在浏览器绘制前执行 —— 齿轮刚插入 DOM 就被换成显示器图标,\n // 用户看到的第一帧就是最终图标(2.4.2 修复齿轮闪现)。\n if (node && node.nodeType === 1 && node.isConnected) {\n checkCellIn(node);\n // 树根标签同样同步替换:微任务内、绘制前完成,避免先闪一下镜像目录 ID\n applyRootLabelsIn(node);\n }\n // 工作区地球角标依赖异步 remoteTitles,仍走防抖批量路径\n schedule(node);\n }\n }\n });\n mo.observe(document.body, { childList: true, subtree: true });\n var off = i18n.subscribe(function () { schedule(null); });\n return function () {\n mo.disconnect();\n if (off) off();\n if (timer) clearTimeout(timer);\n clearInterval(titleTimer);\n clearInterval(recheckTimer);\n };\n }, \"dsh-remote-ssh: settings nav monitor icon + tree root label + remote workspace folder-globe icon\");\n }\n\n // better-sidebar 0.15+ 的文件上传 UI 把原始字节流 POST 到 /sidebar/upload。\n // 远程工作区会话的文件树显示的是本地镜像目录,better-sidebar 会把上传写进\n // 本地镜像而不会到达远程。这里包装 fetch:目标目录位于某个远程工作区镜像\n // 目录内时,把该上传请求重定向到 /remote-ssh/upload(走 SSH 上传到远端)。\n ctx.effect(function () {\n if (typeof window === \"undefined\" || typeof window.fetch !== \"function\") return;\n var nativeFetch = window.fetch.bind(window);\n var mirrors = [];\n function refreshMirrors() {\n api(\"listWorkspaces\").then(function (r) {\n if (r && r.ok && Array.isArray(r.workspaces)) {\n mirrors = r.workspaces.map(function (w) {\n return String(w && w.mirrorPath || \"\").replace(/\\\\/g, \"/\").replace(/\\/+$/g, \"\").toLowerCase();\n }).filter(Boolean);\n }\n }).catch(function () {});\n }\n refreshMirrors();\n var timer = setInterval(refreshMirrors, 30000);\n function patchedFetch(input, init) {\n var raw = typeof input === \"string\" ? input : (input && input.url);\n if (typeof raw === \"string\") {\n try {\n var u = new URL(raw, window.location.origin);\n // better-sidebar 0.25+ 的保存走原始路由 POST /sidebar/write?sessionId&path[&cwd][&expectedMtimeMs],\n // 请求体就是全文(LF)。远程工作区里 path 是**镜像路径**:不接管就会写进本地镜像,\n // 远端文件没变(issue #37 的「保存不上」)。这里把保存改投本插件端点,本地工作区原样透传。\n if (u.pathname === \"/sidebar/write\") {\n var wpath = (u.searchParams.get(\"path\") || \"\").replace(/\\\\/g, \"/\").toLowerCase();\n var wbody = init && init.body;\n if (typeof wbody === \"string\") {\n for (var wi = 0; wi < mirrors.length; wi++) {\n var wm = mirrors[wi];\n if (wpath === wm || wpath.indexOf(wm + \"/\") === 0) {\n var wpayload = {\n sessionId: u.searchParams.get(\"sessionId\") || \"\",\n cwd: u.searchParams.get(\"cwd\") || \"\",\n path: u.searchParams.get(\"path\") || \"\",\n content: wbody\n };\n var emRaw = u.searchParams.get(\"expectedMtimeMs\");\n if (emRaw !== null && emRaw !== \"\") wpayload.expectedMtimeMs = Number(emRaw);\n return nativeFetch(new URL(\"/remote-ssh/write\", window.location.origin).toString(), {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify(wpayload)\n });\n }\n }\n }\n }\n if (u.pathname === \"/sidebar/upload\") {\n var dir = (u.searchParams.get(\"dir\") || \"\").replace(/\\\\/g, \"/\").replace(/\\/+$/g, \"\").toLowerCase();\n var cwd = (u.searchParams.get(\"cwd\") || \"\").replace(/\\\\/g, \"/\").replace(/\\/+$/g, \"\").toLowerCase();\n for (var i = 0; i < mirrors.length; i++) {\n var m = mirrors[i];\n var hit = (dir && (dir === m || dir.indexOf(m + \"/\") === 0)) || (cwd && (cwd === m || cwd.indexOf(m + \"/\") === 0));\n if (hit) {\n var target = new URL(\"/remote-ssh/upload\" + u.search, window.location.origin);\n return nativeFetch(target.toString(), init);\n }\n }\n }\n } catch (e) {}\n }\n return nativeFetch(input, init);\n }\n window.fetch = patchedFetch;\n return function () {\n clearInterval(timer);\n if (window.fetch === patchedFetch) window.fetch = nativeFetch;\n };\n }, \"dsh-remote-ssh: redirect remote-workspace uploads and editor saves\");\n\n // dsh-better-sidebar 是**可选**依赖,绝不能放进 exports.inject:\n // cordis 的 fiber 只要有一个 inject 键对应的服务没注册就整体停在 pending,\n // 前端会报 `web boot: 1 entry did not activate` / `pending (waiting for service: betterSidebar)`,\n // DSH Desktop 还会弹「插件恢复」——即使没装 better-sidebar 时内核自带侧边栏照常可用。\n // 因此改用子 fiber 软注入(前端自身也用 e.inject([\"uiRenderer\"], …) 这一招):\n // 装了 better-sidebar 就注册远程文件编辑器页签,没装就静默降级 ——\n // 宿主半边的 fs.*/终端拦截、设置页与模型工具都不依赖它。\n ctx.inject([\"betterSidebar\"], function (bsCtx) {\n var bs = bsCtx.betterSidebar;\n if (!bs || typeof bs.registerTab !== \"function\") return;\n // 远程文件编辑器页签(隐藏页签,仅由代码打开,每个远程文件单开一栏)。\n // remssh:files 和 remssh:term 已移除:远程文件由内置「文件」页签直接 SSH 读写,\n // 远程终端由内置「终端」页签提供(shell wrapper 自动 SSH)。\n bsCtx.effect(function () {\n return bs.registerTab({\n id: \"remssh:editor\",\n title: function () { return i18n.t(\"tabs.files\"); },\n hidden: true,\n dedupeKey: function (tab) { return (tab && tab.meta && tab.meta.profileId || \"\") + \"\\u0000\" + (tab && tab.path || \"\"); },\n icon: function () { return h(\"span\", null, \"📄\"); },\n component: function (props) {\n return h(RemoteEditor, { tab: props && props.tab, ctx: props && props.ctx, scope: props && props.scope });\n }\n });\n });\n });\n\n if (slots) {\n slots.inject(\"settings.section\", function () {\n return slots.register({\n name: \"settings.section\",\n id: \"remote-ssh\",\n order: 200,\n label: function () { return i18n.t(\"settings.nav\"); },\n locale: NS\n }, SettingsSection);\n });\n\n // 接管原生「添加工作区」流程:用明显更低的优先级覆盖内置的本地目录选择器,\n // 弹窗内提供「本地目录(DSH browse)/ 远程目录(SSH)」两种浏览。\n var flowInject = function () { return { workspaces: ctx.get(\"workspaces\") }; };\n ctx.effect(function () {\n return slots.inject(\"conversation.hero.workspace.directoryFlow\", function () {\n return slots.register({ name: \"conversation.hero.workspace.directoryFlow\", priority: -100, inject: flowInject }, RemoteWorkspaceFlow);\n });\n });\n ctx.effect(function () {\n return slots.inject(\"sidebar.workspaces.directoryFlow\", function () {\n return slots.register({ name: \"sidebar.workspaces.directoryFlow\", priority: -100, inject: flowInject }, RemoteWorkspaceFlow);\n });\n });\n }\n }\n\n exports.apply = apply;\n // 只声明内核一定提供的服务;betterSidebar(第三方 bundle dsh-better-sidebar)\n // 走 apply 内的 ctx.inject 软注入 —— 放进这里会让未安装它的用户 web boot 直接失败(issue #18)。\n exports.inject = [\"slots\", \"locale\"];\n return module.exports;\n}\n","/**\n * workspace-groups-remote — merged client entry.\n *\n * One package gets exactly one client row in the DSH web shell (the module\n * loader keys graph rows by package name), so this entry composes the two\n * client halves on one fiber:\n *\n * - groupsClient: the workspace-groups browser + session tab strip\n * (groups-client.ts, formerly this file).\n * - remoteSshClient: the dsh-remote-ssh client, vendored from\n * vendor/dsh-remote-ssh/lib/client.js. Upstream ships it as a\n * self-registering module-loader bundle; scripts/build-remote-ssh-client.mjs\n * strips that registration wrapper and re-exports the bare factory, which\n * is invoked here with this bundle's own require (its only requires are\n * `react` and `@deepseek-ai/dsh-client-ui-primitives`, both platform\n * modules) and applied alongside the groups client.\n *\n * The inject list is the union of both halves (remote-ssh's `slots`/`locale`\n * are a subset of the groups list).\n */\nimport type { Context } from '@deepseek-ai/cordis'\nimport * as groupsClient from './groups-client.ts'\nimport remoteSshFactory from './remote-ssh-factory.generated.mjs'\n\n/** Services required before mounting (union of both client halves). */\nexport const inject = ['slots', 'sessions', 'workspaces', 'uiWorkspace', 'locale']\n\n/** Instantiate the vendored remote-ssh client plugin exactly once. */\nconst remoteSshClient = remoteSshFactory(id => require(id))\n\n/** Plugin body: apply both client halves on this bundle's fiber. */\nexport function apply(ctx: Context): void {\n groupsClient.apply(ctx)\n remoteSshClient.apply(ctx)\n}\n"],"mappings":";;;;;;;;;;;;;EAsBA,SAAgB,wBAAwB,OAAwB,KAAa,UAAyB;GACpG,MAAM,kBAAkB,OAAO;EACjC;;EAGA,SAAgB,yBAAyB,OAAwB,KAAa,UAAyB;GACrG,MAAM,mBAAmB,OAAO;EAClC;;EAGA,SAAgB,eACd,OACA,cACA,eACM;GACN,MAAM,oBAAoB,OAAO,YAC/B,OAAO,QAAQ,MAAM,iBAAiB,CAAC,CAAC,QAAQ,CAAC,SAAS,aAAa,SAAS,GAAG,CAAC,CACtF;GACA,MAAM,qBAAqB,OAAO,YAChC,OAAO,QAAQ,MAAM,kBAAkB,CAAC,CAAC,QAAQ,CAAC,SAAS,cAAc,SAAS,GAAG,CAAC,CACxF;EACF;;;;;;;;;;;;;;;;;;ECZA,SAAgB,wBAA+E;GAC7F,QAAA,GAAOA,8BAAAA,YAAAA,CAAY;IACjB,aAAa;KAAE,mBAAmB,CAAC;KAAG,oBAAoB,CAAC;IAAE;IAC7D,SAAS;IACT,SAAS;KACP,qBAAqB;KACrB,sBAAsB;KACtB,YAAY;IACd;GACF,CAAC;EACH;;;;;;;;;;;;;;;EC6CA,SAAgB,UAAU,MAA6B,WAAsB,WAAiC;GAE5G,IADiB,KAAK,MAAK,QAAO,IAAI,cAAc,SACzC,MAAM,KAAA,GAAW,OAAO;GACnC,OAAO,CAAC,GAAG,MAAM;IAAE;IAAW,OAAO;GAAU,CAAC;EAClD;;;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back","useSyncExternalStore","IconFolderCloseMedium","IconWorkspaceTreeOutlineMedium","IconCodeOutlineMedium","IconCordisPluginOutlineMedium","IconSkillOutlineMedium","IconDataOutlineMedium","IconDatabaseOutlineMedium","IconApiOutlineMedium","IconPlanOutlineMedium","IconGoalOutlineMedium","IconLightOutlineMedium","IconGlobeOutlineMedium","IconArchiveOutlineMedium","IconBranchOutlineMedium","IconUsersOutlineMedium","IconClockOutlineMedium","IconShieldOutlineMedium","IconChecklistOutlineMedium","IconSparkleMedium","IconTreeCornerMedium","IconNewChatOutlineMedium","IconSearchOutlineMedium","IconSettingsOutlineMedium","IconDeliverDocMedium","IconEditOutlineMedium","IconThinkOutlineMedium","IconAgentPresetOutlineMedium","IconBrowseOutlineMedium","IconContextInjectionOutlineMedium","IconLinkOutlineMedium","IconShareOutlineMedium","IconUserOutlineMedium","IconPaperPlaneOutlineMedium","IconPaperclipOutlineMedium","IconDownloadOutlineMedium","IconPlayOutlineMedium","IconPersonalizationOutlineMedium","IconDarkOutlineMedium","IconFollowsystemOutlineMedium","IconGaugeOutlineMedium","IconQueueOutlineMedium","IconListPenOutlineMedium","IconInspectOutlineMedium","IconQuestionOutlineMedium","IconInfoOutlineMedium","IconAlarmClockOutlineMedium","IconCompareSplitOutlineMedium","IconCheckCircleOutlineMedium","IconPinOutlineMedium","IconMicrophoneOutlineMedium","useState","IconPinFillMedium","IconPinOutlineRegular","IconSlidersTwoOutlineRegular","IconEditOutlineRegular","IconTrashOutlineRegular","IconFolderOpenMedium","IconPlusOutlineRegular","Menu","IconEllipsisOutlineRegular","IconFolderOpenOutlineRegular","IconRightUpOutlineRegular","IconProjectAddOutlineMedium","useRef","IconBranchOutlineRegular","IconArchiveOutlineRegular","StateDot","useState","Modal","Button","IconFolderOpenOutlineRegular","IconTrashOutlineRegular","useState","useRef","useMemo","createPortal","Button","StateDot","useMemo","useState","useRef","StateDot","IconPinFillMedium","Tooltip","IconCloseFillMedium","createPortal","css","useState","useRef","useMemo","IconSearchOutlineRegular","IconCloseFillMedium","Tooltip","IconFolderOpenOutlineRegular","IconProjectAddOutlineRegular","Modal","Button","Toast","IconWarningOutlineRegular","apply","require","remoteSshFactory"],"sources":["../src/client/store-core.ts","../src/client/stores.ts","../src/client/tabs.ts","../src/client/tab-store.ts","../src/client/tab-persist.ts","../src/client/store-hook.ts","../src/core/types.ts","../src/core/matcher.ts","../src/client/subagent-lineage.ts","../src/core/default-workspace.ts","../src/core/folders.ts","../src/client/tree.ts","../src/client/FlowerBranch.tsx","../src/client/group-icons-science.tsx","../src/client/rows.tsx","../src/client/group-icon-labels.ts","../src/client/folders-persist.ts","../src/client/folder-directory.ts","../src/client/open-folder.ts","../src/client/FoldersDialog.tsx","../src/client/quick.ts","../src/client/QuickPanel.tsx","../src/client/tab-seat.ts","../src/client/SessionTabs.tsx","../src/client/GroupsBrowser.tsx","../src/client/directory-flow.ts","../src/client/locales.ts","../src/client/groups-client.ts","../src/client/remote-ssh-factory.generated.mjs","../src/client/index.ts"],"sourcesContent":["/**\r\n * Pure expansion-state transforms for the workspace-groups store. Kept free\r\n * of any runtime import so both the store (which binds them via defineStore)\r\n * and unit tests (which exercise them directly) share one implementation.\r\n *\r\n * Expansion semantics follow the official ui-workspace store: collapse\r\n * WRITES `false` (never deletes the key). The browser's auto-expand guard\r\n * uses `Object.hasOwn` — a present `false` means \"user deliberately\r\n * collapsed this\" and must NOT be re-expanded; only a fully absent key means\r\n * \"never touched\" and may auto-expand. (Earlier versions deleted the key on\r\n * collapse, which made the current category/workspace impossible to fold.)\r\n */\r\n\r\n/** Workspace-groups browser viewing state persisted across surface remounts and reloads. */\r\nexport interface GroupsViewState {\r\n /** Category folder expansion keyed by category label (absent = never touched). */\r\n categoryExpansion: Record\r\n /** Workspace folder expansion keyed by workspace id (absent = never touched). */\r\n workspaceExpansion: Record\r\n}\r\n\r\n/** Collapse writes `false` (key retained); expand writes `true`. */\r\nexport function setCategoryExpandedImpl(state: GroupsViewState, key: string, expanded: boolean): void {\r\n state.categoryExpansion[key] = expanded\r\n}\r\n\r\n/** Collapse writes `false` (key retained); expand writes `true`. */\r\nexport function setWorkspaceExpandedImpl(state: GroupsViewState, key: string, expanded: boolean): void {\r\n state.workspaceExpansion[key] = expanded\r\n}\r\n\r\n/** Drop expansion keys that no longer exist (renames/deletes/config edits). */\r\nexport function retainKeysImpl(\r\n state: GroupsViewState,\r\n categoryKeys: readonly string[],\r\n workspaceKeys: readonly string[],\r\n): void {\r\n state.categoryExpansion = Object.fromEntries(\r\n Object.entries(state.categoryExpansion).filter(([key]) => categoryKeys.includes(key)),\r\n )\r\n state.workspaceExpansion = Object.fromEntries(\r\n Object.entries(state.workspaceExpansion).filter(([key]) => workspaceKeys.includes(key)),\r\n )\r\n}\r\n","/**\r\n * The workspace-groups viewing store: category / workspace folder expansion,\r\n * persisted across reloads under an independent key (the official\r\n * ui-workspace store keeps its own `dsh.workspace.view.v5` — we never touch\r\n * it). Module level exports the factory only (a module-level handle would pin\r\n * the store identity across plugin reloads); register() receives the factory\r\n * and the browser derives its PropsStore share from the return type.\r\n *\r\n * The action implementations live in `store-core.ts` (pure, runtime-free) so\r\n * unit tests exercise the real semantics without a browser module loader;\r\n * this file only binds them through defineStore.\r\n */\r\nimport { defineStore, type EngineStoreHandle } from '@deepseek-ai/dsh-client-store'\r\nimport {\r\n retainKeysImpl,\r\n setCategoryExpandedImpl,\r\n setWorkspaceExpandedImpl,\r\n type GroupsViewState,\r\n} from './store-core.ts'\r\n\r\n/** Annotation twin of the actions literal below (structural type, satisfies `ActionsDecl`). */\r\ntype GroupsViewActions = {\r\n setCategoryExpanded: typeof setCategoryExpandedImpl\r\n setWorkspaceExpanded: typeof setWorkspaceExpandedImpl\r\n retainKeys: typeof retainKeysImpl\r\n}\r\n\r\n/**\r\n * Create the workspace-groups viewing store handle.\r\n * @returns the store handle (spec + type + identity + factory in one).\r\n */\r\nexport function createGroupsViewStore(): EngineStoreHandle {\r\n return defineStore({\r\n init: () => ({ categoryExpansion: {}, workspaceExpansion: {} }),\r\n persist: 'dsh.workspace.groups.view.v1',\r\n actions: {\r\n setCategoryExpanded: setCategoryExpandedImpl,\r\n setWorkspaceExpanded: setWorkspaceExpandedImpl,\r\n retainKeys: retainKeysImpl,\r\n },\r\n })\r\n}\r\n\r\nexport type { GroupsViewState } from './store-core.ts'\r\n","/**\r\n * Pure session-tab state: the ordered strip of sessions the user has opened,\r\n * the active one, and each tab's derived presentation.\r\n *\r\n * Position model: a tab's place in the strip is decided when it is first opened\r\n * and otherwise only moves when the USER moves it. Switching to a tab, or\r\n * re-opening a session that already has one, leaves the strip exactly as it was\r\n * — so clicking a chip never moves the chip out from under the pointer. The\r\n * order changes on: a session opening for the FIRST time (append), a tab closing\r\n * (remove), a drag (move), and a pin toggle (which carries the chip across the\r\n * pinned boundary).\r\n *\r\n * The array IS the display order, with one invariant the transforms maintain:\r\n * every pinned tab sits before every unpinned one. New tabs therefore append at\r\n * the end (the unpinned block) and pinning/unpinning re-inserts at the boundary\r\n * between the two blocks. A stored strip from an older build has no `pinned`\r\n * flag, which reads as \"unpinned\" and satisfies the invariant as-is.\r\n *\r\n * Runtime-free on purpose (same discipline as `store-core.ts` / `quick.ts`):\r\n * the component owns the ref + React state, this module owns every rule, and\r\n * unit tests exercise the real semantics without a browser module loader.\r\n *\r\n * Retention note: a tab outlives whatever it points at. The strip is a list of\r\n * things the USER opened, so nothing here consults the session catalog — a tab\r\n * whose session is gone stays visible until the user closes it, and no\r\n * background sweep ever trims the strip.\r\n */\r\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\r\nimport type { SessionSummary } from '@deepseek-ai/dsh-api-session-controller/client'\r\nimport type { SessionStatus } from '@deepseek-ai/dsh-client-ui-session/client'\r\n\r\n/** One open tab: a session id plus its arrival key (React list identity). */\r\nexport interface SessionTab {\r\n /** The session the tab shows. */\r\n readonly sessionId: SessionId\r\n /**\r\n * Monotonic arrival key. It doubles as the React `key`, so it must stay\r\n * attached to the session for the tab's whole life — a reused key would make\r\n * React move an existing chip's DOM node instead of reconciling it in place.\r\n */\r\n readonly order: number\r\n /**\r\n * Pinned tabs stay at the front of the strip and survive `close others`.\r\n *\r\n * Absent means unpinned: that is both the `false` case and the shape an older\r\n * build's stored strip has, so no migration step is needed to read one back.\r\n */\r\n readonly pinned?: boolean\r\n /**\r\n * A label the user typed for THIS tab, overriding the session's title.\r\n *\r\n * Kept separate from the session title on purpose: renaming a tab here must\r\n * not rewrite the conversation's own name (which the sidebar and the search\r\n * results show). Absent/empty means \"follow the session\".\r\n */\r\n readonly title?: string\r\n}\r\n\r\n/** Feature switch: whether opening a session also surfaces a tab. */\r\nexport type TabOpenMode = 'auto' | 'manual'\r\n\r\n/** Per-tab indicator derived from the catalog summary and the live UI status. */\r\nexport interface SessionTabIndicator {\r\n /** A domain request is waiting for the user (approval / plan review / question). */\r\n readonly attention: boolean\r\n /** The agent is producing output, or a descendant subagent is. */\r\n readonly running: boolean\r\n /** The turn finished while the tab was in the background and was never looked at. */\r\n readonly unread: boolean\r\n /** Idle tab whose session already has a title (a settled conversation). */\r\n readonly settled: boolean\r\n}\r\n\r\n/**\r\n * Add a session to the strip, or leave an existing entry exactly where it is.\r\n *\r\n * Arrival order is the strip's only order, so re-opening a session that already\r\n * has a tab is a NO-OP: the tab keeps its position and its arrival key. Moving\r\n * it to the front here would fight the whole point of stable positions — a user\r\n * clicking through sessions would watch the strip reshuffle on every click.\r\n *\r\n * @param tabs - current strip (oldest first).\r\n * @param sessionId - arriving session.\r\n * @param nextOrder - monotonic arrival counter to spend when appending.\r\n * @returns the strip, unchanged (same array) when the session already has a tab.\r\n */\r\nexport function appendTab(tabs: readonly SessionTab[], sessionId: SessionId, nextOrder: number): SessionTab[] {\r\n const existing = tabs.find(tab => tab.sessionId === sessionId)\r\n if (existing !== undefined) return tabs as SessionTab[]\r\n return [...tabs, { sessionId, order: nextOrder }]\r\n}\r\n\r\n/**\r\n * Remove one session's tab. An absent session leaves the strip untouched.\r\n * @param tabs - current strip.\r\n * @param sessionId - session whose tab closes.\r\n * @returns a new strip.\r\n */\r\nexport function removeTab(tabs: readonly SessionTab[], sessionId: SessionId): SessionTab[] {\r\n return tabs.filter(tab => tab.sessionId !== sessionId)\r\n}\r\n\r\n/**\r\n * Whether a tab is pinned (absent counts as unpinned).\r\n * @param tab - the tab.\r\n * @returns true when the tab belongs in the pinned block.\r\n */\r\nfunction isPinned(tab: SessionTab): boolean {\r\n return tab.pinned === true\r\n}\r\n\r\n/**\r\n * Count the leading pinned block.\r\n *\r\n * The transforms keep every pinned tab before every unpinned one, so the pinned\r\n * block is always a prefix and its length is the single index that separates\r\n * the two blocks — which is exactly where a chip lands when it changes sides.\r\n *\r\n * @param tabs - strip in display order.\r\n * @returns how many leading tabs are pinned.\r\n */\r\nexport function pinnedCount(tabs: readonly SessionTab[]): number {\r\n let count = 0\r\n while (count < tabs.length && isPinned(tabs[count] as SessionTab)) count += 1\r\n return count\r\n}\r\n\r\n/**\r\n * Stable-partition a strip so every pinned tab precedes every unpinned one.\r\n *\r\n * Needed by the restore path: stored tabs are merged onto whatever the startup\r\n * flow already opened, and an append would otherwise park a pinned tab at the\r\n * end of the strip. Already-normalized strips come back as a copy.\r\n *\r\n * @param tabs - any strip.\r\n * @returns a strip satisfying the pinned-first invariant.\r\n */\r\nexport function normalizeTabs(tabs: readonly SessionTab[]): SessionTab[] {\r\n const pinned = tabs.filter(isPinned)\r\n if (pinned.length === 0 || pinned.length === tabs.length) return [...tabs]\r\n return [...pinned, ...tabs.filter(tab => !isPinned(tab))]\r\n}\r\n\r\n/**\r\n * Move one tab to a new place in the strip (drag and drop).\r\n *\r\n * `targetIndex` is an index in the RESULTING strip. The move is clamped to the\r\n * tab's own block — a dragged chip can be reordered within the pinned block or\r\n * within the unpinned one, but never carried across that boundary. Crossing it\r\n * is `togglePinTab`'s job, because it changes the tab's meaning rather than\r\n * just its position: pinning is what makes a tab survive `close others`.\r\n *\r\n * @param tabs - strip in display order.\r\n * @param sessionId - the tab being moved.\r\n * @param targetIndex - desired index in the resulting strip.\r\n * @returns a new strip, or the same array when nothing moved.\r\n */\r\nexport function moveTab(\r\n tabs: readonly SessionTab[],\r\n sessionId: SessionId,\r\n targetIndex: number,\r\n): SessionTab[] {\r\n const from = tabs.findIndex(tab => tab.sessionId === sessionId)\r\n if (from < 0) return tabs as SessionTab[]\r\n const moving = tabs[from] as SessionTab\r\n const rest = tabs.filter(tab => tab.sessionId !== sessionId)\r\n const boundary = pinnedCount(rest)\r\n const min = isPinned(moving) ? 0 : boundary\r\n const max = isPinned(moving) ? boundary : rest.length\r\n const clamped = Math.min(Math.max(Math.trunc(targetIndex), min), max)\r\n if (clamped === from) return tabs as SessionTab[]\r\n return [...rest.slice(0, clamped), moving, ...rest.slice(clamped)]\r\n}\r\n\r\n/**\r\n * Pin or unpin one tab, re-inserting it at the boundary between the blocks.\r\n *\r\n * Pinning puts the chip at the END of the pinned block (next to the other\r\n * kept tabs) and unpinning at the START of the unpinned one, so a toggle never\r\n * throws a chip to the far end of the strip.\r\n *\r\n * @param tabs - strip in display order.\r\n * @param sessionId - the tab to toggle.\r\n * @returns a new strip, or the same array when the tab is absent.\r\n */\r\nexport function togglePinTab(tabs: readonly SessionTab[], sessionId: SessionId): SessionTab[] {\r\n const from = tabs.findIndex(tab => tab.sessionId === sessionId)\r\n if (from < 0) return tabs as SessionTab[]\r\n const moving = tabs[from] as SessionTab\r\n const rest = tabs.filter(tab => tab.sessionId !== sessionId)\r\n const boundary = pinnedCount(rest)\r\n const repinned: SessionTab = isPinned(moving)\r\n ? { sessionId: moving.sessionId, order: moving.order, ...(moving.title !== undefined ? { title: moving.title } : {}) }\r\n : { sessionId: moving.sessionId, order: moving.order, pinned: true, ...(moving.title !== undefined ? { title: moving.title } : {}) }\r\n return [...rest.slice(0, boundary), repinned, ...rest.slice(boundary)]\r\n}\r\n\r\n/**\r\n * Set or clear one tab's own label.\r\n *\r\n * A blank value CLEARS the override (the chip falls back to the session title)\r\n * rather than storing an empty label, so \"rename to nothing\" and \"rename back to\r\n * the session title\" are the same gesture.\r\n *\r\n * @param tabs - strip.\r\n * @param sessionId - the tab to relabel.\r\n * @param title - the new label; blank clears it.\r\n * @returns a new strip, or the same array when the tab is absent.\r\n */\r\nexport function renameTab(\r\n tabs: readonly SessionTab[],\r\n sessionId: SessionId,\r\n title: string | undefined,\r\n): SessionTab[] {\r\n const from = tabs.findIndex(tab => tab.sessionId === sessionId)\r\n if (from < 0) return tabs as SessionTab[]\r\n const trimmed = title?.trim() ?? ''\r\n // No change: return the same array so the store can skip the write.\r\n if ((tabs[from]?.title ?? '') === trimmed) return tabs as SessionTab[]\r\n return tabs.map((tab) => {\r\n if (tab.sessionId !== sessionId) return tab\r\n if (trimmed === '') {\r\n const { title: _cleared, ...rest } = tab\r\n void _cleared\r\n return rest\r\n }\r\n return { ...tab, title: trimmed }\r\n })\r\n}\r\n\r\n/**\r\n * Close every tab except one — pinned tabs stay.\r\n *\r\n * Pinning is exactly how a user says \"keep this no matter what\"; letting\r\n * `close others` eat the pinned block would make the flag pointless.\r\n *\r\n * @param tabs - strip.\r\n * @param keepSessionId - the tab to keep (plus every pinned one).\r\n * @returns a new strip.\r\n */\r\nexport function closeOtherTabs(tabs: readonly SessionTab[], keepSessionId: SessionId): SessionTab[] {\r\n if (!tabs.some(tab => tab.sessionId === keepSessionId)) return tabs as SessionTab[]\r\n return tabs.filter(tab => isPinned(tab) || tab.sessionId === keepSessionId)\r\n}\r\n\r\n/**\r\n * Close every tab after one in display order.\r\n *\r\n * \"After\" is display order (pinned block first), which is the order the user\r\n * sees; a pinned tab is never after an unpinned one, so this cannot silently\r\n * drop the kept block.\r\n *\r\n * @param tabs - strip in display order.\r\n * @param sessionId - the last tab that stays.\r\n * @returns a new strip, or the same array when the tab is absent.\r\n */\r\nexport function closeTabsAfter(tabs: readonly SessionTab[], sessionId: SessionId): SessionTab[] {\r\n const from = tabs.findIndex(tab => tab.sessionId === sessionId)\r\n if (from < 0) return tabs as SessionTab[]\r\n return tabs.slice(0, from + 1)\r\n}\r\n\r\n/**\r\n * Order the strip for display: strictly by arrival, regardless of which tab is\r\n * active.\r\n *\r\n * Position is a property of the TAB, not of the selection. Switching to a tab\r\n * must not move it — an earlier version pulled the active tab to the front,\r\n * which made every click reshuffle the strip and slid the chip out from under\r\n * the pointer that had just clicked it.\r\n *\r\n * `activeId` is therefore accepted only to document that \"active\" deliberately\r\n * does NOT participate in ordering; it is unused. The returned array is a copy\r\n * so callers cannot mutate the store's state through it.\r\n *\r\n * @param tabs - strip in arrival order.\r\n * @param activeId - the open session, if it has a tab (intentionally unused).\r\n * @returns a new array in arrival order.\r\n */\r\nexport function orderedTabs(tabs: readonly SessionTab[], activeId: SessionId | undefined): SessionTab[] {\r\n void activeId\r\n return [...tabs]\r\n}\r\n\r\n/**\r\n * Whether the open session must surface a tab.\r\n *\r\n * A tab means \"this conversation is in play right now\", not \"I once opened\r\n * this\". Browsing history is what the sidebar is for; opening an old\r\n * conversation to read it should not litter the strip, which is the whole point\r\n * of the strip being a working set rather than a second session list.\r\n *\r\n * A session therefore earns a tab only once a conversation has actually STARTED\r\n * in it and is still engaged, which is any of:\r\n * - **running** — the agent is producing output (including subagents);\r\n * - **waiting on you** — an approval / plan review / question is pending;\r\n * - **unseen completion** — it finished while you were elsewhere, so the tab is\r\n * the thing that tells you to come back.\r\n *\r\n * A still-blank draft gets NO tab: the tab appears the moment the first message\r\n * is sent (which is when the controller flips `blank` on `turn/start`). Once the\r\n * turn ends and you have read the result, the session is settled history and\r\n * does not earn a tab — so clicking through finished conversations leaves the\r\n * strip alone. Tabs already opened stay open: this gate only decides whether a\r\n * NEW tab appears, never whether an existing one closes.\r\n *\r\n * `blank` (from `sessionListMetadata`) is exactly \"no turn has started\": the\r\n * controller flips it to false on `turn/start`. It is the right signal for\r\n * \"has this conversation begun\", and the wrong one ALONE — a conversation\r\n * finished a week ago is also non-blank, which is why the earlier `!blank` rule\r\n * surfaced every old conversation the user clicked.\r\n *\r\n * @param mode - feature switch ('auto' applies the engagement rule).\r\n * @param summary - the session's catalog row (absent while the catalog has not\r\n * caught up with a just-created session).\r\n * @param status - the session's unified UI status (absent → no live signal).\r\n * @returns true when a tab belongs in the strip.\r\n */\r\nexport function shouldOpenTab(\r\n mode: TabOpenMode,\r\n summary: SessionSummary | undefined,\r\n status: SessionStatus | undefined,\r\n): boolean {\r\n if (mode === 'manual') return false\r\n if (summary === undefined) return false\r\n // No turn yet: a scratch draft is not a conversation, so it holds no tab. The\r\n // first message flips `blank`, and the tab appears then.\r\n if (summary.blank) return false\r\n // A conversation has begun. Keep the tab only while it is still in play.\r\n if (summary.running) return true\r\n if (status?.running === true) return true\r\n if (status?.pendingInteraction !== undefined) return true\r\n if (status?.completionUnread === true) return true\r\n // Begun, but quiet and read: settled history, not a working tab.\r\n return false\r\n}\r\n\r\n/**\r\n * Derive one tab's indicators from the catalog row and the unified UI status.\r\n * @param summary - the tab session's catalog row (absent → inert indicators).\r\n * @param status - the tab session's unified UI status (absent → idle).\r\n * @returns the indicator quadruple.\r\n */\r\nexport function tabIndicator(\r\n summary: SessionSummary | undefined,\r\n status: SessionStatus | undefined,\r\n): SessionTabIndicator {\r\n const pending = status?.pendingInteraction !== undefined\r\n const running = status?.running === true || summary?.running === true\r\n const unread = status?.completionUnread === true\r\n const blank = summary?.blank !== false\r\n return {\r\n attention: pending,\r\n running,\r\n unread,\r\n settled: !pending && !running && !unread && summary !== undefined && !blank,\r\n }\r\n}\r\n\r\n/**\r\n * Where one session lives: the project (workspace) that accounts for it.\r\n *\r\n * Tabs carry this because a strip of bare session titles is ambiguous once\r\n * several projects are open — two checkouts both named \"api\", or a session\r\n * titled after a file, give no hint which project it belongs to.\r\n */\r\nexport interface TabProject {\r\n /** Stable workspace id. */\r\n readonly workspaceId: string\r\n /** Display label: the workspace title, falling back to its directory name. */\r\n readonly label: string\r\n /** Canonical directory path, for the tooltip. */\r\n readonly path: string\r\n}\r\n\r\n/**\r\n * Index sessions by the project that owns them.\r\n *\r\n * Membership comes from the workspace registry (`sessionIds`), which is the same\r\n * authority the sidebar tree uses — a tab and its sidebar row therefore agree on\r\n * the project without a second derivation.\r\n *\r\n * Built once per render pass rather than scanned per tab: a strip of N tabs over\r\n * M projects is O(N×M) with a naive `find` per tab.\r\n *\r\n * @param workspaces - workspace views from the controller snapshot.\r\n * @returns a session id → project map; sessions in no workspace are absent.\r\n */\r\nexport function projectIndex(\r\n workspaces: readonly WorkspaceViewLike[],\r\n): ReadonlyMap {\r\n const index = new Map()\r\n for (const workspace of workspaces) {\r\n const label = projectLabel(workspace)\r\n const project: TabProject = {\r\n workspaceId: workspace.workspaceId,\r\n label,\r\n path: workspace.path,\r\n }\r\n for (const sessionId of workspace.sessionIds) {\r\n // First writer wins: a session wrongly listed by two workspaces keeps the\r\n // first, so the tab never flickers between labels across renders.\r\n if (!index.has(sessionId)) index.set(sessionId, project)\r\n }\r\n }\r\n return index\r\n}\r\n\r\n/** Minimal workspace shape this module needs (keeps it importable in tests). */\r\nexport interface WorkspaceViewLike {\r\n readonly workspaceId: string\r\n readonly path: string\r\n readonly title: string\r\n readonly sessionIds: readonly SessionId[]\r\n}\r\n\r\n/**\r\n * Display label for a project: its title, else the directory basename.\r\n * @param workspace - workspace view.\r\n * @returns a non-empty label, falling back to the raw path.\r\n */\r\nexport function projectLabel(workspace: Pick): string {\r\n const title = workspace.title.trim()\r\n if (title !== '') return title\r\n // Both separators: the host path may be Windows or POSIX.\r\n const parts = workspace.path.split(/[\\\\/]/).filter(part => part !== '')\r\n return parts[parts.length - 1] ?? workspace.path\r\n}\r\n\r\n/**\r\n * Whether two strips are the same sequence of sessions (arrival keys ignored).\r\n * @param left - previous strip.\r\n * @param right - next strip.\r\n * @returns true when no entry was added, removed, or reordered.\r\n */\r\nexport function sameTabs(left: readonly SessionTab[], right: readonly SessionTab[]): boolean {\r\n return left.length === right.length\r\n && left.every((tab, index) => right[index]?.sessionId === tab.sessionId)\r\n}\r\n\r\n/** Session-tab strip state (the shape the store persists). */\r\nexport interface SessionTabsState {\r\n /** Open tabs in arrival order — the strip's one and only order. */\r\n tabs: SessionTab[]\r\n /** Monotonic arrival counter; each FIRST-time session spends one. */\r\n order: number\r\n}\r\n\r\n/**\r\n * Store transform: add the open session, or leave its existing tab in place.\r\n *\r\n * Live here rather than in `tab-store.ts` so unit tests can exercise the real\r\n * semantics without importing `@deepseek-ai/dsh-client-store` (which pulls\r\n * `zustand` into the test process). The store module binds these into its\r\n * actions table.\r\n *\r\n * The no-op guard matters: this runs on EVERY catalog change for the open\r\n * session, so an unguarded write would wake the strip and spend arrival keys on\r\n * every projection tick.\r\n *\r\n * @param state - store draft, mutated in place.\r\n * @param sessionId - the session that just became open.\r\n */\r\nexport function touchTabImpl(state: SessionTabsState, sessionId: SessionId): void {\r\n const next = appendTab(state.tabs, sessionId, state.order + 1)\r\n // Same array => the session already had a tab; nothing changed, so nothing is\r\n // written and no subscriber wakes.\r\n if (next === state.tabs) return\r\n state.order += 1\r\n state.tabs = next\r\n}\r\n\r\n/**\r\n * Store transform: close one tab. Closing a session that has no tab is not a\r\n * state change, so it writes nothing.\r\n * @param state - store draft, mutated in place.\r\n * @param sessionId - the tab to close.\r\n */\r\nexport function closeTabImpl(state: SessionTabsState, sessionId: SessionId): void {\r\n const next = removeTab(state.tabs, sessionId)\r\n if (next.length === state.tabs.length) return\r\n state.tabs = next\r\n}\r\n\r\n/**\r\n * Store transform: adopt tabs loaded from the host, MERGING with whatever is\r\n * already in the strip.\r\n *\r\n * Async by nature (the host read is a `fetch`), so it can land after the browser\r\n * has already opened a tab for the current session. Merging — rather than\r\n * \"ignore the read if the strip is non-empty\" — is what makes a restart safe:\r\n * the tab opened during startup survives AND the stored tabs still come back.\r\n * (Bailing on a non-empty strip would silently drop every stored tab whenever\r\n * the startup tab won the race, which is the common case for a session that is\r\n * running or unread.)\r\n *\r\n * The arrival counter is lifted above every restored key so a tab opened later\r\n * cannot reuse one; a reused key makes React move a chip's DOM node instead of\r\n * reconciling it.\r\n *\r\n * @param state - store draft, mutated in place.\r\n * @param tabs - tabs read from the host, oldest first.\r\n */\r\nexport function restoreTabsImpl(state: SessionTabsState, tabs: readonly SessionTab[]): void {\r\n if (tabs.length === 0) return\r\n const present = new Set(state.tabs.map(tab => tab.sessionId))\r\n const additions: SessionTab[] = []\r\n let order = state.order\r\n for (const tab of tabs) {\r\n // Never duplicate: a session already in the strip keeps its existing entry\r\n // and position.\r\n if (present.has(tab.sessionId)) continue\r\n present.add(tab.sessionId)\r\n // Re-key onto a fresh, monotonically increasing counter so a restored key\r\n // can never collide with one already spent.\r\n order += 1\r\n // Carry the chip's own presentation across the restore: a pinned tab or a\r\n // custom label that came back unpinned/untitled would silently lose the\r\n // user's configuration on every restart.\r\n additions.push({\r\n sessionId: tab.sessionId,\r\n order,\r\n ...(tab.pinned === true ? { pinned: true } : {}),\r\n ...(tab.title !== undefined ? { title: tab.title } : {}),\r\n })\r\n }\r\n if (additions.length > 0) {\r\n const merged = [...state.tabs, ...additions]\r\n // Restored tabs can be pinned, and appending them would park a pinned chip\r\n // past the unpinned ones. Re-establish the pinned-first invariant.\r\n state.tabs = merged.some(isPinned) ? normalizeTabs(merged) : merged\r\n }\r\n state.order = order\r\n}\r\n\r\n/**\r\n * Store transform: pin or unpin one tab.\r\n * @param state - store draft, mutated in place.\r\n * @param sessionId - the tab to toggle.\r\n */\r\nexport function pinTabImpl(state: SessionTabsState, sessionId: SessionId): void {\r\n const next = togglePinTab(state.tabs, sessionId)\r\n if (next === state.tabs) return\r\n state.tabs = next\r\n}\r\n\r\n/**\r\n * Store transform: move one tab to a new index (drag and drop).\r\n * @param state - store draft, mutated in place.\r\n * @param sessionId - the tab being moved.\r\n * @param targetIndex - desired index in the resulting strip.\r\n */\r\nexport function moveTabImpl(state: SessionTabsState, sessionId: SessionId, targetIndex: number): void {\r\n const next = moveTab(state.tabs, sessionId, targetIndex)\r\n if (next === state.tabs) return\r\n state.tabs = next\r\n}\r\n\r\n/**\r\n * Store transform: set or clear one tab's own label.\r\n * @param state - store draft, mutated in place.\r\n * @param sessionId - the tab to relabel.\r\n * @param title - the new label; blank clears it.\r\n */\r\nexport function renameTabImpl(state: SessionTabsState, sessionId: SessionId, title: string | undefined): void {\r\n const next = renameTab(state.tabs, sessionId, title)\r\n if (next === state.tabs) return\r\n state.tabs = next\r\n}\r\n\r\n/**\r\n * Store transform: close every unlisted tab, keeping the pinned ones.\r\n * @param state - store draft, mutated in place.\r\n * @param keepSessionId - the tab to keep.\r\n */\r\nexport function closeOthersImpl(state: SessionTabsState, keepSessionId: SessionId): void {\r\n const next = closeOtherTabs(state.tabs, keepSessionId)\r\n if (next.length === state.tabs.length) return\r\n state.tabs = next\r\n}\r\n\r\n/**\r\n * Store transform: close every tab after one in display order.\r\n * @param state - store draft, mutated in place.\r\n * @param sessionId - the last tab that stays.\r\n */\r\nexport function closeAfterImpl(state: SessionTabsState, sessionId: SessionId): void {\r\n const next = closeTabsAfter(state.tabs, sessionId)\r\n if (next.length === state.tabs.length) return\r\n state.tabs = next\r\n}\r\n","/**\r\n * The session-tab store: the `defineStore` binding and nothing else.\r\n *\r\n * The action TRANSFORMS live in `tabs.ts` (pure, runtime-free), so unit tests\r\n * exercise the real semantics without pulling in the store engine — this module\r\n * is the only place that needs `@deepseek-ai/dsh-client-store`, and importing it\r\n * from a test would drag `zustand` into the test process.\r\n *\r\n * One handle, one scope: the tab store is seated by the `sidebar.workspaces`\r\n * entry alone. The tab strip is a CHILD of that entry (rendered through a DOM\r\n * portal into the conversation column), not a second slot registration, so the\r\n * handle is never mounted under a second, differently-scoped slot — which the\r\n * registry rejects outright (\"one handle, one scope\").\r\n *\r\n * Placement is navigation, not data: the strip derives its active chip from the\r\n * open session, and arrival order is the strip's only order, so nothing here\r\n * mirrors selection.\r\n */\r\nimport { defineStore, type EngineStoreHandle, type StoreHandle } from '@deepseek-ai/dsh-client-store'\r\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\r\nimport {\r\n closeAfterImpl,\r\n closeOthersImpl,\r\n closeTabImpl,\r\n moveTabImpl,\r\n pinTabImpl,\r\n renameTabImpl,\r\n restoreTabsImpl,\r\n touchTabImpl,\r\n type SessionTab,\r\n type SessionTabsState,\r\n} from './tabs.ts'\r\n\r\nexport type { SessionTabsState }\r\n\r\n/**\r\n * Session-tab strip actions (bound by the framework, handed to the browser).\r\n *\r\n * There is deliberately NO \"drop tabs whose session vanished\" action. An open\r\n * tab is closed by the USER and by nothing else — a program that trims the strip\r\n * on its own eventually eats tabs the user wanted, and the whole point of the\r\n * strip is that it holds what you opened.\r\n *\r\n * This is also why the store needs no catalog at all: it never consults one.\r\n */\r\nexport interface SessionTabsActions {\r\n /** Add the open session, or leave its existing tab untouched in place. */\r\n touch: (sessionId: SessionId) => void\r\n /** Close one tab; navigation is untouchable from here (the caller decides). */\r\n close: (sessionId: SessionId) => void\r\n /**\r\n * Replace the strip with tabs loaded from the host.\r\n *\r\n * The host read is a `fetch`, so it cannot happen inside `init()`. This action\r\n * is how the async result lands, and it is a no-op once the user has already\r\n * opened a tab — a slow response must never discard what they just did.\r\n */\r\n restore: (tabs: readonly SessionTab[]) => void\r\n /** Pin or unpin one tab (re-inserts it at the block boundary). */\r\n pin: (sessionId: SessionId) => void\r\n /** Move one tab to an index in the resulting strip (drag and drop). */\r\n move: (sessionId: SessionId, targetIndex: number) => void\r\n /** Set (or clear, with a blank value) one tab's own label. */\r\n rename: (sessionId: SessionId, title: string | undefined) => void\r\n /** Close everything except one tab; pinned tabs are kept. */\r\n closeOthers: (sessionId: SessionId) => void\r\n /** Close every tab after one in display order. */\r\n closeAfter: (sessionId: SessionId) => void\r\n}\r\n\r\n/** Annotation twin of the actions literal below (structural `ActionsDecl`). */\r\ntype SessionTabsActionsDecl = {\r\n touch: typeof touchTabImpl\r\n close: typeof closeTabImpl\r\n restore: typeof restoreTabsImpl\r\n pin: typeof pinTabImpl\r\n move: typeof moveTabImpl\r\n rename: typeof renameTabImpl\r\n closeOthers: typeof closeOthersImpl\r\n closeAfter: typeof closeAfterImpl\r\n}\r\n\r\n/**\r\n * The tab store's registered handle: identity + spec + the instance factory the\r\n * framework resolves per entry x scope. It deliberately does NOT claim the live\r\n * instance's faces (`getSnapshot` / `actions`) — `defineStore`'s concrete return\r\n * is structurally narrower, and this alias has to stay a type that value can be\r\n * assigned to.\r\n */\r\nexport type SessionTabsStoreHandle = StoreHandle\r\n\r\n/**\r\n * The live tab store value: the handle's `create()` product, which carries the\r\n * baked write set and the snapshot source. Named here so the registrations and\r\n * the strip's props can share one type without importing the store engine.\r\n */\r\nexport type SessionTabsInstance = ReturnType['create']>\r\n\r\n/**\r\n * Create the session-tab store handle.\r\n *\r\n * The strip starts EMPTY and is hydrated by the caller through the `restore`\r\n * action: persistence lives on the host behind a `fetch`, which cannot run\r\n * during `init()`. Browser storage is deliberately not used — the origin\r\n * includes the port, and every launch picks a new one, so `localStorage` and\r\n * `sessionStorage` both start empty on the next start.\r\n *\r\n * @returns the store handle (spec + type + identity + factory in one).\r\n */\r\nexport function createSessionTabsStore(): EngineStoreHandle {\r\n return defineStore({\r\n init: (): SessionTabsState => ({ tabs: [], order: 0 }),\r\n actions: {\r\n touch: touchTabImpl,\r\n close: closeTabImpl,\r\n restore: restoreTabsImpl,\r\n pin: pinTabImpl,\r\n move: moveTabImpl,\r\n rename: renameTabImpl,\r\n closeOthers: closeOthersImpl,\r\n closeAfter: closeAfterImpl,\r\n },\r\n })\r\n}\r\n\r\nexport type { SessionTab }","/**\r\n * Client side of the session-tab persistence, talking to\r\n * `GET|PUT /workspace-groups/tabs` on the host.\r\n *\r\n * Why not browser storage: **the origin includes the PORT**, and every `dsh web`\r\n * / `dsh test` / desktop launch picks a different one. `localStorage` and\r\n * `sessionStorage` are both scoped to the origin, so they start empty on the\r\n * next launch — a tab list kept there survives a reload only when the port\r\n * happens to match. The host's JSON sidecar has no such problem, which is why\r\n * the strip is stored there and read back verbatim.\r\n *\r\n * There is deliberately no per-browser-session marker. A marker has to live in\r\n * browser storage, which the port invalidates, so every restart looked like a\r\n * fresh session and silently discarded the user's tabs — the exact failure this\r\n * module exists to prevent.\r\n *\r\n * Every call is best-effort: a failed read means \"no tabs\" and a failed write is\r\n * swallowed, because the strip is a convenience and must never break the app.\r\n */\r\n\r\n/** Host route holding the strip. */\r\nexport const TABS_ROUTE = '/workspace-groups/tabs'\r\n\r\n/** One tab as it crosses the wire. */\r\nexport interface WireTab {\r\n readonly sessionId: string\r\n readonly order: number\r\n /** Pinned tabs are restored at the front of the strip. */\r\n readonly pinned?: boolean\r\n /** A label the user typed for the tab itself (absent = follow the session). */\r\n readonly title?: string\r\n}\r\n\r\n/**\r\n * Read one tab row off the wire, dropping the row when it is unusable.\r\n * @param entry - one element of the stored `tabs` array.\r\n * @returns the tab, or null for a malformed row.\r\n */\r\nfunction parseWireTab(entry: unknown): WireTab | null {\r\n if (typeof entry !== 'object' || entry === null) return null\r\n const row = entry as Record\r\n if (typeof row.sessionId !== 'string' || row.sessionId === '') return null\r\n if (typeof row.order !== 'number' || !Number.isFinite(row.order)) return null\r\n const pinned = row.pinned === true\r\n const title = typeof row.title === 'string' && row.title.trim() !== '' ? row.title.trim() : undefined\r\n return {\r\n sessionId: row.sessionId,\r\n order: row.order,\r\n ...(pinned ? { pinned: true } : {}),\r\n ...(title !== undefined ? { title } : {}),\r\n }\r\n}\r\n\r\n/**\r\n * Fetch the stored strip.\r\n * @param fetchImpl - fetch implementation (injectable for tests).\r\n * @returns the tabs, oldest first; empty on any failure.\r\n */\r\nexport async function loadTabs(fetchImpl: typeof fetch = fetch): Promise {\r\n try {\r\n const response = await fetchImpl(TABS_ROUTE, {\r\n method: 'GET',\r\n // Per-session state; a cached response would restore stale tabs.\r\n cache: 'no-store',\r\n })\r\n if (!response.ok) return []\r\n const body: unknown = await response.json()\r\n if (typeof body !== 'object' || body === null) return []\r\n const list = (body as { tabs?: unknown }).tabs\r\n if (!Array.isArray(list)) return []\r\n const tabs: WireTab[] = []\r\n for (const entry of list) {\r\n const tab = parseWireTab(entry)\r\n if (tab !== null) tabs.push(tab)\r\n }\r\n return tabs\r\n } catch {\r\n return []\r\n }\r\n}\r\n\r\n/**\r\n * Store the strip. Failures are swallowed.\r\n * @param state - the client's current strip and its arrival counter.\r\n * @param fetchImpl - fetch implementation (injectable for tests).\r\n */\r\nexport async function saveTabs(\r\n state: { order: number; tabs: readonly WireTab[] },\r\n fetchImpl: typeof fetch = fetch,\r\n): Promise {\r\n try {\r\n await fetchImpl(TABS_ROUTE, {\r\n method: 'PUT',\r\n headers: { 'Content-Type': 'application/json' },\r\n body: JSON.stringify({ order: state.order, tabs: state.tabs }),\r\n cache: 'no-store',\r\n // Survive a navigation that happens while the request is in flight; the\r\n // write is idempotent so a re-send is harmless.\r\n keepalive: true,\r\n })\r\n } catch {\r\n // Offline or the host is restarting: the next change writes the full state\r\n // again, so nothing is lost beyond this tick.\r\n }\r\n}\r\n","/**\r\n * A framework-shaped selector hook over a store instance.\r\n *\r\n * The renderer builds this hook for slot seats (`bindSnapshotSelector` in\r\n * ui-renderer, wrapping React's `useSyncExternalStoreWithSelector`), but the tab\r\n * strip is NOT a slot occupant: it renders through a DOM seat as a child of this\r\n * plugin's own `sidebar.workspaces` occupant, so it receives its store face as a\r\n * plain prop and needs the equivalent binding here.\r\n *\r\n * The implementation mirrors React's `useSyncExternalStoreWithSelector` without\r\n * depending on the `use-sync-external-store` package (it is not resolvable from\r\n * this plugin). The two behaviours that matter:\r\n *\r\n * - identity-stable subscribe/getSnapshot closures, so the strip never\r\n * resubscribes across renders;\r\n * - a memoized selection: the selector re-runs only when the state reference\r\n * changes, and an equal result (by `eq`, defaulting to `Object.is`) returns\r\n * the PREVIOUS reference, so a selector allocating a fresh array or object\r\n * does not spin the render loop.\r\n *\r\n * The hook must be called unconditionally (Rules of Hooks).\r\n */\r\nimport { useCallback, useRef, useSyncExternalStore } from 'react'\r\nimport type { ActionsDecl, StoreInstance } from '@deepseek-ai/dsh-client-store'\r\n\r\n/** One memory cell: the state it was derived from, and the value it produced. */\r\ninterface Selection {\r\n state: T\r\n value: S\r\n /** Whether `value` was produced by the selector (vs. carried over as equal). */\r\n hasValue: boolean\r\n}\r\n\r\n/**\r\n * Build a selector hook bound to one store instance.\r\n * @param instance - the live store instance (snapshot source).\r\n * @returns a `SnapshotSelectorHook`-compatible hook over that instance.\r\n */\r\nexport function createStoreHook>(\r\n instance: StoreInstance,\r\n): (selector: (state: T) => S, eq?: (a: S, b: S) => boolean) => S {\r\n // Captured once: stable closures keep uSES from resubscribing every render.\r\n const subscribe = (onChange: () => void): (() => void) => instance.subscribe(onChange)\r\n const getState = (): T => instance.getSnapshot()\r\n\r\n return function useSelector(\r\n selector: (state: T) => S,\r\n eq?: (a: S, b: S) => boolean,\r\n ): S {\r\n // Seeded eagerly so the first render selects without an extra pass.\r\n const memory = useRef | null>(null)\r\n\r\n // Re-select the value for the current state. Called by uSES on every\r\n // notification AND on every render; the memory makes it cheap and\r\n // reference-stable.\r\n const getSelection = useCallback((): S => {\r\n const state = getState()\r\n const previous = memory.current\r\n\r\n // Same state object => the previous value is still valid. This is the\r\n // path that lets an allocating selector stay reference-stable.\r\n if (previous !== null && previous.hasValue && Object.is(previous.state, state)) {\r\n return previous.value\r\n }\r\n\r\n const value = selector(state)\r\n\r\n // New state, but an equal value: carry the old reference forward so uSES\r\n // sees no change and skips the re-render.\r\n if (previous !== null && previous.hasValue) {\r\n const equal = eq !== undefined ? eq(previous.value, value) : Object.is(previous.value, value)\r\n if (equal) {\r\n memory.current = { state, value: previous.value, hasValue: true }\r\n return previous.value\r\n }\r\n }\r\n\r\n memory.current = { state, value, hasValue: true }\r\n return value\r\n }, [selector, eq])\r\n\r\n // The third argument is the server snapshot; the client plugin never\r\n // server-renders, so the same getter is correct for both.\r\n return useSyncExternalStore(subscribe, getSelection, getSelection)\r\n }\r\n}\r\n","/**\r\n * Shared config types for @dsh-xhl/workspace-groups. Pure types (zero runtime\r\n * deps) so both halves — the node half (sidecar YAML reading) and the\r\n * browser half (tree derivation) — compile against the same contract.\r\n */\r\n\r\n/** One classification rule: any rule that matches places the workspace in the category. */\r\nexport interface GroupRule {\r\n /** Absolute path prefix match (normalized, case-sensitive). */\r\n pathPrefix?: string\r\n /** Case-insensitive substring match against the workspace display title. */\r\n nameContains?: string\r\n /** Case-insensitive substring match against the workspace directory basename. */\r\n basenameContains?: string\r\n /** Exact absolute path match (normalized). */\r\n pathExact?: string\r\n}\r\n\r\n/** One category folder in the sidebar tree. */\r\nexport interface GroupCategory {\r\n /** Display label of the category folder. */\r\n name: string\r\n /** Rules; a workspace is classified here when ANY rule matches. */\r\n rules: GroupRule[]\r\n}\r\n\r\n/** Theme-safe palette id for a group's accent. */\r\nexport type GroupColor =\r\n | 'red' | 'orange' | 'amber' | 'green' | 'teal'\r\n | 'blue' | 'indigo' | 'purple' | 'pink' | 'gray'\r\n\r\n/** Whitelist shared by the host write-validation and the client picker. */\r\nexport const GROUP_COLORS: readonly GroupColor[] = [\r\n 'red', 'orange', 'amber', 'green', 'teal',\r\n 'blue', 'indigo', 'purple', 'pink', 'gray',\r\n]\r\n\r\n/** Curated icon ids (rendered from @deepseek-ai/dsh-client-ui-primitives). */\r\nexport const GROUP_ICON_IDS = [\r\n 'folder', 'workspace', 'code', 'plugin', 'skill', 'data',\r\n 'database', 'api', 'plan', 'goal', 'light', 'globe',\r\n 'archive', 'branch', 'users', 'clock', 'shield', 'checklist',\r\n 'sparkle', 'tree',\r\n 'chat', 'search', 'settings', 'document', 'edit', 'think',\r\n 'agent', 'browse', 'context', 'link', 'share', 'user',\r\n 'send', 'attachment', 'download', 'play', 'design', 'moon',\r\n 'monitor', 'gauge', 'queue', 'notes', 'inspect', 'help',\r\n 'info', 'alarm', 'compare', 'done', 'pin', 'microphone',\r\n // Materials & Lab family (appended: the first 50 ids keep their order because\r\n // saved configs address icons by id, never by position).\r\n // Lab operations\r\n 'test-tube', 'flask', 'pipette', 'dropper', 'stirrer', 'hotplate', 'centrifuge', 'balance',\r\n // Material structures\r\n 'atom', 'molecule', 'lattice', 'layered', 'framework', 'thin-film', 'fiber', 'hydrogel',\r\n // Characterization\r\n 'microscope', 'xrd', 'spectrum', 'tensile', 'electrode', 'iv-curve',\r\n // Functional devices\r\n 'illumination', 'temperature', 'humidity', 'actuator', 'flex-sensor', 'battery',\r\n] as const\r\n\r\n/** Derived from the shared registry so host validation and UI cannot drift. */\r\nexport type GroupIconId = (typeof GROUP_ICON_IDS)[number]\r\n\r\n/**\r\n * Presentation metadata for one group. Every field optional.\r\n *\r\n * The explicit `| undefined` on each field is what lets a UI patch clear a\r\n * value (`pruneAppearance` then drops it): under `exactOptionalPropertyTypes`\r\n * a bare `color?: GroupColor` would reject `{ color: undefined }`.\r\n */\r\nexport interface CategoryAppearance {\r\n /** Palette id; the CSS palette lives in styles.css `[data-wg-color]`. */\r\n color?: GroupColor | undefined\r\n /** `GroupIconId` preset id, or a short glyph (1–4 Unicode code points, emoji/latin). */\r\n icon?: string | undefined\r\n /** Pinned groups sort before unpinned ones (within the manual order). */\r\n pinned?: boolean | undefined\r\n}\r\n\r\n/** The full sidecar configuration (mirrors workspace-groups.yaml). */\r\nexport interface GroupsConfig {\r\n /** Category folders, in render order. First match wins. */\r\n categories: GroupCategory[]\r\n /**\r\n * Runtime grouping overlay (manual groups + per-workspace overrides).\r\n * Optional: the YAML file itself never carries it — the host GET route\r\n * merges it from `workspace-groups.manual.json`, and the browser PUT route\r\n * replaces it whole.\r\n */\r\n manual?: ManualGroups\r\n}\r\n\r\n/**\r\n * Runtime-managed grouping overlay: groups created in the sidebar UI plus\r\n * per-workspace category overrides and user-controlled ordering. Owned by the\r\n * plugin (JSON sidecar, `$DSH_HOME/workspace-groups.manual.json`), never\r\n * written back into the operator YAML.\r\n *\r\n * All new fields are optional for backward compatibility (files written by\r\n * older plugin versions keep working); rendering falls back to sensible\r\n * defaults when they are absent. Note that an older plugin version writes the\r\n * whole file back, which silently drops fields it does not know about — e.g.\r\n * `appearance` (group color / icon / pin) is lost after a downgrade.\r\n */\r\nexport interface ManualGroups {\r\n /**\r\n * Monotonic write counter, owned by the host (same contract as the folder\r\n * overlay): a PUT whose revision does not match the stored one is\r\n * rejected with 409 instead of silently overwriting another window's\r\n * edits. Absent in files written before revisions existed — read as 0.\r\n */\r\n revision?: number\r\n /**\r\n * Manually created category folder names. These have no rules — they render\r\n * even while empty (a new group appears before anything is dragged into\r\n * it) and hold only workspaces assigned to them.\r\n */\r\n categories: string[]\r\n /**\r\n * Per-workspace category override, keyed by workspace id. Value is a\r\n * category display name (rule or manual), or `null` to force the workspace\r\n * into the uncategorized bucket even when a rule would match. An absent\r\n * key means \"classify by rules\".\r\n */\r\n assignments: Record\r\n /**\r\n * Display order of all category keys (rule display names + manual names).\r\n * The uncategorized bucket is never listed — it always renders last.\r\n * Absent = rule categories first (YAML order), manual groups appended in\r\n * creation order.\r\n */\r\n categoryOrder?: string[]\r\n /**\r\n * Per-category ordered workspace ids (user drag-reorder within a group).\r\n * Keyed by category display name; absent key = host registration order.\r\n */\r\n workspaceOrder?: Record\r\n /**\r\n * Rule category rename overrides: original YAML rule category name →\r\n * display name (UI rename of a rule group). Rules still classify by the\r\n * original name; only the rendered label/keys change.\r\n */\r\n renamed?: Record\r\n /**\r\n * Rule category original names hidden by a UI delete. Hidden rules are\r\n * inert: workspaces matching them become top-level (ungrouped).\r\n */\r\n hidden?: string[]\r\n /**\r\n * Per-group presentation, keyed by category DISPLAY name (same key space as\r\n * `categoryOrder`). Optional per field; an absent group has no presentation.\r\n * Dangling keys (a YAML category that no longer exists) are tolerated on read\r\n * and on write — see validateManualGroups.\r\n */\r\n appearance?: Record\r\n}\r\n\r\n/**\r\n * Legacy label of the fallback bucket. The top-level (ungrouped) concept\r\n * replaced the rendered \"未分类\" bucket: workspaces in no group render as\r\n * top-level rows beside the group folders. The constant survives for data\r\n * compatibility (reserved name, assignment null marker).\r\n */\r\nexport const UNCATEGORIZED_LABEL = '未分类'\r\n\r\n/**\r\n * Reserved key under `workspaceOrder` holding the manual order of TOP-LEVEL\r\n * (ungrouped) project rows. Distinct from any real group display name (a group\r\n * may not be named this), so it can never collide; the top-level list's order\r\n * is preserved exactly like a group's, and top-level rows can be reordered by\r\n * dragging.\r\n */\r\nexport const TOP_LEVEL_ORDER_KEY = '__topLevel__'\r\n\r\n/** Normalize a path for prefix matching: trailing slashes stripped. */\r\nexport function normalizePath(path: string): string {\r\n return path.replace(/[/\\\\]+$/, '')\r\n}\r\n","/**\r\n * Pure classification + ordering logic: decides which category a workspace\r\n * belongs to and how categories/workspaces are ordered. Shared by the host\r\n * half (validation) and the client half (tree derivation), so the semantics\r\n * can never drift between the config surface and the rendered tree.\r\n *\r\n * Category identity: a category's STABLE origin is its YAML rule category\r\n * name (or a manual-group name). Its DISPLAY key is what the tree renders and\r\n * what assignments reference — for rule categories that is the rename\r\n * override when present. Hidden rule categories are inert: workspaces that\r\n * would match them become top-level (ungrouped).\r\n */\r\nimport {\r\n normalizePath,\r\n UNCATEGORIZED_LABEL,\r\n type CategoryAppearance,\r\n type GroupCategory,\r\n type GroupRule,\r\n type GroupsConfig,\r\n type ManualGroups,\r\n} from './types.ts'\r\n\r\n/** One rule match against a workspace's path and title. */\r\nfunction ruleMatches(rule: GroupRule, path: string, title: string): boolean {\r\n const normalized = normalizePath(path)\r\n if (rule.pathPrefix !== undefined && normalized.startsWith(normalizePath(rule.pathPrefix))) return true\r\n if (rule.pathExact !== undefined && normalized === normalizePath(rule.pathExact)) return true\r\n if (rule.nameContains !== undefined && title.toLowerCase().includes(rule.nameContains.toLowerCase())) return true\r\n if (rule.basenameContains !== undefined) {\r\n const base = path.replace(/[/\\\\]+$/, '').split(/[/\\\\]/).pop() ?? ''\r\n if (base.toLowerCase().includes(rule.basenameContains.toLowerCase())) return true\r\n }\r\n return false\r\n}\r\n\r\n/** Classify a workspace by rules only; hidden categories are inert. */\r\nexport function classify(categories: readonly GroupCategory[], path: string, title: string): GroupCategory | undefined {\r\n for (const category of categories) {\r\n if (category.rules.some(rule => ruleMatches(rule, path, title))) return category\r\n }\r\n return undefined\r\n}\r\n\r\n/** Display name of a rule category: the rename override when present. */\r\nexport function ruleDisplayName(manual: ManualGroups | undefined, originalName: string): string {\r\n return manual?.renamed?.[originalName] ?? originalName\r\n}\r\n\r\n/** Whether a rule category has been hidden by a UI delete. */\r\nexport function isHiddenRule(manual: ManualGroups | undefined, originalName: string): boolean {\r\n return manual?.hidden?.includes(originalName) ?? false\r\n}\r\n\r\n/** Presentation for a category display key, or undefined when unset. */\r\nexport function categoryAppearance(\r\n manual: ManualGroups | undefined,\r\n key: string,\r\n): CategoryAppearance | undefined {\r\n return manual?.appearance?.[key]\r\n}\r\n\r\n/** Whether a category display key is pinned. */\r\nexport function isCategoryPinned(manual: ManualGroups | undefined, key: string): boolean {\r\n return categoryAppearance(manual, key)?.pinned === true\r\n}\r\n\r\n/**\r\n * Drop empty presentation fields: `undefined` values, `pinned: false`, `icon: ''`.\r\n * Returns undefined when nothing is left, so callers can delete the whole entry.\r\n */\r\nexport function pruneAppearance(value: CategoryAppearance): CategoryAppearance | undefined {\r\n const result: CategoryAppearance = {}\r\n if (value.color !== undefined) result.color = value.color\r\n if (value.icon !== undefined && value.icon.trim() !== '') result.icon = value.icon\r\n if (value.pinned === true) result.pinned = true\r\n return Object.keys(result).length === 0 ? undefined : result\r\n}\r\n\r\n/** Rule category display names, in YAML render order (hidden ones excluded). */\r\nexport function ruleDisplayNames(categories: readonly GroupCategory[], manual: ManualGroups | undefined): string[] {\r\n const names: string[] = []\r\n for (const category of categories) {\r\n if (isHiddenRule(manual, category.name)) continue\r\n names.push(ruleDisplayName(manual, category.name))\r\n }\r\n return names\r\n}\r\n\r\n/** Original YAML rule name whose display name equals `key` (undefined when none). */\r\nexport function originalRuleNameForDisplay(\r\n categories: readonly GroupCategory[],\r\n manual: ManualGroups | undefined,\r\n key: string,\r\n): string | undefined {\r\n return categories.find(c => ruleDisplayName(manual, c.name) === key)?.name\r\n}\r\n\r\n/**\r\n * Effective category entries in display order: rule categories (YAML order,\r\n * hidden skipped, renamed applied) first, then manual-only groups in\r\n * creation order — unless `manual.categoryOrder` overrides the sequence.\r\n * Top-level (ungrouped) workspaces are never included; they render as\r\n * separate top-level rows after the group folders.\r\n *\r\n * The pin partition is part of DISPLAY ORDER, not a render-time concern:\r\n * pinned groups sort before unpinned ones *within* the manual order, and both\r\n * the tree and the drag-drop landing neighbours read this list, so they can\r\n * never disagree about what sits next to what.\r\n */\r\nexport interface EffectiveCategory {\r\n /** Display key (what the tree renders and assignments reference). */\r\n key: string\r\n /** Origin: a YAML rule category or a manual group. */\r\n source: 'rule' | 'manual'\r\n}\r\n\r\n/** Apply `manual.categoryOrder` to the default sequence (stable). */\r\nfunction orderByCategoryOrder(\r\n entries: EffectiveCategory[],\r\n order: readonly string[] | undefined,\r\n): EffectiveCategory[] {\r\n if (order === undefined || order.length === 0) return entries\r\n // Stable sort by position in categoryOrder; entries absent from the order\r\n // keep their relative default position after all ordered ones.\r\n const position = new Map(order.map((key, index) => [key, index]))\r\n return [...entries].sort((a, b) => {\r\n const pa = position.get(a.key)\r\n const pb = position.get(b.key)\r\n if (pa !== undefined && pb !== undefined) return pa - pb\r\n if (pa !== undefined) return -1\r\n if (pb !== undefined) return 1\r\n return 0\r\n })\r\n}\r\n\r\n/** Stable partition: pinned groups first, unpinned ones keep their order. */\r\nfunction pinnedFirst(entries: EffectiveCategory[], manual: ManualGroups | undefined): EffectiveCategory[] {\r\n if (manual?.appearance === undefined) return entries\r\n const pinned = (entry: EffectiveCategory): number => Number(isCategoryPinned(manual, entry.key))\r\n return [...entries].sort((a, b) => pinned(b) - pinned(a))\r\n}\r\n\r\nexport function effectiveCategories(\r\n config: GroupsConfig,\r\n manual: ManualGroups | undefined,\r\n): EffectiveCategory[] {\r\n const entries: EffectiveCategory[] = []\r\n const seen = new Set()\r\n for (const category of config.categories) {\r\n if (isHiddenRule(manual, category.name)) continue\r\n const key = ruleDisplayName(manual, category.name)\r\n if (seen.has(key)) continue\r\n seen.add(key)\r\n entries.push({ key, source: 'rule' })\r\n }\r\n for (const name of manual?.categories ?? []) {\r\n if (seen.has(name)) continue\r\n seen.add(name)\r\n entries.push({ key: name, source: 'manual' })\r\n }\r\n return pinnedFirst(orderByCategoryOrder(entries, manual?.categoryOrder), manual)\r\n}\r\n\r\n/** Display keys of all effective categories (top-level workspaces excluded). */\r\nexport function displayCategoryKeys(config: GroupsConfig, manual: ManualGroups | undefined): string[] {\r\n return effectiveCategories(config, manual).map(e => e.key)\r\n}\r\n\r\n/**\r\n * Resolve the category key a workspace renders under, or `undefined` when it\r\n * is top-level (ungrouped). Precedence: manual override (`null` = forced\r\n * top-level) → rule classification (hidden rules inert) → top-level.\r\n */\r\nexport function resolveCategory(\r\n config: GroupsConfig,\r\n manual: ManualGroups | undefined,\r\n workspaceId: string,\r\n path: string,\r\n title: string,\r\n): string | undefined {\r\n const override = manual?.assignments[workspaceId]\r\n if (override !== undefined) return override ?? undefined // null forces top-level\r\n const matched = classify(config.categories, path, title)\r\n if (matched === undefined) return undefined\r\n if (isHiddenRule(manual, matched.name)) return undefined\r\n return ruleDisplayName(manual, matched.name)\r\n}\r\n\r\n/** Whether a category key is a manual-only group (manageable via list). */\r\nexport function isManualOnlyCategory(\r\n config: GroupsConfig,\r\n manual: ManualGroups | undefined,\r\n key: string,\r\n): boolean {\r\n return (manual?.categories.includes(key) ?? false) && !ruleDisplayNames(config.categories, manual).includes(key)\r\n}\r\n\r\n/**\r\n * Names that may not be used for a new/renamed group: the legacy reserved\r\n * label plus every current display key.\r\n */\r\nexport function takenCategoryNames(config: GroupsConfig, manual: ManualGroups | undefined): Set {\r\n const taken = new Set(displayCategoryKeys(config, manual))\r\n taken.add(UNCATEGORIZED_LABEL)\r\n return taken\r\n}\r\n\r\n/**\r\n * Order a bucket of workspace ids: the stored per-category order first\r\n * (filtered to actual members), then any remaining members in `fallback`\r\n * (host) order. Deterministic; the renderer never re-sorts on its own.\r\n */\r\nexport function orderedWorkspaceIds(\r\n manual: ManualGroups | undefined,\r\n categoryKey: string,\r\n members: readonly string[],\r\n): string[] {\r\n const stored = manual?.workspaceOrder?.[categoryKey]\r\n if (stored === undefined || stored.length === 0) return [...members]\r\n const memberSet = new Set(members)\r\n const ordered: string[] = []\r\n const seen = new Set()\r\n for (const id of stored) {\r\n if (!memberSet.has(id) || seen.has(id)) continue\r\n seen.add(id)\r\n ordered.push(id)\r\n }\r\n for (const id of members) {\r\n if (seen.has(id)) continue\r\n ordered.push(id)\r\n }\r\n return ordered\r\n}\r\n\r\n/** Move `id` before `beforeId` (undefined = append) within an ordered list. */\r\nexport function moveBefore(list: readonly string[], id: string, beforeId: string | undefined): string[] {\r\n const rest = list.filter(x => x !== id)\r\n if (beforeId === undefined) return [...rest, id]\r\n const index = rest.indexOf(beforeId)\r\n if (index === -1) return [...rest, id]\r\n rest.splice(index, 0, id)\r\n return rest\r\n}\r\n\r\n/** Move `id` after `afterId` (undefined = append) within an ordered list. */\r\nexport function moveAfter(list: readonly string[], id: string, afterId: string | undefined): string[] {\r\n const rest = list.filter(x => x !== id)\r\n if (afterId === undefined) return [...rest, id]\r\n const index = rest.indexOf(afterId)\r\n if (index === -1) return [...rest, id]\r\n rest.splice(index + 1, 0, id)\r\n return rest\r\n}\r\n","/**\r\n * Plugin-owned projection of descendant counts from Session summaries.\r\n *\r\n * 0.1.2 移除了 `@deepseek-ai/dsh-client-runtime/client`(平台模块表不再提供\r\n * `indexSubagentDescendants`),官方 ui-workspace 改为各自持有本地副本\r\n * (packages/client/ui-workspace/src/client/subagent-lineage.ts,MIT)。这里\r\n * 保持同一实现,使运行中的子代理会话数在树行上继续可见。\r\n */\r\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\r\n\r\ninterface LineageEntry {\r\n readonly id: SessionId\r\n readonly parentId?: SessionId\r\n readonly origin?: 'subagent'\r\n readonly running: boolean\r\n}\r\n\r\n/** Descendant counts for one possible parent Session. */\r\nexport interface SubagentDescendantSummary {\r\n readonly count: number\r\n readonly runningCount: number\r\n}\r\n\r\n/**\r\n * Index uninterrupted subagent descendants under each ancestor.\r\n * @param summaries - Session summaries keyed by id.\r\n * @returns descendant totals keyed by possible parent id.\r\n */\r\nexport function indexSubagentDescendants(\r\n summaries: Readonly>,\r\n): ReadonlyMap {\r\n const indexed = new Map()\r\n for (const descendant of Object.values(summaries)) {\r\n if (descendant.origin !== 'subagent') continue\r\n const seen = new Set()\r\n let current: LineageEntry | undefined = descendant\r\n while (current?.origin === 'subagent' && current.parentId !== undefined && !seen.has(current.id)) {\r\n seen.add(current.id)\r\n const aggregate = indexed.get(current.parentId)\r\n if (aggregate === undefined) {\r\n indexed.set(current.parentId, { count: 1, runningCount: descendant.running ? 1 : 0 })\r\n } else {\r\n aggregate.count += 1\r\n if (descendant.running) aggregate.runningCount += 1\r\n }\r\n current = summaries[current.parentId]\r\n }\r\n }\r\n return indexed\r\n}\r\n","/**\r\n * Recognising the Host's own default workspace (\"默认工作区\").\r\n *\r\n * The workspace snapshot carries no `isDefault` flag, so the only Host-owned\r\n * signal is the one the Host itself uses: the registry title. Its\r\n * `workspaceDisplayTitle()` treats a title equal to `DEFAULT_WORKSPACE_DIRECTORY`\r\n * as \"the default workspace\" and swaps in a localized label. That constant lives\r\n * in the workspace-controller package, which this plugin must not import at\r\n * runtime (it is a client bundle), so the string is mirrored here.\r\n *\r\n * Two Host signals are combined:\r\n * - the registry title (primary: exactly what the Host substitutes for);\r\n * - the Host's own directory layout (`/deepseek-harness/default-workspace`),\r\n * which still identifies the workspace after the user renames it.\r\n * A user-created directory that merely happens to be called \"default-workspace\"\r\n * somewhere else on disk is NOT treated as the default workspace, and no single\r\n * directory name is used as the sole test.\r\n */\r\n\r\n/** Directory name the Host uses for its default workspace (host mirror). */\r\nexport const DEFAULT_WORKSPACE_TITLE = 'default-workspace'\r\n\r\n/** Parent directory the Host creates inside for its state. */\r\nconst HOST_STATE_DIRECTORY = 'deepseek-harness'\r\n\r\n/** The fields the identification needs from a workspace snapshot. */\r\nexport interface DefaultWorkspaceIdentity {\r\n /** Registry title (`WorkspaceView.title`). */\r\n title?: string | undefined\r\n /** Absolute workspace directory (`WorkspaceView.path`). */\r\n path?: string | undefined\r\n}\r\n\r\n/**\r\n * Whether a workspace snapshot is the Host's default workspace.\r\n * @param workspace - workspace snapshot (title is the primary signal, path the fallback).\r\n */\r\nexport function isDefaultWorkspace(workspace: DefaultWorkspaceIdentity): boolean {\r\n if (workspace.title?.trim().toLowerCase() === DEFAULT_WORKSPACE_TITLE) return true\r\n const path = (workspace.path ?? '').replace(/[/\\\\]+$/u, '')\r\n if (path === '') return false\r\n const segments = path.split(/[/\\\\]+/u)\r\n const base = segments[segments.length - 1]?.toLowerCase()\r\n return base === DEFAULT_WORKSPACE_TITLE\r\n && segments.some(segment => segment.toLowerCase() === HOST_STATE_DIRECTORY)\r\n}\r\n","/**\r\n * Pure folder-list logic for per-workspace multi-root folders.\r\n *\r\n * DSH core gives a workspace exactly ONE canonical directory\r\n * (`WorkspaceView.path`). This module layers a plugin-owned list of EXTRA\r\n * folders on top of it, plus one designated root folder per workspace:\r\n *\r\n * - the canonical directory is always folder #0 (the \"base\"); it cannot be\r\n * removed and may be the root;\r\n * - `root` is stored only when it names an EXTRA folder — \"base is the root\"\r\n * is expressed by omitting the key, so the base path is never duplicated\r\n * into the sidecar;\r\n * - a session whose recorded `cwd` lives inside an extra folder belongs to\r\n * that folder, not to the project row.\r\n *\r\n * Everything here is pure and platform-agnostic: it imports no React, no DOM\r\n * and no cordis so plain Node (the verifier, the host route) can load it.\r\n */\r\n\r\n/** Kind of a member folder: a plain local directory, or an SSH-mirrored one. */\r\nexport type FolderMemberKind = 'local' | 'remote'\r\n\r\n/**\r\n * A folder row that is backed by its OWN DSH workspace (\"member\").\r\n *\r\n * Plain extra folders ( {@link WorkspaceFolderEntry.folders} ) live inside the\r\n * owner's canonical directory tree and their sessions run with the OWNER's\r\n * workspace id. A member has a directory the owner cannot reach that way — a\r\n * remote (mirror-backed) folder, or a local directory added to a remote project\r\n * — so the platform registers a real workspace for it and the row delegates\r\n * session creation to that workspace id. The member's own workspace row is\r\n * hidden from the sidebar while some entry lists it (see\r\n * {@link absorbedWorkspaceIds}), so the project reads as one project with both\r\n * kinds of folders.\r\n */\r\nexport interface FolderMember {\r\n /** Absolute LOCAL path of the member workspace (its canonical directory). */\r\n readonly path: string\r\n /** Native DSH workspace id backing this folder row. */\r\n readonly workspaceId: string\r\n readonly kind: FolderMemberKind\r\n /** Remote root, when `kind` is 'remote' (`~`, `~/proj`, `/srv/proj`). */\r\n readonly remotePath?: string\r\n /** SSH connection profile id, when `kind` is 'remote'. */\r\n readonly profileId?: string\r\n /** remote-ssh's own record id, when `kind` is 'remote'. */\r\n readonly recordId?: string\r\n /** Display title the platform gave the member workspace. */\r\n readonly title?: string\r\n}\r\n\r\n/** Folders attached to one workspace: EXTRA folders only (the base is implicit). */\r\nexport interface WorkspaceFolderEntry {\r\n /**\r\n * Plain local extra folders: directories the owner workspace can address\r\n * directly, so their sessions keep the owner's workspace id.\r\n */\r\n readonly folders: readonly string[]\r\n /** Workspace-backed extra folders (remote mirrors, or local on a remote owner). */\r\n readonly members?: readonly FolderMember[]\r\n readonly root?: string\r\n}\r\n\r\n/** The whole `workspace-groups.folders.json` document. */\r\nexport interface FoldersDocument {\r\n readonly version: 1\r\n /**\r\n * Monotonic write counter, owned by the host: every accepted PUT bumps it\r\n * and a PUT whose revision does not match the stored one is rejected\r\n * (409), so two windows can no longer silently overwrite each other's\r\n * edits. Absent in documents written before revisions existed — read as 0.\r\n */\r\n readonly revision?: number\r\n readonly workspaces: Readonly>\r\n}\r\n\r\n/** Canonical empty document, shared so callers need not allocate one each time. */\r\nexport const EMPTY_FOLDERS_DOCUMENT: FoldersDocument = { version: 1, revision: 0, workspaces: {} }\r\n\r\n/** `C:\\…` or `C:/…` — a drive-rooted Windows path. */\r\nconst WINDOWS_DRIVE = /^[A-Za-z]:[\\\\/]/u\r\n\r\n/** `\\\\server\\share` — a Windows UNC path. */\r\nconst WINDOWS_UNC = /^\\\\\\\\/u\r\n\r\n/** True for both Windows path spellings accepted by the write validator. */\r\nfunction isWindowsStyle(path: string): boolean {\r\n return WINDOWS_DRIVE.test(path) || WINDOWS_UNC.test(path)\r\n}\r\n\r\n/**\r\n * One path with trailing separators removed, spelling preserved (no case\r\n * folding) — the form to STORE. A drive/UNC/root prefix keeps its separator.\r\n * @param path - raw path.\r\n */\r\nfunction withoutTrailingSeparator(path: string): string {\r\n if (isWindowsStyle(path)) {\r\n let value = path.replaceAll('/', '\\\\')\r\n while (value.length > 3 && value.endsWith('\\\\')) value = value.slice(0, -1)\r\n return value\r\n }\r\n let value = path\r\n while (value.length > 1 && value.endsWith('/')) value = value.slice(0, -1)\r\n return value\r\n}\r\n\r\n/**\r\n * Comparison form of one path: trimmed, separator-normalized and, for Windows\r\n * spellings, lower-cased (drive letters and file names are case-insensitive\r\n * there). Trailing separators are dropped except for a drive/UNC/root prefix.\r\n * @param path - raw path as stored or picked.\r\n * @returns the canonical comparison form.\r\n */\r\nfunction canonicalPath(path: string): string {\r\n const trimmed = path.trim()\r\n const value = withoutTrailingSeparator(trimmed)\r\n return isWindowsStyle(trimmed) ? value.toLowerCase() : value\r\n}\r\n\r\n/**\r\n * Path equality: case-insensitive for Windows-style paths, tolerant of\r\n * trailing separators, exact for POSIX paths.\r\n * @param a - first path.\r\n * @param b - second path.\r\n */\r\nexport function samePath(a: string, b: string): boolean {\r\n return canonicalPath(a) === canonicalPath(b)\r\n}\r\n\r\n/**\r\n * Look up the folder entry saved for one workspace.\r\n * @param doc - folders document.\r\n * @param workspaceId - host workspace id.\r\n * @returns the entry, or undefined when the workspace has none.\r\n */\r\nexport function entryFor(doc: FoldersDocument, workspaceId: string): WorkspaceFolderEntry | undefined {\r\n return doc.workspaces[workspaceId]\r\n}\r\n\r\n/**\r\n * The workspace's effective folder list, base first. The base cannot be\r\n * duplicated and blank extra entries are dropped.\r\n * @param workspacePath - canonical directory of the workspace.\r\n * @param entry - saved folder entry, if any.\r\n */\r\nexport function effectiveFolders(\r\n workspacePath: string,\r\n entry: WorkspaceFolderEntry | undefined,\r\n): readonly string[] {\r\n const extras: string[] = []\r\n const candidates: string[] = [\r\n ...(entry?.folders ?? []),\r\n ...(entry?.members ?? []).map(member => member.path),\r\n ]\r\n for (const folder of candidates) {\r\n if (folder.trim() === '') continue\r\n if (samePath(folder, workspacePath)) continue\r\n if (extras.some(existing => samePath(existing, folder))) continue\r\n extras.push(folder)\r\n }\r\n return [workspacePath, ...extras]\r\n}\r\n\r\n/**\r\n * The member record behind one folder path, when that folder is workspace-backed.\r\n * @param entry - saved folder entry, if any.\r\n * @param path - folder path as stored.\r\n */\r\nexport function memberOf(entry: WorkspaceFolderEntry | undefined, path: string): FolderMember | undefined {\r\n return (entry?.members ?? []).find(member => samePath(member.path, path))\r\n}\r\n\r\n/**\r\n * Light canonical form of a REMOTE path (POSIX — the server's filesystem):\r\n * trimmed, trailing slashes removed. Deliberately string-only: the client\r\n * cannot resolve `~` or symlinks; the remote-ssh host canonicalizes fully\r\n * at registration time. This is the second line of defense, catching the\r\n * spelling variants a user can type into the add-cloud-folder dialog.\r\n * @param raw - remote path as typed or as stored.\r\n */\r\nexport function lightRemotePath(raw: string): string {\r\n const trimmed = raw.trim()\r\n return trimmed.length > 1 ? trimmed.replace(/\\/+$/, '') : trimmed\r\n}\r\n\r\n/**\r\n * Whether two remote paths name the same directory under {@link lightRemotePath}.\r\n * @param a - first remote path.\r\n * @param b - second remote path.\r\n */\r\nexport function sameRemotePath(a: string, b: string): boolean {\r\n return lightRemotePath(a) === lightRemotePath(b)\r\n}\r\n\r\n/**\r\n * The member backed by one native workspace id, when one exists.\r\n * @param entry - saved folder entry, if any.\r\n * @param workspaceId - native workspace id backing the member.\r\n */\r\nexport function memberByWorkspaceId(entry: WorkspaceFolderEntry | undefined, workspaceId: string): FolderMember | undefined {\r\n return (entry?.members ?? []).find(member => member.workspaceId === workspaceId)\r\n}\r\n\r\n/**\r\n * The remote member for one connection + remote directory, when one exists.\r\n * @param entry - saved folder entry, if any.\r\n * @param profileId - remote-ssh connection id.\r\n * @param remotePath - remote directory to look up.\r\n */\r\nexport function findRemoteMember(entry: WorkspaceFolderEntry | undefined, profileId: string, remotePath: string): FolderMember | undefined {\r\n return (entry?.members ?? []).find(member =>\r\n member.kind === 'remote'\r\n && member.profileId === profileId\r\n && member.remotePath !== undefined\r\n && sameRemotePath(member.remotePath, remotePath))\r\n}\r\n\r\n/**\r\n * Every member folder of one owner workspace, in stored order.\r\n * @param doc - folders document.\r\n * @param ownerWorkspaceId - workspace the members hang off.\r\n */\r\nexport function membersOf(doc: FoldersDocument, ownerWorkspaceId: string): readonly FolderMember[] {\r\n return entryFor(doc, ownerWorkspaceId)?.members ?? []\r\n}\r\n\r\n/**\r\n * Member workspace id → owning workspace id.\r\n *\r\n * These are the workspaces whose own row disappears from the sidebar: their\r\n * sessions render under the owning project's folder row instead. A workspace\r\n * that is itself an owner (it carries an entry) is never absorbed — absorbing\r\n * it would hide a project together with the folders nested below it.\r\n * @param doc - folders document.\r\n */\r\nexport function absorbedWorkspaceIds(doc: FoldersDocument): ReadonlyMap {\r\n const owners = new Set(Object.keys(doc.workspaces))\r\n const absorbed = new Map()\r\n for (const [ownerId, entry] of Object.entries(doc.workspaces)) {\r\n for (const member of entry.members ?? []) {\r\n if (member.workspaceId === '' || member.workspaceId === ownerId) continue\r\n if (owners.has(member.workspaceId)) continue\r\n if (!absorbed.has(member.workspaceId)) absorbed.set(member.workspaceId, ownerId)\r\n }\r\n }\r\n return absorbed\r\n}\r\n\r\n/**\r\n * True when the entry carries neither a plain folder nor a member, i.e. it can\r\n * be dropped from the sidecar instead of being written empty.\r\n * @param entry - folder entry.\r\n */\r\nexport function isEmptyEntry(entry: WorkspaceFolderEntry | undefined): boolean {\r\n return (entry?.folders.length ?? 0) === 0 && (entry?.members?.length ?? 0) === 0\r\n}\r\n\r\n/**\r\n * The folder new sessions start in by default.\r\n * @param workspacePath - canonical directory of the workspace.\r\n * @param entry - saved folder entry, if any.\r\n * @returns the stored root when it names an effective extra folder, else the\r\n * workspace's own directory.\r\n */\r\nexport function rootOf(workspacePath: string, entry: WorkspaceFolderEntry | undefined): string {\r\n const root = entry?.root\r\n if (root === undefined) return workspacePath\r\n const folders = effectiveFolders(workspacePath, entry)\r\n return folders.find(folder => samePath(folder, root)) ?? workspacePath\r\n}\r\n\r\n/**\r\n * Owning folder of a session cwd: the most specific (longest) effective folder\r\n * that equals the cwd or is a proper path ancestor of it.\r\n * @param cwd - recorded session cwd; undefined means \"the workspace itself\".\r\n * @param workspacePath - canonical directory of the workspace.\r\n * @param entry - saved folder entry, if any.\r\n * @returns the owning folder, or the workspace path when nothing matches.\r\n */\r\nexport function folderOfCwd(\r\n cwd: string | undefined,\r\n workspacePath: string,\r\n entry: WorkspaceFolderEntry | undefined,\r\n): string {\r\n if (cwd === undefined) return workspacePath\r\n const target = canonicalPath(cwd)\r\n let best: string | undefined\r\n let bestLength = -1\r\n for (const folder of effectiveFolders(workspacePath, entry)) {\r\n const root = canonicalPath(folder)\r\n if (root === '') continue\r\n const separator = isWindowsStyle(root) ? '\\\\' : '/'\r\n const prefix = root.endsWith(separator) ? root : `${root}${separator}`\r\n if (target !== root && !target.startsWith(prefix)) continue\r\n if (root.length > bestLength) {\r\n best = folder\r\n bestLength = root.length\r\n }\r\n }\r\n return best ?? workspacePath\r\n}\r\n\r\n/**\r\n * Append an extra folder. Idempotent under `samePath`, and the stored root (if\r\n * any) survives untouched.\r\n * @param entry - current entry, or undefined for a workspace with no extras.\r\n * @param path - folder path to append.\r\n */\r\nexport function addFolder(entry: WorkspaceFolderEntry | undefined, path: string): WorkspaceFolderEntry {\r\n const folders = entry?.folders ?? []\r\n const members = entry?.members ?? []\r\n const root = entry?.root\r\n const trimmed = path.trim()\r\n const keepRoot = root === undefined ? {} : { root }\r\n const keepMembers = members.length === 0 ? {} : { members: [...members] }\r\n if (trimmed === '' || folders.some(folder => samePath(folder, trimmed))\r\n || members.some(member => samePath(member.path, trimmed))) {\r\n return { folders: [...folders], ...keepMembers, ...keepRoot }\r\n }\r\n return { folders: [...folders, trimmed], ...keepMembers, ...keepRoot }\r\n}\r\n\r\n/**\r\n * Append a workspace-backed folder. Idempotent under `samePath`: a later call\r\n * for the same path replaces the stored member (so a re-registered workspace id\r\n * wins) instead of stacking a duplicate row.\r\n * @param entry - current entry, or undefined for a workspace with no extras.\r\n * @param member - member record to store.\r\n */\r\nexport function addMember(entry: WorkspaceFolderEntry | undefined, member: FolderMember): WorkspaceFolderEntry {\r\n const folders = (entry?.folders ?? []).filter(folder => !samePath(folder, member.path))\r\n const members = (entry?.members ?? []).filter(existing => !samePath(existing.path, member.path))\r\n const root = entry?.root\r\n // The root survives even when it names the member's own path: the member\r\n // replaces the plain folder at that path, so the root still resolves —\r\n // dropping it would silently change where new sessions start.\r\n const keepRoot = root === undefined ? {} : { root }\r\n return { folders: [...folders], members: [...members, member], ...keepRoot }\r\n}\r\n\r\n/**\r\n * Drop an extra folder, plain or workspace-backed. A root that pointed at it is\r\n * cleared, so the workspace falls back to its own directory instead of\r\n * referencing a folder it no longer has.\r\n * @param entry - current entry, or undefined.\r\n * @param path - folder path to drop.\r\n */\r\nexport function removeFolder(entry: WorkspaceFolderEntry | undefined, path: string): WorkspaceFolderEntry {\r\n const folders = (entry?.folders ?? []).filter(folder => !samePath(folder, path))\r\n const members = (entry?.members ?? []).filter(member => !samePath(member.path, path))\r\n const root = entry?.root\r\n const keepRoot = root !== undefined && !samePath(root, path)\r\n const keepMembers = members.length === 0 ? {} : { members }\r\n return { folders: folders, ...keepMembers, ...(keepRoot ? { root } : {}) }\r\n}\r\n\r\n/**\r\n * Designate the root folder. Only an extra folder can be stored: naming the\r\n * base directory means \"no explicit root\", which is represented by clearing\r\n * the key.\r\n * @param entry - current entry, or undefined.\r\n * @param path - folder to make the root.\r\n */\r\nexport function setRoot(entry: WorkspaceFolderEntry | undefined, path: string): WorkspaceFolderEntry {\r\n const folders = entry?.folders ?? []\r\n const members = entry?.members ?? []\r\n const keepMembers = members.length === 0 ? {} : { members: [...members] }\r\n const match = [...folders, ...members.map(member => member.path)]\r\n .find(folder => samePath(folder, path))\r\n if (match === undefined) return { folders: [...folders], ...keepMembers }\r\n return { folders: [...folders], ...keepMembers, root: match }\r\n}\r\n\r\n/**\r\n * True when `path` is `base` itself or lives somewhere below it, with the same\r\n * separator and case rules as {@link samePath}.\r\n * @param path - candidate path.\r\n * @param base - containing directory.\r\n */\r\nexport function isUnderBase(path: string, base: string): boolean {\r\n const root = canonicalPath(base)\r\n const target = canonicalPath(path)\r\n if (root === '' || target === '') return false\r\n if (target === root) return true\r\n const separator = isWindowsStyle(root) ? '\\\\' : '/'\r\n const prefix = root.endsWith(separator) ? root : `${root}${separator}`\r\n return target.startsWith(prefix)\r\n}\r\n\r\n/**\r\n * Resolve a user-typed SUBPATH against a base directory.\r\n *\r\n * This is what remote (mirror-backed) workspaces need: their canonical\r\n * directory is a local mirror of a remote root, so an extra folder must be a\r\n * directory INSIDE the mirror — that is the only spelling that also exists on\r\n * the remote side. Absolute input and `..` escapes are rejected outright so a\r\n * typo cannot smuggle in an unrelated local directory.\r\n * @param base - the workspace's canonical directory.\r\n * @param relative - typed subpath, either separator style.\r\n * @returns the joined path, or null when the input is empty, absolute, or\r\n * escapes the base.\r\n */\r\nexport function joinSubpath(base: string, relative: string): string | null {\r\n const root = base.trim()\r\n const raw = relative.trim()\r\n if (root === '' || raw === '') return null\r\n if (WINDOWS_DRIVE.test(raw) || WINDOWS_UNC.test(raw) || raw.startsWith('/')) return null\r\n const segments = raw.split(/[\\\\/]+/u).filter(segment => segment !== '' && segment !== '.')\r\n if (segments.length === 0) return null\r\n if (segments.includes('..')) return null\r\n const windows = isWindowsStyle(root)\r\n const separator = windows ? '\\\\' : '/'\r\n return `${withoutTrailingSeparator(root)}${separator}${segments.join(separator)}`\r\n}\r\n","/**\r\n * Derives the three-level workspace-groups tree: 分类文件夹 → 项目文件夹 →\r\n * 会话行. Pure derivation — all inputs are snapshots; the renderer never\r\n * scans. Session visibility rules mirror the official ui-workspace tree\r\n * (blank rows only when current, archived excluded, subagent rows excluded).\r\n */\r\nimport type {\r\n SessionListState,\r\n SessionSearchResultItem,\r\n SessionSummary,\r\n} from '@deepseek-ai/dsh-api-session-controller/client'\r\nimport type { WorkspaceId, WorkspaceView } from '@deepseek-ai/dsh-api-workspace-controller/client'\r\n// Type-only: the unified UI status snapshot. 0.1.6 把 running / pendingInteraction /\r\n// 未读完成提示收敛为 ui-session 的 SessionStatusSnapshot;SessionSummary.completed\r\n// 与 SessionListState.current 同时移除,当前会话改由 `mainView` 保留位推导。\r\nimport type { SessionStatus, SessionStatusSnapshot } from '@deepseek-ai/dsh-client-ui-session/client'\r\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\r\nimport { indexSubagentDescendants, type SubagentDescendantSummary } from './subagent-lineage.ts'\r\nimport { isDefaultWorkspace } from '../core/default-workspace.ts'\r\nimport { categoryAppearance, effectiveCategories, orderedWorkspaceIds, resolveCategory } from '../core/matcher.ts'\r\nimport {\r\n absorbedWorkspaceIds,\r\n EMPTY_FOLDERS_DOCUMENT,\r\n effectiveFolders,\r\n entryFor,\r\n folderOfCwd,\r\n rootOf,\r\n samePath,\r\n type FoldersDocument,\r\n type WorkspaceFolderEntry,\r\n} from '../core/folders.ts'\r\nimport {\r\n TOP_LEVEL_ORDER_KEY,\r\n UNCATEGORIZED_LABEL,\r\n type CategoryAppearance,\r\n type GroupsConfig,\r\n type ManualGroups,\r\n} from '../core/types.ts'\r\n\r\n/** Pending interaction kinds with dedicated Workspace-row presentation. */\r\nexport type SessionPendingInteractionStatus = 'approval' | 'plan-review' | 'question'\r\n\r\n/** Current unified UI status by Session (ui-session snapshot). */\r\ntype SessionStatuses = SessionStatusSnapshot\r\n\r\n/**\r\n * The Session the Conversation is currently showing.\r\n *\r\n * 0.1.6 removed `SessionListState.current`: selection is expressed as the\r\n * Session retained through the `mainView` reference source (the ui-workspace\r\n * navigation holds exactly one). Same read the official browser performs.\r\n * @param list - sessions list snapshot.\r\n * @returns the retained Session id, or undefined while no Session is selected.\r\n */\r\nexport function currentSessionId(list: SessionListState): SessionId | undefined {\r\n return Object.values(list.byId).find(session => (session.retainedBy?.mainView ?? 0) > 0)?.id\r\n}\r\n\r\n/** Keep navigation presentation independent from domain-owned interaction objects. */\r\nfunction visiblePendingKind(kind: string | undefined): SessionPendingInteractionStatus | undefined {\r\n switch (kind) {\r\n case 'approval':\r\n case 'plan-review':\r\n case 'question':\r\n return kind\r\n default:\r\n return undefined\r\n }\r\n}\r\n\r\n/** One top-level session row inside a workspace folder. */\r\nexport interface SessionNode {\r\n id: SessionId\r\n /** Stored display title; blank rows show the localized New Session label. */\r\n title: string\r\n /** The provisional blank session (renderer shows the localized New Session title). */\r\n blank: boolean\r\n pendingInteraction?: SessionPendingInteractionStatus\r\n running: boolean\r\n /** Running descendants connected through uninterrupted subagent-origin lineage. */\r\n runningSubagentCount: number\r\n /** Finished running while not selected and not yet opened (the green \"done\" reminder dot). */\r\n completed: boolean\r\n updatedAt: number\r\n /** Search-hit marker (rendered with a highlighted tint in search mode). */\r\n matched?: boolean\r\n /** Content-match snippet from the Host search (search mode only). */\r\n snippet?: string\r\n}\r\n\r\n/** One folder row inside a workspace folder (base or extra). */\r\nexport interface FolderNode {\r\n /** Absolute folder path. */\r\n path: string\r\n /** Display label: last path segment, or the whole path for drive roots. */\r\n label: string\r\n /** The workspace's default target for new sessions (★). */\r\n isRoot: boolean\r\n expanded: boolean\r\n /** The workspace's own canonical directory (folder #0); cannot be removed. */\r\n isBase: boolean\r\n /** Visible sessions whose recorded cwd lives inside this folder. */\r\n sessions: readonly SessionNode[]\r\n}\r\n\r\n/** One workspace folder row inside a category folder. */\r\nexport interface WorkspaceGroupNode {\r\n workspaceId: WorkspaceId\r\n /** Canonical host directory path. */\r\n path: string\r\n /** Display title. */\r\n label: string\r\n /** Workspace creation time (epoch ms). */\r\n createdAt: number\r\n /** Total visible sessions in the folder (every folder included). */\r\n sessionCount: number\r\n expanded: boolean\r\n /** The folder contains the selected session (active folder tint). */\r\n containsCurrent: boolean\r\n /** Base-owned visible session rows (empty while the folder is folded). */\r\n sessions: readonly SessionNode[]\r\n /**\r\n * Folder rows, present only when the workspace carries at least one extra\r\n * folder: root first, then stored order, base included. Absent means \"this\r\n * workspace has exactly one directory\", the plain pre-folders node shape.\r\n */\r\n folders?: readonly FolderNode[]\r\n}\r\n\r\n/** One category folder at the top of the tree. */\r\nexport interface CategoryNode {\r\n /** Stable category key: the configured label, or the uncategorized bucket. */\r\n key: string\r\n /** Display label. */\r\n label: string\r\n expanded: boolean\r\n /** The category contains the selected session (active folder tint). */\r\n containsCurrent: boolean\r\n /** Workspace folders in host order. */\r\n workspaces: readonly WorkspaceGroupNode[]\r\n /** Presentation (color / icon / pin) for this category, when configured. */\r\n appearance?: CategoryAppearance\r\n}\r\n\r\n/** Viewing state consumed by the derivation. */\r\nexport interface GroupsTreeView {\r\n expandedCategories: readonly string[]\r\n expandedWorkspaces: readonly string[]\r\n /**\r\n * Collapsed folder rows, keyed by `folderKey(workspaceId, path)`. Folders are\r\n * expanded by default: adding a folder must never hide the sessions that used\r\n * to show flat under the project.\r\n */\r\n collapsedFolders?: readonly string[]\r\n}\r\n\r\n/** Key of the uncategorized bucket (matches the config fallback label). */\r\nexport const UNCATEGORIZED_KEY = UNCATEGORIZED_LABEL\r\n\r\n/**\r\n * Names the \"not sorted yet\" bucket commonly gets. A group whose key matches one\r\n * of these is docked to the bottom of the sidebar (above the default-workspace\r\n * row) instead of taking a slot in the tree, so the workspaces a user has not\r\n * classified yet never push the classified tree around.\r\n */\r\nconst DOCKED_CATEGORY_PATTERN = /^(?:未归类|未分类|未分组|未排序|待归类|ungrouped|uncategorized|unsorted)$/iu\r\n\r\n/** Whether this category key names the \"not yet classified\" bucket. */\r\nexport function isDockedCategoryKey(key: string): boolean {\r\n return DOCKED_CATEGORY_PATTERN.test(key.trim())\r\n}\r\n\r\n/** Directory display label: basename of the path (both separators accepted). */\r\nexport function workspaceLabel(cwd: string | undefined): string {\r\n if (cwd === undefined || cwd === '') return UNCATEGORIZED_LABEL\r\n const base = cwd.replace(/[/\\\\]+$/, '').split(/[/\\\\]/).pop()\r\n return base !== undefined && base !== '' ? base : cwd\r\n}\r\n\r\n/** Ordinary sessions are visible; blank only when current; archived/subagent never. */\r\nfunction sessionVisible(session: SessionSummary, current: SessionId | undefined, archived: ReadonlySet): boolean {\r\n return session.origin !== 'subagent'\r\n && !archived.has(session.id)\r\n && (!session.blank || session.id === current)\r\n}\r\n\r\n/** Blank rows display the localized New Session label (never enters search). */\r\nfunction sessionTitle(session: SessionSummary): string {\r\n return session.blank ? 'New Session' : session.displayTitle\r\n}\r\n\r\nfunction sessionNode(\r\n s: SessionSummary,\r\n descendants: ReadonlyMap,\r\n statuses: SessionStatuses,\r\n): SessionNode {\r\n // `SessionStatusSnapshot` is typed as ReadonlyMap, but the framework binds a\r\n // plain record at runtime (client.js: `statuses[sessionId]`). Read both shapes\r\n // so a hook backed by an object never throws \"statuses.get is not a function\".\r\n const status = typeof (statuses as { get?: unknown } | undefined)?.get === 'function'\r\n ? statuses.get(s.id)\r\n : (statuses as unknown as Record)[s.id]\r\n const pending = visiblePendingKind(status?.pendingInteraction?.kind)\r\n return {\r\n id: s.id,\r\n title: sessionTitle(s),\r\n blank: s.blank,\r\n running: status?.running ?? s.running,\r\n runningSubagentCount: descendants.get(s.id)?.runningCount ?? 0,\r\n completed: status?.completionUnread === true,\r\n updatedAt: s.updatedAt,\r\n ...(pending === undefined ? {} : { pendingInteraction: pending }),\r\n }\r\n}\r\n\r\n/** Visible sessions of one workspace in its stored account order. */\r\nfunction workspaceSessions(\r\n list: SessionListState,\r\n workspace: WorkspaceView,\r\n archived: ReadonlySet,\r\n descendants: ReadonlyMap,\r\n statuses: SessionStatuses,\r\n current: SessionId | undefined,\r\n): SessionNode[] {\r\n const nodes: SessionNode[] = []\r\n for (const id of workspace.sessionIds) {\r\n const summary = list.byId[id]\r\n if (summary === undefined) continue // account may lead the list pull; appears when the summary lands\r\n if (!sessionVisible(summary, current, archived)) continue\r\n nodes.push(sessionNode(summary, descendants, statuses))\r\n }\r\n return nodes\r\n}\r\n\r\n/** A workspace-backed (\"member\") folder resolved against the workspace list. */\r\nexport interface MemberWorkspaces {\r\n /** Member workspace id → owning workspace id (the rows to hide). */\r\n absorbed: ReadonlyMap\r\n /** Owning workspace id → member workspaces in stored folder order. */\r\n byOwner: ReadonlyMap\r\n}\r\n\r\n/**\r\n * Resolve the workspace-backed folders of every project.\r\n *\r\n * A member folder is a real DSH workspace whose OWN row must disappear: its\r\n * sessions are rendered under its owner's folder row instead, so one project can\r\n * carry local and cloud (SSH-mirrored) folders at once. Members the Host no\r\n * longer knows are dropped from the index — the folder row survives (its path is\r\n * still stored) but shows no sessions.\r\n * @param workspaces - real workspaces in Host order.\r\n * @param folders - per-workspace extra folders + members + root.\r\n */\r\nexport function memberWorkspaces(\r\n workspaces: readonly WorkspaceView[],\r\n folders: FoldersDocument = EMPTY_FOLDERS_DOCUMENT,\r\n): MemberWorkspaces {\r\n const byId = new Map()\r\n for (const workspace of workspaces) byId.set(workspace.workspaceId as string, workspace)\r\n // Only an owner that still exists may hide a row: if the project itself is gone,\r\n // its members must come back as their own rows instead of staying invisible. A\r\n // chained member (an absorbed project that owns members of its own) is refused\r\n // for the same reason — nesting would swallow the inner sessions.\r\n const stored = absorbedWorkspaceIds(folders)\r\n const absorbed = new Map()\r\n for (const [memberId, ownerId] of stored) {\r\n if (!byId.has(ownerId) || stored.has(ownerId)) continue\r\n absorbed.set(memberId, ownerId)\r\n }\r\n const byOwner = new Map()\r\n for (const [ownerId, entry] of Object.entries(folders.workspaces)) {\r\n for (const member of entry.members ?? []) {\r\n if (absorbed.get(member.workspaceId) !== ownerId) continue\r\n const view = byId.get(member.workspaceId)\r\n if (view === undefined) continue\r\n const bucket = byOwner.get(ownerId)\r\n if (bucket === undefined) byOwner.set(ownerId, [view])\r\n else bucket.push(view)\r\n }\r\n }\r\n return { absorbed, byOwner }\r\n}\r\n\r\n/** Visible sessions of a project: its own rows plus every member folder's rows. */\r\nfunction sessionsWithMembers(\r\n list: SessionListState,\r\n workspace: WorkspaceView,\r\n members: readonly WorkspaceView[],\r\n archived: ReadonlySet,\r\n descendants: ReadonlyMap,\r\n statuses: SessionStatuses,\r\n current: SessionId | undefined,\r\n): SessionNode[] {\r\n if (members.length === 0) {\r\n return workspaceSessions(list, workspace, archived, descendants, statuses, current)\r\n }\r\n const nodes = workspaceSessions(list, workspace, archived, descendants, statuses, current)\r\n for (const member of members) {\r\n nodes.push(...workspaceSessions(list, member, archived, descendants, statuses, current))\r\n }\r\n return nodes\r\n}\r\n\r\n/** Whether a session lives in this project or in one of its member folders. */\r\nfunction projectHoldsSession(\r\n workspace: WorkspaceView,\r\n members: readonly WorkspaceView[],\r\n sessionId: SessionId | undefined,\r\n): boolean {\r\n if (sessionId === undefined) return false\r\n if (workspace.sessionIds.includes(sessionId)) return true\r\n return members.some(member => member.sessionIds.includes(sessionId))\r\n}\r\n\r\n/**\r\n * Display label of one folder: the last path segment. A drive root (`C:\\`) or\r\n * the POSIX root has no segment, so the whole path is the honest label.\r\n * @param path - absolute folder path.\r\n */export function folderLabel(path: string): string {\r\n const trimmed = path.replace(/[/\\\\]+$/u, '')\r\n if (trimmed === '' || /^[A-Za-z]:$/u.test(trimmed)) return path\r\n const base = trimmed.split(/[/\\\\]/u).pop()\r\n return base !== undefined && base !== '' ? base : path\r\n}\r\n\r\n/** Stable identity of one folder row (same path may live under two workspaces). */\r\nexport function folderKey(workspaceId: WorkspaceId, path: string): string {\r\n return `${workspaceId}\\u0000${path}`\r\n}\r\n\r\n/**\r\n * Display labels for member folders.\r\n *\r\n * A cloud member's directory is a locally generated mirror id (`wabc123`), which\r\n * says nothing to the user: its REMOTE path or title is the honest label. Local\r\n * members keep the last path segment, like every other folder.\r\n * @param folders - per-workspace folders + members.\r\n */\r\nfunction memberFolderLabels(entry: WorkspaceFolderEntry | undefined): Map {\r\n const labels = new Map()\r\n for (const member of entry?.members ?? []) {\r\n const label = member.kind === 'remote'\r\n ? (member.title ?? folderLabel(member.remotePath ?? member.path))\r\n : folderLabel(member.path)\r\n if (label !== '') labels.set(member.path, label)\r\n }\r\n return labels\r\n}\r\n\r\n/**\r\n * Split a workspace's visible sessions between its base directory and its extra\r\n * folders. Sessions keep the order they already had inside their owner, and a\r\n * workspace with no extra folder returns its sessions untouched — the pre-\r\n * folders node shape (no `folders` key at all).\r\n * @param workspaceId - owning workspace.\r\n * @param workspacePath - canonical directory (folder #0).\r\n * @param sessions - every visible session of the workspace, in host order.\r\n * @param list - sessions list snapshot (records each session's cwd).\r\n * @param entry - saved extra folders + root for this workspace.\r\n * @param collapsedFolders - collapsed folder-row keys. Undefined means \"nothing\r\n * is collapsed\", which is both the default view and what search uses so every\r\n * hit is visible without another click.\r\n */\r\nfunction applyFolders(\r\n workspaceId: WorkspaceId,\r\n workspacePath: string,\r\n workspaceTitle: string,\r\n sessions: readonly SessionNode[],\r\n list: SessionListState,\r\n entry: WorkspaceFolderEntry | undefined,\r\n collapsedFolders: ReadonlySet | undefined,\r\n): { sessions: readonly SessionNode[]; folders?: readonly FolderNode[] } {\r\n const labels = memberFolderLabels(entry)\r\n // The base row shows the project's confirmed display title (custom name or\r\n // remote directory name) instead of the local mirror basename. The path\r\n // remains the directory identity for file access; only the LABEL changes.\r\n const title = workspaceTitle.trim()\r\n if (title !== '') labels.set(workspacePath, title)\r\n const extras = effectiveFolders(workspacePath, entry).slice(1)\r\n if (extras.length === 0) return { sessions }\r\n const root = rootOf(workspacePath, entry)\r\n const base: SessionNode[] = []\r\n const byFolder = new Map()\r\n for (const node of sessions) {\r\n const owner = folderOfCwd(list.byId[node.id]?.cwd, workspacePath, entry)\r\n if (samePath(owner, workspacePath)) {\r\n base.push(node)\r\n continue\r\n }\r\n const bucket = byFolder.get(owner)\r\n if (bucket === undefined) byFolder.set(owner, [node])\r\n else bucket.push(node)\r\n }\r\n const folderNode = (path: string, isBase: boolean): FolderNode => {\r\n const owned = isBase ? base : (byFolder.get(path) ?? [])\r\n return {\r\n path,\r\n label: labels.get(path) ?? folderLabel(path),\r\n isRoot: samePath(path, root),\r\n expanded: collapsedFolders === undefined || !collapsedFolders.has(folderKey(workspaceId, path)),\r\n isBase,\r\n // Every owned session is kept on the node so the row's count stays honest\r\n // while the folder is collapsed; the RowGroup does the hiding.\r\n sessions: owned,\r\n }\r\n }\r\n const folders: FolderNode[] = [\r\n folderNode(workspacePath, true),\r\n ...extras.map(path => folderNode(path, false)),\r\n ]\r\n // Root first, then stored order: moving the root row to the front keeps the\r\n // remaining rows (base included) in their stored order.\r\n const rootIndex = folders.findIndex(folder => folder.isRoot)\r\n if (rootIndex > 0) {\r\n const [rootFolder] = folders.splice(rootIndex, 1)\r\n if (rootFolder !== undefined) folders.unshift(rootFolder)\r\n }\r\n return { sessions: base, folders }\r\n}\r\n\r\n/**\r\n * Derive the three-level tree.\r\n * @param list - sessions list snapshot (`current` feeds containsCurrent).\r\n * @param workspaces - real workspaces in stable Host order.\r\n * @param archivedSessionIds - registry-global archive set.\r\n * @param config - sidecar grouping config (rule categories).\r\n * @param view - local expansion arrays.\r\n * @param manual - runtime overlay (manual groups + overrides). A workspace's\r\n * manual override wins over rule classification; removing it reverts to rules.\r\n * @param statuses - unified UI status by Session (drives the running / warning\r\n * / unread-completion row indicators); defaults to none (tests).\r\n * @param folders - per-workspace extra folders + root. A workspace with extras\r\n * gains folder rows and its extra-folder sessions move under them; a workspace\r\n * without extras keeps exactly the pre-folders node shape.\r\n * @returns category sections in render order (rule categories first, then\r\n * manual-only ones, uncategorized last). Manual groups render even while\r\n * empty; empty rule buckets stay hidden.\r\n */\r\nexport function deriveGroups(\r\n list: SessionListState,\r\n workspaces: readonly WorkspaceView[],\r\n archivedSessionIds: readonly SessionId[],\r\n config: GroupsConfig,\r\n view: GroupsTreeView,\r\n manual: ManualGroups,\r\n statuses: SessionStatuses = new Map(),\r\n folders: FoldersDocument = EMPTY_FOLDERS_DOCUMENT,\r\n): CategoryNode[] {\r\n const archived = new Set(archivedSessionIds)\r\n const expandedCategories = new Set(view.expandedCategories)\r\n const expandedWorkspaces = new Set(view.expandedWorkspaces)\r\n const collapsedFolders = new Set(view.collapsedFolders ?? [])\r\n const descendants = indexSubagentDescendants(list.byId)\r\n const current = currentSessionId(list)\r\n const members = memberWorkspaces(workspaces, folders)\r\n\r\n // Bucket workspaces by display key. Seed with every effective category so\r\n // manual groups render while empty. Top-level (ungrouped) workspaces are\r\n // handled by deriveTopLevel and never land here.\r\n const byCategory = new Map()\r\n for (const { key } of effectiveCategories(config, manual)) {\r\n byCategory.set(key, [])\r\n }\r\n for (const workspace of workspaces) {\r\n // The Host default workspace is pinned to its own bottom bar, never grouped.\r\n if (isDefaultWorkspace(workspace)) continue\r\n // Member folders render inside their owner; their own row is not a project.\r\n if (members.absorbed.has(workspace.workspaceId as string)) continue\r\n const key = resolveCategory(config, manual, workspace.workspaceId, workspace.path, workspace.title)\r\n if (key === undefined) continue // top-level — rendered by deriveTopLevel\r\n if (!byCategory.has(key)) byCategory.set(key, [])\r\n byCategory.get(key)!.push(workspace)\r\n }\r\n\r\n const manualCategories = new Set(manual.categories)\r\n const currentWorkspaceId = current === undefined\r\n ? undefined\r\n : workspaces.find(w => !members.absorbed.has(w.workspaceId as string)\r\n && projectHoldsSession(w, members.byOwner.get(w.workspaceId as string) ?? [], current))?.workspaceId\r\n\r\n const nodes: CategoryNode[] = []\r\n // Effective categories in display order (categoryOrder applied).\r\n for (const key of effectiveCategories(config, manual).map(e => e.key)) {\r\n const bucket = byCategory.get(key) ?? []\r\n // Manual groups stay visible while empty; everything else hides when empty.\r\n if (bucket.length === 0 && !manualCategories.has(key)) continue\r\n const expanded = expandedCategories.has(key)\r\n const ordered = orderedWorkspaceIds(manual, key, bucket.map(w => w.workspaceId as string))\r\n const workspaceNodes: WorkspaceGroupNode[] = []\r\n let containsCurrent = false\r\n for (const workspaceId of ordered) {\r\n const workspace = bucket.find(w => w.workspaceId === workspaceId)\r\n if (workspace === undefined) continue\r\n const ownerMembers = members.byOwner.get(workspace.workspaceId as string) ?? []\r\n const sessions = sessionsWithMembers(list, workspace, ownerMembers, archived, descendants, statuses, current)\r\n const wsExpanded = expandedWorkspaces.has(workspace.workspaceId as string)\r\n const wsContainsCurrent = workspace.workspaceId === currentWorkspaceId\r\n const partitioned = applyFolders(\r\n workspace.workspaceId,\r\n workspace.path,\r\n workspace.title,\r\n sessions,\r\n list,\r\n entryFor(folders, workspace.workspaceId as string),\r\n collapsedFolders,\r\n )\r\n if (wsContainsCurrent) containsCurrent = true\r\n workspaceNodes.push({\r\n workspaceId: workspace.workspaceId,\r\n path: workspace.path,\r\n label: workspace.title,\r\n createdAt: Date.parse(workspace.createdAt),\r\n sessionCount: sessions.length,\r\n expanded: wsExpanded,\r\n containsCurrent: wsContainsCurrent,\r\n sessions: wsExpanded ? partitioned.sessions : [],\r\n ...(partitioned.folders === undefined ? {} : { folders: partitioned.folders }),\r\n })\r\n }\r\n const appearance = categoryAppearance(manual, key)\r\n nodes.push({\r\n key,\r\n label: key,\r\n expanded,\r\n containsCurrent,\r\n workspaces: workspaceNodes,\r\n ...(appearance === undefined ? {} : { appearance }),\r\n })\r\n }\r\n return nodes\r\n}\r\n\r\n/**\r\n * Top-level (ungrouped) workspace rows: workspaces resolving to no category\r\n * (no manual override and no matching rule, or a forced `null` override).\r\n * Rendered after the group folders as plain project rows (not inside any\r\n * folder), in manual top-level order (`workspaceOrder[TOP_LEVEL_ORDER_KEY]`),\r\n * falling back to host registration order.\r\n */\r\nexport function deriveTopLevel(\r\n list: SessionListState,\r\n workspaces: readonly WorkspaceView[],\r\n archivedSessionIds: readonly SessionId[],\r\n config: GroupsConfig,\r\n view: GroupsTreeView,\r\n manual: ManualGroups,\r\n statuses: SessionStatuses = new Map(),\r\n folders: FoldersDocument = EMPTY_FOLDERS_DOCUMENT,\r\n): WorkspaceGroupNode[] {\r\n const archived = new Set(archivedSessionIds)\r\n const expandedWorkspaces = new Set(view.expandedWorkspaces)\r\n const collapsedFolders = new Set(view.collapsedFolders ?? [])\r\n const descendants = indexSubagentDescendants(list.byId)\r\n const current = currentSessionId(list)\r\n const members = memberWorkspaces(workspaces, folders)\r\n const currentWorkspaceId = current === undefined\r\n ? undefined\r\n : workspaces.find(w => !members.absorbed.has(w.workspaceId as string)\r\n && projectHoldsSession(w, members.byOwner.get(w.workspaceId as string) ?? [], current))?.workspaceId\r\n\r\n const topLevelIds = workspaces\r\n .filter(w => !isDefaultWorkspace(w))\r\n .filter(w => !members.absorbed.has(w.workspaceId as string))\r\n .filter(w => resolveCategory(config, manual, w.workspaceId, w.path, w.title) === undefined)\r\n .map(w => w.workspaceId as string)\r\n const ordered = orderedWorkspaceIds(manual, TOP_LEVEL_ORDER_KEY, topLevelIds)\r\n\r\n const nodes: WorkspaceGroupNode[] = []\r\n for (const workspaceId of ordered) {\r\n const workspace = workspaces.find(w => w.workspaceId === workspaceId)\r\n if (workspace === undefined) continue\r\n const ownerMembers = members.byOwner.get(workspaceId) ?? []\r\n const sessions = sessionsWithMembers(list, workspace, ownerMembers, archived, descendants, statuses, current)\r\n const wsExpanded = expandedWorkspaces.has(workspaceId)\r\n const partitioned = applyFolders(\r\n workspace.workspaceId,\r\n workspace.path,\r\n workspace.title,\r\n sessions,\r\n list,\r\n entryFor(folders, workspaceId),\r\n collapsedFolders,\r\n )\r\n nodes.push({\r\n workspaceId: workspace.workspaceId,\r\n path: workspace.path,\r\n label: workspace.title,\r\n createdAt: Date.parse(workspace.createdAt),\r\n sessionCount: sessions.length,\r\n expanded: wsExpanded,\r\n containsCurrent: workspace.workspaceId === currentWorkspaceId,\r\n sessions: wsExpanded ? partitioned.sessions : [],\r\n ...(partitioned.folders === undefined ? {} : { folders: partitioned.folders }),\r\n })\r\n }\r\n return nodes\r\n}\r\n\r\n/**\r\n * The Host's default workspace as a standalone node for the pinned bottom bar.\r\n *\r\n * The default workspace is not part of the grouping tree (it is excluded from\r\n * `deriveGroups`, `deriveTopLevel` and the search results), yet it keeps the\r\n * full workspace-row behaviour: expansion, session count, its sessions and its\r\n * extra folders. This derives exactly that node, reusing the same visibility,\r\n * folder partitioning and current-session marking as the tree.\r\n *\r\n * @param list - sessions list snapshot.\r\n * @param workspaces - real workspaces in stable Host order.\r\n * @param archivedSessionIds - registry-global archive set.\r\n * @param view - local expansion arrays.\r\n * @param statuses - unified UI status by Session.\r\n * @param folders - per-workspace extra folders + root.\r\n * @returns the default workspace node, or undefined when the Host has none.\r\n */\r\nexport function deriveDefaultWorkspace(\r\n list: SessionListState,\r\n workspaces: readonly WorkspaceView[],\r\n archivedSessionIds: readonly SessionId[],\r\n view: GroupsTreeView,\r\n statuses: SessionStatuses = new Map(),\r\n folders: FoldersDocument = EMPTY_FOLDERS_DOCUMENT,\r\n): WorkspaceGroupNode | undefined {\r\n const workspace = workspaces.find(w => isDefaultWorkspace(w))\r\n if (workspace === undefined) return undefined\r\n const archived = new Set(archivedSessionIds)\r\n const expandedWorkspaces = new Set(view.expandedWorkspaces)\r\n const collapsedFolders = new Set(view.collapsedFolders ?? [])\r\n const descendants = indexSubagentDescendants(list.byId)\r\n const current = currentSessionId(list)\r\n const members = memberWorkspaces(workspaces, folders)\r\n const ownerMembers = members.byOwner.get(workspace.workspaceId as string) ?? []\r\n const sessions = sessionsWithMembers(list, workspace, ownerMembers, archived, descendants, statuses, current)\r\n const wsExpanded = expandedWorkspaces.has(workspace.workspaceId as string)\r\n const partitioned = applyFolders(\r\n workspace.workspaceId,\r\n workspace.path,\r\n workspace.title,\r\n sessions,\r\n list,\r\n entryFor(folders, workspace.workspaceId as string),\r\n collapsedFolders,\r\n )\r\n return {\r\n workspaceId: workspace.workspaceId,\r\n path: workspace.path,\r\n label: workspace.title,\r\n createdAt: Date.parse(workspace.createdAt),\r\n sessionCount: sessions.length,\r\n expanded: wsExpanded,\r\n containsCurrent: projectHoldsSession(workspace, ownerMembers, current),\r\n sessions: wsExpanded ? partitioned.sessions : [],\r\n ...(partitioned.folders === undefined ? {} : { folders: partitioned.folders }),\r\n }\r\n}\r\n\r\n/** Recency comparator: newest first, id as the deterministic tiebreak. */\r\nfunction byRecency(a: SessionSummary, b: SessionSummary): number {\r\n if (b.updatedAt !== a.updatedAt) return b.updatedAt - a.updatedAt\r\n return a.id < b.id ? -1 : 1\r\n}\r\n\r\n/** Bounded set of matched sessions plus content snippets (feeds the search tree). */\r\nexport interface SearchMatchSet {\r\n /** Session ids that matched (local metadata hits + Host content hits). */\r\n matchedIds: ReadonlySet\r\n /** Content-match snippets keyed by session id (Host search only). */\r\n snippetsBySession: ReadonlyMap\r\n hasMore: boolean\r\n}\r\n\r\n/**\r\n * Compute the matched-session set: immediate title/Workspace substring matches\r\n * from the local list, merged with ranked Host content matches. The consumer\r\n * (SearchBody) derives the pruned three-level tree from these ids.\r\n */\r\nexport function deriveSearchMatches(\r\n list: SessionListState,\r\n workspaces: readonly WorkspaceView[],\r\n config: GroupsConfig,\r\n query: string,\r\n archivedSessionIds: readonly SessionId[],\r\n content: { items: readonly SessionSearchResultItem[]; hasMore: boolean },\r\n limit: number,\r\n folders: FoldersDocument = EMPTY_FOLDERS_DOCUMENT,\r\n): SearchMatchSet {\r\n const q = query.trim().toLowerCase()\r\n if (q === '') return { matchedIds: new Set(), snippetsBySession: new Map(), hasMore: false }\r\n const archived = new Set(archivedSessionIds)\r\n const descendants = indexSubagentDescendants(list.byId)\r\n const current = currentSessionId(list)\r\n const members = memberWorkspaces(workspaces, folders)\r\n\r\n // A member folder's sessions search as part of the project that shows them.\r\n const workspaceBySession = new Map()\r\n for (const workspace of workspaces) {\r\n if (members.absorbed.has(workspace.workspaceId as string)) continue\r\n const owner = workspace\r\n for (const sessionId of workspace.sessionIds) {\r\n if (!workspaceBySession.has(sessionId)) workspaceBySession.set(sessionId, owner)\r\n }\r\n for (const member of members.byOwner.get(workspace.workspaceId as string) ?? []) {\r\n for (const sessionId of member.sessionIds) {\r\n if (!workspaceBySession.has(sessionId)) workspaceBySession.set(sessionId, owner)\r\n }\r\n }\r\n }\r\n const labelOf = (summary: SessionSummary): string =>\r\n workspaceBySession.get(summary.id)?.title ?? workspaceLabel(summary.cwd)\r\n\r\n const local: SessionSummary[] = []\r\n for (const id of list.ids) {\r\n const summary = list.byId[id]\r\n if (summary === undefined || summary.blank || !sessionVisible(summary, current, archived)) continue\r\n if (\r\n sessionTitle(summary).toLowerCase().includes(q)\r\n || labelOf(summary).toLowerCase().includes(q)\r\n ) {\r\n local.push(summary)\r\n }\r\n }\r\n local.sort(byRecency)\r\n\r\n const ordered: SessionSummary[] = []\r\n const included = new Set()\r\n const include = (summary: SessionSummary): void => {\r\n if (included.has(summary.id)) return\r\n included.add(summary.id)\r\n ordered.push(summary)\r\n }\r\n for (const summary of local) include(summary)\r\n for (const item of content.items) {\r\n const summary = list.byId[item.sessionId]\r\n if (summary !== undefined && !summary.blank && sessionVisible(summary, current, archived)) include(summary)\r\n }\r\n\r\n const snippets = new Map()\r\n for (const item of content.items) {\r\n if (item.snippet !== undefined) snippets.set(item.sessionId, item.snippet)\r\n }\r\n\r\n return {\r\n matchedIds: ordered.slice(0, limit).reduce((set, summary) => { set.add(summary.id); return set }, new Set()),\r\n snippetsBySession: snippets,\r\n hasMore: content.hasMore || ordered.length > limit,\r\n }\r\n}\r\n\r\n/** Search tree: group folders plus top-level (ungrouped) matched workspaces. */\r\nexport interface SearchTree {\r\n /** Group folders containing matched sessions, in display order. */\r\n categories: CategoryNode[]\r\n /** Top-level (ungrouped) workspaces holding matched sessions. */\r\n topLevel: WorkspaceGroupNode[]\r\n /**\r\n * The Host default workspace's matched branch, when it has a hit. It is\r\n * rendered in the pinned bottom bar instead of the results list, so a hit\r\n * never makes the default workspace appear twice.\r\n */\r\n defaultWorkspace?: WorkspaceGroupNode\r\n}\r\n\r\n/**\r\n * Build a three-level search tree containing ONLY the branches that hold a\r\n * matched session: 分类文件夹 → 项目文件夹 → 命中会话行. Every matched\r\n * session carries `matched: true` so rows render with the search-hit tint.\r\n * Classification uses the same precedence as the idle tree (manual override →\r\n * rules), so search shows the same grouping the user sees. Matched top-level\r\n * workspaces are returned separately (rendered as plain rows).\r\n *\r\n * @param list - sessions list snapshot.\r\n * @param workspaces - real workspaces in stable Host order.\r\n * @param config - sidecar grouping config.\r\n * @param matchedIds - set of session ids that matched the query.\r\n * @param archivedSessionIds - registry-global archive set.\r\n * @param manual - runtime overlay (manual groups + overrides).\r\n * @param snippetsBySession - optional content-match snippets keyed by session id.\r\n * @param statuses - unified UI status by Session (drives the running / warning\r\n * / unread-completion row indicators); defaults to none (tests).\r\n * @param folders - per-workspace extra folders + root, so a hit inside an extra\r\n * folder surfaces under that folder instead of flat under the project.\r\n * @returns group folders in render order plus top-level matched workspaces,\r\n * pruned to matched branches only.\r\n */\r\nexport function deriveSearchGroups(\r\n list: SessionListState,\r\n workspaces: readonly WorkspaceView[],\r\n config: GroupsConfig,\r\n matchedIds: ReadonlySet,\r\n archivedSessionIds: readonly SessionId[],\r\n manual: ManualGroups,\r\n snippetsBySession?: ReadonlyMap,\r\n statuses: SessionStatuses = new Map(),\r\n folders: FoldersDocument = EMPTY_FOLDERS_DOCUMENT,\r\n): SearchTree {\r\n const archived = new Set(archivedSessionIds)\r\n const descendants = indexSubagentDescendants(list.byId)\r\n const current = currentSessionId(list)\r\n const members = memberWorkspaces(workspaces, folders)\r\n\r\n const byCategory = new Map()\r\n for (const key of effectiveCategories(config, manual).map(e => e.key)) byCategory.set(key, [])\r\n\r\n const topLevel: WorkspaceGroupNode[] = []\r\n let defaultWorkspace: WorkspaceGroupNode | undefined\r\n for (const workspace of workspaces) {\r\n // A member's own row is folded into its owner's folder row below.\r\n if (members.absorbed.has(workspace.workspaceId as string)) continue\r\n // Only sessions that matched the query and are visible in this folder.\r\n const nodes: SessionNode[] = []\r\n const sources = [workspace, ...(members.byOwner.get(workspace.workspaceId as string) ?? [])]\r\n for (const source of sources) {\r\n for (const id of source.sessionIds) {\r\n const summary = list.byId[id]\r\n if (summary === undefined || !matchedIds.has(id)) continue\r\n if (!sessionVisible(summary, current, archived)) continue\r\n const node = sessionNode(summary, descendants, statuses)\r\n const snippet = snippetsBySession?.get(id)\r\n nodes.push({\r\n ...node,\r\n matched: true,\r\n ...(snippet === undefined ? {} : { snippet }),\r\n })\r\n }\r\n }\r\n if (nodes.length === 0) continue\r\n\r\n const partitioned = applyFolders(\r\n workspace.workspaceId,\r\n workspace.path,\r\n workspace.title,\r\n nodes,\r\n list,\r\n entryFor(folders, workspace.workspaceId as string),\r\n undefined,\r\n )\r\n const node: WorkspaceGroupNode = {\r\n workspaceId: workspace.workspaceId,\r\n path: workspace.path,\r\n label: workspace.title,\r\n createdAt: Date.parse(workspace.createdAt),\r\n sessionCount: nodes.length,\r\n expanded: true,\r\n containsCurrent: false,\r\n sessions: partitioned.sessions,\r\n ...(partitioned.folders === undefined ? {} : { folders: partitioned.folders }),\r\n }\r\n if (isDefaultWorkspace(workspace)) {\r\n defaultWorkspace = node\r\n continue\r\n }\r\n const key = resolveCategory(config, manual, workspace.workspaceId, workspace.path, workspace.title)\r\n if (key === undefined) {\r\n topLevel.push(node)\r\n continue\r\n }\r\n if (!byCategory.has(key)) byCategory.set(key, [])\r\n byCategory.get(key)!.push(node)\r\n }\r\n\r\n const categories: CategoryNode[] = []\r\n // Same display order as the idle tree.\r\n for (const key of effectiveCategories(config, manual).map(e => e.key)) {\r\n const workspaceNodes = byCategory.get(key)\r\n if (workspaceNodes === undefined || workspaceNodes.length === 0) continue\r\n const appearance = categoryAppearance(manual, key)\r\n categories.push({\r\n key,\r\n label: key,\r\n expanded: true,\r\n containsCurrent: false,\r\n workspaces: workspaceNodes,\r\n ...(appearance === undefined ? {} : { appearance }),\r\n })\r\n }\r\n return {\r\n categories,\r\n topLevel,\r\n ...(defaultWorkspace === undefined ? {} : { defaultWorkspace }),\r\n }\r\n}\r\n","/**\r\n * The flower marker: an SVG overlay that draws a single bloom on the row you are\r\n * currently on.\r\n *\r\n * Originally ported from the RewampUI *Flower Sidebar* reference, which drew a\r\n * continuous curly stem down the whole tree — a dashed \"ghost\" route plus a\r\n * solid stroke \"grown\" to the active row — with a dot on every row and the bloom\r\n * at its tip. **The stem and the dots are gone**: they read as a stray black line\r\n * down the sidebar, and depth is already carried by the row indentation. Only the\r\n * bloom remains, still spinning while the current session works and resting when\r\n * it is idle.\r\n *\r\n * The SVG is `pointer-events: none` and `overflow: visible`, so it is pure\r\n * decoration over the real rows and never intercepts a click.\r\n *\r\n * Measurement, not layout: the rows are rendered by the tree itself (they carry\r\n * drag handlers, menus and hover state), so this component reads each row's\r\n * vertical centre and anchor from the DOM and feeds plain numbers to\r\n * `buildBranch`. That keeps the geometry unit-tested (`branch.ts`) while the SVG\r\n * stays a dumb renderer of it — and leaves the branch math intact should the stem\r\n * ever come back.\r\n *\r\n * Re-measured on: row count changes (expand/collapse, new session), the active\r\n * row changing, and container resize. A `ResizeObserver` on the scroll body\r\n * covers the last one without a window listener.\r\n *\r\n * The bloom's spin is NOT re-measured here: it arrives as the `spinning` prop\r\n * and is applied as a class, so a status flip never re-runs the DOM measurement\r\n * above (the tree is the expensive part, not the class swap).\r\n */\r\nimport { useEffect, useRef, useState } from 'react'\r\nimport { buildBranch, type Branch, type BranchRow } from './branch.ts'\r\n\r\n/**\r\n * Attribute the tree puts on every row the branch should connect. */\r\nexport const BRANCH_ROW_ATTRIBUTE = 'data-wg-branch-row'\r\n\r\n/**\r\n * Attribute marking the row the stem should grow to.\r\n *\r\n * Only the DEEPEST row gets this (the session). Its ancestors — the project and\r\n * the category that contain it — deliberately do NOT, because a session belongs\r\n * to both and marking all three would make \"which row is active?\" ambiguous.\r\n * When several rows do carry it, the deepest (last in document order) wins.\r\n */\r\nexport const BRANCH_ACTIVE_ATTRIBUTE = 'data-wg-branch-active'\r\n\r\n/** Row kind marker: a group boundary kinks the stem. */\r\nexport const BRANCH_GROUP_ATTRIBUTE = 'data-wg-branch-group'\r\n\r\n/**\r\n * The bloom's petal outline, in the 1024-unit box the artwork was drawn in.\r\n *\r\n * This is the user's own flower glyph verbatim: an eight-petal bloom around a\r\n * ringed center. Kept as a path (not a component) because it is a constant.\r\n */\r\nconst FLOWER_PATH = 'M375.3728 841.8432c92.96-12.5184 203.8784-71.264 299.5456-166.9248 22.6112-22.6112 43.1616-46.08 61.5232-69.952C712.7616 786.3936 621.2608 921.6 512 921.6c-51.1488 0-98.4-29.632-136.6272-79.7568z m-87.808-422.8096C311.2384 237.6064 402.7328 102.4 512 102.4c51.1488 0 98.4 29.632 136.6272 79.7568-92.96 12.5184-203.8784 71.264-299.5456 166.9248a719.1232 719.1232 0 0 0-61.5232 69.952z m-129.536 139.5648c57.3248 74.2464 163.6608 140.9344 294.336 175.9488a719.1232 719.1232 0 0 0 91.3472 18.304c-168.9664 70.208-331.808 58.5728-386.432-36.0512-25.5744-44.288-23.5456-100.032 0.7552-158.2016z m322.2592-287.4496c168.9664-70.208 331.808-58.5728 386.432 36.0512 25.5744 44.288 23.5456 100.032-0.7552 158.2016-57.3184-74.2464-163.648-140.9344-294.336-175.9488a719.1232 719.1232 0 0 0-91.3408-18.304zM294.656 228.7552c-35.6352 86.7648-40.224 212.1984-5.2032 342.8736a719.1232 719.1232 0 0 0 29.8176 88.256C173.9904 548.6592 102.6432 401.824 157.2736 307.2c25.5744-44.288 74.8608-70.4 137.3824-78.4448z m410.0736 135.36c145.28 111.2256 216.6272 258.0608 161.9968 352.6848-25.5744 44.288-74.8608 70.4-137.3824 78.4448 35.6352-86.7648 40.224-212.1984 5.2032-342.8736a719.1232 719.1232 0 0 0-29.8176-88.256zM512 678.4c-88.3648 0-160-71.6352-160-160s71.6352-160 160-160 160 71.6352 160 160-71.6352 160-160 160z m0-83.2c42.4128 0 76.8-34.3872 76.8-76.8s-34.3872-76.8-76.8-76.8-76.8 34.3872-76.8 76.8 34.3872 76.8 76.8 76.8z'\r\n\r\n/** Petal colour: the accent the glyph was drawn in. */\r\nconst FLOWER_PETAL = '#fa541c'\r\n\r\n/**\r\n * Rendered size of the bloom, as a scale factor over the authored 1024 box.\r\n *\r\n * 17 / 1024 ≈ 0.0166 puts the flower at ~17px: clear of neighbouring rows (rows\r\n * are 28px tall) while still reading as a flower rather than a dot at the end of\r\n * the stem.\r\n */\r\nconst FLOWER_SCALE = 17 / 1024\r\n\r\n/**\r\n * Centre of the artwork inside its own 1024-unit box, measured from the path.\r\n *\r\n * Both the recentring AND the rotation are expressed with this ONE pair of user\r\n * units, so neither depends on a percentage or on a reference box. Verified\r\n * against the live DOM: the path's own `getBBox()` centre is exactly (512, 512).\r\n */\r\nconst FLOWER_CENTRE = 512\r\n\r\n/**\r\n * The bloom at the branch's endpoint.\r\n *\r\n * Anchoring is done entirely by these transforms, in this order:\r\n *\r\n * 1. `translate(cx cy)` — put the origin on the stem's tip (the endpoint of\r\n * the grown stroke).\r\n * 2. `scale(FLOWER_SCALE)` — shrink the 1024-unit artwork about that origin.\r\n * 3. `translate(-512 -512)` — bring the glyph's own centre (512, 512) onto the\r\n * origin, so the flower is centred on the tip.\r\n *\r\n * The spin is applied by `wgFlowerArt` in CSS as a `rotate()` composed AFTER\r\n * that recentring (`translate(-512 -512) rotate(...)`), so the bloom turns about\r\n * its own centre and the recentring never drifts as it rotates.\r\n *\r\n * Note what is deliberately NOT used here: a percentage `translate(-50%, -50%)`\r\n * or `transform-box: fill-box` + percentage `transform-origin`. Measured on the\r\n * live page, the percentage form resolved against the SVG VIEWPORT rather than\r\n * the path's box, translating by (-24, -409.5) instead of (-373, -409.6) and\r\n * parking the bloom well right of the stem. Explicit user units remove the\r\n * question: 512 is the measured centre, not an inferred one.\r\n *\r\n * The flower rests while the session is idle and turns while it works: one\r\n * animation, paused rather than removed, so a state flip resumes the turn\r\n * instead of snapping the petals back to 0deg.\r\n *\r\n * @param props - endpoint coordinates and whether the session is working.\r\n * @returns the bloom group.\r\n */\r\n/** In-flow session marker: its position follows the row, including disclosure animations. */\r\nexport function SessionFlower({ spinning }: { spinning: boolean }) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n\r\nfunction Flower({ cx, cy, spinning }: { cx: number; cy: number; spinning: boolean }) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n\r\n/**\r\n * Render the branch for the rows currently inside `scope`.\r\n * @param props - the element to measure, and whether the open session is working.\r\n * @returns the SVG overlay, or null until at least one row is measured.\r\n */\r\nexport function FlowerBranch({ scope, spinning }: { scope: HTMLElement | null; spinning: boolean }) {\r\n const [rows, setRows] = useState([])\r\n\r\n // A cheap change key: the caller cannot tell us when a row expanded, so we\r\n // watch the attribute count and the active row instead of diffing every node.\r\n const measureKey = useRef('')\r\n // The measured pixel pitch is per-list, not the module default: our rows are\r\n // 28/30px tall in places, and assuming 32 would drift the dots off the rows.\r\n const [branch, setBranch] = useState(null)\r\n\r\n useEffect(() => {\r\n if (scope === null) {\r\n setRows([])\r\n setBranch(null)\r\n return\r\n }\r\n\r\n const measure = (): void => {\r\n const nodes = Array.from(scope.querySelectorAll(`[${BRANCH_ROW_ATTRIBUTE}]`))\r\n const first = nodes[0]\r\n if (first === undefined) {\r\n if (measureKey.current !== '') {\r\n measureKey.current = ''\r\n setRows([])\r\n setBranch(null)\r\n }\r\n return\r\n }\r\n\r\n // Exactly one row carries the marker (the session); if a caller ever marks\r\n // several, the deepest wins so the stem still lands on a real leaf.\r\n const activeIndex = nodes.reduce(\r\n (found, node, index) => (node.hasAttribute(BRANCH_ACTIVE_ATTRIBUTE) ? index : found),\r\n -1,\r\n )\r\n const kinds = nodes.map(n => (n.hasAttribute(BRANCH_GROUP_ATTRIBUTE) ? 'group' : 'item')).join('')\r\n const key = `${nodes.length}|${activeIndex}|${kinds}|${Math.round(scope.clientWidth)}`\r\n if (key === measureKey.current) return\r\n measureKey.current = key\r\n\r\n // Each row carries its OWN measured anchor: y because the tree mixes row\r\n // heights, x because it indents per row via padding (a folder's chevron and\r\n // a session's text do not share an x).\r\n const measured: BranchRow[] = nodes.map((node, index) => ({\r\n key: `${index}`,\r\n y: center(node),\r\n x: anchorX(node),\r\n kind: node.hasAttribute(BRANCH_GROUP_ATTRIBUTE) ? 'group' : 'item',\r\n active: index === activeIndex,\r\n }))\r\n\r\n setRows(measured)\r\n setBranch(buildBranch(measured))\r\n }\r\n\r\n /** Vertical centre of a node, relative to the scope box. */\r\n function center(node: HTMLElement): number {\r\n const r = node.getBoundingClientRect()\r\n const s = (scope as HTMLElement).getBoundingClientRect()\r\n return r.top - s.top + r.height / 2\r\n }\r\n\r\n /**\r\n * Horizontal anchor of a row, relative to the scope box.\r\n *\r\n * A row with a chevron anchors to that triangle's CENTRE: it is the marker\r\n * the user already reads as \"this row opens\", so the stem hangs off it\r\n * instead of floating beside it. A chevron-less row (a session) has no\r\n * marker, so it anchors to where its own content starts — the status dot's\r\n * centre, which is the first thing in the row.\r\n */\r\n function anchorX(node: HTMLElement): number {\r\n const s = (scope as HTMLElement).getBoundingClientRect()\r\n const marker = node.querySelector('.wgChevron')\r\n ?? node.querySelector('[class*=\"wgStatusSlot\"]')\r\n ?? node.querySelector('[class*=\"wgCategoryIcon\"]')\r\n ?? node.querySelector('[class*=\"wgRowIcon\"]')\r\n const box = (marker ?? node).getBoundingClientRect()\r\n return box.left - s.left + box.width / 2\r\n }\r\n\r\n measure()\r\n\r\n // Row set changes (expand/collapse/new session) arrive as childList edits.\r\n const observer = new MutationObserver(measure)\r\n observer.observe(scope, { childList: true, subtree: true, attributes: true, attributeFilter: [BRANCH_ACTIVE_ATTRIBUTE] })\r\n\r\n // Width changes reflow row heights in the rail/wide layouts.\r\n const resizer = new ResizeObserver(measure)\r\n resizer.observe(scope)\r\n\r\n return () => {\r\n observer.disconnect()\r\n resizer.disconnect()\r\n }\r\n }, [scope])\r\n\r\n if (branch === null || rows.length === 0) return null\r\n\r\n // Only the bloom is drawn. The stem (ghost + grown stroke) and the per-row\r\n // dots were removed on request: they read as a stray black line down the\r\n // sidebar and the depth is already carried by the indentation, so the flower\r\n // alone marks the row you are on. `branch` is still BUILT from the measured\r\n // rows — it is what gives the bloom its position — but its path geometry is\r\n // no longer rendered.\r\n if (branch.flower === null) return null\r\n\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","/**\r\n * Self-drawn monochrome artwork for the \"Materials & Lab\" icon family.\r\n *\r\n * The Host primitive package only ships product/generic glyphs, so the 28\r\n * research icons are drawn here in the exact same visual language as the Host\r\n * ones: a 16x16 viewBox, `currentColor` stroke, 1.3 stroke width (Host\r\n * `ICON_MEDIUM_STROKE`), round caps/joins and no fill. Keeping the artwork as\r\n * primitive data (instead of one opaque `` per icon) lets the icon test\r\n * assert every coordinate stays inside the viewBox and that each id has\r\n * artwork — a hand-tuned path string could silently drift out of frame.\r\n */\r\nimport type { ReactElement } from 'react'\r\n\r\n/** One drawable primitive of a 16x16 icon; coordinates are in viewBox units. */\r\nexport type SciencePrimitive =\r\n | { readonly kind: 'line'; readonly x1: number; readonly y1: number; readonly x2: number; readonly y2: number }\r\n | {\r\n readonly kind: 'rect'\r\n readonly x: number\r\n readonly y: number\r\n readonly width: number\r\n readonly height: number\r\n readonly radius?: number\r\n }\r\n | { readonly kind: 'circle'; readonly cx: number; readonly cy: number; readonly radius: number; readonly filled?: boolean }\r\n | {\r\n readonly kind: 'ellipse'\r\n readonly cx: number\r\n readonly cy: number\r\n readonly rx: number\r\n readonly ry: number\r\n /** Rotation around the icon centre (8,8), in degrees. */\r\n readonly rotate?: number\r\n }\r\n | { readonly kind: 'path'; readonly d: string }\r\n\r\n/** Ids appended to the shared registry; order is the picker's section order. */\r\nexport const SCIENCE_ICON_IDS = [\r\n // Lab operations\r\n 'test-tube', 'flask', 'pipette', 'dropper', 'stirrer', 'hotplate', 'centrifuge', 'balance',\r\n // Material structures\r\n 'atom', 'molecule', 'lattice', 'layered', 'framework', 'thin-film', 'fiber', 'hydrogel',\r\n // Characterization\r\n 'microscope', 'xrd', 'spectrum', 'tensile', 'electrode', 'iv-curve',\r\n // Functional devices\r\n 'illumination', 'temperature', 'humidity', 'actuator', 'flex-sensor', 'battery',\r\n] as const\r\n\r\n/** Union of the research icon ids (a subset of the shared `GroupIconId`). */\r\nexport type ScienceIconId = (typeof SCIENCE_ICON_IDS)[number]\r\n\r\n/** The picker's section split of the research family. */\r\nexport const SCIENCE_ICON_SECTIONS = [\r\n { key: 'lab', ids: ['test-tube', 'flask', 'pipette', 'dropper', 'stirrer', 'hotplate', 'centrifuge', 'balance'] },\r\n { key: 'materials', ids: ['atom', 'molecule', 'lattice', 'layered', 'framework', 'thin-film', 'fiber', 'hydrogel'] },\r\n { key: 'characterization', ids: ['microscope', 'xrd', 'spectrum', 'tensile', 'electrode', 'iv-curve'] },\r\n { key: 'devices', ids: ['illumination', 'temperature', 'humidity', 'actuator', 'flex-sensor', 'battery'] },\r\n] as const satisfies readonly { readonly key: string; readonly ids: readonly ScienceIconId[] }[]\r\n\r\n/** Primitive artwork per research icon. */\r\nexport const SCIENCE_ICON_ART: Record = {\r\n // ---- Lab operations ------------------------------------------------------\r\n 'test-tube': [\r\n { kind: 'path', d: 'M5.2 2.8v7.6a2.8 2.8 0 0 0 5.6 0V2.8' },\r\n { kind: 'line', x1: 4.5, y1: 2.8, x2: 11.5, y2: 2.8 },\r\n { kind: 'line', x1: 5.2, y1: 8.4, x2: 10.8, y2: 8.4 },\r\n ],\r\n flask: [\r\n { kind: 'path', d: 'M6.2 2.4v3.4L3 11.6a1.6 1.6 0 0 0 1.4 2.4h7.2a1.6 1.6 0 0 0 1.4-2.4L9.8 5.8V2.4' },\r\n { kind: 'line', x1: 5.2, y1: 2.4, x2: 10.8, y2: 2.4 },\r\n { kind: 'line', x1: 5.2, y1: 9.8, x2: 10.8, y2: 9.8 },\r\n ],\r\n pipette: [\r\n { kind: 'line', x1: 8, y1: 1.5, x2: 8, y2: 2.4 },\r\n { kind: 'rect', x: 6.1, y: 2.5, width: 3.8, height: 6.4, radius: 1.1 },\r\n { kind: 'line', x1: 6.1, y1: 4.6, x2: 7.2, y2: 4.6 },\r\n { kind: 'line', x1: 6.1, y1: 6.1, x2: 7.2, y2: 6.1 },\r\n { kind: 'path', d: 'M7.3 8.9L8 13.2L8.7 8.9' },\r\n ],\r\n dropper: [\r\n { kind: 'rect', x: 5.1, y: 2.1, width: 5.8, height: 4.2, radius: 2.1 },\r\n { kind: 'line', x1: 6.6, y1: 6.3, x2: 6.6, y2: 10.3 },\r\n { kind: 'line', x1: 9.4, y1: 6.3, x2: 9.4, y2: 10.3 },\r\n { kind: 'path', d: 'M6.6 10.3L8 13.4L9.4 10.3' },\r\n { kind: 'circle', cx: 11.9, cy: 12.2, radius: 0.95, filled: true },\r\n ],\r\n stirrer: [\r\n { kind: 'circle', cx: 8, cy: 6.1, radius: 2.5 },\r\n { kind: 'path', d: 'M6.4 6.1c1-.9 2.2-.9 3.2 0' },\r\n { kind: 'rect', x: 2, y: 9.6, width: 12, height: 4.2, radius: 1.2 },\r\n { kind: 'circle', cx: 11.4, cy: 11.7, radius: 0.85, filled: true },\r\n ],\r\n hotplate: [\r\n { kind: 'path', d: 'M5.4 8.4c1.2-.9 1.2-2.1 0-3' },\r\n { kind: 'path', d: 'M8 8.4c1.2-.9 1.2-2.1 0-3' },\r\n { kind: 'path', d: 'M10.6 8.4c1.2-.9 1.2-2.1 0-3' },\r\n { kind: 'rect', x: 2, y: 9.6, width: 12, height: 4.2, radius: 1.2 },\r\n { kind: 'circle', cx: 11.4, cy: 11.7, radius: 0.85, filled: true },\r\n ],\r\n centrifuge: [\r\n { kind: 'circle', cx: 8, cy: 5.6, radius: 3.4 },\r\n { kind: 'line', x1: 8, y1: 5.6, x2: 8, y2: 2.3 },\r\n { kind: 'line', x1: 8, y1: 5.6, x2: 5.1, y2: 7.3 },\r\n { kind: 'line', x1: 8, y1: 5.6, x2: 10.9, y2: 7.3 },\r\n { kind: 'circle', cx: 8, cy: 5.6, radius: 0.9, filled: true },\r\n { kind: 'line', x1: 8, y1: 9, x2: 8, y2: 9.8 },\r\n { kind: 'rect', x: 2.6, y: 9.8, width: 10.8, height: 3.4, radius: 1 },\r\n ],\r\n balance: [\r\n { kind: 'path', d: 'M4.1 7.8h7.8' },\r\n { kind: 'path', d: 'M5 7.8a3 3 0 0 0 6 0' },\r\n { kind: 'line', x1: 8, y1: 9.3, x2: 8, y2: 10.4 },\r\n { kind: 'rect', x: 2.2, y: 10.4, width: 11.6, height: 3.2, radius: 1 },\r\n { kind: 'rect', x: 9.6, y: 11.2, width: 2.6, height: 1.5, radius: 0.3 },\r\n ],\r\n\r\n // ---- Material structures -------------------------------------------------\r\n atom: [\r\n { kind: 'ellipse', cx: 8, cy: 8, rx: 6.2, ry: 2.5 },\r\n { kind: 'ellipse', cx: 8, cy: 8, rx: 6.2, ry: 2.5, rotate: 60 },\r\n { kind: 'ellipse', cx: 8, cy: 8, rx: 6.2, ry: 2.5, rotate: -60 },\r\n { kind: 'circle', cx: 8, cy: 8, radius: 1.05, filled: true },\r\n ],\r\n molecule: [\r\n { kind: 'line', x1: 5, y1: 4.2, x2: 11, y2: 4.2 },\r\n { kind: 'line', x1: 4.5, y1: 5.4, x2: 6.9, y2: 9.7 },\r\n { kind: 'line', x1: 11.5, y1: 5.4, x2: 9.1, y2: 9.7 },\r\n { kind: 'circle', cx: 3.6, cy: 4.2, radius: 1.35 },\r\n { kind: 'circle', cx: 12.4, cy: 4.2, radius: 1.35 },\r\n { kind: 'circle', cx: 8, cy: 11.6, radius: 1.35 },\r\n ],\r\n lattice: [\r\n { kind: 'line', x1: 3.6, y1: 3.6, x2: 3.6, y2: 12.4 },\r\n { kind: 'line', x1: 8, y1: 3.6, x2: 8, y2: 12.4 },\r\n { kind: 'line', x1: 12.4, y1: 3.6, x2: 12.4, y2: 12.4 },\r\n { kind: 'line', x1: 3.6, y1: 3.6, x2: 12.4, y2: 3.6 },\r\n { kind: 'line', x1: 3.6, y1: 8, x2: 12.4, y2: 8 },\r\n { kind: 'line', x1: 3.6, y1: 12.4, x2: 12.4, y2: 12.4 },\r\n { kind: 'circle', cx: 3.6, cy: 3.6, radius: 0.85, filled: true },\r\n { kind: 'circle', cx: 8, cy: 3.6, radius: 0.85, filled: true },\r\n { kind: 'circle', cx: 12.4, cy: 3.6, radius: 0.85, filled: true },\r\n { kind: 'circle', cx: 3.6, cy: 8, radius: 0.85, filled: true },\r\n { kind: 'circle', cx: 8, cy: 8, radius: 0.85, filled: true },\r\n { kind: 'circle', cx: 12.4, cy: 8, radius: 0.85, filled: true },\r\n { kind: 'circle', cx: 3.6, cy: 12.4, radius: 0.85, filled: true },\r\n { kind: 'circle', cx: 8, cy: 12.4, radius: 0.85, filled: true },\r\n { kind: 'circle', cx: 12.4, cy: 12.4, radius: 0.85, filled: true },\r\n ],\r\n layered: [\r\n { kind: 'rect', x: 2.6, y: 3, width: 10.8, height: 2.3, radius: 0.6 },\r\n { kind: 'rect', x: 3.6, y: 6.85, width: 10.8, height: 2.3, radius: 0.6 },\r\n { kind: 'rect', x: 2.6, y: 10.7, width: 10.8, height: 2.3, radius: 0.6 },\r\n ],\r\n framework: [\r\n { kind: 'rect', x: 2.6, y: 2.8, width: 10.8, height: 10.4, radius: 0.8 },\r\n { kind: 'line', x1: 8, y1: 2.8, x2: 8, y2: 13.2 },\r\n { kind: 'line', x1: 2.6, y1: 8, x2: 13.4, y2: 8 },\r\n { kind: 'circle', cx: 5.3, cy: 5.3, radius: 0.8, filled: true },\r\n { kind: 'circle', cx: 10.7, cy: 5.3, radius: 0.8, filled: true },\r\n { kind: 'circle', cx: 5.3, cy: 10.7, radius: 0.8, filled: true },\r\n { kind: 'circle', cx: 10.7, cy: 10.7, radius: 0.8, filled: true },\r\n ],\r\n 'thin-film': [\r\n { kind: 'path', d: 'M2.6 7.6q1.35-1.6 2.7 0t2.7 0t2.7 0t2.7 0' },\r\n { kind: 'line', x1: 2.6, y1: 9.4, x2: 13.4, y2: 9.4 },\r\n { kind: 'rect', x: 2.6, y: 10.6, width: 10.8, height: 2.6, radius: 0.6 },\r\n ],\r\n fiber: [\r\n { kind: 'path', d: 'M5 2.4c1 1.6-1 2.4 0 4s-1 2.4 0 4 0 1.6 0 3.2' },\r\n { kind: 'path', d: 'M8 2.4c1 1.6-1 2.4 0 4s-1 2.4 0 4 0 1.6 0 3.2' },\r\n { kind: 'path', d: 'M11 2.4c1 1.6-1 2.4 0 4s-1 2.4 0 4 0 1.6 0 3.2' },\r\n { kind: 'rect', x: 2.9, y: 7.2, width: 10.2, height: 1.8, radius: 0.9 },\r\n ],\r\n hydrogel: [\r\n { kind: 'rect', x: 2.4, y: 4.4, width: 11.2, height: 8.4, radius: 4.2 },\r\n { kind: 'path', d: 'M5.4 7.3L8 9.4L10.6 6.9L5.4 7.3' },\r\n { kind: 'circle', cx: 5.4, cy: 7.3, radius: 0.8, filled: true },\r\n { kind: 'circle', cx: 8, cy: 9.4, radius: 0.8, filled: true },\r\n { kind: 'circle', cx: 10.6, cy: 6.9, radius: 0.8, filled: true },\r\n ],\r\n\r\n // ---- Characterization ----------------------------------------------------\r\n microscope: [\r\n { kind: 'line', x1: 5.9, y1: 2.1, x2: 8.9, y2: 5.1 },\r\n { kind: 'circle', cx: 5.4, cy: 1.9, radius: 0.9 },\r\n { kind: 'circle', cx: 9.5, cy: 7.4, radius: 1.1 },\r\n { kind: 'path', d: 'M11 6.6c1.5 1.5 1.5 3.8 0 5.3' },\r\n { kind: 'line', x1: 4.2, y1: 10.4, x2: 11.6, y2: 10.4 },\r\n { kind: 'line', x1: 9.9, y1: 10.4, x2: 9.9, y2: 13.2 },\r\n { kind: 'line', x1: 3, y1: 13.2, x2: 12.6, y2: 13.2 },\r\n ],\r\n xrd: [\r\n { kind: 'path', d: 'M2.6 13.2V2.9h11' },\r\n {\r\n kind: 'path',\r\n d: 'M3.4 12.4h1.9l.6-4.6.6 4.6h1.9l.7-2.6.6 2.6h1.9l.9-6.1.7 6.1h1.3',\r\n },\r\n ],\r\n spectrum: [\r\n { kind: 'path', d: 'M6.6 4.4L9.8 10.6H3.4z' },\r\n { kind: 'line', x1: 1.2, y1: 8.4, x2: 4.4, y2: 8.4 },\r\n { kind: 'line', x1: 9.2, y1: 9.2, x2: 13.4, y2: 4.8 },\r\n { kind: 'line', x1: 9.6, y1: 10, x2: 13.7, y2: 6.4 },\r\n { kind: 'line', x1: 9.8, y1: 10.6, x2: 13.8, y2: 8.6 },\r\n ],\r\n tensile: [\r\n { kind: 'rect', x: 5.8, y: 7.2, width: 4.4, height: 1.6, radius: 0.4 },\r\n { kind: 'line', x1: 4.4, y1: 5.8, x2: 4.4, y2: 10.2 },\r\n { kind: 'line', x1: 11.6, y1: 5.8, x2: 11.6, y2: 10.2 },\r\n { kind: 'path', d: 'M2.4 8h1.7' },\r\n { kind: 'path', d: 'M3.3 7.2l.8.8-.8.8' },\r\n { kind: 'path', d: 'M13.6 8h-1.7' },\r\n { kind: 'path', d: 'M12.7 7.2l-.8.8.8.8' },\r\n { kind: 'line', x1: 8, y1: 4.9, x2: 8, y2: 3.2 },\r\n { kind: 'path', d: 'M7.2 4l.8-.8.8.8' },\r\n { kind: 'line', x1: 8, y1: 11.1, x2: 8, y2: 12.8 },\r\n { kind: 'path', d: 'M7.2 12l.8.8.8-.8' },\r\n ],\r\n electrode: [\r\n { kind: 'path', d: 'M3.2 8.6v4.4a1.2 1.2 0 0 0 1.2 1.2h7.2a1.2 1.2 0 0 0 1.2-1.2V8.6' },\r\n { kind: 'line', x1: 3.2, y1: 10.6, x2: 12.8, y2: 10.6 },\r\n { kind: 'line', x1: 6, y1: 2.4, x2: 6, y2: 10.6 },\r\n { kind: 'line', x1: 10, y1: 2.4, x2: 10, y2: 10.6 },\r\n { kind: 'line', x1: 5.2, y1: 2.4, x2: 6.8, y2: 2.4 },\r\n { kind: 'line', x1: 9.2, y1: 2.4, x2: 10.8, y2: 2.4 },\r\n ],\r\n 'iv-curve': [\r\n { kind: 'path', d: 'M2.8 13.2V3.2h10.4' },\r\n { kind: 'path', d: 'M3.6 12.4c2.6 0 2.7-4.6 5-5.6s3.4-2.6 4.3-3.4' },\r\n { kind: 'circle', cx: 8.6, cy: 6.8, radius: 0.8, filled: true },\r\n ],\r\n\r\n // ---- Functional devices --------------------------------------------------\r\n illumination: [\r\n { kind: 'rect', x: 4.6, y: 1.8, width: 6.8, height: 2.6, radius: 0.7 },\r\n { kind: 'line', x1: 6.2, y1: 4.9, x2: 4.6, y2: 8.4 },\r\n { kind: 'line', x1: 8, y1: 4.9, x2: 8, y2: 9 },\r\n { kind: 'line', x1: 9.8, y1: 4.9, x2: 11.4, y2: 8.4 },\r\n { kind: 'line', x1: 2.6, y1: 12.6, x2: 13.4, y2: 12.6 },\r\n ],\r\n temperature: [\r\n { kind: 'rect', x: 6.9, y: 2.4, width: 2.2, height: 8.2, radius: 1.1 },\r\n { kind: 'circle', cx: 8, cy: 12.2, radius: 1.9 },\r\n { kind: 'line', x1: 8, y1: 6.4, x2: 8, y2: 11.4 },\r\n { kind: 'line', x1: 9.1, y1: 4.8, x2: 10, y2: 4.8 },\r\n { kind: 'line', x1: 9.1, y1: 7, x2: 10, y2: 7 },\r\n { kind: 'line', x1: 9.1, y1: 9.2, x2: 10, y2: 9.2 },\r\n ],\r\n humidity: [\r\n { kind: 'path', d: 'M8 2.1c0 0-4.2 5-4.2 7.9a4.2 4.2 0 0 0 8.4 0C12.2 7.1 8 2.1 8 2.1z' },\r\n { kind: 'path', d: 'M6 10.2c1.3-1 2.7-1 4 0' },\r\n ],\r\n actuator: [\r\n { kind: 'path', d: 'M2.6 12.6c6 .4 9.2-1.8 10.2-6.4' },\r\n { kind: 'path', d: 'M2.6 10.6c5.2.3 7.8-1.6 8.6-5.2' },\r\n { kind: 'line', x1: 2.6, y1: 9.6, x2: 2.6, y2: 14 },\r\n ],\r\n 'flex-sensor': [\r\n { kind: 'path', d: 'M2.8 4.2v8.2h3.4V4.2h3.4v8.2h3.4V4.2' },\r\n { kind: 'circle', cx: 2.8, cy: 3.2, radius: 0.8, filled: true },\r\n { kind: 'circle', cx: 13, cy: 3.2, radius: 0.8, filled: true },\r\n { kind: 'circle', cx: 8, cy: 8.2, radius: 1.1 },\r\n ],\r\n battery: [\r\n { kind: 'rect', x: 1.8, y: 5.4, width: 11, height: 5.4, radius: 1 },\r\n { kind: 'rect', x: 12.8, y: 7.1, width: 1.6, height: 2, radius: 0.4 },\r\n { kind: 'path', d: 'M8.8 6.3L6.8 8.8h2.2l-1.4 2.5' },\r\n ],\r\n}\r\n\r\n/** Research icon id → picker section key. */\r\nexport const SCIENCE_ICON_SECTION_OF: Record = {\r\n 'test-tube': 'lab', flask: 'lab', pipette: 'lab', dropper: 'lab',\r\n stirrer: 'lab', hotplate: 'lab', centrifuge: 'lab', balance: 'lab',\r\n atom: 'materials', molecule: 'materials', lattice: 'materials', layered: 'materials',\r\n framework: 'materials', 'thin-film': 'materials', fiber: 'materials', hydrogel: 'materials',\r\n microscope: 'characterization', xrd: 'characterization', spectrum: 'characterization',\r\n tensile: 'characterization', electrode: 'characterization', 'iv-curve': 'characterization',\r\n illumination: 'devices', temperature: 'devices', humidity: 'devices',\r\n actuator: 'devices', 'flex-sensor': 'devices', battery: 'devices',\r\n}\r\n\r\nfunction Primitive({ primitive }: { primitive: SciencePrimitive }): ReactElement {\r\n switch (primitive.kind) {\r\n case 'line':\r\n return \r\n case 'rect':\r\n return (\r\n \r\n )\r\n case 'circle':\r\n return (\r\n \r\n )\r\n case 'ellipse':\r\n return (\r\n \r\n )\r\n case 'path':\r\n return \r\n }\r\n}\r\n\r\n/**\r\n * Render one research icon in the Host glyph's visual language: 16x16,\r\n * `currentColor` stroke, 1.3px, round joins, decorative for screen readers (the\r\n * row/picker button already carries the bilingual name).\r\n * @param props.icon - research icon id.\r\n * @param props.size - rendered square size in CSS pixels (default 16, like Host glyphs).\r\n */\r\nexport function ScienceGlyph({ icon, size = 16 }: { icon: ScienceIconId; size?: number }): ReactElement {\r\n return (\r\n \r\n {SCIENCE_ICON_ART[icon].map((primitive, index) => (\r\n \r\n ))}\r\n \r\n )\r\n}\r\n\r\n/** Research icon id → rendered node, merged into the row icon registry. */\r\nexport function scienceIconNodes(): Record {\r\n const nodes: Partial> = {}\r\n for (const id of SCIENCE_ICON_IDS) nodes[id] = \r\n return nodes as Record\r\n}\r\n","/**\r\n * Row components for the workspace-groups tree. Kept dependency-light: they\r\n * consume only React, primitives (StateDot/Menu/icons), and the shared CSS\r\n * string. Each row owns its hover actions menu; dialogs live in the browser\r\n * root so they survive row unmounts during collapse.\r\n *\r\n * Drag & drop: workspace rows are draggable sources; category rows (and\r\n * workspace rows, standing for their containing category) are drop targets.\r\n * The payload is a custom dataTransfer type so only in-plugin drags land.\r\n */\r\nimport { useEffect, useRef, useState, type AnimationEvent, type DragEvent, type ReactNode } from 'react'\r\nimport {\r\n IconNewChatOutlineMedium,\r\n IconSearchOutlineMedium,\r\n IconSettingsOutlineMedium,\r\n IconDeliverDocMedium,\r\n IconEditOutlineMedium,\r\n IconThinkOutlineMedium,\r\n IconAgentPresetOutlineMedium,\r\n IconBrowseOutlineMedium,\r\n IconContextInjectionOutlineMedium,\r\n IconLinkOutlineMedium,\r\n IconShareOutlineMedium,\r\n IconUserOutlineMedium,\r\n IconPaperPlaneOutlineMedium,\r\n IconPaperclipOutlineMedium,\r\n IconDownloadOutlineMedium,\r\n IconPlayOutlineMedium,\r\n IconPersonalizationOutlineMedium,\r\n IconDarkOutlineMedium,\r\n IconFollowsystemOutlineMedium,\r\n IconGaugeOutlineMedium,\r\n IconQueueOutlineMedium,\r\n IconListPenOutlineMedium,\r\n IconInspectOutlineMedium,\r\n IconQuestionOutlineMedium,\r\n IconInfoOutlineMedium,\r\n IconAlarmClockOutlineMedium,\r\n IconCompareSplitOutlineMedium,\r\n IconCheckCircleOutlineMedium,\r\n IconPinOutlineMedium,\r\n IconMicrophoneOutlineMedium,\r\n IconApiOutlineMedium,\r\n IconArchiveOutlineRegular,\r\n IconArchiveOutlineMedium,\r\n IconBranchOutlineMedium,\r\n IconBranchOutlineRegular,\r\n IconChecklistOutlineMedium,\r\n IconClockOutlineMedium,\r\n IconCodeOutlineMedium,\r\n IconCordisPluginOutlineMedium,\r\n IconDataOutlineMedium,\r\n IconDatabaseOutlineMedium,\r\n IconEditOutlineRegular,\r\n IconEllipsisOutlineRegular,\r\n IconFolderCloseMedium,\r\n IconFolderOpenMedium,\r\n IconFolderOpenOutlineRegular,\r\n IconGlobeOutlineMedium,\r\n IconGoalOutlineMedium,\r\n IconLightOutlineMedium,\r\n IconPinFillMedium,\r\n IconPinOutlineRegular,\r\n IconPlanOutlineMedium,\r\n IconPlusOutlineRegular,\r\n IconProjectAddOutlineMedium,\r\n IconRightUpOutlineRegular,\r\n IconShieldOutlineMedium,\r\n IconSkillOutlineMedium,\r\n IconSlidersTwoOutlineRegular,\r\n IconSparkleMedium,\r\n IconTreeCornerMedium,\r\n IconTrashOutlineRegular,\r\n IconUsersOutlineMedium,\r\n IconWorkspaceTreeOutlineMedium,\r\n Menu,\r\n StateDot,\r\n type MenuEntry,\r\n type StateDotState,\r\n} from '@deepseek-ai/dsh-client-ui-primitives'\r\nimport type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'\r\nimport type { WorkspaceGroupsKey } from './locales.ts'\r\nimport { SessionFlower } from './FlowerBranch.tsx'\r\nimport { scienceIconNodes, type ScienceIconId } from './group-icons-science.tsx'\r\nimport type { GroupIconId } from '../core/types.ts'\r\nimport type { CategoryNode, FolderNode, SessionNode, WorkspaceGroupNode } from './tree.ts'\r\n\r\ntype T = TranslateNS<'workspaceGroups'>\r\n\r\n/** dataTransfer type carrying the dragged workspace id (in-plugin drags only). */\r\nexport const DND_WORKSPACE_TYPE = 'application/x-dsh-workspace-groups'\r\n/** dataTransfer type carrying the dragged category key (group reorder). */\r\nexport const DND_CATEGORY_TYPE = 'application/x-dsh-workspace-groups-category'\r\n\r\n/** Whether a drag carries any of the plugin's payloads (drop targets accept both). */\r\nexport function hasPluginDragType(types: DOMStringList | readonly string[]): boolean {\r\n const list = Array.from(types as Iterable)\r\n return list.includes(DND_WORKSPACE_TYPE) || list.includes(DND_CATEGORY_TYPE)\r\n}\r\n\r\n/** Pending interaction status → primitives StateDot state. */\r\nfunction pendingState(status: SessionNode['pendingInteraction']): StateDotState | undefined {\r\n switch (status) {\r\n case 'approval':\r\n case 'plan-review':\r\n case 'question':\r\n return 'warning'\r\n default:\r\n return undefined\r\n }\r\n}\r\n\r\n/** Primary status dot state for a session row. */\r\nexport function sessionDotState(node: Pick): StateDotState {\r\n if (pendingState(node.pendingInteraction) !== undefined) return 'warning'\r\n if (node.running || node.runningSubagentCount > 0) return 'ongoing'\r\n return node.completed ? 'done' : 'done'\r\n}\r\n\r\n/** Compact relative time (\"now\"/\"5min\"/\"3h\"/\"2d\"/\"4mo\"/\"1y\"). */\r\nexport function relativeTimeLabel(updatedAt: number, now: number): string {\r\n const diff = Math.max(0, now - updatedAt)\r\n const MIN = 60_000\r\n const HOUR = 3_600_000\r\n const DAY = 86_400_000\r\n if (diff < MIN) return 'now'\r\n if (diff < HOUR) return `${Math.floor(diff / MIN)}min`\r\n if (diff < DAY) return `${Math.floor(diff / HOUR)}h`\r\n if (diff < 30 * DAY) return `${Math.floor(diff / DAY)}d`\r\n if (diff < 365 * DAY) return `${Math.floor(diff / (30 * DAY))}mo`\r\n return `${Math.floor(diff / (365 * DAY))}y`\r\n}\r\n\r\n/** Drop-target props shared by category and workspace rows (all optional). */\r\nexport interface RowDropProps {\r\n /** Row is under the dragged workspace — show the drop highlight. */\r\n dropActive?: boolean\r\n /** Insertion indicator: a line above (before) or below (after) this row. */\r\n insertLine?: 'before' | 'after'\r\n /** Accept a drag over this row (must preventDefault to allow the drop). */\r\n onRowDragOver?: (event: DragEvent) => void\r\n /** Clear the highlight when the pointer leaves the row. */\r\n onRowDragLeave?: (event: DragEvent) => void\r\n /** Drop a workspace onto this row. */\r\n onRowDrop?: (event: DragEvent) => void\r\n}\r\n\r\n/**\r\n * Preset group icon ids → primitives artwork. Medium stroke to match the\r\n * folder glyph used by unprefixed groups. Keyed by plain string so an id from\r\n * a newer host (or a hand-edited JSON file) degrades instead of throwing.\r\n */\r\nconst HOST_CATEGORY_ICONS = {\r\n folder: ,\r\n workspace: ,\r\n code: ,\r\n plugin: ,\r\n skill: ,\r\n data: ,\r\n database: ,\r\n api: ,\r\n plan: ,\r\n goal: ,\r\n light: ,\r\n globe: ,\r\n archive: ,\r\n branch: ,\r\n users: ,\r\n clock: ,\r\n shield: ,\r\n checklist: ,\r\n sparkle: ,\r\n tree: ,\r\n chat: ,\r\n search: ,\r\n settings: ,\r\n document: ,\r\n edit: ,\r\n think: ,\r\n agent: ,\r\n browse: ,\r\n context: ,\r\n link: ,\r\n share: ,\r\n user: ,\r\n send: ,\r\n attachment: ,\r\n download: ,\r\n play: ,\r\n design: ,\r\n moon: ,\r\n monitor: ,\r\n gauge: ,\r\n queue: ,\r\n notes: ,\r\n inspect: ,\r\n help: ,\r\n info: ,\r\n alarm: ,\r\n compare: ,\r\n done: ,\r\n pin: ,\r\n microphone: ,\r\n} satisfies Record, ReactNode>\r\n\r\n/**\r\n * Registered icon id → rendered artwork. The research family is merged in from\r\n * its own module: those glyphs are drawn locally (the Host primitive package\r\n * ships no lab/material icons) but must render through the very same path.\r\n */\r\nconst CATEGORY_ICONS: Record = {\r\n ...HOST_CATEGORY_ICONS,\r\n ...scienceIconNodes(),\r\n}\r\n\r\n/**\r\n * Resolve a stored `appearance.icon` value: a preset id renders the artwork,\r\n * a 1–4 character glyph renders as text, and anything else returns null so the\r\n * caller keeps the default folder icon.\r\n */\r\nfunction resolveCategoryIcon(icon: string | undefined): ReactNode | null {\r\n if (icon === undefined || icon === '') return null\r\n const preset = Object.prototype.hasOwnProperty.call(CATEGORY_ICONS, icon) ? CATEGORY_ICONS[icon] : undefined\r\n if (preset !== undefined) return preset\r\n return Array.from(icon).length <= 4 ? {icon} : null\r\n}\r\n\r\n/**\r\n * Render one stored icon value (preset artwork or a short glyph). Shared by the\r\n * category row's icon slot and the appearance picker grid, so both show exactly\r\n * the same artwork. `fallback` renders when the value is empty or unknown.\r\n */\r\nexport function CategoryGlyph({ icon, fallback = null }: { icon: string | undefined; fallback?: ReactNode }): JSX.Element {\r\n return <>{resolveCategoryIcon(icon) ?? fallback}\r\n}\r\n\r\n/**\r\n * One category folder row: toggle, rename/delete menu (every group — rule\r\n * groups via overlay renames/hides), draggable source for group reorder and\r\n * drop target for both workspace moves and group reorders.\r\n */\r\nexport function CategoryRow({ node, t, onToggle, onAddWorkspace, addingWorkspace = false, onRename, onDelete, onTogglePin, onEditAppearance, dropActive = false, insertLine, onRowDragOver, onRowDragLeave, onRowDrop, onDragStartCategory }: {\r\n node: CategoryNode\r\n t: T\r\n onToggle: () => void\r\n /** Create and assign a workspace directly to this category. */\r\n onAddWorkspace?: () => void\r\n addingWorkspace?: boolean\r\n /** Rename/delete actions; the hover menu renders only when both provided. */\r\n onRename?: () => void\r\n onDelete?: () => void\r\n /** Pin/unpin this group (menu row). */\r\n onTogglePin?: () => void\r\n /** Open the appearance dialog (menu row). */\r\n onEditAppearance?: () => void\r\n /** Group reorder source; the row becomes draggable only when provided. */\r\n onDragStartCategory?: (event: DragEvent) => void\r\n} & RowDropProps) {\r\n const [menuOpen, setMenuOpen] = useState(false)\r\n const count = node.workspaces.length\r\n const manageable = onRename !== undefined && onDelete !== undefined\r\n const pinned = node.appearance?.pinned === true\r\n const menuItems: MenuEntry[] = [\r\n ...(onTogglePin === undefined\r\n ? []\r\n : [{\r\n id: 'pin',\r\n label: pinned ? t('group.unpin') : t('group.pin'),\r\n icon: pinned ? : ,\r\n }]),\r\n ...(onEditAppearance === undefined\r\n ? []\r\n : [{ id: 'appearance', label: t('group.appearance'), icon: }]),\r\n { type: 'separator', id: 'group-menu-separator' },\r\n { id: 'rename', label: t('group.rename'), icon: },\r\n { id: 'delete', label: t('group.delete'), icon: , danger: true },\r\n ]\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n : }\r\n />\r\n \r\n {node.label}\r\n {pinned && (\r\n \r\n \r\n \r\n )}\r\n {/* One trailing slot for both states: the count and the hover buttons are\r\n stacked in the same grid cell pinned to the row's right edge, so the\r\n count is right-aligned exactly where the buttons appear and the swap\r\n never moves a box (see .wgRowTrail in styles.css). */}\r\n \r\n {count}\r\n \r\n {onAddWorkspace !== undefined && (\r\n \r\n )}\r\n {manageable && (\r\n { setMenuOpen(false) }}\r\n items={menuItems}\r\n onSelect={(id) => {\r\n setMenuOpen(false)\r\n if (id === 'pin') onTogglePin?.()\r\n if (id === 'appearance') onEditAppearance?.()\r\n if (id === 'rename') onRename()\r\n if (id === 'delete') onDelete()\r\n }}\r\n portal\r\n closeOnPointerLeave\r\n anchor={(\r\n { e.stopPropagation(); setMenuOpen(v => !v) }}\r\n >\r\n \r\n \r\n )}\r\n />\r\n )}\r\n \r\n \r\n \r\n )\r\n}\r\n\r\n/** One workspace folder row inside a category: draggable source + drop target. */\r\nexport function WorkspaceRow({ node, t, onToggle, onNewSession, onRename, onDelete, canMoveOut = false, onMoveOut, onManageFolders, onOpenInFolder, flat = false, dropActive = false, insertLine, onRowDragOver, onRowDragLeave, onRowDrop, onDragStartExtra }: {\r\n node: WorkspaceGroupNode\r\n t: T\r\n onToggle: () => void\r\n onNewSession: () => void\r\n onRename: () => void\r\n onDelete: () => void\r\n /** Project currently sits inside a group — offer \"move out of group\". */\r\n canMoveOut?: boolean\r\n onMoveOut?: () => void\r\n /** Open the folder-management dialog (extra folders + root). */\r\n onManageFolders?: () => void\r\n /**\r\n * Open the project directory in the host's file manager. Omitted when the\r\n * host resolved no folder application (no capability, or a remote launch),\r\n * which keeps the entry out of the menu entirely.\r\n */\r\n onOpenInFolder?: () => void\r\n /** Render as a top-level row (no folder indentation). */\r\n flat?: boolean\r\n /** Extra dragstart hook (e.g. collapse all expanded projects while dragging). */\r\n onDragStartExtra?: () => void\r\n} & RowDropProps) {\r\n const [menuOpen, setMenuOpen] = useState(false)\r\n const menuItems: MenuEntry[] = [\r\n ...(onOpenInFolder !== undefined\r\n ? [{ id: 'openInFolder', label: t('workspace.openInFolder'), icon: }]\r\n : []),\r\n ...(canMoveOut && onMoveOut !== undefined\r\n ? [{ id: 'moveOut', label: t('workspace.moveOutOfGroup'), icon: }]\r\n : []),\r\n ...(onManageFolders !== undefined\r\n ? [{ id: 'folders', label: t('folder.manage'), icon: }]\r\n : []),\r\n { id: 'rename', label: t('workspace.rename'), icon: },\r\n { id: 'delete', label: t('workspace.delete'), icon: , danger: true },\r\n ]\r\n const onDragStart = (event: DragEvent): void => {\r\n event.dataTransfer.setData(DND_WORKSPACE_TYPE, node.workspaceId)\r\n event.dataTransfer.effectAllowed = 'move'\r\n onDragStartExtra?.()\r\n }\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {/* Project rows use the project glyph (same as the official workspace\r\n browser) so groups (folder glyph) and projects stay distinguishable.\r\n Medium stroke like every other row glyph: the thin Regular artwork\r\n turns into a grey blob once the sidebar shrinks it. */}\r\n \r\n \r\n {node.label}\r\n {/* Same trailing-slot contract as groups and folders: the count and the\r\n hover buttons share one right-aligned grid cell, so the count sits where\r\n the buttons appear and the swap never moves either box. */}\r\n \r\n {node.sessionCount}\r\n {/* Action order is uniform across every row kind: new-session + first,\r\n menu ⋯ second (see CategoryRow). */}\r\n \r\n { e.stopPropagation(); onNewSession() }}\r\n >\r\n \r\n \r\n { setMenuOpen(false) }}\r\n items={menuItems}\r\n onSelect={(id) => {\r\n setMenuOpen(false)\r\n if (id === 'openInFolder') onOpenInFolder?.()\r\n if (id === 'moveOut') onMoveOut?.()\r\n if (id === 'folders') onManageFolders?.()\r\n if (id === 'rename') onRename()\r\n if (id === 'delete') onDelete()\r\n }}\r\n portal\r\n closeOnPointerLeave\r\n anchor={(\r\n { e.stopPropagation(); setMenuOpen(v => !v) }}\r\n >\r\n \r\n \r\n )}\r\n />\r\n \r\n \r\n \r\n )\r\n}\r\n\r\n/**\r\n * One folder row under a project: the base directory (folder #0) plus every\r\n * extra folder of that workspace. Sits at the session indent level so the\r\n * 42/58/74 ladder is preserved, and its own session rows indent one step\r\n * deeper (see `.wgSessionNested`).\r\n *\r\n * Deliberately NOT a drag source or drop target: folders are a fixed,\r\n * host-ordered list; reordering them would need a write path this feature does\r\n * not have.\r\n */\r\nexport function FolderRow({ node, t, onToggle, onNewSession, onSetRoot, onRemove, onOpenInFolder, creating = false }: {\r\n node: FolderNode\r\n t: T\r\n onToggle: () => void\r\n onNewSession: () => void\r\n onSetRoot: () => void\r\n onRemove: () => void\r\n /** Absent when the host resolved no folder application. */\r\n onOpenInFolder?: () => void\r\n /** A session is being created here: the hover + stays disabled. */\r\n creating?: boolean\r\n}) {\r\n const [menuOpen, setMenuOpen] = useState(false)\r\n const menuItems: MenuEntry[] = [\r\n { id: 'newSession', label: t('session.new'), icon: },\r\n ...(onOpenInFolder !== undefined\r\n ? [{ id: 'openInFolder', label: t('workspace.openInFolder'), icon: }]\r\n : []),\r\n ...(node.isRoot\r\n ? []\r\n : [{ id: 'setRoot', label: t('folder.setRoot'), icon: }]),\r\n ...(node.isBase\r\n ? []\r\n : [\r\n { type: 'separator' as const, id: 'folder-menu-separator' },\r\n { id: 'remove', label: t('folder.remove'), icon: , danger: true },\r\n ]),\r\n ]\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {node.expanded ? : }\r\n \r\n {node.label}\r\n {node.isRoot && (\r\n ★\r\n )}\r\n {/* Count and hover buttons share the same right-aligned cell (as on every\r\n other row): the count is flush with the row's right edge and yields to\r\n the buttons without any reflow. */}\r\n \r\n {node.sessions.length}\r\n {/* Same + then ⋯ order as groups and workspaces. */}\r\n \r\n { e.stopPropagation(); onNewSession() }}\r\n >\r\n \r\n \r\n { setMenuOpen(false) }}\r\n items={menuItems}\r\n onSelect={(id) => {\r\n setMenuOpen(false)\r\n if (id === 'newSession') onNewSession()\r\n if (id === 'openInFolder') onOpenInFolder?.()\r\n if (id === 'setRoot') onSetRoot()\r\n if (id === 'remove') onRemove()\r\n }}\r\n portal\r\n closeOnPointerLeave\r\n anchor={(\r\n { e.stopPropagation(); setMenuOpen(v => !v) }}\r\n >\r\n \r\n \r\n )}\r\n />\r\n \r\n \r\n \r\n )\r\n}\r\n\r\n/**\r\n * Children container for one folder's rows.\r\n *\r\n * Keeps the tree's `role=\"group\"` semantics and gives the rows a single\r\n * positioned ancestor. It used to draw a per-folder guide rail; that is now the\r\n * flower branch's job (one continuous stem for the whole tree, see\r\n * `FlowerBranch.tsx`), so this is structure only.\r\n */\r\nexport function TreeChildren({ children }: { children: ReactNode }) {\r\n return (\r\n
\r\n {children}\r\n
\r\n )\r\n}\r\n\r\n/** Keyframe names the disclosure animation relies on (styles.css). */\r\nconst ROW_GROUP_OPEN_ANIMATION = 'wg-rows-in'\r\nconst ROW_GROUP_CLOSE_ANIMATION = 'wg-rows-out'\r\n\r\n/** Upper bound for one disclosure animation (180ms open / 160ms close). */\r\nconst ROW_GROUP_ANIMATION_FALLBACK_MS = 400\r\n\r\n/** Lifecycle of one animated disclosure body. */\r\ntype RowGroupPhase = 'opening' | 'open' | 'closing' | 'closed'\r\n\r\n/** Whether the user asked the OS to reduce motion (no sync unmount without it). */\r\nfunction prefersReducedMotion(): boolean {\r\n return typeof window !== 'undefined'\r\n && typeof window.matchMedia === 'function'\r\n && window.matchMedia('(prefers-reduced-motion: reduce)').matches\r\n}\r\n\r\n/**\r\n * Animated disclosure body shared by the category and project levels.\r\n *\r\n * Collapsed state renders nothing at all (same DOM as the old\r\n * `{expanded && …}`), so hidden subtrees cost no layout. Expanding plays a\r\n * 0fr→1fr grid animation; collapsing keeps the rows mounted for one closing\r\n * animation and unmounts on its `animationend`. `prefers-reduced-motion`\r\n * unmounts synchronously instead — waiting for an `animationend` that CSS\r\n * disabled would leave the group stuck half-closed.\r\n *\r\n * The flower-branch overlay cannot follow a moving row box, so the animation\r\n * phase exposes `data-wg-animating` (styles.css fades the vine while it is\r\n * present).\r\n */\r\nexport function RowGroup({ expanded, className, animate = true, children }: {\r\n expanded: boolean\r\n className?: string\r\n /** Disable the animation for huge subtrees or during drag folding. */\r\n animate?: boolean\r\n children: ReactNode\r\n}): JSX.Element | null {\r\n const [phase, setPhase] = useState(expanded ? 'open' : 'closed')\r\n const previousExpanded = useRef(expanded)\r\n // Adjust state while rendering (React's documented prop-change pattern) so a\r\n // reduced-motion collapse unmounts in the same commit instead of flashing\r\n // the old rows for a frame.\r\n if (previousExpanded.current !== expanded) {\r\n previousExpanded.current = expanded\r\n if (expanded) setPhase(animate && !prefersReducedMotion() ? 'opening' : 'open')\r\n else setPhase(animate && !prefersReducedMotion() ? 'closing' : 'closed')\r\n }\r\n // Insurance against a missing `animationend` (interrupted or skipped\r\n // animation): the animating phase holds `pointer-events:none` and keeps a\r\n // collapsed body mounted, so it must always settle on its own.\r\n useEffect(() => {\r\n if (phase !== 'opening' && phase !== 'closing') return undefined\r\n const timer = window.setTimeout(() => {\r\n setPhase(phase === 'opening' ? 'open' : 'closed')\r\n }, ROW_GROUP_ANIMATION_FALLBACK_MS)\r\n return () => { window.clearTimeout(timer) }\r\n }, [phase])\r\n if (phase === 'closed') return null\r\n const animating = phase === 'opening' || phase === 'closing'\r\n const classes = `wgRows${className === undefined ? '' : ` ${className}`}${phase === 'opening' ? ' wgRowsOpening' : ''}${phase === 'closing' ? ' wgRowsClosing' : ''}`\r\n const onAnimationEnd = (event: AnimationEvent): void => {\r\n if (event.target !== event.currentTarget) return\r\n if (phase === 'opening' && event.animationName === ROW_GROUP_OPEN_ANIMATION) setPhase('open')\r\n if (phase === 'closing' && event.animationName === ROW_GROUP_CLOSE_ANIMATION) setPhase('closed')\r\n }\r\n return (\r\n \r\n
{children}
\r\n \r\n )\r\n}\r\n\r\n/** One session leaf row. */\r\nexport function SessionRow({ node, currentId, now, t, onOpen, onRename, onFork, onArchive, nested = false }: {\r\n node: SessionNode\r\n currentId: string | undefined\r\n now: number\r\n t: T\r\n onOpen: (id: SessionNode['id']) => void\r\n onRename: (id: SessionNode['id'], currentTitle: string) => void\r\n onFork: (id: SessionNode['id']) => void\r\n onArchive: (id: SessionNode['id']) => void\r\n /** Rendered under a folder row: one indent step deeper than a plain session. */\r\n nested?: boolean\r\n}) {\r\n const selected = node.id === currentId\r\n const [menuOpen, setMenuOpen] = useState(false)\r\n // Keep the active flower inside its own status slot, never in a measured\r\n // overlay: scrolling and expanding ancestors must move it with this row.\r\n const menuItems = [\r\n { id: 'rename', label: t('session.rename'), icon: },\r\n { id: 'fork', label: t('session.fork'), icon: },\r\n { id: 'archive', label: t('session.archive'), icon: },\r\n ]\r\n return (\r\n { onOpen(node.id) }}\r\n >\r\n \r\n {selected\r\n ? 0} />\r\n : }\r\n \r\n {node.title}\r\n {node.snippet !== undefined && (\r\n {node.snippet}\r\n )}\r\n {/* Same trailing slot as groups, workspaces and folders: the time is\r\n right-aligned on the row's right edge and yields to the ⋯ button on\r\n hover/focus without moving either box (see .wgRowTrail in styles.css). */}\r\n {!node.blank && (\r\n \r\n {relativeTimeLabel(node.updatedAt, now)}\r\n \r\n { setMenuOpen(false) }}\r\n items={menuItems}\r\n onSelect={(id) => {\r\n setMenuOpen(false)\r\n if (id === 'rename') onRename(node.id, node.title)\r\n if (id === 'fork') onFork(node.id)\r\n if (id === 'archive') onArchive(node.id)\r\n }}\r\n portal\r\n closeOnPointerLeave\r\n anchor={(\r\n { e.stopPropagation(); setMenuOpen(v => !v) }}\r\n >\r\n \r\n \r\n )}\r\n />\r\n \r\n \r\n )}\r\n \r\n )\r\n}\r\n\r\nexport type { T }\r\n","import type { GroupIconId } from '../core/types.ts'\r\n\r\n/** Bilingual accessible names also make native browser tooltips recognizable in either locale. */\r\nexport const GROUP_ICON_LABELS: Record = {\r\n folder: '文件夹 / Folder', workspace: '工作区 / Workspace', code: '代码 / Code',\r\n plugin: '插件 / Plugin', skill: '技能 / Skill', data: '数据 / Data',\r\n database: '数据库 / Database', api: '接口 / API', plan: '计划 / Plan',\r\n goal: '目标 / Goal', light: '日光 / Sun', globe: '全球 / Globe',\r\n archive: '归档 / Archive', branch: '分支 / Branch', users: '团队 / Team',\r\n clock: '时间 / Clock', shield: '安全 / Security', checklist: '清单 / Checklist',\r\n sparkle: '灵感 / Sparkle', tree: '层级 / Tree',\r\n chat: '对话 / Chat', search: '搜索 / Search', settings: '设置 / Settings',\r\n document: '文档 / Document', edit: '编辑 / Edit', think: '思考 / Think',\r\n agent: '智能体 / Agent', browse: '浏览 / Browse', context: '上下文 / Context',\r\n link: '链接 / Link', share: '分享 / Share', user: '个人 / Personal',\r\n send: '发送 / Send', attachment: '附件 / Attachment', download: '下载 / Download',\r\n play: '运行 / Run', design: '设计 / Design', moon: '夜间 / Moon',\r\n monitor: '桌面 / Desktop', gauge: '性能 / Performance', queue: '队列 / Queue',\r\n notes: '笔记 / Notes', inspect: '检查 / Inspect', help: '帮助 / Help',\r\n info: '信息 / Information', alarm: '提醒 / Reminder', compare: '对比 / Compare',\r\n done: '完成 / Done', pin: '重点 / Pin', microphone: '语音 / Voice',\r\n // Materials & Lab family\r\n 'test-tube': '试管 / Test tube', flask: '烧瓶 / Flask', pipette: '移液枪 / Pipette',\r\n dropper: '滴液 / Dropper', stirrer: '磁力搅拌 / Magnetic stirrer', hotplate: '加热台 / Hot plate',\r\n centrifuge: '离心机 / Centrifuge', balance: '电子天平 / Balance',\r\n atom: '原子 / Atom', molecule: '分子 / Molecule', lattice: '晶格 / Crystal lattice',\r\n layered: '层状材料 / Layered material', framework: '多孔框架 / Porous framework',\r\n 'thin-film': '薄膜 / Thin film', fiber: '纤维 / Fiber', hydrogel: '水凝胶 / Hydrogel',\r\n microscope: '显微镜 / Microscope', xrd: 'XRD 衍射峰 / XRD pattern', spectrum: '光谱 / Spectrum',\r\n tensile: '拉伸测试 / Tensile test', electrode: '电极 / Electrode', 'iv-curve': '电学曲线 / I–V curve',\r\n illumination: '光照 / Illumination', temperature: '温度 / Temperature', humidity: '湿度 / Humidity',\r\n actuator: '弯曲驱动器 / Bending actuator', 'flex-sensor': '柔性传感器 / Flexible sensor',\r\n battery: '电池 / Battery',\r\n}\r\n\r\n/** All presets satisfy the existing host's 1–4 Unicode-code-point custom-glyph rule. */\r\nexport const GROUP_EMOJI_ICONS = [\r\n { icon: '🚀', label: '启动 / Launch' },\r\n { icon: '📚', label: '学习 / Learning' },\r\n { icon: '🔬', label: '科研 / Research' },\r\n { icon: '🧪', label: '实验 / Experiment' },\r\n { icon: '🎨', label: '创作 / Art' },\r\n { icon: '🎯', label: '目标 / Target' },\r\n { icon: '💡', label: '想法 / Idea' },\r\n { icon: '🛠️', label: '工具 / Tools' },\r\n { icon: '🌱', label: '成长 / Growth' },\r\n { icon: '🏠', label: '生活 / Home' },\r\n { icon: '💼', label: '工作 / Work' },\r\n { icon: '🎮', label: '游戏 / Games' },\r\n { icon: '🎵', label: '音乐 / Music' },\r\n { icon: '❤️', label: '收藏 / Favorites' },\r\n { icon: '⭐', label: '星标 / Star' },\r\n { icon: '🔥', label: '热门 / Hot' },\r\n] as const\r\n","/**\r\n * Client side of the per-workspace folder list, talking to\r\n * `GET|PUT /workspace-groups/folders` on the host.\r\n *\r\n * The document is the host's JSON sidecar verbatim (`version` + `workspaces`),\r\n * so the client and the host agree on one shape: `folders` holds EXTRA folders\r\n * only — the workspace's canonical directory is implicit folder #0 — and\r\n * `root` names one of those extras (absent means \"the workspace itself\").\r\n *\r\n * Reads are best-effort, like the manual overlay and the tab strip: a failed\r\n * read means \"no extra folders\". A failed write, however, rejects so the caller\r\n * can say so — a folder row that silently forgot its edit would be worse than\r\n * the toast.\r\n */\r\nimport {\r\n EMPTY_FOLDERS_DOCUMENT,\r\n type FolderMember,\r\n type FoldersDocument,\r\n type WorkspaceFolderEntry,\r\n} from '../core/folders.ts'\r\n\r\n/** Host route holding the folder overlay. */\r\nexport const FOLDERS_ROUTE = '/workspace-groups/folders'\r\n\r\n/** One successful read: the overlay plus the mirror base the host reported. */\r\nexport interface FoldersSnapshot {\r\n readonly document: FoldersDocument\r\n /**\r\n * Local mirror root of the remote-ssh plugin, when the host named one.\r\n * Workspaces whose directory lives below it are remote mirrors, so their extra\r\n * folders must be subdirectories of that same mirror.\r\n */\r\n readonly remoteBase?: string\r\n}\r\n\r\n/**\r\n * One folder-overlay read result. A failed read must never masquerade as the\r\n * empty document: the browser uses `ok` to keep the last confirmed rows and\r\n * show a retryable error instead of rendering every member as a duplicate.\r\n */\r\nexport interface FoldersLoadResult extends FoldersSnapshot {\r\n readonly ok: boolean\r\n /** Human-readable failure reason; absent on success. */\r\n readonly error?: string\r\n}\r\n\r\n/** One non-empty string field, or undefined when it is absent or blank. */\r\nfunction wireText(value: unknown): string | undefined {\r\n if (typeof value !== 'string') return undefined\r\n const trimmed = value.trim()\r\n return trimmed === '' ? undefined : trimmed\r\n}\r\n\r\n/**\r\n * Read one member (a folder backed by its own workspace) off the wire.\r\n * @param value - one value of the stored `members` list.\r\n * @returns the member, or null for a malformed one.\r\n */\r\nfunction parseWireMember(value: unknown): FolderMember | null {\r\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return null\r\n const row = value as Record\r\n const path = wireText(row.path)\r\n const workspaceId = wireText(row.workspaceId)\r\n // A member without a directory or without its workspace cannot run a session,\r\n // so it is not worth a row.\r\n if (path === undefined || workspaceId === undefined) return null\r\n const remotePath = wireText(row.remotePath)\r\n const profileId = wireText(row.profileId)\r\n const recordId = wireText(row.recordId)\r\n const title = wireText(row.title)\r\n return {\r\n path,\r\n workspaceId,\r\n kind: row.kind === 'remote' ? 'remote' : 'local',\r\n ...(remotePath === undefined ? {} : { remotePath }),\r\n ...(profileId === undefined ? {} : { profileId }),\r\n ...(recordId === undefined ? {} : { recordId }),\r\n ...(title === undefined ? {} : { title }),\r\n }\r\n}\r\n\r\n/**\r\n * Read one workspace entry off the wire, dropping the entry when it is\r\n * unusable.\r\n *\r\n * `members` must survive this round trip: the client owns the whole document\r\n * (the PUT sends it back verbatim), so an entry parsed without its members is\r\n * not merely a display gap — the next folder edit would rewrite the sidecar and\r\n * erase every member-backed folder for good.\r\n * @param value - one value of the stored `workspaces` mapping.\r\n * @returns the entry, or null for a malformed one.\r\n */\r\nfunction parseWireEntry(value: unknown): WorkspaceFolderEntry | null {\r\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return null\r\n const row = value as Record\r\n const folders: string[] = []\r\n if (Array.isArray(row.folders)) {\r\n for (const candidate of row.folders) {\r\n const path = wireText(candidate)\r\n if (path !== undefined) folders.push(path)\r\n }\r\n }\r\n const members: FolderMember[] = []\r\n if (Array.isArray(row.members)) {\r\n for (const candidate of row.members) {\r\n const member = parseWireMember(candidate)\r\n if (member !== null) members.push(member)\r\n }\r\n }\r\n if (folders.length === 0 && members.length === 0) return null\r\n const root = wireText(row.root)\r\n return {\r\n folders,\r\n ...(members.length === 0 ? {} : { members }),\r\n ...(root === undefined ? {} : { root }),\r\n }\r\n}\r\n\r\n/**\r\n * Fetch the stored folder overlay.\r\n *\r\n * A non-2xx response, a malformed body or a transport error is returned as\r\n * `ok:false` with the reason. The empty document is still present for callers\r\n * that only need a safe value, but `ok` is the authority: the browser must not\r\n * treat a failed read as \"no folders\".\r\n * @param fetchImpl - fetch implementation (injectable for tests).\r\n * @param signal - optional cancellation for a superseded read/retry.\r\n */\r\nexport async function loadFolders(\r\n fetchImpl: typeof fetch = fetch,\r\n signal?: AbortSignal,\r\n): Promise {\r\n try {\r\n const response = await fetchImpl(FOLDERS_ROUTE, {\r\n method: 'GET',\r\n // Folders are user state; a cached response would show stale rows.\r\n cache: 'no-store',\r\n ...(signal === undefined ? {} : { signal }),\r\n })\r\n if (!response.ok) {\r\n return { ok: false, document: EMPTY_FOLDERS_DOCUMENT, error: `HTTP ${response.status}` }\r\n }\r\n const body: unknown = await response.json()\r\n if (typeof body !== 'object' || body === null) {\r\n return { ok: false, document: EMPTY_FOLDERS_DOCUMENT, error: '响应不是 JSON 对象' }\r\n }\r\n const source = body as Record\r\n const remoteBase = typeof source.remoteBase === 'string' && source.remoteBase.trim() !== ''\r\n ? source.remoteBase.trim()\r\n : undefined\r\n const base = remoteBase === undefined ? {} : { remoteBase }\r\n const document = parseWireDocument(source)\r\n if (document === null) {\r\n return { ok: false, document: EMPTY_FOLDERS_DOCUMENT, ...base, error: '文件夹文档格式无效' }\r\n }\r\n return { ok: true, document, ...base }\r\n } catch (error) {\r\n if (signal?.aborted === true) {\r\n return { ok: false, document: EMPTY_FOLDERS_DOCUMENT, error: 'aborted' }\r\n }\r\n return {\r\n ok: false,\r\n document: EMPTY_FOLDERS_DOCUMENT,\r\n error: error instanceof Error ? error.message : String(error),\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Read a whole folder document off the wire (GET response, PUT echo or the\r\n * 409 conflict body), or null when it is not a version-1 document.\r\n * @param source - parsed JSON body.\r\n */\r\nexport function parseWireDocument(source: Record): FoldersDocument | null {\r\n if (source.version !== 1) return null\r\n const revision = typeof source.revision === 'number' && Number.isSafeInteger(source.revision) && source.revision >= 0\r\n ? source.revision\r\n : 0\r\n if (typeof source.workspaces !== 'object' || source.workspaces === null || Array.isArray(source.workspaces)) {\r\n return { version: 1, revision, workspaces: {} }\r\n }\r\n const workspaces: Record = {}\r\n for (const [workspaceId, value] of Object.entries(source.workspaces)) {\r\n if (workspaceId === '__proto__') continue // assigning it would mutate the record's prototype\r\n const entry = parseWireEntry(value)\r\n if (entry !== null) workspaces[workspaceId] = entry\r\n }\r\n return { version: 1, revision, workspaces }\r\n}\r\n\r\n/**\r\n * A save rejected because another window wrote first (HTTP 409). Carries the\r\n * host's current document so the caller can adopt it and resync its state\r\n * instead of leaving the user looking at a phantom edit.\r\n */\r\nexport class FoldersConflictError extends Error {\r\n readonly current: FoldersDocument\r\n /** The unsaved document the failed PUT attempted to write. */\r\n readonly attempted: FoldersDocument\r\n constructor(current: FoldersDocument, attempted: FoldersDocument = current) {\r\n super('folder overlay changed in another window')\r\n this.name = 'FoldersConflictError'\r\n this.current = current\r\n this.attempted = attempted\r\n }\r\n}\r\n\r\n/**\r\n * Store the whole folder overlay.\r\n *\r\n * Unlike the tab strip this does NOT swallow failures: folder edits are explicit\r\n * row/dialog actions, so the caller turns a rejection into a toast instead of\r\n * leaving the user with a row that silently forgot its folder.\r\n * @param document - the client's current document.\r\n * @param fetchImpl - fetch implementation (injectable for tests).\r\n */\r\nexport async function saveFolders(\r\n document: FoldersDocument,\r\n fetchImpl: typeof fetch = fetch,\r\n): Promise {\r\n const response = await fetchImpl(FOLDERS_ROUTE, {\r\n method: 'PUT',\r\n headers: { 'Content-Type': 'application/json' },\r\n body: JSON.stringify(document),\r\n cache: 'no-store',\r\n // The write is idempotent, so surviving a navigation with keepalive is\r\n // safe and avoids losing the just-added folder.\r\n keepalive: true,\r\n })\r\n if (response.status === 409) {\r\n const body: unknown = await response.json().catch(() => null)\r\n const current = typeof body === 'object' && body !== null\r\n ? parseWireDocument(body as Record)\r\n : null\r\n throw new FoldersConflictError(current ?? EMPTY_FOLDERS_DOCUMENT, document)\r\n }\r\n if (!response.ok) throw new Error(`PUT ${FOLDERS_ROUTE}: ${response.status}`)\r\n // Adopt the host's echo: it is the normalized document (with the bumped\r\n // revision) that was actually stored.\r\n const body: unknown = await response.json().catch(() => null)\r\n const stored = typeof body === 'object' && body !== null\r\n ? parseWireDocument(body as Record)\r\n : null\r\n return stored ?? document\r\n}\r\n","/** One directory operation for local DSH and optional remote-ssh workspaces.\r\n * Never send remote writes through the sidebar route: without its SSH interceptor\r\n * that route can create a LOCAL directory instead. Use the SSH-owned API instead.\r\n */\r\nimport { isUnderBase, joinSubpath, samePath } from '../core/folders.ts'\r\n\r\nexport interface RemoteFolderWorkspace {\r\n mirrorPath: string\r\n remotePath: string\r\n profileId: string\r\n /** Native DSH workspace registered for the mirror root ('' when unregistered). */\r\n workspaceId: string\r\n /** remote-ssh's own record id ('' when it cannot be resolved). */\r\n recordId: string\r\n}\r\n\r\ntype JsonObject = Record\r\nfunction object(value: unknown): JsonObject | undefined {\r\n return typeof value === 'object' && value !== null && !Array.isArray(value)\r\n ? value as JsonObject : undefined\r\n}\r\nfunction message(value: JsonObject | undefined): string {\r\n const error = value?.error\r\n return typeof error === 'string' ? error\r\n : typeof object(error)?.message === 'string' ? String(object(error)?.message)\r\n : typeof value?.stderr === 'string' && value.stderr !== '' ? value.stderr\r\n : 'Remote SSH request failed'\r\n}\r\n\r\nasync function rpc(method: string, body: JsonObject, fetchImpl: typeof fetch): Promise {\r\n const response = await fetchImpl(`/remote-ssh/api/${method}`, {\r\n method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Requested-With': 'XMLHttpRequest' },\r\n body: JSON.stringify(body), cache: 'no-store', signal: AbortSignal.timeout(30000),\r\n })\r\n // Only catalog absence denotes an optional plugin not installed/running.\r\n if (response.status === 404 && method === 'listWorkspaces') return null\r\n if (!response.ok) throw new Error(`Remote SSH ${method}: HTTP ${response.status}`)\r\n const envelope = object(await response.json())\r\n const value = object(envelope?.value)\r\n if (envelope?.ok !== true || value?.ok !== true) throw new Error(message(value ?? envelope))\r\n return value\r\n}\r\n\r\n/** A marker is only a refusal hint, never authority to execute remote commands. */\r\nasync function refuseMarkedLocalPath(path: string, fetchImpl: typeof fetch): Promise {\r\n const response = await fetchImpl(`/workspace-groups/remote-hint?path=${encodeURIComponent(path)}`, {\r\n cache: 'no-store', signal: AbortSignal.timeout(10000),\r\n })\r\n if (!response.ok) throw new Error(`Cannot verify local directory: HTTP ${response.status}`)\r\n const body = object(await response.json())\r\n if (typeof body?.remoteHint !== 'boolean') throw new Error('Invalid directory safety response')\r\n if (body.remoteHint) throw new Error('SSH marker detected but no active registered remote workspace; refusing local operation')\r\n}\r\n\r\n/** One SSH connection the remote plugin offers, as the picker needs it. */\r\nexport interface RemoteProfileSummary {\r\n id: string\r\n name: string\r\n host: string\r\n user: string\r\n /** Directory the connection opens on (`~` when the plugin leaves it empty). */\r\n remoteRoot: string\r\n}\r\n\r\n/** One row of a remote directory listing. */\r\nexport interface RemoteDirEntry {\r\n name: string\r\n type: 'directory' | 'file'\r\n size: number\r\n}\r\n\r\n/** A remote directory and its children, as the cloud folder picker needs them. */\r\nexport interface RemoteDirListing {\r\n /** Path as requested (`~`, a relative name or an absolute path). */\r\n requested: string\r\n /** Absolute path the remote shell resolved it to (`requested` when unknown). */\r\n resolved: string\r\n entries: readonly RemoteDirEntry[]\r\n}\r\n\r\n/** Single-quote one POSIX shell word; `~` expands only when it stays unquoted. */\r\nfunction shellWord(path: string): string {\r\n return `'${path.replace(/'/gu, `'\\\\''`)}'`\r\n}\r\n\r\n/** Quote a remote path for `sh`, keeping a leading `~` expandable. */\r\nfunction shellPath(path: string): string {\r\n if (path === '~') return '~'\r\n if (path.startsWith('~/')) return `~/${shellWord(path.slice(2))}`\r\n return shellWord(path)\r\n}\r\n\r\n/** Parent of a directory path, or null where going up stops (`~`, `/`, root). */\r\nexport function remoteDirParent(path: string): string | null {\r\n const trimmed = path.trim().replace(/\\/+$/u, '')\r\n if (trimmed === '' || trimmed === '~' || trimmed === '.') return null\r\n const cut = trimmed.lastIndexOf('/')\r\n if (cut < 0) return null\r\n if (cut === 0) return '/'\r\n return trimmed.slice(0, cut)\r\n}\r\n\r\n/** Join a child directory name onto a remote directory path. */\r\nexport function remoteDirJoin(base: string, name: string): string {\r\n if (base === '') return name\r\n return base.endsWith('/') ? `${base}${name}` : `${base}/${name}`\r\n}\r\n\r\n/**\r\n * List one remote directory through the SSH plugin's own pooled session, so\r\n * password auth, ProxyJump and host-key handling stay where they already work.\r\n * @param profileId - SSH connection to browse.\r\n * @param path - directory to list; empty means the connection's remote root.\r\n * @param fetchImpl - fetch implementation (tests inject one).\r\n */\r\nexport async function listRemoteDirectory(\r\n profileId: string, path: string, fetchImpl: typeof fetch = fetch,\r\n): Promise {\r\n const requested = path.trim() === '' ? '~' : path.trim()\r\n const value = await rpc('listDir', { profileId, path: requested }, fetchImpl)\r\n if (value === null) throw new Error('The SSH plugin is unavailable; cannot browse that connection')\r\n const rows = Array.isArray(value.entries) ? value.entries : []\r\n const entries: RemoteDirEntry[] = []\r\n for (const raw of rows) {\r\n const row = object(raw)\r\n if (row === undefined || typeof row.name !== 'string' || row.name === '') continue\r\n entries.push({\r\n name: row.name,\r\n type: row.type === 'directory' ? 'directory' : 'file',\r\n size: typeof row.size === 'number' && Number.isFinite(row.size) ? row.size : 0,\r\n })\r\n }\r\n return { requested, resolved: await resolveRemoteDirectory(profileId, requested, fetchImpl) ?? requested, entries }\r\n}\r\n\r\n/** Absolute form of a remote path, or null when the remote shell cannot resolve it. */\r\nasync function resolveRemoteDirectory(\r\n profileId: string, path: string, fetchImpl: typeof fetch,\r\n): Promise {\r\n try {\r\n const value = await rpc('remoteExec', { profileId, command: `cd ${shellPath(path)} && pwd -P` }, fetchImpl)\r\n const stdout = typeof value?.stdout === 'string' ? value.stdout.trim() : ''\r\n const line = stdout.split('\\n').filter(text => text.trim() !== '').pop()\r\n return line === undefined ? null : line.trim()\r\n } catch {\r\n // Listing succeeded but the path cannot be named (a shell without cd): keep browsing.\r\n return null\r\n }\r\n}\r\n\r\n/** A newly registered remote (mirror-backed) folder workspace. */\r\nexport interface CreatedRemoteFolder {\r\n /** Absolute LOCAL mirror path — the member workspace's canonical directory. */\r\n path: string\r\n /** Native DSH workspace id that now backs the folder row. */\r\n workspaceId: string\r\n /** remote-ssh's own record id (used to delete the record again). */\r\n recordId: string\r\n remotePath: string\r\n profileId: string\r\n title: string\r\n /** True when an existing record for the same profile + remote path was taken over. */\r\n reused: boolean\r\n}\r\n\r\n/**\r\n * The SSH connections available for a cloud folder, or null when the\r\n * `@zhangfengshun/dsh-remote-ssh` plugin does not answer at all.\r\n * @param fetchImpl - fetch implementation (tests inject one).\r\n */\r\nexport async function listRemoteProfiles(\r\n fetchImpl: typeof fetch = fetch,\r\n): Promise {\r\n let value: JsonObject | null\r\n try {\r\n value = await rpc('listProfiles', {}, fetchImpl)\r\n } catch (reason) {\r\n // A missing plugin answers HTTP 404 with no JSON envelope at all.\r\n if (reason instanceof Error && reason.message.includes('HTTP 404')) return null\r\n throw reason\r\n }\r\n if (value === null) return null\r\n const rows = Array.isArray(value.profiles) ? value.profiles : []\r\n const profiles: RemoteProfileSummary[] = []\r\n for (const raw of rows) {\r\n const row = object(raw)\r\n if (row === undefined || typeof row.id !== 'string' || row.id === '') continue\r\n profiles.push({\r\n id: row.id,\r\n name: typeof row.name === 'string' && row.name !== '' ? row.name : row.id,\r\n host: typeof row.host === 'string' ? row.host : '',\r\n user: typeof row.user === 'string' ? row.user : '',\r\n remoteRoot: typeof row.remoteRoot === 'string' && row.remoteRoot !== '' ? row.remoteRoot : '~',\r\n })\r\n }\r\n return profiles\r\n}\r\n\r\n/**\r\n * Register one cloud folder: the SSH plugin creates the local mirror, writes the\r\n * connection marker and registers a real DSH workspace for it — exactly what its\r\n * own \"new remote workspace\" flow does. The returned native workspace id backs\r\n * the folder row, and the workspace's own sidebar row is hidden once the entry\r\n * lists it (see `absorbedWorkspaceIds`).\r\n * @param profileId - SSH connection to use.\r\n * @param remotePath - remote directory (`~`, `~/proj`, `/srv/proj`).\r\n * @param title - optional display title; the plugin derives one from the path.\r\n * @param fetchImpl - fetch implementation (tests inject one).\r\n */\r\nexport async function createRemoteFolder(\r\n profileId: string,\r\n remotePath: string,\r\n title?: string,\r\n fetchImpl: typeof fetch = fetch,\r\n): Promise {\r\n const trimmedPath = remotePath.trim()\r\n if (profileId.trim() === '' || trimmedPath === '') throw new Error('Pick a connection and enter a remote path')\r\n const value = await rpc('createRemoteWorkspace', {\r\n profileId,\r\n remotePath: trimmedPath,\r\n ...(title === undefined || title.trim() === '' ? {} : { title: title.trim() }),\r\n }, fetchImpl)\r\n if (value === null) throw new Error('The SSH plugin is unavailable; cannot add a cloud folder')\r\n const record = object(value.workspace) ?? {}\r\n const workspaceId = typeof value.workspaceId === 'string' ? value.workspaceId : ''\r\n const mirrorPath = typeof value.mirrorPath === 'string' ? value.mirrorPath : ''\r\n const recordId = typeof record.id === 'string' ? record.id : ''\r\n if (workspaceId === '' || mirrorPath === '') {\r\n throw new Error('The SSH plugin did not register a workspace for this folder')\r\n }\r\n return {\r\n path: mirrorPath,\r\n workspaceId,\r\n recordId,\r\n remotePath: typeof record.remotePath === 'string' ? record.remotePath : trimmedPath,\r\n profileId: typeof record.profileId === 'string' ? record.profileId : profileId,\r\n title: typeof record.title === 'string' && record.title !== '' ? record.title : trimmedPath,\r\n reused: value.reused === true,\r\n }\r\n}\r\n\r\n/**\r\n * Delete one remote workspace record through the SSH plugin: it removes the\r\n * record, unregisters the native workspace behind it (that workspace's\r\n * sessions go with it) and cleans up the mirror — the counterpart of\r\n * {@link createRemoteFolder}, for when a member folder is removed for good.\r\n * @param recordId - remote-ssh record id stored on the member.\r\n * @param fetchImpl - fetch implementation (tests inject one).\r\n */\r\nexport async function deleteRemoteWorkspaceRecord(\r\n recordId: string,\r\n fetchImpl: typeof fetch = fetch,\r\n): Promise {\r\n if (recordId.trim() === '') throw new Error('No remote workspace record to delete')\r\n const value = await rpc('deleteWorkspace', { id: recordId }, fetchImpl)\r\n if (value === null) throw new Error('The SSH plugin is unavailable; cannot delete the remote workspace')\r\n}\r\n\r\n/** Resolve against the SSH plugin's registered mirrors, not copied marker files. */\r\nexport async function remoteFolderWorkspace(\r\n path: string, remoteBase: string | null, fetchImpl: typeof fetch = fetch,\r\n): Promise {\r\n const value = await rpc('listWorkspaces', {}, fetchImpl)\r\n const knownMirror = remoteBase !== null && isUnderBase(path, remoteBase)\r\n if (value === null) {\r\n if (knownMirror) throw new Error('SSH plugin is unavailable; refusing a local operation in a remote mirror')\r\n await refuseMarkedLocalPath(path, fetchImpl)\r\n return null\r\n }\r\n if (!Array.isArray(value.workspaces)) throw new Error('Invalid SSH workspace catalog')\r\n const matches: RemoteFolderWorkspace[] = []\r\n for (const raw of value.workspaces) {\r\n const row = object(raw)\r\n if (!row || typeof row.mirrorPath !== 'string' || typeof row.remotePath !== 'string'\r\n || typeof row.profileId !== 'string' || !row.mirrorPath || !row.remotePath || !row.profileId) {\r\n throw new Error('Invalid SSH workspace entry')\r\n }\r\n if (samePath(path, row.mirrorPath) || isUnderBase(path, row.mirrorPath)) {\r\n matches.push({\r\n mirrorPath: row.mirrorPath,\r\n remotePath: row.remotePath,\r\n profileId: row.profileId,\r\n workspaceId: typeof row.shellWorkspaceId === 'string' ? row.shellWorkspaceId : '',\r\n recordId: typeof row.id === 'string' ? row.id : '',\r\n })\r\n }\r\n }\r\n if (matches.length > 1) throw new Error('Overlapping SSH workspaces are not supported safely')\r\n if (matches.length === 1) return matches[0]!\r\n if (knownMirror) throw new Error('Remote mirror is not registered with the SSH plugin')\r\n await refuseMarkedLocalPath(path, fetchImpl)\r\n return null\r\n}\r\n\r\n/** Single-segment names match DSH createDirectory(path, name). */\r\nexport function validateFolderName(raw: string): string {\r\n const name = raw.trim()\r\n if (!name || name === '.' || name === '..' || /[\\\\/\\u0000-\\u001f]/u.test(name)) {\r\n throw new Error('Enter a single folder name, not an absolute path or nested path')\r\n }\r\n return name\r\n}\r\n\r\nexport async function createWorkspaceDirectory(\r\n parent: string, rawName: string, remoteBase: string | null,\r\n createLocal: (path: string, name: string) => Promise, fetchImpl: typeof fetch = fetch,\r\n): Promise<{ path: string; remote: boolean }> {\r\n const name = validateFolderName(rawName)\r\n const path = joinSubpath(parent, name)\r\n if (path === null) throw new Error('Invalid folder name')\r\n const remote = await remoteFolderWorkspace(parent, remoteBase, fetchImpl)\r\n if (!remote) return { path: await createLocal(parent, name), remote: false }\r\n // Names with shell expansions are rejected defensively for older SSH wrappers.\r\n if (/[\\u0000-\\u001f`$\"\\\\]/u.test(name)) throw new Error('Unsupported remote folder name')\r\n const normalizedParent = parent.trim().replace(/\\\\/gu, '/').replace(/\\/+$/u, '')\r\n const normalizedRoot = remote.mirrorPath.trim().replace(/\\\\/gu, '/').replace(/\\/+$/u, '')\r\n const suffix = normalizedParent.slice(normalizedRoot.length).replace(/^\\/+/, '')\r\n if (suffix.split('/').some(part => part === '..' || part === '.')) throw new Error('Invalid mirror path')\r\n const root = remote.remotePath.replace(/\\/+$/u, '')\r\n const remotePath = `${root}/${suffix ? `${suffix}/` : ''}${name}`\r\n await rpc('mkdir', { profileId: remote.profileId, path: remotePath }, fetchImpl)\r\n return { path, remote: true }\r\n}\r\n","/**\r\n * Transport for the official open-in-app host routes served by\r\n * `@deepseek-ai/dsh-host-open-in-app`. The project row offers \"open this\r\n * project's folder\" by asking that host half for the applications it verified\r\n * as installed, then POSTing the launcher it already resolved — this plugin\r\n * never probes or spawns a launcher itself, and a host without the capability\r\n * (no resolved application, e.g. an SSH launch) simply yields no menu entry.\r\n */\r\n\r\n/** GET route serving the probed application ids (host-owned constant). */\r\nexport const OPEN_IN_APP_APPS_ROUTE = '/open-in-app/apps'\r\n\r\n/** POST route launching one resolved application on one absolute directory. */\r\nexport const OPEN_IN_APP_OPEN_ROUTE = '/open-in-app/open'\r\n\r\n/**\r\n * Catalog ids that open a directory in the platform file manager, most\r\n * specific first (the official catalog names one per platform: `explorer` on\r\n * Windows, `finder` on macOS, `filemanager` on Linux).\r\n */\r\nconst FOLDER_APP_IDS = ['explorer', 'finder', 'filemanager'] as const\r\n\r\n/**\r\n * The installed file-manager id for this host, or undefined when the host\r\n * resolved none (the row then offers no \"open in folder\" entry).\r\n * @param apps - installed catalog ids from the apps route.\r\n * @returns the preferred available id.\r\n */\r\nexport function folderAppId(apps: readonly string[]): string | undefined {\r\n for (const id of FOLDER_APP_IDS) {\r\n if (apps.includes(id)) return id\r\n }\r\n return undefined\r\n}\r\n\r\n/**\r\n * Resolve the browser's Host base with the connection carrier's null-origin\r\n * fallback (same rule the official button uses): a sandboxed document reports\r\n * the literal origin \"null\", which cannot address the host.\r\n * @returns the absolute base URL of the current Host.\r\n */\r\nfunction hostBase(): string {\r\n const origin = globalThis.location?.origin\r\n return origin !== undefined && origin !== 'null' ? origin : 'http://dsh.internal'\r\n}\r\n\r\n/**\r\n * Read the host's installed-application ids. A host without the capability\r\n * (or one that refuses) reads as an empty list rather than an error, so the\r\n * caller can treat \"no apps\" and \"no route\" identically.\r\n * @param signal - aborts the read when the browser half unmounts.\r\n * @returns installed catalog ids, in host menu order.\r\n */\r\nexport async function fetchOpenInApps(signal?: AbortSignal): Promise {\r\n const response = await fetch(new URL(OPEN_IN_APP_APPS_ROUTE, hostBase()), {\r\n headers: { accept: 'application/json' },\r\n cache: 'no-store',\r\n ...(signal === undefined ? {} : { signal }),\r\n })\r\n if (!response.ok) throw new Error(`open-in-app apps request failed: ${response.status}`)\r\n const payload: unknown = await response.json()\r\n const apps = (payload as { apps?: unknown }).apps\r\n return Array.isArray(apps) ? apps.filter((id): id is string => typeof id === 'string') : []\r\n}\r\n\r\n/**\r\n * Launch one installed application on one absolute directory.\r\n * @param appId - catalog id from the apps route.\r\n * @param path - the project's absolute directory.\r\n * @returns after the host acknowledged the launch; rejects on any refusal.\r\n */\r\nexport async function openPathInApp(appId: string, path: string): Promise {\r\n const response = await fetch(new URL(OPEN_IN_APP_OPEN_ROUTE, hostBase()), {\r\n method: 'POST',\r\n headers: { 'Content-Type': 'application/json' },\r\n body: JSON.stringify({ app: appId, path }),\r\n })\r\n if (!response.ok) throw new Error(`open-in-app launch failed: ${response.status}`)\r\n}\r\n","/**\r\n * The folder dialog of one workspace row: the base folder first, then every\r\n * extra folder in stored order. A row is chosen as the root (the folder new\r\n * sessions default to); open/remove act per row, and the base folder is never\r\n * removable because the workspace's canonical directory cannot be dropped.\r\n *\r\n * Folders come in two kinds, and the add area switches between them:\r\n * · local — a directory picked on this machine (`pickDirectory`);\r\n * · cloud — a directory on an SSH host, browsed through the SSH plugin's own\r\n * pooled session, then registered as a mirror-backed workspace.\r\n *\r\n * Cloud browsing lives here rather than behind a second modal: the dialog body\r\n * swaps to the remote tree, so no stacked overlays are needed and the current\r\n * location stays readable at the top.\r\n */\r\nimport { useEffect, useState } from 'react'\r\nimport {\r\n Button,\r\n IconFolderOpenOutlineRegular,\r\n IconTrashOutlineRegular,\r\n Modal,\r\n} from '@deepseek-ai/dsh-client-ui-primitives'\r\nimport type { WorkspaceView } from '@deepseek-ai/dsh-api-workspace-controller/client'\r\nimport { effectiveFolders, memberOf, rootOf, samePath, type WorkspaceFolderEntry } from '../core/folders.ts'\r\nimport type { GroupsBrowserProps } from './contract.ts'\r\nimport { folderLabel } from './tree.ts'\r\nimport {\r\n listRemoteDirectory,\r\n remoteDirJoin,\r\n remoteDirParent,\r\n type RemoteDirEntry,\r\n type RemoteProfileSummary,\r\n} from './folder-directory.ts'\r\n\r\n/** Which kind of folder the add area currently offers. */\r\ntype AddMode = 'local' | 'cloud'\r\n\r\n/** Relative path of `picked` inside `root`: '' for the root itself, null outside. */\r\nfunction subfolderOf(root: string | null, picked: string): string | null {\r\n if (root === null) return null\r\n const base = root.trim().replace(/\\/+$/u, '')\r\n if (base === '') return null\r\n if (picked === base) return ''\r\n return picked.startsWith(`${base}/`) ? picked.slice(base.length + 1) : null\r\n}\r\n\r\nexport function FoldersDialog({ workspace, entry, t, busy, canOpen, remote, ownerRemotePath, profiles, profilesError, knownWorkspaceIds, onClose, onAddFolder, onAddRemote, onAddSubpath, onSetRoot, onRemove, onOpenFolder }: {\r\n workspace: WorkspaceView\r\n entry: WorkspaceFolderEntry | undefined\r\n t: GroupsBrowserProps['t']\r\n busy: boolean\r\n canOpen: boolean\r\n /** Remote (mirror-backed) workspace: extra folders can also be typed subpaths. */\r\n remote: boolean\r\n /** Remote root of a cloud owner, so a browsed subdirectory joins as a subfolder. */\r\n ownerRemotePath: string | null\r\n /** SSH connections, `null` while loading or when the remote-ssh plugin is absent. */\r\n profiles: readonly RemoteProfileSummary[] | null\r\n profilesError: string | null\r\n /** Live workspace ids, so a member whose workspace is gone can say so. */\r\n knownWorkspaceIds: readonly string[]\r\n onClose: () => void\r\n /** Pick any directory (local or an already-mirrored cloud folder). */\r\n onAddFolder: () => void\r\n /** Register one cloud folder: returns true once it is stored. */\r\n onAddRemote: (profileId: string, remotePath: string) => Promise\r\n onAddSubpath: (relative: string) => Promise\r\n onSetRoot: (path: string) => void\r\n onRemove: (path: string, deleteRecord: boolean) => void\r\n onOpenFolder: (path: string) => void\r\n}) {\r\n const folders = effectiveFolders(workspace.path, entry)\r\n const root = rootOf(workspace.path, entry)\r\n const [addMode, setAddMode] = useState('local')\r\n // Path of the remote member whose removal awaits the delete-record choice.\r\n const [confirmRemovePath, setConfirmRemovePath] = useState(null)\r\n const [profileId, setProfileId] = useState('')\r\n const [remotePath, setRemotePath] = useState('')\r\n const [browsing, setBrowsing] = useState(false)\r\n const [notice, setNotice] = useState(null)\r\n const profileChoices = profiles ?? []\r\n const knownIds = new Set(knownWorkspaceIds)\r\n const selectedProfile = profileChoices.some(profile => profile.id === profileId)\r\n ? profileId\r\n : (profileChoices[0]?.id ?? '')\r\n const currentProfile = profileChoices.find(profile => profile.id === selectedProfile)\r\n /** One field, two shapes: a bare name creates a subdirectory inside THIS\r\n * project's remote root, anything with a separator registers a new cloud\r\n * workspace. Keeping them in one field removed a whole extra row from a\r\n * ~330px wide dialog. */\r\n const typed = remotePath.trim()\r\n const asSubfolder = remote && typed !== '' && !/[/\\\\~]/u.test(typed)\r\n const submitAdd = (): void => {\r\n if (typed === '' || busy) return\r\n if (asSubfolder) {\r\n void onAddSubpath(typed).then(success => { if (success) setRemotePath('') })\r\n return\r\n }\r\n if (selectedProfile === '') return\r\n void onAddRemote(selectedProfile, typed).then((success) => {\r\n if (!success) return\r\n setRemotePath('')\r\n setBrowsing(false)\r\n })\r\n }\r\n\r\n if (browsing && currentProfile !== undefined) {\r\n return (\r\n {\r\n const relative = subfolderOf(ownerRemotePath, picked)\r\n if (relative === '' && ownerRemotePath !== null) {\r\n // Already this project's base folder: nothing to add, say so.\r\n setNotice(t('folder.alreadyRoot'))\r\n setBrowsing(false)\r\n return\r\n }\r\n if (relative !== null) {\r\n // Inside the owner's remote root: one folder of this mirror, no second copy.\r\n void onAddSubpath(relative).then((success) => {\r\n if (success) {\r\n setNotice(null)\r\n setBrowsing(false)\r\n }\r\n })\r\n return\r\n }\r\n setRemotePath(picked)\r\n setBrowsing(false)\r\n }}\r\n onCancel={() => { setBrowsing(false) }}\r\n />\r\n )\r\n }\r\n\r\n const cloudAvailable = profiles !== null\r\n const extraFolders = folders.length > 1\r\n // A cloud project's directory is a generated mirror id, so the header names the\r\n // place a human recognises: the remote root, when we managed to read it.\r\n const ownerPath = remote ? (ownerRemotePath ?? workspace.path) : workspace.path\r\n return (\r\n {t('folder.done')}\r\n )}\r\n >\r\n
\r\n
\r\n {workspace.title}\r\n {ownerPath}\r\n
\r\n\r\n
\r\n
{t('folder.sectionList')}
\r\n
\r\n {folders.map((path, index) => {\r\n const isBase = index === 0\r\n const isRoot = samePath(path, root)\r\n const member = memberOf(entry, path)\r\n // A cloud member's directory is a generated mirror id, so the dialog\r\n // names it by its remote path/title, exactly like the sidebar row does.\r\n // The base folder is named by the workspace title for the same reason.\r\n const label = isBase\r\n ? workspace.title\r\n : member?.kind === 'remote'\r\n ? (member.title ?? folderLabel(member.remotePath ?? path))\r\n : folderLabel(path)\r\n const displayPath = member === undefined\r\n ? (isBase ? ownerPath : path)\r\n : (member.remotePath ?? member.path)\r\n // A member whose own workspace disappeared (deleted outside this\r\n // overlay, or an SSH record the plugin dropped) keeps its row so the\r\n // user can still remove it, but says that it cannot run sessions.\r\n const memberGone = member !== undefined && !knownIds.has(member.workspaceId)\r\n const canDeleteRecord = member?.kind === 'remote' && member.recordId !== undefined && member.recordId !== ''\r\n return (\r\n
\r\n
\r\n \r\n \r\n {label}\r\n {displayPath}\r\n \r\n \r\n {isBase && {t('folder.base')}}\r\n {isRoot && {t('folder.rootBadge')}}\r\n {member !== undefined && (\r\n \r\n {member.kind === 'remote' ? t('folder.cloudTag') : t('folder.localTag')}\r\n \r\n )}\r\n {memberGone && (\r\n {t('folder.memberMissing')}\r\n )}\r\n \r\n \r\n {canOpen && (\r\n { onOpenFolder(path) }}\r\n >\r\n \r\n \r\n )}\r\n {!isBase && (\r\n {\r\n // A remote member can take its backing workspace\r\n // with it; ask which removal the user means first.\r\n if (canDeleteRecord) setConfirmRemovePath(path)\r\n else onRemove(path, false)\r\n }}\r\n >\r\n \r\n \r\n )}\r\n \r\n
\r\n {confirmRemovePath === path && (\r\n
\r\n {t('folder.removeRemotePrompt')}\r\n \r\n { setConfirmRemovePath(null); onRemove(path, true) }}\r\n >\r\n {t('folder.removeRemoteDelete')}\r\n \r\n { setConfirmRemovePath(null); onRemove(path, false) }}\r\n >\r\n {t('folder.removeRemoteOnly')}\r\n \r\n { setConfirmRemovePath(null) }}\r\n >\r\n {t('cancel')}\r\n \r\n \r\n
\r\n )}\r\n
\r\n )\r\n })}\r\n
\r\n {!extraFolders &&

{t('folder.emptyHint')}

}\r\n
\r\n\r\n
\r\n
{t('folder.sectionAdd')}
\r\n
\r\n { setAddMode('local'); setNotice(null) }}\r\n >\r\n {t('folder.tabLocal')}\r\n \r\n {cloudAvailable && (\r\n { setAddMode('cloud'); setNotice(null) }}\r\n >\r\n {t('folder.tabCloud')}\r\n \r\n )}\r\n
\r\n {notice !== null &&

{notice}

}\r\n\r\n {addMode === 'local'\r\n ? (\r\n
\r\n {/* Full width, own line: the action used to share a row with the\r\n consequence text and the label wrapped onto two lines. */}\r\n \r\n

{remote ? t('folder.localIntoRemote') : t('folder.localNote')}

\r\n
\r\n )\r\n : (\r\n <>\r\n {/* One control per line: the dialog body is only ~330px wide, so a\r\n profile select, a path field and a labelled button cannot share\r\n a row without squeezing one of them. Browsing therefore docks\r\n into the path field as an icon instead of its own button. */}\r\n
\r\n {profileChoices.length === 0\r\n ?

{t('folder.noProfiles')}

\r\n : (\r\n setProfileId(event.target.value)}\r\n >\r\n {profileChoices.map(profile => (\r\n \r\n ))}\r\n \r\n )}\r\n
\r\n setRemotePath(event.target.value)}\r\n onKeyDown={(event) => {\r\n if (event.key !== 'Enter') return\r\n event.preventDefault()\r\n submitAdd()\r\n }}\r\n />\r\n { setBrowsing(true) }}\r\n >\r\n \r\n \r\n
\r\n
\r\n \r\n {t(asSubfolder ? 'folder.createAndAdd' : 'folder.addRemote')}\r\n \r\n
\r\n
\r\n

{t(remote ? 'folder.cloudNoteBoth' : 'folder.cloudNote')}

\r\n \r\n )}\r\n {profilesError !== null && (\r\n

{t('folder.profilesError')}: {profilesError}

\r\n )}\r\n
\r\n
\r\n \r\n )\r\n}\r\n\r\n/**\r\n * Browse one SSH host and pick a directory. Entries come from the SSH plugin's\r\n * `listDir`, so the local machine never runs a copy of the remote tree and the\r\n * connection's own auth (key, password, ProxyJump) is reused unchanged.\r\n */\r\nfunction RemoteFolderPicker({ profile, startPath, t, busy, onPick, onCancel }: {\r\n profile: RemoteProfileSummary\r\n startPath: string\r\n t: GroupsBrowserProps['t']\r\n busy: boolean\r\n onPick: (path: string) => void\r\n onCancel: () => void\r\n}) {\r\n const [path, setPath] = useState(startPath)\r\n const [resolved, setResolved] = useState(startPath)\r\n const [entries, setEntries] = useState([])\r\n const [error, setError] = useState(null)\r\n const [loading, setLoading] = useState(true)\r\n const [reloadKey, setReloadKey] = useState(0)\r\n\r\n useEffect(() => {\r\n let live = true\r\n setLoading(true)\r\n setError(null)\r\n void listRemoteDirectory(profile.id, path).then(\r\n (listing) => {\r\n if (!live) return\r\n setEntries(listing.entries)\r\n setResolved(listing.resolved)\r\n setLoading(false)\r\n // The shell resolved `~` or a relative name: browse the real place next\r\n // so \"up\" and the children join behave like an absolute path.\r\n if (listing.resolved !== path) setPath(listing.resolved)\r\n },\r\n (reason: unknown) => {\r\n if (!live) return\r\n setError(reason instanceof Error ? reason.message : String(reason))\r\n setLoading(false)\r\n },\r\n )\r\n return () => { live = false }\r\n }, [profile.id, path, reloadKey])\r\n\r\n const parent = remoteDirParent(resolved)\r\n const directories = entries.filter(entry => entry.type === 'directory')\r\n const choose = (): void => { onPick(resolved) }\r\n return (\r\n \r\n \r\n \r\n \r\n )}\r\n >\r\n
\r\n {resolved}\r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n {loading &&

{t('folder.loading')}

}\r\n {!loading && error !== null && (\r\n

{t('folder.browseFailed')}: {error}

\r\n )}\r\n {!loading && error === null && directories.length === 0 && (\r\n

{t('folder.emptyDir')}

\r\n )}\r\n {!loading && error === null && directories.map(entry => (\r\n { setPath(remoteDirJoin(resolved, entry.name)) }}\r\n >\r\n \r\n {entry.name}\r\n \r\n ))}\r\n
\r\n

{t('folder.browseNote')}

\r\n \r\n )\r\n}\r\n","/**\r\n * Pure data shaping for the Ctrl+R quick switch panel. Runtime-free (same\r\n * discipline as store-core.ts): unit tests exercise the real semantics\r\n * without a browser module loader; the panel only binds them to the\r\n * framework's global hooks.\r\n */\r\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\r\nimport type { SessionListState, SessionSummary } from '@deepseek-ai/dsh-api-session-controller/client'\r\nimport type { WorkspaceView } from '@deepseek-ai/dsh-api-workspace-controller/client'\r\n\r\n/** A session row eligible for quick switching: running, top-level, real. */\r\nfunction quickEligible(summary: SessionSummary): boolean {\r\n return summary.running === true && summary.origin !== 'subagent' && !summary.blank\r\n}\r\n\r\n/**\r\n * Running quick-switchable sessions across the whole list, newest first.\r\n * @param list - sessions list snapshot.\r\n * @param archived - registry-global archive set (archived rows never surface).\r\n * @returns running summaries in recency order (id as deterministic tiebreak).\r\n */\r\nexport function runningSessions(list: SessionListState, archived: ReadonlySet): SessionSummary[] {\r\n const out: SessionSummary[] = []\r\n for (const id of list.ids) {\r\n if (archived.has(id)) continue\r\n const summary = list.byId[id]\r\n if (summary !== undefined && quickEligible(summary)) out.push(summary)\r\n }\r\n out.sort((a, b) => (b.updatedAt !== a.updatedAt ? b.updatedAt - a.updatedAt : (a.id < b.id ? -1 : 1)))\r\n return out\r\n}\r\n\r\n/**\r\n * Every quick-switchable session across the whole list — the sessions tab's\r\n * data: running rows pinned on top, everything else under them, both groups\r\n * newest first. Visibility mirrors the tree (subagent rows never; archived\r\n * never; a blank row only while it is the open session).\r\n * @param list - sessions list snapshot.\r\n * @param archived - registry-global archive set (archived rows never surface).\r\n * @param current - the selected session (`mainView` retention; keeps its blank row visible).\r\n * @returns summaries with running first, then recency (id as deterministic tiebreak).\r\n */\r\nexport function allSessions(\r\n list: SessionListState,\r\n archived: ReadonlySet,\r\n current: SessionId | undefined,\r\n): SessionSummary[] {\r\n const out: SessionSummary[] = []\r\n for (const id of list.ids) {\r\n if (archived.has(id)) continue\r\n const summary = list.byId[id]\r\n if (summary === undefined) continue\r\n if (summary.origin === 'subagent') continue\r\n if (summary.blank && summary.id !== current) continue\r\n out.push(summary)\r\n }\r\n out.sort((a, b) => {\r\n if (a.running !== b.running) return a.running ? -1 : 1\r\n return b.updatedAt !== a.updatedAt ? b.updatedAt - a.updatedAt : (a.id < b.id ? -1 : 1)\r\n })\r\n return out\r\n}\r\n\r\n/**\r\n * Session search for the quick panel: display-title or owning-workspace-title\r\n * substring match (trimmed, case-insensitive). Filters only — the incoming\r\n * running-first/recency order is preserved verbatim, so \"running on top\"\r\n * survives any query.\r\n * @param sessions - allSessions() output (running pinned on top, then recency).\r\n * @param query - raw query.\r\n * @param workspaceTitleOf - owning workspace title resolver (sub-line source).\r\n * @param limit - hard render cap.\r\n * @returns matching sessions in the given order.\r\n */\r\nexport function filterSessions(\r\n sessions: readonly SessionSummary[],\r\n query: string,\r\n workspaceTitleOf: (session: SessionSummary) => string | undefined,\r\n limit = 200,\r\n): SessionSummary[] {\r\n const q = query.trim().toLowerCase()\r\n if (q === '') return sessions.slice(0, limit)\r\n const out: SessionSummary[] = []\r\n for (const session of sessions) {\r\n const workspace = workspaceTitleOf(session)?.toLowerCase() ?? ''\r\n if (session.displayTitle.toLowerCase().includes(q) || workspace.includes(q)) out.push(session)\r\n }\r\n return out.slice(0, limit)\r\n}\r\n\r\n/**\r\n * Most recently updated running session inside one workspace.\r\n * @param list - sessions list snapshot.\r\n * @param workspace - target workspace (its session account order is irrelevant;\r\n * recency picks the row).\r\n * @returns the session id, or undefined when nothing in the workspace runs.\r\n */\r\nexport function latestRunningInWorkspace(list: SessionListState, workspace: WorkspaceView): SessionId | undefined {\r\n let best: SessionId | undefined\r\n let bestTime = Number.NEGATIVE_INFINITY\r\n for (const id of workspace.sessionIds) {\r\n const summary = list.byId[id]\r\n if (summary === undefined || !quickEligible(summary)) continue\r\n if (summary.updatedAt > bestTime) {\r\n best = summary.id\r\n bestTime = summary.updatedAt\r\n }\r\n }\r\n return best\r\n}\r\n\r\n/**\r\n * Running-session count per workspace id (badge on the workspace tab rows).\r\n * @param running - runningSessions() output.\r\n * @param workspaces - real workspaces in stable Host order.\r\n * @returns counts keyed by workspace id; absent key = none running.\r\n */\r\nexport function runningCountByWorkspace(\r\n running: readonly SessionSummary[],\r\n workspaces: readonly WorkspaceView[],\r\n): Map {\r\n const counts = new Map()\r\n if (running.length === 0) return counts\r\n const runningIds = new Set(running.map(s => s.id))\r\n for (const workspace of workspaces) {\r\n let count = 0\r\n for (const sessionId of workspace.sessionIds) {\r\n if (runningIds.has(sessionId)) count += 1\r\n }\r\n if (count > 0) counts.set(workspace.workspaceId as string, count)\r\n }\r\n return counts\r\n}\r\n\r\n/**\r\n * The workspace that owns the currently open session.\r\n * @param workspaces - real workspaces in stable Host order.\r\n * @param currentSessionId - the selected session (`mainView` retention); may be undefined\r\n * (no session open, cleared selection) or an id no listed workspace holds\r\n * (e.g. an addressed subagent session).\r\n * @returns the workspace id, or undefined when there is no active workspace.\r\n */\r\nexport function activeWorkspaceId(\r\n workspaces: readonly WorkspaceView[],\r\n currentSessionId: SessionId | undefined,\r\n): string | undefined {\r\n if (currentSessionId === undefined) return undefined\r\n const workspace = workspaces.find(w => w.sessionIds.includes(currentSessionId))\r\n return workspace?.workspaceId as string | undefined\r\n}\r\n\r\n/**\r\n * Workspace search for the quick panel: title prefix → title substring →\r\n * category label substring → path substring; ties keep host order via a\r\n * stable title compare inside one rank.\r\n * @param workspaces - real workspaces in stable Host order.\r\n * @param query - raw query (trimmed, case-insensitive).\r\n * @param categoryLabelOf - category label resolver (grouped workspaces only).\r\n * @param limit - hard render cap.\r\n * @returns ranked matches; an empty query returns host order.\r\n */\r\nexport function filterWorkspaces(\r\n workspaces: readonly WorkspaceView[],\r\n query: string,\r\n categoryLabelOf?: (workspace: WorkspaceView) => string | undefined,\r\n limit = 50,\r\n): WorkspaceView[] {\r\n const q = query.trim().toLowerCase()\r\n if (q === '') return workspaces.slice(0, limit)\r\n const scored: { workspace: WorkspaceView; score: number }[] = []\r\n for (const workspace of workspaces) {\r\n const title = workspace.title.toLowerCase()\r\n const path = workspace.path.toLowerCase()\r\n const category = (categoryLabelOf?.(workspace) ?? '').toLowerCase()\r\n let score: number | undefined\r\n if (title.startsWith(q)) score = 0\r\n else if (title.includes(q)) score = 1\r\n else if (category !== '' && category.includes(q)) score = 2\r\n else if (path.includes(q)) score = 3\r\n if (score !== undefined) scored.push({ workspace, score })\r\n }\r\n scored.sort((a, b) => (a.score !== b.score\r\n ? a.score - b.score\r\n : a.workspace.title.localeCompare(b.workspace.title)))\r\n return scored.slice(0, limit).map(entry => entry.workspace)\r\n}\r\n","/**\r\n * Ctrl+R quick switch panel: two tabs over the framework's global hooks.\r\n *\r\n * - Workspaces tab: search real Workspaces, select one, then either start a\r\n * New Session in it or jump straight to its most recently updated running\r\n * session (the button reads the none-running state and disables).\r\n * - Sessions tab: every top-level session across workspaces — running ones\r\n * pinned on top, everything else under them, both groups newest first; one\r\n * click (or Enter) opens it. The shared search input filters by session or\r\n * workspace title and never re-sorts, so the running-first order survives.\r\n *\r\n * Current-row marker: the open workspace (workspaces tab) and the open\r\n * session (sessions tab) render `.wgQuickRowCurrent`; with no current\r\n * session — or one no listed workspace holds — nothing is marked.\r\n *\r\n * Mount discipline: the parent conditionally mounts this component, so every\r\n * open starts from a fresh query/selection (quick-switcher semantics). The\r\n * overlay portals to document.body (sidebar ancestors clip `fixed`), sizes\r\n * itself like a launcher (top-anchored, 640px) instead of the host Modal's\r\n * 380px dialog, and handles Escape / mask click by itself. Pure data shaping\r\n * lives in quick.ts; this file only binds hooks + actions.\r\n */\r\nimport { useEffect, useMemo, useRef, useState, type KeyboardEvent, type MouseEvent } from 'react'\r\nimport { createPortal } from 'react-dom'\r\nimport { Button, StateDot } from '@deepseek-ai/dsh-client-ui-primitives'\r\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\r\nimport type { SessionListState } from '@deepseek-ai/dsh-api-session-controller/client'\r\nimport type { WorkspaceId, WorkspaceView } from '@deepseek-ai/dsh-api-workspace-controller/client'\r\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\r\nimport { activeWorkspaceId, allSessions, filterSessions, filterWorkspaces, latestRunningInWorkspace, runningCountByWorkspace, runningSessions } from './quick.ts'\r\nimport { relativeTimeLabel } from './rows.tsx'\r\n\r\n/** Which surface of the quick panel is active. */\r\nexport type QuickTab = 'workspaces' | 'sessions'\r\n\r\n/** The locale seat's translate function (same shape GroupsBrowser receives). */\r\ntype Translate = PropsLocale<'workspaceGroups'>['t']\r\n\r\n/** Quick panel props: hooks snapshots + the two injected verbs + shared CSS context. */\r\nexport type QuickPanelProps = {\r\n /** Close request (Escape, mask click, action completed, or parent Ctrl+R toggle). */\r\n onClose: () => void\r\n /** Sessions list snapshot (drives running detection). */\r\n list: SessionListState\r\n /** Real workspaces in stable Host order. */\r\n workspaces: readonly WorkspaceView[]\r\n /** Registry-global archive set. */\r\n archivedSessionIds: readonly SessionId[]\r\n /** Category label per grouped workspace id (badge column; top-level absent). */\r\n categoryByWorkspace: ReadonlyMap\r\n /** The Session the Conversation currently shows (mainView retention), if any. */\r\n current: SessionId | undefined\r\n /** Start a New Session in a workspace (injected share verb). */\r\n startSession: (workspaceId?: WorkspaceId) => void\r\n /** Open a real Session (injected share verb). */\r\n openSession: (sessionId: SessionId) => void\r\n /** Render clock for relative times (parent refreshes per render). */\r\n now: number\r\n /** Dictionary accessor (workspaceGroups namespace). */\r\n t: Translate\r\n}\r\n\r\n/** Basename of a host path (both separators; shortens the workspace row sub-line). */\r\nfunction pathBasename(path: string): string {\r\n const trimmed = path.replace(/[/\\\\]+$/, '')\r\n const base = trimmed.split(/[/\\\\]/).pop()\r\n return base !== undefined && base !== '' ? base : trimmed\r\n}\r\n\r\n/**\r\n * Render the quick switch panel (portaled overlay).\r\n * @param props - hooks snapshots + injected verbs.\r\n * @returns the panel element tree.\r\n */\r\nexport function QuickPanel({\r\n onClose,\r\n list,\r\n workspaces,\r\n archivedSessionIds,\r\n categoryByWorkspace,\r\n current: currentSessionId,\r\n startSession,\r\n openSession,\r\n now,\r\n t,\r\n}: QuickPanelProps) {\r\n const [tab, setTab] = useState('workspaces')\r\n const [query, setQuery] = useState('')\r\n const [selectedId, setSelectedId] = useState(null)\r\n const [activeIndex, setActiveIndex] = useState(0)\r\n const inputRef = useRef(null)\r\n const activeRowRef = useRef(null)\r\n\r\n const archived = useMemo(() => new Set(archivedSessionIds), [archivedSessionIds])\r\n const running = useMemo(() => runningSessions(list, archived), [list, archived])\r\n const runCounts = useMemo(() => runningCountByWorkspace(running, workspaces), [running, workspaces])\r\n const filtered = useMemo(\r\n () => filterWorkspaces(workspaces, query, ws => categoryByWorkspace.get(ws.workspaceId as string)),\r\n [workspaces, query, categoryByWorkspace],\r\n )\r\n\r\n // Where the user is right now: the open session and its owning workspace.\r\n // Both may be absent (no mainView retention, or a session no listed\r\n // workspace holds) — the current-row marker simply never renders then.\r\n const currentWorkspaceId = useMemo(\r\n () => activeWorkspaceId(workspaces, currentSessionId),\r\n [workspaces, currentSessionId],\r\n )\r\n\r\n // Sessions tab data: every top-level session, running pinned on top then\r\n // recency, filtered by the shared search query (filter never re-sorts).\r\n const sessions = useMemo(\r\n () => allSessions(list, archived, currentSessionId),\r\n [list, archived, currentSessionId],\r\n )\r\n // Owning workspace title per session id (row sub-line + search field);\r\n // first workspace wins — a session lives in exactly one.\r\n const workspaceTitleBySession = useMemo(() => {\r\n const map = new Map()\r\n for (const workspace of workspaces) {\r\n for (const sessionId of workspace.sessionIds) {\r\n if (!map.has(sessionId)) map.set(sessionId, workspace.title)\r\n }\r\n }\r\n return map\r\n }, [workspaces])\r\n const filteredSessions = useMemo(\r\n () => filterSessions(sessions, query, s => workspaceTitleBySession.get(s.id)),\r\n [sessions, query, workspaceTitleBySession],\r\n )\r\n\r\n const selected = selectedId === null\r\n ? undefined\r\n : workspaces.find(w => (w.workspaceId as string) === selectedId)\r\n const selectedRunningId = selected === undefined ? undefined : latestRunningInWorkspace(list, selected)\r\n\r\n // Focus the search input whenever a tab becomes reachable (both tabs own it).\r\n useEffect(() => {\r\n inputRef.current?.focus()\r\n }, [tab])\r\n\r\n // Keep the keyboard-active row visible while arrowing through the list.\r\n useEffect(() => {\r\n activeRowRef.current?.scrollIntoView({ block: 'nearest' })\r\n }, [activeIndex])\r\n\r\n /** Select the workspace and close (New Session verb). */\r\n const launchNewSession = (workspace: WorkspaceView): void => {\r\n startSession(workspace.workspaceId)\r\n onClose()\r\n }\r\n\r\n /** Open a session row and close (sessions tab click or Enter). */\r\n const launchSession = (sessionId: SessionId): void => {\r\n openSession(sessionId)\r\n onClose()\r\n }\r\n\r\n /** Switch tabs; the query carries over, the per-tab selection resets. */\r\n const switchTab = (next: QuickTab): void => {\r\n setTab(next)\r\n setSelectedId(null)\r\n setActiveIndex(0)\r\n }\r\n\r\n /** Search-input keyboard: arrows move the active row; Enter confirms it. */\r\n const onSearchKeyDown = (e: KeyboardEvent): void => {\r\n if (e.key === 'ArrowDown') {\r\n e.preventDefault()\r\n const max = (tab === 'workspaces' ? filtered.length : filteredSessions.length) - 1\r\n setActiveIndex(i => Math.min(i + 1, Math.max(max, 0)))\r\n } else if (e.key === 'ArrowUp') {\r\n e.preventDefault()\r\n setActiveIndex(i => Math.max(i - 1, 0))\r\n } else if (e.key === 'Enter') {\r\n e.preventDefault()\r\n if (tab === 'workspaces') {\r\n if (selected === undefined) {\r\n const target = filtered[activeIndex]\r\n if (target !== undefined) setSelectedId(target.workspaceId as string)\r\n } else {\r\n launchNewSession(selected)\r\n }\r\n } else {\r\n const target = filteredSessions[activeIndex]\r\n if (target !== undefined) launchSession(target.id)\r\n }\r\n }\r\n }\r\n\r\n /** Escape closes (capture so row buttons and the input can't swallow it). */\r\n const onCardKeyDown = (e: KeyboardEvent): void => {\r\n if (e.key === 'Escape') {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n onClose()\r\n }\r\n }\r\n\r\n /** Mask click closes; clicks inside the card never reach the mask. */\r\n const onOverlayMouseDown = (e: MouseEvent): void => {\r\n if (e.target === e.currentTarget) onClose()\r\n }\r\n\r\n const selectWorkspace = (id: string): void => {\r\n setSelectedId(id)\r\n inputRef.current?.focus()\r\n }\r\n\r\n return createPortal(\r\n
\r\n \r\n
\r\n {t('quick.title')}\r\n
\r\n { switchTab('workspaces') }}\r\n >\r\n {t('quick.tab.workspaces')}\r\n \r\n { switchTab('sessions') }}\r\n >\r\n {t('quick.tab.sessions')}\r\n {running.length > 0 && {running.length}}\r\n \r\n
\r\n
\r\n\r\n {/* Shared search: workspaces on one tab, sessions on the other. */}\r\n
\r\n {\r\n setQuery(e.target.value)\r\n setSelectedId(null)\r\n setActiveIndex(0)\r\n }}\r\n onKeyDown={onSearchKeyDown}\r\n />\r\n
\r\n {tab === 'workspaces' ? (\r\n <>\r\n
\r\n {filtered.map((workspace, i) => {\r\n const id = workspace.workspaceId as string\r\n const count = runCounts.get(id) ?? 0\r\n const category = categoryByWorkspace.get(id)\r\n const isCurrent = id === currentWorkspaceId\r\n return (\r\n { setActiveIndex(i) }}\r\n onClick={() => { selectWorkspace(id) }}\r\n >\r\n \r\n {workspace.title}\r\n {count > 0 && ● {count}}\r\n \r\n \r\n \r\n {category !== undefined ? `${category} · ${pathBasename(workspace.path)}` : pathBasename(workspace.path)}\r\n \r\n \r\n \r\n )\r\n })}\r\n {filtered.length === 0 &&
{t('quick.empty.workspaces')}
}\r\n
\r\n
\r\n \r\n {selected === undefined ? t('quick.select.hint') : selected.title}\r\n \r\n { if (selectedRunningId !== undefined) launchSession(selectedRunningId) }}\r\n >\r\n {selectedRunningId !== undefined ? t('quick.action.running') : t('quick.action.noneRunning')}\r\n \r\n { if (selected !== undefined) launchNewSession(selected) }}\r\n >\r\n {t('quick.action.newSession')}\r\n \r\n
\r\n \r\n ) : (\r\n
\r\n {filteredSessions.map((session, i) => {\r\n const workspaceTitle = workspaceTitleBySession.get(session.id) ?? ''\r\n const isCurrent = session.id === currentSessionId\r\n return (\r\n { setActiveIndex(i) }}\r\n onClick={() => { launchSession(session.id) }}\r\n >\r\n \r\n \r\n {session.blank ? t('newSession') : session.displayTitle}\r\n {relativeTimeLabel(session.updatedAt, now)}\r\n \r\n \r\n {workspaceTitle}\r\n \r\n \r\n )\r\n })}\r\n {filteredSessions.length === 0 &&
{t('quick.empty.sessions')}
}\r\n
\r\n )}\r\n\r\n
{t('quick.hint')}
\r\n
\r\n ,\r\n document.body,\r\n )\r\n}\r\n","/**\r\n * DOM seat for the session tab strip.\r\n *\r\n * Why this exists instead of a slot: the strip belongs at the very top of the\r\n * conversation column — `pI_x6G_centerCol` (ui-layout's AppFrame `.centerCol`,\r\n * a hashed CSS-Modules class). That column declares NO child slots: its only\r\n * child is the `main` slot's occupant (`renderSlot('main', …)`, the\r\n * Conversation or a global panel), so there is nowhere to register. The\r\n * shipped slot in that neighbourhood — `conversation.composer.dock` — is the\r\n * band UNDER the composer card, a different place entirely.\r\n *\r\n * So the strip gets a real DOM seat: this module finds the column, prepends a\r\n * `
` to it, and hands that element to a React portal. The element is\r\n * OURS, never React's: it is inserted outside the column's child list that\r\n * React reconciles, and it is re-inserted if React (or a theme/titlebar\r\n * re-render) ever drops it.\r\n *\r\n * Two hazards this module is built around:\r\n *\r\n * 1. `centerCol` is a hashed class name (`pI_x6G_centerCol`) that changes when\r\n * the package is rebuilt. Matching is therefore done on the *structural*\r\n * contract — a grid-item column that holds the `main` panel — plus a\r\n * `[class*=\"_centerCol\"]` probe, never on the exact hash.\r\n * 2. The column mounts after the client plugin's `apply()` runs. Discovery is\r\n * therefore a MutationObserver on `document.body` plus a `requestAnimationFrame`\r\n * retry, and both are torn down when the owning effect disposes.\r\n */\r\n\r\n/** Persistent marker for the injected container (survives React re-renders). */\r\nconst SEAT_ATTRIBUTE = 'data-wg-tab-seat'\r\n\r\n/** Sentinel attribute on the container so discovery can skip our own node. */\r\nconst SEAT_SELECTOR = `[${SEAT_ATTRIBUTE}]`\r\n\r\n/**\r\n * Match the conversation column by its hashed CSS-Modules class.\r\n *\r\n * The hash prefix (`pI_x6G_`) is build-dependent, so the probe matches the\r\n * `_centerCol` suffix that the Modules transform always preserves. A plain\r\n * `class*=\"centerCol\"` scan would risk matching unrelated utility classes, so\r\n * the leading underscore is required.\r\n * @param root - subtree to scan (normally `document`).\r\n * @returns the column element, or null while it has not mounted.\r\n */\r\nfunction findCenterColumn(root: ParentNode): HTMLElement | null {\r\n // Fast path: the seat is already in place and still attached, which is the\r\n // steady state on every re-render (portal into an existing element).\r\n const existing = root.querySelector(SEAT_SELECTOR)\r\n if (existing?.isConnected === true) return existing.parentElement\r\n\r\n // Structural probe: the column is the direct child of the app frame grid\r\n // that contains the `main` panel. Querying the class suffix first keeps this\r\n // to one selector evaluation in the common case.\r\n const column = root.querySelector('[class*=\"_centerCol\"]')\r\n if (column !== null) return column\r\n\r\n // Nothing matched: either the shell has not mounted yet, or the Modules hash\r\n // convention changed. Returning null keeps the caller in its wait loop\r\n // instead of guessing at a wrong node (which would visually corrupt the\r\n // shell). The strip simply appears once the frame is up.\r\n return null\r\n}\r\n\r\n/** A mounted seat: the host element plus the disposer that removes it. */\r\nexport interface TabSeat {\r\n /**\r\n * The element the React portal renders into — null until the conversation\r\n * column mounts. The portal is simply not rendered while this is null.\r\n */\r\n readonly host: HTMLElement | null\r\n /** Remove the seat and stop watching for the column. */\r\n dispose: () => void\r\n}\r\n\r\n/**\r\n * Ensure a seat exists as the FIRST child of the conversation column, creating\r\n * it if needed, and keep it there for as long as the returned handle is live.\r\n *\r\n * The seat element is created once and reused: a portal that re-mounts into a\r\n * fresh node on every shell re-render would drop the tab strip's React state\r\n * and visible focus. If React removes the node (it owns the column's child\r\n * list, and our node is not part of it), the observer re-inserts the SAME\r\n * element, so the portal's subtree moves with it.\r\n *\r\n * @param onReady - called with the host element each time it becomes attached\r\n * (once immediately when the column already exists). Used to seed React\r\n * state; may fire more than once if the column is remounted.\r\n * @returns the seat handle. `host` is null until the column appears, so the\r\n * caller renders nothing meanwhile and starts rendering when `onReady`\r\n * fires. Never null: a missing column must degrade to \"no strip\", not to a\r\n * thrown error that would take the whole client plugin down.\r\n */\r\nexport function mountTabSeat(onReady: (host: HTMLElement) => void): TabSeat {\r\n let host: HTMLElement | null = null\r\n let column: HTMLElement | null = null\r\n let observer: MutationObserver | null = null\r\n let raf = 0\r\n let attempts = 0\r\n let disposed = false\r\n\r\n // Bounded retry: ~5s at 60fps. The shell mounts well inside this; the bound\r\n // exists so a missing column degrades to \"no strip\" instead of a permanent\r\n // frame loop.\r\n const MAX_ATTEMPTS = 300\r\n\r\n /**\r\n * Put the seat at the head of the column, creating it on first success.\r\n * Idempotent: a seat already first is left untouched, so repeated calls from\r\n * the observer cause no DOM churn (and therefore no observer feedback loop —\r\n * our insertion schedules one more callback, which then takes this early\r\n * return instead of re-inserting).\r\n */\r\n const place = (target: HTMLElement): void => {\r\n if (disposed) return\r\n if (host === null) {\r\n host = document.createElement('div')\r\n host.setAttribute(SEAT_ATTRIBUTE, '')\r\n }\r\n if (target.firstChild === host) return\r\n target.insertBefore(host, target.firstChild)\r\n }\r\n\r\n /** Locate the column and, on success, seat the host and notify the caller. */\r\n const tryMount = (): boolean => {\r\n if (disposed) return true\r\n // Steady state: the column we already found is still attached.\r\n if (column !== null && column.isConnected) {\r\n place(column)\r\n return true\r\n }\r\n const found = findCenterColumn(document)\r\n if (found === null) return false\r\n // A different column than last time (shell remount): re-seat AND re-notify,\r\n // because the caller may hold a stale host element from the old tree.\r\n const changed = found !== column\r\n column = found\r\n place(found)\r\n if (changed) onReady(host as HTMLElement)\r\n return true\r\n }\r\n\r\n const tick = (): void => {\r\n if (disposed) return\r\n raf = 0\r\n if (tryMount()) return\r\n attempts += 1\r\n if (attempts >= MAX_ATTEMPTS) return\r\n raf = requestAnimationFrame(tick)\r\n }\r\n\r\n // The observer covers both \"column mounts later\" and \"React dropped our\r\n // node\": either way the child list changes and we re-seat. `requestAnimationFrame`\r\n // alone would miss a removal that happens after the retry budget is spent.\r\n observer = new MutationObserver(() => {\r\n if (disposed) return\r\n if (tryMount()) return\r\n if (raf === 0 && attempts < MAX_ATTEMPTS) raf = requestAnimationFrame(tick)\r\n })\r\n observer.observe(document.body, { childList: true, subtree: true })\r\n\r\n if (!tryMount() && raf === 0) raf = requestAnimationFrame(tick)\r\n\r\n return {\r\n get host(): HTMLElement | null {\r\n // Null until the column mounts; the caller's `onReady` fires at the same\r\n // moment this becomes non-null, so the two never disagree.\r\n return host\r\n },\r\n dispose: () => {\r\n disposed = true\r\n if (raf !== 0) cancelAnimationFrame(raf)\r\n raf = 0\r\n observer?.disconnect()\r\n observer = null\r\n host?.remove()\r\n host = null\r\n column = null\r\n },\r\n } as TabSeat\r\n}\r\n","/**\r\n * The session tab strip: one chip per opened conversation, rendered into the\r\n * DOM seat at the head of the conversation column (see `tab-seat.ts` for why\r\n * this is a DOM injection rather than a slot).\r\n *\r\n * A tab is a *view* of the open session, not a second navigation model:\r\n * clicking a chip navigates through `ctx.uiWorkspace.openSession`, which is the\r\n * one path that retains a target session; the owning component derives the\r\n * strip from the open session plus the tab store.\r\n *\r\n * The active chip is derived, never stored: it is the chip whose session is the\r\n * open one, so clicking a background chip immediately shows that chip active.\r\n *\r\n * Every affordance beyond \"click to switch\" is an explicit USER gesture, and\r\n * each one maps to exactly one store action: middle-click closes, the context\r\n * menu pins / renames / closes a range, a drag reorders, and a double-click\r\n * edits the tab's own label. None of them can run on their own — the strip stays\r\n * a record of what the user opened.\r\n */\r\nimport { useEffect, useMemo, useRef, useState } from 'react'\r\nimport { createPortal } from 'react-dom'\r\nimport {\r\n IconCloseFillMedium,\r\n IconPinFillMedium,\r\n StateDot,\r\n Tooltip,\r\n type StateDotState,\r\n} from '@deepseek-ai/dsh-client-ui-primitives'\r\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\r\nimport type { SessionsTabsProps } from './contract.ts'\r\nimport { mountTabSeat } from './tab-seat.ts'\r\nimport {\r\n orderedTabs,\r\n projectIndex,\r\n tabIndicator,\r\n type SessionTab,\r\n type SessionTabIndicator,\r\n} from './tabs.ts'\r\nimport { currentSessionId } from './tree.ts'\r\n\r\n/** Dot state for one tab (the sidebar's session rows share this vocabulary). */\r\nfunction dotState(indicator: SessionTabIndicator): StateDotState {\r\n if (indicator.attention) return 'warning'\r\n if (indicator.running) return 'ongoing'\r\n return 'done'\r\n}\r\n\r\n/** Where the context menu is pinned, and which chip it belongs to. */\r\ninterface MenuAnchor {\r\n readonly sessionId: SessionId\r\n readonly x: number\r\n readonly y: number\r\n}\r\n\r\n/** Which chip a drag is hovering, and which half of it. */\r\ninterface DropTarget {\r\n readonly sessionId: SessionId\r\n readonly side: 'before' | 'after'\r\n}\r\n\r\n/** In-flight inline label edit. */\r\ninterface LabelEdit {\r\n readonly sessionId: SessionId\r\n readonly draft: string\r\n}\r\n\r\n/** One row of the tab context menu. */\r\nfunction MenuRow({\r\n label,\r\n onSelect,\r\n disabled = false,\r\n danger = false,\r\n}: {\r\n readonly label: string\r\n readonly onSelect: () => void\r\n readonly disabled?: boolean\r\n readonly danger?: boolean\r\n}) {\r\n return (\r\n \r\n {label}\r\n \r\n )\r\n}\r\n\r\n/**\r\n * Render the session tab strip into the conversation column's head seat.\r\n * @param props - tab store, catalog/status hooks, navigation, locale.\r\n * @returns the portal (or null until the column has mounted).\r\n */\r\nexport function SessionTabs({\r\n useTabs,\r\n actions,\r\n useSessions,\r\n useSessionStatus,\r\n useWorkspaces,\r\n activate,\r\n rename,\r\n t,\r\n}: SessionsTabsProps) {\r\n const tabs = useTabs(s => s.tabs)\r\n const list = useSessions(s => s)\r\n const statuses = useSessionStatus(s => s)\r\n const currentId = useSessions(s => currentSessionId(s))\r\n const workspaces = useWorkspaces(s => s.items)\r\n\r\n // Session → owning project, in one pass over the workspace registry. This is\r\n // what lets each chip name its project; without it a strip of session titles\r\n // is ambiguous as soon as two projects are open.\r\n const projects = useMemo(() => projectIndex(workspaces), [workspaces])\r\n\r\n // The seat is a DOM node outside React's tree, so it cannot arrive through\r\n // props; it is discovered once per mount and held in state to trigger the\r\n // portal's first render when the column appears.\r\n const [seat, setSeat] = useState(null)\r\n // The scrolling row, for wheel redirection and keep-active-in-view.\r\n const scrollRef = useRef(null)\r\n // The open context menu, its chip, and its viewport position.\r\n const [menu, setMenu] = useState(null)\r\n // The chip whose label is being typed into, plus the in-progress text.\r\n const [editing, setEditing] = useState(null)\r\n // The chip being dragged and the chip/half it would land on.\r\n const [dragging, setDragging] = useState(null)\r\n const [dropTarget, setDropTarget] = useState(null)\r\n // Timestamp of the last drag end: a drop must not also count as a click on\r\n // the chip it landed on (which would navigate away from what was just moved).\r\n const dragEndedAt = useRef(0)\r\n\r\n useEffect(() => {\r\n const mounted = mountTabSeat(setSeat)\r\n // The column may already exist, in which case onReady fired synchronously\r\n // during mountTabSeat and setSeat is already queued; adopt it here too so\r\n // the very first paint has a host instead of waiting a frame.\r\n if (mounted.host !== null) setSeat(mounted.host)\r\n return () => {\r\n mounted.dispose()\r\n // The portal must stop targeting a removed node before the next mount.\r\n setSeat(null)\r\n }\r\n }, [])\r\n\r\n // The strip renders exactly the tabs the store holds. There is deliberately NO\r\n // filtering against the session catalog and no \"close tabs whose session\r\n // vanished\" sweep: a tab is removed when the USER closes it, and by nothing\r\n // else. Trimming automatically also misfires — the catalog is briefly empty on\r\n // every load, which deleted restored tabs before the sessions arrived.\r\n const display = useMemo(() => orderedTabs(tabs, currentId), [tabs, currentId])\r\n const index = useMemo(() => new Map(display.map((tab, at) => [tab.sessionId, at])), [display])\r\n\r\n // With the row scrollable, the active chip can sit outside the viewport —\r\n // e.g. after clicking a session in the sidebar that has a tab far to the\r\n // right. Bring it into view on selection change. `block: 'nearest'` keeps\r\n // this a horizontal-only scroll, and `inline: 'nearest'` avoids nudging the\r\n // row when the chip is already fully visible.\r\n useEffect(() => {\r\n const el = scrollRef.current\r\n if (el === null || currentId === undefined) return\r\n const chip = el.querySelector(`[data-tab-session=\"${CSS.escape(currentId)}\"]`)\r\n chip?.scrollIntoView({ block: 'nearest', inline: 'nearest' })\r\n }, [currentId, display.length])\r\n\r\n // Dismiss the context menu on any interaction outside it. Pointerdown covers\r\n // both buttons; Escape and a viewport change (which would leave a fixed menu\r\n // pointing at the wrong chip) close it too. `capture` matters for the scroll\r\n // case: the strip's own row scrolls without bubbling a scroll event up.\r\n useEffect(() => {\r\n if (menu === null) return\r\n const dismiss = (): void => { setMenu(null) }\r\n const onPointerDown = (event: PointerEvent): void => {\r\n const target = event.target\r\n if (target instanceof Element && target.closest('.wgTabMenu') !== null) return\r\n dismiss()\r\n }\r\n const onKeyDown = (event: KeyboardEvent): void => {\r\n if (event.key === 'Escape') dismiss()\r\n }\r\n document.addEventListener('pointerdown', onPointerDown, true)\r\n document.addEventListener('keydown', onKeyDown)\r\n window.addEventListener('resize', dismiss)\r\n window.addEventListener('scroll', dismiss, true)\r\n return () => {\r\n document.removeEventListener('pointerdown', onPointerDown, true)\r\n document.removeEventListener('keydown', onKeyDown)\r\n window.removeEventListener('resize', dismiss)\r\n window.removeEventListener('scroll', dismiss, true)\r\n }\r\n }, [menu])\r\n\r\n if (seat === null || display.length === 0) return null\r\n\r\n /** Commit the in-flight label edit (blank clears the override). */\r\n const commitEdit = (): void => {\r\n if (editing === null) return\r\n actions.rename(editing.sessionId, editing.draft)\r\n setEditing(null)\r\n }\r\n\r\n /** Start editing a tab's own label, pre-filled with what the chip shows. */\r\n const startEdit = (sessionId: SessionId, current: string): void => {\r\n setMenu(null)\r\n setEditing({ sessionId, draft: current })\r\n }\r\n\r\n /** Translate a drop onto `target` into an index in the resulting strip. */\r\n const dropIndexFor = (draggedSessionId: SessionId, target: DropTarget): number | null => {\r\n const from = index.get(draggedSessionId)\r\n const at = index.get(target.sessionId)\r\n if (from === undefined || at === undefined || from === at) return null\r\n // Insertion index in the CURRENT strip, then corrected for the removal the\r\n // move implies: removing a chip before the insertion point shifts it left.\r\n const insertion = at + (target.side === 'after' ? 1 : 0)\r\n return from < insertion ? insertion - 1 : insertion\r\n }\r\n\r\n const chips = display.map((tab: SessionTab, at: number) => {\r\n const summary = list.byId[tab.sessionId]\r\n // A restored tab can render before its catalog row arrives. Show the\r\n // session id meanwhile rather than an empty chip — the tab is real, and\r\n // the title fills in as soon as the catalog catches up.\r\n const sessionLabel = summary === undefined\r\n ? tab.sessionId\r\n : summary.blank ? t('newSession') : summary.displayTitle\r\n // The user's own label wins over the session title; blank means \"follow the\r\n // session\", so the override is absent rather than empty.\r\n const label = tab.title ?? sessionLabel\r\n const active = tab.sessionId === currentId\r\n const pinned = tab.pinned === true\r\n const indicator = tabIndicator(summary, statuses.get(tab.sessionId))\r\n // The project this session belongs to. Absent for a session that is in\r\n // no workspace (a bare session, or one just created before the\r\n // registry caught up) — the chip then shows the title alone rather\r\n // than a placeholder.\r\n const project = projects.get(tab.sessionId)\r\n // Title attribute carries the full pair plus the directory, so the\r\n // truncated chip text is recoverable on hover.\r\n const tip = project === undefined\r\n ? label\r\n : `${project.label} · ${label}\\n${project.path}`\r\n const drop = dropTarget !== null && dropTarget.sessionId === tab.sessionId ? dropTarget.side : null\r\n const isEditing = editing !== null && editing.sessionId === tab.sessionId\r\n const draft = isEditing && editing !== null ? editing.draft : ''\r\n const className = [\r\n 'wgTab',\r\n active ? 'wgTabActive' : '',\r\n pinned ? 'wgTabPinned' : '',\r\n dragging === tab.sessionId ? 'wgTabDragging' : '',\r\n drop === 'before' ? 'wgTabDropBefore' : '',\r\n drop === 'after' ? 'wgTabDropAfter' : '',\r\n ].filter(part => part !== '').join(' ')\r\n return (\r\n {\r\n // Middle click closes, the way every other tab strip behaves. Only\r\n // button 1: a right click opens the menu instead.\r\n if (event.button !== 1) return\r\n event.preventDefault()\r\n actions.close(tab.sessionId)\r\n }}\r\n onContextMenu={(event) => {\r\n event.preventDefault()\r\n setEditing(null)\r\n setMenu({\r\n sessionId: tab.sessionId,\r\n // Clamp inside the viewport so a chip near the right edge does not\r\n // open a menu that runs off-screen.\r\n x: Math.min(event.clientX, window.innerWidth - 208),\r\n y: Math.min(event.clientY, window.innerHeight - 240),\r\n })\r\n }}\r\n onDragStart={(event) => {\r\n event.dataTransfer.effectAllowed = 'move'\r\n event.dataTransfer.setData('text/plain', tab.sessionId)\r\n setDragging(tab.sessionId)\r\n setMenu(null)\r\n }}\r\n onDragOver={(event) => {\r\n if (dragging === null || dragging === tab.sessionId) return\r\n event.preventDefault()\r\n event.dataTransfer.dropEffect = 'move'\r\n const rect = event.currentTarget.getBoundingClientRect()\r\n const side = event.clientX < rect.left + rect.width / 2 ? 'before' : 'after'\r\n setDropTarget({ sessionId: tab.sessionId, side })\r\n }}\r\n onDrop={(event) => {\r\n event.preventDefault()\r\n if (dragging !== null && dropTarget !== null) {\r\n const target = dropIndexFor(dragging, dropTarget)\r\n if (target !== null) actions.move(dragging, target)\r\n }\r\n setDragging(null)\r\n setDropTarget(null)\r\n dragEndedAt.current = Date.now()\r\n }}\r\n onDragEnd={() => {\r\n setDragging(null)\r\n setDropTarget(null)\r\n dragEndedAt.current = Date.now()\r\n }}\r\n >\r\n {isEditing ? (\r\n { event.currentTarget.select() }}\r\n onChange={(event) => { setEditing({ sessionId: tab.sessionId, draft: event.target.value }) }}\r\n onClick={(event) => { event.stopPropagation() }}\r\n onKeyDown={(event) => {\r\n if (event.key === 'Enter') {\r\n event.preventDefault()\r\n commitEdit()\r\n } else if (event.key === 'Escape') {\r\n event.preventDefault()\r\n setEditing(null)\r\n }\r\n }}\r\n onBlur={() => { commitEdit() }}\r\n />\r\n ) : (\r\n <>\r\n {\r\n if (Date.now() - dragEndedAt.current < 250) return\r\n activate(tab.sessionId)\r\n }}\r\n onDoubleClick={() => { startEdit(tab.sessionId, label) }}\r\n >\r\n \r\n \r\n \r\n {/* Two stacked lines, folder-style: the project (short, quiet)\r\n over the session title (long, primary). The project line is\r\n omitted for a session in no workspace, which lets the title\r\n use the full height rather than leaving a blank row. */}\r\n \r\n {project !== undefined && (\r\n {project.label}\r\n )}\r\n {label}\r\n \r\n \r\n {pinned && (\r\n \r\n \r\n \r\n )}\r\n \r\n {\r\n event.stopPropagation()\r\n actions.close(tab.sessionId)\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n )}\r\n
\r\n )\r\n })\r\n\r\n // The menu's chip, resolved against the current strip: a menu opened on a chip\r\n // that has since disappeared renders nothing rather than acting on a stale id.\r\n const menuTab = menu === null ? undefined : display.find(tab => tab.sessionId === menu.sessionId)\r\n const menuIndex = menuTab === undefined ? -1 : at(display, menuTab)\r\n const menuLabel = menuTab === undefined\r\n ? ''\r\n : menuTab.title ?? list.byId[menuTab.sessionId]?.displayTitle ?? menuTab.sessionId\r\n const menuPinned = menuTab?.pinned === true\r\n const canCloseRight = menuIndex >= 0 && menuIndex < display.length - 1\r\n\r\n return createPortal(\r\n <>\r\n
\r\n {\r\n // A plain wheel reports only `deltaY`, and the overflow here is\r\n // horizontal, so without this the wheel would do nothing over the\r\n // strip (or scroll the transcript behind it). Redirect the dominant\r\n // delta to scrollLeft, and only swallow the event once there is\r\n // somewhere left to scroll — otherwise a wheel at either end keeps\r\n // propagating and the page still scrolls normally.\r\n const el = event.currentTarget\r\n if (el.scrollWidth <= el.clientWidth) return\r\n const delta = Math.abs(event.deltaY) > Math.abs(event.deltaX) ? event.deltaY : event.deltaX\r\n if (delta === 0) return\r\n const atStart = el.scrollLeft <= 0 && delta < 0\r\n const atEnd = el.scrollLeft + el.clientWidth >= el.scrollWidth - 1 && delta > 0\r\n if (atStart || atEnd) return\r\n el.scrollLeft += delta\r\n event.preventDefault()\r\n }}\r\n >\r\n {chips}\r\n
\r\n \r\n {menu !== null && menuTab !== undefined && createPortal(\r\n \r\n {\r\n actions.pin(menu.sessionId)\r\n setMenu(null)\r\n }}\r\n />\r\n { startEdit(menu.sessionId, menuLabel) }}\r\n />\r\n {\r\n setMenu(null)\r\n rename(menu.sessionId, menuLabel)\r\n }}\r\n />\r\n
\r\n {\r\n setMenu(null)\r\n actions.close(menu.sessionId)\r\n }}\r\n />\r\n {\r\n setMenu(null)\r\n actions.closeOthers(menu.sessionId)\r\n }}\r\n />\r\n {\r\n setMenu(null)\r\n actions.closeAfter(menu.sessionId)\r\n }}\r\n />\r\n
,\r\n document.body,\r\n )}\r\n ,\r\n seat,\r\n )\r\n}\r\n\r\n/** Index of one tab in the strip, used by the menu's range actions. */\r\nfunction at(tabs: readonly SessionTab[], target: SessionTab): number {\r\n return tabs.findIndex(tab => tab.sessionId === target.sessionId)\r\n}\r\n","/**\r\n * The workspace-groups browsing region filling the sidebar shell's\r\n * `sidebar.workspaces` hole: section header (title + right-aligned search +\r\n * new-group + add workspace), the three-level tree (category —workspace — * session), group management dialogs, and the workspace/session dialogs. Wide\r\n * state renders the full browser; rail state renders the two region icons\r\n * (search / add workspace) as 36px controls on the shell's shared rail entry\r\n * path, each requesting expansion through the owner share.\r\n *\r\n * Data: workspaces/sessions via the framework global hooks; grouping config\r\n * via the host half's `/workspace-groups/config` route (refetched on mount).\r\n * Runtime group management (create/rename/delete any group, drag workspaces\r\n * between groups and into position, drag groups into position) persists\r\n * through `PUT /workspace-groups/manual`; the sidecar YAML is never rewritten\r\n * (rule-group rename/delete ride the overlay `renamed`/`hidden` maps).\r\n */\r\nimport { useEffect, useMemo, useRef, useState, type DragEvent, type ReactElement } from 'react'\r\nimport {\r\n Button,\r\n IconCloseFillMedium,\r\n IconFolderOpenOutlineRegular,\r\n IconProjectAddOutlineRegular,\r\n IconSearchOutlineRegular,\r\n IconWarningOutlineRegular,\r\n Modal,\r\n Toast,\r\n Tooltip,\r\n} from '@deepseek-ai/dsh-client-ui-primitives'\r\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\r\nimport type { SessionListState, SessionSearchResultItem } from '@deepseek-ai/dsh-api-session-controller/client'\r\nimport type { WorkspaceId, WorkspaceView } from '@deepseek-ai/dsh-api-workspace-controller/client'\r\nimport type { SessionStatusSnapshot } from '@deepseek-ai/dsh-client-ui-session/client'\r\nimport {\r\n displayCategoryKeys,\r\n isCategoryPinned,\r\n moveAfter,\r\n moveBefore,\r\n originalRuleNameForDisplay,\r\n pruneAppearance,\r\n resolveCategory,\r\n takenCategoryNames,\r\n} from '../core/matcher.ts'\r\nimport {\r\n GROUP_COLORS,\r\n GROUP_ICON_IDS,\r\n TOP_LEVEL_ORDER_KEY,\r\n UNCATEGORIZED_LABEL,\r\n type CategoryAppearance,\r\n type GroupColor,\r\n type GroupsConfig,\r\n type ManualGroups,\r\n} from '../core/types.ts'\r\nimport type { GroupsBrowserProps } from './contract.ts'\r\nimport { deriveDefaultWorkspace, deriveGroups, deriveSearchGroups, deriveSearchMatches, deriveTopLevel, currentSessionId, folderKey, isDockedCategoryKey, memberWorkspaces, UNCATEGORIZED_KEY, type CategoryNode, type SearchMatchSet, type SearchTree, type WorkspaceGroupNode } from './tree.ts'\r\nimport { CategoryGlyph, CategoryRow, DND_CATEGORY_TYPE, DND_WORKSPACE_TYPE, FolderRow, hasPluginDragType, RowGroup, SessionRow, WorkspaceRow } from './rows.tsx'\r\nimport type { WorkspaceGroupsKey } from './locales.ts'\r\nimport { GROUP_EMOJI_ICONS, GROUP_ICON_LABELS } from './group-icon-labels.ts'\r\nimport { SCIENCE_ICON_IDS, SCIENCE_ICON_SECTIONS } from './group-icons-science.tsx'\r\nimport { EMPTY_FOLDERS_DOCUMENT, addFolder, addMember, effectiveFolders, entryFor, isEmptyEntry, isUnderBase, memberByWorkspaceId, memberOf, findRemoteMember, removeFolder, rootOf, samePath, setRoot, type FolderMember, type FoldersDocument, type WorkspaceFolderEntry } from '../core/folders.ts'\r\nimport { FoldersConflictError, loadFolders, saveFolders } from './folders-persist.ts'\r\nimport { createRemoteFolder, createWorkspaceDirectory, deleteRemoteWorkspaceRecord, listRemoteProfiles, remoteFolderWorkspace, type RemoteFolderWorkspace, type RemoteProfileSummary } from './folder-directory.ts'\r\nimport { fetchOpenInApps, folderAppId, openPathInApp } from './open-folder.ts'\r\nimport { FoldersDialog } from './FoldersDialog.tsx'\r\nimport { QuickPanel } from './QuickPanel.tsx'\r\nimport { SessionTabs } from './SessionTabs.tsx'\r\nimport css from './styles.css?inline'\r\n\r\nconst SEARCH_DEBOUNCE_MS = 250\r\nconst SEARCH_QUERY_MAX_CODE_UNITS = 500\r\n\r\n/** Overlay with every optional field materialized (plain-object edits, no undefined spreads). */\r\ntype NormalizedManual = Required\r\n\r\nconst EMPTY_MANUAL: NormalizedManual = {\r\n revision: 0,\r\n categories: [], assignments: {}, categoryOrder: [], workspaceOrder: {}, renamed: {}, hidden: [], appearance: {},\r\n}\r\n\r\n/** Materialize optional overlay fields so every update is a plain object edit. */\r\nfunction normalizeManual(manual: ManualGroups): NormalizedManual {\r\n return {\r\n revision: manual.revision ?? 0,\r\n categories: manual.categories,\r\n assignments: manual.assignments,\r\n categoryOrder: manual.categoryOrder ?? [],\r\n workspaceOrder: manual.workspaceOrder ?? {},\r\n renamed: manual.renamed ?? {},\r\n hidden: manual.hidden ?? [],\r\n appearance: manual.appearance ?? {},\r\n }\r\n}\r\n\r\n/**\r\n * Largest subtree (rows including the level header) that still animates: a\r\n * 100-session project expanding with a grid animation janks the sidebar, so\r\n * wide subtrees snap open instead.\r\n */\r\nconst ANIMATION_ROW_CAP = 40\r\n\r\n/**\r\n * Mirrors the host icon validator (`parseAppearance`) so invalid custom glyphs\r\n * fail locally instead of turning the whole overlay PUT into a 400.\r\n */\r\nconst ICON_VALUE_PATTERN = /^(?:[a-z][a-z0-9-]{0,23}|[^\\s\\u0000-\\u001f\\u007f]{1,4})$/u\r\n\r\n/** Rows a group reveals when expanded (projects + their visible sessions). */\r\nfunction categoryRowCount(category: CategoryNode): number {\r\n return category.workspaces.reduce((total, workspace) => total + 1 + (workspace.expanded ? workspace.sessions.length : 0), 0)\r\n}\r\n\r\n/** Palette id —i18n key for the colour picker (keeps literal key types intact). */\r\nconst COLOR_LABEL_KEYS: Record = {\r\n red: 'color.red',\r\n orange: 'color.orange',\r\n amber: 'color.amber',\r\n green: 'color.green',\r\n teal: 'color.teal',\r\n blue: 'color.blue',\r\n indigo: 'color.indigo',\r\n purple: 'color.purple',\r\n pink: 'color.pink',\r\n gray: 'color.gray',\r\n}\r\n\r\n/** Research icon ids, matched against the shared registry for the picker split. */\r\nconst SCIENCE_ICON_ID_SET: ReadonlySet = new Set(SCIENCE_ICON_IDS)\r\n\r\n/** Picker section key —i18n key (keeps literal key types intact). */\r\nconst SCIENCE_SECTION_LABEL_KEYS: Record<'lab' | 'materials' | 'characterization' | 'devices', WorkspaceGroupsKey> = {\r\n lab: 'group.icon.section.lab',\r\n materials: 'group.icon.section.materials',\r\n characterization: 'group.icon.section.characterization',\r\n devices: 'group.icon.section.devices',\r\n}\r\n\r\n/** The pre-existing glyphs, shown as the picker's \"common\" section. */\r\nconst COMMON_ICON_IDS = GROUP_ICON_IDS.filter(id => !SCIENCE_ICON_ID_SET.has(id))\r\n\r\n/**\r\n * The same workspace node without its extra folders and session rows: used\r\n * while searching, so the pinned default-workspace bar never paints unrelated\r\n * sessions next to pruned search results.\r\n */\r\nfunction withoutSessions(node: WorkspaceGroupNode): WorkspaceGroupNode {\r\n return {\r\n workspaceId: node.workspaceId,\r\n path: node.path,\r\n label: node.label,\r\n createdAt: node.createdAt,\r\n sessionCount: node.sessionCount,\r\n expanded: node.expanded,\r\n containsCurrent: node.containsCurrent,\r\n sessions: [],\r\n }\r\n}\r\n\r\n/**\r\n * Split the derived categories into the tree and the docked \"not classified\r\n * yet\" bucket (see isDockedCategoryKey). The bucket keeps its own row and\r\n * children, only its position moves to the bottom dock.\r\n */\r\nfunction splitDockedCategory(categories: readonly CategoryNode[]): {\r\n treeGroups: readonly CategoryNode[]\r\n dockedCategory: CategoryNode | undefined\r\n} {\r\n const docked = categories.find(category => isDockedCategoryKey(category.key))\r\n return {\r\n treeGroups: docked === undefined ? categories : categories.filter(category => category !== docked),\r\n dockedCategory: docked,\r\n }\r\n}\r\n\r\n/** Whether a workspace node (or one of its folder rows) holds a matched session. */\r\nfunction workspaceHasMatchedSession(workspace: WorkspaceGroupNode, matched: ReadonlySet): boolean {\r\n if (workspace.sessions.some(session => matched.has(session.id))) return true\r\n return workspace.folders?.some(folder => folder.sessions.some(session => matched.has(session.id))) ?? false\r\n}\r\n\r\nfunction sanitizeSearchQuery(value: string): string {\r\n const withoutNul = value.replaceAll('\\0', '')\r\n if (withoutNul.length <= SEARCH_QUERY_MAX_CODE_UNITS) return withoutNul\r\n return withoutNul.slice(0, SEARCH_QUERY_MAX_CODE_UNITS)\r\n}\r\n\r\n/** Immutable membership toggle for the local expand-all array. */\r\nfunction toggled(list: readonly string[], key: string): string[] {\r\n return list.includes(key) ? list.filter(k => k !== key) : [...list, key]\r\n}\r\n\r\ninterface RemoteSearchState {\r\n query: string\r\n status: 'idle' | 'loading' | 'ready' | 'error'\r\n items: readonly SessionSearchResultItem[]\r\n hasMore: boolean\r\n}\r\n\r\n/** Light runtime guard for the manual overlay attached to the config fetch. */\r\nfunction isManualGroups(value: unknown): value is ManualGroups {\r\n if (typeof value !== 'object' || value === null) return false\r\n const candidate = value as { categories?: unknown; assignments?: unknown }\r\n return Array.isArray(candidate.categories) && typeof candidate.assignments === 'object' && candidate.assignments !== null\r\n}\r\n\r\n/** Minimal fetch of the grouping config + runtime overlay (no-cache revalidation). */\r\nasync function fetchGroupsConfig(): Promise<{ config: GroupsConfig; manual: NormalizedManual }> {\r\n const response = await fetch('/workspace-groups/config', { cache: 'no-cache' })\r\n if (!response.ok) throw new Error(`config request failed: ${response.status}`)\r\n const body = (await response.json()) as GroupsConfig\r\n const config: GroupsConfig = Array.isArray(body.categories) ? body : { categories: [] }\r\n return { config, manual: isManualGroups(body.manual) ? normalizeManual(body.manual) : EMPTY_MANUAL }\r\n}\r\n\r\n/** A manual-overlay save rejected because another window wrote first (HTTP 409). */\r\nclass ManualConflictError extends Error {\r\n readonly current: ManualGroups\r\n constructor(current: ManualGroups, message = 'group changes changed in another window') {\r\n super(message)\r\n this.name = 'ManualConflictError'\r\n this.current = current\r\n }\r\n}\r\n\r\n/**\r\n * Persist the whole runtime overlay (idempotent; the host validates + writes).\r\n * Resolves with the overlay as stored (host echo, revision bumped) so callers\r\n * adopt it instead of their own pre-save copy; a stale write rejects with\r\n * {@link ManualConflictError} carrying the host's current overlay.\r\n */\r\nasync function saveManualOverlay(manual: ManualGroups): Promise {\r\n const response = await fetch('/workspace-groups/manual', {\r\n method: 'PUT',\r\n headers: { 'Content-Type': 'application/json' },\r\n body: JSON.stringify(manual),\r\n })\r\n if (response.status === 409) {\r\n const body: unknown = await response.json().catch(() => null)\r\n const current = typeof body === 'object' && body !== null && isManualGroups((body as { manual?: unknown }).manual)\r\n ? (body as { manual: ManualGroups }).manual\r\n : { categories: [], assignments: {} }\r\n throw new ManualConflictError(current)\r\n }\r\n if (!response.ok) {\r\n let message = `manual save failed: ${response.status}`\r\n try {\r\n const text = await response.text()\r\n if (text !== '') message = text\r\n } catch { /* keep the fallback message */ }\r\n throw new Error(message)\r\n }\r\n const body: unknown = await response.json().catch(() => null)\r\n const stored = typeof body === 'object' && body !== null && isManualGroups((body as { manual?: unknown }).manual)\r\n ? (body as { manual: ManualGroups }).manual\r\n : null\r\n return stored ?? manual\r\n}\r\n\r\n/** One group-management dialog state: create, or rename an existing group. */\r\ntype GroupDialogState = { mode: 'create' } | { mode: 'rename'; from: string } | null\r\n\r\n/** Row reference used by drop targets: which kind of row, which key. */\r\nexport type DropRowRef = { kind: 'category' | 'workspace' | 'topLevel'; key: string }\r\n\r\n/**\r\n * Which level's rows fold while a drag is in progress: dragging a project\r\n * folds every project row (grouped AND top-level), dragging a group folds\r\n * every group row. The other level keeps its expansion untouched.\r\n */\r\nexport type DragLevel = 'workspace' | 'category' | null\r\n\r\n/**\r\n * Current drop indicator. A `line` renders a 2px insertion line above/below a\r\n * row (project reorder inside a group, or group reorder); an `into` renders\r\n * the whole-row highlight used when dropping a project into a group. Drop\r\n * handlers re-derive before/after from the drop event itself, so the\r\n * indicator is purely visual and can never go stale.\r\n */\r\nexport type DragIndicator =\r\n | { mode: 'line'; row: DropRowRef; before: boolean }\r\n | { mode: 'into'; categoryKey: string }\r\n | null\r\n\r\n/**\r\n * Render the browsing region.\r\n * @param props - composed slot props (shell owner share + store + injected actions).\r\n * @returns the region element tree.\r\n */\r\nexport function GroupsBrowser({\r\n wide,\r\n expandSidebar,\r\n useSessions,\r\n useWorkspaces,\r\n useSessionStatus,\r\n useStore,\r\n actions,\r\n startSession,\r\n createSessionIn,\r\n open,\r\n renameSession,\r\n forkSession,\r\n renameWorkspace,\r\n deleteWorkspace,\r\n insertWorkspaceBefore,\r\n archiveSession,\r\n insertSessionBefore,\r\n createWorkspace,\r\n pickDirectory,\r\n getDirectoryFlow,\r\n createDirectory,\r\n searchSessions,\r\n searchResultLimit,\r\n openTab,\r\n useTabs,\r\n tabActions,\r\n t,\r\n}: GroupsBrowserProps) {\r\n // Inject the stylesheet once per fiber; dispose removes it (HMR safe).\r\n useEffect(() => {\r\n const style = document.createElement('style')\r\n style.setAttribute('data-plugin', 'dsh-workspace-groups')\r\n style.textContent = css\r\n document.head.append(style)\r\n return () => { style.remove() }\r\n }, [])\r\n\r\n // Ctrl+R toggles the quick switch panel. Capture phase + preventDefault:\r\n // beats the browser's page-reload default and any shell-level handler.\r\n const [quickOpen, setQuickOpen] = useState(false)\r\n useEffect(() => {\r\n const onKeyDown = (e: KeyboardEvent): void => {\r\n if (e.ctrlKey && !e.altKey && !e.metaKey && !e.shiftKey && (e.key === 'r' || e.key === 'R')) {\r\n e.preventDefault()\r\n e.stopPropagation()\r\n setQuickOpen(v => !v)\r\n }\r\n }\r\n window.addEventListener('keydown', onKeyDown, true)\r\n return () => window.removeEventListener('keydown', onKeyDown, true)\r\n }, [])\r\n\r\n // Grouping config from the host route + the runtime manual overlay.\r\n const [config, setConfig] = useState({ categories: [] })\r\n const [manual, setManual] = useState(EMPTY_MANUAL)\r\n const [configError, setConfigError] = useState(null)\r\n const reloadConfig = () => {\r\n setConfigError(null)\r\n fetchGroupsConfig().then(({ config: nextConfig, manual: nextManual }) => {\r\n setConfig(nextConfig)\r\n setManual(nextManual)\r\n }).catch((reason: unknown) => {\r\n setConfigError(reason instanceof Error ? reason.message : String(reason))\r\n })\r\n }\r\n useEffect(() => { reloadConfig() }, [])\r\n\r\n // Transient save errors for drag/menu group operations (dialog errors are local).\r\n const [manualError, setManualError] = useState(null)\r\n const [manualSaving, setManualSaving] = useState(false)\r\n\r\n // ---- Per-workspace folders (multi-root) -------------------------------------\r\n //\r\n // A second host sidecar (`/workspace-groups/folders`) lists each workspace's\r\n // extra folders plus the optional root folder. Reads carry an explicit\r\n // loading/ready/error phase: an HTTP failure must never be rendered as \"no\r\n // folders\", because that makes every member reappear as a duplicate row.\r\n const [foldersDoc, setFoldersDoc] = useState(EMPTY_FOLDERS_DOCUMENT)\r\n const [foldersPhase, setFoldersPhase] = useState<'loading' | 'ready' | 'error'>('loading')\r\n const [foldersError, setFoldersError] = useState(null)\r\n const [foldersRetryToken, setFoldersRetryToken] = useState(0)\r\n const [foldersConflict, setFoldersConflict] = useState<{ current: FoldersDocument; draft: FoldersDocument } | null>(null)\r\n const foldersConfirmedRef = useRef(EMPTY_FOLDERS_DOCUMENT)\r\n const foldersHasDataRef = useRef(false)\r\n const foldersPendingRef = useRef(null)\r\n const foldersSavingRef = useRef(false)\r\n // Folder collapse is component state, not store state: it is a transient view\r\n // of the row list, like the quick panel, so it is deliberately NOT persisted\r\n // with the category/workspace expansion keys. Folders start expanded, so\r\n // attaching a folder never hides sessions the user could already see.\r\n const [collapsedFolderKeys, setCollapsedFolderKeys] = useState([])\r\n const [foldersTarget, setFoldersTarget] = useState(null)\r\n const [foldersBusy, setFoldersBusy] = useState(false)\r\n const createdFolderPendingSave = useRef<{ workspaceId: WorkspaceId; name: string; path: string } | null>(null)\r\n const [creatingSessionIn, setCreatingSessionIn] = useState(null)\r\n // Local mirror root of the remote-ssh plugin, as reported by the host. A\r\n // project whose directory lives below it is a REMOTE workspace: its folder is\r\n // a mirror of one remote root, so extra folders must be subdirectories of that\r\n // mirror —anything else would exist on this machine only.\r\n const [foldersRemoteBase, setFoldersRemoteBase] = useState(null)\r\n useEffect(() => {\r\n let cancelled = false\r\n const controller = new AbortController()\r\n let timer: ReturnType | null = null\r\n let retries = 0\r\n const attempt = async (): Promise => {\r\n const snapshot = await loadFolders(fetch, controller.signal)\r\n if (cancelled) return\r\n if (snapshot.error === 'aborted') return\r\n if (snapshot.ok) {\r\n foldersConfirmedRef.current = snapshot.document\r\n foldersHasDataRef.current = true\r\n setFoldersDoc(snapshot.document)\r\n setFoldersRemoteBase(snapshot.remoteBase ?? null)\r\n setFoldersPhase('ready')\r\n setFoldersError(null)\r\n return\r\n }\r\n const reason = snapshot.error ?? 'unknown error'\r\n if (foldersHasDataRef.current) {\r\n // Keep the last confirmed rows and mark the refresh as failed; never\r\n // replace them with an empty document.\r\n setFoldersPhase('ready')\r\n setFoldersError(reason)\r\n } else {\r\n setFoldersPhase('error')\r\n setFoldersError(reason)\r\n }\r\n // Bounded exponential backoff (1s, 2s, 4s, 8s, 15s). The timer is\r\n // cancelled on unmount; an online event or the Retry button resets it.\r\n if (retries < 5) {\r\n const delay = Math.min(15_000, 1_000 * 2 ** retries)\r\n retries += 1\r\n timer = setTimeout(() => { void attempt() }, delay)\r\n }\r\n }\r\n void attempt()\r\n const onOnline = (): void => {\r\n retries = 0\r\n void attempt()\r\n }\r\n window.addEventListener('online', onOnline)\r\n return () => {\r\n cancelled = true\r\n controller.abort()\r\n if (timer !== null) clearTimeout(timer)\r\n window.removeEventListener('online', onOnline)\r\n }\r\n }, [foldersRetryToken])\r\n\r\n const workspaces = useWorkspaces(state => state.items)\r\n const workspacePhase = useWorkspaces(state => state.phase)\r\n const archivedSessionIds = useWorkspaces(state => state.archivedSessionIds)\r\n const categoryExpansion = useStore(s => s.categoryExpansion)\r\n const workspaceExpansion = useStore(s => s.workspaceExpansion)\r\n\r\n const list = useSessions(s => s)\r\n const statuses = useSessionStatus(s => s)\r\n // 0.1.6: the selected Session is the one retained through `mainView`, not a\r\n // `list.current` field (the list snapshot carries catalog facts only).\r\n const current = currentSessionId(list)\r\n // A member folder is backed by its own DSH workspace, whose sidebar row this\r\n // plugin hides: its sessions belong to the project that SHOWS the folder, so\r\n // \"current\" must resolve back to that owner for expansion and highlighting.\r\n const members = useMemo(() => memberWorkspaces(workspaces, foldersDoc), [workspaces, foldersDoc])\r\n const visibleWorkspaces = useMemo(\r\n () => workspaces.filter(w => !members.absorbed.has(w.workspaceId as string)),\r\n [workspaces, members],\r\n )\r\n const currentWorkspaceKey = useMemo(() => {\r\n if (current === undefined) return undefined\r\n const owner = workspaces.find(w => w.sessionIds.includes(current as SessionId))?.workspaceId as string | undefined\r\n if (owner === undefined) return undefined\r\n return members.absorbed.get(owner) ?? owner\r\n }, [current, workspaces, members])\r\n\r\n // Auto-expand the category + workspace containing the current session, but\r\n // ONLY when the user has never touched that key (`Object.hasOwn`): a\r\n // present `false` is a deliberate collapse and must stay folded. Without\r\n // this guard the effect re-expands the just-collapsed current category on\r\n // every store change (the reported \"cannot collapse\" bug).\r\n useEffect(() => {\r\n if (current === undefined || currentWorkspaceKey === undefined) return\r\n const category = categoriesForCurrent(config, workspaces, current, manual)\r\n if (category !== undefined && !Object.hasOwn(categoryExpansion, category)) {\r\n actions.setCategoryExpanded(category, true)\r\n }\r\n if (!Object.hasOwn(workspaceExpansion, currentWorkspaceKey)) {\r\n actions.setWorkspaceExpanded(currentWorkspaceKey, true)\r\n }\r\n }, [current, currentWorkspaceKey, config, workspaces, manual, categoryExpansion, workspaceExpansion, actions])\r\n\r\n // Drop expansion keys that no longer exist (group edits / workspace deletion).\r\n useEffect(() => {\r\n if (workspacePhase !== 'ready') return\r\n actions.retainKeys(\r\n displayCategoryKeys(config, manual),\r\n workspaces.map(w => w.workspaceId as string),\r\n )\r\n }, [actions, config, manual, workspacePhase, workspaces])\r\n\r\n // Session tabs: the strip lives in the conversation column, but its lifecycle\r\n // belongs here —the browser already derives the open session for its own tree,\r\n // so one effect covers every way a session can be opened (sidebar row,\r\n // workspace New Session, quick panel, conversation-header crumbs).\r\n //\r\n // `statuses` is a dependency on purpose: a session earns its tab when it\r\n // STARTS working, which is a status change, not a catalog change. Without it a\r\n // conversation that began while already open would never surface a tab.\r\n useEffect(() => {\r\n if (current === undefined) return\r\n openTab(current, statuses.get(current))\r\n }, [current, list, statuses, openTab])\r\n\r\n const [query, setQuery] = useState('')\r\n const [searchExpanded, setSearchExpanded] = useState(false)\r\n const normalizedQuery = sanitizeSearchQuery(query).trim()\r\n const [remoteSearch, setRemoteSearch] = useState({\r\n query: '', status: 'idle', items: [], hasMore: false,\r\n })\r\n const searchInput = useRef(null)\r\n const searchRoot = useRef(null)\r\n\r\n // Search debounce + abort, same posture as the official browser.\r\n useEffect(() => {\r\n if (normalizedQuery === '') {\r\n setRemoteSearch({ query: '', status: 'idle', items: [], hasMore: false })\r\n return\r\n }\r\n const controller = new AbortController()\r\n setRemoteSearch({ query: normalizedQuery, status: 'loading', items: [], hasMore: false })\r\n const timer = window.setTimeout(() => {\r\n searchSessions(normalizedQuery, controller.signal).then((result) => {\r\n if (controller.signal.aborted) return\r\n setRemoteSearch({ query: normalizedQuery, status: 'ready', items: result.items, hasMore: result.hasMore })\r\n }).catch(() => {\r\n if (controller.signal.aborted) return\r\n setRemoteSearch({ query: normalizedQuery, status: 'error', items: [], hasMore: false })\r\n })\r\n }, SEARCH_DEBOUNCE_MS)\r\n return () => {\r\n window.clearTimeout(timer)\r\n controller.abort()\r\n }\r\n }, [normalizedQuery, searchSessions])\r\n\r\n // Outside-click dismissal of the search box.\r\n useEffect(() => {\r\n if (!wide || !searchExpanded) return\r\n const onClick = (event: MouseEvent): void => {\r\n if (!(event.target instanceof Node) || searchRoot.current?.contains(event.target) === true) return\r\n searchInput.current?.blur()\r\n if (normalizedQuery !== '') return\r\n setSearchExpanded(false)\r\n }\r\n document.addEventListener('click', onClick)\r\n return () => { document.removeEventListener('click', onClick) }\r\n }, [normalizedQuery, wide, searchExpanded])\r\n\r\n const expandedCategories = useMemo(\r\n () => Object.entries(categoryExpansion).filter(([, v]) => v).map(([k]) => k),\r\n [categoryExpansion],\r\n )\r\n const expandedWorkspaces = useMemo(\r\n () => Object.entries(workspaceExpansion).filter(([, v]) => v).map(([k]) => k),\r\n [workspaceExpansion],\r\n )\r\n // Which level is being dragged: drives the top-level drop target (project\r\n // drags only) and which level's rows fold.\r\n const [dragging, setDragging] = useState(null)\r\n const groups = useMemo(\r\n () => deriveGroups(list, workspaces, archivedSessionIds, config, {\r\n expandedCategories,\r\n expandedWorkspaces,\r\n collapsedFolders: collapsedFolderKeys,\r\n }, manual, statuses, foldersDoc),\r\n [list, workspaces, archivedSessionIds, config, manual, statuses, expandedCategories, expandedWorkspaces, collapsedFolderKeys, foldersDoc],\r\n )\r\n // Top-level (ungrouped) workspace rows, rendered after the group folders.\r\n const topLevel = useMemo(\r\n () => deriveTopLevel(list, workspaces, archivedSessionIds, config, {\r\n expandedCategories,\r\n expandedWorkspaces,\r\n collapsedFolders: collapsedFolderKeys,\r\n }, manual, statuses, foldersDoc),\r\n [list, workspaces, archivedSessionIds, config, manual, statuses, expandedCategories, expandedWorkspaces, collapsedFolderKeys, foldersDoc],\r\n )\r\n // The Host's default workspace is not part of the grouping tree: it is pinned\r\n // to its own bar at the bottom of the sidebar (see deriveDefaultWorkspace and\r\n // the exclusions in tree.ts), while keeping the full workspace-row behaviour.\r\n const defaultWorkspace = useMemo(\r\n () => deriveDefaultWorkspace(list, workspaces, archivedSessionIds, {\r\n expandedCategories,\r\n expandedWorkspaces,\r\n collapsedFolders: collapsedFolderKeys,\r\n }, statuses, foldersDoc),\r\n [list, workspaces, archivedSessionIds, statuses, foldersDoc, expandedCategories, expandedWorkspaces, collapsedFolderKeys],\r\n )\r\n // Search derivation lives here (not inside SearchBody) so the pinned\r\n // default-workspace bar can show the very same pruned branch the results use.\r\n const activeRemoteSearch = useMemo(\r\n () => (remoteSearch.query === normalizedQuery\r\n ? remoteSearch\r\n : { query: normalizedQuery, status: 'loading', items: [], hasMore: false }),\r\n [remoteSearch, normalizedQuery],\r\n )\r\n const searchMatches = useMemo(\r\n () => (normalizedQuery === ''\r\n ? undefined\r\n : deriveSearchMatches(list, workspaces, config, normalizedQuery, archivedSessionIds, activeRemoteSearch, searchResultLimit, foldersDoc)),\r\n [list, workspaces, config, normalizedQuery, archivedSessionIds, activeRemoteSearch, searchResultLimit, foldersDoc],\r\n )\r\n const searchTree = useMemo(\r\n () => (searchMatches === undefined\r\n ? undefined\r\n : deriveSearchGroups(list, workspaces, config, searchMatches.matchedIds, archivedSessionIds, manual, searchMatches.snippetsBySession, statuses, foldersDoc)),\r\n [list, workspaces, config, searchMatches, archivedSessionIds, manual, statuses, foldersDoc],\r\n )\r\n // The \"not classified yet\" bucket leaves the tree and docks above the\r\n // default-workspace bar, so unsorted projects never take a tree slot.\r\n const { treeGroups, dockedCategory } = useMemo(() => splitDockedCategory(groups), [groups])\r\n // Search keeps the dock too, but pruned to the matching rows: a bucket with no\r\n // match is content, not a permanent anchor, so it simply does not show.\r\n const searchDockCategory = useMemo(() => {\r\n if (searchTree === undefined || searchMatches === undefined) return undefined\r\n const docked = searchTree.categories.find(category => isDockedCategoryKey(category.key))\r\n if (docked === undefined) return undefined\r\n const workspaces = docked.workspaces.filter(workspace => workspaceHasMatchedSession(workspace, searchMatches.matchedIds))\r\n return workspaces.length === 0 ? undefined : { ...docked, workspaces }\r\n }, [searchTree, searchMatches])\r\n // The results area must never repeat the docked bucket: drop it from the tree\r\n // handed to SearchBody (the dock renders it instead).\r\n const searchTreeForBody = useMemo(\r\n () => (searchTree === undefined\r\n ? undefined\r\n : { ...searchTree, categories: searchTree.categories.filter(category => !isDockedCategoryKey(category.key)) }),\r\n [searchTree],\r\n )\r\n // Quick panel (Ctrl+R): category label per grouped workspace id (the tree\r\n // derivation already resolved grouping; top-level workspaces stay absent).\r\n const categoryByWorkspace = useMemo(() => {\r\n const map = new Map()\r\n for (const category of groups) {\r\n for (const workspace of category.workspaces) map.set(workspace.workspaceId as string, category.label)\r\n }\r\n return map\r\n }, [groups])\r\n // While dragging a project, an empty top-level area must still show a landing\r\n // line —otherwise a project can never be dragged OUT of a group when every\r\n // project is currently grouped.\r\n const topLevelDropActive = dragging === 'workspace' && topLevel.length === 0\r\n // The top-level area is the move-out landing spot: rows reorder with an\r\n // insertion line (before/after), and the blank space below the last row\r\n // appends to the end of the list. No whole-area highlight box.\r\n const topLevelRef: DropRowRef = { kind: 'topLevel', key: UNCATEGORIZED_KEY }\r\n\r\n // Use the elected standard flow, including remote-ssh's local/remote picker.\r\n const [directoryFlowOpen, setDirectoryFlowOpen] = useState(false)\r\n const [directoryFlow, setDirectoryFlow] = useState>(null)\r\n const DirectoryFlow = directoryFlow?.component\r\n const directoryRequest = useRef<{\r\n resolve: (path: string | null) => void\r\n reject: (error: Error) => void\r\n } | null>(null)\r\n const finishDirectoryFlow = (path: string | null, error?: string): void => {\r\n const pending = directoryRequest.current\r\n directoryRequest.current = null\r\n setDirectoryFlowOpen(false)\r\n if (error !== undefined) pending?.reject(new Error(error))\r\n else pending?.resolve(path)\r\n }\r\n useEffect(() => () => {\r\n directoryRequest.current?.resolve(null)\r\n directoryRequest.current = null\r\n }, [])\r\n const pickWorkspaceDirectory = (): Promise => {\r\n const flow = getDirectoryFlow()\r\n if (!flow) return pickDirectory()\r\n if (directoryRequest.current) return Promise.resolve(null)\r\n setDirectoryFlow(flow)\r\n return new Promise((resolve, reject) => {\r\n directoryRequest.current = { resolve, reject }\r\n setDirectoryFlowOpen(true)\r\n })\r\n }\r\n const [adding, setAdding] = useState(false)\r\n const [addError, setAddError] = useState(null)\r\n const [addErrorOpen, setAddErrorOpen] = useState(false)\r\n const addCategoryRef = useRef(undefined)\r\n const currentGrouping = useRef({ manual, groups, manualSaving })\r\n currentGrouping.current = { manual, groups, manualSaving }\r\n const addWorkspace = async (categoryKey?: string): Promise => {\r\n if (adding || manualSaving) return\r\n addCategoryRef.current = categoryKey\r\n setAdding(true)\r\n setAddError(null)\r\n setAddErrorOpen(false)\r\n try {\r\n const path = await pickWorkspaceDirectory()\r\n if (path === null) return // cancelled\r\n const workspace = await createWorkspace({ path })\r\n if (categoryKey !== undefined) {\r\n // Use the returned ID: the workspace observable may not have caught up yet.\r\n const latest = currentGrouping.current\r\n if (latest.manualSaving || !latest.groups.some(group => group.key === categoryKey)) {\r\n throw new Error('The group changed while adding the workspace. Please retry from the target group.')\r\n }\r\n const workspaceId = workspace.workspaceId as string\r\n const workspaceOrder = Object.fromEntries(Object.entries(latest.manual.workspaceOrder)\r\n .map(([key, ids]) => [key, ids.filter(id => id !== workspaceId)]))\r\n workspaceOrder[categoryKey] = [...(workspaceOrder[categoryKey] ?? []), workspaceId]\r\n const next = { ...latest.manual, assignments: { ...latest.manual.assignments, [workspaceId]: categoryKey }, workspaceOrder }\r\n setManualSaving(true)\r\n try {\r\n await persistManual(next)\r\n actions.setCategoryExpanded(categoryKey, true)\r\n } finally {\r\n setManualSaving(false)\r\n }\r\n }\r\n startSession(workspace.workspaceId)\r\n } catch (reason) {\r\n const message = reason instanceof Error ? reason.message : String(reason)\r\n setAddError(message)\r\n setAddErrorOpen(true)\r\n } finally {\r\n setAdding(false)\r\n }\r\n }\r\n\r\n // Workspace rename dialog.\r\n const [renameTarget, setRenameTarget] = useState<{ workspaceId: WorkspaceId; currentTitle: string } | null>(null)\r\n const [renameDraft, setRenameDraft] = useState('')\r\n const [renaming, setRenaming] = useState(false)\r\n const [renameError, setRenameError] = useState(null)\r\n const renameTrimmed = renameDraft.trim()\r\n const renameDuplicate = renameTarget !== null && renameTrimmed !== '' && renameTrimmed !== renameTarget.currentTitle\r\n && workspaces.some(w => w.title === renameTrimmed)\r\n const renameBlocked = renaming || renameTrimmed === '' || renameTarget === null\r\n || renameTrimmed === renameTarget.currentTitle || renameDuplicate\r\n const confirmRename = () => {\r\n if (renameBlocked || renameTarget === null) return\r\n setRenaming(true)\r\n setRenameError(null)\r\n renameWorkspace(renameTarget.workspaceId, renameTrimmed).then(() => {\r\n setRenaming(false)\r\n setRenameTarget(null)\r\n }).catch((reason: unknown) => {\r\n setRenaming(false)\r\n setRenameError(reason instanceof Error ? reason.message : String(reason))\r\n })\r\n }\r\n\r\n // Workspace delete dialog.\r\n const [deleteTarget, setDeleteTarget] = useState<{ workspaceId: WorkspaceId; title: string } | null>(null)\r\n const [deleting, setDeleting] = useState(false)\r\n const [deleteError, setDeleteError] = useState(null)\r\n const confirmDelete = () => {\r\n if (deleting || deleteTarget === null) return\r\n setDeleting(true)\r\n setDeleteError(null)\r\n deleteWorkspace(deleteTarget.workspaceId).then(() => {\r\n setDeleting(false)\r\n setDeleteTarget(null)\r\n }).catch((reason: unknown) => {\r\n setDeleting(false)\r\n setDeleteError(reason instanceof Error ? reason.message : String(reason))\r\n })\r\n }\r\n\r\n // Session rename dialog.\r\n const [sessionRenameTarget, setSessionRenameTarget] = useState<{ sessionId: SessionId; currentTitle: string } | null>(null)\r\n const [sessionRenameDraft, setSessionRenameDraft] = useState('')\r\n const [sessionRenaming, setSessionRenaming] = useState(false)\r\n const [sessionRenameError, setSessionRenameError] = useState(null)\r\n const sessionRenameTrimmed = sessionRenameDraft.trim()\r\n const sessionRenameBlocked = sessionRenaming || sessionRenameTrimmed === '' || sessionRenameTarget === null\r\n const confirmSessionRename = () => {\r\n if (sessionRenameBlocked || sessionRenameTarget === null) return\r\n setSessionRenaming(true)\r\n setSessionRenameError(null)\r\n renameSession(sessionRenameTarget.sessionId, sessionRenameTrimmed).then(() => {\r\n setSessionRenaming(false)\r\n setSessionRenameTarget(null)\r\n }).catch((reason: unknown) => {\r\n setSessionRenaming(false)\r\n setSessionRenameError(reason instanceof Error ? reason.message : String(reason))\r\n })\r\n }\r\n const onSessionRename = (sessionId: SessionId, currentTitle: string) => {\r\n setSessionRenameTarget({ sessionId, currentTitle })\r\n setSessionRenameDraft(currentTitle)\r\n setSessionRenameError(null)\r\n }\r\n\r\n // The strip is a child of this component (rendered through a DOM portal), so\r\n // it shares this fiber's props directly: renames call the dialog owner here,\r\n // and activation goes through the same navigation verb the sidebar rows use.\r\n const activateTab = (sessionId: SessionId) => { open(sessionId) }\r\n\r\n const onSessionArchive = (sessionId: SessionId) => {\r\n archiveSession(sessionId).catch((reason: unknown) => {\r\n console.warn('session archive rejected:', reason)\r\n })\r\n }\r\n\r\n // \"Open in folder\": the host half of the official open-in-app plugin resolves\r\n // which applications it can launch; the project row then just posts the\r\n // project directory to that host's launch route. One availability read per\r\n // mount —a host without the capability (or a refused read) leaves\r\n // `folderApp` undefined, which drops the menu entry rather than failing.\r\n const [folderApp, setFolderApp] = useState(undefined)\r\n const [folderError, setFolderError] = useState<{ id: number; text: string } | null>(null)\r\n useEffect(() => {\r\n const controller = new AbortController()\r\n fetchOpenInApps(controller.signal).then((apps) => {\r\n if (controller.signal.aborted) return\r\n setFolderApp(folderAppId(apps))\r\n }).catch(() => { /* no capability: the row simply offers no folder entry */ })\r\n return () => { controller.abort() }\r\n }, [])\r\n\r\n const openInFolder = folderApp === undefined\r\n ? undefined\r\n : (workspaceId: WorkspaceId): void => {\r\n const workspace = workspaces.find(w => w.workspaceId === workspaceId)\r\n if (workspace === undefined) return\r\n openPathInApp(folderApp, workspace.path).catch((reason: unknown) => {\r\n const detail = reason instanceof Error ? reason.message : String(reason)\r\n setFolderError({ id: Date.now(), text: `${t('workspace.openInFolderError')}: ${detail}` })\r\n })\r\n }\r\n\r\n // ---- Folder overlay editing -------------------------------------------------\r\n\r\n const notifyFolder = (text: string): void => {\r\n setFolderError({ id: Date.now(), text })\r\n }\r\n\r\n /**\r\n * Serialize folder saves. A save always sends the LAST confirmed revision and\r\n * the latest pending document; a newer edit made while a request is in flight\r\n * is coalesced and sent only after the previous result settles. This keeps an\r\n * older response from ever overwriting a newer state.\r\n */\r\n const drainFolders = async (): Promise => {\r\n if (foldersSavingRef.current) return\r\n foldersSavingRef.current = true\r\n try {\r\n while (foldersPendingRef.current !== null) {\r\n const draft = foldersPendingRef.current\r\n foldersPendingRef.current = null\r\n const payload: FoldersDocument = {\r\n ...draft,\r\n revision: foldersConfirmedRef.current.revision ?? 0,\r\n }\r\n try {\r\n const stored = await saveFolders(payload)\r\n foldersConfirmedRef.current = stored\r\n setFoldersError(null)\r\n if (foldersPendingRef.current === null) setFoldersDoc(stored)\r\n } catch (reason) {\r\n if (reason instanceof FoldersConflictError) {\r\n // Keep the server state visible AND remember the user's unsaved\r\n // draft; never silently overwrite the draft or claim success.\r\n foldersConfirmedRef.current = reason.current\r\n setFoldersDoc(reason.current)\r\n setFoldersConflict({ current: reason.current, draft: reason.attempted ?? draft })\r\n notifyFolder(t('folder.conflict'))\r\n } else {\r\n const detail = reason instanceof Error ? reason.message : String(reason)\r\n setFoldersDoc(foldersConfirmedRef.current)\r\n notifyFolder(`${t('folder.saveError')}: ${detail}`)\r\n }\r\n // A failed base makes every queued follow-up stale; stop here and let\r\n // the user retry the draft explicitly.\r\n foldersPendingRef.current = null\r\n break\r\n }\r\n }\r\n } finally {\r\n foldersSavingRef.current = false\r\n if (foldersPendingRef.current !== null) void drainFolders()\r\n }\r\n }\r\n\r\n const persistFolders = (next: FoldersDocument): void => {\r\n if (foldersPhase !== 'ready') {\r\n notifyFolder(t('folder.notReady'))\r\n return\r\n }\r\n foldersPendingRef.current = next\r\n setFoldersDoc(next)\r\n void drainFolders()\r\n }\r\n\r\n const retryFolderConflict = (): void => {\r\n if (foldersConflict === null) return\r\n const draft = foldersConflict.draft\r\n setFoldersConflict(null)\r\n persistFolders({ ...draft, revision: foldersConflict.current.revision ?? 0 })\r\n }\r\n\r\n /**\r\n * Save the manual overlay and adopt the host's stored version (revision\r\n * bumped). On a conflict the host's current overlay is adopted instead, so\r\n * the tree resyncs to what is actually stored, and the caller still sees a\r\n * (localized) rejection it can surface in its own error area.\r\n */\r\n const persistManual = async (next: ManualGroups): Promise => {\r\n try {\r\n const stored = await saveManualOverlay(next)\r\n setManual(normalizeManual(stored))\r\n return stored\r\n } catch (reason) {\r\n if (reason instanceof ManualConflictError) {\r\n setManual(normalizeManual(reason.current))\r\n throw new ManualConflictError(reason.current, t('manual.conflict'))\r\n }\r\n throw reason\r\n }\r\n }\r\n\r\n /** Write one workspace's entry; an entry with nothing attached removes the key. */\r\n const writeFolderEntry = (workspaceId: WorkspaceId, entry: WorkspaceFolderEntry): void => {\r\n const next: Record = { ...foldersDoc.workspaces }\r\n const key = workspaceId as string\r\n if (isEmptyEntry(entry)) delete next[key]\r\n else next[key] = entry\r\n persistFolders({ version: 1, revision: foldersDoc.revision ?? 0, workspaces: next })\r\n }\r\n\r\n const toggleFolder = (workspaceId: WorkspaceId, path: string): void => {\r\n const key = folderKey(workspaceId, path)\r\n setCollapsedFolderKeys(keys => (keys.includes(key) ? keys.filter(k => k !== key) : [...keys, key]))\r\n }\r\n\r\n const isRemoteWorkspace = (workspace: WorkspaceView): boolean => (\r\n foldersRemoteBase !== null && isUnderBase(workspace.path, foldersRemoteBase)\r\n )\r\n\r\n // The dialog browses the cloud folder's own remote root so a picked subdirectory\r\n // becomes a folder of THIS project instead of a second mirror of the same tree.\r\n const [foldersOwnerRemote, setFoldersOwnerRemote] = useState(null)\r\n const foldersOwnerRequest = useRef('')\r\n\r\n /** Open the folder dialog and learn the owner's remote root (cloud owners only). */\r\n const openFoldersFor = (workspaceId: string): void => {\r\n foldersOwnerRequest.current = workspaceId\r\n setFoldersTarget(workspaceId as WorkspaceId)\r\n setFoldersOwnerRemote(null)\r\n const workspace = workspaces.find(row => (row.workspaceId as string) === workspaceId)\r\n if (workspace === undefined || !isRemoteWorkspace(workspace) || foldersRemoteBase === null) return\r\n void remoteFolderWorkspace(workspace.path, foldersRemoteBase).then(\r\n (record) => {\r\n if (foldersOwnerRequest.current !== workspaceId) return\r\n setFoldersOwnerRemote(record === null ? null : record.remotePath)\r\n },\r\n () => { if (foldersOwnerRequest.current === workspaceId) setFoldersOwnerRemote(null) },\r\n )\r\n }\r\n\r\n /** The overlay record for a picked path that the SSH plugin already mirrors. */\r\n const remoteMember = (target: RemoteFolderWorkspace): FolderMember => ({\r\n path: target.mirrorPath,\r\n workspaceId: target.workspaceId,\r\n kind: 'remote',\r\n remotePath: target.remotePath,\r\n profileId: target.profileId,\r\n ...(target.recordId === '' ? {} : { recordId: target.recordId }),\r\n })\r\n\r\n // SSH connections for the dialog's cloud section: read when the dialog opens,\r\n // `null` when the remote-ssh plugin is absent (no cloud folders then), and an\r\n // empty list when it is present but has no connection configured yet.\r\n const [remoteProfiles, setRemoteProfiles] = useState(null)\r\n const [remoteProfilesError, setRemoteProfilesError] = useState(null)\r\n useEffect(() => {\r\n if (foldersTarget === null) return\r\n let cancelled = false\r\n setRemoteProfilesError(null)\r\n void listRemoteProfiles().then((profiles) => {\r\n if (!cancelled) setRemoteProfiles(profiles)\r\n }).catch((reason: unknown) => {\r\n if (cancelled) return\r\n setRemoteProfiles(null)\r\n setRemoteProfilesError(reason instanceof Error ? reason.message : String(reason))\r\n })\r\n return () => { cancelled = true }\r\n }, [foldersTarget])\r\n\r\n /**\r\n * Resolve the member workspace that owns one folder living OUTSIDE this\r\n * project's own tree. DSH roots every session's file tools at its workspace,\r\n * so an outside folder is only readable by the agent once it is a workspace of\r\n * its own. A registered workspace already sitting on that exact path is reused\r\n * instead of forked; one that owns folders of its own is refused, because\r\n * nesting a folder tree inside another would hide the inner folders' sessions.\r\n */\r\n const memberWorkspaceFor = async (workspaceId: WorkspaceId, path: string): Promise => {\r\n const existing = workspaces.find(w => samePath(w.path, path) && w.workspaceId !== workspaceId)\r\n if (existing !== undefined) {\r\n if (!isEmptyEntry(entryFor(foldersDoc, existing.workspaceId as string))) {\r\n throw new Error(t('folder.memberNested'))\r\n }\r\n return { path, workspaceId: existing.workspaceId as string, kind: 'local' }\r\n }\r\n const created = await createWorkspace({ path })\r\n return { path, workspaceId: created.workspaceId as string, kind: 'local' }\r\n }\r\n\r\n /**\r\n * Whether an entry already holds a member backed by this workspace, or a\r\n * remote member naming the same connection + remote directory. Both add\r\n * flows (pick a local directory, create a cloud folder) run this check —\r\n * the remote-ssh side now reuses same-directory records, so the member\r\n * layer must refuse the second row itself.\r\n */\r\n const hasMemberClash = (\r\n entry: WorkspaceFolderEntry | undefined,\r\n candidate: { workspaceId: string; profileId?: string; remotePath?: string },\r\n ): boolean => memberByWorkspaceId(entry, candidate.workspaceId) !== undefined\r\n || (candidate.profileId !== undefined && candidate.remotePath !== undefined\r\n && findRemoteMember(entry, candidate.profileId, candidate.remotePath) !== undefined)\r\n\r\n const addFolderTo = async (workspaceId: WorkspaceId): Promise => {\r\n if (foldersBusy) return\r\n const workspace = workspaces.find(w => w.workspaceId === workspaceId)\r\n if (workspace === undefined) return\r\n setFoldersBusy(true)\r\n try {\r\n if (foldersRemoteBase === null) throw new Error(t('folder.notReady'))\r\n const path = await pickDirectory()\r\n if (path === null) return // cancelled\r\n const entry = entryFor(foldersDoc, workspaceId as string)\r\n if (effectiveFolders(workspace.path, entry).some(folder => samePath(folder, path))) {\r\n notifyFolder(t('folder.duplicate'))\r\n return\r\n }\r\n // The picked directory may BE a cloud folder (a registered SSH mirror): it\r\n // then joins the project as a cloud member, whichever side the project\r\n // itself lives on. A mirror subdirectory has no workspace of its own, so\r\n // that one still needs the subpath field instead.\r\n const target = await remoteFolderWorkspace(path, foldersRemoteBase)\r\n if (target !== null) {\r\n if (samePath(target.mirrorPath, path) && target.workspaceId !== ''\r\n && target.workspaceId !== (workspaceId as string)) {\r\n if (hasMemberClash(entry, target)) {\r\n notifyFolder(t('folder.duplicate'))\r\n return\r\n }\r\n writeFolderEntry(workspaceId, addMember(entry, remoteMember(target)))\r\n return\r\n }\r\n notifyFolder(t('folder.remoteNeedsSubpath'))\r\n return\r\n }\r\n // A folder outside this project's own tree becomes a member: its own\r\n // workspace is what makes it reachable for the agent, and a session started\r\n // there then runs natively with no cross-workspace cwd. Folders along the\r\n // tree stay plain — one cheap cwd gesture, grouped under this project.\r\n if (!isUnderBase(path, workspace.path)) {\r\n writeFolderEntry(workspaceId, addMember(entry, await memberWorkspaceFor(workspaceId, path)))\r\n return\r\n }\r\n writeFolderEntry(workspaceId, addFolder(entry, path))\r\n } catch (reason) {\r\n const detail = reason instanceof Error ? reason.message : String(reason)\r\n notifyFolder(`${t('folder.addError')}: ${detail}`)\r\n } finally {\r\n setFoldersBusy(false)\r\n }\r\n }\r\n\r\n /**\r\n * \"New cloud folder\" in the folder dialog: the SSH plugin creates the mirror,\r\n * registers a real workspace for it and returns both ids, so the folder joins\r\n * this project as a member and its own sidebar row stays hidden.\r\n */\r\n const addRemoteFolderTo = async (\r\n workspaceId: WorkspaceId, profileId: string, remotePath: string,\r\n ): Promise => {\r\n if (foldersBusy) return false\r\n const owner = workspaces.find(w => w.workspaceId === workspaceId)\r\n if (owner === undefined) return false\r\n setFoldersBusy(true)\r\n try {\r\n const created = await createRemoteFolder(profileId, remotePath)\r\n const entry = entryFor(foldersDoc, workspaceId as string)\r\n // Duplicate defenses. The first two compare identities the SSH plugin\r\n // returns; they only hold when it reuses the existing record for the\r\n // same remote directory (its host canonicalizes the path at\r\n // registration). The member checks below do not depend on that: a\r\n // folder for the same connection + remote directory, or backed by the\r\n // same workspace, is a duplicate no matter which mirror it points at.\r\n if (created.workspaceId === (workspaceId as string)) throw new Error(t('folder.duplicate'))\r\n if (hasMemberClash(entry, created)) throw new Error(t('folder.duplicate'))\r\n if (effectiveFolders(owner.path, entry).some(folder => samePath(folder, created.path))) {\r\n throw new Error(t('folder.duplicate'))\r\n }\r\n const member: FolderMember = {\r\n path: created.path,\r\n workspaceId: created.workspaceId,\r\n kind: 'remote',\r\n remotePath: created.remotePath,\r\n profileId: created.profileId,\r\n title: created.title,\r\n ...(created.recordId === '' ? {} : { recordId: created.recordId }),\r\n }\r\n const next: FoldersDocument = {\r\n version: 1,\r\n revision: foldersDoc.revision ?? 0,\r\n workspaces: { ...foldersDoc.workspaces, [workspaceId]: addMember(entry, member) },\r\n }\r\n // Like the subpath field: report success only once the overlay is durable.\r\n setFoldersDoc(await saveFolders(next))\r\n return true\r\n } catch (reason) {\r\n if (reason instanceof FoldersConflictError) setFoldersDoc(reason.current)\r\n notifyFolder(`${t('folder.addError')}: ${reason instanceof Error ? reason.message : String(reason)}`)\r\n return false\r\n } finally {\r\n setFoldersBusy(false)\r\n }\r\n }\r\n\r\n /** The same gesture routes through native local or SSH-owned mkdir APIs. */\r\n const addSubpathTo = async (workspaceId: WorkspaceId, name: string): Promise => {\r\n if (foldersBusy) return false\r\n const workspace = workspaces.find(w => w.workspaceId === workspaceId)\r\n if (workspace === undefined) return false\r\n setFoldersBusy(true)\r\n try {\r\n if (foldersRemoteBase === null) throw new Error(t('folder.notReady'))\r\n const pending = createdFolderPendingSave.current\r\n const created = pending !== null && pending.workspaceId === workspaceId && pending.name === name\r\n ? pending\r\n : await createWorkspaceDirectory(workspace.path, name, foldersRemoteBase, createDirectory)\r\n createdFolderPendingSave.current = { workspaceId, name, path: created.path }\r\n const entry = addFolder(entryFor(foldersDoc, workspaceId as string), created.path)\r\n const next: FoldersDocument = {\r\n version: 1,\r\n revision: foldersDoc.revision ?? 0,\r\n workspaces: { ...foldersDoc.workspaces, [workspaceId]: entry },\r\n }\r\n // Do not report success or clear the input until both operations succeed.\r\n // A failed overlay save does NOT delete the newly created user directory.\r\n setFoldersDoc(await saveFolders(next))\r\n createdFolderPendingSave.current = null\r\n return true\r\n } catch (reason) {\r\n if (reason instanceof FoldersConflictError) setFoldersDoc(reason.current)\r\n notifyFolder(`${t('folder.addError')}: ${reason instanceof Error ? reason.message : String(reason)}`)\r\n return false\r\n } finally {\r\n setFoldersBusy(false)\r\n }\r\n }\r\n\r\n const setFolderRoot = (workspaceId: WorkspaceId, path: string): void => {\r\n writeFolderEntry(workspaceId, setRoot(entryFor(foldersDoc, workspaceId as string), path))\r\n }\r\n\r\n /**\r\n * Remove one folder from a project. With `deleteRecord` set — only the\r\n * folder dialog offers it, behind an explicit confirm — a remote member's\r\n * backing record is deleted through the SSH plugin as well (record, native\r\n * workspace and mirror go away, sessions included); without it the removal\r\n * is overlay-only and the workspace survives as its own project. If the\r\n * record deletion fails, the member stays so the user can retry.\r\n */\r\n const removeFolderFrom = (workspaceId: WorkspaceId, path: string, deleteRecord = false): void => {\r\n const entry = entryFor(foldersDoc, workspaceId as string)\r\n const member = memberOf(entry, path)\r\n if (deleteRecord && member?.kind === 'remote' && member.recordId !== undefined && member.recordId !== '') {\r\n const recordId = member.recordId\r\n void (async () => {\r\n try {\r\n await deleteRemoteWorkspaceRecord(recordId)\r\n } catch (reason) {\r\n const detail = reason instanceof Error ? reason.message : String(reason)\r\n notifyFolder(`${t('folder.removeError')}: ${detail}`)\r\n return\r\n }\r\n writeFolderEntry(workspaceId, removeFolder(entry, path))\r\n })()\r\n return\r\n }\r\n writeFolderEntry(workspaceId, removeFolder(entry, path))\r\n }\r\n\r\n /**\r\n * \"New session here\": a member folder has its OWN workspace, so the session is\r\n * created there with no cwd override at all —that is what makes a cloud\r\n * folder and a local folder behave identically under one project row. A plain\r\n * extra folder keeps the cwd gesture. The base folder keeps the platform's own\r\n * gesture instead, because that one reuses the blank session it already opened;\r\n * creating a fresh Session on every click would pile up empty sessions. One\r\n * creation in flight at a time; a rejection surfaces the failure and creates\r\n * nothing else.\r\n */\r\n const startSessionInFolder = (workspaceId: WorkspaceId, path: string, isBase: boolean): void => {\r\n if (isBase) {\r\n startSession(workspaceId)\r\n return\r\n }\r\n if (creatingSessionIn !== null) return\r\n setCreatingSessionIn(folderKey(workspaceId, path))\r\n void (async () => {\r\n const workspace = workspaces.find(w => w.workspaceId === workspaceId)\r\n if (!workspace) throw new Error('Workspace not found')\r\n const member = memberOf(entryFor(foldersDoc, workspaceId as string), path)\r\n if (member !== undefined) {\r\n // The member's own workspace is what runs the session; if the user deleted\r\n // it outside this overlay, say so instead of failing inside the platform.\r\n if (!workspaces.some(w => w.workspaceId === member.workspaceId)) {\r\n throw new Error(t('folder.memberMissing'))\r\n }\r\n await createSessionIn(member.workspaceId as WorkspaceId)\r\n return\r\n }\r\n if (foldersRemoteBase === null) throw new Error(t('folder.notReady'))\r\n // Legacy overlay: a folder recorded before out-of-tree folders became\r\n // members has no workspace of its own, and a cwd override cannot escape\r\n // this project's root — so the agent would open the folder and see nothing.\r\n // Register the member now and run the session inside it.\r\n if (!isUnderBase(path, workspace.path)) {\r\n const entry = entryFor(foldersDoc, workspaceId as string)\r\n const attached = await memberWorkspaceFor(workspaceId, path)\r\n writeFolderEntry(workspaceId, addMember(entry, attached))\r\n await createSessionIn(attached.workspaceId as WorkspaceId)\r\n return\r\n }\r\n const remote = await remoteFolderWorkspace(workspace.path, foldersRemoteBase)\r\n const targetRemote = await remoteFolderWorkspace(path, foldersRemoteBase)\r\n if (remote || targetRemote) throw new Error(t('folder.remoteSessionUnsupported'))\r\n await createSessionIn(workspaceId, path)\r\n })().catch((reason: unknown) => {\r\n const detail = reason instanceof Error ? reason.message : String(reason)\r\n notifyFolder(`${t('folder.sessionError')}: ${detail}`)\r\n }).finally(() => {\r\n setCreatingSessionIn(null)\r\n })\r\n }\r\n\r\n /** A project row's plus button —starts in that workspace's root folder. */\r\n const startSessionAtRoot = (workspaceId?: WorkspaceId): void => {\r\n const workspace = workspaceId === undefined ? undefined : workspaces.find(w => w.workspaceId === workspaceId)\r\n if (workspace === undefined) {\r\n startSession(workspaceId)\r\n return\r\n }\r\n const root = rootOf(workspace.path, entryFor(foldersDoc, workspaceId as string))\r\n startSessionInFolder(workspaceId as WorkspaceId, root, samePath(root, workspace.path))\r\n }\r\n\r\n // Absent when the host offers no folder application: folder rows then drop\r\n // their \"open folder\" entry instead of failing at the click.\r\n const openFolderPath = folderApp === undefined\r\n ? undefined\r\n : (path: string): void => {\r\n openPathInApp(folderApp, path).catch((reason: unknown) => {\r\n const detail = reason instanceof Error ? reason.message : String(reason)\r\n notifyFolder(`${t('workspace.openInFolderError')}: ${detail}`)\r\n })\r\n }\r\n\r\n // ---- Runtime group management ----------------------------------------------\r\n\r\n const [groupDialog, setGroupDialog] = useState(null)\r\n const [groupDraft, setGroupDraft] = useState('')\r\n const [groupError, setGroupError] = useState(null)\r\n const [groupBusy, setGroupBusy] = useState(false)\r\n const [groupDeleteTarget, setGroupDeleteTarget] = useState(null)\r\n const [groupDeleting, setGroupDeleting] = useState(false)\r\n const [groupDeleteError, setGroupDeleteError] = useState(null)\r\n\r\n // Appearance dialog (color / icon / pin) for one group display key. Every\r\n // control applies immediately (optimistic merge + save); there is no OK, so\r\n // `appearanceTarget` also doubles as the open flag.\r\n const [appearanceTarget, setAppearanceTarget] = useState(null)\r\n const [appearanceDraft, setAppearanceDraft] = useState({})\r\n const [appearanceError, setAppearanceError] = useState(null)\r\n\r\n const takenNames = useMemo(() => takenCategoryNames(config, manual), [config, manual])\r\n\r\n const groupTrimmed = groupDraft.trim()\r\n const groupNameIssue = groupDialog !== null && groupTrimmed !== ''\r\n ? (groupTrimmed === UNCATEGORIZED_LABEL\r\n ? t('group.nameReserved')\r\n : (groupDialog.mode === 'rename' && groupTrimmed === groupDialog.from)\r\n ? null\r\n : takenNames.has(groupTrimmed) ? t('group.nameDuplicate') : null)\r\n : null\r\n const groupBlocked = groupBusy || groupTrimmed === '' || groupNameIssue !== null\r\n || (groupDialog !== null && groupDialog.mode === 'rename' && groupTrimmed === groupDialog.from)\r\n\r\n const confirmGroupDialog = () => {\r\n if (groupBlocked || groupDialog === null) return\r\n const name = groupTrimmed\r\n const from = groupDialog.mode === 'rename' ? groupDialog.from : undefined\r\n const renaming = groupDialog.mode === 'rename' && from !== name\r\n\r\n let next: NormalizedManual\r\n if (groupDialog.mode === 'create') {\r\n next = { ...manual, categories: [...manual.categories, name] }\r\n } else {\r\n // Rename: rule groups ride the `renamed` map, manual groups the list;\r\n // every reference (assignments / workspaceOrder / categoryOrder) follows.\r\n const originalRule = from !== undefined ? originalRuleNameForDisplay(config.categories, manual, from) : undefined\r\n next = {\r\n ...manual,\r\n ...(originalRule !== undefined\r\n ? { renamed: { ...manual.renamed, [originalRule]: name } }\r\n : { categories: manual.categories.map(c => c === from ? name : c) }),\r\n assignments: Object.fromEntries(\r\n Object.entries(manual.assignments).map(([id, category]): [string, string | null] => [id, category === from ? name : category]),\r\n ),\r\n workspaceOrder: Object.fromEntries(\r\n Object.entries(manual.workspaceOrder).map(([key, ids]): [string, string[]] => [key === from ? name : key, ids]),\r\n ),\r\n categoryOrder: manual.categoryOrder.map(key => key === from ? name : key),\r\n // Appearance is keyed by display name too: move the entry instead of\r\n // leaving the colour/icon/pin behind under the old name.\r\n appearance: from === undefined || from === name\r\n ? manual.appearance\r\n : Object.fromEntries(\r\n Object.entries(manual.appearance).map(([key, value]): [string, CategoryAppearance] => [key === from ? name : key, value]),\r\n ),\r\n }\r\n }\r\n\r\n setGroupBusy(true)\r\n setGroupError(null)\r\n persistManual(next).then(() => {\r\n setManualError(null)\r\n setGroupBusy(false)\r\n setGroupDialog(null)\r\n setGroupDraft('')\r\n // Keep the renamed group open (its old expansion key is dropped by retainKeys).\r\n if (renaming) actions.setCategoryExpanded(name, true)\r\n }).catch((reason: unknown) => {\r\n setGroupBusy(false)\r\n setGroupError(reason instanceof Error ? reason.message : String(reason))\r\n })\r\n }\r\n\r\n const confirmGroupDelete = () => {\r\n if (groupDeleting || groupDeleteTarget === null) return\r\n const name = groupDeleteTarget\r\n const originalRule = originalRuleNameForDisplay(config.categories, manual, name)\r\n\r\n // Every project currently in the group goes to the uncategorized bucket (forced, not rule-\r\n // reclassified), regardless of how it landed there.\r\n const assignments = { ...manual.assignments }\r\n for (const workspace of workspaces) {\r\n if (resolveCategory(config, manual, workspace.workspaceId, workspace.path, workspace.title) === name) {\r\n assignments[workspace.workspaceId] = null\r\n }\r\n }\r\n const workspaceOrder = Object.fromEntries(\r\n Object.entries(manual.workspaceOrder).filter(([key]) => key !== name),\r\n )\r\n const next: NormalizedManual = {\r\n ...manual,\r\n assignments,\r\n workspaceOrder,\r\n categoryOrder: manual.categoryOrder.filter(key => key !== name),\r\n // Drop the presentation entry with the group itself (a dangling key would\r\n // silently re-attach if a new group ever reused the name).\r\n appearance: Object.fromEntries(\r\n Object.entries(manual.appearance).filter(([key]) => key !== name),\r\n ),\r\n ...(originalRule !== undefined\r\n ? {\r\n renamed: Object.fromEntries(Object.entries(manual.renamed).filter(([key]) => key !== originalRule)),\r\n hidden: [...manual.hidden, originalRule],\r\n }\r\n : { categories: manual.categories.filter(c => c !== name) }),\r\n }\r\n\r\n setGroupDeleting(true)\r\n setGroupDeleteError(null)\r\n persistManual(next).then(() => {\r\n setManualError(null)\r\n setGroupDeleting(false)\r\n setGroupDeleteTarget(null)\r\n }).catch((reason: unknown) => {\r\n setGroupDeleting(false)\r\n setGroupDeleteError(reason instanceof Error ? reason.message : String(reason))\r\n })\r\n }\r\n\r\n // ---- Drag & drop (move/reorder workspaces, reorder groups) ------------------\r\n\r\n const [dragIndicator, setDragIndicator] = useState(null)\r\n\r\n // Expansion state taken at dragstart; dragend restores it so the folding\r\n // caused by a drag is always undone afterwards.\r\n const expansionSnapshot = useRef<{ categories: Record; workspaces: Record } | null>(null)\r\n // Live expansion state for the dragend restore (the document-level listener\r\n // is registered once, so it must read current values through a ref).\r\n const liveExpansionRef = useRef({ categoryExpansion, workspaceExpansion, actions })\r\n liveExpansionRef.current = { categoryExpansion, workspaceExpansion, actions }\r\n\r\n // Cancel any stale indicator when a drag ends outside a row (or is aborted),\r\n // and restore the expansion snapshot taken at dragstart.\r\n useEffect(() => {\r\n const clear = () => {\r\n setDragIndicator(null)\r\n setDragging(null)\r\n const snapshot = expansionSnapshot.current\r\n if (snapshot === null) return\r\n expansionSnapshot.current = null\r\n const { categoryExpansion: currentCategories, workspaceExpansion: currentWorkspaces, actions: currentActions } = liveExpansionRef.current\r\n for (const [key, value] of Object.entries(snapshot.categories)) {\r\n if (currentCategories[key] !== value) currentActions.setCategoryExpanded(key, value)\r\n }\r\n for (const [key, value] of Object.entries(snapshot.workspaces)) {\r\n if (currentWorkspaces[key] !== value) currentActions.setWorkspaceExpanded(key, value)\r\n }\r\n }\r\n document.addEventListener('dragend', clear)\r\n return () => { document.removeEventListener('dragend', clear) }\r\n }, [])\r\n\r\n /** Move a workspace into a category (or reorder inside it when `beforeWorkspaceId`/`afterWorkspaceId`). */\r\n const moveWorkspaceTo = async (workspaceId: string, categoryKey: string, beforeWorkspaceId?: string, afterWorkspaceId?: string): Promise => {\r\n if (manualSaving) return\r\n const workspace = workspaces.find(w => w.workspaceId === workspaceId)\r\n if (workspace === undefined) return\r\n setManualSaving(true)\r\n try {\r\n let next: NormalizedManual\r\n if (categoryKey === UNCATEGORIZED_KEY) {\r\n // Move to the TOP LEVEL: force ungrouped (null) and drop from every\r\n // group's order list, while recording the position inside the ordered\r\n // top-level list (`workspaceOrder[TOP_LEVEL_ORDER_KEY]`).\r\n const assignments = { ...manual.assignments, [workspaceId]: null }\r\n const workspaceOrder: Record = {}\r\n for (const [key, ids] of Object.entries(manual.workspaceOrder)) {\r\n if (key === TOP_LEVEL_ORDER_KEY) continue\r\n workspaceOrder[key] = ids.filter(id => id !== workspaceId)\r\n }\r\n const topLevelIds = workspaces\r\n .filter(w => w.workspaceId !== workspaceId && resolveCategory(config, manual, w.workspaceId, w.path, w.title) === undefined)\r\n .map(w => w.workspaceId as string)\r\n workspaceOrder[TOP_LEVEL_ORDER_KEY] = afterWorkspaceId !== undefined\r\n ? moveAfter(topLevelIds, workspaceId, afterWorkspaceId)\r\n : moveBefore(topLevelIds, workspaceId, beforeWorkspaceId)\r\n next = { ...manual, assignments, workspaceOrder }\r\n } else {\r\n const currentKey = resolveCategory(config, manual, workspaceId, workspace.path, workspace.title)\r\n const movingAcross = currentKey !== categoryKey\r\n const assignments = movingAcross\r\n ? { ...manual.assignments, [workspaceId]: categoryKey }\r\n : manual.assignments\r\n const targetOrder = afterWorkspaceId !== undefined\r\n ? moveAfter(manual.workspaceOrder[categoryKey] ?? [], workspaceId, afterWorkspaceId)\r\n : moveBefore(manual.workspaceOrder[categoryKey] ?? [], workspaceId, beforeWorkspaceId)\r\n const workspaceOrder = { ...manual.workspaceOrder, [categoryKey]: targetOrder }\r\n if (movingAcross && currentKey !== undefined && workspaceOrder[currentKey] !== undefined) {\r\n workspaceOrder[currentKey] = workspaceOrder[currentKey]!.filter(id => id !== workspaceId)\r\n }\r\n next = { ...manual, assignments, workspaceOrder }\r\n }\r\n await persistManual(next)\r\n setManualError(null)\r\n if (categoryKey !== UNCATEGORIZED_KEY) actions.setCategoryExpanded(categoryKey, true)\r\n } catch (reason) {\r\n setManualError(reason instanceof Error ? reason.message : String(reason))\r\n } finally {\r\n setManualSaving(false)\r\n }\r\n }\r\n\r\n /** Reorder groups: move `draggedKey` before `beforeKey` or after `afterKey` (no target = append). */\r\n const moveCategory = async (draggedKey: string, beforeKey?: string, afterKey?: string): Promise => {\r\n if (manualSaving || draggedKey === beforeKey || draggedKey === afterKey) return\r\n setManualSaving(true)\r\n try {\r\n const order = displayCategoryKeys(config, manual)\r\n const categoryOrder = afterKey !== undefined\r\n ? moveAfter(order, draggedKey, afterKey)\r\n : moveBefore(order, draggedKey, beforeKey)\r\n // Pinned groups sort before unpinned ones, so a drop across that boundary\r\n // only sticks when the dragged group adopts the neighbour's pin state in\r\n // the SAME write. Otherwise the derived order snaps it back and the drop\r\n // looks broken (spec §7.2).\r\n const neighbourKey = afterKey ?? beforeKey\r\n let appearance = manual.appearance\r\n if (neighbourKey !== undefined && isCategoryPinned(manual, neighbourKey) !== isCategoryPinned(manual, draggedKey)) {\r\n const cleaned = pruneAppearance({\r\n ...(manual.appearance[draggedKey] ?? {}),\r\n pinned: isCategoryPinned(manual, neighbourKey),\r\n })\r\n appearance = { ...manual.appearance }\r\n if (cleaned === undefined) delete appearance[draggedKey]\r\n else appearance[draggedKey] = cleaned\r\n }\r\n const next: NormalizedManual = { ...manual, categoryOrder, appearance }\r\n await persistManual(next)\r\n setManualError(null)\r\n } catch (reason) {\r\n setManualError(reason instanceof Error ? reason.message : String(reason))\r\n } finally {\r\n setManualSaving(false)\r\n }\r\n }\r\n\r\n /**\r\n * Merge a presentation patch for one group and persist the overlay.\r\n * Optimistic: the tree reflects the change immediately and rolls back if the\r\n * host refuses the write (the dialog has no confirm step).\r\n */\r\n const updateCategoryAppearance = async (key: string, patch: CategoryAppearance): Promise => {\r\n if (manualSaving) return\r\n setManualSaving(true)\r\n const previous = manual\r\n try {\r\n const merged: CategoryAppearance = { ...(manual.appearance[key] ?? {}), ...patch }\r\n const appearance = { ...manual.appearance }\r\n const cleaned = pruneAppearance(merged)\r\n if (cleaned === undefined) delete appearance[key]\r\n else appearance[key] = cleaned\r\n const next: NormalizedManual = { ...manual, appearance }\r\n setManual(next)\r\n await persistManual(next)\r\n setManualError(null)\r\n } catch (reason) {\r\n // On a conflict persistManual already adopted the host's current\r\n // overlay; rolling back to `previous` would resurrect the stale copy.\r\n if (!(reason instanceof ManualConflictError)) setManual(previous)\r\n setManualError(reason instanceof Error ? reason.message : String(reason))\r\n } finally {\r\n setManualSaving(false)\r\n }\r\n }\r\n\r\n /** Pin/unpin a group (pinned groups render above the normal order). */\r\n const toggleCategoryPinned = async (key: string): Promise => {\r\n await updateCategoryAppearance(key, { pinned: !isCategoryPinned(manual, key) })\r\n }\r\n\r\n /** Appearance currently shown in the dialog (empty while it is closed). */\r\n const appearanceCurrent: CategoryAppearance = appearanceTarget === null\r\n ? {}\r\n : (manual.appearance[appearanceTarget] ?? {})\r\n\r\n /**\r\n * Commit the custom-icon text field. Invalid input is blocked locally (the\r\n * host would 400 the whole overlay save); an empty field clears the icon.\r\n */\r\n const commitAppearanceIcon = (): void => {\r\n if (appearanceTarget === null) return\r\n const icon = (appearanceDraft.icon ?? '').trim()\r\n if (icon !== '' && !ICON_VALUE_PATTERN.test(icon)) {\r\n setAppearanceError(t('group.iconInvalid'))\r\n return\r\n }\r\n setAppearanceError(null)\r\n /* Blur fires before a neighbouring click and on every dialog close: skip\r\n the PUT when the field still matches the stored value. */\r\n if (icon === (appearanceCurrent.icon ?? '')) return\r\n void updateCategoryAppearance(appearanceTarget, { icon: icon === '' ? undefined : icon })\r\n }\r\n\r\n /**\r\n * Drop on a row. The insertion point is re-derived from the drop event's\r\n * position (top half = before, bottom half = after), so it always matches\r\n * the indicator the user last saw —even when dragover and drop arrive in\r\n * the same tick.\r\n */\r\n const onDropRow = (categoryKey: string, row: DropRowRef) => (event: DragEvent): void => {\r\n event.preventDefault()\r\n // Keep the drop from bubbling to the enclosing top-level area (which is\r\n // also a move-out target): a row drop and the area-drop below it must not\r\n // both fire moveWorkspaceTo.\r\n event.stopPropagation()\r\n setDragIndicator(null)\r\n setDragging(null)\r\n const draggedCategory = event.dataTransfer.getData(DND_CATEGORY_TYPE)\r\n if (draggedCategory !== '') {\r\n // Group reorder: only category rows are targets (project rows fold\r\n // during group drags); before/after follows the drop position.\r\n const rect = (event.currentTarget as HTMLElement).getBoundingClientRect()\r\n const before = event.clientY < rect.top + rect.height / 2\r\n const beforeKey = row.kind === 'category' && before ? row.key : undefined\r\n const afterKey = row.kind === 'category' && !before ? row.key : undefined\r\n void moveCategory(draggedCategory, beforeKey, afterKey)\r\n return\r\n }\r\n const workspaceId = event.dataTransfer.getData(DND_WORKSPACE_TYPE) || event.dataTransfer.getData('text/plain')\r\n if (workspaceId === '') return\r\n if (row.kind === 'topLevel') {\r\n // Top-level row / top-level blank drop = move OUT of any group (forced\r\n // top-level, rules ignored) and set the position inside the ordered\r\n // top-level list. A row drop re-derives before/after from the drop\r\n // position; a bare area drop (key = UNCATEGORIZED_KEY) appends to the end.\r\n const rect = (event.currentTarget as HTMLElement).getBoundingClientRect()\r\n const before = event.clientY < rect.top + rect.height / 2\r\n const specificKey = row.key === UNCATEGORIZED_KEY ? undefined : row.key\r\n void moveWorkspaceTo(workspaceId, UNCATEGORIZED_KEY, before ? specificKey : undefined, !before ? specificKey : undefined)\r\n return\r\n }\r\n // Project move/reorder: a line on a project row = reorder before/after it;\r\n // dropping anywhere else in a category = move into the group (its end).\r\n const rect = (event.currentTarget as HTMLElement).getBoundingClientRect()\r\n const before = event.clientY < rect.top + rect.height / 2\r\n const beforeWsid = row.kind === 'workspace' && before ? row.key : undefined\r\n const afterWsid = row.kind === 'workspace' && !before ? row.key : undefined\r\n void moveWorkspaceTo(workspaceId, categoryKey, beforeWsid, afterWsid)\r\n }\r\n\r\n const onDragOverRow = (row: DropRowRef) => (event: DragEvent): void => {\r\n if (!hasPluginDragType(event.dataTransfer.types)) return\r\n const draggingCategory = Array.from(event.dataTransfer.types as Iterable).includes(DND_CATEGORY_TYPE)\r\n if (draggingCategory && row.kind !== 'category') return // group drags target category rows only\r\n event.preventDefault()\r\n // Keep a row's dragover from bubbling to the enclosing top-level area\r\n // (which would interpret it as the end-of-list landing).\r\n event.stopPropagation()\r\n event.dataTransfer.dropEffect = 'move'\r\n const rect = (event.currentTarget as HTMLElement).getBoundingClientRect()\r\n const before = event.clientY < rect.top + rect.height / 2\r\n if (draggingCategory || row.kind === 'workspace' || row.kind === 'topLevel') {\r\n // Group reorder (line on a category row), project reorder inside a\r\n // group (line on a project row), or top-level reorder (line on a\r\n // top-level project row).\r\n setDragIndicator(prev =>\r\n prev?.mode === 'line' && prev.row.kind === row.kind && prev.row.key === row.key && prev.before === before\r\n ? prev\r\n : { mode: 'line', row, before })\r\n } else {\r\n // Dropping a project INTO a group: whole-row highlight.\r\n setDragIndicator(prev =>\r\n prev?.mode === 'into' && prev.categoryKey === row.key ? prev : { mode: 'into', categoryKey: row.key })\r\n }\r\n }\r\n\r\n const onDragLeaveRow = (event: DragEvent): void => {\r\n if (event.currentTarget.contains(event.relatedTarget as Node | null)) return\r\n setDragIndicator(null)\r\n }\r\n\r\n /**\r\n * Drag over the TOP-LEVEL AREA's blank space (not on a row ???rows stop\r\n * propagation). An insertion line shows the landing spot: empty top level — * a standalone line under the last group; non-empty —a line below the last\r\n * top-level row (end of the list).\r\n */\r\n const onDragOverTopLevelArea = (event: DragEvent): void => {\r\n if (!hasPluginDragType(event.dataTransfer.types)) return\r\n const draggingCategory = Array.from(event.dataTransfer.types as Iterable).includes(DND_CATEGORY_TYPE)\r\n if (draggingCategory) return // group drags never target the top-level area\r\n event.preventDefault()\r\n event.dataTransfer.dropEffect = 'move'\r\n const last = topLevel.length > 0 ? topLevel[topLevel.length - 1] : undefined\r\n if (last !== undefined) {\r\n setDragIndicator(prev =>\r\n prev?.mode === 'line' && prev.row.kind === 'topLevel' && prev.row.key === last.workspaceId && prev.before === false\r\n ? prev\r\n : { mode: 'line', row: { kind: 'topLevel', key: last.workspaceId }, before: false })\r\n } else {\r\n setDragIndicator(prev =>\r\n prev?.mode === 'line' && prev.row.kind === 'topLevel' && prev.row.key === topLevelRef.key && prev.before === false\r\n ? prev\r\n : { mode: 'line', row: topLevelRef, before: false })\r\n }\r\n }\r\n\r\n // While dragging a project, only PROJECT rows fold —every expanded\r\n // workspace collapses (inside groups AND top-level); group rows keep their\r\n // expansion so the user still sees where groups are. dragend restores the\r\n // snapshot taken here.\r\n const onDragStartWorkspace = (_workspaceId: string) => (): void => {\r\n setDragging('workspace')\r\n expansionSnapshot.current = {\r\n categories: { ...categoryExpansion },\r\n workspaces: { ...workspaceExpansion },\r\n }\r\n for (const key of Object.keys(workspaceExpansion)) {\r\n if (workspaceExpansion[key]) actions.setWorkspaceExpanded(key, false)\r\n }\r\n }\r\n\r\n // While dragging a group, only GROUP rows fold (their rows stay visible as\r\n // reorder targets); project rows keep their expansion. dragend restores the\r\n // snapshot taken here.\r\n const onDragStartCategory = (categoryKey: string) => (event: DragEvent): void => {\r\n event.dataTransfer.setData(DND_CATEGORY_TYPE, categoryKey)\r\n event.dataTransfer.effectAllowed = 'move'\r\n setDragging('category')\r\n expansionSnapshot.current = {\r\n categories: { ...categoryExpansion },\r\n workspaces: { ...workspaceExpansion },\r\n }\r\n for (const key of Object.keys(categoryExpansion)) {\r\n if (categoryExpansion[key]) actions.setCategoryExpanded(key, false)\r\n }\r\n }\r\n\r\n // Appearance picker cell: the same glyph button for every icon section\r\n // (common presets, the four research sections, and the emoji row).\r\n const renderIconCell = (id: string, label: string): ReactElement => (\r\n {\r\n setAppearanceDraft({ ...appearanceDraft, icon: id })\r\n setAppearanceError(null)\r\n if (appearanceTarget !== null) void updateCategoryAppearance(appearanceTarget, { icon: id })\r\n }}\r\n >\r\n \r\n \r\n )\r\n\r\n const now = Date.now()\r\n\r\n // Bottom-bar content. Idle: the default workspace with its real subtree.\r\n // Searching: the pruned branch (matched sessions only), or the bare row when\r\n // nothing matched —the results area never repeats this workspace.\r\n const defaultBarNode = defaultWorkspace === undefined\r\n ? undefined\r\n : normalizedQuery === ''\r\n ? defaultWorkspace\r\n : (searchTree?.defaultWorkspace ?? withoutSessions(defaultWorkspace))\r\n\r\n // Idle: the bucketed category as the tree derived it. Searching: the pruned\r\n // bucket (matched rows only), absent when nothing matched.\r\n const dockCategory = normalizedQuery === '' ? dockedCategory : searchDockCategory\r\n\r\n /**\r\n * One category section with every tree callback bound. Extracted so the docked\r\n * bucket is literally the same row/children component as a tree category — * drag, menu, rename, appearance, folder management all behave identically.\r\n */\r\n const categorySectionNode = (category: CategoryNode): JSX.Element => (\r\n { actions.setCategoryExpanded(category.key, !category.expanded) }}\r\n onToggleWorkspace={(key) => { actions.setWorkspaceExpanded(key, !workspaceExpansion[key]) }}\r\n onNewSession={startSessionAtRoot}\r\n onOpen={open}\r\n onToggleFolder={toggleFolder}\r\n onFolderNewSession={startSessionInFolder}\r\n onFolderSetRoot={setFolderRoot}\r\n onFolderRemove={removeFolderFrom}\r\n onOpenFolderPath={openFolderPath}\r\n onManageFolders={openFoldersFor}\r\n creatingFolderKey={creatingSessionIn}\r\n onRenameRequest={(workspaceId, title) => {\r\n setRenameTarget({ workspaceId, currentTitle: title })\r\n setRenameDraft(title)\r\n setRenameError(null)\r\n }}\r\n onDeleteRequest={(workspaceId, title) => {\r\n setDeleteTarget({ workspaceId, title })\r\n setDeleteError(null)\r\n }}\r\n onSessionRename={onSessionRename}\r\n onSessionArchive={onSessionArchive}\r\n onFork={forkSession}\r\n onAddWorkspace={() => { void addWorkspace(category.key) }}\r\n addingWorkspace={adding || manualSaving}\r\n onGroupRename={() => {\r\n setGroupDraft(category.key)\r\n setGroupError(null)\r\n setGroupDialog({ mode: 'rename', from: category.key })\r\n }}\r\n onGroupDelete={() => {\r\n setGroupDeleteTarget(category.key)\r\n setGroupDeleteError(null)\r\n }}\r\n onGroupTogglePin={() => { void toggleCategoryPinned(category.key) }}\r\n onGroupAppearance={() => {\r\n setAppearanceDraft(manual.appearance[category.key] ?? {})\r\n setAppearanceError(null)\r\n setAppearanceTarget(category.key)\r\n }}\r\n animate={dragging === null}\r\n onMoveOut={(workspaceId) => { void moveWorkspaceTo(workspaceId, UNCATEGORIZED_KEY) }}\r\n onOpenInFolder={openInFolder}\r\n canMoveOut={(workspaceId) => {\r\n // The menu \"Move out of group\" is offered for any project that\r\n // currently sits inside a group (rule-classified or manual) — // not just overridden ones. Top-level projects\r\n // (resolveCategory === undefined) don't need it.\r\n const workspace = workspaces.find(w => w.workspaceId === workspaceId)\r\n return workspace !== undefined\r\n && resolveCategory(config, manual, workspace.workspaceId, workspace.path, workspace.title) !== undefined\r\n }}\r\n />\r\n )\r\n\r\n return (\r\n
\r\n {/* The tab strip portals itself into the conversation column's head seat,\r\n so its position here is irrelevant to where it appears; rendering it\r\n from this component is what keeps it on this fiber (and therefore on\r\n this store's single scope) while still reaching the other column. */}\r\n \r\n
\r\n {wide && {t('section.workspaces')}}\r\n {wide && (\r\n
\r\n { setSearchExpanded(true) }}\r\n >\r\n \r\n \r\n {searchExpanded && (\r\n { setQuery(sanitizeSearchQuery(e.target.value)) }}\r\n onKeyDown={(e) => {\r\n if (e.key !== 'Escape') return\r\n setQuery('')\r\n setSearchExpanded(false)\r\n }}\r\n />\r\n )}\r\n {searchExpanded && (\r\n {\r\n e.stopPropagation()\r\n setQuery('')\r\n setSearchExpanded(false)\r\n }}\r\n >\r\n \r\n \r\n )}\r\n
\r\n )}\r\n \r\n {\r\n setGroupDraft('')\r\n setGroupError(null)\r\n setGroupDialog({ mode: 'create' })\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n { void addWorkspace() }}\r\n >\r\n \r\n \r\n \r\n
\r\n\r\n {!wide && (\r\n
\r\n \r\n { setSearchExpanded(true); expandSidebar() }}\r\n >\r\n \r\n \r\n \r\n
\r\n )}\r\n\r\n
\r\n {foldersPhase === 'loading' && (\r\n
{t('folder.loadingState')}
\r\n )}\r\n {foldersPhase === 'error' && (\r\n
\r\n {t('folder.loadError')}:{foldersError}\r\n {' '}\r\n \r\n
\r\n )}\r\n {foldersPhase === 'ready' && foldersError !== null && (\r\n
\r\n {t('folder.refreshError')}:{foldersError}\r\n {' '}\r\n \r\n
\r\n )}\r\n {foldersConflict !== null && (\r\n
\r\n
{t('folder.conflictDetail')}
\r\n
\r\n server revision {foldersConflict.current.revision ?? 0} · draft revision {foldersConflict.draft.revision ?? 0}\r\n
\r\n
\r\n \r\n {' '}\r\n \r\n
\r\n
\r\n )}\r\n {configError !== null && (\r\n
{t('configUnavailable')}
\r\n )}\r\n {manualError !== null && (\r\n
{t('manual.saveError')}: {manualError}
\r\n )}\r\n {foldersPhase !== 'ready' ? null : wide && normalizedQuery !== '' && searchTreeForBody !== undefined && searchMatches !== undefined ? (\r\n \r\n ) : (\r\n /* The branch overlay lives beside the tree, not inside it: it measures\r\n the rows and paints behind them, so it must share their box without\r\n becoming a row itself (which would break role=\"tree\" semantics and\r\n the index-based measurement). */\r\n
\r\n
\r\n {/* The docked bucket and the pinned default workspace sit outside the\r\n tree's scroll area, so a tree holding nothing but them is not \"empty\". */}\r\n {treeGroups.length === 0 && topLevel.length === 0 && !topLevelDropActive && defaultBarNode === undefined && dockCategory === undefined && (\r\n
{workspacePhase === 'ready' ? t('empty.noWorkspaces') : t('empty.none')}
\r\n )}\r\n {treeGroups.map(categorySectionNode)}\r\n {/* Top-level (ungrouped) workspaces, rendered after the group\r\n folders. While dragging a project the whole area is the\r\n move-out landing spot (a line shows the insert position;\r\n an empty top level shows a line under the last group). */}\r\n {(topLevel.length > 0 || topLevelDropActive) && (\r\n { actions.setWorkspaceExpanded(key, !workspaceExpansion[key]) }}\r\n onNewSession={startSessionAtRoot}\r\n onOpen={open}\r\n onToggleFolder={toggleFolder}\r\n onFolderNewSession={startSessionInFolder}\r\n onFolderSetRoot={setFolderRoot}\r\n onFolderRemove={removeFolderFrom}\r\n onOpenFolderPath={openFolderPath}\r\n onManageFolders={openFoldersFor}\r\n creatingFolderKey={creatingSessionIn}\r\n onRenameRequest={(workspaceId, title) => {\r\n setRenameTarget({ workspaceId, currentTitle: title })\r\n setRenameDraft(title)\r\n setRenameError(null)\r\n }}\r\n onDeleteRequest={(workspaceId, title) => {\r\n setDeleteTarget({ workspaceId, title })\r\n setDeleteError(null)\r\n }}\r\n onSessionRename={onSessionRename}\r\n onSessionArchive={onSessionArchive}\r\n onFork={forkSession}\r\n onOpenInFolder={openInFolder}\r\n />\r\n )}\r\n
\r\n
\r\n )}\r\n
\r\n\r\n {/* Bottom dock: siblings of the tree's scroll area (not rows inside it), so\r\n a long session list can never push them away or scroll them out.\r\n - the \"not classified yet\" bucket keeps its own category row and\r\n children (same component, same drag/menu behaviour), capped in height\r\n with its own scroll so a big bucket cannot swallow the tree;\r\n - the Host default workspace keeps the whole workspace-row behaviour\r\n (toggle, new session, rename, delete, —menu, folder management) and\r\n its sessions still highlight as usual. */}\r\n {wide && (dockCategory !== undefined || defaultBarNode !== undefined) && (\r\n
\r\n {dockCategory !== undefined && (\r\n
\r\n {categorySectionNode(dockCategory)}\r\n
\r\n )}\r\n {defaultBarNode !== undefined && (\r\n
\r\n { actions.setWorkspaceExpanded(defaultBarNode.workspaceId as string, !workspaceExpansion[defaultBarNode.workspaceId]) }}\r\n onNewSession={() => { startSessionAtRoot(defaultBarNode.workspaceId) }}\r\n onRename={() => {\r\n setRenameTarget({ workspaceId: defaultBarNode.workspaceId, currentTitle: defaultBarNode.label })\r\n setRenameDraft(defaultBarNode.label)\r\n setRenameError(null)\r\n }}\r\n onDelete={() => {\r\n setDeleteTarget({ workspaceId: defaultBarNode.workspaceId, title: defaultBarNode.label })\r\n setDeleteError(null)\r\n }}\r\n {...(openInFolder !== undefined\r\n ? { onOpenInFolder: () => { openInFolder(defaultBarNode.workspaceId) } }\r\n : {})}\r\n onManageFolders={() => { openFoldersFor(defaultBarNode.workspaceId as string) }}\r\n />\r\n
\r\n \r\n
\r\n
\r\n )}\r\n
\r\n )}\r\n\r\n {/* Group create / rename dialog */}\r\n { setGroupDialog(null) }}\r\n closeLabel={t('close')}\r\n title={groupDialog?.mode === 'rename' ? t('group.renameTitle') : t('group.createTitle')}\r\n footer={(\r\n <>\r\n \r\n \r\n \r\n )}\r\n >\r\n { setGroupDraft(e.target.value); setGroupError(null) }}\r\n onKeyDown={(e) => { if (e.key === 'Enter') confirmGroupDialog() }}\r\n />\r\n {groupNameIssue !== null &&
{groupNameIssue}
}\r\n {groupError !== null &&
{groupError}
}\r\n \r\n\r\n {/* Group delete dialog */}\r\n { setGroupDeleteTarget(null) }}\r\n closeLabel={t('close')}\r\n title={t('group.deleteTitle')}\r\n footer={(\r\n <>\r\n \r\n \r\n \r\n )}\r\n >\r\n
{t('group.deleteConfirm')}
\r\n {groupDeleteError !== null &&
{groupDeleteError}
}\r\n \r\n\r\n {/* Group appearance dialog: every control writes immediately (optimistic\r\n patch + rollback banner), so the footer is only \"done\". The body is a\r\n single scroll column (the dialog caps itself at the viewport and keeps\r\n the footer outside the scroller), and the sections are spaced so a\r\n focused field's ring never touches the next control. */}\r\n { setAppearanceTarget(null) }}\r\n closeLabel={t('group.appearanceDone')}\r\n title={t('group.appearanceTitle')}\r\n className=\"wgAppearanceDialog\"\r\n contentClassName=\"wgAppearanceContent\"\r\n footer={(\r\n \r\n )}\r\n >\r\n {appearanceTarget !== null && (\r\n
\r\n
\r\n
{t('group.color')}
\r\n
\r\n { void updateCategoryAppearance(appearanceTarget, { color: undefined }) }}\r\n />\r\n {GROUP_COLORS.map((color) => {\r\n const active = appearanceCurrent.color === color\r\n return (\r\n { void updateCategoryAppearance(appearanceTarget, { color }) }}\r\n />\r\n )\r\n })}\r\n
\r\n
\r\n
\r\n
{t('group.icon')}
\r\n {/* Categorised picker: the pre-existing presets stay together as\r\n the common section, the research family is split into its four\r\n families, the emoji stay in their own row. The sections share\r\n one height-capped scroller so the footer button is never\r\n pushed out of the dialog. */}\r\n
\r\n
\r\n
{t('group.icon.section.common')}
\r\n
\r\n {COMMON_ICON_IDS.map(id => renderIconCell(id, GROUP_ICON_LABELS[id]))}\r\n
\r\n
\r\n {SCIENCE_ICON_SECTIONS.map(section => {\r\n const label = t(SCIENCE_SECTION_LABEL_KEYS[section.key])\r\n return (\r\n
\r\n
{label}
\r\n
\r\n {section.ids.map(id => renderIconCell(id, GROUP_ICON_LABELS[id]))}\r\n
\r\n
\r\n )\r\n })}\r\n
\r\n
{t('group.icon.section.emoji')}
\r\n
\r\n {GROUP_EMOJI_ICONS.map(({ icon, label }) => renderIconCell(icon, label))}\r\n
\r\n
\r\n
\r\n
\r\n {\r\n setAppearanceDraft({ ...appearanceDraft, icon: '' })\r\n setAppearanceError(null)\r\n void updateCategoryAppearance(appearanceTarget, { icon: undefined })\r\n }}\r\n >\r\n {t('group.iconDefault')}\r\n \r\n {\r\n setAppearanceDraft({ ...appearanceDraft, icon: e.target.value })\r\n setAppearanceError(null)\r\n }}\r\n onKeyDown={(e) => { if (e.key === 'Enter') commitAppearanceIcon() }}\r\n onBlur={(event) => {\r\n /* A swatch / preset click moves focus out of the field in the\r\n same gesture and writes its own patch —committing the stale\r\n draft here would race it and could overwrite the preset. */\r\n const next = event.relatedTarget\r\n if (next instanceof Element && next.closest('.wgSwatch, .wgIconCell') !== null) return\r\n commitAppearanceIcon()\r\n }}\r\n />\r\n
\r\n
\r\n
\r\n { void updateCategoryAppearance(appearanceTarget, { pinned: appearanceCurrent.pinned !== true }) }}\r\n >\r\n {appearanceCurrent.pinned === true ? t('group.unpin') : t('group.pin')}\r\n \r\n
\r\n {appearanceError !== null &&
{appearanceError}
}\r\n
\r\n )}\r\n \r\n\r\n {/* Per-workspace folders dialog: base + extra folders, root radio,\r\n open/remove per row. Mounted only while a project row asked for it. */}\r\n {foldersTarget !== null && (() => {\r\n const workspace = workspaces.find(w => w.workspaceId === foldersTarget)\r\n if (workspace === undefined) return null\r\n return (\r\n w.workspaceId as string)}\r\n onAddFolder={() => { void addFolderTo(foldersTarget) }}\r\n onAddRemote={(profileId, remotePath) => addRemoteFolderTo(foldersTarget, profileId, remotePath)}\r\n onAddSubpath={(relative) => addSubpathTo(foldersTarget, relative)}\r\n onSetRoot={(path) => { setFolderRoot(foldersTarget, path) }}\r\n onRemove={(path, deleteRecord) => { removeFolderFrom(foldersTarget, path, deleteRecord) }}\r\n onOpenFolder={(path) => { openFolderPath?.(path) }}\r\n onClose={() => { foldersOwnerRequest.current = ''; setFoldersTarget(null) }}\r\n />\r\n )\r\n })()}\r\n\r\n {/* Workspace rename dialog */}\r\n { setRenameTarget(null) }}\r\n closeLabel={t('close')}\r\n title={t('workspace.renameTitle')}\r\n footer={(\r\n <>\r\n \r\n \r\n \r\n )}\r\n >\r\n { setRenameDraft(e.target.value) }}\r\n onKeyDown={(e) => { if (e.key === \"Enter\") confirmRename() }}\r\n />\r\n {renameError !== null &&
{renameError}
}\r\n \r\n\r\n {/* Workspace delete dialog */}\r\n { setDeleteTarget(null) }}\r\n closeLabel={t('close')}\r\n title={t('workspace.deleteTitle')}\r\n footer={(\r\n <>\r\n \r\n \r\n \r\n )}\r\n >\r\n
{t('workspace.deleteConfirm')}
\r\n {deleteError !== null &&
{deleteError}
}\r\n \r\n\r\n {/* Session rename dialog */}\r\n { setSessionRenameTarget(null) }}\r\n closeLabel={t('close')}\r\n title={t('session.renameTitle')}\r\n footer={(\r\n <>\r\n \r\n \r\n \r\n )}\r\n >\r\n { setSessionRenameDraft(e.target.value) }}\r\n onKeyDown={(e) => { if (e.key === \"Enter\") confirmSessionRename() }}\r\n />\r\n {sessionRenameError !== null &&
{sessionRenameError}
}\r\n \r\n\r\n {/* Add workspace error dialog */}\r\n {directoryFlowOpen && DirectoryFlow && (\r\n { finishDirectoryFlow(path) }}\r\n onCancel={() => { finishDirectoryFlow(null) }}\r\n onError={message => { finishDirectoryFlow(null, message) }}\r\n />\r\n )}\r\n\r\n { setAddErrorOpen(false) }}\r\n closeLabel={t('close')}\r\n title={t('workspace.addErrorTitle')}\r\n footer={(\r\n <>\r\n \r\n \r\n \r\n )}\r\n >\r\n
{addError}
\r\n \r\n\r\n {/* \"Open in folder\" failure: transient banner, keyed per attempt so a\r\n repeat failure restarts the cycle. */}\r\n {folderError !== null && (\r\n }\r\n onDone={() => { setFolderError(null) }}\r\n />\r\n )}\r\n\r\n {/* Ctrl+R quick switch panel (conditionally mounted: fresh query per open). */}\r\n {quickOpen && (\r\n { setQuickOpen(false) }}\r\n list={list}\r\n workspaces={visibleWorkspaces}\r\n archivedSessionIds={archivedSessionIds}\r\n categoryByWorkspace={categoryByWorkspace}\r\n current={current}\r\n startSession={startSession}\r\n openSession={open}\r\n now={now}\r\n t={t}\r\n />\r\n )}\r\n
\r\n )\r\n}\r\n\r\n/** Resolve the category label containing the current session (auto-expand helper). */\r\nfunction categoriesForCurrent(\r\n config: GroupsConfig,\r\n workspaces: readonly WorkspaceView[],\r\n current: SessionId,\r\n manual: ManualGroups,\r\n): string | undefined {\r\n const workspace = workspaces.find(w => w.sessionIds.includes(current))\r\n if (workspace === undefined) return undefined\r\n return resolveCategory(config, manual, workspace.workspaceId, workspace.path, workspace.title)\r\n}\r\n\r\n/**\r\n * The expanded session rows of one project. Workspaces with extra folders get\r\n * one folder row per folder (root first) and hang their sessions off that\r\n * folder; a workspace without extra folders renders today's flat list, so the\r\n * common case is unchanged row-for-row.\r\n */\r\nfunction WorkspaceSubtree({ workspace, current, now, t, animate, onOpen, onSessionRename, onSessionArchive, onFork, onToggleFolder, onFolderNewSession, onFolderSetRoot, onFolderRemove, onOpenFolderPath, creatingFolderKey }: {\r\n workspace: WorkspaceGroupNode\r\n current: SessionId | undefined\r\n now: number\r\n t: GroupsBrowserProps['t']\r\n animate: boolean\r\n onOpen: (sessionId: SessionId) => void\r\n onSessionRename: (sessionId: SessionId, currentTitle: string) => void\r\n onSessionArchive: (sessionId: SessionId) => void\r\n onFork: (sessionId: SessionId) => void\r\n onToggleFolder: (workspaceId: WorkspaceId, path: string) => void\r\n onFolderNewSession: (workspaceId: WorkspaceId, path: string, isBase: boolean) => void\r\n onFolderSetRoot: (workspaceId: WorkspaceId, path: string) => void\r\n onFolderRemove: (workspaceId: WorkspaceId, path: string) => void\r\n onOpenFolderPath?: ((path: string) => void) | undefined\r\n creatingFolderKey: string | null\r\n}) {\r\n const folders = workspace.folders\r\n if (folders === undefined) {\r\n return (\r\n \r\n {workspace.sessions.map((session) => (\r\n \r\n ))}\r\n \r\n )\r\n }\r\n return (\r\n \r\n {folders.map((folder) => {\r\n const key = folderKey(workspace.workspaceId, folder.path)\r\n return (\r\n
\r\n { onToggleFolder(workspace.workspaceId, folder.path) }}\r\n onNewSession={() => { onFolderNewSession(workspace.workspaceId, folder.path, folder.isBase) }}\r\n onSetRoot={() => { onFolderSetRoot(workspace.workspaceId, folder.path) }}\r\n onRemove={() => { onFolderRemove(workspace.workspaceId, folder.path) }}\r\n {...(onOpenFolderPath !== undefined\r\n ? { onOpenInFolder: () => { onOpenFolderPath(folder.path) } }\r\n : {})}\r\n />\r\n \r\n {folder.sessions.map((session) => (\r\n \r\n ))}\r\n \r\n
\r\n )\r\n })}\r\n \r\n )\r\n}\r\n\r\n/** One category section: header row + expanded workspace folders. */\r\nfunction CategorySection({ category, current, now, t, dragIndicator, onDragOverRow, onDragLeaveRow, onDropRow, onDragStartCategory, onDragStartWorkspace, onToggleCategory, onToggleWorkspace, onNewSession, onOpen, onRenameRequest, onDeleteRequest, onSessionRename, onSessionArchive, onFork, onAddWorkspace, addingWorkspace, onGroupRename, onGroupDelete, onGroupTogglePin, onGroupAppearance, animate, onMoveOut, canMoveOut, onOpenInFolder, onToggleFolder, onFolderNewSession, onFolderSetRoot, onFolderRemove, onOpenFolderPath, onManageFolders, creatingFolderKey }: {\r\n category: CategoryNode\r\n current: SessionId | undefined\r\n now: number\r\n t: GroupsBrowserProps['t']\r\n dragIndicator: DragIndicator\r\n /** Whether the disclosure animation may play (false while a drag folds rows). */\r\n animate: boolean\r\n onDragOverRow: (row: DropRowRef) => (event: DragEvent) => void\r\n onDragLeaveRow: (event: DragEvent) => void\r\n /** Drop factory: bind the target category and the row kind (before/after re-derived at drop time). */\r\n onDropRow: (categoryKey: string, row: DropRowRef) => (event: DragEvent) => void\r\n onDragStartCategory: (event: DragEvent) => void\r\n onDragStartWorkspace: (workspaceId: WorkspaceId) => () => void\r\n onToggleCategory: () => void\r\n onToggleWorkspace: (key: string) => void\r\n onNewSession: (workspaceId?: WorkspaceId) => void\r\n onOpen: (sessionId: SessionId) => void\r\n onRenameRequest: (workspaceId: WorkspaceId, currentTitle: string) => void\r\n onDeleteRequest: (workspaceId: WorkspaceId, title: string) => void\r\n onSessionRename: (sessionId: SessionId, currentTitle: string) => void\r\n onSessionArchive: (sessionId: SessionId) => void\r\n onFork: (sessionId: SessionId) => void\r\n onAddWorkspace: () => void\r\n addingWorkspace: boolean\r\n onGroupRename: () => void\r\n onGroupDelete: () => void\r\n /** Pin/unpin this group from its row menu. */\r\n onGroupTogglePin: () => void\r\n /** Open the appearance dialog for this group. */\r\n onGroupAppearance: () => void\r\n onMoveOut: (workspaceId: WorkspaceId) => void\r\n canMoveOut: (workspaceId: WorkspaceId) => boolean\r\n onToggleFolder: (workspaceId: WorkspaceId, path: string) => void\r\n onFolderNewSession: (workspaceId: WorkspaceId, path: string, isBase: boolean) => void\r\n onFolderSetRoot: (workspaceId: WorkspaceId, path: string) => void\r\n onFolderRemove: (workspaceId: WorkspaceId, path: string) => void\r\n onManageFolders: (workspaceId: WorkspaceId) => void\r\n /** Creation in flight, keyed by `folderKey`; disables the row's controls */\r\n creatingFolderKey: string | null\r\n /** Absent when the host resolved no folder application. */\r\n onOpenInFolder?: ((workspaceId: WorkspaceId) => void) | undefined\r\n /** Absent when the host resolved no folder application. */\r\n onOpenFolderPath?: ((path: string) => void) | undefined\r\n}) {\r\n const categoryLine = dragIndicator?.mode === 'line' && dragIndicator.row.kind === 'category' && dragIndicator.row.key === category.key\r\n ? (dragIndicator.before ? 'before' : 'after')\r\n : undefined\r\n const categoryInto = dragIndicator?.mode === 'into' && dragIndicator.categoryKey === category.key\r\n return (\r\n
\r\n \r\n \r\n {category.workspaces.map((workspace) => (\r\n
\r\n { onToggleWorkspace(workspace.workspaceId as string) }}\r\n onNewSession={() => { onNewSession(workspace.workspaceId) }}\r\n onRename={() => { onRenameRequest(workspace.workspaceId, workspace.label) }}\r\n onDelete={() => { onDeleteRequest(workspace.workspaceId, workspace.label) }}\r\n canMoveOut={canMoveOut(workspace.workspaceId)}\r\n onMoveOut={() => { onMoveOut(workspace.workspaceId) }}\r\n {...(onOpenInFolder !== undefined\r\n ? { onOpenInFolder: () => { onOpenInFolder(workspace.workspaceId) } }\r\n : {})}\r\n dropActive={false}\r\n {...(dragIndicator?.mode === 'line' && dragIndicator.row.kind === 'workspace' && dragIndicator.row.key === workspace.workspaceId\r\n ? { insertLine: dragIndicator.before ? 'before' : 'after' }\r\n : {})}\r\n onRowDragOver={onDragOverRow({ kind: 'workspace', key: workspace.workspaceId })}\r\n onRowDragLeave={onDragLeaveRow}\r\n onRowDrop={onDropRow(category.key, { kind: 'workspace', key: workspace.workspaceId })}\r\n onDragStartExtra={onDragStartWorkspace(workspace.workspaceId)}\r\n onManageFolders={() => { onManageFolders(workspace.workspaceId) }}\r\n />\r\n \r\n
\r\n ))}\r\n \r\n
\r\n )\r\n}\r\n\r\n/**\r\n * Top-level (ungrouped) workspace rows rendered after the group folders. While\r\n * a project drag is in progress the WHOLE top-level area is the move-out\r\n * landing spot, shown with an insertion LINE (not a highlight box):\r\n * - a top-level row reorders before/after it (line above/below, like a group);\r\n * - the blank space below the last row appends to the end (line below the\r\n * last row);\r\n * - an empty top level shows a standalone line under the last group folder.\r\n */\r\nfunction TopLevelSection({ topLevel, current, now, t, dragging, dragIndicator, topLevelRef, onDragOverRow, onDragOverTopLevelArea, onDragLeaveRow, onDropRow, onDragStartWorkspace, onToggleWorkspace, onNewSession, onOpen, onRenameRequest, onDeleteRequest, onSessionRename, onSessionArchive, onFork, onOpenInFolder, onToggleFolder, onFolderNewSession, onFolderSetRoot, onFolderRemove, onOpenFolderPath, onManageFolders, creatingFolderKey }: {\r\n topLevel: readonly WorkspaceGroupNode[]\r\n current: SessionId | undefined\r\n now: number\r\n t: GroupsBrowserProps['t']\r\n /** A project drag is in progress (drives the empty-top-level landing line). */\r\n dragging: boolean\r\n dragIndicator: DragIndicator\r\n topLevelRef: DropRowRef\r\n onDragOverRow: (row: DropRowRef) => (event: DragEvent) => void\r\n onDragOverTopLevelArea: (event: DragEvent) => void\r\n onDragLeaveRow: (event: DragEvent) => void\r\n onDropRow: (categoryKey: string, row: DropRowRef) => (event: DragEvent) => void\r\n onDragStartWorkspace: (workspaceId: WorkspaceId) => () => void\r\n onToggleWorkspace: (key: string) => void\r\n onNewSession: (workspaceId?: WorkspaceId) => void\r\n onOpen: (sessionId: SessionId) => void\r\n onRenameRequest: (workspaceId: WorkspaceId, currentTitle: string) => void\r\n onDeleteRequest: (workspaceId: WorkspaceId, title: string) => void\r\n onSessionRename: (sessionId: SessionId, currentTitle: string) => void\r\n onSessionArchive: (sessionId: SessionId) => void\r\n onFork: (sessionId: SessionId) => void\r\n onToggleFolder: (workspaceId: WorkspaceId, path: string) => void\r\n onFolderNewSession: (workspaceId: WorkspaceId, path: string, isBase: boolean) => void\r\n onFolderSetRoot: (workspaceId: WorkspaceId, path: string) => void\r\n onFolderRemove: (workspaceId: WorkspaceId, path: string) => void\r\n onManageFolders: (workspaceId: WorkspaceId) => void\r\n creatingFolderKey: string | null\r\n /** Absent when the host resolved no folder application. */\r\n onOpenInFolder?: ((workspaceId: WorkspaceId) => void) | undefined\r\n /** Absent when the host resolved no folder application. */\r\n onOpenFolderPath?: ((path: string) => void) | undefined\r\n}) {\r\n const emptyLineActive = dragIndicator?.mode === 'line' && dragIndicator.row.kind === 'topLevel' && dragIndicator.row.key === topLevelRef.key\r\n return (\r\n \r\n {topLevel.length === 0 && dragging && (\r\n \r\n \r\n \r\n )}\r\n {topLevel.map((workspace) => (\r\n
\r\n { onToggleWorkspace(workspace.workspaceId as string) }}\r\n onNewSession={() => { onNewSession(workspace.workspaceId) }}\r\n onRename={() => { onRenameRequest(workspace.workspaceId, workspace.label) }}\r\n onDelete={() => { onDeleteRequest(workspace.workspaceId, workspace.label) }}\r\n {...(onOpenInFolder !== undefined\r\n ? { onOpenInFolder: () => { onOpenInFolder(workspace.workspaceId) } }\r\n : {})}\r\n {...(dragIndicator?.mode === 'line' && dragIndicator.row.kind === 'topLevel' && dragIndicator.row.key === workspace.workspaceId\r\n ? { insertLine: dragIndicator.before ? 'before' : 'after' }\r\n : {})}\r\n onRowDragOver={onDragOverRow({ kind: 'topLevel', key: workspace.workspaceId })}\r\n onRowDragLeave={onDragLeaveRow}\r\n onRowDrop={onDropRow(UNCATEGORIZED_KEY, { kind: 'topLevel', key: workspace.workspaceId })}\r\n onDragStartExtra={onDragStartWorkspace(workspace.workspaceId)}\r\n onManageFolders={() => { onManageFolders(workspace.workspaceId) }}\r\n />\r\n \r\n
\r\n ))}\r\n \r\n )\r\n}\r\n\r\n/**\r\n * Search hits inside one project. When the project owns extra folders the hits\r\n * keep their folder row (all expanded, since search prunes to matches) so a\r\n * match never loses the folder it came from.\r\n */\r\nfunction SearchSubtree({ workspace, current, now, open, t }: {\r\n workspace: WorkspaceGroupNode\r\n current: SessionId | undefined\r\n now: number\r\n open: (sessionId: SessionId) => void\r\n t: GroupsBrowserProps['t']\r\n}) {\r\n const folders = workspace.folders\r\n if (folders === undefined) {\r\n return (\r\n
\r\n {workspace.sessions.map((session) => (\r\n {}}\r\n onFork={() => {}}\r\n onArchive={() => {}}\r\n />\r\n ))}\r\n
\r\n )\r\n }\r\n return (\r\n
\r\n {folders.map((folder) => (\r\n
\r\n {}}\r\n onNewSession={() => {}}\r\n onSetRoot={() => {}}\r\n onRemove={() => {}}\r\n />\r\n
\r\n {folder.sessions.map((session) => (\r\n {}}\r\n onFork={() => {}}\r\n onArchive={() => {}}\r\n />\r\n ))}\r\n
\r\n
\r\n ))}\r\n
\r\n )\r\n}\r\n\r\n/**\r\n * Search body rendered as a three-level tree pruned to matched branches:\r\n * Only branches that contain a hit are rendered, which keeps a long list short. Reuses the same row components as\r\n * the idle tree, so search keeps the same folder hierarchy the user is used to.\r\n */\r\n/**\r\n * Search results, presentational only: the owner derives the tree and the\r\n * match set (so the pinned default-workspace bar can share that derivation).\r\n * This view never repeats the default workspace —tree.ts leaves it out of the\r\n * categories / top-level projections and hands it back as `tree.defaultWorkspace`.\r\n */\r\nfunction SearchBody({ tree, matches, status, current, now, open, t }: {\r\n tree: SearchTree\r\n matches: SearchMatchSet\r\n status: RemoteSearchState['status']\r\n current: SessionId | undefined\r\n now: number\r\n open: (sessionId: SessionId) => void\r\n t: GroupsBrowserProps['t']\r\n}) {\r\n const groups = tree.categories\r\n const searchTopLevel = tree.topLevel\r\n const pending = status === 'loading'\r\n const failed = status === 'error'\r\n return (\r\n
\r\n {groups.map((category) => (\r\n
\r\n {}} />\r\n
\r\n {category.workspaces.map((workspace) => (\r\n
\r\n {}}\r\n onNewSession={() => {}}\r\n onRename={() => {}}\r\n onDelete={() => {}}\r\n />\r\n \r\n
\r\n ))}\r\n
\r\n
\r\n ))}\r\n {searchTopLevel.map((workspace) => (\r\n
\r\n {}}\r\n onNewSession={() => {}}\r\n onRename={() => {}}\r\n onDelete={() => {}}\r\n />\r\n \r\n
\r\n ))}\r\n {pending &&
{t('search.pending')}
}\r\n {failed &&
{t('search.unavailable')}
}\r\n {!pending && groups.length === 0 && searchTopLevel.length === 0 && (\r\n
{t('search.noMatches')}
\r\n )}\r\n {matches.hasMore && (\r\n
{t('search.hasMore')}
\r\n )}\r\n
\r\n )\r\n}\r\n","import type { StoredEntry } from '@deepseek-ai/dsh-client-ui-slots'\r\nimport type { GroupsBrowserInjected } from './contract.ts'\r\n\r\n/** Adapt the elected self-contained picker, without stealing its original slot. */\r\nexport function directoryFlowFromEntry(entry: StoredEntry | undefined): ReturnType {\r\n if (!entry) return null\r\n // Stateful/translated/nested seats need the full original renderer context.\r\n // Never silently drop them or fall back to a local picker for a remote request.\r\n if (entry.store || entry.locale || entry.children || typeof entry.component !== 'function') {\r\n throw new Error('This directory picker requires an unsupported renderer context.')\r\n }\r\n return {\r\n component: entry.component as NonNullable>['component'],\r\n injected: entry.inject?.() ?? {},\r\n }\r\n}\r\n","/**\r\n * Locale dictionaries for the workspace-groups browser. The namespace is\r\n * `workspaceGroups` (independent from ui-workspace's `workspace` namespace).\r\n */\r\nimport type { LocaleDictOf } from '@deepseek-ai/dsh-client-ui-slots'\r\n\r\n/** Dictionary keys of the workspaceGroups namespace (single source of truth). */\r\n\r\nexport type WorkspaceGroupsKey =\r\n | 'section.workspaces'\r\n | 'section.sessions'\r\n | 'search'\r\n | 'search.placeholder'\r\n | 'search.clear'\r\n | 'search.noMatches'\r\n | 'search.unavailable'\r\n | 'search.pending'\r\n | 'search.hasMore'\r\n | 'search.results.aria'\r\n | 'workspace.add'\r\n | 'workspace.addBusy'\r\n | 'workspace.addError'\r\n | 'workspace.addErrorTitle'\r\n | 'workspace.rename'\r\n | 'workspace.delete'\r\n | 'workspace.deleteTitle'\r\n | 'workspace.deleteConfirm'\r\n | 'workspace.deleteCancel'\r\n | 'workspace.renaming'\r\n | 'workspace.deleting'\r\n | 'workspace.renameTitle'\r\n | 'workspace.renamePlaceholder'\r\n | 'workspace.renameConfirm'\r\n | 'workspace.renameCancel'\r\n | 'workspace.moveOutOfGroup'\r\n | 'workspace.openInFolder'\r\n | 'workspace.openInFolderError'\r\n | 'folder.title'\r\n | 'folder.manage'\r\n | 'folder.listAria'\r\n | 'folder.sectionList'\r\n | 'folder.sectionAdd'\r\n | 'folder.emptyHint'\r\n | 'folder.base'\r\n | 'folder.setRoot'\r\n | 'folder.rootBadge'\r\n | 'folder.remove'\r\n | 'folder.add'\r\n | 'folder.done'\r\n | 'folder.duplicate'\r\n | 'folder.conflict'\r\n | 'folder.removeError'\r\n | 'folder.removeRemotePrompt'\r\n | 'folder.removeRemoteDelete'\r\n | 'folder.removeRemoteOnly'\r\n | 'folder.addError'\r\n | 'folder.sessionError'\r\n | 'folder.saveError'\r\n | 'folder.notReady'\r\n | 'folder.remoteSessionUnsupported'\r\n | 'folder.remoteHint'\r\n | 'folder.remoteNeedsSubpath'\r\n | 'folder.subpathLabel'\r\n | 'folder.subpathPlaceholder'\r\n | 'folder.addSubpath'\r\n | 'folder.subpathInvalid'\r\n | 'folder.cloudSection'\r\n | 'folder.profileLabel'\r\n | 'folder.remotePathLabel'\r\n | 'folder.remotePathPlaceholder'\r\n | 'folder.remotePathOrName'\r\n | 'folder.createAndAdd'\r\n | 'folder.cloudNoteBoth'\r\n | 'folder.addRemote'\r\n | 'folder.noProfiles'\r\n | 'folder.profilesError'\r\n | 'folder.cloudTag'\r\n | 'folder.localTag'\r\n | 'folder.memberMissing'\r\n | 'folder.memberNested'\r\n | 'folder.alreadyRoot'\r\n | 'folder.addAria'\r\n | 'folder.tabLocal'\r\n | 'folder.tabCloud'\r\n | 'folder.pickLocal'\r\n | 'folder.localNote'\r\n | 'folder.localIntoRemote'\r\n | 'folder.cloudNote'\r\n | 'folder.browse'\r\n | 'folder.browseTitle'\r\n | 'folder.browseListAria'\r\n | 'folder.browseNote'\r\n | 'folder.browseFailed'\r\n | 'folder.chooseHere'\r\n | 'folder.up'\r\n | 'folder.home'\r\n | 'folder.refresh'\r\n | 'folder.loading'\r\n | 'folder.loadingState'\r\n | 'folder.loadError'\r\n | 'folder.refreshError'\r\n | 'folder.retry'\r\n | 'folder.retryDraft'\r\n | 'folder.discardDraft'\r\n | 'folder.conflictDetail'\r\n | 'folder.emptyDir'\r\n | 'group.create'\r\n | 'group.createTitle'\r\n | 'group.createPlaceholder'\r\n | 'group.createConfirm'\r\n | 'group.createCancel'\r\n | 'group.rename'\r\n | 'group.renameTitle'\r\n | 'group.renameConfirm'\r\n | 'group.delete'\r\n | 'group.deleteTitle'\r\n | 'group.deleteConfirm'\r\n | 'group.deleteCancel'\r\n | 'group.nameDuplicate'\r\n | 'group.nameReserved'\r\n | 'group.pin'\r\n | 'group.unpin'\r\n | 'group.pinned'\r\n | 'group.appearance'\r\n | 'group.appearanceTitle'\r\n | 'group.appearanceDone'\r\n | 'group.color'\r\n | 'group.colorDefault'\r\n | 'group.icon'\r\n | 'group.iconDefault'\r\n | 'group.iconCustom'\r\n | 'group.iconInvalid'\r\n | 'group.icon.section.common'\r\n | 'group.icon.section.lab'\r\n | 'group.icon.section.materials'\r\n | 'group.icon.section.characterization'\r\n | 'group.icon.section.devices'\r\n | 'group.icon.section.emoji'\r\n | 'color.red'\r\n | 'color.orange'\r\n | 'color.amber'\r\n | 'color.green'\r\n | 'color.teal'\r\n | 'color.blue'\r\n | 'color.indigo'\r\n | 'color.purple'\r\n | 'color.pink'\r\n | 'color.gray'\r\n | 'section.topLevel'\r\n | 'section.defaultWorkspace'\r\n | 'manual.saveError'\r\n | 'manual.conflict'\r\n | 'session.new'\r\n | 'session.rename'\r\n | 'session.archive'\r\n | 'session.fork'\r\n | 'session.renameTitle'\r\n | 'session.renamePlaceholder'\r\n | 'session.renameConfirm'\r\n | 'session.renameCancel'\r\n | 'session.renaming'\r\n | 'uncategorized'\r\n | 'empty.none'\r\n | 'empty.noWorkspaces'\r\n | 'close'\r\n | 'cancel'\r\n | 'confirm'\r\n | 'retry'\r\n | 'configUnavailable'\r\n | 'collapse'\r\n | 'expandMore'\r\n | 'newSession'\r\n | 'quick.title'\r\n | 'quick.tab.workspaces'\r\n | 'quick.tab.sessions'\r\n | 'quick.search.placeholder'\r\n | 'quick.search.sessions'\r\n | 'quick.empty.workspaces'\r\n | 'quick.action.newSession'\r\n | 'quick.action.running'\r\n | 'quick.action.noneRunning'\r\n | 'quick.empty.sessions'\r\n | 'quick.select.hint'\r\n | 'quick.hint'\r\n | 'tabs.aria'\r\n | 'tabs.close'\r\n | 'tabs.archive'\r\n | 'tabs.pin'\r\n | 'tabs.unpin'\r\n | 'tabs.pinned'\r\n | 'tabs.rename'\r\n | 'tabs.renameSession'\r\n | 'tabs.renamePlaceholder'\r\n | 'tabs.closeOthers'\r\n | 'tabs.closeRight'\r\n | 'tabs.dragHint'\r\n\r\nexport type WorkspaceGroupsDict = LocaleDictOf<'workspaceGroups'>\r\n\r\n/** Simplified Chinese dictionary. */\r\nexport const zh: WorkspaceGroupsDict = {\r\n 'section.workspaces': '工作区',\r\n 'section.sessions': '会话',\r\n 'search': '搜索',\r\n 'search.placeholder': '搜索会话…',\r\n 'search.clear': '清除',\r\n 'search.noMatches': '没有匹配的会话',\r\n 'search.unavailable': '搜索不可用',\r\n 'search.pending': '搜索中…',\r\n 'search.hasMore': '结果过多,请细化关键词',\r\n 'search.results.aria': '搜索结果',\r\n 'workspace.add': '添加工作区',\r\n 'workspace.addBusy': '正在添加…',\r\n 'workspace.addError': '添加失败',\r\n 'workspace.addErrorTitle': '无法添加工作区',\r\n 'workspace.rename': '重命名',\r\n 'workspace.delete': '删除',\r\n 'workspace.deleteTitle': '删除工作区',\r\n 'workspace.deleteConfirm': '仅删除注册信息,目录与会话日志保留。确定删除?',\r\n 'workspace.deleteCancel': '取消删除',\r\n 'workspace.renaming': '重命名中…',\r\n 'workspace.deleting': '删除中…',\r\n 'workspace.renameTitle': '重命名工作区',\r\n 'workspace.renamePlaceholder': '工作区名称',\r\n 'workspace.renameConfirm': '重命名',\r\n 'workspace.renameCancel': '取消',\r\n 'workspace.moveOutOfGroup': '移出分组',\r\n 'workspace.openInFolder': '在文件夹中打开',\r\n 'workspace.openInFolderError': '打开文件夹失败',\r\n 'folder.title': '文件夹',\r\n 'folder.manage': '文件夹…',\r\n 'folder.listAria': '工作区文件夹',\r\n 'folder.sectionList': '项目文件夹',\r\n 'folder.sectionAdd': '添加文件夹',\r\n 'folder.emptyHint': '还没有额外文件夹。下面挂一个目录,它的会话会独立运行,模型也能直接读到里面的文件。',\r\n 'folder.base': '基础文件夹',\r\n 'folder.setRoot': '设为根目录',\r\n 'folder.rootBadge': '根目录',\r\n 'folder.remove': '从工作区移除',\r\n 'folder.add': '添加文件夹',\r\n 'folder.done': '完成',\r\n 'folder.duplicate': '该文件夹已在此工作区中',\r\n 'folder.conflict': '文件夹已被另一个窗口修改,已同步为最新状态,本次修改未保存,请重试',\r\n 'folder.removeError': '远程工作区删除失败',\r\n 'folder.removeRemotePrompt': '这个云端文件夹背后有一个工作区,移除时要连它一起删掉吗?删掉后它里面的会话也会消失。',\r\n 'folder.removeRemoteDelete': '连工作区一起删',\r\n 'folder.removeRemoteOnly': '只移除文件夹',\r\n 'folder.addError': '添加文件夹失败',\r\n 'folder.sessionError': '新建会话失败',\r\n 'folder.saveError': '文件夹保存失败',\r\n 'folder.notReady': '目录安全信息尚未加载,请重启 DSH 并刷新页面后重试',\r\n 'folder.remoteSessionUnsupported': '当前 SSH 插件不完整支持子目录会话,请从远程工作区根目录打开会话。不会退回本地终端。',\r\n 'folder.remoteHint': '输入一个文件夹名:本地使用 DSH 目录接口;远程使用 SSH 创建目录接口(远端同名目录已存在时复用)。SSH 不可用时不会在镜像里创建本地目录。',\r\n 'folder.remoteNeedsSubpath': '远程工作区请用子目录方式添加文件夹',\r\n 'folder.subpathLabel': '文件夹名称',\r\n 'folder.subpathPlaceholder': '例如 data',\r\n 'folder.addSubpath': '创建文件夹',\r\n 'folder.subpathInvalid': '路径无效:请填工作区内的相对路径,不能用绝对路径或 ..',\r\n 'folder.cloudSection': '云端文件夹',\r\n 'folder.profileLabel': 'SSH 连接',\r\n 'folder.remotePathLabel': '远端目录',\r\n 'folder.remotePathPlaceholder': '例如 ~/projects/app',\r\n 'folder.remotePathOrName': '例如 ~/projects/app,或新目录名',\r\n 'folder.createAndAdd': '新建并添加',\r\n 'folder.cloudNoteBoth': '填绝对路径:新建一个云端工作区(带本地镜像);只填名字:在项目云端根目录下新建该目录并挂进来',\r\n 'folder.addRemote': '添加云端文件夹',\r\n 'folder.noProfiles': '没有可用的 SSH 连接:请先在 remote-ssh 插件中配置连接',\r\n 'folder.profilesError': '读取 SSH 连接失败',\r\n 'folder.cloudTag': '云端',\r\n 'folder.localTag': '本地',\r\n 'folder.memberMissing': '该文件夹对应的独立工作区已不存在,请移除后重新添加',\r\n 'folder.memberNested': '该目录本身已是一个含文件夹的项目,不能作为文件夹加入',\r\n 'folder.alreadyRoot': '这就是项目的根目录,不能再作为一个文件夹加入',\r\n 'folder.addAria': '添加文件夹的方式',\r\n 'folder.tabLocal': '本地目录',\r\n 'folder.tabCloud': '云端目录',\r\n 'folder.pickLocal': '选择本地目录…',\r\n 'folder.localNote': '在本机选一个目录,作为这个项目的文件夹',\r\n 'folder.localIntoRemote': '这个项目在云端;本地目录会作为本地文件夹挂到这个项目里',\r\n 'folder.cloudNote': '会为该远端目录建立本地镜像,并注册成一个工作区供会话使用',\r\n 'folder.browse': '浏览…',\r\n 'folder.browseTitle': '选择云端文件夹',\r\n 'folder.browseListAria': '远端目录列表',\r\n 'folder.browseNote': '只列出目录:点目录进入,用底部按钮选择当前目录。',\r\n 'folder.browseFailed': '读取远端目录失败',\r\n 'folder.chooseHere': '选择此目录',\r\n 'folder.up': '上一级',\r\n 'folder.home': '主目录',\r\n 'folder.refresh': '刷新',\r\n 'folder.loading': '正在读取远端目录…',\r\n 'folder.loadingState': '正在读取文件夹配置…',\r\n 'folder.loadError': '文件夹配置读取失败(未显示为空分组)',\r\n 'folder.refreshError': '文件夹配置刷新失败,继续显示上次确认的配置',\r\n 'folder.retry': '重试',\r\n 'folder.retryDraft': '重新应用我的修改',\r\n 'folder.discardDraft': '保留服务端版本',\r\n 'folder.conflictDetail': '文件夹已被另一个窗口修改:下面是服务端当前版本;你未保存的修改仍保留在此处,可重新应用。',\r\n 'folder.emptyDir': '这个目录下没有子目录',\r\n 'group.create': '新建分组',\r\n 'group.createTitle': '新建分组',\r\n 'group.createPlaceholder': '分组名称',\r\n 'group.createConfirm': '创建',\r\n 'group.createCancel': '取消',\r\n 'group.rename': '重命名分组',\r\n 'group.renameTitle': '重命名分组',\r\n 'group.renameConfirm': '重命名',\r\n 'group.delete': '删除分组',\r\n 'group.deleteTitle': '删除分组',\r\n 'group.deleteConfirm': '删除后,该分组内的所有项目将移到顶层(不归组)。确定删除?',\r\n 'group.deleteCancel': '取消删除',\r\n 'group.nameDuplicate': '已存在同名分组',\r\n 'group.nameReserved': '该名称不可用',\r\n 'group.pin': '置顶分组',\r\n 'group.unpin': '取消置顶',\r\n 'group.pinned': '已置顶',\r\n 'group.appearance': '颜色与图标…',\r\n 'group.appearanceTitle': '分组外观',\r\n 'group.appearanceDone': '完成',\r\n 'group.color': '颜色',\r\n 'group.colorDefault': '默认',\r\n 'group.icon': '图标',\r\n 'group.iconDefault': '默认图标',\r\n 'group.iconCustom': '自定义字符',\r\n 'group.iconInvalid': '图标需为预设图标或 1–4 个字符',\r\n 'group.icon.section.common': '常用图标',\r\n 'group.icon.section.lab': '实验操作',\r\n 'group.icon.section.materials': '材料结构',\r\n 'group.icon.section.characterization': '表征测试',\r\n 'group.icon.section.devices': '功能器件',\r\n 'group.icon.section.emoji': '常用表情',\r\n 'color.red': '红色',\r\n 'color.orange': '橙色',\r\n 'color.amber': '琥珀',\r\n 'color.green': '绿色',\r\n 'color.teal': '青色',\r\n 'color.blue': '蓝色',\r\n 'color.indigo': '靛蓝',\r\n 'color.purple': '紫色',\r\n 'color.pink': '粉色',\r\n 'color.gray': '灰色',\r\n 'section.topLevel': '顶层项目',\r\n 'section.defaultWorkspace': '默认工作区',\r\n 'manual.saveError': '分组变更保存失败',\r\n 'manual.conflict': '分组已被另一个窗口修改,已同步为最新状态,本次修改未保存,请重试',\r\n 'session.new': '新建会话',\r\n 'session.rename': '重命名会话',\r\n 'session.archive': '归档',\r\n 'session.fork': '派生',\r\n 'session.renameTitle': '重命名会话',\r\n 'session.renamePlaceholder': '会话名称',\r\n 'session.renameConfirm': '重命名',\r\n 'session.renameCancel': '取消',\r\n 'session.renaming': '重命名中…',\r\n 'uncategorized': '未分类',\r\n 'empty.none': '暂无内容',\r\n 'empty.noWorkspaces': '还没有工作区',\r\n 'close': '关闭',\r\n 'cancel': '取消',\r\n 'confirm': '确定',\r\n 'retry': '重试',\r\n 'configUnavailable': '分组配置不可用',\r\n 'collapse': '折叠',\r\n 'expandMore': '展开全部',\r\n 'newSession': '新建会话',\r\n 'quick.title': '快速切换',\r\n 'quick.tab.workspaces': '工作区',\r\n 'quick.tab.sessions': '全部会话',\r\n 'quick.search.placeholder': '搜索工作区…',\r\n 'quick.search.sessions': '搜索会话…',\r\n 'quick.empty.workspaces': '没有匹配的工作区',\r\n 'quick.action.newSession': '新建会话',\r\n 'quick.action.running': '切到运行中的会话',\r\n 'quick.action.noneRunning': '没有正在运行的会话',\r\n 'quick.empty.sessions': '还没有会话',\r\n 'quick.select.hint': '在上方选择一个工作区',\r\n 'quick.hint': 'Ctrl+R 开关 · Enter 打开/新建 · Esc 关闭',\r\n 'tabs.aria': '已打开的会话',\r\n 'tabs.close': '关闭标签',\r\n 'tabs.archive': '归档',\r\n 'tabs.pin': '固定标签',\r\n 'tabs.unpin': '取消固定',\r\n 'tabs.pinned': '已固定(关闭其他时保留)',\r\n 'tabs.rename': '重命名标签',\r\n 'tabs.renameSession': '重命名会话…',\r\n 'tabs.renamePlaceholder': '标签名,留空恢复会话标题',\r\n 'tabs.closeOthers': '关闭其他标签',\r\n 'tabs.closeRight': '关闭右侧标签',\r\n 'tabs.dragHint': '拖动可排序',\r\n}\r\n\r\n/** English dictionary. */\r\nexport const en: WorkspaceGroupsDict = {\r\n 'section.workspaces': 'Workspaces',\r\n 'section.sessions': 'Sessions',\r\n 'search': 'Search',\r\n 'search.placeholder': 'Search sessions…',\r\n 'search.clear': 'Clear',\r\n 'search.noMatches': 'No matching sessions',\r\n 'search.unavailable': 'Search unavailable',\r\n 'search.pending': 'Searching…',\r\n 'search.hasMore': 'Too many results — refine the query',\r\n 'search.results.aria': 'Search results',\r\n 'workspace.add': 'Add workspace',\r\n 'workspace.addBusy': 'Adding…',\r\n 'workspace.addError': 'Add failed',\r\n 'workspace.addErrorTitle': 'Could not add workspace',\r\n 'workspace.rename': 'Rename',\r\n 'workspace.delete': 'Delete',\r\n 'workspace.deleteTitle': 'Delete workspace',\r\n 'workspace.deleteConfirm': 'Only the registration is removed; the directory and session logs stay. Delete?',\r\n 'workspace.deleteCancel': 'Cancel delete',\r\n 'workspace.renaming': 'Renaming…',\r\n 'workspace.deleting': 'Deleting…',\r\n 'workspace.renameTitle': 'Rename workspace',\r\n 'workspace.renamePlaceholder': 'Workspace name',\r\n 'workspace.renameConfirm': 'Rename',\r\n 'workspace.renameCancel': 'Cancel',\r\n 'workspace.moveOutOfGroup': 'Move out of group',\r\n 'workspace.openInFolder': 'Open in folder',\r\n 'workspace.openInFolderError': 'Could not open the folder',\r\n 'folder.title': 'Folders',\r\n 'folder.manage': 'Folders…',\r\n 'folder.listAria': 'Workspace folders',\r\n 'folder.sectionList': 'Project folders',\r\n 'folder.sectionAdd': 'Add a folder',\r\n 'folder.emptyHint': 'No extra folders yet. A folder added below runs its sessions on its own, so the agent can read the files inside it directly.',\r\n 'folder.base': 'Base folder',\r\n 'folder.setRoot': 'Set as root',\r\n 'folder.rootBadge': 'Root',\r\n 'folder.remove': 'Remove from workspace',\r\n 'folder.add': 'Add folder',\r\n 'folder.done': 'Done',\r\n 'folder.duplicate': 'That folder is already in this workspace',\r\n 'folder.conflict': 'Folders changed in another window; synced to the latest state, this edit was not saved — please retry',\r\n 'folder.removeError': 'Could not delete the remote workspace',\r\n 'folder.removeRemotePrompt': 'This cloud folder is backed by its own workspace. Remove the workspace along with it? Its sessions will be deleted too.',\r\n 'folder.removeRemoteDelete': 'Delete workspace too',\r\n 'folder.removeRemoteOnly': 'Remove folder only',\r\n 'folder.addError': 'Could not add the folder',\r\n 'folder.sessionError': 'Could not start a session',\r\n 'folder.saveError': 'Could not save folders',\r\n 'folder.notReady': 'Directory safety information is not loaded. Restart DSH and refresh the page before retrying.',\r\n 'folder.remoteSessionUnsupported': 'This SSH plugin does not fully support subdirectory sessions. Start from the remote workspace root instead; no local terminal fallback is allowed.',\r\n 'folder.remoteHint': 'Enter one folder name. Local workspaces use DSH; remote workspaces use SSH mkdir (existing remote directories are reused). Missing SSH never falls back to a local mirror write.',\r\n 'folder.remoteNeedsSubpath': 'Remote workspaces take a subdirectory, not a picked folder',\r\n 'folder.subpathLabel': 'Folder name',\r\n 'folder.subpathPlaceholder': 'e.g. data',\r\n 'folder.addSubpath': 'Create folder',\r\n 'folder.subpathInvalid': 'Invalid path: use a relative path inside the workspace (no absolute paths, no ..)',\r\n 'folder.cloudSection': 'Cloud folders',\r\n 'folder.profileLabel': 'SSH connection',\r\n 'folder.remotePathLabel': 'Remote directory',\r\n 'folder.remotePathPlaceholder': 'e.g. ~/projects/app',\r\n 'folder.remotePathOrName': 'e.g. ~/projects/app, or a new folder name',\r\n 'folder.createAndAdd': 'Create and add',\r\n 'folder.cloudNoteBoth': 'A path creates a new cloud workspace with its local mirror; a bare name creates that directory under this project’s remote root and attaches it',\r\n 'folder.addRemote': 'Add cloud folder',\r\n 'folder.noProfiles': 'No SSH connection available: configure one in the remote-ssh plugin first',\r\n 'folder.profilesError': 'Could not read SSH connections',\r\n 'folder.cloudTag': 'Cloud',\r\n 'folder.localTag': 'Local',\r\n 'folder.memberMissing': 'The standalone workspace behind this folder no longer exists. Remove the folder and add it again.',\r\n 'folder.memberNested': 'That directory is a project with folders of its own, so it cannot join as a folder.',\r\n 'folder.alreadyRoot': 'That is the root of this project, so it cannot join as a folder.',\r\n 'folder.addAria': 'Ways to add a folder',\r\n 'folder.tabLocal': 'Local directory',\r\n 'folder.tabCloud': 'Cloud directory',\r\n 'folder.pickLocal': 'Choose a local directory…',\r\n 'folder.localNote': 'Pick a directory on this machine to use as a folder of this project',\r\n 'folder.localIntoRemote': 'This project lives on the SSH host; a local directory joins it as a local folder',\r\n 'folder.cloudNote': 'Mirrors that remote directory locally and registers a workspace for its sessions',\r\n 'folder.browse': 'Browse…',\r\n 'folder.browseTitle': 'Choose a cloud folder',\r\n 'folder.browseListAria': 'Remote directory list',\r\n 'folder.browseNote': 'Only directories are listed: enter one, then choose the current directory with the button below.',\r\n 'folder.browseFailed': 'Could not read the remote directory',\r\n 'folder.chooseHere': 'Choose this directory',\r\n 'folder.up': 'Up',\r\n 'folder.home': 'Home',\r\n 'folder.refresh': 'Refresh',\r\n 'folder.loading': 'Reading the remote directory…',\r\n 'folder.loadingState': 'Reading folder configuration…',\r\n 'folder.loadError': 'Could not read folder configuration (not shown as an empty grouping)',\r\n 'folder.refreshError': 'Could not refresh folder configuration; showing the last confirmed state',\r\n 'folder.retry': 'Retry',\r\n 'folder.retryDraft': 'Reapply my changes',\r\n 'folder.discardDraft': 'Keep server version',\r\n 'folder.conflictDetail': 'Folders changed in another window. The server version is shown below; your unsaved changes are kept here and can be reapplied.',\r\n 'folder.emptyDir': 'No subdirectories here',\r\n 'group.create': 'New group',\r\n 'group.createTitle': 'New group',\r\n 'group.createPlaceholder': 'Group name',\r\n 'group.createConfirm': 'Create',\r\n 'group.createCancel': 'Cancel',\r\n 'group.rename': 'Rename group',\r\n 'group.renameTitle': 'Rename group',\r\n 'group.renameConfirm': 'Rename',\r\n 'group.delete': 'Delete group',\r\n 'group.deleteTitle': 'Delete group',\r\n 'group.deleteConfirm': 'Deleting removes this group; every project inside it moves to the top level (ungrouped). Delete?',\r\n 'group.deleteCancel': 'Cancel delete',\r\n 'group.nameDuplicate': 'A group with this name already exists',\r\n 'group.nameReserved': 'This name is not available',\r\n 'group.pin': 'Pin group',\r\n 'group.unpin': 'Unpin group',\r\n 'group.pinned': 'Pinned',\r\n 'group.appearance': 'Color & icon…',\r\n 'group.appearanceTitle': 'Group appearance',\r\n 'group.appearanceDone': 'Done',\r\n 'group.color': 'Color',\r\n 'group.colorDefault': 'Default',\r\n 'group.icon': 'Icon',\r\n 'group.iconDefault': 'Default icon',\r\n 'group.iconCustom': 'Custom character',\r\n 'group.iconInvalid': 'Use a preset icon or 1–4 characters',\r\n 'group.icon.section.common': 'Common icons',\r\n 'group.icon.section.lab': 'Lab operations',\r\n 'group.icon.section.materials': 'Material structures',\r\n 'group.icon.section.characterization': 'Characterization',\r\n 'group.icon.section.devices': 'Functional devices',\r\n 'group.icon.section.emoji': 'Emoji',\r\n 'color.red': 'Red',\r\n 'color.orange': 'Orange',\r\n 'color.amber': 'Amber',\r\n 'color.green': 'Green',\r\n 'color.teal': 'Teal',\r\n 'color.blue': 'Blue',\r\n 'color.indigo': 'Indigo',\r\n 'color.purple': 'Purple',\r\n 'color.pink': 'Pink',\r\n 'color.gray': 'Gray',\r\n 'section.topLevel': 'Top-level projects',\r\n 'section.defaultWorkspace': 'Default workspace',\r\n 'manual.saveError': 'Could not save group changes',\r\n 'manual.conflict': 'Groups changed in another window; synced to the latest state, this edit was not saved — please retry',\r\n 'session.new': 'New Session',\r\n 'session.rename': 'Rename session',\r\n 'session.archive': 'Archive',\r\n 'session.fork': 'Fork',\r\n 'session.renameTitle': 'Rename session',\r\n 'session.renamePlaceholder': 'Session name',\r\n 'session.renameConfirm': 'Rename',\r\n 'session.renameCancel': 'Cancel',\r\n 'session.renaming': 'Renaming…',\r\n 'uncategorized': 'Uncategorized',\r\n 'empty.none': 'Nothing here',\r\n 'empty.noWorkspaces': 'No workspaces yet',\r\n 'close': 'Close',\r\n 'cancel': 'Cancel',\r\n 'confirm': 'Confirm',\r\n 'retry': 'Retry',\r\n 'configUnavailable': 'Grouping config unavailable',\r\n 'collapse': 'Collapse',\r\n 'expandMore': 'Show all',\r\n 'newSession': 'New Session',\r\n 'quick.title': 'Quick switch',\r\n 'quick.tab.workspaces': 'Workspaces',\r\n 'quick.tab.sessions': 'All sessions',\r\n 'quick.search.placeholder': 'Search workspaces…',\r\n 'quick.search.sessions': 'Search sessions…',\r\n 'quick.empty.workspaces': 'No matching workspaces',\r\n 'quick.action.newSession': 'New Session',\r\n 'quick.action.running': 'Switch to running session',\r\n 'quick.action.noneRunning': 'No running session',\r\n 'quick.empty.sessions': 'No sessions yet',\r\n 'quick.select.hint': 'Pick a workspace above',\r\n 'quick.hint': 'Ctrl+R toggle · Enter open/new · Esc close',\r\n 'tabs.aria': 'Open sessions',\r\n 'tabs.close': 'Close tab',\r\n 'tabs.archive': 'Archive',\r\n 'tabs.pin': 'Pin tab',\r\n 'tabs.unpin': 'Unpin tab',\r\n 'tabs.pinned': 'Pinned (kept by Close others)',\r\n 'tabs.rename': 'Rename tab',\r\n 'tabs.renameSession': 'Rename session…',\r\n 'tabs.renamePlaceholder': 'Tab name — blank restores the session title',\r\n 'tabs.closeOthers': 'Close other tabs',\r\n 'tabs.closeRight': 'Close tabs to the right',\r\n 'tabs.dragHint': 'Drag to reorder',\r\n}\r\n","/**\r\n * @dsh-xhl/workspace-groups client half. ONE registration, plus a DOM-seated\r\n * view that hangs off it:\r\n *\r\n * The three-level grouped workspace browser into `sidebar.workspaces`,\r\n * shadowing the official ui-workspace browser.\r\n *\r\n * Shadowing mechanics (SlotCore semantics):\r\n * - `sidebar.workspaces` is a `single`/`root` slot. The official browser\r\n * registers at priority 0; this entry registers at priority -1, and the\r\n * single-cell shadow rule makes the LOWEST priority the winner — the\r\n * sidebar renders this browser instead of the official one.\r\n * - This entry deliberately declares NO child slots: the official entry\r\n * already declared `sidebar.workspaces.directoryFlow` (a second declaration\r\n * of an occupied child key throws). Add Workspace is therefore self-\r\n * contained — the shared navigation service + `workspaces.create()`, no\r\n * hole.\r\n *\r\n * The session tab strip is NOT a second registration. It renders into a DOM\r\n * seat at the head of the conversation column (`pI_x6G_centerCol`) because that\r\n * column declares no child slot — its only child is the `main` slot's occupant\r\n * — so there is nowhere to register. See `tab-seat.ts` for the injection and\r\n * `SessionTabs.tsx` for the portal.\r\n *\r\n * Two consequences of that choice, both deliberate:\r\n * - The strip is a CHILD of this entry's component, so it inherits this\r\n * fiber's frame; it needs no injected seam, no cross-entry callback set,\r\n * and the rename dialog stays owned by one place.\r\n * - The tab store is seated by exactly ONE entry. Registering one handle\r\n * under a second, differently-scoped slot throws inside the registry\r\n * (\"one handle, one scope\") and would abort this whole `apply()` — which\r\n * is precisely why the strip does not occupy a slot.\r\n *\r\n * 0.1.6 适配:导航(选中会话 / New Session / fork / archive / 目录选择)从\r\n * `ctx.sessions` 抽到 ui-workspace 提供的 `ctx.uiWorkspace` 服务\r\n * (`ISessions` 现在只有目录 / retain / search 能力,选中由 `mainView` 保留位\r\n * 表达)。本插件不再自建 connectWorkspace/recentWorkspace 语义,全部委托给该\r\n * 服务,只保留改名、删除、排序、搜索等数据动作。\r\n */\r\nimport type { Context } from '@deepseek-ai/cordis'\r\n// Type-only service merges: sessions/workspaces controllers, the ui-workspace\r\n// navigation service face (ctx.uiWorkspace), locale dictionary seat, the\r\n// SlotRegistry, and the sidebar SlotMap.\r\nimport type {} from '@deepseek-ai/dsh-api-session-controller/client'\r\nimport type {} from '@deepseek-ai/dsh-api-workspace-controller/client'\r\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\r\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\r\nimport type {} from '@deepseek-ai/dsh-client-ui-workspace/client'\r\nimport type { SnapshotSelectorHook } from '@deepseek-ai/dsh-client-ui-slots'\r\n// `useWorkspaces` is contributed by the ui-workspace browser domain (same\r\n// declaration as the official ui-workspace client half).\r\nimport type { WorkspaceSnapshot } from '@deepseek-ai/dsh-api-workspace-controller/client'\r\nimport type { SessionId } from '@deepseek-ai/dsh-session/types'\r\nimport type { GroupsBrowserInjected } from './contract.ts'\r\nimport { createGroupsViewStore } from './stores.ts'\r\nimport { createSessionTabsStore } from './tab-store.ts'\r\nimport { loadTabs, saveTabs } from './tab-persist.ts'\r\nimport { createStoreHook } from './store-hook.ts'\r\nimport { shouldOpenTab, type TabOpenMode } from './tabs.ts'\r\nimport { GroupsBrowser } from './GroupsBrowser.tsx'\r\nimport { directoryFlowFromEntry } from './directory-flow.ts'\r\nimport { en, zh, type WorkspaceGroupsKey } from './locales.ts'\r\n\r\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\r\n interface LocaleNamespaceMap {\r\n /** The workspace-groups browsing region copy. */\r\n workspaceGroups: WorkspaceGroupsKey\r\n }\r\n\r\n interface GlobalStandardProps {\r\n /** Selector hook over the pure Workspace Controller snapshot. */\r\n useWorkspaces: SnapshotSelectorHook\r\n }\r\n}\r\n\r\n/** Dictionary namespace owned by this plugin. */\r\nconst NS = 'workspaceGroups'\r\n\r\n/**\r\n * Tab visibility policy. `auto` is the behaviour the feature was asked for —\r\n * opening a session that has no tab yet adds one at the front of the strip;\r\n * `manual` leaves the strip to callers that drive `openTab` themselves.\r\n */\r\nconst TAB_OPEN_MODE: TabOpenMode = 'auto'\r\n\r\n/**\r\n * Required services (cordis fiber inject; 0.1.6 service roster). `uiWorkspace`\r\n * is the shipped navigation face this entry delegates selection to.\r\n */\r\nexport const inject = ['slots', 'sessions', 'workspaces', 'uiWorkspace', 'locale']\r\n\r\n/**\r\n * Register the grouped browser once the sidebar slot declaration is on the\r\n * ledger. Inject factory returns plain callbacks; data reads use the\r\n * framework's global hooks.\r\n * @param ctx - client root context.\r\n */\r\nexport function apply(ctx: Context): void {\r\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), '@dsh-xhl/workspace-groups: dictionaries')\r\n\r\n // ONE store, ONE scope. The tab store is seated only by the\r\n // `sidebar.workspaces` entry below (scope root); the strip reads it as a\r\n // plain prop because it renders as a CHILD of that entry through a DOM\r\n // portal, not as a second slot occupant. Seating the same handle under a\r\n // session-scoped slot as well throws inside the registry\r\n // (one handle, one scope) and would abort this whole apply().\r\n const tabsStore = createSessionTabsStore()\r\n const tabInstance = tabsStore.create()\r\n const tabWrites = tabInstance.actions\r\n\r\n // Persist the strip on the HOST, not in browser storage: the origin includes\r\n // the port and every launch picks a new one, so localStorage/sessionStorage\r\n // both start empty next time.\r\n //\r\n // Writes are GATED until the initial restore has settled. The store starts\r\n // empty and the browser's own effects run before the host read resolves, so an\r\n // ungated subscriber would write that empty state over the stored tabs —\r\n // erasing exactly what it was supposed to restore. `hydrated` is the latch.\r\n let hydrated = false\r\n ctx.effect(() => {\r\n const stop = tabInstance.subscribe(() => {\r\n if (!hydrated) return\r\n void saveTabs({\r\n order: tabInstance.getSnapshot().order,\r\n tabs: tabInstance.getSnapshot().tabs,\r\n })\r\n })\r\n return () => { stop() }\r\n }, '@dsh-xhl/workspace-groups: tab persistence')\r\n\r\n // Hydrate once from the host, then open the write gate.\r\n //\r\n // `restore` is a no-op if the user already opened a tab while this was in\r\n // flight, so a slow response cannot discard live work. The settle deliberately\r\n // does NOT write: writing the strip here would erase the stored tabs whenever\r\n // the read came back empty for a transient reason (host still booting, a\r\n // dropped request). Only a real state CHANGE persists, via the subscriber.\r\n ctx.effect(() => {\r\n let cancelled = false\r\n void loadTabs().then((tabs) => {\r\n if (cancelled) return\r\n if (tabs.length > 0) {\r\n tabWrites.restore(tabs.map(tab => ({\r\n sessionId: tab.sessionId as SessionId,\r\n order: tab.order,\r\n ...(tab.pinned === true ? { pinned: true } : {}),\r\n ...(tab.title !== undefined ? { title: tab.title } : {}),\r\n })))\r\n }\r\n hydrated = true\r\n }).catch(() => {\r\n // The read failed; leave the gate open so the user's own actions persist,\r\n // but never write on the strength of a failed read.\r\n if (!cancelled) hydrated = true\r\n })\r\n return () => { cancelled = true }\r\n }, '@dsh-xhl/workspace-groups: tab restore')\r\n\r\n const searchSessions: GroupsBrowserInjected['searchSessions'] = async (query, signal) => {\r\n const result = await ctx.sessions.search(query, signal)\r\n if (!result.ok) throw new Error(result.error.message)\r\n return result.value\r\n }\r\n\r\n const browserInjected = (): GroupsBrowserInjected => ({\r\n // Navigation verbs belong to the shipped ui-workspace service: it owns the\r\n // retained `mainView` selection, supersession and pending-navigation\r\n // cancellation (0.1.6 moved them out of `ctx.sessions`).\r\n startSession: (workspaceId) => { ctx.uiWorkspace.startSession(workspaceId) },\r\n // Folder rows create a real Session rooted in that folder. `cwd` stays out\r\n // of the call for the base folder (the Workspace's canonical directory),\r\n // where the controller already defaults to `WorkspaceView.path`.\r\n createSessionIn: async (workspaceId, cwd) => {\r\n const sessionId = await ctx.sessions.create({\r\n workspaceId,\r\n ...(cwd === undefined ? {} : { cwd }),\r\n })\r\n ctx.uiWorkspace.openSession(sessionId)\r\n return sessionId\r\n },\r\n open: (sessionId) => { ctx.uiWorkspace.openSession(sessionId) },\r\n forkSession: (sessionId) => {\r\n ctx.uiWorkspace.forkSession(sessionId).catch((reason: unknown) => {\r\n console.warn('fork session failed:', reason)\r\n })\r\n },\r\n archiveSession: async (sessionId) => {\r\n await ctx.uiWorkspace.archiveSession(sessionId)\r\n // The tab is deliberately LEFT ALONE. Archiving hides the session from the\r\n // grouped surfaces, but a tab is something the user opened, and the rule\r\n // for this strip is that only they close one — an automatic close here\r\n // would silently drop work they were keeping an eye on. The chip keeps\r\n // rendering (falling back to the session id when the title no longer\r\n // resolves).\r\n },\r\n pickDirectory: () => ctx.uiWorkspace.pickDirectory(),\r\n // Our shadow entry cannot own/render the official browser's child slot.\r\n // Reuse the elected self-contained picker and its actual injected services.\r\n getDirectoryFlow: () => directoryFlowFromEntry(ctx.slots.entriesOfSlot('sidebar.workspaces.directoryFlow')[0]),\r\n createDirectory: (path, name) => ctx.uiWorkspace.createDirectory(path, name),\r\n searchSessions,\r\n searchResultLimit: ctx.sessions.searchResultLimit,\r\n // Directory-flow hole occupancy. The official ui-workspace browser gates\r\n // its \"Add workspace…\" affordance on the hole being occupied (the shipped\r\n // picker package's client half fills it); this browser drives the picker\r\n // itself through `pickDirectory`, so it must keep the hole occupied or the\r\n // official entry (still live at priority 0) would silently withdraw the\r\n // affordance.\r\n hooks: {\r\n directoryFlow: {\r\n getSnapshot: () => true,\r\n subscribe: () => () => {},\r\n },\r\n },\r\n // Data-only verbs stay on the controllers.\r\n renameSession: async (sessionId, title) => {\r\n const session = ctx.sessions.binding(sessionId)?.session\r\n if (session === undefined) throw new Error(`unknown session \"${sessionId}\"`)\r\n const result = await session.rename(title)\r\n if (!result.ok) throw new Error(result.error.message)\r\n },\r\n renameWorkspace: async (workspaceId, title) => { await ctx.workspaces.rename(workspaceId, title) },\r\n deleteWorkspace: async (workspaceId) => { await ctx.workspaces.delete(workspaceId) },\r\n insertWorkspaceBefore: async (workspaceId, beforeWorkspaceId) => {\r\n await ctx.workspaces.insertBefore(workspaceId, beforeWorkspaceId)\r\n },\r\n insertSessionBefore: async (workspaceId, sessionId, beforeSessionId) => {\r\n await ctx.workspaces.insertSessionBefore(workspaceId, sessionId, beforeSessionId)\r\n },\r\n createWorkspace: input => ctx.workspaces.create(input),\r\n // \"Show a tab for what I just opened\" — but only while it is actually in\r\n // play. The browser decides per session (see `shouldOpenTab`): a draft that\r\n // has not been talked to, and settled history, both stay out of the strip.\r\n // The status arrives from the caller because it is a live UI fact read\r\n // through a hook, which this (non-React) factory cannot reach.\r\n openTab: (sessionId, status) => {\r\n const summary = ctx.sessions.list.getSnapshot().byId[sessionId]\r\n if (shouldOpenTab(TAB_OPEN_MODE, summary, status)) tabWrites.touch(sessionId)\r\n },\r\n // The strip rides this entry's own store seat, so it needs both faces\r\n // explicitly: a selector hook over the one live instance, and the baked\r\n // writes. Both come from the same instance the browser writes through.\r\n useTabs: createStoreHook(tabInstance),\r\n tabActions: tabWrites,\r\n })\r\n\r\n // priority: -1 — lower than the official browser's default 0, so the\r\n // single-slot shadow rule elects this entry. No children declaration: the\r\n // official entry already owns `sidebar.workspaces.directoryFlow`.\r\n //\r\n // The official WorkspaceBrowser entry is NEVER disposed — shadowing only\r\n // changes which entry renders (activation just bumps the store's mount\r\n // count). Both entries live at the same cell, so if this one ever throws\r\n // during render the slot core retires it for the rest of its registration's\r\n // life and silently falls back to the official browser. Anything that can\r\n // throw belongs outside the hot path.\r\n ctx.slots.inject('sidebar.workspaces', () => ctx.slots.register(\r\n {\r\n name: 'sidebar.workspaces',\r\n priority: -1,\r\n store: createGroupsViewStore(),\r\n inject: browserInjected,\r\n locale: NS,\r\n registrant: 'workspace-groups-local',\r\n },\r\n GroupsBrowser,\r\n ))\r\n}\r\n","/**\n * @zhangfengshun/dsh-remote-ssh — Client 半边(静态 DSH Web 插件,浏览器 bundle)\n *\n * 远程文件与远程终端已合并到内置「文件」和「终端」页签:\n * - 远程文件:内置「文件」页签通过 fs.* 拦截直接 SSH 读写远程文件,无需同步。\n * 远程终端由内置「终端」页签提供(shell wrapper 自动 SSH)。\n * - 远程终端:shell wrapper 自动检测工作区 .remote-ssh.json,在远程工作区中打开 SSH 终端。\n * 需在 better-sidebar 设置中将 shell 指向 wrapper 脚本(见 README)。\n * 仍保留隐藏的 remssh:editor 页签用于远程文件编辑器。\n * 在 DSH 设置页注册「远程连接」小节管理连接配置和远程工作区;\n * 同时接管原生「添加工作区」流程提供「本地目录 / 远程目录」两选。\n */\n// --- merged-bundle transform (scripts/build-remote-ssh-client.mjs) ---\n// Upstream registers this factory under its own package id; the merged\n// package registers ONE client row, so the factory is exported instead\n// and applied by src/client/index.ts. Body below is upstream-verbatim.\nexport default (require) => {\n var module = { exports: {} };\n var exports = module.exports;\n var React = require(\"react\");\n var primitives = require(\"@deepseek-ai/dsh-client-ui-primitives\");\n var Modal = primitives.Modal;\n\n function h(tag, props) {\n var args = [tag, props];\n for (var i = 2; i < arguments.length; i++) args.push(arguments[i]);\n return React.createElement.apply(React, args);\n }\n\n var CSS =\n // 颜色全部使用 DSH 主题 token(--dsw-alias-*),跟随 body[data-ds-dark-theme] 自动切换明暗主题。\n \".rssh-row{margin:6px 0}.rssh-label{color:var(--dsw-alias-label-caption);font-size:11px;display:block;margin-bottom:2px}\" +\n \".rssh-input{width:100%;box-sizing:border-box;background:var(--dsw-specific-input-major);color:var(--dsw-alias-label-primary);border:1px solid var(--dsw-alias-border-l2);border-radius:4px;padding:5px 7px;margin:3px 0;font-size:12px}\" +\n \".rssh-select{width:100%;box-sizing:border-box;background:var(--dsw-specific-input-major);color:var(--dsw-alias-label-primary);border:1px solid var(--dsw-alias-border-l2);border-radius:4px;padding:5px 7px;margin:3px 0;font-size:12px}\" +\n \".rssh-btn{background:var(--dsw-alias-button-ghost-active-fill);color:var(--dsw-alias-label-primary);border:1px solid var(--dsw-alias-border-l2);border-radius:4px;padding:4px 9px;cursor:pointer;font-size:12px}\" +\n \".rssh-btn:hover{background:var(--dsw-alias-button-ghost-active-hover)}.rssh-btn:disabled{opacity:.5;cursor:default}\" +\n \".rssh-card{padding:8px 10px;border:1px solid var(--dsw-alias-border-l1);border-radius:6px;margin:8px 0;background:var(--dsw-alias-bg-layer-2)}\" +\n \".rssh-title{font-weight:600;font-size:13px}.rssh-sub{color:var(--dsw-alias-label-tertiary);font-size:11px}\" +\n \".rssh-actions{margin-top:6px;display:flex;gap:5px;flex-wrap:wrap}\" +\n \".rssh-tree-item{display:flex;align-items:center;gap:5px;padding:3px 5px;cursor:pointer;border-radius:3px}\" +\n \".rssh-tree-item:hover{background:var(--dsw-alias-interactive-bg-hover)}\" +\n \".rssh-tree-dir{color:var(--dsw-alias-state-business-primary)}.rssh-tree-file{color:var(--dsw-alias-label-primary)}\" +\n \".rssh-tree-size{color:var(--dsw-alias-label-caption);font-size:11px;margin-left:auto}\" +\n \".rssh-pathbar{display:flex;gap:4px;align-items:center;margin:4px 0}\" +\n \".rssh-pathbar .rssh-input{flex:1;margin:0}\" +\n \".rssh-content{white-space:pre-wrap;font-family:Consolas,monospace;font-size:12px;background:var(--dsw-alias-markdown-code-block);color:var(--dsw-alias-label-primary);padding:8px;border-radius:4px;margin-top:6px;max-height:400px;overflow:auto}\" +\n \".rssh-terminal{background:var(--dsw-alias-markdown-code-block);color:var(--dsw-alias-label-primary);border-radius:4px;padding:6px;margin-top:8px;font-family:Consolas,monospace;font-size:12px}\" +\n \".rssh-terminal-out{white-space:pre-wrap;max-height:320px;overflow:auto;min-height:120px;line-height:1.4}\" +\n \".rssh-terminal-bar{display:flex;gap:5px;align-items:center;margin-bottom:4px}\" +\n \".rssh-terminal-input-row{display:flex;gap:4px;margin-top:5px}.rssh-terminal-input-row .rssh-input{flex:1}\" +\n \".rssh-ok{color:var(--dsw-alias-state-success-primary)}.rssh-err{color:var(--dsw-alias-state-error-primary)}.rssh-muted{color:var(--dsw-alias-label-tertiary);font-size:12px;padding:6px 0}\" +\n \".rssh-empty{padding:12px;text-align:center;color:var(--dsw-alias-label-tertiary);font-size:12px}\" +\n \".rssh-flow-dialog{width:690px!important;max-width:94vw!important;min-width:460px;resize:horizontal;overflow:auto!important}\" +\n // 添加工作区弹窗:上方本地/远程分段切换 + 路径栏 + 文件树\n \".rssh-seg{display:flex;gap:0;margin-bottom:8px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;overflow:hidden}\" +\n \".rssh-seg-btn{flex:1;padding:7px 12px;text-align:center;cursor:pointer;font-size:12px;font-weight:500;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);border:none;transition:background .15s}\" +\n \".rssh-seg-btn:hover{background:var(--dsw-alias-interactive-bg-hover)}\" +\n \".rssh-seg-btn.active{background:var(--dsw-alias-state-business-primary);color:#fff}\" +\n \".rssh-pick-tree{border:1px solid var(--dsw-alias-border-l1);border-radius:4px;max-height:240px;overflow-y:auto;margin-top:4px;background:var(--dsw-alias-bg-layer-2)}\" +\n \".rssh-pick-empty{padding:12px;text-align:center;color:var(--dsw-alias-label-tertiary);font-size:11px}\";\n\n // ---- 国际化(跟随 DSH 设置中的语言自动切换)----\n var NS = \"dsh-remote-ssh\";\n var zh = {\n \"tabs.files\": \"远程文件\",\n \"tabs.term\": \"远程终端\",\n \"settings.nav\": \"远程连接\",\n \"settings.desc\": \"管理 Remote-SSH 的远程连接配置(SSH 密钥或密码认证)。\",\n \"settings.empty\": \"还没有连接配置。请在下方添加。\",\n \"settings.add\": \"添加连接\",\n \"settings.workspaces\": \"远程工作区\",\n \"settings.name\": \"名称\",\n \"settings.namePlaceholder\": \"如:我的超算\",\n \"settings.host\": \"主机 host\",\n \"settings.hostPlaceholder\": \"login.example.com\",\n \"settings.port\": \"端口 port\",\n \"settings.user\": \"用户名 user\",\n \"settings.userPlaceholder\": \"your-username\",\n \"settings.auth\": \"认证方式\",\n \"settings.key\": \"密钥 (推荐)\",\n \"settings.password\": \"密码\",\n \"settings.keyPath\": \"私钥路径 keyPath\",\n \"settings.keyPathPlaceholder\": \"~/.ssh/id_rsa\",\n \"settings.passwordField\": \"密码 password\",\n \"settings.remoteRoot\": \"远程根目录 remoteRoot\",\n \"settings.proxyJump\": \"跳板机 ProxyJump\",\n \"settings.test\": \"测试连接\",\n \"settings.saved\": \"已保存\",\n \"settings.connOk\": \"连接成功\",\n \"settings.connFail\": \"连接失败: \",\n \"settings.errSave\": \"保存失败\",\n \"settings.guards\": \"写回与终端(进阶)\",\n \"settings.guardsHint\": \"终端起不来时,把 node 可执行文件的绝对路径填在这里(issue #23);写回失败与远端新鲜度检查控制 agent 的 write/edit 要不要推到远端(issue #24)。\",\n \"settings.nodePath\": \"node 绝对路径 nodePath(留空 = 自动解析)\",\n \"settings.writeBackFailure\": \"写回推送失败时\",\n \"settings.wbError\": \"让模型看见(工具报错,推荐)\",\n \"settings.wbLog\": \"只写日志(不打扰模型)\",\n \"settings.writeBackFreshness\": \"推之前检查远端是否被改过(发现被改过就不推、并报告;推荐开着)\",\n \"settings.wsWriteBack\": \"该工作区启用写回(agent 的 write/edit 同步到远端)\",\n \"settings.wsWriteBackExclude\": \"写回排除(逗号或换行分隔,如 _patch/, *.log, wbdeep/**)\",\n \"settings.saveGuards\": \"保存这一项\",\n \"settings.wsSyncPaths\": \"同步范围(逗号或换行分隔,如 .dsh;留空 = 整树)\",\n \"settings.wsSyncExclude\": \"同步排除(逗号或换行分隔,如 data/, *.log)\",\n \"settings.wsSyncMaxBytes\": \"同步体积上限(GiB,留空 = 默认 2 GiB)\",\n \"settings.syncScope\": \"同步范围(进阶)\",\n \"settings.syncScopeHint\": \"只同步需要的子路径,避免整树 tar。对远程路径是 ~ 的工作区尤其重要:整树会先被体积上限拒绝(issue #28)。留空 = 整树。\",\n \"settings.defaultSyncPaths\": \"新工作区的默认同步范围(逗号或换行分隔)\",\n \"settings.defaultSyncExclude\": \"新工作区的默认同步排除\",\n \"settings.defaultSyncMaxBytes\": \"默认同步体积上限(GiB,留空 = 内置 2 GiB)\",\n \"sync.upDone\": \"推送完成\",\n \"sync.upFail\": \"推送失败: \",\n \"common.selectProfile\": \"— 选择连接 —\",\n \"common.profile\": \"连接配置\",\n \"common.save\": \"保存\",\n \"common.open\": \"打开\",\n \"common.close\": \"关闭\",\n \"common.noEntries\": \"(无子目录)\",\n \"common.delete\": \"删除\",\n \"common.up\": \"⬆ 上级\",\n \"common.loading\": \"加载中…\",\n \"common.processing\": \"处理中…\",\n \"common.errList\": \"读取目录失败\",\n \"files.workspace\": \"远程工作区\",\n \"files.selectWorkspace\": \"— 选择工作区 —\",\n \"files.orProfile\": \"或直接选连接配置\",\n \"files.defaultDir\": \"默认目录(打开该工作区时进入的远程目录)\",\n \"files.reading\": \"读取中…\",\n \"files.errRead\": \"读取失败\",\n \"files.errSave\": \"保存失败\",\n \"files.errSaveDefaultDir\": \"保存默认目录失败\",\n \"files.binary\": \"二进制文件,无法预览\",\n \"term.title\": \"终端 {id}\",\n \"term.exited\": \" (已退出)\",\n \"term.connecting\": \"正在连接…\",\n \"term.noOutput\": \"(无输出)\",\n \"term.inputPlaceholder\": \"输入命令后回车…\",\n \"term.send\": \"发送\",\n \"term.needProfile\": \"请先选择连接配置\",\n \"term.newTerminal\": \"+ 新建终端\",\n \"term.emptyHint\": \"从上面的连接配置新建一个终端,直接操作远程环境。\",\n \"term.errSpawn\": \"启动终端失败\",\n \"picker.dir\": \"目录\",\n \"picker.choose\": \"选择此目录\",\n \"picker.errNameEmpty\": \"目录名不能为空\",\n \"picker.errNameBad\": \"目录名不能包含 / 或 \\\\,也不能是 . 或 ..\",\n \"flow.localTitle\": \"选择本地目录\",\n \"flow.remoteTitle\": \"选择远程目录\",\n \"flow.localDir\": \"本地目录\",\n \"flow.remoteDir\": \"远程目录\",\n \"flow.addWsTitle\": \"添加工作区\",\n \"flow.localSeg\": \"📁 本地目录\",\n \"flow.remoteSeg\": \"🌐 远程目录\",\n \"flow.syncPaths\": \"同步范围(可选,留空 = 全局默认/整树)\",\n \"flow.browse\": \"浏览\",\n \"flow.chooseRemote\": \"选择远程目录…\",\n \"flow.backLocal\": \"← 选择本地目录\",\n \"flow.errCreate\": \"创建远程工作区失败\",\n \"flow.errMkdir\": \"新建目录失败\",\n \"settings.importSshConfig\": \"从 ~/.ssh/config 导入…\",\n \"settings.importTitle\": \"导入 ~/.ssh/config 主机\",\n \"settings.noneFound\": \"未在 ~/.ssh/config 中发现可用主机\",\n \"settings.imported\": \"已导入 {n} 个连接\",\n \"sync.down\": \"⬇ 同步\",\n \"sync.up\": \"⬆ 推送\",\n \"sync.syncing\": \"同步中…\",\n \"sync.pushing\": \"推送中…\",\n \"sync.done\": \"同步完成\",\n \"sync.fail\": \"同步失败\",\n \"ops.search\": \"🔍 搜索\",\n \"ops.find\": \"按名查找\",\n \"ops.searchPh\": \"正则或关键词…\",\n \"ops.globPh\": \"*.py\",\n \"ops.newDir\": \"📁 新建目录\",\n \"ops.newDirPh\": \"目录名\",\n \"ops.rename\": \"✏ 重命名/移动\",\n \"ops.renamePh\": \"目标路径\",\n \"ops.delete\": \"🗑 删除\",\n \"ops.confirmDel\": \"确认删除远程文件/目录?(不可恢复)\",\n \"ops.grepTitle\": \"远程内容搜索 (grep)\",\n \"ops.globTitle\": \"按文件名查找 (glob)\",\n \"ops.mkdirTitle\": \"新建远程目录\",\n \"ops.moveTitle\": \"移动/重命名\",\n \"ops.deleteTitle\": \"删除远程文件/目录\",\n \"ops.noMatch\": \"无匹配\",\n \"ops.done\": \"操作完成\",\n \"ops.fail\": \"操作失败\"\n };\n var en = {\n \"tabs.files\": \"Remote Files\",\n \"tabs.term\": \"Remote Terminal\",\n \"settings.nav\": \"Remote Connections\",\n \"settings.desc\": \"Manage Remote-SSH connection profiles (SSH key or password authentication).\",\n \"settings.empty\": \"No connection profiles yet. Add one below.\",\n \"settings.add\": \"Add Profile\",\n \"settings.workspaces\": \"Remote Workspaces\",\n \"settings.name\": \"Name\",\n \"settings.namePlaceholder\": \"e.g. My HPC\",\n \"settings.host\": \"Host\",\n \"settings.hostPlaceholder\": \"login.example.com\",\n \"settings.port\": \"Port\",\n \"settings.user\": \"User\",\n \"settings.userPlaceholder\": \"your-username\",\n \"settings.auth\": \"Authentication\",\n \"settings.key\": \"Key (recommended)\",\n \"settings.password\": \"Password\",\n \"settings.keyPath\": \"Private key path (keyPath)\",\n \"settings.keyPathPlaceholder\": \"~/.ssh/id_rsa\",\n \"settings.passwordField\": \"Password\",\n \"settings.remoteRoot\": \"Remote root (remoteRoot)\",\n \"settings.proxyJump\": \"ProxyJump (jump host)\",\n \"settings.test\": \"Test Connection\",\n \"settings.saved\": \"Saved\",\n \"settings.connOk\": \"Connected\",\n \"settings.connFail\": \"Connection failed: \",\n \"settings.errSave\": \"Save failed\",\n \"settings.guards\": \"Write-back & terminal (advanced)\",\n \"settings.guardsHint\": \"If the integrated terminal cannot start, put the absolute path of node here (issue #23). The other two control whether the agent's write/edit is pushed to the remote (issue #24).\",\n \"settings.nodePath\": \"Absolute path of node (nodePath; empty = auto-resolve)\",\n \"settings.writeBackFailure\": \"When a write-back push fails\",\n \"settings.wbError\": \"Make it visible to the model (tool error, recommended)\",\n \"settings.wbLog\": \"Log only (do not disturb the model)\",\n \"settings.writeBackFreshness\": \"Check the remote before pushing (skip + report if it changed remotely; recommended on)\",\n \"settings.wsWriteBack\": \"Enable write-back for this workspace (agent write/edit syncs to the remote)\",\n \"settings.wsWriteBackExclude\": \"Write-back excludes (comma or newline separated, e.g. _patch/, *.log, wbdeep/**)\",\n \"settings.saveGuards\": \"Save this item\",\n \"settings.wsSyncPaths\": \"Sync scope (comma or newline separated, e.g. .dsh; empty = whole tree)\",\n \"settings.wsSyncExclude\": \"Sync excludes (comma or newline separated, e.g. data/, *.log)\",\n \"settings.wsSyncMaxBytes\": \"Sync size limit (GiB, empty = default 2 GiB)\",\n \"settings.syncScope\": \"Sync scope (advanced)\",\n \"settings.syncScopeHint\": \"Sync only the sub-paths you need instead of a whole-tree tar. This matters for workspaces whose remote path is ~ — a whole-tree sync is refused by the size sentinel first (issue #28). Empty = whole tree.\",\n \"settings.defaultSyncPaths\": \"Default sync scope for new workspaces (comma or newline separated)\",\n \"settings.defaultSyncExclude\": \"Default sync excludes for new workspaces\",\n \"settings.defaultSyncMaxBytes\": \"Default sync size limit (GiB, empty = built-in 2 GiB)\",\n \"sync.upDone\": \"Push complete\",\n \"sync.upFail\": \"Push failed: \",\n \"common.selectProfile\": \"— Select profile —\",\n \"common.profile\": \"Profile\",\n \"common.save\": \"Save\",\n \"common.open\": \"Open\",\n \"common.close\": \"Close\",\n \"common.noEntries\": \"(no subdirectories)\",\n \"common.delete\": \"Delete\",\n \"common.up\": \"⬆ Up\",\n \"common.loading\": \"Loading…\",\n \"common.processing\": \"Processing…\",\n \"common.errList\": \"Failed to list directory\",\n \"files.workspace\": \"Remote Workspace\",\n \"files.selectWorkspace\": \"— Select workspace —\",\n \"files.orProfile\": \"or pick a profile directly\",\n \"files.defaultDir\": \"Default directory (entered when opening this workspace)\",\n \"files.reading\": \"Reading…\",\n \"files.errRead\": \"Failed to read\",\n \"files.errSave\": \"Failed to save\",\n \"files.errSaveDefaultDir\": \"Failed to save default directory\",\n \"files.binary\": \"Binary file — preview not available\",\n \"term.title\": \"Terminal {id}\",\n \"term.exited\": \" (exited)\",\n \"term.connecting\": \"Connecting…\",\n \"term.noOutput\": \"(no output)\",\n \"term.inputPlaceholder\": \"Type a command and press Enter…\",\n \"term.send\": \"Send\",\n \"term.needProfile\": \"Select a profile first\",\n \"term.newTerminal\": \"+ New terminal\",\n \"term.emptyHint\": \"Create a terminal from the profile above to operate the remote environment.\",\n \"term.errSpawn\": \"Failed to start terminal\",\n \"picker.dir\": \"Directory\",\n \"picker.choose\": \"Choose this directory\",\n \"picker.errNameEmpty\": \"Folder name cannot be empty\",\n \"picker.errNameBad\": \"Folder name cannot contain / or \\\\, nor be . or ..\",\n \"flow.localTitle\": \"Select Local Directory\",\n \"flow.remoteTitle\": \"Select Remote Directory\",\n \"flow.localDir\": \"Local directory\",\n \"flow.remoteDir\": \"Remote directory\",\n \"flow.addWsTitle\": \"Add Workspace\",\n \"flow.localSeg\": \"📁 Local\",\n \"flow.remoteSeg\": \"🌐 Remote\",\n \"flow.syncPaths\": \"Sync scope (optional, empty = global default / whole tree)\",\n \"flow.browse\": \"Browse\",\n \"flow.chooseRemote\": \"Choose remote directory…\",\n \"flow.backLocal\": \"← Choose local directory\",\n \"flow.errCreate\": \"Failed to create remote workspace\",\n \"flow.errMkdir\": \"Failed to create the folder\",\n \"settings.importSshConfig\": \"Import from ~/.ssh/config…\",\n \"settings.importTitle\": \"Import ~/.ssh/config hosts\",\n \"settings.noneFound\": \"No usable hosts found in ~/.ssh/config\",\n \"settings.imported\": \"Imported {n} connection(s)\",\n \"sync.down\": \"⬇ Sync\",\n \"sync.up\": \"⬆ Push\",\n \"sync.syncing\": \"Syncing…\",\n \"sync.pushing\": \"Pushing…\",\n \"sync.done\": \"Sync complete\",\n \"sync.fail\": \"Sync failed\",\n \"ops.search\": \"🔍 Search\",\n \"ops.find\": \"Find by name\",\n \"ops.searchPh\": \"regex or keyword…\",\n \"ops.globPh\": \"*.py\",\n \"ops.newDir\": \"📁 New dir\",\n \"ops.newDirPh\": \"dir name\",\n \"ops.rename\": \"✏ Rename/Move\",\n \"ops.renamePh\": \"target path\",\n \"ops.delete\": \"🗑 Delete\",\n \"ops.confirmDel\": \"Confirm delete remote file/dir? (irreversible)\",\n \"ops.grepTitle\": \"Remote content search (grep)\",\n \"ops.globTitle\": \"Find by name (glob)\",\n \"ops.mkdirTitle\": \"Create remote directory\",\n \"ops.moveTitle\": \"Move/Rename\",\n \"ops.deleteTitle\": \"Delete remote file/dir\",\n \"ops.noMatch\": \"No match\",\n \"ops.done\": \"Done\",\n \"ops.fail\": \"Operation failed\"\n };\n var i18n = {\n t: function (key) { return key; },\n subscribe: function () { return function () {}; },\n getSnapshot: function () { return 0; }\n };\n function useT() {\n var state = React.useState(0);\n var force = state[1];\n React.useEffect(function () {\n return i18n.subscribe(function () { force(function (n) { return n + 1; }); });\n }, []);\n return i18n.t;\n }\n\n // ---- 跨会话切换的状态记忆(按 sessionId 分桶,模块级存活,页面刷新即失效)----\n var memoryBySession = {};\n function useSessionMemory(sessionId, key, initial) {\n var sid = sessionId || \"global\";\n var bucket = memoryBySession[sid] || (memoryBySession[sid] = {});\n var state = React.useState(function () {\n if (Object.prototype.hasOwnProperty.call(bucket, key)) return bucket[key];\n var init = typeof initial === \"function\" ? initial() : initial;\n return bucket[key] = init;\n });\n var value = state[0], setValue = state[1];\n React.useEffect(function () { bucket[key] = value; }, [value]);\n return [value, setValue];\n }\n\n // ---- 与 Host 半边的 JSON RPC ----\n async function api(method, args) {\n try {\n var r = await fetch(\"/remote-ssh/api/\" + method, {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\", \"x-requested-with\": \"XMLHttpRequest\" },\n body: JSON.stringify(args || {})\n });\n var j = await r.json();\n if (j && j.ok) return j.value;\n return { ok: false, error: (j && j.error && j.error.message) || (\"HTTP \" + r.status) };\n } catch (e) {\n return { ok: false, error: String(e && e.message ? e.message : e) };\n }\n }\n\n // ---- 跨页签「打开工作区」的轻量共享选择 ----\n var sel = { workspaceId: null };\n var selListeners = [];\n function setSelWorkspace(id) { sel.workspaceId = id; selListeners.forEach(function (fn) { fn(); }); }\n function subscribeSel(fn) { selListeners.push(fn); return function () { var i = selListeners.indexOf(fn); if (i >= 0) selListeners.splice(i, 1); }; }\n\n // ---- 通用:拉取连接配置(refreshKey 变化时重新拉取,避免缓存过期)----\n function useProfiles(refreshKey) {\n var state = React.useState([]);\n var profiles = state[0], setProfiles = state[1];\n React.useEffect(function () {\n api(\"listProfiles\").then(function (r) { if (r && r.ok) setProfiles(r.profiles || []); });\n }, [refreshKey]);\n return profiles;\n }\n\n function Field(props) {\n return h(\"div\", { className: \"rssh-row\" },\n h(\"span\", { className: \"rssh-label\" }, props.label),\n h(\"input\", { className: \"rssh-input\", type: props.type || \"text\", value: props.value, placeholder: props.placeholder,\n onChange: function (e) { props.onChange(e.target.value); } })\n );\n }\n\n // ---- 同步范围输入框 ↔ 宿主要的数据形状(issue #28)----\n // 输入框统一是「逗号或换行分隔」的文本,宿主存数组;体积上限界面按 GiB 填、宿主存字节。\n // 拆分语义要与宿主 normalizeSyncList 一致(逗号/换行/分号都认,去空白、丢空串)。\n\n /** 「逗号或换行分隔」的列表文本 → 数组。 */\n function splitList(value) {\n return String(value == null ? \"\" : value).split(/[\\n,;]/).map(function (s) { return s.trim(); }).filter(Boolean);\n }\n\n /** 字节数 → GiB 文本(空 = 用宿主内置默认上限)。 */\n function bytesToGibText(bytes) {\n var n = Number(bytes) || 0;\n if (!n) return \"\";\n return String(Math.round((n / 1073741824) * 100) / 100);\n }\n\n /** GiB 文本 → 字节;空/非法 → 0(= 用宿主内置默认上限)。 */\n function gibTextToBytes(text) {\n var n = parseFloat(String(text == null ? \"\" : text).replace(/[^0-9.]/g, \"\"));\n if (!isFinite(n) || n <= 0) return 0;\n return Math.round(n * 1073741824);\n }\n\n /** 宿主返回的偏好 → 界面状态(数组转文本,字节转 GiB)。 */\n function prefsForUi(p) {\n var v = p || {};\n return {\n nodePath: String(v.nodePath || \"\"),\n writeBackFailure: String(v.writeBackFailure || \"error\"),\n writeBackFreshness: v.writeBackFreshness !== false,\n defaultSyncPaths: (v.defaultSyncPaths || []).join(\", \"),\n defaultSyncExclude: (v.defaultSyncExclude || []).join(\", \"),\n defaultSyncMaxBytes: bytesToGibText(v.defaultSyncMaxBytes)\n };\n }\n\n // ======================================================================\n // 远程操作弹窗(grep / glob / mkdir / move / delete)\n // ======================================================================\n function OpsModal(props) {\n var d = props.opsDlg;\n var t = props.t;\n var patchOps = props.patchOps;\n var runOps = props.runOps;\n var title = ({\n grep: t(\"ops.grepTitle\"), glob: t(\"ops.globTitle\"), mkdir: t(\"ops.mkdirTitle\"),\n move: t(\"ops.moveTitle\"), delete: t(\"ops.deleteTitle\")\n })[d.type] || \"\";\n var isGrep = d.type === \"grep\";\n var isGlob = d.type === \"glob\";\n var isMove = d.type === \"move\";\n var isDel = d.type === \"delete\";\n // 结果渲染\n var resultEl = null;\n if (d.result) {\n var r = d.result;\n if (isGrep) {\n var ms = r.matches || [];\n resultEl = h(\"div\", { style: { maxHeight: 260, overflow: \"auto\", marginTop: 8, fontSize: 11, whiteSpace: \"pre-wrap\", fontFamily: \"monospace\" } },\n !r.ok ? h(\"div\", { className: \"rssh-err\" }, r.error || t(\"ops.fail\")) :\n ms.length === 0 ? h(\"div\", { className: \"rssh-muted\" }, t(\"ops.noMatch\")) :\n ms.map(function (m, i) { return h(\"div\", { key: i }, m.file + \":\" + m.line + \": \" + m.content); }),\n r.truncated ? h(\"div\", { className: \"rssh-muted\" }, \"…\") : null\n );\n } else if (isGlob) {\n var fs2 = r.files || [];\n resultEl = h(\"div\", { style: { maxHeight: 260, overflow: \"auto\", marginTop: 8, fontSize: 11, whiteSpace: \"pre-wrap\", fontFamily: \"monospace\" } },\n !r.ok ? h(\"div\", { className: \"rssh-err\" }, r.error || t(\"ops.fail\")) :\n fs2.length === 0 ? h(\"div\", { className: \"rssh-muted\" }, t(\"ops.noMatch\")) :\n fs2.map(function (f, i) { return h(\"div\", { key: i }, f); })\n );\n } else {\n // exec 结果(mkdir/move/delete)\n resultEl = h(\"div\", { style: { marginTop: 8 } },\n r.ok ? h(\"div\", { className: \"rssh-ok\" }, t(\"ops.done\") + (r.stderr ? \" \" + String(r.stderr).slice(0, 200) : \"\")) :\n h(\"div\", { className: \"rssh-err\" }, (r.error || r.stderr || t(\"ops.fail\")))\n );\n }\n }\n return h(Modal, { open: true, onClose: props.close, title: title, closeLabel: t(\"common.close\"), className: \"rssh-flow-dialog\" },\n h(\"div\", { style: { display: \"flex\", flexDirection: \"column\", gap: 6 } },\n h(\"input\", { className: \"rssh-input\", value: d.p1, onChange: function (e) { patchOps({ p1: e.target.value }); }, placeholder: isGrep ? t(\"ops.searchPh\") : (isGlob ? t(\"ops.globPh\") : t(\"ops.newDirPh\")) }),\n isGrep ? h(\"input\", { className: \"rssh-input\", value: d.p2, onChange: function (e) { patchOps({ p2: e.target.value }); }, placeholder: \"*.py (include)\" }) : null,\n isMove ? h(\"input\", { className: \"rssh-input\", value: d.p2, onChange: function (e) { patchOps({ p2: e.target.value }); }, placeholder: t(\"ops.renamePh\") }) : null,\n h(\"div\", { className: \"rssh-actions\" },\n h(\"button\", { className: \"rssh-btn\", onClick: runOps, disabled: d.busy }, d.busy ? t(\"common.processing\") : (isDel ? t(\"ops.delete\") : t(\"common.save\"))),\n h(\"button\", { className: \"rssh-btn\", onClick: props.close, disabled: d.busy }, t(\"common.close\"))\n ),\n resultEl\n )\n );\n }\n\n // ======================================================================\n // 远程文件页签\n // ======================================================================\n function FilesTab(props) {\n var t = useT();\n var sessionId = props.sessionId;\n var betterSidebar = props.betterSidebar;\n var [workspaces, setWorkspaces] = React.useState([]);\n var profiles = useProfiles();\n var [wsId, setWsId] = useSessionMemory(sessionId, \"wsId\", sel.workspaceId);\n var [profileId, setProfileId] = useSessionMemory(sessionId, \"profileId\", \"\");\n var [path, setPath] = useSessionMemory(sessionId, \"path\", \"\");\n var [entries, setEntries] = useSessionMemory(sessionId, \"entries\", []);\n var [err, setErr] = React.useState(null);\n var [loading, setLoading] = React.useState(false);\n var [defaultDir, setDefaultDir] = useSessionMemory(sessionId, \"defaultDir\", \"\");\n var [opsDlg, setOpsDlg] = React.useState(null); // { type, p1, p2, result, busy }\n\n React.useEffect(function () {\n api(\"listWorkspaces\").then(function (r) { if (r && r.ok) setWorkspaces(r.workspaces || []); });\n return subscribeSel(function () { setWsId(sel.workspaceId); });\n }, []);\n\n function load(targetProfile, targetPath) {\n setLoading(true); setErr(null);\n api(\"listDir\", { profileId: targetProfile, path: targetPath }).then(function (r) {\n setLoading(false);\n if (r && r.ok) { setEntries(r.entries || []); setPath(r.path || targetPath); }\n else setErr((r && r.error) || t(\"common.errList\"));\n });\n }\n\n // 工作区/配置选择变化时进入对应目录\n React.useEffect(function () {\n if (!wsId && !profileId) return;\n var pid = profileId;\n var rootPath = \"\";\n if (wsId) {\n var ws = workspaces.find(function (w) { return w.id === wsId; });\n if (ws) { pid = ws.profileId; rootPath = ws.remotePath; }\n }\n if (!pid) return;\n setProfileId(pid);\n load(pid, rootPath || undefined);\n }, [wsId, profileId, workspaces]);\n\n // 选中工作区时,把「默认目录」输入框同步为该工作区的 remotePath。\n React.useEffect(function () {\n if (wsId) {\n var ws = workspaces.find(function (w) { return w.id === wsId; });\n if (ws) setDefaultDir(ws.remotePath || \"\");\n }\n }, [wsId, workspaces]);\n\n function saveDefaultDir() {\n if (!wsId) return;\n api(\"updateWorkspace\", { id: wsId, remotePath: defaultDir }).then(function (r) {\n if (r && r.ok) { setWorkspaces(r.workspaces || []); setErr(null); }\n else setErr((r && r.error) || t(\"files.errSaveDefaultDir\"));\n });\n }\n\n function activeProfileId() {\n if (wsId) {\n var ws = workspaces.find(function (w) { return w.id === wsId; });\n if (ws) return ws.profileId;\n }\n return profileId;\n }\n function opsBase() {\n if (wsId) {\n var ws = workspaces.find(function (w) { return w.id === wsId; });\n if (ws) return ws.remotePath || path || \"~\";\n }\n return path || \"~\";\n }\n function openOps(type) {\n var init = { type: type, p1: \"\", p2: \"\", result: null, busy: false };\n if (type === \"mkdir\") init.p1 = path ? (path.replace(/\\/+$/, \"\") + \"/\") : \"\";\n if (type === \"move\") { init.p1 = path ? (path.replace(/\\/+$/, \"\") + \"/\") : \"\"; init.p2 = path ? (path.replace(/\\/+$/, \"\") + \"/\") : \"\"; }\n if (type === \"delete\") init.p1 = path ? (path.replace(/\\/+$/, \"\") + \"/\") : \"\";\n setOpsDlg(init);\n }\n function patchOps(patch) {\n setOpsDlg(function (d) { var n = {}; for (var k in d) n[k] = d[k]; for (var k2 in patch) n[k2] = patch[k2]; return n; });\n }\n function runOps() {\n if (!opsDlg) return;\n var pid = activeProfileId();\n if (!pid) { patchOps({ result: { ok: false, msg: t(\"ops.fail\") }, busy: false }); return; }\n var base = opsBase();\n var d = opsDlg;\n patchOps({ busy: true, result: null });\n function resolveP(p) {\n if (!p) return p;\n var c = String(p).charAt(0);\n if (c === \"/\" || c === \"~\") return p;\n return base.replace(/\\/+$/, \"\") + \"/\" + p;\n }\n if (d.type === \"grep\") {\n api(\"grep\", { profileId: pid, pattern: d.p1, path: base, include: d.p2 || undefined }).then(function (r) {\n patchOps({ busy: false, result: r });\n });\n } else if (d.type === \"glob\") {\n api(\"glob\", { profileId: pid, pattern: d.p1, path: base }).then(function (r) {\n patchOps({ busy: false, result: r });\n });\n } else if (d.type === \"mkdir\") {\n api(\"mkdir\", { profileId: pid, path: resolveP(d.p1) }).then(function (r) {\n patchOps({ busy: false, result: r });\n if (r && r.ok) { setErr(null); load(pid, path); }\n });\n } else if (d.type === \"move\") {\n api(\"move\", { profileId: pid, src: resolveP(d.p1), dst: resolveP(d.p2) }).then(function (r) {\n patchOps({ busy: false, result: r });\n if (r && r.ok) { setErr(null); load(pid, path); }\n });\n } else if (d.type === \"delete\") {\n api(\"deleteFile\", { profileId: pid, path: resolveP(d.p1) }).then(function (r) {\n patchOps({ busy: false, result: r });\n if (r && r.ok) { setErr(null); load(pid, path); }\n });\n }\n }\n\n function openEntry(e) {\n var base = path ? (path.replace(/\\/+$/, \"\") + \"/\" + e.name) : e.name;\n if (e.type === \"directory\") {\n setPath(base);\n load(profileId, base);\n } else {\n // 用独立页签预览远程文件(与内置「文件」页签一致),而非在文件树下方预览。\n if (betterSidebar && betterSidebar.openTab) {\n betterSidebar.openTab({\n type: \"remssh:editor\",\n id: \"remssh:editor:\" + profileId + \":\" + base,\n title: e.name,\n path: base,\n meta: { profileId: profileId, remotePath: base }\n }, { sessionId: sessionId });\n }\n }\n }\n\n function goUp() {\n if (!path) return;\n var parts = path.replace(/\\/+$/, \"\").split(\"/\");\n parts.pop();\n var up = parts.join(\"/\") || \"/\";\n setPath(up);\n load(profileId, up);\n }\n\n return h(\"div\", { style: { display: \"flex\", flexDirection: \"column\", flex: 1, minHeight: 0, overflow: \"hidden\" } },\n h(\"div\", { style: { flex: \"none\" } },\n h(\"div\", { className: \"rssh-row\" },\n h(\"span\", { className: \"rssh-label\" }, t(\"files.workspace\")),\n h(\"select\", { className: \"rssh-select\", value: wsId || \"\", onChange: function (e) { setWsId(e.target.value); setProfileId(\"\"); } },\n h(\"option\", { value: \"\" }, t(\"files.selectWorkspace\")),\n workspaces.map(function (w) { return h(\"option\", { key: w.id, value: w.id }, w.title); })\n )\n ),\n h(\"div\", { className: \"rssh-row\" },\n h(\"span\", { className: \"rssh-label\" }, t(\"files.orProfile\")),\n h(\"select\", { className: \"rssh-select\", value: profileId, onChange: function (e) { setProfileId(e.target.value); setWsId(\"\"); } },\n h(\"option\", { value: \"\" }, t(\"common.selectProfile\")),\n profiles.map(function (p) { return h(\"option\", { key: p.id, value: p.id }, p.name); })\n )\n ),\n wsId ? h(\"div\", { className: \"rssh-row\" },\n h(\"span\", { className: \"rssh-label\" }, t(\"files.defaultDir\")),\n h(\"div\", { className: \"rssh-pathbar\" },\n h(\"input\", { className: \"rssh-input\", value: defaultDir, onChange: function (e) { setDefaultDir(e.target.value); }, placeholder: \"/home/user/project\" }),\n h(\"button\", { className: \"rssh-btn\", onClick: saveDefaultDir }, t(\"common.save\"))\n )\n ) : null,\n h(\"div\", { className: \"rssh-pathbar\" },\n h(\"input\", { className: \"rssh-input\", value: path, onChange: function (e) { setPath(e.target.value); }, placeholder: \"/home/user\" }),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { load(profileId, path); } }, t(\"common.open\")),\n h(\"button\", { className: \"rssh-btn\", onClick: goUp }, t(\"common.up\"))\n ),\n wsId ? h(\"div\", { className: \"rssh-pathbar\", style: { flexWrap: \"wrap\" } },\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"grep\"); } }, t(\"ops.search\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"glob\"); } }, t(\"ops.find\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"mkdir\"); } }, t(\"ops.newDir\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"move\"); } }, t(\"ops.rename\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"delete\"); } }, t(\"ops.delete\"))\n ) : (wsId || profileId) ? h(\"div\", { className: \"rssh-pathbar\", style: { flexWrap: \"wrap\" } },\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"grep\"); } }, t(\"ops.search\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"glob\"); } }, t(\"ops.find\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"mkdir\"); } }, t(\"ops.newDir\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"move\"); } }, t(\"ops.rename\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { openOps(\"delete\"); } }, t(\"ops.delete\"))\n ) : null,\n loading ? h(\"div\", { className: \"rssh-muted\" }, t(\"common.loading\")) : null,\n err ? h(\"div\", { className: \"rssh-err\", style: { whiteSpace: \"pre-wrap\" } }, err) : null,\n opsDlg ? h(OpsModal, { opsDlg: opsDlg, patchOps: patchOps, runOps: runOps, close: function () { setOpsDlg(null); }, t: t }) : null\n ),\n h(\"div\", { style: { flex: 1, minHeight: 0, overflowY: \"auto\", marginTop: 6 } },\n entries.map(function (e) {\n return h(\"div\", { key: e.name, className: \"rssh-tree-item\", onClick: function () { openEntry(e); } },\n h(\"span\", { className: e.type === \"directory\" ? \"rssh-tree-dir\" : \"rssh-tree-file\" }, e.type === \"directory\" ? \"📁 \" + e.name : \"📄 \" + e.name),\n e.type === \"file\" ? h(\"span\", { className: \"rssh-tree-size\" }, String(e.size)) : null\n );\n })\n )\n );\n }\n\n // ======================================================================\n // 远程文件编辑器页签:点击文件树中的文件后单开一栏预览/编辑(与内置「文件」页签一致)\n // ======================================================================\n function RemoteEditor(props) {\n var t = useT();\n var tab = props.tab || {};\n var ctx = props.ctx;\n var meta = tab.meta || {};\n var profileId = meta.profileId || \"\";\n var remotePath = tab.path || meta.remotePath || \"\";\n var [data, setData] = React.useState({ loading: true, content: \"\", binary: false, dirty: false, error: null });\n\n React.useEffect(function () {\n var alive = true;\n setData({ loading: true, content: \"\", binary: false, dirty: false, error: null });\n api(\"readFile\", { profileId: profileId, path: remotePath }).then(function (r) {\n if (!alive) return;\n if (r && r.ok) setData({ loading: false, content: r.content || \"\", binary: !!r.binary, dirty: false, error: null });\n else setData({ loading: false, content: \"\", binary: false, dirty: false, error: (r && r.error) || t(\"files.errRead\") });\n });\n return function () { alive = false; };\n }, [profileId, remotePath]);\n\n function save() {\n api(\"writeFile\", { profileId: profileId, path: remotePath, content: data.content }).then(function (r) {\n if (r && r.ok) setData(Object.assign({}, data, { dirty: false, error: null }));\n else setData(Object.assign({}, data, { error: (r && r.error) || t(\"files.errSave\") }));\n });\n }\n\n function close() {\n if (ctx && ctx.betterSidebar && tab.id) ctx.betterSidebar.closeTab(tab.id);\n }\n\n if (data.loading) return h(\"div\", { className: \"rssh-muted\", style: { padding: 8 } }, t(\"files.reading\"));\n if (data.error) return h(\"div\", { className: \"rssh-err\", style: { padding: 8, whiteSpace: \"pre-wrap\" } }, data.error);\n if (data.binary) return h(\"div\", { className: \"rssh-muted\", style: { padding: 8 } }, t(\"files.binary\"));\n\n return h(\"div\", { style: { display: \"flex\", flexDirection: \"column\", flex: 1, minHeight: 0, padding: 8, overflow: \"hidden\" } },\n h(\"div\", { className: \"rssh-pathbar\", style: { flex: \"none\" } },\n h(\"span\", { className: \"rssh-title\", style: { flex: 1, wordBreak: \"break-all\" } }, remotePath),\n h(\"button\", { className: \"rssh-btn\", onClick: save }, t(\"common.save\")),\n h(\"button\", { className: \"rssh-btn\", onClick: close }, t(\"common.close\"))\n ),\n h(\"textarea\", { className: \"rssh-content\", style: { flex: 1, minHeight: 0, maxHeight: \"none\", width: \"100%\", boxSizing: \"border-box\", background: \"var(--dsw-alias-markdown-code-block)\", color: \"var(--dsw-alias-label-primary)\", border: \"1px solid var(--dsw-alias-border-l2)\" },\n value: data.content, onChange: function (e) { setData(Object.assign({}, data, { content: e.target.value, dirty: true })); } })\n );\n }\n\n // ======================================================================\n // 远程终端页签\n // ======================================================================\n function TerminalView(props) {\n var t = useT();\n var [data, setData] = React.useState(\"\");\n var [status, setStatus] = React.useState(\"running\");\n var [input, setInput] = React.useState(\"\");\n var endRef = React.useRef(null);\n\n React.useEffect(function () {\n var timer = setInterval(function () {\n api(\"terminalRead\", { id: props.id }).then(function (r) {\n if (r && r.ok) {\n if (r.data) setData(function (d) { return d + r.data; });\n if (r.status) setStatus(r.status);\n }\n });\n }, 200);\n return function () { clearInterval(timer); };\n }, [props.id]);\n\n React.useEffect(function () {\n if (endRef.current) endRef.current.scrollTop = endRef.current.scrollHeight;\n }, [data]);\n\n function send() {\n if (!input) return;\n api(\"terminalWrite\", { id: props.id, data: input + \"\\r\" });\n setInput(\"\");\n }\n\n return h(\"div\", { className: \"rssh-terminal\" },\n h(\"div\", { className: \"rssh-terminal-bar\" },\n h(\"span\", { style: { flex: 1, color: status === \"running\" ? \"var(--dsw-alias-state-success-primary)\" : \"var(--dsw-alias-state-error-primary)\" } }, t(\"term.title\", { id: props.id }) + (status === \"exited\" ? t(\"term.exited\") : \"\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { props.onClose(props.id); } }, t(\"common.close\"))\n ),\n h(\"div\", { className: \"rssh-terminal-out\", ref: endRef }, data || (status === \"running\" ? t(\"term.connecting\") : t(\"term.noOutput\"))),\n h(\"div\", { className: \"rssh-terminal-input-row\" },\n h(\"input\", { className: \"rssh-input\", value: input,\n onChange: function (e) { setInput(e.target.value); },\n onKeyDown: function (e) { if (e.key === \"Enter\") send(); },\n placeholder: t(\"term.inputPlaceholder\") }),\n h(\"button\", { className: \"rssh-btn\", onClick: send }, t(\"term.send\"))\n )\n );\n }\n\n function TerminalTab(props) {\n var t = useT();\n var sessionId = props.sessionId;\n var profiles = useProfiles();\n var [profileId, setProfileId] = useSessionMemory(sessionId, \"profileId\", \"\");\n var [terms, setTerms] = useSessionMemory(sessionId, \"terms\", []);\n var [err, setErr] = React.useState(null);\n\n function spawn() {\n if (!profileId) { setErr(t(\"term.needProfile\")); return; }\n setErr(null);\n api(\"spawnTerminal\", { profileId: profileId }).then(function (r) {\n if (r && r.ok) setTerms(function (list) { return list.concat([{ id: r.id }]); });\n else setErr((r && r.error) || t(\"term.errSpawn\"));\n });\n }\n\n function close(id) {\n api(\"terminalClose\", { id: id });\n setTerms(function (list) { return list.filter(function (x) { return x.id !== id; }); });\n }\n\n return h(\"div\", null,\n h(\"div\", { className: \"rssh-row\" },\n h(\"span\", { className: \"rssh-label\" }, t(\"common.profile\")),\n h(\"select\", { className: \"rssh-select\", value: profileId, onChange: function (e) { setProfileId(e.target.value); } },\n h(\"option\", { value: \"\" }, t(\"common.selectProfile\")),\n profiles.map(function (p) { return h(\"option\", { key: p.id, value: p.id }, p.name); })\n )\n ),\n h(\"button\", { className: \"rssh-btn\", onClick: spawn }, t(\"term.newTerminal\")),\n err ? h(\"div\", { className: \"rssh-err\", style: { marginTop: 6 } }, err) : null,\n terms.length === 0 ? h(\"div\", { className: \"rssh-empty\" }, t(\"term.emptyHint\")) : null,\n terms.map(function (term) { return h(TerminalView, { key: term.id, id: term.id, onClose: close }); })\n );\n }\n\n // ======================================================================\n // 目录选择器(供「添加工作区」弹窗流程使用:本地 browse / 远程 SSH)\n // ======================================================================\n // 本地目录列举:走 DSH browse 能力(无原生对话框时替代 pickDirectory)。\n function localListFn(workspaces, p) {\n // 走 better-sidebar 的 fs.tree 端点(已被本插件拦截,本地工作区走本地 fs)\n // 不依赖 workspaces.listDirectory(需要 browse capability,可能被禁用)\n return fetch(\"/sidebar/api/fs.tree\", {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify({ sessionId: \"\", path: p || \"\" })\n }).then(function (r) { return r.json(); }).then(function (j) {\n if (!j || !j.ok) return { ok: false, error: (j && j.error && j.error.message) || \"list failed\" };\n var v = j.value || {};\n return {\n ok: true,\n path: v.path || p || \"\",\n entries: (v.entries || []).filter(function (e) { return e.isDir; }).map(function (e) { return { name: e.name, type: \"directory\", path: e.path }; })\n };\n }).catch(function (e) {\n return { ok: false, error: String(e && e.message ? e.message : e) };\n });\n }\n\n // 远程目录列举:走本插件 SSH API,并为每条记录补全绝对 path。\n function remoteListFn(profileId, p) {\n return api(\"listDir\", { profileId: profileId, path: p }).then(function (r) {\n if (!(r && r.ok)) return r;\n var parent = r.path || \"\";\n var entries = (r.entries || []).map(function (e) {\n return { name: e.name, type: e.type, path: (parent ? parent.replace(/\\/+$/, \"\") + \"/\" : \"\") + e.name };\n });\n return { ok: true, path: r.path, entries: entries };\n });\n }\n\n // 计算父目录,兼容 Windows(\\\\) 与 POSIX(/) 分隔符。\n function parentOf(path) {\n if (!path) return null;\n var str = String(path).replace(/[\\/\\\\]+$/, \"\");\n if (str === \"\") return null;\n var idx = Math.max(str.lastIndexOf(\"/\"), str.lastIndexOf(\"\\\\\"));\n if (idx < 0) return null;\n var parent = str.slice(0, idx);\n if (/^[A-Za-z]:$/.test(parent)) return parent + \"\\\\\";\n if (parent === \"\") return \"/\";\n return parent;\n }\n\n // 新建目录名校验(issue #11):返回 i18n 键,合法则返回 null。\n // 只接受单个路径段——分隔符会让「在 path 下新建」变成任意位置写入。\n function newDirNameError(name) {\n var s = String(name == null ? \"\" : name).trim();\n if (!s) return \"picker.errNameEmpty\";\n if (s === \".\" || s === \"..\") return \"picker.errNameBad\";\n if (s.indexOf(\"/\") >= 0 || s.indexOf(\"\\\\\") >= 0) return \"picker.errNameBad\";\n return null;\n }\n\n // 把子目录名拼到基路径之后:沿用基路径的分隔符(Windows 反斜杠 / POSIX 斜杠),\n // 并保留根路径语义(\"/\" + name、\"C:\\\" + name)。\n function joinChild(base, name) {\n var raw = String(base == null ? \"\" : base);\n var b = raw.replace(/[\\/\\\\]+$/, \"\");\n if (!b) return (raw.charAt(0) === \"/\" ? \"/\" : \"\") + String(name);\n var sep = (b.indexOf(\"\\\\\") >= 0 && b.indexOf(\"/\") < 0) || /^[A-Za-z]:$/.test(b) ? \"\\\\\" : \"/\";\n return b + sep + String(name);\n }\n\n // 通用目录选择器:listFn(path) 返回 {ok, path, entries:[{name,type,path}]}。\n // resetKey 变化(如远程切换连接)时从根目录重新加载。\n // createFn(path, name)(可选):在当前目录下新建子目录,远程/本地由调用方分流(issue #11)。\n function DirPicker(props) {\n var t = useT();\n var [path, setPath] = React.useState(\"\");\n var [entries, setEntries] = React.useState([]);\n var [err, setErr] = React.useState(null);\n var [loading, setLoading] = React.useState(false);\n var [newDir, setNewDir] = React.useState(null); // { name, busy, error } | null\n\n var listFnRef = React.useRef(props.listFn);\n listFnRef.current = props.listFn;\n\n function load(p) {\n setLoading(true); setErr(null);\n listFnRef.current(p).then(function (r) {\n setLoading(false);\n if (r && r.ok) { setEntries(r.entries || []); setPath(r.path || p || \"\"); }\n else setErr((r && r.error) || t(\"common.errList\"));\n });\n }\n React.useEffect(function () { load(undefined); }, [props.resetKey]);\n\n function enterDir(e) { load(e.path); }\n function goUp() {\n var up = parentOf(path);\n if (up !== null) load(up);\n }\n\n // 打开按钮:按输入框路径加载该路径下的文件树。空路径时打开主目录。\n function open() {\n load(path || undefined);\n }\n\n // 在当前 path 下新建子目录(远程/本地由 createFn 分流),成功后进入该目录,\n // 便于紧接着点「选择此目录」——对齐 VSCode「新建文件夹」的交互预期(issue #11)。\n function submitNewDir() {\n if (!newDir || !props.createFn) return;\n var name = String(newDir.name || \"\").trim();\n var invalid = newDirNameError(name);\n if (invalid) { setNewDir({ name: name, busy: false, error: t(invalid) }); return; }\n setNewDir({ name: name, busy: true, error: null });\n Promise.resolve(props.createFn(path, name)).then(function (r) {\n if (r && r.ok) {\n setNewDir(null);\n load((r && r.path) || joinChild(path, name));\n } else {\n setNewDir({ name: name, busy: false, error: (r && r.error) || t(\"common.errList\") });\n }\n }).catch(function (e) {\n setNewDir({ name: name, busy: false, error: String(e && e.message ? e.message : e) });\n });\n }\n\n // 路径栏:输入框(回车导航)+ 打开按钮(紧挨在右侧)+ 上级\n return h(\"div\", null,\n h(\"div\", { className: \"rssh-pathbar\" },\n h(\"input\", { className: \"rssh-input\", value: path,\n onChange: function (e) { setPath(e.target.value); },\n onKeyDown: function (e) { if (e.key === \"Enter\") { e.preventDefault(); open(); } },\n placeholder: props.placeholder || t(\"picker.dir\") }),\n h(\"button\", { className: \"rssh-btn\", onClick: open, disabled: loading }, t(\"common.open\")),\n h(\"button\", { className: \"rssh-btn\", onClick: goUp }, t(\"common.up\"))\n ),\n // 新建目录输入行(点底部「新建目录」按钮后出现)\n newDir ? h(\"div\", { className: \"rssh-pathbar\", style: { marginTop: 6 } },\n h(\"input\", { className: \"rssh-input\", value: newDir.name, autoFocus: true,\n placeholder: t(\"ops.newDirPh\"),\n onChange: function (e) { setNewDir({ name: e.target.value, busy: false, error: null }); },\n onKeyDown: function (e) { if (e.key === \"Enter\") { e.preventDefault(); submitNewDir(); } } }),\n h(\"button\", { className: \"rssh-btn\", onClick: submitNewDir, disabled: newDir.busy }, newDir.busy ? t(\"common.processing\") : t(\"common.save\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { setNewDir(null); }, disabled: newDir.busy }, t(\"common.close\"))\n ) : null,\n newDir && newDir.error ? h(\"div\", { className: \"rssh-err\" }, newDir.error) : null,\n loading ? h(\"div\", { className: \"rssh-muted\" }, t(\"common.loading\")) : null,\n err ? h(\"div\", { className: \"rssh-err\" }, err) : null,\n // 当前路径下的文件树(仅目录可进入)\n h(\"div\", { className: \"rssh-pick-tree\" },\n (entries.filter(function (e) { return e.type === \"directory\"; })).length === 0 && !loading\n ? h(\"div\", { className: \"rssh-pick-empty\" }, t(\"common.noEntries\"))\n : entries.filter(function (e) { return e.type === \"directory\"; }).map(function (e) {\n return h(\"div\", { key: e.path || e.name, className: \"rssh-tree-item\", onClick: function () { enterDir(e); } },\n h(\"span\", { className: \"rssh-tree-dir\" }, \"📁 \" + e.name));\n })\n ),\n h(\"div\", { className: \"rssh-actions\", style: { marginTop: 8 } },\n h(\"button\", { className: \"rssh-btn\", disabled: !path || props.disabled, onClick: function () { props.onChoose(path); } }, t(\"picker.choose\")),\n props.createFn ? h(\"button\", { className: \"rssh-btn\",\n disabled: !path || loading || props.disabled || !!(newDir && newDir.busy),\n onClick: function () { setNewDir({ name: \"\", busy: false, error: null }); } }, t(\"ops.newDir\")) : null\n )\n );\n }\n\n function RemoteWorkspaceFlow(props) {\n var t = useT();\n var [mode, setMode] = React.useState(\"local\");\n var profiles = useProfiles(props.open);\n var [profileId, setProfileId] = React.useState(\"\");\n var [creating, setCreating] = React.useState(false);\n // 同步范围(issue #28 第 2 条):建区时就能定,留空 = 全局默认(再留空 = 整树)。\n var [syncPaths, setSyncPaths] = React.useState(\"\");\n\n // 每次打开流程时重置为「本地目录」起始界面。\n React.useEffect(function () {\n if (props.open) { setMode(\"local\"); setProfileId(\"\"); setSyncPaths(\"\"); }\n }, [props.open]);\n\n if (!props.open) return null;\n\n function chooseLocal(p) { props.onPicked(p); }\n\n function chooseRemote(remotePath) {\n setCreating(true);\n // 同步范围(issue #28):非空才传,空 = 让宿主用「全局默认」兜底(再空 = 整树)\n var payload = { profileId: profileId, remotePath: remotePath };\n var scope = splitList(syncPaths);\n if (scope.length) payload.syncPaths = scope;\n api(\"createRemoteWorkspace\", payload).then(function (r) {\n setCreating(false);\n if (r && r.ok && r.mirrorPath) props.onPicked(r.mirrorPath);\n else props.onError((r && r.error) || t(\"flow.errCreate\"));\n });\n }\n\n var canClose = !creating && !props.busy;\n var isRemote = mode === \"remote\";\n\n // 统一弹窗:上方本地/远程分段切换 → 远程时显示连接选择 → 路径栏(浏览按钮紧挨右侧)→ 文件树\n return h(Modal, { open: true, onClose: function () { if (canClose) props.onCancel(); }, title: t(\"flow.addWsTitle\"), closeLabel: t(\"common.close\"), className: \"rssh-flow-dialog\" },\n h(\"div\", { style: { padding: 8 } },\n creating || props.busy ? h(\"div\", { className: \"rssh-muted\" }, t(\"common.processing\")) : null,\n // 分段切换:本地 / 远程\n h(\"div\", { className: \"rssh-seg\" },\n h(\"button\", { className: \"rssh-seg-btn\" + (isRemote ? \"\" : \" active\"), onClick: function () { setMode(\"local\"); }, disabled: !!props.busy || creating }, t(\"flow.localSeg\")),\n h(\"button\", { className: \"rssh-seg-btn\" + (isRemote ? \" active\" : \"\"), onClick: function () { setMode(\"remote\"); }, disabled: !!props.busy || creating }, t(\"flow.remoteSeg\"))\n ),\n // 远程模式:连接配置选择\n isRemote ? h(\"div\", { className: \"rssh-row\" },\n h(\"span\", { className: \"rssh-label\" }, t(\"common.profile\")),\n h(\"select\", { className: \"rssh-select\", value: profileId, onChange: function (e) { setProfileId(e.target.value); }, disabled: creating },\n h(\"option\", { value: \"\" }, t(\"common.selectProfile\")),\n profiles.map(function (p) { return h(\"option\", { key: p.id, value: p.id }, p.name); })\n )\n ) : null,\n // 远程模式:同步范围(issue #28 第 2 条)——留空走全局默认,避免建完再手工补一遍\n isRemote ? Field({ label: t(\"flow.syncPaths\"), value: syncPaths, onChange: setSyncPaths, placeholder: \".dsh\" }) : null,\n // 目录选择器:远程需选好连接后才显示。\n // createFn:在当前目录下新建子目录(远程走 SSH 的 mkdir -p,本地走宿主 mkdirLocal),\n // 两个 tab 都提供——新建远程项目目录是本 issue 的痛点,本地顺手补齐(issue #11)。\n isRemote\n ? (profileId ? h(DirPicker, { resetKey: profileId, placeholder: t(\"flow.remoteDir\"),\n listFn: function (p) { return remoteListFn(profileId, p); },\n createFn: function (p, name) {\n var target = joinChild(p, name);\n return api(\"mkdir\", { profileId: profileId, path: target }).then(function (r) {\n return (r && r.ok) ? { ok: true, path: target } : { ok: false, error: (r && r.error) || t(\"flow.errMkdir\") };\n });\n },\n onChoose: chooseRemote, disabled: creating })\n : h(\"div\", { className: \"rssh-pick-empty\" }, t(\"common.selectProfile\")))\n : h(DirPicker, { resetKey: \"local\", placeholder: t(\"flow.localDir\"),\n listFn: function (p) { return localListFn(props.workspaces, p); },\n createFn: function (p, name) {\n var target = joinChild(p, name);\n return api(\"mkdirLocal\", { path: target }).then(function (r) {\n return (r && r.ok) ? { ok: true, path: target } : { ok: false, error: (r && r.error) || t(\"flow.errMkdir\") };\n });\n },\n onChoose: chooseLocal })\n )\n );\n }\n\n // ======================================================================\n // 设置页小节(连接配置管理)\n // ======================================================================\n function SettingsSection(props) {\n var t = useT();\n var [profiles, setProfiles] = React.useState([]);\n var [workspaces, setWorkspaces] = React.useState([]);\n var [form, setForm] = React.useState({ name: \"\", host: \"\", port: \"22\", user: \"\", authMethod: \"key\", keyPath: \"\", password: \"\", remoteRoot: \"~\", proxyJump: \"\" });\n var [result, setResult] = React.useState(null);\n var [busy, setBusy] = React.useState(false);\n var [importDlg, setImportDlg] = React.useState(null);\n // 进阶设置(issue #23/#24 的可达性):nodePath / writeBackFailure / writeBackFreshness\n // + issue #28 的全局默认同步范围(新建工作区时取作初始值)\n var [prefs, setPrefs] = React.useState(prefsForUi(null));\n var [guards, setGuards] = React.useState({}); // wsId → { writeBack, exclude, syncPaths, syncExclude, syncMaxBytes }\n var [prefsMsg, setPrefsMsg] = React.useState(null);\n // 正在同步/推送的工作区 id:同一个工作区的两个按钮在此期间都禁用 —— 两次 syncDown 并发\n // 会在同一镜像目录里各解一份临时树,纯属自己跟自己抢\n var [syncId, setSyncId] = React.useState(\"\");\n var set = function (k, v) { setForm(function (f) { var n = {}; for (var key in f) n[key] = f[key]; n[k] = v; return n; }); };\n var setPref = function (k, v) { setPrefs(function (p) { var n = {}; for (var key in p) n[key] = p[key]; n[k] = v; return n; }); };\n var setGuard = function (id, k, v) { setGuards(function (g) { var n = {}; for (var key in g) n[key] = g[key]; n[id] = Object.assign({}, n[id] || {}, { [k]: v }); return n; }); };\n\n function reload() {\n api(\"listProfiles\").then(function (r) { if (r && r.ok) setProfiles(r.profiles || []); });\n api(\"listWorkspaces\").then(function (r) {\n if (!r || !r.ok) return;\n var list = r.workspaces || [];\n setWorkspaces(list);\n var g = {};\n list.forEach(function (w) {\n g[w.id] = {\n writeBack: w.writeBack !== false,\n exclude: (w.writeBackExclude || []).join(\", \"),\n // 同步范围(issue #28):整树同步的排除、只同步的子路径、体积上限\n syncPaths: (w.syncPaths || []).join(\", \"),\n syncExclude: (w.syncExclude || []).join(\", \"),\n syncMaxBytes: bytesToGibText(w.syncMaxBytes)\n };\n });\n setGuards(g);\n });\n api(\"getPrefs\").then(function (r) { if (r && r.ok && r.prefs) setPrefs(prefsForUi(r.prefs)); });\n }\n React.useEffect(reload, []);\n\n /** 保存全局偏好(nodePath 是 #23 的逃生舱,writeBack* 是 #24 的开关,defaultSync* 是 #28 的默认范围)。 */\n function savePrefs() {\n setPrefsMsg(null);\n api(\"savePrefs\", {\n nodePath: String(prefs.nodePath || \"\"),\n writeBackFailure: String(prefs.writeBackFailure || \"error\"),\n writeBackFreshness: prefs.writeBackFreshness !== false,\n // 默认同步范围(issue #28):空 = 整树(旧行为)\n defaultSyncPaths: splitList(prefs.defaultSyncPaths),\n defaultSyncExclude: splitList(prefs.defaultSyncExclude),\n defaultSyncMaxBytes: gibTextToBytes(prefs.defaultSyncMaxBytes)\n }).then(function (r) {\n if (r && r.ok) { if (r.prefs) setPrefs(prefsForUi(r.prefs)); setPrefsMsg({ ok: true, msg: t(\"settings.saved\") }); }\n else setPrefsMsg({ ok: false, msg: (r && r.error) || t(\"settings.errSave\") });\n });\n }\n\n /** 保存单个工作区的写回护栏 + 同步范围(issue #24 护栏 A / issue #28)。 */\n function saveGuard(ws) {\n var g = guards[ws.id] || { writeBack: true, exclude: \"\", syncPaths: \"\", syncExclude: \"\", syncMaxBytes: \"\" };\n setPrefsMsg(null);\n api(\"updateWorkspaceGuards\", {\n id: ws.id,\n writeBack: g.writeBack !== false,\n writeBackExclude: splitList(g.exclude),\n // 同步范围(issue #28):空数组 = 整树(旧行为)\n syncPaths: splitList(g.syncPaths),\n syncExclude: splitList(g.syncExclude),\n syncMaxBytes: gibTextToBytes(g.syncMaxBytes)\n }).then(function (r) {\n if (r && r.ok) {\n setWorkspaces(r.workspaces || []);\n reload();\n setPrefsMsg({ ok: true, msg: t(\"settings.saved\") });\n } else setPrefsMsg({ ok: false, msg: (r && r.error) || t(\"settings.errSave\") });\n });\n }\n\n /** 手动同步(issue #28 第 4 条):复用已有的 syncDown / syncUp 端点,走该工作区的持久化范围。 */\n function runSync(ws, action) {\n if (syncId) return; // 已有同步在跑:别让两次同步在同一镜像目录里抢\n var down = action === \"syncDown\";\n setSyncId(ws.id);\n setPrefsMsg({ ok: true, msg: t(down ? \"sync.syncing\" : \"sync.pushing\") });\n api(action, { id: ws.id }).then(function (r) {\n setSyncId(\"\");\n if (r && r.ok) setPrefsMsg({ ok: true, msg: t(down ? \"sync.done\" : \"sync.upDone\") });\n else setPrefsMsg({ ok: false, msg: t(down ? \"sync.fail\" : \"sync.upFail\") + ((r && r.error) || \"\") });\n });\n }\n\n function profileName(id) {\n var p = profiles.find(function (x) { return x.id === id; });\n return p ? p.name : id;\n }\n function delWs(wsId) {\n api(\"deleteWorkspace\", { id: wsId }).then(function (r) { if (r && r.ok) setWorkspaces(r.workspaces || []); });\n }\n\n function save() {\n setBusy(true); setResult(null);\n api(\"saveProfile\", Object.assign({}, form, { port: parseInt(form.port, 10) || 22 })).then(function (r) {\n setBusy(false);\n if (r && r.ok) {\n setProfiles(r.profiles || []);\n setForm({ name: \"\", host: \"\", port: \"22\", user: \"\", authMethod: \"key\", keyPath: \"\", password: \"\", remoteRoot: \"~\", proxyJump: \"\" });\n setResult({ ok: true, msg: t(\"settings.saved\") });\n } else setResult({ ok: false, msg: (r && r.error) || t(\"settings.errSave\") });\n });\n }\n function test(p) {\n setBusy(true); setResult(null);\n api(\"testConnection\", { id: p.id }).then(function (r) {\n setBusy(false);\n if (r && r.ok) setResult({ ok: true, msg: t(\"settings.connOk\") + \"\\n\" + (r.warning ? r.warning + \"\\n\" : \"\") + (r.stdout || \"\") });\n else setResult({ ok: false, msg: t(\"settings.connFail\") + ((r && r.error) || (r && r.stderr) || \"\") });\n });\n }\n function del(p) {\n api(\"deleteProfile\", { id: p.id }).then(function (r) { if (r && r.ok) { setProfiles(r.profiles || []); } });\n }\n\n function openImport() {\n setImportDlg({ loading: true, hosts: [], selected: {} });\n api(\"listSshConfigHosts\").then(function (r) {\n if (r && r.ok) {\n var hosts = r.hosts || [];\n var sel = {};\n hosts.forEach(function (h) { sel[h.name + \"|\" + h.hostName] = true; });\n setImportDlg({ loading: false, hosts: hosts, selected: sel });\n } else {\n setImportDlg({ loading: false, hosts: [], selected: {}, error: (r && r.error) || t(\"settings.noneFound\") });\n }\n });\n }\n function toggleImport(key) {\n setImportDlg(function (d) {\n var sel = {}; for (var k in d.selected) sel[k] = d.selected[k];\n sel[key] = !sel[key];\n return Object.assign({}, d, { selected: sel });\n });\n }\n function doImport() {\n if (!importDlg) return;\n var picked = importDlg.hosts.filter(function (h) { return importDlg.selected[h.name + \"|\" + h.hostName]; });\n setBusy(true);\n var i = 0;\n function next() {\n if (i >= picked.length) {\n setBusy(false); setImportDlg(null);\n setResult({ ok: true, msg: t(\"settings.imported\").replace(\"{n}\", String(picked.length)) });\n reload();\n return;\n }\n var h = picked[i++];\n api(\"saveProfile\", {\n name: h.name, host: h.hostName, port: h.port || 22, user: h.user || \"\",\n authMethod: \"key\", keyPath: h.identityFile || \"\", password: \"\", remoteRoot: \"~\", proxyJump: h.proxyJump || \"\"\n }).then(next);\n }\n next();\n }\n\n return h(\"div\", null,\n h(\"p\", { className: \"rssh-muted\" }, t(\"settings.desc\")),\n profiles.map(function (p) {\n return h(\"div\", { key: p.id, className: \"rssh-card\" },\n h(\"div\", { className: \"rssh-title\" }, p.name),\n h(\"div\", { className: \"rssh-sub\" }, (p.user || \"\") + \"@\" + (p.host || \"\") + \":\" + (p.port || 22) + \" [\" + (p.authMethod || \"key\") + \"]\"),\n h(\"div\", { className: \"rssh-actions\" },\n h(\"button\", { className: \"rssh-btn\", onClick: function () { test(p); }, disabled: busy }, t(\"settings.test\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { del(p); } }, t(\"common.delete\"))\n )\n );\n }),\n profiles.length === 0 ? h(\"div\", { className: \"rssh-empty\" }, t(\"settings.empty\")) : null,\n workspaces.length > 0 ? h(\"div\", { className: \"rssh-card\" },\n h(\"div\", { className: \"rssh-title\" }, t(\"settings.workspaces\")),\n workspaces.map(function (ws) {\n var g = guards[ws.id] || { writeBack: true, exclude: \"\", syncPaths: \"\", syncExclude: \"\", syncMaxBytes: \"\" };\n return h(\"div\", { key: ws.id, className: \"rssh-card\", style: { marginBottom: 6 } },\n h(\"div\", { className: \"rssh-title\" }, ws.title || ws.id),\n h(\"div\", { className: \"rssh-sub\" }, profileName(ws.profileId) + \" → \" + (ws.remotePath || \"\")),\n h(\"label\", { className: \"rssh-tree-item\", style: { cursor: \"pointer\" } },\n h(\"input\", { type: \"checkbox\", checked: g.writeBack !== false, onChange: function (e) { setGuard(ws.id, \"writeBack\", !!e.target.checked); } }),\n h(\"span\", null, t(\"settings.wsWriteBack\"))\n ),\n Field({ label: t(\"settings.wsWriteBackExclude\"), value: g.exclude, onChange: function (v) { setGuard(ws.id, \"exclude\", v); }, placeholder: \"_patch/, *.log, wbdeep/**\" }),\n // 同步范围(issue #28):后端早就支持、GUI 一直没有入口 —— 结果每个新工作区\n // 都退化成整树同步,remotePath 是 ~ 的工作区直接被体积哨兵拒绝。\n h(\"div\", { className: \"rssh-muted\", style: { marginTop: 6 } }, t(\"settings.syncScopeHint\")),\n Field({ label: t(\"settings.wsSyncPaths\"), value: g.syncPaths, onChange: function (v) { setGuard(ws.id, \"syncPaths\", v); }, placeholder: \".dsh\" }),\n Field({ label: t(\"settings.wsSyncExclude\"), value: g.syncExclude, onChange: function (v) { setGuard(ws.id, \"syncExclude\", v); }, placeholder: \"data/, *.log\" }),\n Field({ label: t(\"settings.wsSyncMaxBytes\"), value: g.syncMaxBytes, onChange: function (v) { setGuard(ws.id, \"syncMaxBytes\", v); }, placeholder: \"2\" }),\n h(\"div\", { className: \"rssh-actions\" },\n h(\"button\", { className: \"rssh-btn\", onClick: function () { saveGuard(ws); } }, t(\"settings.saveGuards\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { runSync(ws, \"syncDown\"); }, disabled: !!syncId }, t(\"sync.down\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { runSync(ws, \"syncUp\"); }, disabled: !!syncId }, t(\"sync.up\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { delWs(ws.id); } }, t(\"common.delete\"))\n )\n );\n })\n ) : null,\n h(\"div\", { className: \"rssh-card\" },\n h(\"div\", { className: \"rssh-title\" }, t(\"settings.guards\")),\n h(\"div\", { className: \"rssh-muted\" }, t(\"settings.guardsHint\")),\n Field({ label: t(\"settings.nodePath\"), value: prefs.nodePath, onChange: function (v) { setPref(\"nodePath\", v); }, placeholder: \"C:\\\\Program Files\\\\nodejs\\\\node.exe\" }),\n h(\"div\", { className: \"rssh-row\" },\n h(\"span\", { className: \"rssh-label\" }, t(\"settings.writeBackFailure\")),\n h(\"select\", { className: \"rssh-select\", value: prefs.writeBackFailure || \"error\", onChange: function (e) { setPref(\"writeBackFailure\", e.target.value); } },\n h(\"option\", { value: \"error\" }, t(\"settings.wbError\")),\n h(\"option\", { value: \"log\" }, t(\"settings.wbLog\"))\n )\n ),\n h(\"label\", { className: \"rssh-tree-item\", style: { cursor: \"pointer\" } },\n h(\"input\", { type: \"checkbox\", checked: prefs.writeBackFreshness !== false, onChange: function (e) { setPref(\"writeBackFreshness\", !!e.target.checked); } }),\n h(\"span\", null, t(\"settings.writeBackFreshness\"))\n ),\n // 全局默认同步范围(issue #28 第 3 条):新建工作区时取作初始值,\n // 避免多远程工作区场景下每建一个区都要手工补一遍范围。\n h(\"div\", { className: \"rssh-title\", style: { marginTop: 10 } }, t(\"settings.syncScope\")),\n Field({ label: t(\"settings.defaultSyncPaths\"), value: prefs.defaultSyncPaths, onChange: function (v) { setPref(\"defaultSyncPaths\", v); }, placeholder: \".dsh\" }),\n Field({ label: t(\"settings.defaultSyncExclude\"), value: prefs.defaultSyncExclude, onChange: function (v) { setPref(\"defaultSyncExclude\", v); }, placeholder: \"data/, *.log\" }),\n Field({ label: t(\"settings.defaultSyncMaxBytes\"), value: prefs.defaultSyncMaxBytes, onChange: function (v) { setPref(\"defaultSyncMaxBytes\", v); }, placeholder: \"2\" }),\n h(\"div\", { className: \"rssh-actions\" },\n h(\"button\", { className: \"rssh-btn\", onClick: savePrefs }, t(\"common.save\"))\n )\n ),\n prefsMsg ? h(\"div\", { className: prefsMsg.ok ? \"rssh-ok\" : \"rssh-err\", style: { whiteSpace: \"pre-wrap\", marginTop: 6 } }, prefsMsg.msg) : null,\n h(\"div\", { className: \"rssh-card\" },\n h(\"div\", { className: \"rssh-title\" }, t(\"settings.add\")),\n Field({ label: t(\"settings.name\"), value: form.name, onChange: function (v) { set(\"name\", v); }, placeholder: t(\"settings.namePlaceholder\") }),\n Field({ label: t(\"settings.host\"), value: form.host, onChange: function (v) { set(\"host\", v); }, placeholder: t(\"settings.hostPlaceholder\") }),\n Field({ label: t(\"settings.port\"), value: form.port, onChange: function (v) { set(\"port\", v); } }),\n Field({ label: t(\"settings.user\"), value: form.user, onChange: function (v) { set(\"user\", v); }, placeholder: t(\"settings.userPlaceholder\") }),\n h(\"div\", { className: \"rssh-row\" },\n h(\"span\", { className: \"rssh-label\" }, t(\"settings.auth\")),\n h(\"select\", { className: \"rssh-select\", value: form.authMethod, onChange: function (e) { set(\"authMethod\", e.target.value); } },\n h(\"option\", { value: \"key\" }, t(\"settings.key\")),\n h(\"option\", { value: \"password\" }, t(\"settings.password\"))\n )\n ),\n form.authMethod === \"key\" ? Field({ label: t(\"settings.keyPath\"), value: form.keyPath, onChange: function (v) { set(\"keyPath\", v); }, placeholder: t(\"settings.keyPathPlaceholder\") }) : null,\n form.authMethod === \"password\" ? Field({ label: t(\"settings.passwordField\"), type: \"password\", value: form.password, onChange: function (v) { set(\"password\", v); } }) : null,\n Field({ label: t(\"settings.remoteRoot\"), value: form.remoteRoot, onChange: function (v) { set(\"remoteRoot\", v); }, placeholder: \"~/project\" }),\n Field({ label: t(\"settings.proxyJump\"), value: form.proxyJump, onChange: function (v) { set(\"proxyJump\", v); }, placeholder: \"bastion.example.com\" }),\n h(\"div\", { className: \"rssh-actions\" },\n h(\"button\", { className: \"rssh-btn\", onClick: save, disabled: busy }, busy ? t(\"common.processing\") : t(\"common.save\")),\n h(\"button\", { className: \"rssh-btn\", onClick: openImport, disabled: busy }, t(\"settings.importSshConfig\"))\n )\n ),\n result ? h(\"div\", { className: result.ok ? \"rssh-ok\" : \"rssh-err\", style: { whiteSpace: \"pre-wrap\", marginTop: 6 } }, result.msg) : null,\n importDlg ? h(Modal, { open: true, onClose: function () { if (!busy) setImportDlg(null); }, title: t(\"settings.importTitle\"), closeLabel: t(\"common.close\") },\n importDlg.loading ? h(\"div\", { className: \"rssh-muted\" }, t(\"common.loading\")) :\n importDlg.error ? h(\"div\", { className: \"rssh-err\" }, importDlg.error) :\n (importDlg.hosts.length === 0 ? h(\"div\", { className: \"rssh-muted\" }, t(\"settings.noneFound\")) :\n h(\"div\", null,\n importDlg.hosts.map(function (hh) {\n var key = hh.name + \"|\" + hh.hostName;\n return h(\"label\", { key: key, className: \"rssh-tree-item\", style: { cursor: \"pointer\" } },\n h(\"input\", { type: \"checkbox\", checked: !!importDlg.selected[key], onChange: function () { toggleImport(key); } }),\n h(\"span\", { className: \"rssh-tree-dir\" }, hh.name),\n h(\"span\", { className: \"rssh-sub\" }, (hh.user || \"?\") + \"@\" + hh.hostName + \":\" + (hh.port || 22) + (hh.proxyJump ? \" → \" + hh.proxyJump : \"\"))\n );\n }),\n h(\"div\", { className: \"rssh-actions\", style: { marginTop: 8 } },\n h(\"button\", { className: \"rssh-btn\", onClick: doImport, disabled: busy }, busy ? t(\"common.processing\") : t(\"common.save\")),\n h(\"button\", { className: \"rssh-btn\", onClick: function () { setImportDlg(null); }, disabled: busy }, t(\"common.close\"))\n )\n )\n )\n ) : null\n );\n }\n\n // ======================================================================\n // apply\n // ======================================================================\n function apply(ctx) {\n var slots = ctx.slots;\n var locale = ctx.locale;\n\n // 兼容 DSH Desktop ≥2.0.4:shell 不再把客户端模块系统挂到\n // globalThis.__DSH_MODULES__,而 dsh-better-sidebar 0.15+ 的懒加载\n // chunk(editor 等)会回退到该全局——缺失时侧边栏面板打不开、报\n // \"chunk ... client module system unavailable\"。这里用内核提供的\n // modules 服务补挂该全局;better-sidebar 已注入则保持原值。\n try {\n if (typeof globalThis !== \"undefined\") {\n var fallbackModules = null;\n try { if (ctx.modules && typeof ctx.modules.import === \"function\") fallbackModules = ctx.modules; } catch (e) {}\n if (!fallbackModules && ctx.get && typeof ctx.get === \"function\") {\n try { fallbackModules = ctx.get(\"modules\"); } catch (e) { fallbackModules = null; }\n }\n // 定期兜底:better-sidebar 若把本插件应用时间之后的模块系统清掉,也补回。\n if (globalThis.__DSH_MODULES__ === undefined && fallbackModules === null) {\n var waitModules = 0;\n var waitTimer = setInterval(function () {\n waitModules += 1;\n try {\n var ms = (ctx.get && typeof ctx.get === \"function\") ? ctx.get(\"modules\") : null;\n if (ms && typeof ms.import === \"function\") {\n globalThis.__DSH_MODULES__ = ms;\n clearInterval(waitTimer);\n }\n } catch (e) {}\n if (globalThis.__DSH_MODULES__ !== undefined || waitModules > 40) clearInterval(waitTimer);\n }, 250);\n }\n if (!globalThis.__DSH_MODULES__ && fallbackModules && typeof fallbackModules.import === \"function\") {\n globalThis.__DSH_MODULES__ = fallbackModules;\n }\n }\n } catch (e) {}\n\n // 注册中英文词典并绑定当前语言;locale 切换时 i18n.subscribe 触发组件重渲染。\n if (locale) {\n ctx.effect(function () { return locale.register(NS, { zh: zh, en: en }); }, \"dsh-remote-ssh: dictionaries\");\n i18n.t = locale.bind(NS);\n i18n.subscribe = function (cb) { return locale.subscribe(cb); };\n i18n.getSnapshot = function () { return locale.getSnapshot(); };\n }\n\n ctx.effect(function () {\n var el = document.createElement(\"style\");\n el.textContent = CSS;\n document.head.appendChild(el);\n return function () { if (el.parentNode) el.parentNode.removeChild(el); };\n });\n\n // ---- 设置导航「远程连接」条目:把壳层默认齿轮换成真实显示器 SVG 图标 ----\n // 壳层对未知 settings.section 一律渲染齿轮图标(IconSettingsOutline16 兜底),\n // 且 settings.section 插槽契约暂不接受自定义图标(壳层注释:Desktop-owned display\n // glyph kept local until the upstream slot accepts icons),导航 CSS 类名是构建期哈希\n // 每版会变。这里沿既有 DOM 方案:按条目文本(settings.nav)定位设置导航按钮,把\n // 兜底齿轮 svg 原位替换为显示器图标(与 🖥️ 语义最接近的真实 SVG,非文字表情)。\n // replaceChild 后 React 只会对已脱离文档的旧齿轮节点做属性更新(无冲突),\n // 设置面板按需挂载、语言切换、React 重渲染由 MutationObserver + 1s 幂等复检兜底。\n if (slots) {\n function monitorIconSvg() {\n var NS = \"http://www.w3.org/2000/svg\";\n var svg = document.createElementNS(NS, \"svg\");\n svg.setAttribute(\"viewBox\", \"0 0 16 16\");\n svg.setAttribute(\"width\", \"16\");\n svg.setAttribute(\"height\", \"16\");\n svg.setAttribute(\"fill\", \"none\");\n svg.setAttribute(\"data-rssh-monitor\", \"1\");\n function add(name, attrs) {\n var n = document.createElementNS(NS, name);\n for (var k in attrs) n.setAttribute(k, attrs[k]);\n svg.appendChild(n);\n }\n // 桌面显示器:圆角屏幕外框 + 支架 + 底座(轮廓线风格,与 DSH 原语一致)\n add(\"rect\", { x: \"1.5\", y: \"2.5\", width: \"13\", height: \"9\", rx: \"1\", stroke: \"currentColor\", \"stroke-width\": \"1.3\" });\n add(\"path\", { d: \"M8 11.5v3\", stroke: \"currentColor\", \"stroke-width\": \"1.3\", \"stroke-linecap\": \"round\" });\n add(\"path\", { d: \"M5.5 14.5h5\", stroke: \"currentColor\", \"stroke-width\": \"1.3\", \"stroke-linecap\": \"round\" });\n return svg;\n }\n function checkCell(btn) {\n var label = i18n.t(\"settings.nav\");\n var text = (btn.textContent || \"\").trim();\n if (text !== label.trim() || text === \"\") return false;\n var icon = btn.querySelector(\"svg\");\n if (!icon) return false;\n if (icon.getAttribute(\"data-rssh-monitor\") === \"1\") return true; // 已替换:幂等\n try { icon.parentNode.replaceChild(monitorIconSvg(), icon); } catch (e) {}\n return true;\n }\n function checkCellIn(root) {\n try {\n if (root.tagName && String(root.tagName).toLowerCase() === \"button\") checkCell(root);\n var cells = root.querySelectorAll(\"button\");\n for (var i = 0; i < cells.length; i++) checkCell(cells[i]);\n } catch (e) {}\n }\n function applyRemoteNavIcon() {\n try {\n var buttons = document.querySelectorAll(\"button\");\n for (var i = 0; i < buttons.length; i++) checkCell(buttons[i]);\n } catch (e) {}\n }\n // ---- 远程工作区图标:单个「地球角标文件夹」SVG 替换壳层默认纯文件夹图标 ----\n // 壳层工作区行的文件夹图标是固定原语(IconFolderOpen16/Close16),无 per-workspace\n // 图标 API;旧方案在标题里塞 🌐 emoji 造成「文件夹 + 地球」双重标识。现按标题文本\n // 定位远程工作区行,找到行首 slot.folder 槽位(标题的前兄弟),向其中的 svg\n // 追加地球经纬线组 —— 文件夹本体保持壳层默认原语几何,零改写零对账风险。\n var remoteTitles = new Set(); // 远程工作区标题(旧壳层按标题匹配时用,也用于诊断)\n var remoteRowKeys = new Set(); // `workspace:<原生工作区 id>`:issue #31 起的精确对齐依据\n var watchedRows = []; // 已加角标的行:定时幂等复检,抵消 React 重渲染对图标的还原\n var remoteWorkspaceCount = 0; // 远程工作区条目数(诊断用)\n var decoratedRows = 0; // 已加角标的行数(诊断用)\n /** 归一化标题文本:折叠空白(壳层可能插入换行/多空格),供匹配与诊断共用。 */\n function normTitle(s) { return String(s == null ? \"\" : s).replace(/\\s+/g, \" \").trim(); }\n /** 镜像目录 basename → { label: 远程目录 basename, remotePath }(issue #9)。 */\n var rootLabels = {};\n function refreshRemoteTitles() {\n api(\"listWorkspaces\").then(function (r) {\n if (!(r && r.ok && Array.isArray(r.workspaces))) return;\n var next = new Set();\n var keys = new Set();\n remoteWorkspaceCount = r.workspaces.length;\n for (var i = 0; i < r.workspaces.length; i++) {\n var w = r.workspaces[i] || {};\n var t = normTitle(w.title);\n if (t) { next.add(t); next.add(\"🌐 \" + t); } // 兼容自愈前的旧前缀标题\n // issue #31:壳层每个工作区行都带 data-row-key=\"workspace:<原生 id>\"。存下这个\n // id 才能**精确**认行 —— 只按标题文本会把「与远程同名」的本地项目也标上地球。\n // 旧记录没有该字段时,由宿主侧 listWorkspaces 按镜像路径回填(见 reconcileShellWorkspaceIds)。\n var sid = normTitle(w.shellWorkspaceId);\n if (sid) keys.add(\"workspace:\" + sid);\n }\n remoteTitles = next;\n remoteRowKeys = keys;\n refreshRootLabels(r.workspaces);\n swapWorkspaceIconsIn(document.body); // 标题集就绪后补一次全量替换\n applyRootLabelsIn(document.body); // 树根标签同样补一次全量替换\n }).catch(function () {});\n }\n /** 地球经纬线组(右下角、无圆盘底色):线色**跟随主题**(取文件夹 svg 自身的计算色,\n * 取不到时退回 currentColor);文件夹本体完全保留壳层默认原语(IconFolderOpen16/Close16\n * 原始路径与几何,零改写),仅向 svg 追加本组 —— appendChild 不触碰 React 管理的子节点。\n * ⚠️ 此前这里硬编码 `stroke=\"#ffffff\"`:在**浅色主题**下白线落在浅色侧边栏上几乎不可见,\n * 是\"换一台电脑就看不到地球角标\"的一个真实成因(与本文件里的显示器图标统一用 currentColor)。 */\n function globeGridElement(color) {\n var NS = \"http://www.w3.org/2000/svg\";\n var g = document.createElementNS(NS, \"g\");\n g.setAttribute(\"data-rssh-globe\", \"1\");\n g.setAttribute(\"fill\", \"none\");\n g.setAttribute(\"stroke\", color || \"currentColor\");\n g.setAttribute(\"stroke-width\", \"0.9\");\n function add(name, attrs) {\n var n = document.createElementNS(NS, name);\n for (var k in attrs) n.setAttribute(k, attrs[k]);\n g.appendChild(n);\n }\n add(\"circle\", { cx: \"11.6\", cy: \"11.9\", r: \"3.4\" }); // 地球轮廓\n add(\"ellipse\", { cx: \"11.6\", cy: \"11.9\", rx: \"1.6\", ry: \"3.4\" }); // 经线\n add(\"path\", { d: \"M8.2 11.9h6.8\" }); // 赤道(纬线)\n add(\"path\", { d: \"M8.7 9.6c0.9 0.65 1.85 0.97 2.9 0.97s2-0.32 2.9-0.97\" }); // 北纬弧\n add(\"path\", { d: \"M8.7 14.2c0.9-0.65 1.85-0.97 2.9-0.97s2 0.32 2.9 0.97\" }); // 南纬弧\n return g;\n }\n /** 取文件夹 svg 的**计算颜色**作为角标颜色:与图标本体同色 → 浅色/深色主题都可见。\n * 透明/取不到时返回 null(由 globeGridElement 退回 currentColor 继承行文本色)。 */\n function iconInkOf(el) {\n try {\n var win = el && el.ownerDocument && el.ownerDocument.defaultView;\n if (!win || !win.getComputedStyle) return null;\n var c = win.getComputedStyle(el).color;\n if (!c) return null;\n if (/^(transparent|rgba?\\(\\s*0\\s*,\\s*0\\s*,\\s*0\\s*,\\s*0\\s*\\))$/i.test(String(c).trim())) return null;\n return c;\n } catch (e) {\n return null;\n }\n }\n /** 幂等应用:React 还原/重建子节点会清掉本组 —— 以 [data-rssh-globe] 子节点\n * 存在性为状态判据(覆盖属性级还原与节点重建),缺席即追加。 */\n function applyFolderGlobe(slotSvg) {\n if (slotSvg.querySelector(\"[data-rssh-globe]\")) return;\n slotSvg.setAttribute(\"data-rssh-folder-globe\", \"1\");\n slotSvg.appendChild(globeGridElement(iconInkOf(slotSvg)));\n decoratedRows += 1;\n }\n /** 反向自愈(issue #31):不是远程工作区的行若还带着角标(升级前按标题误标),摘掉它。\n * 否则用户升级后仍会看到本地项目上的地球,只有等 React 重渲染才会消失。 */\n function removeFolderGlobe(slotSvg) {\n try {\n if (!slotSvg || !slotSvg.querySelector) return;\n var g = slotSvg.querySelector(\"[data-rssh-globe]\");\n if (!g) return;\n if (typeof slotSvg.removeChild === \"function\") slotSvg.removeChild(g);\n else if (g.parentNode && typeof g.parentNode.removeChild === \"function\") g.parentNode.removeChild(g);\n if (typeof slotSvg.removeAttribute === \"function\" && slotSvg.getAttribute(\"data-rssh-folder-globe\") === \"1\") {\n slotSvg.removeAttribute(\"data-rssh-folder-globe\");\n }\n decoratedRows = Math.max(0, decoratedRows - 1);\n } catch (e) {}\n }\n /** 行首槽位里的文件夹 svg(`row > span.slot.folder > svg`)。 */\n function folderSvgOfRow(row) {\n var first = row && row.children && row.children[0];\n return first && first.querySelector ? first.querySelector(\"svg\") : null;\n }\n /** 行 → 原生工作区键(`workspace:`);旧壳层没有该属性时返回 null。 */\n function rowKeyOfRow(row) {\n try {\n var k = row && row.getAttribute ? row.getAttribute(\"data-row-key\") : null;\n return k && String(k).indexOf(\"workspace:\") === 0 ? String(k) : null;\n } catch (e) { return null; }\n }\n /** 工作区行集合(root 自身是行时也算进来 —— MutationObserver 常把行本身当新增节点)。 */\n function workspaceRowsIn(root) {\n var list = [];\n try {\n if (!root || !root.querySelectorAll) return list;\n var found = root.querySelectorAll('[data-row-key^=\"workspace:\"]');\n for (var i = 0; i < found.length; i++) list.push(found[i]);\n var selfKey = rowKeyOfRow(root);\n if (selfKey && list.indexOf(root) < 0) list.unshift(root);\n } catch (e) {}\n return list;\n }\n /** 行首 svg 加/摘角标;返回 true 表示这一行加上了。 */\n function markRow(row, want) {\n var svg = folderSvgOfRow(row);\n if (!svg) return false;\n if (want) { applyFolderGlobe(svg); return true; }\n removeFolderGlobe(svg);\n return false;\n }\n /** 精确路径(issue #31):按 data-row-key 与 remoteRowKeys 对齐。\n * 同名本地项目行键不同 → 不会被标;曾误标的行会在这里被摘掉(自愈)。 */\n function applyRowGlobes(rows) {\n if (!rows || !rows.length) return 0;\n var applied = 0;\n for (var i = 0; i < rows.length; i++) {\n var key = rowKeyOfRow(rows[i]);\n var want = !!key && remoteRowKeys.has(key);\n if (markRow(rows[i], want)) applied += 1;\n if (want) watchRow(rows[i]);\n }\n return applied;\n }\n /** 向上 ≤4 层找到\"行\"元素(其首个子元素槽位里有 svg)—— 旧壳层回退用。 */\n function ownerRowOf(el) {\n var holder = el;\n for (var hop = 0; hop < 4 && holder && holder.parentElement; hop++) {\n var row = holder.parentElement;\n var first = row.children && row.children[0];\n if (first && first.querySelector && first.querySelector(\"svg\")) return row;\n holder = row;\n }\n return null;\n }\n /** 旧壳层回退:没有 data-row-key 时只能按标题匹配。\n * ⚠️ 同名行不止一行时**都不标** —— 无法区分哪一行是远程的,宁可漏标也不误标(issue #31)。 */\n function applyByTitle(root) {\n if (!remoteTitles.size) return;\n try {\n var nodes = root.querySelectorAll(\"span,div,button,a,p,[title],[aria-label]\");\n var rowsSeen = [];\n var titlesSeen = [];\n for (var i = 0; i < nodes.length; i++) {\n var el = nodes[i];\n if (el.childElementCount > 2) continue;\n var text = normTitle(el.textContent);\n var hit = remoteTitles.has(text);\n if (!hit) {\n // 容错:部分壳层/主题把标题放在 title / aria-label 属性上,文本另有装饰\n var attr = el.getAttribute ? (el.getAttribute(\"title\") || el.getAttribute(\"aria-label\")) : null;\n hit = !!attr && remoteTitles.has(normTitle(attr));\n }\n if (!hit) continue;\n var row = ownerRowOf(el);\n if (!row || rowsSeen.indexOf(row) >= 0) continue;\n rowsSeen.push(row);\n titlesSeen.push(normTitle(row.textContent));\n }\n for (var r = 0; r < rowsSeen.length; r++) {\n var same = 0;\n for (var q = 0; q < titlesSeen.length; q++) { if (titlesSeen[q] === titlesSeen[r]) same += 1; }\n if (same > 1) continue; // 同名(本地 + 远程)→ 不标\n if (markRow(rowsSeen[r], true)) watchRow(rowsSeen[r]);\n }\n } catch (e) {}\n }\n function watchRow(row) {\n for (var i = 0; i < watchedRows.length; i++) { if (watchedRows[i] === row) return; }\n watchedRows.push(row);\n }\n function recheckWatched() {\n // 精确路径:整份行集合复检(顺带把曾误标的行摘干净),行数通常 <20,1s 一次成本可忽略\n if (remoteRowKeys.size) {\n var rows = workspaceRowsIn(document.body);\n if (rows.length) { applyRowGlobes(rows); return; }\n }\n // 旧壳层:没有行键,只能按记录的标题元素复检\n for (var i = watchedRows.length - 1; i >= 0; i--) {\n var row = watchedRows[i];\n if (!row || !row.isConnected) { watchedRows.splice(i, 1); continue; }\n var svg = folderSvgOfRow(row);\n if (svg) applyFolderGlobe(svg);\n }\n }\n /** 该壳层是否支持行键(首次见到工作区行即置 true,之后永不再按标题猜)。 */\n var shellHasRowKeys = false;\n function swapWorkspaceIconsIn(root) {\n if (!remoteTitles.size && !remoteRowKeys.size) return;\n var rows = workspaceRowsIn(root);\n if (rows.length) { shellHasRowKeys = true; applyRowGlobes(rows); return; } // 2.4.37+:按行键精确对齐\n // 局部子树(例如标题 span 重渲染)里没有行 —— 但壳层本身支持行键时必须\"什么都不做\",\n // 否则会退回按标题猜,把同名本地项目的这一小块重新标上(issue #31 的坑)。\n if (!shellHasRowKeys) {\n var probe = workspaceRowsIn(document.body);\n if (probe.length) { shellHasRowKeys = true; applyRowGlobes(probe); return; }\n }\n if (shellHasRowKeys) return;\n applyByTitle(root); // 仅旧壳层(根本没有 data-row-key)才走标题回退\n }\n\n // ---- 角标自检:把\"该有却没有\"的情形直接打到控制台,便于在别的机器上定位 ----\n // 控制台可随时执行 window.__dshRemoteSshGlobeStats() 查看详情。\n var globeHealthWarned = false;\n function globeStats(withTitles) {\n var inDom = 0;\n try { inDom = document.querySelectorAll(\"[data-rssh-globe]\").length; } catch (e) {}\n var s = {\n loaded: true,\n remoteWorkspaces: remoteWorkspaceCount,\n decoratedRows: decoratedRows,\n globesInDom: inDom,\n watchedRows: watchedRows.length,\n titleKeys: remoteTitles.size,\n // issue #31:rowKeyKeys > 0 表示走的是「按行键精确对齐」,标题只是回退路径\n rowKeyKeys: remoteRowKeys.size,\n matchedBy: remoteRowKeys.size ? \"rowKey\" : \"title\",\n };\n if (withTitles) {\n try { s.titleSamples = Array.prototype.slice.call(remoteTitles).slice(0, 6); } catch (e) {}\n try { s.rowKeySamples = Array.prototype.slice.call(remoteRowKeys).slice(0, 6); } catch (e) {}\n }\n return s;\n }\n function checkGlobeHealth(verbose) {\n try {\n var s = globeStats(true);\n if (s.remoteWorkspaces === 0) {\n if (verbose) console.info(\"[dsh-remote-ssh] 宿主未返回远程工作区:地球角标与远程功能都未生效(请检查插件版本与 harness 兼容性,或先创建/迁移远程工作区)\", s);\n return s;\n }\n if (s.globesInDom === 0 && !globeHealthWarned) {\n globeHealthWarned = true;\n console.warn(\"[dsh-remote-ssh] 有 \" + s.remoteWorkspaces + \" 个远程工作区,但工作区行上没找到可加角标的图标:可能是壳层 DOM 结构变化。执行 window.__dshRemoteSshGlobeStats(true) 查看详情\", s);\n }\n } catch (e) {}\n return null;\n }\n // 自检入口(命名空间隔离,不影响宿主)\n try {\n if (typeof window !== \"undefined\") {\n window.__dshRemoteSshGlobeStats = function (withTitles) {\n var s = globeStats(withTitles === true);\n var health = checkGlobeHealth(true);\n console.info(\"[dsh-remote-ssh] 地球角标自检\", s, health ? health : \"\");\n return s;\n };\n }\n } catch (e) {}\n\n // ---- 文件树根标签:按完整镜像路径精确认行(issue #9)----\n // better-sidebar 的根行 title 是完整目录路径(RootRow title={path})。\n // 只在该 title 精确等于某个远程工作区的 mirrorPath 时才改写名称:不再\n // 按 basename 或内联 padding-left 猜测目录身份,因此同名本地目录不会\n // 被误改;属性缺席时保持原样(安全降级)。\n var watchedRootLabels = []; // 已替换的标签元素:1s 幂等复检,抵消 React 重渲染\n var rootLabels = {};\n function normRemotePath(value) {\n return String(value == null ? \"\" : value).replace(/[\\\\/]+$/, \"\");\n }\n function refreshRootLabels(workspaces) {\n var next = {};\n for (var i = 0; i < (workspaces || []).length; i++) {\n var w = workspaces[i] || {};\n var mirror = normRemotePath(w.mirrorPath);\n var remote = normRemotePath(w.remotePath);\n if (!mirror || !remote) continue;\n var title = normTitle(w.title);\n var label = title || remote.split(/[\\\\/]/).pop();\n if (label) next[mirror] = { label: label, remotePath: remote, mirrorPath: mirror };\n }\n rootLabels = next;\n }\n /** The root row's own full path, from the explicit attributes only. */\n function rootPathOf(el) {\n var explicit = el && el.getAttribute ? el.getAttribute(\"data-rssh-root-mirror\") : null;\n if (explicit) return normRemotePath(explicit);\n var title = el && el.getAttribute ? el.getAttribute(\"title\") : null;\n return title ? normRemotePath(title) : \"\";\n }\n /** Direct leaf that prints the folder name (no nested markup). */\n function rootLabelSpanOf(el) {\n var children = el && el.children ? el.children : [];\n for (var i = 0; i < children.length; i++) {\n if (String(children[i].tagName || \"\").toLowerCase() === \"span\" && children[i].childElementCount === 0) return children[i];\n }\n return null;\n }\n /** Exact full-path hit → replace only the leaf name span. */\n function fixRootLabel(el) {\n if (!el || !el.getAttribute) return false;\n var path = rootPathOf(el);\n if (!path) return false;\n var hit = rootLabels[path];\n if (hit === undefined) return false;\n var span = rootLabelSpanOf(el);\n if (!span) return false;\n var base = path.split(/[\\\\/]/).pop();\n var text = normTitle(span.textContent);\n if (text !== base && el.getAttribute(\"data-rssh-root-label\") !== \"1\") return false;\n span.textContent = hit.label;\n el.setAttribute(\"data-rssh-root-label\", \"1\");\n el.setAttribute(\"data-rssh-root-mirror\", hit.mirrorPath);\n el.setAttribute(\"title\", hit.remotePath); // 悬停可见完整远程路径\n watchRootLabel(el);\n return true;\n }\n function watchRootLabel(el) {\n for (var i = 0; i < watchedRootLabels.length; i++) { if (watchedRootLabels[i] === el) return; }\n watchedRootLabels.push(el);\n }\n function recheckRootLabels() {\n for (var i = watchedRootLabels.length - 1; i >= 0; i--) {\n var el = watchedRootLabels[i];\n if (!el || !el.isConnected) { watchedRootLabels.splice(i, 1); continue; }\n fixRootLabel(el);\n }\n }\n function applyRootLabelsIn(root) {\n if (!root || !root.querySelectorAll) return;\n try {\n // Only elements carrying the full path title are candidates; no\n // text/basename or inline-style scan.\n var nodes = root.querySelectorAll(\"[title]\");\n for (var i = 0; i < nodes.length; i++) fixRootLabel(nodes[i]);\n if (root.nodeType === 1) fixRootLabel(root);\n } catch (e) {}\n }\n ctx.effect(function () {\n if (typeof document === \"undefined\") return;\n applyRemoteNavIcon();\n refreshRemoteTitles();\n // 角标自检:等界面稳定后再判(避免行还没渲染就误报);仅在\"有远程工作区却没有角标\"时告警一次\n setTimeout(function () { checkGlobeHealth(false); }, 8000);\n setTimeout(function () { checkGlobeHealth(false); }, 25000);\n var titleTimer = setInterval(refreshRemoteTitles, 30000);\n var recheckTimer = setInterval(function () { recheckWatched(); recheckRootLabels(); }, 1000); // 抵消 React 属性还原\n var timer = null;\n var pendingRoots = null;\n var schedule = function (root) {\n if (root && root.nodeType === 1) (pendingRoots || (pendingRoots = [])).push(root);\n if (timer) return;\n timer = setTimeout(function () {\n timer = null;\n var roots = pendingRoots;\n pendingRoots = null;\n if (document.hidden) return; // 后台页签零开销\n if (roots && roots.length) {\n // 只扫新增子树:流式聊天期间不做全文档扫描(稳态成本≈0)\n // (设置导航图标与树根标签已在 MutationObserver 回调里同步替换,这里只补工作区角标)\n for (var i = 0; i < roots.length; i++) {\n if (roots[i].isConnected) swapWorkspaceIconsIn(roots[i]);\n }\n } else {\n applyRemoteNavIcon(); // 语言切换等无根场景全量扫一次\n swapWorkspaceIconsIn(document.body);\n applyRootLabelsIn(document.body);\n }\n }, 500);\n };\n var mo = new MutationObserver(function (muts) {\n for (var i = 0; i < muts.length; i++) {\n var added = muts[i].addedNodes;\n for (var j = 0; j < added.length; j++) {\n var node = added[j];\n // 设置导航图标:同步原位替换。MutationObserver 回调是微任务,\n // 在浏览器绘制前执行 —— 齿轮刚插入 DOM 就被换成显示器图标,\n // 用户看到的第一帧就是最终图标(2.4.2 修复齿轮闪现)。\n if (node && node.nodeType === 1 && node.isConnected) {\n checkCellIn(node);\n // 树根标签同样同步替换:微任务内、绘制前完成,避免先闪一下镜像目录 ID\n applyRootLabelsIn(node);\n }\n // 工作区地球角标依赖异步 remoteTitles,仍走防抖批量路径\n schedule(node);\n }\n }\n });\n mo.observe(document.body, { childList: true, subtree: true });\n var off = i18n.subscribe(function () { schedule(null); });\n return function () {\n mo.disconnect();\n if (off) off();\n if (timer) clearTimeout(timer);\n clearInterval(titleTimer);\n clearInterval(recheckTimer);\n };\n }, \"dsh-remote-ssh: settings nav monitor icon + tree root label + remote workspace folder-globe icon\");\n }\n\n // better-sidebar 0.15+ 的文件上传 UI 把原始字节流 POST 到 /sidebar/upload。\n // 远程工作区会话的文件树显示的是本地镜像目录,better-sidebar 会把上传写进\n // 本地镜像而不会到达远程。这里包装 fetch:目标目录位于某个远程工作区镜像\n // 目录内时,把该上传请求重定向到 /remote-ssh/upload(走 SSH 上传到远端)。\n ctx.effect(function () {\n if (typeof window === \"undefined\" || typeof window.fetch !== \"function\") return;\n var nativeFetch = window.fetch.bind(window);\n var mirrors = [];\n function refreshMirrors() {\n api(\"listWorkspaces\").then(function (r) {\n if (r && r.ok && Array.isArray(r.workspaces)) {\n mirrors = r.workspaces.map(function (w) {\n return String(w && w.mirrorPath || \"\").replace(/\\\\/g, \"/\").replace(/\\/+$/g, \"\").toLowerCase();\n }).filter(Boolean);\n }\n }).catch(function () {});\n }\n refreshMirrors();\n var timer = setInterval(refreshMirrors, 30000);\n function patchedFetch(input, init) {\n var raw = typeof input === \"string\" ? input : (input && input.url);\n if (typeof raw === \"string\") {\n try {\n var u = new URL(raw, window.location.origin);\n // better-sidebar 0.25+ 的保存走原始路由 POST /sidebar/write?sessionId&path[&cwd][&expectedMtimeMs],\n // 请求体就是全文(LF)。远程工作区里 path 是**镜像路径**:不接管就会写进本地镜像,\n // 远端文件没变(issue #37 的「保存不上」)。这里把保存改投本插件端点,本地工作区原样透传。\n if (u.pathname === \"/sidebar/write\") {\n var wpath = (u.searchParams.get(\"path\") || \"\").replace(/\\\\/g, \"/\").toLowerCase();\n var wbody = init && init.body;\n if (typeof wbody === \"string\") {\n for (var wi = 0; wi < mirrors.length; wi++) {\n var wm = mirrors[wi];\n if (wpath === wm || wpath.indexOf(wm + \"/\") === 0) {\n var wpayload = {\n sessionId: u.searchParams.get(\"sessionId\") || \"\",\n cwd: u.searchParams.get(\"cwd\") || \"\",\n path: u.searchParams.get(\"path\") || \"\",\n content: wbody\n };\n var emRaw = u.searchParams.get(\"expectedMtimeMs\");\n if (emRaw !== null && emRaw !== \"\") wpayload.expectedMtimeMs = Number(emRaw);\n return nativeFetch(new URL(\"/remote-ssh/write\", window.location.origin).toString(), {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify(wpayload)\n });\n }\n }\n }\n }\n if (u.pathname === \"/sidebar/upload\") {\n var dir = (u.searchParams.get(\"dir\") || \"\").replace(/\\\\/g, \"/\").replace(/\\/+$/g, \"\").toLowerCase();\n var cwd = (u.searchParams.get(\"cwd\") || \"\").replace(/\\\\/g, \"/\").replace(/\\/+$/g, \"\").toLowerCase();\n for (var i = 0; i < mirrors.length; i++) {\n var m = mirrors[i];\n var hit = (dir && (dir === m || dir.indexOf(m + \"/\") === 0)) || (cwd && (cwd === m || cwd.indexOf(m + \"/\") === 0));\n if (hit) {\n var target = new URL(\"/remote-ssh/upload\" + u.search, window.location.origin);\n return nativeFetch(target.toString(), init);\n }\n }\n }\n } catch (e) {}\n }\n return nativeFetch(input, init);\n }\n window.fetch = patchedFetch;\n return function () {\n clearInterval(timer);\n if (window.fetch === patchedFetch) window.fetch = nativeFetch;\n };\n }, \"dsh-remote-ssh: redirect remote-workspace uploads and editor saves\");\n\n // dsh-better-sidebar 是**可选**依赖,绝不能放进 exports.inject:\n // cordis 的 fiber 只要有一个 inject 键对应的服务没注册就整体停在 pending,\n // 前端会报 `web boot: 1 entry did not activate` / `pending (waiting for service: betterSidebar)`,\n // DSH Desktop 还会弹「插件恢复」——即使没装 better-sidebar 时内核自带侧边栏照常可用。\n // 因此改用子 fiber 软注入(前端自身也用 e.inject([\"uiRenderer\"], …) 这一招):\n // 装了 better-sidebar 就注册远程文件编辑器页签,没装就静默降级 ——\n // 宿主半边的 fs.*/终端拦截、设置页与模型工具都不依赖它。\n ctx.inject([\"betterSidebar\"], function (bsCtx) {\n var bs = bsCtx.betterSidebar;\n if (!bs || typeof bs.registerTab !== \"function\") return;\n // 远程文件编辑器页签(隐藏页签,仅由代码打开,每个远程文件单开一栏)。\n // remssh:files 和 remssh:term 已移除:远程文件由内置「文件」页签直接 SSH 读写,\n // 远程终端由内置「终端」页签提供(shell wrapper 自动 SSH)。\n bsCtx.effect(function () {\n return bs.registerTab({\n id: \"remssh:editor\",\n title: function () { return i18n.t(\"tabs.files\"); },\n hidden: true,\n dedupeKey: function (tab) { return (tab && tab.meta && tab.meta.profileId || \"\") + \"\\u0000\" + (tab && tab.path || \"\"); },\n icon: function () { return h(\"span\", null, \"📄\"); },\n component: function (props) {\n return h(RemoteEditor, { tab: props && props.tab, ctx: props && props.ctx, scope: props && props.scope });\n }\n });\n });\n });\n\n if (slots) {\n slots.inject(\"settings.section\", function () {\n return slots.register({\n name: \"settings.section\",\n id: \"remote-ssh\",\n order: 200,\n label: function () { return i18n.t(\"settings.nav\"); },\n locale: NS\n }, SettingsSection);\n });\n\n // 接管原生「添加工作区」流程:用明显更低的优先级覆盖内置的本地目录选择器,\n // 弹窗内提供「本地目录(DSH browse)/ 远程目录(SSH)」两种浏览。\n var flowInject = function () { return { workspaces: ctx.get(\"workspaces\") }; };\n ctx.effect(function () {\n return slots.inject(\"conversation.hero.workspace.directoryFlow\", function () {\n return slots.register({ name: \"conversation.hero.workspace.directoryFlow\", priority: -100, inject: flowInject }, RemoteWorkspaceFlow);\n });\n });\n ctx.effect(function () {\n return slots.inject(\"sidebar.workspaces.directoryFlow\", function () {\n return slots.register({ name: \"sidebar.workspaces.directoryFlow\", priority: -100, inject: flowInject }, RemoteWorkspaceFlow);\n });\n });\n }\n }\n\n exports.apply = apply;\n // 只声明内核一定提供的服务;betterSidebar(第三方 bundle dsh-better-sidebar)\n // 走 apply 内的 ctx.inject 软注入 —— 放进这里会让未安装它的用户 web boot 直接失败(issue #18)。\n exports.inject = [\"slots\", \"locale\"];\n return module.exports;\n}\n","/**\r\n * workspace-groups-remote — merged client entry.\r\n *\r\n * One package gets exactly one client row in the DSH web shell (the module\r\n * loader keys graph rows by package name), so this entry composes the two\r\n * client halves on one fiber:\r\n *\r\n * - groupsClient: the workspace-groups browser + session tab strip\r\n * (groups-client.ts, formerly this file).\r\n * - remoteSshClient: the dsh-remote-ssh client, vendored from\r\n * vendor/dsh-remote-ssh/lib/client.js. Upstream ships it as a\r\n * self-registering module-loader bundle; scripts/build-remote-ssh-client.mjs\r\n * strips that registration wrapper and re-exports the bare factory, which\r\n * is invoked here with this bundle's own require (its only requires are\r\n * `react` and `@deepseek-ai/dsh-client-ui-primitives`, both platform\r\n * modules) and applied alongside the groups client.\r\n *\r\n * The inject list is the union of both halves (remote-ssh's `slots`/`locale`\r\n * are a subset of the groups list).\r\n */\r\nimport type { Context } from '@deepseek-ai/cordis'\r\nimport * as groupsClient from './groups-client.ts'\r\nimport remoteSshFactory from './remote-ssh-factory.generated.mjs'\r\n\r\n/** Services required before mounting (union of both client halves). */\r\nexport const inject = ['slots', 'sessions', 'workspaces', 'uiWorkspace', 'locale']\r\n\r\n/** Instantiate the vendored remote-ssh client plugin exactly once. */\r\nconst remoteSshClient = remoteSshFactory(id => require(id))\r\n\r\n/** Plugin body: apply both client halves on this bundle's fiber. */\r\nexport function apply(ctx: Context): void {\r\n groupsClient.apply(ctx)\r\n remoteSshClient.apply(ctx)\r\n}\r\n"],"mappings":";;;;;;;;;;;;;EAsBA,SAAgB,wBAAwB,OAAwB,KAAa,UAAyB;GACpG,MAAM,kBAAkB,OAAO;EACjC;;EAGA,SAAgB,yBAAyB,OAAwB,KAAa,UAAyB;GACrG,MAAM,mBAAmB,OAAO;EAClC;;EAGA,SAAgB,eACd,OACA,cACA,eACM;GACN,MAAM,oBAAoB,OAAO,YAC/B,OAAO,QAAQ,MAAM,iBAAiB,CAAC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,CAAC;KACH,CAAC;IACH;GACF;GAEA,QAAQ,QAAQ;GAGhB,QAAQ,SAAS,CAAC,SAAS,QAAQ;GACnC,OAAO,OAAO;EAClB;;;EC56DA,MAAa,SAAS;GAAC;GAAS;GAAY;GAAc;GAAe;EAAQ;;EAGjF,MAAM,kBAAkBC,sCAAiB,OAAM,QAAQ,EAAE,CAAC;;EAG1D,SAAgB,MAAM,KAAoB;GACxC,QAAmB,GAAG;GACtB,gBAAgB,MAAM,GAAG;EAC3B"} \ No newline at end of file diff --git a/lib/groups.js b/lib/groups.js index 2a1c10d..a6b3634 100644 --- a/lib/groups.js +++ b/lib/groups.js @@ -1,7 +1,7 @@ import { lstat, mkdir, open, readFile, rename, unlink } from "node:fs/promises"; import { dirname, resolve } from "node:path"; import { homedir } from "node:os"; -// node_modules/js-yaml/dist/js-yaml.mjs +// node_modules/.pnpm/js-yaml@4.3.2/node_modules/js-yaml/dist/js-yaml.mjs function getDefaultExportFromCjs(x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; } diff --git a/lib/remote-ssh/index.js b/lib/remote-ssh/index.js index a24bf9f..0d78b78 100644 --- a/lib/remote-ssh/index.js +++ b/lib/remote-ssh/index.js @@ -1057,17 +1057,20 @@ function expandRemoteHome(path, home) { } /** - * Resolve a remote path to its canonical absolute form via one SSH round - * trip (also learns the remote $HOME). Returns { canonical, home }; on any - * failure canonical falls back to the home-expanded light form and the - * caller proceeds exactly as upstream would (fail-open). + * Resolve a remote path to its canonical absolute identity through one SSH + * round trip (also learns the remote $HOME). Returns a discriminated result: + * ok:false is NOT "not a duplicate" — the caller must refuse to create + * because it cannot prove the path is distinct. */ async function resolveRemoteCanonical(subprocess, p, rawPath) { const light = lightRemotePath(rawPath); + if (!light) return { ok: false, error: "remotePath 为空", home: "" }; try { const cmd = "printf '__DSH_HOME__%s\n' \"$HOME\"; cd " + shellQuotePath(light) + " 2>/dev/null && pwd -P"; const r = await runRemote(subprocess, p, cmd, undefined, 64 * 1024, undefined, 15000); - if (!r || !r.ok || !r.stdout) return { canonical: light, home: "" }; + if (!r || !r.ok) { + return { ok: false, error: String((r && (r.error || r.stderr)) || "SSH 解析失败").trim() || "SSH 解析失败", home: "" }; + } let home = ""; let resolved = ""; const lines = String(r.stdout).split("\n"); @@ -1076,10 +1079,14 @@ async function resolveRemoteCanonical(subprocess, p, rawPath) { if (t.startsWith("__DSH_HOME__")) home = t.slice("__DSH_HOME__".length).trim(); else if (t.startsWith("/")) resolved = t; } - if (!resolved) return { canonical: expandRemoteHome(light, home), home: home }; - return { canonical: lightRemotePath(resolved), home: home }; + if (!resolved) { + // cd failed (missing directory / permission / shell error): identity is + // unknown, never silently treated as a new directory. + return { ok: false, error: "无法解析远端目录(不存在或不可访问):" + light, home: home }; + } + return { ok: true, canonical: lightRemotePath(resolved), home: home }; } catch (e) { - return { canonical: light, home: "" }; + return { ok: false, error: String(e && e.message ? e.message : e), home: "" }; } } @@ -4929,25 +4936,47 @@ function apply(ctx, config) { // (或宿主重启丢了原生注册的那一条)必须在这里被"接管",而不是再造一条 —— // 否则设置面板里会出现两条一模一样的工作区,删其中一条还会连带删掉另一条的会话行。 const prefsNow = settingsFace.read(); - // [workspace-groups-remote patch] Canonical-path reuse: compare - // light-normalized spellings first; on a miss, resolve once over SSH - // (fail-open) and compare canonical forms, so ~/x, x/ and the absolute - // form of one directory all reuse the existing record instead of - // registering a duplicate workspace + mirror. The stored spelling - // converges to the matched/canonical form below. - let existing = prefsNow.workspaces.find((w) => w && w.profileId === a.profileId && lightRemotePath(w.remotePath) === lightRemotePath(a.remotePath)); - if (existing) { - a.remotePath = lightRemotePath(a.remotePath); - } else { - const resolvedCanonical = await resolveRemoteCanonical(subprocess, p, a.remotePath); - a.remotePath = resolvedCanonical.canonical; - existing = prefsNow.workspaces.find((w) => w && w.profileId === a.profileId && expandRemoteHome(lightRemotePath(w.remotePath), resolvedCanonical.home) === resolvedCanonical.canonical); + // [workspace-groups-remote patch] Canonical-path reuse: resolve the new + // spelling once over SSH and resolve every existing record of the same + // connection with the same rule (light form + remote $HOME + pwd -P), + // so relative/~, trailing-slash and symlink spellings converge on one + // directory identity. A resolution failure is NOT "not a duplicate": + // creation is refused with an actionable error instead of silently + // registering a second workspace. + const targetResolved = await resolveRemoteCanonical(subprocess, p, a.remotePath); + if (targetResolved.ok !== true) { + return { ok: false, error: "无法确认远端路径是否重复:" + targetResolved.error + ";未创建新工作区" }; } + const sameProfile = prefsNow.workspaces.filter((w) => w && w.profileId === a.profileId && typeof w.remotePath === "string"); + let existing = undefined; + for (const record of sameProfile) { + const light = lightRemotePath(record.remotePath); + // Fast path: the spelling expands to exactly the resolved target. + if (expandRemoteHome(light, targetResolved.home) === targetResolved.canonical) { + existing = record; + break; + } + // Slow path: resolve the old record with the SAME rules. This catches + // relative paths, symlinks and historical spellings the old partial + // expansion missed. A failure aborts instead of assuming uniqueness. + const candidate = await resolveRemoteCanonical(subprocess, p, record.remotePath); + if (candidate.ok !== true) { + return { ok: false, error: "无法确认是否与已有远程工作区「" + String(record.title || record.id) + "」重复:" + candidate.error + ";未创建新工作区" }; + } + if (candidate.canonical === targetResolved.canonical) { + existing = record; + break; + } + } + a.remotePath = existing ? String(existing.remotePath) : targetResolved.canonical; const wsId = existing ? existing.id : ("w" + Date.now().toString(36) + Math.random().toString(36).slice(2, 6)); // 默认标题取远程路径最后一段目录名(如 ~/proj/DSH_Test → DSH_Test); // 取不到有效段(如 ~/ 或 /)时回退为 连接名:远程路径。 + // [workspace-groups-remote patch] Reuse keeps the user's existing + // title; only a new record (or an explicit a.title) derives one from + // the path. Otherwise "reuse" could silently rename a custom workspace. const lastSeg = String(a.remotePath).replace(/\/+$/, "").split("/").pop(); - const title = a.title || (lastSeg && lastSeg !== "~" ? lastSeg : (p.name + ":" + a.remotePath)); + const title = a.title || (existing && existing.title) || (lastSeg && lastSeg !== "~" ? lastSeg : (p.name + ":" + a.remotePath)); // 本地镜像目录:作为原生工作区注册进 workspaceRegistry,会话 cwd 即指向它。 // 根目录走 mirrorBaseDir()(与 fs 处理器的镜像判定同一处,避免两处各写一遍后漂移)。 // 复用旧条目时沿用它原来的镜像目录 —— 里面可能有用户没推回去的本地改动。 diff --git a/lib/types/client/folders-persist.d.ts b/lib/types/client/folders-persist.d.ts index 56e8774..42f8290 100644 --- a/lib/types/client/folders-persist.d.ts +++ b/lib/types/client/folders-persist.d.ts @@ -26,12 +26,26 @@ export interface FoldersSnapshot { readonly remoteBase?: string; } /** - * Fetch the stored folder overlay. - * @param fetchImpl - fetch implementation (injectable for tests). - * @returns the overlay plus the reported mirror base; the empty document on any - * failure. + * One folder-overlay read result. A failed read must never masquerade as the + * empty document: the browser uses `ok` to keep the last confirmed rows and + * show a retryable error instead of rendering every member as a duplicate. */ -export declare function loadFolders(fetchImpl?: typeof fetch): Promise; +export interface FoldersLoadResult extends FoldersSnapshot { + readonly ok: boolean; + /** Human-readable failure reason; absent on success. */ + readonly error?: string; +} +/** + * Fetch the stored folder overlay. + * + * A non-2xx response, a malformed body or a transport error is returned as + * `ok:false` with the reason. The empty document is still present for callers + * that only need a safe value, but `ok` is the authority: the browser must not + * treat a failed read as "no folders". + * @param fetchImpl - fetch implementation (injectable for tests). + * @param signal - optional cancellation for a superseded read/retry. + */ +export declare function loadFolders(fetchImpl?: typeof fetch, signal?: AbortSignal): Promise; /** * Read a whole folder document off the wire (GET response, PUT echo or the * 409 conflict body), or null when it is not a version-1 document. @@ -45,7 +59,9 @@ export declare function parseWireDocument(source: Record): Fold */ export declare class FoldersConflictError extends Error { readonly current: FoldersDocument; - constructor(current: FoldersDocument); + /** The unsaved document the failed PUT attempted to write. */ + readonly attempted: FoldersDocument; + constructor(current: FoldersDocument, attempted?: FoldersDocument); } /** * Store the whole folder overlay. diff --git a/lib/types/client/locales.d.ts b/lib/types/client/locales.d.ts index 3fe01b6..6949620 100644 --- a/lib/types/client/locales.d.ts +++ b/lib/types/client/locales.d.ts @@ -4,7 +4,7 @@ */ import type { LocaleDictOf } from '@deepseek-ai/dsh-client-ui-slots'; /** Dictionary keys of the workspaceGroups namespace (single source of truth). */ -export type WorkspaceGroupsKey = 'section.workspaces' | 'section.sessions' | 'search' | 'search.placeholder' | 'search.clear' | 'search.noMatches' | 'search.unavailable' | 'search.pending' | 'search.hasMore' | 'search.results.aria' | 'workspace.add' | 'workspace.addBusy' | 'workspace.addError' | 'workspace.addErrorTitle' | 'workspace.rename' | 'workspace.delete' | 'workspace.deleteTitle' | 'workspace.deleteConfirm' | 'workspace.deleteCancel' | 'workspace.renaming' | 'workspace.deleting' | 'workspace.renameTitle' | 'workspace.renamePlaceholder' | 'workspace.renameConfirm' | 'workspace.renameCancel' | 'workspace.moveOutOfGroup' | 'workspace.openInFolder' | 'workspace.openInFolderError' | 'folder.title' | 'folder.manage' | 'folder.listAria' | 'folder.sectionList' | 'folder.sectionAdd' | 'folder.emptyHint' | 'folder.base' | 'folder.setRoot' | 'folder.rootBadge' | 'folder.remove' | 'folder.add' | 'folder.done' | 'folder.duplicate' | 'folder.conflict' | 'folder.removeError' | 'folder.removeRemotePrompt' | 'folder.removeRemoteDelete' | 'folder.removeRemoteOnly' | 'folder.addError' | 'folder.sessionError' | 'folder.saveError' | 'folder.notReady' | 'folder.remoteSessionUnsupported' | 'folder.remoteHint' | 'folder.remoteNeedsSubpath' | 'folder.subpathLabel' | 'folder.subpathPlaceholder' | 'folder.addSubpath' | 'folder.subpathInvalid' | 'folder.cloudSection' | 'folder.profileLabel' | 'folder.remotePathLabel' | 'folder.remotePathPlaceholder' | 'folder.remotePathOrName' | 'folder.createAndAdd' | 'folder.cloudNoteBoth' | 'folder.addRemote' | 'folder.noProfiles' | 'folder.profilesError' | 'folder.cloudTag' | 'folder.localTag' | 'folder.memberMissing' | 'folder.memberNested' | 'folder.alreadyRoot' | 'folder.addAria' | 'folder.tabLocal' | 'folder.tabCloud' | 'folder.pickLocal' | 'folder.localNote' | 'folder.localIntoRemote' | 'folder.cloudNote' | 'folder.browse' | 'folder.browseTitle' | 'folder.browseListAria' | 'folder.browseNote' | 'folder.browseFailed' | 'folder.chooseHere' | 'folder.up' | 'folder.home' | 'folder.refresh' | 'folder.loading' | 'folder.emptyDir' | 'group.create' | 'group.createTitle' | 'group.createPlaceholder' | 'group.createConfirm' | 'group.createCancel' | 'group.rename' | 'group.renameTitle' | 'group.renameConfirm' | 'group.delete' | 'group.deleteTitle' | 'group.deleteConfirm' | 'group.deleteCancel' | 'group.nameDuplicate' | 'group.nameReserved' | 'group.pin' | 'group.unpin' | 'group.pinned' | 'group.appearance' | 'group.appearanceTitle' | 'group.appearanceDone' | 'group.color' | 'group.colorDefault' | 'group.icon' | 'group.iconDefault' | 'group.iconCustom' | 'group.iconInvalid' | 'group.icon.section.common' | 'group.icon.section.lab' | 'group.icon.section.materials' | 'group.icon.section.characterization' | 'group.icon.section.devices' | 'group.icon.section.emoji' | 'color.red' | 'color.orange' | 'color.amber' | 'color.green' | 'color.teal' | 'color.blue' | 'color.indigo' | 'color.purple' | 'color.pink' | 'color.gray' | 'section.topLevel' | 'section.defaultWorkspace' | 'manual.saveError' | 'manual.conflict' | 'session.new' | 'session.rename' | 'session.archive' | 'session.fork' | 'session.renameTitle' | 'session.renamePlaceholder' | 'session.renameConfirm' | 'session.renameCancel' | 'session.renaming' | 'uncategorized' | 'empty.none' | 'empty.noWorkspaces' | 'close' | 'cancel' | 'confirm' | 'retry' | 'configUnavailable' | 'collapse' | 'expandMore' | 'newSession' | 'quick.title' | 'quick.tab.workspaces' | 'quick.tab.sessions' | 'quick.search.placeholder' | 'quick.search.sessions' | 'quick.empty.workspaces' | 'quick.action.newSession' | 'quick.action.running' | 'quick.action.noneRunning' | 'quick.empty.sessions' | 'quick.select.hint' | 'quick.hint' | 'tabs.aria' | 'tabs.close' | 'tabs.archive' | 'tabs.pin' | 'tabs.unpin' | 'tabs.pinned' | 'tabs.rename' | 'tabs.renameSession' | 'tabs.renamePlaceholder' | 'tabs.closeOthers' | 'tabs.closeRight' | 'tabs.dragHint'; +export type WorkspaceGroupsKey = 'section.workspaces' | 'section.sessions' | 'search' | 'search.placeholder' | 'search.clear' | 'search.noMatches' | 'search.unavailable' | 'search.pending' | 'search.hasMore' | 'search.results.aria' | 'workspace.add' | 'workspace.addBusy' | 'workspace.addError' | 'workspace.addErrorTitle' | 'workspace.rename' | 'workspace.delete' | 'workspace.deleteTitle' | 'workspace.deleteConfirm' | 'workspace.deleteCancel' | 'workspace.renaming' | 'workspace.deleting' | 'workspace.renameTitle' | 'workspace.renamePlaceholder' | 'workspace.renameConfirm' | 'workspace.renameCancel' | 'workspace.moveOutOfGroup' | 'workspace.openInFolder' | 'workspace.openInFolderError' | 'folder.title' | 'folder.manage' | 'folder.listAria' | 'folder.sectionList' | 'folder.sectionAdd' | 'folder.emptyHint' | 'folder.base' | 'folder.setRoot' | 'folder.rootBadge' | 'folder.remove' | 'folder.add' | 'folder.done' | 'folder.duplicate' | 'folder.conflict' | 'folder.removeError' | 'folder.removeRemotePrompt' | 'folder.removeRemoteDelete' | 'folder.removeRemoteOnly' | 'folder.addError' | 'folder.sessionError' | 'folder.saveError' | 'folder.notReady' | 'folder.remoteSessionUnsupported' | 'folder.remoteHint' | 'folder.remoteNeedsSubpath' | 'folder.subpathLabel' | 'folder.subpathPlaceholder' | 'folder.addSubpath' | 'folder.subpathInvalid' | 'folder.cloudSection' | 'folder.profileLabel' | 'folder.remotePathLabel' | 'folder.remotePathPlaceholder' | 'folder.remotePathOrName' | 'folder.createAndAdd' | 'folder.cloudNoteBoth' | 'folder.addRemote' | 'folder.noProfiles' | 'folder.profilesError' | 'folder.cloudTag' | 'folder.localTag' | 'folder.memberMissing' | 'folder.memberNested' | 'folder.alreadyRoot' | 'folder.addAria' | 'folder.tabLocal' | 'folder.tabCloud' | 'folder.pickLocal' | 'folder.localNote' | 'folder.localIntoRemote' | 'folder.cloudNote' | 'folder.browse' | 'folder.browseTitle' | 'folder.browseListAria' | 'folder.browseNote' | 'folder.browseFailed' | 'folder.chooseHere' | 'folder.up' | 'folder.home' | 'folder.refresh' | 'folder.loading' | 'folder.loadingState' | 'folder.loadError' | 'folder.refreshError' | 'folder.retry' | 'folder.retryDraft' | 'folder.discardDraft' | 'folder.conflictDetail' | 'folder.emptyDir' | 'group.create' | 'group.createTitle' | 'group.createPlaceholder' | 'group.createConfirm' | 'group.createCancel' | 'group.rename' | 'group.renameTitle' | 'group.renameConfirm' | 'group.delete' | 'group.deleteTitle' | 'group.deleteConfirm' | 'group.deleteCancel' | 'group.nameDuplicate' | 'group.nameReserved' | 'group.pin' | 'group.unpin' | 'group.pinned' | 'group.appearance' | 'group.appearanceTitle' | 'group.appearanceDone' | 'group.color' | 'group.colorDefault' | 'group.icon' | 'group.iconDefault' | 'group.iconCustom' | 'group.iconInvalid' | 'group.icon.section.common' | 'group.icon.section.lab' | 'group.icon.section.materials' | 'group.icon.section.characterization' | 'group.icon.section.devices' | 'group.icon.section.emoji' | 'color.red' | 'color.orange' | 'color.amber' | 'color.green' | 'color.teal' | 'color.blue' | 'color.indigo' | 'color.purple' | 'color.pink' | 'color.gray' | 'section.topLevel' | 'section.defaultWorkspace' | 'manual.saveError' | 'manual.conflict' | 'session.new' | 'session.rename' | 'session.archive' | 'session.fork' | 'session.renameTitle' | 'session.renamePlaceholder' | 'session.renameConfirm' | 'session.renameCancel' | 'session.renaming' | 'uncategorized' | 'empty.none' | 'empty.noWorkspaces' | 'close' | 'cancel' | 'confirm' | 'retry' | 'configUnavailable' | 'collapse' | 'expandMore' | 'newSession' | 'quick.title' | 'quick.tab.workspaces' | 'quick.tab.sessions' | 'quick.search.placeholder' | 'quick.search.sessions' | 'quick.empty.workspaces' | 'quick.action.newSession' | 'quick.action.running' | 'quick.action.noneRunning' | 'quick.empty.sessions' | 'quick.select.hint' | 'quick.hint' | 'tabs.aria' | 'tabs.close' | 'tabs.archive' | 'tabs.pin' | 'tabs.unpin' | 'tabs.pinned' | 'tabs.rename' | 'tabs.renameSession' | 'tabs.renamePlaceholder' | 'tabs.closeOthers' | 'tabs.closeRight' | 'tabs.dragHint'; export type WorkspaceGroupsDict = LocaleDictOf<'workspaceGroups'>; /** Simplified Chinese dictionary. */ export declare const zh: WorkspaceGroupsDict; diff --git a/package.json b/package.json index a5a1020..0e87121 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "workspace-groups-remote", - "version": "1.0.3", + "version": "1.1.0", "description": "Merged DSH bundle: the workspace-groups sidebar manager (category -> project -> session grouped tree, session tab strip) plus dsh-remote-ssh (VSCode Remote-SSH-like remote development: remote workspaces, file access, integrated terminal) in one installable package.", "keywords": [ "dsh", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..753661a --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,3387 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@deepseek-ai/dsh-tools': + specifier: ^0.1.0-rc.6 || ^0.1.5-rc.1 || ^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-rc.1 + version: 0.2.1-rc.5(666b24f7fdca183de44b9b4a80ebd640) + '@deepseek-ai/schemastery': + specifier: ^3.18.4 + version: 3.19.0 + js-yaml: + specifier: ^4.1.0 + version: 4.3.2 + yaml: + specifier: ^2.9.1 + version: 2.9.1 + devDependencies: + '@deepseek-ai/cordis': + specifier: ^4.0.4 + version: 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-api-remotes': + specifier: 0.2.0-rc.1 + version: 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-api-session-controller': + specifier: 0.2.0-rc.1 + version: 0.2.0-rc.1(9b462facac363b65e9219b2cbd122587) + '@deepseek-ai/dsh-api-workspace-controller': + specifier: 0.2.0-rc.1 + version: 0.2.0-rc.1(183631cae50a354b57dd9a8353599a19) + '@deepseek-ai/dsh-client-locale': + specifier: 0.2.0-rc.1 + version: 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-client-store': + specifier: 0.2.0-rc.1 + version: 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-client-ui-conversation': + specifier: 0.2.0-rc.1 + version: 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-client-ui-primitives': + specifier: 0.2.0-rc.1 + version: 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-client-ui-renderer': + specifier: 0.2.0-rc.1 + version: 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-client-ui-session': + specifier: 0.2.0-rc.1 + version: 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-client-ui-sidebar': + specifier: 0.2.0-rc.1 + version: 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-client-ui-slots': + specifier: 0.2.0-rc.1 + version: 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-client-ui-workspace': + specifier: 0.2.0-rc.1 + version: 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-host-webserver': + specifier: 0.2.0-rc.1 + version: 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session': + specifier: 0.2.0-rc.1 + version: 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@types/js-yaml': + specifier: ^4.0.9 + version: 4.0.9 + '@types/node': + specifier: ^24.0.0 + version: 24.19.2 + '@types/react': + specifier: ~18.3.1 + version: 18.3.31 + '@types/react-dom': + specifier: ~18.3.0 + version: 18.3.7(@types/react@18.3.31) + immer: + specifier: ^11.1.18 + version: 11.2.10 + jsdom: + specifier: ^30.0.1 + version: 30.1.3 + lightningcss: + specifier: ^1.32.0 + version: 1.33.0 + react: + specifier: ^18.2.0 + version: 18.3.1 + react-dom: + specifier: ^18.2.0 + version: 18.3.1(react@18.3.1) + tsdown: + specifier: ^0.22.2 + version: 0.22.14(typescript@5.9.3) + typescript: + specifier: ^5.6.0 + version: 5.9.3 + vitest: + specifier: 4.1.8 + version: 4.1.8(@types/node@24.19.2)(jsdom@30.1.3)(vite@8.3.8(@types/node@24.19.2)(yaml@2.9.1)) + zustand: + specifier: ^5.0.15 + version: 5.1.0(@types/react@18.3.31)(immer@11.2.10)(react@18.3.1) + +packages: + + '@asamuzakjp/css-color@7.2.0': + resolution: {integrity: sha512-+JNLVlzePs1XiBT5s9aVkEjOePRoB//tk3bc69BGdzQCz7EICVSQuVPZu6tjc7vAJxBx5fama67LbOltwnXzPQ==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@asamuzakjp/dom-selector@10.0.5': + resolution: {integrity: sha512-EgmJ7oEaGQECTn3H3wmnQpEy4hKY66VvM7VQndwPIQob3p877BgbyOUE3EX0LgXQCciF2H8KMdR+RznqjMNOLw==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + '@bramus/specificity@2.4.3': + resolution: {integrity: sha512-0GEz8qJWokkUVYQYRukmkSHIFNoBH8QTreeHrAFbvz1XFYc3Y+puhMs8PQ5x8GNugiC2l5jvDBXKLbBIByeSBw==} + hasBin: true + + '@csstools/color-helpers@6.1.2': + resolution: {integrity: sha512-grhRy3OKmniaAEKXMjua5z/EODX0MSqBGjunw8+j/3HQjOnahs2AGhvEOIYVUWcU6ScApbhLhVrQTX8XqrMrow==} + engines: {node: '>=20.19.0'} + + '@csstools/css-calc@3.4.3': + resolution: {integrity: sha512-iex20d8CHVkyvg6B7UKV7uHnI2Bqo9g+EFfT9E0y+GvTvhZ/DwONJ+9aKb1dlqm0ZiGsL5RXjp0fCoJYnkeDjA==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@csstools/css-parser-algorithms': ^4.0.2 + '@csstools/css-tokenizer': ^4.0.2 + + '@csstools/css-color-parser@4.2.7': + resolution: {integrity: sha512-zgm9yjQz5iJB4VL8RyVwd71TWB8Q89FSxt/NzXoWqPSkEBOVtn9L6vAPtSc9hpKfB0Awo/AL2VKFHjYetBLFHQ==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@csstools/css-parser-algorithms': ^4.0.2 + '@csstools/css-tokenizer': ^4.0.2 + + '@csstools/css-parser-algorithms@4.0.2': + resolution: {integrity: sha512-40cSKyMvK+tq4qz6Awrlye2WGuOKt3FwPgtGg6KTfbHOWNw+Rk1rzbAtZnZ6IBhsY491HLRnDXwoyBAijmmILA==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@csstools/css-tokenizer': ^4.0.2 + + '@csstools/css-syntax-patches-for-csstree@1.1.16': + resolution: {integrity: sha512-LsDbJPP/B8cPasUJyTA5S99F7C4G93ngW8hUluXz8CFeOaaRnBPtBiIlvgcPYU0HmHNz8CXg+1vwFrIB4F6Dgw==} + peerDependencies: + css-tree: ^3.2.1 + peerDependenciesMeta: + css-tree: + optional: true + + '@csstools/css-tokenizer@4.0.2': + resolution: {integrity: sha512-OoKoR0f76dCY666JlcbhmVTs2drYj1GUXZTYTcbUgJjh9Nv41aFfZ21bPQTERm5+L5cBDo466NltB2lplS5GBw==} + engines: {node: '>=20.19.0'} + + '@deepseek-ai/cordis-plugin-group@1.0.5': + resolution: {integrity: sha512-PGYqImAydmAjmy5fl1Js6qDmk0Ivt1fipa3fOj1KyyRd0tZ9i61a2rhzHc7LaSeBb/spJ1LF4k3Pcppaq+w8fw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.5 + '@deepseek-ai/cordis-plugin-loader': ~1.0.6 + + '@deepseek-ai/cordis-plugin-include@1.0.10': + resolution: {integrity: sha512-Rdo6Uqf9WfDbfN3dsYkYj/EW+SGuWCSfthz1PoOtZYUr6qrRpqD7ND4Gj3nUYj8XhSGIo8E3xpsck6J5nM5BYQ==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.5 + '@deepseek-ai/cordis-plugin-loader': ~1.0.6 + + '@deepseek-ai/cordis-plugin-loader@1.0.6': + resolution: {integrity: sha512-fr011A782oEjkJXCY4pePt2qaPpkGvem7Rmst6Rhwgg6icgwI4eN9QBRb6S/q9XOYGVQUdvL0wXUWyNxO8WipA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.5 + node-addon-require-builtin: ^0.1.9 + peerDependenciesMeta: + node-addon-require-builtin: + optional: true + + '@deepseek-ai/cordis@4.1.0': + resolution: {integrity: sha512-CJrjNyBkKn1SfvBQUcgFYKFnLjS+uKrhdMsbHU60xabvi12d+xQ+IQSNlME5Z+B+4Zi6n4BDknKY94tEPeo47w==} + hasBin: true + peerDependencies: + '@deepseek-ai/cordis-plugin-include': ~1.1.0 + '@deepseek-ai/cordis-plugin-loader': ~1.1.0 + peerDependenciesMeta: + '@deepseek-ai/cordis-plugin-include': + optional: true + '@deepseek-ai/cordis-plugin-loader': + optional: true + + '@deepseek-ai/cosmokit@1.8.6': + resolution: {integrity: sha512-ZSD/fN52L498LBIOYwjIOlaLv5veY6ZEwI2yzvZUKQtctn0QAPqu8tKdJ+OF5+Tv6NBq1U+wJWH+QI6OGy5EvQ==} + + '@deepseek-ai/cosmokit@1.9.0': + resolution: {integrity: sha512-5O1S53mZiJyZYcvxxD0Qv1EY7qFPSxbGyD8CbVK6gw7W9FvcXZj2YIX1ZkOqyQQ3Xt2rFkZDHJv0+V3Zmmp8CA==} + + '@deepseek-ai/dsh-agent-default-model@0.2.0-rc.1': + resolution: {integrity: sha512-blP7HPyC1PMyCYVU22fcGdFJX0YWflNGFaVn7D2lmgd7BuD5f0o+SibFLSFr0VGU6b32ZlSGC4TABoxxBn8Btw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-agent': 0.2.0-rc.1 + '@deepseek-ai/dsh-llm': 0.2.0-rc.1 + + '@deepseek-ai/dsh-agent-preset-registry@0.2.0-rc.1': + resolution: {integrity: sha512-66oQDnV4N0vaolLb+/YjfnDlK1+HeIORqCs0kAVsDeyFCKwyxvQhy6JJdAfm8S1nhQdC5Qo8u4IQ9UjYjhlncA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/cordis-plugin-include': ~1.0.9 + '@deepseek-ai/cordis-plugin-loader': ~1.0.5 + '@deepseek-ai/dsh-agent': 0.2.0-rc.1 + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1 + '@deepseek-ai/dsh-scope': 0.2.0-rc.1 + '@deepseek-ai/dsh-session': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-projection': 0.2.0-rc.1 + '@deepseek-ai/dsh-settings': 0.2.0-rc.1 + '@deepseek-ai/dsh-system-prompt': 0.2.0-rc.1 + '@deepseek-ai/dsh-tools': 0.2.0-rc.1 + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1 + + '@deepseek-ai/dsh-agent@0.2.0-rc.1': + resolution: {integrity: sha512-PQ4Qtu7QiI6j2n730p8RJ+u4l7ywwhVJ4NeIe/Tj86hBYYZNvNT8iMhViECn+GSepAk7GmM/1eb7e7hvmYhsKA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1 + '@deepseek-ai/dsh-llm': 0.2.0-rc.1 + '@deepseek-ai/dsh-scope': 0.2.0-rc.1 + '@deepseek-ai/dsh-session': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-projection': 0.2.0-rc.1 + '@deepseek-ai/dsh-system-prompt': 0.2.0-rc.1 + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1 + '@deepseek-ai/dsh-util-values': 0.2.0-rc.1 + '@deepseek-ai/dsh-workspace': 0.2.0-rc.1 + peerDependenciesMeta: + '@deepseek-ai/dsh-workspace': + optional: true + + '@deepseek-ai/dsh-api-gateway@0.2.0-rc.1': + resolution: {integrity: sha512-HoBQyk/S5HtUJaQ3GDPWV2WvTq7BxVWlJoU4d/DYbpfzPdnb94ZUzY3fgi6g+xQqW2q80zq+k9tuJpVciypR1w==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-client-connection': 0.2.0-rc.1 + + '@deepseek-ai/dsh-api-remotes@0.2.0-rc.1': + resolution: {integrity: sha512-XJYSFJ6pR/12mneBwAvtgOcoBFu7qhVXYZ3M3B3qtZDnVN6i7iR5IAu90ZqqsMU1oqUgIfqfyFne4XRiii3GPg==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-scope': 0.2.0-rc.1 + + '@deepseek-ai/dsh-api-session-controller@0.2.0-rc.1': + resolution: {integrity: sha512-0oSU0vdUjQycdVPvqZeEGrnBvRiKySgLOqZ/FwDYh0FjcpD8/1SKAKhsNKq8IavjiYEXluFpT55dvOEfmicEkA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-agent': 0.2.0-rc.1 + '@deepseek-ai/dsh-agent-default-model': 0.2.0-rc.1 + '@deepseek-ai/dsh-agent-preset-registry': 0.2.0-rc.1 + '@deepseek-ai/dsh-api-gateway': 0.2.0-rc.1 + '@deepseek-ai/dsh-attachment': 0.2.0-rc.1 + '@deepseek-ai/dsh-client-connection': 0.2.0-rc.1 + '@deepseek-ai/dsh-client-file-upload': 0.2.0-rc.1 + '@deepseek-ai/dsh-commands': 0.2.0-rc.1 + '@deepseek-ai/dsh-credentials': 0.2.0-rc.1 + '@deepseek-ai/dsh-file-reference': 0.2.0-rc.1 + '@deepseek-ai/dsh-fs': 0.2.0-rc.1 + '@deepseek-ai/dsh-llm': 0.2.0-rc.1 + '@deepseek-ai/dsh-native-command': 0.2.0-rc.1 + '@deepseek-ai/dsh-scope': 0.2.0-rc.1 + '@deepseek-ai/dsh-session': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-persistence': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-projection': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-projection-cache': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-query': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-title': 0.2.0-rc.1 + '@deepseek-ai/dsh-settings': 0.2.0-rc.1 + '@deepseek-ai/dsh-skill': 0.2.0-rc.1 + '@deepseek-ai/dsh-subagent': 0.2.0-rc.1 + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1 + '@deepseek-ai/dsh-typert-registry': 0.2.0-rc.1 + '@deepseek-ai/dsh-util-time': 0.2.0-rc.1 + '@deepseek-ai/dsh-util-values': 0.2.0-rc.1 + '@deepseek-ai/dsh-util-workspace-path': 0.2.0-rc.1 + '@deepseek-ai/dsh-workspace': 0.2.0-rc.1 + peerDependenciesMeta: + '@deepseek-ai/dsh-session-persistence': + optional: true + '@deepseek-ai/dsh-session-projection-cache': + optional: true + '@deepseek-ai/dsh-settings': + optional: true + + '@deepseek-ai/dsh-api-workspace-controller@0.2.0-rc.1': + resolution: {integrity: sha512-ufdQT5WCoHC2eQNBMX/aMtv8FgKdQs6kIdSQaBRZ+olYgfC9WKh4LeUG96KZFXp1KMvMpgdWgarANHcd6Gwviw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-api-gateway': 0.2.0-rc.1 + '@deepseek-ai/dsh-client-connection': 0.2.0-rc.1 + '@deepseek-ai/dsh-host-directory-picker': 0.2.0-rc.1 + '@deepseek-ai/dsh-session': 0.2.0-rc.1 + '@deepseek-ai/dsh-storage-domain': 0.2.0-rc.1 + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1 + '@deepseek-ai/dsh-workspace': 0.2.0-rc.1 + + '@deepseek-ai/dsh-app-boot@0.2.0-rc.1': + resolution: {integrity: sha512-iHUYI+Tc3FlaYay0aLg4LsmZELi8wNWd6DSYrd46enUv0SWgm3qXVFLZivlcKqKWxcjuuvL5JxNemxGiMRIWxQ==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/cordis-plugin-group': ~1.0.4 + '@deepseek-ai/cordis-plugin-include': ~1.0.9 + '@deepseek-ai/cordis-plugin-loader': ~1.0.5 + '@deepseek-ai/dsh-home-paths': 0.2.0-rc.1 + '@deepseek-ai/dsh-launch-environment': 0.2.0-rc.1 + '@deepseek-ai/dsh-system-prompt': 0.2.0-rc.1 + + '@deepseek-ai/dsh-atomic-write@0.2.0-rc.1': + resolution: {integrity: sha512-xfqotH4A560oEQl+EzvyAJFjhiFF68ywiM/LuSuMQ2xvqLnaX50tJV/WCCBfVguM+4x/hObI0jz4oLDBs0d2Kg==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-attachment@0.2.0-rc.1': + resolution: {integrity: sha512-aKKFE9fGYYn1BCzDtun7IYkpiMANYt7s51vwPukkCnobNiLfxHrIyANLWNmMTSpq0iENfqREXPR805K/um8Hfw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-brand': 0.2.0-rc.1 + + '@deepseek-ai/dsh-brand@0.2.0-rc.1': + resolution: {integrity: sha512-TPeMaUt/Xev0X2TfIf6pSVVGiWAbFHy+VWCIW+w8UkC0yH1ep9302JQOBqhUgefAM4s/3W1R8lra/PMbFhjx2w==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-brand@0.2.1-rc.5': + resolution: {integrity: sha512-7lUfWjWWAkrb/CFtMbXgjXLYQnL3KJwv+GLMTgY5EZ/4sOH0ufZUX8xlBWyMpdV2LqdvJ1yPKQ+mopH71/wbMQ==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.5 + + '@deepseek-ai/dsh-chunked-list@0.2.0-rc.1': + resolution: {integrity: sha512-UbIx0v5VuVR58vMX6Tv/myS91HSRakMutKHimBT152JjaVWD75tBx+3luRrGFRZesEJ22tNZ0TdTidRCHKgBKA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-client-connection@0.2.0-rc.1': + resolution: {integrity: sha512-aMZvpoyryBUYpqIBxaC8+nYWcwluSCegIU5JIuKnWMyaZLNvMC187ZPm7Bbpvy3pR2hnfWqJaFkl2XQodGfGCA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-scope': 0.2.0-rc.1 + + '@deepseek-ai/dsh-client-file-upload@0.2.0-rc.1': + resolution: {integrity: sha512-vy7v1lOvHUcVYv2GYxz6+iWVQq3lNiJbcBTxjmDESEyEhpv9mtCA6qE0aIict9GrUmvFVhhVZh8+HyYyQr2yeg==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-scope': 0.2.0-rc.1 + + '@deepseek-ai/dsh-client-locale@0.2.0-rc.1': + resolution: {integrity: sha512-4LNz28WCad8v3quEeuSTXOTHb6YHrMGkjIq73W+6+6zkEBbbmpfiz4FJ3MW9iE72DXLR9/IyUHNBpf6N/CVZ4Q==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-client-store@0.2.0-rc.1': + resolution: {integrity: sha512-fvjAr7KvcfH/GOGiOuZiNhwZyga+HSyYsb0tvCBHHEn3UiyGZzaguaLa6RtN++GTvE+lUUExpWSNuTGlZQ28zw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-client-ui-conversation@0.2.0-rc.1': + resolution: {integrity: sha512-2aDx9NZUrExfCe6elV5RczHoxJS/zyJlpdv7fD1FyTZIN7DS2yvDQe9+P6FpPCUfm1Sn6y0slls8QK9aLo4IvQ==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-client-ui-primitives@0.2.0-rc.1': + resolution: {integrity: sha512-1CCpyIh5PJljyXS9zQP8ib6JAg2p6PELh+iZhD3VBjQC5ZZ5i/zdgNGVOGr6Uu+sUpU7BkjYPvUkhy7AZQJWYA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-client-ui-renderer@0.2.0-rc.1': + resolution: {integrity: sha512-jEX/d4MBgfMEYVhGN2ooiJsPfk596+ISPLKYTfOwSTTOwus/9bvGI8dMCIz2CrSKa0LMHcK6lUi/f0nQ6hWQlw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-client-ui-session@0.2.0-rc.1': + resolution: {integrity: sha512-eNFVTb0GwNxI0Q7ZlzjHsIXvFYw4NCApMcdw0DnxYw6tsAc2oLFkYFUx/PACigYvWhPiGLw4xZtOEkW5/Iekfw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-client-ui-sidebar@0.2.0-rc.1': + resolution: {integrity: sha512-OiUg7wrTDt7syjE1CEc6SuXqdNwQZ9naGwUYqGJyFPnyR54o1qM9HPwNP7bwQHgcF/JjizpvgB/9u8rgWzM01g==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-client-ui-slots@0.2.0-rc.1': + resolution: {integrity: sha512-GrQbf1KN9NGa63ZBocAKAA2W5aahRCOAQVYQoW2OLIvg5h2e1j30dqMx+nptni59YUvg0DmmLj6ggUXvFpzCQA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-client-ui-workspace@0.2.0-rc.1': + resolution: {integrity: sha512-8ehLXqZGvFWk93RxQwnCKkaoMrTxdyE7HBbKyXaav3V6GAMOpe+MbUmR8fLm17JTno4cfMr/Mg2S4P9hS5dBAw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-commands@0.2.0-rc.1': + resolution: {integrity: sha512-VZOWNwjBDBkX3kXVJcD24oAoKeGRpLnHZjRiPm0gq41ZClCYy9CzNnFdl6IVtJHfG+bz9/HDnONilpiRwBg2lQ==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-agent': 0.2.0-rc.1 + '@deepseek-ai/dsh-attachment': 0.2.0-rc.1 + '@deepseek-ai/dsh-brand': 0.2.0-rc.1 + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1 + '@deepseek-ai/dsh-llm': 0.2.0-rc.1 + '@deepseek-ai/dsh-scope': 0.2.0-rc.1 + '@deepseek-ai/dsh-session': 0.2.0-rc.1 + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1 + + '@deepseek-ai/dsh-compaction-image-offload@0.2.0-rc.1': + resolution: {integrity: sha512-GM+Wk7dROfMllrm0gqbYpZY8MCef+Y+tK+vSLP426hd/hNRpSSOcPB72ZNfu05hZF+IUCkNSCF7x0gTAGtm7NQ==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-agent': 0.2.0-rc.1 + '@deepseek-ai/dsh-compaction': 0.2.0-rc.1 + '@deepseek-ai/dsh-llm': 0.2.0-rc.1 + '@deepseek-ai/dsh-session': 0.2.0-rc.1 + + '@deepseek-ai/dsh-compaction@0.2.0-rc.1': + resolution: {integrity: sha512-xtyT0MW45DIseej9fJ4HmkUlRK02IY0vC8AWPZ7ORQqaEHMV4lqX/mhTRFA937NOuOeLdLF/DKH5E4bpUeeshQ==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-brand': 0.2.0-rc.1 + '@deepseek-ai/dsh-commands': 0.2.0-rc.1 + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1 + '@deepseek-ai/dsh-llm': 0.2.0-rc.1 + '@deepseek-ai/dsh-session': 0.2.0-rc.1 + + '@deepseek-ai/dsh-config-editor@0.2.0-rc.1': + resolution: {integrity: sha512-BGzv0pUgPELrWO073NrL0JbnjE1cXoUvaZIbG6Q9V0kZp46mg1BITtBvbD+p/pIu+SdbKwGeP1YxRyfdHG6ZKg==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/cordis-plugin-include': ~1.0.9 + '@deepseek-ai/cordis-plugin-loader': ~1.0.5 + '@deepseek-ai/dsh-app-boot': 0.2.0-rc.1 + '@deepseek-ai/dsh-hmr': 0.2.0-rc.1 + peerDependenciesMeta: + '@deepseek-ai/dsh-hmr': + optional: true + + '@deepseek-ai/dsh-credentials@0.2.0-rc.1': + resolution: {integrity: sha512-XcAy6bK1lHLW3XWxxwKtrFdDurEvEvpBoqNhfR6PHTetd8wV/f9l06uNg0DO7xg1GUzkY8t88j2EXhg2z2nFrw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1 + + '@deepseek-ai/dsh-deque@0.2.0-rc.1': + resolution: {integrity: sha512-PlCukTxVBSavQGij2Hw7pKjbMblmT0Pbo+iU2Bw73pZeIXqsSuPrWR8z7kHr1bDb4jqd6JuKBk1Bd9fGgBxtoA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-file-reference@0.2.0-rc.1': + resolution: {integrity: sha512-QYMVTexTK8V3dS3cDpSzYj2USN44nG4MZcUUjNyr0D/58A5g6HeER1ZUiwEnNSenj9wMUrNUulbgQUL2PYBQxg==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-agent': 0.2.0-rc.1 + + '@deepseek-ai/dsh-fs@0.2.0-rc.1': + resolution: {integrity: sha512-IWjXn/BsoWwT5dti/Jfkrx49GDGi1H7B3cuTgwRvxIQl6o86eb7ns+3mQiBpFyrCrVOMV+1t8FC1ipiIxol+gA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-brand': 0.2.0-rc.1 + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1 + '@deepseek-ai/dsh-llm': 0.2.0-rc.1 + '@deepseek-ai/dsh-sandbox': 0.2.0-rc.1 + + '@deepseek-ai/dsh-home-paths@0.2.0-rc.1': + resolution: {integrity: sha512-QWHegbfNY4J7qZgBdiWshhhcF6fgybua6XKUaMIhxj4J+mqR9KEQOJ7hRjOOg8Yub3nGbBTyqpH10C44EGGroA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-host-directory-picker@0.2.0-rc.1': + resolution: {integrity: sha512-8OCjonS/poDfc49afEr2Jv60clYQjGfAqFWnKgE7RZ6AQH+THOEHfqC3LXF7n/YQD2xBesZ4U+uwS8Cjl1/CFw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-host-webserver@0.2.0-rc.1': + resolution: {integrity: sha512-/LkuSWupB7vijPty3Iypt9DZrBli9wsNh/E485m+xgo4uBbgloANQA+nyIpB0n+N20zleyV4EFYbe6Lb6k2oqQ==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-invariants@0.2.0-rc.1': + resolution: {integrity: sha512-sEeO6sRPGxgHChQsiU/V3LvelbVaLt7kb4WHVQqljZGgoAv3VZK0rzSlQaGfTCYJrThcoJ/a9mCT9pcZEZ3aDg==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-launch-environment@0.2.0-rc.1': + resolution: {integrity: sha512-ADTbIFhcVnFSYmycI4Ln4q9GGv5YS+MRg0ahCbn0+rDLcYyx4TT9B9Xyiz856YRRPpYRbYwQqZ+o14kCDpicQA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-llm@0.2.0-rc.1': + resolution: {integrity: sha512-F5ZlBG8z8o5PfEWeEF/PN9t/A1N/oEErvqmpqE4J8f9mJR85DvBdV+rjDs7OjAbMJsJ8INjkbroruG5NNKDg5A==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-native-command@0.2.0-rc.1': + resolution: {integrity: sha512-CgWN1pIq+ESrwl54Zuj9yYMQMqhoDch2hDW6/hZ+jzHOx7xyrJP/yCCoaOw6KSH3GRN+jUUIT2ZcciBVxs2nQw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-package-manifest@0.2.0-rc.1': + resolution: {integrity: sha512-topsRB2Pr2pfyQgqIkcEnS0mjDWZUDS+inb7/FREv0UaxkB0ezIiQuSJVJk5PQ3KMyuMSz2oNH/URlKOGw35Sw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-ptc-runtime@0.2.1-rc.5': + resolution: {integrity: sha512-NwGIE3niS/7U90OLEGCtELNovWnmVWgvCVvTTm0eCvqSAUUtLUMochGgrK1o051M6YoTfew1XS+VTCq+Y67ngg==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.5 + '@deepseek-ai/dsh-sandbox': 0.2.1-rc.5 + + '@deepseek-ai/dsh-sandbox-policy@0.2.1-rc.5': + resolution: {integrity: sha512-DUEe4ld/OMlpMWLshQc2HDgWQhd7i+3+l+/5cx2vtoy/M4cFdMp1l6Foi+VfGQMaBDr9ZBCGVjaOLW8StSoyYw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.5 + '@deepseek-ai/dsh-agent': 0.2.1-rc.5 + '@deepseek-ai/dsh-sandbox': 0.2.1-rc.5 + '@deepseek-ai/dsh-session': 0.2.1-rc.5 + '@deepseek-ai/dsh-session-projection': 0.2.1-rc.5 + '@deepseek-ai/dsh-system-prompt': 0.2.1-rc.5 + + '@deepseek-ai/dsh-sandbox@0.2.1-rc.5': + resolution: {integrity: sha512-QokCxazz+xB9jaSVog6flKQwaNZF9iPak86k9wgeB5m7cki5XFkcKyf3+36G/y3rjGVAMqbmxL86WoP4gLp6xw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.5 + '@deepseek-ai/dsh-llm': 0.2.1-rc.5 + '@deepseek-ai/dsh-session': 0.2.1-rc.5 + + '@deepseek-ai/dsh-scope@0.2.0-rc.1': + resolution: {integrity: sha512-D1JeWIz40A62/nJIi7HwLsddmuDwdcxV9Lbx5IgBveWDZHGqPIP0/CPJ4o6XWr+C1qI/GBtdMkN2Z3F20Rlt7w==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1 + + '@deepseek-ai/dsh-session-format-catalog@0.2.0-rc.1': + resolution: {integrity: sha512-Kacc7D3at1ifPlPbFD3t463/m+jg0RdERnuTWH1omv0hjT5ZkX/xM0TS37bhlyhLJdI+1TOqm9Jy3BpR15yR0Q==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-session': 0.2.0-rc.1 + + '@deepseek-ai/dsh-session-format-v0-to-v1@0.2.0-rc.1': + resolution: {integrity: sha512-bBf8YJKpolltz2vn03+mbT5IZ3mrAeN1GjgVQ5FwhU5ITWLV6jQqvtN7DWEWjTwKVVmUpl2XkmRcGBib+PH16Q==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-session-format-v1-to-v2@0.2.0-rc.1': + resolution: {integrity: sha512-YXqkqnTqMUKUgdSZT4GXCEwWvfSZv7TEIG+wfYxtJBWQlzfuCf7iHjNIWVNBslQdxl0VxbaFThbwZUtBa3f2Tg==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-session-format-v2-to-v3@0.2.0-rc.1': + resolution: {integrity: sha512-f7QapRRmMstuTYVVORYWgZn2gngw8Vu/ls5iBYfyb+15FbgwYr8bIOKNMGQ660dg4PHsxzWprsTbsxBAe9QDNw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-session-format-v3-to-v4@0.2.0-rc.1': + resolution: {integrity: sha512-vnplfHQOqTXpe7EMN/0h0VZyBS10+kzzjm5x/X01iu5lynbOQs2jRdi4Lrzp9fgnAUEJYaESZZLlWKY40arLCw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-session-format@0.2.0-rc.1': + resolution: {integrity: sha512-j2m+3FQeFPW9fgzRktL8E6J2UegpWPcc7nSFP+Ir7fdKYD5xDukcbdYDzzairbqQedntb0QMcp78rBQeJOmoYA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-session-persistence@0.2.0-rc.1': + resolution: {integrity: sha512-OAHmDpR3LasgEXzpmGyajlgcG5tOEzlUSclovllLtKaY402hcTn6Vm7W/EzRMwc+jvSfEQyXDY1g7wG3t3Ch+g==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-brand': 0.2.0-rc.1 + '@deepseek-ai/dsh-session': 0.2.0-rc.1 + '@deepseek-ai/dsh-timeout': 0.2.0-rc.1 + + '@deepseek-ai/dsh-session-projection@0.2.0-rc.1': + resolution: {integrity: sha512-6ymxQyycjXlxayjgVfxAsQv8POk3oKny/mrpxPcz30/Sv8FRsWnEnKaWf1pQvlBsGQcN6atOqXWsNyvHSyT/zw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-session': 0.2.0-rc.1 + + '@deepseek-ai/dsh-session-query@0.2.0-rc.1': + resolution: {integrity: sha512-kjYmW5/D/hANpczVOYUtbkYUen2s2ZyVaAwJfdlYKW5l/ls++XxdKM947BX76DxgHYg8RXjcSkkbK1TPNaAjiA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-brand': 0.2.0-rc.1 + '@deepseek-ai/dsh-llm': 0.2.0-rc.1 + '@deepseek-ai/dsh-session': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-persistence': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-projection': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-projection-cache': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-title': 0.2.0-rc.1 + '@deepseek-ai/dsh-tool-todo': 0.2.0-rc.1 + peerDependenciesMeta: + '@deepseek-ai/dsh-session-persistence': + optional: true + '@deepseek-ai/dsh-session-projection': + optional: true + '@deepseek-ai/dsh-session-projection-cache': + optional: true + + '@deepseek-ai/dsh-session-title@0.2.0-rc.1': + resolution: {integrity: sha512-IHvlestI2LFrknefZ3TrgdtEAghYV75eBVr1CL3gbJfj9ycu8qMpzTTrmMQn4TDldzuKf9mr+6iAp7MhOPKzvA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-agent': 0.2.0-rc.1 + '@deepseek-ai/dsh-brand': 0.2.0-rc.1 + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1 + '@deepseek-ai/dsh-llm': 0.2.0-rc.1 + '@deepseek-ai/dsh-session': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-projection': 0.2.0-rc.1 + + '@deepseek-ai/dsh-session@0.2.0-rc.1': + resolution: {integrity: sha512-KUDCUk8kmiJCwvV3gDbkUSpkyoGHdg36nIhKsEh6iBoYDuIQCuvX2htiVRXCm099XZO6rCBVInmm1193UoPYcA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-scope': 0.2.0-rc.1 + + '@deepseek-ai/dsh-settings@0.2.0-rc.1': + resolution: {integrity: sha512-kC7Cq6Ls6of8J9qY0/8oehLbf9AV62QVA9dL0YPOnvdvgaNJaRbLtXxwr+I36rjDVmOfUkqvW4nxBIjJmPSY/g==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-brand': 0.2.0-rc.1 + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1 + '@deepseek-ai/dsh-session': 0.2.0-rc.1 + '@deepseek-ai/schemastery': ~3.18.4 + + '@deepseek-ai/dsh-skill@0.2.0-rc.1': + resolution: {integrity: sha512-gCubwIMvMstpF1nWppJBAygQxrPDxN+XfX4RwQtvXcv3m5qGtcqPL0owx/tF7s+LUGipCf97LwMm5trn5sOOUg==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-llm': 0.2.0-rc.1 + '@deepseek-ai/dsh-scope': 0.2.0-rc.1 + + '@deepseek-ai/dsh-storage-domain@0.2.0-rc.1': + resolution: {integrity: sha512-LnoWOJs72A/KxwyOH+EfFji39JUX2u2dqyfeDWodqW/qFVu+bekubuz1HTURuBzuG281TFzTSyHFYt9vgL0wrw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1 + '@deepseek-ai/dsh-storage': 0.2.0-rc.1 + + '@deepseek-ai/dsh-storage@0.2.0-rc.1': + resolution: {integrity: sha512-cHHR5jdsqS+Coj9dm5xslDcn2AUL5N7H8M6udEBAGlxjTCB/0cO+S8i2I04LOuBUd/3MJ+1Xwsny7rC9SpBjHg==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-subagent@0.2.0-rc.1': + resolution: {integrity: sha512-apyy9ovQMHfS1/J1aztVJR1mwwKyksajI+P+LwaRie3ZCpzHksE1U9LPZHHdJFNA0VMoMUu8B+BuupKAjYuihA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-agent': 0.2.0-rc.1 + '@deepseek-ai/dsh-agent-preset-registry': 0.2.0-rc.1 + '@deepseek-ai/dsh-attachment': 0.2.0-rc.1 + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1 + '@deepseek-ai/dsh-jobs': 0.2.0-rc.1 + '@deepseek-ai/dsh-llm': 0.2.0-rc.1 + '@deepseek-ai/dsh-permission-presets': 0.2.0-rc.1 + '@deepseek-ai/dsh-sandbox': 0.2.0-rc.1 + '@deepseek-ai/dsh-sandbox-policy': 0.2.0-rc.1 + '@deepseek-ai/dsh-scope': 0.2.0-rc.1 + '@deepseek-ai/dsh-session': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-persistence': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-projection': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-query': 0.2.0-rc.1 + '@deepseek-ai/dsh-settings': '*' + '@deepseek-ai/dsh-system-prompt': 0.2.0-rc.1 + '@deepseek-ai/dsh-tools': 0.2.0-rc.1 + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1 + '@deepseek-ai/dsh-user-approval': 0.2.0-rc.1 + '@deepseek-ai/dsh-util-time': 0.2.0-rc.1 + '@deepseek-ai/dsh-workspace': 0.2.0-rc.1 + peerDependenciesMeta: + '@deepseek-ai/dsh-agent-preset-registry': + optional: true + '@deepseek-ai/dsh-jobs': + optional: true + '@deepseek-ai/dsh-permission-presets': + optional: true + '@deepseek-ai/dsh-sandbox': + optional: true + '@deepseek-ai/dsh-sandbox-policy': + optional: true + '@deepseek-ai/dsh-session-persistence': + optional: true + '@deepseek-ai/dsh-session-projection': + optional: true + '@deepseek-ai/dsh-session-query': + optional: true + '@deepseek-ai/dsh-settings': + optional: true + '@deepseek-ai/dsh-user-approval': + optional: true + '@deepseek-ai/dsh-workspace': + optional: true + + '@deepseek-ai/dsh-system-prompt@0.2.1-rc.5': + resolution: {integrity: sha512-HWW0k4Ug4XjRbCghLZYFMpLh8Ywcuh/bS7DAnjWfq4HbwwB+hV0XXJRF3iCf5600uYArfbuv4Ttz+4PHKu7k9w==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.5 + '@deepseek-ai/dsh-llm': 0.2.1-rc.5 + '@deepseek-ai/dsh-scope': 0.2.1-rc.5 + + '@deepseek-ai/dsh-timeout@0.2.0-rc.1': + resolution: {integrity: sha512-SQpvDLIPU0EJP1lbphfuEkLrvnX+CE9u9ym1+L5z/8dYe9BCPbhgjQoRvDnyzKZqFyoXVvZFdqdAADlc6DX7Ig==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-tool-todo@0.2.0-rc.1': + resolution: {integrity: sha512-NzgpZxc/sngDmznEVbMoZPCOx3l0N6UCDcyf9kBK0wQA+FQMgrMrmI0BaZUyjF0yMPXeQ47KXQVAoh8spramHg==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-agent': 0.2.0-rc.1 + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1 + '@deepseek-ai/dsh-session': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-projection': 0.2.0-rc.1 + '@deepseek-ai/dsh-tools': 0.2.0-rc.1 + + '@deepseek-ai/dsh-tools@0.2.1-rc.5': + resolution: {integrity: sha512-tOEMsbG1jH4EV80xcGucfeWsKHLjnETjRLtSnyFrVl2oma95tzTHBjti5MK60IvT2ijcCWhx8CrUKcqRksfDPA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.5 + '@deepseek-ai/dsh-agent': 0.2.1-rc.5 + '@deepseek-ai/dsh-llm': 0.2.1-rc.5 + '@deepseek-ai/dsh-ptc-runtime': 0.2.1-rc.5 + '@deepseek-ai/dsh-sandbox': 0.2.1-rc.5 + '@deepseek-ai/dsh-sandbox-policy': 0.2.1-rc.5 + '@deepseek-ai/dsh-scope': 0.2.1-rc.5 + '@deepseek-ai/dsh-session': 0.2.1-rc.5 + '@deepseek-ai/dsh-system-prompt': 0.2.1-rc.5 + '@deepseek-ai/dsh-user-approval': 0.2.1-rc.5 + '@deepseek-ai/dsh-working-directory': 0.2.1-rc.5 + + '@deepseek-ai/dsh-typert-protocol@0.2.0-rc.1': + resolution: {integrity: sha512-MhpeimGP6E3MqSESLm32OmPgx5aNUG7yCJCgcIFw7XBWhQmKB9fU3CWuUxxbWZeC7eWkdJ93AG2ww/Qu6QWW9A==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-typert-registry@0.2.0-rc.1': + resolution: {integrity: sha512-qJAMWRlCFeDVqy7lDnLA670VDQ705lu+Ojd3NDCzvTCRBx4gSxjPRs3FKU8CcrCDr+K0GA+qmw1WijhzsOKiNA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-user-approval@0.2.1-rc.5': + resolution: {integrity: sha512-3lwcH3SBnBLO07qLlPXYjuerMRDcXcJFPIdqwgliC6J5SAdrbi7Vx9rCYhz2aWcrpwmxhR3yXYiaNkvSnHHCJQ==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.5 + '@deepseek-ai/dsh-agent': 0.2.1-rc.5 + '@deepseek-ai/dsh-brand': 0.2.1-rc.5 + '@deepseek-ai/dsh-llm': 0.2.1-rc.5 + '@deepseek-ai/dsh-scope': 0.2.1-rc.5 + '@deepseek-ai/dsh-session': 0.2.1-rc.5 + '@deepseek-ai/dsh-system-prompt': 0.2.1-rc.5 + + '@deepseek-ai/dsh-util-crypto@0.2.0-rc.1': + resolution: {integrity: sha512-BLBQVRGBlzhNprSpREiMDi1JwX0X8jKdEPWiVRKBnttlG9d33j1pLsaiH9HHLY/D10lXX/NagGia/Zz9mW4FBA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-util-time@0.2.0-rc.1': + resolution: {integrity: sha512-SMJgashRtqOzZM8QvAgiN1tKRXExqIgRRiIkR6s4MStDHgjvUUrpzazPCarL3SAzXKDCi3I+H5QeglGG+j9qKA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-util-values@0.2.0-rc.1': + resolution: {integrity: sha512-Eh1HH0LFvztBwU2xotdfW5oCwLlWGjK2ygCC5+PnC3tkSDh9gvVQpEf0ezK+Kk6vpLz117V7VPehhR1+gs90+Q==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-util-values@0.2.1-rc.5': + resolution: {integrity: sha512-PL8TerJM/4jpZ2ArwgTpFbeDiAVnqkSh8Xinw2iEu8B6a+axmshzL4dCpwpf+uB8GHdXAhGz1cT+SBQwX/2TLQ==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.5 + + '@deepseek-ai/dsh-util-workspace-path@0.2.0-rc.1': + resolution: {integrity: sha512-8pNpCCgByrlYtxXqDLuIz/77rJg4p+bdQs/IotRppM7ahfIQtY/u3qkcbniCTQo4FUfoC3F2p6Lw/fHdLhcgqQ==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + + '@deepseek-ai/dsh-working-directory@0.2.1-rc.5': + resolution: {integrity: sha512-1iHEkg+VApcpiynxjjWPjdl4COGMG/VRvRtB8aESe3CWQW1HN0tjzEw0VSizsvn3XDaZ8VjiA+g1Svufobc0yw==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.5 + '@deepseek-ai/dsh-agent': 0.2.1-rc.5 + '@deepseek-ai/dsh-fs': 0.2.1-rc.5 + '@deepseek-ai/dsh-llm': 0.2.1-rc.5 + '@deepseek-ai/dsh-session': 0.2.1-rc.5 + '@deepseek-ai/dsh-session-projection': 0.2.1-rc.5 + '@deepseek-ai/dsh-system-prompt': 0.2.1-rc.5 + + '@deepseek-ai/dsh-workspace@0.2.0-rc.1': + resolution: {integrity: sha512-iEVfkxwNdNUUINTlQaalw6GXxU9lQUldBAhc1LY3l6nGk+XY53hQ9rT1bP+RN/jDi7ad6xd+i+jSbowGdLgLgA==} + peerDependencies: + '@deepseek-ai/cordis': ~4.0.4 + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1 + '@deepseek-ai/dsh-session': 0.2.0-rc.1 + '@deepseek-ai/dsh-session-persistence': 0.2.0-rc.1 + '@deepseek-ai/dsh-storage': 0.2.0-rc.1 + '@deepseek-ai/dsh-storage-domain': 0.2.0-rc.1 + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1 + + '@deepseek-ai/schemastery@3.18.5': + resolution: {integrity: sha512-Mnobvqf9rHsZYv4g5edj5ddxS1oF1kIdSlz0DunUgnY3LWG5F26MqvH3YOOsSaodCgyzJ16OMN9O99/s5Crtdw==} + + '@deepseek-ai/schemastery@3.19.0': + resolution: {integrity: sha512-bDXoYQa7ghAhmdYD5VPlzKxEzJV/aKkz5l4V5h1u06z8GAPN1ROewSjvR9WiXhpa52E9fng8lpH5QdCRIQgnyQ==} + + '@emnapi/core@2.0.0-beta.2': + resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==} + + '@emnapi/runtime@2.0.0-beta.2': + resolution: {integrity: sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==} + + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + + '@eslint-community/regexpp@4.12.3': + resolution: {integrity: sha512-R76UKbvsqI68DJJVTVyqFKqU98CN4+B+acxNfEA2IFarSzP0SjtKf/3+fFiXzTyv5Fj3PxLkGHe2wnVWWMxobQ==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + '@exodus/bytes@1.16.0': + resolution: {integrity: sha512-IcpW84uEn3N7ETtNZMlxKhfl6Pec8rUNGOTBtWbK1FKhJxIFAptZyVrvVRVBimAJxJCgc3PxepxkdWWG4DVzfA==} + engines: {node: ^20.19.0 || ^22.12.0 || >=24.0.0} + peerDependencies: + '@noble/hashes': ^1.8.0 || ^2.0.0 + peerDependenciesMeta: + '@noble/hashes': + optional: true + + '@jridgewell/sourcemap-codec@1.6.0': + resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} + + '@napi-rs/wasm-runtime@1.2.6': + resolution: {integrity: sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + peerDependencies: + '@emnapi/core': ^1.7.1 || 2.0.0-beta.2 + '@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2 + + '@oxc-project/types@0.156.0': + resolution: {integrity: sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==} + + '@quansync/fs@1.1.0': + resolution: {integrity: sha512-qAPG/t3HqML1TlN7sY/pTbEjzFVAKsMjNNMGheyDosro+kT4iw2KCUoHcVdmliwWjorm4elZbgNQyU2eD97eDg==} + + '@rolldown/binding-android-arm-eabi@1.2.19': + resolution: {integrity: sha512-e+Ebe0WT+9tbXmNKPIiC8YrWAHYwug3m6i4p3rZGGulfZri1jtI4HslT+OZnFf/OIHowWF71DTlHwXBP2SiA7A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@rolldown/binding-android-arm64@1.2.19': + resolution: {integrity: sha512-hOombrTJ+szt2ciEzS7oCA78lMPBgF5UMQWCJIyNfnrI7GLl8HYoFqCnpL2gcPOaXMqryGCU5ExdQKyDDcC+yA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.2.19': + resolution: {integrity: sha512-XoMA2pwCKGTQzUjPgtRwkedH4WmXhdIPKT6l6oOxd1PUbNodGI6DcBekgN7EC//+x3pfBYX/qL1gNmZAqivw5g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.2.19': + resolution: {integrity: sha512-zo8EsSSwMZCY/e+fRnGaX02YGgvJD0yvhNi/9hpGPA2MJ9ZF8dPCw75UGfpI6OpQ/myR/dIYmogRvqiZD0TrXg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.2.19': + resolution: {integrity: sha512-O8ISAOfI1nj7AuBPd30FSF47z7f7lzlk5poQVGgiikvQuGEBFYvW8ki+UEnT+YJPnNGjQzn304klt4O9FUE7mA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.2.19': + resolution: {integrity: sha512-/lYCba5NO0yq4S0jGMH8QTBtkvQxoXjoQWzF5BcWp9MjB9jxVRD1GQDNofkVjcOj30DWyhLIN/4Oe60JKzaONw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.2.19': + resolution: {integrity: sha512-pm/apFMBnSbFb3O6nG5pHO1iqHhZrjGDFEjSm+ot9J17XXPvH9L90y5h+jgfHCE+Qdlsvy8qKEcU4VKxgjD+vA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.2.19': + resolution: {integrity: sha512-K1SmQp3FFichn8oqrNIwvFoZ5wcvjC7goBzpaMNvLf9FZc+QB/QvLmnpJZgAAGHiD980tP8FZZnXk2K94rvlxg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.2.19': + resolution: {integrity: sha512-I0xwD57jP/3A7+5UPZin2w8Y7XHEmEM5zqpYZOcQ45MlNW6tUJUziymV3yRr7rL4vwyfEcRsRksC4a7Kc08p5Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.2.19': + resolution: {integrity: sha512-BrtEHT24SNXj9HiXqy+s/kXiSiQGt6EKCPUlRirAoIioVxKGnbXBUEkbZASAei7iZJB0/Ynm+0JP00Ipx7AnSw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.2.19': + resolution: {integrity: sha512-rm75/9DkHKeU2WnA8w4X94WGYgLlDCFCfkQC+4bguVJmC/jvDRv2B+2wLOYhyE0fVuv7//Ckk39OoOufyCu76Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.2.19': + resolution: {integrity: sha512-irh/4+iYFM4GAzpluDErgjz89bj6NDtqqMAG/6O1LG38Ed3NpyebzCpcVNkFW8uhy+/3/BocUvnXDR33CXWe9A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.2.19': + resolution: {integrity: sha512-+KWTWNoPt+CfSq94CiceWu3yPE+QzkaG+phPyz9G60tmZLwfQkcA4AeksafzvJAw4pvg1mcd5a1TkUqVv0s4JA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.2.19': + resolution: {integrity: sha512-7EH+skOsl5qpWnK0vzamgJFhOv1cwxQpsxm8tI883K9fur5c27p8q87fzEO6BbBPabA2/+s/zR63/pLc137iOg==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.2.19': + resolution: {integrity: sha512-3Q1Yg1Q7tEvBWoZf5rFvG/GKZQPgwfru+p4wBajDfJFBs0SHCpL++dfTjW9gyAKd1T7ZpIYvdaUax7Pa/IhFVQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.2.19': + resolution: {integrity: sha512-y/sqRRc6d7hECzOFc5n3LSeqctmIp9mMjY1Kq4s14uLPd/LZ4z7i1zrW6fMtp2mPeuQIC4e6ULMcwQzMomqQag==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.1.0': + resolution: {integrity: sha512-K+NU2HDCEem4sClgHH4ZZXwdJeNFkJo+hRk479DIwdIviAPN2hFJH1KHHwg8CxHQXvi0M5XY4deTXINfIiSG6w==} + + '@standard-schema/spec@1.1.0': + resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} + + '@tybys/wasm-util@0.10.4': + resolution: {integrity: sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==} + + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + + '@types/estree@1.0.10': + resolution: {integrity: sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==} + + '@types/js-yaml@4.0.9': + resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==} + + '@types/node@24.19.2': + resolution: {integrity: sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ==} + + '@types/prop-types@15.7.15': + resolution: {integrity: sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==} + + '@types/react-dom@18.3.7': + resolution: {integrity: sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==} + peerDependencies: + '@types/react': ^18.0.0 + + '@types/react@18.3.31': + resolution: {integrity: sha512-vfEqpXTvwT91yhmwdfouStN2hSKwTvyRs8qpLfADyrq/kxDw0hZM7Wk9Ug1FELj8hIby+S/+kQCSRFF32nv2Qw==} + + '@vitest/expect@4.1.8': + resolution: {integrity: sha512-h3nDO677RDLEGlBxyQ5CW8RlMThSKSRLUePLOx09gNIWRL40edgA1GCZSZgf1W55MFAG6/Sw14KeaAnqv0NKdQ==} + + '@vitest/mocker@4.1.8': + resolution: {integrity: sha512-LEiN/xe4OSIbKe9HQIp5OC24agGD9J5CnmMgsLohVVoOPWL9a2sBoR6VBx43jQZb7Kr1l4RCuyCJzcAa0+dojw==} + peerDependencies: + msw: ^2.4.9 + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/pretty-format@4.1.8': + resolution: {integrity: sha512-9GasEBxpZ1VYIpqHf/0+YGg121uSNwCKOJqIrTwWP/TB7DmFCiaBpNl3aPZzoLWfWkuqhbH8vJIVobZkvdo2cA==} + + '@vitest/runner@4.1.8': + resolution: {integrity: sha512-EmVxeBAfMJvycdjd6Hm+RbFBbA9fKvo0Kx37hNpBYoYeavH3RNsBXWDooR1mgD52dCrxIIuP7UotpfiwOikvcg==} + + '@vitest/snapshot@4.1.8': + resolution: {integrity: sha512-acfZboRmAIf05DEKcBQy33VXojFJjtUdLyo7oOmV9kebb2xdU01UknNiPuPZoJZQyO7DF0gZdTGTpeAzET9QPQ==} + + '@vitest/spy@4.1.8': + resolution: {integrity: sha512-6EevtBp6OZOPF7bmz36HrGMeP3txgVSrgebWxHOafDXGkhIzfXK14f8KF6MuFfgXXUeHxmpD3BQxkV00/3s5mA==} + + '@vitest/utils@4.1.8': + resolution: {integrity: sha512-uOJamYALNhfJ6iolExyQM40yIQwDqYnkKtQ5VCiSe17E33H0aQ/u+1GlRuz4LZBk6Mm3sg90G9hEbmEt37C1Zg==} + + '@yuku-codegen/binding-android-arm64@0.8.7': + resolution: {integrity: sha512-C/0zV5IhgVdYhGJTwrY0v8dknxlhiKwtVJkMUaexu9/QvRmzlV4vfU3hZlUSgqc2BxQHntL1mCVbDq8j0FRFDw==} + cpu: [arm64] + os: [android] + deprecated: yuku-codegen is pure JavaScript since 0.14 + + '@yuku-codegen/binding-darwin-arm64@0.8.7': + resolution: {integrity: sha512-/u+REDMI4a0/lsJXTM4c53/w31OGZLOReZIyg62uhgLs0kc8NHsj/nOcxTdlQjq5gi0zhdkccD9LaLTXcdzPvw==} + cpu: [arm64] + os: [darwin] + deprecated: yuku-codegen is pure JavaScript since 0.14 + + '@yuku-codegen/binding-darwin-x64@0.8.7': + resolution: {integrity: sha512-sMMzFOwCo4WXR+/6zIBThOocSC50iIIZZdfiIDbaLvj0Ax/rWt/iavyfEAqajyvzydLyCqR/ZItdLWSRlu1umw==} + cpu: [x64] + os: [darwin] + deprecated: yuku-codegen is pure JavaScript since 0.14 + + '@yuku-codegen/binding-freebsd-x64@0.8.7': + resolution: {integrity: sha512-MpdpKXix9P+Y1rKgjvcNeNtGjXeL1CmttNhYINrWls8kRpm4xM/oBGTmn6w7to8lAlwj5jm8q03dQPl5mRv4Qw==} + cpu: [x64] + os: [freebsd] + deprecated: yuku-codegen is pure JavaScript since 0.14 + + '@yuku-codegen/binding-linux-arm-gnu@0.8.7': + resolution: {integrity: sha512-rr1srFLlPAmC1vtxfc9C1YLDe3iH09YjfSeeIidBqKhzx1MATjOAq4mjlRUOnhr/L27MotWIYOFKwVsd5JZFOg==} + cpu: [arm] + os: [linux] + libc: [glibc] + deprecated: yuku-codegen is pure JavaScript since 0.14 + + '@yuku-codegen/binding-linux-arm-musl@0.8.7': + resolution: {integrity: sha512-eAufXh8qBRpiSO6ueaMDL+yyoXIGLhpUce72YbcACtZU2qhExwBIJyEtQf5kH2Ki0X2aqkSjSfog4OPtKXan3Q==} + cpu: [arm] + os: [linux] + libc: [musl] + deprecated: yuku-codegen is pure JavaScript since 0.14 + + '@yuku-codegen/binding-linux-arm64-gnu@0.8.7': + resolution: {integrity: sha512-gw4w6wPoHObBrdIC4duVWLmJOvpdE25j5D7yrM5mACNlK4klRz/lv8hK+ssQk9EJHBgZjSaqZIJVFgqNYbfv7A==} + cpu: [arm64] + os: [linux] + libc: [glibc] + deprecated: yuku-codegen is pure JavaScript since 0.14 + + '@yuku-codegen/binding-linux-arm64-musl@0.8.7': + resolution: {integrity: sha512-L68N6Y4XkqcIaKo3Ra88JEvBEH4AHff44A4INcrxeVWZ8CZtu2tCpfVxe3hR8qQQMcvBSQlDn24KpkCKEhVvfA==} + cpu: [arm64] + os: [linux] + libc: [musl] + deprecated: yuku-codegen is pure JavaScript since 0.14 + + '@yuku-codegen/binding-linux-x64-gnu@0.8.7': + resolution: {integrity: sha512-dzyAbltJmf3Cqlb8HcFuYIf5Yn0fl1vTr3XJ9HiVNNvOlhqPSArOqtw9vI1p6/VTXTjrMLXlU+s+/kNHiIy/Cw==} + cpu: [x64] + os: [linux] + libc: [glibc] + deprecated: yuku-codegen is pure JavaScript since 0.14 + + '@yuku-codegen/binding-linux-x64-musl@0.8.7': + resolution: {integrity: sha512-Otw4MH3404q0Bbvl+YTdW9aoUV5vXmUw8260bWvt1XlaoIX/ceSgI4ygheRDMfBPoHt6FDayQaO9OLVUZAgkFA==} + cpu: [x64] + os: [linux] + libc: [musl] + deprecated: yuku-codegen is pure JavaScript since 0.14 + + '@yuku-codegen/binding-win32-arm64@0.8.7': + resolution: {integrity: sha512-qo/jyrzryiBuKEsFiuWaBCBe3tRMynQ0qFWFgOEjcCMQeZfBm+wKiVEUEFXXLc7bh8YezguAWp0Mtnhq4ARNyA==} + cpu: [arm64] + os: [win32] + deprecated: yuku-codegen is pure JavaScript since 0.14 + + '@yuku-codegen/binding-win32-x64@0.8.7': + resolution: {integrity: sha512-D5lDsVDx6m00E6bWySlWdH72Ca4TPSaphDqB6QjU6MpuNLIJqoGoatYyq2rOmBE8Zv/kunot/o58KGL03P3eiA==} + cpu: [x64] + os: [win32] + deprecated: yuku-codegen is pure JavaScript since 0.14 + + '@yuku-parser/binding-android-arm64@0.8.7': + resolution: {integrity: sha512-eGKYiUDX7Y0V7tDTmg+JTVnXnjMqfXXsorZ+EDf5kxwchQ3Or1HS14MzI2fw+jFhHR85fCWt+mtX33Yao73hIQ==} + cpu: [arm64] + os: [android] + deprecated: yuku-parser runs on yuku-core since 0.14 + + '@yuku-parser/binding-darwin-arm64@0.8.7': + resolution: {integrity: sha512-Re0RHelKLnjEURulY2/KxW+Ngb8zuNA4BRZuMwgGQNzVumT6u4U2N2hc01oeYVNVof0i7GrXE4UCNBgbpRRnjQ==} + cpu: [arm64] + os: [darwin] + deprecated: yuku-parser runs on yuku-core since 0.14 + + '@yuku-parser/binding-darwin-x64@0.8.7': + resolution: {integrity: sha512-Hn8DROtQkjlA1ACbPgj4a7eP9IuVOI504oiTwpkWPbpaDWD9KdmnVYCqW+1LfenNK/g7O9NhWGpXEdaCNX7lIA==} + cpu: [x64] + os: [darwin] + deprecated: yuku-parser runs on yuku-core since 0.14 + + '@yuku-parser/binding-freebsd-x64@0.8.7': + resolution: {integrity: sha512-bAP2OV8wRuzplX/jYxv9+vvqQT8JxyNphI8fLfXGL054Xs+4/J5u33cIm3y4rxY8rdoLmmdiJs2Tq7r7lrDRfA==} + cpu: [x64] + os: [freebsd] + deprecated: yuku-parser runs on yuku-core since 0.14 + + '@yuku-parser/binding-linux-arm-gnu@0.8.7': + resolution: {integrity: sha512-kTYwJQQgmZeAWdDIWabiReIZMpmfLueIj1tCmjStUtFGhR1Z0qwxonKVfUC4N7h/VhGGzLZ//7O1kgt1QKqgCg==} + cpu: [arm] + os: [linux] + libc: [glibc] + deprecated: yuku-parser runs on yuku-core since 0.14 + + '@yuku-parser/binding-linux-arm-musl@0.8.7': + resolution: {integrity: sha512-uL4jE8HPT2BLlxAXyD10LqgPuXa9eDa0BKpCdSANmzIJghq/2eZo3/gQNtaxPZMupWoxjYzSad9IXrwu7aYPXQ==} + cpu: [arm] + os: [linux] + libc: [musl] + deprecated: yuku-parser runs on yuku-core since 0.14 + + '@yuku-parser/binding-linux-arm64-gnu@0.8.7': + resolution: {integrity: sha512-3gVN4pWSKZmXiNX7cU164dR9MPvesCHnlH6nPfpK+yQsCuYphjKKplcb4SnZBrhiqmXbgb2HR0c2TS0IZUPhgA==} + cpu: [arm64] + os: [linux] + libc: [glibc] + deprecated: yuku-parser runs on yuku-core since 0.14 + + '@yuku-parser/binding-linux-arm64-musl@0.8.7': + resolution: {integrity: sha512-S0mwfEjoLpxzXeZw802Wa4RaELsQiPtWqG6INcy8j4GtvNFtl4LCX3eGO1XLn9pyLAISLzTRyU3zUCBUPin8lg==} + cpu: [arm64] + os: [linux] + libc: [musl] + deprecated: yuku-parser runs on yuku-core since 0.14 + + '@yuku-parser/binding-linux-x64-gnu@0.8.7': + resolution: {integrity: sha512-lnbWdPmerE5D1uH1G4IEZKnPzCrWCStRGrtgpSIe1RibAo5bZIjDbbbPYXmMHCEh4F+x/JaJpElh26a3r+BPbg==} + cpu: [x64] + os: [linux] + libc: [glibc] + deprecated: yuku-parser runs on yuku-core since 0.14 + + '@yuku-parser/binding-linux-x64-musl@0.8.7': + resolution: {integrity: sha512-769uwndMvMzUvATWbAcEvyLHKA+DzhHSCl/obBUrRdYfRo26yxui6S8y3z7uJ+Naup7UKrDxrpK7OnQkxkl9KQ==} + cpu: [x64] + os: [linux] + libc: [musl] + deprecated: yuku-parser runs on yuku-core since 0.14 + + '@yuku-parser/binding-win32-arm64@0.8.7': + resolution: {integrity: sha512-mEB/9PlaAkisJ6KWGz0zvywXoU6+80dTlR2LwS7s/jcXXoU6fm2+sitBZXtqu3+Q4DcDgPxM45uWMCzPs0TSRw==} + cpu: [arm64] + os: [win32] + deprecated: yuku-parser runs on yuku-core since 0.14 + + '@yuku-parser/binding-win32-x64@0.8.7': + resolution: {integrity: sha512-8vNB2DP0ou61nGb8tc/qfi41gfyDXz1MHr2zqL3nR+cJ6CEbiuWV/l/a/vv151gCgiZLLAyGkQGENpozdg716w==} + cpu: [x64] + os: [win32] + deprecated: yuku-parser runs on yuku-core since 0.14 + + '@yuku-toolchain/types@0.8.7': + resolution: {integrity: sha512-2Z53dNxAJL6UvFoIrDZvYf3zlO8s4VJK4O2hhaB4mXVwwpX/7ajtss3cmfqKvamlNLWyt9FSWs4eoYdlbxpnHA==} + + ajv@8.20.0: + resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} + + ansis@4.5.0: + resolution: {integrity: sha512-KwIVkfFfJSSzBmZhDGuTmkhWqTdyB5oNVzzznBJbBZ5bZtHiqSrcugRF0RKJKT4Ss3d7ZrcjnlFVDlQNmtWfWw==} + engines: {node: '>=14'} + + argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + + bidi-js@1.1.0: + resolution: {integrity: sha512-fX1Onk0tdVPC7obPWB5EbJ1z7NVhLq4m2xZLq2YXBkxzMXIGRpNMU88n0EPgWseKl12J7zXs7qrDxPK4sRs2fg==} + + bytes@3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + + cac@7.1.0: + resolution: {integrity: sha512-LMDU/U2yA4IPIY8KT0NsNPWEYZvAMkbgyspxJ6btJaYV+WMDOHAZCmB0lsTObiHaRS1V/ztKAl7+TSkTqXyeoA==} + engines: {node: '>=20.19.0'} + + chai@6.3.0: + resolution: {integrity: sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==} + engines: {node: '>=18'} + + compressible@2.0.18: + resolution: {integrity: sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==} + engines: {node: '>= 0.6'} + + compression@1.8.2: + resolution: {integrity: sha512-o8vI5RE5A6EVVOd9o41jKp41aJom+QTEO/Bx8MYNjexMo/Bv2WOjUfZr+aL0WnYSgymUy6zeguqLTsIhV0gMvQ==} + engines: {node: '>= 0.8.0'} + + content-type@2.1.0: + resolution: {integrity: sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==} + engines: {node: '>=18'} + + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + + css-tree@3.2.1: + resolution: {integrity: sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==} + engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} + + csstype@3.2.3: + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + + data-urls@8.0.0: + resolution: {integrity: sha512-JQUCCK+/CAGbGGx618PlFZMXH81Jtj7t73CHv9dd/zVWvxgGT2zLFRjnKb+Ng46GIwcy+f7f88qd4duqllK+WQ==} + engines: {node: ^22.14.0 || >=24.0.0} + + debug@2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + decimal.js@10.6.0: + resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + destroy@1.2.0: + resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + dts-resolver@3.0.0: + resolution: {integrity: sha512-1T1f+z+4tl9XD+m+0HBgWoL/nm0bOIffyWaUuUSBlFg/86IWvfx+wjNaO/ybU0AJzG9/Mi5hBUgGV6zCmWEN7Q==} + engines: {node: ^22.18.0 || >=24.0.0} + peerDependencies: + oxc-resolver: '>=11.0.0' + peerDependenciesMeta: + oxc-resolver: + optional: true + + empathic@2.1.0: + resolution: {integrity: sha512-AnfC1ATldl49/cvZdLPDjBfrRNwbDO05aibiOtzQu3qtlbJtomNLhF30HEtn/7iBz50dlMECqATo3fG0LrdEgw==} + engines: {node: '>=14'} + + entities@9.0.0: + resolution: {integrity: sha512-oJFNDJg3kTPwAD1cNn2+WmUq4wFoo09npc3Ydf1D7ED4smRiWrsKnaLxykrTWgyGEcusc87P5dxlAleol9kpkg==} + engines: {node: '>=20.19.0'} + + es-module-lexer@2.3.2: + resolution: {integrity: sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==} + + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + + expect-type@1.4.0: + resolution: {integrity: sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==} + engines: {node: '>=12.0.0'} + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fast-uri@3.1.9: + resolution: {integrity: sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==} + + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + get-tsconfig@5.0.0-beta.5: + resolution: {integrity: sha512-/6gFNr0N04nob252sTQxyFLi3eKFRqIg1I87YcqAMT1i6SQrSF6KujUEQrtrjMV0H/eejTCltLdDSTEMzHbnsQ==} + engines: {node: '>=20.20.0'} + + hookable@6.1.2: + resolution: {integrity: sha512-+abwxtiEA52GCVIsQqut3S/uKTbUwYIp4Pe/vv+6py5XiXBCqMZHg6pA6Y5qhgLSEys0/cYuPbO0z1QFj5ZCmg==} + + html-encoding-sniffer@7.0.0: + resolution: {integrity: sha512-UikN5yr7xsCDAq87Or5or0PAlD3HJJOKVzM05az588WnpDJ4Ux7a2A53Qi6gofGg2/EtvF/H4hCi/TXfCW4Y6w==} + engines: {node: ^22.13.0 || >=24.0.0} + + immer@11.2.10: + resolution: {integrity: sha512-pzANBj+0A9u+prdhBJ14DVi44vCvVUQzBa8DKt6I0AMCokPHtt722BK9IX5bFC70xUSU9TnzLRIJLTGqIzjEFw==} + + import-without-cache@0.4.1: + resolution: {integrity: sha512-vXoV9PjKHEednCUu01e98TkImxy67e3BJXbTIOmIq4Hyzw3IAwYRcuPkfeTzJzwyyts4kjuA73x+pWJLc4f86A==} + engines: {node: ^22.18.0 || >=24.0.0} + + is-potential-custom-element-name@1.0.1: + resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} + + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + js-yaml@4.3.2: + resolution: {integrity: sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==} + hasBin: true + + jsdom@30.1.3: + resolution: {integrity: sha512-hQMUPvRgN7KxsfIytDQji7bimuJeRQa6Qo5+iuiZQk5CafeRxLIA10/cG5YCBFNpD9RO3oqIiN4CO1Y44kxqXg==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + peerDependencies: + canvas: ^3.2.3 + peerDependenciesMeta: + canvas: + optional: true + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + lightningcss-android-arm64@1.33.0: + resolution: {integrity: sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + + lightningcss-darwin-arm64@1.33.0: + resolution: {integrity: sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.33.0: + resolution: {integrity: sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.33.0: + resolution: {integrity: sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.33.0: + resolution: {integrity: sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.33.0: + resolution: {integrity: sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + lightningcss-linux-arm64-musl@1.33.0: + resolution: {integrity: sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + libc: [musl] + + lightningcss-linux-x64-gnu@1.33.0: + resolution: {integrity: sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [glibc] + + lightningcss-linux-x64-musl@1.33.0: + resolution: {integrity: sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + libc: [musl] + + lightningcss-win32-arm64-msvc@1.33.0: + resolution: {integrity: sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.33.0: + resolution: {integrity: sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.33.0: + resolution: {integrity: sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==} + engines: {node: '>= 12.0.0'} + + loose-envify@1.4.0: + resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} + hasBin: true + + lru-cache@11.5.3: + resolution: {integrity: sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==} + engines: {node: 20 || >=22} + + magic-string@0.30.21: + resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + + mdn-data@2.27.1: + resolution: {integrity: sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==} + + mime-db@1.54.0: + resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==} + engines: {node: '>= 0.6'} + + mime-types@3.0.2: + resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==} + engines: {node: '>=18'} + + ms@2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + + nanoid@3.3.20: + resolution: {integrity: sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + negotiator@0.6.4: + resolution: {integrity: sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==} + engines: {node: '>= 0.6'} + + negotiator@1.1.0: + resolution: {integrity: sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==} + engines: {node: '>=18'} + + node-addon-native-custom-loader@0.1.9: + resolution: {integrity: sha512-Zh87aubSc1UF8CzZsRws1KtSwXiPDH0tbcg8V/2OA8Tcq9yGJRESFcEOC5NGLFama5IGfC3aJhubZbrj9Un2qA==} + engines: {node: '>=20'} + + node-addon-require-builtin-darwin-arm64@0.1.9: + resolution: {integrity: sha512-n45xEILQVOLZ2hVhzRXesTMYS4odHquyI/B/IkPMPUCONa8PjNfBag6lYBH4wDrhgpLNNBwMsUD8d8O/13QPPA==} + engines: {node: '>=20'} + cpu: [arm64] + os: [darwin] + + node-addon-require-builtin-darwin-x64@0.1.9: + resolution: {integrity: sha512-Sm4Liqh1uo9zgJB2F/pACPPZdHu+fj9Qniyr1Q99dDQB0v71VgZgkAgv3K0/E1iPQBlZq9rakFkY7MGUIfWc0A==} + engines: {node: '>=20'} + cpu: [x64] + os: [darwin] + + node-addon-require-builtin-linux-arm64-gnu@0.1.9: + resolution: {integrity: sha512-ToU4wGtOD/069i2y4fJ3cjDJiiWtcjSQTZMf0YKlotb5BmTM7FjhR3X1aub8J/YjlOwl6665J/XAYuvCaDO5sA==} + engines: {node: '>=20'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + node-addon-require-builtin-linux-arm64-musl@0.1.9: + resolution: {integrity: sha512-85Z5Avp++wfa9iiTIH8LC/r6qvlC/CiwpifiwIz0gYQ9PzajTSkz06gX7YDqf1oUqWYxU9uwNEOmo7mktHOOfA==} + engines: {node: '>=20'} + cpu: [arm64] + os: [linux] + libc: [musl] + + node-addon-require-builtin-linux-x64-gnu@0.1.9: + resolution: {integrity: sha512-fh3K3/JvBfSYwU8vEOpp4Wdp4N/jX0EnZYq5GsaftlQin1FVqgve/yDNoh+asxBMOQyHOG8F4dXlV1WCierrfg==} + engines: {node: '>=20'} + cpu: [x64] + os: [linux] + libc: [glibc] + + node-addon-require-builtin-linux-x64-musl@0.1.9: + resolution: {integrity: sha512-B6fu/5xmbRxnifM7nWz0IESkYnUl8dwFZmRDMsxdhzv2nb+EtBRFAXg4lf73qhX3yoZD4SnWJILBQMlIAwBCzw==} + engines: {node: '>=20'} + cpu: [x64] + os: [linux] + libc: [musl] + + node-addon-require-builtin-win32-arm64-msvc@0.1.9: + resolution: {integrity: sha512-FOQuzNe8B1BANu886rJgdbQuRxPGUQmewkykw87wSr32U0ibQ3AWGuUM/Gh7LG4RekjFaifj7gEI/tq2+6GU6g==} + engines: {node: '>=20'} + cpu: [arm64] + os: [win32] + + node-addon-require-builtin-win32-ia32-msvc@0.1.9: + resolution: {integrity: sha512-N29P0kmIBT6hnkNNFYzxn+o9ydT6OYZe9RFAi8dSxV1rNSul1FlxtuKWYe8w2sQpbQGYuGDEtpOwdeFtq2iFTg==} + engines: {node: '>=20 <23'} + cpu: [ia32] + os: [win32] + + node-addon-require-builtin-win32-x64-msvc@0.1.9: + resolution: {integrity: sha512-+i6N4A7m7txjbw8pDYESdWXiKO9EEVq0SzTzwPS0WZuV4F1MzQnaDJwJJnO7T6zAc0BvqHXBOkpharCrUjFhbQ==} + engines: {node: '>=20'} + cpu: [x64] + os: [win32] + + node-addon-require-builtin@0.1.9: + resolution: {integrity: sha512-BCxXCMZDs/VLLh64SwKNw/me7Qx1I7Be4qxWwYVRRm8tJoOB8fL7qg6CmXhSXeUqsKt72t8RaKCX4EN+5nocVg==} + engines: {node: '>=20'} + + obug@2.2.1: + resolution: {integrity: sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==} + engines: {node: '>=12.20.0'} + + on-headers@1.1.0: + resolution: {integrity: sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==} + engines: {node: '>= 0.8'} + + parse5@8.1.1: + resolution: {integrity: sha512-EcR/6WDcU7b2N3vQSxKALCk9lXGtUMQxXio008OEMBE0kavu/7JLfBEeFPzi43nMqVDSbEn3QCK+BMCc9zO//w==} + + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + + postcss@8.5.32: + resolution: {integrity: sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==} + engines: {node: ^10 || ^12 || >=14} + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + quansync@1.0.0: + resolution: {integrity: sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA==} + + react-dom@18.3.1: + resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} + peerDependencies: + react: ^18.3.1 + + react@18.3.1: + resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} + engines: {node: '>=0.10.0'} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + + resolve.exports@2.0.4: + resolution: {integrity: sha512-zepuGL0ulf+nt+XaFrlKeaiTJeyPFPLLY62+ncq1/VTHBdt3HsfXOH60priZ6tnXQozdGcDeIF5JVTanvIcYWQ==} + engines: {node: '>=10'} + + rolldown-plugin-dts@0.27.14: + resolution: {integrity: sha512-ZvuDDwoIpRK9RPxDXratCpklFO9QZZWndf/sd0VBFb4LEj0jj07UcHK9OCh7V4XiFz2Z89ziyBC2K6tJiDjrbw==} + engines: {node: ^22.18.0 || >=24.11.0} + peerDependencies: + '@typescript/native-preview': '*' + '@volar/typescript': ~2.4.0 + rolldown: ^1.0.0 + typescript: ^5.0.0 || ^6.0.0 || ~7.0.0 + vue-tsc: ~3.2.0 || ~3.3.0 + peerDependenciesMeta: + '@typescript/native-preview': + optional: true + '@volar/typescript': + optional: true + typescript: + optional: true + vue-tsc: + optional: true + + rolldown@1.2.19: + resolution: {integrity: sha512-QIiV1J9d0pzN4jeeTH4sjPy0AZ6cAy2cG0ExeoE1+U8Rvj+hR3gYkokx0YbeUNGlZqiQJJ2utcETe0oKXwzsuA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + + saxes@6.0.0: + resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} + engines: {node: '>=v12.22.7'} + + scheduler@0.23.2: + resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} + + semver@7.8.6: + resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==} + engines: {node: '>=10'} + hasBin: true + + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + + source-map-js@1.2.2: + resolution: {integrity: sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==} + engines: {node: '>=0.10.0'} + + stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + + std-env@4.3.0: + resolution: {integrity: sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==} + + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + + tinyexec@1.3.1: + resolution: {integrity: sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==} + engines: {node: '>=18'} + + tinyglobby@0.2.17: + resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} + engines: {node: '>=12.0.0'} + + tinyrainbow@3.2.0: + resolution: {integrity: sha512-LgO3D9yZJjApUiuUfl9iFAwrtaX4+lok3wJIqttGoKCHlWUqHqbQpnxCf82L8FjgKsh4iGo78hqJwgL8F6To2A==} + engines: {node: '>=14.0.0'} + + tldts-core@7.4.21: + resolution: {integrity: sha512-sj8bAOjYu9juPKgsB3A58Uj91ybcnsRzgEUxbEGACP32rfJ5o9EScerRIfX1c6GPCiQlMoy4rCu2qTVIQgL4UA==} + + tldts@7.4.21: + resolution: {integrity: sha512-SomReMX1GpjzK4KzAMr8SKtn628eakKLlPWEEPOLnC2lfKXt5UZ5gh/y2I8cgRI2zWidULCx2p7vfYyjGSwnaw==} + hasBin: true + + tough-cookie@6.1.0: + resolution: {integrity: sha512-FTxc8u8Kl2tz0Lat1u8ksvcy8bwHRyEMawwTWybo51JqaC6O7SvfuhAKg+Ld6VqyIe2QRJBzY9HA7y2WyFRT2w==} + engines: {node: '>=16'} + + tr46@7.0.0: + resolution: {integrity: sha512-BcDSDW+SIGWVOns1Zm6Yg91q9AEj7eaID0QDY9oIqJD1A8dscNwMcl9Sms2DeuWCNov1X0/oXanHGYQBSLwZsg==} + engines: {node: ^22.14.0 || >=24.0.0} + + tree-kill@1.2.2: + resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} + hasBin: true + + tsdown@0.22.14: + resolution: {integrity: sha512-ule7Y+fsAN2iZbLDoo7C4KYljFJNJJ+fLshyn+9gozeTspVersWHxwdGB+Dm2hzA38s6muFnUTl0jK3vJm9ifQ==} + engines: {node: ^22.18.0 || >=24.11.0} + hasBin: true + peerDependencies: + '@arethetypeswrong/core': ^0.18.1 + '@tsdown/css': 0.22.14 + '@tsdown/exe': 0.22.14 + '@vitejs/devtools': '*' + publint: ^0.3.8 + tsx: '*' + typescript: ^5.0.0 || ^6.0.0 || ^7.0.0 + unplugin-unused: ^0.5.0 + unrun: '*' + peerDependenciesMeta: + '@arethetypeswrong/core': + optional: true + '@tsdown/css': + optional: true + '@tsdown/exe': + optional: true + '@vitejs/devtools': + optional: true + publint: + optional: true + tsx: + optional: true + typescript: + optional: true + unplugin-unused: + optional: true + unrun: + optional: true + + tslib@2.9.1: + resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} + + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + + unconfig-core@7.5.0: + resolution: {integrity: sha512-Su3FauozOGP44ZmKdHy2oE6LPjk51M/TRRjHv2HNCWiDvfvCoxC2lno6jevMA91MYAdCdwP05QnWdWpSbncX/w==} + + undici-types@7.24.6: + resolution: {integrity: sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==} + + undici@8.12.4: + resolution: {integrity: sha512-8Mx+uNKKER2bA4AdtedkqRbwUCIJFr2nJckXRe5yrDqzePqwLP7VNcctN8/XdmDSbF7mS+jJKIszlL+vbam1VA==} + engines: {node: '>=22.19.0'} + + vary@1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + + verkit@0.3.2: + resolution: {integrity: sha512-zj/ob3UsvJGN0whEAKFp53REA5X66hvffVqoCtVQAakJKnKlH+/PcOfMoFwIG/o4rElqLv/ycAFlx8ZlXUorCg==} + engines: {node: '>=18.12.0'} + + vite@8.3.8: + resolution: {integrity: sha512-LzOn3h9rG/0vhLdXrV4yJ4QFA9eEoqCl+Yx+kGJd7aB9w6nfNgVHKSYwLPZUHrz4ZGa+t+kXjV9itvcHDLQouA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + '@vitejs/devtools': ^0.7.1 || ^0.8.0 + esbuild: ^0.27.0 || ^0.28.0 + jiti: '>=1.21.0' + less: ^4.0.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + '@vitejs/devtools': + optional: true + esbuild: + optional: true + jiti: + optional: true + less: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vitest@4.1.8: + resolution: {integrity: sha512-flY6ScbCIt9HThs+C5HS7jvGOB560DJtk/Z15IQROTA6zEy49Nh8T/dofWTQL+n3vswqn87sbJNiuqw1SDp5Ig==} + engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@opentelemetry/api': ^1.9.0 + '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 + '@vitest/browser-playwright': 4.1.8 + '@vitest/browser-preview': 4.1.8 + '@vitest/browser-webdriverio': 4.1.8 + '@vitest/coverage-istanbul': 4.1.8 + '@vitest/coverage-v8': 4.1.8 + '@vitest/ui': 4.1.8 + happy-dom: '*' + jsdom: '*' + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@opentelemetry/api': + optional: true + '@types/node': + optional: true + '@vitest/browser-playwright': + optional: true + '@vitest/browser-preview': + optional: true + '@vitest/browser-webdriverio': + optional: true + '@vitest/coverage-istanbul': + optional: true + '@vitest/coverage-v8': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + + w3c-xmlserializer@6.0.0: + resolution: {integrity: sha512-4Nsy8K5Tr6SPDH9jhKJOHf7ChDrc1zufZTVSF7x72hwuEXBqxqk9G6cK+K2NRUtB3iELRJqjXb4JPDMBjMTl2Q==} + engines: {node: ^22.22.2 || ^24.15.0 || >=26.0.0} + + webidl-conversions@8.0.1: + resolution: {integrity: sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==} + engines: {node: '>=20'} + + whatwg-mimetype@5.0.0: + resolution: {integrity: sha512-sXcNcHOC51uPGF0P/D4NVtrkjSU2fNsm9iog4ZvZJsL3rjoDAzXZhkm2MWt1y+PUdggKAYVoMAIYcs78wJ51Cw==} + engines: {node: '>=20'} + + whatwg-url@17.3.0: + resolution: {integrity: sha512-KwOAJrpf+GTgBvcBQJcP38sMF0DsQKdwtG+TxM2pW44P6E5k0hDbWrDmyuJDIF0Uef0aQq0ZoJs+5oI+k8ddhg==} + engines: {node: ^22.14.0 || >=24.0.0} + + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} + engines: {node: '>=8'} + hasBin: true + + ws@8.22.2: + resolution: {integrity: sha512-/rEZ2ejown2N5gxVTHUu9bVVC7ttu0/Tgzf5hbTOixR3Fs7mbbXgn2DbdbcKgJOmpQMtrIUWivtYuVMnp/W/yA==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + xml-name-validator@5.0.0: + resolution: {integrity: sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==} + engines: {node: '>=18'} + + xmlchars@2.2.0: + resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} + + yaml@2.9.1: + resolution: {integrity: sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==} + engines: {node: '>= 14.6'} + hasBin: true + + yuku-ast@0.8.7: + resolution: {integrity: sha512-h6+4bDfyootiMB9vckk5uKo5r5j0GHrkr17FQTDNfEsFT3DWlN9uu1HJwQwc64pgmLCI945fWM3lbTIqxjT3GQ==} + + yuku-codegen@0.8.7: + resolution: {integrity: sha512-adwDZSh8oVDzhE6Du9PwVWxcOxeV0e2EVhUuMKWfhSY4wkrDq9eqixlxFF3l/XGUV1E7UFzhpz9393MUumkyNw==} + + yuku-parser@0.8.7: + resolution: {integrity: sha512-vRD9nwt4L3aYpxNqeSC4WqLv58xrXef0Ong1Mc45CTXTIpvLafx7JO05sczmQZwdLEZvywrLOGdNC5+Rp5N1BQ==} + + zod@4.4.3: + resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} + + zod@4.6.7: + resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==} + + zustand@5.1.0: + resolution: {integrity: sha512-ciJZlP48M1PTQbVQq81CGVFxHTLpZNrFjKqwjtCU34AWuXTZT/jrF3p9+fI84Cf1eSCMLapxqBy/SNTfwOBuqA==} + engines: {node: '>=12.20.0'} + peerDependencies: + '@types/react': '>=18.0.0' + immer: '>=9.0.6' + react: '>=18.0.0' + use-sync-external-store: '>=1.2.0' + peerDependenciesMeta: + '@types/react': + optional: true + immer: + optional: true + react: + optional: true + use-sync-external-store: + optional: true + +snapshots: + + '@asamuzakjp/css-color@7.2.0': + dependencies: + '@csstools/css-calc': 3.4.3(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2) + '@csstools/css-color-parser': 4.2.7(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2) + '@csstools/css-parser-algorithms': 4.0.2(@csstools/css-tokenizer@4.0.2) + '@csstools/css-tokenizer': 4.0.2 + lru-cache: 11.5.3 + + '@asamuzakjp/dom-selector@10.0.5': + dependencies: + bidi-js: 1.1.0 + css-tree: 3.2.1 + is-potential-custom-element-name: 1.0.1 + lru-cache: 11.5.3 + + '@bramus/specificity@2.4.3': + dependencies: + css-tree: 3.2.1 + + '@csstools/color-helpers@6.1.2': {} + + '@csstools/css-calc@3.4.3(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2)': + dependencies: + '@csstools/css-parser-algorithms': 4.0.2(@csstools/css-tokenizer@4.0.2) + '@csstools/css-tokenizer': 4.0.2 + + '@csstools/css-color-parser@4.2.7(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2)': + dependencies: + '@csstools/color-helpers': 6.1.2 + '@csstools/css-calc': 3.4.3(@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2))(@csstools/css-tokenizer@4.0.2) + '@csstools/css-parser-algorithms': 4.0.2(@csstools/css-tokenizer@4.0.2) + '@csstools/css-tokenizer': 4.0.2 + + '@csstools/css-parser-algorithms@4.0.2(@csstools/css-tokenizer@4.0.2)': + dependencies: + '@csstools/css-tokenizer': 4.0.2 + + '@csstools/css-syntax-patches-for-csstree@1.1.16(css-tree@3.2.1)': + optionalDependencies: + css-tree: 3.2.1 + + '@csstools/css-tokenizer@4.0.2': {} + + '@deepseek-ai/cordis-plugin-group@1.0.5(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/cordis-plugin-loader': 1.0.6(@deepseek-ai/cordis@4.1.0)(node-addon-require-builtin@0.1.9) + + '@deepseek-ai/cordis-plugin-include@1.0.10(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/cordis-plugin-loader': 1.0.6(@deepseek-ai/cordis@4.1.0)(node-addon-require-builtin@0.1.9) + '@deepseek-ai/cosmokit': 1.8.6 + js-yaml: 4.3.2 + + '@deepseek-ai/cordis-plugin-loader@1.0.6(@deepseek-ai/cordis@4.1.0)(node-addon-require-builtin@0.1.9)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/cosmokit': 1.8.6 + '@deepseek-ai/schemastery': 3.18.5 + optionalDependencies: + node-addon-require-builtin: 0.1.9 + + '@deepseek-ai/cordis@4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6)': + dependencies: + '@deepseek-ai/cosmokit': 1.9.0 + '@standard-schema/spec': 1.1.0 + optionalDependencies: + '@deepseek-ai/cordis-plugin-include': 1.0.10(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/cordis-plugin-loader': 1.0.6(@deepseek-ai/cordis@4.1.0)(node-addon-require-builtin@0.1.9) + + '@deepseek-ai/cosmokit@1.8.6': {} + + '@deepseek-ai/cosmokit@1.9.0': {} + + '@deepseek-ai/dsh-agent-default-model@0.2.0-rc.1(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-app-boot@0.2.0-rc.1(@deepseek-ai/cordis-plugin-group@1.0.5(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-home-paths@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-launch-environment@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-system-prompt@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-agent': 0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad) + '@deepseek-ai/dsh-config-editor': 0.2.0-rc.1(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-app-boot@0.2.0-rc.1(@deepseek-ai/cordis-plugin-group@1.0.5(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-home-paths@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-launch-environment@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-system-prompt@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/schemastery': 3.18.5 + transitivePeerDependencies: + - '@deepseek-ai/cordis-plugin-include' + - '@deepseek-ai/cordis-plugin-loader' + - '@deepseek-ai/dsh-app-boot' + - '@deepseek-ai/dsh-hmr' + + '@deepseek-ai/dsh-agent-preset-registry@0.2.0-rc.1(c4c519f1d8cc8f3b50a54ac0c9492adb)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/cordis-plugin-include': 1.0.10(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/cordis-plugin-loader': 1.0.6(@deepseek-ai/cordis@4.1.0)(node-addon-require-builtin@0.1.9) + '@deepseek-ai/dsh-agent': 0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad) + '@deepseek-ai/dsh-app-boot': 0.2.0-rc.1(@deepseek-ai/cordis-plugin-group@1.0.5(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-home-paths@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-launch-environment@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-system-prompt@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-scope': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-session-projection': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-settings': 0.2.0-rc.1(63a56c224ed4e89339aed0841e0b560e) + '@deepseek-ai/dsh-system-prompt': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-tools': 0.2.1-rc.5(666b24f7fdca183de44b9b4a80ebd640) + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/schemastery': 3.18.5 + js-yaml: 4.3.2 + zod: 4.6.7 + transitivePeerDependencies: + - '@deepseek-ai/cordis-plugin-group' + - '@deepseek-ai/dsh-home-paths' + - '@deepseek-ai/dsh-launch-environment' + + '@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-scope': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-session-projection': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-system-prompt': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-util-values': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + optionalDependencies: + '@deepseek-ai/dsh-workspace': 0.2.0-rc.1(cf94c8e99361ad48838b9dc0d8adc28a) + + '@deepseek-ai/dsh-api-gateway@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-client-connection@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-client-connection': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-deque': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-timeout': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/schemastery': 3.18.5 + ws: 8.22.2 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + '@deepseek-ai/dsh-api-remotes@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-deque': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-scope': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-util-values': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-api-session-controller@0.2.0-rc.1(9b462facac363b65e9219b2cbd122587)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-agent': 0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad) + '@deepseek-ai/dsh-agent-default-model': 0.2.0-rc.1(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-app-boot@0.2.0-rc.1(@deepseek-ai/cordis-plugin-group@1.0.5(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-home-paths@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-launch-environment@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-system-prompt@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-agent-preset-registry': 0.2.0-rc.1(c4c519f1d8cc8f3b50a54ac0c9492adb) + '@deepseek-ai/dsh-api-gateway': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-client-connection@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-attachment': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-client-connection': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-client-file-upload': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-commands': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-attachment@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))(@deepseek-ai/dsh-typert-protocol@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-credentials': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-deque': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-file-reference': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad)) + '@deepseek-ai/dsh-fs': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-sandbox@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-native-command': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-scope': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-session-projection': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-session-query': 0.2.0-rc.1(9da575534a2a041b57a644f8c2e3e283) + '@deepseek-ai/dsh-session-title': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session-projection@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-skill': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-subagent': 0.2.0-rc.1(f2eb889e98e56c8941b15259e44d5099) + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-typert-registry': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-util-time': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-util-values': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-util-workspace-path': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-workspace': 0.2.0-rc.1(cf94c8e99361ad48838b9dc0d8adc28a) + '@deepseek-ai/schemastery': 3.18.5 + mime-types: 3.0.2 + zod: 4.6.7 + optionalDependencies: + '@deepseek-ai/dsh-session-persistence': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))(@deepseek-ai/dsh-timeout@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-settings': 0.2.0-rc.1(63a56c224ed4e89339aed0841e0b560e) + + '@deepseek-ai/dsh-api-workspace-controller@0.2.0-rc.1(183631cae50a354b57dd9a8353599a19)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-api-gateway': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-client-connection@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-client-connection': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-deque': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-host-directory-picker': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-native-command': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-storage-domain': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-storage@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-workspace': 0.2.0-rc.1(cf94c8e99361ad48838b9dc0d8adc28a) + '@deepseek-ai/schemastery': 3.18.5 + zod: 4.6.7 + + '@deepseek-ai/dsh-app-boot@0.2.0-rc.1(@deepseek-ai/cordis-plugin-group@1.0.5(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-home-paths@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-launch-environment@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-system-prompt@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/cordis-plugin-group': 1.0.5(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/cordis-plugin-include': 1.0.10(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/cordis-plugin-loader': 1.0.6(@deepseek-ai/cordis@4.1.0)(node-addon-require-builtin@0.1.9) + '@deepseek-ai/dsh-atomic-write': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-home-paths': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-launch-environment': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-package-manifest': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-system-prompt': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@eslint-community/regexpp': 4.12.3 + ajv: 8.20.0 + js-yaml: 4.3.2 + node-addon-require-builtin: 0.1.9 + resolve.exports: 2.0.4 + semver: 7.8.6 + + '@deepseek-ai/dsh-atomic-write@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-attachment@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-brand@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-chunked-list@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + zod: 4.6.7 + + '@deepseek-ai/dsh-client-connection@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-credentials': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-scope': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/schemastery': 3.18.5 + zod: 4.6.7 + transitivePeerDependencies: + - '@deepseek-ai/dsh-invariants' + + '@deepseek-ai/dsh-client-file-upload@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-scope': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + zod: 4.6.7 + + '@deepseek-ai/dsh-client-locale@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/schemastery': 3.18.5 + + '@deepseek-ai/dsh-client-store@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-client-ui-conversation@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/schemastery': 3.18.5 + + '@deepseek-ai/dsh-client-ui-primitives@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-client-ui-renderer@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-client-ui-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-client-ui-sidebar@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-client-ui-slots@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-client-ui-workspace@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-commands@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-attachment@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))(@deepseek-ai/dsh-typert-protocol@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-agent': 0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad) + '@deepseek-ai/dsh-attachment': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-scope': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-util-crypto': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + zod: 4.6.7 + + '@deepseek-ai/dsh-compaction-image-offload@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-compaction@0.2.0-rc.1(f9e4ebedc629872747d6b9e9abeb7b02))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-agent': 0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad) + '@deepseek-ai/dsh-compaction': 0.2.0-rc.1(f9e4ebedc629872747d6b9e9abeb7b02) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-util-values': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-compaction@0.2.0-rc.1(f9e4ebedc629872747d6b9e9abeb7b02)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-commands': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-attachment@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))(@deepseek-ai/dsh-typert-protocol@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + + '@deepseek-ai/dsh-config-editor@0.2.0-rc.1(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-app-boot@0.2.0-rc.1(@deepseek-ai/cordis-plugin-group@1.0.5(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-home-paths@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-launch-environment@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-system-prompt@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/cordis-plugin-include': 1.0.10(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/cordis-plugin-loader': 1.0.6(@deepseek-ai/cordis@4.1.0)(node-addon-require-builtin@0.1.9) + '@deepseek-ai/dsh-app-boot': 0.2.0-rc.1(@deepseek-ai/cordis-plugin-group@1.0.5(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-home-paths@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-launch-environment@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-system-prompt@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-atomic-write': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + js-yaml: 4.3.2 + yaml: 2.9.1 + + '@deepseek-ai/dsh-credentials@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-deque@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-file-reference@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-agent': 0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad) + + '@deepseek-ai/dsh-fs@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-sandbox@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-sandbox': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + + '@deepseek-ai/dsh-home-paths@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-host-directory-picker@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-host-webserver@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/schemastery': 3.18.5 + compression: 1.8.2 + negotiator: 1.1.0 + transitivePeerDependencies: + - supports-color + + '@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/schemastery': 3.18.5 + + '@deepseek-ai/dsh-launch-environment@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-timeout': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-util-crypto': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-util-values': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/schemastery': 3.18.5 + zod: 4.6.7 + + '@deepseek-ai/dsh-native-command@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-package-manifest@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-ptc-runtime@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-sandbox@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-sandbox': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + + '@deepseek-ai/dsh-sandbox-policy@0.2.1-rc.5(b92c9575974e70552ffe680a30f57db8)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-agent': 0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad) + '@deepseek-ai/dsh-sandbox': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-session-projection': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-system-prompt': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/schemastery': 3.18.5 + zod: 4.4.3 + + '@deepseek-ai/dsh-sandbox@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-util-values': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-session-format-catalog@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-compaction@0.2.0-rc.1(f9e4ebedc629872747d6b9e9abeb7b02))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-compaction-image-offload': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-compaction@0.2.0-rc.1(f9e4ebedc629872747d6b9e9abeb7b02))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-session-format': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session-format-v0-to-v1': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session-format-v1-to-v2': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session-format-v2-to-v3': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session-format-v3-to-v4': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + transitivePeerDependencies: + - '@deepseek-ai/dsh-agent' + - '@deepseek-ai/dsh-compaction' + - '@deepseek-ai/dsh-llm' + + '@deepseek-ai/dsh-session-format-v0-to-v1@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-session-format': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-util-values': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-session-format-v1-to-v2@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session-format': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session-format-v0-to-v1': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-util-values': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-session-format-v2-to-v3@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-session-format': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session-format-v0-to-v1': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session-format-v1-to-v2': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-session-format-v3-to-v4@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-session-format': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session-format-v2-to-v3': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-session-format@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-util-values': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-session-persistence@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))(@deepseek-ai/dsh-timeout@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-timeout': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-util-values': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-session-projection@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + zod: 4.6.7 + + '@deepseek-ai/dsh-session-query@0.2.0-rc.1(9da575534a2a041b57a644f8c2e3e283)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-session-format-catalog': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-compaction@0.2.0-rc.1(f9e4ebedc629872747d6b9e9abeb7b02))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-session-title': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session-projection@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-tool-todo': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session-projection@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))(@deepseek-ai/dsh-tools@0.2.1-rc.5(666b24f7fdca183de44b9b4a80ebd640)) + optionalDependencies: + '@deepseek-ai/dsh-session-persistence': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))(@deepseek-ai/dsh-timeout@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-session-projection': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + transitivePeerDependencies: + - '@deepseek-ai/dsh-agent' + - '@deepseek-ai/dsh-compaction' + + '@deepseek-ai/dsh-session-title@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session-projection@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-agent': 0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad) + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-session-projection': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-util-values': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/schemastery': 3.18.5 + zod: 4.6.7 + + '@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-scope': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-util-values': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-settings@0.2.0-rc.1(63a56c224ed4e89339aed0841e0b560e)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/cordis-plugin-loader': 1.0.6(@deepseek-ai/cordis@4.1.0)(node-addon-require-builtin@0.1.9) + '@deepseek-ai/cosmokit': 1.8.6 + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-config-editor': 0.2.0-rc.1(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-app-boot@0.2.0-rc.1(@deepseek-ai/cordis-plugin-group@1.0.5(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6)(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-home-paths@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-launch-environment@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-system-prompt@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))) + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-util-values': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/schemastery': 3.19.0 + yaml: 2.9.1 + transitivePeerDependencies: + - '@deepseek-ai/cordis-plugin-include' + - '@deepseek-ai/dsh-app-boot' + - '@deepseek-ai/dsh-hmr' + - node-addon-require-builtin + + '@deepseek-ai/dsh-skill@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-scope': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-util-values': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/schemastery': 3.18.5 + + '@deepseek-ai/dsh-storage-domain@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-storage@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-storage': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/schemastery': 3.18.5 + zod: 4.6.7 + + '@deepseek-ai/dsh-storage@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-subagent@0.2.0-rc.1(f2eb889e98e56c8941b15259e44d5099)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-agent': 0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad) + '@deepseek-ai/dsh-attachment': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-chunked-list': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-scope': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-system-prompt': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-tools': 0.2.1-rc.5(666b24f7fdca183de44b9b4a80ebd640) + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-util-time': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-util-values': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/schemastery': 3.18.5 + zod: 4.6.7 + optionalDependencies: + '@deepseek-ai/dsh-agent-preset-registry': 0.2.0-rc.1(c4c519f1d8cc8f3b50a54ac0c9492adb) + '@deepseek-ai/dsh-sandbox': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-sandbox-policy': 0.2.1-rc.5(b92c9575974e70552ffe680a30f57db8) + '@deepseek-ai/dsh-session-persistence': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))(@deepseek-ai/dsh-timeout@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-session-projection': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-session-query': 0.2.0-rc.1(9da575534a2a041b57a644f8c2e3e283) + '@deepseek-ai/dsh-settings': 0.2.0-rc.1(63a56c224ed4e89339aed0841e0b560e) + '@deepseek-ai/dsh-user-approval': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))(@deepseek-ai/dsh-system-prompt@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-workspace': 0.2.0-rc.1(cf94c8e99361ad48838b9dc0d8adc28a) + + '@deepseek-ai/dsh-system-prompt@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-scope': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/schemastery': 3.18.5 + + '@deepseek-ai/dsh-timeout@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-tool-todo@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session-projection@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))(@deepseek-ai/dsh-tools@0.2.1-rc.5(666b24f7fdca183de44b9b4a80ebd640))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-agent': 0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad) + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-session-projection': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-tools': 0.2.1-rc.5(666b24f7fdca183de44b9b4a80ebd640) + '@deepseek-ai/schemastery': 3.18.5 + zod: 4.6.7 + + '@deepseek-ai/dsh-tools@0.2.1-rc.5(666b24f7fdca183de44b9b4a80ebd640)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-agent': 0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad) + '@deepseek-ai/dsh-brand': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-ptc-runtime': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-sandbox@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))) + '@deepseek-ai/dsh-sandbox': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-sandbox-policy': 0.2.1-rc.5(b92c9575974e70552ffe680a30f57db8) + '@deepseek-ai/dsh-scope': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-system-prompt': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-user-approval': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))(@deepseek-ai/dsh-system-prompt@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-util-values': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-working-directory': 0.2.1-rc.5(9464f69451a17962f0629df00117b526) + '@deepseek-ai/schemastery': 3.18.5 + + '@deepseek-ai/dsh-typert-protocol@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + + '@deepseek-ai/dsh-typert-registry@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + zod: 4.6.7 + + '@deepseek-ai/dsh-user-approval@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-agent@0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad))(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))(@deepseek-ai/dsh-system-prompt@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-agent': 0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad) + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-scope': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-system-prompt': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/schemastery': 3.18.5 + + '@deepseek-ai/dsh-util-crypto@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-util-time@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-util-values@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-util-values@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-util-workspace-path@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + + '@deepseek-ai/dsh-working-directory@0.2.1-rc.5(9464f69451a17962f0629df00117b526)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-agent': 0.2.0-rc.1(bce8e5ae0e046db2068d4d94b23b34ad) + '@deepseek-ai/dsh-fs': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-sandbox@0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))) + '@deepseek-ai/dsh-llm': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-session-projection': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)))) + '@deepseek-ai/dsh-system-prompt': 0.2.1-rc.5(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-llm@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/schemastery': 3.18.5 + zod: 4.6.7 + + '@deepseek-ai/dsh-workspace@0.2.0-rc.1(cf94c8e99361ad48838b9dc0d8adc28a)': + dependencies: + '@deepseek-ai/cordis': 4.1.0(@deepseek-ai/cordis-plugin-include@1.0.10)(@deepseek-ai/cordis-plugin-loader@1.0.6) + '@deepseek-ai/dsh-brand': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-invariants': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-session': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))) + '@deepseek-ai/dsh-session-persistence': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-brand@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-session@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-scope@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))))(@deepseek-ai/dsh-timeout@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-storage': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + '@deepseek-ai/dsh-storage-domain': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)(@deepseek-ai/dsh-invariants@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0))(@deepseek-ai/dsh-storage@0.2.0-rc.1(@deepseek-ai/cordis@4.1.0)) + '@deepseek-ai/dsh-typert-protocol': 0.2.0-rc.1(@deepseek-ai/cordis@4.1.0) + zod: 4.6.7 + + '@deepseek-ai/schemastery@3.18.5': + dependencies: + '@deepseek-ai/cosmokit': 1.8.6 + '@standard-schema/spec': 1.1.0 + + '@deepseek-ai/schemastery@3.19.0': + dependencies: + '@deepseek-ai/cosmokit': 1.9.0 + '@standard-schema/spec': 1.1.0 + + '@emnapi/core@2.0.0-beta.2': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.9.1 + optional: true + + '@emnapi/runtime@2.0.0-beta.2': + dependencies: + tslib: 2.9.1 + optional: true + + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.9.1 + optional: true + + '@eslint-community/regexpp@4.12.3': {} + + '@exodus/bytes@1.16.0': {} + + '@jridgewell/sourcemap-codec@1.6.0': {} + + '@napi-rs/wasm-runtime@1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@tybys/wasm-util': 0.10.4 + optional: true + + '@oxc-project/types@0.156.0': {} + + '@quansync/fs@1.1.0': + dependencies: + quansync: 1.0.0 + + '@rolldown/binding-android-arm-eabi@1.2.19': + optional: true + + '@rolldown/binding-android-arm64@1.2.19': + optional: true + + '@rolldown/binding-darwin-arm64@1.2.19': + optional: true + + '@rolldown/binding-darwin-x64@1.2.19': + optional: true + + '@rolldown/binding-freebsd-x64@1.2.19': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.2.19': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.2.19': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.2.19': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.2.19': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.2.19': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.2.19': + optional: true + + '@rolldown/binding-linux-x64-musl@1.2.19': + optional: true + + '@rolldown/binding-openharmony-arm64@1.2.19': + optional: true + + '@rolldown/binding-wasm32-wasi@1.2.19': + dependencies: + '@emnapi/core': 2.0.0-beta.2 + '@emnapi/runtime': 2.0.0-beta.2 + '@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.2.19': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.2.19': + optional: true + + '@rolldown/pluginutils@1.1.0': {} + + '@standard-schema/spec@1.1.0': {} + + '@tybys/wasm-util@0.10.4': + dependencies: + tslib: 2.9.1 + optional: true + + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + + '@types/deep-eql@4.0.2': {} + + '@types/estree@1.0.10': {} + + '@types/js-yaml@4.0.9': {} + + '@types/node@24.19.2': + dependencies: + undici-types: 7.24.6 + + '@types/prop-types@15.7.15': {} + + '@types/react-dom@18.3.7(@types/react@18.3.31)': + dependencies: + '@types/react': 18.3.31 + + '@types/react@18.3.31': + dependencies: + '@types/prop-types': 15.7.15 + csstype: 3.2.3 + + '@vitest/expect@4.1.8': + dependencies: + '@standard-schema/spec': 1.1.0 + '@types/chai': 5.2.3 + '@vitest/spy': 4.1.8 + '@vitest/utils': 4.1.8 + chai: 6.3.0 + tinyrainbow: 3.2.0 + + '@vitest/mocker@4.1.8(vite@8.3.8(@types/node@24.19.2)(yaml@2.9.1))': + dependencies: + '@vitest/spy': 4.1.8 + estree-walker: 3.0.3 + magic-string: 0.30.21 + optionalDependencies: + vite: 8.3.8(@types/node@24.19.2)(yaml@2.9.1) + + '@vitest/pretty-format@4.1.8': + dependencies: + tinyrainbow: 3.2.0 + + '@vitest/runner@4.1.8': + dependencies: + '@vitest/utils': 4.1.8 + pathe: 2.0.3 + + '@vitest/snapshot@4.1.8': + dependencies: + '@vitest/pretty-format': 4.1.8 + '@vitest/utils': 4.1.8 + magic-string: 0.30.21 + pathe: 2.0.3 + + '@vitest/spy@4.1.8': {} + + '@vitest/utils@4.1.8': + dependencies: + '@vitest/pretty-format': 4.1.8 + convert-source-map: 2.0.0 + tinyrainbow: 3.2.0 + + '@yuku-codegen/binding-android-arm64@0.8.7': + optional: true + + '@yuku-codegen/binding-darwin-arm64@0.8.7': + optional: true + + '@yuku-codegen/binding-darwin-x64@0.8.7': + optional: true + + '@yuku-codegen/binding-freebsd-x64@0.8.7': + optional: true + + '@yuku-codegen/binding-linux-arm-gnu@0.8.7': + optional: true + + '@yuku-codegen/binding-linux-arm-musl@0.8.7': + optional: true + + '@yuku-codegen/binding-linux-arm64-gnu@0.8.7': + optional: true + + '@yuku-codegen/binding-linux-arm64-musl@0.8.7': + optional: true + + '@yuku-codegen/binding-linux-x64-gnu@0.8.7': + optional: true + + '@yuku-codegen/binding-linux-x64-musl@0.8.7': + optional: true + + '@yuku-codegen/binding-win32-arm64@0.8.7': + optional: true + + '@yuku-codegen/binding-win32-x64@0.8.7': + optional: true + + '@yuku-parser/binding-android-arm64@0.8.7': + optional: true + + '@yuku-parser/binding-darwin-arm64@0.8.7': + optional: true + + '@yuku-parser/binding-darwin-x64@0.8.7': + optional: true + + '@yuku-parser/binding-freebsd-x64@0.8.7': + optional: true + + '@yuku-parser/binding-linux-arm-gnu@0.8.7': + optional: true + + '@yuku-parser/binding-linux-arm-musl@0.8.7': + optional: true + + '@yuku-parser/binding-linux-arm64-gnu@0.8.7': + optional: true + + '@yuku-parser/binding-linux-arm64-musl@0.8.7': + optional: true + + '@yuku-parser/binding-linux-x64-gnu@0.8.7': + optional: true + + '@yuku-parser/binding-linux-x64-musl@0.8.7': + optional: true + + '@yuku-parser/binding-win32-arm64@0.8.7': + optional: true + + '@yuku-parser/binding-win32-x64@0.8.7': + optional: true + + '@yuku-toolchain/types@0.8.7': {} + + ajv@8.20.0: + dependencies: + fast-deep-equal: 3.1.3 + fast-uri: 3.1.9 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + + ansis@4.5.0: {} + + argparse@2.0.1: {} + + assertion-error@2.0.1: {} + + bidi-js@1.1.0: + dependencies: + require-from-string: 2.0.2 + + bytes@3.1.2: {} + + cac@7.1.0: {} + + chai@6.3.0: {} + + compressible@2.0.18: + dependencies: + mime-db: 1.54.0 + + compression@1.8.2: + dependencies: + bytes: 3.1.2 + compressible: 2.0.18 + debug: 2.6.9 + destroy: 1.2.0 + negotiator: 0.6.4 + on-headers: 1.1.0 + safe-buffer: 5.2.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + + content-type@2.1.0: {} + + convert-source-map@2.0.0: {} + + css-tree@3.2.1: + dependencies: + mdn-data: 2.27.1 + source-map-js: 1.2.2 + + csstype@3.2.3: {} + + data-urls@8.0.0: + dependencies: + whatwg-mimetype: 5.0.0 + whatwg-url: 17.3.0 + transitivePeerDependencies: + - '@noble/hashes' + + debug@2.6.9: + dependencies: + ms: 2.0.0 + + decimal.js@10.6.0: {} + + defu@6.1.7: {} + + destroy@1.2.0: {} + + detect-libc@2.1.2: {} + + dts-resolver@3.0.0: {} + + empathic@2.1.0: {} + + entities@9.0.0: {} + + es-module-lexer@2.3.2: {} + + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.10 + + expect-type@1.4.0: {} + + fast-deep-equal@3.1.3: {} + + fast-uri@3.1.9: {} + + fdir@6.5.0(picomatch@4.0.7): + optionalDependencies: + picomatch: 4.0.7 + + fsevents@2.3.3: + optional: true + + get-tsconfig@5.0.0-beta.5: + dependencies: + resolve-pkg-maps: 1.0.0 + + hookable@6.1.2: {} + + html-encoding-sniffer@7.0.0: + dependencies: + '@exodus/bytes': 1.16.0 + transitivePeerDependencies: + - '@noble/hashes' + + immer@11.2.10: {} + + import-without-cache@0.4.1: {} + + is-potential-custom-element-name@1.0.1: {} + + js-tokens@4.0.0: {} + + js-yaml@4.3.2: + dependencies: + argparse: 2.0.1 + + jsdom@30.1.3: + dependencies: + '@asamuzakjp/css-color': 7.2.0 + '@asamuzakjp/dom-selector': 10.0.5 + '@bramus/specificity': 2.4.3 + '@csstools/css-syntax-patches-for-csstree': 1.1.16(css-tree@3.2.1) + '@exodus/bytes': 1.16.0 + css-tree: 3.2.1 + data-urls: 8.0.0 + decimal.js: 10.6.0 + html-encoding-sniffer: 7.0.0 + is-potential-custom-element-name: 1.0.1 + lru-cache: 11.5.3 + parse5: 8.1.1 + saxes: 6.0.0 + tough-cookie: 6.1.0 + undici: 8.12.4 + w3c-xmlserializer: 6.0.0 + webidl-conversions: 8.0.1 + whatwg-mimetype: 5.0.0 + whatwg-url: 17.3.0 + xml-name-validator: 5.0.0 + transitivePeerDependencies: + - '@noble/hashes' + + json-schema-traverse@1.0.0: {} + + lightningcss-android-arm64@1.33.0: + optional: true + + lightningcss-darwin-arm64@1.33.0: + optional: true + + lightningcss-darwin-x64@1.33.0: + optional: true + + lightningcss-freebsd-x64@1.33.0: + optional: true + + lightningcss-linux-arm-gnueabihf@1.33.0: + optional: true + + lightningcss-linux-arm64-gnu@1.33.0: + optional: true + + lightningcss-linux-arm64-musl@1.33.0: + optional: true + + lightningcss-linux-x64-gnu@1.33.0: + optional: true + + lightningcss-linux-x64-musl@1.33.0: + optional: true + + lightningcss-win32-arm64-msvc@1.33.0: + optional: true + + lightningcss-win32-x64-msvc@1.33.0: + optional: true + + lightningcss@1.33.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.33.0 + lightningcss-darwin-arm64: 1.33.0 + lightningcss-darwin-x64: 1.33.0 + lightningcss-freebsd-x64: 1.33.0 + lightningcss-linux-arm-gnueabihf: 1.33.0 + lightningcss-linux-arm64-gnu: 1.33.0 + lightningcss-linux-arm64-musl: 1.33.0 + lightningcss-linux-x64-gnu: 1.33.0 + lightningcss-linux-x64-musl: 1.33.0 + lightningcss-win32-arm64-msvc: 1.33.0 + lightningcss-win32-x64-msvc: 1.33.0 + + loose-envify@1.4.0: + dependencies: + js-tokens: 4.0.0 + + lru-cache@11.5.3: {} + + magic-string@0.30.21: + dependencies: + '@jridgewell/sourcemap-codec': 1.6.0 + + mdn-data@2.27.1: {} + + mime-db@1.54.0: {} + + mime-types@3.0.2: + dependencies: + mime-db: 1.54.0 + + ms@2.0.0: {} + + nanoid@3.3.20: {} + + negotiator@0.6.4: {} + + negotiator@1.1.0: + dependencies: + content-type: 2.1.0 + + node-addon-native-custom-loader@0.1.9: {} + + node-addon-require-builtin-darwin-arm64@0.1.9: + dependencies: + node-addon-native-custom-loader: 0.1.9 + optional: true + + node-addon-require-builtin-darwin-x64@0.1.9: + dependencies: + node-addon-native-custom-loader: 0.1.9 + optional: true + + node-addon-require-builtin-linux-arm64-gnu@0.1.9: + dependencies: + node-addon-native-custom-loader: 0.1.9 + optional: true + + node-addon-require-builtin-linux-arm64-musl@0.1.9: + dependencies: + node-addon-native-custom-loader: 0.1.9 + optional: true + + node-addon-require-builtin-linux-x64-gnu@0.1.9: + dependencies: + node-addon-native-custom-loader: 0.1.9 + optional: true + + node-addon-require-builtin-linux-x64-musl@0.1.9: + dependencies: + node-addon-native-custom-loader: 0.1.9 + optional: true + + node-addon-require-builtin-win32-arm64-msvc@0.1.9: + dependencies: + node-addon-native-custom-loader: 0.1.9 + optional: true + + node-addon-require-builtin-win32-ia32-msvc@0.1.9: + dependencies: + node-addon-native-custom-loader: 0.1.9 + optional: true + + node-addon-require-builtin-win32-x64-msvc@0.1.9: + dependencies: + node-addon-native-custom-loader: 0.1.9 + optional: true + + node-addon-require-builtin@0.1.9: + dependencies: + node-addon-native-custom-loader: 0.1.9 + optionalDependencies: + node-addon-require-builtin-darwin-arm64: 0.1.9 + node-addon-require-builtin-darwin-x64: 0.1.9 + node-addon-require-builtin-linux-arm64-gnu: 0.1.9 + node-addon-require-builtin-linux-arm64-musl: 0.1.9 + node-addon-require-builtin-linux-x64-gnu: 0.1.9 + node-addon-require-builtin-linux-x64-musl: 0.1.9 + node-addon-require-builtin-win32-arm64-msvc: 0.1.9 + node-addon-require-builtin-win32-ia32-msvc: 0.1.9 + node-addon-require-builtin-win32-x64-msvc: 0.1.9 + + obug@2.2.1: {} + + on-headers@1.1.0: {} + + parse5@8.1.1: + dependencies: + entities: 9.0.0 + + pathe@2.0.3: {} + + picocolors@1.1.1: {} + + picomatch@4.0.7: {} + + postcss@8.5.32: + dependencies: + nanoid: 3.3.20 + picocolors: 1.1.1 + source-map-js: 1.2.2 + + punycode@2.3.1: {} + + quansync@1.0.0: {} + + react-dom@18.3.1(react@18.3.1): + dependencies: + loose-envify: 1.4.0 + react: 18.3.1 + scheduler: 0.23.2 + + react@18.3.1: + dependencies: + loose-envify: 1.4.0 + + require-from-string@2.0.2: {} + + resolve-pkg-maps@1.0.0: {} + + resolve.exports@2.0.4: {} + + rolldown-plugin-dts@0.27.14(rolldown@1.2.19)(typescript@5.9.3): + dependencies: + dts-resolver: 3.0.0 + get-tsconfig: 5.0.0-beta.5 + obug: 2.2.1 + rolldown: 1.2.19 + yuku-ast: 0.8.7 + yuku-codegen: 0.8.7 + yuku-parser: 0.8.7 + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - oxc-resolver + + rolldown@1.2.19: + dependencies: + '@oxc-project/types': 0.156.0 + '@rolldown/pluginutils': 1.1.0 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.2.19 + '@rolldown/binding-android-arm64': 1.2.19 + '@rolldown/binding-darwin-arm64': 1.2.19 + '@rolldown/binding-darwin-x64': 1.2.19 + '@rolldown/binding-freebsd-x64': 1.2.19 + '@rolldown/binding-linux-arm-gnueabihf': 1.2.19 + '@rolldown/binding-linux-arm64-gnu': 1.2.19 + '@rolldown/binding-linux-arm64-musl': 1.2.19 + '@rolldown/binding-linux-ppc64-gnu': 1.2.19 + '@rolldown/binding-linux-s390x-gnu': 1.2.19 + '@rolldown/binding-linux-x64-gnu': 1.2.19 + '@rolldown/binding-linux-x64-musl': 1.2.19 + '@rolldown/binding-openharmony-arm64': 1.2.19 + '@rolldown/binding-wasm32-wasi': 1.2.19 + '@rolldown/binding-win32-arm64-msvc': 1.2.19 + '@rolldown/binding-win32-x64-msvc': 1.2.19 + + safe-buffer@5.2.1: {} + + saxes@6.0.0: + dependencies: + xmlchars: 2.2.0 + + scheduler@0.23.2: + dependencies: + loose-envify: 1.4.0 + + semver@7.8.6: {} + + siginfo@2.0.0: {} + + source-map-js@1.2.2: {} + + stackback@0.0.2: {} + + std-env@4.3.0: {} + + tinybench@2.9.0: {} + + tinyexec@1.3.1: {} + + tinyglobby@0.2.17: + dependencies: + fdir: 6.5.0(picomatch@4.0.7) + picomatch: 4.0.7 + + tinyrainbow@3.2.0: {} + + tldts-core@7.4.21: {} + + tldts@7.4.21: + dependencies: + tldts-core: 7.4.21 + + tough-cookie@6.1.0: + dependencies: + tldts: 7.4.21 + + tr46@7.0.0: + dependencies: + punycode: 2.3.1 + + tree-kill@1.2.2: {} + + tsdown@0.22.14(typescript@5.9.3): + dependencies: + ansis: 4.5.0 + cac: 7.1.0 + defu: 6.1.7 + empathic: 2.1.0 + hookable: 6.1.2 + import-without-cache: 0.4.1 + obug: 2.2.1 + picomatch: 4.0.7 + rolldown: 1.2.19 + rolldown-plugin-dts: 0.27.14(rolldown@1.2.19)(typescript@5.9.3) + tinyexec: 1.3.1 + tinyglobby: 0.2.17 + tree-kill: 1.2.2 + unconfig-core: 7.5.0 + verkit: 0.3.2 + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - '@typescript/native-preview' + - '@volar/typescript' + - oxc-resolver + - vue-tsc + + tslib@2.9.1: + optional: true + + typescript@5.9.3: {} + + unconfig-core@7.5.0: + dependencies: + '@quansync/fs': 1.1.0 + quansync: 1.0.0 + + undici-types@7.24.6: {} + + undici@8.12.4: {} + + vary@1.1.2: {} + + verkit@0.3.2: {} + + vite@8.3.8(@types/node@24.19.2)(yaml@2.9.1): + dependencies: + lightningcss: 1.33.0 + picomatch: 4.0.7 + postcss: 8.5.32 + rolldown: 1.2.19 + tinyglobby: 0.2.17 + optionalDependencies: + '@types/node': 24.19.2 + fsevents: 2.3.3 + yaml: 2.9.1 + + vitest@4.1.8(@types/node@24.19.2)(jsdom@30.1.3)(vite@8.3.8(@types/node@24.19.2)(yaml@2.9.1)): + dependencies: + '@vitest/expect': 4.1.8 + '@vitest/mocker': 4.1.8(vite@8.3.8(@types/node@24.19.2)(yaml@2.9.1)) + '@vitest/pretty-format': 4.1.8 + '@vitest/runner': 4.1.8 + '@vitest/snapshot': 4.1.8 + '@vitest/spy': 4.1.8 + '@vitest/utils': 4.1.8 + es-module-lexer: 2.3.2 + expect-type: 1.4.0 + magic-string: 0.30.21 + obug: 2.2.1 + pathe: 2.0.3 + picomatch: 4.0.7 + std-env: 4.3.0 + tinybench: 2.9.0 + tinyexec: 1.3.1 + tinyglobby: 0.2.17 + tinyrainbow: 3.2.0 + vite: 8.3.8(@types/node@24.19.2)(yaml@2.9.1) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 24.19.2 + jsdom: 30.1.3 + transitivePeerDependencies: + - msw + + w3c-xmlserializer@6.0.0: + dependencies: + xml-name-validator: 5.0.0 + + webidl-conversions@8.0.1: {} + + whatwg-mimetype@5.0.0: {} + + whatwg-url@17.3.0: + dependencies: + '@exodus/bytes': 1.16.0 + tr46: 7.0.0 + webidl-conversions: 8.0.1 + transitivePeerDependencies: + - '@noble/hashes' + + why-is-node-running@2.3.0: + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + + ws@8.22.2: {} + + xml-name-validator@5.0.0: {} + + xmlchars@2.2.0: {} + + yaml@2.9.1: {} + + yuku-ast@0.8.7: + dependencies: + '@yuku-toolchain/types': 0.8.7 + + yuku-codegen@0.8.7: + dependencies: + '@yuku-toolchain/types': 0.8.7 + optionalDependencies: + '@yuku-codegen/binding-android-arm64': 0.8.7 + '@yuku-codegen/binding-darwin-arm64': 0.8.7 + '@yuku-codegen/binding-darwin-x64': 0.8.7 + '@yuku-codegen/binding-freebsd-x64': 0.8.7 + '@yuku-codegen/binding-linux-arm-gnu': 0.8.7 + '@yuku-codegen/binding-linux-arm-musl': 0.8.7 + '@yuku-codegen/binding-linux-arm64-gnu': 0.8.7 + '@yuku-codegen/binding-linux-arm64-musl': 0.8.7 + '@yuku-codegen/binding-linux-x64-gnu': 0.8.7 + '@yuku-codegen/binding-linux-x64-musl': 0.8.7 + '@yuku-codegen/binding-win32-arm64': 0.8.7 + '@yuku-codegen/binding-win32-x64': 0.8.7 + + yuku-parser@0.8.7: + dependencies: + '@yuku-toolchain/types': 0.8.7 + yuku-ast: 0.8.7 + optionalDependencies: + '@yuku-parser/binding-android-arm64': 0.8.7 + '@yuku-parser/binding-darwin-arm64': 0.8.7 + '@yuku-parser/binding-darwin-x64': 0.8.7 + '@yuku-parser/binding-freebsd-x64': 0.8.7 + '@yuku-parser/binding-linux-arm-gnu': 0.8.7 + '@yuku-parser/binding-linux-arm-musl': 0.8.7 + '@yuku-parser/binding-linux-arm64-gnu': 0.8.7 + '@yuku-parser/binding-linux-arm64-musl': 0.8.7 + '@yuku-parser/binding-linux-x64-gnu': 0.8.7 + '@yuku-parser/binding-linux-x64-musl': 0.8.7 + '@yuku-parser/binding-win32-arm64': 0.8.7 + '@yuku-parser/binding-win32-x64': 0.8.7 + + zod@4.4.3: {} + + zod@4.6.7: {} + + zustand@5.1.0(@types/react@18.3.31)(immer@11.2.10)(react@18.3.1): + optionalDependencies: + '@types/react': 18.3.31 + immer: 11.2.10 + react: 18.3.1 diff --git a/scripts/build-remote-ssh-client.mjs b/scripts/build-remote-ssh-client.mjs index 172efe2..4cbb195 100644 --- a/scripts/build-remote-ssh-client.mjs +++ b/scripts/build-remote-ssh-client.mjs @@ -35,6 +35,166 @@ if (body.endsWith(TAIL + '\n')) body = body.slice(0, -(TAIL.length + 1)) else if (body.endsWith(TAIL)) body = body.slice(0, -TAIL.length) else throw new Error('remote-ssh client: tail anchor mismatch') +// [workspace-groups-remote patch] Replace the upstream root-label heuristic +// (basename + inline padding-left:6px) with an exact full-path identity match. +// better-sidebar's RootRow carries the complete directory in `title`; only an +// element whose title equals a remote workspace's mirrorPath is rewritten, so +// a same-named local directory can never be relabelled by mistake. If a future +// shell drops that attribute nothing is changed (safe degradation). +const ROOT_LABEL_OLD = ` // ---- 文件树根标签:显示远程目录名,而不是本地镜像目录 ID(issue #9)---- + // better-sidebar「文件」页签的树根标签取自会话 cwd(= 本地镜像路径)的 basename, + // 于是显示成镜像目录 ID(如 wmirror3)。这条链路不经过任何 fs.* 路由, + // 而 Host 侧 session.cwd 虽然已返回 root 字段,客户端只消费 cwd + // (client-registry 的 api.sessionCwd(...).then(r => setFetchedCwd(r.cwd)), + // 另有 useSessionCwd 直接读客户端会话列表的 cwd),因此只能在渲染层替换文本。 + // 定位不依赖构建期哈希类名:根行是树里唯一带内联 padding-left:6px 的行, + // 仅当该行内的纯文本节点 === 某远程工作区的镜像 basename 时才替换(幂等、可自愈)。 + var watchedRootLabels = []; // 已替换的标签元素:1s 幂等复检,抵消 React 重渲染 + function refreshRootLabels(workspaces) { + var next = {}; + for (var i = 0; i < (workspaces || []).length; i++) { + var w = workspaces[i] || {}; + var mirror = String(w.mirrorPath || "").replace(/[\\\\/]+$/, ""); + var remote = String(w.remotePath || "").replace(/[\\\\/]+$/, ""); + if (!mirror || !remote) continue; + var mb = mirror.split(/[\\\\/]/).pop(); + var rb = remote.split(/[\\\\/]/).pop(); + if (mb && rb && mb !== rb) next[mb] = { label: rb, remotePath: remote }; + } + rootLabels = next; + } + /** 根行判据:自身或 ≤3 层祖先带内联 padding-left:6px(better-sidebar 根行样式)。 */ + function isRootRow(el) { + var node = el; + for (var hop = 0; hop < 3 && node; hop++) { + var style = node.getAttribute ? node.getAttribute("style") : null; + if (style && /padding-left:\\s*6px/i.test(String(style))) return true; + node = node.parentElement; + } + return false; + } + /** 单个标签替换:纯文本 + 命中镜像 basename + 位于根行 → 换成远程目录名。 */ + function fixRootLabel(el) { + var text = (el.textContent || "").trim(); + if (!text) return false; + var hit = rootLabels[text]; + if (hit === undefined) { + // 文本已是远程目录名(上一轮替换过)→ 幂等成功;否则与本插件无关 + return el.getAttribute && el.getAttribute("data-rssh-root-label") === "1"; + } + if (el.childElementCount > 0) return false; // 只改纯文本节点 + if (!isRootRow(el)) return false; // 非根行(例如同名子条目)不动 + el.textContent = hit.label; + if (el.setAttribute) { + el.setAttribute("data-rssh-root-label", "1"); + el.setAttribute("title", hit.remotePath); // 悬停可见完整远程路径 + } + watchRootLabel(el); + return true; + } + function watchRootLabel(el) { + for (var i = 0; i < watchedRootLabels.length; i++) { if (watchedRootLabels[i] === el) return; } + watchedRootLabels.push(el); + } + function recheckRootLabels() { + for (var i = watchedRootLabels.length - 1; i >= 0; i--) { + var el = watchedRootLabels[i]; + if (!el || !el.isConnected) { watchedRootLabels.splice(i, 1); continue; } + fixRootLabel(el); + } + } + function applyRootLabelsIn(root) { + if (!root || !root.querySelectorAll) return; + try { + var nodes = root.querySelectorAll("span,div"); + for (var i = 0; i < nodes.length; i++) fixRootLabel(nodes[i]); + if (root.nodeType === 1) fixRootLabel(root); + } catch (e) {} + }` + +const ROOT_LABEL_NEW = ` // ---- 文件树根标签:按完整镜像路径精确认行(issue #9)---- + // better-sidebar 的根行 title 是完整目录路径(RootRow title={path})。 + // 只在该 title 精确等于某个远程工作区的 mirrorPath 时才改写名称:不再 + // 按 basename 或内联 padding-left 猜测目录身份,因此同名本地目录不会 + // 被误改;属性缺席时保持原样(安全降级)。 + var watchedRootLabels = []; // 已替换的标签元素:1s 幂等复检,抵消 React 重渲染 + var rootLabels = {}; + function normRemotePath(value) { + return String(value == null ? "" : value).replace(/[\\\\/]+$/, ""); + } + function refreshRootLabels(workspaces) { + var next = {}; + for (var i = 0; i < (workspaces || []).length; i++) { + var w = workspaces[i] || {}; + var mirror = normRemotePath(w.mirrorPath); + var remote = normRemotePath(w.remotePath); + if (!mirror || !remote) continue; + var title = normTitle(w.title); + var label = title || remote.split(/[\\\\/]/).pop(); + if (label) next[mirror] = { label: label, remotePath: remote, mirrorPath: mirror }; + } + rootLabels = next; + } + /** The root row's own full path, from the explicit attributes only. */ + function rootPathOf(el) { + var explicit = el && el.getAttribute ? el.getAttribute("data-rssh-root-mirror") : null; + if (explicit) return normRemotePath(explicit); + var title = el && el.getAttribute ? el.getAttribute("title") : null; + return title ? normRemotePath(title) : ""; + } + /** Direct leaf that prints the folder name (no nested markup). */ + function rootLabelSpanOf(el) { + var children = el && el.children ? el.children : []; + for (var i = 0; i < children.length; i++) { + if (String(children[i].tagName || "").toLowerCase() === "span" && children[i].childElementCount === 0) return children[i]; + } + return null; + } + /** Exact full-path hit → replace only the leaf name span. */ + function fixRootLabel(el) { + if (!el || !el.getAttribute) return false; + var path = rootPathOf(el); + if (!path) return false; + var hit = rootLabels[path]; + if (hit === undefined) return false; + var span = rootLabelSpanOf(el); + if (!span) return false; + var base = path.split(/[\\\\/]/).pop(); + var text = normTitle(span.textContent); + if (text !== base && el.getAttribute("data-rssh-root-label") !== "1") return false; + span.textContent = hit.label; + el.setAttribute("data-rssh-root-label", "1"); + el.setAttribute("data-rssh-root-mirror", hit.mirrorPath); + el.setAttribute("title", hit.remotePath); // 悬停可见完整远程路径 + watchRootLabel(el); + return true; + } + function watchRootLabel(el) { + for (var i = 0; i < watchedRootLabels.length; i++) { if (watchedRootLabels[i] === el) return; } + watchedRootLabels.push(el); + } + function recheckRootLabels() { + for (var i = watchedRootLabels.length - 1; i >= 0; i--) { + var el = watchedRootLabels[i]; + if (!el || !el.isConnected) { watchedRootLabels.splice(i, 1); continue; } + fixRootLabel(el); + } + } + function applyRootLabelsIn(root) { + if (!root || !root.querySelectorAll) return; + try { + // Only elements carrying the full path title are candidates; no + // text/basename or inline-style scan. + var nodes = root.querySelectorAll("[title]"); + for (var i = 0; i < nodes.length; i++) fixRootLabel(nodes[i]); + if (root.nodeType === 1) fixRootLabel(root); + } catch (e) {} + }` + +const occurrences = body.split(ROOT_LABEL_OLD).length - 1 +if (occurrences !== 1) throw new Error('remote-ssh client: root-label block anchor found ' + occurrences + ' times') +body = body.replace(ROOT_LABEL_OLD, ROOT_LABEL_NEW) + const out = header + '// --- merged-bundle transform (scripts/build-remote-ssh-client.mjs) ---\n' + '// Upstream registers this factory under its own package id; the merged\n' diff --git a/scripts/patch-remote-ssh.mjs b/scripts/patch-remote-ssh.mjs index f38aaf9..df12786 100644 --- a/scripts/patch-remote-ssh.mjs +++ b/scripts/patch-remote-ssh.mjs @@ -69,17 +69,20 @@ function expandRemoteHome(path, home) { } /** - * Resolve a remote path to its canonical absolute form via one SSH round - * trip (also learns the remote $HOME). Returns { canonical, home }; on any - * failure canonical falls back to the home-expanded light form and the - * caller proceeds exactly as upstream would (fail-open). + * Resolve a remote path to its canonical absolute identity through one SSH + * round trip (also learns the remote $HOME). Returns a discriminated result: + * ok:false is NOT "not a duplicate" — the caller must refuse to create + * because it cannot prove the path is distinct. */ async function resolveRemoteCanonical(subprocess, p, rawPath) { const light = lightRemotePath(rawPath); + if (!light) return { ok: false, error: "remotePath 为空", home: "" }; try { const cmd = "printf '__DSH_HOME__%s\\n' \\"$HOME\\"; cd " + shellQuotePath(light) + " 2>/dev/null && pwd -P"; const r = await runRemote(subprocess, p, cmd, undefined, 64 * 1024, undefined, 15000); - if (!r || !r.ok || !r.stdout) return { canonical: light, home: "" }; + if (!r || !r.ok) { + return { ok: false, error: String((r && (r.error || r.stderr)) || "SSH 解析失败").trim() || "SSH 解析失败", home: "" }; + } let home = ""; let resolved = ""; const lines = String(r.stdout).split("\\n"); @@ -88,10 +91,14 @@ async function resolveRemoteCanonical(subprocess, p, rawPath) { if (t.startsWith("__DSH_HOME__")) home = t.slice("__DSH_HOME__".length).trim(); else if (t.startsWith("/")) resolved = t; } - if (!resolved) return { canonical: expandRemoteHome(light, home), home: home }; - return { canonical: lightRemotePath(resolved), home: home }; + if (!resolved) { + // cd failed (missing directory / permission / shell error): identity is + // unknown, never silently treated as a new directory. + return { ok: false, error: "无法解析远端目录(不存在或不可访问):" + light, home: home }; + } + return { ok: true, canonical: lightRemotePath(resolved), home: home }; } catch (e) { - return { canonical: light, home: "" }; + return { ok: false, error: String(e && e.message ? e.message : e), home: "" }; } } @@ -143,20 +150,39 @@ if (typeof runRemote !== 'function' || typeof shellQuotePath !== 'function') { const FIND_ANCHOR = ' const existing = prefsNow.workspaces.find((w) => w && w.profileId === a.profileId && String(w.remotePath) === String(a.remotePath));' -const FIND_REPLACEMENT = ` // [workspace-groups-remote patch] Canonical-path reuse: compare - // light-normalized spellings first; on a miss, resolve once over SSH - // (fail-open) and compare canonical forms, so ~/x, x/ and the absolute - // form of one directory all reuse the existing record instead of - // registering a duplicate workspace + mirror. The stored spelling - // converges to the matched/canonical form below. - let existing = prefsNow.workspaces.find((w) => w && w.profileId === a.profileId && lightRemotePath(w.remotePath) === lightRemotePath(a.remotePath)); - if (existing) { - a.remotePath = lightRemotePath(a.remotePath); - } else { - const resolvedCanonical = await resolveRemoteCanonical(subprocess, p, a.remotePath); - a.remotePath = resolvedCanonical.canonical; - existing = prefsNow.workspaces.find((w) => w && w.profileId === a.profileId && expandRemoteHome(lightRemotePath(w.remotePath), resolvedCanonical.home) === resolvedCanonical.canonical); - }` +const FIND_REPLACEMENT = ` // [workspace-groups-remote patch] Canonical-path reuse: resolve the new + // spelling once over SSH and resolve every existing record of the same + // connection with the same rule (light form + remote $HOME + pwd -P), + // so relative/~, trailing-slash and symlink spellings converge on one + // directory identity. A resolution failure is NOT "not a duplicate": + // creation is refused with an actionable error instead of silently + // registering a second workspace. + const targetResolved = await resolveRemoteCanonical(subprocess, p, a.remotePath); + if (targetResolved.ok !== true) { + return { ok: false, error: "无法确认远端路径是否重复:" + targetResolved.error + ";未创建新工作区" }; + } + const sameProfile = prefsNow.workspaces.filter((w) => w && w.profileId === a.profileId && typeof w.remotePath === "string"); + let existing = undefined; + for (const record of sameProfile) { + const light = lightRemotePath(record.remotePath); + // Fast path: the spelling expands to exactly the resolved target. + if (expandRemoteHome(light, targetResolved.home) === targetResolved.canonical) { + existing = record; + break; + } + // Slow path: resolve the old record with the SAME rules. This catches + // relative paths, symlinks and historical spellings the old partial + // expansion missed. A failure aborts instead of assuming uniqueness. + const candidate = await resolveRemoteCanonical(subprocess, p, record.remotePath); + if (candidate.ok !== true) { + return { ok: false, error: "无法确认是否与已有远程工作区「" + String(record.title || record.id) + "」重复:" + candidate.error + ";未创建新工作区" }; + } + if (candidate.canonical === targetResolved.canonical) { + existing = record; + break; + } + } + a.remotePath = existing ? String(existing.remotePath) : targetResolved.canonical;` // Each entry: [label, anchor, replacement]. Anchors are exact byte strings // from the vendored file; every one must occur exactly once. @@ -324,6 +350,13 @@ const TRANSFORMS = [ " // name can no longer break out. (~ still expands remotely.)", " const b64 = (s) => Buffer.from(String(s), 'utf8').toString('base64');", " const expanded = remotePath === '~' ? '$HOME' : (remotePath.indexOf('~/') === 0 ? '$HOME/$(printf %s \\\\'' + b64(remotePath.slice(2)) + '\\\\' | base64 -d)' : '$(printf %s \\\\'' + b64(remotePath) + '\\\\' | base64 -d)');",`], + ['patch 12: reusing a record keeps its existing title', + ' const lastSeg = String(a.remotePath).replace(/\\/+$/, "").split("/").pop();\n const title = a.title || (lastSeg && lastSeg !== "~" ? lastSeg : (p.name + ":" + a.remotePath));', + ` // [workspace-groups-remote patch] Reuse keeps the user's existing + // title; only a new record (or an explicit a.title) derives one from + // the path. Otherwise "reuse" could silently rename a custom workspace. + const lastSeg = String(a.remotePath).replace(/\\/+$/, "").split("/").pop(); + const title = a.title || (existing && existing.title) || (lastSeg && lastSeg !== "~" ? lastSeg : (p.name + ":" + a.remotePath));`], ] function countOccurrences(text, needle) { @@ -351,11 +384,11 @@ function applyPatch(source) { // Post-conditions: the vulnerable code forms must be gone, the fixed // forms present. (A historical comment mentioning StrictHostKeyChecking=no // remains in the source; only the executable code form is asserted here.) - const gone = ['head.concat(opts, [target])', '["sshpass", "-p"', "'StrictHostKeyChecking=no', '-o', 'ExitOnForwardFailure=no'"] + const gone = ['head.concat(opts, [target])', '["sshpass", "-p"', "'StrictHostKeyChecking=no', '-o', 'ExitOnForwardFailure=no'", 'lightRemotePath(w.remotePath) === lightRemotePath(a.remotePath)'] for (const bad of gone) { if (out.includes(bad)) throw new Error('patch-remote-ssh: vulnerable form still present after patching: ' + bad) } - const present = ['resolveRemoteCanonical', 'head.concat(opts, ["--", target])', '"sshpass", "-e"', 'StrictHostKeyChecking=accept-new', 'inMirrorRoot', 'base64 -d', 'foldedParts', '写回护栏无法确认,本次不推送', 'upstream internals changed (runRemote / shellQuotePath not found)', 'findEscapingLink', 'renameSync(tmpFile, file)', "%s %Y %N", 'startsWith(prev + ".")', 'foldCase', 'dirname(dir) === join(homedir()'] + const present = ['resolveRemoteCanonical', 'targetResolved.ok', '无法确认远端路径是否重复', 'existing && existing.title', 'head.concat(opts, ["--", target])', '"sshpass", "-e"', 'StrictHostKeyChecking=accept-new', 'inMirrorRoot', 'base64 -d', 'foldedParts', '写回护栏无法确认,本次不推送', 'upstream internals changed (runRemote / shellQuotePath not found)', 'findEscapingLink', 'renameSync(tmpFile, file)', "%s %Y %N", 'startsWith(prev + ".")', 'foldCase', 'dirname(dir) === join(homedir()'] for (const good of present) { if (!out.includes(good)) throw new Error('patch-remote-ssh: expected patched form missing: ' + good) } diff --git a/scripts/test-remote-ssh-patch.mjs b/scripts/test-remote-ssh-patch.mjs index c62e138..d5efb83 100644 --- a/scripts/test-remote-ssh-patch.mjs +++ b/scripts/test-remote-ssh-patch.mjs @@ -85,6 +85,7 @@ const lightRemotePath = new Function(grabFunction('lightRemotePath') + '\nreturn const expandRemoteHome = new Function(grabFunction('expandRemoteHome') + '\nreturn expandRemoteHome;')() const HOME = '/home/u' +const SYMLINKS = { '/home/u/link': '/srv/real' } let sshCalls = 0 let sshFails = false function fakeRunRemote(subprocess, p, cmd) { @@ -95,7 +96,8 @@ function fakeRunRemote(subprocess, p, cmd) { let target = m ? m[1].trim() : '' if (target.startsWith('~/')) target = target.slice(2).replace(/^'(.*)'$/, '$1') else target = target.replace(/^'(.*)'$/, '$1') - const resolved = (target.startsWith('/') ? target : HOME + '/' + target).replace(/\/+$/, '') + const absolute = (target.startsWith('/') ? target : HOME + '/' + target).replace(/\/+$/, '') + const resolved = SYMLINKS[absolute] || absolute return Promise.resolve({ ok: true, stdout: '__DSH_HOME__' + HOME + '\n' + resolved + '\n' }) } const resolveRemoteCanonical = new Function('shellQuotePath', 'runRemote', 'lightRemotePath', 'expandRemoteHome', @@ -113,10 +115,10 @@ check(expandRemoteHome('~/proj', '') === '~/proj', 'expand: no home, untouched') console.log('resolveRemoteCanonical') { const r = await resolveRemoteCanonical({}, {}, '~/proj/') - check(r.canonical === '/home/u/proj' && r.home === HOME, 'resolves ~/proj/ to the absolute canonical path') + check(r.ok === true && r.canonical === '/home/u/proj' && r.home === HOME, 'resolves ~/proj/ to the absolute canonical path') sshFails = true const f = await resolveRemoteCanonical({}, {}, '~/proj') - check(f.canonical === '~/proj' && f.home === '', 'SSH failure is fail-open (light form, no home)') + check(f.ok === false && /stubbed failure/.test(f.error), 'SSH failure is fail-closed (no canonical fallback)') sshFails = false } @@ -183,19 +185,38 @@ console.log('createRemoteWorkspace (patched)') const r = await handler({ profileId: 'prof-1', remotePath: '/home/u/proj/' }) check(r.ok === true && r.reused === true && state.workspaces.length === 1, 'E: trailing-slash variant reuses') } +{ + const { face, state } = fakeSettings([{ ...seedRecord, remotePath: 'proj' }]) + const handler = makeHandler(face) + const r = await handler({ profileId: 'prof-1', remotePath: '~/proj/' }) + check(r.ok === true && r.reused === true && state.workspaces.length === 1, 'H: relative record spelling resolves to the same directory') +} +{ + const { face, state } = fakeSettings([{ ...seedRecord, remotePath: '/home/u/link' }]) + const handler = makeHandler(face) + const r = await handler({ profileId: 'prof-1', remotePath: '/srv/real' }) + check(r.ok === true && r.reused === true && state.workspaces.length === 1, 'I: symlink and pwd -P form count as one directory') +} +{ + const { face, state } = fakeSettings([{ ...seedRecord, profileId: 'prof-2' }]) + const handler = makeHandler(face) + const r = await handler({ profileId: 'prof-1', remotePath: '/home/u/proj' }) + check(r.ok === true && r.reused === false && state.workspaces.length === 2, 'J: same path on another connection is not merged') +} { const { face, state } = fakeSettings([seedRecord]) const handler = makeHandler(face) sshFails = true const r = await handler({ profileId: 'prof-1', remotePath: '/home/u/proj' }) sshFails = false - check(r.ok === true && state.workspaces.length === 2, 'D: with SSH down the create still succeeds (fail-open, upstream behavior)') + check(r.ok === false && /无法确认远端路径是否重复/.test(String(r.error)), 'D: SSH down refuses creation instead of silently duplicating') + check(state.workspaces.length === 1, 'D: no second record is written when identity cannot be confirmed') } // --- sshArgv hardening (patch 2) ------------------------------------------- const sshArgv = new Function('sshExecutablePath', 'expandSshPath', 'ensureWindowsAskpass', - grabFunction('sshArgv') + '\nreturn sshArgv;')(() => 'ssh', (x) => x, () => { throw new Error('win32 only') }) + grabFunction('sshArgv') + '\nreturn sshArgv;')(() => 'ssh', (x) => x, () => ({ ascii: true, file: 'C:/tmp/askpass.cmd' })) console.log('sshArgv (patched)') { @@ -210,9 +231,14 @@ console.log('sshArgv (patched)') } { const { argv, env } = sshArgv({ user: 'u', host: 'h', port: 22, authMethod: 'password', password: 's3cret-value' }, undefined, false) - check(argv[0] === 'sshpass' && argv[1] === '-e', 'G: POSIX password auth uses sshpass -e') + if (process.platform === 'win32') { + check(!argv.includes('sshpass'), 'G: Windows password auth does not use sshpass') + check(env !== undefined && env.SSH_ASKPASS === 'C:/tmp/askpass.cmd' && env.RSSH_ASKPASS_PW === 's3cret-value', 'G: Windows password travels via SSH_ASKPASS env') + } else { + check(argv[0] === 'sshpass' && argv[1] === '-e', 'G: POSIX password auth uses sshpass -e') + check(env !== undefined && env.SSHPASS === 's3cret-value', 'G: password travels via the SSHPASS env var') + } check(!argv.some(a => String(a).includes('s3cret-value')), 'G: password is not in argv') - check(env !== undefined && env.SSHPASS === 's3cret-value', 'G: password travels via the SSHPASS env var') } // --- terminal wrapper (patch 3) ---------------------------------------------- @@ -226,6 +252,9 @@ function extractWrapperSource() { return new Function('return (' + arrayText + ')')().join('\n') } +if (process.platform === 'win32') { + console.log('terminal wrapper (patched): skipped on win32 (POSIX /bin/sh fixtures)') +} else { console.log('terminal wrapper (patched)') { const sandbox = mkdtempSync(join(tmpdir(), 'wg-remote-wrapper-')) @@ -278,6 +307,7 @@ console.log('terminal wrapper (patched)') const out = spawnSync('bash', ['-c', remoteCmd2], { env: { ...baseEnv, SHELL: join(binDir, 'fakeshell') }, encoding: 'utf8' }) check(out.stdout.trim().endsWith(weird), 'W4: weird-but-legit path lands in the right directory') } +} console.log('localToRemote dot-segment folding') { @@ -329,10 +359,19 @@ console.log('freshness: nanosecond stamps + legacy tolerance + escaping links') try { mkdirSync(join(tree, 'sub'), { recursive: true }) writeFileSync(join(tree, 'sub', 'f.txt'), 'x') - symlinkSync(join(tree, 'sub', 'f.txt'), join(tree, 'inner-link')) - check(findEscapingLink(tree) === null, 'F6: an in-tree symlink is fine') - symlinkSync('/etc', join(tree, 'sub', 'escape-link')) - check(String(findEscapingLink(tree)).endsWith('escape-link'), 'F7: a symlink escaping the tree is found') + let linksAvailable = true + try { + symlinkSync(join(tree, 'sub', 'f.txt'), join(tree, 'inner-link')) + } catch (error) { + if (error?.code !== 'EPERM') throw error + linksAvailable = false + console.log(' skip F6/F7: symlink creation not permitted in this environment') + } + if (linksAvailable) { + check(findEscapingLink(tree) === null, 'F6: an in-tree symlink is fine') + symlinkSync('/etc', join(tree, 'sub', 'escape-link')) + check(String(findEscapingLink(tree)).endsWith('escape-link'), 'F7: a symlink escaping the tree is found') + } } finally { rmSync(tree, { recursive: true, force: true }) } diff --git a/scripts/verify-bundle.mjs b/scripts/verify-bundle.mjs index 1dd4bba..0007486 100644 --- a/scripts/verify-bundle.mjs +++ b/scripts/verify-bundle.mjs @@ -8,7 +8,7 @@ // 4. cordis.patch.yml carries the single insert row plus remote-ssh's two // shell overrides (better-sidebar / terminal-controller). import { readFileSync } from 'node:fs' -import { fileURLToPath } from 'node:url' +import { fileURLToPath, pathToFileURL } from 'node:url' import { dirname, join } from 'node:path' import vm from 'node:vm' import { checkVendorManifest } from './vendor-manifest.mjs' @@ -18,7 +18,7 @@ const pkg = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')) let failures = 0 const check = (label, ok) => { console.log(`${ok ? '✓' : '✗ FAIL'} ${label}`); if (!ok) failures++ } -const host = await import(join(root, 'lib/index.js')) +const host = await import(pathToFileURL(join(root, 'lib/index.js')).href) check('host name is the package name', host.name === pkg.name) check('host exports the remote-ssh Config at top level (owns the settings entry)', !!host.Config) check('host inject is the union', JSON.stringify(host.inject) === JSON.stringify(['webServer', 'subprocess', 'tools', 'workspaceRegistry'])) @@ -42,7 +42,7 @@ check('client contains the remote-ssh half', client.includes('remssh')) const remoteHost = readFileSync(join(root, 'lib/remote-ssh/index.js'), 'utf8') const vendorHost = readFileSync(join(root, 'vendor/dsh-remote-ssh/lib/index.js'), 'utf8') -check('remote-ssh host artifact carries the canonical-path patch', remoteHost.includes('resolveRemoteCanonical') && remoteHost.includes('lightRemotePath(w.remotePath) === lightRemotePath(a.remotePath)')) +check('remote-ssh host artifact carries the canonical-path patch', remoteHost.includes('resolveRemoteCanonical') && remoteHost.includes('targetResolved.ok') && remoteHost.includes('无法确认远端路径是否重复')) check('vendored upstream host stays pristine', !vendorHost.includes('resolveRemoteCanonical')) check('remote-ssh host artifact carries the ssh hardening patches', remoteHost.includes('head.concat(opts, ["--", target])') && remoteHost.includes('"sshpass", "-e"') && remoteHost.includes('inMirrorRoot')) check('remote-ssh host artifact has no vulnerable code forms', !remoteHost.includes('["sshpass", "-p"') && !remoteHost.includes("'StrictHostKeyChecking=no', '-o', 'ExitOnForwardFailure=no'")) diff --git a/src/client/GroupsBrowser.tsx b/src/client/GroupsBrowser.tsx index 73dfed3..85bcdee 100644 --- a/src/client/GroupsBrowser.tsx +++ b/src/client/GroupsBrowser.tsx @@ -358,10 +358,18 @@ export function GroupsBrowser({ // ---- Per-workspace folders (multi-root) ------------------------------------- // // A second host sidecar (`/workspace-groups/folders`) lists each workspace's - // extra folders plus the optional root folder. It is read once per mount and - // written back whole, like the manual overlay above; a failed write is a - // toast rather than a banner because every edit here is a one-off row action. + // extra folders plus the optional root folder. Reads carry an explicit + // loading/ready/error phase: an HTTP failure must never be rendered as "no + // folders", because that makes every member reappear as a duplicate row. const [foldersDoc, setFoldersDoc] = useState(EMPTY_FOLDERS_DOCUMENT) + const [foldersPhase, setFoldersPhase] = useState<'loading' | 'ready' | 'error'>('loading') + const [foldersError, setFoldersError] = useState(null) + const [foldersRetryToken, setFoldersRetryToken] = useState(0) + const [foldersConflict, setFoldersConflict] = useState<{ current: FoldersDocument; draft: FoldersDocument } | null>(null) + const foldersConfirmedRef = useRef(EMPTY_FOLDERS_DOCUMENT) + const foldersHasDataRef = useRef(false) + const foldersPendingRef = useRef(null) + const foldersSavingRef = useRef(false) // Folder collapse is component state, not store state: it is a transient view // of the row list, like the quick panel, so it is deliberately NOT persisted // with the category/workspace expansion keys. Folders start expanded, so @@ -378,13 +386,53 @@ export function GroupsBrowser({ const [foldersRemoteBase, setFoldersRemoteBase] = useState(null) useEffect(() => { let cancelled = false - void loadFolders().then((snapshot) => { + const controller = new AbortController() + let timer: ReturnType | null = null + let retries = 0 + const attempt = async (): Promise => { + const snapshot = await loadFolders(fetch, controller.signal) if (cancelled) return - setFoldersDoc(snapshot.document) - setFoldersRemoteBase(snapshot.remoteBase ?? null) - }) - return () => { cancelled = true } - }, []) + if (snapshot.error === 'aborted') return + if (snapshot.ok) { + foldersConfirmedRef.current = snapshot.document + foldersHasDataRef.current = true + setFoldersDoc(snapshot.document) + setFoldersRemoteBase(snapshot.remoteBase ?? null) + setFoldersPhase('ready') + setFoldersError(null) + return + } + const reason = snapshot.error ?? 'unknown error' + if (foldersHasDataRef.current) { + // Keep the last confirmed rows and mark the refresh as failed; never + // replace them with an empty document. + setFoldersPhase('ready') + setFoldersError(reason) + } else { + setFoldersPhase('error') + setFoldersError(reason) + } + // Bounded exponential backoff (1s, 2s, 4s, 8s, 15s). The timer is + // cancelled on unmount; an online event or the Retry button resets it. + if (retries < 5) { + const delay = Math.min(15_000, 1_000 * 2 ** retries) + retries += 1 + timer = setTimeout(() => { void attempt() }, delay) + } + } + void attempt() + const onOnline = (): void => { + retries = 0 + void attempt() + } + window.addEventListener('online', onOnline) + return () => { + cancelled = true + controller.abort() + if (timer !== null) clearTimeout(timer) + window.removeEventListener('online', onOnline) + } + }, [foldersRetryToken]) const workspaces = useWorkspaces(state => state.items) const workspacePhase = useWorkspaces(state => state.phase) @@ -775,22 +823,68 @@ export function GroupsBrowser({ setFolderError({ id: Date.now(), text }) } - const persistFolders = (next: FoldersDocument): void => { - setFoldersDoc(next) - saveFolders(next).then((stored) => { - setFoldersDoc(stored) - }).catch((reason: unknown) => { - if (reason instanceof FoldersConflictError) { - // Another window wrote first: adopt the host's current document so - // the tree shows what is actually stored, and say the edit did not - // land instead of leaving a phantom row behind. - setFoldersDoc(reason.current) - notifyFolder(t('folder.conflict')) - return + /** + * Serialize folder saves. A save always sends the LAST confirmed revision and + * the latest pending document; a newer edit made while a request is in flight + * is coalesced and sent only after the previous result settles. This keeps an + * older response from ever overwriting a newer state. + */ + const drainFolders = async (): Promise => { + if (foldersSavingRef.current) return + foldersSavingRef.current = true + try { + while (foldersPendingRef.current !== null) { + const draft = foldersPendingRef.current + foldersPendingRef.current = null + const payload: FoldersDocument = { + ...draft, + revision: foldersConfirmedRef.current.revision ?? 0, + } + try { + const stored = await saveFolders(payload) + foldersConfirmedRef.current = stored + setFoldersError(null) + if (foldersPendingRef.current === null) setFoldersDoc(stored) + } catch (reason) { + if (reason instanceof FoldersConflictError) { + // Keep the server state visible AND remember the user's unsaved + // draft; never silently overwrite the draft or claim success. + foldersConfirmedRef.current = reason.current + setFoldersDoc(reason.current) + setFoldersConflict({ current: reason.current, draft: reason.attempted ?? draft }) + notifyFolder(t('folder.conflict')) + } else { + const detail = reason instanceof Error ? reason.message : String(reason) + setFoldersDoc(foldersConfirmedRef.current) + notifyFolder(`${t('folder.saveError')}: ${detail}`) + } + // A failed base makes every queued follow-up stale; stop here and let + // the user retry the draft explicitly. + foldersPendingRef.current = null + break + } } - const detail = reason instanceof Error ? reason.message : String(reason) - notifyFolder(`${t('folder.saveError')}: ${detail}`) - }) + } finally { + foldersSavingRef.current = false + if (foldersPendingRef.current !== null) void drainFolders() + } + } + + const persistFolders = (next: FoldersDocument): void => { + if (foldersPhase !== 'ready') { + notifyFolder(t('folder.notReady')) + return + } + foldersPendingRef.current = next + setFoldersDoc(next) + void drainFolders() + } + + const retryFolderConflict = (): void => { + if (foldersConflict === null) return + const draft = foldersConflict.draft + setFoldersConflict(null) + persistFolders({ ...draft, revision: foldersConflict.current.revision ?? 0 }) } /** @@ -1802,13 +1896,47 @@ export function GroupsBrowser({ )}
+ {foldersPhase === 'loading' && ( +
{t('folder.loadingState')}
+ )} + {foldersPhase === 'error' && ( +
+ {t('folder.loadError')}:{foldersError} + {' '} + +
+ )} + {foldersPhase === 'ready' && foldersError !== null && ( +
+ {t('folder.refreshError')}:{foldersError} + {' '} + +
+ )} + {foldersConflict !== null && ( +
+
{t('folder.conflictDetail')}
+
+ server revision {foldersConflict.current.revision ?? 0} · draft revision {foldersConflict.draft.revision ?? 0} +
+
+ + {' '} + +
+
+ )} {configError !== null && (
{t('configUnavailable')}
)} {manualError !== null && (
{t('manual.saveError')}: {manualError}
)} - {wide && normalizedQuery !== '' && searchTreeForBody !== undefined && searchMatches !== undefined ? ( + {foldersPhase !== 'ready' ? null : wide && normalizedQuery !== '' && searchTreeForBody !== undefined && searchMatches !== undefined ? ( { +export async function loadFolders( + fetchImpl: typeof fetch = fetch, + signal?: AbortSignal, +): Promise { try { const response = await fetchImpl(FOLDERS_ROUTE, { method: 'GET', // Folders are user state; a cached response would show stale rows. cache: 'no-store', + ...(signal === undefined ? {} : { signal }), }) - if (!response.ok) return { document: EMPTY_FOLDERS_DOCUMENT } + if (!response.ok) { + return { ok: false, document: EMPTY_FOLDERS_DOCUMENT, error: `HTTP ${response.status}` } + } const body: unknown = await response.json() - if (typeof body !== 'object' || body === null) return { document: EMPTY_FOLDERS_DOCUMENT } + if (typeof body !== 'object' || body === null) { + return { ok: false, document: EMPTY_FOLDERS_DOCUMENT, error: '响应不是 JSON 对象' } + } const source = body as Record const remoteBase = typeof source.remoteBase === 'string' && source.remoteBase.trim() !== '' ? source.remoteBase.trim() : undefined const base = remoteBase === undefined ? {} : { remoteBase } const document = parseWireDocument(source) - return { document: document ?? EMPTY_FOLDERS_DOCUMENT, ...base } - } catch { - return { document: EMPTY_FOLDERS_DOCUMENT } + if (document === null) { + return { ok: false, document: EMPTY_FOLDERS_DOCUMENT, ...base, error: '文件夹文档格式无效' } + } + return { ok: true, document, ...base } + } catch (error) { + if (signal?.aborted === true) { + return { ok: false, document: EMPTY_FOLDERS_DOCUMENT, error: 'aborted' } + } + return { + ok: false, + document: EMPTY_FOLDERS_DOCUMENT, + error: error instanceof Error ? error.message : String(error), + } } } @@ -162,10 +195,13 @@ export function parseWireDocument(source: Record): FoldersDocum */ export class FoldersConflictError extends Error { readonly current: FoldersDocument - constructor(current: FoldersDocument) { + /** The unsaved document the failed PUT attempted to write. */ + readonly attempted: FoldersDocument + constructor(current: FoldersDocument, attempted: FoldersDocument = current) { super('folder overlay changed in another window') this.name = 'FoldersConflictError' this.current = current + this.attempted = attempted } } @@ -196,7 +232,7 @@ export async function saveFolders( const current = typeof body === 'object' && body !== null ? parseWireDocument(body as Record) : null - throw new FoldersConflictError(current ?? EMPTY_FOLDERS_DOCUMENT) + throw new FoldersConflictError(current ?? EMPTY_FOLDERS_DOCUMENT, document) } if (!response.ok) throw new Error(`PUT ${FOLDERS_ROUTE}: ${response.status}`) // Adopt the host's echo: it is the normalized document (with the bumped diff --git a/src/client/locales.ts b/src/client/locales.ts index 0cf5654..7f56797 100644 --- a/src/client/locales.ts +++ b/src/client/locales.ts @@ -96,6 +96,13 @@ export type WorkspaceGroupsKey = | 'folder.home' | 'folder.refresh' | 'folder.loading' + | 'folder.loadingState' + | 'folder.loadError' + | 'folder.refreshError' + | 'folder.retry' + | 'folder.retryDraft' + | 'folder.discardDraft' + | 'folder.conflictDetail' | 'folder.emptyDir' | 'group.create' | 'group.createTitle' @@ -281,6 +288,13 @@ export const zh: WorkspaceGroupsDict = { 'folder.home': '主目录', 'folder.refresh': '刷新', 'folder.loading': '正在读取远端目录…', + 'folder.loadingState': '正在读取文件夹配置…', + 'folder.loadError': '文件夹配置读取失败(未显示为空分组)', + 'folder.refreshError': '文件夹配置刷新失败,继续显示上次确认的配置', + 'folder.retry': '重试', + 'folder.retryDraft': '重新应用我的修改', + 'folder.discardDraft': '保留服务端版本', + 'folder.conflictDetail': '文件夹已被另一个窗口修改:下面是服务端当前版本;你未保存的修改仍保留在此处,可重新应用。', 'folder.emptyDir': '这个目录下没有子目录', 'group.create': '新建分组', 'group.createTitle': '新建分组', @@ -465,6 +479,13 @@ export const en: WorkspaceGroupsDict = { 'folder.home': 'Home', 'folder.refresh': 'Refresh', 'folder.loading': 'Reading the remote directory…', + 'folder.loadingState': 'Reading folder configuration…', + 'folder.loadError': 'Could not read folder configuration (not shown as an empty grouping)', + 'folder.refreshError': 'Could not refresh folder configuration; showing the last confirmed state', + 'folder.retry': 'Retry', + 'folder.retryDraft': 'Reapply my changes', + 'folder.discardDraft': 'Keep server version', + 'folder.conflictDetail': 'Folders changed in another window. The server version is shown below; your unsaved changes are kept here and can be reapplied.', 'folder.emptyDir': 'No subdirectories here', 'group.create': 'New group', 'group.createTitle': 'New group', diff --git a/src/client/remote-ssh-factory.generated.mjs b/src/client/remote-ssh-factory.generated.mjs index 0707caf..7f4b3e3 100644 --- a/src/client/remote-ssh-factory.generated.mjs +++ b/src/client/remote-ssh-factory.generated.mjs @@ -1714,54 +1714,60 @@ export default (require) => { } } catch (e) {} - // ---- 文件树根标签:显示远程目录名,而不是本地镜像目录 ID(issue #9)---- - // better-sidebar「文件」页签的树根标签取自会话 cwd(= 本地镜像路径)的 basename, - // 于是显示成镜像目录 ID(如 wmirror3)。这条链路不经过任何 fs.* 路由, - // 而 Host 侧 session.cwd 虽然已返回 root 字段,客户端只消费 cwd - // (client-registry 的 api.sessionCwd(...).then(r => setFetchedCwd(r.cwd)), - // 另有 useSessionCwd 直接读客户端会话列表的 cwd),因此只能在渲染层替换文本。 - // 定位不依赖构建期哈希类名:根行是树里唯一带内联 padding-left:6px 的行, - // 仅当该行内的纯文本节点 === 某远程工作区的镜像 basename 时才替换(幂等、可自愈)。 + // ---- 文件树根标签:按完整镜像路径精确认行(issue #9)---- + // better-sidebar 的根行 title 是完整目录路径(RootRow title={path})。 + // 只在该 title 精确等于某个远程工作区的 mirrorPath 时才改写名称:不再 + // 按 basename 或内联 padding-left 猜测目录身份,因此同名本地目录不会 + // 被误改;属性缺席时保持原样(安全降级)。 var watchedRootLabels = []; // 已替换的标签元素:1s 幂等复检,抵消 React 重渲染 + var rootLabels = {}; + function normRemotePath(value) { + return String(value == null ? "" : value).replace(/[\\/]+$/, ""); + } function refreshRootLabels(workspaces) { var next = {}; for (var i = 0; i < (workspaces || []).length; i++) { var w = workspaces[i] || {}; - var mirror = String(w.mirrorPath || "").replace(/[\\/]+$/, ""); - var remote = String(w.remotePath || "").replace(/[\\/]+$/, ""); + var mirror = normRemotePath(w.mirrorPath); + var remote = normRemotePath(w.remotePath); if (!mirror || !remote) continue; - var mb = mirror.split(/[\\/]/).pop(); - var rb = remote.split(/[\\/]/).pop(); - if (mb && rb && mb !== rb) next[mb] = { label: rb, remotePath: remote }; + var title = normTitle(w.title); + var label = title || remote.split(/[\\/]/).pop(); + if (label) next[mirror] = { label: label, remotePath: remote, mirrorPath: mirror }; } rootLabels = next; } - /** 根行判据:自身或 ≤3 层祖先带内联 padding-left:6px(better-sidebar 根行样式)。 */ - function isRootRow(el) { - var node = el; - for (var hop = 0; hop < 3 && node; hop++) { - var style = node.getAttribute ? node.getAttribute("style") : null; - if (style && /padding-left:\s*6px/i.test(String(style))) return true; - node = node.parentElement; - } - return false; + /** The root row's own full path, from the explicit attributes only. */ + function rootPathOf(el) { + var explicit = el && el.getAttribute ? el.getAttribute("data-rssh-root-mirror") : null; + if (explicit) return normRemotePath(explicit); + var title = el && el.getAttribute ? el.getAttribute("title") : null; + return title ? normRemotePath(title) : ""; } - /** 单个标签替换:纯文本 + 命中镜像 basename + 位于根行 → 换成远程目录名。 */ + /** Direct leaf that prints the folder name (no nested markup). */ + function rootLabelSpanOf(el) { + var children = el && el.children ? el.children : []; + for (var i = 0; i < children.length; i++) { + if (String(children[i].tagName || "").toLowerCase() === "span" && children[i].childElementCount === 0) return children[i]; + } + return null; + } + /** Exact full-path hit → replace only the leaf name span. */ function fixRootLabel(el) { - var text = (el.textContent || "").trim(); - if (!text) return false; - var hit = rootLabels[text]; - if (hit === undefined) { - // 文本已是远程目录名(上一轮替换过)→ 幂等成功;否则与本插件无关 - return el.getAttribute && el.getAttribute("data-rssh-root-label") === "1"; - } - if (el.childElementCount > 0) return false; // 只改纯文本节点 - if (!isRootRow(el)) return false; // 非根行(例如同名子条目)不动 - el.textContent = hit.label; - if (el.setAttribute) { - el.setAttribute("data-rssh-root-label", "1"); - el.setAttribute("title", hit.remotePath); // 悬停可见完整远程路径 - } + if (!el || !el.getAttribute) return false; + var path = rootPathOf(el); + if (!path) return false; + var hit = rootLabels[path]; + if (hit === undefined) return false; + var span = rootLabelSpanOf(el); + if (!span) return false; + var base = path.split(/[\\/]/).pop(); + var text = normTitle(span.textContent); + if (text !== base && el.getAttribute("data-rssh-root-label") !== "1") return false; + span.textContent = hit.label; + el.setAttribute("data-rssh-root-label", "1"); + el.setAttribute("data-rssh-root-mirror", hit.mirrorPath); + el.setAttribute("title", hit.remotePath); // 悬停可见完整远程路径 watchRootLabel(el); return true; } @@ -1779,7 +1785,9 @@ export default (require) => { function applyRootLabelsIn(root) { if (!root || !root.querySelectorAll) return; try { - var nodes = root.querySelectorAll("span,div"); + // Only elements carrying the full path title are candidates; no + // text/basename or inline-style scan. + var nodes = root.querySelectorAll("[title]"); for (var i = 0; i < nodes.length; i++) fixRootLabel(nodes[i]); if (root.nodeType === 1) fixRootLabel(root); } catch (e) {} diff --git a/src/client/styles.css b/src/client/styles.css index 8017010..965f793 100644 --- a/src/client/styles.css +++ b/src/client/styles.css @@ -3,6 +3,8 @@ flex-direction:column; flex:1; width:100%; + height:100%; + max-height:100%; min-width:0; min-height:0; display:flex; @@ -705,6 +707,22 @@ word-break:break-word; } +.wgSmallAction { + border:1px solid var(--dsw-border-1,#7f7f7f55); + border-radius:4px; + background:transparent; + color:inherit; + font:inherit; + font-size:10.5px; + line-height:1; + padding:3px 6px; + cursor:pointer; +} + +.wgSmallAction:hover { + border-color:var(--dsw-accent,#4c8dff); +} + .wgRail { flex-direction:column; align-items:center; diff --git a/src/client/tree.ts b/src/client/tree.ts index 08c4c33..ee0f50b 100644 --- a/src/client/tree.ts +++ b/src/client/tree.ts @@ -364,12 +364,18 @@ function memberFolderLabels(entry: WorkspaceFolderEntry | undefined): Map | undefined, ): { sessions: readonly SessionNode[]; folders?: readonly FolderNode[] } { const labels = memberFolderLabels(entry) + // The base row shows the project's confirmed display title (custom name or + // remote directory name) instead of the local mirror basename. The path + // remains the directory identity for file access; only the LABEL changes. + const title = workspaceTitle.trim() + if (title !== '') labels.set(workspacePath, title) const extras = effectiveFolders(workspacePath, entry).slice(1) if (extras.length === 0) return { sessions } const root = rootOf(workspacePath, entry) @@ -492,6 +498,7 @@ export function deriveGroups( const partitioned = applyFolders( workspace.workspaceId, workspace.path, + workspace.title, sessions, list, entryFor(folders, workspace.workspaceId as string), @@ -568,6 +575,7 @@ export function deriveTopLevel( const partitioned = applyFolders( workspace.workspaceId, workspace.path, + workspace.title, sessions, list, entryFor(folders, workspaceId), @@ -627,6 +635,7 @@ export function deriveDefaultWorkspace( const partitioned = applyFolders( workspace.workspaceId, workspace.path, + workspace.title, sessions, list, entryFor(folders, workspace.workspaceId as string), @@ -819,6 +828,7 @@ export function deriveSearchGroups( const partitioned = applyFolders( workspace.workspaceId, workspace.path, + workspace.title, nodes, list, entryFor(folders, workspace.workspaceId as string), diff --git a/tests/folders-persist.test.ts b/tests/folders-persist.test.ts index 8b15f3f..b942cd8 100644 --- a/tests/folders-persist.test.ts +++ b/tests/folders-persist.test.ts @@ -22,10 +22,21 @@ function stubFetch(status: number, body: unknown, capture?: (url: string, init?: describe('loadFolders revision', () => { it('carries the stored revision, defaulting an absent one to 0', async () => { const withRevision = await loadFolders(stubFetch(200, { version: 1, revision: 7, workspaces: {} })) + expect(withRevision.ok).toBe(true) expect(withRevision.document.revision).toBe(7) const without = await loadFolders(stubFetch(200, { version: 1, workspaces: {} })) + expect(without.ok).toBe(true) expect(without.document.revision).toBe(0) }) + + it('does not turn HTTP 503 or malformed JSON into a successful empty document', async () => { + const unavailable = await loadFolders(stubFetch(503, {})) + expect(unavailable.ok).toBe(false) + expect(unavailable.error).toContain('503') + const malformed = await loadFolders(stubFetch(200, { version: 2, workspaces: {} })) + expect(malformed.ok).toBe(false) + expect(malformed.error).toContain('格式无效') + }) }) describe('saveFolders', () => { @@ -36,9 +47,11 @@ describe('saveFolders', () => { }) it('rejects with FoldersConflictError carrying the current document on 409', async () => { const current = { version: 1, revision: 5, workspaces: {} } - const failure = await saveFolders({ version: 1, revision: 2, workspaces: {} }, stubFetch(409, current)).catch((e: unknown) => e) + const attempted = { version: 1, revision: 2, workspaces: { a: { folders: ['/x'] } } } + const failure = await saveFolders(attempted, stubFetch(409, current)).catch((e: unknown) => e) expect(failure).toBeInstanceOf(FoldersConflictError) expect((failure as FoldersConflictError).current).toEqual(current) + expect((failure as FoldersConflictError).attempted).toEqual(attempted) }) }) diff --git a/tests/folders.test.ts b/tests/folders.test.ts index c6e33a7..876458b 100644 --- a/tests/folders.test.ts +++ b/tests/folders.test.ts @@ -429,7 +429,9 @@ describe('folders revision guard (route)', () => { } as unknown as ServerResponse) return { status, text } } - const first = { version: 1, revision: 0, workspaces: { a: { folders: ['/x'] } } } + const rootA = process.platform === 'win32' ? 'C:\\x' : '/x' + const rootB = process.platform === 'win32' ? 'C:\\y' : '/y' + const first = { version: 1, revision: 0, workspaces: { a: { folders: [rootA] } } } const accepted = await request('PUT', JSON.stringify(first)) expect(accepted.status).toBe(200) expect(JSON.parse(accepted.text!)).toEqual({ ...first, revision: 1 }) @@ -438,7 +440,7 @@ describe('folders revision guard (route)', () => { expect(stale.status).toBe(409) expect(JSON.parse(stale.text!)).toEqual({ ...first, revision: 1 }) // Building on the current revision works and bumps again. - const second = { version: 1, revision: 1, workspaces: { a: { folders: ['/x', '/y'] } } } + const second = { version: 1, revision: 1, workspaces: { a: { folders: [rootA, rootB] } } } const accepted2 = await request('PUT', JSON.stringify(second)) expect(accepted2.status).toBe(200) expect(JSON.parse(accepted2.text!).revision).toBe(2) @@ -468,26 +470,31 @@ describe('folders revision (validation + tolerant read)', () => { describe('write-boundary hardening (dot segments, __proto__, UNC hints)', () => { it('validateFoldersDocument rejects dot segments in folder and member paths', () => { + const badFolder = process.platform === 'win32' ? 'C:\\x\\..\\y' : '/x/../y' + const badMember = process.platform === 'win32' ? 'C:\\x\\.\\y' : '/x/./y' expect(() => hostFolders.validateFoldersDocument({ - version: 1, workspaces: { a: { folders: ['/x/../y'] } }, + version: 1, workspaces: { a: { folders: [badFolder] } }, })).toThrow(/"\.\." segments/) expect(() => hostFolders.validateFoldersDocument({ - version: 1, workspaces: { a: { folders: [], members: [{ path: '/x/./y', workspaceId: 'b', kind: 'local' }] } }, + version: 1, workspaces: { a: { folders: [], members: [{ path: badMember, workspaceId: 'b', kind: 'local' }] } }, })).toThrow(/"\.\." segments/) }) it('validateFoldersDocument rejects a __proto__ workspace id; the tolerant read skips it', () => { - expect(() => hostFolders.validateFoldersDocument({ - version: 1, workspaces: { ['__proto__']: { folders: ['/x'] } }, - })).toThrow(/workspace ids/) - const parsed = hostFolders.parseFoldersDocument({ - version: 1, workspaces: { ['__proto__']: { folders: ['/x'] }, ok: { folders: ['/y'] } }, - }) + const doc: Record = Object.create(null) + doc.version = 1 + const workspaces: Record = Object.create(null) + workspaces['__proto__'] = { folders: [process.platform === 'win32' ? 'C:\\x' : '/x'] } + workspaces.ok = { folders: [process.platform === 'win32' ? 'C:\\y' : '/y'] } + doc.workspaces = workspaces + expect(() => hostFolders.validateFoldersDocument(doc)).toThrow(/workspace ids/) + const parsed = hostFolders.parseFoldersDocument(doc) expect(Object.keys(parsed.workspaces)).toEqual(['ok']) expect(({} as Record).polluted).toBeUndefined() }) it('validateRemoteHintPath rejects UNC paths', () => { - expect(() => hostFolders.validateRemoteHintPath('\\\\server\\share\\dir')).toThrow(/UNC/) - expect(hostFolders.validateRemoteHintPath('/home/u/proj')).toBe('/home/u/proj') + expect(() => hostFolders.validateRemoteHintPath(String.raw`\\server\share\dir`)).toThrow(/UNC/) + expect(hostFolders.validateRemoteHintPath(process.platform === 'win32' ? 'C:\\home\\u\\proj' : '/home/u/proj')) + .toBe(process.platform === 'win32' ? 'C:\\home\\u\\proj' : '/home/u/proj') }) it('addMember keeps a root that names the member path', () => { const entry = addMember( diff --git a/tests/tree.test.ts b/tests/tree.test.ts index d4ec447..114d85e 100644 --- a/tests/tree.test.ts +++ b/tests/tree.test.ts @@ -14,6 +14,7 @@ import type { SessionListState, SessionSummary } from '@deepseek-ai/dsh-api-sess import type { WorkspaceView } from '@deepseek-ai/dsh-api-workspace-controller/client' import { deriveGroups, deriveSearchGroups, deriveTopLevel } from '../src/client/tree.ts' import type { GroupsConfig, ManualGroups } from '../src/core/types.ts' +import type { FoldersDocument } from '../src/core/folders.ts' const CONFIG: GroupsConfig = { categories: [ @@ -179,6 +180,39 @@ describe('category appearance on the tree nodes', () => { }) }) +describe('folder rows use confirmed display names', () => { + it('base row shows the project title, not the local mirror basename', () => { + const ws = workspace('ws-remote', 'C:/mirror/w123', '远程项目', ['s1']) + const folders: FoldersDocument = { + version: 1, + revision: 1, + workspaces: { + 'ws-remote': { + folders: ['C:/mirror/w123/extra'], + members: [{ + path: 'C:/mirror/w123/extra', + workspaceId: 'ws-extra', + kind: 'remote', + remotePath: '/srv/proj/extra', + profileId: 'prof-1', + title: 'extra-remote', + }], + }, + }, + } + const view = { expandedCategories: [], expandedWorkspaces: ['ws-remote'] } + const top = deriveTopLevel(listState([ws], 's1'), [ws], [], CONFIG, view, { categories: [], assignments: {} }, new Map(), folders) + const node = top.find(item => item.workspaceId === 'ws-remote') + expect(node).toBeDefined() + const base = node?.folders?.find(folder => folder.isBase) + const member = node?.folders?.find(folder => !folder.isBase) + expect(base?.label).toBe('远程项目') + expect(member?.label).toBe('extra-remote') + // The underlying path identity is untouched. + expect(base?.path).toBe('C:/mirror/w123') + }) +}) + describe('deriveTopLevel', () => { const ws = [ workspace('ws-a', '/Users/zcol/Project/SomePlugin', 'DSH插件Demo'), diff --git a/tools/verify-dock.mjs b/tools/verify-dock.mjs index aa42d6c..712b71c 100644 --- a/tools/verify-dock.mjs +++ b/tools/verify-dock.mjs @@ -58,6 +58,9 @@ const block = (selector) => { const start = match.index + match[0].length - match[1].length return css.slice(start, css.indexOf('}', start)) } +assert.match(block('.wgRoot'), /height:100%/, 'the root consumes the sidebar slot height') +assert.match(block('.wgRoot'), /max-height:100%/, 'the root cannot grow past its slot') +assert.match(block('.wgRoot'), /overflow:hidden/, 'the root clips instead of scrolling the whole sidebar') assert.match(block('.wgDock'), /border-top:1px solid/, 'the dock draws the divider against the tree') assert.match(block('.wgDock'), /max-height:min\(62vh,560px\)/, 'the dock is capped so the tree always keeps room') assert.match(block('.wgDock'), /overflow:hidden/, 'the dock clips its own overflow instead of painting over the tree')