Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

refactor(plugins): unify register/* prefix across client plugins

hairyf81fc78f07f4f
diff --git a/packages/dsh-tauri-panel-extension/src/client/index.ts b/packages/dsh-tauri-panel-extension/src/client/index.ts
index 1a87c512..d9f4555d 100644
--- a/packages/dsh-tauri-panel-extension/src/client/index.ts
+++ b/packages/dsh-tauri-panel-extension/src/client/index.ts
@@ -10,8 +10,8 @@ import type { ExtensionClientContext, Translate } from './types'
import { mountStyle } from 'dsh-tauri-ui/client'
import { compat } from 'dsh-tauri/client'
import { LOCALE_NAMESPACE, PLUGIN_ID, STYLE_ID } from './constants'
-import { installExtensionLocale } from './locales'
-import { installExtensionPanel } from './register/extension-panel'
+import { registerExtensionLocale } from './locales'
+import { registerExtensionPanel } from './register/extension-panel'
import { registerSkillCreatorPrefill } from './register/skill-creator-prefill'
import { createMcpInjected } from './service/mcp'
import { createSkillsInjected } from './service/skills'
@@ -22,9 +22,9 @@ export const inject = ['slots', 'locale', 'sessions', 'workspaces']
export function apply(ctx: ExtensionClientContext): void {
const cx = compat(ctx)
- installExtensionLocale(ctx)
+ registerExtensionLocale(ctx)
ctx.effect(() => mountStyle(extensionIndexStyle, STYLE_ID), `${PLUGIN_ID}: styles`)
const t = ctx.locale.bind(LOCALE_NAMESPACE) as Translate
registerSkillCreatorPrefill(ctx)
- installExtensionPanel(cx as ExtensionClientContext, t, createSkillsInjected(), createMcpInjected())
+ registerExtensionPanel(cx as ExtensionClientContext, t, createSkillsInjected(), createMcpInjected())
}
diff --git a/packages/dsh-tauri-panel-extension/src/client/locales/index.ts b/packages/dsh-tauri-panel-extension/src/client/locales/index.ts
index 0266c08e..a34d4483 100644
--- a/packages/dsh-tauri-panel-extension/src/client/locales/index.ts
+++ b/packages/dsh-tauri-panel-extension/src/client/locales/index.ts
@@ -205,7 +205,7 @@ const en: Record<string, string> = {
pasteTransportMismatch: 'The row transport is locked and differs from the pasted config.',
}
-export function installExtensionLocale(ctx: ExtensionClientContext): void {
+export function registerExtensionLocale(ctx: ExtensionClientContext): void {
ctx.effect(() => [
ctx.locale.register(LOCALE_NAMESPACE, 'zh', zh),
ctx.locale.register(LOCALE_NAMESPACE, 'en', en),
diff --git a/packages/dsh-tauri-panel-extension/src/client/register/extension-panel.tsx b/packages/dsh-tauri-panel-extension/src/client/register/extension-panel.tsx
index 27b31936..c4b0ce74 100644
--- a/packages/dsh-tauri-panel-extension/src/client/register/extension-panel.tsx
+++ b/packages/dsh-tauri-panel-extension/src/client/register/extension-panel.tsx
@@ -24,7 +24,7 @@ import {
} from '../constants'
import { chooseWorkspace } from '../utils/workspace'
-export function installExtensionPanel(ctx: ClientContext, t: Translate, skills: SkillsInjected, mcp: McpInjected): void {
+export function registerExtensionPanel(ctx: ClientContext, t: Translate, skills: SkillsInjected, mcp: McpInjected): void {
ctx.slots.inject(PANEL_SLOT_NAME as never, () => {
let registration: (() => void) | undefined
let retryTimer: number | undefined
diff --git a/packages/dsh-tauri-panel-placeholder/src/client/components/panel.tsx b/packages/dsh-tauri-panel-placeholder/src/client/components/panel.tsx
index 97fa6e4f..2a93d25c 100644
--- a/packages/dsh-tauri-panel-placeholder/src/client/components/panel.tsx
+++ b/packages/dsh-tauri-panel-placeholder/src/client/components/panel.tsx
@@ -6,7 +6,7 @@ import { Content } from './content'
/**
* components/panel.tsx — 面板区(sidebar.panel.action 槽)样板条目组件:
- * 「定时任务」。槽位注册在 register/panel.ts(installPanel)。
+ * 「定时任务」。槽位注册在 register/panel.ts(registerPanel)。
*/
export function PlaceholderPanel(props: PlaceholderPanelProps): ReactElement {
diff --git a/packages/dsh-tauri-panel-placeholder/src/client/index.ts b/packages/dsh-tauri-panel-placeholder/src/client/index.ts
index 284c7ff3..f80924f9 100644
--- a/packages/dsh-tauri-panel-placeholder/src/client/index.ts
+++ b/packages/dsh-tauri-panel-placeholder/src/client/index.ts
@@ -16,8 +16,8 @@ import type {} from '@deepseek-ai/dsh-client-ui-layout/client'
import type { ClientContext } from 'dsh-tauri/client'
import { mountStyle } from 'dsh-tauri-ui/client'
import { PLUGIN_ID, STYLE_ID } from './constants'
-import { installPanelLocale } from './locales'
-import { installPanel } from './register/panel'
+import { registerPanelLocale } from './locales'
+import { registerPanel } from './register/panel'
import placeholderStyle from './styles/index.cssr'
/** 插件显示名(诊断元数据)。 */
@@ -35,6 +35,6 @@ export function apply(ctx: ClientContext): void {
() => mountStyle(placeholderStyle, STYLE_ID),
`${PLUGIN_ID}: styles`,
)
- installPanelLocale(ctx)
- installPanel(ctx)
+ registerPanelLocale(ctx)
+ registerPanel(ctx)
}
diff --git a/packages/dsh-tauri-panel-placeholder/src/client/locales/index.ts b/packages/dsh-tauri-panel-placeholder/src/client/locales/index.ts
index cd4fdfdd..70af8fb0 100644
--- a/packages/dsh-tauri-panel-placeholder/src/client/locales/index.ts
+++ b/packages/dsh-tauri-panel-placeholder/src/client/locales/index.ts
@@ -6,7 +6,7 @@ import { LOCALE_NAMESPACE, PANEL_LOCALE_KEY, PLUGIN_ID } from '../constants'
* ctx.locale.register 类型来自 slots.d.ts 对 cordis Context 的增广。
*/
/** 注册双语文案(分开注册:cordis locale 的 zh/en 分区;effect 内返回 dispose 组合)。 */
-export function installPanelLocale(ctx: Context): void {
+export function registerPanelLocale(ctx: Context): void {
ctx.effect(
() => [
ctx.locale.register(LOCALE_NAMESPACE, 'zh', { [PANEL_LOCALE_KEY]: '占位符' }),
diff --git a/packages/dsh-tauri-panel-placeholder/src/client/register/panel.ts b/packages/dsh-tauri-panel-placeholder/src/client/register/panel.ts
index 0495e962..69621fc4 100644
--- a/packages/dsh-tauri-panel-placeholder/src/client/register/panel.ts
+++ b/packages/dsh-tauri-panel-placeholder/src/client/register/panel.ts
@@ -18,7 +18,7 @@ import {
* renderPanelContent 切换会话区替换——本插件零机制代码。
* @param ctx - 客户端根上下文。
*/
-export function installPanel(ctx: Context): void {
+export function registerPanel(ctx: Context): void {
ctx.slots.inject(PANEL_SLOT_NAME as never, () => {
// 宿主协议服务经反射注册(dsh-tauri-panel apply 先于本条目声明执行);
// 缺失时降级:不注册条目(旧核心/宿主未装)。
diff --git a/packages/dsh-tauri-panel-scheduler/src/client/index.ts b/packages/dsh-tauri-panel-scheduler/src/client/index.ts
index 3d863161..9d88e50d 100644
--- a/packages/dsh-tauri-panel-scheduler/src/client/index.ts
+++ b/packages/dsh-tauri-panel-scheduler/src/client/index.ts
@@ -9,10 +9,10 @@
import type { SchedulerClientContext, Translate } from './types'
import { mountStyle } from 'dsh-tauri-ui/client'
import { LOCALE_NAMESPACE, PLUGIN_ID, SESSION_ICONS_EFFECT, STYLE_ID, STYLES_EFFECT } from './constants'
-import { installSchedulerLocale } from './locales'
-import { installSchedulerPanel } from './register/panel'
+import { registerSchedulerLocale } from './locales'
+import { registerSchedulerPanel } from './register/panel'
import { registerSchedulerPrefill } from './register/prefill'
-import { installSessionIcons } from './register/session-icons'
+import { registerSessionIcons } from './register/session-icons'
import schedulerIndexStyle from './styles/index.cssr'
export { SCHEDULER_API_PREFIX } from '../shared/constants'
@@ -29,10 +29,10 @@ export const inject = ['slots', 'layout', 'locale', 'sessions', 'workspaces']
* @param ctx - 客户端根上下文。
*/
export function apply(ctx: SchedulerClientContext): void {
- installSchedulerLocale(ctx)
+ registerSchedulerLocale(ctx)
ctx.effect(() => mountStyle(schedulerIndexStyle, STYLE_ID), STYLES_EFFECT)
const t = ctx.locale.bind(LOCALE_NAMESPACE) as Translate
- installSchedulerPanel(ctx, t)
+ registerSchedulerPanel(ctx, t)
registerSchedulerPrefill(ctx)
- ctx.effect(() => installSessionIcons(), SESSION_ICONS_EFFECT)
+ ctx.effect(() => registerSessionIcons(), SESSION_ICONS_EFFECT)
}
diff --git a/packages/dsh-tauri-panel-scheduler/src/client/locales/index.ts b/packages/dsh-tauri-panel-scheduler/src/client/locales/index.ts
index ffdbd173..719ddbd3 100644
--- a/packages/dsh-tauri-panel-scheduler/src/client/locales/index.ts
+++ b/packages/dsh-tauri-panel-scheduler/src/client/locales/index.ts
@@ -213,7 +213,7 @@ const en: Record<string, string> = {
'perWeek': 'Weekly',
}
-export function installSchedulerLocale(ctx: SchedulerClientContext): void {
+export function registerSchedulerLocale(ctx: SchedulerClientContext): void {
ctx.effect(() => [
ctx.locale.register(LOCALE_NAMESPACE, 'zh', zh),
ctx.locale.register(LOCALE_NAMESPACE, 'en', en),
diff --git a/packages/dsh-tauri-panel-scheduler/src/client/register/panel.tsx b/packages/dsh-tauri-panel-scheduler/src/client/register/panel.tsx
index c6b2d564..db44c2ff 100644
--- a/packages/dsh-tauri-panel-scheduler/src/client/register/panel.tsx
+++ b/packages/dsh-tauri-panel-scheduler/src/client/register/panel.tsx
@@ -24,7 +24,7 @@ import {
import { setChatPrefill } from '../prefill'
import { hydrateScheduler } from '../service/scheduler'
-export function installSchedulerPanel(ctx: ClientContext, t: Translate): void {
+export function registerSchedulerPanel(ctx: ClientContext, t: Translate): void {
ctx.slots.inject(PANEL_SLOT_NAME as never, () => {
let registration: (() => void) | undefined
let retryTimer: number | undefined
diff --git a/packages/dsh-tauri-panel-scheduler/src/client/register/session-icons.ts b/packages/dsh-tauri-panel-scheduler/src/client/register/session-icons.ts
index c4991a1f..4fb4fc34 100644
--- a/packages/dsh-tauri-panel-scheduler/src/client/register/session-icons.ts
+++ b/packages/dsh-tauri-panel-scheduler/src/client/register/session-icons.ts
@@ -25,7 +25,7 @@ import sessionIconStyle from '../styles/index.cssr'
* 安装会话行时钟图标(CSS + DOM 观察器)。返回卸载函数。
* @returns 卸载函数。
*/
-export function installSessionIcons(): () => void {
+export function registerSessionIcons(): () => void {
if (typeof document === 'undefined')
return () => {}
const controller = createLifecycleController()
diff --git a/packages/dsh-tauri-panel/src/client/index.ts b/packages/dsh-tauri-panel/src/client/index.ts
index d2596cbf..8d7b6cfa 100644
--- a/packages/dsh-tauri-panel/src/client/index.ts
+++ b/packages/dsh-tauri-panel/src/client/index.ts
@@ -19,9 +19,9 @@ import type { ClientContext } from 'dsh-tauri/client'
import { SlotOutlet } from '@deepseek-ai/dsh-client-ui-renderer'
import { mountStyle } from 'dsh-tauri-ui/client'
import { PANEL_STYLE_ID } from './constants'
-import { installPanelLocale } from './locales'
-import { installPanelService } from './register/panel-service'
-import { installSidebarRoot } from './register/sidebar'
+import { registerPanelLocale } from './locales'
+import { registerPanelService } from './register/panel-service'
+import { registerSidebarRoot } from './register/sidebar'
import panelIndexStyle from './styles/index.cssr'
export { PANEL_PROTOCOL_SERVICE } from './constants'
@@ -49,10 +49,10 @@ export function apply(ctx: ClientContext): void {
() => mountStyle(panelIndexStyle, PANEL_STYLE_ID),
'dsh-tauri-panel: styles',
)
- installPanelLocale(ctx)
+ registerPanelLocale(ctx)
// 面板协议宿主服务(panel.protocol:ActionItem + renderPanelContent):
// 只走 slots runtime,不依赖 renderer 补丁——无补丁时内容区替换仍可用。
- installPanelService(ctx)
+ registerPanelService(ctx)
// 侧栏面板依赖 renderer 补丁导出的 <SlotOutlet>;无补丁时不注册任何条目,
// 官方侧栏原样工作。
@@ -63,5 +63,5 @@ export function apply(ctx: ClientContext): void {
return
}
- installSidebarRoot(ctx)
+ registerSidebarRoot(ctx)
}
diff --git a/packages/dsh-tauri-panel/src/client/locales/index.ts b/packages/dsh-tauri-panel/src/client/locales/index.ts
index b49f34fc..5c33437f 100644
--- a/packages/dsh-tauri-panel/src/client/locales/index.ts
+++ b/packages/dsh-tauri-panel/src/client/locales/index.ts
@@ -22,7 +22,7 @@ const en: Record<keyof typeof zh, string> = {
}
/** 注册面板文案命名空间(effect 生命周期,随插件卸载注销)。 */
-export function installPanelLocale(ctx: ClientContext): void {
+export function registerPanelLocale(ctx: ClientContext): void {
ctx.effect(
() => {
const disposeZh = ctx.locale.register(NS, 'zh', zh)
diff --git a/packages/dsh-tauri-panel/src/client/register/panel-service.ts b/packages/dsh-tauri-panel/src/client/register/panel-service.ts
index 28c0987d..24e2bd06 100644
--- a/packages/dsh-tauri-panel/src/client/register/panel-service.ts
+++ b/packages/dsh-tauri-panel/src/client/register/panel-service.ts
@@ -31,7 +31,7 @@ import { createPanelConversationController } from '../service/controller'
* 核心时降级为不提供该字段)。
* @param ctx - 客户端根上下文。
*/
-export function installPanelService(ctx: Context): void {
+export function registerPanelService(ctx: Context): void {
const controller = createPanelConversationController()
const api: PanelProtocol = {
ActionItem: PanelActionItem,
diff --git a/packages/dsh-tauri-panel/src/client/register/sidebar.ts b/packages/dsh-tauri-panel/src/client/register/sidebar.ts
index 04106d72..538bd448 100644
--- a/packages/dsh-tauri-panel/src/client/register/sidebar.ts
+++ b/packages/dsh-tauri-panel/src/client/register/sidebar.ts
@@ -13,7 +13,7 @@ import { NS } from '../locales'
* sidebar.panel.action 协议槽。
* @param ctx - 客户端根上下文。
*/
-export function installSidebarRoot(ctx: Context): void {
+export function registerSidebarRoot(ctx: Context): void {
ctx.slots.inject('sidebar' as never, () =>
ctx.slots.register(
{
diff --git a/packages/dsh-tauri-pet/src/client/dom/sidebar-icon.ts b/packages/dsh-tauri-pet/src/client/dom/sidebar-icon.ts
index 77ed8348..97c4355a 100644
--- a/packages/dsh-tauri-pet/src/client/dom/sidebar-icon.ts
+++ b/packages/dsh-tauri-pet/src/client/dom/sidebar-icon.ts
@@ -93,7 +93,7 @@ function syncIconState(button: HTMLButtonElement): void {
* 安装侧栏入口补丁。返回卸载函数(移除按钮、断开观察器与订阅)。
* 桌宠状态缓存在这里初始化拉取一次;此后由设置页与按钮自身的切换写入。
*/
-export function installSidebarPetIcon(): () => void {
+export function registerSidebarPetIcon(): () => void {
if (typeof document === 'undefined')
return () => {}
diff --git a/packages/dsh-tauri-pet/src/client/index.ts b/packages/dsh-tauri-pet/src/client/index.ts
index 6abd2e61..4da30e09 100644
--- a/packages/dsh-tauri-pet/src/client/index.ts
+++ b/packages/dsh-tauri-pet/src/client/index.ts
@@ -17,9 +17,9 @@
import type { ClientContext } from 'dsh-tauri/client'
import { mountStyle } from 'dsh-tauri-ui/client'
import { PET_CLIENT_PLUGIN, PET_STYLES_EFFECT } from './constants'
-import { installLocale } from './locales'
-import { installPetIconPatch, registerPetPrefill, registerPetSection } from './register/pet'
-import { installPetSessionForwarder } from './service/activity'
+import { registerLocale } from './locales'
+import { registerPetIconPatch, registerPetPrefill, registerPetSection } from './register/pet'
+import { registerPetSessionForwarder } from './service/activity'
import petEntryStyle from './styles/index.cssr'
/** 插件显示名(诊断元数据)。 */
@@ -35,10 +35,10 @@ export const inject = ['slots', 'locale', 'sessions', 'workspaces']
export function apply(ctx: ClientContext): void {
ctx.effect(() => mountStyle(petEntryStyle, `${PET_CLIENT_PLUGIN}-styles`), PET_STYLES_EFFECT)
- installLocale(ctx)
+ registerLocale(ctx)
registerPetSection(ctx)
- installPetIconPatch(ctx)
+ registerPetIconPatch(ctx)
registerPetPrefill(ctx)
- installPetSessionForwarder(ctx)
+ registerPetSessionForwarder(ctx)
}
diff --git a/packages/dsh-tauri-pet/src/client/locales/index.ts b/packages/dsh-tauri-pet/src/client/locales/index.ts
index 9be06958..7df9ad84 100644
--- a/packages/dsh-tauri-pet/src/client/locales/index.ts
+++ b/packages/dsh-tauri-pet/src/client/locales/index.ts
@@ -75,7 +75,7 @@ const DICT_EN: Record<LocaleKey, string> = {
let activeLocale = 'en'
const localeRevision = createExternalStore({ revision: 0 })
-export function installLocale(ctx: ClientContext): void {
+export function registerLocale(ctx: ClientContext): void {
activeLocale = ctx.locale.getLocale().active
ctx.locale.register(NS, 'zh', DICT_ZH)
ctx.locale.register(NS, 'en', DICT_EN)
diff --git a/packages/dsh-tauri-pet/src/client/register/pet.ts b/packages/dsh-tauri-pet/src/client/register/pet.ts
index e78a44b9..054f31bb 100644
--- a/packages/dsh-tauri-pet/src/client/register/pet.ts
+++ b/packages/dsh-tauri-pet/src/client/register/pet.ts
@@ -19,7 +19,7 @@ import {
PET_SECTION_ID,
PET_SECTION_ORDER,
} from '../constants'
-import { installSidebarPetIcon } from '../dom/sidebar-icon'
+import { registerSidebarPetIcon } from '../dom/sidebar-icon'
import { text } from '../locales'
import { chooseWorkspace } from '../utils/workspace'
@@ -37,8 +37,8 @@ export function registerPetSection(ctx: ClientContext): void {
)
}
-export function installPetIconPatch(ctx: Context): void {
- ctx.effect(() => installSidebarPetIcon(), PET_ICON_PATCH_EFFECT)
+export function registerPetIconPatch(ctx: Context): void {
+ ctx.effect(() => registerSidebarPetIcon(), PET_ICON_PATCH_EFFECT)
}
export function registerPetPrefill(ctx: ClientContext): void {
diff --git a/packages/dsh-tauri-pet/src/client/service/activity.ts b/packages/dsh-tauri-pet/src/client/service/activity.ts
index bd777e48..88067852 100644
--- a/packages/dsh-tauri-pet/src/client/service/activity.ts
+++ b/packages/dsh-tauri-pet/src/client/service/activity.ts
@@ -52,7 +52,7 @@ interface SessionWatch {
* 按会话做 trailing 节流,到期时按当前窗口重算实时活动(进行中的工具调用 /
* 思考流)并以 liveActivity 字段并入快照;alpha 缺失事件窗口时退级为纯快照转发。
*/
-export function installPetSessionForwarder(ctx: ClientContext): void {
+export function registerPetSessionForwarder(ctx: ClientContext): void {
ctx.effect(() => {
const controller = createLifecycleController()
const watches = new Map<string, SessionWatch>()
diff --git a/packages/dsh-tauri-rightclick/src/client/index.ts b/packages/dsh-tauri-rightclick/src/client/index.ts
index 762c52ae..4825a9ad 100644
--- a/packages/dsh-tauri-rightclick/src/client/index.ts
+++ b/packages/dsh-tauri-rightclick/src/client/index.ts
@@ -21,8 +21,8 @@ import {
RIGHTCLICK_MENU_STYLE_ID,
RIGHTCLICK_STYLES_EFFECT,
} from './constants'
-import { installLocale } from './locales'
-import { installContextMenu } from './service/menu'
+import { registerLocale } from './locales'
+import { registerContextMenu } from './service/menu'
import rightClickStyle from './styles/index.cssr'
/** 插件显示名(诊断元数据)。 */
@@ -37,9 +37,9 @@ export const inject = ['locale', 'sessions', 'workspaces']
*/
export function apply(ctx: ClientContext): void {
const cx = compat(ctx)
- installLocale(cx)
+ registerLocale(cx)
ctx.effect(() => mountStyle(rightClickStyle, RIGHTCLICK_MENU_STYLE_ID), RIGHTCLICK_STYLES_EFFECT)
- ctx.effect(() => installContextMenu(cx), RIGHTCLICK_MENU_EFFECT)
+ ctx.effect(() => registerContextMenu(cx), RIGHTCLICK_MENU_EFFECT)
}
diff --git a/packages/dsh-tauri-rightclick/src/client/locales/index.ts b/packages/dsh-tauri-rightclick/src/client/locales/index.ts
index 1da28285..e6fe5858 100644
--- a/packages/dsh-tauri-rightclick/src/client/locales/index.ts
+++ b/packages/dsh-tauri-rightclick/src/client/locales/index.ts
@@ -150,7 +150,7 @@ let activeLocale = 'en'
* 在 apply 里安装:注册双语字典,并桥接 locale 变更到 module 级缓存。
* @param ctx - 客户端根上下文(须已注入 locale 服务)。
*/
-export function installLocale(ctx: ClientContext): void {
+export function registerLocale(ctx: ClientContext): void {
activeLocale = ctx.locale.getLocale().active
ctx.locale.register(NS, 'zh', DICT_ZH)
ctx.locale.register(NS, 'en', DICT_EN)
diff --git a/packages/dsh-tauri-rightclick/src/client/service/menu.ts b/packages/dsh-tauri-rightclick/src/client/service/menu.ts
index 7860c990..afd77a1a 100644
--- a/packages/dsh-tauri-rightclick/src/client/service/menu.ts
+++ b/packages/dsh-tauri-rightclick/src/client/service/menu.ts
@@ -43,7 +43,7 @@ import { holdRegistryLease, registry } from './registry'
* 安装右键菜单。返回卸载函数(关闭菜单并 dispose 生命周期控制器)。
* @param ctx - 客户端根上下文(须已注入 sessions/workspaces)。
*/
-export function installContextMenu(ctx: ClientContext): () => void {
+export function registerContextMenu(ctx: ClientContext): () => void {
const cx = compat(ctx)
const sessions = cx.sessions as unknown as SessionsRuntimeLike
const workspaces = cx.workspaces as unknown as WorkspacesRuntimeLike
diff --git a/packages/dsh-tauri-session/src/client/dom/workspace-patch.ts b/packages/dsh-tauri-session/src/client/dom/workspace-patch.ts
index b5b0111b..b8a54263 100644
--- a/packages/dsh-tauri-session/src/client/dom/workspace-patch.ts
+++ b/packages/dsh-tauri-session/src/client/dom/workspace-patch.ts
@@ -81,7 +81,7 @@ export function collectWorkspaceSessionIds(
* @param workspacesRuntime - 客户端 ctx.workspaces(归档目标与会话清单来源)。
* @param sessionsRuntime - 客户端 ctx.sessions(仅兜底 DOM 收集用)。
*/
-export function installWorkspaceArchivePatch(workspacesRuntime: WorkspacesRuntimeLike, sessionsRuntime: SessionsRuntimeLike): () => void {
+export function registerWorkspaceArchivePatch(workspacesRuntime: WorkspacesRuntimeLike, sessionsRuntime: SessionsRuntimeLike): () => void {
if (typeof document === 'undefined')
return () => {}
diff --git a/packages/dsh-tauri-session/src/client/index.ts b/packages/dsh-tauri-session/src/client/index.ts
index d1f54f78..cc2748a9 100644
--- a/packages/dsh-tauri-session/src/client/index.ts
+++ b/packages/dsh-tauri-session/src/client/index.ts
@@ -8,8 +8,8 @@
import type { ClientContext } from 'dsh-tauri/client'
import { compat } from 'dsh-tauri/client'
import { SESSION_ARCHIVE_PATCH_EFFECT } from './constants'
-import { installWorkspaceArchivePatch } from './dom/workspace-patch'
-import { installLocale } from './locales'
+import { registerWorkspaceArchivePatch } from './dom/workspace-patch'
+import { registerLocale } from './locales'
import { registerArchiveSection } from './register/archive-section'
/** 插件显示名(诊断元数据)。 */
@@ -24,11 +24,11 @@ export const inject = ['slots', 'locale', 'sessions', 'workspaces']
*/
export function apply(ctx: ClientContext): void {
const cx = compat(ctx)
- installLocale(cx)
+ registerLocale(cx)
// 1) 设置页「归档」分区(settings.section 单槽注册;导航行/内容由官方设置侧边栏投影)。
registerArchiveSection(cx)
// 2) 工作区浏览器补丁:替换「删除工作区」+ 隐藏归档会话行。
- ctx.effect(() => installWorkspaceArchivePatch(cx.workspaces as unknown as import('./types').WorkspacesRuntimeLike, cx.sessions as unknown as import('./types').SessionsRuntimeLike), SESSION_ARCHIVE_PATCH_EFFECT)
+ ctx.effect(() => registerWorkspaceArchivePatch(cx.workspaces as unknown as import('./types').WorkspacesRuntimeLike, cx.sessions as unknown as import('./types').SessionsRuntimeLike), SESSION_ARCHIVE_PATCH_EFFECT)
}
diff --git a/packages/dsh-tauri-session/src/client/locales/index.ts b/packages/dsh-tauri-session/src/client/locales/index.ts
index 7ab8346c..6934d347 100644
--- a/packages/dsh-tauri-session/src/client/locales/index.ts
+++ b/packages/dsh-tauri-session/src/client/locales/index.ts
@@ -113,7 +113,7 @@ export const localeRev = createExternalStore({ rev: 0 })
* 在 apply 里安装:注册双语字典,并桥接 locale 变更到 rev。
* @param ctx - 客户端根上下文(须已注入 locale 服务)。
*/
-export function installLocale(ctx: ClientContext): void {
+export function registerLocale(ctx: ClientContext): void {
activeLocale = ctx.locale.getLocale().active
ctx.locale.register(NS, 'zh', DICT_ZH)
ctx.locale.register(NS, 'en', DICT_EN)
diff --git a/packages/dsh-tauri-ui/src/client/hooks/sections.ts b/packages/dsh-tauri-ui/src/client/hooks/sections.ts
index e591833a..6b69efdc 100644
--- a/packages/dsh-tauri-ui/src/client/hooks/sections.ts
+++ b/packages/dsh-tauri-ui/src/client/hooks/sections.ts
@@ -16,7 +16,7 @@ export type { SettingsRow } from '../types'
* label 与官方一致经 resolveSlotLabel 语义解析(函数型 label 即按当前
* locale 求值,所以 locale 变更也要触发重算)。
*
- * 槽注册中心引用不在此持有:由 register/sections.ts 的 installSettingsSections
+ * 槽注册中心引用不在此持有:由 register/sections.ts 的 registerSettingsSections
* 在 apply 时存入(卸载即清),本文件经 getSettingsSlots() 读取——槽位
* 所有权与卸载清理只存在一处。
*/
diff --git a/packages/dsh-tauri-ui/src/client/index.ts b/packages/dsh-tauri-ui/src/client/index.ts
index 8a390df4..33d75f16 100644
--- a/packages/dsh-tauri-ui/src/client/index.ts
+++ b/packages/dsh-tauri-ui/src/client/index.ts
@@ -37,8 +37,8 @@ import {
SETTINGS_UI_PLUGIN,
TURN_NAVIGATION_STYLE_ID,
} from './constants'
-import { installSettingsLocale } from './locales'
-import { installSettingsSections } from './register/sections'
+import { registerSettingsLocale } from './locales'
+import { registerSettingsSections } from './register/sections'
import { registerSettingsSidebar } from './register/sidebar'
import { registerSettingsTrigger } from './register/trigger'
import { mountStyle } from './style'
@@ -92,10 +92,10 @@ export function apply(ctx: ClientContext): void {
() => mountStyle(turnNavigationStyle, TURN_NAVIGATION_STYLE_ID),
'dsh-tauri-ui: turn navigation styles',
)
- installSettingsLocale(ctx)
+ registerSettingsLocale(ctx)
// 设置分区投影:引用清理也走 effect(插件卸载后 slotsRef 复位,避免跨实例残留)。
ctx.effect(
- () => installSettingsSections(ctx.slots as never),
+ () => registerSettingsSections(ctx.slots as never),
'dsh-tauri-ui: settings sections projection',
)
if (typeof SlotOutlet === 'function') {
diff --git a/packages/dsh-tauri-ui/src/client/locales/index.ts b/packages/dsh-tauri-ui/src/client/locales/index.ts
index b7ce5efc..368a9e3a 100644
--- a/packages/dsh-tauri-ui/src/client/locales/index.ts
+++ b/packages/dsh-tauri-ui/src/client/locales/index.ts
@@ -27,7 +27,7 @@ export const settingsLocaleRev = createExternalStore({ rev: 0 })
* 在 apply 里安装:注册本插件的双语字典,并桥接 locale 变更到 rev。
* @param ctx - 客户端根上下文(须已注入 locale 服务)。
*/
-export function installSettingsLocale(ctx: ClientContext): void {
+export function registerSettingsLocale(ctx: ClientContext): void {
activeLocale = ctx.locale.getLocale().active
ctx.locale.register(SETTINGS_UI_NS, 'zh', DICT_ZH)
ctx.locale.register(SETTINGS_UI_NS, 'en', DICT_EN)
diff --git a/packages/dsh-tauri-ui/src/client/register/sections.ts b/packages/dsh-tauri-ui/src/client/register/sections.ts
index 00208726..034903bb 100644
--- a/packages/dsh-tauri-ui/src/client/register/sections.ts
+++ b/packages/dsh-tauri-ui/src/client/register/sections.ts
@@ -5,7 +5,7 @@ import type { SlotRegistry } from '@deepseek-ai/dsh-client-ui-renderer/client'
* 安装器半区:持有槽注册中心的模块引用(slotsRef),供 hooks/sections.ts
* 的只读投影 hooks 在 render 期经 getSettingsSlots() 订阅。
*
- * 引用所有权与卸载清理只存在本文件:installSettingsSections 在 apply 时把
+ * 引用所有权与卸载清理只存在本文件:registerSettingsSections 在 apply 时把
* ctx.slots 写入,返回的卸载函数在插件卸载后清除模块引用,避免跨实例残留。
*/
@@ -19,7 +19,7 @@ let slotsRef: SettingsSlots | undefined
* @param slots - 客户端 slota 注册中心(ctx.slots)。
* @returns 卸载函数(插件卸载后清除模块引用,避免跨实例残留)。
*/
-export function installSettingsSections(slots: SettingsSlots): () => void {
+export function registerSettingsSections(slots: SettingsSlots): () => void {
slotsRef = slots
return () => {
if (slotsRef === slots)
diff --git a/packages/dsh-tauri-worktree/src/client/index.ts b/packages/dsh-tauri-worktree/src/client/index.ts
index b178ec9c..31afb078 100644
--- a/packages/dsh-tauri-worktree/src/client/index.ts
+++ b/packages/dsh-tauri-worktree/src/client/index.ts
@@ -28,11 +28,11 @@ import {
WORKTREE_PLUGIN_NAME,
WORKTREE_STYLE_ID,
} from './constants'
-import { installLocale } from './locales'
+import { registerLocale } from './locales'
import { registerDialog } from './register/dialog'
-import { installWorktreeHydration } from './register/hydration'
+import { registerWorktreeHydration } from './register/hydration'
import { registerModeSelect } from './register/mode-select'
-import { installSessionIcons } from './register/session-icons'
+import { registerSessionIcons } from './register/session-icons'
import { registerSurface } from './register/surface'
import { hydratePreferredMode } from './store'
import worktreeIndexStyle from './styles/index.cssr'
@@ -52,7 +52,7 @@ export const inject = ['slots', 'layout', 'locale', 'sessions', 'workspaces']
*/
export function apply(ctx: ClientContext): void {
const cx = compat(ctx)
- installLocale(cx)
+ registerLocale(cx)
// 新会话偏好(本地/工作树)异步读回一次,未就绪前保持官方默认「本地」。
void hydratePreferredMode()
ctx.effect(
@@ -70,6 +70,6 @@ export function apply(ctx: ClientContext): void {
ctx.effect(() => registerModeSelect(cx), MODE_SELECT_EFFECT)
ctx.effect(() => registerSurface(cx), SURFACE_EFFECT)
registerDialog(cx)
- ctx.effect(() => installWorktreeHydration(cx), HYDRATION_EFFECT)
- ctx.effect(() => installSessionIcons(), SESSION_ICONS_EFFECT)
+ ctx.effect(() => registerWorktreeHydration(cx), HYDRATION_EFFECT)
+ ctx.effect(() => registerSessionIcons(), SESSION_ICONS_EFFECT)
}
diff --git a/packages/dsh-tauri-worktree/src/client/locales/index.ts b/packages/dsh-tauri-worktree/src/client/locales/index.ts
index 52db307e..b1ada97f 100644
--- a/packages/dsh-tauri-worktree/src/client/locales/index.ts
+++ b/packages/dsh-tauri-worktree/src/client/locales/index.ts
@@ -91,7 +91,7 @@ export const localeRev = createExternalStore({ rev: 0 })
* 在 apply 里安装:注册本插件的双语字典,并桥接 locale 变更到 rev。
* @param ctx - 客户端根上下文(须已注入 locale 服务)。
*/
-export function installLocale(ctx: ClientContext): void {
+export function registerLocale(ctx: ClientContext): void {
activeLocale = ctx.locale.getLocale().active
ctx.locale.register(NS, 'zh', DICT_ZH)
ctx.locale.register(NS, 'en', DICT_EN)
diff --git a/packages/dsh-tauri-worktree/src/client/register/hydration.ts b/packages/dsh-tauri-worktree/src/client/register/hydration.ts
index 0c614166..87db920e 100644
--- a/packages/dsh-tauri-worktree/src/client/register/hydration.ts
+++ b/packages/dsh-tauri-worktree/src/client/register/hydration.ts
@@ -19,7 +19,7 @@ import { attachWorktreeSession, discardWorktree, fetchStatus } from '../service/
import { openWorktreeSession } from '../service/handoff'
import { patchSession, selectSessionState, worktreeStore } from '../store'
-export function installWorktreeHydration(ctx: ClientContext): () => void {
+export function registerWorktreeHydration(ctx: ClientContext): () => void {
// HARDCODE: SessionRuntime.binding() is an internal DSH 0.1.1-rc.2 API.
// The public session-list source does not emit every tool-event mutation, so
// live checkout/discard reconciliation subscribes to the bound Session source.
diff --git a/packages/dsh-tauri-worktree/src/client/register/session-icons.ts b/packages/dsh-tauri-worktree/src/client/register/session-icons.ts
index 2252c778..5aba2786 100644
--- a/packages/dsh-tauri-worktree/src/client/register/session-icons.ts
+++ b/packages/dsh-tauri-worktree/src/client/register/session-icons.ts
@@ -24,7 +24,7 @@ import sessionIconStyle from '../styles/index.cssr'
* 安装会话行分支图标(CSS + DOM 观察器)。返回卸载函数。
* @returns 卸载函数。
*/
-export function installSessionIcons(): () => void {
+export function registerSessionIcons(): () => void {
if (typeof document === 'undefined')
return () => {}
const controller = createLifecycleController()