dsh-zen-remote 2.0.3 → 2.2.1
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 +15 -1
- package/README.md +11 -5
- package/README.zh-CN.md +11 -5
- package/docs/adr/0001-plugin-bridge-forwards-plugin-routes.md +15 -0
- package/docs/adr/0002-relay-emulates-websocket.md +8 -0
- package/docs/interface.md +3 -1
- package/docs/plugin-bridge.md +140 -0
- package/docs/remote-access.en.md +57 -0
- package/docs/remote-access.md +57 -0
- package/lib/activity.js +25 -0
- package/lib/activity.js.map +1 -1
- package/lib/adapters/dsh-better-sidebar/index.js +144 -0
- package/lib/adapters/dsh-better-sidebar/index.js.map +1 -0
- package/lib/adapters/dsh-better-sidebar/methods.js +221 -0
- package/lib/adapters/dsh-better-sidebar/methods.js.map +1 -0
- package/lib/adapters/index.js +17 -0
- package/lib/adapters/index.js.map +1 -0
- package/lib/adapters/types.js +17 -0
- package/lib/adapters/types.js.map +1 -0
- package/lib/admin-routes.js +51 -0
- package/lib/admin-routes.js.map +1 -1
- package/lib/client-routes.js +18 -1
- package/lib/client-routes.js.map +1 -1
- package/lib/client.js +449 -45
- package/lib/config.js +27 -0
- package/lib/config.js.map +1 -1
- package/lib/http.js +10 -0
- package/lib/http.js.map +1 -1
- package/lib/index.js +273 -1
- package/lib/index.js.map +1 -1
- package/lib/plugin-adapter-core.js +385 -0
- package/lib/plugin-adapter-core.js.map +1 -0
- package/lib/plugin-bridge.js +318 -0
- package/lib/plugin-bridge.js.map +1 -0
- package/lib/plugin-loopback.js +207 -0
- package/lib/plugin-loopback.js.map +1 -0
- package/lib/plugin-route-intercept.js +1103 -0
- package/lib/plugin-route-intercept.js.map +1 -0
- package/lib/plugin-tunnel.js +416 -0
- package/lib/plugin-tunnel.js.map +1 -0
- package/lib/relay-client.js +319 -2
- package/lib/relay-client.js.map +1 -1
- package/lib/relay-server.js +633 -0
- package/lib/relay-server.js.map +1 -1
- package/lib/types/activity.d.ts +22 -0
- package/lib/types/activity.d.ts.map +1 -1
- package/lib/types/adapters/dsh-better-sidebar/index.d.ts +27 -0
- package/lib/types/adapters/dsh-better-sidebar/index.d.ts.map +1 -0
- package/lib/types/adapters/dsh-better-sidebar/methods.d.ts +58 -0
- package/lib/types/adapters/dsh-better-sidebar/methods.d.ts.map +1 -0
- package/lib/types/adapters/index.d.ts +17 -0
- package/lib/types/adapters/index.d.ts.map +1 -0
- package/lib/types/adapters/types.d.ts +42 -0
- package/lib/types/adapters/types.d.ts.map +1 -0
- package/lib/types/admin-routes.d.ts +16 -0
- package/lib/types/admin-routes.d.ts.map +1 -1
- package/lib/types/client/effects/remote-session.d.ts +0 -22
- package/lib/types/client/effects/remote-session.d.ts.map +1 -1
- package/lib/types/client/locales.d.ts +16 -0
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/client/settings/SettingsSection.d.ts.map +1 -1
- package/lib/types/client/styles/remote-session.css.d.ts +1 -1
- package/lib/types/client/styles/remote-session.css.d.ts.map +1 -1
- package/lib/types/client-data/plugin-bridge.d.ts +79 -0
- package/lib/types/client-data/plugin-bridge.d.ts.map +1 -0
- package/lib/types/client-data/remote-status.d.ts +20 -0
- package/lib/types/client-data/remote-status.d.ts.map +1 -1
- package/lib/types/client-data/settings-form.d.ts +37 -1
- package/lib/types/client-data/settings-form.d.ts.map +1 -1
- package/lib/types/client-routes.d.ts +13 -0
- package/lib/types/client-routes.d.ts.map +1 -1
- package/lib/types/config.d.ts +8 -0
- package/lib/types/config.d.ts.map +1 -1
- package/lib/types/http.d.ts +7 -0
- package/lib/types/http.d.ts.map +1 -1
- package/lib/types/index.d.ts +4 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/plugin-adapter-core.d.ts +263 -0
- package/lib/types/plugin-adapter-core.d.ts.map +1 -0
- package/lib/types/plugin-bridge.d.ts +187 -0
- package/lib/types/plugin-bridge.d.ts.map +1 -0
- package/lib/types/plugin-loopback.d.ts +104 -0
- package/lib/types/plugin-loopback.d.ts.map +1 -0
- package/lib/types/plugin-route-intercept.d.ts +114 -0
- package/lib/types/plugin-route-intercept.d.ts.map +1 -0
- package/lib/types/plugin-tunnel.d.ts +96 -0
- package/lib/types/plugin-tunnel.d.ts.map +1 -0
- package/lib/types/relay-client.d.ts +76 -0
- package/lib/types/relay-client.d.ts.map +1 -1
- package/lib/types/relay-server.d.ts +32 -1
- package/lib/types/relay-server.d.ts.map +1 -1
- package/llms.txt +1 -0
- package/package.json +2 -2
- package/scripts/check-plugin-bridge-ui.mjs +168 -0
- package/scripts/check-settings-form.mjs +3 -1
- package/src/activity.ts +32 -0
- package/src/adapters/dsh-better-sidebar/index.ts +144 -0
- package/src/adapters/dsh-better-sidebar/methods.ts +244 -0
- package/src/adapters/index.ts +19 -0
- package/src/adapters/types.ts +44 -0
- package/src/admin-routes.ts +64 -0
- package/src/client/effects/remote-session.ts +82 -10
- package/src/client/locales.ts +36 -0
- package/src/client/settings/SettingsSection.tsx +107 -3
- package/src/client/styles/remote-session.css.ts +70 -31
- package/src/client-data/plugin-bridge.ts +150 -0
- package/src/client-data/remote-status.ts +30 -0
- package/src/client-data/settings-form.ts +78 -0
- package/src/client-routes.ts +29 -1
- package/src/config.ts +32 -0
- package/src/http.ts +12 -0
- package/src/index.ts +279 -1
- package/src/plugin-adapter-core.ts +530 -0
- package/src/plugin-bridge.ts +435 -0
- package/src/plugin-loopback.ts +299 -0
- package/src/plugin-route-intercept.ts +1193 -0
- package/src/plugin-tunnel.ts +470 -0
- package/src/relay-client.ts +394 -2
- package/src/relay-server.ts +656 -1
package/lib/config.js
CHANGED
|
@@ -54,6 +54,7 @@ export const DEFAULTS = {
|
|
|
54
54
|
serverName: defaultServerName(),
|
|
55
55
|
idleHours: 48,
|
|
56
56
|
autoShareNewSessions: false,
|
|
57
|
+
pluginBridgeConsent: {},
|
|
57
58
|
};
|
|
58
59
|
// --- per-field validators -------------------------------------------------
|
|
59
60
|
// Each takes an unknown layer value and returns the normalized legal value,
|
|
@@ -120,6 +121,23 @@ function serverNameOf(value) {
|
|
|
120
121
|
const name = nonEmptyString(value);
|
|
121
122
|
return name === undefined ? undefined : name.slice(0, SERVER_NAME_MAX);
|
|
122
123
|
}
|
|
124
|
+
/** `pluginBridgeConsent`: a plain object mapping plugin names to STRICT
|
|
125
|
+
* booleans. Anything else — null, an array, a non-boolean value (`"yes"`,
|
|
126
|
+
* `1`; unlike the scalar booleans there is no historic `1`/`"1"` convention
|
|
127
|
+
* to honor, this map only ever came from the settings surface or a
|
|
128
|
+
* hand-edited row/file) — makes the layer transparent, because a half-valid
|
|
129
|
+
* consent map must never read as "consented". Object keys are strings by
|
|
130
|
+
* construction in both JSON and YAML; the per-key string check stays as the
|
|
131
|
+
* cheap belt over the iteration. */
|
|
132
|
+
function consentMap(value) {
|
|
133
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
134
|
+
return undefined;
|
|
135
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
136
|
+
if (typeof key !== 'string' || typeof entry !== 'boolean')
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
return value;
|
|
140
|
+
}
|
|
123
141
|
/** Env validator applied to `Number(env[name])`, so `LAN_GATE_PORT='abc'`
|
|
124
142
|
* lands in the same "unset" bucket as a bad row value. */
|
|
125
143
|
function envNumber(name, validate) {
|
|
@@ -179,6 +197,10 @@ const FIELDS = {
|
|
|
179
197
|
serverName: { row: serverNameOf, file: serverNameOf },
|
|
180
198
|
idleHours: { row: inRange(0, 8760), file: inRange(0, 8760) },
|
|
181
199
|
autoShareNewSessions: { row: boolLike, file: boolLike },
|
|
200
|
+
// No env layer on purpose (PB-1): a per-plugin consent map has no historic
|
|
201
|
+
// flat variable to stay compatible with, and a consent decision is a
|
|
202
|
+
// settings-page action, not something set through the environment.
|
|
203
|
+
pluginBridgeConsent: { row: consentMap, file: consentMap },
|
|
182
204
|
};
|
|
183
205
|
/**
|
|
184
206
|
* Resolve one field through env → row → file → default, recording which layer
|
|
@@ -246,6 +268,7 @@ export function resolveConfig(row, file, env) {
|
|
|
246
268
|
serverName: resolveField('serverName', safeRow, safeFile, env, sources),
|
|
247
269
|
idleHours: resolveField('idleHours', safeRow, safeFile, env, sources),
|
|
248
270
|
autoShareNewSessions: resolveField('autoShareNewSessions', safeRow, safeFile, env, sources),
|
|
271
|
+
pluginBridgeConsent: resolveField('pluginBridgeConsent', safeRow, safeFile, env, sources),
|
|
249
272
|
};
|
|
250
273
|
return { values, sources };
|
|
251
274
|
}
|
|
@@ -330,6 +353,10 @@ export const Config = z.object({
|
|
|
330
353
|
serverName: z.any().volatile(),
|
|
331
354
|
idleHours: z.any().volatile(),
|
|
332
355
|
autoShareNewSessions: z.any().volatile(),
|
|
356
|
+
// Plugin-bridge consent (PB-1): a name → boolean map, live-read at compare
|
|
357
|
+
// time — a consent flip must apply without a row restart, so it is
|
|
358
|
+
// deliberately NOT in RESTART_FIELDS.
|
|
359
|
+
pluginBridgeConsent: z.any().volatile(),
|
|
333
360
|
// Client-half knobs (T16): where the phone finds the gateway, and the
|
|
334
361
|
// pairing token it presents. `role('secret')` keeps the token out of every
|
|
335
362
|
// settings wire surface, like the verifier plugin's API key.
|
package/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAKxC,iDAAiD;AACjD,MAAM,eAAe,GAAG,EAAE,CAAA;AA0C1B,SAAS,iBAAiB;IACxB,OAAO,QAAQ,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE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C,mBAAmB,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACvC,cAAc,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAA"}
|
package/lib/http.js
CHANGED
|
@@ -66,4 +66,14 @@ export function sameOriginPost(req) {
|
|
|
66
66
|
return false;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* One plugin-bridge refusal (PB-3): the standard JSON envelope plus the
|
|
71
|
+
* `x-zen-remote-error` marker header — the sub-client's passthrough layer
|
|
72
|
+
* classifies a refusal off the header alone, because the success path
|
|
73
|
+
* streams opaque plugin bytes and must never have to parse a body.
|
|
74
|
+
*/
|
|
75
|
+
export function pluginBridgeError(res, status, code) {
|
|
76
|
+
res.setHeader('x-zen-remote-error', code);
|
|
77
|
+
responseJson(res, status, { ok: false, error: { code } });
|
|
78
|
+
}
|
|
69
79
|
//# sourceMappingURL=http.js.map
|
package/lib/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;wEAEwE;AACxE,MAAM,UAAU,YAAY,CAAC,GAAmB,EAAE,MAAc,EAAE,IAAa;IAC7E,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;IAC/C,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,iCAAiC,CAAC,CAAA;IAChE,GAAG,CAAC,SAAS,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;IACrD,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,CAAA;IAC1C,GAAG,CAAC,SAAS,CAAC,wBAAwB,EAAE,SAAS,CAAC,CAAA;IAClD,GAAG,CAAC,SAAS,CAAC,yBAAyB,E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CAAC,IAAI,KAAK,IAAI,CAAA;IAC9F,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAGD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAmB,EAAE,MAAc,EAAE,IAAY;IACjF,GAAG,CAAC,SAAS,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAA;IACzC,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;AAC3D,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import { randomBytes } from 'node:crypto';
|
|
|
19
19
|
import { homedir } from 'node:os';
|
|
20
20
|
import { basename, extname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
21
21
|
import { readFileConfig, resolveConfig, unwrapVolatile } from './config.js';
|
|
22
|
-
import { createActivityTracker, createParentIndex, startSweeper } from './activity.js';
|
|
22
|
+
import { createActivityTracker, createParentIndex, seedParentIndexFromSnapshots, startSweeper } from './activity.js';
|
|
23
23
|
import { ADMIN_ROUTE_PREFIX, createAdminHandler } from './admin-routes.js';
|
|
24
24
|
import { normalizedRowServerUrl } from './client-pairing.js';
|
|
25
25
|
import { CLIENT_ROUTE_PREFIX, createClientHandler } from './client-routes.js';
|
|
@@ -33,7 +33,13 @@ import { computeFingerprints } from './fingerprint.js';
|
|
|
33
33
|
import { runSelfCheck, installIntercept } from './intercept.js';
|
|
34
34
|
import { checkGatewayShape } from './intercept-shape.js';
|
|
35
35
|
import { checkFetchRouteShape, installFetchRouteIntercept } from './fetch-route-intercept.js';
|
|
36
|
+
import { checkWebServerShape, installPluginRouteIntercept } from './plugin-route-intercept.js';
|
|
37
|
+
import { normalizeAdapter, adapterOwnsRegistryEntry } from './plugin-adapter-core.js';
|
|
38
|
+
import { ADAPTERS } from './adapters/index.js';
|
|
36
39
|
import { createRelayHandler, loadServerId, RELAY_PREFIX, resolveDshVersion } from './relay-server.js';
|
|
40
|
+
import { createBridgeRegistry, compareBridges } from './plugin-bridge.js';
|
|
41
|
+
import { createPluginLoopback } from './plugin-loopback.js';
|
|
42
|
+
import { createPluginTunnel } from './plugin-tunnel.js';
|
|
37
43
|
// The loader's config schema (settings form) and the role normalizer live in
|
|
38
44
|
// src/config.ts next to the resolution they describe; re-exported so the
|
|
39
45
|
// plugin row's public surface stays on the main entry. The same-origin gate
|
|
@@ -87,6 +93,20 @@ let clientRelayClient;
|
|
|
87
93
|
export function getRelayClient() {
|
|
88
94
|
return clientRelayClient;
|
|
89
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* The plugin bridge's declaration registry (PB-1), created inside apply() on
|
|
98
|
+
* BOTH roles and kept on the module so later tasks (the handshake's plugins
|
|
99
|
+
* table, the client-side rewrite) can reach it without reaching into a
|
|
100
|
+
* context. Undefined in compositions that never ran this module's apply, and
|
|
101
|
+
* — identity-guarded below — after the row that owned a registry was
|
|
102
|
+
* unloaded or reloaded, so a reloaded row never leaves a stale table where
|
|
103
|
+
* the getter can hand it out (the T23a-fix discipline).
|
|
104
|
+
*/
|
|
105
|
+
let bridgeRegistry;
|
|
106
|
+
/** The live bridge registry, if a plugin row is currently applied. */
|
|
107
|
+
export function getBridgeRegistry() {
|
|
108
|
+
return bridgeRegistry;
|
|
109
|
+
}
|
|
90
110
|
/**
|
|
91
111
|
* One configured number on its way to the browser, clamped into a band that
|
|
92
112
|
* cannot break the composer — a ratio of 5 or a 9000px lift would push the
|
|
@@ -365,6 +385,79 @@ export async function handleUpload(ctx, maxBytes, req, res, admit) {
|
|
|
365
385
|
*/
|
|
366
386
|
export function apply(ctx, config = {}) {
|
|
367
387
|
const effective = resolveConfig(config, readFileConfig(), process.env);
|
|
388
|
+
// The plugin bridge's zenRemote service (PB-1), provided on BOTH roles
|
|
389
|
+
// before any role branch: a plugin that wants its panel data forwarded in
|
|
390
|
+
// remote sessions declares that against THIS process whichever role it
|
|
391
|
+
// runs as, and the declaration registry is the one piece of PB-1 both the
|
|
392
|
+
// server half (handshake plugins table) and the client half (route
|
|
393
|
+
// rewrite) will read. ctx.provide (cordis 4) registers the service owned
|
|
394
|
+
// by THIS row's fiber: visible to `inject(['zenRemote'])` dependents once
|
|
395
|
+
// the row is active, withdrawn when the row unloads — so a composition
|
|
396
|
+
// without zen-remote never fires those injects and a row reload swaps the
|
|
397
|
+
// service wholesale. The registry goes into the module slot BEFORE the
|
|
398
|
+
// provide so this apply's consumers never see a window without it; the
|
|
399
|
+
// effect's identity guard then clears the slot exactly when THIS row
|
|
400
|
+
// unloads (a reload installs the new registry before the old disposer
|
|
401
|
+
// runs, same shape as clientRelayClient). provide() throwing is not worth
|
|
402
|
+
// failing the row over — the bridge stays off, everything else keeps
|
|
403
|
+
// working — so it degrades to a warning like the session feeds do.
|
|
404
|
+
const registry = createBridgeRegistry({
|
|
405
|
+
warn: (text) => { ctx.logger?.warn('dsh-zen-remote plugin bridge: %s', text); },
|
|
406
|
+
});
|
|
407
|
+
bridgeRegistry = registry;
|
|
408
|
+
try {
|
|
409
|
+
const service = {
|
|
410
|
+
bridge: (declaration) => registry.register(declaration),
|
|
411
|
+
};
|
|
412
|
+
ctx.provide('zenRemote', service);
|
|
413
|
+
}
|
|
414
|
+
catch (error) {
|
|
415
|
+
ctx.logger?.warn('dsh-zen-remote: cannot provide the "zenRemote" service: %s', message(error));
|
|
416
|
+
}
|
|
417
|
+
ctx.effect(() => () => {
|
|
418
|
+
if (bridgeRegistry === registry)
|
|
419
|
+
bridgeRegistry = undefined;
|
|
420
|
+
}, 'dsh-zen-remote: plugin bridge registry disposal');
|
|
421
|
+
// The adapters (PB-11): each one registers ONLY against its target's
|
|
422
|
+
// EXACT installed version, probed off the host's `pluginPackages` service
|
|
423
|
+
// (`packageOf(name, ctx.baseUrl)` — verified on 0.2.0-rc.2 to answer
|
|
424
|
+
// `{name, version, dir, …}` or undefined; any other shape, a missing
|
|
425
|
+
// service or a probe failure reads as "not installed" and the adapter
|
|
426
|
+
// stays out). A plugin that registers its OWN cooperative declaration
|
|
427
|
+
// always wins: the adapter yields at registration time (logged), and the
|
|
428
|
+
// runtime re-checks the registry digest on every request. Both roles run
|
|
429
|
+
// this loop — the registry entries drive the handshake table, the bridge
|
|
430
|
+
// verdicts and the settings listing on either side, while the returned
|
|
431
|
+
// array feeds the two request halves.
|
|
432
|
+
const adapters = [];
|
|
433
|
+
{
|
|
434
|
+
const adapterWarn = (text) => { ctx.logger?.warn('dsh-zen-remote adapter: %s', text); };
|
|
435
|
+
for (const adapter of ADAPTERS) {
|
|
436
|
+
try {
|
|
437
|
+
const holder = ctx;
|
|
438
|
+
const packages = holder.get?.('pluginPackages');
|
|
439
|
+
const found = packages?.packageOf?.(adapter.plugin, holder.baseUrl ?? '');
|
|
440
|
+
const installedVersion = found !== null && typeof found === 'object' && typeof found.version === 'string'
|
|
441
|
+
? found.version
|
|
442
|
+
: undefined;
|
|
443
|
+
if (installedVersion === undefined || installedVersion === '') {
|
|
444
|
+
adapterWarn(`${adapter.plugin}: target package (or its version) not found; not registered`);
|
|
445
|
+
continue;
|
|
446
|
+
}
|
|
447
|
+
const normalized = normalizeAdapter(adapter, installedVersion);
|
|
448
|
+
if (registry.get(normalized.plugin) !== undefined) {
|
|
449
|
+
adapterWarn(`${normalized.plugin}: the plugin registers its own bridge declaration; the adapter yields`);
|
|
450
|
+
continue;
|
|
451
|
+
}
|
|
452
|
+
registry.registerNormalized(normalized.declaration);
|
|
453
|
+
adapters.push(normalized);
|
|
454
|
+
ctx.logger?.info('dsh-zen-remote adapter: %s adapted at version %s', normalized.plugin, installedVersion);
|
|
455
|
+
}
|
|
456
|
+
catch (error) {
|
|
457
|
+
adapterWarn(`${adapter.plugin} refused: ${error instanceof Error ? error.message : String(error)}`);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
368
461
|
if (effective.values.role === 'host') {
|
|
369
462
|
// A row that switched from client to host must not leave a stale relay
|
|
370
463
|
// client where getRelayClient() can find it (T23a-fix).
|
|
@@ -466,6 +559,32 @@ export function apply(ctx, config = {}) {
|
|
|
466
559
|
const agents = agentsCtx.agents;
|
|
467
560
|
restoreBusy(store, () => agents.list());
|
|
468
561
|
});
|
|
562
|
+
// Restart repair (2026-10-13): the parent index rebuilds only from LIVE
|
|
563
|
+
// session/event traffic, so after a host restart every already-stored
|
|
564
|
+
// sidechat / subagent child lost its parent link and the relay answered
|
|
565
|
+
// `not-shared` for a session whose share it used to inherit through the
|
|
566
|
+
// ancestor chain. Seed the index once from the persistence service's
|
|
567
|
+
// snapshot list — headers only, event logs are never read.
|
|
568
|
+
try {
|
|
569
|
+
ctx.inject(['sessionPersistence'], (persistenceCtx) => {
|
|
570
|
+
const persistence = persistenceCtx.sessionPersistence;
|
|
571
|
+
if (persistence === undefined) {
|
|
572
|
+
ctx.logger.warn('dsh-zen-remote: no sessionPersistence service — pre-restart subagent sessions stay not-shared until they emit an event');
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
void persistence
|
|
576
|
+
.list()
|
|
577
|
+
.then((snapshots) => {
|
|
578
|
+
const recorded = seedParentIndexFromSnapshots(parentIndex, snapshots);
|
|
579
|
+
if (recorded > 0)
|
|
580
|
+
ctx.logger.info?.('dsh-zen-remote: restored %d persisted parent links', recorded);
|
|
581
|
+
})
|
|
582
|
+
.catch((error) => ctx.logger.warn('dsh-zen-remote cannot seed parent links from persisted sessions: %s', message(error)));
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
catch (error) {
|
|
586
|
+
ctx.logger.warn('dsh-zen-remote cannot listen on "sessionPersistence": %s', message(error));
|
|
587
|
+
}
|
|
469
588
|
// Settings-surface admin routes (T14). The browser cannot call the
|
|
470
589
|
// gateway's loopback-only admin API from DSH's origin, so the host
|
|
471
590
|
// process re-exposes it same-origin and the handler calls the gateway AS
|
|
@@ -506,6 +625,16 @@ export function apply(ctx, config = {}) {
|
|
|
506
625
|
// composition lacks the service.
|
|
507
626
|
viewerCount: (id) => relayHandler?.viewerCount(id) ?? 0,
|
|
508
627
|
sessionQuery: () => webCtx.reflect.get('sessionQuery'),
|
|
628
|
+
// The plugin bridge listing (PB-5): the SAME registry this apply
|
|
629
|
+
// built and the SAME live consent reader the relay's plugins table
|
|
630
|
+
// uses — one source of truth per question. PB-11: the listing
|
|
631
|
+
// marks the plugins an adapter stands in for (live — a plugin
|
|
632
|
+
// that registered its own declaration stops being marked).
|
|
633
|
+
pluginBridge: {
|
|
634
|
+
registry,
|
|
635
|
+
getConsent: () => resolveConfig(config, readFileConfig(), process.env).values.pluginBridgeConsent,
|
|
636
|
+
adaptedPlugins: () => new Set(adapters.filter((adapter) => adapterOwnsRegistryEntry(adapter, registry.get(adapter.plugin))).map((adapter) => adapter.plugin)),
|
|
637
|
+
},
|
|
509
638
|
}),
|
|
510
639
|
}), 'dsh-zen-remote: admin routes');
|
|
511
640
|
});
|
|
@@ -549,6 +678,32 @@ export function apply(ctx, config = {}) {
|
|
|
549
678
|
// ~7 ms per computation against a full registry; a failed compute
|
|
550
679
|
// lands as the empty map inside the relay handler's own guard.
|
|
551
680
|
relayCtx.effect(() => {
|
|
681
|
+
// The plugin bridge's loopback facts (PB-3), both read PER REQUEST
|
|
682
|
+
// through the reflection layer: the web server may have restarted on
|
|
683
|
+
// another port or protocol, and the connection service's
|
|
684
|
+
// authenticatedUrl — the token-exchange entry the lan-gate wiring
|
|
685
|
+
// also reads (0.1.1 hosts lack the method entirely) — lives on a
|
|
686
|
+
// service deliberately NOT in this inject's declaration list (same
|
|
687
|
+
// reason as getApiFetch above: adding it would keep the whole relay
|
|
688
|
+
// prefix off compositions that lack it).
|
|
689
|
+
const getLoopbackTarget = () => {
|
|
690
|
+
const webServer = relayCtx.reflect.get('webServer');
|
|
691
|
+
const port = typeof webServer?.port === 'number' && webServer.port > 0 ? webServer.port : undefined;
|
|
692
|
+
if (port === undefined)
|
|
693
|
+
throw new Error('the web server exposes no loopback port');
|
|
694
|
+
return { protocol: webServer?.protocol === 'https:' ? 'https:' : 'http:', port };
|
|
695
|
+
};
|
|
696
|
+
const getTokenUrl = () => {
|
|
697
|
+
const connection = relayCtx.reflect.get('connection');
|
|
698
|
+
if (typeof connection?.authenticatedUrl !== 'function')
|
|
699
|
+
return undefined;
|
|
700
|
+
const { protocol, port } = getLoopbackTarget();
|
|
701
|
+
return connection.authenticatedUrl(`${protocol}//127.0.0.1:${port}`);
|
|
702
|
+
};
|
|
703
|
+
// One loopback executor for BOTH plugin halves (the HTTP forward and
|
|
704
|
+
// the PB-10 tunnel): a single cookie cache behind two consumers.
|
|
705
|
+
const pluginLoopback = createPluginLoopback({ getTarget: getLoopbackTarget, getTokenUrl });
|
|
706
|
+
const pluginConsent = () => resolveConfig(config, readFileConfig(), process.env).values.pluginBridgeConsent;
|
|
552
707
|
const handler = createRelayHandler({
|
|
553
708
|
secret: relaySecret,
|
|
554
709
|
store,
|
|
@@ -566,6 +721,43 @@ export function apply(ctx, config = {}) {
|
|
|
566
721
|
serverName: () => resolveConfig(config, readFileConfig(), process.env).values.serverName,
|
|
567
722
|
dshVersion: resolveDshVersion(),
|
|
568
723
|
fingerprints: () => computeFingerprints(relayCtx),
|
|
724
|
+
// PB-2: the plugin bridge table, rebuilt FRESH at every handshake
|
|
725
|
+
// from the PB-1 registry and the row's consent map — both live:
|
|
726
|
+
// the registry through this apply's own closure, the consent
|
|
727
|
+
// through resolveConfig on the SAME row object (a volatile field,
|
|
728
|
+
// read at use time per the hard constraint, never snapshotted).
|
|
729
|
+
plugins: () => {
|
|
730
|
+
const consent = resolveConfig(config, readFileConfig(), process.env).values.pluginBridgeConsent;
|
|
731
|
+
const table = {};
|
|
732
|
+
for (const declaration of registry.list()) {
|
|
733
|
+
table[declaration.plugin] = {
|
|
734
|
+
version: declaration.version,
|
|
735
|
+
digest: declaration.digest,
|
|
736
|
+
serverScopeConsent: consent[declaration.plugin] === true,
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
return table;
|
|
740
|
+
},
|
|
741
|
+
},
|
|
742
|
+
// PB-3: the forwarding half of the plugin bridge — the registry
|
|
743
|
+
// this apply built (the zenRemote service's table), the consent
|
|
744
|
+
// map read LIVE per request (a volatile row field), and the
|
|
745
|
+
// loopback executor over the wiring's two reflection getters.
|
|
746
|
+
// PB-10: the WebSocket byte tunnel's server half shares the SAME
|
|
747
|
+
// loopback (one cookie cache) and the same live consent; its
|
|
748
|
+
// reachability judgment rides the store directly (the handler's
|
|
749
|
+
// own isAccessible closure is not visible out here).
|
|
750
|
+
pluginBridge: {
|
|
751
|
+
registry,
|
|
752
|
+
getConsent: pluginConsent,
|
|
753
|
+
loopback: pluginLoopback,
|
|
754
|
+
adapters,
|
|
755
|
+
tunnel: createPluginTunnel({
|
|
756
|
+
bridge: { registry, getConsent: pluginConsent, loopback: pluginLoopback },
|
|
757
|
+
getTarget: getLoopbackTarget,
|
|
758
|
+
isAccessible: (sessionId) => store.isAccessible(sessionId, parentIndex.parentOf),
|
|
759
|
+
heartbeatMs: 15_000,
|
|
760
|
+
}),
|
|
569
761
|
},
|
|
570
762
|
});
|
|
571
763
|
const unregister = relayCtx.webServer.register({
|
|
@@ -641,6 +833,14 @@ export function apply(ctx, config = {}) {
|
|
|
641
833
|
computeOwnFingerprints: () => computeFingerprints(ctx),
|
|
642
834
|
});
|
|
643
835
|
clientRelayClient = relayClient;
|
|
836
|
+
// The plugin bridge's live verdict (PB-2), the CLIENT role's job — a host
|
|
837
|
+
// has no remote sessions of its own to bridge anything into. Computed PER
|
|
838
|
+
// CALL (never a stored conclusion): the local registry is this apply's
|
|
839
|
+
// own closure, the server's table is the LAST handshake's `plugins`
|
|
840
|
+
// (undefined until one succeeded — an old server reads server-too-old),
|
|
841
|
+
// and `online` is the client's CURRENT state — so a registry change, a
|
|
842
|
+
// fresh handshake or a link flip shows up at the very next read.
|
|
843
|
+
const pluginBridgeStatus = () => compareBridges(registry.list(), relayClient.handshakeInfo?.plugins, relayClient.state === 'online');
|
|
644
844
|
// A stopped or reloaded row must not leave a stale instance where the
|
|
645
845
|
// module getter can hand it out (T23a-fix), and its reconnect machinery
|
|
646
846
|
// (T43) must not outlive the row either: stop() cancels the armed retry
|
|
@@ -846,6 +1046,76 @@ export function apply(ctx, config = {}) {
|
|
|
846
1046
|
fetchRouteHandle = undefined;
|
|
847
1047
|
}, 'dsh-zen-remote: fetch-route intercept');
|
|
848
1048
|
});
|
|
1049
|
+
// The plugin bridge's route interception (PB-4): the local webServer's
|
|
1050
|
+
// `match` wrap forwarding bridged-plugin requests for REMOTE sessions
|
|
1051
|
+
// through the relay. Injected on `webServer` alone — the only service
|
|
1052
|
+
// it reads — and the raw instance comes off the reflection layer's
|
|
1053
|
+
// symbols lookup, the same face the typert and fetch-route wraps use.
|
|
1054
|
+
// The diagnostics flow to the client status route like theirs, refused
|
|
1055
|
+
// installs included.
|
|
1056
|
+
let pluginRouteHandle;
|
|
1057
|
+
let pluginRouteRefused;
|
|
1058
|
+
const pluginRouteDiagnostics = () => {
|
|
1059
|
+
if (pluginRouteHandle !== undefined)
|
|
1060
|
+
return pluginRouteHandle.diagnostics();
|
|
1061
|
+
if (pluginRouteRefused !== undefined) {
|
|
1062
|
+
return {
|
|
1063
|
+
installed: false,
|
|
1064
|
+
shape: pluginRouteRefused,
|
|
1065
|
+
forwarded: 0,
|
|
1066
|
+
refused: 0,
|
|
1067
|
+
refusalsByReason: {},
|
|
1068
|
+
recentFailures: [],
|
|
1069
|
+
adapterForwarded: 0,
|
|
1070
|
+
adapterResponseRewrites: 0,
|
|
1071
|
+
adapterResponsePassthroughs: 0,
|
|
1072
|
+
tunnelsCurrent: 0,
|
|
1073
|
+
tunnelsOpened: 0,
|
|
1074
|
+
tunnelsClosed: 0,
|
|
1075
|
+
};
|
|
1076
|
+
}
|
|
1077
|
+
return undefined;
|
|
1078
|
+
};
|
|
1079
|
+
ctx.inject(['webServer'], (wsCtx) => {
|
|
1080
|
+
const logWarn = (...args) => { ctx.logger?.warn(...args); };
|
|
1081
|
+
const proxy = wsCtx.webServer;
|
|
1082
|
+
const raw = proxy !== null && typeof proxy === 'object'
|
|
1083
|
+
? proxy[symbols.original]
|
|
1084
|
+
: undefined;
|
|
1085
|
+
if (raw === null || typeof raw !== 'object') {
|
|
1086
|
+
pluginRouteRefused = { ok: false, reasons: ['original: webServer[symbols.original] is not an object'] };
|
|
1087
|
+
logWarn('dsh-zen-remote plugin-route intercept not installed: %s', pluginRouteRefused.reasons[0]);
|
|
1088
|
+
return;
|
|
1089
|
+
}
|
|
1090
|
+
// Shape first, like every wrap: a failed check leaves the webServer
|
|
1091
|
+
// exactly as it was — local routing untouched, remote bridging off.
|
|
1092
|
+
const shape = checkWebServerShape(raw);
|
|
1093
|
+
if (!shape.ok) {
|
|
1094
|
+
pluginRouteRefused = shape;
|
|
1095
|
+
logWarn('dsh-zen-remote plugin-route intercept not installed: %s', shape.reasons.join('; '));
|
|
1096
|
+
return;
|
|
1097
|
+
}
|
|
1098
|
+
const handle = installPluginRouteIntercept({
|
|
1099
|
+
webServer: raw,
|
|
1100
|
+
registry,
|
|
1101
|
+
relay: relayClient,
|
|
1102
|
+
getServerId: () => relayClient.handshakeInfo?.serverId,
|
|
1103
|
+
getStatus: pluginBridgeStatus,
|
|
1104
|
+
adapters,
|
|
1105
|
+
// PB-12: the browser's currently open session — a VIRTUAL id means
|
|
1106
|
+
// a remote panel is the request's origin, the signal the adapter
|
|
1107
|
+
// routes' deny hooks read (better-sidebar's open.external carries
|
|
1108
|
+
// no session field of its own).
|
|
1109
|
+
getCurrentSession: () => (reportedCurrentSession.kind === 'open' ? reportedCurrentSession.sessionId : undefined),
|
|
1110
|
+
log: (format, ...args) => { ctx.logger?.info(`dsh-zen-remote ${format}`, ...args); },
|
|
1111
|
+
});
|
|
1112
|
+
pluginRouteHandle = handle;
|
|
1113
|
+
wsCtx.effect(() => () => {
|
|
1114
|
+
handle.uninstall();
|
|
1115
|
+
if (pluginRouteHandle === handle)
|
|
1116
|
+
pluginRouteHandle = undefined;
|
|
1117
|
+
}, 'dsh-zen-remote: plugin route intercept');
|
|
1118
|
+
});
|
|
849
1119
|
ctx.inject(['webServer', 'connection'], (clientCtx) => {
|
|
850
1120
|
clientCtx.effect(() => clientCtx.webServer.register({
|
|
851
1121
|
kind: 'prefix',
|
|
@@ -856,6 +1126,8 @@ export function apply(ctx, config = {}) {
|
|
|
856
1126
|
getRelayClient: () => relayClient,
|
|
857
1127
|
getIntercept: interceptDiagnostics,
|
|
858
1128
|
getFetchRouteIntercept: fetchRouteDiagnostics,
|
|
1129
|
+
getPluginRouteIntercept: pluginRouteDiagnostics,
|
|
1130
|
+
getPluginBridgeStatus: pluginBridgeStatus,
|
|
859
1131
|
onCurrentSession,
|
|
860
1132
|
}),
|
|
861
1133
|
}), 'dsh-zen-remote: client routes');
|