@linxin666/dsh-remote-web-ui 0.3.13 → 0.3.14
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/README.i18n.yaml +2 -2
- package/README.md +2 -2
- package/README.zh.md +2 -2
- package/lib/client.js +1 -5
- package/lib/client.js.map +1 -1
- package/lib/index.js +3 -8
- package/lib/types/client/remote-channel.d.ts +0 -2
- package/lib/types/client/remote-channel.d.ts.map +1 -1
- package/lib/types/client/remote-channel.js +0 -4
- package/lib/types/remote-api.d.ts +1 -1
- package/lib/types/remote-api.d.ts.map +1 -1
- package/lib/types/remote-api.js +1 -1
- package/lib/types/remote-channel-boot.d.ts.map +1 -1
- package/lib/types/remote-channel-boot.js +0 -1
- package/lib/types/remote-channel-rules.d.ts +0 -1
- package/lib/types/remote-channel-rules.d.ts.map +1 -1
- package/lib/types/remote-channel-rules.js +0 -1
- package/lib/types/remote-methods.d.ts +1 -4
- package/lib/types/remote-methods.d.ts.map +1 -1
- package/lib/types/remote-methods.js +1 -5
- package/package.json +18 -18
- package/src/client/remote-channel.ts +0 -3
- package/src/remote-api.ts +0 -1
- package/src/remote-channel-boot.ts +0 -1
- package/src/remote-channel-rules.ts +0 -2
- package/src/remote-methods.ts +1 -6
package/lib/index.js
CHANGED
|
@@ -1577,8 +1577,6 @@ const REMOTE_UPGRADE_PATHS = [
|
|
|
1577
1577
|
];
|
|
1578
1578
|
/** Plugin-manager HTTP prefix: install/remove stay physically local. */
|
|
1579
1579
|
const PLUGIN_MANAGER_PATH = "/api/plugin-manager";
|
|
1580
|
-
/** Desktop-launcher HTTP prefix: shortcut create and host shutdown stay physically local. */
|
|
1581
|
-
const DESKTOP_LAUNCHER_PATH = "/api/dsh-desktop-launcher";
|
|
1582
1580
|
/**
|
|
1583
1581
|
* The cookieless device credential: the boot patch reads the device id from
|
|
1584
1582
|
* the /pair-app URL, keeps it in sessionStorage, and attaches it to every
|
|
@@ -1595,14 +1593,12 @@ const REMOTE_DEVICE_QUERY = "device";
|
|
|
1595
1593
|
* paired remote desktop may use the full host API (chat, sessions,
|
|
1596
1594
|
* settings, credentials, presets — it is a full-control credential), but it
|
|
1597
1595
|
* must not reach the machine-control planes: pairing control itself, the
|
|
1598
|
-
* dsh-web self-update installer, plugin install/remove
|
|
1599
|
-
* launcher actions (host shutdown, shortcuts).
|
|
1596
|
+
* dsh-web self-update installer, and plugin install/remove.
|
|
1600
1597
|
*/
|
|
1601
1598
|
const LOCAL_ONLY_PREFIXES = [
|
|
1602
1599
|
"/api/pair",
|
|
1603
1600
|
"/api/update",
|
|
1604
|
-
PLUGIN_MANAGER_PATH
|
|
1605
|
-
DESKTOP_LAUNCHER_PATH
|
|
1601
|
+
PLUGIN_MANAGER_PATH
|
|
1606
1602
|
];
|
|
1607
1603
|
/**
|
|
1608
1604
|
* Whether a paired inner path must stay physically local.
|
|
@@ -3580,7 +3576,6 @@ const REMOTE_CHANNEL_RULES = {
|
|
|
3580
3576
|
apiPrefix: "/api/",
|
|
3581
3577
|
pairPrefix: "/api/pair/",
|
|
3582
3578
|
updatePrefix: "/api/update/",
|
|
3583
|
-
desktopLauncherPrefix: "/api/dsh-desktop-launcher",
|
|
3584
3579
|
settingsBridgePrefix: "/api/dsh-web-ui-settings",
|
|
3585
3580
|
sidebarPrefix: "/sidebar/",
|
|
3586
3581
|
gitPrefix: "/git/",
|
|
@@ -3630,7 +3625,7 @@ const REMOTE_CHANNEL_BOOT_GLOBAL = "__DSH_REMOTE_CHANNEL_BOOT__";
|
|
|
3630
3625
|
function buildRemoteChannelBootScript(rules = REMOTE_CHANNEL_RULES) {
|
|
3631
3626
|
const json = JSON.stringify(rules);
|
|
3632
3627
|
const seat = JSON.stringify(REMOTE_CHANNEL_BOOT_GLOBAL);
|
|
3633
|
-
return "(function(){try{var w=window,loc=w.location,h=loc.hostname;if(h==='localhost'||h==='::1'||/^127(\\.\\d{1,3}){3}$/.test(h))return;try{if(w.__DSH_TRANSPORT__===undefined)w.__DSH_TRANSPORT__={};w.__DSH_TRANSPORT__.ownsHost=true}catch(e){}var R=" + json + ";function rdv(){try{return w.sessionStorage.getItem(R.deviceKey)}catch(e){return null}}function att(init){var dv=rdv();if(dv===null)return init;var h=init&&init.headers;if(typeof Headers!==\"undefined\"&&h instanceof Headers){try{h.set(R.deviceHeader,dv)}catch(e){}return init}if(typeof h===\"object\"&&h!==null){var o={};for(var k in h)o[k]=h[k];o[R.deviceHeader]=dv;return Object.assign({},init,{headers:o})}return init}function sf(p){if(p.indexOf(R.pairPrefix)===0)return false;if(p.indexOf(R.updatePrefix)===0)return false;if(p===R.
|
|
3628
|
+
return "(function(){try{var w=window,loc=w.location,h=loc.hostname;if(h==='localhost'||h==='::1'||/^127(\\.\\d{1,3}){3}$/.test(h))return;try{if(w.__DSH_TRANSPORT__===undefined)w.__DSH_TRANSPORT__={};w.__DSH_TRANSPORT__.ownsHost=true}catch(e){}var R=" + json + ";function rdv(){try{return w.sessionStorage.getItem(R.deviceKey)}catch(e){return null}}function att(init){var dv=rdv();if(dv===null)return init;var h=init&&init.headers;if(typeof Headers!==\"undefined\"&&h instanceof Headers){try{h.set(R.deviceHeader,dv)}catch(e){}return init}if(typeof h===\"object\"&&h!==null){var o={};for(var k in h)o[k]=h[k];o[R.deviceHeader]=dv;return Object.assign({},init,{headers:o})}return init}function sf(p){if(p.indexOf(R.pairPrefix)===0)return false;if(p.indexOf(R.updatePrefix)===0)return false;if(p===R.settingsBridgePrefix||p.indexOf(R.settingsBridgePrefix+\"/\")===0)return false;if(p.indexOf(R.apiPrefix)===0)return true;if(p.indexOf(R.sidebarPrefix)===0||p===\"/sidebar\")return true;if(p.indexOf(R.gitPrefix)===0||p===\"/git\")return true;if(p.indexOf(R.petPrefix)===0||p===\"/pet\")return true;return false}function sw(p){return R.wsPaths.indexOf(p)!==-1}function rp(p){return R.remotePrefix+p}function so(u){return u.origin===loc.origin}function rr(raw){var u;try{u=new URL(raw,loc.href)}catch(e){return raw}if(u.origin!==loc.origin)return raw;if(!sf(u.pathname))return raw;u.pathname=rp(u.pathname);if(raw.charAt(0)===\"/\"&&raw.charAt(1)!==\"/\")return u.pathname+u.search+u.hash;return u.href}function uc(v){if(typeof v!==\"object\"||v===null)return undefined;var n=v.result;if(typeof n===\"object\"&&n!==null){var e=n.error;if(typeof e===\"object\"&&e!==null&&typeof e.code===\"string\")return e.code}var t=v.error;if(typeof t===\"object\"&&t!==null&&typeof t.code===\"string\")return t.code;return undefined}var seat={onUnpaired:null,onPaired:null,pendingUnpaired:false,restore:function(){}};function denied(res){if(res.status!==403)return false;return res.clone().json().then(function(b){return uc(b)===\"unpaired\"}).catch(function(){return false})}function signal(unpaired){if(unpaired){if(seat.onUnpaired)seat.onUnpaired();else seat.pendingUnpaired=true}else{seat.pendingUnpaired=false;if(seat.onPaired)seat.onPaired()}}var of=w.fetch;w.fetch=function(input,init){var raw=typeof input===\"string\"||input instanceof URL?input.toString():input.url;var url=new URL(raw,loc.href);if(so(url)&&sf(url.pathname)){var next=new URL(url);next.pathname=rp(url.pathname);var target=typeof input===\"string\"||input instanceof URL?next.toString():new Request(next,input);return Promise.resolve(of.call(w,target,att(init))).then(function(res){void Promise.resolve(denied(res)).then(signal);return res})}return of.call(w,input,init)};var OW=w.WebSocket;w.WebSocket=function(url,protocols){var p=new URL(url.toString(),loc.href);var o=p.protocol===\"wss:\"?\"https://\"+p.host:p.protocol===\"ws:\"?\"http://\"+p.host:\"\";if(o!==\"\"&&o===loc.origin&&sw(p.pathname)){var nx=new URL(p);nx.pathname=rp(p.pathname);var dvv=rdv();if(dvv!==null)nx.searchParams.set(R.deviceQuery,dvv);return protocols!==undefined?new OW(nx,protocols):new OW(nx)}return protocols!==undefined?new OW(url,protocols):new OW(url)};w.WebSocket.prototype=OW.prototype;w.WebSocket.CONNECTING=OW.CONNECTING;w.WebSocket.OPEN=OW.OPEN;w.WebSocket.CLOSING=OW.CLOSING;w.WebSocket.CLOSED=OW.CLOSED;var OE=w.EventSource;if(OE!==undefined){w.EventSource=function(url,cfg){var p=new URL(url.toString(),loc.href);if(so(p)&&sf(p.pathname)){var nx=new URL(p);nx.pathname=rp(p.pathname);var dvv=rdv();if(dvv!==null)nx.searchParams.set(R.deviceQuery,dvv);return new OE(nx,cfg)}return new OE(url,cfg)};w.EventSource.prototype=OE.prototype}var restores=[];function patchSrc(C){if(C===undefined)return;var d=Object.getOwnPropertyDescriptor(C.prototype,\"src\");if(d===undefined||d.configurable===false||d.set===undefined)return;var os=d.set;Object.defineProperty(C.prototype,\"src\",{configurable:true,enumerable:d.enumerable!==false,get:d.get,set:function(v){os.call(this,rr(String(v)))}});restores.push(function(){Object.defineProperty(C.prototype,\"src\",d)})}patchSrc(w.HTMLImageElement);patchSrc(w.HTMLScriptElement);patchSrc(w.HTMLIFrameElement);seat.restore=function(){w.fetch=of;w.WebSocket=OW;if(OE!==undefined)w.EventSource=OE;for(var i=0;i<restores.length;i++)restores[i]();try{delete w[" + seat + "]}catch(e){w[" + seat + "]=undefined}};w[" + seat + "]=seat" + buildBootWatchdogScript() + "}catch(e){}})();";
|
|
3634
3629
|
}
|
|
3635
3630
|
/** Boot-watchdog latch: one self-reload per session while the boot is broken. */
|
|
3636
3631
|
const BOOT_WATCHDOG_KEY = "dsh-remote-boot-reload";
|
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
* - the pairing routes (`/api/pair/*`) stay where they are — accept must
|
|
12
12
|
* work BEFORE a device is paired;
|
|
13
13
|
* - the update endpoints (`/api/update/*`) stay loopback-only;
|
|
14
|
-
* - desktop-launcher create/shutdown (`/api/dsh-desktop-launcher/*`) stay
|
|
15
|
-
* loopback-only (host-local files and process exit);
|
|
16
14
|
* - the family settings bridge (`/api/dsh-web-ui-settings/*`) stays
|
|
17
15
|
* loopback-only (same plane as SDK settings.*);
|
|
18
16
|
* - `/api/*` (SDK methods and `/api/<plugin>/...` plugin namespaces),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-channel.d.ts","sourceRoot":"","sources":["../../../src/client/remote-channel.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"remote-channel.d.ts","sourceRoot":"","sources":["../../../src/client/remote-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EACL,iBAAiB,EAEjB,aAAa,EACd,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,CAAA;AAC3C,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAA;AAIvE,qEAAqE;AACrE,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,aAAa,GAAG,MAAM,CAAA;IACpD,KAAK,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,oBAAoB,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAC9D;AAED,qFAAqF;AACrF,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,6BAA6B,EACvC,iBAAiB,EAAE,OAAO,GAAG,SAAS,GACrC,OAAO,CAQT;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAI5D;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAShE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,yEAAyE;AACzE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAcnF;AAED,wEAAwE;AACxE,UAAU,cAAc;IACtB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,qEAAqE;AACrE,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;IAC9B,SAAS,EAAE,OAAO,SAAS,CAAA;IAC3B,WAAW,CAAC,EAAE,OAAO,WAAW,CAAA;IAChC,gBAAgB,CAAC,EAAE,cAAc,CAAA;IACjC,iBAAiB,CAAC,EAAE,cAAc,CAAA;IAClC,iBAAiB,CAAC,EAAE,cAAc,CAAA;IAClC,QAAQ,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C,cAAc,CAAC,EAAE;QAAE,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;KAAE,CAAA;CACzD;AAED,gDAAgD;AAChD,MAAM,WAAW,oBAAoB;IACnC,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAoBD;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAO3E;AA0BD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,GAAE,oBAAyB,GAAG,MAAM,IAAI,CAmG1G;AAED;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAA;AAE7D;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAG,iBAAiB,CAIxF"}
|
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
* - the pairing routes (`/api/pair/*`) stay where they are — accept must
|
|
12
12
|
* work BEFORE a device is paired;
|
|
13
13
|
* - the update endpoints (`/api/update/*`) stay loopback-only;
|
|
14
|
-
* - desktop-launcher create/shutdown (`/api/dsh-desktop-launcher/*`) stay
|
|
15
|
-
* loopback-only (host-local files and process exit);
|
|
16
14
|
* - the family settings bridge (`/api/dsh-web-ui-settings/*`) stays
|
|
17
15
|
* loopback-only (same plane as SDK settings.*);
|
|
18
16
|
* - `/api/*` (SDK methods and `/api/<plugin>/...` plugin namespaces),
|
|
@@ -60,8 +58,6 @@ export function shouldRewriteFetchPath(pathname) {
|
|
|
60
58
|
return false;
|
|
61
59
|
if (pathname.startsWith(RULES.updatePrefix))
|
|
62
60
|
return false;
|
|
63
|
-
if (pathname === RULES.desktopLauncherPrefix || pathname.startsWith(`${RULES.desktopLauncherPrefix}/`))
|
|
64
|
-
return false;
|
|
65
61
|
if (pathname === RULES.settingsBridgePrefix || pathname.startsWith(`${RULES.settingsBridgePrefix}/`))
|
|
66
62
|
return false;
|
|
67
63
|
if (pathname.startsWith(RULES.apiPrefix))
|
|
@@ -25,7 +25,7 @@ import type { IncomingMessage } from 'node:http';
|
|
|
25
25
|
import type { WebRoute, WebUpgradeRoute } from '@deepseek-ai/dsh-host-webserver';
|
|
26
26
|
import type { PairingService } from './pairing.ts';
|
|
27
27
|
import type { InnerAuth } from './inner-auth.ts';
|
|
28
|
-
export {
|
|
28
|
+
export { LOCAL_ONLY_PREFIXES, PLUGIN_MANAGER_PATH, REMOTE_API_PATHS, REMOTE_DEVICE_HEADER, REMOTE_DEVICE_QUERY, REMOTE_PREFIX, REMOTE_UPGRADE_PATHS, WEB_UI_SETTINGS_BRIDGE_PATH, localOnlyDenial, } from './remote-methods.ts';
|
|
29
29
|
export { REMOTE_API_PREFIX } from './remote-methods.ts';
|
|
30
30
|
/** Route-family dependencies. */
|
|
31
31
|
export interface RemoteApiDeps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-api.d.ts","sourceRoot":"","sources":["../../src/remote-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,WAAW,CAAA;AAEhE,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAGlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAUhD,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"remote-api.d.ts","sourceRoot":"","sources":["../../src/remote-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,WAAW,CAAA;AAEhE,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAGlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAUhD,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,2BAA2B,EAC3B,eAAe,GAChB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAgBvD,iCAAiC;AACjC,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,OAAO,EAAE,cAAc,CAAA;IACvB,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,CAAA;IAChD;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAWD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUhE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,CAQlG;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,aAAa,GAAG,QAAQ,EAAE,CA0CnE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAWzF;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,aAAa,GAAG,eAAe,EAAE,CA2CjF"}
|
package/lib/types/remote-api.js
CHANGED
|
@@ -25,7 +25,7 @@ import { readCookie } from "./gate.js";
|
|
|
25
25
|
import { writeJson } from "./http.js";
|
|
26
26
|
import { proxyLoopbackHttp, proxyLoopbackUpgrade } from "./loopback-proxy.js";
|
|
27
27
|
import { REMOTE_DEVICE_HEADER, REMOTE_DEVICE_QUERY, REMOTE_PREFIX, REMOTE_UPGRADE_PATHS, localOnlyDenial, } from "./remote-methods.js";
|
|
28
|
-
export {
|
|
28
|
+
export { LOCAL_ONLY_PREFIXES, PLUGIN_MANAGER_PATH, REMOTE_API_PATHS, REMOTE_DEVICE_HEADER, REMOTE_DEVICE_QUERY, REMOTE_PREFIX, REMOTE_UPGRADE_PATHS, WEB_UI_SETTINGS_BRIDGE_PATH, localOnlyDenial, } from "./remote-methods.js";
|
|
29
29
|
export { REMOTE_API_PREFIX } from "./remote-methods.js";
|
|
30
30
|
const ALLOWED_METHODS = new Set(['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE']);
|
|
31
31
|
/** Reject traversal and empty segments; allow plugin file-path characters. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-channel-boot.d.ts","sourceRoot":"","sources":["../../src/remote-channel-boot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAoD,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAErH;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,GAAE,kBAAyC,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"remote-channel-boot.d.ts","sourceRoot":"","sources":["../../src/remote-channel-boot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAoD,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAErH;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,GAAE,kBAAyC,GAAG,MAAM,CA8HrG;AAED,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,2BAA2B,CAAA;AAQzD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,SAAwB,EAAE,MAAM,SAAwB,GAAG,MAAM,CAgB9G;AAED,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,EAAE,MAAuC,CAAA"}
|
|
@@ -57,7 +57,6 @@ export function buildRemoteChannelBootScript(rules = REMOTE_CHANNEL_RULES) {
|
|
|
57
57
|
'function sf(p){' +
|
|
58
58
|
'if(p.indexOf(R.pairPrefix)===0)return false;' +
|
|
59
59
|
'if(p.indexOf(R.updatePrefix)===0)return false;' +
|
|
60
|
-
'if(p===R.desktopLauncherPrefix||p.indexOf(R.desktopLauncherPrefix+"/")===0)return false;' +
|
|
61
60
|
'if(p===R.settingsBridgePrefix||p.indexOf(R.settingsBridgePrefix+"/")===0)return false;' +
|
|
62
61
|
'if(p.indexOf(R.apiPrefix)===0)return true;' +
|
|
63
62
|
'if(p.indexOf(R.sidebarPrefix)===0||p==="/sidebar")return true;' +
|
|
@@ -17,7 +17,6 @@ export interface RemoteChannelRules {
|
|
|
17
17
|
readonly apiPrefix: string;
|
|
18
18
|
readonly pairPrefix: string;
|
|
19
19
|
readonly updatePrefix: string;
|
|
20
|
-
readonly desktopLauncherPrefix: string;
|
|
21
20
|
readonly settingsBridgePrefix: string;
|
|
22
21
|
readonly sidebarPrefix: string;
|
|
23
22
|
readonly gitPrefix: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-channel-rules.d.ts","sourceRoot":"","sources":["../../src/remote-channel-rules.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,kEAAkE;AAClE,eAAO,MAAM,aAAa,YAAY,CAAA;AAEtC,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAE/E,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,CAAA;AAEpD,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB,gBAAyB,CAAA;AAEvD,6EAA6E;AAC7E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"remote-channel-rules.d.ts","sourceRoot":"","sources":["../../src/remote-channel-rules.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,kEAAkE;AAClE,eAAO,MAAM,aAAa,YAAY,CAAA;AAEtC,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAE/E,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,CAAA;AAEpD,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB,gBAAyB,CAAA;AAEvD,6EAA6E;AAC7E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAA;IACrC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,yEAAyE;IACzE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,2EAA2E;IAC3E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,yDAAyD;IACzD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED,yBAAyB;AACzB,eAAO,MAAM,oBAAoB,EAAE,kBAqBlC,CAAA;AAED,iEAAiE;AACjE,eAAO,MAAM,0BAA0B,gCAAgC,CAAA;AAEvE;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAA;IAC/B,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAA;IAC7B,eAAe,EAAE,OAAO,CAAA;IACxB,OAAO,IAAI,IAAI,CAAA;CAChB"}
|
|
@@ -17,7 +17,6 @@ export const REMOTE_CHANNEL_RULES = {
|
|
|
17
17
|
apiPrefix: '/api/',
|
|
18
18
|
pairPrefix: '/api/pair/',
|
|
19
19
|
updatePrefix: '/api/update/',
|
|
20
|
-
desktopLauncherPrefix: '/api/dsh-desktop-launcher',
|
|
21
20
|
settingsBridgePrefix: '/api/dsh-web-ui-settings',
|
|
22
21
|
sidebarPrefix: '/sidebar/',
|
|
23
22
|
gitPrefix: '/git/',
|
|
@@ -34,8 +34,6 @@ export declare const REMOTE_API_PATHS: {
|
|
|
34
34
|
export declare const REMOTE_UPGRADE_PATHS: readonly ["/remote/api/remote.mux", "/remote/sidebar/ws/terminal", "/remote/sidebar/ws/agent-terminals", "/remote/api/dsh-ssh/terminal"];
|
|
35
35
|
/** Plugin-manager HTTP prefix: install/remove stay physically local. */
|
|
36
36
|
export declare const PLUGIN_MANAGER_PATH = "/api/plugin-manager";
|
|
37
|
-
/** Desktop-launcher HTTP prefix: shortcut create and host shutdown stay physically local. */
|
|
38
|
-
export declare const DESKTOP_LAUNCHER_PATH = "/api/dsh-desktop-launcher";
|
|
39
37
|
/** Family settings-bridge HTTP prefix — re-exposed to paired devices (plain settings parity). */
|
|
40
38
|
export declare const WEB_UI_SETTINGS_BRIDGE_PATH = "/api/dsh-web-ui-settings";
|
|
41
39
|
/**
|
|
@@ -54,8 +52,7 @@ export declare const REMOTE_DEVICE_QUERY = "device";
|
|
|
54
52
|
* paired remote desktop may use the full host API (chat, sessions,
|
|
55
53
|
* settings, credentials, presets — it is a full-control credential), but it
|
|
56
54
|
* must not reach the machine-control planes: pairing control itself, the
|
|
57
|
-
* dsh-web self-update installer, plugin install/remove
|
|
58
|
-
* launcher actions (host shutdown, shortcuts).
|
|
55
|
+
* dsh-web self-update installer, and plugin install/remove.
|
|
59
56
|
*/
|
|
60
57
|
export declare const LOCAL_ONLY_PREFIXES: readonly string[];
|
|
61
58
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-methods.d.ts","sourceRoot":"","sources":["../../src/remote-methods.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,gFAAgF;AAChF,eAAO,MAAM,aAAa,YAAY,CAAA;AAEtC,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB,gBAAyB,CAAA;AAEvD;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB;;CAEnB,CAAA;AAEV;;;GAGG;AACH,eAAO,MAAM,oBAAoB,0IAKvB,CAAA;AAEV,wEAAwE;AACxE,eAAO,MAAM,mBAAmB,wBAAwB,CAAA;AAExD,
|
|
1
|
+
{"version":3,"file":"remote-methods.d.ts","sourceRoot":"","sources":["../../src/remote-methods.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,gFAAgF;AAChF,eAAO,MAAM,aAAa,YAAY,CAAA;AAEtC,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB,gBAAyB,CAAA;AAEvD;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB;;CAEnB,CAAA;AAEV;;;GAGG;AACH,eAAO,MAAM,oBAAoB,0IAKvB,CAAA;AAEV,wEAAwE;AACxE,eAAO,MAAM,mBAAmB,wBAAwB,CAAA;AAExD,iGAAiG;AACjG,eAAO,MAAM,2BAA2B,6BAA6B,CAAA;AAErE;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,wBAAwB,CAAA;AACzD,eAAO,MAAM,mBAAmB,WAAW,CAAA;AAE3C;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAIvC,CAAA;AAEV;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOrE"}
|
|
@@ -39,8 +39,6 @@ export const REMOTE_UPGRADE_PATHS = [
|
|
|
39
39
|
];
|
|
40
40
|
/** Plugin-manager HTTP prefix: install/remove stay physically local. */
|
|
41
41
|
export const PLUGIN_MANAGER_PATH = '/api/plugin-manager';
|
|
42
|
-
/** Desktop-launcher HTTP prefix: shortcut create and host shutdown stay physically local. */
|
|
43
|
-
export const DESKTOP_LAUNCHER_PATH = '/api/dsh-desktop-launcher';
|
|
44
42
|
/** Family settings-bridge HTTP prefix — re-exposed to paired devices (plain settings parity). */
|
|
45
43
|
export const WEB_UI_SETTINGS_BRIDGE_PATH = '/api/dsh-web-ui-settings';
|
|
46
44
|
/**
|
|
@@ -59,14 +57,12 @@ export const REMOTE_DEVICE_QUERY = 'device';
|
|
|
59
57
|
* paired remote desktop may use the full host API (chat, sessions,
|
|
60
58
|
* settings, credentials, presets — it is a full-control credential), but it
|
|
61
59
|
* must not reach the machine-control planes: pairing control itself, the
|
|
62
|
-
* dsh-web self-update installer, plugin install/remove
|
|
63
|
-
* launcher actions (host shutdown, shortcuts).
|
|
60
|
+
* dsh-web self-update installer, and plugin install/remove.
|
|
64
61
|
*/
|
|
65
62
|
export const LOCAL_ONLY_PREFIXES = [
|
|
66
63
|
'/api/pair',
|
|
67
64
|
'/api/update',
|
|
68
65
|
PLUGIN_MANAGER_PATH,
|
|
69
|
-
DESKTOP_LAUNCHER_PATH,
|
|
70
66
|
];
|
|
71
67
|
/**
|
|
72
68
|
* Whether a paired inner path must stay physically local.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linxin666/dsh-remote-web-ui",
|
|
3
3
|
"description": "Scan-to-pair remote access for the dsh web GUI that shares one official interface: a QR beside the settings button pairs phones and PCs into the same Web GUI (a portrait-touch adaptation layer for phones, full desktop on PCs) through one-time tokens and revocable device sessions, with a LAN bind toggle, optional Cloudflare tunnel, and one-click family self-update",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.14",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": "^22.19.0 || >=24.0.0"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"license": "Apache-2.0",
|
|
37
37
|
"dsh": {
|
|
38
38
|
"engines": {
|
|
39
|
-
"dsh": ">=0.1.2-
|
|
39
|
+
"dsh": ">=0.1.2-rc.1"
|
|
40
40
|
},
|
|
41
41
|
"bundle": {
|
|
42
42
|
"patch": "./cordis.patch.yml"
|
|
@@ -63,22 +63,22 @@
|
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
66
|
-
"@deepseek-ai/dsh-agent": "^0.1.2-
|
|
67
|
-
"@deepseek-ai/dsh-api-remotes": "^0.1.2-
|
|
68
|
-
"@deepseek-ai/dsh-api-session-controller": "^0.1.2-
|
|
69
|
-
"@deepseek-ai/dsh-api-workspace-controller": "^0.1.2-
|
|
70
|
-
"@deepseek-ai/dsh-client-connection": "^0.1.2-
|
|
71
|
-
"@deepseek-ai/dsh-client-locale": "^0.1.2-
|
|
72
|
-
"@deepseek-ai/dsh-client-store": "^0.1.2-
|
|
73
|
-
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.2-
|
|
74
|
-
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.2-
|
|
75
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.1.2-
|
|
76
|
-
"@deepseek-ai/dsh-client-ui-sidebar": "^0.1.2-
|
|
77
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.1.2-
|
|
78
|
-
"@deepseek-ai/dsh-commands": "^0.1.2-
|
|
79
|
-
"@deepseek-ai/dsh-host-webserver": "^0.1.2-
|
|
80
|
-
"@deepseek-ai/dsh-invariants": "^0.1.2-
|
|
81
|
-
"@deepseek-ai/dsh-settings": "^0.1.2-
|
|
66
|
+
"@deepseek-ai/dsh-agent": "^0.1.2-rc.1",
|
|
67
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.2-rc.1",
|
|
68
|
+
"@deepseek-ai/dsh-api-session-controller": "^0.1.2-rc.1",
|
|
69
|
+
"@deepseek-ai/dsh-api-workspace-controller": "^0.1.2-rc.1",
|
|
70
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.2-rc.1",
|
|
71
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.2-rc.1",
|
|
72
|
+
"@deepseek-ai/dsh-client-store": "^0.1.2-rc.1",
|
|
73
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.2-rc.1",
|
|
74
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.2-rc.1",
|
|
75
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.2-rc.1",
|
|
76
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "^0.1.2-rc.1",
|
|
77
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.2-rc.1",
|
|
78
|
+
"@deepseek-ai/dsh-commands": "^0.1.2-rc.1",
|
|
79
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.2-rc.1",
|
|
80
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-rc.1",
|
|
81
|
+
"@deepseek-ai/dsh-settings": "^0.1.2-rc.1",
|
|
82
82
|
"@testing-library/dom": "^10.4.1",
|
|
83
83
|
"@testing-library/react": "^16.3.2",
|
|
84
84
|
"@types/node": "^22.20.0",
|
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
* - the pairing routes (`/api/pair/*`) stay where they are — accept must
|
|
12
12
|
* work BEFORE a device is paired;
|
|
13
13
|
* - the update endpoints (`/api/update/*`) stay loopback-only;
|
|
14
|
-
* - desktop-launcher create/shutdown (`/api/dsh-desktop-launcher/*`) stay
|
|
15
|
-
* loopback-only (host-local files and process exit);
|
|
16
14
|
* - the family settings bridge (`/api/dsh-web-ui-settings/*`) stays
|
|
17
15
|
* loopback-only (same plane as SDK settings.*);
|
|
18
16
|
* - `/api/*` (SDK methods and `/api/<plugin>/...` plugin namespaces),
|
|
@@ -77,7 +75,6 @@ export function isLoopbackHostname(hostname: string): boolean {
|
|
|
77
75
|
export function shouldRewriteFetchPath(pathname: string): boolean {
|
|
78
76
|
if (pathname.startsWith(RULES.pairPrefix)) return false
|
|
79
77
|
if (pathname.startsWith(RULES.updatePrefix)) return false
|
|
80
|
-
if (pathname === RULES.desktopLauncherPrefix || pathname.startsWith(`${RULES.desktopLauncherPrefix}/`)) return false
|
|
81
78
|
if (pathname === RULES.settingsBridgePrefix || pathname.startsWith(`${RULES.settingsBridgePrefix}/`)) return false
|
|
82
79
|
if (pathname.startsWith(RULES.apiPrefix)) return true
|
|
83
80
|
if (pathname.startsWith(RULES.sidebarPrefix) || pathname === '/sidebar') return true
|
package/src/remote-api.ts
CHANGED
|
@@ -59,7 +59,6 @@ export function buildRemoteChannelBootScript(rules: RemoteChannelRules = REMOTE_
|
|
|
59
59
|
'function sf(p){' +
|
|
60
60
|
'if(p.indexOf(R.pairPrefix)===0)return false;' +
|
|
61
61
|
'if(p.indexOf(R.updatePrefix)===0)return false;' +
|
|
62
|
-
'if(p===R.desktopLauncherPrefix||p.indexOf(R.desktopLauncherPrefix+"/")===0)return false;' +
|
|
63
62
|
'if(p===R.settingsBridgePrefix||p.indexOf(R.settingsBridgePrefix+"/")===0)return false;' +
|
|
64
63
|
'if(p.indexOf(R.apiPrefix)===0)return true;' +
|
|
65
64
|
'if(p.indexOf(R.sidebarPrefix)===0||p==="/sidebar")return true;' +
|
|
@@ -22,7 +22,6 @@ export interface RemoteChannelRules {
|
|
|
22
22
|
readonly apiPrefix: string
|
|
23
23
|
readonly pairPrefix: string
|
|
24
24
|
readonly updatePrefix: string
|
|
25
|
-
readonly desktopLauncherPrefix: string
|
|
26
25
|
readonly settingsBridgePrefix: string
|
|
27
26
|
readonly sidebarPrefix: string
|
|
28
27
|
readonly gitPrefix: string
|
|
@@ -42,7 +41,6 @@ export const REMOTE_CHANNEL_RULES: RemoteChannelRules = {
|
|
|
42
41
|
apiPrefix: '/api/',
|
|
43
42
|
pairPrefix: '/api/pair/',
|
|
44
43
|
updatePrefix: '/api/update/',
|
|
45
|
-
desktopLauncherPrefix: '/api/dsh-desktop-launcher',
|
|
46
44
|
settingsBridgePrefix: '/api/dsh-web-ui-settings',
|
|
47
45
|
sidebarPrefix: '/sidebar/',
|
|
48
46
|
gitPrefix: '/git/',
|
package/src/remote-methods.ts
CHANGED
|
@@ -45,9 +45,6 @@ export const REMOTE_UPGRADE_PATHS = [
|
|
|
45
45
|
/** Plugin-manager HTTP prefix: install/remove stay physically local. */
|
|
46
46
|
export const PLUGIN_MANAGER_PATH = '/api/plugin-manager'
|
|
47
47
|
|
|
48
|
-
/** Desktop-launcher HTTP prefix: shortcut create and host shutdown stay physically local. */
|
|
49
|
-
export const DESKTOP_LAUNCHER_PATH = '/api/dsh-desktop-launcher'
|
|
50
|
-
|
|
51
48
|
/** Family settings-bridge HTTP prefix — re-exposed to paired devices (plain settings parity). */
|
|
52
49
|
export const WEB_UI_SETTINGS_BRIDGE_PATH = '/api/dsh-web-ui-settings'
|
|
53
50
|
|
|
@@ -68,14 +65,12 @@ export const REMOTE_DEVICE_QUERY = 'device'
|
|
|
68
65
|
* paired remote desktop may use the full host API (chat, sessions,
|
|
69
66
|
* settings, credentials, presets — it is a full-control credential), but it
|
|
70
67
|
* must not reach the machine-control planes: pairing control itself, the
|
|
71
|
-
* dsh-web self-update installer, plugin install/remove
|
|
72
|
-
* launcher actions (host shutdown, shortcuts).
|
|
68
|
+
* dsh-web self-update installer, and plugin install/remove.
|
|
73
69
|
*/
|
|
74
70
|
export const LOCAL_ONLY_PREFIXES: readonly string[] = [
|
|
75
71
|
'/api/pair',
|
|
76
72
|
'/api/update',
|
|
77
73
|
PLUGIN_MANAGER_PATH,
|
|
78
|
-
DESKTOP_LAUNCHER_PATH,
|
|
79
74
|
] as const
|
|
80
75
|
|
|
81
76
|
/**
|