DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.
chore: PLUGIN_NAME to PLUGIN_ID
hairyf090dfd6992d5
diff --git a/docs/PLUGIN_CLIENT.spec.md b/docs/PLUGIN_CLIENT.spec.mdindex 362c2b1d..63eecd71 100644--- a/docs/PLUGIN_CLIENT.spec.md+++ b/docs/PLUGIN_CLIENT.spec.md@@ -115,7 +115,7 @@ $$\text{client/index.ts} \longrightarrow \begin{bmatrix} \text{register/} \\ \te### 7. 依赖与本地化 (`locales/`, 依赖关系)-* 使用 `defineLocale(PLUGIN_NAME, { zh, en })` 声明语言包,通过 `ctx.effect(locale.registerLocale, LOCALE_EFFECT)` 安装。+* 使用 `defineLocale(PLUGIN_ID, { zh, en })` 声明语言包,通过 `ctx.effect(locale.registerLocale, LOCALE_EFFECT)` 安装。* 禁止自建 locale store、`let activeLocale` 或在 DOM 选择器中使用文案[cite: 1]。通用动词直接复用 `common` 命名空间。* **依赖隔离**:第三方库(`unstorage` / `ofetch` / `valtio-define` / `@reause/core` / `lodash-es`)统一由 `dsh-tauri/client` 转出,严禁插件直接 import;需要白名单外的 `lodash-es` 方法时,先补进 `packages/dsh-tauri/src/client/modules/lodash-es.ts`。diff --git a/packages/dsh-tauri-panel-extension/src/client/constants/index.ts b/packages/dsh-tauri-panel-extension/src/client/constants/index.tsindex f0c45042..e0c8ae99 100644--- a/packages/dsh-tauri-panel-extension/src/client/constants/index.ts+++ b/packages/dsh-tauri-panel-extension/src/client/constants/index.ts@@ -1,26 +1,26 @@import type { LocaleKey } from '../locales/index.types'-import { PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'-export { API_PREFIX, PLUGIN_NAME as PLUGIN_ID } from '../../shared/constants'+export { API_PREFIX, PLUGIN_ID as PLUGIN_ID } from '../../shared/constants'export const CONVERSATION_INPUT_LEFT_SLOT = 'conversation.input.left'-export const PANEL_ID = PLUGIN_NAME+export const PANEL_ID = PLUGIN_IDexport const PANEL_ACTION_ORDER = 40-export const INPUT_PREFILL_ID = `${PLUGIN_NAME}.skill-prefill`+export const INPUT_PREFILL_ID = `${PLUGIN_ID}.skill-prefill`export const INPUT_PREFILL_ORDER = 40export const INPUT_PREFILL_PRIORITY = 0-export const STYLE_ID = `${PLUGIN_NAME}-styles`-export const EXTENSION_PANEL_STYLE_ID = `${PLUGIN_NAME}-panel-styles`-export const SKILLS_TAB_STYLE_ID = `${PLUGIN_NAME}-skills-tab-styles`-export const MCP_TAB_STYLE_ID = `${PLUGIN_NAME}-mcp-tab-styles`-export const MARKDOWN_STYLE_ID = `${PLUGIN_NAME}-markdown-styles`-export const MCP_EDITOR_FORM_STYLE_ID = `${PLUGIN_NAME}-editor-form-styles`-export const MCP_IMPORT_DIALOG_STYLE_ID = `${PLUGIN_NAME}-import-dialog-styles`+export const STYLE_ID = `${PLUGIN_ID}-styles`+export const EXTENSION_PANEL_STYLE_ID = `${PLUGIN_ID}-panel-styles`+export const SKILLS_TAB_STYLE_ID = `${PLUGIN_ID}-skills-tab-styles`+export const MCP_TAB_STYLE_ID = `${PLUGIN_ID}-mcp-tab-styles`+export const MARKDOWN_STYLE_ID = `${PLUGIN_ID}-markdown-styles`+export const MCP_EDITOR_FORM_STYLE_ID = `${PLUGIN_ID}-editor-form-styles`+export const MCP_IMPORT_DIALOG_STYLE_ID = `${PLUGIN_ID}-import-dialog-styles`-export const LOCALE_EFFECT = `${PLUGIN_NAME}: locale`-export const STYLES_EFFECT = `${PLUGIN_NAME}: styles`-export const SKILL_CREATOR_PREFILL_EFFECT = `${PLUGIN_NAME}: skill creator prefill`-export const EXTENSION_PANEL_EFFECT = `${PLUGIN_NAME}: extension panel`+export const LOCALE_EFFECT = `${PLUGIN_ID}: locale`+export const STYLES_EFFECT = `${PLUGIN_ID}: styles`+export const SKILL_CREATOR_PREFILL_EFFECT = `${PLUGIN_ID}: skill creator prefill`+export const EXTENSION_PANEL_EFFECT = `${PLUGIN_ID}: extension panel`export const SKILL_CREATOR_DRAFT = '/skill-creator 'export const SKILL_REFRESH_INTERVAL_MS = 300diff --git a/packages/dsh-tauri-panel-extension/src/host/apply.ts b/packages/dsh-tauri-panel-extension/src/host/apply.tsindex 93d021ed..78228926 100644--- a/packages/dsh-tauri-panel-extension/src/host/apply.ts+++ b/packages/dsh-tauri-panel-extension/src/host/apply.ts@@ -3,7 +3,7 @@ import type { Config } from './apply.types'import type { PanelExtensionHost } from './config/runtime.types'import { fileURLToPath } from 'node:url'import { dirname, join } from 'pathe'-import { PLUGIN_NAME } from '../shared/constants'+import { PLUGIN_ID } from '../shared/constants'import { DEFAULT_PROFILE } from './config/constants'import { clearHostRuntime, resetProviderRuntime, setCurrentHostInstance } from './config/runtime'import { routes } from './routes'@@ -12,7 +12,7 @@ import { provider } from './service/provider'export type { Config } from './apply.types'-export const name = PLUGIN_NAME+export const name = PLUGIN_IDexport const inject = ['webServer', 'skills', 'connection']diff --git a/packages/dsh-tauri-panel-extension/src/host/service/restart.ts b/packages/dsh-tauri-panel-extension/src/host/service/restart.tsindex 79975e47..6e644747 100644--- a/packages/dsh-tauri-panel-extension/src/host/service/restart.ts+++ b/packages/dsh-tauri-panel-extension/src/host/service/restart.ts@@ -5,7 +5,7 @@ import { tmpdir } from 'node:os'import process from 'node:process'import { defineService } from 'dsh-tauri'import { dirname, resolve } from 'pathe'-import { PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'import { RESTART_KILL_DELAY_MS } from '../config/constants'export const restart = defineService({@@ -34,7 +34,7 @@ function scheduleRestart(launch: ReturnType<typeof dshLaunch>,): { pid: number, replacementPid: number | undefined, logOut: string } {const stamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19)- const logOut = `${tmpdir()}${tmpdir().endsWith('/') ? '' : '\\'}${PLUGIN_NAME}-restart-${stamp}.out.log`+ const logOut = `${tmpdir()}${tmpdir().endsWith('/') ? '' : '\\'}${PLUGIN_ID}-restart-${stamp}.out.log`const logErr = logOut.replace('.out.log', '.err.log')const child = spawn(launch.file, launch.args, {cwd: launch.cwd,diff --git a/packages/dsh-tauri-panel-extension/src/index.ts b/packages/dsh-tauri-panel-extension/src/index.tsindex db5f3fad..95139e08 100644--- a/packages/dsh-tauri-panel-extension/src/index.ts+++ b/packages/dsh-tauri-panel-extension/src/index.ts@@ -1,6 +1,6 @@-import { PLUGIN_NAME } from './shared/constants'+import { PLUGIN_ID } from './shared/constants'-export const name = PLUGIN_NAME+export const name = PLUGIN_IDexport const inject = ['webServer', 'skills', 'connection']diff --git a/packages/dsh-tauri-panel-extension/src/shared/constants.ts b/packages/dsh-tauri-panel-extension/src/shared/constants.tsindex 423a3a99..c9662749 100644--- a/packages/dsh-tauri-panel-extension/src/shared/constants.ts+++ b/packages/dsh-tauri-panel-extension/src/shared/constants.ts@@ -1,3 +1,3 @@-export const PLUGIN_NAME = 'dsh-tauri-panel-extension'+export const PLUGIN_ID = 'dsh-tauri-panel-extension'-export const API_PREFIX = `/${PLUGIN_NAME}`+export const API_PREFIX = `/${PLUGIN_ID}`diff --git a/packages/dsh-tauri-panel-scheduler/src/client/constants/index.ts b/packages/dsh-tauri-panel-scheduler/src/client/constants/index.tsindex 5f48865c..1e508384 100644--- a/packages/dsh-tauri-panel-scheduler/src/client/constants/index.ts+++ b/packages/dsh-tauri-panel-scheduler/src/client/constants/index.ts@@ -1,33 +1,33 @@-import { SCHEDULER_PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'-export { SCHEDULER_API_PREFIX as API_PREFIX, SCHEDULER_PLUGIN_NAME as PLUGIN_ID } from '../../shared/constants'+export { SCHEDULER_API_PREFIX as API_PREFIX, PLUGIN_ID as PLUGIN_ID } from '../../shared/constants'-export const PANEL_ID = SCHEDULER_PLUGIN_NAME+export const PANEL_ID = PLUGIN_IDexport const PANEL_ACTION_ORDER = 30export const CONVERSATION_INPUT_LEFT_SLOT = 'conversation.input.left'-export const INPUT_PREFILL_ID = `${SCHEDULER_PLUGIN_NAME}.prefill`+export const INPUT_PREFILL_ID = `${PLUGIN_ID}.prefill`export const INPUT_PREFILL_ORDER = 40export const INPUT_PREFILL_PRIORITY = 0-export const STYLE_ID = `${SCHEDULER_PLUGIN_NAME}-styles`-export const SCHEDULER_PANEL_STYLE_ID = `${SCHEDULER_PLUGIN_NAME}-panel-styles`-export const TASK_CARD_STYLE_ID = `${SCHEDULER_PLUGIN_NAME}-task-card-styles`-export const RUNS_TAB_STYLE_ID = `${SCHEDULER_PLUGIN_NAME}-runs-tab-styles`-export const RECOMMENDATIONS_STYLE_ID = `${SCHEDULER_PLUGIN_NAME}-recommendations-styles`-export const MODEL_PICKER_STYLE_ID = `${SCHEDULER_PLUGIN_NAME}-model-picker-styles`-export const MENU_STYLE_ID = `${SCHEDULER_PLUGIN_NAME}-menu-styles`-export const TASK_CREATE_DIALOG_STYLE_ID = `${SCHEDULER_PLUGIN_NAME}-task-create-dialog-styles`-export const SESSION_ICON_STYLE_ID = `${SCHEDULER_PLUGIN_NAME}-session-clock-icon`+export const STYLE_ID = `${PLUGIN_ID}-styles`+export const SCHEDULER_PANEL_STYLE_ID = `${PLUGIN_ID}-panel-styles`+export const TASK_CARD_STYLE_ID = `${PLUGIN_ID}-task-card-styles`+export const RUNS_TAB_STYLE_ID = `${PLUGIN_ID}-runs-tab-styles`+export const RECOMMENDATIONS_STYLE_ID = `${PLUGIN_ID}-recommendations-styles`+export const MODEL_PICKER_STYLE_ID = `${PLUGIN_ID}-model-picker-styles`+export const MENU_STYLE_ID = `${PLUGIN_ID}-menu-styles`+export const TASK_CREATE_DIALOG_STYLE_ID = `${PLUGIN_ID}-task-create-dialog-styles`+export const SESSION_ICON_STYLE_ID = `${PLUGIN_ID}-session-clock-icon`export const SESSION_ICON_ATTRIBUTE = 'data-dsh-scheduler-icon'export const SIDEBAR_SELECTOR = '[data-slot="sidebar"]'export const REFRESH_INTERVAL_MS = 5_000-export const LOCALE_EFFECT = `${SCHEDULER_PLUGIN_NAME}: locale`-export const STYLES_EFFECT = `${SCHEDULER_PLUGIN_NAME}: styles`-export const HYDRATE_EFFECT = `${SCHEDULER_PLUGIN_NAME}: hydrate`-export const PANEL_EFFECT = `${SCHEDULER_PLUGIN_NAME}: panel`-export const PREFILL_EFFECT = `${SCHEDULER_PLUGIN_NAME}: prefill`-export const SESSION_ICONS_EFFECT = `${SCHEDULER_PLUGIN_NAME}: session clock icons`+export const LOCALE_EFFECT = `${PLUGIN_ID}: locale`+export const STYLES_EFFECT = `${PLUGIN_ID}: styles`+export const HYDRATE_EFFECT = `${PLUGIN_ID}: hydrate`+export const PANEL_EFFECT = `${PLUGIN_ID}: panel`+export const PREFILL_EFFECT = `${PLUGIN_ID}: prefill`+export const SESSION_ICONS_EFFECT = `${PLUGIN_ID}: session clock icons`diff --git a/packages/dsh-tauri-panel-scheduler/src/host/config/constants.ts b/packages/dsh-tauri-panel-scheduler/src/host/config/constants.tsindex 3975f459..96a6e561 100644--- a/packages/dsh-tauri-panel-scheduler/src/host/config/constants.ts+++ b/packages/dsh-tauri-panel-scheduler/src/host/config/constants.ts@@ -1,4 +1,4 @@-import { SCHEDULER_PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'export const SCHEDULER_TASKS_KEY = 'tasks'export const SCHEDULER_RUNS_KEY = 'runs'@@ -13,7 +13,7 @@ export const SCHEDULER_AGENT_PRESET = 'standard'export const SCHEDULER_UNGROUPED_DIRECTORY = 'automations'export const SCHEDULER_INTERRUPTED_ERROR = 'host_interrupted'-export const SCHEDULER_ROUTES_EFFECT = `${SCHEDULER_PLUGIN_NAME}: routes`-export const SCHEDULER_RECOVER_EFFECT = `${SCHEDULER_PLUGIN_NAME}: recover interrupted runs`-export const SCHEDULER_TICK_EFFECT = `${SCHEDULER_PLUGIN_NAME}: tick`-export const SCHEDULER_RUNTIME_EFFECT = `${SCHEDULER_PLUGIN_NAME}: host runtime`+export const SCHEDULER_ROUTES_EFFECT = `${PLUGIN_ID}: routes`+export const SCHEDULER_RECOVER_EFFECT = `${PLUGIN_ID}: recover interrupted runs`+export const SCHEDULER_TICK_EFFECT = `${PLUGIN_ID}: tick`+export const SCHEDULER_RUNTIME_EFFECT = `${PLUGIN_ID}: host runtime`diff --git a/packages/dsh-tauri-panel-scheduler/src/index.ts b/packages/dsh-tauri-panel-scheduler/src/index.tsindex 33f3ff12..bdc52d3e 100644--- a/packages/dsh-tauri-panel-scheduler/src/index.ts+++ b/packages/dsh-tauri-panel-scheduler/src/index.ts@@ -1,6 +1,6 @@-import { SCHEDULER_API_PREFIX, SCHEDULER_PLUGIN_NAME } from './shared/constants'+import { SCHEDULER_API_PREFIX, PLUGIN_ID } from './shared/constants'-export const name = SCHEDULER_PLUGIN_NAME+export const name = PLUGIN_IDexport const inject = ['tools',diff --git a/packages/dsh-tauri-panel-scheduler/src/shared/constants.ts b/packages/dsh-tauri-panel-scheduler/src/shared/constants.tsindex 2b3236fa..65960e77 100644--- a/packages/dsh-tauri-panel-scheduler/src/shared/constants.ts+++ b/packages/dsh-tauri-panel-scheduler/src/shared/constants.ts@@ -6,7 +6,7 @@*//** 插件名(诊断元数据 / registrant / storage key 前缀)。 */-export const SCHEDULER_PLUGIN_NAME = 'dsh-tauri-panel-scheduler'+export const PLUGIN_ID = 'dsh-tauri-panel-scheduler'/** HTTP 路由前缀(host route + client rpc 同源 fetch)。 */export const SCHEDULER_API_PREFIX = '/api/dsh-scheduler'diff --git a/packages/dsh-tauri-pet/src/client/constants/index.ts b/packages/dsh-tauri-pet/src/client/constants/index.tsindex 28bd2a4e..0f6a569d 100644--- a/packages/dsh-tauri-pet/src/client/constants/index.ts+++ b/packages/dsh-tauri-pet/src/client/constants/index.ts@@ -1,4 +1,4 @@-import { PET_PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'/** settings.section 槽位里的桌宠分区标识与排序权重。 */export const PET_SECTION_ID = 'dsh-tauri-pet-settings'@@ -8,11 +8,11 @@ export const PET_SECTION_ORDER = 230export const PET_STYLES_ID = 'dsh-tauri-pet-styles'export const PET_SETTINGS_STYLES_ID = 'dsh-tauri-pet-settings-styles'export const PET_CARD_STYLES_ID = 'dsh-tauri-pet-card-styles'-export const PET_LOCALE_EFFECT = `${PET_PLUGIN_NAME}: locale`-export const PET_STYLES_EFFECT = `${PET_PLUGIN_NAME}: styles`-export const PET_SECTION_EFFECT = `${PET_PLUGIN_NAME}: settings section`-export const PET_ICON_PATCH_EFFECT = `${PET_PLUGIN_NAME}: sidebar icon patch`-export const PET_PREFILL_EFFECT = `${PET_PLUGIN_NAME}: conversation prefill`+export const PET_LOCALE_EFFECT = `${PLUGIN_ID}: locale`+export const PET_STYLES_EFFECT = `${PLUGIN_ID}: styles`+export const PET_SECTION_EFFECT = `${PLUGIN_ID}: settings section`+export const PET_ICON_PATCH_EFFECT = `${PLUGIN_ID}: sidebar icon patch`+export const PET_PREFILL_EFFECT = `${PLUGIN_ID}: conversation prefill`/** conversation.input.left 槽位里的一次性草稿注入。 */export const CONVERSATION_INPUT_LEFT_SLOT = 'conversation.input.left'diff --git a/packages/dsh-tauri-pet/src/client/index.ts b/packages/dsh-tauri-pet/src/client/index.tsindex ec10a236..806756eb 100644--- a/packages/dsh-tauri-pet/src/client/index.ts+++ b/packages/dsh-tauri-pet/src/client/index.ts@@ -1,5 +1,5 @@import type { ClientContext } from 'dsh-tauri/client'-import { PET_PLUGIN_NAME } from '../shared/constants'+import { PLUGIN_ID } from '../shared/constants'import {PET_ICON_PATCH_EFFECT,PET_LOCALE_EFFECT,@@ -14,7 +14,7 @@ import { sidebarIconFeature } from './register/sidebar-icon'import { stylesFeature } from './register/styles'/** 插件显示名(诊断元数据)。 */-export const name = PET_PLUGIN_NAME+export const name = PLUGIN_ID/** 需要的客户端服务:slots(槽位注册)、locale(双语文案)、sessions/workspaces(新建会话)。 */export const inject = ['slots', 'locale', 'sessions', 'workspaces']diff --git a/packages/dsh-tauri-pet/src/client/locales/index.ts b/packages/dsh-tauri-pet/src/client/locales/index.tsindex ee4589be..f18131bb 100644--- a/packages/dsh-tauri-pet/src/client/locales/index.ts+++ b/packages/dsh-tauri-pet/src/client/locales/index.ts@@ -1,5 +1,5 @@import { defineLocale } from 'dsh-tauri/client'-import { PET_PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'/** 桌宠设置分区的双语文案(`zh` 键集合为权威,`en` 缺键即编译错误)。 */const zh = {@@ -50,4 +50,4 @@ const en: Record<keyof typeof zh, string> = {toggleFailed: 'Failed to toggle the pet',}-export const locale = defineLocale(PET_PLUGIN_NAME, { zh, en })+export const locale = defineLocale(PLUGIN_ID, { zh, en })diff --git a/packages/dsh-tauri-pet/src/client/register/pet-section.ts b/packages/dsh-tauri-pet/src/client/register/pet-section.tsindex ca66cb94..220e53ad 100644--- a/packages/dsh-tauri-pet/src/client/register/pet-section.ts+++ b/packages/dsh-tauri-pet/src/client/register/pet-section.ts@@ -1,6 +1,6 @@import type { ClientContext } from 'dsh-tauri/client'import { defineRegister } from 'dsh-tauri/client'-import { PET_PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'import { PetSettings } from '../components/pet-settings'import { PET_SECTION_ID, PET_SECTION_ORDER } from '../constants'import { locale } from '../locales'@@ -12,7 +12,7 @@ export const petSectionFeature = defineRegister<ClientContext>((controller, ctx,name: 'settings.section',id: PET_SECTION_ID,order: PET_SECTION_ORDER,- registrant: PET_PLUGIN_NAME,+ registrant: PLUGIN_ID,label: () => locale.text('name'),inject: () => ({ onCreate: (close?: () => void) => createPetSession({ adapter, close }) }),} as never, PetSettings as never)))diff --git a/packages/dsh-tauri-pet/src/client/register/prefill.ts b/packages/dsh-tauri-pet/src/client/register/prefill.tsindex 79be22d0..489db034 100644--- a/packages/dsh-tauri-pet/src/client/register/prefill.ts+++ b/packages/dsh-tauri-pet/src/client/register/prefill.ts@@ -1,6 +1,6 @@import type { ClientContext } from 'dsh-tauri/client'import { defineRegister } from 'dsh-tauri/client'-import { PET_PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'import { PetPrefill } from '../components/prefill'import {CONVERSATION_INPUT_LEFT_SLOT,@@ -16,7 +16,7 @@ export const prefillFeature = defineRegister<ClientContext>((controller, ctx) =>id: PET_PREFILL_ID,order: PET_PREFILL_ORDER,priority: PET_PREFILL_PRIORITY,- registrant: PET_PLUGIN_NAME,+ registrant: PLUGIN_ID,inject: (sessionId: string) => ({ sessionId }),} as never, PetPrefill)))})diff --git a/packages/dsh-tauri-pet/src/index.ts b/packages/dsh-tauri-pet/src/index.tsindex 20ac023e..6ffbca99 100644--- a/packages/dsh-tauri-pet/src/index.ts+++ b/packages/dsh-tauri-pet/src/index.ts@@ -1,6 +1,6 @@-import { PET_PLUGIN_NAME } from './shared/constants'+import { PLUGIN_ID } from './shared/constants'-export const name = PET_PLUGIN_NAME+export const name = PLUGIN_ID/** 需要的宿主服务:webServer(SSE 路由)、sessions(session/event 总线)、connection(路由工具的连接信任边界)。 */export const inject = ['webServer', 'sessions', 'connection']diff --git a/packages/dsh-tauri-pet/src/shared/constants.ts b/packages/dsh-tauri-pet/src/shared/constants.tsindex f6f589f7..78143c6b 100644--- a/packages/dsh-tauri-pet/src/shared/constants.ts+++ b/packages/dsh-tauri-pet/src/shared/constants.ts@@ -6,7 +6,7 @@*//** 插件名(诊断元数据、locale 命名空间与注册标识)。 */-export const PET_PLUGIN_NAME = 'dsh-tauri-pet'+export const PLUGIN_ID = 'dsh-tauri-pet'/** 桌宠会话增量 SSE 流路径(Rust 按 `http://127.0.0.1:<DSH_WEB_PORT>` + 此路径订阅)。 */export const SESSION_STREAM_PATH = '/api/dsh-pet/session-stream'diff --git a/packages/dsh-tauri-rightclick/src/client/constants/index.ts b/packages/dsh-tauri-rightclick/src/client/constants/index.tsindex dd8e6dab..b665b049 100644--- a/packages/dsh-tauri-rightclick/src/client/constants/index.ts+++ b/packages/dsh-tauri-rightclick/src/client/constants/index.ts@@ -1,17 +1,17 @@-import { RIGHTCLICK_PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'export {OPEN_PATH_ROUTE,OPEN_URL_ROUTE,RIGHTCLICK_API_PREFIX,- RIGHTCLICK_PLUGIN_NAME,+ PLUGIN_ID,} from '../../shared/constants'-export const LOCALE_EFFECT = `${RIGHTCLICK_PLUGIN_NAME}: locale`-export const STYLES_EFFECT = `${RIGHTCLICK_PLUGIN_NAME}: styles`-export const CONTEXT_MENU_EFFECT = `${RIGHTCLICK_PLUGIN_NAME}: context menu`+export const LOCALE_EFFECT = `${PLUGIN_ID}: locale`+export const STYLES_EFFECT = `${PLUGIN_ID}: styles`+export const CONTEXT_MENU_EFFECT = `${PLUGIN_ID}: context menu`-export const MENU_STYLE_ID = `${RIGHTCLICK_PLUGIN_NAME}-menu-styles`+export const MENU_STYLE_ID = `${PLUGIN_ID}-menu-styles`export const MENU_BLOCK = 'dshp-menu'export const MENU_ITEM_CLASS = `${MENU_BLOCK}__item`diff --git a/packages/dsh-tauri-rightclick/src/client/index.ts b/packages/dsh-tauri-rightclick/src/client/index.tsindex fd2b5d62..cfa435a8 100644--- a/packages/dsh-tauri-rightclick/src/client/index.ts+++ b/packages/dsh-tauri-rightclick/src/client/index.ts@@ -1,10 +1,10 @@import type { ClientContext } from 'dsh-tauri/client'-import { CONTEXT_MENU_EFFECT, LOCALE_EFFECT, RIGHTCLICK_PLUGIN_NAME, STYLES_EFFECT } from './constants'+import { CONTEXT_MENU_EFFECT, LOCALE_EFFECT, PLUGIN_ID, STYLES_EFFECT } from './constants'import { locale } from './locales'import { contextMenuFeature } from './register/context-menu'import { stylesFeature } from './register/styles'-export const name = RIGHTCLICK_PLUGIN_NAME+export const name = PLUGIN_IDexport const inject = ['locale', 'sessions', 'workspaces']diff --git a/packages/dsh-tauri-rightclick/src/client/locales/index.ts b/packages/dsh-tauri-rightclick/src/client/locales/index.tsindex a1f2ee86..bad77608 100644--- a/packages/dsh-tauri-rightclick/src/client/locales/index.ts+++ b/packages/dsh-tauri-rightclick/src/client/locales/index.ts@@ -1,5 +1,5 @@import { defineLocale } from 'dsh-tauri/client'-import { RIGHTCLICK_PLUGIN_NAME } from '../constants'+import { PLUGIN_ID } from '../constants'const zh = {renameSession: '重命名会话',@@ -133,4 +133,4 @@ const en: Record<keyof typeof zh, string> = {editPositionUnknown: 'Could not determine the editing position',}-export const locale = defineLocale(RIGHTCLICK_PLUGIN_NAME, { zh, en })+export const locale = defineLocale(PLUGIN_ID, { zh, en })diff --git a/packages/dsh-tauri-rightclick/src/host/config/constants.ts b/packages/dsh-tauri-rightclick/src/host/config/constants.tsindex aa5012d8..da7ab549 100644--- a/packages/dsh-tauri-rightclick/src/host/config/constants.ts+++ b/packages/dsh-tauri-rightclick/src/host/config/constants.ts@@ -1,7 +1,7 @@-import { RIGHTCLICK_PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'-export const ROUTES_EFFECT = `${RIGHTCLICK_PLUGIN_NAME}: routes`-export const HOST_RUNTIME_EFFECT = `${RIGHTCLICK_PLUGIN_NAME}: host runtime`+export const ROUTES_EFFECT = `${PLUGIN_ID}: routes`+export const HOST_RUNTIME_EFFECT = `${PLUGIN_ID}: host runtime`/** 只接受同源 JSON POST:readBody 会忽略 Content-Type,这道闸缺了就会放行 text/plain。 */export const JSON_CONTENT_TYPE = /^application\/json(?:\s*;|$)/idiff --git a/packages/dsh-tauri-rightclick/src/host/service/opener.ts b/packages/dsh-tauri-rightclick/src/host/service/opener.tsindex 5cbaa7a2..4b02900d 100644--- a/packages/dsh-tauri-rightclick/src/host/service/opener.ts+++ b/packages/dsh-tauri-rightclick/src/host/service/opener.ts@@ -1,6 +1,6 @@import type { OperationResult } from '../types'import { defineService, openDirectory, openUrl } from 'dsh-tauri'-import { RIGHTCLICK_PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'import { getCurrentHostInstance } from '../config/runtime'import { mutationQueue } from './mutation-queue'@@ -37,7 +37,7 @@ export const opener = defineService({function warn(message: string, error: unknown): void {try {- getCurrentHostInstance().logger?.warn?.(`[${RIGHTCLICK_PLUGIN_NAME}] ${message}:`, error)+ getCurrentHostInstance().logger?.warn?.(`[${PLUGIN_ID}] ${message}:`, error)}catch {}}diff --git a/packages/dsh-tauri-rightclick/src/index.ts b/packages/dsh-tauri-rightclick/src/index.tsindex d4ad8b55..07214072 100644--- a/packages/dsh-tauri-rightclick/src/index.ts+++ b/packages/dsh-tauri-rightclick/src/index.ts@@ -1,6 +1,6 @@-import { RIGHTCLICK_API_PREFIX, RIGHTCLICK_PLUGIN_NAME } from './shared/constants'+import { RIGHTCLICK_API_PREFIX, PLUGIN_ID } from './shared/constants'-export const name = RIGHTCLICK_PLUGIN_NAME+export const name = PLUGIN_IDexport const inject = ['webServer', 'connection']diff --git a/packages/dsh-tauri-rightclick/src/shared/constants.ts b/packages/dsh-tauri-rightclick/src/shared/constants.tsindex a04345f9..e6a00543 100644--- a/packages/dsh-tauri-rightclick/src/shared/constants.ts+++ b/packages/dsh-tauri-rightclick/src/shared/constants.ts@@ -1,4 +1,4 @@-export const RIGHTCLICK_PLUGIN_NAME = 'dsh-tauri-rightclick'+export const PLUGIN_ID = 'dsh-tauri-rightclick'export const RIGHTCLICK_API_PREFIX = '/api/dsh-rightclick-menu'diff --git a/packages/dsh-tauri-session/src/client/constants/index.ts b/packages/dsh-tauri-session/src/client/constants/index.tsindex 4c6df6d3..736518b1 100644--- a/packages/dsh-tauri-session/src/client/constants/index.ts+++ b/packages/dsh-tauri-session/src/client/constants/index.ts@@ -1,18 +1,18 @@-import { SESSION_PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'-export { SESSION_API_PREFIX, SESSION_PLUGIN_NAME, SESSION_SECTION_ORDER } from '../../shared/constants'+export { SESSION_API_PREFIX, PLUGIN_ID, SESSION_SECTION_ORDER } from '../../shared/constants'export const SETTINGS_SECTION_SLOT = 'settings.section'-export const SESSION_REGISTRANT = SESSION_PLUGIN_NAME-export const SESSION_SECTION_ID = `${SESSION_PLUGIN_NAME}-archive`+export const SESSION_REGISTRANT = PLUGIN_ID+export const SESSION_SECTION_ID = `${PLUGIN_ID}-archive`-export const SESSION_STYLE_ID = `${SESSION_PLUGIN_NAME}-styles`-export const SESSION_MENU_STYLE_ID = `${SESSION_PLUGIN_NAME}-menu-styles`+export const SESSION_STYLE_ID = `${PLUGIN_ID}-styles`+export const SESSION_MENU_STYLE_ID = `${PLUGIN_ID}-menu-styles`-export const LOCALE_EFFECT = `${SESSION_PLUGIN_NAME}: locale`-export const STYLES_EFFECT = `${SESSION_PLUGIN_NAME}: styles`-export const ARCHIVE_SECTION_EFFECT = `${SESSION_PLUGIN_NAME}: archive section`-export const WORKSPACE_PATCH_EFFECT = `${SESSION_PLUGIN_NAME}: workspace archive patch`+export const LOCALE_EFFECT = `${PLUGIN_ID}: locale`+export const STYLES_EFFECT = `${PLUGIN_ID}: styles`+export const ARCHIVE_SECTION_EFFECT = `${PLUGIN_ID}: archive section`+export const WORKSPACE_PATCH_EFFECT = `${PLUGIN_ID}: workspace archive patch`export const ARCHIVE_RESYNC_TIMEOUT_MS = 2_000export const SIDEBAR_ATTACH_POLL_MS = 500diff --git a/packages/dsh-tauri-session/src/client/index.ts b/packages/dsh-tauri-session/src/client/index.tsindex 845a400a..a89407aa 100644--- a/packages/dsh-tauri-session/src/client/index.ts+++ b/packages/dsh-tauri-session/src/client/index.ts@@ -2,7 +2,7 @@ import type { ClientContext } from 'dsh-tauri/client'import {ARCHIVE_SECTION_EFFECT,LOCALE_EFFECT,- SESSION_PLUGIN_NAME,+ PLUGIN_ID,STYLES_EFFECT,WORKSPACE_PATCH_EFFECT,} from './constants'@@ -11,7 +11,7 @@ import { archiveSectionFeature } from './register/archive-section'import { stylesFeature } from './register/styles'import { workspacePatchFeature } from './register/workspace-patch'-export const name = SESSION_PLUGIN_NAME+export const name = PLUGIN_IDexport const inject = ['slots', 'locale', 'sessions', 'workspaces']diff --git a/packages/dsh-tauri-session/src/client/locales/index.ts b/packages/dsh-tauri-session/src/client/locales/index.tsindex 8fec1102..39c50294 100644--- a/packages/dsh-tauri-session/src/client/locales/index.ts+++ b/packages/dsh-tauri-session/src/client/locales/index.ts@@ -1,5 +1,5 @@import { defineLocale } from 'dsh-tauri/client'-import { SESSION_PLUGIN_NAME } from '../constants'+import { PLUGIN_ID } from '../constants'const zh = {section: '归档',@@ -75,4 +75,4 @@ const en: Record<keyof typeof zh, string> = {openFailed: 'Failed to open directory: {reason}',}-export const locale = defineLocale(SESSION_PLUGIN_NAME, { zh, en })+export const locale = defineLocale(PLUGIN_ID, { zh, en })diff --git a/packages/dsh-tauri-session/src/host/apply.ts b/packages/dsh-tauri-session/src/host/apply.tsindex 70c37316..76a50bd6 100644--- a/packages/dsh-tauri-session/src/host/apply.ts+++ b/packages/dsh-tauri-session/src/host/apply.ts@@ -1,12 +1,12 @@import type { HostContext } from 'dsh-tauri'import type { SessionHost } from './config/runtime.types'-import { SESSION_PLUGIN_NAME } from '../shared/constants'+import { PLUGIN_ID } from '../shared/constants'import { clearHostRuntime, setCurrentHostInstance } from './config/runtime'import { routes } from './routes'export function apply(ctx: HostContext): void {setCurrentHostInstance(ctx as unknown as SessionHost)- ctx.effect(() => routes(ctx), `${SESSION_PLUGIN_NAME}: routes`)- ctx.effect(() => () => clearHostRuntime(), `${SESSION_PLUGIN_NAME}: host runtime`)+ ctx.effect(() => routes(ctx), `${PLUGIN_ID}: routes`)+ ctx.effect(() => () => clearHostRuntime(), `${PLUGIN_ID}: host runtime`)}diff --git a/packages/dsh-tauri-session/src/index.ts b/packages/dsh-tauri-session/src/index.tsindex f7f8cb11..56d3a9cb 100644--- a/packages/dsh-tauri-session/src/index.ts+++ b/packages/dsh-tauri-session/src/index.ts@@ -1,6 +1,6 @@-import { SESSION_API_PREFIX, SESSION_PLUGIN_NAME } from './shared/constants'+import { SESSION_API_PREFIX, PLUGIN_ID } from './shared/constants'-export const name = SESSION_PLUGIN_NAME+export const name = PLUGIN_IDexport const inject = ['webServer', 'sessions', 'workspaceRegistry', 'connection']diff --git a/packages/dsh-tauri-session/src/shared/constants.ts b/packages/dsh-tauri-session/src/shared/constants.tsindex 0c24b933..280d1696 100644--- a/packages/dsh-tauri-session/src/shared/constants.ts+++ b/packages/dsh-tauri-session/src/shared/constants.ts@@ -1,7 +1,7 @@/** shared/constants.ts — 跨 host/client 的稳定协议常量(session 归档管理)。 *//** 插件名(诊断元数据 / registrant)。 */-export const SESSION_PLUGIN_NAME = 'dsh-tauri-session'+export const PLUGIN_ID = 'dsh-tauri-session'/** HTTP 路由前缀(host route + client rpc 同源 fetch)。 */export const SESSION_API_PREFIX = '/api/dsh-session'diff --git a/packages/dsh-tauri-turnrewind/src/client/constants/index.ts b/packages/dsh-tauri-turnrewind/src/client/constants/index.tsindex b5c466fb..437658d4 100644--- a/packages/dsh-tauri-turnrewind/src/client/constants/index.ts+++ b/packages/dsh-tauri-turnrewind/src/client/constants/index.ts@@ -2,9 +2,9 @@* client/constants/index.ts — 客户端静态常量(跨 half 协议常量见 shared/constants.ts)。*/-import { TURNREWIND_PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'-export { TURNREWIND_PLUGIN_NAME } from '../../shared/constants'+export { PLUGIN_ID } from '../../shared/constants'/*** 完成一轮对话的尾部槽位(chain 型)。@@ -24,22 +24,22 @@ export const TURNREWIND_TURN_TAIL_PRIORITY = -1*/export const TURNREWIND_INPUT_DOCK_SLOT = 'conversation.input.dock'-export const TURNREWIND_RUNNING_CHIP_ID = `${TURNREWIND_PLUGIN_NAME}-running-changes`+export const TURNREWIND_RUNNING_CHIP_ID = `${PLUGIN_ID}-running-changes`export const TURNREWIND_RUNNING_CHIP_ORDER = -30/** 运行中提示条的客户端轮询间隔;宿主端另有 1.5s 的 git 刷新节奏。 */export const TURNREWIND_LIVE_POLL_INTERVAL_MS = 1200/** 卡片与提示条的 css-render style id。 */-export const TURNREWIND_CARD_STYLE_ID = `${TURNREWIND_PLUGIN_NAME}/TurnChangesCard.module.css`-export const TURNREWIND_CHIP_STYLE_ID = `${TURNREWIND_PLUGIN_NAME}/RunningChangesChip.module.css`-export const TURNREWIND_COUNTS_STYLE_ID = `${TURNREWIND_PLUGIN_NAME}/ChangeCounts.module.css`+export const TURNREWIND_CARD_STYLE_ID = `${PLUGIN_ID}/TurnChangesCard.module.css`+export const TURNREWIND_CHIP_STYLE_ID = `${PLUGIN_ID}/RunningChangesChip.module.css`+export const TURNREWIND_COUNTS_STYLE_ID = `${PLUGIN_ID}/ChangeCounts.module.css`/** effect 标签(诊断/日志)。 */-export const TURNREWIND_LOCALE_EFFECT = `${TURNREWIND_PLUGIN_NAME}: locale`-export const TURNREWIND_SUMMARY_EFFECT = `${TURNREWIND_PLUGIN_NAME}: summary retry`-export const TURNREWIND_TURN_TAIL_EFFECT = `${TURNREWIND_PLUGIN_NAME}: turn tail`-export const TURNREWIND_RUNNING_CHIP_EFFECT = `${TURNREWIND_PLUGIN_NAME}: running chip`+export const TURNREWIND_LOCALE_EFFECT = `${PLUGIN_ID}: locale`+export const TURNREWIND_SUMMARY_EFFECT = `${PLUGIN_ID}: summary retry`+export const TURNREWIND_TURN_TAIL_EFFECT = `${PLUGIN_ID}: turn tail`+export const TURNREWIND_RUNNING_CHIP_EFFECT = `${PLUGIN_ID}: running chip`/*** 「应用内右侧边栏」服务名(新内核由 `dsh-client-ui-sidebar-right` 发布)。diff --git a/packages/dsh-tauri-turnrewind/src/client/index.ts b/packages/dsh-tauri-turnrewind/src/client/index.tsindex f834e846..1f231e84 100644--- a/packages/dsh-tauri-turnrewind/src/client/index.ts+++ b/packages/dsh-tauri-turnrewind/src/client/index.ts@@ -11,7 +11,7 @@import type { ClientContext } from 'dsh-tauri/client'import {TURNREWIND_LOCALE_EFFECT,- TURNREWIND_PLUGIN_NAME,+ PLUGIN_ID,TURNREWIND_RUNNING_CHIP_EFFECT,TURNREWIND_SUMMARY_EFFECT,TURNREWIND_TURN_TAIL_EFFECT,@@ -24,7 +24,7 @@ import { turnTailFeature } from './register/turn-tail'export type * from './types'/** 插件显示名(诊断元数据)。 */-export const name = TURNREWIND_PLUGIN_NAME+export const name = PLUGIN_ID/** 需要的客户端服务:slots(槽位注册)、locale(双语文案)。 */export const inject = ['slots', 'locale']diff --git a/packages/dsh-tauri-turnrewind/src/client/locales/index.ts b/packages/dsh-tauri-turnrewind/src/client/locales/index.tsindex 2c8b84b9..69455517 100644--- a/packages/dsh-tauri-turnrewind/src/client/locales/index.ts+++ b/packages/dsh-tauri-turnrewind/src/client/locales/index.ts@@ -8,7 +8,7 @@import type { LocaleKey } from '../types'import { defineLocale } from 'dsh-tauri/client'-import { TURNREWIND_PLUGIN_NAME } from '../constants'+import { PLUGIN_ID } from '../constants'/** zh 字典(键集合的权威)。 */const zh = {@@ -66,4 +66,4 @@ const en: Record<LocaleKey, string> = {openFile: 'Open {name}',}-export const locale = defineLocale(TURNREWIND_PLUGIN_NAME, { zh, en })+export const locale = defineLocale(PLUGIN_ID, { zh, en })diff --git a/packages/dsh-tauri-turnrewind/src/client/register/running-chip.ts b/packages/dsh-tauri-turnrewind/src/client/register/running-chip.tsindex d876c21a..808f40a0 100644--- a/packages/dsh-tauri-turnrewind/src/client/register/running-chip.ts+++ b/packages/dsh-tauri-turnrewind/src/client/register/running-chip.ts@@ -10,7 +10,7 @@ import { defineRegister } from 'dsh-tauri/client'import { RunningChangesChip } from '../components/running-changes-chip'import {TURNREWIND_INPUT_DOCK_SLOT,- TURNREWIND_PLUGIN_NAME,+ PLUGIN_ID,TURNREWIND_RUNNING_CHIP_ID,TURNREWIND_RUNNING_CHIP_ORDER,} from '../constants'@@ -24,7 +24,7 @@ export const runningChipFeature = defineRegister<ClientContext>((controller, ctxname: TURNREWIND_INPUT_DOCK_SLOT,id: TURNREWIND_RUNNING_CHIP_ID,order: TURNREWIND_RUNNING_CHIP_ORDER,- registrant: TURNREWIND_PLUGIN_NAME,+ registrant: PLUGIN_ID,inject: (sessionId?: string) => ({ sessionId }),} as never,RunningChangesChip as never,diff --git a/packages/dsh-tauri-turnrewind/src/client/register/turn-tail.ts b/packages/dsh-tauri-turnrewind/src/client/register/turn-tail.tsindex 1edcfc83..ce1df04a 100644--- a/packages/dsh-tauri-turnrewind/src/client/register/turn-tail.ts+++ b/packages/dsh-tauri-turnrewind/src/client/register/turn-tail.ts@@ -14,7 +14,7 @@ import type { ClientContext } from 'dsh-tauri/client'import { defineRegister } from 'dsh-tauri/client'import { TurnChangesCard } from '../components/turn-changes-card'import {- TURNREWIND_PLUGIN_NAME,+ PLUGIN_ID,TURNREWIND_TURN_TAIL_PRIORITY,TURNREWIND_TURN_TAIL_SLOT,} from '../constants'@@ -32,7 +32,7 @@ export const turnTailFeature = defineRegister<ClientContext>((controller, ctx) =ctx.slots.register({name: TURNREWIND_TURN_TAIL_SLOT,- registrant: TURNREWIND_PLUGIN_NAME,+ registrant: PLUGIN_ID,priority: TURNREWIND_TURN_TAIL_PRIORITY,select: (owner: TurnTailOwnerLike) => ({ turn: owner?.turn?.turn ?? 0 }),inject: (sessionId?: string) => ({ sessionId, capabilities: readCapabilities(ctx) }),diff --git a/packages/dsh-tauri-turnrewind/src/host/apply.ts b/packages/dsh-tauri-turnrewind/src/host/apply.tsindex ae633631..73807318 100644--- a/packages/dsh-tauri-turnrewind/src/host/apply.ts+++ b/packages/dsh-tauri-turnrewind/src/host/apply.ts@@ -5,7 +5,7 @@*/import type { HostContext } from './types'-import { TURNREWIND_PLUGIN_NAME } from '../shared/constants'+import { PLUGIN_ID } from '../shared/constants'import { clearHostRuntime, resetHostRuntime, setCurrentHostInstance } from './config/runtime'import { handleAgentStatus } from './events/agent-status'import { handlePreStep } from './events/pre-step'@@ -23,7 +23,7 @@ export function apply(ctx: HostContext): void {ctx.on('agent/status', handleAgentStatus)ctx.on('session/disposed', handleSessionDisposed)- ctx.effect(() => routes(ctx), `${TURNREWIND_PLUGIN_NAME}: routes`)- ctx.effect(() => () => capture.dispose(), `${TURNREWIND_PLUGIN_NAME}: turn capture`)- ctx.effect(() => () => clearHostRuntime(), `${TURNREWIND_PLUGIN_NAME}: host runtime`)+ ctx.effect(() => routes(ctx), `${PLUGIN_ID}: routes`)+ ctx.effect(() => () => capture.dispose(), `${PLUGIN_ID}: turn capture`)+ ctx.effect(() => () => clearHostRuntime(), `${PLUGIN_ID}: host runtime`)}diff --git a/packages/dsh-tauri-turnrewind/src/host/config/constants.ts b/packages/dsh-tauri-turnrewind/src/host/config/constants.tsindex f229c191..5a958575 100644--- a/packages/dsh-tauri-turnrewind/src/host/config/constants.ts+++ b/packages/dsh-tauri-turnrewind/src/host/config/constants.ts@@ -6,7 +6,7 @@*/import {- TURNREWIND_PLUGIN_NAME,+ PLUGIN_ID,TURNREWIND_REASON_EXPIRED,TURNREWIND_REASON_GIT_REQUIRED,TURNREWIND_REASON_GIT_UNAVAILABLE,@@ -19,7 +19,7 @@ import {export const SNAPSHOT_REF_PREFIX = 'refs/turnrewind'/** 每个工作区私有快照仓与每会话账本的存放目录(DSH_HOME 下)。 */-export const SNAPSHOT_FEATURE_DIR = TURNREWIND_PLUGIN_NAME+export const SNAPSHOT_FEATURE_DIR = PLUGIN_ID/** 账本子目录(`$DSH_HOME/<feature>/sessions`)。 */export const LEDGER_SUBDIR = 'sessions'diff --git a/packages/dsh-tauri-turnrewind/src/host/events/agent-status.ts b/packages/dsh-tauri-turnrewind/src/host/events/agent-status.tsindex 90c31305..5c840dbf 100644--- a/packages/dsh-tauri-turnrewind/src/host/events/agent-status.ts+++ b/packages/dsh-tauri-turnrewind/src/host/events/agent-status.ts@@ -1,4 +1,4 @@-import { TURNREWIND_PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'import { capture } from '../service/capture'/**@@ -13,6 +13,6 @@ export function handleAgentStatus(payload: any): void {returncapture.resetLive(sessionId)void capture.settleIdle(sessionId).catch((error: unknown) => {- console.warn(`${TURNREWIND_PLUGIN_NAME}: idle settle failed: ${String(error)}`)+ console.warn(`${PLUGIN_ID}: idle settle failed: ${String(error)}`)})}diff --git a/packages/dsh-tauri-turnrewind/src/host/events/pre-step.ts b/packages/dsh-tauri-turnrewind/src/host/events/pre-step.tsindex fafc426e..ce2e1588 100644--- a/packages/dsh-tauri-turnrewind/src/host/events/pre-step.ts+++ b/packages/dsh-tauri-turnrewind/src/host/events/pre-step.ts@@ -1,4 +1,4 @@-import { TURNREWIND_PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'import { capture } from '../service/capture'/**@@ -12,7 +12,7 @@ export async function handlePreStep(payload: any, next: () => Promise<any>): Proawait capture.begin(sessionId, payload.turn)}catch (error) {- console.warn(`${TURNREWIND_PLUGIN_NAME}: before snapshot failed: ${String(error)}`)+ console.warn(`${PLUGIN_ID}: before snapshot failed: ${String(error)}`)}return next()}diff --git a/packages/dsh-tauri-turnrewind/src/host/events/session-event.ts b/packages/dsh-tauri-turnrewind/src/host/events/session-event.tsindex e4938d95..2e33239b 100644--- a/packages/dsh-tauri-turnrewind/src/host/events/session-event.ts+++ b/packages/dsh-tauri-turnrewind/src/host/events/session-event.ts@@ -1,4 +1,4 @@-import { TURNREWIND_PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'import { capture } from '../service/capture'/**@@ -13,6 +13,6 @@ export function handleSessionEvent(session: any, event: any): void {returncapture.resetLive(session.id, turn)void capture.settle(session.id, turn).catch((error: unknown) => {- console.warn(`${TURNREWIND_PLUGIN_NAME}: settle turn failed: ${String(error)}`)+ console.warn(`${PLUGIN_ID}: settle turn failed: ${String(error)}`)})}diff --git a/packages/dsh-tauri-turnrewind/src/host/service/capture.test.ts b/packages/dsh-tauri-turnrewind/src/host/service/capture.test.tsindex a1f0c0ba..fb01e241 100644--- a/packages/dsh-tauri-turnrewind/src/host/service/capture.test.ts+++ b/packages/dsh-tauri-turnrewind/src/host/service/capture.test.ts@@ -6,7 +6,7 @@ import { promisify } from 'node:util'import { join } from 'pathe'import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'import { resetTestDshHome, testDshHome } from '../../../../.test/test-utils'-import { TURNREWIND_PLUGIN_NAME, TURNREWIND_REASON_SNAPSHOT_FAILED } from '../../shared/constants'+import { PLUGIN_ID, TURNREWIND_REASON_SNAPSHOT_FAILED } from '../../shared/constants'import { clearHostRuntime, resetHostRuntime, setCurrentHostInstance, workspaceQueue } from '../config/runtime'import { turnrewindHooks } from '../events'import { capture } from './capture'@@ -51,7 +51,7 @@ async function fixture(): Promise<{ worktree: string }> {beforeEach(() => {resetTestDshHome()// 账本与私有快照仓都在 <DSH_HOME>/<feature> 下,resetTestDshHome 不清这个目录。- rmSync(join(testDshHome, TURNREWIND_PLUGIN_NAME), { recursive: true, force: true })+ rmSync(join(testDshHome, PLUGIN_ID), { recursive: true, force: true })resetHostRuntime()})diff --git a/packages/dsh-tauri-turnrewind/src/host/service/undo.test.ts b/packages/dsh-tauri-turnrewind/src/host/service/undo.test.tsindex 3731971b..408743bc 100644--- a/packages/dsh-tauri-turnrewind/src/host/service/undo.test.ts+++ b/packages/dsh-tauri-turnrewind/src/host/service/undo.test.ts@@ -7,7 +7,7 @@ import { promisify } from 'node:util'import { join } from 'pathe'import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'import { resetTestDshHome, testDshHome } from '../../../../.test/test-utils'-import { TURNREWIND_PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'import { REASON_ALREADY_UNDONE, REASON_CONFLICT, REASON_EXPIRED, REASON_GIT_REQUIRED, REASON_TURN_ACTIVE } from '../config/constants'import { clearHostRuntime, resetHostRuntime, setCurrentHostInstance } from '../config/runtime'import { capture } from './capture'@@ -102,7 +102,7 @@ async function fixture(): Promise<Fixture> {beforeEach(() => {resetTestDshHome()// 账本与私有快照仓都在 <DSH_HOME>/<feature> 下,resetTestDshHome 不清这个目录。- rmSync(join(testDshHome, TURNREWIND_PLUGIN_NAME), { recursive: true, force: true })+ rmSync(join(testDshHome, PLUGIN_ID), { recursive: true, force: true })resetHostRuntime()})diff --git a/packages/dsh-tauri-turnrewind/src/index.ts b/packages/dsh-tauri-turnrewind/src/index.tsindex 7fa715f5..81d27ecf 100644--- a/packages/dsh-tauri-turnrewind/src/index.ts+++ b/packages/dsh-tauri-turnrewind/src/index.ts@@ -10,9 +10,9 @@* 该服务必须进 inject,否则 cordis 在请求期抛 `cannot get property without inject`)。*/-import { TURNREWIND_API_PREFIX, TURNREWIND_PLUGIN_NAME } from './shared/constants'+import { TURNREWIND_API_PREFIX, PLUGIN_ID } from './shared/constants'-export const name = TURNREWIND_PLUGIN_NAME+export const name = PLUGIN_IDexport const inject = ['webServer', 'sessions', 'agents', 'connection']diff --git a/packages/dsh-tauri-turnrewind/src/shared/constants.ts b/packages/dsh-tauri-turnrewind/src/shared/constants.tsindex 3100f668..c8ed0dbd 100644--- a/packages/dsh-tauri-turnrewind/src/shared/constants.ts+++ b/packages/dsh-tauri-turnrewind/src/shared/constants.ts@@ -7,7 +7,7 @@*//** 插件名(诊断元数据 / registrant / 存储目录名)。 */-export const TURNREWIND_PLUGIN_NAME = 'dsh-tauri-turnrewind'+export const PLUGIN_ID = 'dsh-tauri-turnrewind'/** HTTP 路由前缀(host 注册 + client 同源 fetch)。 */export const TURNREWIND_API_PREFIX = '/api/turnrewind'diff --git a/packages/dsh-tauri-ui/src/client/constants/index.ts b/packages/dsh-tauri-ui/src/client/constants/index.tsindex 6325ec74..224ee05b 100644--- a/packages/dsh-tauri-ui/src/client/constants/index.ts+++ b/packages/dsh-tauri-ui/src/client/constants/index.ts@@ -1,7 +1,7 @@-import { PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'-export const SETTINGS_REGISTRANT = PLUGIN_NAME-export const SETTINGS_SHELL_SEAT_ID = PLUGIN_NAME+export const SETTINGS_REGISTRANT = PLUGIN_ID+export const SETTINGS_SHELL_SEAT_ID = PLUGIN_IDexport const SETTINGS_SHELL_OVERLAY_SLOT = 'shell.overlay'export const SETTINGS_SIDEBAR_SLOT = 'sidebar.settings'@@ -18,12 +18,12 @@ export const MENU_SELECT_STYLE_ID = 'dsh-tauri-ui-menu-select-styles'export const TURN_NAVIGATION_STYLE_ID = 'dsh-tauri-ui-turn-navigation-styles'export const GLOBAL_STYLE_ID = 'dsh-tauri-ui-global-styles'-export const STYLES_EFFECT = `${PLUGIN_NAME}: styles`-export const LOCALE_EFFECT = `${PLUGIN_NAME}: locale`-export const SEAT_EFFECT = `${PLUGIN_NAME}: shell.overlay seat`-export const SECTIONS_EFFECT = `${PLUGIN_NAME}: settings sections projection`-export const SETTINGS_EFFECT = `${PLUGIN_NAME}: settings panel`-export const OBSTRUCTIONS_EFFECT = `${PLUGIN_NAME}: settings obstructions`+export const STYLES_EFFECT = `${PLUGIN_ID}: styles`+export const LOCALE_EFFECT = `${PLUGIN_ID}: locale`+export const SEAT_EFFECT = `${PLUGIN_ID}: shell.overlay seat`+export const SECTIONS_EFFECT = `${PLUGIN_ID}: settings sections projection`+export const SETTINGS_EFFECT = `${PLUGIN_ID}: settings panel`+export const OBSTRUCTIONS_EFFECT = `${PLUGIN_ID}: settings obstructions`export const TURN_NAVIGATION_LABEL_ZH = '轮次导航'export const TURN_NAVIGATION_LABEL_EN = 'Turn navigation'diff --git a/packages/dsh-tauri-ui/src/client/index.ts b/packages/dsh-tauri-ui/src/client/index.tsindex e5b44310..76ac2535 100644--- a/packages/dsh-tauri-ui/src/client/index.ts+++ b/packages/dsh-tauri-ui/src/client/index.ts@@ -1,6 +1,6 @@import type {} from '@deepseek-ai/dsh-client-ui-layout/client'import type { ClientContext } from 'dsh-tauri/client'-import { PLUGIN_NAME } from '../shared/constants'+import { PLUGIN_ID } from '../shared/constants'import {LOCALE_EFFECT,OBSTRUCTIONS_EFFECT,@@ -29,7 +29,7 @@ export type * from './types/selector'export * from './utils/cssr'export * from './utils/style'-export const name = PLUGIN_NAME+export const name = PLUGIN_IDexport const inject = ['slots', 'layout', 'locale']export function apply(ctx: ClientContext): void {diff --git a/packages/dsh-tauri-ui/src/client/locales/index.ts b/packages/dsh-tauri-ui/src/client/locales/index.tsindex c95f6020..9db05480 100644--- a/packages/dsh-tauri-ui/src/client/locales/index.ts+++ b/packages/dsh-tauri-ui/src/client/locales/index.ts@@ -1,7 +1,7 @@import { defineLocale } from 'dsh-tauri/client'-import { PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'-export const locale = defineLocale(PLUGIN_NAME, {+export const locale = defineLocale(PLUGIN_ID, {zh: {back: '返回应用',search: '搜索设置…',diff --git a/packages/dsh-tauri-ui/src/index.ts b/packages/dsh-tauri-ui/src/index.tsindex 37395067..b97d2f72 100644--- a/packages/dsh-tauri-ui/src/index.ts+++ b/packages/dsh-tauri-ui/src/index.ts@@ -1,5 +1,5 @@-import { PLUGIN_NAME } from './shared/constants'+import { PLUGIN_ID } from './shared/constants'export { apply } from './host/apply'-export const name = PLUGIN_NAME+export const name = PLUGIN_IDdiff --git a/packages/dsh-tauri-ui/src/shared/constants.ts b/packages/dsh-tauri-ui/src/shared/constants.tsindex b68e9b74..2a971335 100644--- a/packages/dsh-tauri-ui/src/shared/constants.ts+++ b/packages/dsh-tauri-ui/src/shared/constants.ts@@ -1 +1 @@-export const PLUGIN_NAME = 'dsh-tauri-ui'+export const PLUGIN_ID = 'dsh-tauri-ui'diff --git a/packages/dsh-tauri-worktree/src/client/constants/index.ts b/packages/dsh-tauri-worktree/src/client/constants/index.tsindex 272b8136..fb1ecd9e 100644--- a/packages/dsh-tauri-worktree/src/client/constants/index.ts+++ b/packages/dsh-tauri-worktree/src/client/constants/index.ts@@ -1,23 +1,23 @@-import { WORKTREE_PLUGIN_NAME } from '../../shared/constants'+import { PLUGIN_ID } from '../../shared/constants'-export { WORKTREE_API_PREFIX, WORKTREE_PLUGIN_NAME } from '../../shared/constants'+export { WORKTREE_API_PREFIX, PLUGIN_ID } from '../../shared/constants'export const INPUT_DOCK_SLOT = 'conversation.input.dock'export const SHELL_OVERLAY_SLOT = 'shell.overlay'-export const MODE_SELECT_ID = `${WORKTREE_PLUGIN_NAME}-mode`+export const MODE_SELECT_ID = `${PLUGIN_ID}-mode`export const MODE_SELECT_ORDER = -20-export const SURFACE_ID = `${WORKTREE_PLUGIN_NAME}-surface`+export const SURFACE_ID = `${PLUGIN_ID}-surface`export const SURFACE_ORDER = -10-export const DIALOG_ID = `${WORKTREE_PLUGIN_NAME}-dialog`--export const STYLES_EFFECT = `${WORKTREE_PLUGIN_NAME}: styles`-export const LOCALE_EFFECT = `${WORKTREE_PLUGIN_NAME}: locale`-export const PREFERENCES_EFFECT = `${WORKTREE_PLUGIN_NAME}: preferred mode`-export const MODE_SELECT_EFFECT = `${WORKTREE_PLUGIN_NAME}: mode select slot`-export const SURFACE_EFFECT = `${WORKTREE_PLUGIN_NAME}: surface slot`-export const DIALOG_EFFECT = `${WORKTREE_PLUGIN_NAME}: dialog`-export const HYDRATION_EFFECT = `${WORKTREE_PLUGIN_NAME}: hydrate session bindings`-export const SESSION_ICONS_EFFECT = `${WORKTREE_PLUGIN_NAME}: session branch icons`+export const DIALOG_ID = `${PLUGIN_ID}-dialog`++export const STYLES_EFFECT = `${PLUGIN_ID}: styles`+export const LOCALE_EFFECT = `${PLUGIN_ID}: locale`+export const PREFERENCES_EFFECT = `${PLUGIN_ID}: preferred mode`+export const MODE_SELECT_EFFECT = `${PLUGIN_ID}: mode select slot`+export const SURFACE_EFFECT = `${PLUGIN_ID}: surface slot`+export const DIALOG_EFFECT = `${PLUGIN_ID}: dialog`+export const HYDRATION_EFFECT = `${PLUGIN_ID}: hydrate session bindings`+export const SESSION_ICONS_EFFECT = `${PLUGIN_ID}: session branch icons`export const SESSION_SWITCH_RETRY_DELAY_MS = 100export const SESSION_SWITCH_MAX_ATTEMPTS = 30diff --git a/packages/dsh-tauri-worktree/src/client/index.ts b/packages/dsh-tauri-worktree/src/client/index.tsindex 9836a823..a2597c6e 100644--- a/packages/dsh-tauri-worktree/src/client/index.ts+++ b/packages/dsh-tauri-worktree/src/client/index.ts@@ -8,7 +8,7 @@ import {SESSION_ICONS_EFFECT,STYLES_EFFECT,SURFACE_EFFECT,- WORKTREE_PLUGIN_NAME,+ PLUGIN_ID,} from './constants'import { locale } from './locales'import { dialogFeature } from './register/dialog'@@ -23,7 +23,7 @@ export { WORKTREE_API_PREFIX } from '../shared/constants'export type * from './apis/index.type'export type * from './store/modules/worktree.types'-export const name = WORKTREE_PLUGIN_NAME+export const name = PLUGIN_IDexport const inject = ['slots', 'layout', 'locale', 'sessions', 'workspaces']diff --git a/packages/dsh-tauri-worktree/src/client/locales/index.ts b/packages/dsh-tauri-worktree/src/client/locales/index.tsindex f48fec9c..fe6c32f4 100644--- a/packages/dsh-tauri-worktree/src/client/locales/index.ts+++ b/packages/dsh-tauri-worktree/src/client/locales/index.ts@@ -1,5 +1,5 @@import { defineLocale } from 'dsh-tauri/client'-import { WORKTREE_PLUGIN_NAME } from '../constants'+import { PLUGIN_ID } from '../constants'const zh = {modeLabel: '工作模式',@@ -65,4 +65,4 @@ const en: Record<keyof typeof zh, string> = {sessionWorkingTreeBadge: 'Worktree',}-export const locale = defineLocale(WORKTREE_PLUGIN_NAME, { zh, en })+export const locale = defineLocale(PLUGIN_ID, { zh, en })diff --git a/packages/dsh-tauri-worktree/src/client/register/dialog.ts b/packages/dsh-tauri-worktree/src/client/register/dialog.tsindex ab2184b9..f4f96b21 100644--- a/packages/dsh-tauri-worktree/src/client/register/dialog.ts+++ b/packages/dsh-tauri-worktree/src/client/register/dialog.ts@@ -2,7 +2,7 @@ import type { ClientContext } from 'dsh-tauri/client'import type { WorktreeDialogProps } from '../components/dialog.types'import { defineRegister } from 'dsh-tauri/client'import { WorktreeDialog } from '../components/dialog'-import { DIALOG_ID, SHELL_OVERLAY_SLOT, WORKTREE_PLUGIN_NAME } from '../constants'+import { DIALOG_ID, SHELL_OVERLAY_SLOT, PLUGIN_ID } from '../constants'export const dialogFeature = defineRegister<ClientContext>((controller, ctx, adapter) => {controller.add(ctx.slots.inject(SHELL_OVERLAY_SLOT, () =>@@ -10,7 +10,7 @@ export const dialogFeature = defineRegister<ClientContext>((controller, ctx, ada{name: SHELL_OVERLAY_SLOT,id: DIALOG_ID,- registrant: WORKTREE_PLUGIN_NAME,+ registrant: PLUGIN_ID,inject: (): Pick<WorktreeDialogProps, 'sessionsRuntime' | 'workspacesRuntime'> => ({workspacesRuntime: adapter.workspaces as unknown as WorktreeDialogProps['workspacesRuntime'],sessionsRuntime: adapter.sessions as unknown as WorktreeDialogProps['sessionsRuntime'],diff --git a/packages/dsh-tauri-worktree/src/client/service/preferences.ts b/packages/dsh-tauri-worktree/src/client/service/preferences.tsindex be4d9a26..c876a55b 100644--- a/packages/dsh-tauri-worktree/src/client/service/preferences.ts+++ b/packages/dsh-tauri-worktree/src/client/service/preferences.ts@@ -1,9 +1,9 @@import type { WorktreeNewSessionMode } from '../store/modules/worktree.types'import { createStorage, get, localStorageDriver } from 'dsh-tauri/client'-import { PREFERRED_MODE_STORAGE_KEY, WORKTREE_PLUGIN_NAME } from '../constants'+import { PREFERRED_MODE_STORAGE_KEY, PLUGIN_ID } from '../constants'import { store } from '../store'-const storage = createStorage({ driver: localStorageDriver({ base: WORKTREE_PLUGIN_NAME }) })+const storage = createStorage({ driver: localStorageDriver({ base: PLUGIN_ID }) })export async function loadPreferredMode(): Promise<WorktreeNewSessionMode> {if (store.preferences.hydrated)diff --git a/packages/dsh-tauri-worktree/src/index.ts b/packages/dsh-tauri-worktree/src/index.tsindex 774a8eb1..59a7044e 100644--- a/packages/dsh-tauri-worktree/src/index.ts+++ b/packages/dsh-tauri-worktree/src/index.ts@@ -1,6 +1,6 @@-import { WORKTREE_API_PREFIX, WORKTREE_PLUGIN_NAME } from './shared/constants'+import { WORKTREE_API_PREFIX, PLUGIN_ID } from './shared/constants'-export const name = WORKTREE_PLUGIN_NAME+export const name = PLUGIN_IDexport const inject = ['tools', 'systemPrompt', 'webServer', 'sessions', 'workspaceRegistry', 'agents', 'connection']diff --git a/packages/dsh-tauri-worktree/src/shared/constants.ts b/packages/dsh-tauri-worktree/src/shared/constants.tsindex b81698c4..2d121264 100644--- a/packages/dsh-tauri-worktree/src/shared/constants.ts+++ b/packages/dsh-tauri-worktree/src/shared/constants.ts@@ -1,4 +1,4 @@-export const WORKTREE_PLUGIN_NAME = 'dsh-tauri-worktree'+export const PLUGIN_ID = 'dsh-tauri-worktree'export const WORKTREE_API_PREFIX = '/api/dsh-worktree'diff --git a/packages/dsh-tauri/src/client/locale/index.ts b/packages/dsh-tauri/src/client/locale/index.tsindex 35f2c546..d88d2257 100644--- a/packages/dsh-tauri/src/client/locale/index.ts+++ b/packages/dsh-tauri/src/client/locale/index.ts@@ -7,7 +7,7 @@** ```ts* // locales/index.ts- * export const locale = defineLocale(PLUGIN_NAME, { zh: {...}, en: {...} })+ * export const locale = defineLocale(PLUGIN_ID, { zh: {...}, en: {...} })* export const { NS } = locale** // index.ts(二选一,副作用都必须由 controller / effect 托管)