@jingyi0605/codingns4dsh 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 (312) hide show
  1. package/README.md +1114 -0
  2. package/assets/provider-icons/claude-code.png +0 -0
  3. package/assets/provider-icons/codex.png +0 -0
  4. package/assets/provider-icons/command-code.svg +5 -0
  5. package/assets/provider-icons/deepseek-harness.svg +9 -0
  6. package/assets/provider-icons/gemini.png +0 -0
  7. package/assets/provider-icons/grok.png +0 -0
  8. package/assets/provider-icons/kimi.png +0 -0
  9. package/assets/provider-icons/opencode.png +0 -0
  10. package/assets/provider-icons/pi.svg +7 -0
  11. package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts +97 -0
  12. package/data/build/dist/bootstrap/dsh-connection-adapter.js +169 -0
  13. package/data/build/dist/bootstrap/index.d.ts +38 -0
  14. package/data/build/dist/bootstrap/index.js +44 -0
  15. package/data/build/dist/client/account-bar.d.ts +9 -0
  16. package/data/build/dist/client/account-bar.js +398 -0
  17. package/data/build/dist/client/bundle.js +26167 -0
  18. package/data/build/dist/client/cli-catalog.d.ts +24 -0
  19. package/data/build/dist/client/cli-catalog.js +108 -0
  20. package/data/build/dist/client/cli-slots.d.ts +38 -0
  21. package/data/build/dist/client/cli-slots.js +297 -0
  22. package/data/build/dist/client/debug/ui.d.ts +12 -0
  23. package/data/build/dist/client/debug/ui.js +451 -0
  24. package/data/build/dist/client/dsh-h5-bootstrap.d.ts +64 -0
  25. package/data/build/dist/client/dsh-h5-bootstrap.js +293 -0
  26. package/data/build/dist/client/dsh-runtime-version.d.ts +3 -0
  27. package/data/build/dist/client/dsh-runtime-version.js +11 -0
  28. package/data/build/dist/client/external-tool-stream.d.ts +24 -0
  29. package/data/build/dist/client/external-tool-stream.js +114 -0
  30. package/data/build/dist/client/features/cli-adapters.d.ts +7 -0
  31. package/data/build/dist/client/features/cli-adapters.js +215 -0
  32. package/data/build/dist/client/features/debug.d.ts +4 -0
  33. package/data/build/dist/client/features/debug.js +24 -0
  34. package/data/build/dist/client/features/index.d.ts +33 -0
  35. package/data/build/dist/client/features/index.js +44 -0
  36. package/data/build/dist/client/features/lan-access-panel.d.ts +5 -0
  37. package/data/build/dist/client/features/lan-access-panel.js +146 -0
  38. package/data/build/dist/client/features/lan-access.d.ts +9 -0
  39. package/data/build/dist/client/features/lan-access.js +30 -0
  40. package/data/build/dist/client/features/login-protection-panel.d.ts +5 -0
  41. package/data/build/dist/client/features/login-protection-panel.js +91 -0
  42. package/data/build/dist/client/features/login-protection-session.d.ts +6 -0
  43. package/data/build/dist/client/features/login-protection-session.js +25 -0
  44. package/data/build/dist/client/features/login-protection.d.ts +4 -0
  45. package/data/build/dist/client/features/login-protection.js +23 -0
  46. package/data/build/dist/client/features/reverse-proxy-panel.d.ts +9 -0
  47. package/data/build/dist/client/features/reverse-proxy-panel.js +159 -0
  48. package/data/build/dist/client/features/reverse-proxy.d.ts +12 -0
  49. package/data/build/dist/client/features/reverse-proxy.js +112 -0
  50. package/data/build/dist/client/features/terminal-enhancement-panel.d.ts +5 -0
  51. package/data/build/dist/client/features/terminal-enhancement-panel.js +160 -0
  52. package/data/build/dist/client/features/terminal-enhancement.d.ts +4 -0
  53. package/data/build/dist/client/features/terminal-enhancement.js +24 -0
  54. package/data/build/dist/client/features/types.d.ts +58 -0
  55. package/data/build/dist/client/features/types.js +2 -0
  56. package/data/build/dist/client/features/workspace-session-enhancement-panel.d.ts +5 -0
  57. package/data/build/dist/client/features/workspace-session-enhancement-panel.js +66 -0
  58. package/data/build/dist/client/features/workspace-session-enhancement.d.ts +4 -0
  59. package/data/build/dist/client/features/workspace-session-enhancement.js +101 -0
  60. package/data/build/dist/client/h5-bootstrap-entry.d.ts +2 -0
  61. package/data/build/dist/client/h5-bootstrap-entry.js +17 -0
  62. package/data/build/dist/client/index.d.ts +31 -0
  63. package/data/build/dist/client/index.js +98 -0
  64. package/data/build/dist/client/lan-access.d.ts +28 -0
  65. package/data/build/dist/client/lan-access.js +68 -0
  66. package/data/build/dist/client/locale.d.ts +20 -0
  67. package/data/build/dist/client/locale.js +393 -0
  68. package/data/build/dist/client/provider-icon-assets.d.ts +2 -0
  69. package/data/build/dist/client/provider-icon-assets.js +23 -0
  70. package/data/build/dist/client/provider-icons.d.ts +19 -0
  71. package/data/build/dist/client/provider-icons.js +39 -0
  72. package/data/build/dist/client/remote-web-context.d.ts +57 -0
  73. package/data/build/dist/client/remote-web-context.js +939 -0
  74. package/data/build/dist/client/session-adapter-cache.d.ts +18 -0
  75. package/data/build/dist/client/session-adapter-cache.js +84 -0
  76. package/data/build/dist/client/settings-bridge.d.ts +32 -0
  77. package/data/build/dist/client/settings-bridge.js +126 -0
  78. package/data/build/dist/client/settings-section.d.ts +30 -0
  79. package/data/build/dist/client/settings-section.js +93 -0
  80. package/data/build/dist/client/subscription-slot.d.ts +18 -0
  81. package/data/build/dist/client/subscription-slot.js +223 -0
  82. package/data/build/dist/client/terminal/index.d.ts +4 -0
  83. package/data/build/dist/client/terminal/index.js +3 -0
  84. package/data/build/dist/client/terminal/model.d.ts +116 -0
  85. package/data/build/dist/client/terminal/model.js +435 -0
  86. package/data/build/dist/client/terminal/styles.d.ts +21 -0
  87. package/data/build/dist/client/terminal/styles.js +51 -0
  88. package/data/build/dist/client/terminal/ui.d.ts +19 -0
  89. package/data/build/dist/client/terminal/ui.js +257 -0
  90. package/data/build/dist/client/terminal/xterm-view.d.ts +13 -0
  91. package/data/build/dist/client/terminal/xterm-view.js +213 -0
  92. package/data/build/dist/client/theme.d.ts +56 -0
  93. package/data/build/dist/client/theme.js +186 -0
  94. package/data/build/dist/client/workspace-session-archive-dom.d.ts +29 -0
  95. package/data/build/dist/client/workspace-session-archive-dom.js +525 -0
  96. package/data/build/dist/client/workspace-session-fiber.d.ts +3 -0
  97. package/data/build/dist/client/workspace-session-fiber.js +33 -0
  98. package/data/build/dist/client/workspace-session-logo-dom.d.ts +26 -0
  99. package/data/build/dist/client/workspace-session-logo-dom.js +128 -0
  100. package/data/build/dist/features/index.d.ts +3 -0
  101. package/data/build/dist/features/index.js +2 -0
  102. package/data/build/dist/features/registry.d.ts +74 -0
  103. package/data/build/dist/features/registry.js +382 -0
  104. package/data/build/dist/features/resource-scope/index.d.ts +39 -0
  105. package/data/build/dist/features/resource-scope/index.js +161 -0
  106. package/data/build/dist/host/auth-session.d.ts +42 -0
  107. package/data/build/dist/host/auth-session.js +186 -0
  108. package/data/build/dist/host/cli-adapters/claude-driver.d.ts +14 -0
  109. package/data/build/dist/host/cli-adapters/claude-driver.js +103 -0
  110. package/data/build/dist/host/cli-adapters/codex-driver.d.ts +45 -0
  111. package/data/build/dist/host/cli-adapters/codex-driver.js +534 -0
  112. package/data/build/dist/host/cli-adapters/command-code-driver.d.ts +38 -0
  113. package/data/build/dist/host/cli-adapters/command-code-driver.js +394 -0
  114. package/data/build/dist/host/cli-adapters/command-code-subscription.d.ts +19 -0
  115. package/data/build/dist/host/cli-adapters/command-code-subscription.js +126 -0
  116. package/data/build/dist/host/cli-adapters/driver.d.ts +41 -0
  117. package/data/build/dist/host/cli-adapters/driver.js +2 -0
  118. package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts +37 -0
  119. package/data/build/dist/host/cli-adapters/dsh-message-projector.js +180 -0
  120. package/data/build/dist/host/cli-adapters/dsh-tool-history.d.ts +48 -0
  121. package/data/build/dist/host/cli-adapters/dsh-tool-history.js +373 -0
  122. package/data/build/dist/host/cli-adapters/feature.d.ts +7 -0
  123. package/data/build/dist/host/cli-adapters/feature.js +335 -0
  124. package/data/build/dist/host/cli-adapters/gemini-driver.d.ts +24 -0
  125. package/data/build/dist/host/cli-adapters/gemini-driver.js +427 -0
  126. package/data/build/dist/host/cli-adapters/grok-driver.d.ts +38 -0
  127. package/data/build/dist/host/cli-adapters/grok-driver.js +372 -0
  128. package/data/build/dist/host/cli-adapters/http-sse-client.d.ts +22 -0
  129. package/data/build/dist/host/cli-adapters/http-sse-client.js +99 -0
  130. package/data/build/dist/host/cli-adapters/interaction-events.d.ts +11 -0
  131. package/data/build/dist/host/cli-adapters/interaction-events.js +80 -0
  132. package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts +65 -0
  133. package/data/build/dist/host/cli-adapters/json-rpc-process.js +256 -0
  134. package/data/build/dist/host/cli-adapters/kimi-driver.d.ts +21 -0
  135. package/data/build/dist/host/cli-adapters/kimi-driver.js +382 -0
  136. package/data/build/dist/host/cli-adapters/model-catalog.d.ts +22 -0
  137. package/data/build/dist/host/cli-adapters/model-catalog.js +89 -0
  138. package/data/build/dist/host/cli-adapters/opencode-driver.d.ts +55 -0
  139. package/data/build/dist/host/cli-adapters/opencode-driver.js +728 -0
  140. package/data/build/dist/host/cli-adapters/pi-driver.d.ts +43 -0
  141. package/data/build/dist/host/cli-adapters/pi-driver.js +312 -0
  142. package/data/build/dist/host/cli-adapters/process-utils.d.ts +16 -0
  143. package/data/build/dist/host/cli-adapters/process-utils.js +27 -0
  144. package/data/build/dist/host/cli-adapters/provider-subscription.d.ts +82 -0
  145. package/data/build/dist/host/cli-adapters/provider-subscription.js +610 -0
  146. package/data/build/dist/host/cli-adapters/registry.d.ts +95 -0
  147. package/data/build/dist/host/cli-adapters/registry.js +659 -0
  148. package/data/build/dist/host/cli-adapters/rpc-driver-utils.d.ts +24 -0
  149. package/data/build/dist/host/cli-adapters/rpc-driver-utils.js +119 -0
  150. package/data/build/dist/host/cli-adapters/session-probe.d.ts +20 -0
  151. package/data/build/dist/host/cli-adapters/session-probe.js +139 -0
  152. package/data/build/dist/host/cli-adapters/session-store.d.ts +68 -0
  153. package/data/build/dist/host/cli-adapters/session-store.js +180 -0
  154. package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts +45 -0
  155. package/data/build/dist/host/cli-adapters/standard-stream-driver.js +205 -0
  156. package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts +25 -0
  157. package/data/build/dist/host/cli-adapters/stream-normalizer.js +83 -0
  158. package/data/build/dist/host/cli-adapters/tool-observation.d.ts +9 -0
  159. package/data/build/dist/host/cli-adapters/tool-observation.js +39 -0
  160. package/data/build/dist/host/control-api-client.d.ts +84 -0
  161. package/data/build/dist/host/control-api-client.js +130 -0
  162. package/data/build/dist/host/credential-store.d.ts +54 -0
  163. package/data/build/dist/host/credential-store.js +114 -0
  164. package/data/build/dist/host/debug.d.ts +79 -0
  165. package/data/build/dist/host/debug.js +295 -0
  166. package/data/build/dist/host/dsh-device-runtime.d.ts +39 -0
  167. package/data/build/dist/host/dsh-device-runtime.js +118 -0
  168. package/data/build/dist/host/dsh-gateway-feature.d.ts +5 -0
  169. package/data/build/dist/host/dsh-gateway-feature.js +55 -0
  170. package/data/build/dist/host/dsh-runtime-version.d.ts +12 -0
  171. package/data/build/dist/host/dsh-runtime-version.js +69 -0
  172. package/data/build/dist/host/features/auth.d.ts +11 -0
  173. package/data/build/dist/host/features/auth.js +273 -0
  174. package/data/build/dist/host/features/debug.d.ts +5 -0
  175. package/data/build/dist/host/features/debug.js +90 -0
  176. package/data/build/dist/host/features/host-status.d.ts +12 -0
  177. package/data/build/dist/host/features/host-status.js +54 -0
  178. package/data/build/dist/host/features/index.d.ts +19 -0
  179. package/data/build/dist/host/features/index.js +29 -0
  180. package/data/build/dist/host/features/lan-access-dsh.d.ts +8 -0
  181. package/data/build/dist/host/features/lan-access-dsh.js +45 -0
  182. package/data/build/dist/host/features/terminal-process.d.ts +5 -0
  183. package/data/build/dist/host/features/terminal-process.js +110 -0
  184. package/data/build/dist/host/features/terminal-status.d.ts +18 -0
  185. package/data/build/dist/host/features/terminal-status.js +56 -0
  186. package/data/build/dist/host/features/types.d.ts +41 -0
  187. package/data/build/dist/host/features/types.js +2 -0
  188. package/data/build/dist/host/index.d.ts +43 -0
  189. package/data/build/dist/host/index.js +135 -0
  190. package/data/build/dist/host/lan-access-dsh.d.ts +83 -0
  191. package/data/build/dist/host/lan-access-dsh.js +831 -0
  192. package/data/build/dist/host/native-session-bridge.d.ts +130 -0
  193. package/data/build/dist/host/native-session-bridge.js +317 -0
  194. package/data/build/dist/host/relay-tunnel-runtime.d.ts +97 -0
  195. package/data/build/dist/host/relay-tunnel-runtime.js +361 -0
  196. package/data/build/dist/host/remote-web-runtime.d.ts +78 -0
  197. package/data/build/dist/host/remote-web-runtime.js +559 -0
  198. package/data/build/dist/host/rpc-table.d.ts +32 -0
  199. package/data/build/dist/host/rpc-table.js +47 -0
  200. package/data/build/dist/host/rpc.d.ts +18 -0
  201. package/data/build/dist/host/rpc.js +248 -0
  202. package/data/build/dist/host/settings.d.ts +19 -0
  203. package/data/build/dist/host/settings.js +80 -0
  204. package/data/build/dist/host/terminal/attachment-registry.d.ts +17 -0
  205. package/data/build/dist/host/terminal/attachment-registry.js +49 -0
  206. package/data/build/dist/host/terminal/backends/conpty-backend.d.ts +39 -0
  207. package/data/build/dist/host/terminal/backends/conpty-backend.js +160 -0
  208. package/data/build/dist/host/terminal/backends/local-pty-backend.d.ts +36 -0
  209. package/data/build/dist/host/terminal/backends/local-pty-backend.js +178 -0
  210. package/data/build/dist/host/terminal/backends/tmux-backend.d.ts +40 -0
  211. package/data/build/dist/host/terminal/backends/tmux-backend.js +191 -0
  212. package/data/build/dist/host/terminal/broker/conpty-broker-client.d.ts +27 -0
  213. package/data/build/dist/host/terminal/broker/conpty-broker-client.js +154 -0
  214. package/data/build/dist/host/terminal/broker/conpty-broker-process.d.ts +10 -0
  215. package/data/build/dist/host/terminal/broker/conpty-broker-process.js +147 -0
  216. package/data/build/dist/host/terminal/broker/conpty-broker-protocol.d.ts +92 -0
  217. package/data/build/dist/host/terminal/broker/conpty-broker-protocol.js +134 -0
  218. package/data/build/dist/host/terminal/controller-factory.d.ts +37 -0
  219. package/data/build/dist/host/terminal/controller-factory.js +82 -0
  220. package/data/build/dist/host/terminal/index.d.ts +17 -0
  221. package/data/build/dist/host/terminal/index.js +17 -0
  222. package/data/build/dist/host/terminal/runtime-adapter.d.ts +77 -0
  223. package/data/build/dist/host/terminal/runtime-adapter.js +18 -0
  224. package/data/build/dist/host/terminal/runtime-manager.d.ts +41 -0
  225. package/data/build/dist/host/terminal/runtime-manager.js +179 -0
  226. package/data/build/dist/host/terminal/shell-detection.d.ts +23 -0
  227. package/data/build/dist/host/terminal/shell-detection.js +105 -0
  228. package/data/build/dist/host/terminal/startup.d.ts +33 -0
  229. package/data/build/dist/host/terminal/startup.js +100 -0
  230. package/data/build/dist/host/terminal/terminal-controller.d.ts +78 -0
  231. package/data/build/dist/host/terminal/terminal-controller.js +324 -0
  232. package/data/build/dist/host/terminal/terminal-process-service.d.ts +30 -0
  233. package/data/build/dist/host/terminal/terminal-process-service.js +194 -0
  234. package/data/build/dist/host/terminal/terminal-process-store.d.ts +45 -0
  235. package/data/build/dist/host/terminal/terminal-process-store.js +183 -0
  236. package/data/build/dist/host/terminal/terminal-service.d.ts +87 -0
  237. package/data/build/dist/host/terminal/terminal-service.js +528 -0
  238. package/data/build/dist/host/terminal/terminal-store.d.ts +49 -0
  239. package/data/build/dist/host/terminal/terminal-store.js +242 -0
  240. package/data/build/dist/index.d.ts +37 -0
  241. package/data/build/dist/index.js +26 -0
  242. package/data/build/dist/shared/contracts/auth.d.ts +122 -0
  243. package/data/build/dist/shared/contracts/auth.js +8 -0
  244. package/data/build/dist/shared/contracts/cli-adapter.d.ts +192 -0
  245. package/data/build/dist/shared/contracts/cli-adapter.js +2 -0
  246. package/data/build/dist/shared/contracts/command-code.d.ts +5 -0
  247. package/data/build/dist/shared/contracts/command-code.js +2 -0
  248. package/data/build/dist/shared/contracts/config.d.ts +113 -0
  249. package/data/build/dist/shared/contracts/config.js +86 -0
  250. package/data/build/dist/shared/contracts/debug-config.d.ts +28 -0
  251. package/data/build/dist/shared/contracts/debug-config.js +78 -0
  252. package/data/build/dist/shared/contracts/debug.d.ts +75 -0
  253. package/data/build/dist/shared/contracts/debug.js +121 -0
  254. package/data/build/dist/shared/contracts/dsh-device.d.ts +72 -0
  255. package/data/build/dist/shared/contracts/dsh-device.js +2 -0
  256. package/data/build/dist/shared/contracts/errors.d.ts +33 -0
  257. package/data/build/dist/shared/contracts/errors.js +41 -0
  258. package/data/build/dist/shared/contracts/feature.d.ts +71 -0
  259. package/data/build/dist/shared/contracts/feature.js +2 -0
  260. package/data/build/dist/shared/contracts/host-status.d.ts +14 -0
  261. package/data/build/dist/shared/contracts/host-status.js +2 -0
  262. package/data/build/dist/shared/contracts/lan-access-dsh.d.ts +30 -0
  263. package/data/build/dist/shared/contracts/lan-access-dsh.js +2 -0
  264. package/data/build/dist/shared/contracts/peer-host.d.ts +37 -0
  265. package/data/build/dist/shared/contracts/peer-host.js +9 -0
  266. package/data/build/dist/shared/contracts/signaling.d.ts +67 -0
  267. package/data/build/dist/shared/contracts/signaling.js +2 -0
  268. package/data/build/dist/shared/contracts/subscription.d.ts +69 -0
  269. package/data/build/dist/shared/contracts/subscription.js +2 -0
  270. package/data/build/dist/shared/contracts/terminal-process.d.ts +65 -0
  271. package/data/build/dist/shared/contracts/terminal-process.js +2 -0
  272. package/data/build/dist/shared/contracts/terminal.d.ts +127 -0
  273. package/data/build/dist/shared/contracts/terminal.js +2 -0
  274. package/data/build/dist/shared/contracts/transport.d.ts +45 -0
  275. package/data/build/dist/shared/contracts/transport.js +3 -0
  276. package/data/build/dist/shared/contracts/version.d.ts +19 -0
  277. package/data/build/dist/shared/contracts/version.js +74 -0
  278. package/data/build/dist/shared/index.d.ts +22 -0
  279. package/data/build/dist/shared/index.js +9 -0
  280. package/data/build/dist/transport/carrier.d.ts +38 -0
  281. package/data/build/dist/transport/carrier.js +268 -0
  282. package/data/build/dist/transport/debug.d.ts +22 -0
  283. package/data/build/dist/transport/debug.js +57 -0
  284. package/data/build/dist/transport/dsh-envelope.d.ts +41 -0
  285. package/data/build/dist/transport/dsh-envelope.js +107 -0
  286. package/data/build/dist/transport/dsh-gateway.d.ts +64 -0
  287. package/data/build/dist/transport/dsh-gateway.js +254 -0
  288. package/data/build/dist/transport/dsh-session.d.ts +55 -0
  289. package/data/build/dist/transport/dsh-session.js +256 -0
  290. package/data/build/dist/transport/dsh-transport.d.ts +57 -0
  291. package/data/build/dist/transport/dsh-transport.js +125 -0
  292. package/data/build/dist/transport/frame.d.ts +132 -0
  293. package/data/build/dist/transport/frame.js +168 -0
  294. package/data/build/dist/transport/index.d.ts +11 -0
  295. package/data/build/dist/transport/index.js +11 -0
  296. package/data/build/dist/transport/multiplexer.d.ts +63 -0
  297. package/data/build/dist/transport/multiplexer.js +323 -0
  298. package/data/build/dist/transport/webrtc-client.d.ts +65 -0
  299. package/data/build/dist/transport/webrtc-client.js +255 -0
  300. package/data/build/dist/transport/webrtc-host.d.ts +58 -0
  301. package/data/build/dist/transport/webrtc-host.js +252 -0
  302. package/data/build/dist/typert.host.d.ts +25 -0
  303. package/data/build/dist/typert.host.js +150 -0
  304. package/dsh.bundle.patch +12 -0
  305. package/package.json +135 -0
  306. package/profile/README.md +27 -0
  307. package/profile/cordis.patch.yml +2 -0
  308. package/profile/package.json +20 -0
  309. package/profile/scripts/check-dsh-install.mjs +71 -0
  310. package/profile/version.json +5 -0
  311. package/scripts/check-dsh-install.mjs +88 -0
  312. package/version.json +6 -0
Binary file
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-hidden="true">
2
+ <rect x="5" y="5" width="54" height="54" rx="12" fill="#111827" />
3
+ <path d="M18 24l8 8-8 8" fill="none" stroke="#f9fafb" stroke-linecap="round" stroke-linejoin="round" stroke-width="5" />
4
+ <path d="M33 42h13" fill="none" stroke="#60a5fa" stroke-linecap="round" stroke-width="5" />
5
+ </svg>
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-hidden="true">
2
+ <circle cx="32" cy="32" r="27" fill="#2563eb" />
3
+ <path
4
+ d="M15 37c3-11 12-18 23-18 7 0 13 3 17 8-3-1-6-1-9 0 3 2 5 5 6 8-4-2-8-3-12-2-4 2-8 5-11 9-4 0-9-2-14-5z"
5
+ fill="#fff"
6
+ />
7
+ <circle cx="43" cy="27" r="2.5" fill="#2563eb" />
8
+ <path d="M17 39c4 5 10 8 17 8 5 0 10-2 14-5-5 1-10 1-14-1-5-2-10-3-17-2z" fill="#bfdbfe" />
9
+ </svg>
Binary file
Binary file
Binary file
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-hidden="true">
2
+ <rect x="5" y="5" width="54" height="54" rx="12" fill="#0b1220" />
3
+ <path d="M32 15v34" fill="none" stroke="#f9fafb" stroke-linecap="round" stroke-width="5" />
4
+ <path d="M19 32h26" fill="none" stroke="#f9fafb" stroke-linecap="round" stroke-width="5" />
5
+ <path d="M23 21h18" fill="none" stroke="#38bdf8" stroke-linecap="round" stroke-width="4" />
6
+ <path d="M23 43h18" fill="none" stroke="#38bdf8" stroke-linecap="round" stroke-width="4" />
7
+ </svg>
@@ -0,0 +1,97 @@
1
+ import { type CodingNsTransportGeneration } from '../shared/index.js';
2
+ import type { CodingNsTransport } from '../shared/index.js';
3
+ import { DshCodingNsTransport } from '../transport/dsh-transport.js';
4
+ import { type CodingNsTransportRegistration } from './index.js';
5
+ export type { CodingNsTransportRegistration } from './index.js';
6
+ /** DSH 0.1.6-alpha.2 的 ClientConnectionRpc 结果形状。 */
7
+ export interface DshConnectionRpcResult<T = unknown> {
8
+ readonly ok: true;
9
+ readonly value: T;
10
+ }
11
+ export interface DshConnectionRpcFailure {
12
+ readonly code: string;
13
+ readonly message: string;
14
+ readonly details: object;
15
+ }
16
+ export type DshConnectionRpcResponse<T = unknown> = DshConnectionRpcResult<T> | {
17
+ readonly ok: false;
18
+ readonly error: DshConnectionRpcFailure;
19
+ };
20
+ /** 从 DSH 0.1.6-alpha.2 ClientTransportHooks 提取的最小运行时接口。 */
21
+ export interface DshClientTransportHooks {
22
+ rpc: {
23
+ call(channel: string, endpoint: string, payload: unknown, signal?: AbortSignal): Promise<DshConnectionRpcResponse>;
24
+ open?(channel: string, endpoint: string, payload: unknown, signal: AbortSignal): AsyncIterable<unknown>;
25
+ };
26
+ fetch?: (input: URL, init: RequestInit) => Promise<Response>;
27
+ openStream?: (endpoint: string, payload: unknown, signal: AbortSignal) => AsyncIterable<unknown>;
28
+ loadBundle?: (url: string) => Promise<void>;
29
+ ownsHost?: boolean;
30
+ streamBaseUrl?: string;
31
+ }
32
+ export interface DshGenerationSource {
33
+ (signal: AbortSignal, ready: (host: {
34
+ home: string;
35
+ }) => void): Promise<void>;
36
+ }
37
+ export interface DshConnectionHandle {
38
+ registerGenerationSource(source: DshGenerationSource): () => void;
39
+ start(sinks: {
40
+ onReconnectRequested?: () => void;
41
+ onConnected?: (host: {
42
+ home: string;
43
+ }) => void;
44
+ onStateChange?: (state: 'connected' | 'connecting' | 'disconnected') => void;
45
+ }): {
46
+ stop(): void;
47
+ };
48
+ }
49
+ export interface DshConnectionContext {
50
+ connection: DshConnectionHandle;
51
+ effect(dispose: () => void | Promise<void>, name?: string): unknown;
52
+ }
53
+ export interface DshConnectionAdapter {
54
+ readonly hooks: DshClientTransportHooks;
55
+ readonly generationSource: DshGenerationSource;
56
+ readonly dispose: () => Promise<void>;
57
+ }
58
+ export interface DshTransportLifecycle {
59
+ generation?: () => CodingNsTransportGeneration | undefined;
60
+ onGenerationChange?: (listener: (generation: CodingNsTransportGeneration | undefined) => void) => () => void;
61
+ reconnect?: (signal?: AbortSignal) => Promise<void>;
62
+ close?: () => Promise<void>;
63
+ }
64
+ /**
65
+ * 将插件内部 Transport 映射为 DSH 的 ClientTransportHooks。
66
+ *
67
+ * DSH 的 rpc 以 channel/endpoint 分离路由;插件帧协议暂时只有一个 method
68
+ * 字段,因此适配层保留完整路由在 payload 中,避免丢失 DSH 的绝对 channel。
69
+ */
70
+ export declare function createDshClientTransportHooks(transport: CodingNsTransport): DshClientTransportHooks;
71
+ /**
72
+ * 将插件 generation 转换为 DSH ConnectionGenerationSource。
73
+ * 每个 source 只负责一个 generation;generation 失效后 promise 结束,
74
+ * 由 DSH ConnectionController 统一触发下一次 reconnect。
75
+ */
76
+ export declare function createDshGenerationSource(transport: CodingNsTransport): DshGenerationSource;
77
+ /** 从全局 hooks 读取 generation,供 Client entry 不持有 Node/Host 对象。 */
78
+ export declare function createDshGenerationSourceFromHooks(hooks: DshTransportLifecycle): DshGenerationSource;
79
+ /**
80
+ * 将已安装的 DSH Connection service 绑定到 Codingns4DSH Transport。
81
+ * 该函数只依赖 DSH 公开的 registerGenerationSource/start/stop,不覆盖默认 Connection。
82
+ */
83
+ export declare function bindDshConnection(ctx: DshConnectionContext, transport: DshCodingNsTransport): () => Promise<void>;
84
+ /** 将全局 hooks 的 generation/reconnect/close 生命周期接入 DSH Connection。 */
85
+ export declare function bindDshConnectionHooks(ctx: DshConnectionContext, hooks: DshTransportLifecycle): () => Promise<void>;
86
+ /**
87
+ * pre-Cordis 启动胶水:登记正确的 DSH hooks,并返回 Connection 绑定函数。
88
+ * 版本检查遵循 version.json 声明的兼容范围,避免未经验证的 generation 契约静默漂移。
89
+ */
90
+ export declare function installDshTransport(options: {
91
+ dshVersion: string;
92
+ transport: DshCodingNsTransport;
93
+ }): CodingNsTransportRegistration & {
94
+ hooks: DshClientTransportHooks;
95
+ };
96
+ export declare const SUPPORTED_DSH_CONNECTION_VERSION: "0.1.6-alpha.2";
97
+ //# sourceMappingURL=dsh-connection-adapter.d.ts.map
@@ -0,0 +1,169 @@
1
+ import { assertSupportedDshVersion, SUPPORTED_DSH_VERSION, } from '../shared/index.js';
2
+ import { DshCodingNsTransport } from '../transport/dsh-transport.js';
3
+ import { installPreCordisTransport, } from './index.js';
4
+ /**
5
+ * 将插件内部 Transport 映射为 DSH 的 ClientTransportHooks。
6
+ *
7
+ * DSH 的 rpc 以 channel/endpoint 分离路由;插件帧协议暂时只有一个 method
8
+ * 字段,因此适配层保留完整路由在 payload 中,避免丢失 DSH 的绝对 channel。
9
+ */
10
+ export function createDshClientTransportHooks(transport) {
11
+ const rpc = {
12
+ async call(channel, endpoint, payload, signal) {
13
+ try {
14
+ const request = {
15
+ method: endpoint,
16
+ payload: { channel, payload },
17
+ ...(signal === undefined ? {} : { signal }),
18
+ };
19
+ const value = await transport.rpc(request);
20
+ return { ok: true, value };
21
+ }
22
+ catch (error) {
23
+ return {
24
+ ok: false,
25
+ error: {
26
+ code: 'transport',
27
+ message: error instanceof Error ? error.message : String(error),
28
+ details: {},
29
+ },
30
+ };
31
+ }
32
+ },
33
+ open(channel, endpoint, payload, signal) {
34
+ return transport.openStream({ method: endpoint, payload: { channel, payload }, signal });
35
+ },
36
+ };
37
+ const hooks = {
38
+ rpc,
39
+ fetch: (input, init) => transport.fetch(input, init),
40
+ openStream: (endpoint, payload, signal) => transport.openStream({ method: endpoint, payload, signal }),
41
+ loadBundle: (url) => transport.loadBundle(url),
42
+ generation: transport.getGeneration.bind(transport),
43
+ onGenerationChange: transport.onGenerationChange.bind(transport),
44
+ reconnect: transport.reconnect.bind(transport),
45
+ close: transport.close.bind(transport),
46
+ };
47
+ const generation = transport.getGeneration();
48
+ if (generation?.host.home)
49
+ hooks.ownsHost = true;
50
+ return hooks;
51
+ }
52
+ /**
53
+ * 将插件 generation 转换为 DSH ConnectionGenerationSource。
54
+ * 每个 source 只负责一个 generation;generation 失效后 promise 结束,
55
+ * 由 DSH ConnectionController 统一触发下一次 reconnect。
56
+ */
57
+ export function createDshGenerationSource(transport) {
58
+ return (signal, ready) => new Promise((resolve) => {
59
+ let published;
60
+ let settled = false;
61
+ const cleanup = transport.onGenerationChange((generation) => {
62
+ if (settled)
63
+ return;
64
+ if (published === undefined && generation !== undefined) {
65
+ published = generation;
66
+ ready({ home: generation.host.home });
67
+ return;
68
+ }
69
+ if (published !== undefined && (generation === undefined || generation.id !== published.id))
70
+ finish();
71
+ });
72
+ const abort = () => finish();
73
+ signal.addEventListener('abort', abort, { once: true });
74
+ const current = transport.getGeneration();
75
+ if (current !== undefined) {
76
+ published = current;
77
+ ready({ home: current.host.home });
78
+ }
79
+ function finish() {
80
+ if (settled)
81
+ return;
82
+ settled = true;
83
+ cleanup();
84
+ signal.removeEventListener('abort', abort);
85
+ resolve();
86
+ }
87
+ });
88
+ }
89
+ /** 从全局 hooks 读取 generation,供 Client entry 不持有 Node/Host 对象。 */
90
+ export function createDshGenerationSourceFromHooks(hooks) {
91
+ return (signal, ready) => new Promise((resolve) => {
92
+ if (!hooks.generation || !hooks.onGenerationChange) {
93
+ resolve();
94
+ return;
95
+ }
96
+ let published;
97
+ let settled = false;
98
+ const cleanup = hooks.onGenerationChange((generation) => {
99
+ if (settled)
100
+ return;
101
+ if (published === undefined && generation !== undefined) {
102
+ published = generation;
103
+ ready({ home: generation.host.home });
104
+ }
105
+ else if (published !== undefined && (generation === undefined || generation.id !== published.id)) {
106
+ finish();
107
+ }
108
+ });
109
+ const abort = () => finish();
110
+ signal.addEventListener('abort', abort, { once: true });
111
+ const current = hooks.generation();
112
+ if (current !== undefined) {
113
+ published = current;
114
+ ready({ home: current.host.home });
115
+ }
116
+ function finish() {
117
+ if (settled)
118
+ return;
119
+ settled = true;
120
+ cleanup();
121
+ signal.removeEventListener('abort', abort);
122
+ resolve();
123
+ }
124
+ });
125
+ }
126
+ /**
127
+ * 将已安装的 DSH Connection service 绑定到 Codingns4DSH Transport。
128
+ * 该函数只依赖 DSH 公开的 registerGenerationSource/start/stop,不覆盖默认 Connection。
129
+ */
130
+ export function bindDshConnection(ctx, transport) {
131
+ return bindDshConnectionHooks(ctx, {
132
+ generation: transport.getGeneration.bind(transport),
133
+ onGenerationChange: transport.onGenerationChange.bind(transport),
134
+ reconnect: transport.reconnect.bind(transport),
135
+ close: transport.close.bind(transport),
136
+ });
137
+ }
138
+ /** 将全局 hooks 的 generation/reconnect/close 生命周期接入 DSH Connection。 */
139
+ export function bindDshConnectionHooks(ctx, hooks) {
140
+ const source = createDshGenerationSourceFromHooks(hooks);
141
+ const unregister = ctx.connection.registerGenerationSource(source);
142
+ const loop = ctx.connection.start({
143
+ onReconnectRequested: () => { void hooks.reconnect?.(); },
144
+ });
145
+ let disposed = false;
146
+ return async () => {
147
+ if (disposed)
148
+ return;
149
+ disposed = true;
150
+ unregister();
151
+ loop.stop();
152
+ await hooks.close?.();
153
+ };
154
+ }
155
+ /**
156
+ * pre-Cordis 启动胶水:登记正确的 DSH hooks,并返回 Connection 绑定函数。
157
+ * 版本检查遵循 version.json 声明的兼容范围,避免未经验证的 generation 契约静默漂移。
158
+ */
159
+ export function installDshTransport(options) {
160
+ assertSupportedDshVersion(options.dshVersion);
161
+ const hooks = createDshClientTransportHooks(options.transport);
162
+ const registration = installPreCordisTransport({
163
+ dshVersion: options.dshVersion,
164
+ transport: hooks,
165
+ });
166
+ return { ...registration, hooks };
167
+ }
168
+ export const SUPPORTED_DSH_CONNECTION_VERSION = SUPPORTED_DSH_VERSION;
169
+ //# sourceMappingURL=dsh-connection-adapter.js.map
@@ -0,0 +1,38 @@
1
+ import type { CodingNsTransportHooks } from '../shared/index.js';
2
+ /**
3
+ * DSH 在 Cordis 启动前读取的页面级 Transport 形状。
4
+ *
5
+ * 这里故意只保留浏览器可用字段。真正的 WebRTC、信令和帧复用器由后续
6
+ * 阶段提供,本模块只负责把已经创建好的 Transport 交给 DSH。
7
+ */
8
+ export interface CodingNsPreCordisTransport extends CodingNsTransportHooks {
9
+ ownsHost?: boolean;
10
+ streamBaseUrl?: string;
11
+ }
12
+ export interface CodingNsBootstrapOptions {
13
+ dshVersion: string;
14
+ transport: CodingNsPreCordisTransport;
15
+ }
16
+ export interface CodingNsBootWithTransportOptions extends CodingNsBootstrapOptions {
17
+ boot: () => void | Promise<void>;
18
+ }
19
+ export interface CodingNsTransportRegistration {
20
+ readonly transport: CodingNsPreCordisTransport;
21
+ dispose(): void;
22
+ }
23
+ export declare const CODINGNS_BOOTSTRAP_DSH_VERSION: "0.1.6-alpha.2";
24
+ /**
25
+ * 在 DSH Client/Cordis 启动前登记唯一 Transport。
26
+ *
27
+ * 普通动态插件不得调用此函数。重复登记直接失败,避免悄悄覆盖 DSH
28
+ * 默认 Connection 或让两个连接 owner 竞争同一个 generation。
29
+ */
30
+ export declare function installPreCordisTransport(options: CodingNsBootstrapOptions): CodingNsTransportRegistration;
31
+ /**
32
+ * 以一次性启动顺序执行:版本校验 -> 登记 Transport -> 启动 DSH Client。
33
+ * boot 失败时会立即撤销全局 Transport,避免半启动状态污染下一次启动。
34
+ */
35
+ export declare function bootWithPreCordisTransport(options: CodingNsBootWithTransportOptions): Promise<CodingNsTransportRegistration>;
36
+ export { bindDshConnection, bindDshConnectionHooks, createDshClientTransportHooks, createDshGenerationSource, createDshGenerationSourceFromHooks, installDshTransport, SUPPORTED_DSH_CONNECTION_VERSION, } from './dsh-connection-adapter.js';
37
+ export type { DshClientTransportHooks, DshConnectionAdapter, DshConnectionContext, DshConnectionHandle, DshConnectionRpcFailure, DshConnectionRpcResponse, DshConnectionRpcResult, DshGenerationSource, DshTransportLifecycle, } from './dsh-connection-adapter.js';
38
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,44 @@
1
+ import { assertSupportedDshVersion, CODINGNS_DSH_ERROR_CODES, CodingNsDshError, SUPPORTED_DSH_VERSION, } from '../shared/index.js';
2
+ export const CODINGNS_BOOTSTRAP_DSH_VERSION = SUPPORTED_DSH_VERSION;
3
+ /**
4
+ * 在 DSH Client/Cordis 启动前登记唯一 Transport。
5
+ *
6
+ * 普通动态插件不得调用此函数。重复登记直接失败,避免悄悄覆盖 DSH
7
+ * 默认 Connection 或让两个连接 owner 竞争同一个 generation。
8
+ */
9
+ export function installPreCordisTransport(options) {
10
+ assertSupportedDshVersion(options.dshVersion);
11
+ const globals = globalThis;
12
+ if (globals.__DSH_TRANSPORT__ !== undefined) {
13
+ throw new CodingNsDshError(CODINGNS_DSH_ERROR_CODES.TRANSPORT_NOT_READY, 'DSH 启动胶水已经登记了 Transport;不允许重复接管 Connection');
14
+ }
15
+ globals.__DSH_TRANSPORT__ = options.transport;
16
+ let disposed = false;
17
+ return {
18
+ transport: options.transport,
19
+ dispose() {
20
+ if (disposed)
21
+ return;
22
+ disposed = true;
23
+ if (globals.__DSH_TRANSPORT__ === options.transport)
24
+ delete globals.__DSH_TRANSPORT__;
25
+ },
26
+ };
27
+ }
28
+ /**
29
+ * 以一次性启动顺序执行:版本校验 -> 登记 Transport -> 启动 DSH Client。
30
+ * boot 失败时会立即撤销全局 Transport,避免半启动状态污染下一次启动。
31
+ */
32
+ export async function bootWithPreCordisTransport(options) {
33
+ const registration = installPreCordisTransport(options);
34
+ try {
35
+ await options.boot();
36
+ return registration;
37
+ }
38
+ catch (error) {
39
+ registration.dispose();
40
+ throw error;
41
+ }
42
+ }
43
+ export { bindDshConnection, bindDshConnectionHooks, createDshClientTransportHooks, createDshGenerationSource, createDshGenerationSourceFromHooks, installDshTransport, SUPPORTED_DSH_CONNECTION_VERSION, } from './dsh-connection-adapter.js';
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,9 @@
1
+ import type { CodingNsSettings } from '../shared/contracts/config.js';
2
+ import type { CodingNsRpcClient } from './features/types.js';
3
+ import type { SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client';
4
+ export interface AccountBarController {
5
+ dispose(): void;
6
+ }
7
+ /** 在 DSH 设置触发器旁挂载统一账户入口,兼容侧栏横排与收起竖排。 */
8
+ export declare function startCodingNsAccountBar(rpc: CodingNsRpcClient, dom?: Document, settings?: SettingsScope<CodingNsSettings>): AccountBarController;
9
+ //# sourceMappingURL=account-bar.d.ts.map