@tiphareth/dsh-hardssh 0.1.2

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.
Files changed (165) hide show
  1. package/README.md +50 -0
  2. package/cordis.patch.yml +26 -0
  3. package/lib/client.js +17780 -0
  4. package/lib/environment-BL1jddfB.js +449 -0
  5. package/lib/fs.js +478 -0
  6. package/lib/index.js +6758 -0
  7. package/lib/subprocess.js +600 -0
  8. package/lib/switch-fs-CAJpFY9C.js +193 -0
  9. package/lib/switch-fs-RrZtG2gv.js +210 -0
  10. package/lib/types/backend.d.ts +108 -0
  11. package/lib/types/base/capability.d.ts +107 -0
  12. package/lib/types/base/index.d.ts +18 -0
  13. package/lib/types/base/ledger-router.d.ts +48 -0
  14. package/lib/types/base/ledger.d.ts +82 -0
  15. package/lib/types/base/model.d.ts +108 -0
  16. package/lib/types/base/namespace.d.ts +57 -0
  17. package/lib/types/base/plugin.d.ts +102 -0
  18. package/lib/types/base/registry.d.ts +60 -0
  19. package/lib/types/base/router.d.ts +40 -0
  20. package/lib/types/client/api.d.ts +85 -0
  21. package/lib/types/client/directory-flow.d.ts +82 -0
  22. package/lib/types/client/icons.d.ts +19 -0
  23. package/lib/types/client/index.d.ts +34 -0
  24. package/lib/types/client/locales.d.ts +104 -0
  25. package/lib/types/client/manager-button.d.ts +32 -0
  26. package/lib/types/client/migrate.d.ts +20 -0
  27. package/lib/types/client/ssh/api.d.ts +89 -0
  28. package/lib/types/client/ssh/apply.d.ts +23 -0
  29. package/lib/types/client/ssh/locales.d.ts +156 -0
  30. package/lib/types/client/ssh/mount.d.ts +13 -0
  31. package/lib/types/client/ssh/panel/ClusterTab.d.ts +8 -0
  32. package/lib/types/client/ssh/panel/HostFingerprintDialog.d.ts +16 -0
  33. package/lib/types/client/ssh/panel/HostFormDialog.d.ts +13 -0
  34. package/lib/types/client/ssh/panel/HostsTab.d.ts +10 -0
  35. package/lib/types/client/ssh/panel/SessionSecretDialog.d.ts +16 -0
  36. package/lib/types/client/ssh/panel/SshPanel.d.ts +14 -0
  37. package/lib/types/client/ssh/panel/TerminalTab.d.ts +12 -0
  38. package/lib/types/client/ssh/panel/TransferTab.d.ts +8 -0
  39. package/lib/types/client/ssh/panel/TunnelsTab.d.ts +8 -0
  40. package/lib/types/client/ssh/panel/controller.d.ts +23 -0
  41. package/lib/types/client/ssh/panel/helpers.d.ts +15 -0
  42. package/lib/types/client/ssh/panel/xterm.css.d.ts +3 -0
  43. package/lib/types/client/ssh/sidebar-entry.d.ts +25 -0
  44. package/lib/types/client/state.d.ts +32 -0
  45. package/lib/types/client/text.d.ts +11 -0
  46. package/lib/types/client/workspace-badges.d.ts +38 -0
  47. package/lib/types/client/workspace-gate.d.ts +15 -0
  48. package/lib/types/client-http.d.ts +15 -0
  49. package/lib/types/core.d.ts +43 -0
  50. package/lib/types/fs.d.ts +36 -0
  51. package/lib/types/host-http.d.ts +25 -0
  52. package/lib/types/index.d.ts +53 -0
  53. package/lib/types/ledger.d.ts +132 -0
  54. package/lib/types/protocol.d.ts +101 -0
  55. package/lib/types/providers/index.d.ts +19 -0
  56. package/lib/types/providers/local/provider.d.ts +58 -0
  57. package/lib/types/providers/ssh/provider.d.ts +112 -0
  58. package/lib/types/remote/environment.d.ts +29 -0
  59. package/lib/types/remote/output.d.ts +38 -0
  60. package/lib/types/remote/remote-fs.d.ts +69 -0
  61. package/lib/types/remote/remote-process.d.ts +41 -0
  62. package/lib/types/remote/remote-subprocess.d.ts +31 -0
  63. package/lib/types/remote/remote-terminal.d.ts +41 -0
  64. package/lib/types/remote-runner.d.ts +83 -0
  65. package/lib/types/remote-search.d.ts +50 -0
  66. package/lib/types/routes.d.ts +24 -0
  67. package/lib/types/runtime/workspace-core.d.ts +59 -0
  68. package/lib/types/seam-state.d.ts +69 -0
  69. package/lib/types/shell.d.ts +8 -0
  70. package/lib/types/ssh/connection/lease.d.ts +16 -0
  71. package/lib/types/ssh/connection/pool.d.ts +57 -0
  72. package/lib/types/ssh/engine.d.ts +434 -0
  73. package/lib/types/ssh/exec/output.d.ts +31 -0
  74. package/lib/types/ssh/known-hosts.d.ts +89 -0
  75. package/lib/types/ssh/plugin.d.ts +57 -0
  76. package/lib/types/ssh/protocol.d.ts +236 -0
  77. package/lib/types/ssh/routes.d.ts +44 -0
  78. package/lib/types/ssh/store.d.ts +107 -0
  79. package/lib/types/ssh/tools.d.ts +35 -0
  80. package/lib/types/ssh/transfer/progress.d.ts +14 -0
  81. package/lib/types/ssh/vault.d.ts +110 -0
  82. package/lib/types/subprocess.d.ts +32 -0
  83. package/lib/types/switch/switch-fs.d.ts +88 -0
  84. package/lib/types/switch/switch-subprocess.d.ts +34 -0
  85. package/lib/types/tools.d.ts +12 -0
  86. package/package.json +134 -0
  87. package/src/backend.ts +624 -0
  88. package/src/base/capability.ts +86 -0
  89. package/src/base/index.ts +18 -0
  90. package/src/base/ledger-router.ts +128 -0
  91. package/src/base/ledger.ts +299 -0
  92. package/src/base/model.ts +118 -0
  93. package/src/base/namespace.ts +102 -0
  94. package/src/base/plugin.ts +170 -0
  95. package/src/base/registry.ts +109 -0
  96. package/src/base/router.ts +43 -0
  97. package/src/client/api.ts +196 -0
  98. package/src/client/css-modules.d.ts +5 -0
  99. package/src/client/directory-flow.tsx +482 -0
  100. package/src/client/icons.tsx +50 -0
  101. package/src/client/index.ts +210 -0
  102. package/src/client/locales.ts +105 -0
  103. package/src/client/manager-button.tsx +269 -0
  104. package/src/client/migrate.ts +109 -0
  105. package/src/client/ssh/api.ts +411 -0
  106. package/src/client/ssh/apply.ts +50 -0
  107. package/src/client/ssh/locales.ts +322 -0
  108. package/src/client/ssh/mount.tsx +83 -0
  109. package/src/client/ssh/panel/ClusterTab.tsx +123 -0
  110. package/src/client/ssh/panel/HostFingerprintDialog.tsx +82 -0
  111. package/src/client/ssh/panel/HostFormDialog.tsx +228 -0
  112. package/src/client/ssh/panel/HostsTab.tsx +236 -0
  113. package/src/client/ssh/panel/SessionSecretDialog.tsx +80 -0
  114. package/src/client/ssh/panel/SshPanel.tsx +77 -0
  115. package/src/client/ssh/panel/TerminalTab.tsx +176 -0
  116. package/src/client/ssh/panel/TransferTab.tsx +232 -0
  117. package/src/client/ssh/panel/TunnelsTab.tsx +177 -0
  118. package/src/client/ssh/panel/controller.ts +48 -0
  119. package/src/client/ssh/panel/helpers.ts +26 -0
  120. package/src/client/ssh/panel/panel.module.css +1006 -0
  121. package/src/client/ssh/panel/xterm.css.ts +2 -0
  122. package/src/client/ssh/sidebar-entry.ts +123 -0
  123. package/src/client/state.ts +99 -0
  124. package/src/client/text.ts +22 -0
  125. package/src/client/workspace-badges.ts +96 -0
  126. package/src/client/workspace-gate.ts +225 -0
  127. package/src/client/workspace.module.css +283 -0
  128. package/src/client-http.ts +45 -0
  129. package/src/core.ts +47 -0
  130. package/src/fs.ts +85 -0
  131. package/src/host-http.ts +74 -0
  132. package/src/index.ts +244 -0
  133. package/src/ledger.ts +416 -0
  134. package/src/protocol.ts +114 -0
  135. package/src/providers/index.ts +34 -0
  136. package/src/providers/local/provider.ts +179 -0
  137. package/src/providers/ssh/provider.ts +274 -0
  138. package/src/remote/environment.ts +123 -0
  139. package/src/remote/output.ts +142 -0
  140. package/src/remote/remote-fs.ts +532 -0
  141. package/src/remote/remote-process.ts +203 -0
  142. package/src/remote/remote-subprocess.ts +159 -0
  143. package/src/remote/remote-terminal.ts +141 -0
  144. package/src/remote-runner.ts +201 -0
  145. package/src/remote-search.ts +163 -0
  146. package/src/routes.ts +395 -0
  147. package/src/runtime/workspace-core.ts +154 -0
  148. package/src/seam-state.ts +185 -0
  149. package/src/shell.ts +10 -0
  150. package/src/ssh/connection/lease.ts +17 -0
  151. package/src/ssh/connection/pool.ts +275 -0
  152. package/src/ssh/engine.ts +1761 -0
  153. package/src/ssh/exec/output.ts +70 -0
  154. package/src/ssh/known-hosts.ts +214 -0
  155. package/src/ssh/plugin.ts +184 -0
  156. package/src/ssh/protocol.ts +227 -0
  157. package/src/ssh/routes.ts +892 -0
  158. package/src/ssh/store.ts +544 -0
  159. package/src/ssh/tools.ts +402 -0
  160. package/src/ssh/transfer/progress.ts +75 -0
  161. package/src/ssh/vault.ts +477 -0
  162. package/src/subprocess.ts +71 -0
  163. package/src/switch/switch-fs.ts +253 -0
  164. package/src/switch/switch-subprocess.ts +59 -0
  165. package/src/tools.ts +221 -0
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Browser-half entry for the dsh-hardssh plugin — runs inside the dsh
3
+ * web GUI. Registers a session-header utility (SSH workspace manager, left
4
+ * of the session log) that lists SSH-bound workspaces, creates new ones
5
+ * (host + remote directory picker) and deletes them. The execution-world
6
+ * routing itself is HOST-side: a session whose cwd is the anchor path of an
7
+ * SSH workspace routes its fs/subprocess calls remote; every other session
8
+ * stays local. There is no global local⇄remote toggle anymore.
9
+ * Failure policy: every DOM wiring problem is logged, never thrown — the
10
+ * web shell fails the whole boot when a plugin apply throws.
11
+ */
12
+ import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
13
+ import { type WorkspaceKey } from './locales.ts';
14
+ declare module '@deepseek-ai/dsh-client-ui-slots' {
15
+ interface LocaleNamespaceMap {
16
+ /** dsh-hardssh surface copy. */
17
+ 'dsh-hardssh': WorkspaceKey;
18
+ }
19
+ }
20
+ export type { PanelControllerSnapshot } from './ssh/panel/controller.ts';
21
+ export type { SshPanelProps } from './ssh/panel/SshPanel.tsx';
22
+ export type { HostsTabProps } from './ssh/panel/HostsTab.tsx';
23
+ export type { HostFormDialogProps } from './ssh/panel/HostFormDialog.tsx';
24
+ export type { TerminalTabProps } from './ssh/panel/TerminalTab.tsx';
25
+ export type { TransferTabProps } from './ssh/panel/TransferTab.tsx';
26
+ export type { TunnelsTabProps } from './ssh/panel/TunnelsTab.tsx';
27
+ export type { ClusterTabProps } from './ssh/panel/ClusterTab.tsx';
28
+ export type { SshKey } from './ssh/locales.ts';
29
+ /** Required services: slots for the header buttons + directory-flow holes,
30
+ * locale for the copy, workspaces for the native local-directory chooser. */
31
+ export declare const inject: string[];
32
+ /** Apply the browser half. */
33
+ export declare function apply(ctx: ClientContext): void;
34
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Locale dictionaries for the dsh-hardssh surface (zh/en).
3
+ * The key union derives from the zh dictionary (mirrors the dsh-ssh locale
4
+ * pattern), so the LocaleNamespaceMap augmentation types the `t` seat and
5
+ * the register call against exactly the shipped keys.
6
+ */
7
+ /** Locale namespace this plugin owns. */
8
+ export declare const NS = "dsh-hardssh";
9
+ /** The zh dictionary (the key union source). */
10
+ export declare const zh: {
11
+ 'manager.label': string;
12
+ 'manager.tooltip': string;
13
+ 'manager.title': string;
14
+ 'manager.empty': string;
15
+ 'manager.delete': string;
16
+ 'manager.editServer': string;
17
+ 'manager.deleteServer': string;
18
+ 'manager.newHost': string;
19
+ 'manager.hostInUse': string;
20
+ 'create.host': string;
21
+ 'create.hostEmpty': string;
22
+ 'create.dir': string;
23
+ 'create.dirPlaceholder': string;
24
+ 'create.browse': string;
25
+ 'create.up': string;
26
+ 'create.current': string;
27
+ 'create.titleLabel': string;
28
+ 'create.titlePlaceholder': string;
29
+ 'create.submit': string;
30
+ 'create.cancel': string;
31
+ 'create.connecting': string;
32
+ 'create.needHost': string;
33
+ 'create.needDir': string;
34
+ 'create.needTitle': string;
35
+ 'create.needConnect': string;
36
+ 'host.add': string;
37
+ 'host.save': string;
38
+ 'host.needFields': string;
39
+ 'host.needPassword': string;
40
+ 'dialog.alias': string;
41
+ 'dialog.host': string;
42
+ 'dialog.port': string;
43
+ 'dialog.user': string;
44
+ 'dialog.password': string;
45
+ 'dialog.passwordHint': string;
46
+ 'flow.local': string;
47
+ 'flow.ssh': string;
48
+ 'flow.useThisDir': string;
49
+ 'panel.loading': string;
50
+ 'gate.failed': string;
51
+ 'gate.retryLimit': string;
52
+ };
53
+ /** The key union (used by the LocaleNamespaceMap augmentation). */
54
+ export type WorkspaceKey = keyof typeof zh;
55
+ /** The en dictionary (same key set). */
56
+ export declare const en: Record<WorkspaceKey, string>;
57
+ /** The dictionary pair registered into the locale service. */
58
+ export declare const dictionaries: {
59
+ readonly zh: {
60
+ 'manager.label': string;
61
+ 'manager.tooltip': string;
62
+ 'manager.title': string;
63
+ 'manager.empty': string;
64
+ 'manager.delete': string;
65
+ 'manager.editServer': string;
66
+ 'manager.deleteServer': string;
67
+ 'manager.newHost': string;
68
+ 'manager.hostInUse': string;
69
+ 'create.host': string;
70
+ 'create.hostEmpty': string;
71
+ 'create.dir': string;
72
+ 'create.dirPlaceholder': string;
73
+ 'create.browse': string;
74
+ 'create.up': string;
75
+ 'create.current': string;
76
+ 'create.titleLabel': string;
77
+ 'create.titlePlaceholder': string;
78
+ 'create.submit': string;
79
+ 'create.cancel': string;
80
+ 'create.connecting': string;
81
+ 'create.needHost': string;
82
+ 'create.needDir': string;
83
+ 'create.needTitle': string;
84
+ 'create.needConnect': string;
85
+ 'host.add': string;
86
+ 'host.save': string;
87
+ 'host.needFields': string;
88
+ 'host.needPassword': string;
89
+ 'dialog.alias': string;
90
+ 'dialog.host': string;
91
+ 'dialog.port': string;
92
+ 'dialog.user': string;
93
+ 'dialog.password': string;
94
+ 'dialog.passwordHint': string;
95
+ 'flow.local': string;
96
+ 'flow.ssh': string;
97
+ 'flow.useThisDir': string;
98
+ 'panel.loading': string;
99
+ 'gate.failed': string;
100
+ 'gate.retryLimit': string;
101
+ };
102
+ readonly en: Record<"manager.label" | "manager.tooltip" | "manager.title" | "manager.empty" | "manager.delete" | "manager.editServer" | "manager.deleteServer" | "manager.newHost" | "manager.hostInUse" | "create.host" | "create.hostEmpty" | "create.dir" | "create.dirPlaceholder" | "create.browse" | "create.up" | "create.current" | "create.titleLabel" | "create.titlePlaceholder" | "create.submit" | "create.cancel" | "create.connecting" | "create.needHost" | "create.needDir" | "create.needTitle" | "create.needConnect" | "host.add" | "host.save" | "host.needFields" | "host.needPassword" | "dialog.alias" | "dialog.host" | "dialog.port" | "dialog.user" | "dialog.password" | "dialog.passwordHint" | "flow.local" | "flow.ssh" | "flow.useThisDir" | "panel.loading" | "gate.failed" | "gate.retryLimit", string>;
103
+ };
104
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1,32 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { WorkspaceManager } from './state.ts';
3
+ import type { SshApi } from './ssh/api.ts';
4
+ /** The session-header button. Slot-injected props: manager + sshApi. */
5
+ export declare function WorkspaceManagerButton(props: {
6
+ manager: WorkspaceManager;
7
+ /** Full SSH host API (list/create/update/delete) for server management. */
8
+ sshApi?: SshApi;
9
+ sessionId?: unknown;
10
+ useSession?: unknown;
11
+ useSessions?: unknown;
12
+ useWorkspaces?: unknown;
13
+ useProjection?: unknown;
14
+ useInput?: unknown;
15
+ inputActions?: unknown;
16
+ renderSlot?: unknown;
17
+ renderSlotChain?: unknown;
18
+ t?: unknown;
19
+ }): ReactElement;
20
+ /** Open the manager dropdown, anchored under the trigger button. */
21
+ export declare function openManager(manager: WorkspaceManager, sshApi?: SshApi, trigger?: HTMLElement): void;
22
+ /** The manager dropdown: server + workspace rows, with server CRUD. */
23
+ export declare function ManagerOverlay(props: {
24
+ manager: WorkspaceManager;
25
+ sshApi?: SshApi;
26
+ onClose: () => void;
27
+ anchor?: {
28
+ bottom: number;
29
+ left: number;
30
+ };
31
+ }): ReactElement;
32
+ //# sourceMappingURL=manager-button.d.ts.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * One-time migration from the legacy GLOBAL local⇄remote mode. The previous
3
+ * hardssh client persisted each session's mode in localStorage under
4
+ * `ssh-session-state:<sessionId>`; a remembered REMOTE target meant the whole
5
+ * host switched to that SSH server. With the workspace-bound redesign, the
6
+ * correct home for that binding is an SSH workspace record. This module
7
+ * scans the legacy keys, converts each DISTINCT remote target (alias +
8
+ * remoteRoot) into a ledger record (reusing it for every session that shared
9
+ * it), and clears the legacy keys so the migration runs exactly once.
10
+ *
11
+ * Best-effort: any failure is logged by the caller and never blocks boot.
12
+ * @module dsh-hardssh/client/migrate
13
+ */
14
+ import type { WorkspaceApi } from './api.ts';
15
+ /**
16
+ * Migrate legacy remote memories into SSH workspace records. Returns the
17
+ * number of workspaces created (0 when nothing to do).
18
+ */
19
+ export declare function migrateLegacySessionMemory(api: WorkspaceApi): Promise<number>;
20
+ //# sourceMappingURL=migrate.d.ts.map
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Browser-side API client for the /api/dsh-ssh route family. The only data
3
+ * access path the panel components use — plain fetch/WebSocket, same origin.
4
+ */
5
+ import { type ClusterResult, type ExecResult, type HostPayload, type ImportResult, type KnownHostAction, type KnownHostView, type RemoteDirEntry, type SshHostSummary, type TestResult, type TransferProgress, type TunnelInfo } from '../../ssh/protocol.ts';
6
+ /** Error carrying the route's JSON error message. */
7
+ export declare class SshApiError extends Error {
8
+ /** Stable machine code from the route error body (HOST_KEY_*, HOST_IN_USE, …). */
9
+ readonly code: string | undefined;
10
+ readonly hostKeyFingerprint: string | undefined;
11
+ constructor(message: string, code?: string, hostKeyFingerprint?: string);
12
+ }
13
+ /** One open terminal connection (WebSocket JSON frames). */
14
+ export interface TerminalConnection {
15
+ /** Fired on the ready frame (shell is up). */
16
+ onReady: (() => void) | undefined;
17
+ /** Fired on every output frame. */
18
+ onOutput: ((data: string) => void) | undefined;
19
+ /** Fired on the exit frame (or transport error). */
20
+ onExit: ((code: number | null, error?: string) => void) | undefined;
21
+ /** Send raw input to the remote shell. */
22
+ send(data: string): void;
23
+ /** Resize the remote PTY. */
24
+ resize(cols: number, rows: number): void;
25
+ /** Close the socket and the remote session. */
26
+ close(): void;
27
+ }
28
+ /** The browser half's only data entry point. */
29
+ export declare class SshApi {
30
+ listHosts(queryText?: string): Promise<SshHostSummary[]>;
31
+ createHost(payload: HostPayload): Promise<SshHostSummary>;
32
+ updateHost(alias: string, patch: HostPayload): Promise<SshHostSummary>;
33
+ deleteHost(alias: string): Promise<void>;
34
+ importSshConfig(): Promise<ImportResult>;
35
+ testHost(alias: string): Promise<TestResult>;
36
+ exec(alias: string, command: string, timeoutMs?: number): Promise<ExecResult>;
37
+ cluster(options: {
38
+ command: string;
39
+ aliases?: string[];
40
+ environment?: string;
41
+ tags?: string[];
42
+ timeoutMs?: number;
43
+ maxWorkers?: number;
44
+ }): Promise<ClusterResult[]>;
45
+ ls(alias: string, path: string): Promise<RemoteDirEntry[]>;
46
+ listTunnels(): Promise<TunnelInfo[]>;
47
+ startTunnel(options: {
48
+ alias: string;
49
+ remotePort: number;
50
+ remoteHost?: string;
51
+ localPort?: number;
52
+ }): Promise<TunnelInfo>;
53
+ stopTunnel(tunnelId: string): Promise<boolean>;
54
+ stopAllTunnels(alias?: string): Promise<number>;
55
+ /**
56
+ * Upload one file (raw bytes) to a remote path. Progress arrives through
57
+ * the NDJSON response stream; resolves when the result frame lands.
58
+ */
59
+ uploadFile(file: File, alias: string, remotePath: string, onProgress?: (progress: TransferProgress) => void): Promise<{
60
+ transferredBytes: number;
61
+ }>;
62
+ /**
63
+ * Download a remote file with client-side progress. Streams straight to
64
+ * disk when the File System Access API is available (no full-file RAM
65
+ * copy); otherwise falls back to an in-memory Blob.
66
+ */
67
+ downloadFile(alias: string, remotePath: string, onProgress?: (progress: TransferProgress) => void): Promise<{
68
+ blob?: Blob;
69
+ filename: string;
70
+ streamed: boolean;
71
+ bytes: number;
72
+ }>;
73
+ /** Open a WebSocket terminal session. */
74
+ openTerminal(alias: string, cols: number, rows: number): TerminalConnection;
75
+ /** Read the host-key trust records (optionally one alias's). */
76
+ listKnownHosts(alias?: string): Promise<KnownHostView[]>;
77
+ /** Confirm (trust) or reset (forget) one alias's host key. */
78
+ hostKeyAction(alias: string, action: KnownHostAction): Promise<void>;
79
+ /** Aliases currently holding a live pooled SSH connection (badge coloring). */
80
+ connectedAliases(): Promise<string[]>;
81
+ /** Provide a password/passphrase for `alias` THIS SESSION ONLY (never
82
+ * persisted). Called when a connection replied NEEDS_PASSWORD; after
83
+ * injection the caller retries the operation. */
84
+ setSessionSecret(alias: string, secret: {
85
+ password?: string;
86
+ passphrase?: string;
87
+ }): Promise<void>;
88
+ }
89
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * SSH operations browser surfaces, hosted inside dsh-hardssh's client bundle
3
+ * (migrated from the legacy dsh-ssh package): the 'dsh-ssh'
4
+ * locale dictionaries, the sidebar entry row, and the SSH operations panel
5
+ * in the center column. Mounted from src/client/index.ts alongside the
6
+ * workspace surfaces; a DOM failure here degrades the SSH panel only, never
7
+ * the GUI.
8
+ */
9
+ import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
10
+ /** Locale namespace this capability owns (kept as 'dsh-ssh'). */
11
+ export declare const NS = "dsh-ssh";
12
+ declare module '@deepseek-ai/dsh-client-ui-slots' {
13
+ interface LocaleNamespaceMap {
14
+ /** dsh-ssh surface copy (now inside dsh-hardssh). */
15
+ 'dsh-ssh': import('./locales.ts').SshKey;
16
+ }
17
+ }
18
+ /**
19
+ * Mount the SSH operations surfaces (sidebar entry + operations panel).
20
+ * @param ctx - client root context (locale service).
21
+ */
22
+ export declare function mountSshOperations(ctx: ClientContext): void;
23
+ //# sourceMappingURL=apply.d.ts.map
@@ -0,0 +1,156 @@
1
+ /**
2
+ * dsh-ssh surface copy: zh is the key source, en mirrors every key.
3
+ */
4
+ export declare const zh: {
5
+ readonly 'entry.label': "SSH";
6
+ readonly 'entry.tooltip': "远程 SSH 运维面板";
7
+ readonly 'panel.title': "远程 SSH";
8
+ readonly 'tab.hosts': "主机";
9
+ readonly 'tab.terminal': "终端";
10
+ readonly 'tab.transfer': "传输";
11
+ readonly 'tab.tunnels': "隧道";
12
+ readonly 'tab.cluster': "集群";
13
+ readonly 'hosts.empty': "尚未配置主机。点击「新增主机」添加,或从 ~/.ssh/config 导入。";
14
+ readonly 'hosts.add': "新增主机";
15
+ readonly 'hosts.import': "导入 ~/.ssh/config";
16
+ readonly 'hosts.search': "搜索别名 / 描述 / 标签…";
17
+ readonly 'hosts.col.alias': "别名";
18
+ readonly 'hosts.col.host': "主机";
19
+ readonly 'hosts.col.user': "用户";
20
+ readonly 'hosts.col.auth': "认证";
21
+ readonly 'hosts.col.environment': "环境";
22
+ readonly 'hosts.col.tags': "标签";
23
+ readonly 'hosts.col.description': "备注";
24
+ readonly 'hosts.col.actions': "操作";
25
+ readonly 'hosts.test': "测试";
26
+ readonly 'hosts.edit': "编辑";
27
+ readonly 'hosts.delete': "删除";
28
+ readonly 'hosts.deleteConfirm': "确定删除主机「{alias}」?将同时停止其隧道。";
29
+ readonly 'hosts.imported': "解析 {parsed} 个配置块,新增 {added} 台主机,跳过 {skipped} 个。";
30
+ readonly 'hosts.testing': "连接测试中…";
31
+ readonly 'hosts.testOk': "连接成功({latency} ms)";
32
+ readonly 'hosts.testFail': "连接失败:{error}";
33
+ readonly 'hosts.connected': "连接";
34
+ readonly 'hosts.notConnected': "未连接";
35
+ readonly 'form.title.create': "新增主机";
36
+ readonly 'form.title.edit': "编辑主机 {alias}";
37
+ readonly 'form.alias': "别名";
38
+ readonly 'form.aliasHint': "小写字母、数字与单连字符,操作时使用";
39
+ readonly 'form.host': "主机地址";
40
+ readonly 'form.port': "端口";
41
+ readonly 'form.user': "用户名";
42
+ readonly 'form.auth': "认证方式";
43
+ readonly 'form.auth.key': "密钥";
44
+ readonly 'form.auth.password': "密码";
45
+ readonly 'form.authKeepHint': "编辑时密钥/密码留空将保留原认证方式与已存凭据;如需更换认证方式请填写新凭据。";
46
+ readonly 'form.keyPath': "私钥路径";
47
+ readonly 'form.keyPathHint': "如 ~/.ssh/id_ed25519";
48
+ readonly 'form.agentHint': "留空则使用 ssh-agent 已加载的密钥:设置 SSH_AUTH_SOCK(Git-Bash ssh-agent / WSL / unix),零输入";
49
+ readonly 'form.passphrase': "密钥口令";
50
+ readonly 'form.password': "密码";
51
+ readonly 'form.passwordHint': "仅本次会话使用:首次连接时手动输入,不落盘(VSCode Remote-SSH 式)";
52
+ readonly 'form.proxyJump': "跳板机别名";
53
+ readonly 'form.proxyJumpHint': "逗号分隔的本地主机别名,按顺序连接";
54
+ readonly 'form.description': "备注";
55
+ readonly 'form.environment': "环境";
56
+ readonly 'form.environmentHint': "如 development / production";
57
+ readonly 'form.tags': "标签";
58
+ readonly 'form.tagsHint': "逗号分隔";
59
+ readonly 'form.location': "位置";
60
+ readonly 'form.save': "保存";
61
+ readonly 'form.cancel': "取消";
62
+ readonly 'form.required': "请填写必填字段:别名、主机地址、用户名。";
63
+ readonly 'form.portInvalid': "端口必须是 1-65535 之间的整数。";
64
+ readonly 'terminal.selectHost': "选择主机";
65
+ readonly 'terminal.connect': "连接";
66
+ readonly 'terminal.disconnect': "断开";
67
+ readonly 'terminal.placeholder': "选择主机后点击「连接」打开远程终端。";
68
+ readonly 'terminal.connecting': "正在连接…";
69
+ readonly 'terminal.ready': "终端已连接({alias})";
70
+ readonly 'terminal.exited': "终端已退出({alias})";
71
+ readonly 'terminal.error': "终端错误:{error}";
72
+ readonly 'transfer.selectHost': "选择主机";
73
+ readonly 'transfer.remotePath': "远程路径";
74
+ readonly 'transfer.remotePathHint': "如 /tmp/ 或 /home/user/app.tar.gz";
75
+ readonly 'transfer.upload': "上传";
76
+ readonly 'transfer.uploading': "正在上传 {file}…";
77
+ readonly 'transfer.download': "下载";
78
+ readonly 'transfer.downloading': "正在下载…";
79
+ readonly 'transfer.done': "完成:{bytes} 字节";
80
+ readonly 'transfer.failed': "传输失败:{error}";
81
+ readonly 'transfer.browseRemote': "浏览远程目录";
82
+ readonly 'transfer.refresh': "刷新";
83
+ readonly 'transfer.name': "名称";
84
+ readonly 'transfer.upLevel': "上级目录";
85
+ readonly 'transfer.size': "大小";
86
+ readonly 'transfer.modified': "修改时间";
87
+ readonly 'transfer.bytes': "{value} B";
88
+ readonly 'transfer.kib': "{value} KB";
89
+ readonly 'transfer.mib': "{value} MB";
90
+ readonly 'transfer.gib': "{value} GB";
91
+ readonly 'transfer.percent': "{value}%";
92
+ readonly 'transfer.speed': "{value}/s";
93
+ readonly 'transfer.dir': "目录";
94
+ readonly 'transfer.file': "文件";
95
+ readonly 'tunnel.empty': "没有活跃的隧道。";
96
+ readonly 'tunnel.start': "新建隧道";
97
+ readonly 'tunnel.alias': "主机别名";
98
+ readonly 'tunnel.remotePort': "远程端口";
99
+ readonly 'tunnel.remoteHost': "远程主机";
100
+ readonly 'tunnel.remoteHostHint': "默认 127.0.0.1(服务器自身)";
101
+ readonly 'tunnel.localPort': "本地端口";
102
+ readonly 'tunnel.localPortHint': "留空自动分配";
103
+ readonly 'tunnel.stop': "停止";
104
+ readonly 'tunnel.stopAll': "全部停止";
105
+ readonly 'tunnel.stopAllConfirm': "确定停止全部隧道吗?";
106
+ readonly 'tunnel.row': "{alias}: 127.0.0.1:{localPort} -> {remoteHost}:{remotePort}";
107
+ readonly 'tunnel.started': "隧道已建立:127.0.0.1:{localPort}";
108
+ readonly 'tunnel.failed': "隧道启动失败:{error}";
109
+ readonly 'cluster.command': "命令";
110
+ readonly 'cluster.run': "执行";
111
+ readonly 'cluster.confirm': "确定在匹配的主机上执行该命令吗?该操作会真实运行在远程服务器上。";
112
+ readonly 'cluster.aliases': "主机别名(逗号分隔,留空为全部)";
113
+ readonly 'cluster.environment': "环境过滤";
114
+ readonly 'cluster.tags': "标签过滤(逗号分隔)";
115
+ readonly 'cluster.results': "执行结果";
116
+ readonly 'cluster.empty': "输入命令后点击「执行」。";
117
+ readonly 'cluster.noMatch': "没有匹配的主机。";
118
+ readonly 'cluster.ok': "成功";
119
+ readonly 'cluster.fail': "失败";
120
+ readonly 'cluster.timeout': "超时";
121
+ readonly 'cluster.col.alias': "主机";
122
+ readonly 'cluster.col.status': "状态";
123
+ readonly 'cluster.col.exit': "退出码";
124
+ readonly 'cluster.col.stdout': "标准输出";
125
+ readonly 'cluster.col.stderr': "标准错误";
126
+ readonly 'cluster.col.error': "错误";
127
+ readonly 'cluster.col.duration': "耗时";
128
+ readonly 'common.loading': "加载中…";
129
+ readonly 'common.error': "出错:{error}";
130
+ readonly 'common.refresh': "刷新";
131
+ readonly 'common.close': "关闭";
132
+ readonly 'common.confirm': "确定";
133
+ readonly 'fingerprint.title': "确认主机密钥 · {alias}";
134
+ readonly 'fingerprint.titleMismatch': "主机密钥变化 · {alias}";
135
+ readonly 'fingerprint.intro': "首次连接该服务器。请通过独立可信渠道核对其密钥指纹,确认无误后再信任:";
136
+ readonly 'fingerprint.mismatchIntro': "该服务器的密钥与之前记录的不一致,可能存在中间人攻击或服务器密钥轮换:";
137
+ readonly 'fingerprint.mismatchWarn': "若确认服务器正常(如重装系统/轮换密钥),请先「重置」再重新信任。";
138
+ readonly 'fingerprint.cancel': "取消";
139
+ readonly 'fingerprint.trust': "信任";
140
+ readonly 'fingerprint.forget': "重置";
141
+ readonly 'sessionSecret.title': "请输入 {account} 的密码";
142
+ readonly 'sessionSecret.titlePassphrase': "请输入 {account} 的密钥口令";
143
+ readonly 'sessionSecret.intro': "";
144
+ readonly 'sessionSecret.introPassphrase': "";
145
+ readonly 'sessionSecret.placeholder': "密码";
146
+ readonly 'sessionSecret.placeholderPassphrase': "密钥口令";
147
+ readonly 'sessionSecret.required': "请输入后再连接";
148
+ readonly 'sessionSecret.connect': "连接";
149
+ readonly 'sessionSecret.cancel': "取消";
150
+ };
151
+ export declare const en: Record<keyof typeof zh, string>;
152
+ /** Locale key union. */
153
+ export type SshKey = keyof typeof zh;
154
+ /** Tiny interpolation: {name} -> value. */
155
+ export declare function t(dictionary: Record<string, string>, key: string, values?: Record<string, string | number>): string;
156
+ //# sourceMappingURL=locales.d.ts.map
@@ -0,0 +1,13 @@
1
+ import type { SshApi } from './api.ts';
2
+ import type { PanelController } from './panel/controller.ts';
3
+ /** The injected panel container (kept in the DOM, hidden when inactive). */
4
+ export declare const PANEL_VIEW_SELECTOR = "[data-dsh-ssh-view]";
5
+ /**
6
+ * Mount the panel React tree into the center column and bind its visibility
7
+ * to the controller's panelOpen state.
8
+ * @param controller - the panel controller driving the view.
9
+ * @param api - the SSH API client the tabs operate through.
10
+ * @returns disposer unmounting the tree and restoring the column.
11
+ */
12
+ export declare function mountPanel(controller: PanelController, api: SshApi): () => void;
13
+ //# sourceMappingURL=mount.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { SshApi } from '../api.ts';
2
+ /** Cluster tab props. */
3
+ export interface ClusterTabProps {
4
+ api: SshApi;
5
+ }
6
+ /** The cluster execution tab. */
7
+ export declare function ClusterTab({ api }: ClusterTabProps): import("react").JSX.Element;
8
+ //# sourceMappingURL=ClusterTab.d.ts.map
@@ -0,0 +1,16 @@
1
+ import type { SshApi } from '../api.ts';
2
+ /** The dialog's props. */
3
+ export interface HostFingerprintDialogProps {
4
+ api: SshApi;
5
+ alias: string;
6
+ /** The server's canonical fingerprint (SHA256:…). */
7
+ fingerprintSha256: string;
8
+ /** True when the refused connection reported a MISMATCH (key changed). */
9
+ mismatch: boolean;
10
+ onClose: () => void;
11
+ /** Called after a successful trust (retry the connection). */
12
+ onTrusted: () => void;
13
+ }
14
+ /** Confirm (or reset) one host key. */
15
+ export declare function HostFingerprintDialog({ api, alias, fingerprintSha256, mismatch, onClose, onTrusted }: HostFingerprintDialogProps): import("react").JSX.Element;
16
+ //# sourceMappingURL=HostFingerprintDialog.d.ts.map
@@ -0,0 +1,13 @@
1
+ import type { SshApi } from '../api.ts';
2
+ import type { SshHostSummary } from '../../../ssh/protocol.ts';
3
+ /** Host form dialog props. */
4
+ export interface HostFormDialogProps {
5
+ api: SshApi;
6
+ /** The host being edited; null/undefined means create. */
7
+ editing?: SshHostSummary | null;
8
+ onClose: () => void;
9
+ onSaved: (host: SshHostSummary) => void;
10
+ }
11
+ /** The create/edit host modal. */
12
+ export declare function HostFormDialog({ api, editing, onClose, onSaved }: HostFormDialogProps): import("react").JSX.Element;
13
+ //# sourceMappingURL=HostFormDialog.d.ts.map
@@ -0,0 +1,10 @@
1
+ import type { SshApi } from '../api.ts';
2
+ /** Hosts tab props. */
3
+ export interface HostsTabProps {
4
+ api: SshApi;
5
+ /** Connect the given alias in the terminal tab. */
6
+ onConnect: (alias: string) => void;
7
+ }
8
+ /** The hosts table plus its toolbar and dialogs. */
9
+ export declare function HostsTab({ api, onConnect }: HostsTabProps): import("react").JSX.Element;
10
+ //# sourceMappingURL=HostsTab.d.ts.map
@@ -0,0 +1,16 @@
1
+ import type { SshApi } from '../api.ts';
2
+ /** The dialog's props. */
3
+ export interface SessionSecretDialogProps {
4
+ api: SshApi;
5
+ alias: string;
6
+ /** SSH login name — rendered as user@alias. */
7
+ user?: string;
8
+ /** Which secret the connection needs. */
9
+ secret: 'password' | 'passphrase';
10
+ onClose: () => void;
11
+ /** Called after the secret was provided (retry the operation). */
12
+ onProvided: () => void;
13
+ }
14
+ /** Prompt for a session-only credential. */
15
+ export declare function SessionSecretDialog({ api, alias, user, secret, onClose, onProvided }: SessionSecretDialogProps): import("react").JSX.Element;
16
+ //# sourceMappingURL=SessionSecretDialog.d.ts.map
@@ -0,0 +1,14 @@
1
+ import type { SshApi } from '../api.ts';
2
+ import type { PanelController } from './controller.ts';
3
+ /** The panel's tab identifiers. */
4
+ export type SshTab = 'hosts' | 'terminal' | 'transfer' | 'tunnels' | 'cluster';
5
+ /** Panel shell props. */
6
+ export interface SshPanelProps {
7
+ /** The panel state owner (open/close/toggle). */
8
+ controller: PanelController;
9
+ /** The SSH API client every tab operates through. */
10
+ api: SshApi;
11
+ }
12
+ /** The tabbed SSH panel. */
13
+ export declare function SshPanel({ controller, api }: SshPanelProps): import("react").JSX.Element;
14
+ //# sourceMappingURL=SshPanel.d.ts.map
@@ -0,0 +1,12 @@
1
+ import type { SshApi } from '../api.ts';
2
+ /** Terminal tab props. */
3
+ export interface TerminalTabProps {
4
+ api: SshApi;
5
+ /** Alias preselected by a "connect" action from the hosts tab. */
6
+ presetAlias?: string;
7
+ /** Monotonic id of the connect request (re-applies presetAlias). */
8
+ requestId?: number;
9
+ }
10
+ /** The xterm terminal view. */
11
+ export declare function TerminalTab({ api, presetAlias, requestId }: TerminalTabProps): import("react").JSX.Element;
12
+ //# sourceMappingURL=TerminalTab.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { SshApi } from '../api.ts';
2
+ /** Transfer tab props. */
3
+ export interface TransferTabProps {
4
+ api: SshApi;
5
+ }
6
+ /** The upload/download tab. */
7
+ export declare function TransferTab({ api }: TransferTabProps): import("react").JSX.Element;
8
+ //# sourceMappingURL=TransferTab.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { SshApi } from '../api.ts';
2
+ /** Tunnels tab props. */
3
+ export interface TunnelsTabProps {
4
+ api: SshApi;
5
+ }
6
+ /** The tunnels tab. */
7
+ export declare function TunnelsTab({ api }: TunnelsTabProps): import("react").JSX.Element;
8
+ //# sourceMappingURL=TunnelsTab.d.ts.map
@@ -0,0 +1,23 @@
1
+ /**
2
+ * SSH panel controller: the single owner of the panel's open/closed state.
3
+ *
4
+ * Framework-free (structural runtime faces, task-board core/controller.ts
5
+ * style) so the DOM mounts and the React panel share one tiny subscription
6
+ * surface. The state lives only for the browser session (no persistence).
7
+ */
8
+ /** Immutable controller snapshot for UI subscriptions. */
9
+ export interface PanelControllerSnapshot {
10
+ panelOpen: boolean;
11
+ }
12
+ /** The panel state owner the sidebar entry toggles and the view renders from. */
13
+ export declare class PanelController {
14
+ private panelOpen;
15
+ private listeners;
16
+ getSnapshot(): PanelControllerSnapshot;
17
+ subscribe(fn: () => void): () => void;
18
+ open(): void;
19
+ close(): void;
20
+ toggle(): void;
21
+ private notify;
22
+ }
23
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Shared panel helpers: the active-dictionary pick (document-language based,
3
+ * task-board precedent) bound to the dsh-ssh interpolator in locales.ts, plus
4
+ * a small error-message extractor. All copy stays in the locale dictionaries.
5
+ */
6
+ import { type SshKey } from '../locales.ts';
7
+ /** Template values accepted by the interpolator. */
8
+ export type TranslateValues = Record<string, string | number>;
9
+ /** Active dictionary, picked by the document language at call time. */
10
+ export declare function dictionary(): Record<string, string>;
11
+ /** Translate a key with optional {name} template params (current language). */
12
+ export declare function tt(key: SshKey, values?: TranslateValues): string;
13
+ /** Human-readable error text from an unknown thrown value. */
14
+ export declare function errorMessage(error: unknown): string;
15
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** xterm.css text embedded at build-authoring time (the ?raw suffix is not resolvable by the tsdown/rolldown pipeline). Generated file — see the package docs. */
2
+ export declare const XTERM_CSS: string;
3
+ //# sourceMappingURL=xterm.css.d.ts.map