dsh-zen-remote 2.3.1 → 2.3.3
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.md +178 -282
- package/README.zh-CN.md +179 -283
- package/docs/interface.md +1 -1
- package/lib/adapters/dsh-better-sidebar/index.js +9 -2
- package/lib/adapters/dsh-better-sidebar/index.js.map +1 -1
- package/lib/client.js +6 -2
- package/lib/lan-gate-server.cjs +29 -0
- package/lib/types/adapters/dsh-better-sidebar/index.d.ts +1 -1
- package/lib/types/adapters/dsh-better-sidebar/index.d.ts.map +1 -1
- package/lib/types/client/wizard/GatewayWizard.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/adapters/dsh-better-sidebar/index.ts +9 -2
- package/src/client/wizard/GatewayWizard.tsx +6 -2
package/docs/interface.md
CHANGED
|
@@ -385,7 +385,7 @@ PWA,再进来就是冷启动。插件自己的边缘手势也触发不了—
|
|
|
385
385
|
## 兼容插件
|
|
386
386
|
|
|
387
387
|
- [dsh-better-sidebar](https://github.com/omdsh-dev/DSH-better-sidebar)(0.19+:它的全部 tab 都在 DSH 0.1.5 官方右侧栏里,手机上宿主自己切全屏,本插件在会话页头部给它留入口位、左缘回退手势收它、文件树里点 @ 引用后自动收起——面板全屏盖住会话页,草稿变化看不见,收起本身就是点击反馈;≤ 0.18 自绘右栏的老版本:全宽抽屉 + 安全区 + 底部关闭 pill,只在 DSH < 0.1.5 上还会走到)——本机实测 **0.19.1**(老版规则实测 0.15.0)
|
|
388
|
-
- dsh-better-sidebar 的**远程会话处理**(PB-12 起分两档):**0.25.0、0.26.0、0.26.1、0.28.0-alpha.0、0.28.0 与 0.28.
|
|
388
|
+
- dsh-better-sidebar 的**远程会话处理**(PB-12 起分两档):**0.25.0、0.26.0、0.26.1、0.28.0-alpha.0、0.28.0、0.28.1 与 0.28.2** 七版由 zen-remote 的内置适配器(`src/adapters/dsh-better-sidebar/`)**代理**——它的文件浏览、编辑器、git 变动、任务等界面在远程会话里读写的是主服务端的数据(整机数据,需主服务端主人在设置页同意;`open.external` 远程拒绝、`settings.*` 与 `/sidebar/bundle` 留本机、侧聊转发(子会话继承父会话共享);0.26 新方法已一并接入(`fs.readPage` 分页读、`sidechat.dequeue` 撤回排队消息、`sidechat.model`/`sidechat.models` 线程切模型、`/sidebar/write` 编辑器保存;0.28.1 再添 `git.history` 分页提交历史读;0.28.2 接口面不变,只把 detached 会话的 cwd 改为读存储 header(不再整份解码会话日志);`ws/sidechat` 推送不桥接,远程侧聊走 0.26 自带的 15s 兜底轮询,正确性无损))。**其他版本维持隐藏**:那些版本的界面都带 `{sessionId, cwd}` 语境调它自己的 `/sidebar/api/*` 接口,远程会话里这些请求落到子客户端本机——文件树会显示本机同名文件、编辑会真的写本机文件;远程会话(`html[data-zr-remote-session="1"]`)里按插件自己的挂载/渲染标记隐藏这些界面,选择器在 `src/client/styles/remote-session.css.ts`,未安装时一条都不命中。因为它接管了宿主的「文件」标签,未桥接的远程会话里暂时没有侧栏文件浏览;聊天或交付物里的文件链接(`dsh-resource://file/**`)会被它的编辑器注册抢先接住,展开一个空的右栏(根治要等 zen-remote 自己的远程文件树)。隐藏档的定位仍是**隐藏而非代理**:插件组件保持挂载并继续静默发只读请求,但所有写控件都在被隐藏的界面里,不会误写本机。PB-14 起显示规则按桥接状态生效:已桥接(0.25.0/0.26.0 且主服务端同意)时远程会话里**照常显示**(面板数据经适配器来自主服务端,隐藏规则全部让位);未桥接时维持隐藏,已打开的 tab 空态改为一行说明占位(better-sidebar 未在远程会话桥接——中英双语,随浏览器语言),空白工作台浮动按钮一并隐藏
|
|
389
389
|
- [@nanmicoder/dsh-agent-teams](https://github.com/NanmiCoder/dsh-agent-teams)(AgentTeams 活动浮层:手机端挪到会话头部下方、避开安全区,会话列表页隐藏;子代理会话头部保留可点的父会话面包屑用于切回)——本机实测 **0.1.9**
|
|
390
390
|
- [@ychris12138/dsh-usage-stats](https://github.com/Ychris12138/dsh-usage-stats)(用量与余额,主屏 chips 行可直接打开;旧包名 `dsh-usage-stats` 已废弃,两个名字同时留在 profile 里会因重复的 `usage-stats` 行让 DSH 起不来)——本机实测 **0.2.9**
|
|
391
391
|
- [@opendsh/dsh-plugin-scheduled-tasks](https://github.com/Ceelog/dsh-plugins)(定时任务,主屏 chips 行自动收割入口)——本机实测 **0.2.3**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The dsh-better-sidebar adapter (PB-12), written against EXACTLY
|
|
3
|
-
* versions 0.25.0, 0.26.0, 0.26.1, 0.28.0-alpha.0, 0.28.0 and 0.28.
|
|
3
|
+
* versions 0.25.0, 0.26.0, 0.26.1, 0.28.0-alpha.0, 0.28.0, 0.28.1 and 0.28.2 (PB-15 widened the list; 0.26.1 is a
|
|
4
4
|
* perf-only patch with the same wire surface as 0.26.0; 0.26.0 is a JSON-api
|
|
5
5
|
* superset of 0.25.0 — it grows fs.readPage and the sidechat dequeue/model/
|
|
6
6
|
* models methods, and moves fs.write's content onto the new raw-text
|
|
@@ -60,7 +60,14 @@ export const dshBetterSidebarAdapter = {
|
|
|
60
60
|
// (paged git-log companion to git.graph — session-scoped read via
|
|
61
61
|
// gitCwdOf, base64url cursor in / commits out, no session ids in the
|
|
62
62
|
// answer; verified against the npm build's lib/index.js:8986).
|
|
63
|
-
|
|
63
|
+
// 0.28.2 (cold-cwd OOM fix): same routes, WebSockets and JSON-api method
|
|
64
|
+
// set as 0.28.1 (verified against the npm build's lib/index.js). Only the
|
|
65
|
+
// backend's cwd resolution changed: a DETACHED session now roots at its
|
|
66
|
+
// stored header cwd (`sessionPersistence.stat`, header-only) instead of a
|
|
67
|
+
// full-log `sessionQuery.observeSession`, then the host defaultDirectory,
|
|
68
|
+
// and only then a client `cwd` hint — so the server hook's cwd stripping
|
|
69
|
+
// below stays correct (if anything, the client hint matters less).
|
|
70
|
+
versions: ['0.25.0', '0.26.0', '0.26.1', '0.28.0-alpha.0', '0.28.0', '0.28.1', '0.28.2'],
|
|
64
71
|
routes: [
|
|
65
72
|
{
|
|
66
73
|
// The JSON API: the method name rides the path tail, the session
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/dsh-better-sidebar/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAEnE;;;;wBAIwB;AACxB,MAAM,sBAAsB,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAA;AAEhD;;kCAEkC;AAClC,MAAM,sBAAsB,GAAG,IAAI,GAAG,IAAI,CAAA;AAE1C,mEAAmE;AACnE,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAA;AAErF,MAAM,CAAC,MAAM,uBAAuB,GAAkB;IACpD,MAAM,EAAE,oBAAoB;IAC5B,uEAAuE;IACvE,sEAAsE;IACtE,sEAAsE;IACtE,uEAAuE;IACvE,0EAA0E;IAC1E,yEAAyE;IACzE,yEAAyE;IACzE,yEAAyE;IACzE,qEAAqE;IACrE,mEAAmE;IACnE,yEAAyE;IACzE,uEAAuE;IACvE,uEAAuE;IACvE,kEAAkE;IAClE,qEAAqE;IACrE,+DAA+D;IAC/D,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapters/dsh-better-sidebar/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,mBAAm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EAAE,KAAK,EAAE,QAAQ,EAAE,CAAA;gBACzC,CAAC;gBACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;YACxB,CAAC;YACD,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,cAAc,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACvH,MAAM,MAAM,GAAG,GAAG,CAAC,IAA+B,CAAA;gBAClD,wEAAwE;gBACxE,oEAAoE;gBACpE,qEAAqE;gBACrE,iEAAiE;gBACjE,kEAAkE;gBAClE,mEAAmE;gBACnE,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,aAAa,IAAI,MAAM,IAAI,MAAM,CAAA;gBACjF,IAAI,KAAK,IAAI,MAAM,IAAI,SAAS,EAAE,CAAC;oBACjC,MAAM,QAAQ,GAAG,EAAE,GAAG,MAAM,EAAE,CAAA;oBAC9B,OAAO,QAAQ,CAAC,GAAG,CAAA;oBACnB,IAAI,SAAS;wBAAE,OAAO,QAAQ,CAAC,IAAI,CAAA;oBACnC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAA;gBACxC,CAAC;YACH,CAAC;YACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;QACxB,CAAC;KACF;CACF,CAAA"}
|
package/lib/client.js
CHANGED
|
@@ -18886,8 +18886,8 @@ function GatewayWizard(props) {
|
|
|
18886
18886
|
};
|
|
18887
18887
|
if (path === 'lan') {
|
|
18888
18888
|
// LAN / Tailscale direct connections arrive on the machine's LAN or
|
|
18889
|
-
// Tailscale interface, so the gateway child
|
|
18890
|
-
//
|
|
18889
|
+
// Tailscale interface, so the gateway child binds to `0.0.0.0` (with
|
|
18890
|
+
// lan-gate's private-IP wall blocking any unproxied public IP).
|
|
18891
18891
|
await props.saveRowFields({
|
|
18892
18892
|
...baseFields,
|
|
18893
18893
|
host: '0.0.0.0',
|
|
@@ -18903,8 +18903,12 @@ function GatewayWizard(props) {
|
|
|
18903
18903
|
});
|
|
18904
18904
|
}
|
|
18905
18905
|
else {
|
|
18906
|
+
// Managed Caddy and Cloudflare Tunnel both run on the same host and
|
|
18907
|
+
// connect to the gateway over loopback, so reset `host` back to
|
|
18908
|
+
// `127.0.0.1` in case the user previously enabled LAN mode.
|
|
18906
18909
|
await props.saveRowFields({
|
|
18907
18910
|
...baseFields,
|
|
18911
|
+
host: '127.0.0.1',
|
|
18908
18912
|
ingressMode: path,
|
|
18909
18913
|
ingressDomain: domain.trim(),
|
|
18910
18914
|
ingressHttpsPort: readiness.httpsPort,
|
package/lib/lan-gate-server.cjs
CHANGED
|
@@ -239,6 +239,22 @@ var lastWebClaim = null // { id, secure, at } | null
|
|
|
239
239
|
// ---- client identity --------------------------------------------------------
|
|
240
240
|
function normalizeIp(raw) { return String(raw || '').replace(/^::ffff:/, '') }
|
|
241
241
|
function isLoopbackIp(ip) { return ip === '127.0.0.1' || ip === '::1' }
|
|
242
|
+
function isPrivateOrLoopbackIp(ip) {
|
|
243
|
+
if (isLoopbackIp(ip)) return true
|
|
244
|
+
var m4 = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(ip)
|
|
245
|
+
if (m4) {
|
|
246
|
+
var a = Number(m4[1]), b = Number(m4[2]), c = Number(m4[3]), d = Number(m4[4])
|
|
247
|
+
if (a > 255 || b > 255 || c > 255 || d > 255) return false
|
|
248
|
+
if (a === 10 || a === 127) return true
|
|
249
|
+
if (a === 172 && b >= 16 && b <= 31) return true
|
|
250
|
+
if (a === 192 && b === 168) return true
|
|
251
|
+
if (a === 169 && b === 254) return true
|
|
252
|
+
if (a === 100 && b >= 64 && b <= 127) return true // CGNAT / Tailscale
|
|
253
|
+
return false
|
|
254
|
+
}
|
|
255
|
+
var lower = String(ip || '').toLowerCase()
|
|
256
|
+
return /^f[cd][0-9a-f]{2}:/.test(lower) || /^fe[89ab][0-9a-f]:/.test(lower)
|
|
257
|
+
}
|
|
242
258
|
function hasForwardHeaders(req) { return req.headers['x-forwarded-for'] !== undefined || req.headers['x-forwarded-proto'] !== undefined || req.headers['x-forwarded-host'] !== undefined }
|
|
243
259
|
|
|
244
260
|
// Resolve who is really talking to us. Forwarded headers are only trusted
|
|
@@ -1186,6 +1202,15 @@ function localOnlyBlocked(req, res) {
|
|
|
1186
1202
|
|
|
1187
1203
|
var server = http.createServer(function (req, res) {
|
|
1188
1204
|
var client = resolveClient(req)
|
|
1205
|
+
// Direct (non-proxied) connections from a public IP are refused outright:
|
|
1206
|
+
// plain HTTP on 0.0.0.0:3088 is for loopback, LAN (RFC1918), and Tailscale
|
|
1207
|
+
// (100.64.0.0/10) only — public internet traffic must enter through a
|
|
1208
|
+
// TLS-terminating reverse proxy or tunnel (which connects from loopback or
|
|
1209
|
+
// a configured trustedProxy).
|
|
1210
|
+
if (!client.viaProxy && !isPrivateOrLoopbackIp(client.ip)) {
|
|
1211
|
+
json(req, res, 403, { ok: false, reason: 'public-direct-forbidden' })
|
|
1212
|
+
return
|
|
1213
|
+
}
|
|
1189
1214
|
var pathname = String(req.url || '/').split('?')[0]
|
|
1190
1215
|
var local = isLocalDirect(req, client)
|
|
1191
1216
|
var device = local ? undefined : deviceForReq(req)
|
|
@@ -1277,6 +1302,10 @@ var server = http.createServer(function (req, res) {
|
|
|
1277
1302
|
|
|
1278
1303
|
server.on('upgrade', function (req, socket, head) {
|
|
1279
1304
|
var client = resolveClient(req)
|
|
1305
|
+
if (!client.viaProxy && !isPrivateOrLoopbackIp(client.ip)) {
|
|
1306
|
+
try { socket.end('HTTP/1.1 403 Forbidden\r\nConnection: close\r\n\r\n') } catch (e) {}
|
|
1307
|
+
return
|
|
1308
|
+
}
|
|
1280
1309
|
var local = isLocalDirect(req, client)
|
|
1281
1310
|
var device = local ? undefined : deviceForReq(req)
|
|
1282
1311
|
if (!local && !device && overRate(client.ip)) { try { socket.end('HTTP/1.1 429 Too Many Requests\r\nConnection: close\r\n\r\n') } catch (e) {} return }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The dsh-better-sidebar adapter (PB-12), written against EXACTLY
|
|
3
|
-
* versions 0.25.0, 0.26.0, 0.26.1, 0.28.0-alpha.0, 0.28.0 and 0.28.
|
|
3
|
+
* versions 0.25.0, 0.26.0, 0.26.1, 0.28.0-alpha.0, 0.28.0, 0.28.1 and 0.28.2 (PB-15 widened the list; 0.26.1 is a
|
|
4
4
|
* perf-only patch with the same wire surface as 0.26.0; 0.26.0 is a JSON-api
|
|
5
5
|
* superset of 0.25.0 — it grows fs.readPage and the sidechat dequeue/model/
|
|
6
6
|
* models methods, and moves fs.write's content onto the new raw-text
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/dsh-better-sidebar/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAmBhD,eAAO,MAAM,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapters/dsh-better-sidebar/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAmBhD,eAAO,MAAM,uBAAuB,EAAE,aA4IrC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GatewayWizard.d.ts","sourceRoot":"","sources":["../../../../src/client/wizard/GatewayWizard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,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K,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3G;AAoGD,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAm/DlE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-zen-remote",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "一个插件、两种角色:主服务端把 DeepSeek Harness 变成手机能安全访问的 PWA(移动端界面、配对码网关、Web Push),并把选定会话共享给已配对的桌面端;子客户端在另一台 DSH 桌面端的侧边栏里远程使用这些会话。One DSH plugin, two roles: the host turns DeepSeek Harness into a phone-reachable PWA (mobile UI, pairing-code gateway behind your own reverse proxy, Web Push) and shares chosen sessions to paired desktops; the client uses those sessions remotely from another DSH desktop app's sidebar.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -82,18 +82,18 @@
|
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"@deepseek-ai/cordis": "*",
|
|
85
|
-
"@deepseek-ai/dsh-client-locale": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1",
|
|
86
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1",
|
|
87
|
-
"@deepseek-ai/dsh-client-ui-layout": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1",
|
|
88
|
-
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1",
|
|
89
|
-
"@deepseek-ai/dsh-client-ui-sidebar": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1",
|
|
90
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1",
|
|
91
|
-
"@deepseek-ai/dsh-host-webserver": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1",
|
|
92
|
-
"@deepseek-ai/dsh-session": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1",
|
|
93
|
-
"@deepseek-ai/dsh-session-log-export": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1",
|
|
94
|
-
"@deepseek-ai/dsh-session-query": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1",
|
|
95
|
-
"@deepseek-ai/dsh-tools": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1",
|
|
96
|
-
"@deepseek-ai/dsh-workspace": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1",
|
|
85
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1 || ^0.2.2-alpha.1",
|
|
86
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1 || ^0.2.2-alpha.1",
|
|
87
|
+
"@deepseek-ai/dsh-client-ui-layout": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1 || ^0.2.2-alpha.1",
|
|
88
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1 || ^0.2.2-alpha.1",
|
|
89
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1 || ^0.2.2-alpha.1",
|
|
90
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1 || ^0.2.2-alpha.1",
|
|
91
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1 || ^0.2.2-alpha.1",
|
|
92
|
+
"@deepseek-ai/dsh-session": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1 || ^0.2.2-alpha.1",
|
|
93
|
+
"@deepseek-ai/dsh-session-log-export": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1 || ^0.2.2-alpha.1",
|
|
94
|
+
"@deepseek-ai/dsh-session-query": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1 || ^0.2.2-alpha.1",
|
|
95
|
+
"@deepseek-ai/dsh-tools": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1 || ^0.2.2-alpha.1",
|
|
96
|
+
"@deepseek-ai/dsh-workspace": "^0.1.7-rc.2 || ^0.2.0-rc.1 || ^0.2.1-alpha.1 || ^0.2.2-alpha.1",
|
|
97
97
|
"@deepseek-ai/schemastery": "*",
|
|
98
98
|
"react": "^18.2.0"
|
|
99
99
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The dsh-better-sidebar adapter (PB-12), written against EXACTLY
|
|
3
|
-
* versions 0.25.0, 0.26.0, 0.26.1, 0.28.0-alpha.0, 0.28.0 and 0.28.
|
|
3
|
+
* versions 0.25.0, 0.26.0, 0.26.1, 0.28.0-alpha.0, 0.28.0, 0.28.1 and 0.28.2 (PB-15 widened the list; 0.26.1 is a
|
|
4
4
|
* perf-only patch with the same wire surface as 0.26.0; 0.26.0 is a JSON-api
|
|
5
5
|
* superset of 0.25.0 — it grows fs.readPage and the sidechat dequeue/model/
|
|
6
6
|
* models methods, and moves fs.write's content onto the new raw-text
|
|
@@ -66,7 +66,14 @@ export const dshBetterSidebarAdapter: BridgeAdapter = {
|
|
|
66
66
|
// (paged git-log companion to git.graph — session-scoped read via
|
|
67
67
|
// gitCwdOf, base64url cursor in / commits out, no session ids in the
|
|
68
68
|
// answer; verified against the npm build's lib/index.js:8986).
|
|
69
|
-
|
|
69
|
+
// 0.28.2 (cold-cwd OOM fix): same routes, WebSockets and JSON-api method
|
|
70
|
+
// set as 0.28.1 (verified against the npm build's lib/index.js). Only the
|
|
71
|
+
// backend's cwd resolution changed: a DETACHED session now roots at its
|
|
72
|
+
// stored header cwd (`sessionPersistence.stat`, header-only) instead of a
|
|
73
|
+
// full-log `sessionQuery.observeSession`, then the host defaultDirectory,
|
|
74
|
+
// and only then a client `cwd` hint — so the server hook's cwd stripping
|
|
75
|
+
// below stays correct (if anything, the client hint matters less).
|
|
76
|
+
versions: ['0.25.0', '0.26.0', '0.26.1', '0.28.0-alpha.0', '0.28.0', '0.28.1', '0.28.2'],
|
|
70
77
|
routes: [
|
|
71
78
|
{
|
|
72
79
|
// The JSON API: the method name rides the path tail, the session
|
|
@@ -600,8 +600,8 @@ export function GatewayWizard(props: GatewayWizardProps): ReactNode {
|
|
|
600
600
|
}
|
|
601
601
|
if (path === 'lan') {
|
|
602
602
|
// LAN / Tailscale direct connections arrive on the machine's LAN or
|
|
603
|
-
// Tailscale interface, so the gateway child
|
|
604
|
-
//
|
|
603
|
+
// Tailscale interface, so the gateway child binds to `0.0.0.0` (with
|
|
604
|
+
// lan-gate's private-IP wall blocking any unproxied public IP).
|
|
605
605
|
await props.saveRowFields(
|
|
606
606
|
{
|
|
607
607
|
...baseFields,
|
|
@@ -618,8 +618,12 @@ export function GatewayWizard(props: GatewayWizardProps): ReactNode {
|
|
|
618
618
|
ingressPublicUrl: readiness.publicUrl,
|
|
619
619
|
})
|
|
620
620
|
} else {
|
|
621
|
+
// Managed Caddy and Cloudflare Tunnel both run on the same host and
|
|
622
|
+
// connect to the gateway over loopback, so reset `host` back to
|
|
623
|
+
// `127.0.0.1` in case the user previously enabled LAN mode.
|
|
621
624
|
await props.saveRowFields({
|
|
622
625
|
...baseFields,
|
|
626
|
+
host: '127.0.0.1',
|
|
623
627
|
ingressMode: path,
|
|
624
628
|
ingressDomain: domain.trim(),
|
|
625
629
|
ingressHttpsPort: readiness.httpsPort,
|