dsh-ssh-workspace-companion 0.2.6 → 0.2.8

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.
Files changed (2) hide show
  1. package/lib/index.js +11 -3
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1,5 +1,9 @@
1
+ import { readFileSync } from 'node:fs'
2
+ import { createRequire } from 'node:module'
3
+ import { pathToFileURL } from 'node:url'
4
+
1
5
  export const name = 'dsh-ssh-workspace-companion'
2
- export const inject = ['webServer']
6
+ export const inject = ['webServer', 'profileContext']
3
7
 
4
8
  const HEALTH_PATH = '/remote-desktop-companion/api/health'
5
9
 
@@ -7,7 +11,11 @@ const HEALTH_PATH = '/remote-desktop-companion/api/health'
7
11
  * Transitional package-readiness probe. Session and Workspace data always use
8
12
  * the authenticated DSH Client Controller running inside the remote iframe.
9
13
  */
10
- export function apply(ctx) {
14
+ export async function apply(ctx) {
15
+ const require = createRequire(ctx.profileContext.installAnchor)
16
+ const boot = await import(pathToFileURL(require.resolve('@deepseek-ai/dsh-app-boot')).href)
17
+ const dshVersion = boot.getDshRuntimeVersion()
18
+ const version = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version
11
19
  const disposeHealth = ctx.webServer.register({
12
20
  kind: 'exact',
13
21
  path: HEALTH_PATH,
@@ -16,7 +24,7 @@ export function apply(ctx) {
16
24
  'content-type': 'application/json; charset=utf-8',
17
25
  'cache-control': 'no-store',
18
26
  })
19
- res.end(JSON.stringify({ ok: true, name }))
27
+ res.end(JSON.stringify({ ok: true, name, version, dshVersion }))
20
28
  },
21
29
  })
22
30
  ctx.effect(() => disposeHealth, 'dsh-remote-desktop-companion: readiness route')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ssh-workspace-companion",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "Remote companion for dsh-remote-desktop iframe control.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",