@jingyi0605/codingns4dsh 0.2.0-rc.2 → 0.2.0-rc.3

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 (353) hide show
  1. package/README.en.md +4 -4
  2. package/README.md +15 -6
  3. package/assets/provider-icons/antigravity.svg +39 -0
  4. package/assets/provider-icons/codebuddy.svg +37 -0
  5. package/assets/provider-icons/cursor-cli.svg +1 -0
  6. package/assets/provider-icons/kiro-cli.svg +11 -0
  7. package/assets/provider-icons/qoder-cn.svg +5 -0
  8. package/assets/provider-icons/qoder.svg +5 -0
  9. package/assets/provider-icons/workbuddy.svg +29 -0
  10. package/data/build/dist/bootstrap/dsh-peer-host-preboot-shim.d.ts.map +1 -1
  11. package/data/build/dist/bootstrap/dsh-peer-host-preboot-shim.js +78 -1
  12. package/data/build/dist/bootstrap/dsh-peer-host-preboot-shim.js.map +1 -1
  13. package/data/build/dist/client/bundle.js +3864 -507
  14. package/data/build/dist/client/bundle.js.map +1 -1
  15. package/data/build/dist/client/cli-catalog.d.ts +1 -1
  16. package/data/build/dist/client/cli-catalog.d.ts.map +1 -1
  17. package/data/build/dist/client/cli-catalog.js +11 -5
  18. package/data/build/dist/client/cli-catalog.js.map +1 -1
  19. package/data/build/dist/client/cli-slots.d.ts.map +1 -1
  20. package/data/build/dist/client/cli-slots.js +111 -13
  21. package/data/build/dist/client/cli-slots.js.map +1 -1
  22. package/data/build/dist/client/debug/ui.d.ts.map +1 -1
  23. package/data/build/dist/client/debug/ui.js +2 -1
  24. package/data/build/dist/client/debug/ui.js.map +1 -1
  25. package/data/build/dist/client/delegate-command.d.ts +1 -0
  26. package/data/build/dist/client/delegate-command.d.ts.map +1 -1
  27. package/data/build/dist/client/delegate-command.js +486 -27
  28. package/data/build/dist/client/delegate-command.js.map +1 -1
  29. package/data/build/dist/client/delegate-plan.d.ts +13 -4
  30. package/data/build/dist/client/delegate-plan.d.ts.map +1 -1
  31. package/data/build/dist/client/delegate-plan.js +10 -6
  32. package/data/build/dist/client/delegate-plan.js.map +1 -1
  33. package/data/build/dist/client/delegate-ui-dom.d.ts +46 -0
  34. package/data/build/dist/client/delegate-ui-dom.d.ts.map +1 -1
  35. package/data/build/dist/client/delegate-ui-dom.js +291 -7
  36. package/data/build/dist/client/delegate-ui-dom.js.map +1 -1
  37. package/data/build/dist/client/features/cli-adapters.d.ts.map +1 -1
  38. package/data/build/dist/client/features/cli-adapters.js +117 -8
  39. package/data/build/dist/client/features/cli-adapters.js.map +1 -1
  40. package/data/build/dist/client/features/mobile-access-panel.d.ts.map +1 -1
  41. package/data/build/dist/client/features/mobile-access-panel.js +8 -7
  42. package/data/build/dist/client/features/mobile-access-panel.js.map +1 -1
  43. package/data/build/dist/client/features/peer-host.d.ts +6 -4
  44. package/data/build/dist/client/features/peer-host.d.ts.map +1 -1
  45. package/data/build/dist/client/features/peer-host.js +346 -18
  46. package/data/build/dist/client/features/peer-host.js.map +1 -1
  47. package/data/build/dist/client/git-history-graph.d.ts +2 -2
  48. package/data/build/dist/client/git-history-graph.d.ts.map +1 -1
  49. package/data/build/dist/client/git-history-graph.js +2 -2
  50. package/data/build/dist/client/git-history-graph.js.map +1 -1
  51. package/data/build/dist/client/git-management.d.ts.map +1 -1
  52. package/data/build/dist/client/git-management.js +21 -1
  53. package/data/build/dist/client/git-management.js.map +1 -1
  54. package/data/build/dist/client/locale.d.ts.map +1 -1
  55. package/data/build/dist/client/locale.js +60 -6
  56. package/data/build/dist/client/locale.js.map +1 -1
  57. package/data/build/dist/client/locales/terminalAuth.d.ts.map +1 -1
  58. package/data/build/dist/client/locales/terminalAuth.js +4 -0
  59. package/data/build/dist/client/locales/terminalAuth.js.map +1 -1
  60. package/data/build/dist/client/locales/usage.d.ts.map +1 -1
  61. package/data/build/dist/client/locales/usage.js +20 -0
  62. package/data/build/dist/client/locales/usage.js.map +1 -1
  63. package/data/build/dist/client/mobile-session-interaction.d.ts.map +1 -1
  64. package/data/build/dist/client/mobile-session-interaction.js +24 -7
  65. package/data/build/dist/client/mobile-session-interaction.js.map +1 -1
  66. package/data/build/dist/client/mobile-sidebar-gestures.d.ts +55 -7
  67. package/data/build/dist/client/mobile-sidebar-gestures.d.ts.map +1 -1
  68. package/data/build/dist/client/mobile-sidebar-gestures.js +339 -40
  69. package/data/build/dist/client/mobile-sidebar-gestures.js.map +1 -1
  70. package/data/build/dist/client/model-catalog-cache.d.ts +5 -0
  71. package/data/build/dist/client/model-catalog-cache.d.ts.map +1 -0
  72. package/data/build/dist/client/model-catalog-cache.js +58 -0
  73. package/data/build/dist/client/model-catalog-cache.js.map +1 -0
  74. package/data/build/dist/client/peer-host-aggregate-refresh.d.ts +7 -0
  75. package/data/build/dist/client/peer-host-aggregate-refresh.d.ts.map +1 -1
  76. package/data/build/dist/client/peer-host-aggregate-refresh.js +13 -1
  77. package/data/build/dist/client/peer-host-aggregate-refresh.js.map +1 -1
  78. package/data/build/dist/client/peer-host-native-projection.d.ts +16 -1
  79. package/data/build/dist/client/peer-host-native-projection.d.ts.map +1 -1
  80. package/data/build/dist/client/peer-host-native-projection.js +49 -8
  81. package/data/build/dist/client/peer-host-native-projection.js.map +1 -1
  82. package/data/build/dist/client/peer-host-native-store-projection.d.ts +6 -2
  83. package/data/build/dist/client/peer-host-native-store-projection.d.ts.map +1 -1
  84. package/data/build/dist/client/peer-host-native-store-projection.js +308 -10
  85. package/data/build/dist/client/peer-host-native-store-projection.js.map +1 -1
  86. package/data/build/dist/client/provider-icon-assets.js +14 -0
  87. package/data/build/dist/client/provider-icon-assets.js.map +1 -1
  88. package/data/build/dist/client/provider-icons.d.ts.map +1 -1
  89. package/data/build/dist/client/provider-icons.js +15 -3
  90. package/data/build/dist/client/provider-icons.js.map +1 -1
  91. package/data/build/dist/client/remote-web-context.js +10 -6
  92. package/data/build/dist/client/remote-web-context.js.map +1 -1
  93. package/data/build/dist/client/service-tier.d.ts +54 -0
  94. package/data/build/dist/client/service-tier.d.ts.map +1 -0
  95. package/data/build/dist/client/service-tier.js +78 -0
  96. package/data/build/dist/client/service-tier.js.map +1 -0
  97. package/data/build/dist/client/settings-promo-styles.d.ts +28 -0
  98. package/data/build/dist/client/settings-promo-styles.d.ts.map +1 -0
  99. package/data/build/dist/client/settings-promo-styles.js +58 -0
  100. package/data/build/dist/client/settings-promo-styles.js.map +1 -0
  101. package/data/build/dist/client/settings-promo.d.ts +14 -0
  102. package/data/build/dist/client/settings-promo.d.ts.map +1 -0
  103. package/data/build/dist/client/settings-promo.js +68 -0
  104. package/data/build/dist/client/settings-promo.js.map +1 -0
  105. package/data/build/dist/client/settings-section.d.ts +2 -1
  106. package/data/build/dist/client/settings-section.d.ts.map +1 -1
  107. package/data/build/dist/client/settings-section.js +7 -4
  108. package/data/build/dist/client/settings-section.js.map +1 -1
  109. package/data/build/dist/client/subscription-slot.d.ts.map +1 -1
  110. package/data/build/dist/client/subscription-slot.js +181 -16
  111. package/data/build/dist/client/subscription-slot.js.map +1 -1
  112. package/data/build/dist/client/terminal/model.d.ts +82 -3
  113. package/data/build/dist/client/terminal/model.d.ts.map +1 -1
  114. package/data/build/dist/client/terminal/model.js +368 -29
  115. package/data/build/dist/client/terminal/model.js.map +1 -1
  116. package/data/build/dist/client/terminal/recovery.d.ts +16 -1
  117. package/data/build/dist/client/terminal/recovery.d.ts.map +1 -1
  118. package/data/build/dist/client/terminal/recovery.js +101 -39
  119. package/data/build/dist/client/terminal/recovery.js.map +1 -1
  120. package/data/build/dist/client/terminal/styles.d.ts +10 -0
  121. package/data/build/dist/client/terminal/styles.d.ts.map +1 -1
  122. package/data/build/dist/client/terminal/styles.js +27 -3
  123. package/data/build/dist/client/terminal/styles.js.map +1 -1
  124. package/data/build/dist/client/terminal/ui.d.ts +3 -2
  125. package/data/build/dist/client/terminal/ui.d.ts.map +1 -1
  126. package/data/build/dist/client/terminal/ui.js +215 -104
  127. package/data/build/dist/client/terminal/ui.js.map +1 -1
  128. package/data/build/dist/client/terminal/xterm-view.d.ts +5 -1
  129. package/data/build/dist/client/terminal/xterm-view.d.ts.map +1 -1
  130. package/data/build/dist/client/terminal/xterm-view.js +378 -20
  131. package/data/build/dist/client/terminal/xterm-view.js.map +1 -1
  132. package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts +58 -0
  133. package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts.map +1 -0
  134. package/data/build/dist/host/cli-adapters/acp-cli-driver.js +271 -0
  135. package/data/build/dist/host/cli-adapters/acp-cli-driver.js.map +1 -0
  136. package/data/build/dist/host/cli-adapters/antigravity-driver.d.ts +30 -0
  137. package/data/build/dist/host/cli-adapters/antigravity-driver.d.ts.map +1 -0
  138. package/data/build/dist/host/cli-adapters/antigravity-driver.js +210 -0
  139. package/data/build/dist/host/cli-adapters/antigravity-driver.js.map +1 -0
  140. package/data/build/dist/host/cli-adapters/claude-driver.js +1 -1
  141. package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -1
  142. package/data/build/dist/host/cli-adapters/codebuddy-driver.d.ts +139 -0
  143. package/data/build/dist/host/cli-adapters/codebuddy-driver.d.ts.map +1 -0
  144. package/data/build/dist/host/cli-adapters/codebuddy-driver.js +1721 -0
  145. package/data/build/dist/host/cli-adapters/codebuddy-driver.js.map +1 -0
  146. package/data/build/dist/host/cli-adapters/codebuddy-subscription.d.ts +53 -0
  147. package/data/build/dist/host/cli-adapters/codebuddy-subscription.d.ts.map +1 -0
  148. package/data/build/dist/host/cli-adapters/codebuddy-subscription.js +778 -0
  149. package/data/build/dist/host/cli-adapters/codebuddy-subscription.js.map +1 -0
  150. package/data/build/dist/host/cli-adapters/codex-driver.d.ts +12 -0
  151. package/data/build/dist/host/cli-adapters/codex-driver.d.ts.map +1 -1
  152. package/data/build/dist/host/cli-adapters/codex-driver.js +153 -6
  153. package/data/build/dist/host/cli-adapters/codex-driver.js.map +1 -1
  154. package/data/build/dist/host/cli-adapters/command-code-driver.d.ts +43 -3
  155. package/data/build/dist/host/cli-adapters/command-code-driver.d.ts.map +1 -1
  156. package/data/build/dist/host/cli-adapters/command-code-driver.js +637 -72
  157. package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -1
  158. package/data/build/dist/host/cli-adapters/command-code-history.d.ts +147 -0
  159. package/data/build/dist/host/cli-adapters/command-code-history.d.ts.map +1 -0
  160. package/data/build/dist/host/cli-adapters/command-code-history.js +659 -0
  161. package/data/build/dist/host/cli-adapters/command-code-history.js.map +1 -0
  162. package/data/build/dist/host/cli-adapters/cursor-driver.d.ts +12 -0
  163. package/data/build/dist/host/cli-adapters/cursor-driver.d.ts.map +1 -0
  164. package/data/build/dist/host/cli-adapters/cursor-driver.js +20 -0
  165. package/data/build/dist/host/cli-adapters/cursor-driver.js.map +1 -0
  166. package/data/build/dist/host/cli-adapters/custom-upstream-classifier.d.ts +67 -0
  167. package/data/build/dist/host/cli-adapters/custom-upstream-classifier.d.ts.map +1 -0
  168. package/data/build/dist/host/cli-adapters/custom-upstream-classifier.js +169 -0
  169. package/data/build/dist/host/cli-adapters/custom-upstream-classifier.js.map +1 -0
  170. package/data/build/dist/host/cli-adapters/delegate-dispatch.d.ts +2 -1
  171. package/data/build/dist/host/cli-adapters/delegate-dispatch.d.ts.map +1 -1
  172. package/data/build/dist/host/cli-adapters/delegate-dispatch.js +14 -61
  173. package/data/build/dist/host/cli-adapters/delegate-dispatch.js.map +1 -1
  174. package/data/build/dist/host/cli-adapters/delegation-authorization.d.ts +19 -0
  175. package/data/build/dist/host/cli-adapters/delegation-authorization.d.ts.map +1 -0
  176. package/data/build/dist/host/cli-adapters/delegation-authorization.js +49 -0
  177. package/data/build/dist/host/cli-adapters/delegation-authorization.js.map +1 -0
  178. package/data/build/dist/host/cli-adapters/delegation-mention-rewrite.d.ts +34 -0
  179. package/data/build/dist/host/cli-adapters/delegation-mention-rewrite.d.ts.map +1 -0
  180. package/data/build/dist/host/cli-adapters/delegation-mention-rewrite.js +121 -0
  181. package/data/build/dist/host/cli-adapters/delegation-mention-rewrite.js.map +1 -0
  182. package/data/build/dist/host/cli-adapters/driver.d.ts +6 -0
  183. package/data/build/dist/host/cli-adapters/driver.d.ts.map +1 -1
  184. package/data/build/dist/host/cli-adapters/feature.d.ts.map +1 -1
  185. package/data/build/dist/host/cli-adapters/feature.js +269 -18
  186. package/data/build/dist/host/cli-adapters/feature.js.map +1 -1
  187. package/data/build/dist/host/cli-adapters/kiro-driver.d.ts +12 -0
  188. package/data/build/dist/host/cli-adapters/kiro-driver.d.ts.map +1 -0
  189. package/data/build/dist/host/cli-adapters/kiro-driver.js +18 -0
  190. package/data/build/dist/host/cli-adapters/kiro-driver.js.map +1 -0
  191. package/data/build/dist/host/cli-adapters/legacy-session-adapter.d.ts.map +1 -1
  192. package/data/build/dist/host/cli-adapters/legacy-session-adapter.js +11 -0
  193. package/data/build/dist/host/cli-adapters/legacy-session-adapter.js.map +1 -1
  194. package/data/build/dist/host/cli-adapters/model-catalog.d.ts +5 -0
  195. package/data/build/dist/host/cli-adapters/model-catalog.d.ts.map +1 -1
  196. package/data/build/dist/host/cli-adapters/model-catalog.js +130 -0
  197. package/data/build/dist/host/cli-adapters/model-catalog.js.map +1 -1
  198. package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts +33 -3
  199. package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts.map +1 -1
  200. package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js +115 -9
  201. package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js.map +1 -1
  202. package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts +14 -2
  203. package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts.map +1 -1
  204. package/data/build/dist/host/cli-adapters/native-team-subagent.js +23 -4
  205. package/data/build/dist/host/cli-adapters/native-team-subagent.js.map +1 -1
  206. package/data/build/dist/host/cli-adapters/new-api-subscription.d.ts +75 -0
  207. package/data/build/dist/host/cli-adapters/new-api-subscription.d.ts.map +1 -0
  208. package/data/build/dist/host/cli-adapters/new-api-subscription.js +959 -0
  209. package/data/build/dist/host/cli-adapters/new-api-subscription.js.map +1 -0
  210. package/data/build/dist/host/cli-adapters/opencode-driver.d.ts.map +1 -1
  211. package/data/build/dist/host/cli-adapters/opencode-driver.js +9 -7
  212. package/data/build/dist/host/cli-adapters/opencode-driver.js.map +1 -1
  213. package/data/build/dist/host/cli-adapters/provider-subscription.d.ts +33 -3
  214. package/data/build/dist/host/cli-adapters/provider-subscription.d.ts.map +1 -1
  215. package/data/build/dist/host/cli-adapters/provider-subscription.js +158 -40
  216. package/data/build/dist/host/cli-adapters/provider-subscription.js.map +1 -1
  217. package/data/build/dist/host/cli-adapters/qoder-driver.d.ts +71 -0
  218. package/data/build/dist/host/cli-adapters/qoder-driver.d.ts.map +1 -0
  219. package/data/build/dist/host/cli-adapters/qoder-driver.js +553 -0
  220. package/data/build/dist/host/cli-adapters/qoder-driver.js.map +1 -0
  221. package/data/build/dist/host/cli-adapters/qoder-subscription.d.ts +31 -0
  222. package/data/build/dist/host/cli-adapters/qoder-subscription.d.ts.map +1 -0
  223. package/data/build/dist/host/cli-adapters/qoder-subscription.js +178 -0
  224. package/data/build/dist/host/cli-adapters/qoder-subscription.js.map +1 -0
  225. package/data/build/dist/host/cli-adapters/registry.d.ts +41 -2
  226. package/data/build/dist/host/cli-adapters/registry.d.ts.map +1 -1
  227. package/data/build/dist/host/cli-adapters/registry.js +187 -18
  228. package/data/build/dist/host/cli-adapters/registry.js.map +1 -1
  229. package/data/build/dist/host/cli-adapters/session-store.d.ts +4 -0
  230. package/data/build/dist/host/cli-adapters/session-store.d.ts.map +1 -1
  231. package/data/build/dist/host/cli-adapters/session-store.js +18 -2
  232. package/data/build/dist/host/cli-adapters/session-store.js.map +1 -1
  233. package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts +14 -1
  234. package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts.map +1 -1
  235. package/data/build/dist/host/cli-adapters/standard-stream-driver.js +121 -23
  236. package/data/build/dist/host/cli-adapters/standard-stream-driver.js.map +1 -1
  237. package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts +10 -1
  238. package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts.map +1 -1
  239. package/data/build/dist/host/cli-adapters/stream-normalizer.js +23 -0
  240. package/data/build/dist/host/cli-adapters/stream-normalizer.js.map +1 -1
  241. package/data/build/dist/host/cli-adapters/subagent-tool.d.ts.map +1 -1
  242. package/data/build/dist/host/cli-adapters/subagent-tool.js +53 -7
  243. package/data/build/dist/host/cli-adapters/subagent-tool.js.map +1 -1
  244. package/data/build/dist/host/cli-bridge/bridge-server.d.ts +5 -0
  245. package/data/build/dist/host/cli-bridge/bridge-server.d.ts.map +1 -1
  246. package/data/build/dist/host/cli-bridge/bridge-server.js +7 -2
  247. package/data/build/dist/host/cli-bridge/bridge-server.js.map +1 -1
  248. package/data/build/dist/host/cli-bridge/command-code-mod.d.ts +5 -1
  249. package/data/build/dist/host/cli-bridge/command-code-mod.d.ts.map +1 -1
  250. package/data/build/dist/host/cli-bridge/command-code-mod.js +43 -12
  251. package/data/build/dist/host/cli-bridge/command-code-mod.js.map +1 -1
  252. package/data/build/dist/host/cli-bridge/dispatch.d.ts.map +1 -1
  253. package/data/build/dist/host/cli-bridge/dispatch.js +43 -5
  254. package/data/build/dist/host/cli-bridge/dispatch.js.map +1 -1
  255. package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js +24 -5
  256. package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js.map +1 -1
  257. package/data/build/dist/host/features/peer-host.d.ts +21 -1
  258. package/data/build/dist/host/features/peer-host.d.ts.map +1 -1
  259. package/data/build/dist/host/features/peer-host.js +174 -30
  260. package/data/build/dist/host/features/peer-host.js.map +1 -1
  261. package/data/build/dist/host/features/types.d.ts +2 -0
  262. package/data/build/dist/host/features/types.d.ts.map +1 -1
  263. package/data/build/dist/host/index.d.ts +11 -1
  264. package/data/build/dist/host/index.d.ts.map +1 -1
  265. package/data/build/dist/host/index.js +12 -2
  266. package/data/build/dist/host/index.js.map +1 -1
  267. package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.js +6 -1
  268. package/data/build/dist/host/modules/peer-host/peer-host-native-protocol.js.map +1 -1
  269. package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.d.ts +2 -0
  270. package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.d.ts.map +1 -1
  271. package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.js +26 -7
  272. package/data/build/dist/host/modules/peer-host/peer-host-virtual-registry.js.map +1 -1
  273. package/data/build/dist/host/native-session-bridge.d.ts.map +1 -1
  274. package/data/build/dist/host/native-session-bridge.js +36 -7
  275. package/data/build/dist/host/native-session-bridge.js.map +1 -1
  276. package/data/build/dist/host/rpc.js +5 -2
  277. package/data/build/dist/host/rpc.js.map +1 -1
  278. package/data/build/dist/host/settings.d.ts.map +1 -1
  279. package/data/build/dist/host/settings.js +12 -5
  280. package/data/build/dist/host/settings.js.map +1 -1
  281. package/data/build/dist/host/terminal/backends/local-pty-backend.d.ts.map +1 -1
  282. package/data/build/dist/host/terminal/backends/local-pty-backend.js +14 -0
  283. package/data/build/dist/host/terminal/backends/local-pty-backend.js.map +1 -1
  284. package/data/build/dist/host/terminal/backends/tmux-backend.d.ts +40 -1
  285. package/data/build/dist/host/terminal/backends/tmux-backend.d.ts.map +1 -1
  286. package/data/build/dist/host/terminal/backends/tmux-backend.js +291 -18
  287. package/data/build/dist/host/terminal/backends/tmux-backend.js.map +1 -1
  288. package/data/build/dist/host/terminal/runtime-adapter.d.ts +32 -0
  289. package/data/build/dist/host/terminal/runtime-adapter.d.ts.map +1 -1
  290. package/data/build/dist/host/terminal/runtime-adapter.js +8 -0
  291. package/data/build/dist/host/terminal/runtime-adapter.js.map +1 -1
  292. package/data/build/dist/host/terminal/runtime-manager.d.ts +3 -0
  293. package/data/build/dist/host/terminal/runtime-manager.d.ts.map +1 -1
  294. package/data/build/dist/host/terminal/runtime-manager.js +92 -4
  295. package/data/build/dist/host/terminal/runtime-manager.js.map +1 -1
  296. package/data/build/dist/host/terminal/terminal-controller.d.ts.map +1 -1
  297. package/data/build/dist/host/terminal/terminal-controller.js +58 -6
  298. package/data/build/dist/host/terminal/terminal-controller.js.map +1 -1
  299. package/data/build/dist/host/terminal/terminal-process-service.d.ts.map +1 -1
  300. package/data/build/dist/host/terminal/terminal-process-service.js +12 -2
  301. package/data/build/dist/host/terminal/terminal-process-service.js.map +1 -1
  302. package/data/build/dist/host/terminal/terminal-service.d.ts +41 -4
  303. package/data/build/dist/host/terminal/terminal-service.d.ts.map +1 -1
  304. package/data/build/dist/host/terminal/terminal-service.js +551 -61
  305. package/data/build/dist/host/terminal/terminal-service.js.map +1 -1
  306. package/data/build/dist/index.d.ts +2 -2
  307. package/data/build/dist/index.d.ts.map +1 -1
  308. package/data/build/dist/index.js +2 -2
  309. package/data/build/dist/index.js.map +1 -1
  310. package/data/build/dist/shared/contracts/cli-adapter.d.ts +64 -2
  311. package/data/build/dist/shared/contracts/cli-adapter.d.ts.map +1 -1
  312. package/data/build/dist/shared/contracts/config.d.ts +54 -11
  313. package/data/build/dist/shared/contracts/config.d.ts.map +1 -1
  314. package/data/build/dist/shared/contracts/config.js +52 -8
  315. package/data/build/dist/shared/contracts/config.js.map +1 -1
  316. package/data/build/dist/shared/contracts/subscription.d.ts +5 -1
  317. package/data/build/dist/shared/contracts/subscription.d.ts.map +1 -1
  318. package/data/build/dist/shared/contracts/subscription.js.map +1 -1
  319. package/data/build/dist/shared/contracts/terminal.d.ts +8 -1
  320. package/data/build/dist/shared/contracts/terminal.d.ts.map +1 -1
  321. package/data/build/dist/shared/contracts/version.d.ts +1 -1
  322. package/data/build/dist/shared/contracts/version.js +1 -1
  323. package/data/build/dist/shared/debug.d.ts +8 -0
  324. package/data/build/dist/shared/debug.d.ts.map +1 -1
  325. package/data/build/dist/shared/debug.js +43 -7
  326. package/data/build/dist/shared/debug.js.map +1 -1
  327. package/data/build/dist/shared/delegation-carrier.d.ts +24 -0
  328. package/data/build/dist/shared/delegation-carrier.d.ts.map +1 -0
  329. package/data/build/dist/shared/delegation-carrier.js +111 -0
  330. package/data/build/dist/shared/delegation-carrier.js.map +1 -0
  331. package/data/build/dist/shared/index.d.ts +2 -2
  332. package/data/build/dist/shared/index.d.ts.map +1 -1
  333. package/data/build/dist/shared/index.js +2 -2
  334. package/data/build/dist/shared/index.js.map +1 -1
  335. package/data/build/dist/shared/terminal-input.d.ts +8 -0
  336. package/data/build/dist/shared/terminal-input.d.ts.map +1 -0
  337. package/data/build/dist/shared/terminal-input.js +10 -0
  338. package/data/build/dist/shared/terminal-input.js.map +1 -0
  339. package/data/build/dist/transport/debug.d.ts +7 -0
  340. package/data/build/dist/transport/debug.d.ts.map +1 -1
  341. package/data/build/dist/transport/debug.js +33 -5
  342. package/data/build/dist/transport/debug.js.map +1 -1
  343. package/data/build/dist/transport/index.d.ts +1 -1
  344. package/data/build/dist/transport/index.d.ts.map +1 -1
  345. package/data/build/dist/transport/index.js +1 -1
  346. package/data/build/dist/transport/index.js.map +1 -1
  347. package/data/build/dist/typert.host.js +1 -1
  348. package/data/build/dist/typert.host.js.map +1 -1
  349. package/package.json +1 -1
  350. package/profile/README.md +2 -2
  351. package/profile/package.json +2 -2
  352. package/profile/version.json +1 -1
  353. package/version.json +1 -1
@@ -15,35 +15,75 @@ export interface TouchSample {
15
15
  readonly t: number;
16
16
  }
17
17
  export interface SidebarGestureConfig {
18
- /** 触发阈值(像素)。 */
19
- readonly thresholdPx: number;
18
+ /**
19
+ * 触发手势所需的水平位移占视口宽度的比例(0–1,默认 0.25)。
20
+ *
21
+ * 用比例而不是像素:同一个像素值在 360px 手机与 1024px 平板上的手势占比相差
22
+ * 近三倍,只有比例才能让「灵敏度」设置在各类设备上表达同一件事。
23
+ */
24
+ readonly distanceRatio: number;
20
25
  /** 起手区域:`avoid` 避开系统边缘热区。 */
21
26
  readonly edgeMode: 'avoid' | 'edge';
22
27
  /** 方向映射:`swipe-inward` 为右滑开合左栏、左滑开合右栏;`swap` 互换。 */
23
28
  readonly mapping: 'swipe-inward' | 'swap';
24
29
  /** 当前视口宽度;用于判断右侧热区。 */
25
30
  readonly viewportWidth: number;
26
- /** 边缘热区宽度,默认 24px。 */
31
+ /** 边缘热区宽度,默认 12px。 */
27
32
  readonly edgeZonePx?: number;
28
33
  /** 方向锁定比(水平位移至少是垂直位移的多少倍),默认 1.5。 */
29
34
  readonly directionRatio?: number;
35
+ /** 甩动通道的最低整段平均速度(像素/毫秒),默认 0.5,即约 500 像素/秒。 */
36
+ readonly flickMinVelocityPxPerMs?: number;
37
+ /** 甩动通道需要的最小水平位移(像素),默认 48。 */
38
+ readonly flickMinDistancePx?: number;
30
39
  }
31
40
  export interface SidebarGestureDecision {
32
41
  readonly action: SidebarGestureAction;
33
42
  /** 稳定原因码,用于诊断与测试断言。 */
34
- readonly reason: 'ok' | 'samples' | 'config' | 'edge' | 'threshold' | 'direction';
43
+ readonly reason: 'ok' | 'samples' | 'config' | 'edge' | 'threshold' | 'direction' | 'flick';
35
44
  }
36
- export declare const DEFAULT_GESTURE_EDGE_ZONE_PX = 24;
45
+ /** 边缘热区只避让最窄的一条,给系统返回手势留空间又不至于让单手起手失效。 */
46
+ export declare const DEFAULT_GESTURE_EDGE_ZONE_PX = 12;
37
47
  export declare const DEFAULT_GESTURE_DIRECTION_RATIO = 1.5;
48
+ /**
49
+ * 距离通道门槛:跨过视口宽度的 25% 即触发。
50
+ *
51
+ * 该通道不再做速度二次否决。旧实现要求「距离与末端速度同时达标」,而人手松手前
52
+ * 必然减速,导致正常滑动被速度门槛系统性误杀,用户需要重复滑动。
53
+ */
54
+ export declare const DEFAULT_GESTURE_DISTANCE_RATIO = 0.25;
55
+ /** 比例设置的合法区间;与共享契约的 15–80 百分比一一对应。 */
56
+ export declare const MIN_GESTURE_DISTANCE_RATIO = 0.15;
57
+ export declare const MAX_GESTURE_DISTANCE_RATIO = 0.8;
58
+ /**
59
+ * 甩动通道:距离不足时的快速甩动逃生通道,任一达标即可触发。
60
+ *
61
+ * 这是 iOS `UISwipeGestureRecognizer`、Android `ViewConfiguration` 与主流手势库
62
+ * (react-swipeable、use-gesture)的通行做法:明确的快速甩动即使位移较短也应当响应。
63
+ */
64
+ export declare const DEFAULT_GESTURE_FLICK_MIN_VELOCITY_PX_PER_MS = 0.5;
65
+ export declare const DEFAULT_GESTURE_FLICK_MIN_DISTANCE_PX = 48;
38
66
  /** 与 DSH 窄屏断点保持一致;超过该宽度不安装全局触摸监听。 */
39
67
  export declare const DEFAULT_MOBILE_GESTURE_VIEWPORT_MAX_PX = 1024;
40
- /** 纯函数:只依据样本与配置给出动作,不读 DOM、不调服务。 */
68
+ /**
69
+ * 纯函数:只依据样本与配置给出动作,不读 DOM、不调服务。
70
+ *
71
+ * 判定采用「距离 OR 甩动」双通道:
72
+ * 1. 方向锁先排除纵向滚动意图;
73
+ * 2. 水平位移达到 `视口宽度 × distanceRatio` 直接触发;
74
+ * 3. 位移不足时,若达到 `flickMinDistancePx` 且整段平均速度达到 `flickMinVelocityPxPerMs`,
75
+ * 按快速甩动触发。
76
+ *
77
+ * 速度使用**整段平均速度**而不是末端窗口速度:自然滑动在松手前会减速,用末端速度
78
+ * 判「是否快速甩动」会误杀正常滑动。
79
+ */
41
80
  export declare function detectSidebarGesture(samples: readonly TouchSample[], config: SidebarGestureConfig): SidebarGestureDecision;
42
81
  export interface SidebarGestureSettings {
43
82
  readonly sidebarGestures: boolean;
44
83
  readonly sidebarGestureMapping: 'swipe-inward' | 'swap';
45
84
  readonly sidebarGestureEdge: 'avoid' | 'edge';
46
- readonly sidebarGestureThresholdPx: number;
85
+ /** 触发手势所需的水平位移占视口宽度的百分比(15–80)。 */
86
+ readonly sidebarGestureDistancePercent: number;
47
87
  }
48
88
  export interface SidebarGesturePorts {
49
89
  /** `ctx.layout`:只用到左栏开合。 */
@@ -94,4 +134,12 @@ export declare const GESTURE_DIAGNOSTIC_CAPABILITY_MISSING = "CODINGNS_GESTURE_C
94
134
  export declare const GESTURE_DIAGNOSTIC_NOT_MOBILE = "CODINGNS_GESTURE_NOT_MOBILE";
95
135
  /** 启动手势控制器;未启用或没有任何可用端口时不注册任何监听。 */
96
136
  export declare function startMobileSidebarGestures(options: MobileSidebarGestureOptions): MobileSidebarGestureController;
137
+ /**
138
+ * 判断触摸点是否位于可横向滚动的元素或其后代中。消息里的表格、代码块和长文本
139
+ * 包装器都依赖这个判断获得全局侧栏手势让位。
140
+ *
141
+ * 必须同时具备横向滚动样式和实际的 `scrollWidth > clientWidth`。只设置
142
+ * `overflow: auto` 的聊天纵向列表不能因此抢走左右侧栏唤起手势。
143
+ */
144
+ export declare function isHorizontalScrollableTarget(target: unknown): boolean;
97
145
  //# sourceMappingURL=mobile-sidebar-gestures.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mobile-sidebar-gestures.d.ts","sourceRoot":"","sources":["../../../../src/client/mobile-sidebar-gestures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;AAE9D,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,gBAAgB;IAChB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,6BAA6B;IAC7B,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAA;IACnC,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAAA;IACzC,uBAAuB;IACvB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,sBAAsB;IACtB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,qCAAqC;IACrC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,C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AE,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,SAAS,CAAA;IACpE,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAA;IAC5D,8CAA8C;IAC9C,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAAC,GAAG,SAAS,CAAA;IACpE,QAAQ,CAAC,MAAM,CAAC,EAAE,wBAAwB,GAAG,SAAS,CAAA;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,0BAA0B,GAAG,SAAS,CAAA;IAC1D,8BAA8B;IAC9B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5C;AAED,MAAM,WAAW,8BAA8B;IAC7C,OAAO,IAAI,IAAI,CAAA;IACf,oCAAoC;IACpC,OAAO,IAAI,OAAO,CAAA;CACnB;AAED,eAAO,MAAM,qCAAqC,wCAAwC,CAAA;AAC1F,eAAO,MAAM,6BAA6B,gCAAgC,CAAA;AAE1E,oCAAoC;AACpC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,2BAA2B,GAAG,8BAA8B,CA6Q/G;AAiJD;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAUrE"}
@@ -9,34 +9,106 @@
9
9
  * 方向锁定失败时立即释放,不 intercept 滚动。
10
10
  */
11
11
  import { vibrateMobile } from './mobile-vibration.js';
12
- export const DEFAULT_GESTURE_EDGE_ZONE_PX = 24;
12
+ /** 边缘热区只避让最窄的一条,给系统返回手势留空间又不至于让单手起手失效。 */
13
+ export const DEFAULT_GESTURE_EDGE_ZONE_PX = 12;
13
14
  export const DEFAULT_GESTURE_DIRECTION_RATIO = 1.5;
15
+ /**
16
+ * 距离通道门槛:跨过视口宽度的 25% 即触发。
17
+ *
18
+ * 该通道不再做速度二次否决。旧实现要求「距离与末端速度同时达标」,而人手松手前
19
+ * 必然减速,导致正常滑动被速度门槛系统性误杀,用户需要重复滑动。
20
+ */
21
+ export const DEFAULT_GESTURE_DISTANCE_RATIO = 0.25;
22
+ /** 比例设置的合法区间;与共享契约的 15–80 百分比一一对应。 */
23
+ export const MIN_GESTURE_DISTANCE_RATIO = 0.15;
24
+ export const MAX_GESTURE_DISTANCE_RATIO = 0.8;
25
+ /**
26
+ * 甩动通道:距离不足时的快速甩动逃生通道,任一达标即可触发。
27
+ *
28
+ * 这是 iOS `UISwipeGestureRecognizer`、Android `ViewConfiguration` 与主流手势库
29
+ * (react-swipeable、use-gesture)的通行做法:明确的快速甩动即使位移较短也应当响应。
30
+ */
31
+ export const DEFAULT_GESTURE_FLICK_MIN_VELOCITY_PX_PER_MS = 0.5;
32
+ export const DEFAULT_GESTURE_FLICK_MIN_DISTANCE_PX = 48;
14
33
  /** 与 DSH 窄屏断点保持一致;超过该宽度不安装全局触摸监听。 */
15
34
  export const DEFAULT_MOBILE_GESTURE_VIEWPORT_MAX_PX = 1024;
16
- /** 纯函数:只依据样本与配置给出动作,不读 DOM、不调服务。 */
35
+ /**
36
+ * 纯函数:只依据样本与配置给出动作,不读 DOM、不调服务。
37
+ *
38
+ * 判定采用「距离 OR 甩动」双通道:
39
+ * 1. 方向锁先排除纵向滚动意图;
40
+ * 2. 水平位移达到 `视口宽度 × distanceRatio` 直接触发;
41
+ * 3. 位移不足时,若达到 `flickMinDistancePx` 且整段平均速度达到 `flickMinVelocityPxPerMs`,
42
+ * 按快速甩动触发。
43
+ *
44
+ * 速度使用**整段平均速度**而不是末端窗口速度:自然滑动在松手前会减速,用末端速度
45
+ * 判「是否快速甩动」会误杀正常滑动。
46
+ */
17
47
  export function detectSidebarGesture(samples, config) {
18
- const thresholdPx = Number.isFinite(config.thresholdPx) ? config.thresholdPx : Number.NaN;
48
+ const evaluated = evaluateHorizontalGesture(samples, config);
49
+ if (evaluated.direction === null)
50
+ return { action: 'ignore', reason: evaluated.reason };
51
+ const inward = evaluated.direction > 0 ? 'left' : 'right';
52
+ const action = config.mapping === 'swap' ? (inward === 'left' ? 'right' : 'left') : inward;
53
+ return { action, reason: 'ok' };
54
+ }
55
+ /**
56
+ * 手势判定的唯一实现:返回有效方向或忽略原因。
57
+ *
58
+ * `detectSidebarGesture` 与控制器内的方向探测共用它,保证「能触发」和「能识别物理
59
+ * 方向」永远是同一套条件——否则甩动通道触发的手势会拿不到方向,右栏收起等依赖物理
60
+ * 方向的动作就会静默失效。
61
+ */
62
+ function evaluateHorizontalGesture(samples, config) {
63
+ const distanceRatio = Number.isFinite(config.distanceRatio) ? config.distanceRatio : Number.NaN;
19
64
  const viewportWidth = Number.isFinite(config.viewportWidth) ? config.viewportWidth : 0;
20
- if (!Number.isFinite(thresholdPx) || thresholdPx <= 0 || viewportWidth <= 0)
21
- return { action: 'ignore', reason: 'config' };
65
+ // 比例必须落在合法区间:0 会让任何抖动都触发,超过 1 则永远无法跨过。
66
+ if (!Number.isFinite(distanceRatio) || distanceRatio <= 0 || distanceRatio > 1 || viewportWidth <= 0) {
67
+ return { direction: null, reason: 'config' };
68
+ }
22
69
  if (samples.length < 2)
23
- return { action: 'ignore', reason: 'samples' };
70
+ return { direction: null, reason: 'samples' };
24
71
  const first = samples[0];
25
72
  const last = samples[samples.length - 1];
26
73
  const edgeZone = config.edgeZonePx ?? DEFAULT_GESTURE_EDGE_ZONE_PX;
27
74
  if (config.edgeMode === 'avoid' && (first.x <= edgeZone || first.x >= viewportWidth - edgeZone)) {
28
- return { action: 'ignore', reason: 'edge' };
75
+ return { direction: null, reason: 'edge' };
29
76
  }
30
77
  const dx = last.x - first.x;
31
78
  const dy = last.y - first.y;
32
- if (Math.abs(dx) < thresholdPx)
33
- return { action: 'ignore', reason: 'threshold' };
79
+ const distance = Math.abs(dx);
80
+ const vertical = Math.abs(dy);
34
81
  const ratio = config.directionRatio ?? DEFAULT_GESTURE_DIRECTION_RATIO;
35
- if (Math.abs(dx) < Math.abs(dy) * ratio)
36
- return { action: 'ignore', reason: 'direction' };
37
- const inward = dx > 0 ? 'left' : 'right';
38
- const action = config.mapping === 'swap' ? (inward === 'left' ? 'right' : 'left') : inward;
39
- return { action, reason: 'ok' };
82
+ const flickMinDistance = config.flickMinDistancePx ?? DEFAULT_GESTURE_FLICK_MIN_DISTANCE_PX;
83
+ if (!Number.isFinite(flickMinDistance) || flickMinDistance < 0)
84
+ return { direction: null, reason: 'config' };
85
+ const distanceThresholdPx = resolveDistanceThresholdPx(distanceRatio, viewportWidth);
86
+ const verticalDominant = distance < vertical * ratio;
87
+ // 距离通道:横向位移达标即触发,不再做速度二次否决。
88
+ if (distance >= distanceThresholdPx) {
89
+ if (verticalDominant)
90
+ return { direction: null, reason: 'direction' };
91
+ return { direction: dx > 0 ? 1 : -1, reason: 'ok' };
92
+ }
93
+ // 横向未达标。纵向占优时是否放弃,取决于运动量是否足够做出可靠判断。
94
+ // 起手阶段位移很小,轻微纵向漂移不代表滚动意图;此时必须保持跟踪,
95
+ // 否则一次正常横滑会被提前判死,用户就得再滑一次。
96
+ if (verticalDominant) {
97
+ const movement = Math.max(distance, vertical);
98
+ if (movement < flickMinDistance)
99
+ return { direction: null, reason: 'threshold' };
100
+ return { direction: null, reason: 'direction' };
101
+ }
102
+ // 甩动通道:横向意图明确但位移不足,快速甩动同样应当响应。
103
+ const flickMinVelocity = config.flickMinVelocityPxPerMs ?? DEFAULT_GESTURE_FLICK_MIN_VELOCITY_PX_PER_MS;
104
+ if (!Number.isFinite(flickMinVelocity) || flickMinVelocity <= 0)
105
+ return { direction: null, reason: 'config' };
106
+ if (distance < flickMinDistance)
107
+ return { direction: null, reason: 'threshold' };
108
+ const velocity = averageHorizontalVelocity(samples);
109
+ if (velocity === undefined || velocity < flickMinVelocity)
110
+ return { direction: null, reason: 'flick' };
111
+ return { direction: dx > 0 ? 1 : -1, reason: 'ok' };
40
112
  }
41
113
  export const GESTURE_DIAGNOSTIC_CAPABILITY_MISSING = 'CODINGNS_GESTURE_CAPABILITY_MISSING';
42
114
  export const GESTURE_DIAGNOSTIC_NOT_MOBILE = 'CODINGNS_GESTURE_NOT_MOBILE';
@@ -48,33 +120,92 @@ export function startMobileSidebarGestures(options) {
48
120
  let samples = [];
49
121
  let tracking = false;
50
122
  let claimed = false;
123
+ let rightbarTouch = false;
124
+ let scrollableTouch = false;
51
125
  let rightbarHistoryPushed = false;
52
126
  // 只有宿主没有提供左栏 DOM 状态时才使用这个乐观状态,保证测试环境和
53
127
  // 尚未完成 DOM 挂载的 WebView 仍能连续完成“打开后左滑关闭”。
54
128
  let leftCollapsedFallback;
55
129
  const onResize = () => { refresh(); };
56
130
  const onTouchStart = (event) => {
131
+ if (touchCount(event) !== 1) {
132
+ resetTracking();
133
+ return;
134
+ }
57
135
  const touch = firstTouch(event);
58
136
  if (touch === null)
59
137
  return;
60
- if (isEditableTarget(touch.target))
138
+ // 横向滚动容器优先接收触摸。右栏里的代码块、长文本和表格经常需要
139
+ // 左右拖动;如果这里继续记录样本,window 的全局监听会把右滑误判为
140
+ // “收起右栏”,浏览器也会因为后续 preventDefault 而丢掉原生滚动。
141
+ if (isEditableTouch(touch)) {
142
+ tracking = false;
143
+ claimed = false;
144
+ rightbarTouch = false;
145
+ scrollableTouch = false;
146
+ samples = [];
61
147
  return;
148
+ }
62
149
  tracking = true;
63
150
  claimed = false;
64
- samples = [{ x: touch.x, y: touch.y, t: now() }];
151
+ scrollableTouch = hasHorizontalScrollableTarget(touch);
152
+ // 横向滚动能力是内容优先级的稳定信号;消息中的表格、代码块和长文本都应
153
+ // 保留左右拖动,不应因为右栏当前未展开就被全局侧栏手势抢走。
154
+ rightbarTouch = isExpandedRightbar() && (isRightbarTarget(touch) || scrollableTouch);
155
+ samples = [{ x: touch.x, y: touch.y, t: eventTime(event) }];
65
156
  };
66
157
  const onTouchMove = (event) => {
67
158
  if (!tracking)
68
159
  return;
160
+ if (touchCount(event) > 1) {
161
+ resetTracking();
162
+ return;
163
+ }
69
164
  const touch = firstTouch(event);
70
165
  if (touch === null)
71
166
  return;
72
- samples.push({ x: touch.x, y: touch.y, t: now() });
73
- if (!claimed && samples.length <= 24) {
167
+ // 某些 WebView 在 touchstart 时只暴露宿主节点,直到 touchmove 才能从
168
+ // composedPath() 看到真正的滚动节点;这里再次检查,避免已经开始采样后
169
+ // 仍被全局侧栏手势抢走。
170
+ if (isEditableTouch(touch)) {
171
+ tracking = false;
172
+ claimed = false;
173
+ rightbarTouch = false;
174
+ scrollableTouch = false;
175
+ samples = [];
176
+ return;
177
+ }
178
+ samples.push({ x: touch.x, y: touch.y, t: eventTime(event) });
179
+ // 事件目标在部分 WebView 中会在 touchmove 才暴露真实宿主;右栏归属和横向
180
+ // 滚动祖先都要同步补探测,避免 Shadow DOM 或消息表格漏掉让位判断。
181
+ rightbarTouch ||= isExpandedRightbar() && isRightbarTarget(touch);
182
+ scrollableTouch ||= hasHorizontalScrollableTarget(touch);
183
+ const config = resolveConfig(options);
184
+ const horizontalDirection = detectHorizontalDirection(samples, config);
185
+ const shouldYieldToContent = horizontalDirection !== null
186
+ && (scrollableTouch || (rightbarTouch && horizontalDirection < 0));
187
+ if (shouldYieldToContent) {
188
+ // 可横向滚动内容无论当前是否处于滚动边界都优先接收手势,避免消息表格、
189
+ // 代码块在边界处的拖动被误判为侧栏开合;右栏非滚动面板的左滑仍交给面板。
190
+ tracking = false;
191
+ claimed = false;
192
+ rightbarTouch = false;
193
+ scrollableTouch = false;
194
+ samples = [];
195
+ return;
196
+ }
197
+ if (!claimed) {
74
198
  const decision = detectSidebarGesture(samples, resolveConfig(options));
75
199
  if (decision.reason === 'ok') {
200
+ const handled = applyAction(decision.action, horizontalDirection ?? undefined);
201
+ if (!handled) {
202
+ // 右栏展开时的物理左滑没有侧栏动作,释放本次触摸,避免既阻止
203
+ // 原生内容交互又在后续 move 中重复判定。
204
+ tracking = false;
205
+ samples = [];
206
+ return;
207
+ }
76
208
  claimed = true;
77
- applyAction(decision.action);
78
209
  preventDefault(event);
79
210
  return;
80
211
  }
@@ -89,9 +220,7 @@ export function startMobileSidebarGestures(options) {
89
220
  preventDefault(event);
90
221
  };
91
222
  const onTouchEnd = () => {
92
- tracking = false;
93
- claimed = false;
94
- samples = [];
223
+ resetTracking();
95
224
  };
96
225
  const onPopState = () => {
97
226
  if (!rightbarHistoryPushed)
@@ -100,24 +229,25 @@ export function startMobileSidebarGestures(options) {
100
229
  if (options.ports.sidebarRight?.isExpanded() === true)
101
230
  options.ports.sidebarRight.toggleExpanded();
102
231
  };
103
- const applyAction = (action) => {
232
+ const applyAction = (action, physicalDirection) => {
104
233
  if (action === 'ignore')
105
- return;
106
- // 仅在手势真正触发开合后反馈,避免滚动和方向锁定失败时误振动。
107
- triggerVibration(10);
234
+ return false;
108
235
  const sidebarRight = options.ports.sidebarRight;
109
- if (action === 'left') {
110
- // 与左栏保持对称:右栏由左滑呼出后,下一次反向右滑应先收回右栏,
111
- // 不能把同一次操作解释成呼出左栏。右栏状态由端口提供,是唯一事实来源。
112
- if (sidebarRight?.isExpanded() === true) {
236
+ if (sidebarRight?.isExpanded() === true) {
237
+ if (physicalDirection === 1) {
238
+ triggerVibration(10);
113
239
  sidebarRight.toggleExpanded();
114
- // 该历史记录只服务于“返回键关闭右栏”;手势已经主动关闭时不应再
115
- // 在后续 popstate 中重复尝试关闭。
116
240
  rightbarHistoryPushed = false;
117
- return;
241
+ return true;
118
242
  }
243
+ // 右栏打开时,物理左滑只交给内部内容,不再触发任何收起动作。
244
+ return false;
245
+ }
246
+ // 仅在手势真正触发开合后反馈,避免滚动和方向锁定失败时误振动。
247
+ triggerVibration(10);
248
+ if (action === 'left') {
119
249
  toggleLeftSidebar();
120
- return;
250
+ return true;
121
251
  }
122
252
  // 默认映射下物理左滑会得到 `right` 动作。左栏已经展开时,用户的意图
123
253
  // 是收回刚刚呼出的左栏,而不是再打开右栏;优先关闭左栏才能保持手势
@@ -125,16 +255,16 @@ export function startMobileSidebarGestures(options) {
125
255
  // 分支处理。
126
256
  if (readLeftCollapsed() === false && options.ports.layout !== undefined) {
127
257
  toggleLeftSidebar();
128
- return;
258
+ return true;
129
259
  }
130
260
  if (sidebarRight === undefined)
131
- return;
261
+ return false;
132
262
  const wasExpanded = sidebarRight.isExpanded() === true;
133
263
  sidebarRight.toggleExpanded();
134
264
  if (wasExpanded) {
135
265
  // 同方向再次触发也可能关闭右栏,保持历史状态与实际面板一致。
136
266
  rightbarHistoryPushed = false;
137
- return;
267
+ return true;
138
268
  }
139
269
  if (!wasExpanded && sidebarRight.isExpanded() === true && hostWindow?.history !== undefined) {
140
270
  // 全屏右栏压入一条历史记录:Android 返回手势与 iOS 边缘返回先关右栏。
@@ -146,11 +276,20 @@ export function startMobileSidebarGestures(options) {
146
276
  rightbarHistoryPushed = false;
147
277
  }
148
278
  }
279
+ return true;
149
280
  };
150
281
  const readLeftCollapsed = () => {
151
282
  const reported = options.readLeftCollapsed?.();
152
283
  return reported ?? leftCollapsedFallback;
153
284
  };
285
+ const isExpandedRightbar = () => {
286
+ try {
287
+ return options.ports.sidebarRight?.isExpanded() === true;
288
+ }
289
+ catch {
290
+ return false;
291
+ }
292
+ };
154
293
  /**
155
294
  * 将振动调用绑定到实际接收触摸事件的 Window。
156
295
  *
@@ -186,6 +325,13 @@ export function startMobileSidebarGestures(options) {
186
325
  if (reported === undefined)
187
326
  leftCollapsedFallback = before === undefined ? false : !before;
188
327
  };
328
+ const resetTracking = () => {
329
+ tracking = false;
330
+ claimed = false;
331
+ rightbarTouch = false;
332
+ scrollableTouch = false;
333
+ samples = [];
334
+ };
189
335
  const attach = () => {
190
336
  if (active)
191
337
  return;
@@ -263,12 +409,16 @@ function resolveConfig(options) {
263
409
  ? globalThis.innerWidth
264
410
  : 0;
265
411
  return {
266
- thresholdPx: settings.sidebarGestureThresholdPx,
412
+ distanceRatio: settings.sidebarGestureDistancePercent / 100,
267
413
  edgeMode: settings.sidebarGestureEdge,
268
414
  mapping: settings.sidebarGestureMapping,
269
415
  viewportWidth,
270
416
  };
271
417
  }
418
+ /** 把视口比例换算成像素门槛;这是判定距离的唯一入口。 */
419
+ function resolveDistanceThresholdPx(distanceRatio, viewportWidth) {
420
+ return viewportWidth * distanceRatio;
421
+ }
272
422
  function firstTouch(event) {
273
423
  if (typeof event !== 'object' || event === null)
274
424
  return null;
@@ -282,7 +432,77 @@ function firstTouch(event) {
282
432
  const y = first.clientY;
283
433
  if (typeof x !== 'number' || typeof y !== 'number' || !Number.isFinite(x) || !Number.isFinite(y))
284
434
  return null;
285
- return { x, y, target: event.target };
435
+ return { x, y, target: event.target, path: composedPathOf(event) };
436
+ }
437
+ function touchCount(event) {
438
+ if (typeof event !== 'object' || event === null)
439
+ return 0;
440
+ const list = event.touches;
441
+ if (typeof list !== 'object' || list === null)
442
+ return 0;
443
+ const length = list.length;
444
+ return typeof length === 'number' && Number.isFinite(length) ? length : 0;
445
+ }
446
+ function isEditableTouch(touch) {
447
+ const targets = [touch.target, ...touch.path];
448
+ return targets.some((target) => isEditableTarget(target));
449
+ }
450
+ function hasHorizontalScrollableTarget(touch) {
451
+ const targets = [touch.target, ...touch.path];
452
+ return targets.some((target) => isHorizontalScrollableTarget(target));
453
+ }
454
+ function isRightbarTarget(touch) {
455
+ const visited = new Set();
456
+ for (const target of [touch.target, ...touch.path]) {
457
+ let current = target;
458
+ for (let depth = 0; depth < 64 && isObjectLike(current); depth += 1) {
459
+ if (visited.has(current))
460
+ break;
461
+ visited.add(current);
462
+ const closest = current.closest;
463
+ if (typeof closest === 'function') {
464
+ try {
465
+ if (closest.call(current, '[data-sidebar-right-session]') !== null)
466
+ return true;
467
+ }
468
+ catch {
469
+ // 事件路径中的 Window、Document 或 ShadowRoot 可能没有可用的 closest。
470
+ }
471
+ }
472
+ current = parentElementOf(current);
473
+ }
474
+ }
475
+ return false;
476
+ }
477
+ function detectHorizontalDirection(samples, config) {
478
+ const evaluated = evaluateHorizontalGesture(samples, config);
479
+ return evaluated.direction;
480
+ }
481
+ /** 整段平均水平速度(像素/毫秒);反向回滑按 0 处理,避免折返被当成甩动。 */
482
+ function averageHorizontalVelocity(samples) {
483
+ if (samples.length < 2)
484
+ return undefined;
485
+ const first = samples[0];
486
+ const last = samples[samples.length - 1];
487
+ const elapsed = last.t - first.t;
488
+ if (!(elapsed > 0))
489
+ return undefined;
490
+ const dx = last.x - first.x;
491
+ if (dx === 0)
492
+ return 0;
493
+ return Math.abs(dx) / elapsed;
494
+ }
495
+ function composedPathOf(event) {
496
+ const method = event.composedPath;
497
+ if (typeof method !== 'function')
498
+ return [];
499
+ try {
500
+ const path = method.call(event);
501
+ return Array.isArray(path) ? path : [];
502
+ }
503
+ catch {
504
+ return [];
505
+ }
286
506
  }
287
507
  function preventDefault(event) {
288
508
  try {
@@ -303,14 +523,93 @@ function isEditableTarget(target) {
303
523
  if (typeof closest !== 'function')
304
524
  return false;
305
525
  try {
306
- return closest.call(target, 'input, textarea, select, [contenteditable="true"], .xterm, .cm-editor') !== null;
526
+ return closest.call(target, 'input, textarea, select, [contenteditable="true"], [data-sidebar-terminal], .xterm, .cm-editor') !== null;
307
527
  }
308
528
  catch {
309
529
  return false;
310
530
  }
311
531
  }
532
+ /**
533
+ * 判断触摸点是否位于可横向滚动的元素或其后代中。消息里的表格、代码块和长文本
534
+ * 包装器都依赖这个判断获得全局侧栏手势让位。
535
+ *
536
+ * 必须同时具备横向滚动样式和实际的 `scrollWidth > clientWidth`。只设置
537
+ * `overflow: auto` 的聊天纵向列表不能因此抢走左右侧栏唤起手势。
538
+ */
539
+ export function isHorizontalScrollableTarget(target) {
540
+ let current = target;
541
+ const visited = new Set();
542
+ for (let depth = 0; depth < 32 && isObjectLike(current); depth += 1) {
543
+ if (visited.has(current))
544
+ return false;
545
+ visited.add(current);
546
+ if (isHorizontalScrollableElement(current))
547
+ return true;
548
+ current = parentElementOf(current);
549
+ }
550
+ return false;
551
+ }
552
+ function isHorizontalScrollableElement(element) {
553
+ const scrollWidth = finiteNumber(element.scrollWidth);
554
+ const clientWidth = finiteNumber(element.clientWidth);
555
+ const overflowX = readOverflowX(element);
556
+ const canScrollX = overflowX === 'auto' || overflowX === 'scroll' || overflowX === 'overlay';
557
+ if (!canScrollX)
558
+ return false;
559
+ return scrollWidth !== undefined && clientWidth !== undefined && scrollWidth > clientWidth + 1;
560
+ }
561
+ function readOverflowX(element) {
562
+ const style = element.style;
563
+ const inline = typeof style?.overflowX === 'string' && style.overflowX.trim() !== ''
564
+ ? style.overflowX
565
+ : typeof style?.overflow === 'string' && style.overflow.trim() !== ''
566
+ ? style.overflow
567
+ : undefined;
568
+ if (inline !== undefined)
569
+ return normalizeOverflowValue(inline);
570
+ const ownerDocument = element.ownerDocument;
571
+ const view = isObjectLike(ownerDocument)
572
+ ? ownerDocument.defaultView
573
+ : undefined;
574
+ const getComputedStyle = isObjectLike(view)
575
+ ? view.getComputedStyle
576
+ : undefined;
577
+ if (typeof getComputedStyle !== 'function')
578
+ return undefined;
579
+ try {
580
+ const computed = getComputedStyle.call(view, element);
581
+ return typeof computed?.overflowX === 'string' ? normalizeOverflowValue(computed.overflowX) : undefined;
582
+ }
583
+ catch {
584
+ return undefined;
585
+ }
586
+ }
587
+ function normalizeOverflowValue(value) {
588
+ return value.trim().toLowerCase().split(/\s+/u)[0] ?? '';
589
+ }
590
+ function parentElementOf(value) {
591
+ const parentElement = value.parentElement;
592
+ if (isObjectLike(parentElement))
593
+ return parentElement;
594
+ const parentNode = value.parentNode;
595
+ return isObjectLike(parentNode) ? parentNode : undefined;
596
+ }
597
+ function isObjectLike(value) {
598
+ return typeof value === 'object' && value !== null;
599
+ }
600
+ function finiteNumber(value) {
601
+ return typeof value === 'number' && Number.isFinite(value) ? value : undefined;
602
+ }
312
603
  function now() {
313
604
  const performanceLike = globalThis.performance;
314
605
  return typeof performanceLike?.now === 'function' ? performanceLike.now() : Date.now();
315
606
  }
607
+ function eventTime(event) {
608
+ if (typeof event === 'object' && event !== null) {
609
+ const timeStamp = event.timeStamp;
610
+ if (typeof timeStamp === 'number' && Number.isFinite(timeStamp))
611
+ return timeStamp;
612
+ }
613
+ return now();
614
+ }
316
615
  //# sourceMappingURL=mobile-sidebar-gestures.js.map