dsh-remote-vs 0.27.0 → 0.29.0

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 (67) hide show
  1. package/README.en.md +159 -23
  2. package/README.md +123 -23
  3. package/lib/client.js +6906 -6619
  4. package/lib/index.js +2014 -67
  5. package/lib/types/changes/recorder.d.ts +119 -2
  6. package/lib/types/client/CodeEditor.d.ts +15 -0
  7. package/lib/types/client/HostsView.d.ts +139 -2
  8. package/lib/types/client/api.d.ts +42 -2
  9. package/lib/types/client/changes/apply-failure.d.ts +41 -0
  10. package/lib/types/client/changes/block-confirm.d.ts +97 -0
  11. package/lib/types/client/changes/diff-outcome.d.ts +56 -0
  12. package/lib/types/client/changes/freshness.d.ts +51 -0
  13. package/lib/types/client/changes/model.d.ts +19 -1
  14. package/lib/types/client/changes/session-diff.d.ts +100 -0
  15. package/lib/types/client/changes/staleness.d.ts +98 -0
  16. package/lib/types/client/changes/turn-reverted.d.ts +82 -0
  17. package/lib/types/client/changes/turn-view.d.ts +131 -0
  18. package/lib/types/client/changes/undo-affordance.d.ts +44 -10
  19. package/lib/types/client/changes/undo-target.d.ts +12 -0
  20. package/lib/types/client/connection.d.ts +28 -1
  21. package/lib/types/client/i18n.d.ts +1 -1
  22. package/lib/types/client/store.d.ts +91 -1
  23. package/lib/types/client/vsc/change-marks.d.ts +21 -0
  24. package/lib/types/forward.d.ts +11 -1
  25. package/lib/types/pool.d.ts +95 -1
  26. package/lib/types/protocol.d.ts +221 -1
  27. package/lib/types/proxy.d.ts +136 -0
  28. package/lib/types/store.d.ts +81 -1
  29. package/lib/types/tools.d.ts +3 -0
  30. package/package.json +1 -1
  31. package/src/changes/recorder.ts +851 -8
  32. package/src/client/CodeEditor.tsx +43 -3
  33. package/src/client/ConnectionStatus.tsx +19 -5
  34. package/src/client/EditorPane.tsx +64 -7
  35. package/src/client/HostsView.tsx +552 -11
  36. package/src/client/PortsView.tsx +16 -0
  37. package/src/client/SettingsHosts.tsx +132 -6
  38. package/src/client/api.ts +60 -3
  39. package/src/client/changes/ChangesDock.tsx +539 -54
  40. package/src/client/changes/apply-failure.ts +73 -0
  41. package/src/client/changes/block-confirm.ts +180 -0
  42. package/src/client/changes/changes.css +45 -0
  43. package/src/client/changes/diff-outcome.ts +97 -0
  44. package/src/client/changes/freshness.ts +68 -0
  45. package/src/client/changes/model.ts +56 -1
  46. package/src/client/changes/session-diff.ts +187 -0
  47. package/src/client/changes/staleness.ts +148 -0
  48. package/src/client/changes/turn-reverted.ts +254 -0
  49. package/src/client/changes/turn-view.ts +195 -0
  50. package/src/client/changes/undo-affordance.ts +295 -63
  51. package/src/client/changes/undo-target.ts +12 -0
  52. package/src/client/connection.ts +76 -2
  53. package/src/client/i18n.ts +204 -4
  54. package/src/client/scm/DiffView.tsx +32 -13
  55. package/src/client/store.tsx +392 -16
  56. package/src/client/vsc/change-marks.ts +21 -0
  57. package/src/client/vsc/preview-document.tsx +4 -1
  58. package/src/client/vsc/vsc.css +6747 -6509
  59. package/src/forward.ts +38 -2
  60. package/src/importers.ts +125 -13
  61. package/src/keygen.ts +8 -1
  62. package/src/pool.ts +422 -27
  63. package/src/protocol.ts +229 -1
  64. package/src/proxy.ts +673 -0
  65. package/src/routes.ts +93 -14
  66. package/src/store.ts +335 -0
  67. package/src/tools.ts +47 -2
package/src/tools.ts CHANGED
@@ -8,7 +8,7 @@ import type { ContentBlock } from '@deepseek-ai/dsh-llm'
8
8
  import type { RemotePool } from './pool.ts'
9
9
  import { RemoteFiles } from './sftp.ts'
10
10
  import type { RemoteStore } from './store.ts'
11
- import type { RemoteExecResult, RemoteHostSummary } from './protocol.ts'
11
+ import type { RemoteExecResult, RemoteHostProxyView, RemoteHostSummary } from './protocol.ts'
12
12
  import { clampExecTimeout, MAX_TIMEOUT_MS } from './timeouts.ts'
13
13
 
14
14
  function text(value: string): ContentBlock[] {
@@ -26,6 +26,8 @@ export interface AgentHostRow {
26
26
  managedKey: boolean
27
27
  description?: string
28
28
  tags: string[]
29
+ /** Effective network route (secret-free), as the host list reports it. */
30
+ proxy: RemoteHostProxyView
29
31
  createdAt: number
30
32
  updatedAt: number
31
33
  }
@@ -41,11 +43,28 @@ function toAgentHostRow(host: RemoteHostSummary): AgentHostRow {
41
43
  managedKey: host.managedKey,
42
44
  ...(host.description !== undefined ? { description: host.description } : {}),
43
45
  tags: [...host.tags],
46
+ proxy: host.proxy,
44
47
  createdAt: host.createdAt,
45
48
  updatedAt: host.updatedAt,
46
49
  }
47
50
  }
48
51
 
52
+ /**
53
+ * One-line description of a host's effective route, for the agent table.
54
+ *
55
+ * `problem` is part of the value (not a separate column): a host whose jump target
56
+ * was deleted is still listed, and the caller must see why it would fail.
57
+ */
58
+ function proxyLabel(proxy: RemoteHostProxyView): string {
59
+ const target = proxy.target === undefined ? '' : ` ${proxy.target.host}:${proxy.target.port}`
60
+ const route = proxy.mode === 'proxy'
61
+ ? `proxy${target}`
62
+ : proxy.mode === 'jump'
63
+ ? `jump ${proxy.jumpVia ?? '?'}`
64
+ : proxy.mode
65
+ return proxy.problem === undefined ? route : `${route} (problem: ${proxy.problem})`
66
+ }
67
+
49
68
  /**
50
69
  * Render the host table.
51
70
  *
@@ -63,10 +82,15 @@ function renderHosts(hosts: RemoteHostSummary[], query?: string): string {
63
82
  const rows = hosts.map(h => [
64
83
  h.alias, h.host, String(h.port), h.user, h.auth,
65
84
  h.auth === 'key' ? (h.keyReady ? 'key-ok' : 'key-missing') : 'password',
85
+ proxyLabel(h.proxy),
66
86
  h.tags.length > 0 ? h.tags.join(',') : '-',
67
87
  h.description ?? '',
68
88
  ].join(' | '))
69
- return ['alias | host | port | user | auth | key | tags | description', '--- | --- | --- | --- | --- | --- | --- | ---', ...rows].join('\n')
89
+ return [
90
+ 'alias | host | port | user | auth | key | proxy | tags | description',
91
+ '--- | --- | --- | --- | --- | --- | --- | --- | ---',
92
+ ...rows,
93
+ ].join('\n')
70
94
  }
71
95
 
72
96
  /**
@@ -139,6 +163,27 @@ export function remoteHostsTool(deps: RemoteToolsDeps): ReturnType<typeof define
139
163
  managedKey: { type: 'boolean', required: true },
140
164
  description: { type: 'string' },
141
165
  tags: { type: 'array', items: { type: 'string' }, required: true },
166
+ proxy: {
167
+ type: 'object',
168
+ additionalProperties: false,
169
+ required: true,
170
+ properties: {
171
+ mode: { type: 'string', enum: ['inherit', 'direct', 'proxy', 'jump'], required: true },
172
+ target: {
173
+ type: 'object',
174
+ additionalProperties: false,
175
+ properties: {
176
+ kind: { type: 'string', enum: ['http', 'socks5'], required: true },
177
+ host: { type: 'string', required: true },
178
+ port: { type: 'integer', required: true },
179
+ username: { type: 'string' },
180
+ hasPassword: { type: 'boolean', required: true },
181
+ },
182
+ },
183
+ jumpVia: { type: 'string' },
184
+ problem: { type: 'string' },
185
+ },
186
+ },
142
187
  createdAt: { type: 'integer', required: true },
143
188
  updatedAt: { type: 'integer', required: true },
144
189
  },