From 3f60b683b6cbe89abe8600ed614f19a540760241 Mon Sep 17 00:00:00 2001 From: QQ Date: Wed, 11 Nov 2026 22:32:08 +0800 Subject: [PATCH] Import src/client/index.ts --- src/client/index.ts | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/client/index.ts diff --git a/src/client/index.ts b/src/client/index.ts new file mode 100644 index 0000000..f916160 --- /dev/null +++ b/src/client/index.ts @@ -0,0 +1,35 @@ +/** + * workspace-groups-remote — merged client entry. + * + * One package gets exactly one client row in the DSH web shell (the module + * loader keys graph rows by package name), so this entry composes the two + * client halves on one fiber: + * + * - groupsClient: the workspace-groups browser + session tab strip + * (groups-client.ts, formerly this file). + * - remoteSshClient: the dsh-remote-ssh client, vendored from + * vendor/dsh-remote-ssh/lib/client.js. Upstream ships it as a + * self-registering module-loader bundle; scripts/build-remote-ssh-client.mjs + * strips that registration wrapper and re-exports the bare factory, which + * is invoked here with this bundle's own require (its only requires are + * `react` and `@deepseek-ai/dsh-client-ui-primitives`, both platform + * modules) and applied alongside the groups client. + * + * The inject list is the union of both halves (remote-ssh's `slots`/`locale` + * are a subset of the groups list). + */ +import type { Context } from '@deepseek-ai/cordis' +import * as groupsClient from './groups-client.ts' +import remoteSshFactory from './remote-ssh-factory.generated.mjs' + +/** Services required before mounting (union of both client halves). */ +export const inject = ['slots', 'sessions', 'workspaces', 'uiWorkspace', 'locale'] + +/** Instantiate the vendored remote-ssh client plugin exactly once. */ +const remoteSshClient = remoteSshFactory(id => require(id)) + +/** Plugin body: apply both client halves on this bundle's fiber. */ +export function apply(ctx: Context): void { + groupsClient.apply(ctx) + remoteSshClient.apply(ctx) +}