dsh-remote 0.8.90 → 0.8.91
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/lib/client.js +26 -9
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -3879,7 +3879,9 @@ window.__ModuleLoader__.load({
|
|
|
3879
3879
|
* null. A Windows drive colon never trails a digit sequence after a path
|
|
3880
3880
|
* separator, and `path:0` is meaningless, so the strip is unambiguous. */
|
|
3881
3881
|
function splitLineAnchor(rawPath) {
|
|
3882
|
-
|
|
3882
|
+
// Trailing `:42` or range `:24-30` / `:24:7` (the latter two keep the
|
|
3883
|
+
// start line, mirroring the core's own resolver).
|
|
3884
|
+
const m = /:(\d+)(?::\d+|-\d+)?$/.exec(String(rawPath || ''))
|
|
3883
3885
|
if (!m) return { path: String(rawPath || ''), line: null }
|
|
3884
3886
|
const line = Number(m[1])
|
|
3885
3887
|
const path = String(rawPath).slice(0, m.index)
|
|
@@ -4209,10 +4211,11 @@ window.__ModuleLoader__.load({
|
|
|
4209
4211
|
// Dropping the leading empty segment keeps a session-root address ('') a
|
|
4210
4212
|
// legitimate empty path instead of turning it into '/'.
|
|
4211
4213
|
const decoded = decodeURIComponent(tail.slice(1).join('/'))
|
|
4212
|
-
// Issue #104: models cite lines as `path:42`
|
|
4213
|
-
//
|
|
4214
|
-
//
|
|
4215
|
-
|
|
4214
|
+
// Issue #104 + #108: models cite lines as `path:42` / `path#L42`, and as
|
|
4215
|
+
// RANGES (`path:24-30`, `#L24-L30`) — the core's own prompt teaches the
|
|
4216
|
+
// range form. Range or not, the anchor is stripped from the path (no file
|
|
4217
|
+
// is ever looked up as "x.c:42"); we take the start line, like the core.
|
|
4218
|
+
const hashLine = /^#L?(\d+)(?:-L?\d+)?$/i.exec(url.hash || '')
|
|
4216
4219
|
const split = splitLineAnchor(decoded)
|
|
4217
4220
|
const line = hashLine ? Number(hashLine[1]) : split.line
|
|
4218
4221
|
return { sessionId, path: split.path, ...(line ? { line } : {}) }
|
|
@@ -4321,13 +4324,21 @@ window.__ModuleLoader__.load({
|
|
|
4321
4324
|
return React.createElement('div', { style: { padding: 16, fontSize: 12, opacity: 0.7 } },
|
|
4322
4325
|
tr('file.linkUnresolved'))
|
|
4323
4326
|
}
|
|
4327
|
+
// Issue #104 + #108: the line reaches us two ways — inside the address
|
|
4328
|
+
// (`x.c:42` / `#L42`, ranges take the start line) and, on 0.2.x, through
|
|
4329
|
+
// navigation params (`openResource(url, {params:{line}})`); the address
|
|
4330
|
+
// grammar itself never carries one.
|
|
4331
|
+
const paramsLine = (() => {
|
|
4332
|
+
try {
|
|
4333
|
+
const n = Number(info.tab && info.tab.navigation && info.tab.navigation.params && info.tab.navigation.params.line)
|
|
4334
|
+
return Number.isInteger(n) && n >= 1 ? n : null
|
|
4335
|
+
} catch { return null }
|
|
4336
|
+
})()
|
|
4324
4337
|
return React.createElement(RemoteFileTab, {
|
|
4325
4338
|
key: remotePath,
|
|
4326
4339
|
tab: { path: remotePath },
|
|
4327
4340
|
scope: { sessionId },
|
|
4328
|
-
|
|
4329
|
-
// the open file on that line instead of its top.
|
|
4330
|
-
jumpLine: (parsed && parsed.line) || null,
|
|
4341
|
+
jumpLine: (parsed && parsed.line) || paramsLine,
|
|
4331
4342
|
})
|
|
4332
4343
|
}
|
|
4333
4344
|
/** The local cwd of a session, from the client's own session store. */
|
|
@@ -4436,7 +4447,13 @@ window.__ModuleLoader__.load({
|
|
|
4436
4447
|
try {
|
|
4437
4448
|
const dispose = tabs.register({
|
|
4438
4449
|
id: NATIVE_LINK, kind: NATIVE_LINK,
|
|
4439
|
-
|
|
4450
|
+
// Specificity beats bundle order: the registry ranks longest-glob-first,
|
|
4451
|
+
// and ties fall to registration order (which we do not control). Another
|
|
4452
|
+
// extension claiming `dsh-resource://file/**` used to win those ties and
|
|
4453
|
+
// read the local mirror (ENOENT) even for provably remote sessions
|
|
4454
|
+
// (issue #108). The narrower glob matches exactly what
|
|
4455
|
+
// parseCoreFileAddress accepts — the session scope.
|
|
4456
|
+
patterns: ['dsh-resource://file/session/**'],
|
|
4440
4457
|
canOpen: (address) => {
|
|
4441
4458
|
const parsed = parseCoreFileAddress(address)
|
|
4442
4459
|
if (!parsed) return false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-remote",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.91",
|
|
4
4
|
"description": "Remote-work assistant for DeepSeek Harness: connect SSH (password/key/agent/keyboard-interactive, multi-hop ProxyJump), list hosts from ~/.ssh/config, pick a remote workspace, operate on it with 21 rw_* tools, conflict-aware mirror sync, an embedded PTY terminal, remote DSH web UI attach, port forwarding, host grouping, remote sandbox fencing, audit log, keychain passwords.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "flymysql <flyphp@outlook.com>",
|