@songtonyli/dsh-cli 0.1.90 → 0.1.91

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 (621) hide show
  1. package/README.md +1 -1
  2. package/bin/dsh.mjs +1 -1
  3. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +26 -13
  4. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +6 -3
  5. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +51 -1
  6. package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +2 -1
  7. package/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js +4 -2
  8. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/parseArn.js +4 -2
  9. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.js +18 -9
  10. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js +6 -3
  11. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +1 -0
  12. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.js +51 -0
  13. package/node_modules/@aws-sdk/core/dist-es/submodules/util/util-arn-parser/arn.js +2 -1
  14. package/node_modules/@aws-sdk/core/package.json +2 -2
  15. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  16. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  17. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  18. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  19. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  20. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  21. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  22. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  23. package/node_modules/@aws-sdk/middleware-eventstream/dist-cjs/index.js +4 -2
  24. package/node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHandlingMiddleware.js +2 -1
  25. package/node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHeaderMiddleware.js +2 -1
  26. package/node_modules/@aws-sdk/middleware-eventstream/package.json +1 -1
  27. package/node_modules/@aws-sdk/middleware-websocket/package.json +2 -2
  28. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  29. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  30. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  31. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  32. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  33. package/node_modules/@aws-sdk/nested-clients/package.json +3 -3
  34. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +1 -1
  35. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  36. package/node_modules/@aws-sdk/xml-builder/package.json +1 -1
  37. package/node_modules/@deepseek-ai/cordis/README.md +6 -2
  38. package/node_modules/@deepseek-ai/cordis/lib/index.js +955 -909
  39. package/node_modules/@deepseek-ai/cordis/src/context.ts +1 -1
  40. package/node_modules/@deepseek-ai/cordis/src/events.ts +81 -62
  41. package/node_modules/@deepseek-ai/cordis/src/fiber.ts +95 -58
  42. package/node_modules/@deepseek-ai/cordis/src/logger.ts +10 -5
  43. package/node_modules/@deepseek-ai/cordis/src/reflect.ts +37 -19
  44. package/node_modules/@deepseek-ai/cordis/src/utils.ts +28 -21
  45. package/node_modules/@deepseek-ai/cordis-plugin-include/lib/index.js +2 -2
  46. package/node_modules/@deepseek-ai/cordis-plugin-include/src/index.ts +2 -6
  47. package/node_modules/@deepseek-ai/cordis-plugin-loader/README.md +4 -0
  48. package/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js +40 -39
  49. package/node_modules/@deepseek-ai/cordis-plugin-loader/src/config/entry.ts +13 -13
  50. package/node_modules/@deepseek-ai/cordis-plugin-loader/src/config/group.ts +1 -3
  51. package/node_modules/@deepseek-ai/cordis-plugin-loader/src/config/isolate.ts +10 -7
  52. package/node_modules/@deepseek-ai/cordis-plugin-loader/src/index.ts +17 -20
  53. package/node_modules/@deepseek-ai/dsh/package.json +0 -1
  54. package/node_modules/@deepseek-ai/dsh-action-cards/lib/typert.host.js +1 -1
  55. package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-composition-reference/references/packages.md +5 -3
  56. package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-plugin-development/references/host-plugin.md +13 -0
  57. package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/index.js +2 -2
  58. package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/typert.host.js +1 -1
  59. package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/types/mount.js +2 -2
  60. package/node_modules/@deepseek-ai/dsh-api-gateway/lib/client.browser.js +1 -1
  61. package/node_modules/@deepseek-ai/dsh-api-gateway/lib/client.node.js +1 -1
  62. package/node_modules/@deepseek-ai/dsh-api-gateway/lib/types/client/remote-events.js +1 -1
  63. package/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +7464 -2004
  64. package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/client.js +77 -92
  65. package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +47 -3
  66. package/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/typert.host.js +1 -1
  67. package/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js +8 -19
  68. package/node_modules/@deepseek-ai/dsh-base/cordis.patch.yml +3 -0
  69. package/node_modules/@deepseek-ai/dsh-client-file-upload/lib/typert.host.js +1 -1
  70. package/node_modules/@deepseek-ai/dsh-client-modules/README.i18n.yaml +2 -2
  71. package/node_modules/@deepseek-ai/dsh-client-modules/README.md +3 -1
  72. package/node_modules/@deepseek-ai/dsh-client-modules/README.zh.md +3 -1
  73. package/node_modules/@deepseek-ai/dsh-client-modules/lib/client.js +1 -1
  74. package/node_modules/@deepseek-ai/dsh-client-modules/lib/index.js +37 -15
  75. package/node_modules/@deepseek-ai/dsh-client-ui-attachment/README.i18n.yaml +4 -4
  76. package/node_modules/@deepseek-ai/dsh-client-ui-attachment/README.md +3 -1
  77. package/node_modules/@deepseek-ai/dsh-client-ui-attachment/README.zh.md +3 -1
  78. package/node_modules/@deepseek-ai/dsh-client-ui-attachment/lib/client.js +19 -6
  79. package/node_modules/@deepseek-ai/dsh-client-ui-attachment/package.json +4 -2
  80. package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.i18n.yaml +10 -10
  81. package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.md +8 -2
  82. package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.zh.md +8 -2
  83. package/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.js +146 -30
  84. package/node_modules/@deepseek-ai/dsh-client-ui-chat/package.json +4 -2
  85. package/node_modules/@deepseek-ai/dsh-client-ui-commands/README.i18n.yaml +2 -2
  86. package/node_modules/@deepseek-ai/dsh-client-ui-commands/README.md +1 -1
  87. package/node_modules/@deepseek-ai/dsh-client-ui-commands/README.zh.md +1 -1
  88. package/node_modules/@deepseek-ai/dsh-client-ui-commands/lib/client.js +295 -274
  89. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/README.i18n.yaml +40 -0
  90. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/README.md +100 -0
  91. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/README.zh.md +100 -0
  92. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/lib/client.js +1445 -0
  93. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/lib/index.js +6 -0
  94. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/de.json +5 -0
  95. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/en.json +5 -0
  96. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/es.json +5 -0
  97. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/fr.json +5 -0
  98. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/ja.json +5 -0
  99. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/pt.json +5 -0
  100. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/ru.json +5 -0
  101. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/zh.json +5 -0
  102. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/package.json +61 -0
  103. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.i18n.yaml +4 -4
  104. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.md +4 -0
  105. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.zh.md +4 -0
  106. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +119 -55
  107. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/package.json +4 -2
  108. package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.i18n.yaml +2 -2
  109. package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.md +2 -0
  110. package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.zh.md +2 -0
  111. package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/client.js +19 -7
  112. package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/package.json +4 -2
  113. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/README.i18n.yaml +40 -0
  114. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/README.md +92 -0
  115. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/README.zh.md +92 -0
  116. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/lib/client.js +1875 -0
  117. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/lib/index.js +6 -0
  118. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/de.json +5 -0
  119. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/en.json +5 -0
  120. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/es.json +5 -0
  121. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/fr.json +5 -0
  122. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/ja.json +5 -0
  123. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/pt.json +5 -0
  124. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/ru.json +5 -0
  125. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/zh.json +5 -0
  126. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/package.json +65 -0
  127. package/node_modules/@deepseek-ai/dsh-client-ui-layout/README.i18n.yaml +6 -6
  128. package/node_modules/@deepseek-ai/dsh-client-ui-layout/README.md +9 -3
  129. package/node_modules/@deepseek-ai/dsh-client-ui-layout/README.zh.md +9 -3
  130. package/node_modules/@deepseek-ai/dsh-client-ui-layout/lib/client.js +91 -26
  131. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.i18n.yaml +2 -2
  132. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.md +8 -0
  133. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.zh.md +8 -0
  134. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/client.js +431 -2
  135. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/package.json +13 -2
  136. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.i18n.yaml +8 -8
  137. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.md +6 -3
  138. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.zh.md +6 -3
  139. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/client.js +111 -48
  140. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/README.i18n.yaml +2 -2
  141. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/README.md +1 -1
  142. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/README.zh.md +1 -1
  143. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/lib/client.js +2 -1
  144. package/node_modules/@deepseek-ai/dsh-client-ui-reference/README.i18n.yaml +2 -2
  145. package/node_modules/@deepseek-ai/dsh-client-ui-reference/README.md +2 -0
  146. package/node_modules/@deepseek-ai/dsh-client-ui-reference/README.zh.md +2 -0
  147. package/node_modules/@deepseek-ai/dsh-client-ui-reference/lib/client.js +28 -5
  148. package/node_modules/@deepseek-ai/dsh-client-ui-reference/package.json +4 -2
  149. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.i18n.yaml +19 -19
  150. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.md +25 -39
  151. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.zh.md +23 -37
  152. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/client.js +10359 -3743
  153. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/package.json +1 -0
  154. package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.i18n.yaml +2 -2
  155. package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.md +1 -1
  156. package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.zh.md +1 -1
  157. package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/client.js +76 -58
  158. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.i18n.yaml +6 -6
  159. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.md +5 -1
  160. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.zh.md +5 -1
  161. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +46 -18
  162. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.i18n.yaml +8 -8
  163. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.md +7 -5
  164. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.zh.md +7 -5
  165. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.js +349 -251
  166. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/package.json +5 -2
  167. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/README.i18n.yaml +20 -14
  168. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/README.md +44 -11
  169. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/README.zh.md +44 -11
  170. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/client.js +1571 -472
  171. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/package.json +5 -3
  172. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.i18n.yaml +12 -12
  173. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.md +15 -7
  174. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.zh.md +15 -7
  175. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/client.js +435 -52
  176. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/package.json +4 -2
  177. package/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/client.js +8 -0
  178. package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.i18n.yaml +2 -2
  179. package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.md +1 -1
  180. package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.zh.md +1 -1
  181. package/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/client.js +1 -1
  182. package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.i18n.yaml +4 -4
  183. package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.md +5 -1
  184. package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.zh.md +5 -1
  185. package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +195 -59
  186. package/node_modules/@deepseek-ai/dsh-client-ui-tool/package.json +5 -2
  187. package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.i18n.yaml +4 -4
  188. package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.md +6 -2
  189. package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.zh.md +6 -2
  190. package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/client.js +127 -27
  191. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.i18n.yaml +15 -15
  192. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.md +16 -8
  193. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.zh.md +17 -8
  194. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +523 -480
  195. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/package.json +4 -2
  196. package/node_modules/@deepseek-ai/dsh-commands/README.i18n.yaml +4 -4
  197. package/node_modules/@deepseek-ai/dsh-commands/README.md +3 -0
  198. package/node_modules/@deepseek-ai/dsh-commands/README.zh.md +3 -0
  199. package/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +1 -1
  200. package/node_modules/@deepseek-ai/dsh-commands/lib/types/builtin.js +39 -0
  201. package/node_modules/@deepseek-ai/dsh-commands/package.json +5 -1
  202. package/node_modules/@deepseek-ai/dsh-compaction-basic/README.i18n.yaml +4 -10
  203. package/node_modules/@deepseek-ai/dsh-compaction-basic/README.md +2 -0
  204. package/node_modules/@deepseek-ai/dsh-compaction-basic/README.zh.md +2 -0
  205. package/node_modules/@deepseek-ai/dsh-cordis-client-runner/lib/client.js +233 -56
  206. package/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/typert.host.js +2 -2
  207. package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/README.i18n.yaml +2 -2
  208. package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/README.md +2 -0
  209. package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/README.zh.md +2 -0
  210. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.i18n.yaml +16 -19
  211. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.md +11 -22
  212. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.zh.md +11 -22
  213. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/lib/index.js +2 -0
  214. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/lib/client.js +1 -1
  215. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.i18n.yaml +12 -12
  216. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.md +18 -10
  217. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.zh.md +20 -12
  218. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/client.js +3338 -297
  219. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/index.js +159 -52
  220. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/typert.host.js +298 -18
  221. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/typert.remote-client.js +267 -13
  222. package/node_modules/@deepseek-ai/dsh-experimental-forge/README.i18n.yaml +2 -2
  223. package/node_modules/@deepseek-ai/dsh-experimental-forge/README.md +5 -1
  224. package/node_modules/@deepseek-ai/dsh-experimental-forge/README.zh.md +5 -1
  225. package/node_modules/@deepseek-ai/dsh-experimental-forge/lib/index.js +48 -6
  226. package/node_modules/@deepseek-ai/dsh-experimental-forge-github/README.i18n.yaml +8 -8
  227. package/node_modules/@deepseek-ai/dsh-experimental-forge-github/README.md +9 -5
  228. package/node_modules/@deepseek-ai/dsh-experimental-forge-github/README.zh.md +9 -5
  229. package/node_modules/@deepseek-ai/dsh-experimental-forge-github/lib/index.js +301 -31
  230. package/node_modules/@deepseek-ai/dsh-experimental-forge-github/package.json +1 -0
  231. package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/client.js +5 -58
  232. package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/index.js +5 -2
  233. package/node_modules/@deepseek-ai/dsh-experimental-liveshare/package.json +1 -1
  234. package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/lib/client.js +77 -92
  235. package/node_modules/@deepseek-ai/dsh-experimental-translator/lib/index.js +2 -2
  236. package/node_modules/@deepseek-ai/dsh-experimental-translator/lib/types/deepseek.js +2 -2
  237. package/node_modules/@deepseek-ai/dsh-fs/README.i18n.yaml +12 -12
  238. package/node_modules/@deepseek-ai/dsh-fs/README.md +15 -7
  239. package/node_modules/@deepseek-ai/dsh-fs/README.zh.md +15 -7
  240. package/node_modules/@deepseek-ai/dsh-fs/lib/index.js +21 -2
  241. package/node_modules/@deepseek-ai/dsh-fs/package.json +3 -0
  242. package/node_modules/@deepseek-ai/dsh-fs-local/README.i18n.yaml +4 -4
  243. package/node_modules/@deepseek-ai/dsh-fs-local/README.md +4 -2
  244. package/node_modules/@deepseek-ai/dsh-fs-local/README.zh.md +4 -2
  245. package/node_modules/@deepseek-ai/dsh-fs-local/lib/index.js +156 -30
  246. package/node_modules/@deepseek-ai/dsh-fs-local/package.json +2 -1
  247. package/node_modules/@deepseek-ai/dsh-fs-observation-policy/README.i18n.yaml +6 -6
  248. package/node_modules/@deepseek-ai/dsh-fs-observation-policy/README.md +4 -2
  249. package/node_modules/@deepseek-ai/dsh-fs-observation-policy/README.zh.md +4 -2
  250. package/node_modules/@deepseek-ai/dsh-fs-observation-policy/lib/index.js +12 -4
  251. package/node_modules/@deepseek-ai/dsh-fs-patch/LICENSE +235 -0
  252. package/node_modules/@deepseek-ai/dsh-fs-patch/README.i18n.yaml +40 -0
  253. package/node_modules/@deepseek-ai/dsh-fs-patch/README.md +112 -0
  254. package/node_modules/@deepseek-ai/dsh-fs-patch/README.zh.md +112 -0
  255. package/node_modules/@deepseek-ai/dsh-fs-patch/lib/index.js +275 -0
  256. package/node_modules/@deepseek-ai/dsh-fs-patch/package.json +35 -0
  257. package/node_modules/@deepseek-ai/dsh-fs-sandbox/README.i18n.yaml +6 -6
  258. package/node_modules/@deepseek-ai/dsh-fs-sandbox/README.md +4 -2
  259. package/node_modules/@deepseek-ai/dsh-fs-sandbox/README.zh.md +4 -2
  260. package/node_modules/@deepseek-ai/dsh-fs-sandbox/lib/index.js +24 -1
  261. package/node_modules/@deepseek-ai/dsh-goal/lib/typert.host.js +1 -1
  262. package/node_modules/@deepseek-ai/dsh-hmr/lib/index.js +4 -3
  263. package/node_modules/@deepseek-ai/dsh-llm/README.i18n.yaml +2 -2
  264. package/node_modules/@deepseek-ai/dsh-llm/README.md +2 -0
  265. package/node_modules/@deepseek-ai/dsh-llm/README.zh.md +2 -0
  266. package/node_modules/@deepseek-ai/dsh-llm/lib/typert.host.js +9 -1
  267. package/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js +4 -3
  268. package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.i18n.yaml +5 -2
  269. package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.md +7 -0
  270. package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.zh.md +7 -0
  271. package/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/index.js +27 -11
  272. package/node_modules/@deepseek-ai/dsh-official-bundles/README.i18n.yaml +2 -2
  273. package/node_modules/@deepseek-ai/dsh-official-bundles/README.md +1 -1
  274. package/node_modules/@deepseek-ai/dsh-official-bundles/README.zh.md +1 -1
  275. package/node_modules/@deepseek-ai/dsh-official-bundles/lib/index.js +86 -52
  276. package/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.host.js +1 -1
  277. package/node_modules/@deepseek-ai/dsh-plugin-manager/README.i18n.yaml +2 -2
  278. package/node_modules/@deepseek-ai/dsh-plugin-manager/README.md +4 -4
  279. package/node_modules/@deepseek-ai/dsh-plugin-manager/README.zh.md +4 -4
  280. package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/index.js +32 -12
  281. package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.host.js +31 -31
  282. package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.remote-client.js +27 -27
  283. package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/github-connection.js +13 -3
  284. package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/index.js +14 -2
  285. package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/install-spec.js +1 -1
  286. package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/operations.js +2 -0
  287. package/node_modules/@deepseek-ai/dsh-plugin-recommendations/lib/typert.host.js +1 -1
  288. package/node_modules/@deepseek-ai/dsh-schedule/README.i18n.yaml +72 -39
  289. package/node_modules/@deepseek-ai/dsh-schedule/README.md +180 -56
  290. package/node_modules/@deepseek-ai/dsh-schedule/README.zh.md +185 -61
  291. package/node_modules/@deepseek-ai/dsh-schedule/lib/index.js +1270 -992
  292. package/node_modules/@deepseek-ai/dsh-schedule/lib/typert.host.js +1842 -274
  293. package/node_modules/@deepseek-ai/dsh-schedule/lib/typert.remote-client.js +1712 -194
  294. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/delivery-history.js +7 -20
  295. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/domain.js +199 -655
  296. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/index.js +452 -204
  297. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/runtime.js +389 -70
  298. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/storage.js +85 -16
  299. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/types.js +1 -1
  300. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/update.js +72 -144
  301. package/node_modules/@deepseek-ai/dsh-schedule/package.json +5 -2
  302. package/node_modules/@deepseek-ai/dsh-sdk-app/README.i18n.yaml +12 -12
  303. package/node_modules/@deepseek-ai/dsh-sdk-app/README.md +7 -4
  304. package/node_modules/@deepseek-ai/dsh-sdk-app/README.zh.md +7 -4
  305. package/node_modules/@deepseek-ai/dsh-sdk-app/cordis.patch.yml +3 -0
  306. package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/README.i18n.yaml +52 -4
  307. package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/README.md +77 -1
  308. package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/README.zh.md +77 -1
  309. package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/index.js +306 -2
  310. package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/package.json +15 -0
  311. package/node_modules/@deepseek-ai/dsh-sdk-protocol/README.i18n.yaml +4 -4
  312. package/node_modules/@deepseek-ai/dsh-sdk-protocol/README.md +10 -2
  313. package/node_modules/@deepseek-ai/dsh-sdk-protocol/README.zh.md +10 -2
  314. package/node_modules/@deepseek-ai/dsh-sdk-protocol/package.json +2 -0
  315. package/node_modules/@deepseek-ai/dsh-session-log-deepseek/README.i18n.yaml +9 -6
  316. package/node_modules/@deepseek-ai/dsh-session-log-deepseek/README.md +20 -1
  317. package/node_modules/@deepseek-ai/dsh-session-log-deepseek/README.zh.md +20 -1
  318. package/node_modules/@deepseek-ai/dsh-session-log-deepseek/lib/index.js +91 -57
  319. package/node_modules/@deepseek-ai/dsh-session-log-deepseek/lib/types/index.js +100 -66
  320. package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/worker.cjs +947 -917
  321. package/node_modules/@deepseek-ai/dsh-session-reference/lib/typert.host.js +1 -1
  322. package/node_modules/@deepseek-ai/dsh-session-title-llm/README.i18n.yaml +2 -2
  323. package/node_modules/@deepseek-ai/dsh-session-title-llm/README.md +1 -1
  324. package/node_modules/@deepseek-ai/dsh-session-title-llm/README.zh.md +1 -1
  325. package/node_modules/@deepseek-ai/dsh-settings/lib/index.js +2 -2
  326. package/node_modules/@deepseek-ai/dsh-settings/lib/types/index.js +2 -2
  327. package/node_modules/@deepseek-ai/dsh-subagent/lib/typert.host.js +1 -1
  328. package/node_modules/@deepseek-ai/dsh-system-prompt/lib/index.js +2 -0
  329. package/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +260 -92
  330. package/node_modules/@deepseek-ai/dsh-tool-fs/README.i18n.yaml +38 -20
  331. package/node_modules/@deepseek-ai/dsh-tool-fs/README.md +63 -5
  332. package/node_modules/@deepseek-ai/dsh-tool-fs/README.zh.md +63 -5
  333. package/node_modules/@deepseek-ai/dsh-tool-fs/lib/index.js +784 -27
  334. package/node_modules/@deepseek-ai/dsh-tool-fs/package.json +4 -1
  335. package/node_modules/@deepseek-ai/dsh-tool-schedule/README.i18n.yaml +50 -32
  336. package/node_modules/@deepseek-ai/dsh-tool-schedule/README.md +47 -20
  337. package/node_modules/@deepseek-ai/dsh-tool-schedule/README.zh.md +47 -20
  338. package/node_modules/@deepseek-ai/dsh-tool-schedule/lib/index.js +477 -445
  339. package/node_modules/@deepseek-ai/dsh-tool-schedule/package.json +7 -2
  340. package/node_modules/@deepseek-ai/dsh-user-questions/lib/typert.host.js +1 -1
  341. package/node_modules/@deepseek-ai/dsh-util-time/README.i18n.yaml +10 -10
  342. package/node_modules/@deepseek-ai/dsh-util-time/README.md +11 -7
  343. package/node_modules/@deepseek-ai/dsh-util-time/README.zh.md +11 -7
  344. package/node_modules/@deepseek-ai/dsh-util-time/lib/index.js +1020 -3
  345. package/node_modules/@deepseek-ai/dsh-util-time/package.json +4 -2
  346. package/node_modules/@deepseek-ai/dsh-util-values/README.i18n.yaml +2 -2
  347. package/node_modules/@deepseek-ai/dsh-util-values/README.md +1 -1
  348. package/node_modules/@deepseek-ai/dsh-util-values/README.zh.md +1 -1
  349. package/node_modules/@deepseek-ai/dsh-util-values/lib/index.js +77 -92
  350. package/node_modules/@deepseek-ai/dsh-web-app/cordis.patch.yml +5 -1
  351. package/node_modules/@deepseek-ai/dsh-web-app/package.json +3 -1
  352. package/node_modules/@deepseek-ai/dsh-web-app/presets/cordis.patch.yml +3 -0
  353. package/node_modules/@deepseek-ai/dsh-web-app/presets/ptc.patch.yml +3 -0
  354. package/node_modules/@deepseek-ai/dsh-web-app/presets/standard.patch.yml +3 -0
  355. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-BCbHmUSs.js +197 -0
  356. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-BUDGJY4R.css +1 -0
  357. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/index.html +2 -2
  358. package/node_modules/@deepseek-ai/dsh-workflow-ptc/lib/index.js +1 -1
  359. package/node_modules/@deepseek-ai/dsh-workspace-changes/README.i18n.yaml +4 -4
  360. package/node_modules/@deepseek-ai/dsh-workspace-changes/README.md +3 -1
  361. package/node_modules/@deepseek-ai/dsh-workspace-changes/README.zh.md +4 -2
  362. package/node_modules/@deepseek-ai/dsh-workspace-changes/lib/index.js +5 -0
  363. package/node_modules/@deepseek-ai/dsh-workspace-changes/lib/types/index.js +5 -0
  364. package/node_modules/@deepseek-ai/dsh-workspace-changes/package.json +4 -1
  365. package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_attributes.cjs +16917 -0
  366. package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_attributes.mjs +15193 -0
  367. package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_events.cjs +325 -0
  368. package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_events.mjs +295 -0
  369. package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_metrics.cjs +4642 -0
  370. package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_metrics.mjs +4155 -0
  371. package/node_modules/@opentelemetry/semantic-conventions/dist/index-incubating.cjs +2495 -0
  372. package/node_modules/@opentelemetry/semantic-conventions/dist/index-incubating.mjs +7 -0
  373. package/node_modules/@opentelemetry/semantic-conventions/dist/index.cjs +662 -0
  374. package/node_modules/@opentelemetry/semantic-conventions/dist/index.mjs +6 -0
  375. package/node_modules/@opentelemetry/semantic-conventions/dist/internal/utils.cjs +20 -0
  376. package/node_modules/@opentelemetry/semantic-conventions/dist/internal/utils.mjs +20 -0
  377. package/node_modules/@opentelemetry/semantic-conventions/dist/resource/SemanticResourceAttributes.cjs +1326 -0
  378. package/node_modules/@opentelemetry/semantic-conventions/dist/resource/SemanticResourceAttributes.mjs +1188 -0
  379. package/node_modules/@opentelemetry/semantic-conventions/dist/stable_attributes.cjs +1947 -0
  380. package/node_modules/@opentelemetry/semantic-conventions/dist/stable_attributes.mjs +1756 -0
  381. package/node_modules/@opentelemetry/semantic-conventions/dist/stable_events.cjs +9 -0
  382. package/node_modules/@opentelemetry/semantic-conventions/dist/stable_events.mjs +9 -0
  383. package/node_modules/@opentelemetry/semantic-conventions/dist/stable_metrics.cjs +362 -0
  384. package/node_modules/@opentelemetry/semantic-conventions/dist/stable_metrics.mjs +312 -0
  385. package/node_modules/@opentelemetry/semantic-conventions/dist/trace/SemanticAttributes.cjs +2508 -0
  386. package/node_modules/@opentelemetry/semantic-conventions/dist/trace/SemanticAttributes.mjs +2236 -0
  387. package/node_modules/@opentelemetry/semantic-conventions/package.json +22 -35
  388. package/node_modules/@smithy/core/dist-cjs/index.js +4 -2
  389. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +32 -16
  390. package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +26 -13
  391. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.browser.js +8 -4
  392. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +16 -8
  393. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.native.js +8 -4
  394. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +2 -1
  395. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +10 -5
  396. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +18 -9
  397. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +18 -9
  398. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +42 -24
  399. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +20 -10
  400. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +24 -12
  401. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +13 -4
  402. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +7 -1
  403. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +13 -4
  404. package/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +6 -3
  405. package/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js +2 -1
  406. package/node_modules/@smithy/core/dist-es/normalizeProvider.js +2 -1
  407. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +8 -4
  408. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +6 -3
  409. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +12 -6
  410. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +4 -2
  411. package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +2 -1
  412. package/node_modules/@smithy/core/dist-es/submodules/client/middleware-stack/MiddlewareStack.js +10 -5
  413. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/create-aggregated-client.js +2 -1
  414. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js +4 -2
  415. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/checksum.js +2 -1
  416. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/get-value-from-text-node.js +2 -1
  417. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/object-mapping.js +4 -2
  418. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/serde-json.js +2 -1
  419. package/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getHomeDir.js +8 -4
  420. package/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/booleanSelector.js +6 -3
  421. package/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/numberSelector.js +2 -1
  422. package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.js +8 -4
  423. package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/resolveEndpoint.js +2 -1
  424. package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +6 -3
  425. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +2 -1
  426. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js +2 -1
  427. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.js +2 -1
  428. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde/utils.js +2 -1
  429. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.js +4 -2
  430. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +8 -4
  431. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +4 -2
  432. package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +2 -1
  433. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js +7 -5
  434. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js +7 -5
  435. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js +7 -5
  436. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +6 -3
  437. package/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js +3 -0
  438. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js +4 -2
  439. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js +2 -1
  440. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retry-pre-sra-deprecated/StandardRetryStrategy.js +6 -3
  441. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js +6 -3
  442. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/util.js +6 -3
  443. package/node_modules/@smithy/core/dist-es/submodules/serde/index.browser.js +1 -0
  444. package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +1 -0
  445. package/node_modules/@smithy/core/dist-es/submodules/serde/index.native.js +1 -0
  446. package/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js +2 -1
  447. package/node_modules/@smithy/core/dist-es/submodules/serde/util-body-length/calculateBodyLength.browser.js +6 -3
  448. package/node_modules/@smithy/core/dist-es/submodules/transport/httpResponse.js +2 -1
  449. package/node_modules/@smithy/core/dist-es/submodules/transport/normalizeProvider.js +2 -1
  450. package/node_modules/@smithy/core/dist-es/submodules/transport/toEndpointV1.js +2 -1
  451. package/node_modules/@smithy/core/package.json +1 -1
  452. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +19 -7
  453. package/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +2 -1
  454. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +11 -6
  455. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +6 -0
  456. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  457. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +23 -11
  458. package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +4 -2
  459. package/node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js +4 -2
  460. package/node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js +5 -1
  461. package/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js +2 -1
  462. package/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js +2 -1
  463. package/node_modules/@smithy/signature-v4/dist-es/headerUtil.js +6 -3
  464. package/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js +2 -1
  465. package/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js +2 -1
  466. package/node_modules/@smithy/signature-v4/package.json +2 -2
  467. package/node_modules/@types/node/README.md +1 -1
  468. package/node_modules/@types/node/package.json +2 -2
  469. package/node_modules/encodeurl/README.md +14 -0
  470. package/node_modules/encodeurl/index.js +5 -10
  471. package/node_modules/encodeurl/package.json +7 -3
  472. package/node_modules/hast-util-to-html/lib/handle/comment.js +6 -1
  473. package/node_modules/hast-util-to-html/lib/handle/doctype.js +1 -1
  474. package/node_modules/hast-util-to-html/lib/handle/element.js +33 -9
  475. package/node_modules/hast-util-to-html/lib/handle/index.js +1 -1
  476. package/node_modules/hast-util-to-html/lib/handle/raw.js +1 -1
  477. package/node_modules/hast-util-to-html/lib/handle/root.js +1 -1
  478. package/node_modules/hast-util-to-html/lib/handle/text.js +1 -1
  479. package/node_modules/hast-util-to-html/lib/index.js +9 -4
  480. package/node_modules/hast-util-to-html/lib/omission/closing.js +7 -5
  481. package/node_modules/hast-util-to-html/lib/omission/omission.js +0 -1
  482. package/node_modules/hast-util-to-html/lib/omission/opening.js +4 -2
  483. package/node_modules/hast-util-to-html/lib/omission/util/siblings.js +3 -0
  484. package/node_modules/hast-util-to-html/package.json +5 -23
  485. package/node_modules/hast-util-to-html/readme.md +3 -2
  486. package/node_modules/jose/dist/webapi/jwks/remote.js +1 -1
  487. package/node_modules/jose/package.json +1 -1
  488. package/node_modules/rrule/LICENCE +65 -0
  489. package/node_modules/rrule/README.md +837 -0
  490. package/node_modules/rrule/dist/es5/rrule.js +3803 -0
  491. package/node_modules/rrule/dist/es5/rrule.min.js +2 -0
  492. package/node_modules/rrule/dist/esm/cache.js +95 -0
  493. package/node_modules/rrule/dist/esm/callbackiterresult.js +24 -0
  494. package/node_modules/rrule/dist/esm/datetime.js +186 -0
  495. package/node_modules/rrule/dist/esm/dateutil.js +161 -0
  496. package/node_modules/rrule/dist/esm/datewithzone.js +36 -0
  497. package/node_modules/rrule/dist/esm/helpers.js +118 -0
  498. package/node_modules/rrule/dist/esm/index.js +22 -0
  499. package/node_modules/rrule/dist/esm/iter/index.js +138 -0
  500. package/node_modules/rrule/dist/esm/iter/poslist.js +42 -0
  501. package/node_modules/rrule/dist/esm/iterinfo/easter.js +21 -0
  502. package/node_modules/rrule/dist/esm/iterinfo/index.js +188 -0
  503. package/node_modules/rrule/dist/esm/iterinfo/monthinfo.js +51 -0
  504. package/node_modules/rrule/dist/esm/iterinfo/yearinfo.js +128 -0
  505. package/node_modules/rrule/dist/esm/iterresult.js +88 -0
  506. package/node_modules/rrule/dist/esm/iterset.js +63 -0
  507. package/node_modules/rrule/dist/esm/masks.js +30 -0
  508. package/node_modules/rrule/dist/esm/nlp/i18n.js +74 -0
  509. package/node_modules/rrule/dist/esm/nlp/index.js +122 -0
  510. package/node_modules/rrule/dist/esm/nlp/parsetext.js +391 -0
  511. package/node_modules/rrule/dist/esm/nlp/totext.js +395 -0
  512. package/node_modules/rrule/dist/esm/optionstostring.js +98 -0
  513. package/node_modules/rrule/dist/esm/parseoptions.js +201 -0
  514. package/node_modules/rrule/dist/esm/parsestring.js +128 -0
  515. package/node_modules/rrule/dist/esm/rrule.js +232 -0
  516. package/node_modules/rrule/dist/esm/rruleset.js +182 -0
  517. package/node_modules/rrule/dist/esm/rrulestr.js +188 -0
  518. package/node_modules/rrule/dist/esm/types.js +14 -0
  519. package/node_modules/rrule/dist/esm/weekday.js +45 -0
  520. package/node_modules/rrule/package.json +79 -0
  521. package/package.json +32 -31
  522. package/node_modules/@deepseek-ai/dsh-computer-use/README.i18n.yaml +0 -37
  523. package/node_modules/@deepseek-ai/dsh-computer-use/README.md +0 -90
  524. package/node_modules/@deepseek-ai/dsh-computer-use/README.zh.md +0 -90
  525. package/node_modules/@deepseek-ai/dsh-computer-use/lib/index.js +0 -35
  526. package/node_modules/@deepseek-ai/dsh-computer-use/lib/types/brand.js +0 -10
  527. package/node_modules/@deepseek-ai/dsh-computer-use/lib/types/index.js +0 -36
  528. package/node_modules/@deepseek-ai/dsh-computer-use/locale/de.json +0 -6
  529. package/node_modules/@deepseek-ai/dsh-computer-use/locale/en.json +0 -6
  530. package/node_modules/@deepseek-ai/dsh-computer-use/locale/es.json +0 -6
  531. package/node_modules/@deepseek-ai/dsh-computer-use/locale/fr.json +0 -6
  532. package/node_modules/@deepseek-ai/dsh-computer-use/locale/ja.json +0 -6
  533. package/node_modules/@deepseek-ai/dsh-computer-use/locale/pt.json +0 -6
  534. package/node_modules/@deepseek-ai/dsh-computer-use/locale/ru.json +0 -6
  535. package/node_modules/@deepseek-ai/dsh-computer-use/locale/zh.json +0 -6
  536. package/node_modules/@deepseek-ai/dsh-computer-use/package.json +0 -44
  537. package/node_modules/@deepseek-ai/dsh-cua/README.i18n.yaml +0 -49
  538. package/node_modules/@deepseek-ai/dsh-cua/README.md +0 -130
  539. package/node_modules/@deepseek-ai/dsh-cua/README.zh.md +0 -130
  540. package/node_modules/@deepseek-ai/dsh-cua/lib/api.js +0 -597
  541. package/node_modules/@deepseek-ai/dsh-cua/lib/bridge.js +0 -611
  542. package/node_modules/@deepseek-ai/dsh-cua/lib/client.js +0 -1758
  543. package/node_modules/@deepseek-ai/dsh-cua/lib/index.js +0 -1916
  544. package/node_modules/@deepseek-ai/dsh-cua/lib/native-client.js +0 -285
  545. package/node_modules/@deepseek-ai/dsh-cua/lib/protocol.js +0 -305
  546. package/node_modules/@deepseek-ai/dsh-cua/lib/remote-types.js +0 -1
  547. package/node_modules/@deepseek-ai/dsh-cua/lib/typert.host.js +0 -416
  548. package/node_modules/@deepseek-ai/dsh-cua/lib/typert.remote-client.js +0 -301
  549. package/node_modules/@deepseek-ai/dsh-cua/locale/de.json +0 -6
  550. package/node_modules/@deepseek-ai/dsh-cua/locale/en.json +0 -6
  551. package/node_modules/@deepseek-ai/dsh-cua/locale/es.json +0 -6
  552. package/node_modules/@deepseek-ai/dsh-cua/locale/fr.json +0 -6
  553. package/node_modules/@deepseek-ai/dsh-cua/locale/ja.json +0 -6
  554. package/node_modules/@deepseek-ai/dsh-cua/locale/pt.json +0 -6
  555. package/node_modules/@deepseek-ai/dsh-cua/locale/ru.json +0 -6
  556. package/node_modules/@deepseek-ai/dsh-cua/locale/zh.json +0 -6
  557. package/node_modules/@deepseek-ai/dsh-cua/package.json +0 -151
  558. package/node_modules/@deepseek-ai/dsh-cua-bundle/README.i18n.yaml +0 -46
  559. package/node_modules/@deepseek-ai/dsh-cua-bundle/README.md +0 -94
  560. package/node_modules/@deepseek-ai/dsh-cua-bundle/README.zh.md +0 -94
  561. package/node_modules/@deepseek-ai/dsh-cua-bundle/cordis.patch.yml +0 -10
  562. package/node_modules/@deepseek-ai/dsh-cua-bundle/docs/DETAIL.md +0 -1
  563. package/node_modules/@deepseek-ai/dsh-cua-bundle/docs/DETAIL.zh.md +0 -1
  564. package/node_modules/@deepseek-ai/dsh-cua-bundle/docs/preview.svg +0 -33
  565. package/node_modules/@deepseek-ai/dsh-cua-bundle/docs/preview.zh.svg +0 -33
  566. package/node_modules/@deepseek-ai/dsh-cua-bundle/icon.svg +0 -35
  567. package/node_modules/@deepseek-ai/dsh-cua-bundle/lib/index.js +0 -1
  568. package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/de.json +0 -7
  569. package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/en.json +0 -7
  570. package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/es.json +0 -7
  571. package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/fr.json +0 -7
  572. package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/ja.json +0 -7
  573. package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/pt.json +0 -7
  574. package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/ru.json +0 -7
  575. package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/zh.json +0 -7
  576. package/node_modules/@deepseek-ai/dsh-cua-bundle/package.json +0 -58
  577. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index--TtJvO-i.js +0 -197
  578. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Jtzf36XE.css +0 -1
  579. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js +0 -14991
  580. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.js +0 -298
  581. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js +0 -4060
  582. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index-incubating.js +0 -13
  583. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js +0 -16
  584. package/node_modules/@opentelemetry/semantic-conventions/build/esm/internal/utils.js +0 -23
  585. package/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/SemanticResourceAttributes.js +0 -1250
  586. package/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/index.js +0 -10
  587. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js +0 -1733
  588. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.js +0 -12
  589. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_metrics.js +0 -315
  590. package/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/SemanticAttributes.js +0 -2360
  591. package/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/index.js +0 -10
  592. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js +0 -7
  593. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js +0 -14991
  594. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.js +0 -298
  595. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js +0 -4060
  596. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index-incubating.js +0 -13
  597. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index.js +0 -16
  598. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/internal/utils.js +0 -23
  599. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/resource/SemanticResourceAttributes.js +0 -1250
  600. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/resource/index.js +0 -10
  601. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js +0 -1733
  602. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_events.js +0 -12
  603. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_metrics.js +0 -315
  604. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/trace/SemanticAttributes.js +0 -2360
  605. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/trace/index.js +0 -10
  606. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js +0 -7
  607. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js +0 -15049
  608. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.js +0 -301
  609. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js +0 -4072
  610. package/node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating.js +0 -29
  611. package/node_modules/@opentelemetry/semantic-conventions/build/src/index.js +0 -32
  612. package/node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js +0 -27
  613. package/node_modules/@opentelemetry/semantic-conventions/build/src/resource/SemanticResourceAttributes.js +0 -1255
  614. package/node_modules/@opentelemetry/semantic-conventions/build/src/resource/index.js +0 -26
  615. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js +0 -1759
  616. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.js +0 -15
  617. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_metrics.js +0 -319
  618. package/node_modules/@opentelemetry/semantic-conventions/build/src/trace/SemanticAttributes.js +0 -2368
  619. package/node_modules/@opentelemetry/semantic-conventions/build/src/trace/index.js +0 -26
  620. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js +0 -10
  621. /package/node_modules/@smithy/core/dist-es/submodules/{protocols → serde}/writeKey.js +0 -0
@@ -5,10 +5,10 @@ window.__ModuleLoader__.load({
5
5
  var exports = module.exports;
6
6
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
7
  let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
8
+ let _deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store");
8
9
  require("@deepseek-ai/cordis");
9
10
  let react_jsx_runtime = require("react/jsx-runtime");
10
11
  let react = require("react");
11
- let _deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store");
12
12
  //#region lib/types/client/definition.js
13
13
  /** The tab kind this package owns. */
14
14
  const FILES_KIND = "files";
@@ -36,6 +36,394 @@ window.__ModuleLoader__.load({
36
36
  };
37
37
  }
38
38
  //#endregion
39
+ //#region ../../util/workspace-path/src/file-address.ts
40
+ /** The scheme and type every file address opens with. */
41
+ const FILE_ADDRESS_PREFIX = "dsh-resource://file/";
42
+ /** Component-encode one id or path segment, keeping `:` literal for drive letters. */
43
+ function encodeSegment(segment) {
44
+ return encodeURIComponent(segment).replace(/%3A/gi, ":");
45
+ }
46
+ /** Encode a `/`-separated path segment by segment. */
47
+ function encodePath(path) {
48
+ return path.split("/").map(encodeSegment).join("/");
49
+ }
50
+ /** Whether a decoded first path segment is a Windows drive (`C:`). */
51
+ function isDriveSegment(segment) {
52
+ return segment !== void 0 && /^[A-Za-z]:$/.test(segment);
53
+ }
54
+ /**
55
+ * Build the address of a file read through one Session.
56
+ * @param sessionId - the Session whose Host workspace resolves the path.
57
+ * @param path - absolute or workspace-relative path; backslashes are normalized to `/`, and leading `./` prefixes are dropped.
58
+ * @returns the `dsh-resource://file/session/<sessionId>/<path>` address.
59
+ */
60
+ function sessionFileAddress(sessionId, path) {
61
+ const normalized = path.replace(/\\/g, "/").replace(/^(?:\.\/)+/, "");
62
+ return `${FILE_ADDRESS_PREFIX}session/${encodeSegment(sessionId)}/${encodePath(normalized)}`;
63
+ }
64
+ /**
65
+ * Read a file address back into its parts without resolving `.` or `..`.
66
+ * Query and fragment suffixes are ignored; encoded path segments are decoded.
67
+ * @param address - a candidate address.
68
+ * @returns the parts, or `undefined` when the string is not a `dsh-resource://file/` URI in a known scope with a path, or a segment is not validly encoded.
69
+ */
70
+ function parseFileAddress(address) {
71
+ try {
72
+ if (!address.startsWith(FILE_ADDRESS_PREFIX)) return void 0;
73
+ const end = address.search(/[?#]/);
74
+ const [scope, ...rest] = address.slice(20, end === -1 ? void 0 : end).split("/");
75
+ if (scope === "session") {
76
+ const [id, ...segments] = rest;
77
+ if (id === void 0 || id === "" || segments.length === 0) return void 0;
78
+ return {
79
+ scope,
80
+ sessionId: decodeURIComponent(id),
81
+ path: segments.map(decodeURIComponent).join("/")
82
+ };
83
+ }
84
+ if (scope === "absolute") {
85
+ const unc = rest[0] === "" && rest.length > 1;
86
+ const segments = (unc ? rest.slice(1) : rest).map(decodeURIComponent);
87
+ if (segments.length === 0 || segments[0] === "") return void 0;
88
+ if (unc) return {
89
+ scope,
90
+ path: `//${segments.join("/")}`
91
+ };
92
+ return {
93
+ scope,
94
+ path: isDriveSegment(segments[0]) ? segments.join("/") : `/${segments.join("/")}`
95
+ };
96
+ }
97
+ return;
98
+ } catch {
99
+ return;
100
+ }
101
+ }
102
+ //#endregion
103
+ //#region ../../util/workspace-path/src/index.ts
104
+ /**
105
+ * Browser-safe Workspace path and display helpers.
106
+ * @module @deepseek-ai/dsh-util-workspace-path
107
+ */
108
+ /** Whether a path uses a Windows drive or UNC prefix. */
109
+ function isWindowsStylePath(value) {
110
+ return /^[A-Za-z]:[/\\]/.test(value) || value.startsWith("\\\\");
111
+ }
112
+ /**
113
+ * Whether a path is absolute in either spelling the Host accepts: POSIX (`/a/b`) or Windows drive or UNC.
114
+ * @param path - the path to classify.
115
+ * @returns `true` for an absolute path; `false` for a Workspace-relative one.
116
+ */
117
+ function isAbsoluteWorkspacePath(path) {
118
+ return path.startsWith("/") || isWindowsStylePath(path);
119
+ }
120
+ /**
121
+ * The address for a path as a caller holds it: a relative path, or an absolute
122
+ * path inside the Session's workspace, becomes a `session`-scoped address; an
123
+ * absolute path outside it, or one whose workspace root is unknown, keeps its
124
+ * absolute path in that Session's address.
125
+ * @param sessionId - the Session the path is read in.
126
+ * @param cwd - that Session's workspace root, when known.
127
+ * @param path - absolute or workspace-relative path, in either separator spelling.
128
+ * @returns the `dsh-resource://file/…` address.
129
+ */
130
+ function fileAddressFor(sessionId, cwd, path) {
131
+ const normalized = path.replace(/\\/g, "/");
132
+ if (!isAbsoluteWorkspacePath(normalized)) return sessionFileAddress(sessionId, normalized);
133
+ const root = cwd === void 0 ? "" : cwd.replace(/\\/g, "/").replace(/\/+$/, "");
134
+ if (root !== "" && normalized === root) return sessionFileAddress(sessionId, "");
135
+ if (root !== "" && normalized.startsWith(`${root}/`)) return sessionFileAddress(sessionId, normalized.slice(root.length + 1));
136
+ return sessionFileAddress(sessionId, normalized);
137
+ }
138
+ /** The narrowest navigator, when the row has room for it. */
139
+ const NAVIGATOR_MINIMUM = 180;
140
+ /** What a navigator floating over the row leaves of it uncovered. */
141
+ const ROW_REMAINDER = 120;
142
+ /**
143
+ * Fit the navigator to the row it shares with the preview. In a row at least
144
+ * `PUSH_FROM` wide the navigator sits beside the body, so it is at most the
145
+ * row less its card's margins and `PREVIEW_MINIMUM`; in a narrower row it
146
+ * floats over the body and is at most the row less `ROW_REMAINDER`.
147
+ * @param available - the row's width in CSS pixels; `undefined` before it is measured.
148
+ * @param width - the pane's width preference.
149
+ * @returns the resize bounds and the width drawn.
150
+ */
151
+ function navigatorGeometry(available, width) {
152
+ if (available === void 0) {
153
+ const drawn = Math.max(NAVIGATOR_MINIMUM, width);
154
+ return {
155
+ minimum: NAVIGATOR_MINIMUM,
156
+ maximum: drawn,
157
+ width: drawn
158
+ };
159
+ }
160
+ const maximum = Math.max(0, available - (available >= 560 ? 336 : ROW_REMAINDER));
161
+ const minimum = Math.min(NAVIGATOR_MINIMUM, maximum);
162
+ return {
163
+ minimum,
164
+ maximum,
165
+ width: Math.min(Math.max(minimum, width), maximum)
166
+ };
167
+ }
168
+ /**
169
+ * The absolute path of one child entry.
170
+ *
171
+ * Joined with `/` whatever the parent's separators: the Host resolves mixed
172
+ * separators, and the tree only needs a stable key.
173
+ * @param parent - absolute path of the listed directory.
174
+ * @param name - the entry's basename.
175
+ * @returns the child's absolute path.
176
+ */
177
+ function childPath(parent, name) {
178
+ return `${parent.replace(/[/\\]+$/, "")}/${name}`;
179
+ }
180
+ /**
181
+ * Whether a root is a Windows drive or UNC path, in either separator spelling,
182
+ * where names compare regardless of case.
183
+ * @param root - the tree's root, or a prefix built from it.
184
+ * @returns `true` for a drive letter followed by a separator, or a leading double separator.
185
+ */
186
+ function windowsRoot(root) {
187
+ const path = root.replace(/\\/g, "/");
188
+ return /^[A-Za-z]:\//.test(path) || path.startsWith("//");
189
+ }
190
+ /**
191
+ * Walk the listed levels to a workspace-relative file, keeping the listing's
192
+ * spelling of each name; a Windows root also matches names regardless of case.
193
+ * @param tree - the pane's tree.
194
+ * @param relativePath - the file's path under the tree's root, `/`-separated.
195
+ * @returns the ancestors found so far, the file's tree key, and whether a level is pending.
196
+ */
197
+ function locateFile(tree, relativePath) {
198
+ const caseless = windowsRoot(tree.root);
199
+ const parts = relativePath.split("/");
200
+ const ancestors = [];
201
+ let parent = tree.root;
202
+ for (const [index, part] of parts.entries()) {
203
+ const level = tree.levels[parent];
204
+ if (level?.kind !== "ready") return {
205
+ ancestors,
206
+ current: void 0,
207
+ pending: level === void 0 || level.kind === "loading"
208
+ };
209
+ const type = index === parts.length - 1 ? "file" : "directory";
210
+ const candidates = level.level.entries.filter((entry) => entry.type === type);
211
+ const entry = candidates.find((candidate) => candidate.name === part) ?? (caseless ? candidates.find((candidate) => candidate.name.toLowerCase() === part.toLowerCase()) : void 0);
212
+ if (entry === void 0) return {
213
+ ancestors,
214
+ current: void 0,
215
+ pending: level.refreshing === true
216
+ };
217
+ const path = childPath(parent, entry.name);
218
+ if (type === "directory") ancestors.push({
219
+ parent,
220
+ path
221
+ });
222
+ parent = path;
223
+ }
224
+ return {
225
+ ancestors,
226
+ current: parent,
227
+ pending: false
228
+ };
229
+ }
230
+ /**
231
+ * The workspace-relative path of the file a tab shows, when it is a file of
232
+ * this Session under the tree's root; dot segments are not resolved here. An
233
+ * absolute path is under a Windows drive or UNC root regardless of case and
234
+ * separator spelling, and under a POSIX root only with the root's exact case.
235
+ * @param address - the tab's content address.
236
+ * @param sessionId - the Session the tree lists.
237
+ * @param root - the tree's root.
238
+ * @returns the `/`-separated relative path, or `undefined` for anything else.
239
+ */
240
+ function relativeFileOf(address, sessionId, root) {
241
+ const file = parseFileAddress(address);
242
+ if (file?.scope !== "session" || file.sessionId !== sessionId) return void 0;
243
+ const path = file.path.replace(/\\/g, "/");
244
+ const normalized = isAbsoluteWorkspacePath(path) ? underRoot(path, root) : path;
245
+ if (normalized === void 0 || normalized === "" || isAbsoluteWorkspacePath(normalized)) return void 0;
246
+ return normalized.split("/").some((part) => part === "" || part === "." || part === "..") ? void 0 : normalized;
247
+ }
248
+ /**
249
+ * An absolute `/`-separated path relative to a tree's root.
250
+ * @param path - the absolute path, `/`-separated.
251
+ * @param root - the tree's root, in either separator spelling.
252
+ * @returns the path under the root, or `undefined` outside it.
253
+ */
254
+ function underRoot(path, root) {
255
+ const prefix = `${root.replace(/\\/g, "/").replace(/\/+$/, "")}/`;
256
+ const head = path.slice(0, prefix.length);
257
+ return (windowsRoot(prefix) ? head.toLowerCase() === prefix.toLowerCase() : head === prefix) ? path.slice(prefix.length) : void 0;
258
+ }
259
+ /**
260
+ * One pane's record, created by its first write.
261
+ * @param state - the draft.
262
+ * @param paneId - the pane being written.
263
+ * @returns the pane's record.
264
+ */
265
+ function pane(state, paneId) {
266
+ state.byPane[paneId] ??= {
267
+ open: void 0,
268
+ width: 260,
269
+ tree: void 0
270
+ };
271
+ return state.byPane[paneId];
272
+ }
273
+ /**
274
+ * One pane's tree, which every writer after `start` relies on: the face only
275
+ * dispatches while it holds the pane's records, and `forget` runs as it drops them.
276
+ * @param state - the draft.
277
+ * @param paneId - the pane being written.
278
+ * @returns the pane's tree.
279
+ */
280
+ function tree(state, paneId) {
281
+ const started = state.byPane[paneId]?.tree;
282
+ if (started === void 0) throw new Error(`ui-sidebar-files: no tree for pane "${paneId}"`);
283
+ return started;
284
+ }
285
+ /**
286
+ * Declare the file tree's store.
287
+ *
288
+ * A factory rather than a shared handle: the registration declares it as an
289
+ * exclusive store, so the framework mints one instance per session.
290
+ * @returns the store handle to declare on the registration.
291
+ */
292
+ function createFilesStore() {
293
+ return (0, _deepseek_ai_dsh_client_store.defineStore)({
294
+ init: () => ({ byPane: {} }),
295
+ actions: {
296
+ autoRefresh: (d, paneId, enabled) => {
297
+ tree(d, paneId).autoRefresh = enabled;
298
+ },
299
+ /**
300
+ * Seed one pane's tree at its workspace root, with the root expanded.
301
+ * @param d - draft state.
302
+ * @param paneId - the pane being drawn.
303
+ * @param root - absolute path of the workspace root.
304
+ */
305
+ start: (d, paneId, root) => {
306
+ pane(d, paneId).tree = {
307
+ root,
308
+ levels: {},
309
+ expanded: [root],
310
+ autoRefresh: true
311
+ };
312
+ },
313
+ /**
314
+ * Mark one directory as being listed; a listed level keeps its entries and is marked refreshing.
315
+ * @param d - draft state.
316
+ * @param paneId - the pane being drawn.
317
+ * @param path - absolute directory path.
318
+ */
319
+ loading: (d, paneId, path) => {
320
+ const state = tree(d, paneId);
321
+ const level = state.levels[path];
322
+ if (level?.kind !== "ready") state.levels[path] = { kind: "loading" };
323
+ else if (level.refreshing !== true) state.levels[path] = {
324
+ ...level,
325
+ refreshing: true
326
+ };
327
+ },
328
+ /**
329
+ * Record one directory's contents.
330
+ * @param d - draft state.
331
+ * @param paneId - the pane being drawn.
332
+ * @param path - absolute directory path.
333
+ * @param level - the listing to show under it.
334
+ */
335
+ loaded: (d, paneId, path, level) => {
336
+ const state = tree(d, paneId);
337
+ const previous = state.levels[path];
338
+ if (previous?.kind === "ready") {
339
+ const directories = new Set(level.entries.filter((entry) => entry.type === "directory").map((entry) => entry.name));
340
+ for (const entry of previous.level.entries) {
341
+ if (entry.type !== "directory" || directories.has(entry.name)) continue;
342
+ const removed = childPath(path, entry.name);
343
+ state.expanded = state.expanded.filter((value) => value !== removed && !value.startsWith(`${removed}/`));
344
+ state.levels = Object.fromEntries(Object.entries(state.levels).filter(([key]) => key !== removed && !key.startsWith(`${removed}/`)));
345
+ }
346
+ }
347
+ state.levels[path] = {
348
+ kind: "ready",
349
+ level
350
+ };
351
+ },
352
+ /**
353
+ * Record why one directory could not be listed, and end the refresh of the levels below it.
354
+ * @param d - draft state.
355
+ * @param paneId - the pane being drawn.
356
+ * @param path - absolute directory path.
357
+ * @param failure - the settled Remote failure.
358
+ */
359
+ failed: (d, paneId, path, failure) => {
360
+ const state = tree(d, paneId);
361
+ const level = state.levels[path];
362
+ state.levels[path] = level?.kind === "ready" ? {
363
+ kind: "ready",
364
+ level: level.level,
365
+ failure
366
+ } : {
367
+ kind: "failed",
368
+ failure
369
+ };
370
+ const below = `${path.replace(/[/\\]+$/, "")}/`;
371
+ for (const [key, kept] of Object.entries(state.levels)) {
372
+ if (!key.startsWith(below) || kept.kind !== "ready" || kept.refreshing !== true) continue;
373
+ state.levels[key] = kept.failure === void 0 ? {
374
+ kind: "ready",
375
+ level: kept.level
376
+ } : {
377
+ kind: "ready",
378
+ level: kept.level,
379
+ failure: kept.failure
380
+ };
381
+ }
382
+ },
383
+ /**
384
+ * Open a collapsed directory, or collapse an open one.
385
+ *
386
+ * A collapsed level keeps what it loaded, so reopening it draws at once.
387
+ * @param d - draft state.
388
+ * @param paneId - the pane being drawn.
389
+ * @param path - absolute directory path.
390
+ */
391
+ toggled: (d, paneId, path) => {
392
+ const state = tree(d, paneId);
393
+ const at = state.expanded.indexOf(path);
394
+ if (at >= 0) state.expanded.splice(at, 1);
395
+ else state.expanded.push(path);
396
+ },
397
+ /**
398
+ * Show or hide one pane's navigator.
399
+ * @param d - draft state.
400
+ * @param paneId - the pane being drawn.
401
+ * @param open - whether the navigator is shown.
402
+ */
403
+ shown: (d, paneId, open) => {
404
+ pane(d, paneId).open = open;
405
+ },
406
+ /**
407
+ * Record one pane's navigator width preference.
408
+ * @param d - draft state.
409
+ * @param paneId - the pane being drawn.
410
+ * @param width - the preferred width, in CSS pixels.
411
+ */
412
+ resized: (d, paneId, width) => {
413
+ pane(d, paneId).width = width;
414
+ },
415
+ /**
416
+ * Forget one pane's navigator and tree.
417
+ * @param d - draft state.
418
+ * @param paneId - the pane whose records go.
419
+ */
420
+ forget: (d, paneId) => {
421
+ d.byPane = Object.fromEntries(Object.entries(d.byPane).filter(([id]) => id !== paneId));
422
+ }
423
+ }
424
+ });
425
+ }
426
+ //#endregion
39
427
  //#region ../../typert/protocol/src/remote-error.ts
40
428
  /**
41
429
  * One Remote call failure: a real Error carrying its stable code and typed
@@ -213,8 +601,23 @@ window.__ModuleLoader__.load({
213
601
  }
214
602
  };
215
603
  //#endregion
604
+ //#region lib/types/client/navigator-layout.js
605
+ /** Matches the right Sidebar's fullscreen viewport and FilesBody.module.css. */
606
+ const FULLSCREEN_QUERY = "(width < 768px)";
607
+ //#endregion
216
608
  //#region lib/types/client/face.js
217
609
  /**
610
+ * The box an element is laid out in: its nearest ancestor that generates one,
611
+ * passing over wrappers drawn with `display: contents`.
612
+ * @param element - the laid-out element.
613
+ * @returns that ancestor, or `null` for a detached element.
614
+ */
615
+ function layoutParent(element) {
616
+ let parent = element.parentElement;
617
+ while (parent !== null && getComputedStyle(parent).display === "contents") parent = parent.parentElement;
618
+ return parent;
619
+ }
620
+ /**
218
621
  * Bind directory observation to the Remote stream supervisor.
219
622
  * @param remote - Client Remote with workspace file streams.
220
623
  * @returns a watcher that awaits stream disposal when its node ends.
@@ -245,7 +648,7 @@ window.__ModuleLoader__.load({
245
648
  };
246
649
  }
247
650
  /**
248
- * Bind the listing to one Remote face, keeping only what the tree stores.
651
+ * Bind the listing to one Remote face.
249
652
  * @param remote - the Client Remote face carrying the `workspaceFiles` namespace.
250
653
  * @returns the listing the tree's face performs.
251
654
  */
@@ -263,83 +666,462 @@ window.__ModuleLoader__.load({
263
666
  };
264
667
  }
265
668
  /**
266
- * The absolute path of one child entry.
267
- *
268
- * Joined with `/` whatever the parent's separators: the Host resolves mixed
269
- * separators, and the tree only needs a stable key.
270
- * @param parent - absolute path of the listed directory.
271
- * @param name - the entry's basename.
272
- * @returns the child's absolute path.
669
+ * Observe whether any registered tab type can open an address.
670
+ * @param registry - the right Sidebar's tab type registry.
671
+ * @returns a source whose snapshot is a predicate, replaced whenever registrations change.
273
672
  */
274
- function childPath(parent, name) {
275
- return `${parent.replace(/[/\\]+$/, "")}/${name}`;
673
+ function canOpenOf(registry) {
674
+ let seen = registry.entries();
675
+ let check = (address) => registry.candidates(address).length > 0;
676
+ return {
677
+ getSnapshot: () => {
678
+ const entries = registry.entries();
679
+ if (entries !== seen) {
680
+ seen = entries;
681
+ check = (address) => registry.candidates(address).length > 0;
682
+ }
683
+ return check;
684
+ },
685
+ subscribe: (listener) => registry.subscribe(listener)
686
+ };
276
687
  }
688
+ /** `focus` asked for the tree's keyboard focus. */
689
+ const REQUESTED = {};
277
690
  /**
278
691
  * Bind the tree's face to one directory listing.
279
692
  * @param list - the bound `workspaceFiles.list` call.
280
693
  * @param watch - target-scoped directory observation.
281
- * @returns the Slot `inject` factory: session and bound actions in, face out.
694
+ * @param canOpen - whether some tab type can open an address.
695
+ * @param navigationOf - the attached tab's navigation; subscriptions end with this plugin or their disposer.
696
+ * @returns the face factory: session, its store instance, and where to place the face beside tabs in, face out.
282
697
  */
283
- function filesFace(list, watch) {
284
- return (sessionId, actions) => {
285
- /** Per tab, per absolute path: the listing generation a settlement must match; the latest request wins. */
286
- const generations = /* @__PURE__ */ new Map();
287
- const roots = /* @__PURE__ */ new Map();
288
- const nextGeneration = (tabId, path) => {
289
- const byPath = generations.get(tabId) ?? /* @__PURE__ */ new Map();
290
- generations.set(tabId, byPath);
291
- const generation = (byPath.get(path) ?? 0) + 1;
292
- byPath.set(path, generation);
293
- return generation;
698
+ function filesFace(list, watch, canOpen, navigationOf) {
699
+ return (sessionId, store, place) => {
700
+ const { actions } = store;
701
+ const panes = /* @__PURE__ */ new Map();
702
+ const record = (paneId) => {
703
+ let pane = panes.get(paneId);
704
+ if (pane === void 0) {
705
+ pane = {
706
+ lifetime: void 0,
707
+ mounts: 0,
708
+ tabs: /* @__PURE__ */ new Set(),
709
+ holds: 0,
710
+ root: void 0,
711
+ scrollTop: 0,
712
+ revealed: void 0,
713
+ revealing: void 0,
714
+ drawn: void 0,
715
+ current: void 0,
716
+ scrollToCurrent: false,
717
+ focus: void 0,
718
+ show: false,
719
+ width: (0, _deepseek_ai_dsh_client_store.createSnapshotStore)(void 0),
720
+ navigator: void 0,
721
+ closable: false,
722
+ unobserve: void 0,
723
+ toggle: void 0
724
+ };
725
+ panes.set(paneId, pane);
726
+ }
727
+ return pane;
294
728
  };
295
- const load = async (tabId, path, signal) => {
296
- if (signal.aborted) return;
297
- const generation = nextGeneration(tabId, path);
298
- actions.loading(tabId, path);
299
- return list(sessionId, path, signal).then((result) => {
300
- if (signal.aborted || generations.get(tabId)?.get(path) !== generation) return;
301
- if (result.ok) actions.loaded(tabId, path, result.value);
302
- else actions.failed(tabId, path, result.error);
303
- return result.ok ? result.value : void 0;
729
+ /** Each open tab's latest pane. */
730
+ const homes = /* @__PURE__ */ new Map();
731
+ const forget = (paneId, pane) => {
732
+ pane.lifetime?.abort();
733
+ pane.root?.close();
734
+ pane.root = void 0;
735
+ pane.unobserve?.();
736
+ panes.delete(paneId);
737
+ actions.forget(paneId);
738
+ };
739
+ const settle = (paneId, pane) => {
740
+ if (pane.mounts > 0 || pane.tabs.size > 0) return;
741
+ queueMicrotask(() => {
742
+ if (pane.mounts === 0 && pane.tabs.size === 0 && panes.get(paneId) === pane) forget(paneId, pane);
304
743
  });
305
744
  };
306
- return {
307
- refresh: (tabId) => {
308
- roots.get(tabId)?.refreshTree();
745
+ const leave = (tabId, home) => {
746
+ home.pane.tabs.delete(tabId);
747
+ settle(home.paneId, home.pane);
748
+ };
749
+ const load = async (paneId, path, signal) => {
750
+ const aborted = () => signal.aborted;
751
+ if (aborted()) return void 0;
752
+ actions.loading(paneId, path);
753
+ const result = await list(sessionId, path, signal);
754
+ if (aborted()) return void 0;
755
+ if (result.ok) actions.loaded(paneId, path, result.value);
756
+ else actions.failed(paneId, path, result.error);
757
+ return result.ok ? result.value : void 0;
758
+ };
759
+ let batching = false;
760
+ const batch = (write) => {
761
+ batching = true;
762
+ try {
763
+ write();
764
+ } finally {
765
+ batching = false;
766
+ }
767
+ };
768
+ const relisting = (paneId, paths) => {
769
+ for (const path of paths) if (store.getSnapshot().byPane[paneId]?.tree?.levels[path]?.kind === "ready") actions.loading(paneId, path);
770
+ };
771
+ const drop = (paneId) => {
772
+ const pane = panes.get(paneId);
773
+ if (pane !== void 0 && pane.lifetime === void 0) settle(paneId, pane);
774
+ };
775
+ const expand = (paneId, parentPath, path, expanded, manual) => {
776
+ const pane = panes.get(paneId);
777
+ const root = pane?.root;
778
+ if (pane === void 0 || root === void 0) return;
779
+ const parent = root.find(parentPath);
780
+ if (parent === void 0 && !expanded.includes(parentPath)) return;
781
+ const collapsing = expanded.includes(path);
782
+ if (manual && collapsing && pane.revealing !== void 0) {
783
+ pane.revealed = pane.revealing;
784
+ pane.revealing = void 0;
785
+ }
786
+ const next = collapsing ? expanded.filter((value) => value !== path) : [...expanded, path];
787
+ root.setExpanded(next);
788
+ if (collapsing) parent?.collapse(path);
789
+ else parent?.expand(path, next);
790
+ batch(() => {
791
+ actions.toggled(paneId, path);
792
+ if (!collapsing) relisting(paneId, next.filter((value) => value === path || value.startsWith(childPath(path, ""))));
793
+ });
794
+ reveal();
795
+ };
796
+ const focusTree = (pane) => {
797
+ const handoff = {};
798
+ pane.focus = handoff;
799
+ queueMicrotask(() => {
800
+ if (pane.focus !== handoff) return;
801
+ pane.focus = void 0;
802
+ (pane.current ?? pane.drawn?.body)?.focus();
803
+ });
804
+ };
805
+ const step = (paneId, pane) => {
806
+ const address = pane.revealing;
807
+ const tree = store.getSnapshot().byPane[paneId]?.tree;
808
+ if (address === void 0 || tree === void 0 || pane.root === void 0) return;
809
+ const path = relativeFileOf(address, sessionId, tree.root);
810
+ const location = path === void 0 ? void 0 : locateFile(tree, path);
811
+ const next = location?.ancestors.find((ancestor) => !tree.expanded.includes(ancestor.path));
812
+ if (next !== void 0) {
813
+ expand(paneId, next.parent, next.path, tree.expanded, false);
814
+ return;
815
+ }
816
+ if (location?.pending === true) return;
817
+ pane.revealing = void 0;
818
+ pane.revealed = address;
819
+ if (location?.current === void 0) return;
820
+ if (pane.current === void 0) pane.scrollToCurrent = true;
821
+ else pane.current.scrollIntoView({
822
+ block: "nearest",
823
+ inline: "nearest"
824
+ });
825
+ };
826
+ const reveal = () => {
827
+ for (const [paneId, pane] of panes) if (pane.revealing !== void 0) step(paneId, pane);
828
+ };
829
+ store.subscribe(() => {
830
+ if (!batching) reveal();
831
+ });
832
+ const open = (paneId, pane, signal, root) => {
833
+ if (pane.root?.path === root) return;
834
+ pane.root?.close();
835
+ const tree = store.getSnapshot().byPane[paneId]?.tree;
836
+ const kept = tree?.root === root ? tree : void 0;
837
+ if (kept === void 0) {
838
+ actions.start(paneId, root);
839
+ pane.scrollTop = 0;
840
+ pane.revealed = void 0;
841
+ pane.revealing = pane.drawn?.address;
842
+ }
843
+ const node = new DirectoryNode(root, (path, lifetime) => load(paneId, path, lifetime), (path, lifetime) => watch(sessionId, path, lifetime), (path, error) => {
844
+ if (pane.root === node) actions.failed(paneId, path, new RemoteError("gateway/internal", error instanceof Error ? error.message : String(error), {}));
845
+ }, signal, kept?.expanded);
846
+ if (kept !== void 0) node.setAutomatic(kept.autoRefresh);
847
+ pane.root = node;
848
+ node.open();
849
+ if (kept !== void 0) batch(() => {
850
+ relisting(paneId, kept.expanded);
851
+ });
852
+ step(paneId, pane);
853
+ };
854
+ const answerNavigation = (home) => {
855
+ if (home.mounts === 0) return;
856
+ const navigation = home.navigation.getSnapshot();
857
+ if (navigation.revision <= home.revision) return;
858
+ const { pane, paneId } = home;
859
+ if (store.getSnapshot().byPane[paneId]?.open !== true) {
860
+ home.revision = navigation.revision;
861
+ return;
862
+ }
863
+ const navigator = pane.navigator;
864
+ if (navigator === void 0 || pane.drawn?.address !== navigation.address) return;
865
+ const row = layoutParent(navigator);
866
+ if (row === null) return;
867
+ home.revision = navigation.revision;
868
+ const window = row.ownerDocument.defaultView;
869
+ if (pane.closable && (row.getBoundingClientRect().width < 400 || typeof window?.matchMedia === "function" && window.matchMedia("(width < 768px)").matches)) face.hide(paneId);
870
+ };
871
+ const answerDrawn = (pane) => {
872
+ for (const home of homes.values()) if (home.pane === pane) answerNavigation(home);
873
+ };
874
+ const face = {
875
+ attach(paneId, tabId, tabSignal) {
876
+ if (tabSignal.aborted) {
877
+ drop(paneId);
878
+ return () => {};
879
+ }
880
+ const pane = record(paneId);
881
+ pane.lifetime ??= new AbortController();
882
+ if (pane.show) {
883
+ pane.show = false;
884
+ actions.shown(paneId, true);
885
+ }
886
+ pane.mounts += 1;
887
+ let home = homes.get(tabId);
888
+ if (home === void 0) {
889
+ const first = {
890
+ paneId,
891
+ pane,
892
+ mounts: 0,
893
+ revision: 0,
894
+ navigation: navigationOf(sessionId, tabId)
895
+ };
896
+ home = first;
897
+ homes.set(tabId, first);
898
+ const unsubscribe = first.navigation.subscribe(() => {
899
+ answerNavigation(first);
900
+ });
901
+ tabSignal.addEventListener("abort", () => {
902
+ unsubscribe();
903
+ homes.delete(tabId);
904
+ leave(tabId, first);
905
+ }, { once: true });
906
+ } else if (home.pane !== pane) {
907
+ leave(tabId, home);
908
+ home.paneId = paneId;
909
+ home.pane = pane;
910
+ }
911
+ home.mounts += 1;
912
+ pane.tabs.add(tabId);
913
+ answerNavigation(home);
914
+ let attached = true;
915
+ return () => {
916
+ if (!attached) return;
917
+ attached = false;
918
+ pane.mounts -= 1;
919
+ home.mounts -= 1;
920
+ settle(paneId, pane);
921
+ };
309
922
  },
310
- setAutoRefresh: (tabId, enabled) => {
311
- actions.autoRefresh(tabId, enabled);
312
- roots.get(tabId)?.setAutomatic(enabled);
923
+ placeBeside: (tabId) => place(tabId, face),
924
+ hold(paneId, root) {
925
+ const pane = panes.get(paneId);
926
+ if (pane?.lifetime === void 0) return () => {};
927
+ pane.holds += 1;
928
+ open(paneId, pane, pane.lifetime.signal, root);
929
+ let held = true;
930
+ return () => {
931
+ if (!held) return;
932
+ held = false;
933
+ pane.holds -= 1;
934
+ queueMicrotask(() => {
935
+ if (pane.holds > 0) return;
936
+ pane.root?.close();
937
+ pane.root = void 0;
938
+ });
939
+ };
313
940
  },
314
- start(tabId, root, signal) {
315
- actions.start(tabId, root);
316
- signal.addEventListener("abort", () => {
317
- roots.get(tabId)?.close();
318
- roots.delete(tabId);
319
- generations.delete(tabId);
320
- actions.forget(tabId);
321
- }, { once: true });
322
- roots.set(tabId, new DirectoryNode(root, (path, lifetime) => load(tabId, path, lifetime), (path, lifetime) => watch(sessionId, path, lifetime), (path, error) => {
323
- if (!signal.aborted) actions.failed(tabId, path, new RemoteError("gateway/internal", error instanceof Error ? error.message : String(error), {}));
324
- }, signal).open());
941
+ refresh: (paneId) => {
942
+ panes.get(paneId)?.root?.refreshTree();
325
943
  },
326
- load: (tabId, path, signal) => {
327
- load(tabId, path, signal);
944
+ setAutoRefresh: (paneId, enabled) => {
945
+ actions.autoRefresh(paneId, enabled);
946
+ panes.get(paneId)?.root?.setAutomatic(enabled);
328
947
  },
329
- toggle(tabId, parentPath, path, expanded, signal) {
330
- if (signal.aborted) return;
331
- const root = roots.get(tabId);
332
- if (root === void 0) return;
333
- const parent = root.find(parentPath);
334
- if (parent === void 0 && !expanded.includes(parentPath)) return;
335
- const collapsing = expanded.includes(path);
336
- const next = collapsing ? expanded.filter((value) => value !== path) : [...expanded, path];
337
- root.setExpanded(next);
338
- if (collapsing) parent?.collapse(path);
339
- else parent?.expand(path, next);
340
- actions.toggled(tabId, path);
341
- }
948
+ toggle: (paneId, parentPath, path, expanded) => {
949
+ expand(paneId, parentPath, path, expanded, true);
950
+ },
951
+ scrolled: (paneId, scrollTop) => {
952
+ const pane = panes.get(paneId);
953
+ if (pane?.lifetime !== void 0) pane.scrollTop = scrollTop;
954
+ },
955
+ hide(paneId) {
956
+ const pane = panes.get(paneId);
957
+ if (pane?.lifetime === void 0) return;
958
+ const navigator = pane.navigator;
959
+ const held = pane.focus !== void 0 || navigator?.contains(navigator.ownerDocument.activeElement) === true;
960
+ pane.focus = void 0;
961
+ actions.shown(paneId, false);
962
+ if (held) queueMicrotask(() => {
963
+ panes.get(paneId)?.toggle?.focus();
964
+ });
965
+ },
966
+ focus(paneId) {
967
+ const pane = panes.get(paneId);
968
+ if (pane === void 0) return;
969
+ if (pane.lifetime === void 0) pane.show = true;
970
+ else actions.shown(paneId, true);
971
+ if (pane.drawn === void 0) pane.focus = REQUESTED;
972
+ else focusTree(pane);
973
+ },
974
+ bodyDrawn(paneId, address, body) {
975
+ if (body === null) {
976
+ const pane = panes.get(paneId);
977
+ if (pane === void 0) return;
978
+ const gone = pane.drawn?.body;
979
+ pane.drawn = void 0;
980
+ pane.revealing = void 0;
981
+ pane.scrollToCurrent = false;
982
+ drop(paneId);
983
+ if (gone?.contains(gone.ownerDocument.activeElement) !== true) return;
984
+ const handoff = {};
985
+ pane.focus = handoff;
986
+ queueMicrotask(() => {
987
+ if (pane.focus === handoff) pane.focus = void 0;
988
+ });
989
+ return;
990
+ }
991
+ const pane = record(paneId);
992
+ pane.drawn = {
993
+ body,
994
+ address
995
+ };
996
+ body.scrollTop = pane.scrollTop;
997
+ if (pane.focus !== void 0) focusTree(pane);
998
+ pane.revealing = pane.revealed === address ? void 0 : address;
999
+ step(paneId, pane);
1000
+ },
1001
+ currentDrawn(paneId, row) {
1002
+ if (row === null) {
1003
+ const pane = panes.get(paneId);
1004
+ if (pane !== void 0) pane.current = void 0;
1005
+ drop(paneId);
1006
+ return;
1007
+ }
1008
+ const pane = record(paneId);
1009
+ pane.current = row;
1010
+ if (!pane.scrollToCurrent) return;
1011
+ pane.scrollToCurrent = false;
1012
+ row.scrollIntoView({
1013
+ block: "nearest",
1014
+ inline: "nearest"
1015
+ });
1016
+ },
1017
+ navigatorDrawn(paneId, navigator, closable) {
1018
+ const pane = navigator === null ? panes.get(paneId) : record(paneId);
1019
+ if (pane === void 0) return;
1020
+ pane.unobserve?.();
1021
+ pane.unobserve = void 0;
1022
+ pane.navigator = navigator ?? void 0;
1023
+ pane.closable = closable;
1024
+ if (navigator === null) {
1025
+ drop(paneId);
1026
+ return;
1027
+ }
1028
+ const row = layoutParent(navigator);
1029
+ if (row === null) return;
1030
+ const document = row.ownerDocument;
1031
+ let edge;
1032
+ const handOff = () => {
1033
+ const held = edge;
1034
+ if (held === void 0) return;
1035
+ const active = document.activeElement;
1036
+ if (active !== held && active !== document.body && active !== null) {
1037
+ edge = void 0;
1038
+ return;
1039
+ }
1040
+ if (held.isConnected && getComputedStyle(held).display !== "none") {
1041
+ if (active !== held) edge = void 0;
1042
+ return;
1043
+ }
1044
+ edge = void 0;
1045
+ focusTree(pane);
1046
+ };
1047
+ const focusin = (event) => {
1048
+ edge = event.target instanceof Element && event.target.hasAttribute("data-files-navigator-resize") ? event.target : void 0;
1049
+ };
1050
+ const focusout = (event) => {
1051
+ if (event.relatedTarget === null) queueMicrotask(handOff);
1052
+ else edge = void 0;
1053
+ };
1054
+ const viewport = closable && typeof matchMedia === "function" ? matchMedia(FULLSCREEN_QUERY) : void 0;
1055
+ let filling = false;
1056
+ const hidden = (element) => getComputedStyle(element).visibility === "hidden";
1057
+ let covered;
1058
+ const release = (event) => {
1059
+ const target = event.target;
1060
+ covered = event.relatedTarget === null && target instanceof Element && !navigator.contains(target) && hidden(target) ? target : void 0;
1061
+ };
1062
+ const forget = () => {
1063
+ covered = void 0;
1064
+ };
1065
+ const measure = () => {
1066
+ const active = document.activeElement;
1067
+ const blurred = covered;
1068
+ covered = void 0;
1069
+ const width = row.getBoundingClientRect().width;
1070
+ const fills = closable && (width < 400 || viewport?.matches === true);
1071
+ const entering = fills && !filling;
1072
+ filling = fills;
1073
+ pane.width.set(width);
1074
+ answerDrawn(pane);
1075
+ const inContent = active !== null && row.contains(active) && !navigator.contains(active);
1076
+ const blurredByFill = blurred !== void 0 && (active === null || active === document.body) && row.contains(blurred) && hidden(blurred);
1077
+ if (entering && store.getSnapshot().byPane[paneId]?.open === true && (inContent || blurredByFill) && pane.focus === void 0) focusTree(pane);
1078
+ if (edge !== void 0) queueMicrotask(handOff);
1079
+ };
1080
+ const close = (event) => {
1081
+ if (event.key !== "Escape" || event.defaultPrevented || event.isComposing || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
1082
+ if (!(event.target instanceof Node) || !row.contains(event.target)) return;
1083
+ event.preventDefault();
1084
+ pane.toggle?.focus();
1085
+ actions.shown(paneId, false);
1086
+ };
1087
+ measure();
1088
+ const observer = new ResizeObserver(measure);
1089
+ observer.observe(row);
1090
+ viewport?.addEventListener("change", measure);
1091
+ if (closable) {
1092
+ document.addEventListener("keydown", close);
1093
+ row.addEventListener("focusout", release);
1094
+ document.addEventListener("focusin", forget, true);
1095
+ document.addEventListener("pointerdown", forget, true);
1096
+ window.addEventListener("blur", forget);
1097
+ }
1098
+ navigator.addEventListener("focusin", focusin);
1099
+ navigator.addEventListener("focusout", focusout);
1100
+ pane.unobserve = () => {
1101
+ observer.disconnect();
1102
+ viewport?.removeEventListener("change", measure);
1103
+ document.removeEventListener("keydown", close);
1104
+ row.removeEventListener("focusout", release);
1105
+ document.removeEventListener("focusin", forget, true);
1106
+ document.removeEventListener("pointerdown", forget, true);
1107
+ window.removeEventListener("blur", forget);
1108
+ navigator.removeEventListener("focusin", focusin);
1109
+ navigator.removeEventListener("focusout", focusout);
1110
+ };
1111
+ },
1112
+ toggleDrawn(paneId, toggle) {
1113
+ if (toggle !== null) {
1114
+ record(paneId).toggle = toggle;
1115
+ return;
1116
+ }
1117
+ const pane = panes.get(paneId);
1118
+ if (pane !== void 0) pane.toggle = void 0;
1119
+ drop(paneId);
1120
+ },
1121
+ hooks: { canOpen },
1122
+ keyedHooks: { rowWidth: (paneId) => record(paneId).width }
342
1123
  };
1124
+ return face;
343
1125
  };
344
1126
  }
345
1127
  //#endregion
@@ -358,66 +1140,334 @@ window.__ModuleLoader__.load({
358
1140
  return n;
359
1141
  }
360
1142
  //#endregion
361
- //#region ../../util/workspace-path/src/file-address.ts
362
- /** The scheme and type every file address opens with. */
363
- const FILE_ADDRESS_PREFIX = "dsh-resource://file/";
364
- /** Component-encode one id or path segment, keeping `:` literal for drive letters. */
365
- function encodeSegment(segment) {
366
- return encodeURIComponent(segment).replace(/%3A/gi, ":");
1143
+ //#region \0dsh-css:/Users/songli/deepseek-harness/packages/client/ui-sidebar-files/src/client/FileTree.module.css.mjs
1144
+ const css$1 = "._1KKbyW_level{margin:0;padding:0;list-style:none}._1KKbyW_level ._1KKbyW_level{padding-left:18px}._1KKbyW_item{margin:0;padding:0}._1KKbyW_row{border-radius:var(--dsw-radius-md);align-items:center;width:100%;min-width:0;display:flex}._1KKbyW_action{min-width:0;color:inherit;font:inherit;text-align:left;border-radius:var(--dsw-radius-md);cursor:pointer;background:0 0;border:0;flex:1;align-items:center;gap:6px;padding:5px 10px;display:flex}._1KKbyW_accessory:empty{display:none}._1KKbyW_accessory{flex:none;align-items:center;padding-right:10px;display:flex}@media (hover:hover){._1KKbyW_row:hover{background:var(--dsw-alias-interactive-bg-hover)}._1KKbyW_current:hover{background:var(--dsw-alias-interactive-bg-active)}}._1KKbyW_current{background:var(--dsw-alias-interactive-bg-active)}._1KKbyW_icon{color:var(--dsw-alias-label-tertiary);flex:none}._1KKbyW_fileIcon{flex:none}._1KKbyW_name{white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}._1KKbyW_hidden{color:var(--dsw-alias-label-secondary)}._1KKbyW_other{color:var(--dsw-alias-label-tertiary);cursor:default}@media (hover:hover){._1KKbyW_inactive:hover{background:0 0}}._1KKbyW_note{color:var(--dsw-alias-label-tertiary);margin:0;padding:3px 10px;font-size:12px}";
1145
+ const tagId$1 = "@deepseek-ai/dsh-client-ui-sidebar-files/FileTree.module.css";
1146
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
1147
+ const tag = document.createElement("style");
1148
+ tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-sidebar-files";
1149
+ tag.dataset.pluginCss = tagId$1;
1150
+ tag.textContent = css$1;
1151
+ document.head.appendChild(tag);
367
1152
  }
368
- /** Encode a `/`-separated path segment by segment. */
369
- function encodePath(path) {
370
- return path.split("/").map(encodeSegment).join("/");
1153
+ var FileTree_module_css_default = {
1154
+ "accessory": "_1KKbyW_accessory",
1155
+ "action": "_1KKbyW_action",
1156
+ "current": "_1KKbyW_current",
1157
+ "fileIcon": "_1KKbyW_fileIcon",
1158
+ "hidden": "_1KKbyW_hidden",
1159
+ "icon": "_1KKbyW_icon",
1160
+ "inactive": "_1KKbyW_inactive",
1161
+ "item": "_1KKbyW_item",
1162
+ "level": "_1KKbyW_level",
1163
+ "name": "_1KKbyW_name",
1164
+ "note": "_1KKbyW_note",
1165
+ "other": "_1KKbyW_other",
1166
+ "row": "_1KKbyW_row"
1167
+ };
1168
+ //#endregion
1169
+ //#region lib/types/client/FileTree.js
1170
+ /**
1171
+ * A controlled file tree Component Factory over flat entries. The caller owns
1172
+ * the data, which directories are expanded, each directory's listing
1173
+ * state, and what a click does; the tree derives each entry's level from its
1174
+ * path, adds the directories the paths imply, orders every drawn level, and
1175
+ * draws the rows and their icons. It redraws when its
1176
+ * props or the occurrence's local selection change, and orders a drawn level
1177
+ * again only when the names or directory kinds in that level change.
1178
+ */
1179
+ /** No row accessory unless the caller selects a local Component. */
1180
+ function EmptyAccessory() {
1181
+ return null;
371
1182
  }
1183
+ /** Natural, case-insensitive name order, so `file2` precedes `file10`. */
1184
+ const byName = new Intl.Collator(void 0, {
1185
+ numeric: true,
1186
+ sensitivity: "base"
1187
+ });
372
1188
  /**
373
- * Build the address of a file read through one Session.
374
- * @param sessionId - the Session whose Host workspace resolves the path.
375
- * @param path - absolute or workspace-relative path; backslashes are normalized to `/`, and leading `./` prefixes are dropped.
376
- * @returns the `dsh-resource://file/session/<sessionId>/<path>` address.
1189
+ * The key of the level an entry is listed in.
1190
+ * @param path - the entry's key.
1191
+ * @param root - the root's key.
1192
+ * @returns the part of `path` before its last `/`, or `root` when it has none.
377
1193
  */
378
- function sessionFileAddress(sessionId, path) {
379
- const normalized = path.replace(/\\/g, "/").replace(/^(?:\.\/)+/, "");
380
- return `${FILE_ADDRESS_PREFIX}session/${encodeSegment(sessionId)}/${encodePath(normalized)}`;
1194
+ function parentOf$1(path, root) {
1195
+ const slash = path.lastIndexOf("/");
1196
+ return slash < 0 ? root : path.slice(0, slash);
1197
+ }
1198
+ /**
1199
+ * Group entries under their parent keys, adding the directories their paths imply.
1200
+ * @param entries - the caller's entries; a repeated `path` keeps its first entry.
1201
+ * @param root - the root's key.
1202
+ * @returns each parent key's children.
1203
+ */
1204
+ function levelsOf(entries, root) {
1205
+ const byPath = /* @__PURE__ */ new Map();
1206
+ for (const entry of entries) if (entry.path !== root && !byPath.has(entry.path)) byPath.set(entry.path, entry);
1207
+ for (const entry of entries) {
1208
+ if (entry.path === root) continue;
1209
+ for (let parent = parentOf$1(entry.path, root); parent !== root && parent !== "" && !byPath.has(parent); parent = parentOf$1(parent, root)) byPath.set(parent, {
1210
+ path: parent,
1211
+ name: parent.slice(parent.lastIndexOf("/") + 1),
1212
+ meta: { kind: "directory" }
1213
+ });
1214
+ }
1215
+ const groups = /* @__PURE__ */ new Map();
1216
+ for (const entry of byPath.values()) {
1217
+ const parent = parentOf$1(entry.path, root);
1218
+ const group = groups.get(parent);
1219
+ if (group === void 0) groups.set(parent, [entry]);
1220
+ else group.push(entry);
1221
+ }
1222
+ const levels = /* @__PURE__ */ new Map();
1223
+ for (const [parent, group] of groups) levels.set(parent, group.map((entry) => ({
1224
+ entry,
1225
+ kind: entry.meta?.kind ?? (groups.has(entry.path) ? "directory" : "file")
1226
+ })));
1227
+ return levels;
1228
+ }
1229
+ /**
1230
+ * One level's display order: directories first, then everything else, each by name.
1231
+ * @param level - one parent key's children.
1232
+ * @returns the children's indices in display order.
1233
+ */
1234
+ function orderOf(level) {
1235
+ return level.map((node, index) => ({
1236
+ node,
1237
+ index
1238
+ })).sort(({ node: left }, { node: right }) => {
1239
+ const group = Number(right.kind === "directory") - Number(left.kind === "directory");
1240
+ return group !== 0 ? group : byName.compare(left.entry.name, right.entry.name);
1241
+ }).map(({ index }) => index);
1242
+ }
1243
+ /** One entry's row, and its children when it is an expanded directory. */
1244
+ function Entry({ node, tree }) {
1245
+ const { input, Accessory } = tree;
1246
+ const { entry, kind } = node;
1247
+ const hidden = entry.meta?.hidden === true && FileTree_module_css_default.hidden;
1248
+ const label = (0, react_jsx_runtime.jsx)("span", {
1249
+ className: FileTree_module_css_default.name,
1250
+ children: entry.name
1251
+ });
1252
+ if (kind === "directory") {
1253
+ const expanded = tree.expanded.has(entry.path);
1254
+ return (0, react_jsx_runtime.jsxs)("li", {
1255
+ className: FileTree_module_css_default.item,
1256
+ "data-files-entry": "directory",
1257
+ "data-files-path": entry.path,
1258
+ children: [(0, react_jsx_runtime.jsxs)("div", {
1259
+ className: FileTree_module_css_default.row,
1260
+ children: [(0, react_jsx_runtime.jsxs)("button", {
1261
+ type: "button",
1262
+ className: clsx(FileTree_module_css_default.action, hidden),
1263
+ "aria-expanded": expanded,
1264
+ onClick: () => {
1265
+ input.onToggle(entry, !expanded);
1266
+ },
1267
+ ...input.rowTriggerProps?.(entry, "directory"),
1268
+ children: [expanded ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderOpenRegular, { className: FileTree_module_css_default.icon }) : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderCloseRegular, { className: FileTree_module_css_default.icon }), label]
1269
+ }), (0, react_jsx_runtime.jsx)("div", {
1270
+ className: FileTree_module_css_default.accessory,
1271
+ children: (0, react_jsx_runtime.jsx)(Accessory, { entry })
1272
+ })]
1273
+ }), expanded && (0, react_jsx_runtime.jsx)("ul", {
1274
+ className: FileTree_module_css_default.level,
1275
+ children: (0, react_jsx_runtime.jsx)(Level, {
1276
+ path: entry.path,
1277
+ tree
1278
+ })
1279
+ })]
1280
+ });
1281
+ }
1282
+ if (kind === "file" && input.canOpen?.(entry) !== false) {
1283
+ const current = entry.path === input.current;
1284
+ return (0, react_jsx_runtime.jsx)("li", {
1285
+ className: FileTree_module_css_default.item,
1286
+ "data-files-entry": "file",
1287
+ "data-files-path": entry.path,
1288
+ children: (0, react_jsx_runtime.jsxs)("div", {
1289
+ className: clsx(FileTree_module_css_default.row, current && FileTree_module_css_default.current),
1290
+ children: [(0, react_jsx_runtime.jsxs)("button", {
1291
+ type: "button",
1292
+ className: clsx(FileTree_module_css_default.action, hidden),
1293
+ "aria-current": current || void 0,
1294
+ ref: current ? input.currentRef : void 0,
1295
+ ...input.rowTriggerProps?.(entry, "file"),
1296
+ onClick: () => {
1297
+ input.onOpen(entry);
1298
+ },
1299
+ children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.FileTypeIcon, {
1300
+ kind: (0, _deepseek_ai_dsh_client_ui_primitives.classifyFileType)(entry.name),
1301
+ size: 16,
1302
+ className: FileTree_module_css_default.fileIcon
1303
+ }), label]
1304
+ }), (0, react_jsx_runtime.jsx)("div", {
1305
+ className: FileTree_module_css_default.accessory,
1306
+ children: (0, react_jsx_runtime.jsx)(Accessory, { entry })
1307
+ })]
1308
+ })
1309
+ });
1310
+ }
1311
+ const file = kind === "file";
1312
+ return (0, react_jsx_runtime.jsx)("li", {
1313
+ className: FileTree_module_css_default.item,
1314
+ "data-files-entry": kind,
1315
+ "data-files-path": entry.path,
1316
+ children: (0, react_jsx_runtime.jsxs)("div", {
1317
+ className: clsx(FileTree_module_css_default.row, FileTree_module_css_default.inactive),
1318
+ children: [(0, react_jsx_runtime.jsxs)("span", {
1319
+ className: clsx(FileTree_module_css_default.action, hidden, FileTree_module_css_default.other),
1320
+ "aria-disabled": "true",
1321
+ title: tree.t(file ? "entry.noViewer" : "entry.other"),
1322
+ children: [file && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.FileTypeIcon, {
1323
+ kind: (0, _deepseek_ai_dsh_client_ui_primitives.classifyFileType)(entry.name),
1324
+ size: 16,
1325
+ className: FileTree_module_css_default.fileIcon
1326
+ }), label]
1327
+ }), (0, react_jsx_runtime.jsx)("div", {
1328
+ className: FileTree_module_css_default.accessory,
1329
+ children: (0, react_jsx_runtime.jsx)(Accessory, { entry })
1330
+ })]
1331
+ })
1332
+ });
1333
+ }
1334
+ /** No entries, shared so that an empty level orders nothing. */
1335
+ const NO_ENTRIES = [];
1336
+ /** One directory's rows: a loading line until it is listed, then its entries and notes. */
1337
+ function Level({ path, tree }) {
1338
+ const { t } = tree;
1339
+ const state = tree.input.directories?.[path];
1340
+ const level = tree.levels.get(path) ?? NO_ENTRIES;
1341
+ const order = (0, react.useMemo)(() => orderOf(level), [JSON.stringify(level.map((node) => [node.kind === "directory", node.entry.name]))]);
1342
+ if (state?.loading === true) return (0, react_jsx_runtime.jsx)("li", {
1343
+ className: FileTree_module_css_default.note,
1344
+ "data-files-row": "loading",
1345
+ children: t("loading")
1346
+ });
1347
+ return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
1348
+ state?.failure !== void 0 && (0, react_jsx_runtime.jsx)("li", {
1349
+ className: FileTree_module_css_default.note,
1350
+ "data-files-row": "failed",
1351
+ children: state.failure
1352
+ }),
1353
+ level.length === 0 && state?.failure === void 0 && (0, react_jsx_runtime.jsx)("li", {
1354
+ className: FileTree_module_css_default.note,
1355
+ "data-files-row": "empty",
1356
+ children: t("empty")
1357
+ }),
1358
+ order.map((index) => level[index]).filter((node) => node !== void 0).map((node) => (0, react_jsx_runtime.jsx)(Entry, {
1359
+ node,
1360
+ tree
1361
+ }, node.entry.path)),
1362
+ state?.truncated === true && (0, react_jsx_runtime.jsx)("li", {
1363
+ className: FileTree_module_css_default.note,
1364
+ "data-files-row": "truncated",
1365
+ children: t("truncated")
1366
+ })
1367
+ ] });
1368
+ }
1369
+ /**
1370
+ * The tree from its root.
1371
+ * @param props - the caller's entries, expansion, states, callbacks, and framework seats.
1372
+ * @returns the root level's list.
1373
+ */
1374
+ function FileTreeView({ t, useFactorySlot, ...input }) {
1375
+ const Accessory = useFactorySlot("accessory", EmptyAccessory);
1376
+ const tree = {
1377
+ levels: (0, react.useMemo)(() => levelsOf(input.entries, input.root), [input.entries, input.root]),
1378
+ expanded: (0, react.useMemo)(() => new Set(input.expanded), [input.expanded]),
1379
+ input,
1380
+ t,
1381
+ Accessory
1382
+ };
1383
+ return (0, react_jsx_runtime.jsx)("ul", {
1384
+ className: FileTree_module_css_default.level,
1385
+ children: (0, react_jsx_runtime.jsx)(Level, {
1386
+ path: input.root,
1387
+ tree
1388
+ })
1389
+ });
381
1390
  }
1391
+ /**
1392
+ * The file tree. It redraws when a prop or the occurrence's local selection
1393
+ * changes, so a caller keeps its inputs and local selection stable between renders.
1394
+ */
1395
+ const FileTree = (0, react.memo)(FileTreeView);
382
1396
  //#endregion
383
- //#region ../../util/workspace-path/src/index.ts
1397
+ //#region lib/types/client/workspace-tree.js
384
1398
  /**
385
- * Browser-safe Workspace path and display helpers.
386
- * @module @deepseek-ai/dsh-util-workspace-path
1399
+ * Say why a directory could not be listed, in terms of the directory.
1400
+ * @param t - namespace-bound translate.
1401
+ * @param failure - the settled Remote failure.
1402
+ * @returns the line to show under the directory.
387
1403
  */
388
- /** Whether a path uses a Windows drive or UNC prefix. */
389
- function isWindowsStylePath(value) {
390
- return /^[A-Za-z]:[/\\]/.test(value) || value.startsWith("\\\\");
1404
+ function failureLine(t, failure) {
1405
+ switch (failure.code) {
1406
+ case "workspace-file/not-found": return t("error.notFound");
1407
+ case "workspace-file/outside-workspace": return t("error.outsideWorkspace");
1408
+ case "workspace-file/not-directory": return t("error.notDirectory");
1409
+ default: return t("error.unavailable", { message: failure.message });
1410
+ }
391
1411
  }
392
1412
  /**
393
- * Whether a path is absolute in either spelling the Host accepts: POSIX (`/a/b`) or Windows drive or UNC.
394
- * @param path - the path to classify.
395
- * @returns `true` for an absolute path; `false` for a Workspace-relative one.
1413
+ * The tree key of a workspace root.
1414
+ * @param root - the root's absolute path as the Host reports it.
1415
+ * @returns the path without trailing separators.
396
1416
  */
397
- function isAbsoluteWorkspacePath(path) {
398
- return path.startsWith("/") || isWindowsStylePath(path);
1417
+ function treeRootOf(root) {
1418
+ return root.replace(/[/\\]+$/, "");
1419
+ }
1420
+ /**
1421
+ * The store key of the directory a tree key's entry is listed in.
1422
+ * @param tree - the pane's tree.
1423
+ * @param path - an entry's tree key.
1424
+ * @returns the absolute path of its parent, the root spelled as the store keeps it.
1425
+ */
1426
+ function parentOf(tree, path) {
1427
+ const parent = path.slice(0, path.lastIndexOf("/"));
1428
+ return parent === treeRootOf(tree.root) ? tree.root : parent;
1429
+ }
1430
+ /**
1431
+ * Every listed entry of a pane's tree, collapsed levels included, each named
1432
+ * as its listing spells it.
1433
+ * @param levels - the pane's level states.
1434
+ * @returns the entries keyed as the tree draws them.
1435
+ */
1436
+ function workspaceEntries(levels) {
1437
+ return Object.entries(levels).flatMap(([path, level]) => level.kind !== "ready" ? [] : level.level.entries.map((entry) => ({
1438
+ path: childPath(path, entry.name),
1439
+ name: entry.name,
1440
+ meta: { kind: entry.type }
1441
+ })));
399
1442
  }
400
1443
  /**
401
- * The address for a path as a caller holds it: a relative path, or an absolute
402
- * path inside the Session's workspace, becomes a `session`-scoped address; an
403
- * absolute path outside it, or one whose workspace root is unknown, keeps its
404
- * absolute path in that Session's address.
405
- * @param sessionId - the Session the path is read in.
406
- * @param cwd - that Session's workspace root, when known.
407
- * @param path - absolute or workspace-relative path, in either separator spelling.
408
- * @returns the `dsh-resource://file/…` address.
1444
+ * Each directory's listing state: loading until its first listing settles, then
1445
+ * its latest failure and whether its listing is truncated.
1446
+ * @param tree - the pane's root, level states, and expanded directories.
1447
+ * @param t - namespace-bound translate, for failure lines.
1448
+ * @returns the states keyed as the tree draws them.
409
1449
  */
410
- function fileAddressFor(sessionId, cwd, path) {
411
- const normalized = path.replace(/\\/g, "/");
412
- if (!isAbsoluteWorkspacePath(normalized)) return sessionFileAddress(sessionId, normalized);
413
- const root = cwd === void 0 ? "" : cwd.replace(/\\/g, "/").replace(/\/+$/, "");
414
- if (root !== "" && normalized === root) return sessionFileAddress(sessionId, "");
415
- if (root !== "" && normalized.startsWith(`${root}/`)) return sessionFileAddress(sessionId, normalized.slice(root.length + 1));
416
- return sessionFileAddress(sessionId, normalized);
1450
+ function workspaceDirectories(tree, t) {
1451
+ const { root, levels, expanded } = tree;
1452
+ const directories = {};
1453
+ const keyOf = (path) => path === root ? treeRootOf(path) : path;
1454
+ for (const path of expanded) directories[keyOf(path)] = { loading: true };
1455
+ for (const [path, level] of Object.entries(levels)) {
1456
+ const key = keyOf(path);
1457
+ if (level.kind === "loading") directories[key] = { loading: true };
1458
+ else if (level.kind === "failed") directories[key] = { failure: failureLine(t, level.failure) };
1459
+ else {
1460
+ const state = {};
1461
+ if (level.failure !== void 0) state.failure = failureLine(t, level.failure);
1462
+ if (level.level.truncated) state.truncated = true;
1463
+ directories[key] = state;
1464
+ }
1465
+ }
1466
+ return directories;
417
1467
  }
418
1468
  //#endregion
419
1469
  //#region \0dsh-css:/Users/songli/deepseek-harness/packages/client/ui-sidebar-files/src/client/FilesBody.module.css.mjs
420
- const css = ".EjH56G_root{height:100%;min-height:0;color:var(--dsw-alias-label-primary);font-size:var(--dsh-content-font-size-secondary,13px);flex-direction:column;flex:auto;line-height:1.5;display:flex}.EjH56G_header{box-sizing:border-box;border-bottom:.5px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:4px;height:38px;padding:0 6px 0 16px;display:flex}.EjH56G_path{margin-right:12px}.EjH56G_body{scrollbar-gutter:stable;flex:auto;min-height:0;margin-right:2px;padding:8px 0 8px 8px;overflow:auto}.EjH56G_body::-webkit-scrollbar-track{margin:2px}.EjH56G_level{margin:0;padding:0;list-style:none}.EjH56G_level .EjH56G_level{padding-left:18px}.EjH56G_item{margin:0;padding:0}.EjH56G_row{width:100%;min-width:0;color:inherit;font:inherit;text-align:left;border-radius:var(--dsw-radius-md);cursor:pointer;background:0 0;border:0;align-items:center;gap:6px;padding:5px 10px;display:flex}@media (hover:hover){.EjH56G_row:hover{background:var(--dsw-alias-interactive-bg-hover)}}.EjH56G_icon{color:var(--dsw-alias-label-tertiary);flex:none}.EjH56G_fileIcon{flex:none}.EjH56G_name{white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}.EjH56G_other{color:var(--dsw-alias-label-tertiary);cursor:default}@media (hover:hover){.EjH56G_other:hover{background:0 0}}.EjH56G_note{color:var(--dsw-alias-label-tertiary);margin:0;padding:3px 10px;font-size:12px}.EjH56G_status{flex-direction:column;padding:12px 10px;display:flex}.EjH56G_statusLine{color:var(--dsw-alias-label-secondary);font-size:var(--dsh-content-font-size-secondary,13px);margin:0;line-height:1.6}.EjH56G_tool{width:28px;height:28px;color:var(--dsw-alias-label-secondary);border-radius:var(--dsw-radius-sm);cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:6px;line-height:1;display:inline-flex}.EjH56G_tool svg{width:15px;height:15px}@media (hover:hover){.EjH56G_tool:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}}.EjH56G_tool[aria-pressed=true]{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.EjH56G_titleIcon{flex:none}";
1470
+ const css = ".EjH56G_page{min-width:0;height:100%;min-height:0;color:var(--dsw-alias-label-primary);font-size:var(--dsh-content-font-size-secondary,13px);flex-direction:column;flex:auto;line-height:1.5;display:flex}.EjH56G_content{isolation:isolate;flex:auto;min-width:0;min-height:0;display:flex;position:relative}.EjH56G_navigator{box-sizing:border-box;width:var(--files-navigator-width);min-width:0;height:100%;min-height:0;color:var(--dsw-alias-label-primary);font-size:var(--dsh-content-font-size-secondary,13px);background:var(--dsw-alias-bg-base);border-left:.5px solid var(--dsw-alias-border-l3);flex-direction:column;flex:none;line-height:1.5;display:flex;position:relative}.EjH56G_wholePage{border-left:0;flex:auto;width:auto}.EjH56G_separator{z-index:1;cursor:col-resize;touch-action:none;width:8px;position:absolute;top:0;bottom:0;left:-4px}.EjH56G_fill{z-index:2;border-left:0;width:auto;height:auto;position:absolute;inset:0}:has(>.EjH56G_navigator.EjH56G_fill)>:not(.EjH56G_navigator){visibility:hidden}@media (width<768px){:has(>.EjH56G_navigator:not(.EjH56G_wholePage))>:not(.EjH56G_navigator){visibility:hidden}.EjH56G_navigator{z-index:2;border-left:0;width:auto;height:auto;position:absolute;inset:0}.EjH56G_separator{display:none}}@media (width>=768px){.EjH56G_push,.EjH56G_overlay{background:var(--dsw-alias-bg-layer-2);border-radius:var(--dsw-radius-lg);--dsw-elevation-stroke-color:var(--dsw-alias-border-l2);box-shadow:var(--dsw-elevation-prominent);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border:0}.EjH56G_push{align-self:stretch;height:auto;margin:8px}.EjH56G_overlay{z-index:2;height:auto;position:absolute;top:8px;bottom:8px;right:8px}body[data-ds-dark-theme] .EjH56G_push,body[data-ds-dark-theme] .EjH56G_overlay{background:var(--dsw-alias-bg-base);box-shadow:var(--dsw-elevation-stroke), 0 3px 8px 0 color-mix(in srgb, var(--dsw-static-neutral-00) 8%, transparent), 0 0 20px 0 color-mix(in srgb, var(--dsw-static-neutral-00) 6%, transparent)}.EjH56G_push .EjH56G_body::-webkit-scrollbar-track,.EjH56G_overlay .EjH56G_body::-webkit-scrollbar-track{margin:var(--dsw-radius-lg) 2px}}.EjH56G_dragging{cursor:col-resize;user-select:none}.EjH56G_header{box-sizing:border-box;border-bottom:.5px solid var(--dsw-alias-border-l3);flex:none;align-items:center;gap:4px;height:38px;padding:0 6px 0 16px;display:flex}.EjH56G_path{margin-right:12px}.EjH56G_body{scrollbar-gutter:stable;flex:auto;min-height:0;margin-right:2px;padding:8px 0 8px 8px;overflow:auto}.EjH56G_body::-webkit-scrollbar-track{margin:2px}.EjH56G_note{color:var(--dsw-alias-label-tertiary);margin:0;padding:3px 10px;font-size:12px}.EjH56G_status{flex-direction:column;padding:12px 10px;display:flex}.EjH56G_statusLine{color:var(--dsw-alias-label-secondary);font-size:var(--dsh-content-font-size-secondary,13px);margin:0;line-height:1.6}.EjH56G_tool{width:28px;height:28px;color:var(--dsw-alias-label-secondary);border-radius:var(--dsw-radius-sm);cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:6px;line-height:1;display:inline-flex}.EjH56G_tool svg{width:15px;height:15px}@media (hover:hover){.EjH56G_tool:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}}.EjH56G_tool[aria-pressed=true],.EjH56G_tool[aria-expanded=true]{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.EjH56G_titleIcon{flex:none}";
421
1471
  const tagId = "@deepseek-ai/dsh-client-ui-sidebar-files/FilesBody.module.css";
422
1472
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
423
1473
  const tag = document.createElement("style");
@@ -428,210 +1478,264 @@ window.__ModuleLoader__.load({
428
1478
  }
429
1479
  var FilesBody_module_css_default = {
430
1480
  "body": "EjH56G_body",
431
- "fileIcon": "EjH56G_fileIcon",
1481
+ "content": "EjH56G_content",
1482
+ "dragging": "EjH56G_dragging",
1483
+ "fill": "EjH56G_fill",
432
1484
  "header": "EjH56G_header",
433
- "icon": "EjH56G_icon",
434
- "item": "EjH56G_item",
435
- "level": "EjH56G_level",
436
- "name": "EjH56G_name",
1485
+ "navigator": "EjH56G_navigator",
437
1486
  "note": "EjH56G_note",
438
- "other": "EjH56G_other",
1487
+ "overlay": "EjH56G_overlay",
1488
+ "page": "EjH56G_page",
439
1489
  "path": "EjH56G_path",
440
- "root": "EjH56G_root",
441
- "row": "EjH56G_row",
1490
+ "push": "EjH56G_push",
1491
+ "separator": "EjH56G_separator",
442
1492
  "status": "EjH56G_status",
443
1493
  "statusLine": "EjH56G_statusLine",
444
1494
  "titleIcon": "EjH56G_titleIcon",
445
- "tool": "EjH56G_tool"
1495
+ "tool": "EjH56G_tool",
1496
+ "wholePage": "EjH56G_wholePage"
446
1497
  };
447
1498
  //#endregion
448
- //#region lib/types/client/FilesBody.js
1499
+ //#region lib/types/client/FileNavigator.js
449
1500
  /**
450
- * The file tree's body: the session's workspace root, listed one level at a time.
451
- *
452
- * Everything the tree keeps lives in its store, keyed by tab; everything it asks
453
- * for goes through its injected face. The component itself only decides what to
454
- * draw for each absolute path and what a click means: a directory toggles, a
455
- * file opens through the owner's `tabActions` for a `file:` viewer to claim, and
456
- * anything else is shown but refuses to open. The header uses the shared
457
- * PathLabel for the root, followed by reload and workspace directory actions.
1501
+ * One pane's workspace navigator: the tree and the edge that resizes it. The
1502
+ * `files` page draws it below its header; beside a preview the preview's own
1503
+ * header is the only one. Everything it shows lives in the store and face,
1504
+ * keyed by pane, so a remount on a tab switch or replacement draws it
1505
+ * unchanged, keyboard focus included when the tree held it. Its layout
1506
+ * follows `PUSH_FROM`, `FILL_BELOW`, and `FULLSCREEN_QUERY`; the package
1507
+ * README describes its behavior.
458
1508
  */
459
- /** Natural, case-insensitive name order, so `file2` precedes `file10`. */
460
- const byName = new Intl.Collator(void 0, {
461
- numeric: true,
462
- sensitivity: "base"
463
- });
1509
+ /** One keyboard resize step. */
1510
+ const RESIZE_STEP = 20;
464
1511
  /**
465
- * Order one level's entries for display: directories first, then everything
466
- * else, each group by name. The endpoint's order is a listing fact; this is the
467
- * reader's.
468
- * @param entries - the listing as the endpoint returned it.
469
- * @returns a new array, directories first, then by name within each group.
1512
+ * The layout a preview's navigator takes in a row; `FULLSCREEN_QUERY` makes every layout fill in CSS.
1513
+ * @param rowWidth - the row's width measured by the face; `undefined` before it is measured.
1514
+ * @returns `overlay` until measured, then the layout for the width.
470
1515
  */
471
- function orderEntries(entries) {
472
- return [...entries].sort((left, right) => {
473
- const group = Number(right.type === "directory") - Number(left.type === "directory");
474
- return group !== 0 ? group : byName.compare(left.name, right.name);
475
- });
1516
+ function navigatorMode(rowWidth) {
1517
+ if (rowWidth === void 0) return "overlay";
1518
+ return rowWidth >= 560 ? "push" : rowWidth >= 400 ? "overlay" : "fill";
476
1519
  }
477
1520
  /**
478
- * Say why a directory could not be listed, in terms of the directory.
479
- * @param t - namespace-bound translate.
480
- * @param failure - the settled Remote failure.
481
- * @returns the line to show under the directory.
1521
+ * The navigator Factory's component.
1522
+ * @param props - the tab it is drawn for, the pane's store records, the tree's face, and copy.
1523
+ * @returns the navigator, or nothing while hidden or without a workspace.
482
1524
  */
483
- function failureLine(t, failure) {
484
- switch (failure.code) {
485
- case "workspace-file/not-found": return t("error.notFound");
486
- case "workspace-file/outside-workspace": return t("error.outsideWorkspace");
487
- case "workspace-file/not-directory": return t("error.notDirectory");
488
- default: return t("error.unavailable", { message: failure.message });
489
- }
490
- }
491
- /** One entry's row, and its children when it is an expanded directory. */
492
- function Entry({ parent, entry, tree }) {
493
- const path = childPath(parent, entry.name);
494
- if (entry.type === "directory") {
495
- const expanded = tree.state.expanded.includes(path);
496
- return (0, react_jsx_runtime.jsxs)("li", {
497
- className: FilesBody_module_css_default.item,
498
- "data-files-entry": "directory",
499
- "data-files-path": path,
500
- children: [(0, react_jsx_runtime.jsxs)("button", {
501
- type: "button",
502
- className: FilesBody_module_css_default.row,
503
- "aria-expanded": expanded,
504
- onClick: () => {
505
- tree.onToggle(parent, path);
506
- },
507
- children: [expanded ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderOpenRegular, { className: FilesBody_module_css_default.icon }) : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderCloseRegular, { className: FilesBody_module_css_default.icon }), (0, react_jsx_runtime.jsx)("span", {
508
- className: FilesBody_module_css_default.name,
509
- children: entry.name
510
- })]
511
- }), expanded && (0, react_jsx_runtime.jsx)("ul", {
512
- className: FilesBody_module_css_default.level,
513
- children: (0, react_jsx_runtime.jsx)(Level, {
514
- path,
515
- tree
516
- })
517
- })]
518
- });
519
- }
520
- if (entry.type === "file") return (0, react_jsx_runtime.jsx)("li", {
521
- className: FilesBody_module_css_default.item,
522
- "data-files-entry": "file",
523
- "data-files-path": path,
524
- children: (0, react_jsx_runtime.jsxs)("button", {
525
- type: "button",
526
- className: FilesBody_module_css_default.row,
527
- onClick: () => {
528
- tree.onOpen(path);
1525
+ function FileNavigator({ useTabInfo, page, onOpen, sessionId, useSessions, useStore, actions, useRowWidth, useCanOpen, attach, placeBeside, hold, toggle, scrolled, bodyDrawn, currentDrawn, navigatorDrawn, t, renderFactorySlot, useContextMenu }) {
1526
+ const { tab, panel } = useTabInfo();
1527
+ const { getTriggerProps } = useContextMenu();
1528
+ const paneId = panel.id;
1529
+ const cwd = useSessions((sessions) => sessions.byId[sessionId]?.cwd);
1530
+ const state = useStore((store) => store.byPane[paneId]);
1531
+ const rowWidth = useRowWidth(paneId);
1532
+ const canOpen = useCanOpen((check) => check);
1533
+ const open = page || state?.open === true;
1534
+ const mode = navigatorMode(rowWidth);
1535
+ const tree = state?.tree?.root === cwd ? state?.tree : void 0;
1536
+ const [dragging, setDragging] = (0, react.useState)(false);
1537
+ const drag = (0, react.useRef)(void 0);
1538
+ const navigatorRef = (0, react.useCallback)((element) => {
1539
+ navigatorDrawn(paneId, element, !page);
1540
+ }, [
1541
+ navigatorDrawn,
1542
+ paneId,
1543
+ page
1544
+ ]);
1545
+ const bodyRef = (0, react.useCallback)((body) => {
1546
+ bodyDrawn(paneId, tab.contentId, body);
1547
+ }, [
1548
+ bodyDrawn,
1549
+ paneId,
1550
+ tab.contentId
1551
+ ]);
1552
+ const currentRef = (0, react.useCallback)((row) => {
1553
+ currentDrawn(paneId, row);
1554
+ }, [currentDrawn, paneId]);
1555
+ (0, react.useEffect)(() => attach(paneId, tab.id, tab.signal), [
1556
+ attach,
1557
+ paneId,
1558
+ tab.id,
1559
+ tab.signal
1560
+ ]);
1561
+ (0, react.useEffect)(() => page || cwd === void 0 ? void 0 : placeBeside(tab.id), [
1562
+ page,
1563
+ cwd,
1564
+ placeBeside,
1565
+ tab.id
1566
+ ]);
1567
+ (0, react.useEffect)(() => cwd === void 0 || !open ? void 0 : hold(paneId, cwd), [
1568
+ cwd,
1569
+ open,
1570
+ paneId,
1571
+ hold
1572
+ ]);
1573
+ const relativePath = tree === void 0 ? void 0 : relativeFileOf(tab.contentId, sessionId, tree.root);
1574
+ const location = (0, react.useMemo)(() => tree === void 0 || relativePath === void 0 ? void 0 : locateFile(tree, relativePath), [tree, relativePath]);
1575
+ const root = tree?.root;
1576
+ const levels = tree?.levels;
1577
+ const expanded = tree?.expanded;
1578
+ const entries = (0, react.useMemo)(() => levels === void 0 ? void 0 : workspaceEntries(levels), [levels]);
1579
+ const directories = (0, react.useMemo)(() => root === void 0 || levels === void 0 || expanded === void 0 ? void 0 : workspaceDirectories({
1580
+ root,
1581
+ levels,
1582
+ expanded
1583
+ }, t), [
1584
+ root,
1585
+ levels,
1586
+ expanded,
1587
+ t
1588
+ ]);
1589
+ const view = (0, react.useMemo)(() => {
1590
+ if (tree === void 0) return void 0;
1591
+ return {
1592
+ root: treeRootOf(tree.root),
1593
+ expanded: tree.expanded,
1594
+ onToggle: (entry) => {
1595
+ toggle(paneId, parentOf(tree, entry.path), entry.path, tree.expanded);
529
1596
  },
530
- children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.FileTypeIcon, {
531
- kind: (0, _deepseek_ai_dsh_client_ui_primitives.classifyFileType)(entry.name),
532
- size: 16,
533
- className: FilesBody_module_css_default.fileIcon
534
- }), (0, react_jsx_runtime.jsx)("span", {
535
- className: FilesBody_module_css_default.name,
536
- children: entry.name
537
- })]
538
- })
539
- });
540
- return (0, react_jsx_runtime.jsx)("li", {
541
- className: FilesBody_module_css_default.item,
542
- "data-files-entry": "other",
543
- "data-files-path": path,
544
- children: (0, react_jsx_runtime.jsx)("span", {
545
- className: clsx(FilesBody_module_css_default.row, FilesBody_module_css_default.other),
546
- "aria-disabled": "true",
547
- title: tree.t("entry.other"),
548
- children: (0, react_jsx_runtime.jsx)("span", {
549
- className: FilesBody_module_css_default.name,
550
- children: entry.name
1597
+ onOpen: (entry) => {
1598
+ onOpen(fileAddressFor(sessionId, tree.root, entry.path));
1599
+ },
1600
+ canOpen: (entry) => canOpen(fileAddressFor(sessionId, tree.root, entry.path)),
1601
+ rowTriggerProps: (entry, kind) => getTriggerProps(kind === "directory" ? {
1602
+ kind,
1603
+ value: {
1604
+ sessionId,
1605
+ path: entry.path
1606
+ }
1607
+ } : {
1608
+ kind,
1609
+ value: {
1610
+ sessionId,
1611
+ path: entry.path,
1612
+ paneId
1613
+ }
551
1614
  })
552
- })
553
- });
554
- }
555
- /** One directory's rows: its state while listing, its entries once listed. */
556
- function Level({ path, tree }) {
557
- const { state, t } = tree;
558
- const level = state.levels[path];
559
- if (level === void 0 || level.kind === "loading") return (0, react_jsx_runtime.jsx)("li", {
560
- className: FilesBody_module_css_default.note,
561
- "data-files-row": "loading",
562
- children: t("loading")
563
- });
564
- if (level.kind === "failed") return (0, react_jsx_runtime.jsx)("li", {
565
- className: FilesBody_module_css_default.note,
566
- "data-files-row": "failed",
567
- "data-files-code": level.failure.code,
568
- children: failureLine(t, level.failure)
1615
+ };
1616
+ }, [
1617
+ tree,
1618
+ paneId,
1619
+ sessionId,
1620
+ toggle,
1621
+ canOpen,
1622
+ onOpen,
1623
+ getTriggerProps
1624
+ ]);
1625
+ if (cwd === void 0 || !open) return null;
1626
+ const geometry = navigatorGeometry(rowWidth, state?.width ?? 260);
1627
+ const shown = page ? void 0 : mode;
1628
+ const clamp = (next) => Math.min(Math.max(next, geometry.minimum), geometry.maximum);
1629
+ return (0, react_jsx_runtime.jsxs)("aside", {
1630
+ ref: navigatorRef,
1631
+ className: clsx(FilesBody_module_css_default.navigator, shown === void 0 ? FilesBody_module_css_default.wholePage : FilesBody_module_css_default[shown], dragging && FilesBody_module_css_default.dragging),
1632
+ style: page ? void 0 : { "--files-navigator-width": `${geometry.width}px` },
1633
+ "aria-label": t("guide.title"),
1634
+ "data-files-navigator": paneId,
1635
+ "data-files-navigator-mode": shown,
1636
+ "data-files-state": "tree",
1637
+ "data-files-root": cwd,
1638
+ children: [shown !== void 0 && shown !== "fill" && (0, react_jsx_runtime.jsx)("div", {
1639
+ className: FilesBody_module_css_default.separator,
1640
+ role: "separator",
1641
+ "aria-orientation": "vertical",
1642
+ "aria-label": t("navigator.resize"),
1643
+ "aria-valuemin": geometry.minimum,
1644
+ "aria-valuemax": geometry.maximum,
1645
+ "aria-valuenow": geometry.width,
1646
+ tabIndex: 0,
1647
+ "data-files-navigator-resize": true,
1648
+ onKeyDown: (event) => {
1649
+ const next = event.key === "ArrowLeft" ? geometry.width + RESIZE_STEP : event.key === "ArrowRight" ? geometry.width - RESIZE_STEP : event.key === "Home" ? geometry.minimum : event.key === "End" ? geometry.maximum : void 0;
1650
+ if (next === void 0) return;
1651
+ event.preventDefault();
1652
+ actions.resized(paneId, clamp(next));
1653
+ },
1654
+ onPointerDown: (event) => {
1655
+ if (event.button !== 0) return;
1656
+ event.preventDefault();
1657
+ event.currentTarget.setPointerCapture(event.pointerId);
1658
+ drag.current = {
1659
+ x: event.clientX,
1660
+ width: geometry.width
1661
+ };
1662
+ setDragging(true);
1663
+ },
1664
+ onPointerMove: (event) => {
1665
+ const origin = drag.current;
1666
+ if (origin === void 0) return;
1667
+ actions.resized(paneId, clamp(origin.width + origin.x - event.clientX));
1668
+ },
1669
+ onPointerUp: (event) => {
1670
+ event.currentTarget.releasePointerCapture(event.pointerId);
1671
+ },
1672
+ onLostPointerCapture: () => {
1673
+ drag.current = void 0;
1674
+ setDragging(false);
1675
+ }
1676
+ }), (0, react_jsx_runtime.jsx)("div", {
1677
+ ref: bodyRef,
1678
+ className: FilesBody_module_css_default.body,
1679
+ tabIndex: -1,
1680
+ "data-files-body": true,
1681
+ onScroll: (event) => {
1682
+ scrolled(paneId, event.currentTarget.scrollTop);
1683
+ },
1684
+ children: view === void 0 || entries === void 0 || directories === void 0 ? (0, react_jsx_runtime.jsx)("p", {
1685
+ className: FilesBody_module_css_default.note,
1686
+ "data-files-row": "loading",
1687
+ children: t("loading")
1688
+ }) : renderFactorySlot("sidebar.files.tree", {
1689
+ ...view,
1690
+ entries,
1691
+ directories,
1692
+ current: location?.current,
1693
+ currentRef
1694
+ })
1695
+ })]
569
1696
  });
570
- const entries = orderEntries(level.level.entries);
571
- return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
572
- level.failure !== void 0 && (0, react_jsx_runtime.jsx)("li", {
573
- className: FilesBody_module_css_default.note,
574
- "data-files-row": "failed",
575
- children: failureLine(t, level.failure)
576
- }),
577
- entries.length === 0 && (0, react_jsx_runtime.jsx)("li", {
578
- className: FilesBody_module_css_default.note,
579
- "data-files-row": "empty",
580
- children: t("empty")
581
- }),
582
- entries.map((entry) => (0, react_jsx_runtime.jsx)(Entry, {
583
- parent: path,
584
- entry,
585
- tree
586
- }, entry.name)),
587
- level.level.truncated && (0, react_jsx_runtime.jsx)("li", {
588
- className: FilesBody_module_css_default.note,
589
- "data-files-row": "truncated",
590
- children: t("truncated")
591
- })
592
- ] });
593
1697
  }
594
- /** The file tree's body: the workspace root and whatever the reader has opened under it. */
595
- function FilesBody({ useTabInfo, sessionId, useSessions, useStore, actions, start, refresh, setAutoRefresh, toggle, t, renderSlot }) {
596
- const { tab } = useTabInfo();
1698
+ //#endregion
1699
+ //#region lib/types/client/FilesBody.js
1700
+ /**
1701
+ * The `files` page: a file browser with no file chosen yet.
1702
+ *
1703
+ * Its header spans the page: the workspace root's path, the tree's reload and
1704
+ * the directory actions, in the order a preview's header ends with its own
1705
+ * reload and file actions. The pane's navigator fills the page below it and
1706
+ * stays shown, so the page draws no toggle; picking a file leaves this page as
1707
+ * it is and opens the file where the right Sidebar places it by default
1708
+ * (`FileNavigator`).
1709
+ */
1710
+ /**
1711
+ * The `files` page body.
1712
+ * @param props - composed slot props.
1713
+ * @returns the header above the pane's navigator, or the workspace line.
1714
+ */
1715
+ function FilesBody(props) {
1716
+ const { useTabInfo, sessionId, useSessions, useStore, refresh, setAutoRefresh, renderSlot, renderFactorySlot, t, useContextMenu } = props;
1717
+ const { tab, panel } = useTabInfo();
1718
+ const { getTriggerProps } = useContextMenu();
1719
+ const onOpen = (0, react.useCallback)((address) => {
1720
+ if (panel.isFloating) tab.actions.openResource(address);
1721
+ else tab.actions.openResource(address, { paneId: panel.id });
1722
+ }, [
1723
+ tab.actions,
1724
+ panel.id,
1725
+ panel.isFloating
1726
+ ]);
597
1727
  (0, react.useEffect)(() => tab.actions.bindCommands({ refresh: () => {
598
- refresh(tab.id);
1728
+ refresh(panel.id);
599
1729
  } }), [
600
1730
  tab.actions,
601
- tab.id,
1731
+ panel.id,
602
1732
  refresh
603
1733
  ]);
604
- const { signal, actions: tabActions } = tab;
605
1734
  const cwd = useSessions((sessions) => sessions.byId[sessionId]?.cwd);
606
- const state = useStore((store) => store.byTab[tab.id]);
607
- const bodyRef = (0, react.useRef)(null);
608
- const scrollTopRef = (0, react.useRef)(0);
609
- const seeded = state !== void 0;
610
- (0, react.useLayoutEffect)(() => {
611
- const body = bodyRef.current;
612
- if (seeded && body !== null) {
613
- body.scrollTop = state.scrollTop;
614
- scrollTopRef.current = body.scrollTop;
615
- }
616
- }, [seeded]);
617
- (0, react.useEffect)(() => () => {
618
- if (seeded && !signal.aborted) actions.scrolled(tab.id, scrollTopRef.current);
619
- }, [
620
- seeded,
621
- signal,
622
- tab.id,
623
- actions
624
- ]);
625
- (0, react.useEffect)(() => {
626
- if (state !== void 0 || cwd === void 0 || signal.aborted) return;
627
- start(tab.id, cwd, signal);
628
- }, [
629
- state,
630
- cwd,
631
- tab.id,
632
- signal,
633
- start
634
- ]);
1735
+ const autoRefresh = useStore((store) => {
1736
+ const tree = store.byPane[panel.id]?.tree;
1737
+ return tree?.root === cwd ? tree?.autoRefresh : void 0;
1738
+ });
635
1739
  if (cwd === void 0) return (0, react_jsx_runtime.jsx)("div", {
636
1740
  className: FilesBody_module_css_default.status,
637
1741
  "data-files-state": "no-workspace",
@@ -640,31 +1744,29 @@ window.__ModuleLoader__.load({
640
1744
  children: t("noWorkspace")
641
1745
  })
642
1746
  });
643
- if (state === void 0) return null;
644
- const tree = {
645
- state,
646
- onToggle: (parent, path) => {
647
- toggle(tab.id, parent, path, state.expanded, signal);
648
- },
649
- onOpen: (path) => {
650
- tabActions.openResource(fileAddressFor(sessionId, state.root, path));
651
- },
652
- t
653
- };
654
- const reload = () => {
655
- refresh(tab.id);
656
- };
1747
+ const automatic = autoRefresh ?? true;
1748
+ const navigator = renderFactorySlot("sidebar.files.navigator", {
1749
+ useTabInfo,
1750
+ page: true,
1751
+ onOpen
1752
+ });
657
1753
  return (0, react_jsx_runtime.jsxs)("div", {
658
- className: FilesBody_module_css_default.root,
659
- "data-files-state": "tree",
660
- "data-files-root": state.root,
1754
+ className: FilesBody_module_css_default.page,
1755
+ "data-files-page": true,
661
1756
  children: [(0, react_jsx_runtime.jsxs)("div", {
662
1757
  className: FilesBody_module_css_default.header,
663
1758
  children: [
664
1759
  (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.PathLabel, {
665
- path: state.root,
1760
+ path: cwd,
666
1761
  className: FilesBody_module_css_default.path,
667
- "data-files-path": true
1762
+ "data-files-path": true,
1763
+ ...getTriggerProps({
1764
+ kind: "directory",
1765
+ value: {
1766
+ sessionId,
1767
+ path: cwd
1768
+ }
1769
+ })
668
1770
  }),
669
1771
  (0, react_jsx_runtime.jsx)("span", {
670
1772
  hidden: true,
@@ -672,13 +1774,14 @@ window.__ModuleLoader__.load({
672
1774
  type: "button",
673
1775
  className: FilesBody_module_css_default.tool,
674
1776
  "aria-label": t("autoRefresh"),
675
- "aria-pressed": state.autoRefresh,
1777
+ "aria-pressed": automatic,
1778
+ disabled: autoRefresh === void 0,
676
1779
  "data-files-auto-refresh": true,
677
- title: t(state.autoRefresh ? "autoRefresh.disable" : "autoRefresh.enable"),
1780
+ title: t(automatic ? "autoRefresh.disable" : "autoRefresh.enable"),
678
1781
  onClick: () => {
679
- setAutoRefresh(tab.id, !state.autoRefresh);
1782
+ setAutoRefresh(panel.id, !automatic);
680
1783
  },
681
- children: state.autoRefresh ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPauseOutlineRegular, {}) : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPlayOutlineRegular, {})
1784
+ children: automatic ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPauseOutlineRegular, {}) : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPlayOutlineRegular, {})
682
1785
  })
683
1786
  }),
684
1787
  (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
@@ -692,26 +1795,18 @@ window.__ModuleLoader__.load({
692
1795
  "aria-label": t("reload"),
693
1796
  "aria-keyshortcuts": tab.refreshShortcut?.aria,
694
1797
  "data-files-reload": true,
695
- onClick: reload,
1798
+ onClick: () => {
1799
+ refresh(panel.id);
1800
+ },
696
1801
  children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineRegular, {})
697
1802
  })
698
1803
  }),
699
- renderSlot("sidebar.right.tab.files.actions", { absolutePath: state.root })
1804
+ renderSlot("sidebar.right.tab.files.actions", { absolutePath: cwd })
700
1805
  ]
701
1806
  }), (0, react_jsx_runtime.jsx)("div", {
702
- ref: bodyRef,
703
- className: FilesBody_module_css_default.body,
704
- "data-files-body": true,
705
- onScroll: (event) => {
706
- scrollTopRef.current = event.currentTarget.scrollTop;
707
- },
708
- children: (0, react_jsx_runtime.jsx)("ul", {
709
- className: FilesBody_module_css_default.level,
710
- children: (0, react_jsx_runtime.jsx)(Level, {
711
- path: state.root,
712
- tree
713
- })
714
- })
1807
+ className: FilesBody_module_css_default.content,
1808
+ "data-files-content": true,
1809
+ children: navigator
715
1810
  })]
716
1811
  });
717
1812
  }
@@ -747,6 +1842,10 @@ window.__ModuleLoader__.load({
747
1842
  "autoRefresh.enable": "开启自动刷新",
748
1843
  "autoRefresh.disable": "关闭自动刷新",
749
1844
  "entry.other": "这不是文件或目录,没法打开。",
1845
+ "entry.noViewer": "没有可以打开此文件的查看器。",
1846
+ "navigator.show": "显示文件树",
1847
+ "navigator.hide": "隐藏文件树",
1848
+ "navigator.resize": "调整文件树宽度",
750
1849
  "error.notFound": "这个目录不在了。可能已被移动或删除。",
751
1850
  "error.outsideWorkspace": "这个目录在工作区之外,侧栏不会读取它。",
752
1851
  "error.notDirectory": "这不是一个目录。",
@@ -767,6 +1866,10 @@ window.__ModuleLoader__.load({
767
1866
  "autoRefresh.enable": "Enable auto refresh",
768
1867
  "autoRefresh.disable": "Disable auto refresh",
769
1868
  "entry.other": "Not a file or a directory, so it cannot be opened.",
1869
+ "entry.noViewer": "No viewer can open this file.",
1870
+ "navigator.show": "Show file tree",
1871
+ "navigator.hide": "Hide file tree",
1872
+ "navigator.resize": "Resize file tree",
770
1873
  "error.notFound": "That directory is gone. It may have been moved or deleted.",
771
1874
  "error.outsideWorkspace": "That directory is outside the workspace, so the sidebar will not read it.",
772
1875
  "error.notDirectory": "That is not a directory.",
@@ -787,6 +1890,10 @@ window.__ModuleLoader__.load({
787
1890
  "autoRefresh.enable": "自動更新を有効にする",
788
1891
  "autoRefresh.disable": "自動更新を無効にする",
789
1892
  "entry.other": "ファイルでもディレクトリでもないため、開けません。",
1893
+ "entry.noViewer": "このファイルを開けるビューアーがありません。",
1894
+ "navigator.show": "ファイルツリーを表示",
1895
+ "navigator.hide": "ファイルツリーを非表示",
1896
+ "navigator.resize": "ファイルツリーの幅を調整",
790
1897
  "error.notFound": "そのディレクトリは存在しません。移動または削除された可能性があります。",
791
1898
  "error.outsideWorkspace": "そのディレクトリはワークスペース外のため、サイドバーでは読み取りません。",
792
1899
  "error.notDirectory": "それはディレクトリではありません。",
@@ -807,6 +1914,10 @@ window.__ModuleLoader__.load({
807
1914
  "autoRefresh.enable": "Habilitar actualización automática",
808
1915
  "autoRefresh.disable": "Deshabilitar la actualización automática",
809
1916
  "entry.other": "No es un archivo ni un directorio, por lo que no se puede abrir.",
1917
+ "entry.noViewer": "Ningún visor puede abrir este archivo.",
1918
+ "navigator.show": "Mostrar árbol de archivos",
1919
+ "navigator.hide": "Ocultar árbol de archivos",
1920
+ "navigator.resize": "Cambiar el ancho del árbol de archivos",
810
1921
  "error.notFound": "Ese directorio desapareció. Es posible que se haya movido o eliminado.",
811
1922
  "error.outsideWorkspace": "Ese directorio está fuera del espacio de trabajo, por lo que la barra lateral no lo leerá.",
812
1923
  "error.notDirectory": "Eso no es un directorio.",
@@ -827,6 +1938,10 @@ window.__ModuleLoader__.load({
827
1938
  "autoRefresh.enable": "Activer l'actualisation automatique",
828
1939
  "autoRefresh.disable": "Désactiver l'actualisation automatique",
829
1940
  "entry.other": "Il ne s'agit pas d'un fichier ou d'un répertoire, il ne peut donc pas être ouvert.",
1941
+ "entry.noViewer": "Aucune visionneuse ne peut ouvrir ce fichier.",
1942
+ "navigator.show": "Afficher l'arborescence des fichiers",
1943
+ "navigator.hide": "Masquer l'arborescence des fichiers",
1944
+ "navigator.resize": "Redimensionner l'arborescence des fichiers",
830
1945
  "error.notFound": "Ce répertoire a disparu. Il a peut-être été déplacé ou supprimé.",
831
1946
  "error.outsideWorkspace": "Ce répertoire se trouve en dehors de l’espace de travail, donc la barre latérale ne le lira pas.",
832
1947
  "error.notDirectory": "Ce n'est pas un répertoire.",
@@ -847,6 +1962,10 @@ window.__ModuleLoader__.load({
847
1962
  "autoRefresh.enable": "Aktivieren Sie die automatische Aktualisierung",
848
1963
  "autoRefresh.disable": "Deaktivieren Sie die automatische Aktualisierung",
849
1964
  "entry.other": "Keine Datei oder kein Verzeichnis, daher kann sie nicht geöffnet werden.",
1965
+ "entry.noViewer": "Kein Viewer kann diese Datei öffnen.",
1966
+ "navigator.show": "Dateibaum anzeigen",
1967
+ "navigator.hide": "Dateibaum ausblenden",
1968
+ "navigator.resize": "Breite des Dateibaums ändern",
850
1969
  "error.notFound": "Dieses Verzeichnis ist weg. Möglicherweise wurde es verschoben oder gelöscht.",
851
1970
  "error.outsideWorkspace": "Dieses Verzeichnis liegt außerhalb des Arbeitsbereichs und wird daher von der Seitenleiste nicht gelesen.",
852
1971
  "error.notDirectory": "Das ist kein Verzeichnis.",
@@ -867,6 +1986,10 @@ window.__ModuleLoader__.load({
867
1986
  "autoRefresh.enable": "Включить автоматическое обновление",
868
1987
  "autoRefresh.disable": "Отключить автоматическое обновление",
869
1988
  "entry.other": "Это не файл и не каталог, поэтому его нельзя открыть.",
1989
+ "entry.noViewer": "Нет средства просмотра, которое может открыть этот файл.",
1990
+ "navigator.show": "Показать дерево файлов",
1991
+ "navigator.hide": "Скрыть дерево файлов",
1992
+ "navigator.resize": "Изменить ширину дерева файлов",
870
1993
  "error.notFound": "Этот каталог исчез. Возможно, оно было перемещено или удалено.",
871
1994
  "error.outsideWorkspace": "Этот каталог находится за пределами рабочей области, поэтому боковая панель его не читает.",
872
1995
  "error.notDirectory": "Это не каталог.",
@@ -887,160 +2010,54 @@ window.__ModuleLoader__.load({
887
2010
  "autoRefresh.enable": "Ativar atualização automática",
888
2011
  "autoRefresh.disable": "Desativar atualização automática",
889
2012
  "entry.other": "Não é um arquivo ou diretório, portanto não pode ser aberto.",
2013
+ "entry.noViewer": "Nenhum visualizador pode abrir este arquivo.",
2014
+ "navigator.show": "Mostrar árvore de arquivos",
2015
+ "navigator.hide": "Ocultar árvore de arquivos",
2016
+ "navigator.resize": "Redimensionar árvore de arquivos",
890
2017
  "error.notFound": "Esse diretório desapareceu. Pode ter sido movido ou excluído.",
891
2018
  "error.outsideWorkspace": "Esse diretório está fora da área de trabalho, portanto a barra lateral não o lerá.",
892
2019
  "error.notDirectory": "Isso não é um diretório.",
893
2020
  "error.unavailable": "Falha na leitura: {message}"
894
2021
  };
895
2022
  //#endregion
896
- //#region lib/types/client/store.js
897
- /**
898
- * The file tree's view state: which directories are expanded, what each
899
- * loaded level contains, and where the body is scrolled to.
900
- *
901
- * The tree is not one resource. A directory listing per level, expanded lazily,
902
- * is state the type owns — so it lives in a Slot-standard exclusive store
903
- * (one instance per session), bucketed by tab id because two tabs of this kind
904
- * in one session expand independently.
905
- *
906
- * Writers run between `start` and `forget`: the owner's `signal` is what ends a
907
- * bucket's life, and the face stops dispatching once it aborts.
908
- */
2023
+ //#region lib/types/client/NavigatorToggle.js
909
2024
  /**
910
- * One tab's bucket, which every writer after `start` relies on: the face only
911
- * dispatches while the record's signal is live, and `forget` runs on its abort.
912
- * @param state - the draft.
913
- * @param tabId - the tab being written.
914
- * @returns the tab's tree.
2025
+ * The navigator's show/hide control, at the end of a document preview's
2026
+ * header through its Factory; the `files` page's tree is always
2027
+ * shown and has none. It writes the pane's choice, which every file tab of
2028
+ * the pane reads, and registers itself with the face, which hands it the
2029
+ * keyboard when Escape closes the navigator.
915
2030
  */
916
- function bucket(state, tabId) {
917
- const tree = state.byTab[tabId];
918
- if (tree === void 0) throw new Error(`ui-sidebar-files: no tree for tab "${tabId}"`);
919
- return tree;
920
- }
921
2031
  /**
922
- * Declare the file tree's store.
923
- *
924
- * A factory rather than a shared handle: the registration declares it as an
925
- * exclusive store, so the framework mints one instance per session.
926
- * @returns the store handle to declare on the registration.
2032
+ * Show or hide the pane's navigator.
2033
+ * @param props - the tab, the pane records, the face's registration, and copy.
2034
+ * @returns the toggle, or nothing without a workspace.
927
2035
  */
928
- function createFilesStore() {
929
- return (0, _deepseek_ai_dsh_client_store.defineStore)({
930
- init: () => ({ byTab: {} }),
931
- actions: {
932
- autoRefresh: (d, tabId, enabled) => {
933
- bucket(d, tabId).autoRefresh = enabled;
934
- },
935
- /**
936
- * Seed one tab's tree at its workspace root, with the root expanded.
937
- * @param d - draft state.
938
- * @param tabId - the tab being drawn.
939
- * @param root - absolute path of the workspace root.
940
- */
941
- start: (d, tabId, root) => {
942
- d.byTab[tabId] = {
943
- root,
944
- levels: {},
945
- expanded: [root],
946
- scrollTop: 0,
947
- autoRefresh: true
948
- };
949
- },
950
- /**
951
- * Mark one directory as being listed.
952
- * @param d - draft state.
953
- * @param tabId - the tab being drawn.
954
- * @param path - absolute directory path.
955
- */
956
- loading: (d, tabId, path) => {
957
- const state = bucket(d, tabId);
958
- if (state.levels[path]?.kind !== "ready") state.levels[path] = { kind: "loading" };
959
- },
960
- /**
961
- * Record one directory's contents.
962
- * @param d - draft state.
963
- * @param tabId - the tab being drawn.
964
- * @param path - absolute directory path.
965
- * @param level - the listing to show under it.
966
- */
967
- loaded: (d, tabId, path, level) => {
968
- const state = bucket(d, tabId);
969
- const previous = state.levels[path];
970
- if (previous?.kind === "ready") {
971
- const directories = new Set(level.entries.filter((entry) => entry.type === "directory").map((entry) => entry.name));
972
- for (const entry of previous.level.entries) {
973
- if (entry.type !== "directory" || directories.has(entry.name)) continue;
974
- const removed = `${path.replace(/[/\\]+$/, "")}/${entry.name}`;
975
- state.expanded = state.expanded.filter((value) => value !== removed && !value.startsWith(`${removed}/`));
976
- state.levels = Object.fromEntries(Object.entries(state.levels).filter(([key]) => key !== removed && !key.startsWith(`${removed}/`)));
977
- }
978
- }
979
- state.levels[path] = {
980
- kind: "ready",
981
- level
982
- };
983
- },
984
- /**
985
- * Record why one directory could not be listed.
986
- * @param d - draft state.
987
- * @param tabId - the tab being drawn.
988
- * @param path - absolute directory path.
989
- * @param failure - the settled Remote failure.
990
- */
991
- failed: (d, tabId, path, failure) => {
992
- const level = bucket(d, tabId).levels[path];
993
- bucket(d, tabId).levels[path] = level?.kind === "ready" ? {
994
- ...level,
995
- failure
996
- } : {
997
- kind: "failed",
998
- failure
999
- };
1000
- },
1001
- /**
1002
- * Open a collapsed directory, or collapse an open one.
1003
- *
1004
- * A collapsed level keeps what it loaded, so reopening it draws at once.
1005
- * @param d - draft state.
1006
- * @param tabId - the tab being drawn.
1007
- * @param path - absolute directory path.
1008
- */
1009
- toggled: (d, tabId, path) => {
1010
- const state = bucket(d, tabId);
1011
- const at = state.expanded.indexOf(path);
1012
- if (at >= 0) state.expanded.splice(at, 1);
1013
- else state.expanded.push(path);
1014
- },
1015
- /**
1016
- * Record where one tab's body is scrolled to.
1017
- * @param d - draft state.
1018
- * @param tabId - the tab being drawn.
1019
- * @param scrollTop - the body's scroll offset, in px.
1020
- */
1021
- scrolled: (d, tabId, scrollTop) => {
1022
- bucket(d, tabId).scrollTop = scrollTop;
1023
- },
1024
- /**
1025
- * Drop every loaded level, keeping what is expanded.
1026
- *
1027
- * This is the reload gesture's first half: the expanded set says which
1028
- * levels to fetch again.
1029
- * @param d - draft state.
1030
- * @param tabId - the tab being drawn.
1031
- */
1032
- reset: (d, tabId) => {
1033
- bucket(d, tabId).levels = {};
2036
+ function NavigatorToggle({ useTabInfo, sessionId, useSessions, useStore, actions, toggleDrawn, t }) {
2037
+ const { panel } = useTabInfo();
2038
+ const cwd = useSessions((sessions) => sessions.byId[sessionId]?.cwd);
2039
+ const open = useStore((store) => store.byPane[panel.id]?.open) === true;
2040
+ const toggleRef = (0, react.useCallback)((button) => {
2041
+ toggleDrawn(panel.id, button);
2042
+ }, [toggleDrawn, panel.id]);
2043
+ if (cwd === void 0) return null;
2044
+ const label = t(open ? "navigator.hide" : "navigator.show");
2045
+ return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
2046
+ label,
2047
+ side: "bottom",
2048
+ delayMs: 500,
2049
+ children: (0, react_jsx_runtime.jsx)("button", {
2050
+ ref: toggleRef,
2051
+ type: "button",
2052
+ className: FilesBody_module_css_default.tool,
2053
+ "aria-label": label,
2054
+ "aria-expanded": open,
2055
+ "data-files-navigator-toggle": true,
2056
+ onClick: () => {
2057
+ actions.shown(panel.id, !open);
1034
2058
  },
1035
- /**
1036
- * Forget one tab's tree, for a tab record that is gone.
1037
- * @param d - draft state.
1038
- * @param tabId - the tab that went away.
1039
- */
1040
- forget: (d, tabId) => {
1041
- d.byTab = Object.fromEntries(Object.entries(d.byTab).filter(([id]) => id !== tabId));
1042
- }
1043
- }
2059
+ children: open ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderOpenRegular, {}) : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderCloseRegular, {})
2060
+ })
1044
2061
  });
1045
2062
  }
1046
2063
  //#endregion
@@ -1060,11 +2077,69 @@ window.__ModuleLoader__.load({
1060
2077
  "remote.workspaceFiles"
1061
2078
  ];
1062
2079
  /**
1063
- * Client plugin body: register the type, its dictionaries, its body, and its chip title.
2080
+ * Client plugin body: register the type, its shortcut, its dictionaries, the
2081
+ * navigator and toggle Factories, the page body, and its
2082
+ * chip title.
1064
2083
  * @param ctx - client root context carrying the registry, the slots, and the Remote face.
1065
2084
  */
1066
2085
  function apply(ctx) {
1067
2086
  const t = ctx.locale.bind(NS);
2087
+ const handle = createFilesStore();
2088
+ const face = filesFace(createList(ctx.remote), createWatch(ctx.remote), canOpenOf(ctx.sidebarRightTabs), (sessionId, tabId) => {
2089
+ const source = ctx.sidebarRight.tabDomain.occurrence(sessionId, { id: tabId }).navigation;
2090
+ return {
2091
+ getSnapshot: () => source.getSnapshot(),
2092
+ subscribe: (listener) => ctx.effect(() => {
2093
+ let active = true;
2094
+ const unsubscribe = source.subscribe(() => {
2095
+ queueMicrotask(() => {
2096
+ if (active) listener();
2097
+ });
2098
+ });
2099
+ return () => {
2100
+ active = false;
2101
+ unsubscribe();
2102
+ };
2103
+ }, "ui-sidebar-files: tab navigation")
2104
+ };
2105
+ });
2106
+ const faces = /* @__PURE__ */ new WeakMap();
2107
+ const beside = /* @__PURE__ */ new Map();
2108
+ const place = (sessionId) => (tabId, bound) => {
2109
+ const tabs = beside.get(sessionId) ?? /* @__PURE__ */ new Map();
2110
+ beside.set(sessionId, tabs);
2111
+ const held = tabs.get(tabId);
2112
+ const entry = held?.face === bound ? held : {
2113
+ face: bound,
2114
+ placed: 0
2115
+ };
2116
+ entry.placed += 1;
2117
+ tabs.set(tabId, entry);
2118
+ let placed = true;
2119
+ return () => {
2120
+ if (!placed) return;
2121
+ placed = false;
2122
+ entry.placed -= 1;
2123
+ if (entry.placed > 0 || tabs.get(tabId) !== entry) return;
2124
+ tabs.delete(tabId);
2125
+ if (tabs.size === 0) beside.delete(sessionId);
2126
+ };
2127
+ };
2128
+ const store = {
2129
+ ...handle,
2130
+ create: (scopeKey) => {
2131
+ const instance = handle.create(scopeKey);
2132
+ if (scopeKey === void 0) return instance;
2133
+ const sessionId = scopeKey;
2134
+ faces.set(instance.actions, face(sessionId, instance, place(sessionId)));
2135
+ return instance;
2136
+ }
2137
+ };
2138
+ const injectFace = (sessionId, actions) => {
2139
+ const bound = faces.get(actions);
2140
+ if (bound === void 0) throw new Error(`ui-sidebar-files: Session "${sessionId}" has no files store instance`);
2141
+ return bound;
2142
+ };
1068
2143
  ctx.inject(["shortcuts"], (ctx) => {
1069
2144
  ctx.effect(() => ctx.shortcuts.register({
1070
2145
  id: "workspace.files",
@@ -1107,7 +2182,13 @@ window.__ModuleLoader__.load({
1107
2182
  return {
1108
2183
  status: "handled",
1109
2184
  run: () => {
1110
- ctx.sidebarRight.openTabFromTarget("files", target);
2185
+ const placed = target.tabId === void 0 ? void 0 : beside.get(target.sessionId)?.get(target.tabId);
2186
+ if (target.host === "dock" && placed !== void 0) {
2187
+ if (!ctx.sidebarRight.isExpanded()) ctx.sidebarRight.toggleExpanded();
2188
+ placed.face.focus(target.paneId);
2189
+ return;
2190
+ }
2191
+ ctx.sidebarRight.openTabFromTarget(FILES_KIND, target);
1111
2192
  }
1112
2193
  };
1113
2194
  }
@@ -1124,14 +2205,32 @@ window.__ModuleLoader__.load({
1124
2205
  ru,
1125
2206
  pt
1126
2207
  }), "ui-sidebar-files: dictionaries");
1127
- const store = createFilesStore();
1128
- const inject = filesFace(createList(ctx.remote), createWatch(ctx.remote));
2208
+ ctx.effect(() => ctx.slots.registerFactory({
2209
+ name: "sidebar.files.tree",
2210
+ scope: "root",
2211
+ locale: NS,
2212
+ slots: { accessory: { scope: "root" } }
2213
+ }, FileTree), "ui-sidebar-files: tree factory");
2214
+ ctx.effect(() => ctx.slots.registerFactory({
2215
+ name: "sidebar.files.navigator",
2216
+ scope: "session",
2217
+ locale: NS,
2218
+ store,
2219
+ inject: injectFace
2220
+ }, FileNavigator), "ui-sidebar-files: navigator factory");
2221
+ ctx.effect(() => ctx.slots.registerFactory({
2222
+ name: "sidebar.files.navigator.toggle",
2223
+ scope: "session",
2224
+ locale: NS,
2225
+ store,
2226
+ inject: injectFace
2227
+ }, NavigatorToggle), "ui-sidebar-files: navigator toggle factory");
1129
2228
  ctx.effect(() => ctx.slots.inject("sidebar.right.pane.tab", () => ctx.slots.register({
1130
2229
  name: "sidebar.right.pane.tab",
1131
2230
  key: FILES_ID,
1132
2231
  locale: NS,
1133
2232
  store,
1134
- inject,
2233
+ inject: injectFace,
1135
2234
  children: { "sidebar.right.tab.files.actions": {
1136
2235
  kind: "list",
1137
2236
  scope: "session"