dsh-zen-remote 1.1.16 → 2.0.0
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/AGENTS.md +54 -9
- package/README.md +249 -190
- package/README.zh-CN.md +247 -201
- package/assets/home.png +0 -0
- package/assets/info.png +0 -0
- package/assets/pairing.png +0 -0
- package/assets/session.png +0 -0
- package/assets/sheet.png +0 -0
- package/cordis.patch.yml +12 -11
- package/cordis.patch.yml.example +24 -9
- package/docs/interface.md +57 -2
- package/docs/remote-access.en.md +99 -58
- package/docs/remote-access.md +99 -42
- package/dsh-push.mjs +67 -54
- package/lan-gate.mjs +88 -20
- package/lib/activity.js +168 -0
- package/lib/activity.js.map +1 -0
- package/lib/admin-routes.js +526 -0
- package/lib/admin-routes.js.map +1 -0
- package/lib/client-pairing.js +224 -0
- package/lib/client-pairing.js.map +1 -0
- package/lib/client-routes.js +674 -0
- package/lib/client-routes.js.map +1 -0
- package/lib/client.js +10051 -4777
- package/lib/config.js +346 -0
- package/lib/config.js.map +1 -0
- package/lib/fetch-route-intercept.js +418 -0
- package/lib/fetch-route-intercept.js.map +1 -0
- package/lib/fingerprint.js +363 -0
- package/lib/fingerprint.js.map +1 -0
- package/lib/http.js +69 -0
- package/lib/http.js.map +1 -0
- package/lib/index.js +675 -54
- package/lib/index.js.map +1 -1
- package/lib/intercept-shape.js +81 -0
- package/lib/intercept-shape.js.map +1 -0
- package/lib/intercept.js +3040 -0
- package/lib/intercept.js.map +1 -0
- package/lib/lan-gate-server.cjs +532 -121
- package/lib/merge-streams.js +1165 -0
- package/lib/merge-streams.js.map +1 -0
- package/lib/relay-access.js +496 -0
- package/lib/relay-access.js.map +1 -0
- package/lib/relay-client.js +1303 -0
- package/lib/relay-client.js.map +1 -0
- package/lib/relay-filter.js +282 -0
- package/lib/relay-filter.js.map +1 -0
- package/lib/relay-server.js +1792 -0
- package/lib/relay-server.js.map +1 -0
- package/lib/restart-fields.js +34 -0
- package/lib/restart-fields.js.map +1 -0
- package/lib/restart-watcher.js +106 -0
- package/lib/restart-watcher.js.map +1 -0
- package/lib/session-reference.js +157 -0
- package/lib/session-reference.js.map +1 -0
- package/lib/share-export.js +16 -1
- package/lib/share-export.js.map +1 -1
- package/lib/share-ops.js +86 -0
- package/lib/share-ops.js.map +1 -0
- package/lib/share-store.js +294 -0
- package/lib/share-store.js.map +1 -0
- package/lib/types/activity.d.ts +99 -0
- package/lib/types/activity.d.ts.map +1 -0
- package/lib/types/admin-routes.d.ts +129 -0
- package/lib/types/admin-routes.d.ts.map +1 -0
- package/lib/types/client/MobileDrawerFooter.d.ts.map +1 -1
- package/lib/types/client/MobileHome.d.ts +1 -1
- package/lib/types/client/MobileHome.d.ts.map +1 -1
- package/lib/types/client/MobileHomeChips.d.ts +1 -1
- package/lib/types/client/MobileHomeChips.d.ts.map +1 -1
- package/lib/types/client/MobileSessionHeader.d.ts +13 -2
- package/lib/types/client/MobileSessionHeader.d.ts.map +1 -1
- package/lib/types/client/MobileSessionInfo.d.ts +20 -3
- package/lib/types/client/MobileSessionInfo.d.ts.map +1 -1
- package/lib/types/client/RemoteComposerBanner.d.ts +42 -0
- package/lib/types/client/RemoteComposerBanner.d.ts.map +1 -0
- package/lib/types/client/RemoteHeaderIcon.d.ts +37 -0
- package/lib/types/client/RemoteHeaderIcon.d.ts.map +1 -0
- package/lib/types/client/RemoteShareMenu.d.ts +28 -0
- package/lib/types/client/RemoteShareMenu.d.ts.map +1 -0
- package/lib/types/client/RemoteStatusIcon.d.ts +36 -0
- package/lib/types/client/RemoteStatusIcon.d.ts.map +1 -0
- package/lib/types/client/compat/desktop.d.ts +21 -0
- package/lib/types/client/compat/desktop.d.ts.map +1 -0
- package/lib/types/client/compat/types.d.ts +57 -0
- package/lib/types/client/compat/types.d.ts.map +1 -1
- package/lib/types/client/current-session-report.d.ts +37 -0
- package/lib/types/client/current-session-report.d.ts.map +1 -0
- package/lib/types/client/effects/header-status.d.ts.map +1 -1
- package/lib/types/client/effects/keyboard-guard.d.ts.map +1 -1
- package/lib/types/client/effects/permission-sheet.d.ts +39 -0
- package/lib/types/client/effects/permission-sheet.d.ts.map +1 -0
- package/lib/types/client/effects/remote-session.d.ts +25 -0
- package/lib/types/client/effects/remote-session.d.ts.map +1 -0
- package/lib/types/client/effects/turn-fold.d.ts +9 -0
- package/lib/types/client/effects/turn-fold.d.ts.map +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/locales.d.ts +187 -2
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/client/remote-fetch.d.ts +51 -0
- package/lib/types/client/remote-fetch.d.ts.map +1 -0
- package/lib/types/client/remote-group-expansion.d.ts +41 -0
- package/lib/types/client/remote-group-expansion.d.ts.map +1 -0
- package/lib/types/client/remote-share-css.d.ts +19 -0
- package/lib/types/client/remote-share-css.d.ts.map +1 -0
- package/lib/types/client/remote-share-register.d.ts +113 -0
- package/lib/types/client/remote-share-register.d.ts.map +1 -0
- package/lib/types/client/remote-status-css.d.ts +15 -0
- package/lib/types/client/remote-status-css.d.ts.map +1 -0
- package/lib/types/client/remote-status-register.d.ts +46 -0
- package/lib/types/client/remote-status-register.d.ts.map +1 -0
- package/lib/types/client/settings/SettingsSection.d.ts +46 -0
- package/lib/types/client/settings/SettingsSection.d.ts.map +1 -0
- package/lib/types/client/settings/register-settings.d.ts +58 -0
- package/lib/types/client/settings/register-settings.d.ts.map +1 -0
- package/lib/types/client/settings/settings-css.d.ts +10 -0
- package/lib/types/client/settings/settings-css.d.ts.map +1 -0
- package/lib/types/client/share/share-preview.d.ts.map +1 -1
- package/lib/types/client/styles/composer.css.d.ts +1 -1
- package/lib/types/client/styles/composer.css.d.ts.map +1 -1
- package/lib/types/client/styles/header.css.d.ts +1 -1
- package/lib/types/client/styles/header.css.d.ts.map +1 -1
- package/lib/types/client/styles/info.css.d.ts +1 -1
- package/lib/types/client/styles/info.css.d.ts.map +1 -1
- package/lib/types/client/styles/remote-session.css.d.ts +2 -0
- package/lib/types/client/styles/remote-session.css.d.ts.map +1 -0
- package/lib/types/client-data/current-session.d.ts +41 -0
- package/lib/types/client-data/current-session.d.ts.map +1 -0
- package/lib/types/client-data/remote-group-expansion.d.ts +76 -0
- package/lib/types/client-data/remote-group-expansion.d.ts.map +1 -0
- package/lib/types/client-data/remote-status.d.ts +148 -0
- package/lib/types/client-data/remote-status.d.ts.map +1 -0
- package/lib/types/client-data/settings-form.d.ts +774 -0
- package/lib/types/client-data/settings-form.d.ts.map +1 -0
- package/lib/types/client-data/shares.d.ts +211 -0
- package/lib/types/client-data/shares.d.ts.map +1 -0
- package/lib/types/client-pairing.d.ts +114 -0
- package/lib/types/client-pairing.d.ts.map +1 -0
- package/lib/types/client-routes.d.ts +112 -0
- package/lib/types/client-routes.d.ts.map +1 -0
- package/lib/types/config.d.ts +200 -0
- package/lib/types/config.d.ts.map +1 -0
- package/lib/types/fetch-route-intercept.d.ts +156 -0
- package/lib/types/fetch-route-intercept.d.ts.map +1 -0
- package/lib/types/fingerprint.d.ts +164 -0
- package/lib/types/fingerprint.d.ts.map +1 -0
- package/lib/types/http.d.ts +41 -0
- package/lib/types/http.d.ts.map +1 -0
- package/lib/types/index.d.ts +56 -24
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/intercept-shape.d.ts +32 -0
- package/lib/types/intercept-shape.d.ts.map +1 -0
- package/lib/types/intercept.d.ts +432 -0
- package/lib/types/intercept.d.ts.map +1 -0
- package/lib/types/merge-streams.d.ts +393 -0
- package/lib/types/merge-streams.d.ts.map +1 -0
- package/lib/types/relay-access.d.ts +310 -0
- package/lib/types/relay-access.d.ts.map +1 -0
- package/lib/types/relay-client.d.ts +274 -0
- package/lib/types/relay-client.d.ts.map +1 -0
- package/lib/types/relay-filter.d.ts +103 -0
- package/lib/types/relay-filter.d.ts.map +1 -0
- package/lib/types/relay-server.d.ts +208 -0
- package/lib/types/relay-server.d.ts.map +1 -0
- package/lib/types/restart-fields.d.ts +22 -0
- package/lib/types/restart-fields.d.ts.map +1 -0
- package/lib/types/restart-watcher.d.ts +83 -0
- package/lib/types/restart-watcher.d.ts.map +1 -0
- package/lib/types/session-reference.d.ts +66 -0
- package/lib/types/session-reference.d.ts.map +1 -0
- package/lib/types/share-export.d.ts +14 -1
- package/lib/types/share-export.d.ts.map +1 -1
- package/lib/types/share-ops.d.ts +79 -0
- package/lib/types/share-ops.d.ts.map +1 -0
- package/lib/types/share-store.d.ts +87 -0
- package/lib/types/share-store.d.ts.map +1 -0
- package/lib/types/virtual-id.d.ts +38 -0
- package/lib/types/virtual-id.d.ts.map +1 -0
- package/lib/virtual-id.js +52 -0
- package/lib/virtual-id.js.map +1 -0
- package/llms.txt +17 -14
- package/package.json +60 -50
- package/scripts/build-client.mjs +5 -3
- package/scripts/check-host-shadow.mjs +19 -2
- package/scripts/check-settings-form.mjs +933 -0
- package/scripts/check-shares.mjs +397 -0
- package/scripts/check-upload-endpoint.mjs +59 -3
- package/scripts/sync-doc-version.mjs +8 -15
- package/scripts/verify-fingerprint-live.mjs +111 -0
- package/src/activity.ts +218 -0
- package/src/admin-routes.ts +627 -0
- package/src/client/MobileAttachButton.tsx +2 -2
- package/src/client/MobileAttachChips.tsx +3 -3
- package/src/client/MobileDrawerFooter.tsx +7 -4
- package/src/client/MobileHome.tsx +20 -16
- package/src/client/MobileHomeChips.tsx +16 -16
- package/src/client/MobileNavOverlay.tsx +2 -2
- package/src/client/MobileNavToggle.tsx +3 -3
- package/src/client/MobileSessionHeader.tsx +63 -42
- package/src/client/MobileSessionInfo.tsx +118 -17
- package/src/client/RemoteComposerBanner.tsx +76 -0
- package/src/client/RemoteHeaderIcon.tsx +103 -0
- package/src/client/RemoteShareMenu.tsx +57 -0
- package/src/client/RemoteStatusIcon.tsx +91 -0
- package/src/client/compat/desktop.ts +22 -0
- package/src/client/compat/types.ts +62 -0
- package/src/client/current-session-report.ts +164 -0
- package/src/client/effects/header-status.ts +21 -17
- package/src/client/effects/keyboard-guard.ts +65 -1
- package/src/client/effects/permission-sheet.ts +149 -0
- package/src/client/effects/remote-session.ts +68 -0
- package/src/client/effects/turn-fold.ts +52 -0
- package/src/client/index.tsx +151 -36
- package/src/client/locales.ts +396 -2
- package/src/client/remote-fetch.ts +125 -0
- package/src/client/remote-group-expansion.ts +190 -0
- package/src/client/remote-share-css.ts +54 -0
- package/src/client/remote-share-register.ts +244 -0
- package/src/client/remote-status-css.ts +64 -0
- package/src/client/remote-status-register.ts +107 -0
- package/src/client/settings/SettingsSection.tsx +1229 -0
- package/src/client/settings/register-settings.ts +116 -0
- package/src/client/settings/settings-css.ts +236 -0
- package/src/client/share/share-preview.tsx +6 -3
- package/src/client/share/share-sheet.tsx +3 -3
- package/src/client/styles/composer.css.ts +119 -26
- package/src/client/styles/header.css.ts +7 -7
- package/src/client/styles/info.css.ts +74 -0
- package/src/client/styles/remote-session.css.ts +251 -0
- package/src/client-data/current-session.ts +57 -0
- package/src/client-data/remote-group-expansion.ts +145 -0
- package/src/client-data/remote-status.ts +374 -0
- package/src/client-data/settings-form.ts +1371 -0
- package/src/client-data/shares.ts +467 -0
- package/src/client-pairing.ts +244 -0
- package/src/client-routes.ts +732 -0
- package/src/config.ts +447 -0
- package/src/fetch-route-intercept.ts +510 -0
- package/src/fingerprint.ts +408 -0
- package/src/http.ts +68 -0
- package/src/index.ts +719 -62
- package/src/intercept-shape.ts +87 -0
- package/src/intercept.ts +3362 -0
- package/src/merge-streams.ts +1272 -0
- package/src/relay-access.ts +669 -0
- package/src/relay-client.ts +1514 -0
- package/src/relay-filter.ts +291 -0
- package/src/relay-server.ts +2025 -0
- package/src/restart-fields.ts +36 -0
- package/src/restart-watcher.ts +140 -0
- package/src/session-reference.ts +156 -0
- package/src/share-export.ts +26 -1
- package/src/share-ops.ts +114 -0
- package/src/share-store.ts +373 -0
- package/src/virtual-id.ts +59 -0
package/src/client/index.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ClientContext, SessionId, WorkspaceId } from './compat/types.ts'
|
|
1
|
+
import type { ClientContext, JobsLike, SessionId, WorkspaceId } from './compat/types.ts'
|
|
2
|
+
import { isDesktopShell } from './compat/desktop.ts'
|
|
2
3
|
import { MobileNavToggle } from './MobileNavToggle.tsx'
|
|
3
4
|
import { MobileNavOverlay } from './MobileNavOverlay.tsx'
|
|
4
5
|
import { MobileDrawerFooter } from './MobileDrawerFooter.tsx'
|
|
@@ -18,13 +19,27 @@ import { installGestures } from './effects/gestures.ts'
|
|
|
18
19
|
import { installTurnFold } from './effects/turn-fold.ts'
|
|
19
20
|
import { installModalBack } from './effects/modal-back.ts'
|
|
20
21
|
import { installModelSheetExtras } from './effects/model-sheet-extras.ts'
|
|
22
|
+
import { installPermissionSheet } from './effects/permission-sheet.ts'
|
|
21
23
|
import { installNativeTriggerOverlay } from './effects/native-trigger-overlay.ts'
|
|
22
24
|
import { installWelcomeNoticeOptOut } from './effects/welcome-notice.ts'
|
|
23
25
|
import { installKeyboardGuard } from './effects/keyboard-guard.ts'
|
|
24
26
|
import { installKeyboardAvoid } from './effects/keyboard-avoid.ts'
|
|
25
27
|
import { SharePreview } from './share/share-preview.tsx'
|
|
26
|
-
import { NS
|
|
28
|
+
import { NS } from './locales.ts'
|
|
27
29
|
import type { MobileNavKey } from './locales.ts'
|
|
30
|
+
import { SettingsSection } from './settings/SettingsSection.tsx'
|
|
31
|
+
import { registerSettingsPage } from './settings/register-settings.ts'
|
|
32
|
+
import { RemoteHeaderIcon } from './RemoteHeaderIcon.tsx'
|
|
33
|
+
import { RemoteShareMenuItem } from './RemoteShareMenu.tsx'
|
|
34
|
+
import { getSharesStore } from '../client-data/shares.ts'
|
|
35
|
+
import { registerRemoteShareUi } from './remote-share-register.ts'
|
|
36
|
+
import { RemoteStatusIcon } from './RemoteStatusIcon.tsx'
|
|
37
|
+
import { RemoteComposerBanner } from './RemoteComposerBanner.tsx'
|
|
38
|
+
import { registerRemoteStatusUi } from './remote-status-register.ts'
|
|
39
|
+
import { mountCurrentSessionReporter } from './current-session-report.ts'
|
|
40
|
+
import { mountRemoteGroupExpansionKeeper } from './remote-group-expansion.ts'
|
|
41
|
+
import { installRemoteApiFetch } from './remote-fetch.ts'
|
|
42
|
+
import { installRemoteSessionGuard } from './effects/remote-session.ts'
|
|
28
43
|
|
|
29
44
|
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
30
45
|
interface LocaleNamespaceMap {
|
|
@@ -37,20 +52,50 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
|
37
52
|
export const inject = ['slots', 'layout', 'locale', 'sessionLogDownload', 'sessions', 'workspaces']
|
|
38
53
|
|
|
39
54
|
/**
|
|
40
|
-
* 0.1.2
|
|
41
|
-
* 0.1.
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* ——0.1.1 装不到。
|
|
55
|
+
* 0.1.2 把新建会话、归档会话与打开会话的界面级操作挪到了 uiWorkspace
|
|
56
|
+
* 服务(0.1.7 删掉了 ctx.sessions.open,这是它唯一的替代入口)。类型用
|
|
57
|
+
* 本地最小接口,不 import 那个 dsh-client-ui-workspace 包——本插件的
|
|
58
|
+
* peerDependencies 不含它,运行时实例由宿主提供,类型自己声明就够。
|
|
45
59
|
*/
|
|
46
60
|
interface UiWorkspaceLike {
|
|
61
|
+
openSession(target: SessionId): void
|
|
47
62
|
startSession(workspaceId?: WorkspaceId): void
|
|
48
63
|
archiveSession(sessionId: SessionId): Promise<void>
|
|
49
64
|
}
|
|
50
65
|
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Activity data both session-header entries read (0.1.7 sources — 0.1.5's
|
|
68
|
+
* per-parent subagent snapshot and per-session job snapshot are gone):
|
|
69
|
+
* - the subagent catalog is read straight off the sessions snapshot's
|
|
70
|
+
* explicit-read store (`projectionsBySession[id].values.subagentCatalog`),
|
|
71
|
+
* exactly like the official SubagentHeaderLineage — no refresh is issued
|
|
72
|
+
* from here: every projection refresh call registers another session in
|
|
73
|
+
* the controller's load table, and all of them are re-read on every
|
|
74
|
+
* reconnect (manager handleConnected), so per-open refreshes would grow
|
|
75
|
+
* into a batch of re-reads forever;
|
|
76
|
+
* - job rows come from the `jobs` client service; the inject face mirrors
|
|
77
|
+
* the official JobListAction registration (`hooks.jobs` observable → the
|
|
78
|
+
* renderer hands the component a `useJobs` hook prop). When the service is
|
|
79
|
+
* absent (a build without the job controller) a fixed empty source keeps
|
|
80
|
+
* the prop present, so the component's hook count never varies — the
|
|
81
|
+
* counts simply read zero instead of the pill silently disappearing.
|
|
82
|
+
*/
|
|
83
|
+
const NO_JOBS_SNAPSHOT = Object.freeze({ rows: Object.freeze({}) }) as {
|
|
84
|
+
readonly rows: Readonly<Record<string, readonly never[]>>
|
|
85
|
+
}
|
|
86
|
+
/** Module-level singleton: one stable observable identity across renders. */
|
|
87
|
+
const NO_JOBS_SOURCE = {
|
|
88
|
+
getSnapshot: () => NO_JOBS_SNAPSHOT,
|
|
89
|
+
subscribe: (): (() => void) => () => {},
|
|
90
|
+
}
|
|
91
|
+
const NO_WATCH_ROWS = (): (() => void) => () => {}
|
|
92
|
+
|
|
93
|
+
function activityInject(ctx: ClientContext) {
|
|
94
|
+
const jobs = ctx.get('jobs') as JobsLike | undefined
|
|
95
|
+
return {
|
|
96
|
+
hooks: { jobs: jobs === undefined ? NO_JOBS_SOURCE : jobs.state },
|
|
97
|
+
watchRows: jobs === undefined ? NO_WATCH_ROWS : (id: SessionId) => jobs.watchRows(id),
|
|
98
|
+
}
|
|
54
99
|
}
|
|
55
100
|
|
|
56
101
|
/**
|
|
@@ -60,7 +105,58 @@ interface LegacyWorkspacesLike {
|
|
|
60
105
|
* @param ctx - client root context.
|
|
61
106
|
*/
|
|
62
107
|
export function apply(ctx: ClientContext): void {
|
|
63
|
-
|
|
108
|
+
// 2.0.0 设置页:必须在桌面门之前注册——桌面端 App 里手机外壳整体不生效,
|
|
109
|
+
// 但设置页必须生效(主服务端就是桌面端)。字典、设置页样式与设置表单服务
|
|
110
|
+
// 的按需注入都在 registerSettingsPage 里(那个服务名绝不进顶层的 inject
|
|
111
|
+
// 数组,否则没有该服务的环境整个界面半边都加载不了)。
|
|
112
|
+
registerSettingsPage(ctx, SettingsSection)
|
|
113
|
+
|
|
114
|
+
// T33b 会话共享的三个入口里前两个(标题行远程图标、会话右键菜单项):
|
|
115
|
+
// 同样必须在桌面门之前注册——桌面端 App 就是主服务端,图标和菜单恰好
|
|
116
|
+
// 住在它的标题行与会话菜单里。部件自身按数据降级:shares 路由 404
|
|
117
|
+
// (子客户端部署没有这条路由)时渲染为空;手机外壳下样式表把
|
|
118
|
+
// header.actions 全量隐藏(styles/header.css.ts),图标也就不订阅
|
|
119
|
+
// (subscribeIfNotPhoneShell)——订阅是轮询的燃料,不订阅就不发
|
|
120
|
+
// admin/shares 请求。设置页的共享列表在 SettingsSection 内部,随设置
|
|
121
|
+
// 页已在门之前。
|
|
122
|
+
registerRemoteShareUi(ctx, RemoteHeaderIcon, RemoteShareMenuItem)
|
|
123
|
+
|
|
124
|
+
// T34 子客户端的远程状态两件套(标题行连接图标、composer 横幅):同样在
|
|
125
|
+
// 桌面门之前注册——桌面端 App 也能以 client 角色接入服务端。部件自身按
|
|
126
|
+
// 数据降级:只在虚拟 id 会话渲染、首次 GET 应答前不渲染,所以主服务端
|
|
127
|
+
// 的页面上两者都是空,桌面保持逐像素 no-op;订阅本身也按虚拟 id 门控
|
|
128
|
+
// (remote-status.ts 的 subscribeIfVirtual)——本地会话不建立订阅,
|
|
129
|
+
// store 只在有订阅者时才轮询,主服务端的页面不白发 remote-status 请求。
|
|
130
|
+
registerRemoteStatusUi(ctx, RemoteStatusIcon, RemoteComposerBanner)
|
|
131
|
+
// T62 当前会话信号的上报:拦截层跑在后台 Node 进程里,读不到浏览器的
|
|
132
|
+
// localStorage——由这里(唯一读得到宿主选择存储的地方)把「当前打开的
|
|
133
|
+
// 会话」在值变化时 POST 给后台路由。同样在桌面门之前挂载:client 角色
|
|
134
|
+
// 的桌面端 App 正是远程会话所在;只在探测出的子客户端角色下运行,主
|
|
135
|
+
// 服务端的页面探测一次后就静默。
|
|
136
|
+
mountCurrentSessionReporter(ctx)
|
|
137
|
+
// T64 服务端分组展开状态的记忆与恢复:宿主在工作区列表 ready 时会把不在
|
|
138
|
+
// 列表里的分组展开记录清掉(retainAccountKeys),而本地工作区先 ready、
|
|
139
|
+
// 服务端分组后并入,zr~ 键每次加载都被清掉、分组回到折叠。与上报器共用
|
|
140
|
+
// 挂载点与角色判断(同一个 client-config 探测)、同样的 1 秒节拍(自己的
|
|
141
|
+
// 定时器),逻辑在 remote-group-expansion.ts 自己的文件里。
|
|
142
|
+
mountRemoteGroupExpansionKeeper(ctx)
|
|
143
|
+
// T41b 的两个远程会话部件:fetch 改写(改动 / diff 面板的两条 /api GET)与
|
|
144
|
+
// 远程会话标记(data-zr-remote-session + 隐藏「在服务端机器上打开」类入口
|
|
145
|
+
// 的样式)。同样必须在桌面门之前注册——桌面窗口也可以是配对好的子客户端,
|
|
146
|
+
// 改写与隐藏在它里面一样必要。改写只碰「同源 + 精确两条路径 + zr~ 虚拟
|
|
147
|
+
// 会话 id」的 GET(remote-fetch.ts),宿主角色的桌面端(会话 id 永非虚拟)
|
|
148
|
+
// 逐字节原样放行;标记属性只在虚拟会话打开时出现,卸载时还原。
|
|
149
|
+
ctx.effect(() => installRemoteApiFetch(window), 'dsh-zen-remote: remote api fetch')
|
|
150
|
+
installRemoteSessionGuard(ctx)
|
|
151
|
+
|
|
152
|
+
// Desktop gate (DSH 0.1.7): the official Electron shell can be dragged
|
|
153
|
+
// down to ~520px wide, where every width-based gate would flip the phone
|
|
154
|
+
// shell on inside the desktop app. Inside that shell this plugin is a
|
|
155
|
+
// complete no-op — no stylesheet, no effects, no slot entries, which is
|
|
156
|
+
// bit-for-bit "not installed" and also retires the desktop-fold knobs
|
|
157
|
+
// there (they exist for narrow desktop *browsers*, which never carry the
|
|
158
|
+
// dshDesktop bridge). See compat/desktop.ts for the marker's provenance.
|
|
159
|
+
if (isDesktopShell()) return
|
|
64
160
|
|
|
65
161
|
ctx.effect(() => {
|
|
66
162
|
const tag = document.createElement('style')
|
|
@@ -111,6 +207,9 @@ export function apply(ctx: ClientContext): void {
|
|
|
111
207
|
// Third-party composer entries (speed chip, vision toggle) move into the
|
|
112
208
|
// model sheet — the row has no width to spare and both are model settings.
|
|
113
209
|
installModelSheetExtras(ctx)
|
|
210
|
+
// T70: the permission menu portals to body on DSH 0.2.0 — mark it so
|
|
211
|
+
// composer.css section 4 can still make it the bottom sheet.
|
|
212
|
+
installPermissionSheet(ctx)
|
|
114
213
|
|
|
115
214
|
// "内测声明" first-run notice: keep it visible (CSS-hiding it leaked the
|
|
116
215
|
// dialog's #root inert lock — see effects/welcome-notice.ts) and offer a
|
|
@@ -156,6 +255,8 @@ export function apply(ctx: ClientContext): void {
|
|
|
156
255
|
id: 'mobile-header-actions',
|
|
157
256
|
order: 0,
|
|
158
257
|
locale: NS,
|
|
258
|
+
// Activity-pill data (subagent catalog + job roster), see activityInject.
|
|
259
|
+
inject: () => activityInject(ctx),
|
|
159
260
|
}, MobileHeaderActions))
|
|
160
261
|
|
|
161
262
|
// Session-info entry (placeholder — S4 owns the sheet) + workbench entry
|
|
@@ -180,14 +281,29 @@ export function apply(ctx: ClientContext): void {
|
|
|
180
281
|
locale: NS,
|
|
181
282
|
// The factory's own sessionId param is unused: every function below
|
|
182
283
|
// takes its own session id explicitly (they're generic action bindings
|
|
183
|
-
// reused verbatim, not closures over one particular session).
|
|
284
|
+
// reused verbatim, not closures over one particular session). The
|
|
285
|
+
// spread adds the activity-pill data (subagent catalog + job roster for
|
|
286
|
+
// the info-sheet badges), see activityInject.
|
|
184
287
|
inject: (_sessionId: SessionId) => ({
|
|
288
|
+
...activityInject(ctx),
|
|
289
|
+
// T67: the SAME page-wide shares store the header icon and the menu
|
|
290
|
+
// item read — the row subscribes only while the sheet is open, so no
|
|
291
|
+
// second poll loop and no phone-shell polling either.
|
|
292
|
+
shares: getSharesStore(),
|
|
185
293
|
forkSession: (id: SessionId) => ctx.sessions.fork({ sessionId: id }),
|
|
186
|
-
|
|
294
|
+
// 0.1.7: ctx.sessions.open is gone; uiWorkspace.openSession is the one
|
|
295
|
+
// navigation entry (also what the official subagent catalog uses).
|
|
296
|
+
// Lazy lookup like every other uiWorkspace binding here: the callback
|
|
297
|
+
// runs on a user tap, by which time the service is registered.
|
|
298
|
+
openSession: (id: SessionId) => {
|
|
299
|
+
const ui = ctx.get('uiWorkspace') as UiWorkspaceLike | undefined
|
|
300
|
+
if (ui === undefined) console.warn('[dsh-zen-remote] uiWorkspace service unavailable; cannot open session', id)
|
|
301
|
+
else ui.openSession(id)
|
|
302
|
+
},
|
|
187
303
|
renameSession: (id: SessionId, title: string) => ctx.sessions.binding(id)?.session.rename(title),
|
|
188
304
|
// 0.1.2 的界面级归档在 uiWorkspace(顺带清当前选中);懒查——回调是用户
|
|
189
|
-
// 点击才跑,那时服务必已注册。本插件的 inject 不包含 uiWorkspace
|
|
190
|
-
//
|
|
305
|
+
// 点击才跑,那时服务必已注册。本插件的 inject 不包含 uiWorkspace,
|
|
306
|
+
// 所以启动时不能查一次就用:可能早于它注册。
|
|
191
307
|
archiveSession: (id: SessionId) => {
|
|
192
308
|
const ui = ctx.get('uiWorkspace') as UiWorkspaceLike | undefined
|
|
193
309
|
return ui === undefined ? ctx.workspaces.archiveSession(id) : ui.archiveSession(id)
|
|
@@ -242,16 +358,18 @@ export function apply(ctx: ClientContext): void {
|
|
|
242
358
|
locale: NS,
|
|
243
359
|
store: nav,
|
|
244
360
|
inject: () => ({
|
|
245
|
-
openSession
|
|
361
|
+
// Same uiWorkspace.openSession binding as the session-info sheet above.
|
|
362
|
+
openSession: (id: SessionId) => {
|
|
363
|
+
const ui = ctx.get('uiWorkspace') as UiWorkspaceLike | undefined
|
|
364
|
+
if (ui === undefined) console.warn('[dsh-zen-remote] uiWorkspace service unavailable; cannot open session', id)
|
|
365
|
+
else ui.openSession(id)
|
|
366
|
+
},
|
|
246
367
|
// uiWorkspace 懒查:回调是用户点击才跑,服务那时必已注册(inject 不含
|
|
247
|
-
// uiWorkspace,启动时可能先于它注册,不能启动查一次就用)。
|
|
248
|
-
// undefined,退回 ctx.workspaces.startSession——0.1.1 专用分支,0.1.2 的
|
|
249
|
-
// 类型里该方法已不存在,故对类型做 LegacyWorkspacesLike cast,运行时走不到。
|
|
368
|
+
// uiWorkspace,启动时可能先于它注册,不能启动查一次就用)。
|
|
250
369
|
startSession: (workspaceId?: WorkspaceId) => {
|
|
251
370
|
const ui = ctx.get('uiWorkspace') as UiWorkspaceLike | undefined
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
: ui.startSession(workspaceId)
|
|
371
|
+
if (ui === undefined) console.warn('[dsh-zen-remote] uiWorkspace service unavailable; cannot start a session')
|
|
372
|
+
else ui.startSession(workspaceId)
|
|
255
373
|
},
|
|
256
374
|
// S5 session-log chip — the same service call MobileDrawerFooter uses.
|
|
257
375
|
downloadSessionLog: (id: SessionId) => ctx.sessionLogDownload.download(id),
|
|
@@ -315,22 +433,19 @@ import type {} from '@deepseek-ai/dsh-client-ui-conversation/client'
|
|
|
315
433
|
import type {} from '@deepseek-ai/dsh-client-ui-sidebar/client'
|
|
316
434
|
import type {} from '@deepseek-ai/dsh-client-locale/client'
|
|
317
435
|
import type {} from '@deepseek-ai/dsh-session-log-export/client'
|
|
318
|
-
//
|
|
319
|
-
//
|
|
320
|
-
// sessionId/useSession/useProjection, and declares the `ctx.uiSession`
|
|
321
|
-
// service.
|
|
322
|
-
// build output carries no trace of it and the runtime is unaffected.
|
|
436
|
+
// ui-session: augments GlobalStandardProps with useSessions /
|
|
437
|
+
// useSessionPendingInteraction / useSessionStatus and SessionStandardProps
|
|
438
|
+
// with sessionId/useSession/useProjection, and declares the `ctx.uiSession`
|
|
439
|
+
// service.
|
|
323
440
|
import type {} from '@deepseek-ai/dsh-client-ui-session/client'
|
|
324
|
-
//
|
|
325
|
-
// `ctx.
|
|
326
|
-
//
|
|
327
|
-
// runtime, so a 0.1.1 installation is unaffected.
|
|
441
|
+
// Controller packages: their `/client` type entries merge `ctx.sessions` /
|
|
442
|
+
// `ctx.workspaces` onto the cordis Context. Type-only — nothing to load at
|
|
443
|
+
// runtime.
|
|
328
444
|
import type {} from '@deepseek-ai/dsh-api-session-controller/client'
|
|
329
445
|
import type {} from '@deepseek-ai/dsh-api-workspace-controller/client'
|
|
330
|
-
//
|
|
331
|
-
//
|
|
332
|
-
//
|
|
333
|
-
//
|
|
334
|
-
// dsh-client-runtime bundle that no longer exists.
|
|
446
|
+
// Type-only: the renderer declares `ctx.slots` on the cordis Context (the
|
|
447
|
+
// service this plugin registers every slot through) and `dsh-subagent/client`
|
|
448
|
+
// types the subagent catalog projection entries the session header reads
|
|
449
|
+
// (projectionsBySession[].values.subagentCatalog on 0.1.7).
|
|
335
450
|
import type {} from '@deepseek-ai/dsh-client-ui-renderer/client'
|
|
336
451
|
import type {} from '@deepseek-ai/dsh-subagent/client'
|