@lemoncat7/dsh-ssh 1.16.19 → 1.16.22

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.
@@ -1,4 +1,41 @@
1
- /** Removes exact, uniquely tagged bootstrap echoes, never their execution output.
1
+ /** A comparison-only view. Raw bytes are retained until an exact bootstrap match. */
2
+ function echoView(raw) {
3
+ let text = '', incomplete = raw.length;
4
+ const offsets = [];
5
+ for (let i = 0; i < raw.length;) {
6
+ // Readline can force a right-margin wrap by writing an extra blank then CR.
7
+ // CRLF is an ordinary newline and must not consume a real preceding space.
8
+ if (raw[i] === ' ' && raw[i + 1] === '\r') {
9
+ if (i + 2 === raw.length) {
10
+ incomplete = i;
11
+ break;
12
+ }
13
+ if (raw[i + 2] !== '\n') {
14
+ i += 2;
15
+ continue;
16
+ }
17
+ }
18
+ if (raw[i] === '\x1b') {
19
+ const tail = raw.slice(i);
20
+ const csi = /^\x1b\[[0-?]*[ -/]*[@-~]/.exec(tail);
21
+ if (csi) {
22
+ i += csi[0].length;
23
+ continue;
24
+ }
25
+ if (tail === '\x1b' || /^\x1b\[[0-?]*[ -/]*$/.test(tail)) {
26
+ incomplete = i;
27
+ break;
28
+ }
29
+ }
30
+ if (raw[i] !== '\r' && raw[i] !== '\n') {
31
+ text += raw[i];
32
+ offsets.push(i);
33
+ }
34
+ i++;
35
+ }
36
+ return { text, offsets, incomplete };
37
+ }
38
+ /** Removes only exact, uniquely tagged bootstrap echoes, never execution output.
2
39
  * A mismatch/timeout is fail-open: original bytes are displayed unchanged.
3
40
  */
4
41
  export class TerminalBootstrapEcho {
@@ -20,35 +57,36 @@ export class TerminalBootstrapEcho {
20
57
  this.pending += text;
21
58
  let output = '';
22
59
  while (!this.done) {
23
- const start = this.pending.indexOf(this.start);
24
- const completed = this.pending.indexOf(this.completed);
60
+ const view = echoView(this.pending);
61
+ const start = view.text.indexOf(this.start);
62
+ const completed = view.text.indexOf(this.completed);
25
63
  if (completed >= 0 && (start < 0 || completed < start)) {
26
- output += this.pending.slice(0, completed) + this.pending.slice(completed + this.completed.length);
64
+ const begin = view.offsets[completed], end = view.offsets[completed + this.completed.length - 1] + 1;
65
+ output += this.pending.slice(0, begin) + this.pending.slice(end);
27
66
  this.pending = '';
28
67
  this.done = true;
29
68
  return output;
30
69
  }
31
70
  if (start < 0) {
32
- // Retain only a possible marker prefix split between transport chunks.
33
- let keep = Math.min(Math.max(this.start.length, this.completed.length) - 1, this.pending.length);
34
- while (keep > 0 && !this.start.startsWith(this.pending.slice(-keep)) && !this.completed.startsWith(this.pending.slice(-keep)))
71
+ let keep = Math.min(Math.max(this.start.length, this.completed.length) - 1, view.text.length);
72
+ while (keep > 0 && !this.start.startsWith(view.text.slice(-keep)) && !this.completed.startsWith(view.text.slice(-keep)))
35
73
  keep--;
36
- output += this.pending.slice(0, this.pending.length - keep);
37
- this.pending = this.pending.slice(this.pending.length - keep);
74
+ const cutoff = keep ? view.offsets[view.text.length - keep] : view.incomplete;
75
+ output += this.pending.slice(0, cutoff);
76
+ this.pending = this.pending.slice(cutoff);
38
77
  return output;
39
78
  }
40
- output += this.pending.slice(0, start);
41
- this.pending = this.pending.slice(start);
42
- const end = this.pending.indexOf(this.end, this.start.length);
43
- if (end < 0)
79
+ const begin = view.offsets[start];
80
+ const end = view.text.indexOf(this.end, start + this.start.length);
81
+ if (end < 0) {
82
+ output += this.pending.slice(0, begin);
83
+ this.pending = this.pending.slice(begin);
44
84
  return output + (this.pending.length > 65_536 ? this.flush() : '');
45
- const length = end + this.end.length;
46
- const candidate = this.pending.slice(0, length);
47
- // PTYs may wrap with CR/LF and readline may insert CSI styling sequences.
48
- const normalized = candidate.replace(/\x1b\[[0-?]*[ -/]*[@-~]/g, '').replace(/[\r\n]/g, '');
49
- if (normalized !== this.command)
85
+ }
86
+ if (view.text.slice(start, end + this.end.length) !== this.command)
50
87
  return output + this.flush();
51
- this.pending = this.pending.slice(length);
88
+ output += this.pending.slice(0, begin);
89
+ this.pending = this.pending.slice(view.offsets[end + this.end.length - 1] + 1);
52
90
  }
53
91
  return output;
54
92
  }
@@ -1 +1 @@
1
- {"version":3,"file":"terminal-bootstrap-echo.js","sourceRoot":"","sources":["../src/terminal-bootstrap-echo.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAGH;IAAkC;IAAgC;IAA8B;IAFrH,OAAO,GAAG,EAAE,CAAA;IACZ,IAAI,GAAG,KAAK,CAAA;IACpB,YAA6B,OAAe,EAAmB,KAAa,EAAmB,GAAW,EAAmB,SAAiB;QAAjH,YAAO,GAAP,OAAO,CAAQ;QAAmB,UAAK,GAAL,KAAK,CAAQ;QAAmB,QAAG,GAAH,GAAG,CAAQ;QAAmB,cAAS,GAAT,SAAS,CAAQ;IAAG,CAAC;IAElJ,IAAI,CAAC,IAAY;QACf,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAA;QAC1B,IAAI,CAAC,OAAO,IAAI,IAAI,CAAA;QACpB,IAAI,MAAM,GAAG,EAAE,CAAA;QACf,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAClB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAC9C,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;YACtD,IAAI,SAAS,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,SAAS,GAAG,KAAK,CAAC,EAAE,CAAC;gBACvD,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;gBAClG,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;gBAAC,IAAI,CAAC,IAAI,GA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AO,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;gBAChF,OAAO,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;YACpE,CAAC;YACD,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,OAAO;gBAAE,OAAO,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,CAAA;YAChG,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;YACtC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAE,GAAG,CAAC,CAAC,CAAA;QACjF,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;IAED,KAAK;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAA;QACzB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QACnC,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ import { type VaultEntryView } from './client-api.js';
2
+ /** Called only from an explicit reveal/copy action, never from list rendering. */
3
+ export declare function VaultPasswordDialog({ entry, onClose }: {
4
+ entry: VaultEntryView;
5
+ onClose(): void;
6
+ }): JSX.Element;
7
+ //# sourceMappingURL=vault-password-dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault-password-dialog.d.ts","sourceRoot":"","sources":["../src/vault-password-dialog.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAK1D,kFAAkF;AAClF,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;IAAE,KAAK,EAAE,cAAc,CAAC;IAAC,OAAO,IAAI,IAAI,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CA4C/G"}
@@ -0,0 +1,80 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef, useState } from 'react';
3
+ import { api } from './client-api.js';
4
+ import { Dialog, errorMessage } from './ui-components.js';
5
+ import { t } from './i18n.js';
6
+ import { useSshLocale } from './use-ssh-locale.js';
7
+ /** Called only from an explicit reveal/copy action, never from list rendering. */
8
+ export function VaultPasswordDialog({ entry, onClose }) {
9
+ useSshLocale();
10
+ const [password, setPassword] = useState();
11
+ const [busy, setBusy] = useState(false);
12
+ const [copied, setCopied] = useState(false);
13
+ const [error, setError] = useState();
14
+ const request = useRef();
15
+ const field = useRef(null);
16
+ useEffect(() => () => { request.current?.abort(); }, []);
17
+ const read = async () => {
18
+ const controller = new AbortController();
19
+ request.current = controller;
20
+ const result = await api(`/vault/${encodeURIComponent(entry.id)}/password`, { method: 'POST', body: '{}', signal: controller.signal });
21
+ if (controller.signal.aborted)
22
+ throw new DOMException('Aborted', 'AbortError');
23
+ return result.password;
24
+ };
25
+ const act = async (copy) => {
26
+ setBusy(true);
27
+ setError(undefined);
28
+ setCopied(false);
29
+ try {
30
+ const value = password ?? await read();
31
+ if (copy) {
32
+ let success = false;
33
+ try {
34
+ if (navigator.clipboard?.writeText) {
35
+ await navigator.clipboard.writeText(value);
36
+ success = true;
37
+ }
38
+ }
39
+ catch { /* HTTP and clipboard policies may require the selection fallback. */ }
40
+ if (request.current?.signal.aborted)
41
+ return;
42
+ if (!success) {
43
+ const node = document.createElement('textarea');
44
+ node.value = value;
45
+ node.readOnly = true;
46
+ node.style.cssText = 'position:fixed;left:-9999px;top:0;opacity:0';
47
+ const focused = document.activeElement;
48
+ try {
49
+ field.current?.parentElement?.append(node);
50
+ node.select();
51
+ success = document.execCommand('copy');
52
+ }
53
+ finally {
54
+ node.remove();
55
+ if (focused instanceof HTMLElement)
56
+ focused.focus();
57
+ }
58
+ }
59
+ if (!success)
60
+ throw Error(t('vault-password.copyFailed'));
61
+ setCopied(true);
62
+ }
63
+ else
64
+ setPassword(value);
65
+ }
66
+ catch (reason) {
67
+ if (!request.current?.signal.aborted)
68
+ setError(errorMessage(reason));
69
+ }
70
+ finally {
71
+ if (!request.current?.signal.aborted)
72
+ setBusy(false);
73
+ }
74
+ };
75
+ return _jsx(Dialog, { title: t('vault-password.title'), subtitle: `${entry.name} · ${entry.username}`, onClose: onClose, children: _jsxs("div", { className: "dsh-ssh-vault-password", children: [_jsxs("label", { className: "dsh-ssh-field", children: [_jsx("span", { children: t('client.password') }), _jsx("input", { ref: field, readOnly: true, type: password === undefined ? 'password' : 'text', autoComplete: "off", spellCheck: false, "aria-label": t('vault-password.savedPassword'), value: password ?? '', placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", onFocus: event => event.currentTarget.select() })] }), _jsxs("div", { className: "dsh-ssh-vault-password-actions", children: [_jsx("button", { type: "button", className: "dsh-ssh-secondary-button", disabled: busy, onClick: () => { if (password !== undefined)
76
+ setPassword(undefined);
77
+ else
78
+ void act(false); }, children: password === undefined ? t('vault-password.show') : t('vault-password.hide') }), _jsx("button", { type: "button", className: "dsh-ssh-secondary-button", disabled: busy, onClick: () => { void act(true); }, children: copied ? t('client.copied') : t('vault-password.copy') })] }), busy && _jsx("p", { role: "status", className: "dsh-ssh-form-hint", children: t('vault-password.loading') }), error && _jsx("p", { role: "alert", className: "dsh-ssh-inline-error", children: error })] }) });
79
+ }
80
+ //# sourceMappingURL=vault-password-dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault-password-dialog.js","sourceRoot":"","sources":["../src/vault-password-dialog.tsx"],"names":[],"mappings":";AAAA,OAA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E,EAAE,WAAW,EAAC,kDAAU,EAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,GAAI,IAAQ,EACjV,eAAK,SAAS,EAAC,gCAAgC,aAAC,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,0BAA0B,EAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,IAAI,QAAQ,KAAK,SAAS;gCAAE,WAAW,CAAC,SAAS,CAAC,CAAC;;gCAAM,KAAK,GAAG,CAAC,KAAK,CAAC,CAAA,CAAC,CAAC,YAAG,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,GAAU,EAAA,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,0BAA0B,EAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,CAAA,CAAC,CAAC,YAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,GAAU,IAAM,EACne,IAAI,IAAI,YAAG,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,mBAAmB,YAAE,CAAC,CAAC,wBAAwB,CAAC,GAAK,EACxF,KAAK,IAAI,YAAG,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,sBAAsB,YAAE,KAAK,GAAK,IAClE,GACC,CAAA;AACX,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemoncat7/dsh-ssh",
3
- "version": "1.16.19",
3
+ "version": "1.16.22",
4
4
  "description": "Secure SSH, FTP/FTPS/SFTP file transfer, browser terminals, proxies, port forwarding, and session-scoped AI access for DeepSeek Harness",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -47,7 +47,10 @@
47
47
  "docs/releases/1.10.4.md",
48
48
  "docs/dsh-021-compatibility.md",
49
49
  "docs/releases/1.11.4.md",
50
- "docs/compatibility-0.2.2-rc.1.md"
50
+ "docs/compatibility-0.2.2-rc.1.md",
51
+ "docs/compatibility-0.2.2-rc.2.md",
52
+ "docs/releases/1.16.21.md",
53
+ "docs/releases/1.16.22.md"
51
54
  ],
52
55
  "dsh": {
53
56
  "bundle": {
@@ -70,14 +73,15 @@
70
73
  },
71
74
  "engines": {
72
75
  "node": ">=24.9.0",
73
- "dsh": "=0.2.2-rc.1"
76
+ "dsh": "=0.2.2-rc.1 || =0.2.2-rc.2"
74
77
  },
75
78
  "scripts": {
76
79
  "clean": "node -e \"require('node:fs').rmSync('lib', { recursive: true, force: true })\"",
77
80
  "build": "tsc -p tsconfig.json && node scripts/build-client.mjs",
78
81
  "prepare": "npm run clean && npm run build",
79
82
  "test": "npm run build && node --test test/*.test.mjs",
80
- "pack:check": "npm pack --dry-run"
83
+ "pack:check": "npm pack --dry-run",
84
+ "test:sidebar-browser": "node test/sidebar-anchor.browser.mjs"
81
85
  },
82
86
  "dependencies": {
83
87
  "@deepseek-ai/schemastery": "~3.19.0",
@@ -139,7 +143,9 @@
139
143
  "@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.1",
140
144
  "@deepseek-ai/dsh-ptc-runtime": "0.2.2-rc.1",
141
145
  "@hugeicons/core-free-icons": "^4.3.5",
142
- "@hugeicons/react": "^1.1.10"
146
+ "@hugeicons/react": "^1.1.10",
147
+ "@types/react-dom": "18.3.7",
148
+ "react-dom": "18.3.1"
143
149
  },
144
150
  "publishConfig": {
145
151
  "access": "public"