dsh-over-ssh 0.0.0-stage → 0.1.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 (254) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +119 -2
  3. package/agents/agent-manifest.json +20 -0
  4. package/agents/linux-amd64/dsh-over-ssh-agent +0 -0
  5. package/agents/linux-arm64/dsh-over-ssh-agent +0 -0
  6. package/cordis.patch.yml +84 -0
  7. package/lib/client.js +6611 -0
  8. package/lib/file-references.js +366 -0
  9. package/lib/fs.js +1368 -0
  10. package/lib/index.js +19034 -0
  11. package/lib/local-bridge-refs.js +16 -0
  12. package/lib/local-bridge.js +16 -0
  13. package/lib/terminal-wrapper.js +294 -0
  14. package/lib/types/src/client/controls.d.ts +131 -0
  15. package/lib/types/src/client/core/card-focus-trap.d.ts +45 -0
  16. package/lib/types/src/client/core/controls.d.ts +164 -0
  17. package/lib/types/src/client/core/latest.d.ts +48 -0
  18. package/lib/types/src/client/core/locale.d.ts +38 -0
  19. package/lib/types/src/client/core/message.d.ts +37 -0
  20. package/lib/types/src/client/core/panel-model.d.ts +134 -0
  21. package/lib/types/src/client/core/portal.d.ts +266 -0
  22. package/lib/types/src/client/core/remote.d.ts +84 -0
  23. package/lib/types/src/client/core/styles.d.ts +458 -0
  24. package/lib/types/src/client/file-tree-io.d.ts +19 -0
  25. package/lib/types/src/client/file-tree.d.ts +271 -0
  26. package/lib/types/src/client/flows/directory-browser.d.ts +587 -0
  27. package/lib/types/src/client/flows/session-directory.d.ts +415 -0
  28. package/lib/types/src/client/flows/workspace-directory-flow.d.ts +480 -0
  29. package/lib/types/src/client/index.d.ts +49 -0
  30. package/lib/types/src/client/locale.d.ts +31 -0
  31. package/lib/types/src/client/panel-model.d.ts +37 -0
  32. package/lib/types/src/client/panel.d.ts +77 -0
  33. package/lib/types/src/client/roots/connection-test.d.ts +69 -0
  34. package/lib/types/src/client/roots/roots-panel-state.d.ts +307 -0
  35. package/lib/types/src/client/roots/roots-panel-view.d.ts +280 -0
  36. package/lib/types/src/client/roots/roots-panel.d.ts +364 -0
  37. package/lib/types/src/client/roots/transfer-panel-view.d.ts +35 -0
  38. package/lib/types/src/client/roots/transfer-panel.d.ts +241 -0
  39. package/lib/types/src/client/roots/transfer-progress.d.ts +67 -0
  40. package/lib/types/src/client/roots-panel-view.d.ts +236 -0
  41. package/lib/types/src/client/roots-panel.d.ts +347 -0
  42. package/lib/types/src/client/session/session-panel-view.d.ts +336 -0
  43. package/lib/types/src/client/session/session-panel.d.ts +322 -0
  44. package/lib/types/src/client/session/session-remote-mark.d.ts +110 -0
  45. package/lib/types/src/client/session/session-row-actions.d.ts +398 -0
  46. package/lib/types/src/client/session-panel.d.ts +152 -0
  47. package/lib/types/src/client/styles.d.ts +252 -0
  48. package/lib/types/src/client/workspace-directory-flow.d.ts +342 -0
  49. package/lib/types/src/config.d.ts +312 -0
  50. package/lib/types/src/file-references.d.ts +25 -0
  51. package/lib/types/src/fs.d.ts +46 -0
  52. package/lib/types/src/host/app/backend.d.ts +170 -0
  53. package/lib/types/src/host/app/recycle-bin/recycle-bin-contract.d.ts +247 -0
  54. package/lib/types/src/host/app/recycle-bin/recycle-bin-move.d.ts +18 -0
  55. package/lib/types/src/host/app/recycle-bin/recycle-bin-service.d.ts +45 -0
  56. package/lib/types/src/host/app/recycle-bin/recycle-bin-world.d.ts +38 -0
  57. package/lib/types/src/host/app/recycle-bin-contract.d.ts +215 -0
  58. package/lib/types/src/host/app/recycle-bin-move.d.ts +18 -0
  59. package/lib/types/src/host/app/recycle-bin-service.d.ts +45 -0
  60. package/lib/types/src/host/app/recycle-bin-world.d.ts +35 -0
  61. package/lib/types/src/host/app/roots/roots-api-connections.d.ts +49 -0
  62. package/lib/types/src/host/app/roots/roots-api-contract.d.ts +369 -0
  63. package/lib/types/src/host/app/roots/roots-api-directories.d.ts +13 -0
  64. package/lib/types/src/host/app/roots/roots-api-http.d.ts +77 -0
  65. package/lib/types/src/host/app/roots/roots-api-long-poll.d.ts +130 -0
  66. package/lib/types/src/host/app/roots/roots-api-projections.d.ts +102 -0
  67. package/lib/types/src/host/app/roots/roots-api-roots.d.ts +13 -0
  68. package/lib/types/src/host/app/roots/roots-api-state.d.ts +22 -0
  69. package/lib/types/src/host/app/roots/roots-api-transfers.d.ts +26 -0
  70. package/lib/types/src/host/app/roots/roots-api.d.ts +55 -0
  71. package/lib/types/src/host/app/roots/user-roots.d.ts +552 -0
  72. package/lib/types/src/host/app/roots-api-connections.d.ts +49 -0
  73. package/lib/types/src/host/app/roots-api-contract.d.ts +339 -0
  74. package/lib/types/src/host/app/roots-api-directories.d.ts +13 -0
  75. package/lib/types/src/host/app/roots-api-http.d.ts +77 -0
  76. package/lib/types/src/host/app/roots-api-projections.d.ts +102 -0
  77. package/lib/types/src/host/app/roots-api-roots.d.ts +13 -0
  78. package/lib/types/src/host/app/roots-api-state.d.ts +22 -0
  79. package/lib/types/src/host/app/roots-api-support.d.ts +182 -0
  80. package/lib/types/src/host/app/roots-api-transfers.d.ts +13 -0
  81. package/lib/types/src/host/app/roots-api.d.ts +55 -0
  82. package/lib/types/src/host/app/routed-fs.d.ts +239 -0
  83. package/lib/types/src/host/app/serialize.d.ts +37 -0
  84. package/lib/types/src/host/app/session-admin/session-admin-context.d.ts +36 -0
  85. package/lib/types/src/host/app/session-admin/session-admin-contract.d.ts +221 -0
  86. package/lib/types/src/host/app/session-admin/session-admin-delete.d.ts +34 -0
  87. package/lib/types/src/host/app/session-admin/session-admin-service.d.ts +40 -0
  88. package/lib/types/src/host/app/session-admin-context.d.ts +36 -0
  89. package/lib/types/src/host/app/session-admin-contract.d.ts +214 -0
  90. package/lib/types/src/host/app/session-admin-delete.d.ts +34 -0
  91. package/lib/types/src/host/app/session-admin-service.d.ts +38 -0
  92. package/lib/types/src/host/app/takeover/takeover-plan.d.ts +227 -0
  93. package/lib/types/src/host/app/takeover/takeover-rows.d.ts +55 -0
  94. package/lib/types/src/host/app/transport/transport-selector.d.ts +98 -0
  95. package/lib/types/src/host/app/transport/transport-service.d.ts +82 -0
  96. package/lib/types/src/host/app/transport-selector.d.ts +98 -0
  97. package/lib/types/src/host/app/transport-service.d.ts +75 -0
  98. package/lib/types/src/host/app/user-roots.d.ts +461 -0
  99. package/lib/types/src/host/domain/bin-location.d.ts +79 -0
  100. package/lib/types/src/host/domain/capability.d.ts +78 -0
  101. package/lib/types/src/host/domain/connection.d.ts +95 -0
  102. package/lib/types/src/host/domain/errors.d.ts +55 -0
  103. package/lib/types/src/host/domain/glob-pattern.d.ts +62 -0
  104. package/lib/types/src/host/domain/literal-text.d.ts +63 -0
  105. package/lib/types/src/host/domain/path-grammar.d.ts +84 -0
  106. package/lib/types/src/host/domain/recycle-bin.d.ts +337 -0
  107. package/lib/types/src/host/domain/root.d.ts +74 -0
  108. package/lib/types/src/host/domain/roots/bin-location.d.ts +91 -0
  109. package/lib/types/src/host/domain/roots/connection.d.ts +106 -0
  110. package/lib/types/src/host/domain/roots/root.d.ts +108 -0
  111. package/lib/types/src/host/domain/roots/route-table.d.ts +102 -0
  112. package/lib/types/src/host/domain/roots/session-roots.d.ts +151 -0
  113. package/lib/types/src/host/domain/roots/ssh-config.d.ts +73 -0
  114. package/lib/types/src/host/domain/route-table.d.ts +80 -0
  115. package/lib/types/src/host/domain/session/session-admin.d.ts +345 -0
  116. package/lib/types/src/host/domain/session/terminal-target.d.ts +136 -0
  117. package/lib/types/src/host/domain/session-admin.d.ts +330 -0
  118. package/lib/types/src/host/domain/shell.d.ts +47 -0
  119. package/lib/types/src/host/domain/ssh-config.d.ts +73 -0
  120. package/lib/types/src/host/domain/terminal-target.d.ts +132 -0
  121. package/lib/types/src/host/domain/tool-requests.d.ts +369 -0
  122. package/lib/types/src/host/domain/transfer/recycle-bin.d.ts +337 -0
  123. package/lib/types/src/host/domain/transfer/transfer.d.ts +260 -0
  124. package/lib/types/src/host/domain/transfer.d.ts +260 -0
  125. package/lib/types/src/host/infra/backend/local-backend.d.ts +84 -0
  126. package/lib/types/src/host/infra/backend/local-version.d.ts +43 -0
  127. package/lib/types/src/host/infra/backend/platform-local-backend.d.ts +89 -0
  128. package/lib/types/src/host/infra/backend/remote-backend.d.ts +239 -0
  129. package/lib/types/src/host/infra/cache/lru.d.ts +52 -0
  130. package/lib/types/src/host/infra/cache/versioned.d.ts +77 -0
  131. package/lib/types/src/host/infra/temp-name.d.ts +19 -0
  132. package/lib/types/src/host/infra/transport/agent/agent-installer.d.ts +121 -0
  133. package/lib/types/src/host/infra/transport/agent/agent-protocol-client.d.ts +132 -0
  134. package/lib/types/src/host/infra/transport/agent/agent-protocol-codec.d.ts +140 -0
  135. package/lib/types/src/host/infra/transport/agent/agent-protocol-errors.d.ts +41 -0
  136. package/lib/types/src/host/infra/transport/agent/agent-protocol-frames.d.ts +197 -0
  137. package/lib/types/src/host/infra/transport/agent/agent-protocol-types.d.ts +564 -0
  138. package/lib/types/src/host/infra/transport/agent/agent-transport.d.ts +418 -0
  139. package/lib/types/src/host/infra/transport/agent-installer.d.ts +121 -0
  140. package/lib/types/src/host/infra/transport/agent-protocol-client.d.ts +123 -0
  141. package/lib/types/src/host/infra/transport/agent-protocol-codec.d.ts +131 -0
  142. package/lib/types/src/host/infra/transport/agent-protocol-errors.d.ts +41 -0
  143. package/lib/types/src/host/infra/transport/agent-protocol-frames.d.ts +197 -0
  144. package/lib/types/src/host/infra/transport/agent-protocol-types.d.ts +509 -0
  145. package/lib/types/src/host/infra/transport/agent-transport.d.ts +353 -0
  146. package/lib/types/src/host/infra/transport/alias-transport.d.ts +206 -0
  147. package/lib/types/src/host/infra/transport/askpass-fs.d.ts +20 -0
  148. package/lib/types/src/host/infra/transport/askpass.d.ts +133 -0
  149. package/lib/types/src/host/infra/transport/command-pool.d.ts +61 -0
  150. package/lib/types/src/host/infra/transport/fs-commands.d.ts +140 -0
  151. package/lib/types/src/host/infra/transport/git-status-route.d.ts +63 -0
  152. package/lib/types/src/host/infra/transport/git-status.d.ts +101 -0
  153. package/lib/types/src/host/infra/transport/node-spawn.d.ts +26 -0
  154. package/lib/types/src/host/infra/transport/session-window.d.ts +51 -0
  155. package/lib/types/src/host/infra/transport/shell-quote.d.ts +59 -0
  156. package/lib/types/src/host/infra/transport/ssh/alias-transport.d.ts +206 -0
  157. package/lib/types/src/host/infra/transport/ssh/askpass-fs.d.ts +20 -0
  158. package/lib/types/src/host/infra/transport/ssh/askpass.d.ts +133 -0
  159. package/lib/types/src/host/infra/transport/ssh/shell-quote.d.ts +62 -0
  160. package/lib/types/src/host/infra/transport/ssh/ssh-argv.d.ts +43 -0
  161. package/lib/types/src/host/infra/transport/ssh/ssh2-transport.d.ts +328 -0
  162. package/lib/types/src/host/infra/transport/ssh-argv.d.ts +43 -0
  163. package/lib/types/src/host/infra/transport/ssh2-transport.d.ts +302 -0
  164. package/lib/types/src/host/infra/transport/transport-base.d.ts +34 -0
  165. package/lib/types/src/host/infra/transport/transport.d.ts +527 -0
  166. package/lib/types/src/host/integration/agent/agent-install-io.d.ts +33 -0
  167. package/lib/types/src/host/integration/agent/agent-preflight.d.ts +56 -0
  168. package/lib/types/src/host/integration/agent/askpass-registry.d.ts +66 -0
  169. package/lib/types/src/host/integration/agent-install-io.d.ts +33 -0
  170. package/lib/types/src/host/integration/agent-preflight.d.ts +56 -0
  171. package/lib/types/src/host/integration/anchor-directory.d.ts +56 -0
  172. package/lib/types/src/host/integration/askpass-registry.d.ts +59 -0
  173. package/lib/types/src/host/integration/bin-root-resolver.d.ts +81 -0
  174. package/lib/types/src/host/integration/connection-test.d.ts +73 -0
  175. package/lib/types/src/host/integration/file-reference-provider.d.ts +115 -0
  176. package/lib/types/src/host/integration/fs/file-reference-provider.d.ts +142 -0
  177. package/lib/types/src/host/integration/fs/fs-provider.d.ts +368 -0
  178. package/lib/types/src/host/integration/fs/git-status-wiring.d.ts +21 -0
  179. package/lib/types/src/host/integration/fs/platform-errors.d.ts +94 -0
  180. package/lib/types/src/host/integration/fs/remote-file-tools.d.ts +369 -0
  181. package/lib/types/src/host/integration/fs/remote-index.d.ts +177 -0
  182. package/lib/types/src/host/integration/fs-provider.d.ts +226 -0
  183. package/lib/types/src/host/integration/lsp/lsp-framing.d.ts +38 -0
  184. package/lib/types/src/host/integration/lsp/lsp-registry.d.ts +67 -0
  185. package/lib/types/src/host/integration/lsp/lsp-session.d.ts +130 -0
  186. package/lib/types/src/host/integration/management-tools.d.ts +64 -0
  187. package/lib/types/src/host/integration/recycle-bin-service.d.ts +247 -0
  188. package/lib/types/src/host/integration/remote/connection-test.d.ts +73 -0
  189. package/lib/types/src/host/integration/remote/remote-face.d.ts +127 -0
  190. package/lib/types/src/host/integration/remote/remote-tool-backend.d.ts +108 -0
  191. package/lib/types/src/host/integration/remote-face.d.ts +127 -0
  192. package/lib/types/src/host/integration/remote-file-tools.d.ts +241 -0
  193. package/lib/types/src/host/integration/remote-home.d.ts +69 -0
  194. package/lib/types/src/host/integration/remote-index.d.ts +165 -0
  195. package/lib/types/src/host/integration/remote-job-tools.d.ts +295 -0
  196. package/lib/types/src/host/integration/remote-tool-backend.d.ts +97 -0
  197. package/lib/types/src/host/integration/remote-tools.d.ts +206 -0
  198. package/lib/types/src/host/integration/root-registry.d.ts +115 -0
  199. package/lib/types/src/host/integration/roots/anchor-directory.d.ts +56 -0
  200. package/lib/types/src/host/integration/roots/bin-root-resolver.d.ts +81 -0
  201. package/lib/types/src/host/integration/roots/remote-home.d.ts +69 -0
  202. package/lib/types/src/host/integration/roots/root-registry.d.ts +144 -0
  203. package/lib/types/src/host/integration/roots/roots-wiring.d.ts +219 -0
  204. package/lib/types/src/host/integration/roots/session-root-index.d.ts +52 -0
  205. package/lib/types/src/host/integration/roots-api.d.ts +407 -0
  206. package/lib/types/src/host/integration/roots-wiring.d.ts +211 -0
  207. package/lib/types/src/host/integration/session/session-api.d.ts +88 -0
  208. package/lib/types/src/host/integration/session/session-bin-lock.d.ts +80 -0
  209. package/lib/types/src/host/integration/session/session-header.d.ts +151 -0
  210. package/lib/types/src/host/integration/session/session-labels.d.ts +56 -0
  211. package/lib/types/src/host/integration/session/session-route-wiring.d.ts +50 -0
  212. package/lib/types/src/host/integration/session-admin-service.d.ts +236 -0
  213. package/lib/types/src/host/integration/session-api.d.ts +81 -0
  214. package/lib/types/src/host/integration/session-bin-lock.d.ts +80 -0
  215. package/lib/types/src/host/integration/session-header.d.ts +118 -0
  216. package/lib/types/src/host/integration/session-labels.d.ts +56 -0
  217. package/lib/types/src/host/integration/session-route-wiring.d.ts +50 -0
  218. package/lib/types/src/host/integration/session-scope.d.ts +113 -0
  219. package/lib/types/src/host/integration/session-tools.d.ts +44 -0
  220. package/lib/types/src/host/integration/strict-arguments.d.ts +79 -0
  221. package/lib/types/src/host/integration/takeover/takeover-api.d.ts +62 -0
  222. package/lib/types/src/host/integration/takeover/takeover-route-wiring.d.ts +60 -0
  223. package/lib/types/src/host/integration/takeover/takeover-service.d.ts +167 -0
  224. package/lib/types/src/host/integration/terminal-manifest.d.ts +94 -0
  225. package/lib/types/src/host/integration/tools/management-tools.d.ts +245 -0
  226. package/lib/types/src/host/integration/tools/remote-job-tools.d.ts +316 -0
  227. package/lib/types/src/host/integration/tools/remote-lsp-tools.d.ts +43 -0
  228. package/lib/types/src/host/integration/tools/remote-tools.d.ts +236 -0
  229. package/lib/types/src/host/integration/tools/session-target.d.ts +52 -0
  230. package/lib/types/src/host/integration/tools/session-tools.d.ts +46 -0
  231. package/lib/types/src/host/integration/tools/strict-arguments.d.ts +79 -0
  232. package/lib/types/src/host/integration/tools/terminal-manifest.d.ts +94 -0
  233. package/lib/types/src/host/integration/transfer/remote-copy.d.ts +66 -0
  234. package/lib/types/src/host/integration/transfer/transfer-adapters.d.ts +48 -0
  235. package/lib/types/src/host/integration/transfer/transfer-service.d.ts +212 -0
  236. package/lib/types/src/host/integration/transfer/transfer-tracker.d.ts +106 -0
  237. package/lib/types/src/host/integration/transfer-adapters.d.ts +44 -0
  238. package/lib/types/src/host/integration/transfer-service.d.ts +164 -0
  239. package/lib/types/src/host/integration/transfer-tracker.d.ts +106 -0
  240. package/lib/types/src/host/integration/user-roots.d.ts +461 -0
  241. package/lib/types/src/index.d.ts +66 -0
  242. package/lib/types/src/local-bridge-refs.d.ts +26 -0
  243. package/lib/types/src/local-bridge.d.ts +36 -0
  244. package/lib/types/src/shared/format.d.ts +13 -0
  245. package/lib/types/src/wiring/connections.d.ts +189 -0
  246. package/lib/types/src/wiring/fs.d.ts +13 -0
  247. package/lib/types/src/wiring/helpers.d.ts +144 -0
  248. package/lib/types/src/wiring/install-memo.d.ts +32 -0
  249. package/lib/types/src/wiring/legacy-dirs.d.ts +62 -0
  250. package/lib/types/src/wiring/package-paths.d.ts +35 -0
  251. package/lib/types/src/wiring/roots.d.ts +21 -0
  252. package/lib/types/src/wiring/state-dir.d.ts +29 -0
  253. package/lib/types/src/wiring/tools.d.ts +35 -0
  254. package/package.json +120 -4
@@ -0,0 +1,35 @@
1
+ /**
2
+ * 传输面板:进度列表、**长轮询驱动**与文案。
3
+ *
4
+ * 从 `roots-panel-view.ts` 抽出(审计 0076);task-19 把定时轮询换成「回答一到就再问一次」的
5
+ * 长轮询循环,循环本身在 `transfer-progress.ts`(可注入时钟,因此可在离线测试里驱动)。
6
+ *
7
+ * 容器只做三件事:建 io、把 controller 挂到 React 生命周期、把状态与回调交给纯模板。
8
+ *
9
+ * @module dsh-over-ssh/client/transfer-panel-view
10
+ */
11
+ import { type ReactNode } from 'react';
12
+ import type { RootsPanelCopy, RootsPanelState } from './roots-panel-state.ts';
13
+ /**
14
+ * The panel, driven by {@link createTransferProgress}.
15
+ *
16
+ * `state` is accepted but not read: the panel's own snapshot is what it renders, and the roots state it used to
17
+ * receive was never read either (the prop is kept so the section's call site does not have to change).
18
+ *
19
+ * @param props - the dictionary (the section's `state` is unused).
20
+ * @returns the transfer section.
21
+ */
22
+ export declare function TransferProgressSection({ copy }: {
23
+ readonly copy: RootsPanelCopy;
24
+ readonly state?: RootsPanelState;
25
+ }): ReactNode;
26
+ /**
27
+ * The tree's strings, read out of the panel's dictionary.
28
+ *
29
+ * Kept as an explicit projection rather than passing the dictionary itself: the tree's copy type is its own
30
+ * contract, so a key it needs and the dictionary does not have is a compile error here, not a blank label at
31
+ * runtime.
32
+ *
33
+ * @param copy - the panel's dictionary.
34
+ * @returns the tree's strings.
35
+ */
@@ -0,0 +1,241 @@
1
+ /**
2
+ * The transfer progress panel (FR-2.6.4): rate, bytes done, time left, and the failure list.
3
+ *
4
+ * The client **polls** rather than subscribes: this plugin's client half talks to the host over one HTTP route,
5
+ * so "what is transferring" is a question it asks. Polling only while the panel is mounted is what keeps that
6
+ * from being a permanent request loop.
7
+ *
8
+ * Two rules it inherits from the rest of this half:
9
+ *
10
+ * - the answer is narrowed field by field (the wire is not trusted), and
11
+ * - **nothing is inferred**: an unknown status is `running`, an unknown direction is `upload`, and a missing
12
+ * `remainingMs` renders as "unknown" rather than as a guess.
13
+ *
14
+ * @module dsh-over-ssh/client/transfer-panel
15
+ */
16
+ import { type ReactNode } from 'react';
17
+ import { type MessageKey } from '../core/message.ts';
18
+ import { type ApiResult, type FetchLike } from './roots-panel.ts';
19
+ /** One tracked transfer, as the panel renders it. */
20
+ export interface TransferRow {
21
+ readonly id: string;
22
+ readonly direction: 'upload' | 'download';
23
+ readonly connectionId: string;
24
+ readonly remotePath: string;
25
+ readonly localPath: string;
26
+ readonly status: 'running' | 'done' | 'failed' | 'cancelled';
27
+ readonly transferredBytes: number;
28
+ readonly totalBytes: number;
29
+ readonly percent: number;
30
+ readonly bytesPerSecond: number;
31
+ readonly elapsedMs: number;
32
+ readonly remainingMs: number | null;
33
+ readonly error?: string;
34
+ readonly errorCode?: string;
35
+ }
36
+ /** How one snapshot may be asked for. */
37
+ export interface TransferListOptions {
38
+ /**
39
+ * Host-side long-poll budget: the host parks the request until the table changes or this many milliseconds pass.
40
+ *
41
+ * Omitted/0 answers immediately (the pre-task-19 behaviour) — which is what a **user refresh** wants, because the
42
+ * user is waiting for an answer now, not for a change.
43
+ */
44
+ readonly waitMs?: number;
45
+ /** Abort the request (panel unmount, or a user refresh superseding a parked one). */
46
+ readonly signal?: AbortSignal;
47
+ }
48
+ /** The calls the panel makes. Injected, so the model is testable with no server. */
49
+ export interface TransferPanelIo {
50
+ list(options?: TransferListOptions): Promise<ApiResult<readonly TransferRow[]>>;
51
+ clear(): Promise<ApiResult<number>>;
52
+ }
53
+ /**
54
+ * Narrow one `list-transfers` answer.
55
+ *
56
+ * @param value - the parsed body.
57
+ * @returns the rows, with unusable entries dropped.
58
+ */
59
+ export declare function parseTransferRows(value: unknown): readonly TransferRow[];
60
+ /**
61
+ * The rows still worth showing: everything running, plus the most recent finished ones.
62
+ *
63
+ * A cap on finished rows because the requirement's "failure list" is a list of *recent* problems; the host keeps
64
+ * the full history, and the panel's job is to be readable.
65
+ *
66
+ * @param rows - every row the host reported.
67
+ * @param finishedLimit - how many finished rows to keep.
68
+ * @returns the rows to render, running first.
69
+ */
70
+ export declare function visibleTransfers(rows: readonly TransferRow[], finishedLimit?: number): readonly TransferRow[];
71
+ /**
72
+ * One row's one-line summary.
73
+ *
74
+ * @param row - the transfer.
75
+ * @param format - the byte/duration formatters plus the localized direction label (injected so this stays free of
76
+ * the domain layer).
77
+ * @param copy - the sentence templates; see {@link TransferPanelCopy.summaryRunning}.
78
+ * @returns e.g. `上传 40.0%(4.0 KiB/10.0 KiB,2.0 KiB/s,剩余约 3.0s)` in Chinese, and the English template in `en`.
79
+ */
80
+ export declare function transferSummary(row: TransferRow, format: {
81
+ readonly bytes: (value: number) => string;
82
+ readonly duration: (value: number) => string;
83
+ readonly label: string;
84
+ }, copy: Pick<TransferPanelCopy, 'summaryRunning' | 'summaryDone' | 'remaining' | 'remainingUnknown'>): string;
85
+ /**
86
+ * The accessible name of one transfer's progress bar.
87
+ *
88
+ * Separate from {@link transferSummary} on purpose. The summary is the row's *visible* line, and it
89
+ * deliberately leaves the path out because the path is rendered next to it; a `<progress>` element has no
90
+ * other text of its own, so a screen reader user needs the path **inside** the bar's name. Every bar used to
91
+ * carry `copy.title` ("传输进度"), which meant N bars with N identical names and no way to tell which transfer
92
+ * was which.
93
+ *
94
+ * The target falls back to the local path when the remote one is empty, so a row can never end up with a name
95
+ * that is only a percentage.
96
+ *
97
+ * @param row - the transfer.
98
+ * @param format - the label plus the byte/duration formatters.
99
+ * @returns e.g. `上传 40.0%(400B/1000B,200B/s,剩余约 3000ms) — /srv/a.bin`.
100
+ */
101
+ export declare function transferProgressLabel(row: TransferRow, format: {
102
+ readonly bytes: (value: number) => string;
103
+ readonly duration: (value: number) => string;
104
+ readonly label: string;
105
+ }, copy: Pick<TransferPanelCopy, 'summaryRunning' | 'summaryDone' | 'remaining' | 'remainingUnknown'>): string;
106
+ /** Everything the panel renders from. */
107
+ export interface TransferPanelState {
108
+ readonly rows: readonly TransferRow[];
109
+ /**
110
+ * Why the last list read failed, **as a key the view resolves**.
111
+ *
112
+ * It used to be the raw transport string, so the failure notice printed `http-500 @ /api/over-ssh/roots`
113
+ * or `TypeError` — machine text, in both locales, naming an internal URL (audit 2026-11-01b ui P2-5).
114
+ */
115
+ readonly error?: MessageKey;
116
+ readonly loading: boolean;
117
+ /** True while the user's 「清除」 request is in flight, so the two buttons can be disabled. */
118
+ readonly clearing: boolean;
119
+ /** Why the last 「清除」 failed, as a key. Kept apart from {@link TransferPanelState.error}: one is a read, the
120
+ * other a command, and they need different sentences. */
121
+ readonly clearError?: MessageKey;
122
+ }
123
+ /**
124
+ * Turn one transport-level failure string into a sentence key.
125
+ *
126
+ * The three cases are the three things the panel can honestly say (audit 2026-11-01b ui P2-5):
127
+ *
128
+ * - a status the route answered → 「…(HTTP {status})」, the number is the useful part;
129
+ * - a transport spelling (`network`, `TypeError`, `AbortError`, `http-500 @ /api/…`) → carrying no information at
130
+ * all, so the panel says the host did not answer instead of printing the spelling;
131
+ * - anything else is the **host's own** explanation (this route answers prose for a refused capability), and that
132
+ * is the one case worth quoting.
133
+ *
134
+ * @param reason - the failure string the io produced.
135
+ * @returns the dictionary key plus its parameters.
136
+ */
137
+ export declare function transferFailureKey(reason: string): MessageKey;
138
+ /** @returns the starting state. */
139
+ export declare function initialTransferPanelState(): TransferPanelState;
140
+ /** A poll started. */
141
+ export declare function transferPanelLoading(state: TransferPanelState): TransferPanelState;
142
+ /** A poll answered. */
143
+ export declare function transferPanelLoaded(state: TransferPanelState, rows: readonly TransferRow[]): TransferPanelState;
144
+ /** A poll failed; the **last known rows stay** (a blip must not blank the panel). */
145
+ export declare function transferPanelFailed(state: TransferPanelState, error: string): TransferPanelState;
146
+ /** The user pressed 「清除」: the request is in flight and the previous clear failure is superseded. */
147
+ export declare function transferPanelClearing(state: TransferPanelState): TransferPanelState;
148
+ /** 「清除」 succeeded: the next poll shows the empty table. */
149
+ export declare function transferPanelCleared(state: TransferPanelState): TransferPanelState;
150
+ /**
151
+ * 「清除」 failed.
152
+ *
153
+ * It used to be dropped on the floor (`void io.clear().then(...)` had no failure branch), so the button did
154
+ * nothing at all on a refusal and the user could click it again and again (audit 2026-11-01b ui P2-5).
155
+ */
156
+ export declare function transferPanelClearFailed(state: TransferPanelState, error: string): TransferPanelState;
157
+ /**
158
+ * The state a poll starts from.
159
+ *
160
+ * `showLoading` separates the user's own action from the timer, and that distinction is the whole point: the
161
+ * view renders a **visible** "reading…" notice for `loading` (`TransferPanelSection`), so a background poll
162
+ * that raised it made the panel alternate between "reading…" and "nothing is transferring" once a second while
163
+ * nothing was happening (audit 0057). Only opening the panel or pressing refresh asks to be seen doing it.
164
+ *
165
+ * A named function rather than an `if` inside the component because this repository's tests render no hooks: a
166
+ * branch buried in a `useEffect` cannot be executed by a test, so the decision lives out here where it can be
167
+ * (removing that branch used to leave every test green).
168
+ *
169
+ * @param state - the current panel state.
170
+ * @param showLoading - `true` when the user asked for this poll.
171
+ * @returns the state to render while the request is in flight.
172
+ */
173
+ export declare function transferPanelPollStarted(state: TransferPanelState, showLoading: boolean): TransferPanelState;
174
+ /**
175
+ * Bind the panel to the route.
176
+ *
177
+ * @param fetchImpl - `window.fetch` in the app, a stub in tests.
178
+ * @param path - override for tests.
179
+ * @returns the two calls the panel makes.
180
+ */
181
+ export declare function createTransferPanelIo(fetchImpl: FetchLike, path?: string): TransferPanelIo;
182
+ /** The strings the panel renders. */
183
+ export interface TransferPanelCopy {
184
+ readonly title: string;
185
+ /** The panel's description line (it existed as a locale key and was never rendered). */
186
+ readonly description: string;
187
+ readonly empty: string;
188
+ readonly loading: string;
189
+ readonly refresh: string;
190
+ readonly clear: string;
191
+ readonly failedTitle: string;
192
+ readonly cancelled: string;
193
+ readonly done: string;
194
+ readonly uploadLabel: string;
195
+ readonly downloadLabel: string;
196
+ /**
197
+ * The one-line summary templates, with `{label} {percent} {done} {total} {rate} {elapsed} {remaining}`.
198
+ *
199
+ * Templates rather than a sentence spelled here: this module is a pure model, and the sentence it used to
200
+ * build carried Chinese full-width punctuation (`%(…,…)`) into the English UI. The dictionaries own the
201
+ * sentence now; the numbers stay here.
202
+ */
203
+ readonly summaryRunning: string;
204
+ readonly summaryDone: string;
205
+ /** `剩余约 {duration}` */
206
+ readonly remaining: string;
207
+ /** `剩余时间未知` */
208
+ readonly remainingUnknown: string;
209
+ /** What a duration formatter prints when it was handed a value it cannot render. */
210
+ readonly durationUnknown: string;
211
+ /** Resolve one deferred failure message against the active dictionary. */
212
+ readonly resolve: (message: MessageKey) => string;
213
+ /** One failed transfer's line: `{path}{sep}{reason}` — the punctuation belongs to the locale. */
214
+ readonly failureLine: string;
215
+ /** The badge text when the host gave no `errorCode` (it used to be the English literal `error`). */
216
+ readonly errorCodeUnknown: string;
217
+ }
218
+ /** What the panel's controls call. */
219
+ export interface TransferPanelActions {
220
+ readonly onRefresh: () => void;
221
+ readonly onClear: () => void;
222
+ }
223
+ /**
224
+ * The panel's markup.
225
+ *
226
+ * A `<progress>` element for the bar rather than a styled `div`: it is the platform's own primitive, it is
227
+ * announced correctly by a screen reader, and it needs no CSS to be a progress bar at all (which matters here,
228
+ * because this plugin's stylesheet is injected and can be missing in a composition that never loaded it).
229
+ *
230
+ * @param props - state, copy, formatters and callbacks.
231
+ * @returns the panel section.
232
+ */
233
+ export declare function TransferPanelSection(props: {
234
+ readonly copy: TransferPanelCopy;
235
+ readonly state: TransferPanelState;
236
+ readonly actions: TransferPanelActions;
237
+ readonly format: {
238
+ readonly bytes: (value: number) => string;
239
+ readonly duration: (value: number) => string;
240
+ };
241
+ }): ReactNode;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * The transfer panel's **long-poll driver**: the thing that was a `setInterval` before task-19.
3
+ *
4
+ * ## Why a controller and not four `useEffect`s
5
+ *
6
+ * The behaviour that matters is a small state machine — one request in flight, the next one sent the moment the
7
+ * answer lands, a user action that supersedes a parked request, and a dispose that aborts it. This repository cannot
8
+ * render hooks in tests, so a controller with an injectable clock/timer is the only way those four rules are
9
+ * verifiable (the same reason `roots-panel-state.ts` and `session-panel` exist).
10
+ *
11
+ * ## What is preserved from the polling version, deliberately
12
+ *
13
+ * - **`clearing` / `clearError`**: `clear()` is a separate action from the list loop; a `cleared` list arriving
14
+ * while the clear request is in flight must not silently drop the "clearing…" state.
15
+ * - **A background read never raises `loading`.** `loading` is the *visible* "reading…" line, and only the user's
16
+ * own action (opening the panel, pressing refresh) may show it — a long-poll that times out every 25 s and
17
+ * flashed "reading…" would be the same flicker the 1 s timer used to cause (audit 0057).
18
+ * - **Newest answer wins.** Requests are strictly sequential, but a user refresh *aborts* the parked one; if the
19
+ * aborted request still resolves (a fetch can), its generation is stale and its rows are dropped instead of
20
+ * overwriting the answer that came after it.
21
+ *
22
+ * ## What changed
23
+ *
24
+ * The loop sends `waitMs` and re-arms **immediately** on every answer. A timeout is a normal answer, not an error;
25
+ * only a real failure backs off ({@link TRANSFER_RETRY_MS}) so a dead host is not hammered.
26
+ *
27
+ * @module dsh-over-ssh/client/transfer-progress
28
+ */
29
+ import { type TransferPanelIo, type TransferPanelState } from './transfer-panel.ts';
30
+ /** Long-poll budget the panel asks the host for (the route clamps it to 25 s as well). */
31
+ export declare const TRANSFER_LONG_POLL_MS = 25000;
32
+ /** Delay before re-asking after a **failed** read. A timeout is not a failure and never waits. */
33
+ export declare const TRANSFER_RETRY_MS = 1000;
34
+ /** One driver over the transfer list. */
35
+ export interface TransferProgress {
36
+ /** The current state; a stable reference until something changed. */
37
+ getState(): TransferPanelState;
38
+ /** Subscribe to state changes; returns the unsubscriber. */
39
+ subscribe(listener: () => void): () => void;
40
+ /** Begin the loop. Idempotent. */
41
+ start(): void;
42
+ /** The user's refresh: abort the parked request and ask again **now**, visibly. */
43
+ refresh(): void;
44
+ /** The user's clear: only finished rows; keeps `clearing`/`clearError`. */
45
+ clear(): void;
46
+ /** Stop the loop and abort the in-flight request. Idempotent. */
47
+ dispose(): void;
48
+ /** How many snapshot requests were issued (tests and diagnostics). */
49
+ requests(): number;
50
+ }
51
+ /** What the driver needs from its caller. */
52
+ export interface TransferProgressOptions {
53
+ readonly io: TransferPanelIo;
54
+ /** Override the long-poll budget (tests use a few milliseconds). */
55
+ readonly waitMs?: number;
56
+ /** Override the failure backoff (tests pass a no-op sleep). */
57
+ readonly retryDelayMs?: number;
58
+ /** Injected timer, so "backs off after a failure" costs nothing in a test. */
59
+ readonly sleep?: (ms: number) => Promise<void>;
60
+ }
61
+ /**
62
+ * Build the driver.
63
+ *
64
+ * @param options - the io, the budget and the injected timer.
65
+ * @returns the controller the React shell subscribes to.
66
+ */
67
+ export declare function createTransferProgress(options: TransferProgressOptions): TransferProgress;
@@ -0,0 +1,236 @@
1
+ /**
2
+ * The **editable** remote-workspaces section of the settings panel.
3
+ *
4
+ * Three layers, deliberately separated so the interesting parts can be tested without a browser:
5
+ *
6
+ * 1. {@link rootsPanelReducer} — a pure state machine over the panel's drafts, the last host answer and
7
+ * whether a request is in flight. No DOM, no I/O, no React: `tests/client-roots-view.test.ts` drives it
8
+ * directly.
9
+ * 2. {@link createRootsPanelController} — the same state plus the two calls from
10
+ * `./roots-panel.ts` (`load` / `send`). Everything that is *not* pure lives here: validation gate,
11
+ * double-submit gate, the refresh after a success, and dropping answers that a newer request superseded.
12
+ * 3. {@link RootsPanelSection} — a pure template (`createElement`, never JSX: Node's native type stripping
13
+ * cannot transform JSX) and {@link RootsPanelContainer}, the thin React shell that subscribes to the
14
+ * controller.
15
+ *
16
+ * Rules this file is responsible for, and where they are enforced:
17
+ *
18
+ * - **A `config` root never gets a delete button.** The button is rendered from
19
+ * {@link RootRowView.removable} and from nothing else; the controller refuses such a key before a POST.
20
+ * - **Nothing is submitted before validation.** `validateRootDraft` / `validateConnectionDraft` are the only
21
+ * way a draft becomes a request body, and their `MessageKey` refusal is rendered as text through the
22
+ * locale dictionaries.
23
+ * - **No double submit.** `canEdit === false` (no answer yet, or a request in flight) disables every control
24
+ * and stops every handler.
25
+ * - **No credentials.** This file can only send the fields its drafts hold; the password field does not
26
+ * exist, and `validateConnectionDraft` refuses `authKind: 'password'` outright.
27
+ *
28
+ * @module dsh-remote-workspace/client/roots-panel-view
29
+ */
30
+ import { type ReactNode } from 'react';
31
+ import type { SshDevKey } from './locale.ts';
32
+ import { type MessageKey, type RootLocation, type RootsApi, type RootsSnapshot, type RootsView } from './roots-panel.ts';
33
+ /** One shipped dictionary, resolved to plain strings. Passed to the component through the inject face. */
34
+ export type RootsPanelCopy = Record<SshDevKey, string>;
35
+ /** The three forms' contents. Kept flat so a patch is one spread and a test can name a single field. */
36
+ export interface RootsPanelDrafts {
37
+ /** Local root path (form 1). */
38
+ readonly localPath: string;
39
+ /** Remote root path (form 2). */
40
+ readonly remotePath: string;
41
+ /** Connection chosen for the remote root (form 2). */
42
+ readonly remoteConnectionId: string;
43
+ /** Optional label for the remote root (form 2). */
44
+ readonly remoteLabel: string;
45
+ /** New connection: id. */
46
+ readonly newId: string;
47
+ /** New connection: host. */
48
+ readonly newHost: string;
49
+ /** New connection: user. */
50
+ readonly newUser: string;
51
+ /** New connection: authentication mode. `password` is not offered at all. */
52
+ readonly newAuthKind: 'agent' | 'key';
53
+ /** New connection: key path, only meaningful for `newAuthKind === 'key'`. */
54
+ readonly newKeyPath: string;
55
+ /** New connection: port as typed; parsed by the controller so a bad value can be refused, not coerced. */
56
+ readonly newPort: string;
57
+ }
58
+ /** A change to the drafts; every field is optional so one handler can serve every input. */
59
+ export type RootsPanelDraftPatch = Partial<RootsPanelDrafts>;
60
+ /** Where an inline form message belongs. */
61
+ export type RootsPanelFormScope = 'roots' | 'connection';
62
+ /** A refusal or a failed submit, shown next to the form it belongs to. */
63
+ export interface RootsPanelFormNotice {
64
+ readonly scope: RootsPanelFormScope;
65
+ readonly message: MessageKey;
66
+ }
67
+ /** Everything the section renders from. */
68
+ export interface RootsPanelState {
69
+ /** True once an initial `load()` has been asked for, so a remount does not re-fetch. */
70
+ readonly started: boolean;
71
+ /** True while a request is in flight; the edit gate is `buildRootsView`'s `canEdit`. */
72
+ readonly pending: boolean;
73
+ /** True once a `load()` answered (ok or not). */
74
+ readonly loaded: boolean;
75
+ /** The last host answer, if any. */
76
+ readonly snapshot?: RootsSnapshot;
77
+ /** The last transport-level failure, if any. */
78
+ readonly error?: string;
79
+ /** The forms' contents. */
80
+ readonly drafts: RootsPanelDrafts;
81
+ /** The last validation refusal or submit failure, with the form it belongs to. */
82
+ readonly formNotice?: RootsPanelFormNotice;
83
+ /** Bumped by every success; a container can watch it to know "the host changed, reload". */
84
+ readonly reloadToken: number;
85
+ }
86
+ /** What the reducer accepts. */
87
+ export type RootsPanelAction =
88
+ /** A request is being sent; also marks the panel as started. */
89
+ {
90
+ readonly type: 'load';
91
+ } | {
92
+ readonly type: 'loaded';
93
+ readonly snapshot: RootsSnapshot;
94
+ }
95
+ /**
96
+ * A request failed. With a `scope` it is a submit failure and is shown next to that form; without one it
97
+ * is the initial load failing, which the view's own `notice` already reports — showing both would say the
98
+ * same thing twice.
99
+ */
100
+ | {
101
+ readonly type: 'failed';
102
+ readonly error: string;
103
+ readonly scope?: RootsPanelFormScope;
104
+ }
105
+ /** One form field changed: clears the inline message, because the user is fixing it. */
106
+ | {
107
+ readonly type: 'draft-changed';
108
+ readonly patch: RootsPanelDraftPatch;
109
+ }
110
+ /** A submit is in flight. */
111
+ | {
112
+ readonly type: 'submitted';
113
+ }
114
+ /** A draft was refused before any request; nothing was sent. */
115
+ | {
116
+ readonly type: 'refused';
117
+ readonly scope: RootsPanelFormScope;
118
+ readonly message: MessageKey;
119
+ }
120
+ /** A request succeeded. `resetDrafts` clears the forms (an add did); a removal keeps them. */
121
+ | {
122
+ readonly type: 'succeeded';
123
+ readonly resetDrafts?: boolean;
124
+ }
125
+ /** A removal is in flight; the reducer itself refuses a row that is not removable. */
126
+ | {
127
+ readonly type: 'remove';
128
+ readonly key: string;
129
+ };
130
+ /** The starting state: nothing loaded, no drafts, no queue. */
131
+ export declare function emptyRootsPanelDrafts(): RootsPanelDrafts;
132
+ /** @returns the state a freshly created controller holds. */
133
+ export declare function initialRootsPanelState(): RootsPanelState;
134
+ /**
135
+ * The panel's state machine. Pure: same state + same action ⇒ same result, and an action that changes
136
+ * nothing returns the **same object**, so a subscriber is never woken for a no-op.
137
+ *
138
+ * @param state - the current state.
139
+ * @param action - what happened.
140
+ * @returns the next state.
141
+ */
142
+ export declare function rootsPanelReducer(state: RootsPanelState, action: RootsPanelAction): RootsPanelState;
143
+ /**
144
+ * The view model for a state.
145
+ *
146
+ * @param state - the panel state.
147
+ * @returns exactly what `buildRootsView` says: rows with `removable`, connections, notice and the edit gate.
148
+ */
149
+ export declare function selectRootsView(state: RootsPanelState): RootsView;
150
+ /** True when the panel may accept input right now: an answer arrived and no request is in flight. */
151
+ export declare function canEdit(state: RootsPanelState): boolean;
152
+ /**
153
+ * Turn one `MessageKey` into text, with its parameters substituted.
154
+ *
155
+ * The key union is closed at compile time, but a `MessageKey` is a plain string by contract (the pure module
156
+ * cannot import the dictionary), so an unknown key is **shown as the key** rather than as an empty string: a
157
+ * missing translation must be visible, never silent.
158
+ *
159
+ * @param copy - the dictionary of the active locale.
160
+ * @param message - the key plus optional `{name}` parameters.
161
+ * @returns the rendered text, or `''` when there is no message.
162
+ */
163
+ export declare function resolveMessage(copy: RootsPanelCopy, message: MessageKey | undefined): string;
164
+ /** The calls the section makes. `roots-panel.ts` owns how they are implemented. */
165
+ export interface RootsPanelController {
166
+ /** The current state; a stable reference until something changes (safe for `useSyncExternalStore`). */
167
+ readonly getState: () => RootsPanelState;
168
+ /** Watch for changes; returns the disposer. */
169
+ readonly subscribe: (listener: () => void) => () => void;
170
+ /** Ask for the first answer once; a remount does not re-fetch. */
171
+ readonly start: () => void;
172
+ /** Reload unconditionally (used after a successful change). */
173
+ readonly reload: () => Promise<void>;
174
+ /** Change one form field. */
175
+ readonly changeDraft: (patch: RootsPanelDraftPatch) => void;
176
+ /** Validate and add a root of the given location. */
177
+ readonly submitRoot: (location: RootLocation) => Promise<void>;
178
+ /** Validate and add a connection. */
179
+ readonly submitConnection: () => Promise<void>;
180
+ /** Remove one row, if the view allows it. */
181
+ readonly remove: (key: string) => Promise<void>;
182
+ /** Stop accepting results and drop listeners. */
183
+ readonly dispose: () => void;
184
+ }
185
+ /** What a controller needs: the two calls. */
186
+ export interface RootsPanelControllerOptions {
187
+ readonly api: RootsApi;
188
+ }
189
+ /**
190
+ * Build the stateful half of the panel.
191
+ *
192
+ * The refresh-after-success is the reason this exists at all: `POST` answers with the *persisted* state,
193
+ * whose `roots` are the user's roots — the same field name `GET` uses for the *config* roots. Rendering that
194
+ * answer directly would show a config root as a user root (or the reverse), so a success always ends with a
195
+ * fresh `GET` and the POST body is used only as a signal.
196
+ *
197
+ * @param options - the injected API.
198
+ * @returns the controller the container subscribes to.
199
+ */
200
+ export declare function createRootsPanelController(options: RootsPanelControllerOptions): RootsPanelController;
201
+ /** What the section's controls call. All of them are no-ops when the gate is closed. */
202
+ export interface RootsPanelSectionActions {
203
+ readonly onDraftChange: (patch: RootsPanelDraftPatch) => void;
204
+ readonly onSubmitRoot: (location: RootLocation) => void;
205
+ readonly onSubmitConnection: () => void;
206
+ readonly onRemove: (key: string) => void;
207
+ }
208
+ /** Props of the pure template: state in, callbacks out, no hooks and no store access. */
209
+ export interface RootsPanelSectionProps {
210
+ readonly copy: RootsPanelCopy;
211
+ readonly state: RootsPanelState;
212
+ readonly actions: RootsPanelSectionActions;
213
+ }
214
+ /**
215
+ * Render the editable section. Pure: calling it twice with the same props yields the same tree.
216
+ *
217
+ * @param props - copy, state and callbacks.
218
+ * @returns the section element.
219
+ */
220
+ export declare function RootsPanelSection({ copy, state, actions }: RootsPanelSectionProps): ReactNode;
221
+ /** Props of the React shell: the controller owns the state, the shell only subscribes. */
222
+ export interface RootsPanelContainerProps {
223
+ readonly copy: RootsPanelCopy;
224
+ readonly controller: RootsPanelController;
225
+ }
226
+ /**
227
+ * Subscribe to a controller and render {@link RootsPanelSection}.
228
+ *
229
+ * `useSyncExternalStore` is the whole reason this is a component and not a function call: the slot's inject
230
+ * face is a synchronous snapshot, so the section has to be re-rendered by the store it reads.
231
+ *
232
+ * @param props - the dictionary and the controller.
233
+ * @returns the section element.
234
+ */
235
+ export declare function RootsPanelContainer({ copy, controller }: RootsPanelContainerProps): ReactNode;
236
+ //# sourceMappingURL=roots-panel-view.d.ts.map