@jingyi0605/codingns4dsh 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +306 -0
- package/README.md +190 -993
- package/data/build/dist/client/account-bar.d.ts +2 -2
- package/data/build/dist/client/account-bar.js +96 -39
- package/data/build/dist/client/bundle.js +13722 -3611
- package/data/build/dist/client/cli-catalog.js +20 -3
- package/data/build/dist/client/cli-slots.d.ts +5 -0
- package/data/build/dist/client/cli-slots.js +57 -7
- package/data/build/dist/client/debug/ui.d.ts +1 -1
- package/data/build/dist/client/debug/ui.js +62 -32
- package/data/build/dist/client/dsh-runtime-version.d.ts +9 -2
- package/data/build/dist/client/dsh-runtime-version.js +24 -2
- package/data/build/dist/client/features/cli-adapters.d.ts +1 -1
- package/data/build/dist/client/features/cli-adapters.js +19 -16
- package/data/build/dist/client/features/debug.js +2 -2
- package/data/build/dist/client/features/index.d.ts +2 -1
- package/data/build/dist/client/features/index.js +3 -1
- package/data/build/dist/client/features/lan-access-panel.d.ts +1 -1
- package/data/build/dist/client/features/lan-access-panel.js +8 -10
- package/data/build/dist/client/features/lan-access.js +1 -1
- package/data/build/dist/client/features/login-protection-panel.d.ts +1 -1
- package/data/build/dist/client/features/login-protection-panel.js +7 -9
- package/data/build/dist/client/features/reverse-proxy-panel.d.ts +1 -1
- package/data/build/dist/client/features/reverse-proxy-panel.js +99 -11
- package/data/build/dist/client/features/reverse-proxy.d.ts +1 -1
- package/data/build/dist/client/features/reverse-proxy.js +19 -18
- package/data/build/dist/client/features/terminal-enhancement-panel.d.ts +1 -1
- package/data/build/dist/client/features/terminal-enhancement-panel.js +62 -55
- package/data/build/dist/client/features/terminal-enhancement.d.ts +1 -1
- package/data/build/dist/client/features/terminal-enhancement.js +3 -3
- package/data/build/dist/client/features/types.d.ts +14 -3
- package/data/build/dist/client/features/workspace-session-enhancement-panel.d.ts +1 -1
- package/data/build/dist/client/features/workspace-session-enhancement-panel.js +31 -9
- package/data/build/dist/client/features/workspace-session-enhancement.js +72 -11
- package/data/build/dist/client/git-management.d.ts +16 -0
- package/data/build/dist/client/git-management.js +757 -0
- package/data/build/dist/client/index.d.ts +3 -2
- package/data/build/dist/client/index.js +152 -27
- package/data/build/dist/client/locale.js +91 -29
- package/data/build/dist/client/quick-phrase-layout.d.ts +49 -0
- package/data/build/dist/client/quick-phrase-layout.js +95 -0
- package/data/build/dist/client/quick-phrase-slot.d.ts +7 -0
- package/data/build/dist/client/quick-phrase-slot.js +370 -0
- package/data/build/dist/client/remote-web-context.js +1 -1
- package/data/build/dist/client/settings-bridge.d.ts +9 -6
- package/data/build/dist/client/settings-bridge.js +51 -27
- package/data/build/dist/client/settings-section.d.ts +3 -2
- package/data/build/dist/client/settings-section.js +33 -19
- package/data/build/dist/client/subscription-slot.d.ts +3 -0
- package/data/build/dist/client/subscription-slot.js +108 -16
- package/data/build/dist/client/terminal/model.d.ts +14 -2
- package/data/build/dist/client/terminal/model.js +109 -21
- package/data/build/dist/client/terminal/recovery.d.ts +50 -0
- package/data/build/dist/client/terminal/recovery.js +101 -0
- package/data/build/dist/client/terminal/ui.d.ts +2 -2
- package/data/build/dist/client/terminal/ui.js +49 -11
- package/data/build/dist/client/terminal/xterm-view.d.ts +2 -2
- package/data/build/dist/client/terminal/xterm-view.js +2 -1
- package/data/build/dist/client/theme.d.ts +6 -1
- package/data/build/dist/client/theme.js +32 -1
- package/data/build/dist/client/workspace-session-archive-dom.d.ts +12 -0
- package/data/build/dist/client/workspace-session-archive-dom.js +27 -5
- package/data/build/dist/client/workspace-session-visibility-dom.d.ts +30 -0
- package/data/build/dist/client/workspace-session-visibility-dom.js +604 -0
- package/data/build/dist/dsh-capabilities/client/config-forms-adapter.d.ts +50 -0
- package/data/build/dist/dsh-capabilities/client/config-forms-adapter.js +139 -0
- package/data/build/dist/dsh-capabilities/client/conversation-adapter.d.ts +7 -0
- package/data/build/dist/dsh-capabilities/client/conversation-adapter.js +6 -0
- package/data/build/dist/dsh-capabilities/client/locale-adapter.d.ts +9 -0
- package/data/build/dist/dsh-capabilities/client/locale-adapter.js +4 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts +10 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js +14 -0
- package/data/build/dist/dsh-capabilities/client/settings-scope-adapter.d.ts +8 -0
- package/data/build/dist/dsh-capabilities/client/settings-scope-adapter.js +16 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-adapter.d.ts +7 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-adapter.js +5 -0
- package/data/build/dist/dsh-capabilities/client/theme-adapter.d.ts +6 -0
- package/data/build/dist/dsh-capabilities/client/theme-adapter.js +4 -0
- package/data/build/dist/dsh-capabilities/client/typert-adapter.d.ts +5 -0
- package/data/build/dist/dsh-capabilities/client/typert-adapter.js +4 -0
- package/data/build/dist/dsh-capabilities/host/config-forms-adapter.d.ts +19 -0
- package/data/build/dist/dsh-capabilities/host/config-forms-adapter.js +45 -0
- package/data/build/dist/dsh-capabilities/host/connection-rpc-adapter.d.ts +19 -0
- package/data/build/dist/dsh-capabilities/host/connection-rpc-adapter.js +13 -0
- package/data/build/dist/dsh-capabilities/host/settings-scope-adapter.d.ts +8 -0
- package/data/build/dist/dsh-capabilities/host/settings-scope-adapter.js +47 -0
- package/data/build/dist/dsh-capabilities/host/typert-adapter.d.ts +6 -0
- package/data/build/dist/dsh-capabilities/host/typert-adapter.js +4 -0
- package/data/build/dist/dsh-capabilities/index.d.ts +6 -0
- package/data/build/dist/dsh-capabilities/index.js +6 -0
- package/data/build/dist/dsh-capabilities/matrix.d.ts +15 -0
- package/data/build/dist/dsh-capabilities/matrix.js +32 -0
- package/data/build/dist/dsh-capabilities/registry.d.ts +22 -0
- package/data/build/dist/dsh-capabilities/registry.js +196 -0
- package/data/build/dist/dsh-capabilities/routes.d.ts +10 -0
- package/data/build/dist/dsh-capabilities/routes.js +34 -0
- package/data/build/dist/dsh-capabilities/settings-store.d.ts +29 -0
- package/data/build/dist/dsh-capabilities/settings-store.js +5 -0
- package/data/build/dist/dsh-capabilities/types.d.ts +50 -0
- package/data/build/dist/dsh-capabilities/types.js +23 -0
- package/data/build/dist/features/registry.d.ts +8 -2
- package/data/build/dist/features/registry.js +104 -1
- package/data/build/dist/host/auth-session.d.ts +8 -1
- package/data/build/dist/host/auth-session.js +28 -6
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts +2 -0
- package/data/build/dist/host/cli-adapters/claude-driver.js +19 -4
- package/data/build/dist/host/cli-adapters/claude-model-options.d.ts +14 -0
- package/data/build/dist/host/cli-adapters/claude-model-options.js +157 -0
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts +11 -0
- package/data/build/dist/host/cli-adapters/codex-driver.js +166 -14
- package/data/build/dist/host/cli-adapters/driver.d.ts +2 -0
- package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts +15 -0
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js +120 -29
- package/data/build/dist/host/cli-adapters/dsh-tool-history.d.ts +4 -1
- package/data/build/dist/host/cli-adapters/dsh-tool-history.js +25 -7
- package/data/build/dist/host/cli-adapters/feature.js +74 -8
- package/data/build/dist/host/cli-adapters/gemini-driver.js +2 -2
- package/data/build/dist/host/cli-adapters/grok-driver.js +2 -2
- package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts +4 -2
- package/data/build/dist/host/cli-adapters/json-rpc-process.js +8 -9
- package/data/build/dist/host/cli-adapters/kimi-driver.js +1 -1
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.d.ts +17 -0
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.js +88 -0
- package/data/build/dist/host/cli-adapters/legacy-session-settings.d.ts +24 -0
- package/data/build/dist/host/cli-adapters/legacy-session-settings.js +162 -0
- package/data/build/dist/host/cli-adapters/official-provider-subscription.d.ts +29 -0
- package/data/build/dist/host/cli-adapters/official-provider-subscription.js +361 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts +2 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.js +97 -12
- package/data/build/dist/host/cli-adapters/pi-driver.js +69 -23
- package/data/build/dist/host/cli-adapters/provider-registry.d.ts +33 -0
- package/data/build/dist/host/cli-adapters/provider-registry.js +83 -0
- package/data/build/dist/host/cli-adapters/provider-subscription.d.ts +25 -3
- package/data/build/dist/host/cli-adapters/provider-subscription.js +346 -30
- package/data/build/dist/host/cli-adapters/registry.d.ts +6 -0
- package/data/build/dist/host/cli-adapters/registry.js +170 -13
- package/data/build/dist/host/cli-adapters/rpc-driver-utils.js +10 -0
- package/data/build/dist/host/cli-adapters/session-store.d.ts +7 -0
- package/data/build/dist/host/cli-adapters/session-store.js +39 -1
- package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts +3 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts +3 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.js +22 -2
- package/data/build/dist/host/control-api-client.d.ts +3 -3
- package/data/build/dist/host/control-api-client.js +2 -1
- package/data/build/dist/host/credential-store.js +11 -1
- package/data/build/dist/host/dsh-device-runtime.d.ts +4 -0
- package/data/build/dist/host/dsh-device-runtime.js +20 -9
- package/data/build/dist/host/features/auth.js +8 -5
- package/data/build/dist/host/features/debug.js +1 -1
- package/data/build/dist/host/features/git-management.d.ts +5 -0
- package/data/build/dist/host/features/git-management.js +290 -0
- package/data/build/dist/host/features/host-status.js +1 -1
- package/data/build/dist/host/features/index.d.ts +1 -0
- package/data/build/dist/host/features/index.js +3 -0
- package/data/build/dist/host/features/terminal-process.js +1 -1
- package/data/build/dist/host/features/terminal-status.d.ts +3 -1
- package/data/build/dist/host/features/terminal-status.js +3 -1
- package/data/build/dist/host/index.d.ts +7 -3
- package/data/build/dist/host/index.js +76 -11
- package/data/build/dist/host/lan-access-dsh.js +18 -5
- package/data/build/dist/host/native-session-bridge.d.ts +23 -1
- package/data/build/dist/host/native-session-bridge.js +157 -10
- package/data/build/dist/host/rpc-table.d.ts +1 -1
- package/data/build/dist/host/rpc.js +60 -10
- package/data/build/dist/host/session-migration-repair.d.ts +19 -0
- package/data/build/dist/host/session-migration-repair.js +395 -0
- package/data/build/dist/host/settings.d.ts +8 -1
- package/data/build/dist/host/settings.js +94 -3
- package/data/build/dist/host/terminal/backends/tmux-backend.d.ts +1 -0
- package/data/build/dist/host/terminal/backends/tmux-backend.js +4 -2
- package/data/build/dist/host/terminal/controller-factory.d.ts +4 -0
- package/data/build/dist/host/terminal/controller-factory.js +26 -7
- package/data/build/dist/host/terminal/runtime-manager.d.ts +2 -1
- package/data/build/dist/host/terminal/runtime-manager.js +3 -0
- package/data/build/dist/host/terminal/startup.d.ts +2 -0
- package/data/build/dist/host/terminal/startup.js +2 -1
- package/data/build/dist/host/terminal/terminal-controller.d.ts +10 -3
- package/data/build/dist/host/terminal/terminal-controller.js +101 -15
- package/data/build/dist/host/terminal/terminal-process-service.js +3 -1
- package/data/build/dist/host/terminal/terminal-service.d.ts +2 -0
- package/data/build/dist/host/terminal/terminal-service.js +10 -0
- package/data/build/dist/index.d.ts +6 -2
- package/data/build/dist/index.js +8 -2
- package/data/build/dist/shared/contracts/cli-adapter.d.ts +14 -0
- package/data/build/dist/shared/contracts/config.d.ts +31 -1
- package/data/build/dist/shared/contracts/config.js +25 -0
- package/data/build/dist/shared/contracts/dsh-device.d.ts +13 -1
- package/data/build/dist/shared/contracts/errors.d.ts +1 -1
- package/data/build/dist/shared/contracts/feature.d.ts +6 -0
- package/data/build/dist/shared/contracts/git.d.ts +82 -0
- package/data/build/dist/shared/contracts/git.js +3 -0
- package/data/build/dist/shared/contracts/subscription.d.ts +46 -0
- package/data/build/dist/shared/contracts/terminal.d.ts +4 -1
- package/data/build/dist/shared/contracts/version.d.ts +2 -2
- package/data/build/dist/shared/contracts/version.js +4 -6
- package/data/build/dist/shared/debug.d.ts +14 -0
- package/data/build/dist/shared/debug.js +53 -0
- package/data/build/dist/shared/index.d.ts +7 -4
- package/data/build/dist/shared/index.js +2 -1
- package/data/build/dist/transport/debug.d.ts +1 -1
- package/data/build/dist/transport/debug.js +3 -30
- package/data/build/dist/transport/dsh-session.js +3 -3
- package/data/build/dist/typert.host.js +4 -2
- package/data/build/dist/typert.remote-client.d.ts +11 -0
- package/data/build/dist/typert.remote-client.js +7 -0
- package/dsh.bundle.patch +1 -1
- package/package.json +17 -5
- package/profile/README.md +4 -4
- package/profile/package.json +6 -4
- package/profile/scripts/check-dsh-install.mjs +2 -2
- package/profile/version.json +2 -2
- package/scripts/check-dsh-install.mjs +2 -2
- package/version.json +2 -2
|
@@ -13,7 +13,8 @@ export const dshThemeColor = {
|
|
|
13
13
|
inputBackground: 'var(--dsw-specific-input-major, Canvas)',
|
|
14
14
|
surfaceSubtle: 'var(--dsw-alias-bg-secondary, rgba(127, 127, 127, 0.06))',
|
|
15
15
|
buttonBackground: 'var(--dsw-alias-button-elevated-fill, transparent)',
|
|
16
|
-
|
|
16
|
+
// 0.1.7 的 specific-menu 可能带透明度;layer-3 在 0.1.5 至 0.1.7 中均为弹层实底。
|
|
17
|
+
menuBackground: 'var(--dsw-alias-bg-layer-3, var(--dsw-alias-bg-l1, var(--dsw-specific-menu, Canvas)))',
|
|
17
18
|
pageBackground: 'var(--dsw-alias-bg-primary, Canvas)',
|
|
18
19
|
overlay: 'var(--dsw-alias-bg-mask-1, rgba(0, 0, 0, 0.45))',
|
|
19
20
|
accent: 'var(--dsw-alias-button-info-fill, #1677ff)',
|
|
@@ -177,6 +178,36 @@ export const dshSettingsNoteStyle = {
|
|
|
177
178
|
fontSize: 12,
|
|
178
179
|
lineHeight: 1.5,
|
|
179
180
|
};
|
|
181
|
+
/** 终端外观设置的紧凑双列布局。 */
|
|
182
|
+
export const dshSettingsGridStyle = {
|
|
183
|
+
display: 'grid',
|
|
184
|
+
gridTemplateColumns: 'repeat(2, minmax(0, 1fr))',
|
|
185
|
+
gap: 12,
|
|
186
|
+
};
|
|
187
|
+
export const dshSettingsSectionHeaderStyle = {
|
|
188
|
+
display: 'flex',
|
|
189
|
+
alignItems: 'center',
|
|
190
|
+
justifyContent: 'space-between',
|
|
191
|
+
gap: 12,
|
|
192
|
+
paddingBottom: 2,
|
|
193
|
+
};
|
|
194
|
+
/** 设置写入结果的顶部浮动提示。 */
|
|
195
|
+
export const dshSettingsToastStyle = {
|
|
196
|
+
position: 'sticky',
|
|
197
|
+
top: 8,
|
|
198
|
+
zIndex: 20,
|
|
199
|
+
alignSelf: 'center',
|
|
200
|
+
width: 'min(300px, calc(100% - 24px))',
|
|
201
|
+
padding: '9px 14px',
|
|
202
|
+
border: `1px solid ${dshThemeColor.border}`,
|
|
203
|
+
borderRadius: 8,
|
|
204
|
+
background: dshThemeColor.menuBackground,
|
|
205
|
+
boxShadow: dshThemeColor.prominentShadow,
|
|
206
|
+
color: dshThemeColor.labelPrimary,
|
|
207
|
+
fontSize: 13,
|
|
208
|
+
lineHeight: 1.4,
|
|
209
|
+
textAlign: 'center',
|
|
210
|
+
};
|
|
180
211
|
/** 模态框和弹出菜单必须成对设置前景色与背景色。 */
|
|
181
212
|
export const dshPopupSurfaceStyle = {
|
|
182
213
|
color: dshThemeColor.labelPrimary,
|
|
@@ -26,4 +26,16 @@ export declare function loadWorkspaceArchivedSessions(remote: unknown, now?: ()
|
|
|
26
26
|
* 身份;真正的归档和取消归档仍交给 DSH Workspace Controller,避免旁路修改存储。
|
|
27
27
|
*/
|
|
28
28
|
export declare function startWorkspaceSessionArchiveDom(options?: WorkspaceSessionArchiveDomOptions): WorkspaceSessionArchiveDomController;
|
|
29
|
+
export interface WorkspaceRecord {
|
|
30
|
+
readonly workspaceId: string;
|
|
31
|
+
readonly path?: string;
|
|
32
|
+
readonly title: string;
|
|
33
|
+
readonly sessionIds: readonly string[];
|
|
34
|
+
readonly archivedSessionIds: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
/** 读取 DSH 当前工作区基线;隐藏工作区控制器与归档控制器共用这份解析。 */
|
|
37
|
+
export declare function loadWorkspaceRecords(remote: unknown): Promise<readonly WorkspaceRecord[]>;
|
|
38
|
+
export declare function findWorkspaceHeaders(dom: Pick<Document, 'querySelectorAll'>): HTMLElement[];
|
|
39
|
+
export declare function resolveWorkspaceId(element: Element): string | undefined;
|
|
40
|
+
export declare function findWorkspaceContainer(anchor: HTMLElement, workspaceId: string): HTMLElement | null;
|
|
29
41
|
//# sourceMappingURL=workspace-session-archive-dom.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { dshThemeColor } from './theme.js';
|
|
1
2
|
/** 归档入口和模态框节点使用的标记,便于重复扫描与停用时完整清理。 */
|
|
2
3
|
export const WORKSPACE_SESSION_ARCHIVE_ATTRIBUTE = 'data-codingns-session-archive';
|
|
3
4
|
export const WORKSPACE_SESSION_ARCHIVE_MODAL_ATTRIBUTE = 'data-codingns-session-archive-modal';
|
|
@@ -156,6 +157,10 @@ async function loadArchiveSnapshot(remote, now) {
|
|
|
156
157
|
}
|
|
157
158
|
return { byWorkspace: result, workspaceIds: workspaces.map((workspace) => workspace.workspaceId) };
|
|
158
159
|
}
|
|
160
|
+
/** 读取 DSH 当前工作区基线;隐藏工作区控制器与归档控制器共用这份解析。 */
|
|
161
|
+
export async function loadWorkspaceRecords(remote) {
|
|
162
|
+
return readWorkspaceBaseline(normalizeRemote(remote).workspace);
|
|
163
|
+
}
|
|
159
164
|
async function readWorkspaceBaseline(api) {
|
|
160
165
|
if (api?.follow === undefined)
|
|
161
166
|
return [];
|
|
@@ -173,9 +178,11 @@ async function readWorkspaceBaseline(api) {
|
|
|
173
178
|
if (workspaceId === undefined)
|
|
174
179
|
return [];
|
|
175
180
|
const path = readString(record?.path);
|
|
181
|
+
const title = readString(record?.title) ?? path ?? workspaceId;
|
|
176
182
|
return [{
|
|
177
183
|
workspaceId,
|
|
178
184
|
...(path === undefined ? {} : { path }),
|
|
185
|
+
title,
|
|
179
186
|
sessionIds: readStringArray(record?.sessionIds),
|
|
180
187
|
archivedSessionIds: globalArchived,
|
|
181
188
|
}];
|
|
@@ -224,10 +231,10 @@ function isPathWithin(candidate, parent) {
|
|
|
224
231
|
function findMoreSessionButtons(dom) {
|
|
225
232
|
return [...dom.querySelectorAll('button')].filter(isMoreSessionButton);
|
|
226
233
|
}
|
|
227
|
-
function findWorkspaceHeaders(dom) {
|
|
234
|
+
export function findWorkspaceHeaders(dom) {
|
|
228
235
|
return [...dom.querySelectorAll('[role="treeitem"][aria-expanded]')];
|
|
229
236
|
}
|
|
230
|
-
function resolveWorkspaceId(element) {
|
|
237
|
+
export function resolveWorkspaceId(element) {
|
|
231
238
|
let current = element;
|
|
232
239
|
for (let depth = 0; depth < 8 && current !== null; depth += 1) {
|
|
233
240
|
for (const key of ['data-workspace-id', 'data-workspaceid', 'data-workspace']) {
|
|
@@ -304,10 +311,16 @@ function insertArchiveEntryAfterHeader(header, items, dom, remote, workspaceId,
|
|
|
304
311
|
container.appendChild(entry);
|
|
305
312
|
return true;
|
|
306
313
|
}
|
|
307
|
-
function findWorkspaceContainer(anchor, workspaceId) {
|
|
314
|
+
export function findWorkspaceContainer(anchor, workspaceId) {
|
|
308
315
|
let current = anchor.parentElement;
|
|
309
316
|
let fallback = null;
|
|
310
317
|
for (let depth = 0; depth < 8 && current !== null; depth += 1) {
|
|
318
|
+
// 找不到明确的工作区边界时不能继续向上回退到整个侧栏;否则归档入口
|
|
319
|
+
// 会被追加到所有工作区之后,变成截图中的独立底部条目。
|
|
320
|
+
if (containsForeignWorkspaceHeader(current, anchor, workspaceId)) {
|
|
321
|
+
current = current.parentElement;
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
311
324
|
fallback = current;
|
|
312
325
|
const hasMoreButton = [...current.querySelectorAll('button')].some((button) => {
|
|
313
326
|
return isMoreSessionButton(button) && (resolveWorkspaceId(button) === workspaceId || button === anchor);
|
|
@@ -321,6 +334,15 @@ function findWorkspaceContainer(anchor, workspaceId) {
|
|
|
321
334
|
}
|
|
322
335
|
return fallback;
|
|
323
336
|
}
|
|
337
|
+
function containsForeignWorkspaceHeader(container, anchor, workspaceId) {
|
|
338
|
+
return [...container.querySelectorAll('[role="treeitem"]')].some((row) => {
|
|
339
|
+
if (row === anchor || row.getAttribute('aria-expanded') === null)
|
|
340
|
+
return false;
|
|
341
|
+
const rowWorkspaceId = resolveWorkspaceId(row);
|
|
342
|
+
// 未能解析的另一个工作区也不能被当成当前工作区的容器处理。
|
|
343
|
+
return rowWorkspaceId === undefined || rowWorkspaceId !== workspaceId;
|
|
344
|
+
});
|
|
345
|
+
}
|
|
324
346
|
function directChildFor(container, descendant) {
|
|
325
347
|
let current = descendant;
|
|
326
348
|
while (current.parentElement !== null && current.parentElement !== container) {
|
|
@@ -380,8 +402,8 @@ function openArchiveModal(items, dom, remote, onChanged) {
|
|
|
380
402
|
surface.setAttribute('aria-label', '已归档的会话');
|
|
381
403
|
Object.assign(surface.style, {
|
|
382
404
|
width: 'min(860px, 100%)', maxHeight: 'min(720px, 90vh)', overflow: 'auto', boxSizing: 'border-box',
|
|
383
|
-
padding: '28px 32px', borderRadius: '16px', color:
|
|
384
|
-
background:
|
|
405
|
+
padding: '28px 32px', borderRadius: '16px', color: dshThemeColor.labelPrimary,
|
|
406
|
+
background: dshThemeColor.menuBackground, boxShadow: dshThemeColor.prominentShadow,
|
|
385
407
|
});
|
|
386
408
|
const header = dom.createElement('div');
|
|
387
409
|
Object.assign(header.style, { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '16px', marginBottom: '18px' });
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** 工作区隐藏注入节点的标记,便于重复扫描和停用时完整清理。 */
|
|
2
|
+
export declare const WORKSPACE_SESSION_HIDDEN_ATTRIBUTE = "data-codingns-hidden-workspace";
|
|
3
|
+
export declare const WORKSPACE_SESSION_HIDDEN_MENU_ATTRIBUTE = "data-codingns-hidden-workspace-menu";
|
|
4
|
+
export declare const WORKSPACE_SESSION_HIDDEN_LIST_ATTRIBUTE = "data-codingns-hidden-workspaces";
|
|
5
|
+
export declare const WORKSPACE_SESSION_HIDDEN_FILTER_ATTRIBUTE = "data-codingns-hidden-workspace-filter";
|
|
6
|
+
export declare const WORKSPACE_SESSION_HIDDEN_FILTER_CHECK_ATTRIBUTE = "data-codingns-hidden-workspace-filter-check";
|
|
7
|
+
export interface WorkspaceSessionVisibilityDomController {
|
|
8
|
+
/** 重新读取工作区并同步侧栏 DOM。 */
|
|
9
|
+
refresh(): void;
|
|
10
|
+
/** 设置当前隐藏的工作区 ID,并触发一次扫描。 */
|
|
11
|
+
setHiddenWorkspaceIds(ids: readonly string[]): void;
|
|
12
|
+
/** 断开观察器并恢复所有被插件隐藏的节点。 */
|
|
13
|
+
dispose(): void;
|
|
14
|
+
}
|
|
15
|
+
export interface WorkspaceSessionVisibilityDomOptions {
|
|
16
|
+
readonly document?: Document;
|
|
17
|
+
readonly MutationObserver?: typeof MutationObserver;
|
|
18
|
+
readonly remote?: unknown;
|
|
19
|
+
readonly hiddenWorkspaceIds?: readonly string[];
|
|
20
|
+
/** 持久化由功能模块完成;回调失败时控制器会恢复上一次可见状态。 */
|
|
21
|
+
readonly onHiddenWorkspaceIdsChange?: (ids: readonly string[]) => Promise<void> | void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 给原生工作区菜单增加隐藏动作,并通过工作区筛选菜单控制恢复列表。
|
|
25
|
+
*
|
|
26
|
+
* DSH 当前版本没有公开工作区可见性 API,因此这里仅隐藏原生 DOM,工作区
|
|
27
|
+
* 本身仍由 DSH Workspace Controller 管理;隐藏 ID 存在 Codingns4DSH 设置中。
|
|
28
|
+
*/
|
|
29
|
+
export declare function startWorkspaceSessionVisibilityDom(options?: WorkspaceSessionVisibilityDomOptions): WorkspaceSessionVisibilityDomController;
|
|
30
|
+
//# sourceMappingURL=workspace-session-visibility-dom.d.ts.map
|