From 7fd69069eab4f9fc98edbdcbbb7da1e271c8c526 Mon Sep 17 00:00:00 2001 From: QQ Date: Wed, 11 Nov 2026 22:29:13 +0800 Subject: [PATCH] Import lib/types/core/default-workspace.d.ts --- lib/types/core/default-workspace.d.ts | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lib/types/core/default-workspace.d.ts diff --git a/lib/types/core/default-workspace.d.ts b/lib/types/core/default-workspace.d.ts new file mode 100644 index 0000000..3750689 --- /dev/null +++ b/lib/types/core/default-workspace.d.ts @@ -0,0 +1,32 @@ +/** + * Recognising the Host's own default workspace ("默认工作区"). + * + * The workspace snapshot carries no `isDefault` flag, so the only Host-owned + * signal is the one the Host itself uses: the registry title. Its + * `workspaceDisplayTitle()` treats a title equal to `DEFAULT_WORKSPACE_DIRECTORY` + * as "the default workspace" and swaps in a localized label. That constant lives + * in the workspace-controller package, which this plugin must not import at + * runtime (it is a client bundle), so the string is mirrored here. + * + * Two Host signals are combined: + * - the registry title (primary: exactly what the Host substitutes for); + * - the Host's own directory layout (`/deepseek-harness/default-workspace`), + * which still identifies the workspace after the user renames it. + * A user-created directory that merely happens to be called "default-workspace" + * somewhere else on disk is NOT treated as the default workspace, and no single + * directory name is used as the sole test. + */ +/** Directory name the Host uses for its default workspace (host mirror). */ +export declare const DEFAULT_WORKSPACE_TITLE = "default-workspace"; +/** The fields the identification needs from a workspace snapshot. */ +export interface DefaultWorkspaceIdentity { + /** Registry title (`WorkspaceView.title`). */ + title?: string | undefined; + /** Absolute workspace directory (`WorkspaceView.path`). */ + path?: string | undefined; +} +/** + * Whether a workspace snapshot is the Host's default workspace. + * @param workspace - workspace snapshot (title is the primary signal, path the fallback). + */ +export declare function isDefaultWorkspace(workspace: DefaultWorkspaceIdentity): boolean;