@qqbrowser/qbot-dsh 0.0.15 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/config/agent-presets/code/agent.cordis.yml +2 -2
  2. package/config/agent-presets/standard/agent.cordis.yml +2 -2
  3. package/node_modules/@deepseek-ai/cordis-plugin-hmr/package.json +1 -1
  4. package/node_modules/@deepseek-ai/dsh-agent/package.json +1 -1
  5. package/node_modules/@deepseek-ai/dsh-agent-default-model/package.json +1 -1
  6. package/node_modules/@deepseek-ai/dsh-agent-instructions/package.json +1 -1
  7. package/node_modules/@deepseek-ai/dsh-agent-loop/package.json +1 -1
  8. package/node_modules/@deepseek-ai/dsh-agent-presets/package.json +1 -1
  9. package/node_modules/@deepseek-ai/dsh-agent-tool-presentation/package.json +1 -1
  10. package/node_modules/@deepseek-ai/dsh-anonymous-user-id/package.json +1 -1
  11. package/node_modules/@deepseek-ai/dsh-api-gateway/package.json +1 -1
  12. package/node_modules/@deepseek-ai/dsh-api-remotes/package.json +1 -1
  13. package/node_modules/@deepseek-ai/dsh-app-boot/package.json +1 -1
  14. package/node_modules/@deepseek-ai/dsh-atomic-write/package.json +1 -1
  15. package/node_modules/@deepseek-ai/dsh-attachment/lib/index.js +1 -1
  16. package/node_modules/@deepseek-ai/dsh-attachment/package.json +1 -1
  17. package/node_modules/@deepseek-ai/dsh-attachment-local/package.json +1 -1
  18. package/node_modules/@deepseek-ai/dsh-base/package.json +1 -1
  19. package/node_modules/@deepseek-ai/dsh-bash-local/package.json +1 -1
  20. package/node_modules/@deepseek-ai/dsh-bash-sandbox/package.json +1 -1
  21. package/node_modules/@deepseek-ai/dsh-brand/package.json +1 -1
  22. package/node_modules/@deepseek-ai/dsh-client-connection/lib/client.js +1 -1
  23. package/node_modules/@deepseek-ai/dsh-client-connection/package.json +1 -1
  24. package/node_modules/@deepseek-ai/dsh-client-hmr/package.json +1 -1
  25. package/node_modules/@deepseek-ai/dsh-client-locale/lib/client.js +1 -1
  26. package/node_modules/@deepseek-ai/dsh-client-locale/package.json +1 -1
  27. package/node_modules/@deepseek-ai/dsh-client-modules/package.json +1 -1
  28. package/node_modules/@deepseek-ai/dsh-client-runtime/lib/client.js +4 -4
  29. package/node_modules/@deepseek-ai/dsh-client-runtime/package.json +1 -1
  30. package/node_modules/@deepseek-ai/dsh-client-schema-form/package.json +1 -1
  31. package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/lib/client.js +1 -1
  32. package/node_modules/@deepseek-ai/dsh-client-ui-agent-preset/package.json +1 -1
  33. package/node_modules/@deepseek-ai/dsh-client-ui-attachment/package.json +1 -1
  34. package/node_modules/@deepseek-ai/dsh-client-ui-commands/lib/client.js +1 -1
  35. package/node_modules/@deepseek-ai/dsh-client-ui-commands/package.json +1 -1
  36. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +8 -8
  37. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/package.json +1 -1
  38. package/node_modules/@deepseek-ai/dsh-client-ui-cordis/lib/client.js +3 -3
  39. package/node_modules/@deepseek-ai/dsh-client-ui-cordis/package.json +1 -1
  40. package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/client.js +1 -1
  41. package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/package.json +1 -1
  42. package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/lib/client.js +1 -1
  43. package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-browse/package.json +1 -1
  44. package/node_modules/@deepseek-ai/dsh-client-ui-directory-picker-native/package.json +1 -1
  45. package/node_modules/@deepseek-ai/dsh-client-ui-goal/lib/client.js +1 -1
  46. package/node_modules/@deepseek-ai/dsh-client-ui-goal/package.json +1 -1
  47. package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/lib/client.js +1 -1
  48. package/node_modules/@deepseek-ai/dsh-client-ui-input-trigger/package.json +1 -1
  49. package/node_modules/@deepseek-ai/dsh-client-ui-jobs/lib/client.js +1 -1
  50. package/node_modules/@deepseek-ai/dsh-client-ui-jobs/package.json +1 -1
  51. package/node_modules/@deepseek-ai/dsh-client-ui-layout/lib/client.js +1 -1
  52. package/node_modules/@deepseek-ai/dsh-client-ui-layout/package.json +1 -1
  53. package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/lib/client.js +1 -1
  54. package/node_modules/@deepseek-ai/dsh-client-ui-message-feedback/package.json +1 -1
  55. package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/lib/client.js +1 -1
  56. package/node_modules/@deepseek-ai/dsh-client-ui-model-selection/package.json +1 -1
  57. package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/lib/client.js +1 -1
  58. package/node_modules/@deepseek-ai/dsh-client-ui-permission-presets/package.json +1 -1
  59. package/node_modules/@deepseek-ai/dsh-client-ui-plan/lib/client.js +1 -1
  60. package/node_modules/@deepseek-ai/dsh-client-ui-plan/package.json +1 -1
  61. package/node_modules/@deepseek-ai/dsh-client-ui-primitives/lib/index.js +22 -22
  62. package/node_modules/@deepseek-ai/dsh-client-ui-primitives/package.json +1 -1
  63. package/node_modules/@deepseek-ai/dsh-client-ui-settings/package.json +1 -1
  64. package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +1 -1
  65. package/node_modules/@deepseek-ai/dsh-client-ui-settings-general/package.json +1 -1
  66. package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/client.js +3 -3
  67. package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/package.json +1 -1
  68. package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/lib/client.js +1 -1
  69. package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/package.json +1 -1
  70. package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/lib/client.js +1 -1
  71. package/node_modules/@deepseek-ai/dsh-client-ui-settings-plugins/package.json +1 -1
  72. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
  73. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/package.json +1 -1
  74. package/node_modules/@deepseek-ai/dsh-client-ui-skill/lib/client.js +3 -3
  75. package/node_modules/@deepseek-ai/dsh-client-ui-skill/package.json +1 -1
  76. package/node_modules/@deepseek-ai/dsh-client-ui-slots/package.json +1 -1
  77. package/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/client.js +1 -1
  78. package/node_modules/@deepseek-ai/dsh-client-ui-subagent/package.json +1 -1
  79. package/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/client.js +1 -1
  80. package/node_modules/@deepseek-ai/dsh-client-ui-theme/package.json +1 -1
  81. package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +4 -4
  82. package/node_modules/@deepseek-ai/dsh-client-ui-tool/package.json +1 -1
  83. package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/client.js +14 -14
  84. package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/package.json +1 -1
  85. package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/lib/client.js +1 -1
  86. package/node_modules/@deepseek-ai/dsh-client-ui-user-questions/package.json +1 -1
  87. package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/lib/client.js +1 -1
  88. package/node_modules/@deepseek-ai/dsh-client-ui-workflow-run/package.json +1 -1
  89. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +1 -1
  90. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/package.json +1 -1
  91. package/node_modules/@deepseek-ai/dsh-client-web/package.json +1 -1
  92. package/node_modules/@deepseek-ai/dsh-client-web-react/package.json +1 -1
  93. package/node_modules/@deepseek-ai/dsh-cmdline/package.json +1 -1
  94. package/node_modules/@deepseek-ai/dsh-code-runtime/package.json +1 -1
  95. package/node_modules/@deepseek-ai/dsh-code-runtime-worker-thread/package.json +1 -1
  96. package/node_modules/@deepseek-ai/dsh-command-compact/package.json +1 -1
  97. package/node_modules/@deepseek-ai/dsh-command-feedback/package.json +1 -1
  98. package/node_modules/@deepseek-ai/dsh-command-goal/package.json +1 -1
  99. package/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +5 -2
  100. package/node_modules/@deepseek-ai/dsh-commands/package.json +1 -1
  101. package/node_modules/@deepseek-ai/dsh-compaction/package.json +1 -1
  102. package/node_modules/@deepseek-ai/dsh-compaction-basic/package.json +1 -1
  103. package/node_modules/@deepseek-ai/dsh-compaction-tool-result-pruner/package.json +1 -1
  104. package/node_modules/@deepseek-ai/dsh-content-review/package.json +1 -1
  105. package/node_modules/@deepseek-ai/dsh-cordis-client-runner/lib/client.js +4 -4
  106. package/node_modules/@deepseek-ai/dsh-cordis-client-runner/package.json +1 -1
  107. package/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/typert.host.js +10 -4
  108. package/node_modules/@deepseek-ai/dsh-cordis-host-runner/package.json +1 -1
  109. package/node_modules/@deepseek-ai/dsh-credentials/package.json +1 -1
  110. package/node_modules/@deepseek-ai/dsh-credentials-local/package.json +1 -1
  111. package/node_modules/@deepseek-ai/dsh-fs/package.json +1 -1
  112. package/node_modules/@deepseek-ai/dsh-fs-local/package.json +1 -1
  113. package/node_modules/@deepseek-ai/dsh-fs-observation-policy/package.json +1 -1
  114. package/node_modules/@deepseek-ai/dsh-fs-sandbox/package.json +1 -1
  115. package/node_modules/@deepseek-ai/dsh-goal/lib/typert.host.js +5 -2
  116. package/node_modules/@deepseek-ai/dsh-goal/package.json +1 -1
  117. package/node_modules/@deepseek-ai/dsh-goal-round-driver/package.json +1 -1
  118. package/node_modules/@deepseek-ai/dsh-headless/package.json +1 -1
  119. package/node_modules/@deepseek-ai/dsh-home-paths/package.json +1 -1
  120. package/node_modules/@deepseek-ai/dsh-home-quarantine-macos/package.json +1 -1
  121. package/node_modules/@deepseek-ai/dsh-host-apiproxy/lib/index.js +7 -7
  122. package/node_modules/@deepseek-ai/dsh-host-apiproxy/lib/types/api/rpc.schema.js +1 -1
  123. package/node_modules/@deepseek-ai/dsh-host-apiproxy/lib/types/api-proxy.js +1 -1
  124. package/node_modules/@deepseek-ai/dsh-host-apiproxy/package.json +1 -1
  125. package/node_modules/@deepseek-ai/dsh-host-directory-picker/package.json +1 -1
  126. package/node_modules/@deepseek-ai/dsh-host-directory-picker-auto/package.json +1 -1
  127. package/node_modules/@deepseek-ai/dsh-host-directory-picker-browse/package.json +1 -1
  128. package/node_modules/@deepseek-ai/dsh-host-directory-picker-native/package.json +1 -1
  129. package/node_modules/@deepseek-ai/dsh-host-frontend-static/package.json +1 -1
  130. package/node_modules/@deepseek-ai/dsh-host-plugin-inventory/package.json +1 -1
  131. package/node_modules/@deepseek-ai/dsh-host-webserver/package.json +1 -1
  132. package/node_modules/@deepseek-ai/dsh-invariants/package.json +1 -1
  133. package/node_modules/@deepseek-ai/dsh-jobs/package.json +1 -1
  134. package/node_modules/@deepseek-ai/dsh-jobs-local/package.json +1 -1
  135. package/node_modules/@deepseek-ai/dsh-launch-environment/package.json +1 -1
  136. package/node_modules/@deepseek-ai/dsh-llm/lib/index.js +1 -1
  137. package/node_modules/@deepseek-ai/dsh-llm/lib/types/assembler.js +1 -1
  138. package/node_modules/@deepseek-ai/dsh-llm/package.json +1 -1
  139. package/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js +1 -1
  140. package/node_modules/@deepseek-ai/dsh-llm-deepseek/package.json +1 -1
  141. package/node_modules/@deepseek-ai/dsh-llm-gateway-openai/package.json +1 -1
  142. package/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/index.js +1 -1
  143. package/node_modules/@deepseek-ai/dsh-llm-pi-ai/package.json +1 -1
  144. package/node_modules/@deepseek-ai/dsh-llm-retry/package.json +1 -1
  145. package/node_modules/@deepseek-ai/dsh-mcp-client/lib/index.js +3 -2
  146. package/node_modules/@deepseek-ai/dsh-mcp-client/package.json +1 -1
  147. package/node_modules/@deepseek-ai/dsh-message-feedback/package.json +1 -1
  148. package/node_modules/@deepseek-ai/dsh-native-command/package.json +1 -1
  149. package/node_modules/@deepseek-ai/dsh-output-retention/package.json +1 -1
  150. package/node_modules/@deepseek-ai/dsh-permission-presets/package.json +1 -1
  151. package/node_modules/@deepseek-ai/dsh-persona/package.json +1 -1
  152. package/node_modules/@deepseek-ai/dsh-plan-mode/package.json +1 -1
  153. package/node_modules/@deepseek-ai/dsh-pwsh-local/package.json +1 -1
  154. package/node_modules/@deepseek-ai/dsh-pwsh-sandbox/package.json +1 -1
  155. package/node_modules/@deepseek-ai/dsh-qb-auth/package.json +1 -1
  156. package/node_modules/@deepseek-ai/dsh-repeat-tool-reminder/package.json +1 -1
  157. package/node_modules/@deepseek-ai/dsh-sandbox/package.json +1 -1
  158. package/node_modules/@deepseek-ai/dsh-sandbox-local/package.json +1 -1
  159. package/node_modules/@deepseek-ai/dsh-sandbox-policy/package.json +1 -1
  160. package/node_modules/@deepseek-ai/dsh-sandbox-windows-acl/package.json +1 -1
  161. package/node_modules/@deepseek-ai/dsh-schedule/package.json +1 -1
  162. package/node_modules/@deepseek-ai/dsh-scope/package.json +1 -1
  163. package/node_modules/@deepseek-ai/dsh-session/package.json +1 -1
  164. package/node_modules/@deepseek-ai/dsh-session-checkpoint-policy/package.json +1 -1
  165. package/node_modules/@deepseek-ai/dsh-session-log-export/lib/client.js +1 -1
  166. package/node_modules/@deepseek-ai/dsh-session-log-export/package.json +1 -1
  167. package/node_modules/@deepseek-ai/dsh-session-persistence/package.json +1 -1
  168. package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/package.json +1 -1
  169. package/node_modules/@deepseek-ai/dsh-session-projection/package.json +1 -1
  170. package/node_modules/@deepseek-ai/dsh-session-projection-cache/package.json +1 -1
  171. package/node_modules/@deepseek-ai/dsh-session-query/lib/index.js +2 -2
  172. package/node_modules/@deepseek-ai/dsh-session-query/package.json +1 -1
  173. package/node_modules/@deepseek-ai/dsh-session-query-sqlite/package.json +1 -1
  174. package/node_modules/@deepseek-ai/dsh-session-reference/package.json +1 -1
  175. package/node_modules/@deepseek-ai/dsh-session-stats/package.json +1 -1
  176. package/node_modules/@deepseek-ai/dsh-session-telemetry/package.json +1 -1
  177. package/node_modules/@deepseek-ai/dsh-session-telemetry-otel/package.json +1 -1
  178. package/node_modules/@deepseek-ai/dsh-session-title/package.json +1 -1
  179. package/node_modules/@deepseek-ai/dsh-session-title-first-prompt-llm/package.json +1 -1
  180. package/node_modules/@deepseek-ai/dsh-session-title-llm/package.json +1 -1
  181. package/node_modules/@deepseek-ai/dsh-settings/package.json +1 -1
  182. package/node_modules/@deepseek-ai/dsh-settings-file/package.json +1 -1
  183. package/node_modules/@deepseek-ai/dsh-shell/package.json +1 -1
  184. package/node_modules/@deepseek-ai/dsh-shell-env/package.json +1 -1
  185. package/node_modules/@deepseek-ai/dsh-skill/package.json +1 -1
  186. package/node_modules/@deepseek-ai/dsh-skill-badge/package.json +1 -1
  187. package/node_modules/@deepseek-ai/dsh-skill-filesystem/package.json +1 -1
  188. package/node_modules/@deepseek-ai/dsh-spill/package.json +1 -1
  189. package/node_modules/@deepseek-ai/dsh-spill-local/package.json +1 -1
  190. package/node_modules/@deepseek-ai/dsh-spill-policy/package.json +1 -1
  191. package/node_modules/@deepseek-ai/dsh-storage/package.json +1 -1
  192. package/node_modules/@deepseek-ai/dsh-storage-domain/package.json +1 -1
  193. package/node_modules/@deepseek-ai/dsh-storage-json/package.json +1 -1
  194. package/node_modules/@deepseek-ai/dsh-subagent/package.json +1 -1
  195. package/node_modules/@deepseek-ai/dsh-subagent-fork-in-process/package.json +1 -1
  196. package/node_modules/@deepseek-ai/dsh-subagent-in-process-driver/package.json +1 -1
  197. package/node_modules/@deepseek-ai/dsh-subagent-spawn-in-process/package.json +1 -1
  198. package/node_modules/@deepseek-ai/dsh-subprocess/package.json +1 -1
  199. package/node_modules/@deepseek-ai/dsh-subprocess-local/package.json +1 -1
  200. package/node_modules/@deepseek-ai/dsh-system-prompt/package.json +1 -1
  201. package/node_modules/@deepseek-ai/dsh-terminal/package.json +1 -1
  202. package/node_modules/@deepseek-ai/dsh-terminal-bash/lib/index.js +1 -1
  203. package/node_modules/@deepseek-ai/dsh-terminal-bash/package.json +1 -1
  204. package/node_modules/@deepseek-ai/dsh-time-context/package.json +1 -1
  205. package/node_modules/@deepseek-ai/dsh-timeout/package.json +1 -1
  206. package/node_modules/@deepseek-ai/dsh-tmux-context/package.json +1 -1
  207. package/node_modules/@deepseek-ai/dsh-token-meter/package.json +1 -1
  208. package/node_modules/@deepseek-ai/dsh-tool-ask-user/package.json +1 -1
  209. package/node_modules/@deepseek-ai/dsh-tool-bash/package.json +1 -1
  210. package/node_modules/@deepseek-ai/dsh-tool-bash-persistent/lib/index.js +7 -10
  211. package/node_modules/@deepseek-ai/dsh-tool-bash-persistent/package.json +1 -1
  212. package/node_modules/@deepseek-ai/dsh-tool-call-timeout-policy/package.json +1 -1
  213. package/node_modules/@deepseek-ai/dsh-tool-cordis/lib/index.js +5 -2
  214. package/node_modules/@deepseek-ai/dsh-tool-cordis/package.json +1 -1
  215. package/node_modules/@deepseek-ai/dsh-tool-fs/lib/index.js +8 -8
  216. package/node_modules/@deepseek-ai/dsh-tool-fs/package.json +1 -1
  217. package/node_modules/@deepseek-ai/dsh-tool-fs-search/package.json +1 -1
  218. package/node_modules/@deepseek-ai/dsh-tool-goal/package.json +1 -1
  219. package/node_modules/@deepseek-ai/dsh-tool-jobs/package.json +1 -1
  220. package/node_modules/@deepseek-ai/dsh-tool-pwsh/package.json +1 -1
  221. package/node_modules/@deepseek-ai/dsh-tool-ralph/package.json +1 -1
  222. package/node_modules/@deepseek-ai/dsh-tool-skill/package.json +1 -1
  223. package/node_modules/@deepseek-ai/dsh-tool-str-replace-editor/package.json +1 -1
  224. package/node_modules/@deepseek-ai/dsh-tool-subagent/lib/index.js +2 -2
  225. package/node_modules/@deepseek-ai/dsh-tool-subagent/package.json +1 -1
  226. package/node_modules/@deepseek-ai/dsh-tool-subagent-control/package.json +1 -1
  227. package/node_modules/@deepseek-ai/dsh-tool-subagent-report/package.json +1 -1
  228. package/node_modules/@deepseek-ai/dsh-tool-todo/package.json +1 -1
  229. package/node_modules/@deepseek-ai/dsh-tool-web/package.json +1 -1
  230. package/node_modules/@deepseek-ai/dsh-tool-workflow/package.json +1 -1
  231. package/node_modules/@deepseek-ai/dsh-tools/lib/index.js +15 -15
  232. package/node_modules/@deepseek-ai/dsh-tools/lib/types/code-mode.js +8 -8
  233. package/node_modules/@deepseek-ai/dsh-tools/lib/types/py-types.js +3 -3
  234. package/node_modules/@deepseek-ai/dsh-tools/lib/types/ts-types.js +4 -4
  235. package/node_modules/@deepseek-ai/dsh-tools/package.json +1 -1
  236. package/node_modules/@deepseek-ai/dsh-typert-loader/package.json +1 -1
  237. package/node_modules/@deepseek-ai/dsh-typert-protocol/package.json +1 -1
  238. package/node_modules/@deepseek-ai/dsh-typert-registry/package.json +1 -1
  239. package/node_modules/@deepseek-ai/dsh-user-approval/package.json +1 -1
  240. package/node_modules/@deepseek-ai/dsh-user-questions/package.json +1 -1
  241. package/node_modules/@deepseek-ai/dsh-web/package.json +1 -1
  242. package/node_modules/@deepseek-ai/dsh-web-app/package.json +1 -1
  243. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/{index-BQQQ5Qt-.js → index-fPGOmJjK.js} +25 -25
  244. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/index.html +1 -1
  245. package/node_modules/@deepseek-ai/dsh-web-frontend/package.json +1 -1
  246. package/node_modules/@deepseek-ai/dsh-web-search-deepseek/package.json +1 -1
  247. package/node_modules/@deepseek-ai/dsh-web-search-dsh/package.json +1 -1
  248. package/node_modules/@deepseek-ai/dsh-workflow/package.json +1 -1
  249. package/node_modules/@deepseek-ai/dsh-workflow-worker-thread/package.json +1 -1
  250. package/node_modules/@deepseek-ai/dsh-workspace/package.json +1 -1
  251. package/node_modules/@tanstack/react-virtual/package.json +1 -1
  252. package/node_modules/@tanstack/virtual-core/dist/cjs/index.cjs +7 -1
  253. package/node_modules/@tanstack/virtual-core/dist/cjs/utils.cjs +14 -4
  254. package/node_modules/@tanstack/virtual-core/dist/esm/index.js +1 -1
  255. package/node_modules/@tanstack/virtual-core/dist/esm/utils.js +2 -2
  256. package/node_modules/@tanstack/virtual-core/package.json +1 -1
  257. package/node_modules/hono/dist/cjs/client/utils.js +1 -1
  258. package/node_modules/hono/dist/cjs/context.js +4 -0
  259. package/node_modules/hono/dist/cjs/middleware/cors/index.js +1 -1
  260. package/node_modules/hono/dist/cjs/middleware/csrf/index.js +1 -1
  261. package/node_modules/hono/dist/cjs/middleware/etag/digest.js +1 -1
  262. package/node_modules/hono/dist/cjs/middleware/etag/index.js +2 -2
  263. package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +3 -1
  264. package/node_modules/hono/dist/cjs/router/linear-router/router.js +7 -2
  265. package/node_modules/hono/dist/cjs/router/pattern-router/router.js +3 -9
  266. package/node_modules/hono/dist/cjs/router/trie-router/node.js +43 -67
  267. package/node_modules/hono/dist/cjs/router/trie-router/router.js +3 -11
  268. package/node_modules/hono/dist/cjs/utils/ipaddr.js +5 -3
  269. package/node_modules/hono/dist/client/utils.js +1 -1
  270. package/node_modules/hono/dist/middleware/cors/index.js +1 -1
  271. package/node_modules/hono/dist/middleware/csrf/index.js +1 -1
  272. package/node_modules/hono/dist/middleware/etag/digest.js +1 -1
  273. package/node_modules/hono/dist/middleware/etag/index.js +1 -1
  274. package/node_modules/hono/dist/middleware/pretty-json/index.js +1 -1
  275. package/node_modules/hono/dist/router/linear-router/router.js +1 -1
  276. package/node_modules/hono/dist/router/pattern-router/router.js +1 -1
  277. package/node_modules/hono/dist/router/trie-router/node.js +1 -1
  278. package/node_modules/hono/dist/router/trie-router/router.js +1 -1
  279. package/node_modules/hono/dist/utils/ipaddr.js +1 -1
  280. package/node_modules/hono/package.json +1 -1
  281. package/node_modules/node-pty/lib/conpty_console_list_agent.js +11 -2
  282. package/node_modules/node-pty/lib/index.js +6 -6
  283. package/node_modules/node-pty/lib/shared/conout.js +2 -3
  284. package/node_modules/node-pty/lib/terminal.js +2 -2
  285. package/node_modules/node-pty/lib/unixTerminal.js +11 -6
  286. package/node_modules/node-pty/lib/utils.js +6 -7
  287. package/node_modules/node-pty/lib/windowsConoutConnection.js +24 -18
  288. package/node_modules/node-pty/lib/windowsPtyAgent.js +125 -101
  289. package/node_modules/node-pty/lib/windowsTerminal.js +14 -4
  290. package/node_modules/node-pty/lib/worker/conoutSocketWorker.js +3 -3
  291. package/node_modules/node-pty/package.json +1 -1
  292. package/node_modules/node-pty/prebuilds/darwin-arm64/pty.node +0 -0
  293. package/node_modules/node-pty/prebuilds/darwin-arm64/spawn-helper +0 -0
  294. package/node_modules/node-pty/prebuilds/darwin-x64/pty.node +0 -0
  295. package/node_modules/node-pty/prebuilds/darwin-x64/spawn-helper +0 -0
  296. package/node_modules/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
  297. package/node_modules/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
  298. package/node_modules/node-pty/prebuilds/win32-x64/conpty.node +0 -0
  299. package/node_modules/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
  300. package/node_modules/node-pty/scripts/post-install.js +1 -5
  301. package/node_modules/node-pty/third_party/conpty/1.25.260303002/win10-arm64/OpenConsole.exe +0 -0
  302. package/node_modules/node-pty/third_party/conpty/{1.23.251008001 → 1.25.260303002}/win10-arm64/conpty.dll +0 -0
  303. package/node_modules/node-pty/third_party/conpty/1.25.260303002/win10-x64/OpenConsole.exe +0 -0
  304. package/node_modules/node-pty/third_party/conpty/1.25.260303002/win10-x64/conpty.dll +0 -0
  305. package/package.json +1 -1
  306. package/node_modules/node-pty/deps/winpty/.drone.yml +0 -15
  307. package/node_modules/node-pty/deps/winpty/LICENSE +0 -21
  308. package/node_modules/node-pty/deps/winpty/configure +0 -167
  309. package/node_modules/node-pty/deps/winpty/misc/ConinMode.ps1 +0 -116
  310. package/node_modules/node-pty/deps/winpty/misc/IdentifyConsoleWindow.ps1 +0 -51
  311. package/node_modules/node-pty/deps/winpty/misc/build32.sh +0 -9
  312. package/node_modules/node-pty/deps/winpty/misc/build64.sh +0 -9
  313. package/node_modules/node-pty/deps/winpty/misc/color-test.sh +0 -212
  314. package/node_modules/node-pty/deps/winpty/ship/build-pty4j-libpty.bat +0 -36
  315. package/node_modules/node-pty/deps/winpty/src/shared/GetCommitHash.bat +0 -13
  316. package/node_modules/node-pty/deps/winpty/src/shared/UpdateGenVersion.bat +0 -20
  317. package/node_modules/node-pty/deps/winpty/vcbuild.bat +0 -83
  318. package/node_modules/node-pty/lib/eventEmitter2.test.js +0 -30
  319. package/node_modules/node-pty/lib/terminal.test.js +0 -139
  320. package/node_modules/node-pty/lib/testUtils.test.js +0 -28
  321. package/node_modules/node-pty/lib/unixTerminal.test.js +0 -351
  322. package/node_modules/node-pty/lib/windowsPtyAgent.test.js +0 -90
  323. package/node_modules/node-pty/lib/windowsTerminal.test.js +0 -219
  324. package/node_modules/node-pty/prebuilds/win32-x64/pty.node +0 -0
  325. package/node_modules/node-pty/prebuilds/win32-x64/winpty-agent.exe +0 -0
  326. package/node_modules/node-pty/prebuilds/win32-x64/winpty.dll +0 -0
  327. package/node_modules/node-pty/scripts/gen-compile-commands.js +0 -8
  328. package/node_modules/node-pty/scripts/increment-version.js +0 -54
  329. package/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-arm64/OpenConsole.exe +0 -0
  330. package/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-x64/OpenConsole.exe +0 -0
  331. package/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-x64/conpty.dll +0 -0
@@ -1 +1 @@
1
- {"name":"@deepseek-ai/dsh-client-ui-trajectory","version":"0.0.15","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./client":{"types":"./lib/types/client/index.d.ts","default":"./lib/client.js"},"./src/*":"./src/*","./package.json":"./package.json"},"dsh":{"client":{"inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation"],"platform":"web"}},"license":"MIT","dependencies":{"@tanstack/react-virtual":"^3.14.9","diff":"^9.0.0"},"peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0","@deepseek-ai/dsh-invariants":"^0.0.15","@deepseek-ai/dsh-client-ui-primitives":"^0.0.15","@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-agent":"^0.0.15","@deepseek-ai/dsh-client-locale":"^0.0.15","@deepseek-ai/dsh-tools":"^0.0.15","@deepseek-ai/dsh-client-runtime":"^0.0.15","@deepseek-ai/dsh-compaction":"^0.0.15"}}
1
+ {"name":"@deepseek-ai/dsh-client-ui-trajectory","version":"0.1.0","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./client":{"types":"./lib/types/client/index.d.ts","default":"./lib/client.js"},"./src/*":"./src/*","./package.json":"./package.json"},"dsh":{"client":{"inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation"],"platform":"web"}},"license":"MIT","dependencies":{"@tanstack/react-virtual":"^3.14.9","diff":"^9.0.0"},"peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0","@deepseek-ai/dsh-agent":"^0.1.0","@deepseek-ai/dsh-client-locale":"^0.1.0","@deepseek-ai/dsh-client-runtime":"^0.1.0","@deepseek-ai/dsh-invariants":"^0.1.0","@deepseek-ai/dsh-client-ui-primitives":"^0.1.0","@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-tools":"^0.1.0","@deepseek-ai/dsh-compaction":"^0.1.0"}}
@@ -1 +1 @@
1
- var oe=Object.defineProperty;var o=(_,k)=>oe(_,"name",{value:k,configurable:!0});window.__ModuleLoader__.load({id:"@deepseek-ai/dsh-client-ui-user-questions",factory:o(_=>{var k={exports:{}},I=k.exports;Object.defineProperty(I,Symbol.toStringTag,{value:"Module"});let a=_("react/jsx-runtime"),v=_("react"),h=_("@deepseek-ai/dsh-client-ui-primitives");function Z(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var p=e.length;for(t=0;t<p;t++)e[t]&&(n=Z(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}o(Z,"r");function A(){for(var e,t,n=0,r="",p=arguments.length;n<p;n++)(e=arguments[n])&&(t=Z(e))&&(r&&(r+=" "),r+=t);return r}o(A,"clsx");function M(e){if(e.length!==1)return;const t=e[0],n=t.intent;if(n?.kind!=="plan-review"||t.detail===void 0||t.multiSelect===!0)return;const r=t.options??[];if(r.length>2)return;const p=r.find(g=>g.label===n.approve);if(p===void 0)return;const b=r.find(g=>g.label!==n.approve);return{id:t.id,question:t.question,plan:t.detail,approve:p,...b===void 0?{}:{decline:b}}}o(M,"planReviewOf");var z=class{static{o(this,"PendingQuestion")}wait;constructor(e){this.wait=e}get key(){return this.wait.key}get questions(){return this.wait.payload.questions}async answer(e){const t=await this.wait.respond({ok:!0,value:{sessionId:this.wait.sessionId,answer:e}});if(!t.accepted)throw new Error(`question response rejected: ${t.reason}`)}async cancel(){const e=await this.wait.respond({ok:!1,error:{code:"cancelled",message:"the user closed this question request",details:{}}});if(!e.accepted)throw new Error(`question cancellation rejected: ${e.reason}`)}};const F=".xl7ZBq_frame{padding:6px calc(var(--dsh-composer-side-clearance) + 16px) 10px;justify-content:center;display:flex}.xl7ZBq_card{width:100%;max-width:var(--dsh-chat-content-width);border:1px solid var(--dsw-alias-state-warn-secondary);background:var(--dsw-specific-input-major);max-height:min(60vh,520px);box-shadow:var(--dsw-shadow-lv2);color:var(--dsw-alias-label-primary);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:20px;flex-direction:column;display:flex;overflow:hidden}.xl7ZBq_card,.xl7ZBq_card *{box-sizing:border-box}.xl7ZBq_strip{background:var(--dsw-alias-state-warn-tertiary);color:var(--dsw-alias-state-warn-primary);flex-shrink:0;align-items:center;gap:8px;padding:10px 16px;font-size:13px;line-height:18px;display:flex}.xl7ZBq_dot{background:var(--dsw-alias-state-warn-primary);border-radius:50%;width:8px;height:8px}.xl7ZBq_body{overscroll-behavior:contain;flex:auto;min-height:0;padding:12px 16px 4px;font-size:14px;line-height:22px;overflow-y:auto}.xl7ZBq_footer{flex-shrink:0;justify-content:space-between;align-items:center;gap:12px;padding:8px 16px 12px;display:flex}.xl7ZBq_feedback{min-height:16px;color:var(--dsw-alias-state-error-primary);font-size:11px;line-height:16px}.xl7ZBq_actions{flex-shrink:0;align-items:center;gap:8px;display:flex}.xl7ZBq_discuss{color:var(--dsw-alias-label-secondary);gap:6px}.xl7ZBq_discuss:hover:not(:disabled){color:var(--dsw-alias-label-primary)}@media (width<=720px){.xl7ZBq_card{border-radius:16px}.xl7ZBq_body{padding:10px 12px 4px}.xl7ZBq_footer{align-items:flex-end;padding:8px 12px 10px}}",R="@deepseek-ai/dsh-client-ui-user-questions/PlanReviewPanel.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(R)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-user-questions",e.dataset.pluginCss=R,e.textContent=F,document.head.appendChild(e)}var f={discuss:"xl7ZBq_discuss",strip:"xl7ZBq_strip",dot:"xl7ZBq_dot",frame:"xl7ZBq_frame",actions:"xl7ZBq_actions",card:"xl7ZBq_card",feedback:"xl7ZBq_feedback",body:"xl7ZBq_body",footer:"xl7ZBq_footer"};function E(e){return e===void 0?{}:{title:e}}o(E,"tooltip");function K({pending:e,review:t,t:n}){const[r,p]=(0,v.useState)(!1),[b,g]=(0,v.useState)(null),m=o(u=>{p(!0),g(null),u().catch(d=>{p(!1),g(d instanceof Error?d.message:String(d))})},"settle"),y=o(u=>{m(()=>e.answer({answers:[{id:t.id,selected:[u]}]}))},"decide"),w=t.decline;return(0,a.jsx)("div",{className:f.frame,"data-plan-review-key":e.key,children:(0,a.jsxs)("section",{className:f.card,"aria-label":t.question,children:[(0,a.jsxs)("div",{className:f.strip,children:[(0,a.jsx)("span",{className:f.dot}),n("plan.header")]}),(0,a.jsx)("div",{className:f.body,"data-plan-review-scroll":!0,children:(0,a.jsx)(h.MarkdownText,{text:t.plan})}),(0,a.jsxs)("div",{className:f.footer,children:[(0,a.jsx)("div",{className:f.feedback,role:"status",children:b}),(0,a.jsxs)("div",{className:f.actions,children:[(0,a.jsx)(h.Button,{variant:"ghost",className:f.discuss,icon:(0,a.jsx)(h.IconEditOutline16,{size:14}),disabled:r,onClick:o(()=>{m(()=>e.cancel())},"onClick"),children:n("plan.discuss")}),w!==void 0&&(0,a.jsx)(h.Button,{variant:"outline",...E(w.description),disabled:r,onClick:o(()=>{y(w.label)},"onClick"),children:n("plan.decline")}),(0,a.jsx)(h.Button,{variant:"primary",...E(t.approve.description),disabled:r,onClick:o(()=>{y(t.approve.label)},"onClick"),children:n("plan.approve")})]})]})]})})}o(K,"PlanReviewPanel");const J='.IAaxrq_frame{padding:6px calc(var(--dsh-composer-side-clearance) + 16px) 10px;justify-content:center;display:flex}.IAaxrq_card{width:100%;max-width:var(--dsh-chat-content-width);border:1px solid var(--dsw-alias-border-l2-darkmode-thin);background:var(--dsw-specific-input-major);max-height:min(60vh,520px);box-shadow:var(--dsw-shadow-lv2);color:var(--dsw-alias-label-primary);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:20px;flex-direction:column;padding:0 0 10px;display:flex;overflow:hidden}.IAaxrq_card,.IAaxrq_card *{box-sizing:border-box}.IAaxrq_header{flex-shrink:0;justify-content:space-between;align-items:flex-start;gap:16px;padding:20px 16px 0 24px;display:flex}.IAaxrq_headingBlock{min-width:0}.IAaxrq_eyebrow{color:var(--dsw-alias-label-tertiary);margin-bottom:5px;font-size:11px;line-height:16px}.IAaxrq_title{margin:0;font-size:16px;font-weight:500;line-height:22px}.IAaxrq_detail{margin:0 2px 8px}.IAaxrq_footerActions{flex-shrink:0;align-items:center;gap:12px;display:flex}.IAaxrq_pager{flex-shrink:0;align-items:center;gap:6px;display:flex}.IAaxrq_progress{color:var(--dsw-alias-label-secondary);white-space:nowrap;word-spacing:-2px;padding:0 4px;font-size:14px;font-weight:500;line-height:24px}.IAaxrq_iconButton{width:24px;height:24px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:999px;place-items:center;padding:0;display:grid}.IAaxrq_iconButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.IAaxrq_iconButton:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}.IAaxrq_body{overscroll-behavior:contain;flex-direction:column;flex:auto;min-height:0;display:flex;overflow-y:auto}.IAaxrq_options{flex-direction:column;gap:1px;margin:8px 0 0;padding:4px 12px;display:flex}.IAaxrq_option{width:100%;min-height:40px;color:inherit;text-align:left;cursor:pointer;background:0 0;border:1px solid #0000;border-radius:12px;flex-shrink:0;align-items:flex-start;gap:8px;padding:8px 12px 8px 8px;transition:background-color .12s,border-color .12s;display:flex}.IAaxrq_option:hover:not(:disabled),.IAaxrq_optionSelected{background:var(--dsw-alias-interactive-bg-hover)}.IAaxrq_optionSelected{border-color:var(--dsw-alias-border-l2)}.IAaxrq_option:disabled{cursor:default}.IAaxrq_number{background:var(--dsw-alias-bg-overlay);width:20px;height:20px;color:var(--dsw-alias-label-secondary);border-radius:6px;flex:0 0 20px;place-items:center;margin-top:2px;font-size:12px;font-weight:500;line-height:18px;display:grid}.IAaxrq_checkbox{flex:0 0 20px;place-items:center;width:20px;height:20px;margin-top:2px;display:grid}.IAaxrq_checkbox:before{content:"";border:1px solid var(--dsw-alias-border-l4);border-radius:4px;grid-area:1/1;width:14px;height:14px;transition:background-color .12s,border-color .12s}.IAaxrq_checkbox>svg{grid-area:1/1}.IAaxrq_checkboxChecked{color:var(--dsw-alias-label-primary-foreground)}.IAaxrq_checkboxChecked:before{border-color:var(--dsw-alias-label-primary);background:var(--dsw-alias-label-primary)}.IAaxrq_optionCopy{flex:1;min-width:0}.IAaxrq_optionLine{flex-wrap:wrap;align-items:baseline;gap:2px 6px;display:flex}.IAaxrq_optionLabel{font-size:14px;font-weight:500;line-height:24px}.IAaxrq_badge{background:var(--dsw-specific-sidebar-nav-item-active-accent);color:var(--dsw-alias-button-info-fill);border-radius:6px;padding:0 4px;font-size:11px;font-weight:600;line-height:18px}.IAaxrq_description{color:var(--dsw-alias-label-tertiary);font-size:14px;font-weight:400;line-height:24px}.IAaxrq_customRow{border:1px solid #0000;border-radius:12px;flex-shrink:0;align-items:flex-start;gap:8px;width:100%;min-height:40px;padding:8px 12px 8px 8px;transition:background-color .12s,border-color .12s;display:flex}.IAaxrq_customRow:hover,.IAaxrq_customRow:focus-within,.IAaxrq_customRowActive{background:var(--dsw-alias-interactive-bg-hover)}.IAaxrq_customRow:focus-within,.IAaxrq_customRowActive{border-color:var(--dsw-alias-border-l2)}.IAaxrq_customInput{min-width:0;color:var(--dsw-alias-label-primary);caret-color:var(--dsw-alias-state-business-primary);font:inherit;background:0 0;border:none;outline:none;flex:1;padding:0;font-size:14px;line-height:24px}.IAaxrq_customInput::placeholder{color:var(--dsw-alias-label-caption)}.IAaxrq_customTextarea{resize:none;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);min-height:64px;max-height:140px;color:var(--dsw-alias-label-primary);caret-color:var(--dsw-alias-state-business-primary);font:inherit;border-radius:10px;outline:none;flex-shrink:0;margin:0 12px;padding:8px 12px;font-size:14px;line-height:24px;display:block}.IAaxrq_customTextarea:focus{border-color:var(--dsw-alias-state-business-primary)}.IAaxrq_customTextarea::placeholder{color:var(--dsw-alias-label-caption)}.IAaxrq_footer{flex-shrink:0;justify-content:space-between;align-items:center;gap:12px;margin-top:12px;padding:0 10px 0 18px;display:flex}.IAaxrq_feedback{min-height:16px;color:var(--dsw-alias-state-error-primary);text-align:right;flex:1;font-size:11px;line-height:16px}@media (width<=720px){.IAaxrq_card{border-radius:16px}.IAaxrq_header{padding:10px 12px 0 18px}.IAaxrq_options{padding:4px 8px}.IAaxrq_title{font-size:15px;line-height:21px}.IAaxrq_option,.IAaxrq_customRow{padding:8px 6px}.IAaxrq_footer{align-items:flex-end;padding:0 10px}.IAaxrq_footerActions{flex-shrink:0}}@media (prefers-reduced-motion:reduce){.IAaxrq_option,.IAaxrq_customRow{transition:none}}',P="@deepseek-ai/dsh-client-ui-user-questions/QuestionComposer.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(P)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-user-questions",e.dataset.pluginCss=P,e.textContent=J,document.head.appendChild(e)}var i={options:"IAaxrq_options",body:"IAaxrq_body",checkboxChecked:"IAaxrq_checkboxChecked",iconButton:"IAaxrq_iconButton",customInput:"IAaxrq_customInput",title:"IAaxrq_title",progress:"IAaxrq_progress",customTextarea:"IAaxrq_customTextarea",frame:"IAaxrq_frame",customRow:"IAaxrq_customRow",footer:"IAaxrq_footer",header:"IAaxrq_header",detail:"IAaxrq_detail",card:"IAaxrq_card",optionCopy:"IAaxrq_optionCopy",optionLabel:"IAaxrq_optionLabel",option:"IAaxrq_option",checkbox:"IAaxrq_checkbox",optionLine:"IAaxrq_optionLine",footerActions:"IAaxrq_footerActions",headingBlock:"IAaxrq_headingBlock",optionSelected:"IAaxrq_optionSelected",description:"IAaxrq_description",customRowActive:"IAaxrq_customRowActive",number:"IAaxrq_number",badge:"IAaxrq_badge",pager:"IAaxrq_pager",feedback:"IAaxrq_feedback",eyebrow:"IAaxrq_eyebrow"};function G(e){const t=/\s*(?:\((?:recommended|推荐)\)|((?:recommended|推荐)))\s*$/i;return t.test(e)?{label:e.replace(t,""),recommended:!0}:{label:e,recommended:!1}}o(G,"parseRecommendedLabel");function H(e){return e.nativeEvent.isComposing||e.nativeEvent.keyCode===229}o(H,"isComposing");function U(e){const t=(0,v.useMemo)(()=>new z(e.matched),[e.matched]),n=(0,v.useMemo)(()=>M(t.questions),[t]);return n===void 0?(0,a.jsx)(V,{pending:t,t:e.t},t.key):(0,a.jsx)(K,{pending:t,review:n,t:e.t},t.key)}o(U,"QuestionComposer");function V({pending:e,t}){const n=e.questions,[r,p]=(0,v.useState)(0),[b,g]=(0,v.useState)(()=>n.map(()=>({selected:[],custom:"",skipped:!1}))),[m,y]=(0,v.useState)(null),[w,u]=(0,v.useState)(null),d=n[r],q=b[r],te=(d.options?.length??0)>0,se=o(()=>{y("cancel"),u(null),e.cancel().catch(s=>{y(null),u({text:s instanceof Error?s.message:String(s)})})},"cancelFlow"),L=o(s=>{g(l=>l.map((x,c)=>c===r?s(x):x)),u(null)},"updateDraft"),re=o(s=>{L(l=>{if(d.multiSelect===!0){const x=l.selected.includes(s)?l.selected.filter(c=>c!==s):[...l.selected,s];return{...l,selected:x,skipped:!1}}return{selected:[s],custom:"",skipped:!1}}),d.multiSelect!==!0&&r<n.length-1&&p(l=>l+1)},"choose"),N=o(s=>s.selected.length>0||s.custom.trim()!=="","answered"),$=o(s=>N(s)||s.skipped,"completed"),B=o(s=>{const l=s.findIndex(c=>!$(c));if(l>=0){p(l),u({key:"error.incomplete"});return}const x={answers:n.map((c,j)=>{const C=s[j];if(C.skipped)return{id:c.id,selected:[]};const S=C.custom.trim();return{id:c.id,selected:S===""||c.multiSelect===!0?C.selected:[],...S===""?{}:{custom:S}}})};y("answer"),u(null),e.answer(x).catch(c=>{y(null),u({text:c instanceof Error?c.message:String(c)})})},"submitDrafts"),D=o(()=>{if(!N(q)){u({key:"error.unanswered"});return}if(r<n.length-1){p(s=>s+1),u(null);return}B(b)},"continueFlow"),T=o(s=>{const l=s.target.value;L(x=>({...x,selected:d.multiSelect===!0?x.selected:[],custom:l,skipped:!1}))},"draftCustom"),Q=o(s=>{s.key!=="Enter"||s.shiftKey||H(s)||(s.preventDefault(),D())},"continueFromCustom"),ie=o(()=>{const s=b.map((l,x)=>x===r?{selected:[],custom:"",skipped:!0}:l);if(g(s),u(null),r<n.length-1){p(l=>l+1);return}B(s)},"skipQuestion");return(0,a.jsx)("div",{className:i.frame,"data-question-key":e.key,children:(0,a.jsxs)("section",{className:i.card,"aria-labelledby":`question-${e.key}-${String(r)}`,children:[(0,a.jsxs)("header",{className:i.header,children:[(0,a.jsxs)("div",{className:i.headingBlock,children:[d.header!==void 0&&(0,a.jsx)("div",{className:i.eyebrow,children:d.header}),(0,a.jsx)("h2",{className:i.title,id:`question-${e.key}-${String(r)}`,children:d.question})]}),(0,a.jsx)("button",{type:"button",className:i.iconButton,"aria-label":t("nav.cancel"),title:t("nav.cancel"),disabled:m!==null,onClick:se,children:(0,a.jsx)(h.IconCloseOutline16,{})})]}),(0,a.jsxs)("div",{className:i.body,"data-question-scroll":!0,children:[d.detail!==void 0&&(0,a.jsx)("div",{className:i.detail,children:(0,a.jsx)(h.MarkdownText,{text:d.detail})}),(0,a.jsxs)("div",{className:i.options,role:d.multiSelect===!0?"group":"radiogroup",children:[(d.options??[]).map((s,l)=>{const x=q.selected.includes(s.label),c=G(s.label);return(0,a.jsxs)("button",{type:"button",className:A(i.option,x&&d.multiSelect!==!0&&i.optionSelected),role:d.multiSelect===!0?"checkbox":"radio","aria-checked":x,"aria-label":c.label,disabled:m!==null,onClick:o(()=>{re(s.label)},"onClick"),onKeyDown:o(j=>{j.key!=="Enter"||!b.every($)||(j.preventDefault(),B(b))},"onKeyDown"),children:[d.multiSelect===!0?(0,a.jsx)("span",{className:A(i.checkbox,x&&i.checkboxChecked),"aria-hidden":"true",children:x&&(0,a.jsx)(h.IconCheckOutline14,{size:12})}):(0,a.jsx)("span",{className:i.number,children:l+1}),(0,a.jsx)("span",{className:i.optionCopy,children:(0,a.jsxs)("span",{className:i.optionLine,children:[(0,a.jsx)("span",{className:i.optionLabel,children:c.label}),c.recommended&&(0,a.jsx)("span",{className:i.badge,children:t("option.recommended")}),s.description!==void 0&&(0,a.jsx)("span",{className:i.description,children:s.description})]})})]},`${s.label}-${String(l)}`)}),te?(0,a.jsxs)("div",{className:A(i.customRow,q.custom!==""&&i.customRowActive),children:[d.multiSelect===!0?(0,a.jsx)("span",{className:A(i.checkbox,q.custom!==""&&i.checkboxChecked),"aria-hidden":"true",children:q.custom!==""&&(0,a.jsx)(h.IconCheckOutline14,{size:12})}):(0,a.jsx)("span",{className:i.number,"aria-hidden":"true",children:(0,a.jsx)(h.IconEditOutline16,{size:12})}),(0,a.jsx)("input",{type:"text",className:i.customInput,value:q.custom,disabled:m!==null,placeholder:t("custom.placeholder"),onChange:T,onKeyDown:Q})]}):(0,a.jsx)("textarea",{autoFocus:!0,className:i.customTextarea,value:q.custom,disabled:m!==null,rows:2,placeholder:t("custom.placeholder"),onChange:T,onKeyDown:Q})]})]}),(0,a.jsxs)("footer",{className:i.footer,children:[(0,a.jsxs)("div",{className:i.pager,children:[(0,a.jsx)("button",{type:"button",className:i.iconButton,"aria-label":t("nav.prev"),disabled:r===0||m!==null,onClick:o(()=>{p(r-1),u(null)},"onClick"),children:(0,a.jsx)(h.IconChevronLeftOutline14,{})}),(0,a.jsxs)("span",{className:i.progress,children:[r+1," / ",n.length]}),(0,a.jsx)("button",{type:"button",className:i.iconButton,"aria-label":t("nav.next"),disabled:r===n.length-1||m!==null,onClick:o(()=>{p(r+1),u(null)},"onClick"),children:(0,a.jsx)(h.IconChevronRightOutline14,{})})]}),(0,a.jsx)("div",{className:i.feedback,role:"status",children:w===null?null:"key"in w?t(w.key):w.text}),(0,a.jsxs)("div",{className:i.footerActions,children:[(0,a.jsx)(h.Button,{variant:"outline",disabled:m!==null,onClick:ie,children:t("action.skip")}),(0,a.jsx)(h.Button,{variant:"primary",disabled:m!==null||!N(q),onClick:D,children:m==="answer"?t("submitting"):r===n.length-1?t("submit"):t("action.next")})]})]})]})})}o(V,"QuestionFlow");const W={"error.incomplete":"请先完成这道问题。","error.unanswered":"请选择一个选项或填写自定义答案。","nav.prev":"上一题","nav.next":"下一题","nav.cancel":"放弃整组问题","option.recommended":"推荐","custom.placeholder":"输入你的答案","action.skip":"跳过本题","action.next":"下一题","plan.header":"计划待审","plan.approve":"确认执行","plan.decline":"拒绝","plan.discuss":"去聊天里说"},X={"error.incomplete":"Please complete this question first.","error.unanswered":"Please select an option or enter a custom answer.","nav.prev":"Previous question","nav.next":"Next question","nav.cancel":"Dismiss all questions","option.recommended":"Recommended","custom.placeholder":"Type your answer","action.skip":"Skip this question","action.next":"Next","plan.header":"Plan review","plan.approve":"Approve","plan.decline":"Refuse","plan.discuss":"Chat about it"},O="question",Y=["slots","locale"];function ee({interactions:e}){return e.find(t=>t.kind==="question")??null}o(ee,"selectQuestion");function ae(e){e.effect(()=>e.locale.register(O,{zh:W,en:X}),"ui-user-questions: dictionaries"),e.slots.inject("conversation.composer",()=>e.slots.register({name:"conversation.composer",select:ee,locale:O},U))}return o(ae,"apply"),I.PendingQuestion=z,I.apply=ae,I.inject=Y,k.exports},"factory")});
1
+ var de=Object.defineProperty;var o=(k,K)=>de(k,"name",{value:K,configurable:!0});window.__ModuleLoader__.load({id:"@deepseek-ai/dsh-client-ui-user-questions",factory:o(k=>{var K={exports:{}},j=K.exports;Object.defineProperty(j,Symbol.toStringTag,{value:"Module"});let t=k("react/jsx-runtime"),_=k("react"),c=k("@deepseek-ai/dsh-client-ui-primitives");function R(e){var s,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var p=e.length;for(s=0;s<p;s++)e[s]&&(r=R(e[s]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}o(R,"r");function D(){for(var e,s,r=0,a="",p=arguments.length;r<p;r++)(e=arguments[r])&&(s=R(e))&&(a&&(a+=" "),a+=s);return a}o(D,"clsx");function J(e){if(e.length!==1)return;const s=e[0],r=s.intent;if(r?.kind!=="plan-review"||s.detail===void 0||s.multiSelect===!0)return;const a=s.options??[];if(a.length>2)return;const p=a.find(v=>v.label===r.approve);if(p===void 0)return;const b=a.find(v=>v.label!==r.approve);return{id:s.id,question:s.question,plan:s.detail,approve:p,...b===void 0?{}:{decline:b}}}o(J,"planReviewOf");var B=class{static{o(this,"PendingQuestion")}wait;constructor(e){this.wait=e}get key(){return this.wait.key}get questions(){return this.wait.payload.questions}async answer(e){const s=await this.wait.respond({ok:!0,value:{sessionId:this.wait.sessionId,answer:e}});if(!s.accepted)throw new Error(`question response rejected: ${s.reason}`)}async cancel(){const e=await this.wait.respond({ok:!1,error:{code:"cancelled",message:"the user closed this question request",details:{}}});if(!e.accepted)throw new Error(`question cancellation rejected: ${e.reason}`)}};const U="._5S9I9q_frame{padding:6px calc(var(--dsh-composer-side-clearance) + 16px) 10px;justify-content:center;display:flex}._5S9I9q_card{width:100%;max-width:var(--dsh-chat-content-width);border:1px solid var(--dsw-alias-state-warn-secondary);background:var(--dsw-specific-input-major);max-height:min(60vh,520px);box-shadow:var(--dsw-shadow-lv2);color:var(--dsw-alias-label-primary);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:20px;flex-direction:column;display:flex;overflow:hidden}._5S9I9q_card,._5S9I9q_card *{box-sizing:border-box}._5S9I9q_strip{background:var(--dsw-alias-state-warn-tertiary);color:var(--dsw-alias-state-warn-primary);flex-shrink:0;align-items:center;gap:8px;padding:10px 16px;font-size:13px;line-height:18px;display:flex}._5S9I9q_dot{background:var(--dsw-alias-state-warn-primary);border-radius:50%;width:8px;height:8px}._5S9I9q_body{overscroll-behavior:contain;flex:auto;min-height:0;padding:12px 16px 4px;font-size:14px;line-height:22px;overflow-y:auto}._5S9I9q_footer{flex-shrink:0;justify-content:space-between;align-items:center;gap:12px;padding:8px 16px 12px;display:flex}._5S9I9q_feedback{min-height:16px;color:var(--dsw-alias-state-error-primary);font-size:11px;line-height:16px}._5S9I9q_actions{flex-shrink:0;align-items:center;gap:8px;display:flex}._5S9I9q_discuss{color:var(--dsw-alias-label-secondary);gap:6px}._5S9I9q_discuss:hover:not(:disabled){color:var(--dsw-alias-label-primary)}@media (width<=720px){._5S9I9q_card{border-radius:16px}._5S9I9q_body{padding:10px 12px 4px}._5S9I9q_footer{align-items:flex-end;padding:8px 12px 10px}}",A="@deepseek-ai/dsh-client-ui-user-questions/PlanReviewPanel.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(A)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-user-questions",e.dataset.pluginCss=A,e.textContent=U,document.head.appendChild(e)}var g={footer:"_5S9I9q_footer",body:"_5S9I9q_body",feedback:"_5S9I9q_feedback",frame:"_5S9I9q_frame",strip:"_5S9I9q_strip",actions:"_5S9I9q_actions",discuss:"_5S9I9q_discuss",card:"_5S9I9q_card",dot:"_5S9I9q_dot"};function E(e){return e===void 0?{}:{title:e}}o(E,"tooltip");function G({pending:e,review:s,t:r}){const[a,p]=(0,_.useState)(!1),[b,v]=(0,_.useState)(null),m=o(h=>{p(!0),v(null),h().catch(f=>{p(!1),v(f instanceof Error?f.message:String(f))})},"settle"),y=o(h=>{m(()=>e.answer({answers:[{id:s.id,selected:[h]}]}))},"decide"),w=s.decline;return(0,t.jsx)("div",{className:g.frame,"data-plan-review-key":e.key,children:(0,t.jsxs)("section",{className:g.card,"aria-label":s.question,children:[(0,t.jsxs)("div",{className:g.strip,children:[(0,t.jsx)("span",{className:g.dot}),r("plan.header")]}),(0,t.jsx)("div",{className:g.body,"data-plan-review-scroll":!0,children:(0,t.jsx)(c.MarkdownText,{text:s.plan})}),(0,t.jsxs)("div",{className:g.footer,children:[(0,t.jsx)("div",{className:g.feedback,role:"status",children:b}),(0,t.jsxs)("div",{className:g.actions,children:[(0,t.jsx)(c.Button,{variant:"ghost",className:g.discuss,icon:(0,t.jsx)(c.IconEditOutline16,{size:14}),disabled:a,onClick:o(()=>{m(()=>e.cancel())},"onClick"),children:r("plan.discuss")}),w!==void 0&&(0,t.jsx)(c.Button,{variant:"outline",...E(w.description),disabled:a,onClick:o(()=>{y(w.label)},"onClick"),children:r("plan.decline")}),(0,t.jsx)(c.Button,{variant:"primary",...E(s.approve.description),disabled:a,onClick:o(()=>{y(s.approve.label)},"onClick"),children:r("plan.approve")})]})]})]})})}o(G,"PlanReviewPanel");const H='._4hK1Dq_frame{padding:6px calc(var(--dsh-composer-side-clearance) + 16px) 10px;justify-content:center;display:flex}._4hK1Dq_card{width:100%;max-width:var(--dsh-chat-content-width);border:1px solid var(--dsw-alias-border-l2-darkmode-thin);background:var(--dsw-specific-input-major);max-height:min(60vh,520px);box-shadow:var(--dsw-shadow-lv2);color:var(--dsw-alias-label-primary);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:20px;flex-direction:column;padding:0 0 10px;display:flex;overflow:hidden}._4hK1Dq_card,._4hK1Dq_card *{box-sizing:border-box}._4hK1Dq_cardMinimized{max-height:none}._4hK1Dq_cardMinimized ._4hK1Dq_header{padding-bottom:14px}._4hK1Dq_headerActions{flex-shrink:0;align-items:center;gap:4px;display:flex}._4hK1Dq_header{flex-shrink:0;justify-content:space-between;align-items:flex-start;gap:16px;padding:20px 16px 0 24px;display:flex}._4hK1Dq_headingBlock{min-width:0}._4hK1Dq_eyebrow{color:var(--dsw-alias-label-tertiary);margin-bottom:5px;font-size:11px;line-height:16px}._4hK1Dq_title{margin:0;font-size:16px;font-weight:500;line-height:22px}._4hK1Dq_detail{margin:0 2px 8px}._4hK1Dq_footerActions{flex-shrink:0;align-items:center;gap:12px;display:flex}._4hK1Dq_pager{flex-shrink:0;align-items:center;gap:6px;display:flex}._4hK1Dq_progress{color:var(--dsw-alias-label-secondary);white-space:nowrap;word-spacing:-2px;padding:0 4px;font-size:14px;font-weight:500;line-height:24px}._4hK1Dq_iconButton{width:24px;height:24px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:999px;place-items:center;padding:0;display:grid}._4hK1Dq_iconButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}._4hK1Dq_iconButton:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}._4hK1Dq_body{overscroll-behavior:contain;flex-direction:column;flex:auto;min-height:0;display:flex;overflow-y:auto}._4hK1Dq_options{flex-direction:column;gap:1px;margin:8px 0 0;padding:4px 12px;display:flex}._4hK1Dq_option{width:100%;min-height:40px;color:inherit;text-align:left;cursor:pointer;background:0 0;border:1px solid #0000;border-radius:12px;flex-shrink:0;align-items:flex-start;gap:8px;padding:8px 12px 8px 8px;transition:background-color .12s,border-color .12s;display:flex}._4hK1Dq_option:hover:not(:disabled),._4hK1Dq_optionSelected{background:var(--dsw-alias-interactive-bg-hover)}._4hK1Dq_optionSelected{border-color:var(--dsw-alias-border-l2)}._4hK1Dq_option:disabled{cursor:default}._4hK1Dq_number{background:var(--dsw-alias-bg-overlay);width:20px;height:20px;color:var(--dsw-alias-label-secondary);border-radius:6px;flex:0 0 20px;place-items:center;margin-top:2px;font-size:12px;font-weight:500;line-height:18px;display:grid}._4hK1Dq_checkbox{flex:0 0 20px;place-items:center;width:20px;height:20px;margin-top:2px;display:grid}._4hK1Dq_checkbox:before{content:"";border:1px solid var(--dsw-alias-border-l4);border-radius:4px;grid-area:1/1;width:14px;height:14px;transition:background-color .12s,border-color .12s}._4hK1Dq_checkbox>svg{grid-area:1/1}._4hK1Dq_checkboxChecked{color:var(--dsw-alias-label-primary-foreground)}._4hK1Dq_checkboxChecked:before{border-color:var(--dsw-alias-label-primary);background:var(--dsw-alias-label-primary)}._4hK1Dq_optionCopy{flex:1;min-width:0}._4hK1Dq_optionLine{flex-wrap:wrap;align-items:baseline;gap:2px 6px;display:flex}._4hK1Dq_optionLabel{font-size:14px;font-weight:500;line-height:24px}._4hK1Dq_badge{background:var(--dsw-specific-sidebar-nav-item-active-accent);color:var(--dsw-alias-button-info-fill);border-radius:6px;padding:0 4px;font-size:11px;font-weight:600;line-height:18px}._4hK1Dq_description{color:var(--dsw-alias-label-tertiary);font-size:14px;font-weight:400;line-height:24px}._4hK1Dq_customRow{border:1px solid #0000;border-radius:12px;flex-shrink:0;align-items:flex-start;gap:8px;width:100%;min-height:40px;padding:8px 12px 8px 8px;transition:background-color .12s,border-color .12s;display:flex}._4hK1Dq_customRow:hover,._4hK1Dq_customRow:focus-within,._4hK1Dq_customRowActive{background:var(--dsw-alias-interactive-bg-hover)}._4hK1Dq_customRow:focus-within,._4hK1Dq_customRowActive{border-color:var(--dsw-alias-border-l2)}._4hK1Dq_customInput{min-width:0;color:var(--dsw-alias-label-primary);caret-color:var(--dsw-alias-state-business-primary);font:inherit;background:0 0;border:none;outline:none;flex:1;padding:0;font-size:14px;line-height:24px}._4hK1Dq_customInput::placeholder{color:var(--dsw-alias-label-caption)}._4hK1Dq_customTextarea{resize:none;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);min-height:64px;max-height:140px;color:var(--dsw-alias-label-primary);caret-color:var(--dsw-alias-state-business-primary);font:inherit;border-radius:10px;outline:none;flex-shrink:0;margin:0 12px;padding:8px 12px;font-size:14px;line-height:24px;display:block}._4hK1Dq_customTextarea:focus{border-color:var(--dsw-alias-state-business-primary)}._4hK1Dq_customTextarea::placeholder{color:var(--dsw-alias-label-caption)}._4hK1Dq_footer{flex-shrink:0;justify-content:space-between;align-items:center;gap:12px;margin-top:12px;padding:0 10px 0 18px;display:flex}._4hK1Dq_feedback{min-height:16px;color:var(--dsw-alias-state-error-primary);text-align:right;flex:1;font-size:11px;line-height:16px}@media (width<=720px){._4hK1Dq_card{border-radius:16px}._4hK1Dq_header{padding:10px 12px 0 18px}._4hK1Dq_options{padding:4px 8px}._4hK1Dq_title{font-size:15px;line-height:21px}._4hK1Dq_option,._4hK1Dq_customRow{padding:8px 6px}._4hK1Dq_footer{align-items:flex-end;padding:0 10px}._4hK1Dq_footerActions{flex-shrink:0}}@media (prefers-reduced-motion:reduce){._4hK1Dq_option,._4hK1Dq_customRow{transition:none}}',O="@deepseek-ai/dsh-client-ui-user-questions/QuestionComposer.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(O)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-user-questions",e.dataset.pluginCss=O,e.textContent=H,document.head.appendChild(e)}var n={cardMinimized:"_4hK1Dq_cardMinimized",headingBlock:"_4hK1Dq_headingBlock",optionSelected:"_4hK1Dq_optionSelected",description:"_4hK1Dq_description",progress:"_4hK1Dq_progress",options:"_4hK1Dq_options",number:"_4hK1Dq_number",customRow:"_4hK1Dq_customRow",card:"_4hK1Dq_card",footer:"_4hK1Dq_footer",title:"_4hK1Dq_title",body:"_4hK1Dq_body",badge:"_4hK1Dq_badge",optionCopy:"_4hK1Dq_optionCopy",checkboxChecked:"_4hK1Dq_checkboxChecked",optionLine:"_4hK1Dq_optionLine",feedback:"_4hK1Dq_feedback",customRowActive:"_4hK1Dq_customRowActive",customInput:"_4hK1Dq_customInput",customTextarea:"_4hK1Dq_customTextarea",optionLabel:"_4hK1Dq_optionLabel",iconButton:"_4hK1Dq_iconButton",footerActions:"_4hK1Dq_footerActions",headerActions:"_4hK1Dq_headerActions",option:"_4hK1Dq_option",detail:"_4hK1Dq_detail",header:"_4hK1Dq_header",eyebrow:"_4hK1Dq_eyebrow",pager:"_4hK1Dq_pager",frame:"_4hK1Dq_frame",checkbox:"_4hK1Dq_checkbox"};function V(e){const s=/\s*(?:\((?:recommended|推荐)\)|((?:recommended|推荐)))\s*$/i;return s.test(e)?{label:e.replace(s,""),recommended:!0}:{label:e,recommended:!1}}o(V,"parseRecommendedLabel");function W(e){return e.nativeEvent.isComposing||e.nativeEvent.keyCode===229}o(W,"isComposing");function X(e){const s=(0,_.useMemo)(()=>new B(e.matched),[e.matched]),r=(0,_.useMemo)(()=>J(s.questions),[s]);return r===void 0?(0,t.jsx)(Y,{pending:s,t:e.t},s.key):(0,t.jsx)(G,{pending:s,review:r,t:e.t},s.key)}o(X,"QuestionComposer");function Y({pending:e,t:s}){const r=e.questions,[a,p]=(0,_.useState)(0),[b,v]=(0,_.useState)(()=>r.map(()=>({selected:[],custom:"",skipped:!1}))),[m,y]=(0,_.useState)(null),[w,h]=(0,_.useState)(null),[f,ae]=(0,_.useState)(!1),M=(0,_.useRef)(new Set),x=r[a],q=b[a],ne=(x.options?.length??0)>0,oe=o(()=>{y("cancel"),h(null),e.cancel().catch(i=>{y(null),h({text:i instanceof Error?i.message:String(i)})})},"cancelFlow"),L=o(i=>{v(l=>l.map((u,d)=>d===a?i(u):u)),h(null)},"updateDraft"),re=o(i=>{L(l=>{if(x.multiSelect===!0){const u=l.selected.includes(i)?l.selected.filter(d=>d!==i):[...l.selected,i];return{...l,selected:u,skipped:!1}}return{selected:[i],custom:"",skipped:!1}}),x.multiSelect!==!0&&a<r.length-1&&p(l=>l+1)},"choose"),N=o(i=>i.selected.length>0||i.custom.trim()!=="","answered"),$=o(i=>N(i)||i.skipped,"completed"),C=o(i=>{const l=i.findIndex(d=>!$(d));if(l>=0){p(l),h({key:"error.incomplete"});return}const u={answers:r.map((d,S)=>{const I=i[S];if(I.skipped)return{id:d.id,selected:[]};const z=I.custom.trim();return{id:d.id,selected:z===""||d.multiSelect===!0?I.selected:[],...z===""?{}:{custom:z}}})};y("answer"),h(null),e.answer(u).catch(d=>{y(null),h({text:d instanceof Error?d.message:String(d)})})},"submitDrafts"),T=o(()=>{if(!N(q)){h({key:"error.unanswered"});return}if(a<r.length-1){p(i=>i+1),h(null);return}C(b)},"continueFlow"),Q=o(i=>{const l=i.target.value;L(u=>({...u,selected:x.multiSelect===!0?u.selected:[],custom:l,skipped:!1}))},"draftCustom"),F=o(i=>{i.key!=="Enter"||i.shiftKey||W(i)||(i.preventDefault(),T())},"continueFromCustom"),le=o(()=>{const i=b.map((l,u)=>u===a?{selected:[],custom:"",skipped:!0}:l);if(v(i),h(null),a<r.length-1){p(l=>l+1);return}C(i)},"skipQuestion");return(0,t.jsx)("div",{className:n.frame,"data-question-key":e.key,children:(0,t.jsxs)("section",{className:D(n.card,f&&n.cardMinimized),"aria-labelledby":`question-${e.key}-${String(a)}`,children:[(0,t.jsxs)("header",{className:n.header,children:[(0,t.jsxs)("div",{className:n.headingBlock,children:[x.header!==void 0&&(0,t.jsx)("div",{className:n.eyebrow,children:x.header}),(0,t.jsx)("h2",{className:n.title,id:`question-${e.key}-${String(a)}`,children:x.question})]}),(0,t.jsxs)("div",{className:n.headerActions,children:[(0,t.jsx)("button",{type:"button",className:n.iconButton,"aria-label":s(f?"nav.maximize":"nav.minimize"),title:s(f?"nav.maximize":"nav.minimize"),"aria-expanded":!f,disabled:m!==null,onClick:o(()=>{ae(i=>!i)},"onClick"),children:f?(0,t.jsx)(c.IconChevronUpOutline14,{}):(0,t.jsx)(c.IconChevronDownOutline14,{})}),(0,t.jsx)("button",{type:"button",className:n.iconButton,"aria-label":s("nav.cancel"),title:s("nav.cancel"),disabled:m!==null,onClick:oe,children:(0,t.jsx)(c.IconCloseOutline16,{})})]})]}),!f&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:n.body,"data-question-scroll":!0,children:[x.detail!==void 0&&(0,t.jsx)("div",{className:n.detail,children:(0,t.jsx)(c.MarkdownText,{text:x.detail})}),(0,t.jsxs)("div",{className:n.options,role:x.multiSelect===!0?"group":"radiogroup",children:[(x.options??[]).map((i,l)=>{const u=q.selected.includes(i.label),d=V(i.label);return(0,t.jsxs)("button",{type:"button",className:D(n.option,u&&x.multiSelect!==!0&&n.optionSelected),role:x.multiSelect===!0?"checkbox":"radio","aria-checked":u,"aria-label":d.label,disabled:m!==null,onClick:o(()=>{re(i.label)},"onClick"),onKeyDown:o(S=>{S.key!=="Enter"||!b.every($)||(S.preventDefault(),C(b))},"onKeyDown"),children:[x.multiSelect===!0?(0,t.jsx)("span",{className:D(n.checkbox,u&&n.checkboxChecked),"aria-hidden":"true",children:u&&(0,t.jsx)(c.IconCheckOutline14,{size:12})}):(0,t.jsx)("span",{className:n.number,children:l+1}),(0,t.jsx)("span",{className:n.optionCopy,children:(0,t.jsxs)("span",{className:n.optionLine,children:[(0,t.jsx)("span",{className:n.optionLabel,children:d.label}),d.recommended&&(0,t.jsx)("span",{className:n.badge,children:s("option.recommended")}),i.description!==void 0&&(0,t.jsx)("span",{className:n.description,children:i.description})]})})]},`${i.label}-${String(l)}`)}),ne?(0,t.jsxs)("div",{className:D(n.customRow,q.custom!==""&&n.customRowActive),children:[x.multiSelect===!0?(0,t.jsx)("span",{className:D(n.checkbox,q.custom!==""&&n.checkboxChecked),"aria-hidden":"true",children:q.custom!==""&&(0,t.jsx)(c.IconCheckOutline14,{size:12})}):(0,t.jsx)("span",{className:n.number,"aria-hidden":"true",children:(0,t.jsx)(c.IconEditOutline16,{size:12})}),(0,t.jsx)("input",{type:"text",className:n.customInput,value:q.custom,disabled:m!==null,placeholder:s("custom.placeholder"),onChange:Q,onKeyDown:F})]}):(0,t.jsx)("textarea",{autoFocus:!M.current.has(a),className:n.customTextarea,value:q.custom,disabled:m!==null,rows:2,placeholder:s("custom.placeholder"),onFocus:o(()=>{M.current.add(a)},"onFocus"),onChange:Q,onKeyDown:F})]})]}),(0,t.jsxs)("footer",{className:n.footer,children:[(0,t.jsxs)("div",{className:n.pager,children:[(0,t.jsx)("button",{type:"button",className:n.iconButton,"aria-label":s("nav.prev"),disabled:a===0||m!==null,onClick:o(()=>{p(a-1),h(null)},"onClick"),children:(0,t.jsx)(c.IconChevronLeftOutline14,{})}),(0,t.jsxs)("span",{className:n.progress,children:[a+1," / ",r.length]}),(0,t.jsx)("button",{type:"button",className:n.iconButton,"aria-label":s("nav.next"),disabled:a===r.length-1||m!==null,onClick:o(()=>{p(a+1),h(null)},"onClick"),children:(0,t.jsx)(c.IconChevronRightOutline14,{})})]}),(0,t.jsx)("div",{className:n.feedback,role:"status",children:w===null?null:"key"in w?s(w.key):w.text}),(0,t.jsxs)("div",{className:n.footerActions,children:[(0,t.jsx)(c.Button,{variant:"outline",disabled:m!==null,onClick:le,children:s("action.skip")}),(0,t.jsx)(c.Button,{variant:"primary",disabled:m!==null||!N(q),onClick:T,children:m==="answer"?s("submitting"):a===r.length-1?s("submit"):s("action.next")})]})]})]})]})})}o(Y,"QuestionFlow");const Z={"error.incomplete":"请先完成这道问题。","error.unanswered":"请选择一个选项或填写自定义答案。","nav.prev":"上一题","nav.next":"下一题","nav.minimize":"收起问题卡片","nav.maximize":"展开问题卡片","nav.cancel":"放弃整组问题","option.recommended":"推荐","custom.placeholder":"输入你的答案","action.skip":"跳过本题","action.next":"下一题","plan.header":"计划待审","plan.approve":"确认执行","plan.decline":"拒绝","plan.discuss":"去聊天里说"},ee={"error.incomplete":"Please complete this question first.","error.unanswered":"Please select an option or enter a custom answer.","nav.prev":"Previous question","nav.next":"Next question","nav.minimize":"Collapse the question card","nav.maximize":"Expand the question card","nav.cancel":"Dismiss all questions","option.recommended":"Recommended","custom.placeholder":"Type your answer","action.skip":"Skip this question","action.next":"Next","plan.header":"Plan review","plan.approve":"Approve","plan.decline":"Refuse","plan.discuss":"Chat about it"},P="question",te=["slots","locale"];function se({interactions:e}){return e.find(s=>s.kind==="question")??null}o(se,"selectQuestion");function ie(e){e.effect(()=>e.locale.register(P,{zh:Z,en:ee}),"ui-user-questions: dictionaries"),e.slots.inject("conversation.composer",()=>e.slots.register({name:"conversation.composer",select:se,locale:P},X))}return o(ie,"apply"),j.PendingQuestion=B,j.apply=ie,j.inject=te,K.exports},"factory")});
@@ -1 +1 @@
1
- {"name":"@deepseek-ai/dsh-client-ui-user-questions","version":"0.0.15","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./client":{"types":"./lib/types/client/index.d.ts","default":"./lib/client.js"},"./src/*":"./src/*","./package.json":"./package.json"},"dsh":{"client":{"inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-conversation"],"platform":"web"}},"license":"MIT","dependencies":{"clsx":"^2.0.0","react":"^18.2.0","@deepseek-ai/dsh-client-ui-conversation":"^0.0.15","@deepseek-ai/dsh-client-connection":"^0.0.15","@deepseek-ai/dsh-client-ui-primitives":"^0.0.15","@deepseek-ai/dsh-client-runtime":"^0.0.15","@deepseek-ai/dsh-client-ui-slots":"^0.0.15"},"peerDependencies":{"@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-client-locale":"^0.0.15","@deepseek-ai/dsh-invariants":"^0.0.15","@deepseek-ai/dsh-api-remotes":"^0.0.15"}}
1
+ {"name":"@deepseek-ai/dsh-client-ui-user-questions","version":"0.1.0","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./client":{"types":"./lib/types/client/index.d.ts","default":"./lib/client.js"},"./src/*":"./src/*","./package.json":"./package.json"},"dsh":{"client":{"inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-conversation"],"platform":"web"}},"license":"MIT","dependencies":{"clsx":"^2.0.0","react":"^18.2.0","@deepseek-ai/dsh-client-connection":"^0.1.0","@deepseek-ai/dsh-client-ui-primitives":"^0.1.0","@deepseek-ai/dsh-client-runtime":"^0.1.0","@deepseek-ai/dsh-client-ui-slots":"^0.1.0","@deepseek-ai/dsh-client-ui-conversation":"^0.1.0"},"peerDependencies":{"@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-invariants":"^0.1.0","@deepseek-ai/dsh-client-locale":"^0.1.0","@deepseek-ai/dsh-api-remotes":"^0.1.0"}}
@@ -1 +1 @@
1
- var V=Object.defineProperty;var s=(p,f)=>V(p,"name",{value:f,configurable:!0});window.__ModuleLoader__.load({id:"@deepseek-ai/dsh-client-ui-workflow-run",factory:s(p=>{var f={exports:{}},w=f.exports;Object.defineProperty(w,Symbol.toStringTag,{value:"Module"});let n=p("react/jsx-runtime"),Q=p("react"),c=p("@deepseek-ai/dsh-client-ui-primitives"),k=p("@deepseek-ai/dsh-client-runtime/client");const j="._23AQmG_root{width:100%;min-width:0}._23AQmG_runHeader{box-sizing:border-box;background:var(--dsw-alias-bg-module-platform);border-radius:8px;align-items:center;gap:6px;width:100%;min-width:0;height:32px;padding:0 8px;display:flex}._23AQmG_runHeader:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}._23AQmG_runLeading{width:16px;height:16px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;margin-right:0;display:inline-flex}._23AQmG_runTitle{max-width:42%;color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;flex:none;font-size:14px;font-weight:510;line-height:24px;overflow:hidden}._23AQmG_runSummary{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:12px;line-height:18px;overflow:hidden}._23AQmG_statusTail{height:20px;color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none;align-items:center;gap:4px;font-size:11px;font-weight:510;line-height:16px;display:inline-flex;overflow:hidden}._23AQmG_phaseHeader{box-sizing:border-box;align-items:center;gap:6px;width:100%;min-width:0;height:32px;display:flex}._23AQmG_phaseHeader:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px;border-radius:4px}._23AQmG_phaseLeading{width:16px;height:16px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;margin-right:0;display:inline-flex}._23AQmG_phaseTitle{min-width:0;max-width:42%;color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;flex:0 auto;font-size:14px;line-height:24px;overflow:hidden}._23AQmG_phaseCount{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px;line-height:20px;overflow:hidden}._23AQmG_phaseStatus{width:132px;color:var(--dsw-alias-label-secondary);text-align:right;text-overflow:ellipsis;white-space:nowrap;flex:none;font-size:13px;line-height:20px;overflow:hidden}._23AQmG_separator{background:var(--dsw-alias-label-tertiary);border-radius:50%;flex:none;width:2px;height:2px}._23AQmG_phaseList{flex-direction:column;gap:4px;min-width:0;padding:4px 0 0 16px;display:flex}._23AQmG_phase{min-width:0}._23AQmG_members{flex-direction:column;gap:2px;min-width:0;padding:0 0 0 16px;display:flex}._23AQmG_memberRow,._23AQmG_memberButton{width:100%;min-width:0;min-height:24px;color:var(--dsw-alias-label-secondary);font:inherit;text-align:left;background:0 0;border:0;border-radius:4px;align-items:center;gap:12px;padding:0;display:flex}._23AQmG_memberButton{cursor:pointer}._23AQmG_memberButton ._23AQmG_memberLabel{color:var(--dsw-alias-state-business-primary);text-underline-position:from-font;text-decoration:underline}._23AQmG_dotSlot{flex:none;justify-content:center;align-items:center;width:16px;height:24px;display:inline-flex;overflow:hidden}._23AQmG_memberButton:focus-visible{outline:none}._23AQmG_memberButton:focus-visible ._23AQmG_memberLabelWrap{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}._23AQmG_memberLabelWrap{border-radius:4px;flex:1;align-items:center;min-width:0;height:24px;padding:0 2px;display:flex;overflow:hidden}._23AQmG_memberLabel{min-width:0;color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:14px;line-height:24px;overflow:hidden}._23AQmG_memberStatus{width:64px;color:var(--dsw-alias-label-secondary);text-align:right;text-overflow:ellipsis;white-space:nowrap;flex:none;font-size:13px;line-height:20px;overflow:hidden}._23AQmG_empty{color:var(--dsw-alias-label-tertiary);padding:0;font-size:13px;line-height:20px}@media (width<=560px){._23AQmG_phaseList,._23AQmG_members{padding-left:12px}}",b="@deepseek-ai/dsh-client-ui-workflow-run/WorkflowRunPanel.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(b)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-workflow-run",e.dataset.pluginCss=b,e.textContent=j,document.head.appendChild(e)}var o={memberLabelWrap:"_23AQmG_memberLabelWrap",phaseTitle:"_23AQmG_phaseTitle",phaseList:"_23AQmG_phaseList",runHeader:"_23AQmG_runHeader",phase:"_23AQmG_phase",runTitle:"_23AQmG_runTitle",members:"_23AQmG_members",dotSlot:"_23AQmG_dotSlot",separator:"_23AQmG_separator",root:"_23AQmG_root",phaseCount:"_23AQmG_phaseCount",statusTail:"_23AQmG_statusTail",phaseHeader:"_23AQmG_phaseHeader",empty:"_23AQmG_empty",memberLabel:"_23AQmG_memberLabel",memberStatus:"_23AQmG_memberStatus",phaseStatus:"_23AQmG_phaseStatus",memberRow:"_23AQmG_memberRow",memberButton:"_23AQmG_memberButton",runLeading:"_23AQmG_runLeading",phaseLeading:"_23AQmG_phaseLeading",runSummary:"_23AQmG_runSummary"};const g={running:"status.running",completed:"status.completed",failed:"status.failed",cancelled:"status.cancelled",interrupted:"status.interrupted"};function x(e){switch(e){case"running":return"ongoing";case"completed":return"done";case"failed":return"error";case"cancelled":case"interrupted":return"warning";default:return e}}s(x,"dotState");function C(e,t){return e===null?t("phase.unassigned"):e===""?t("phase.empty"):e}s(C,"readablePhase");function S(e,t){return e===""?t("member.empty"):e}s(S,"readableMember");function _(e,t,a){return a(`statusCount.${e}`,{count:t})}s(_,"statusCount");function y(e,t){return t(e===1?"run.members.one":"run.members.other",{count:e})}s(y,"memberCount");function v(e){return e.members.some(t=>t.status!=="completed")}s(v,"phaseRequiresExpansion");const N=s(()=>{},"forcedOpenToggle");function R(e){const[t,a]=(0,Q.useState)(!1);return(0,n.jsx)(c.DisclosureRow,{...e,open:t,expandable:!0,onToggle:s(()=>{a(i=>!i)},"onToggle")})}s(R,"ManualDisclosure");function A({cleanCycleKey:e,requiresExpansion:t,...a}){return t?(0,n.jsx)(c.DisclosureRow,{...a,open:!0,expandable:!1,onToggle:N}):(0,n.jsx)(R,{...a},e)}s(A,"StatusDisclosure");function L(e,t){const a=new Map;for(const l of e)a.set(l.status,(a.get(l.status)??0)+1);const i=s(l=>a.get(l)??0,"count"),r=["running","failed","cancelled","interrupted"].filter(l=>i(l)>0);return r.length===0?_("completed",i("completed"),t):(r.includes("interrupted")&&i("completed")>0?["completed",...r]:r).map(l=>_(l,i(l),t)).join(" · ")}s(L,"phaseStatusSummary");function I(e,t,a){const i=new Set(e.ids),r=[];for(const l of t)for(const u of l.members){const d=e.byId[u.childId];u.status==="running"&&i.has(u.childId)&&d?.origin==="subagent"&&d.parentId===a&&d.running&&r.push(u.childId)}return r}s(I,"navigableMembers");function T({children:e,count:t,name:a,requiresExpansion:i,status:r,t:l}){return(0,n.jsx)(A,{icon:(0,n.jsx)(c.IconChevronRightOutline14,{}),title:l("run.title",{name:a}),requiresExpansion:i,expandOnRowClick:!0,previewChevron:!1,keepContentWhenOpen:!0,rowClassName:o.runHeader,leadingClassName:o.runLeading,titleClassName:o.runTitle,collapsedContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:o.separator,"aria-hidden":!0}),(0,n.jsx)("span",{className:o.runSummary,children:y(t,l)}),(0,n.jsxs)("span",{className:o.statusTail,"data-status":r,children:[(0,n.jsx)(c.StateDot,{state:x(r)}),(0,n.jsx)("span",{children:l(g[r])})]})]}),children:e})}s(T,"RunHeader");function q({member:e,navigable:t,openSession:a,t:i}){const r=S(e.label,i),l=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:o.dotSlot,children:(0,n.jsx)(c.StateDot,{state:x(e.status)})}),(0,n.jsx)("span",{className:o.memberLabelWrap,"data-member-label-wrap":!0,children:(0,n.jsx)("span",{className:o.memberLabel,"data-member-label":!0,children:r})}),(0,n.jsx)("span",{className:o.memberStatus,"data-member-status-text":!0,children:i(g[e.status])})]});return t?(0,n.jsx)("button",{type:"button",className:o.memberButton,"data-member-status":e.status,"aria-label":i("member.open",{name:r}),onClick:s(()=>{a(e.childId)},"onClick"),children:l}):(0,n.jsx)("div",{className:o.memberRow,"data-member-status":e.status,children:l})}s(q,"MemberRow");function z({phase:e,navigable:t,openSession:a,t:i}){return(0,n.jsx)(A,{icon:(0,n.jsx)(c.IconChevronRightOutline14,{}),title:C(e.phase,i),cleanCycleKey:e.members.length,requiresExpansion:v(e),expandOnRowClick:!0,previewChevron:!1,keepContentWhenOpen:!0,className:o.phase,rowClassName:o.phaseHeader,leadingClassName:o.phaseLeading,titleClassName:o.phaseTitle,collapsedContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:o.separator,"aria-hidden":!0}),(0,n.jsx)("span",{className:o.phaseCount,"data-phase-count":!0,children:y(e.members.length,i)}),(0,n.jsx)("span",{className:o.phaseStatus,"data-phase-status-text":!0,children:L(e.members,i)})]}),children:(0,n.jsx)("div",{className:o.members,children:e.members.map(r=>(0,n.jsx)(q,{member:r,navigable:t.includes(r.childId),openSession:a,t:i},r.seq))})})}s(z,"PhaseSection");function E({node:e,sessionId:t,useSessions:a,openSession:i,t:r}){const l=e.data.phases.reduce((m,h)=>m+h.members.length,0),u=e.data.status!=="completed"||e.data.phases.some(v),d=a(m=>I(m,e.data.phases,t),k.shallowEqual);return(0,n.jsx)("section",{className:o.root,"data-workflow-run":!0,"data-run-status":e.data.status,children:(0,n.jsx)(T,{count:l,name:e.data.name,requiresExpansion:u,status:e.data.status,t:r,children:(0,n.jsx)("div",{className:o.phaseList,children:e.data.phases.length===0?(0,n.jsx)("span",{className:o.empty,children:r("run.empty")}):e.data.phases.map(m=>(0,n.jsx)(z,{phase:m,navigable:d,openSession:i,t:r},m.key))})})})}s(E,"WorkflowRunPanel");const G="workflowRun",O={"run.title":"{name}","run.members.one":"{count} 个成员","run.members.other":"{count} 个成员","run.empty":"没有启动成员","phase.unassigned":"未分阶段","phase.empty":"空阶段名","statusCount.running":"运行中 {count}","statusCount.completed":"已完成 {count}","statusCount.failed":"失败 {count}","statusCount.cancelled":"已取消 {count}","statusCount.interrupted":"已中断 {count}","member.empty":"空成员名","member.open":"打开 {name}","status.running":"运行中","status.completed":"已完成","status.failed":"失败","status.cancelled":"已取消","status.interrupted":"已中断"},H={"run.title":"{name}","run.members.one":"{count} member","run.members.other":"{count} members","run.empty":"No members started","phase.unassigned":"Unphased","phase.empty":"Empty phase name","statusCount.running":"Running {count}","statusCount.completed":"Completed {count}","statusCount.failed":"Failed {count}","statusCount.cancelled":"Cancelled {count}","statusCount.interrupted":"Interrupted {count}","member.empty":"Empty member name","member.open":"Open {name}","status.running":"Running","status.completed":"Completed","status.failed":"Failed","status.cancelled":"Cancelled","status.interrupted":"Interrupted"};function W(e){return e===null?"missing":`value:${e.length}:${e}`}s(W,"workflowPhaseKey");function M(e){switch(e){case"completed":return"completed";case"cancelled":return"cancelled";case"error":return"failed";default:return e}}s(M,"statusFromStopReason");function B(e){switch(e){case"completed":return"completed";case"cancelled":return"cancelled";case"failed":return"failed";default:return e}}s(B,"statusFromOutcome");function P(e){return e.kind==="step"?e.step.status==="closed"||e.turn.status==="closed":e.kind==="turn"&&e.turn.status==="closed"}s(P,"locationClosed");function D(e,t){const a=e.state,i=a.stopReason===void 0&&P(t),r=new Map;for(const u of a.members){const d=u.phase===void 0?null:u.phase,m=W(d);let h=r.get(m);h===void 0&&(h={phase:d,members:[]},r.set(m,h)),h.members.push({seq:u.seq,label:u.label,childId:u.childId,status:u.outcome===void 0?i?"interrupted":"running":B(u.outcome)})}const l=[...r].map(([u,d])=>({key:u,phase:d.phase,members:d.members}));return{name:a.name,status:a.stopReason===void 0?i?"interrupted":"running":M(a.stopReason),phases:l}}s(D,"projectWorkflow");function F(e,t){const a={seq:t.seq,label:t.label,...t.phase===void 0?{}:{phase:t.phase},childId:t.childId};return{...e,members:[...e.members,a]}}s(F,"updateAgentStart");function K(e,t){return{...e,members:e.members.map(a=>a.seq===t.seq?{...a,outcome:t.outcome}:a)}}s(K,"updateAgentEnd");const $={kind:"workflow-run",target:"chat",match:s(e=>e.type==="tool-workflow/run-start"?{id:String(e.data.runId),role:"start"}:e.type==="tool-workflow/agent-start"||e.type==="tool-workflow/agent-end"||e.type==="tool-workflow/run-end"?{id:String(e.data.runId),role:"update"}:null,"match"),start:s((e,t)=>{if(t.event.type!=="tool-workflow/run-start")throw new Error("workflow-run start requires tool-workflow/run-start");return{name:t.event.data.name,members:[]}},"start"),update:s((e,t)=>t.event.type==="tool-workflow/agent-start"?F(e.state,t.event.data):t.event.type==="tool-workflow/agent-end"?K(e.state,t.event.data):t.event.type==="tool-workflow/run-end"?{...e.state,stopReason:t.event.data.stopReason}:e.state,"update"),buildViewNode:s(e=>{if(e.start===void 0)return null;const t=D(e,e.start.location);return{key:e.key,kind:"workflow-run",id:e.id,target:"chat",anchorSeq:e.start.event.seq,location:e.start.location,visibility:"visible",data:t}},"buildViewNode")},U=["conversationEvents","slots","sessions","locale"];function J(e){e.conversationEvents.register($),e.effect(()=>e.locale.register(G,{zh:O,en:H}),"ui-workflow-run: dictionaries"),e.slots.inject("conversation.chat.node",()=>e.slots.register({name:"conversation.chat.node",key:"workflow-run",locale:G,inject:s(()=>({openSession:s(t=>{e.sessions.open(t)},"openSession")}),"inject")},E))}return s(J,"apply"),w.apply=J,w.inject=U,f.exports},"factory")});
1
+ var J=Object.defineProperty;var s=(c,f)=>J(c,"name",{value:f,configurable:!0});window.__ModuleLoader__.load({id:"@deepseek-ai/dsh-client-ui-workflow-run",factory:s(c=>{var f={exports:{}},w=f.exports;Object.defineProperty(w,Symbol.toStringTag,{value:"Module"});let n=c("react/jsx-runtime"),X=c("react"),m=c("@deepseek-ai/dsh-client-ui-primitives"),Z=c("@deepseek-ai/dsh-client-runtime/client");const k=".sEZnXG_root{width:100%;min-width:0}.sEZnXG_runHeader{box-sizing:border-box;background:var(--dsw-alias-bg-module-platform);border-radius:8px;align-items:center;gap:6px;width:100%;min-width:0;height:32px;padding:0 8px;display:flex}.sEZnXG_runHeader:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}.sEZnXG_runLeading{width:16px;height:16px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;margin-right:0;display:inline-flex}.sEZnXG_runTitle{max-width:42%;color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;flex:none;font-size:14px;font-weight:510;line-height:24px;overflow:hidden}.sEZnXG_runSummary{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:12px;line-height:18px;overflow:hidden}.sEZnXG_statusTail{height:20px;color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none;align-items:center;gap:4px;font-size:11px;font-weight:510;line-height:16px;display:inline-flex;overflow:hidden}.sEZnXG_phaseHeader{box-sizing:border-box;align-items:center;gap:6px;width:100%;min-width:0;height:32px;display:flex}.sEZnXG_phaseHeader:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px;border-radius:4px}.sEZnXG_phaseLeading{width:16px;height:16px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;margin-right:0;display:inline-flex}.sEZnXG_phaseTitle{min-width:0;max-width:42%;color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;flex:0 auto;font-size:14px;line-height:24px;overflow:hidden}.sEZnXG_phaseCount{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px;line-height:20px;overflow:hidden}.sEZnXG_phaseStatus{width:132px;color:var(--dsw-alias-label-secondary);text-align:right;text-overflow:ellipsis;white-space:nowrap;flex:none;font-size:13px;line-height:20px;overflow:hidden}.sEZnXG_separator{background:var(--dsw-alias-label-tertiary);border-radius:50%;flex:none;width:2px;height:2px}.sEZnXG_phaseList{flex-direction:column;gap:4px;min-width:0;padding:4px 0 0 16px;display:flex}.sEZnXG_phase{min-width:0}.sEZnXG_members{flex-direction:column;gap:2px;min-width:0;padding:0 0 0 16px;display:flex}.sEZnXG_memberRow,.sEZnXG_memberButton{width:100%;min-width:0;min-height:24px;color:var(--dsw-alias-label-secondary);font:inherit;text-align:left;background:0 0;border:0;border-radius:4px;align-items:center;gap:12px;padding:0;display:flex}.sEZnXG_memberButton{cursor:pointer}.sEZnXG_memberButton .sEZnXG_memberLabel{color:var(--dsw-alias-state-business-primary);text-underline-position:from-font;text-decoration:underline}.sEZnXG_dotSlot{flex:none;justify-content:center;align-items:center;width:16px;height:24px;display:inline-flex;overflow:hidden}.sEZnXG_memberButton:focus-visible{outline:none}.sEZnXG_memberButton:focus-visible .sEZnXG_memberLabelWrap{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}.sEZnXG_memberLabelWrap{border-radius:4px;flex:1;align-items:center;min-width:0;height:24px;padding:0 2px;display:flex;overflow:hidden}.sEZnXG_memberLabel{min-width:0;color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:14px;line-height:24px;overflow:hidden}.sEZnXG_memberStatus{width:64px;color:var(--dsw-alias-label-secondary);text-align:right;text-overflow:ellipsis;white-space:nowrap;flex:none;font-size:13px;line-height:20px;overflow:hidden}.sEZnXG_empty{color:var(--dsw-alias-label-tertiary);padding:0;font-size:13px;line-height:20px}@media (width<=560px){.sEZnXG_phaseList,.sEZnXG_members{padding-left:12px}}",b="@deepseek-ai/dsh-client-ui-workflow-run/WorkflowRunPanel.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(b)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-workflow-run",e.dataset.pluginCss=b,e.textContent=k,document.head.appendChild(e)}var o={runSummary:"sEZnXG_runSummary",phaseTitle:"sEZnXG_phaseTitle",phaseList:"sEZnXG_phaseList",phase:"sEZnXG_phase",memberRow:"sEZnXG_memberRow",dotSlot:"sEZnXG_dotSlot",runHeader:"sEZnXG_runHeader",memberLabel:"sEZnXG_memberLabel",statusTail:"sEZnXG_statusTail",root:"sEZnXG_root",phaseCount:"sEZnXG_phaseCount",memberButton:"sEZnXG_memberButton",runTitle:"sEZnXG_runTitle",separator:"sEZnXG_separator",runLeading:"sEZnXG_runLeading",members:"sEZnXG_members",phaseLeading:"sEZnXG_phaseLeading",memberLabelWrap:"sEZnXG_memberLabelWrap",memberStatus:"sEZnXG_memberStatus",phaseStatus:"sEZnXG_phaseStatus",empty:"sEZnXG_empty",phaseHeader:"sEZnXG_phaseHeader"};const g={running:"status.running",completed:"status.completed",failed:"status.failed",cancelled:"status.cancelled",interrupted:"status.interrupted"};function x(e){switch(e){case"running":return"ongoing";case"completed":return"done";case"failed":return"error";case"cancelled":case"interrupted":return"warning";default:return e}}s(x,"dotState");function j(e,t){return e===null?t("phase.unassigned"):e===""?t("phase.empty"):e}s(j,"readablePhase");function C(e,t){return e===""?t("member.empty"):e}s(C,"readableMember");function y(e,t,a){return a(`statusCount.${e}`,{count:t})}s(y,"statusCount");function v(e,t){return t(e===1?"run.members.one":"run.members.other",{count:e})}s(v,"memberCount");function _(e){return e.members.some(t=>t.status!=="completed")}s(_,"phaseRequiresExpansion");const S=s(()=>{},"forcedOpenToggle");function N(e){const[t,a]=(0,X.useState)(!1);return(0,n.jsx)(m.DisclosureRow,{...e,open:t,expandable:!0,onToggle:s(()=>{a(i=>!i)},"onToggle")})}s(N,"ManualDisclosure");function E({cleanCycleKey:e,requiresExpansion:t,...a}){return t?(0,n.jsx)(m.DisclosureRow,{...a,open:!0,expandable:!1,onToggle:S}):(0,n.jsx)(N,{...a},e)}s(E,"StatusDisclosure");function R(e,t){const a=new Map;for(const l of e)a.set(l.status,(a.get(l.status)??0)+1);const i=s(l=>a.get(l)??0,"count"),r=["running","failed","cancelled","interrupted"].filter(l=>i(l)>0);return r.length===0?y("completed",i("completed"),t):(r.includes("interrupted")&&i("completed")>0?["completed",...r]:r).map(l=>y(l,i(l),t)).join(" · ")}s(R,"phaseStatusSummary");function L(e,t,a){const i=new Set(e.ids),r=[];for(const l of t)for(const u of l.members){const d=e.byId[u.childId];u.status==="running"&&i.has(u.childId)&&d?.origin==="subagent"&&d.parentId===a&&d.running&&r.push(u.childId)}return r}s(L,"navigableMembers");function I({children:e,count:t,name:a,requiresExpansion:i,status:r,t:l}){return(0,n.jsx)(E,{icon:(0,n.jsx)(m.IconChevronRightOutline14,{}),title:l("run.title",{name:a}),requiresExpansion:i,expandOnRowClick:!0,previewChevron:!1,keepContentWhenOpen:!0,rowClassName:o.runHeader,leadingClassName:o.runLeading,titleClassName:o.runTitle,collapsedContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:o.separator,"aria-hidden":!0}),(0,n.jsx)("span",{className:o.runSummary,children:v(t,l)}),(0,n.jsxs)("span",{className:o.statusTail,"data-status":r,children:[(0,n.jsx)(m.StateDot,{state:x(r)}),(0,n.jsx)("span",{children:l(g[r])})]})]}),children:e})}s(I,"RunHeader");function T({member:e,navigable:t,openSession:a,t:i}){const r=C(e.label,i),l=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:o.dotSlot,children:(0,n.jsx)(m.StateDot,{state:x(e.status)})}),(0,n.jsx)("span",{className:o.memberLabelWrap,"data-member-label-wrap":!0,children:(0,n.jsx)("span",{className:o.memberLabel,"data-member-label":!0,children:r})}),(0,n.jsx)("span",{className:o.memberStatus,"data-member-status-text":!0,children:i(g[e.status])})]});return t?(0,n.jsx)("button",{type:"button",className:o.memberButton,"data-member-status":e.status,"aria-label":i("member.open",{name:r}),onClick:s(()=>{a(e.childId)},"onClick"),children:l}):(0,n.jsx)("div",{className:o.memberRow,"data-member-status":e.status,children:l})}s(T,"MemberRow");function q({phase:e,navigable:t,openSession:a,t:i}){return(0,n.jsx)(E,{icon:(0,n.jsx)(m.IconChevronRightOutline14,{}),title:j(e.phase,i),cleanCycleKey:e.members.length,requiresExpansion:_(e),expandOnRowClick:!0,previewChevron:!1,keepContentWhenOpen:!0,className:o.phase,rowClassName:o.phaseHeader,leadingClassName:o.phaseLeading,titleClassName:o.phaseTitle,collapsedContent:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:o.separator,"aria-hidden":!0}),(0,n.jsx)("span",{className:o.phaseCount,"data-phase-count":!0,children:v(e.members.length,i)}),(0,n.jsx)("span",{className:o.phaseStatus,"data-phase-status-text":!0,children:R(e.members,i)})]}),children:(0,n.jsx)("div",{className:o.members,children:e.members.map(r=>(0,n.jsx)(T,{member:r,navigable:t.includes(r.childId),openSession:a,t:i},r.seq))})})}s(q,"PhaseSection");function z({node:e,sessionId:t,useSessions:a,openSession:i,t:r}){const l=e.data.phases.reduce((p,h)=>p+h.members.length,0),u=e.data.status!=="completed"||e.data.phases.some(_),d=a(p=>L(p,e.data.phases,t),Z.shallowEqual);return(0,n.jsx)("section",{className:o.root,"data-workflow-run":!0,"data-run-status":e.data.status,children:(0,n.jsx)(I,{count:l,name:e.data.name,requiresExpansion:u,status:e.data.status,t:r,children:(0,n.jsx)("div",{className:o.phaseList,children:e.data.phases.length===0?(0,n.jsx)("span",{className:o.empty,children:r("run.empty")}):e.data.phases.map(p=>(0,n.jsx)(q,{phase:p,navigable:d,openSession:i,t:r},p.key))})})})}s(z,"WorkflowRunPanel");const G="workflowRun",O={"run.title":"{name}","run.members.one":"{count} 个成员","run.members.other":"{count} 个成员","run.empty":"没有启动成员","phase.unassigned":"未分阶段","phase.empty":"空阶段名","statusCount.running":"运行中 {count}","statusCount.completed":"已完成 {count}","statusCount.failed":"失败 {count}","statusCount.cancelled":"已取消 {count}","statusCount.interrupted":"已中断 {count}","member.empty":"空成员名","member.open":"打开 {name}","status.running":"运行中","status.completed":"已完成","status.failed":"失败","status.cancelled":"已取消","status.interrupted":"已中断"},H={"run.title":"{name}","run.members.one":"{count} member","run.members.other":"{count} members","run.empty":"No members started","phase.unassigned":"Unphased","phase.empty":"Empty phase name","statusCount.running":"Running {count}","statusCount.completed":"Completed {count}","statusCount.failed":"Failed {count}","statusCount.cancelled":"Cancelled {count}","statusCount.interrupted":"Interrupted {count}","member.empty":"Empty member name","member.open":"Open {name}","status.running":"Running","status.completed":"Completed","status.failed":"Failed","status.cancelled":"Cancelled","status.interrupted":"Interrupted"};function W(e){return e===null?"missing":`value:${e.length}:${e}`}s(W,"workflowPhaseKey");function M(e){switch(e){case"completed":return"completed";case"cancelled":return"cancelled";case"error":return"failed";default:return e}}s(M,"statusFromStopReason");function B(e){switch(e){case"completed":return"completed";case"cancelled":return"cancelled";case"failed":return"failed";default:return e}}s(B,"statusFromOutcome");function P(e){return e.kind==="step"?e.step.status==="closed"||e.turn.status==="closed":e.kind==="turn"&&e.turn.status==="closed"}s(P,"locationClosed");function D(e,t){const a=e.state,i=a.stopReason===void 0&&P(t),r=new Map;for(const u of a.members){const d=u.phase===void 0?null:u.phase,p=W(d);let h=r.get(p);h===void 0&&(h={phase:d,members:[]},r.set(p,h)),h.members.push({seq:u.seq,label:u.label,childId:u.childId,status:u.outcome===void 0?i?"interrupted":"running":B(u.outcome)})}const l=[...r].map(([u,d])=>({key:u,phase:d.phase,members:d.members}));return{name:a.name,status:a.stopReason===void 0?i?"interrupted":"running":M(a.stopReason),phases:l}}s(D,"projectWorkflow");function F(e,t){const a={seq:t.seq,label:t.label,...t.phase===void 0?{}:{phase:t.phase},childId:t.childId};return{...e,members:[...e.members,a]}}s(F,"updateAgentStart");function A(e,t){return{...e,members:e.members.map(a=>a.seq===t.seq?{...a,outcome:t.outcome}:a)}}s(A,"updateAgentEnd");const K={kind:"workflow-run",target:"chat",match:s(e=>e.type==="tool-workflow/run-start"?{id:String(e.data.runId),role:"start"}:e.type==="tool-workflow/agent-start"||e.type==="tool-workflow/agent-end"||e.type==="tool-workflow/run-end"?{id:String(e.data.runId),role:"update"}:null,"match"),start:s((e,t)=>{if(t.event.type!=="tool-workflow/run-start")throw new Error("workflow-run start requires tool-workflow/run-start");return{name:t.event.data.name,members:[]}},"start"),update:s((e,t)=>t.event.type==="tool-workflow/agent-start"?F(e.state,t.event.data):t.event.type==="tool-workflow/agent-end"?A(e.state,t.event.data):t.event.type==="tool-workflow/run-end"?{...e.state,stopReason:t.event.data.stopReason}:e.state,"update"),buildViewNode:s(e=>{if(e.start===void 0)return null;const t=D(e,e.start.location);return{key:e.key,kind:"workflow-run",id:e.id,target:"chat",anchorSeq:e.start.event.seq,location:e.start.location,visibility:"visible",data:t}},"buildViewNode")},$=["conversationEvents","slots","sessions","locale"];function U(e){e.conversationEvents.register(K),e.effect(()=>e.locale.register(G,{zh:O,en:H}),"ui-workflow-run: dictionaries"),e.slots.inject("conversation.chat.node",()=>e.slots.register({name:"conversation.chat.node",key:"workflow-run",locale:G,inject:s(()=>({openSession:s(t=>{e.sessions.open(t)},"openSession")}),"inject")},z))}return s(U,"apply"),w.apply=U,w.inject=$,f.exports},"factory")});
@@ -1 +1 @@
1
- {"name":"@deepseek-ai/dsh-client-ui-workflow-run","version":"0.0.15","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./client":{"types":"./lib/types/client/index.d.ts","default":"./lib/client.js"},"./src/*":"./src/*","./package.json":"./package.json"},"dsh":{"client":{"inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation"],"platform":"web"}},"license":"MIT","dependencies":{"react":"^18.2.0"},"peerDependencies":{"@deepseek-ai/dsh-client-runtime":"^0.0.15","@deepseek-ai/dsh-client-ui-conversation":"^0.0.15","@deepseek-ai/dsh-invariants":"^0.0.15","@deepseek-ai/dsh-client-ui-slots":"^0.0.15","@deepseek-ai/dsh-client-locale":"^0.0.15","@deepseek-ai/dsh-tool-workflow":"^0.0.15","@deepseek-ai/dsh-client-ui-primitives":"^0.0.15","@deepseek-ai/dsh-session":"^0.0.15","@deepseek-ai/dsh-workflow":"^0.0.15","@deepseek-ai/cordis":"^4.0.1"}}
1
+ {"name":"@deepseek-ai/dsh-client-ui-workflow-run","version":"0.1.0","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./client":{"types":"./lib/types/client/index.d.ts","default":"./lib/client.js"},"./src/*":"./src/*","./package.json":"./package.json"},"dsh":{"client":{"inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation"],"platform":"web"}},"license":"MIT","dependencies":{"react":"^18.2.0"},"peerDependencies":{"@deepseek-ai/dsh-client-locale":"^0.1.0","@deepseek-ai/dsh-client-ui-conversation":"^0.1.0","@deepseek-ai/dsh-client-runtime":"^0.1.0","@deepseek-ai/dsh-client-ui-primitives":"^0.1.0","@deepseek-ai/dsh-session":"^0.1.0","@deepseek-ai/dsh-tool-workflow":"^0.1.0","@deepseek-ai/dsh-invariants":"^0.1.0","@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-workflow":"^0.1.0","@deepseek-ai/dsh-client-ui-slots":"^0.1.0"}}
@@ -1 +1 @@
1
- var Ks=Object.defineProperty;var s=(ae,fe)=>Ks(ae,"name",{value:fe,configurable:!0});window.__ModuleLoader__.load({id:"@deepseek-ai/dsh-client-ui-workspace",factory:s(ae=>{var fe={exports:{}},_e=fe.exports;Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"});let me=ae("@deepseek-ai/dsh-client-runtime/client"),n=ae("react/jsx-runtime"),h=ae("react"),x=ae("@deepseek-ai/dsh-client-ui-primitives");const ie="__flat_session_order__";function ws(){return(0,me.defineStore)({init:s(()=>({groupBy:"workspace",orderBy:"updated",groupExpansion:{},sessionOrderByAccount:{},sessionUpdatedAtByAccount:{}}),"init"),persist:"dsh.workspace.view.v5",actions:{setGroupBy:s((e,t)=>{e.groupBy=t},"setGroupBy"),setOrderBy:s((e,t)=>{e.orderBy=t},"setOrderBy"),setGroupExpanded:s((e,t,o)=>{e.groupExpansion[t]=o},"setGroupExpanded"),retainAccountKeys:s((e,t)=>{const o=new Set(t);e.groupExpansion=Object.fromEntries(Object.entries(e.groupExpansion).filter(([r])=>o.has(r))),e.sessionOrderByAccount=Object.fromEntries(Object.entries(e.sessionOrderByAccount).filter(([r])=>o.has(r))),e.sessionUpdatedAtByAccount=Object.fromEntries(Object.entries(e.sessionUpdatedAtByAccount).filter(([r])=>o.has(r)))},"retainAccountKeys"),syncSessionOrderAccount:s((e,t,o,r)=>{e.sessionOrderByAccount[t]=o,e.sessionUpdatedAtByAccount[t]=r},"syncSessionOrderAccount"),setSessionOrder:s((e,t,o)=>{e.sessionOrderByAccount[t]=o},"setSessionOrder")}})}s(ws,"createWorkspaceViewStore");function Ee(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(o=Ee(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}s(Ee,"r");function M(){for(var e,t,o=0,r="",i=arguments.length;o<i;o++)(e=arguments[o])&&(t=Ee(e))&&(r&&(r+=" "),r+=t);return r}s(M,"clsx");const Be="Ungrouped";function bs(e){if(e===void 0||e==="")return Be;const t=e.replace(/[/\\]+$/,"").split(/[/\\]/).pop();return t!==void 0&&t!==""?t:e}s(bs,"workspaceLabel");function we(e,t){return t.updatedAt!==e.updatedAt?t.updatedAt-e.updatedAt:e.id<t.id?-1:1}s(we,"byRecency");function ce(e,t,o){return e.origin!=="subagent"&&!o.has(e.id)&&(!e.blank||e.id===t)}s(ce,"sessionVisible");function ke(e){return e.blank?"New Session":e.displayTitle}s(ke,"sessionTitle");function Oe(e,t,o,r,i,l,d){const a=[...l];return d==="recency"&&a.sort(we),{key:e,workspaceId:t,cwd:o,createdAt:r,label:i,sessions:a}}s(Oe,"buildGroup");function gs(e,t){const o=new Map(e.map(l=>[l.id,l])),r=new Set,i=[];for(const l of t){const d=o.get(l);d===void 0||r.has(l)||(i.push(d),r.add(l))}for(const l of[...e].sort(we))r.has(l.id)||i.push(l);return i}s(gs,"orderedUngrouped");function xs(e,t,o,r){const i=[],l=new Set;for(const a of t){const g=[];for(const u of a.sessionIds){const b=e.byId[u];b!==void 0&&(l.add(u),ce(b,e.current,o)&&g.push(b))}i.push(Oe(a.workspaceId,a.workspaceId,a.path,Date.parse(a.createdAt),a.title,g,"account"))}const d=e.ids.map(a=>e.byId[a]).filter(a=>a!==void 0&&!l.has(a.id)&&ce(a,e.current,o));return d.length>0&&i.push(Oe("",void 0,void 0,void 0,Be,r===void 0?d:gs(d,r),r===void 0?"recency":"account")),i}s(xs,"groupByWorkspace");function Ce(e,t){return{id:e.id,title:ke(e),blank:e.blank,running:e.running,runningSubagentCount:t.get(e.id)?.runningCount??0,completed:e.completed===!0,updatedAt:e.updatedAt,...e.pendingInteraction===void 0?{}:{pendingInteraction:e.pendingInteraction}}}s(Ce,"sessionNode");function vs(e,t,o,r){const i=new Set(o),l=new Set(r.expandedGroups),d=(0,me.indexSubagentDescendants)(e.byId),a=e.current===void 0?void 0:t.find(u=>u.sessionIds.includes(e.current))?.workspaceId??"",g=[];for(const u of xs(e,t,i,r.ungroupedOrder)){const b=l.has(u.key);g.push({key:u.key,workspaceId:u.workspaceId,cwd:u.cwd,createdAt:u.createdAt,label:u.label,sessionCount:u.sessions.length,expanded:b,containsCurrent:u.key===a,sessions:b?u.sessions.map(y=>Ce(y,d)):[]})}return g}s(vs,"deriveGroups");function ys(e,t){const o=new Set(t),r=(0,me.indexSubagentDescendants)(e.byId),i=[];for(const l of e.ids){const d=e.byId[l];d===void 0||!ce(d,e.current,o)||i.push(d)}return i.sort(we),i.map(l=>Ce(l,r))}s(ys,"deriveFlat");function _s(e,t,o,r,i,l){const d=o.trim().toLowerCase();if(d==="")return{items:[],hasMore:!1};const a=new Set(r),g=(0,me.indexSubagentDescendants)(e.byId),u=new Map;for(const w of t)for(const q of w.sessionIds)u.has(q)||u.set(q,w.title);const b=s(w=>u.get(w.id)??bs(w.cwd),"labelOf"),y=new Map;for(const w of i.items)y.has(w.sessionId)||y.set(w.sessionId,w);const _=[];for(const w of e.ids){const q=e.byId[w];q===void 0||q.blank||!ce(q,e.current,a)||(ke(q).toLowerCase().includes(d)||b(q).toLowerCase().includes(d))&&_.push(q)}_.sort(we);const k=[],B=new Set,V=s(w=>{B.has(w.id)||(B.add(w.id),k.push(w))},"include");for(const w of _)V(w);for(const w of i.items){const q=e.byId[w.sessionId];q!==void 0&&!q.blank&&ce(q,e.current,a)&&V(q)}return{items:k.slice(0,l).map(w=>{const q=y.get(w.id);return{id:w.id,title:ke(w),workspace:b(w),running:w.running,runningSubagentCount:g.get(w.id)?.runningCount??0,...w.pendingInteraction===void 0?{}:{pendingInteraction:w.pendingInteraction},completed:w.completed===!0,...q===void 0?{}:{snippet:q.snippet}}}),hasMore:i.hasMore||k.length>l}}s(_s,"deriveSearchResults");function Te(e,t){const l=Math.max(0,t-e);return l<6e4?{unit:"now",n:0}:l<36e5?{unit:"minutes",n:Math.floor(l/6e4)}:l<864e5?{unit:"hours",n:Math.floor(l/36e5)}:l<30*864e5?{unit:"days",n:Math.floor(l/864e5)}:l<365*864e5?{unit:"months",n:Math.floor(l/(30*864e5))}:{unit:"years",n:Math.floor(l/(365*864e5))}}s(Te,"relativeTime");const ks='.wDdVUq_projectRow,.wDdVUq_sessionRow{cursor:pointer;user-select:none;color:var(--dsw-alias-label-primary);border-radius:8px;align-items:center;gap:6px;padding:0 8px;display:flex}.wDdVUq_projectRow:hover,.wDdVUq_sessionRow:hover,.wDdVUq_sessionRow.wDdVUq_selected{background:var(--dsw-alias-interactive-bg-hover)}.wDdVUq_searchResultRow{box-sizing:border-box;cursor:pointer;text-align:left;width:100%;min-height:48px;color:var(--dsw-alias-label-primary);background:0 0;border:none;border-radius:8px;flex-direction:column;align-items:stretch;padding:4px 8px;display:flex}.wDdVUq_searchResultRow:hover,.wDdVUq_searchResultRow.wDdVUq_selected{background:var(--dsw-alias-interactive-bg-hover)}.wDdVUq_searchResultHeading{align-items:center;min-width:0;display:flex}.wDdVUq_searchResultTitle{text-overflow:ellipsis;white-space:nowrap;min-width:0;margin-left:4px;font-size:14px;line-height:20px;overflow:hidden}.wDdVUq_searchResultMeta{align-items:center;gap:6px;min-width:0;margin-left:20px;display:flex}.wDdVUq_searchResultWorkspace,.wDdVUq_searchResultSnippet{text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:17px;overflow:hidden}.wDdVUq_searchResultWorkspace{max-width:40%;color:var(--dsw-alias-label-tertiary);flex:none}.wDdVUq_searchResultSnippet{min-width:0;color:var(--dsw-alias-label-secondary);flex:1}.wDdVUq_projectRow{box-sizing:border-box;align-items:center;height:34px}.wDdVUq_projectRow .wDdVUq_rowActions{height:20px}.wDdVUq_sessionRow{height:32px;animation:wDdVUq_row-in .15s var(--ds-ease-in-out);gap:0}.wDdVUq_sessionRow .wDdVUq_title{margin:0 6px 0 4px}.wDdVUq_flatSessionRowWithoutStatus .wDdVUq_title{margin-left:0}@keyframes wDdVUq_row-in{0%{opacity:0}}.wDdVUq_slot{width:16px;height:20px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;display:inline-flex}.wDdVUq_visuallyHidden{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.wDdVUq_folderActive{color:var(--dsw-alias-state-business-primary)}.wDdVUq_projectRow .wDdVUq_chevron{display:none}.wDdVUq_projectRow:hover .wDdVUq_chevron{display:inline-flex}.wDdVUq_projectRow:hover .wDdVUq_folder{display:none}.wDdVUq_arrow{transition:transform .15s var(--ds-ease-in-out)}.wDdVUq_arrowOpen{transform:rotate(90deg)}.wDdVUq_projectText{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.wDdVUq_title{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:14px;line-height:20px;overflow:hidden}.wDdVUq_renameInput{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-button-elevated-fill);min-width:0;color:inherit;border-radius:4px;outline:none;padding:0 2px;font-size:14px;line-height:20px}.wDdVUq_sessionRow .wDdVUq_title{flex:1}.wDdVUq_meta{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px;overflow:hidden}.wDdVUq_time{color:var(--dsw-alias-label-tertiary);flex:none;font-size:12px;line-height:20px}.wDdVUq_dot{flex:none}.wDdVUq_rowActions{flex:none;align-items:center;gap:12px;display:none}.wDdVUq_projectRow:hover .wDdVUq_rowActions,.wDdVUq_sessionRow:hover .wDdVUq_rowActions,.wDdVUq_projectRow.wDdVUq_menuOpen .wDdVUq_rowActions,.wDdVUq_sessionRow.wDdVUq_menuOpen .wDdVUq_rowActions{display:inline-flex}.wDdVUq_sessionRow:hover .wDdVUq_time,.wDdVUq_sessionRow.wDdVUq_menuOpen .wDdVUq_time{display:none}.wDdVUq_projectRow.wDdVUq_menuOpen,.wDdVUq_sessionRow.wDdVUq_menuOpen{background:var(--dsw-alias-interactive-bg-hover)}.wDdVUq_sessionRow.wDdVUq_dropBefore,.wDdVUq_sessionRow.wDdVUq_dropAfter{position:relative}.wDdVUq_sessionRow.wDdVUq_dropBefore:before,.wDdVUq_sessionRow.wDdVUq_dropAfter:after{content:"";z-index:1;background:linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat, linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat, linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;pointer-events:none;height:12px;position:absolute;left:0;right:4px}.wDdVUq_sessionRow.wDdVUq_dropBefore:before{top:-7px}.wDdVUq_sessionRow.wDdVUq_dropAfter:after{bottom:-7px}.wDdVUq_hoverContent{flex-direction:column;gap:8px;display:flex}.wDdVUq_hoverTitle{color:#fff;overflow-wrap:break-word;font-size:14px;line-height:20px}.wDdVUq_hoverPath{color:#cfd3d6;word-break:break-all;font-size:12px;line-height:16px}.wDdVUq_hoverTime{color:#cfd3d6;font-size:12px;line-height:16px}.wDdVUq_hoverStatus{color:#adb2b8;align-items:center;gap:8px;font-size:12px;line-height:20px;display:flex}.wDdVUq_iconButton{cursor:pointer;width:16px;height:16px;color:var(--dsw-alias-label-tertiary);background:0 0;border:none;border-radius:4px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.wDdVUq_iconButton:hover{color:var(--dsw-alias-label-primary)}.wDdVUq_chevron{color:var(--dsw-alias-label-caption)}@media (prefers-reduced-motion:reduce){.wDdVUq_sessionRow,.wDdVUq_arrow{transition:none;animation:none}}',Me="@deepseek-ai/dsh-client-ui-workspace/Rows.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(Me)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-workspace",e.dataset.pluginCss=Me,e.textContent=ks,document.head.appendChild(e)}var v={time:"wDdVUq_time",arrow:"wDdVUq_arrow",hoverContent:"wDdVUq_hoverContent",hoverTitle:"wDdVUq_hoverTitle",flatSessionRowWithoutStatus:"wDdVUq_flatSessionRowWithoutStatus",renameInput:"wDdVUq_renameInput",searchResultRow:"wDdVUq_searchResultRow",searchResultHeading:"wDdVUq_searchResultHeading",title:"wDdVUq_title",slot:"wDdVUq_slot",dot:"wDdVUq_dot",hoverTime:"wDdVUq_hoverTime",projectText:"wDdVUq_projectText",searchResultMeta:"wDdVUq_searchResultMeta",folder:"wDdVUq_folder",searchResultSnippet:"wDdVUq_searchResultSnippet",hoverStatus:"wDdVUq_hoverStatus",searchResultTitle:"wDdVUq_searchResultTitle",sessionRow:"wDdVUq_sessionRow",selected:"wDdVUq_selected",projectRow:"wDdVUq_projectRow","row-in":"wDdVUq_row-in",dropBefore:"wDdVUq_dropBefore",menuOpen:"wDdVUq_menuOpen",dropAfter:"wDdVUq_dropAfter",rowActions:"wDdVUq_rowActions",chevron:"wDdVUq_chevron",folderActive:"wDdVUq_folderActive",hoverPath:"wDdVUq_hoverPath",searchResultWorkspace:"wDdVUq_searchResultWorkspace",visuallyHidden:"wDdVUq_visuallyHidden",meta:"wDdVUq_meta",arrowOpen:"wDdVUq_arrowOpen",iconButton:"wDdVUq_iconButton"};function We(e,t){return e.blank?t("session.new"):e.title}s(We,"displayTitle");function qs(e,t,o){const{unit:r,n:i}=Te(e,t);return r==="now"?o("time.now"):o(`time.${r}`,{n:i})}s(qs,"timeLabel");function Ns(e,t,o){const{unit:r,n:i}=Te(e,t);return r==="now"?o("time.now"):o("time.ago",{t:o(`time.${r}`,{n:i})})}s(Ns,"hoverTimeLabel");function Ss(e,t){const o=new Date(e),r=s(i=>String(i).padStart(2,"0"),"pad2");return t("hover.created",{time:`${t("date.ymd",{y:o.getFullYear(),m:o.getMonth()+1,d:o.getDate()})} ${r(o.getHours())}:${r(o.getMinutes())}`})}s(Ss,"createdLabel");function Ds({label:e,cwd:t,createdAt:o,t:r}){return(0,n.jsxs)("div",{className:v.hoverContent,children:[(0,n.jsx)("div",{className:v.hoverTitle,children:e}),(0,n.jsx)("div",{className:v.hoverPath,children:t}),(0,n.jsx)("div",{className:v.hoverTime,children:Ss(o,r)})]})}s(Ds,"WorkspaceHoverContent");function Fe(e){const t=e.currentTarget.getBoundingClientRect();return e.clientY<t.top+t.height/2?"before":"after"}s(Fe,"rowHalf");function js({group:e,onToggle:t,onCreate:o,actions:r,drag:i,t:l}){const d=e,a=d.workspaceId===void 0?l("group.ungrouped"):d.label,g=e.expanded&&e.containsCurrent,[u,b]=(0,h.useState)(!1),y=[{id:"rename",label:l("rename"),icon:(0,n.jsx)(x.IconEditOutline16,{})},{id:"delete",label:l("delete.workspace"),icon:(0,n.jsx)(x.IconTrashOutline16,{}),danger:!0}],_=(0,n.jsxs)("div",{className:M(v.projectRow,u&&v.menuOpen),role:"treeitem","aria-expanded":d.expanded,onClick:t,draggable:i!==void 0,onDragStart:i===void 0?void 0:k=>{k.dataTransfer.effectAllowed="move",k.dataTransfer.setData("text/plain",d.key),i.start()},onDragEnd:i?.end,children:[(0,n.jsx)("span",{className:M(v.slot,v.folder,g&&v.folderActive),children:d.expanded?(0,n.jsx)(x.IconFolderOpen16,{}):(0,n.jsx)(x.IconFolderClose16,{})}),(0,n.jsx)("span",{className:M(v.slot,v.chevron),children:(0,n.jsx)(x.IconTriangleRightFill14,{className:M(v.arrow,d.expanded&&v.arrowOpen)})}),(0,n.jsx)("span",{className:v.projectText,children:(0,n.jsx)("span",{className:v.title,children:a})}),(0,n.jsxs)("span",{className:v.rowActions,children:[r!==void 0&&(0,n.jsx)(x.Menu,{open:u,onClose:s(()=>{b(!1)},"onClose"),items:y,onSelect:s(k=>{b(!1),!(k!=="rename"&&k!=="delete")&&(k==="rename"?r.rename():r.delete())},"onSelect"),portal:!0,closeOnPointerLeave:!0,anchor:(0,n.jsx)("button",{type:"button",className:v.iconButton,"aria-label":l("actions.workspace.aria",{name:a}),onClick:s(k=>{k.stopPropagation(),b(B=>!B)},"onClick"),children:(0,n.jsx)(x.IconEllipsisOutline16,{})})}),(0,n.jsx)("button",{type:"button",className:v.iconButton,"aria-label":l("actions.newSession.aria",{name:a}),onClick:s(k=>{k.stopPropagation(),o()},"onClick"),children:(0,n.jsx)(x.IconPlusOutline16,{})})]})]});return d.createdAt===void 0?_:(0,n.jsx)(x.HoverCard,{anchor:_,content:(0,n.jsx)(Ds,{label:d.label,cwd:d.cwd,createdAt:d.createdAt,t:l}),disabled:u,copyText:d.cwd,copyLabel:l("copy"),copiedLabel:l("hover.copied")})}s(js,"ProjectRowItem");function Is(e){throw new Error(`unknown pending interaction: ${String(e)}`)}s(Is,"assertNever");function qe(e,t){const o=e.runningSubagentCount===0?void 0:{state:"ongoing",label:t(e.runningSubagentCount===1?"status.subagentsRunning.one":"status.subagentsRunning.other",{n:e.runningSubagentCount})};let r;switch(e.pendingInteraction){case"approval":r={state:"warning",label:t("status.waitingApproval")};break;case"plan-review":r={state:"warning",label:t("status.planReview")};break;case"question":r={state:"warning",label:t("status.waitingAnswer")};break;case void 0:break;default:return Is(e.pendingInteraction)}if(r!==void 0)return o===void 0?[r]:[r,o];if(e.running){const i={state:"ongoing",label:t("status.running")};return o===void 0?[i]:[i,o]}return o!==void 0?[o]:e.completed?[{state:"done",label:t("status.completed")}]:[{state:"done",label:t("status.idle")}]}s(qe,"sessionStatuses");function ze({statuses:e}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(x.StateDot,{state:e[0].state}),e.map(t=>(0,n.jsx)("span",{className:v.visuallyHidden,children:t.label},t.label))]})}s(ze,"SessionStatusDots");function Ls({node:e,now:t,t:o}){const r=qe(e,o);return(0,n.jsxs)("div",{className:v.hoverContent,children:[(0,n.jsx)("div",{className:v.hoverTitle,children:We(e,o)}),!e.blank&&(0,n.jsx)("div",{className:v.hoverTime,children:Ns(e.updatedAt,t,o)}),r.map(i=>(0,n.jsxs)("div",{className:v.hoverStatus,children:[(0,n.jsx)(x.StateDot,{state:i.state}),(0,n.jsx)("span",{children:i.label})]},i.label))]})}s(Ls,"SessionHoverContent");function Rs({result:e,currentId:t,onOpen:o,t:r}){const i=e.id===t,l=qe(e,r),d=l[0];return(0,n.jsxs)("button",{type:"button",className:M(v.searchResultRow,i&&v.selected),role:"treeitem","aria-selected":i,onClick:s(()=>{o(e.id)},"onClick"),children:[(0,n.jsxs)("span",{className:v.searchResultHeading,children:[(0,n.jsx)("span",{className:v.slot,children:(d.state!=="done"||e.completed)&&(0,n.jsx)(ze,{statuses:l})}),(0,n.jsx)("span",{className:v.searchResultTitle,children:e.title})]}),(0,n.jsxs)("span",{className:v.searchResultMeta,children:[(0,n.jsx)("span",{className:v.searchResultWorkspace,children:e.workspace}),e.snippet!==void 0&&(0,n.jsx)("span",{className:v.searchResultSnippet,children:e.snippet})]})]})}s(Rs,"SearchResultItem");function Pe({node:e,currentId:t,now:o,onOpen:r,onRename:i,onFork:l,onArchive:d,drag:a,flat:g=!1,t:u}){const b=e,y=We(e,u),_=e.id===t,k=qe(e,u),B=k[0].state!=="done"||b.completed,[V,w]=(0,h.useState)(!1),q=[{id:"rename",label:u("rename"),icon:(0,n.jsx)(x.IconEditOutline16,{})},{id:"fork",label:u("menu.fork"),icon:(0,n.jsx)(x.IconBranchOutline16,{})},{id:"archive",label:u("menu.archiveSession"),icon:(0,n.jsx)(x.IconArchiveOutline20,{size:16})}],H=(0,n.jsxs)("div",{className:M(v.sessionRow,_&&v.selected,V&&v.menuOpen,g&&!B&&v.flatSessionRowWithoutStatus,a?.marker==="before"&&v.dropBefore,a?.marker==="after"&&v.dropAfter),role:"treeitem","aria-selected":_,onClick:s(()=>{r(e.id)},"onClick"),draggable:a!==void 0,onDragStart:a===void 0?void 0:S=>{S.dataTransfer.effectAllowed="move",S.dataTransfer.setData("text/plain",e.id),a.start()},onDragEnd:a?.end,onDragOver:a===void 0?void 0:S=>{a.active&&(S.preventDefault(),S.dataTransfer.dropEffect="move",a.hover(Fe(S)))},onDrop:a===void 0?void 0:S=>{a.active&&(S.preventDefault(),a.drop(Fe(S)))},children:[(!g||B)&&(0,n.jsx)("span",{className:v.slot,children:B&&(0,n.jsx)(ze,{statuses:k})}),(0,n.jsx)("span",{className:v.title,children:y}),!b.blank&&(0,n.jsx)("span",{className:v.time,children:qs(b.updatedAt,o,u)}),!b.blank&&(0,n.jsx)("span",{className:v.rowActions,children:(0,n.jsx)(x.Menu,{open:V,onClose:s(()=>{w(!1)},"onClose"),items:q,onSelect:s(S=>{w(!1),S==="rename"&&i(e.id,b.title),S==="fork"&&l(e.id),S==="archive"&&d(e.id)},"onSelect"),portal:!0,closeOnPointerLeave:!0,anchor:(0,n.jsx)("button",{type:"button",className:v.iconButton,"aria-label":u("actions.session.aria",{name:y}),onClick:s(S=>{S.stopPropagation(),w(m=>!m)},"onClick"),children:(0,n.jsx)(x.IconEllipsisOutline16,{})})})})]});return(0,n.jsx)(x.HoverCard,{anchor:H,content:(0,n.jsx)(Ls,{node:e,now:o,t:u}),disabled:V||a?.active===!0,copyText:b.blank?void 0:b.title,copyLabel:u("copy"),copiedLabel:u("hover.copied")})}s(Pe,"SessionNodeItem");const Us=".eBk4YW_modalAction{min-width:72px}.eBk4YW_modalError,.eBk4YW_menuStatus{margin-top:8px;font-size:12px;line-height:18px}.eBk4YW_modalError{color:var(--dsw-alias-state-error-primary)}.eBk4YW_menuStatus{color:var(--dsw-alias-label-secondary)}",He="@deepseek-ai/dsh-client-ui-workspace/WorkspacePicker.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(He)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-workspace",e.dataset.pluginCss=He,e.textContent=Us,document.head.appendChild(e)}var be={modalAction:"eBk4YW_modalAction",menuStatus:"eBk4YW_menuStatus",modalError:"eBk4YW_modalError"};const Ye="::add-workspace";function Ge({t:e,open:t,anchorRef:o,useWorkspaces:r,createWorkspace:i,useDirectoryFlow:l,renderDirectoryFlow:d,onPick:a,onClose:g,addOnly:u=!1,side:b="bottom",selectedId:y}){const _=r(R=>R),k=_.items,B=(0,h.useCallback)(()=>o?.current?.getBoundingClientRect()??null,[o]),[V,w]=(0,h.useState)(!1),[q,H]=(0,h.useState)(null),[S,m]=(0,h.useState)(!1),[W,j]=(0,h.useState)(!1),A=S||W,I=l(R=>R);(0,h.useEffect)(()=>{S&&!I&&m(!1)},[S,I]);const L=I?[{id:Ye,label:e("menu.addWorkspace"),icon:(0,n.jsx)(x.IconPlusOutline16,{size:16}),disabled:A}]:[],F=!u&&k.length>0,C=F?k.map(R=>({id:R.workspaceId,label:R.title,icon:(0,n.jsx)(x.IconFolderClose16,{size:16}),disabled:A})):L,Y=C.length===0,X=s(()=>{w(!1),H(null)},"closeModal"),T=s(R=>i({path:R}).then(se=>{m(!1),a(se.workspaceId)}).catch(se=>{H(se instanceof Error?se.message:String(se)),m(!1),w(!0)}),"adoptDirectory"),Z=(0,h.useCallback)(()=>{g(),w(!1),H(null),m(!0)},[g]),z=u||_.phase==="ready",G=!F&&z&&L.length===1;(0,h.useEffect)(()=>{t&&G&&!A&&Z()},[t,G,A,Z]);const K={open:S,busy:W,onPicked:s(R=>{j(!0),T(R).finally(()=>{j(!1)})},"onPicked"),onCancel:s(()=>{m(!1)},"onCancel"),onError:s(R=>{m(!1),H(R),w(!0)},"onError")},de=s(R=>{if(R===Ye){Z();return}a(R)},"handleSelect");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(x.Menu,{open:t&&!G&&!Y,anchor:null,items:C,...F?{footer:L}:{},selectedId:y,onSelect:de,onClose:g,side:b,portal:!0,getAnchorRect:B}),t&&!G&&!Y&&_.phase==="pending"&&(0,n.jsx)("div",{className:be.menuStatus,role:"status",children:e("picker.loading")}),d(K),(0,n.jsx)(x.Modal,{open:V,onClose:X,closeLabel:e("close"),title:e("folderError.title"),footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(x.Button,{variant:"outline",className:be.modalAction,onClick:X,children:e("cancel")}),(0,n.jsx)(x.Button,{variant:"primary",className:be.modalAction,disabled:!I,onClick:Z,children:e("folderError.retry")})]}),children:(0,n.jsx)("div",{className:be.modalError,role:"alert",children:q})})]})}s(Ge,"WorkspacePickFlow");function As({open:e,anchorRef:t,useWorkspaces:o,selectedId:r,onPick:i,onClose:l,createWorkspace:d,useDirectoryFlow:a,renderSlot:g,t:u}){return(0,n.jsx)(Ge,{t:u,open:e,anchorRef:t,useWorkspaces:o,createWorkspace:d,useDirectoryFlow:a,renderDirectoryFlow:s(b=>g("conversation.hero.workspace.directoryFlow",b),"renderDirectoryFlow"),selectedId:r,onPick:i,onClose:l})}s(As,"WorkspacePicker");const Vs='.LauNbq_root{--dsh-session-list-edge-inset:var(--dsh-sidebar-inline-padding);--dsh-session-list-scrollbar-width:8px;--dsh-session-list-scrollbar-offset:2px;box-sizing:border-box;min-height:0;padding-right:var(--dsh-session-list-edge-inset);flex-direction:column;flex:1;display:flex}.LauNbq_root.LauNbq_rail{padding-right:0}.LauNbq_iconButton{cursor:pointer;width:28px;height:28px;color:var(--dsw-alias-label-secondary);background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.LauNbq_iconButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.LauNbq_sectionHeader{box-sizing:border-box;height:36px;color:var(--dsw-alias-label-tertiary);border-radius:12px;flex:none;justify-content:flex-end;align-items:center;gap:4px;margin-bottom:4px;padding-left:4px;display:flex;overflow:hidden}.LauNbq_root:not(.LauNbq_rail) .LauNbq_sectionHeader{margin-top:2px;margin-right:-4px}.LauNbq_sectionLabel{white-space:nowrap;opacity:1;visibility:visible;min-width:0;max-width:45%;transition:max-width .18s var(--ds-ease-in-out), margin-right .18s var(--ds-ease-in-out), opacity .12s var(--ds-ease-in-out), transform .18s var(--ds-ease-in-out), visibility 0s linear;flex:none;line-height:20px;overflow:hidden}.LauNbq_sectionLabelHidden{opacity:0;visibility:hidden;max-width:0;margin-right:-4px;transition-delay:0s,0s,0s,0s,.18s;transform:translate(-4px)}.LauNbq_searchSlot{box-sizing:border-box;min-width:0;max-width:28px;transition:max-width .18s var(--ds-ease-in-out), padding-left .18s var(--ds-ease-in-out);flex:1;align-items:center;margin-left:auto;padding-left:0;display:flex}.LauNbq_searchSlotExpanded{max-width:100%;padding-left:0}.LauNbq_headerActions{opacity:1;visibility:visible;max-width:60px;transition:max-width .18s var(--ds-ease-in-out), opacity .12s var(--ds-ease-in-out), transform .18s var(--ds-ease-in-out), visibility 0s linear;flex:none;align-items:center;gap:4px;display:flex;overflow:hidden}.LauNbq_headerActionsHidden{opacity:0;visibility:hidden;pointer-events:none;max-width:0;transition-delay:0s,0s,0s,.18s;transform:translate(4px)}.LauNbq_search{box-sizing:border-box;cursor:text;width:100%;height:28px;color:var(--dsw-alias-label-secondary);transition:width .18s var(--ds-ease-in-out), padding .18s var(--ds-ease-in-out), border-color .18s var(--ds-ease-in-out), background-color .18s var(--ds-ease-in-out);background:0 0;border:none;border-radius:50%;flex:none;align-items:center;gap:0;margin:0;padding:0;display:flex;overflow:hidden}.LauNbq_searchExpanded{border:1px solid var(--dsw-alias-border-l2);width:calc(100% + 4px);height:30px;color:var(--dsw-alias-label-caption);background:0 0;border-radius:10px;margin-inline:-2px;padding:0 4px 0 0}.LauNbq_searchButton{cursor:pointer;width:28px;height:28px;color:inherit;background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.LauNbq_searchExpanded .LauNbq_searchButton{width:28px;height:30px}.LauNbq_searchButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.LauNbq_searchExpanded .LauNbq_searchButton:hover{background:0 0}.LauNbq_searchInput{opacity:0;pointer-events:none;width:0;min-width:0;color:var(--dsw-alias-label-primary);transition:opacity .12s var(--ds-ease-in-out);background:0 0;border:none;outline:none;flex:1;font-size:13px;line-height:18px}.LauNbq_searchExpanded .LauNbq_searchInput{opacity:1;pointer-events:auto;margin-left:-2px}.LauNbq_searchInput::placeholder{color:var(--dsw-alias-label-tertiary)}.LauNbq_clearButton{cursor:pointer;width:24px;height:24px;color:var(--dsw-alias-label-secondary);background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.LauNbq_clearButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.LauNbq_rail .LauNbq_sectionHeader{justify-content:flex-start;gap:0;margin-bottom:12px;padding-left:0}.LauNbq_rail .LauNbq_headerActions{max-width:none}.LauNbq_rail .LauNbq_iconButton{width:36px;height:36px;color:var(--dsw-alias-label-primary)}.LauNbq_rail .LauNbq_search{background:0 0;border-color:#0000;gap:0;width:36px;height:36px;margin:0 0 12px;padding:0}.LauNbq_rail .LauNbq_searchButton{width:36px;height:36px;color:var(--dsw-alias-label-primary)}.LauNbq_rail .LauNbq_searchButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.LauNbq_listArea{min-height:0;margin-left:-4px;margin-right:calc(-1 * var(--dsh-session-list-edge-inset));flex-direction:column;flex:1;padding-left:4px;display:flex;overflow:visible}.LauNbq_rail .LauNbq_listArea{margin-left:0;margin-right:0;padding-left:0}.LauNbq_treeBody{flex-direction:column;flex:1;min-height:0;display:flex;position:relative}.LauNbq_fade{left:0;right:var(--dsh-session-list-edge-inset);background:linear-gradient(to bottom, transparent, var(--dsw-specific-sidebar-fill));pointer-events:none;height:24px;position:absolute;bottom:0}.LauNbq_wide{animation:LauNbq_wide-in .2s var(--ds-ease-in-out)}@keyframes LauNbq_wide-in{0%{opacity:0}}.LauNbq_list{min-height:0;margin-left:-4px;margin-right:var(--dsh-session-list-scrollbar-offset);padding-left:4px;padding-right:calc(var(--dsh-session-list-edge-inset) - var(--dsh-session-list-scrollbar-width) - var(--dsh-session-list-scrollbar-offset));scrollbar-gutter:stable;flex:1;padding-bottom:16px;overflow-y:auto}.LauNbq_flatList>*+*,.LauNbq_searchTree>[role=treeitem]+[role=treeitem],.LauNbq_groupSection>*+*{margin-top:2px}.LauNbq_searchStatus,.LauNbq_searchWarning{color:var(--dsw-alias-label-tertiary);padding:10px 12px;font-size:12px;line-height:18px}.LauNbq_searchWarning{color:var(--dsw-alias-label-secondary)}.LauNbq_groupSection{position:relative}.LauNbq_groupSection+.LauNbq_groupSection{margin-top:4px}.LauNbq_listTopDropIndicator,.LauNbq_workspaceDropBefore:before,.LauNbq_workspaceDropAfter:after{content:"";z-index:1;background:linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat, linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat, linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;pointer-events:none;height:12px;position:absolute;left:0;right:0}.LauNbq_listTopDropIndicator{top:-8px;left:0;right:var(--dsh-session-list-edge-inset)}.LauNbq_listTopDropActive>.LauNbq_workspaceDropBefore:first-child:before{display:none}.LauNbq_workspaceDropBefore:before{top:-8px}.LauNbq_workspaceDropAfter:after{bottom:-8px}.LauNbq_sessionOverflowButton{cursor:pointer;text-align:left;width:100%;height:28px;color:var(--dsw-alias-label-tertiary);background:0 0;border:none;border-radius:8px;padding:0 12px 0 28px;font-size:12px}.LauNbq_groupSection>.LauNbq_sessionOverflowButton{margin-top:0}.LauNbq_sessionOverflowButton:hover{color:var(--dsw-alias-label-secondary);background:0 0}.LauNbq_empty{color:var(--dsw-alias-label-tertiary);padding:16px 12px;font-size:13px}.LauNbq_renameInput{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);width:100%;height:44px;color:var(--dsw-alias-label-primary);background:0 0;border-radius:22px;outline:none;padding:7px 14px;font-size:14px;font-weight:400;line-height:22px}.LauNbq_renameInput:disabled{color:var(--dsw-alias-label-dimmed)}.LauNbq_renameError{color:var(--dsw-alias-state-error-primary);margin-top:8px;font-size:12px;line-height:18px}.LauNbq_deleteAction:not(:disabled){color:var(--dsw-alias-state-error-primary)}.LauNbq_deleteStatus{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}@media (prefers-reduced-motion:reduce){.LauNbq_wide{animation:none}.LauNbq_search,.LauNbq_sectionLabel,.LauNbq_searchSlot,.LauNbq_searchInput,.LauNbq_headerActions{transition:none}}',Ke="@deepseek-ai/dsh-client-ui-workspace/WorkspaceBrowser.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(Ke)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-workspace",e.dataset.pluginCss=Ke,e.textContent=Vs,document.head.appendChild(e)}var f={sessionOverflowButton:"LauNbq_sessionOverflowButton",list:"LauNbq_list",groupSection:"LauNbq_groupSection",iconButton:"LauNbq_iconButton",renameError:"LauNbq_renameError",searchSlotExpanded:"LauNbq_searchSlotExpanded",fade:"LauNbq_fade","wide-in":"LauNbq_wide-in",headerActionsHidden:"LauNbq_headerActionsHidden",searchInput:"LauNbq_searchInput",listTopDropIndicator:"LauNbq_listTopDropIndicator",empty:"LauNbq_empty",search:"LauNbq_search",searchSlot:"LauNbq_searchSlot",workspaceDropBefore:"LauNbq_workspaceDropBefore",flatList:"LauNbq_flatList",sectionLabel:"LauNbq_sectionLabel",treeBody:"LauNbq_treeBody",sectionLabelHidden:"LauNbq_sectionLabelHidden",listArea:"LauNbq_listArea",sectionHeader:"LauNbq_sectionHeader",searchStatus:"LauNbq_searchStatus",root:"LauNbq_root",wide:"LauNbq_wide",renameInput:"LauNbq_renameInput",headerActions:"LauNbq_headerActions",searchTree:"LauNbq_searchTree",deleteAction:"LauNbq_deleteAction",rail:"LauNbq_rail",searchWarning:"LauNbq_searchWarning",searchExpanded:"LauNbq_searchExpanded",clearButton:"LauNbq_clearButton",listTopDropActive:"LauNbq_listTopDropActive",deleteStatus:"LauNbq_deleteStatus",searchButton:"LauNbq_searchButton",workspaceDropAfter:"LauNbq_workspaceDropAfter"};const Es=300,Bs=250,Ne=500,Se=5;function $e(e){const t=e.replaceAll("\0","");if(t.length<=Ne)return t;let o=Ne;const r=t.charCodeAt(o-1),i=t.charCodeAt(o);return r>=55296&&r<=56319&&i>=56320&&i<=57343&&o--,t.slice(0,o)}s($e,"sanitizeSearchQuery");function Os(e,t){return e.includes(t)?e.filter(o=>o!==t):[...e,t]}s(Os,"toggled");function Qe(e){(0,h.useEffect)(()=>{if(!e)return;const t=s(r=>{r.preventDefault(),r.dataTransfer!==null&&(r.dataTransfer.dropEffect="move")},"acceptDrag"),o=s(r=>{r.preventDefault()},"acceptDrop");return document.addEventListener("dragover",t),document.addEventListener("drop",o),()=>{document.removeEventListener("dragover",t),document.removeEventListener("drop",o)}},[e])}s(Qe,"useNativeDragAcceptance");function ge(e,t){if(t===void 0)return[...e];const o=new Map(e.map(l=>[l,l])),r=[],i=new Set;for(const l of t){const d=o.get(l);d===void 0||i.has(l)||(r.push(d),i.add(l))}for(const l of e)i.has(l)||r.push(l);return r}s(ge,"reconciledSessionOrder");function Je(e,t,o){const r=o[e]?.updatedAt??Number.NEGATIVE_INFINITY,i=o[t]?.updatedAt??Number.NEGATIVE_INFINITY;return r!==i?i-r:e<t?-1:1}s(Je,"compareSessionRecency");function Xe({sessionIds:e,previousOrder:t,previousUpdatedAt:o,list:r,orderBy:i,sortByRecency:l}){let d=ge(e,t);if(l)d.sort((b,y)=>Je(b,y,r.byId));else if(i==="updated"){const b=e.filter(y=>{const _=r.byId[y];return _!==void 0&&(o[y]===void 0||_.updatedAt>o[y])}).sort((y,_)=>Je(y,_,r.byId));if(b.length>0){const y=new Set(b);d=[...b,...d.filter(_=>!y.has(_))]}}const a={};for(const b of e){const y=r.byId[b];y!==void 0&&(a[b]=y.updatedAt)}const g=t===void 0||d.length!==t.length||d.some((b,y)=>b!==t[y]),u=Object.keys(a).length!==Object.keys(o).length||Object.entries(a).some(([b,y])=>o[b]!==y);return{order:d,updatedAt:a,changed:g||u}}s(Xe,"nextSessionOrderAccount");function Cs({groupBy:e,orderBy:t,onGroupPick:o,onOrderPick:r,t:i}){const[l,d]=(0,h.useState)(!1);return(0,n.jsx)(x.Menu,{open:l,onClose:s(()=>{d(!1)},"onClose"),items:[{type:"label",id:"group-by",text:i("groupBy.label")},{id:"workspace",label:i("groupBy.workspace")},{id:"flat",label:i("groupBy.flat")},{type:"separator",id:"order-by-separator"},{type:"label",id:"order-by",text:i("orderBy.label")},{id:"manual",label:i("orderBy.manual")},{id:"updated",label:i("orderBy.updated")}],selectedIds:[e,t],onSelect:s(a=>{a==="workspace"||a==="flat"?o(a):(a==="manual"||a==="updated")&&r(a),d(!1)},"onSelect"),align:"end",dense:!0,portal:!0,anchor:(0,n.jsx)(x.Tooltip,{label:i("viewOptions.label"),side:"bottom",delayMs:500,children:(0,n.jsx)("button",{type:"button",className:M(f.iconButton,f.wide),"aria-label":i("viewOptions.label"),onClick:s(()=>{d(a=>!a)},"onClick"),children:(0,n.jsx)(x.IconPersonalizationOutline16,{})})})})}s(Cs,"ViewOptionsMenu");function Ze(e){const t=e.currentTarget.getBoundingClientRect();return e.clientY<t.top+t.height/2?"before":"after"}s(Ze,"workspaceGroupHalf");function Ts({useSessions:e,startSession:t,open:o,forkSession:r,workspaces:i,archivedSessionIds:l,onRenameRequest:d,onDeleteRequest:a,onSessionRename:g,onSessionArchive:u,insertWorkspaceBefore:b,insertSessionBefore:y,orderBy:_,groupExpansion:k,setGroupExpanded:B,sessionOrderByAccount:V,sessionUpdatedAtByAccount:w,syncSessionOrderAccount:q,setSessionOrder:H,t:S}){const m=e(p=>p),W=m.current,[j,A]=(0,h.useState)([]),[I,L]=(0,h.useState)(null),F=(0,h.useRef)(!1),[C,Y]=(0,h.useState)(null),X=(0,h.useRef)(!1),T=(0,h.useRef)(_);Qe(I!==null||C!==null);const Z=W===void 0?void 0:i.find(p=>p.sessionIds.includes(W))?.workspaceId??"";(0,h.useEffect)(()=>{W===void 0||Z===void 0||Object.hasOwn(k,Z)||B(Z,!0)},[W,Z,B,k]);const z=(0,h.useMemo)(()=>Object.entries(k).filter(([,p])=>p).map(([p])=>p),[k]),G=(0,h.useMemo)(()=>{const p=new Set(i.flatMap(D=>D.sessionIds));return m.ids.filter(D=>m.byId[D]!==void 0&&!p.has(D))},[m,i]);(0,h.useEffect)(()=>{if(m.phase!=="ready")return;const p=T.current!=="updated"&&_==="updated";T.current=_;const D=[...i.map(U=>({key:U.workspaceId,sessionIds:U.sessionIds.filter($=>m.byId[$]!==void 0)})),{key:"",sessionIds:G}];for(const{key:U,sessionIds:$}of D){const E=V[U],P=Xe({sessionIds:$,previousOrder:E,previousUpdatedAt:w[U]??{},list:m,orderBy:_,sortByRecency:_==="updated"&&(E===void 0||p)});P.changed&&q(U,P.order.map(N=>N),P.updatedAt)}},[m,_,V,w,q,G,i]);const K=(0,h.useMemo)(()=>i.map(p=>{const D=V[p.workspaceId],U=ge(p.sessionIds,D);return{...p,sessionIds:U}}),[V,i]),de=(0,h.useMemo)(()=>ge(G,V[""]),[V,G]),R=(0,h.useMemo)(()=>vs(m,K,l,{expandedGroups:z,...V[""]===void 0?{}:{ungroupedOrder:V[""]}}),[m,K,l,z,V]),se=Date.now(),te=s((p,D)=>{if(F.current)return;F.current=!0,L(null);const U=R.find(O=>O.key===p.accountKey);if(U===void 0)return;const $=U.sessions.findIndex(O=>O.id===D.id);if($===-1)return;const E=D.half==="before"?D.id:U.sessions[$+1]?.id;if(E===p.sessionId)return;const P=U.sessions.findIndex(O=>O.id===p.sessionId),N=E===void 0?U.sessions.length:U.sessions.findIndex(O=>O.id===E);if(P!==-1&&(N===P||N===P+1))return;const Q=p.accountKey===""?de:K.find(O=>O.workspaceId===p.accountKey)?.sessionIds;if(Q===void 0)return;const ee=Q.filter(O=>O!==p.sessionId),ne=E===void 0?ee.length:ee.indexOf(E);ee.splice(ne===-1?ee.length:ne,0,p.sessionId),H(p.accountKey,ee.map(O=>O)),!(_==="updated"||p.accountKey==="")&&y(p.accountKey,p.sessionId,E).catch(O=>{console.warn("session reorder rejected:",O)})},"commitSessionDrag"),xe=s((p,D)=>{if(X.current)return;X.current=!0,Y(null);const U=i.findIndex(N=>N.workspaceId===D.id);if(U===-1)return;const $=D.half==="before"?D.id:i[U+1]?.workspaceId;if($===p.workspaceId)return;const E=i.findIndex(N=>N.workspaceId===p.workspaceId),P=$===void 0?i.length:i.findIndex(N=>N.workspaceId===$);E!==-1&&(P===E||P===E+1)||b(p.workspaceId,$).catch(N=>{console.warn("workspace reorder rejected:",N)})},"commitWorkspaceDrag"),oe=R[0]?.workspaceId!==void 0&&C?.over?.id===R[0].workspaceId&&C.over.half==="before";return(0,n.jsxs)("div",{className:M(f.treeBody,f.wide),children:[oe&&(0,n.jsx)("span",{className:f.listTopDropIndicator,"aria-hidden":"true"}),(0,n.jsxs)("div",{className:M(f.list,oe&&f.listTopDropActive),role:"tree","aria-label":S("section.sessions"),children:[R.length===0&&(0,n.jsx)("div",{className:f.empty,children:S("empty.none")}),R.map(p=>{const D=p.workspaceId,U=D!==void 0&&C?.over?.id===D?C.over.half:null,$=D===void 0?void 0:{start:s(()=>{X.current=!1,Y({workspaceId:D,over:null})},"start"),end:s(()=>{C?.over!==null&&C?.over!==void 0?xe(C,C.over):Y(null),X.current=!1},"end")},E=D===void 0?void 0:N=>{Y(Q=>Q===null?Q:{...Q,over:{id:D,half:N}})},P=D===void 0?void 0:N=>{C!==null&&xe(C,{id:D,half:N})};return(0,n.jsxs)("div",{className:M(f.groupSection,U==="before"&&f.workspaceDropBefore,U==="after"&&f.workspaceDropAfter),onDragOver:C===null||E===void 0?void 0:N=>{N.preventDefault(),N.dataTransfer.dropEffect="move",E(Ze(N))},onDrop:C===null||P===void 0?void 0:N=>{N.preventDefault(),P(Ze(N))},children:[(0,n.jsx)(js,{group:p,t:S,onToggle:s(()=>{p.expanded&&A(N=>N.filter(Q=>Q!==p.key)),B(p.key,!p.expanded)},"onToggle"),onCreate:s(()=>{p.workspaceId!==void 0&&(B(p.key,!0),t(p.workspaceId))},"onCreate"),drag:$,actions:p.workspaceId===void 0?void 0:{rename:s(()=>{p.workspaceId!==void 0&&d(p.workspaceId,p.label)},"rename"),delete:s(()=>{p.workspaceId!==void 0&&a(p.workspaceId,p.label)},"delete")}}),(j.includes(p.key)?p.sessions:p.sessions.slice(0,Se)).map(N=>{const Q=I!==null&&I.accountKey===p.key,ee={start:s(()=>{F.current=!1,L({accountKey:p.key,sessionId:N.id,over:null})},"start"),active:Q,marker:Q&&I.over?.id===N.id?I.over.half:null,hover:s(ne=>{L(O=>O===null?O:{...O,over:{id:N.id,half:ne}})},"hover"),drop:s(ne=>{I!==null&&te(I,{id:N.id,half:ne})},"drop"),end:s(()=>{I?.over!==null&&I?.over!==void 0?te(I,I.over):L(null),F.current=!1},"end")};return(0,n.jsx)(Pe,{node:N,currentId:W,now:se,onOpen:o,onRename:g,onFork:r,onArchive:u,drag:ee,t:S},N.id)}),p.sessions.length>Se&&(0,n.jsx)("button",{type:"button",className:f.sessionOverflowButton,"aria-expanded":j.includes(p.key),onClick:s(()=>{A(N=>Os(N,p.key))},"onClick"),children:j.includes(p.key)?S("sessions.collapse"):S("sessions.expand",{n:p.sessions.length-Se})})]},p.key)})]}),(0,n.jsx)("span",{className:f.fade})]})}s(Ts,"SessionTree");function Ms({useSessions:e,open:t,forkSession:o,onSessionRename:r,onSessionArchive:i,archivedSessionIds:l,orderBy:d,sessionOrderByAccount:a,sessionUpdatedAtByAccount:g,syncSessionOrderAccount:u,setSessionOrder:b,t:y}){const _=e(j=>j),k=(0,h.useMemo)(()=>ys(_,l),[_,l]),B=(0,h.useMemo)(()=>k.map(j=>j.id),[k]),V=(0,h.useRef)(d);(0,h.useEffect)(()=>{if(_.phase!=="ready")return;const j=a[ie],A=g.__flat_session_order__??{},I=V.current!=="updated"&&d==="updated";V.current=d;const L=Xe({sessionIds:B,previousOrder:j,previousUpdatedAt:A,list:_,orderBy:d,sortByRecency:d==="updated"&&(j===void 0||I)});L.changed&&u(ie,L.order.map(F=>F),L.updatedAt)},[_,d,a,g,B,u]);const w=(0,h.useMemo)(()=>{const j=new Map(k.map(A=>[A.id,A]));return ge(B,a[ie]).flatMap(A=>{const I=j.get(A);return I===void 0?[]:[I]})},[k,a,B]),[q,H]=(0,h.useState)(null),S=(0,h.useRef)(!1);Qe(q!==null);const m=s((j,A)=>{if(S.current)return;S.current=!0,H(null);const I=w.findIndex(T=>T.id===A.id);if(I===-1)return;const L=A.half==="before"?A.id:w[I+1]?.id;if(L===j.sessionId)return;const F=w.findIndex(T=>T.id===j.sessionId),C=L===void 0?w.length:w.findIndex(T=>T.id===L);if(F!==-1&&(C===F||C===F+1))return;const Y=w.map(T=>T.id).filter(T=>T!==j.sessionId),X=L===void 0?Y.length:Y.indexOf(L);Y.splice(X===-1?Y.length:X,0,j.sessionId),b(ie,Y.map(T=>T))},"commitDrag"),W=Date.now();return(0,n.jsxs)("div",{className:M(f.treeBody,f.wide),children:[(0,n.jsxs)("div",{className:M(f.list,f.flatList),role:"tree","aria-label":y("section.sessions"),children:[w.length===0&&(0,n.jsx)("div",{className:f.empty,children:y("empty.none")}),w.map(j=>{const A=q!==null;return(0,n.jsx)(Pe,{node:j,currentId:_.current,now:W,onOpen:t,onRename:r,onFork:o,onArchive:i,flat:!0,drag:{start:s(()=>{S.current=!1,H({accountKey:ie,sessionId:j.id,over:null})},"start"),active:A,marker:A&&q.over?.id===j.id?q.over.half:null,hover:s(I=>{H(L=>L===null?L:{...L,over:{id:j.id,half:I}})},"hover"),drop:s(I=>{q!==null&&m(q,{id:j.id,half:I})},"drop"),end:s(()=>{q?.over!==null&&q?.over!==void 0?m(q,q.over):H(null),S.current=!1},"end")},t:y},j.id)})]}),(0,n.jsx)("span",{className:f.fade})]})}s(Ms,"FlatList");function Ws({useSessions:e,open:t,workspaces:o,archivedSessionIds:r,query:i,remote:l,resultLimit:d,t:a}){const g=e(k=>k),u=l.query===i?l:{query:i,status:"loading",items:[],hasMore:!1},b=(0,h.useMemo)(()=>_s(g,o,i,r,u,d),[g,o,i,r,u,d]),y=u.status==="loading",_=u.status==="error";return(0,n.jsxs)("div",{className:M(f.treeBody,f.wide),children:[(0,n.jsxs)("div",{className:f.list,children:[(0,n.jsx)("div",{className:f.searchTree,role:"tree","aria-label":a("search.results.aria"),children:b.items.map(k=>(0,n.jsx)(Rs,{result:k,currentId:g.current,onOpen:t,t:a},k.id))}),y&&(0,n.jsx)("div",{className:f.searchStatus,role:"status",children:a("search.pending")}),_&&(0,n.jsx)("div",{className:f.searchWarning,role:"status",children:a("search.unavailable")}),!y&&b.items.length===0&&(0,n.jsx)("div",{className:f.empty,children:a("search.noMatches")}),b.hasMore&&(0,n.jsx)("div",{className:f.searchStatus,children:a("search.hasMore",{n:d})})]}),(0,n.jsx)("span",{className:f.fade})]})}s(Ws,"SearchResults");function Fs({wide:e,expandSidebar:t,useSessions:o,useWorkspaces:r,useStore:i,actions:l,startSession:d,open:a,renameSession:g,forkSession:u,renameWorkspace:b,deleteWorkspace:y,insertWorkspaceBefore:_,archiveSession:k,insertSessionBefore:B,createWorkspace:V,searchSessions:w,searchResultLimit:q,useDirectoryFlow:H,renderSlot:S,t:m}){const W=r(c=>c.items),j=r(c=>c.phase),A=r(c=>c.archivedSessionIds),I=H(c=>c),L=i(c=>c.groupBy),F=i(c=>c.orderBy),C=i(c=>c.groupExpansion),Y=i(c=>c.sessionOrderByAccount),X=i(c=>c.sessionUpdatedAtByAccount);(0,h.useEffect)(()=>{j==="ready"&&l.retainAccountKeys(["",ie,...W.map(c=>c.workspaceId)])},[l.retainAccountKeys,j,W]);const[T,Z]=(0,h.useState)(""),[z,G]=(0,h.useState)(!1),K=$e(T).trim(),[de,R]=(0,h.useState)({query:"",status:"idle",items:[],hasMore:!1}),se=(0,h.useRef)(null),te=(0,h.useRef)(null),[xe,oe]=(0,h.useState)(!1),p=(0,h.useRef)(null),D=(0,h.useRef)(!1),[U,$]=(0,h.useState)(!1);(0,h.useEffect)(()=>{if(e&&U){const c=window.setTimeout(()=>{te.current?.focus({preventScroll:!0}),$(!1)},Es);return()=>{window.clearTimeout(c)}}},[e,U]),(0,h.useEffect)(()=>{!e||!z||U||te.current?.focus({preventScroll:!0})},[e,z,U]),(0,h.useEffect)(()=>{if(!e||!z)return;const c=s(J=>{!(J.target instanceof Node)||se.current?.contains(J.target)===!0||(te.current?.blur(),K===""&&G(!1))},"onClick");return document.addEventListener("click",c),()=>{document.removeEventListener("click",c)}},[K,e,z]),(0,h.useEffect)(()=>{if(K===""){R({query:"",status:"idle",items:[],hasMore:!1});return}const c=new AbortController;R({query:K,status:"loading",items:[],hasMore:!1});const J=window.setTimeout(()=>{w(K,c.signal).then(ms=>{c.signal.aborted||R({query:K,status:"ready",items:ms.items,hasMore:ms.hasMore})}).catch(()=>{c.signal.aborted||R({query:K,status:"error",items:[],hasMore:!1})})},Bs);return()=>{window.clearTimeout(J),c.abort()}},[K,w]);const[E,P]=(0,h.useState)(null),[N,Q]=(0,h.useState)(""),[ee,ne]=(0,h.useState)(!1),[O,ue]=(0,h.useState)(null),re=N.trim(),es=E!==null&&re!==""&&re!==E.currentTitle&&W.some(c=>c.title===re),ss=ee||re===""||E===null||re===E.currentTitle||es,ns=s(()=>{ee||(P(null),ue(null))},"closeRename"),ts=s(()=>{ss||(ne(!0),ue(null),b(E.workspaceId,re).then(()=>{ne(!1),P(null)}).catch(c=>{ne(!1),ue(c instanceof Error?c.message:String(c))}))},"confirmRename"),[je,Ie]=(0,h.useState)(null),[os,rs]=(0,h.useState)(""),[ve,Le]=(0,h.useState)(!1),[as,pe]=(0,h.useState)(null),is=os.trim(),ls=ve||is===""||je===null,cs=s(()=>{ve||(Ie(null),pe(null))},"closeSessionRename"),ds=s(()=>{ls||(Le(!0),pe(null),g(je.sessionId,is).then(()=>{Le(!1),Ie(null)}).catch(c=>{Le(!1),pe(c instanceof Error?c.message:String(c))}))},"confirmSessionRename"),us=s((c,J)=>{Ie({sessionId:c,currentTitle:J}),rs(J),pe(null)},"onSessionRename"),ps=s(c=>{k(c).catch(J=>{console.warn("session archive rejected:",J)})},"onSessionArchive"),[le,Re]=(0,h.useState)(null),[he,Ue]=(0,h.useState)(!1),[Ae,Ve]=(0,h.useState)(null),[hs,ye]=(0,h.useState)(null);(0,h.useEffect)(()=>{Ae===null||W.some(c=>c.workspaceId===Ae)||(Ue(!1),Ve(null),Re(null))},[Ae,W]);const fs=s(()=>{he||(Re(null),ye(null))},"closeDelete"),Gs=s(()=>{he||le===null||(Ue(!0),Ve(null),ye(null),y(le.workspaceId).then(()=>{Ve(le.workspaceId)}).catch(c=>{Ue(!1),ye(c instanceof Error?c.message:String(c))}))},"confirmDelete");return(0,n.jsxs)("div",{className:M(f.root,!e&&f.rail),children:[(0,n.jsxs)("div",{className:f.sectionHeader,children:[e&&(0,n.jsx)("span",{className:M(f.sectionLabel,f.wide,z&&f.sectionLabelHidden),children:m(L==="flat"?"section.sessions":"section.workspaces")}),e&&(0,n.jsx)("div",{className:M(f.searchSlot,z&&f.searchSlotExpanded),children:(0,n.jsxs)("div",{ref:se,className:M(f.search,z&&f.searchExpanded),onClick:s(()=>{oe(!1),G(!0),te.current?.focus()},"onClick"),children:[(0,n.jsx)(x.Tooltip,{label:m("search"),side:"bottom",delayMs:500,disabled:z,children:(0,n.jsx)("button",{type:"button",className:f.searchButton,"aria-label":m("search.sessions.aria"),"aria-expanded":z,onClick:s(()=>{oe(!1),G(!0)},"onClick"),children:(0,n.jsx)(x.IconSearchOutline16,{size:z?11:14})})}),(0,n.jsx)("input",{ref:te,className:f.searchInput,type:"text",placeholder:m("search.placeholder"),maxLength:Ne,value:T,tabIndex:z?0:-1,onChange:s(c=>{Z($e(c.target.value))},"onChange"),onKeyDown:s(c=>{c.key==="Escape"&&(Z(""),G(!1))},"onKeyDown")}),z&&(0,n.jsx)("button",{type:"button",className:f.clearButton,"aria-label":m("search.clear"),onClick:s(c=>{c.stopPropagation(),Z(""),G(!1)},"onClick"),children:(0,n.jsx)(x.IconCloseFill14,{})})]})}),(0,n.jsxs)("div",{className:M(f.headerActions,e&&z&&f.headerActionsHidden),children:[e&&(0,n.jsx)(Cs,{groupBy:L,orderBy:F,onGroupPick:s(c=>{l.setGroupBy(c)},"onGroupPick"),onOrderPick:s(c=>{l.setOrderBy(c)},"onOrderPick"),t:m}),I&&(0,n.jsx)(x.Tooltip,{label:m("workspace.add"),side:"bottom",delayMs:500,children:(0,n.jsx)("button",{ref:p,type:"button",className:f.iconButton,"aria-label":m("workspace.add"),onClick:s(()=>{oe(c=>!c)},"onClick"),children:(0,n.jsx)(x.IconProjectAddOutline16,{size:e?16:18})})})]}),(0,n.jsx)(Ge,{t:m,open:xe,anchorRef:p,useWorkspaces:r,createWorkspace:V,useDirectoryFlow:H,renderDirectoryFlow:s(c=>S("sidebar.workspaces.directoryFlow",c),"renderDirectoryFlow"),addOnly:!0,side:"right",onPick:s(c=>{oe(!1),d(c)},"onPick"),onClose:s(()=>{oe(!1)},"onClose")})]}),!e&&(0,n.jsx)("div",{className:f.search,children:(0,n.jsx)(x.Tooltip,{label:m("search"),children:(0,n.jsx)("button",{type:"button",className:f.searchButton,"aria-label":m("search.sessions.aria"),onClick:s(()=>{G(!0),$(!0),t()},"onClick"),children:(0,n.jsx)(x.IconSearchOutline16,{size:18})})})}),(0,n.jsx)("div",{className:f.listArea,children:e&&(K!==""?(0,n.jsx)(Ws,{useSessions:o,open:a,workspaces:W,archivedSessionIds:A,query:K,remote:de,resultLimit:q,t:m}):L==="flat"?(0,n.jsx)(Ms,{useSessions:o,open:a,forkSession:u,onSessionRename:us,onSessionArchive:ps,archivedSessionIds:A,orderBy:F,sessionOrderByAccount:Y,sessionUpdatedAtByAccount:X,syncSessionOrderAccount:l.syncSessionOrderAccount,setSessionOrder:l.setSessionOrder,t:m}):(0,n.jsx)(Ts,{useSessions:o,onSessionRename:us,onSessionArchive:ps,forkSession:u,workspaces:W,groupExpansion:C,setGroupExpanded:l.setGroupExpanded,sessionOrderByAccount:Y,sessionUpdatedAtByAccount:X,syncSessionOrderAccount:l.syncSessionOrderAccount,setSessionOrder:l.setSessionOrder,archivedSessionIds:A,startSession:d,open:a,insertWorkspaceBefore:_,insertSessionBefore:B,orderBy:F,t:m,onRenameRequest:s((c,J)=>{P({workspaceId:c,currentTitle:J}),Q(J),ue(null)},"onRenameRequest"),onDeleteRequest:s((c,J)=>{Re({workspaceId:c,title:J}),ye(null)},"onDeleteRequest")}))}),(0,n.jsxs)(x.Modal,{open:E!==null,onClose:ns,closeLabel:m("close"),title:m("rename.workspace.title"),footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(x.Button,{variant:"outline",disabled:ee,onClick:ns,children:m("cancel")}),(0,n.jsx)(x.Button,{variant:"primary",disabled:ss,onClick:ts,children:m("rename")})]}),children:[(0,n.jsx)("input",{className:f.renameInput,value:N,"aria-label":m("field.workspaceName"),autoFocus:!0,disabled:ee,onFocus:s(c=>{c.target.select()},"onFocus"),onChange:s(c=>{Q(c.target.value),ue(null)},"onChange"),onCompositionStart:s(()=>{D.current=!0},"onCompositionStart"),onCompositionEnd:s(()=>{D.current=!1},"onCompositionEnd"),onKeyDown:s(c=>{c.key==="Enter"&&!D.current&&(c.preventDefault(),ts())},"onKeyDown")}),es&&(0,n.jsx)("div",{className:f.renameError,role:"alert",children:m("conflict.named",{name:re})}),O!==null&&(0,n.jsx)("div",{className:f.renameError,role:"alert",children:O})]}),(0,n.jsxs)(x.Modal,{open:je!==null,onClose:cs,closeLabel:m("close"),title:m("rename.session.title"),footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(x.Button,{variant:"outline",disabled:ve,onClick:cs,children:m("cancel")}),(0,n.jsx)(x.Button,{variant:"primary",disabled:ls,onClick:ds,children:m("rename")})]}),children:[(0,n.jsx)("input",{className:f.renameInput,value:os,"aria-label":m("field.sessionName"),autoFocus:!0,disabled:ve,onFocus:s(c=>{c.target.select()},"onFocus"),onChange:s(c=>{rs(c.target.value),pe(null)},"onChange"),onCompositionStart:s(()=>{D.current=!0},"onCompositionStart"),onCompositionEnd:s(()=>{D.current=!1},"onCompositionEnd"),onKeyDown:s(c=>{c.key==="Enter"&&!D.current&&(c.preventDefault(),ds())},"onKeyDown")}),as!==null&&(0,n.jsx)("div",{className:f.renameError,role:"alert",children:as})]}),(0,n.jsxs)(x.Modal,{open:le!==null,onClose:fs,closeLabel:m("close"),title:m("delete.workspace"),...le===null?{}:{description:m("delete.desc",{name:le.title})},footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(x.Button,{variant:"outline",disabled:he,onClick:fs,children:m("cancel")}),(0,n.jsx)(x.Button,{variant:"outline",className:f.deleteAction,disabled:he,onClick:Gs,children:m("delete.workspace")})]}),children:[he&&(0,n.jsx)("div",{className:f.deleteStatus,role:"status",children:m("delete.pending")}),hs!==null&&(0,n.jsx)("div",{className:f.renameError,role:"alert",children:hs})]})]})}s(Fs,"WorkspaceBrowser");const zs={"group.ungrouped":"未分组","session.new":"新会话","section.workspaces":"工作区","section.sessions":"会话","viewOptions.label":"视图选项","groupBy.label":"分组方式","groupBy.workspace":"按工作区","groupBy.flat":"单列表","orderBy.label":"排序方式","orderBy.manual":"手动排序","orderBy.updated":"最近更新","sessions.expand":"展开其余 {n} 个会话","sessions.collapse":"收起","empty.none":"暂无会话","empty.noMatches":"无匹配结果","workspace.add":"添加工作区","search.sessions.aria":"搜索会话","search.placeholder":"搜索会话…","search.clear":"清除搜索","search.results.aria":"搜索结果","search.pending":"正在搜索会话历史…","search.unavailable":"内容搜索暂不可用,仅显示名称匹配。","search.noMatches":"无匹配会话","search.hasMore":"仅显示前 {n} 条结果,请缩小搜索范围。","menu.addWorkspace":"添加工作区…","picker.loading":"正在加载工作区…","conflict.named":"已存在名为“{name}”的工作区。","folderError.title":"无法打开文件夹","folderError.retry":"重新选择",rename:"重命名","rename.workspace.title":"重命名工作区","rename.session.title":"重命名会话","field.workspaceName":"工作区名称","field.sessionName":"会话名称","delete.workspace":"删除工作区","delete.desc":"将把“{name}”从工作区列表中移除。文件夹与会话记录会保留,其会话将显示在“未分组”下。","delete.pending":"正在删除工作区…","menu.fork":"分叉会话","menu.archiveSession":"归档会话","sessions.count.one":"{n} 个会话","sessions.count.other":"{n} 个会话","actions.workspace.aria":"工作区“{name}”的操作","actions.session.aria":"会话“{name}”的操作","actions.newSession.aria":"在“{name}”中新建会话","status.running":"进行中","status.subagentsRunning.one":"{n} 个子代理运行中","status.subagentsRunning.other":"{n} 个子代理运行中","status.idle":"空闲","status.waitingApproval":"等待审批","status.planReview":"计划待审","status.waitingAnswer":"等待回答","status.completed":"已完成","hover.created":"创建于 {time}","hover.copied":"已复制","date.ymd":"{y}年{m}月{d}日","time.now":"刚刚","time.minutes":"{n}分钟","time.hours":"{n}小时","time.days":"{n}天","time.months":"{n}个月","time.years":"{n}年","time.ago":"{t}前"},Ps={"group.ungrouped":"Ungrouped","session.new":"New Session","section.workspaces":"Workspaces","section.sessions":"Sessions","viewOptions.label":"View options","groupBy.label":"Group by","groupBy.workspace":"WorkSpace","groupBy.flat":"In one list","orderBy.label":"Order by","orderBy.manual":"Manual","orderBy.updated":"Last updated","sessions.expand":"Show {n} more sessions","sessions.collapse":"Show less","empty.none":"No sessions yet","empty.noMatches":"No matches","workspace.add":"Add workspace","search.sessions.aria":"Search sessions","search.placeholder":"Search sessions...","search.clear":"Clear search","search.results.aria":"Search results","search.pending":"Searching session history…","search.unavailable":"Content search is temporarily unavailable. Showing name matches.","search.noMatches":"No matching sessions","search.hasMore":"Showing the first {n} results. Narrow your search.","menu.addWorkspace":"Add workspace…","picker.loading":"Loading workspaces…","conflict.named":"A workspace named “{name}” already exists.","folderError.title":"Couldn’t open folder","folderError.retry":"Choose again",rename:"Rename","rename.workspace.title":"Rename workspace","rename.session.title":"Rename session","field.workspaceName":"Workspace name","field.sessionName":"Session name","delete.workspace":"Delete workspace","delete.desc":"This removes “{name}” from the workspace list. The folder and session logs will be kept. Its sessions will appear under Ungrouped.","delete.pending":"Deleting workspace…","menu.fork":"Fork session","menu.archiveSession":"Archive session","sessions.count.one":"{n} session","sessions.count.other":"{n} sessions","actions.workspace.aria":"Workspace actions for {name}","actions.session.aria":"Session actions for {name}","actions.newSession.aria":"New session in {name}","status.running":"Running","status.subagentsRunning.one":"{n} subagent running","status.subagentsRunning.other":"{n} subagents running","status.idle":"Idle","status.waitingApproval":"Waiting for approval","status.planReview":"Plan awaiting review","status.waitingAnswer":"Waiting for answer","status.completed":"Completed","hover.created":"Created {time}","hover.copied":"Copied","date.ymd":"{y}-{m}-{d}","time.now":"now","time.minutes":"{n}min","time.hours":"{n}h","time.days":"{n}d","time.months":"{n}mo","time.years":"{n}y","time.ago":"{t} ago"},De="workspace",Hs=["slots","sessions","workspaces","locale"];function Ys(e){e.effect(()=>e.locale.register(De,{zh:zs,en:Ps}),"ui-workspace: dictionaries");const t=s(async(a,g)=>{const u=await e.sessions.search(a,g);if(!u.ok)throw new Error(u.error.message);return u.value},"searchSessions"),o=s(a=>({getSnapshot:s(()=>e.slots.entries(a).length>0,"getSnapshot"),subscribe:s(g=>e.slots.subscribe(a,g),"subscribe")}),"flowSource"),r=o("sidebar.workspaces.directoryFlow"),i=o("conversation.hero.workspace.directoryFlow"),l=s(()=>({startSession:s(a=>{e.workspaces.startSession(a)},"startSession"),open:s(a=>{e.sessions.open(a)},"open"),searchSessions:t,searchResultLimit:e.sessions.searchResultLimit,renameSession:s(async(a,g)=>{const u=e.sessions.binding(a)?.session;if(u===void 0)throw new Error(`unknown session "${a}"`);const b=await u.rename(g);if(!b.ok)throw new Error(b.error.message)},"renameSession"),forkSession:s(a=>{e.sessions.fork({sessionId:a,increaseTitle:!0}).then(g=>{e.sessions.open(g)}).catch(()=>{})},"forkSession"),renameWorkspace:s(async(a,g)=>{await e.workspaces.rename(a,g)},"renameWorkspace"),deleteWorkspace:s(async a=>{await e.workspaces.delete(a)},"deleteWorkspace"),insertWorkspaceBefore:s(async(a,g)=>{await e.workspaces.insertBefore(a,g)},"insertWorkspaceBefore"),archiveSession:s(async a=>{await e.workspaces.archiveSession(a)},"archiveSession"),insertSessionBefore:s(async(a,g,u)=>{await e.workspaces.insertSessionBefore(a,g,u)},"insertSessionBefore"),createWorkspace:s(a=>e.workspaces.create(a),"createWorkspace"),hooks:{directoryFlow:r}}),"browserInjected"),d=s(()=>({createWorkspace:s(a=>e.workspaces.create(a),"createWorkspace"),hooks:{directoryFlow:i}}),"pickerInjected");e.slots.inject("sidebar.workspaces",()=>e.slots.register({name:"sidebar.workspaces",children:{"sidebar.workspaces.directoryFlow":{kind:"single",scope:"root"}},store:ws(),inject:l,locale:De},Fs)),e.slots.inject("conversation.hero.workspace",()=>e.slots.register({name:"conversation.hero.workspace",children:{"conversation.hero.workspace.directoryFlow":{kind:"single",scope:"root"}},inject:d,locale:De},As))}return s(Ys,"apply"),_e.apply=Ys,_e.inject=Hs,fe.exports},"factory")});
1
+ var $s=Object.defineProperty;var s=(ae,xe)=>$s(ae,"name",{value:xe,configurable:!0});window.__ModuleLoader__.load({id:"@deepseek-ai/dsh-client-ui-workspace",factory:s(ae=>{var xe={exports:{}},ye=xe.exports;Object.defineProperty(ye,Symbol.toStringTag,{value:"Module"});let fe=ae("@deepseek-ai/dsh-client-runtime/client"),n=ae("react/jsx-runtime"),h=ae("react"),v=ae("@deepseek-ai/dsh-client-ui-primitives");const ie="__flat_session_order__";function ms(){return(0,fe.defineStore)({init:s(()=>({groupBy:"workspace",orderBy:"updated",groupExpansion:{},sessionOrderByAccount:{},sessionUpdatedAtByAccount:{}}),"init"),persist:"dsh.workspace.view.v5",actions:{setGroupBy:s((e,t)=>{e.groupBy=t},"setGroupBy"),setOrderBy:s((e,t)=>{e.orderBy=t},"setOrderBy"),setGroupExpanded:s((e,t,o)=>{e.groupExpansion[t]=o},"setGroupExpanded"),retainAccountKeys:s((e,t)=>{const o=new Set(t);e.groupExpansion=Object.fromEntries(Object.entries(e.groupExpansion).filter(([r])=>o.has(r))),e.sessionOrderByAccount=Object.fromEntries(Object.entries(e.sessionOrderByAccount).filter(([r])=>o.has(r))),e.sessionUpdatedAtByAccount=Object.fromEntries(Object.entries(e.sessionUpdatedAtByAccount).filter(([r])=>o.has(r)))},"retainAccountKeys"),syncSessionOrderAccount:s((e,t,o,r)=>{e.sessionOrderByAccount[t]=o,e.sessionUpdatedAtByAccount[t]=r},"syncSessionOrderAccount"),setSessionOrder:s((e,t,o)=>{e.sessionOrderByAccount[t]=o},"setSessionOrder")}})}s(ms,"createWorkspaceViewStore");function Be(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(o=Be(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}s(Be,"r");function W(){for(var e,t,o=0,r="",i=arguments.length;o<i;o++)(e=arguments[o])&&(t=Be(e))&&(r&&(r+=" "),r+=t);return r}s(W,"clsx");const Oe="Ungrouped";function ws(e){if(e===void 0||e==="")return Oe;const t=e.replace(/[/\\]+$/,"").split(/[/\\]/).pop();return t!==void 0&&t!==""?t:e}s(ws,"workspaceLabel");function me(e,t){return t.updatedAt!==e.updatedAt?t.updatedAt-e.updatedAt:e.id<t.id?-1:1}s(me,"byRecency");function ce(e,t,o){return e.origin!=="subagent"&&!o.has(e.id)&&(!e.blank||e.id===t)}s(ce,"sessionVisible");function Ie(e){return e.blank?"New Session":e.displayTitle}s(Ie,"sessionTitle");function Ce(e,t,o,r,i,l,d){const a=[...l];return d==="recency"&&a.sort(me),{key:e,workspaceId:t,cwd:o,createdAt:r,label:i,sessions:a}}s(Ce,"buildGroup");function gs(e,t){const o=new Map(e.map(l=>[l.id,l])),r=new Set,i=[];for(const l of t){const d=o.get(l);d===void 0||r.has(l)||(i.push(d),r.add(l))}for(const l of[...e].sort(me))r.has(l.id)||i.push(l);return i}s(gs,"orderedUngrouped");function vs(e,t,o,r){const i=[],l=new Set;for(const a of t){const g=[];for(const u of a.sessionIds){const w=e.byId[u];w!==void 0&&(l.add(u),ce(w,e.current,o)&&g.push(w))}i.push(Ce(a.workspaceId,a.workspaceId,a.path,Date.parse(a.createdAt),a.title,g,"account"))}const d=e.ids.map(a=>e.byId[a]).filter(a=>a!==void 0&&!l.has(a.id)&&ce(a,e.current,o));return d.length>0&&i.push(Ce("",void 0,void 0,void 0,Oe,r===void 0?d:gs(d,r),r===void 0?"recency":"account")),i}s(vs,"groupByWorkspace");function De(e,t){return{id:e.id,title:Ie(e),blank:e.blank,running:e.running,runningSubagentCount:t.get(e.id)?.runningCount??0,completed:e.completed===!0,updatedAt:e.updatedAt,...e.pendingInteraction===void 0?{}:{pendingInteraction:e.pendingInteraction}}}s(De,"sessionNode");function bs(e,t,o,r){const i=new Set(o),l=new Set(r.expandedGroups),d=(0,fe.indexSubagentDescendants)(e.byId),a=e.current===void 0?void 0:t.find(u=>u.sessionIds.includes(e.current))?.workspaceId??"",g=[];for(const u of vs(e,t,i,r.ungroupedOrder)){const w=l.has(u.key);g.push({key:u.key,workspaceId:u.workspaceId,cwd:u.cwd,createdAt:u.createdAt,label:u.label,sessionCount:u.sessions.length,expanded:w,containsCurrent:u.key===a,sessions:w?u.sessions.map(_=>De(_,d)):[]})}return g}s(bs,"deriveGroups");function _s(e,t){const o=new Set(t),r=(0,fe.indexSubagentDescendants)(e.byId),i=[];for(const l of e.ids){const d=e.byId[l];d===void 0||!ce(d,e.current,o)||i.push(d)}return i.sort(me),i.map(l=>De(l,r))}s(_s,"deriveFlat");function ys(e,t,o,r,i,l){const d=o.trim().toLowerCase();if(d==="")return{items:[],hasMore:!1};const a=new Set(r),g=(0,fe.indexSubagentDescendants)(e.byId),u=new Map;for(const m of t)for(const k of m.sessionIds)u.has(k)||u.set(k,m.title);const w=s(m=>u.get(m.id)??ws(m.cwd),"labelOf"),_=new Map;for(const m of i.items)_.has(m.sessionId)||_.set(m.sessionId,m);const y=[];for(const m of e.ids){const k=e.byId[m];k===void 0||k.blank||!ce(k,e.current,a)||(Ie(k).toLowerCase().includes(d)||w(k).toLowerCase().includes(d))&&y.push(k)}y.sort(me);const I=[],O=new Set,N=s(m=>{O.has(m.id)||(O.add(m.id),I.push(m))},"include");for(const m of y)N(m);for(const m of i.items){const k=e.byId[m.sessionId];k!==void 0&&!k.blank&&ce(k,e.current,a)&&N(k)}return{items:I.slice(0,l).map(m=>{const k=_.get(m.id);return{id:m.id,title:Ie(m),workspace:w(m),running:m.running,runningSubagentCount:g.get(m.id)?.runningCount??0,...m.pendingInteraction===void 0?{}:{pendingInteraction:m.pendingInteraction},completed:m.completed===!0,...k===void 0?{}:{snippet:k.snippet}}}),hasMore:i.hasMore||I.length>l}}s(ys,"deriveSearchResults");function Te(e,t){const l=Math.max(0,t-e);return l<6e4?{unit:"now",n:0}:l<36e5?{unit:"minutes",n:Math.floor(l/6e4)}:l<864e5?{unit:"hours",n:Math.floor(l/36e5)}:l<30*864e5?{unit:"days",n:Math.floor(l/864e5)}:l<365*864e5?{unit:"months",n:Math.floor(l/(30*864e5))}:{unit:"years",n:Math.floor(l/(365*864e5))}}s(Te,"relativeTime");const Is='.ex-ixa_projectRow,.ex-ixa_sessionRow{cursor:pointer;user-select:none;color:var(--dsw-alias-label-primary);border-radius:8px;align-items:center;gap:6px;padding:0 8px;display:flex}.ex-ixa_projectRow:hover,.ex-ixa_sessionRow:hover,.ex-ixa_sessionRow.ex-ixa_selected{background:var(--dsw-alias-interactive-bg-hover)}.ex-ixa_searchResultRow{box-sizing:border-box;cursor:pointer;text-align:left;width:100%;min-height:48px;color:var(--dsw-alias-label-primary);background:0 0;border:none;border-radius:8px;flex-direction:column;align-items:stretch;padding:4px 8px;display:flex}.ex-ixa_searchResultRow:hover,.ex-ixa_searchResultRow.ex-ixa_selected{background:var(--dsw-alias-interactive-bg-hover)}.ex-ixa_searchResultHeading{align-items:center;min-width:0;display:flex}.ex-ixa_searchResultTitle{text-overflow:ellipsis;white-space:nowrap;min-width:0;margin-left:4px;font-size:14px;line-height:20px;overflow:hidden}.ex-ixa_searchResultMeta{align-items:center;gap:6px;min-width:0;margin-left:20px;display:flex}.ex-ixa_searchResultWorkspace,.ex-ixa_searchResultSnippet{text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:17px;overflow:hidden}.ex-ixa_searchResultWorkspace{max-width:40%;color:var(--dsw-alias-label-tertiary);flex:none}.ex-ixa_searchResultSnippet{min-width:0;color:var(--dsw-alias-label-secondary);flex:1}.ex-ixa_projectRow{box-sizing:border-box;align-items:center;height:34px}.ex-ixa_projectRow .ex-ixa_rowActions{height:20px}.ex-ixa_sessionRow{height:32px;animation:ex-ixa_row-in .15s var(--ds-ease-in-out);gap:0}.ex-ixa_sessionRow .ex-ixa_title{margin:0 6px 0 4px}.ex-ixa_flatSessionRowWithoutStatus .ex-ixa_title{margin-left:0}@keyframes ex-ixa_row-in{0%{opacity:0}}.ex-ixa_slot{width:16px;height:20px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;display:inline-flex}.ex-ixa_visuallyHidden{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.ex-ixa_folderActive{color:var(--dsw-alias-state-business-primary)}.ex-ixa_projectRow .ex-ixa_chevron{display:none}.ex-ixa_projectRow:hover .ex-ixa_chevron{display:inline-flex}.ex-ixa_projectRow:hover .ex-ixa_folder{display:none}.ex-ixa_arrow{transition:transform .15s var(--ds-ease-in-out)}.ex-ixa_arrowOpen{transform:rotate(90deg)}.ex-ixa_projectText{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.ex-ixa_title{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:14px;line-height:20px;overflow:hidden}.ex-ixa_renameInput{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-button-elevated-fill);min-width:0;color:inherit;border-radius:4px;outline:none;padding:0 2px;font-size:14px;line-height:20px}.ex-ixa_sessionRow .ex-ixa_title{flex:1}.ex-ixa_meta{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px;overflow:hidden}.ex-ixa_time{color:var(--dsw-alias-label-tertiary);flex:none;font-size:12px;line-height:20px}.ex-ixa_dot{flex:none}.ex-ixa_rowActions{flex:none;align-items:center;gap:12px;display:none}.ex-ixa_projectRow:hover .ex-ixa_rowActions,.ex-ixa_sessionRow:hover .ex-ixa_rowActions,.ex-ixa_projectRow.ex-ixa_menuOpen .ex-ixa_rowActions,.ex-ixa_sessionRow.ex-ixa_menuOpen .ex-ixa_rowActions{display:inline-flex}.ex-ixa_sessionRow:hover .ex-ixa_time,.ex-ixa_sessionRow.ex-ixa_menuOpen .ex-ixa_time{display:none}.ex-ixa_projectRow.ex-ixa_menuOpen,.ex-ixa_sessionRow.ex-ixa_menuOpen{background:var(--dsw-alias-interactive-bg-hover)}.ex-ixa_sessionRow.ex-ixa_dropBefore,.ex-ixa_sessionRow.ex-ixa_dropAfter{position:relative}.ex-ixa_sessionRow.ex-ixa_dropBefore:before,.ex-ixa_sessionRow.ex-ixa_dropAfter:after{content:"";z-index:1;background:linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat, linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat, linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;pointer-events:none;height:12px;position:absolute;left:0;right:4px}.ex-ixa_sessionRow.ex-ixa_dropBefore:before{top:-7px}.ex-ixa_sessionRow.ex-ixa_dropAfter:after{bottom:-7px}.ex-ixa_hoverContent{flex-direction:column;gap:8px;display:flex}.ex-ixa_hoverTitle{color:#fff;overflow-wrap:break-word;font-size:14px;line-height:20px}.ex-ixa_hoverPath{color:#cfd3d6;word-break:break-all;font-size:12px;line-height:16px}.ex-ixa_hoverTime{color:#cfd3d6;font-size:12px;line-height:16px}.ex-ixa_hoverStatus{color:#adb2b8;align-items:center;gap:8px;font-size:12px;line-height:20px;display:flex}.ex-ixa_iconButton{cursor:pointer;width:16px;height:16px;color:var(--dsw-alias-label-tertiary);background:0 0;border:none;border-radius:4px;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.ex-ixa_iconButton:hover{color:var(--dsw-alias-label-primary)}.ex-ixa_chevron{color:var(--dsw-alias-label-caption)}@media (prefers-reduced-motion:reduce){.ex-ixa_sessionRow,.ex-ixa_arrow{transition:none;animation:none}}',We="@deepseek-ai/dsh-client-ui-workspace/Rows.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(We)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-workspace",e.dataset.pluginCss=We,e.textContent=Is,document.head.appendChild(e)}var b={renameInput:"ex-ixa_renameInput",iconButton:"ex-ixa_iconButton",meta:"ex-ixa_meta",chevron:"ex-ixa_chevron",time:"ex-ixa_time",arrow:"ex-ixa_arrow",rowActions:"ex-ixa_rowActions",searchResultWorkspace:"ex-ixa_searchResultWorkspace",flatSessionRowWithoutStatus:"ex-ixa_flatSessionRowWithoutStatus",menuOpen:"ex-ixa_menuOpen",folder:"ex-ixa_folder",dot:"ex-ixa_dot",title:"ex-ixa_title",hoverPath:"ex-ixa_hoverPath","row-in":"ex-ixa_row-in",visuallyHidden:"ex-ixa_visuallyHidden",slot:"ex-ixa_slot",hoverTitle:"ex-ixa_hoverTitle",folderActive:"ex-ixa_folderActive",searchResultHeading:"ex-ixa_searchResultHeading",sessionRow:"ex-ixa_sessionRow",searchResultRow:"ex-ixa_searchResultRow",searchResultSnippet:"ex-ixa_searchResultSnippet",projectRow:"ex-ixa_projectRow",arrowOpen:"ex-ixa_arrowOpen",hoverStatus:"ex-ixa_hoverStatus",dropAfter:"ex-ixa_dropAfter",hoverTime:"ex-ixa_hoverTime",searchResultTitle:"ex-ixa_searchResultTitle",searchResultMeta:"ex-ixa_searchResultMeta",selected:"ex-ixa_selected",hoverContent:"ex-ixa_hoverContent",dropBefore:"ex-ixa_dropBefore",projectText:"ex-ixa_projectText"};function Fe(e,t){return e.blank?t("session.new"):e.title}s(Fe,"displayTitle");function ks(e,t,o){const{unit:r,n:i}=Te(e,t);return r==="now"?o("time.now"):o(`time.${r}`,{n:i})}s(ks,"timeLabel");function Es(e,t,o){const{unit:r,n:i}=Te(e,t);return r==="now"?o("time.now"):o("time.ago",{t:o(`time.${r}`,{n:i})})}s(Es,"hoverTimeLabel");function Ss(e,t){const o=new Date(e),r=s(i=>String(i).padStart(2,"0"),"pad2");return t("hover.created",{time:`${t("date.ymd",{y:o.getFullYear(),m:o.getMonth()+1,d:o.getDate()})} ${r(o.getHours())}:${r(o.getMinutes())}`})}s(Ss,"createdLabel");function Ms({label:e,cwd:t,createdAt:o,t:r}){return(0,n.jsxs)("div",{className:b.hoverContent,children:[(0,n.jsx)("div",{className:b.hoverTitle,children:e}),(0,n.jsx)("div",{className:b.hoverPath,children:t}),(0,n.jsx)("div",{className:b.hoverTime,children:Ss(o,r)})]})}s(Ms,"WorkspaceHoverContent");function ze(e){const t=e.currentTarget.getBoundingClientRect();return e.clientY<t.top+t.height/2?"before":"after"}s(ze,"rowHalf");function js({group:e,onToggle:t,onCreate:o,actions:r,drag:i,t:l}){const d=e,a=d.workspaceId===void 0?l("group.ungrouped"):d.label,g=e.expanded&&e.containsCurrent,[u,w]=(0,h.useState)(!1),_=[{id:"rename",label:l("rename"),icon:(0,n.jsx)(v.IconEditOutline16,{})},{id:"delete",label:l("delete.workspace"),icon:(0,n.jsx)(v.IconTrashOutline16,{}),danger:!0}],y=(0,n.jsxs)("div",{className:W(b.projectRow,u&&b.menuOpen),role:"treeitem","aria-expanded":d.expanded,onClick:t,draggable:i!==void 0,onDragStart:i===void 0?void 0:I=>{I.dataTransfer.effectAllowed="move",I.dataTransfer.setData("text/plain",d.key),i.start()},onDragEnd:i?.end,children:[(0,n.jsx)("span",{className:W(b.slot,b.folder,g&&b.folderActive),children:d.expanded?(0,n.jsx)(v.IconFolderOpen16,{}):(0,n.jsx)(v.IconFolderClose16,{})}),(0,n.jsx)("span",{className:W(b.slot,b.chevron),children:(0,n.jsx)(v.IconTriangleRightFill14,{className:W(b.arrow,d.expanded&&b.arrowOpen)})}),(0,n.jsx)("span",{className:b.projectText,children:(0,n.jsx)("span",{className:b.title,children:a})}),(0,n.jsxs)("span",{className:b.rowActions,children:[r!==void 0&&(0,n.jsx)(v.Menu,{open:u,onClose:s(()=>{w(!1)},"onClose"),items:_,onSelect:s(I=>{w(!1),!(I!=="rename"&&I!=="delete")&&(I==="rename"?r.rename():r.delete())},"onSelect"),portal:!0,closeOnPointerLeave:!0,anchor:(0,n.jsx)("button",{type:"button",className:b.iconButton,"aria-label":l("actions.workspace.aria",{name:a}),onClick:s(I=>{I.stopPropagation(),w(O=>!O)},"onClick"),children:(0,n.jsx)(v.IconEllipsisOutline16,{})})}),(0,n.jsx)("button",{type:"button",className:b.iconButton,"aria-label":l("actions.newSession.aria",{name:a}),onClick:s(I=>{I.stopPropagation(),o()},"onClick"),children:(0,n.jsx)(v.IconPlusOutline16,{})})]})]});return d.createdAt===void 0?y:(0,n.jsx)(v.HoverCard,{anchor:y,content:(0,n.jsx)(Ms,{label:d.label,cwd:d.cwd,createdAt:d.createdAt,t:l}),disabled:u,copyText:d.cwd,copyLabel:l("copy"),copiedLabel:l("hover.copied")})}s(js,"ProjectRowItem");function Ls(e){throw new Error(`unknown pending interaction: ${String(e)}`)}s(Ls,"assertNever");function ke(e,t){const o=e.runningSubagentCount===0?void 0:{state:"ongoing",label:t(e.runningSubagentCount===1?"status.subagentsRunning.one":"status.subagentsRunning.other",{n:e.runningSubagentCount})};let r;switch(e.pendingInteraction){case"approval":r={state:"warning",label:t("status.waitingApproval")};break;case"plan-review":r={state:"warning",label:t("status.planReview")};break;case"question":r={state:"warning",label:t("status.waitingAnswer")};break;case void 0:break;default:return Ls(e.pendingInteraction)}if(r!==void 0)return o===void 0?[r]:[r,o];if(e.running){const i={state:"ongoing",label:t("status.running")};return o===void 0?[i]:[i,o]}return o!==void 0?[o]:e.completed?[{state:"done",label:t("status.completed")}]:[{state:"done",label:t("status.idle")}]}s(ke,"sessionStatuses");function Pe({statuses:e}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.StateDot,{state:e[0].state}),e.map(t=>(0,n.jsx)("span",{className:b.visuallyHidden,children:t.label},t.label))]})}s(Pe,"SessionStatusDots");function Rs({node:e,now:t,t:o}){const r=ke(e,o);return(0,n.jsxs)("div",{className:b.hoverContent,children:[(0,n.jsx)("div",{className:b.hoverTitle,children:Fe(e,o)}),!e.blank&&(0,n.jsx)("div",{className:b.hoverTime,children:Es(e.updatedAt,t,o)}),r.map(i=>(0,n.jsxs)("div",{className:b.hoverStatus,children:[(0,n.jsx)(v.StateDot,{state:i.state}),(0,n.jsx)("span",{children:i.label})]},i.label))]})}s(Rs,"SessionHoverContent");function Gs({result:e,currentId:t,onOpen:o,t:r}){const i=e.id===t,l=ke(e,r),d=l[0];return(0,n.jsxs)("button",{type:"button",className:W(b.searchResultRow,i&&b.selected),role:"treeitem","aria-selected":i,onClick:s(()=>{o(e.id)},"onClick"),children:[(0,n.jsxs)("span",{className:b.searchResultHeading,children:[(0,n.jsx)("span",{className:b.slot,children:(d.state!=="done"||e.completed)&&(0,n.jsx)(Pe,{statuses:l})}),(0,n.jsx)("span",{className:b.searchResultTitle,children:e.title})]}),(0,n.jsxs)("span",{className:b.searchResultMeta,children:[(0,n.jsx)("span",{className:b.searchResultWorkspace,children:e.workspace}),e.snippet!==void 0&&(0,n.jsx)("span",{className:b.searchResultSnippet,children:e.snippet})]})]})}s(Gs,"SearchResultItem");function He({node:e,currentId:t,now:o,onOpen:r,onRename:i,onFork:l,onArchive:d,drag:a,flat:g=!1,t:u}){const w=e,_=Fe(e,u),y=e.id===t,I=ke(e,u),O=I[0].state!=="done"||w.completed,[N,m]=(0,h.useState)(!1),k=[{id:"rename",label:u("rename"),icon:(0,n.jsx)(v.IconEditOutline16,{})},{id:"fork",label:u("menu.fork"),icon:(0,n.jsx)(v.IconBranchOutline16,{})},{id:"archive",label:u("menu.archiveSession"),icon:(0,n.jsx)(v.IconArchiveOutline20,{size:16})}],U=(0,n.jsxs)("div",{className:W(b.sessionRow,y&&b.selected,N&&b.menuOpen,g&&!O&&b.flatSessionRowWithoutStatus,a?.marker==="before"&&b.dropBefore,a?.marker==="after"&&b.dropAfter),role:"treeitem","aria-selected":y,onClick:s(()=>{r(e.id)},"onClick"),draggable:a!==void 0,onDragStart:a===void 0?void 0:S=>{S.dataTransfer.effectAllowed="move",S.dataTransfer.setData("text/plain",e.id),a.start()},onDragEnd:a?.end,onDragOver:a===void 0?void 0:S=>{a.active&&(S.preventDefault(),S.dataTransfer.dropEffect="move",a.hover(ze(S)))},onDrop:a===void 0?void 0:S=>{a.active&&(S.preventDefault(),a.drop(ze(S)))},children:[(!g||O)&&(0,n.jsx)("span",{className:b.slot,children:O&&(0,n.jsx)(Pe,{statuses:I})}),(0,n.jsx)("span",{className:b.title,children:_}),!w.blank&&(0,n.jsx)("span",{className:b.time,children:ks(w.updatedAt,o,u)}),!w.blank&&(0,n.jsx)("span",{className:b.rowActions,children:(0,n.jsx)(v.Menu,{open:N,onClose:s(()=>{m(!1)},"onClose"),items:k,onSelect:s(S=>{m(!1),S==="rename"&&i(e.id,w.title),S==="fork"&&l(e.id),S==="archive"&&d(e.id)},"onSelect"),portal:!0,closeOnPointerLeave:!0,anchor:(0,n.jsx)("button",{type:"button",className:b.iconButton,"aria-label":u("actions.session.aria",{name:_}),onClick:s(S=>{S.stopPropagation(),m(f=>!f)},"onClick"),children:(0,n.jsx)(v.IconEllipsisOutline16,{})})})})]});return(0,n.jsx)(v.HoverCard,{anchor:U,content:(0,n.jsx)(Rs,{node:e,now:o,t:u}),disabled:N||a?.active===!0,copyText:w.blank?void 0:w.title,copyLabel:u("copy"),copiedLabel:u("hover.copied")})}s(He,"SessionNodeItem");const As="._3ZwE_W_modalAction{min-width:72px}._3ZwE_W_modalError,._3ZwE_W_menuStatus{margin-top:8px;font-size:12px;line-height:18px}._3ZwE_W_modalError{color:var(--dsw-alias-state-error-primary)}._3ZwE_W_menuStatus{color:var(--dsw-alias-label-secondary)}",Ue="@deepseek-ai/dsh-client-ui-workspace/WorkspacePicker.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify(Ue)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-workspace",e.dataset.pluginCss=Ue,e.textContent=As,document.head.appendChild(e)}var we={modalError:"_3ZwE_W_modalError",menuStatus:"_3ZwE_W_menuStatus",modalAction:"_3ZwE_W_modalAction"};const Ke="::add-workspace";function Ye({t:e,open:t,anchorRef:o,useWorkspaces:r,createWorkspace:i,useDirectoryFlow:l,renderDirectoryFlow:d,onPick:a,onClose:g,addOnly:u=!1,side:w="bottom",selectedId:_}){const y=r(G=>G),I=y.items,O=(0,h.useCallback)(()=>o?.current?.getBoundingClientRect()??null,[o]),[N,m]=(0,h.useState)(!1),[k,U]=(0,h.useState)(null),[S,f]=(0,h.useState)(!1),[F,j]=(0,h.useState)(!1),Z=S||F,L=l(G=>G);(0,h.useEffect)(()=>{S&&!L&&f(!1)},[S,L]);const R=L?[{id:Ke,label:e("menu.addWorkspace"),icon:(0,n.jsx)(v.IconPlusOutline16,{size:16}),disabled:Z}]:[],z=!u&&I.length>0,D=z?I.map(G=>({id:G.workspaceId,label:G.title,icon:(0,n.jsx)(v.IconFolderClose16,{size:16}),disabled:Z})):R,K=D.length===0,J=s(()=>{m(!1),U(null)},"closeModal"),T=s(G=>i({path:G}).then(se=>{f(!1),a(se.workspaceId)}).catch(se=>{U(se instanceof Error?se.message:String(se)),f(!1),m(!0)}),"adoptDirectory"),X=(0,h.useCallback)(()=>{g(),m(!1),U(null),f(!0)},[g]),P=u||y.phase==="ready",Y=!z&&P&&R.length===1;(0,h.useEffect)(()=>{t&&Y&&!Z&&X()},[t,Y,Z,X]);const $={open:S,busy:F,onPicked:s(G=>{j(!0),T(G).finally(()=>{j(!1)})},"onPicked"),onCancel:s(()=>{f(!1)},"onCancel"),onError:s(G=>{f(!1),U(G),m(!0)},"onError")},de=s(G=>{if(G===Ke){X();return}a(G)},"handleSelect");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.Menu,{open:t&&!Y&&!K,anchor:null,items:D,...z?{footer:R}:{},selectedId:_,onSelect:de,onClose:g,side:w,portal:!0,getAnchorRect:O}),t&&!Y&&!K&&y.phase==="pending"&&(0,n.jsx)("div",{className:we.menuStatus,role:"status",children:e("picker.loading")}),d($),(0,n.jsx)(v.Modal,{open:N,onClose:J,closeLabel:e("close"),title:e("folderError.title"),footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.Button,{variant:"outline",className:we.modalAction,onClick:J,children:e("cancel")}),(0,n.jsx)(v.Button,{variant:"primary",className:we.modalAction,disabled:!L,onClick:X,children:e("folderError.retry")})]}),children:(0,n.jsx)("div",{className:we.modalError,role:"alert",children:k})})]})}s(Ye,"WorkspacePickFlow");function Zs({open:e,anchorRef:t,useWorkspaces:o,selectedId:r,onPick:i,onClose:l,createWorkspace:d,useDirectoryFlow:a,renderSlot:g,t:u}){return(0,n.jsx)(Ye,{t:u,open:e,anchorRef:t,useWorkspaces:o,createWorkspace:d,useDirectoryFlow:a,renderDirectoryFlow:s(w=>g("conversation.hero.workspace.directoryFlow",w),"renderDirectoryFlow"),selectedId:r,onPick:i,onClose:l})}s(Zs,"WorkspacePicker");const Ns='.EMZLIG_root{--dsh-session-list-edge-inset:var(--dsh-sidebar-inline-padding);--dsh-session-list-scrollbar-width:8px;--dsh-session-list-scrollbar-offset:2px;box-sizing:border-box;min-height:0;padding-right:var(--dsh-session-list-edge-inset);flex-direction:column;flex:1;display:flex}.EMZLIG_root.EMZLIG_rail{padding-right:0}.EMZLIG_iconButton{cursor:pointer;width:28px;height:28px;color:var(--dsw-alias-label-secondary);background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.EMZLIG_iconButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.EMZLIG_sectionHeader{box-sizing:border-box;height:36px;color:var(--dsw-alias-label-tertiary);border-radius:12px;flex:none;justify-content:flex-end;align-items:center;gap:4px;margin-bottom:4px;padding-left:4px;display:flex;overflow:hidden}.EMZLIG_root:not(.EMZLIG_rail) .EMZLIG_sectionHeader{margin-top:2px;margin-right:-4px}.EMZLIG_sectionLabel{white-space:nowrap;opacity:1;visibility:visible;min-width:0;max-width:45%;transition:max-width .18s var(--ds-ease-in-out), margin-right .18s var(--ds-ease-in-out), opacity .12s var(--ds-ease-in-out), transform .18s var(--ds-ease-in-out), visibility 0s linear;flex:none;line-height:20px;overflow:hidden}.EMZLIG_sectionLabelHidden{opacity:0;visibility:hidden;max-width:0;margin-right:-4px;transition-delay:0s,0s,0s,0s,.18s;transform:translate(-4px)}.EMZLIG_searchSlot{box-sizing:border-box;min-width:0;max-width:28px;transition:max-width .18s var(--ds-ease-in-out), padding-left .18s var(--ds-ease-in-out);flex:1;align-items:center;margin-left:auto;padding-left:0;display:flex}.EMZLIG_searchSlotExpanded{max-width:100%;padding-left:0}.EMZLIG_headerActions{opacity:1;visibility:visible;max-width:60px;transition:max-width .18s var(--ds-ease-in-out), opacity .12s var(--ds-ease-in-out), transform .18s var(--ds-ease-in-out), visibility 0s linear;flex:none;align-items:center;gap:4px;display:flex;overflow:hidden}.EMZLIG_headerActionsHidden{opacity:0;visibility:hidden;pointer-events:none;max-width:0;transition-delay:0s,0s,0s,.18s;transform:translate(4px)}.EMZLIG_search{box-sizing:border-box;cursor:text;width:100%;height:28px;color:var(--dsw-alias-label-secondary);transition:width .18s var(--ds-ease-in-out), padding .18s var(--ds-ease-in-out), border-color .18s var(--ds-ease-in-out), background-color .18s var(--ds-ease-in-out);background:0 0;border:none;border-radius:50%;flex:none;align-items:center;gap:0;margin:0;padding:0;display:flex;overflow:hidden}.EMZLIG_searchExpanded{border:1px solid var(--dsw-alias-border-l2);width:calc(100% + 4px);height:30px;color:var(--dsw-alias-label-caption);background:0 0;border-radius:10px;margin-inline:-2px;padding:0 4px 0 0}.EMZLIG_searchButton{cursor:pointer;width:28px;height:28px;color:inherit;background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.EMZLIG_searchExpanded .EMZLIG_searchButton{width:28px;height:30px}.EMZLIG_searchButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.EMZLIG_searchExpanded .EMZLIG_searchButton:hover{background:0 0}.EMZLIG_searchInput{opacity:0;pointer-events:none;width:0;min-width:0;color:var(--dsw-alias-label-primary);transition:opacity .12s var(--ds-ease-in-out);background:0 0;border:none;outline:none;flex:1;font-size:13px;line-height:18px}.EMZLIG_searchExpanded .EMZLIG_searchInput{opacity:1;pointer-events:auto;margin-left:-2px}.EMZLIG_searchInput::placeholder{color:var(--dsw-alias-label-tertiary)}.EMZLIG_clearButton{cursor:pointer;width:24px;height:24px;color:var(--dsw-alias-label-secondary);background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.EMZLIG_clearButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.EMZLIG_rail .EMZLIG_sectionHeader{justify-content:flex-start;gap:0;margin-bottom:12px;padding-left:0}.EMZLIG_rail .EMZLIG_headerActions{max-width:none}.EMZLIG_rail .EMZLIG_iconButton{width:36px;height:36px;color:var(--dsw-alias-label-primary)}.EMZLIG_rail .EMZLIG_search{background:0 0;border-color:#0000;gap:0;width:36px;height:36px;margin:0 0 12px;padding:0}.EMZLIG_rail .EMZLIG_searchButton{width:36px;height:36px;color:var(--dsw-alias-label-primary)}.EMZLIG_rail .EMZLIG_searchButton:hover{background:var(--dsw-alias-interactive-bg-hover)}.EMZLIG_listArea{min-height:0;margin-left:-4px;margin-right:calc(-1 * var(--dsh-session-list-edge-inset));flex-direction:column;flex:1;padding-left:4px;display:flex;overflow:visible}.EMZLIG_rail .EMZLIG_listArea{margin-left:0;margin-right:0;padding-left:0}.EMZLIG_treeBody{flex-direction:column;flex:1;min-height:0;display:flex;position:relative}.EMZLIG_fade{left:0;right:var(--dsh-session-list-edge-inset);background:linear-gradient(to bottom, transparent, var(--dsw-specific-sidebar-fill));pointer-events:none;height:24px;position:absolute;bottom:0}.EMZLIG_wide{animation:EMZLIG_wide-in .2s var(--ds-ease-in-out)}@keyframes EMZLIG_wide-in{0%{opacity:0}}.EMZLIG_list{min-height:0;margin-left:-4px;margin-right:var(--dsh-session-list-scrollbar-offset);padding-left:4px;padding-right:calc(var(--dsh-session-list-edge-inset) - var(--dsh-session-list-scrollbar-width) - var(--dsh-session-list-scrollbar-offset));scrollbar-gutter:stable;flex:1;padding-bottom:16px;overflow-y:auto}.EMZLIG_flatList>*+*,.EMZLIG_searchTree>[role=treeitem]+[role=treeitem],.EMZLIG_groupSection>*+*{margin-top:2px}.EMZLIG_searchStatus,.EMZLIG_searchWarning{color:var(--dsw-alias-label-tertiary);padding:10px 12px;font-size:12px;line-height:18px}.EMZLIG_searchWarning{color:var(--dsw-alias-label-secondary)}.EMZLIG_groupSection{position:relative}.EMZLIG_groupSection+.EMZLIG_groupSection{margin-top:4px}.EMZLIG_listTopDropIndicator,.EMZLIG_workspaceDropBefore:before,.EMZLIG_workspaceDropAfter:after{content:"";z-index:1;background:linear-gradient(55deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 0 / 5px 7px no-repeat, linear-gradient(125deg, transparent calc(50% - 1px), var(--dsw-alias-state-business-primary) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) 0 5px / 5px 7px no-repeat, linear-gradient(var(--dsw-alias-state-business-primary) 0 0) 4px 5px / calc(100% - 4px) 2px no-repeat;pointer-events:none;height:12px;position:absolute;left:0;right:0}.EMZLIG_listTopDropIndicator{top:-8px;left:0;right:var(--dsh-session-list-edge-inset)}.EMZLIG_listTopDropActive>.EMZLIG_workspaceDropBefore:first-child:before{display:none}.EMZLIG_workspaceDropBefore:before{top:-8px}.EMZLIG_workspaceDropAfter:after{bottom:-8px}.EMZLIG_sessionOverflowButton{cursor:pointer;text-align:left;width:100%;height:28px;color:var(--dsw-alias-label-tertiary);background:0 0;border:none;border-radius:8px;padding:0 12px 0 28px;font-size:12px}.EMZLIG_groupSection>.EMZLIG_sessionOverflowButton{margin-top:0}.EMZLIG_sessionOverflowButton:hover{color:var(--dsw-alias-label-secondary);background:0 0}.EMZLIG_empty{color:var(--dsw-alias-label-tertiary);padding:16px 12px;font-size:13px}.EMZLIG_renameInput{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);width:100%;height:44px;color:var(--dsw-alias-label-primary);background:0 0;border-radius:22px;outline:none;padding:7px 14px;font-size:14px;font-weight:400;line-height:22px}.EMZLIG_renameInput:disabled{color:var(--dsw-alias-label-dimmed)}.EMZLIG_renameError{color:var(--dsw-alias-state-error-primary);margin-top:8px;font-size:12px;line-height:18px}.EMZLIG_deleteAction:not(:disabled){color:var(--dsw-alias-state-error-primary)}.EMZLIG_deleteStatus{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}@media (prefers-reduced-motion:reduce){.EMZLIG_wide{animation:none}.EMZLIG_search,.EMZLIG_sectionLabel,.EMZLIG_searchSlot,.EMZLIG_searchInput,.EMZLIG_headerActions{transition:none}}',$e="@deepseek-ai/dsh-client-ui-workspace/WorkspaceBrowser.module.css";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify($e)+"]")===null){const e=document.createElement("style");e.dataset.plugin="@deepseek-ai/dsh-client-ui-workspace",e.dataset.pluginCss=$e,e.textContent=Ns,document.head.appendChild(e)}var x={groupSection:"EMZLIG_groupSection",iconButton:"EMZLIG_iconButton",search:"EMZLIG_search",listTopDropIndicator:"EMZLIG_listTopDropIndicator",deleteAction:"EMZLIG_deleteAction",searchExpanded:"EMZLIG_searchExpanded",listTopDropActive:"EMZLIG_listTopDropActive",searchButton:"EMZLIG_searchButton",sectionLabelHidden:"EMZLIG_sectionLabelHidden",headerActionsHidden:"EMZLIG_headerActionsHidden",renameInput:"EMZLIG_renameInput",renameError:"EMZLIG_renameError",searchSlot:"EMZLIG_searchSlot",rail:"EMZLIG_rail",fade:"EMZLIG_fade",searchTree:"EMZLIG_searchTree",searchInput:"EMZLIG_searchInput",wide:"EMZLIG_wide",searchSlotExpanded:"EMZLIG_searchSlotExpanded",root:"EMZLIG_root",treeBody:"EMZLIG_treeBody",list:"EMZLIG_list",sectionHeader:"EMZLIG_sectionHeader",sectionLabel:"EMZLIG_sectionLabel",clearButton:"EMZLIG_clearButton",searchWarning:"EMZLIG_searchWarning",searchStatus:"EMZLIG_searchStatus",workspaceDropAfter:"EMZLIG_workspaceDropAfter",sessionOverflowButton:"EMZLIG_sessionOverflowButton",deleteStatus:"EMZLIG_deleteStatus",workspaceDropBefore:"EMZLIG_workspaceDropBefore","wide-in":"EMZLIG_wide-in",listArea:"EMZLIG_listArea",headerActions:"EMZLIG_headerActions",empty:"EMZLIG_empty",flatList:"EMZLIG_flatList"};const Bs=300,Os=250,Ee=500,Se=5;function qe(e){const t=e.replaceAll("\0","");if(t.length<=Ee)return t;let o=Ee;const r=t.charCodeAt(o-1),i=t.charCodeAt(o);return r>=55296&&r<=56319&&i>=56320&&i<=57343&&o--,t.slice(0,o)}s(qe,"sanitizeSearchQuery");function Cs(e,t){return e.includes(t)?e.filter(o=>o!==t):[...e,t]}s(Cs,"toggled");function Ve(e){(0,h.useEffect)(()=>{if(!e)return;const t=s(r=>{r.preventDefault(),r.dataTransfer!==null&&(r.dataTransfer.dropEffect="move")},"acceptDrag"),o=s(r=>{r.preventDefault()},"acceptDrop");return document.addEventListener("dragover",t),document.addEventListener("drop",o),()=>{document.removeEventListener("dragover",t),document.removeEventListener("drop",o)}},[e])}s(Ve,"useNativeDragAcceptance");function ge(e,t){if(t===void 0)return[...e];const o=new Map(e.map(l=>[l,l])),r=[],i=new Set;for(const l of t){const d=o.get(l);d===void 0||i.has(l)||(r.push(d),i.add(l))}for(const l of e)i.has(l)||r.push(l);return r}s(ge,"reconciledSessionOrder");function Qe(e,t,o){const r=o[e]?.updatedAt??Number.NEGATIVE_INFINITY,i=o[t]?.updatedAt??Number.NEGATIVE_INFINITY;return r!==i?i-r:e<t?-1:1}s(Qe,"compareSessionRecency");function Je({sessionIds:e,previousOrder:t,previousUpdatedAt:o,list:r,orderBy:i,sortByRecency:l}){let d=ge(e,t);if(l)d.sort((w,_)=>Qe(w,_,r.byId));else if(i==="updated"){const w=e.filter(_=>{const y=r.byId[_];return y!==void 0&&(o[_]===void 0||y.updatedAt>o[_])}).sort((_,y)=>Qe(_,y,r.byId));if(w.length>0){const _=new Set(w);d=[...w,...d.filter(y=>!_.has(y))]}}const a={};for(const w of e){const _=r.byId[w];_!==void 0&&(a[w]=_.updatedAt)}const g=t===void 0||d.length!==t.length||d.some((w,_)=>w!==t[_]),u=Object.keys(a).length!==Object.keys(o).length||Object.entries(a).some(([w,_])=>o[w]!==_);return{order:d,updatedAt:a,changed:g||u}}s(Je,"nextSessionOrderAccount");function Ds({groupBy:e,orderBy:t,onGroupPick:o,onOrderPick:r,t:i}){const[l,d]=(0,h.useState)(!1);return(0,n.jsx)(v.Menu,{open:l,onClose:s(()=>{d(!1)},"onClose"),items:[{type:"label",id:"group-by",text:i("groupBy.label")},{id:"workspace",label:i("groupBy.workspace")},{id:"flat",label:i("groupBy.flat")},{type:"separator",id:"order-by-separator"},{type:"label",id:"order-by",text:i("orderBy.label")},{id:"manual",label:i("orderBy.manual")},{id:"updated",label:i("orderBy.updated")}],selectedIds:[e,t],onSelect:s(a=>{a==="workspace"||a==="flat"?o(a):(a==="manual"||a==="updated")&&r(a),d(!1)},"onSelect"),align:"end",dense:!0,portal:!0,anchor:(0,n.jsx)(v.Tooltip,{label:i("viewOptions.label"),side:"bottom",delayMs:500,children:(0,n.jsx)("button",{type:"button",className:W(x.iconButton,x.wide),"aria-label":i("viewOptions.label"),onClick:s(()=>{d(a=>!a)},"onClick"),children:(0,n.jsx)(v.IconPersonalizationOutline16,{})})})})}s(Ds,"ViewOptionsMenu");function Xe(e){const t=e.currentTarget.getBoundingClientRect();return e.clientY<t.top+t.height/2?"before":"after"}s(Xe,"workspaceGroupHalf");function Ts({useSessions:e,startSession:t,open:o,forkSession:r,workspaces:i,archivedSessionIds:l,onRenameRequest:d,onDeleteRequest:a,onSessionRename:g,onSessionArchive:u,insertWorkspaceBefore:w,insertSessionBefore:_,orderBy:y,groupExpansion:I,setGroupExpanded:O,sessionOrderByAccount:N,sessionUpdatedAtByAccount:m,syncSessionOrderAccount:k,setSessionOrder:U,t:S}){const f=e(p=>p),F=f.current,[j,Z]=(0,h.useState)([]),[L,R]=(0,h.useState)(null),z=(0,h.useRef)(!1),[D,K]=(0,h.useState)(null),J=(0,h.useRef)(!1),T=(0,h.useRef)(y);Ve(L!==null||D!==null);const X=F===void 0?void 0:i.find(p=>p.sessionIds.includes(F))?.workspaceId??"";(0,h.useEffect)(()=>{F===void 0||X===void 0||Object.hasOwn(I,X)||O(X,!0)},[F,X,O,I]);const P=(0,h.useMemo)(()=>Object.entries(I).filter(([,p])=>p).map(([p])=>p),[I]),Y=(0,h.useMemo)(()=>{const p=new Set(i.flatMap(M=>M.sessionIds));return f.ids.filter(M=>f.byId[M]!==void 0&&!p.has(M))},[f,i]);(0,h.useEffect)(()=>{if(f.phase!=="ready")return;const p=T.current!=="updated"&&y==="updated";T.current=y;const M=[...i.map(A=>({key:A.workspaceId,sessionIds:A.sessionIds.filter(q=>f.byId[q]!==void 0)})),{key:"",sessionIds:Y}];for(const{key:A,sessionIds:q}of M){const B=N[A],H=Je({sessionIds:q,previousOrder:B,previousUpdatedAt:m[A]??{},list:f,orderBy:y,sortByRecency:y==="updated"&&(B===void 0||p)});H.changed&&k(A,H.order.map(E=>E),H.updatedAt)}},[f,y,N,m,k,Y,i]);const $=(0,h.useMemo)(()=>i.map(p=>{const M=N[p.workspaceId],A=ge(p.sessionIds,M);return{...p,sessionIds:A}}),[N,i]),de=(0,h.useMemo)(()=>ge(Y,N[""]),[N,Y]),G=(0,h.useMemo)(()=>bs(f,$,l,{expandedGroups:P,...N[""]===void 0?{}:{ungroupedOrder:N[""]}}),[f,$,l,P,N]),se=Date.now(),te=s((p,M)=>{if(z.current)return;z.current=!0,R(null);const A=G.find(C=>C.key===p.accountKey);if(A===void 0)return;const q=A.sessions.findIndex(C=>C.id===M.id);if(q===-1)return;const B=M.half==="before"?M.id:A.sessions[q+1]?.id;if(B===p.sessionId)return;const H=A.sessions.findIndex(C=>C.id===p.sessionId),E=B===void 0?A.sessions.length:A.sessions.findIndex(C=>C.id===B);if(H!==-1&&(E===H||E===H+1))return;const V=p.accountKey===""?de:$.find(C=>C.workspaceId===p.accountKey)?.sessionIds;if(V===void 0)return;const ee=V.filter(C=>C!==p.sessionId),ne=B===void 0?ee.length:ee.indexOf(B);ee.splice(ne===-1?ee.length:ne,0,p.sessionId),U(p.accountKey,ee.map(C=>C)),!(y==="updated"||p.accountKey==="")&&_(p.accountKey,p.sessionId,B).catch(C=>{console.warn("session reorder rejected:",C)})},"commitSessionDrag"),ve=s((p,M)=>{if(J.current)return;J.current=!0,K(null);const A=i.findIndex(E=>E.workspaceId===M.id);if(A===-1)return;const q=M.half==="before"?M.id:i[A+1]?.workspaceId;if(q===p.workspaceId)return;const B=i.findIndex(E=>E.workspaceId===p.workspaceId),H=q===void 0?i.length:i.findIndex(E=>E.workspaceId===q);B!==-1&&(H===B||H===B+1)||w(p.workspaceId,q).catch(E=>{console.warn("workspace reorder rejected:",E)})},"commitWorkspaceDrag"),oe=G[0]?.workspaceId!==void 0&&D?.over?.id===G[0].workspaceId&&D.over.half==="before";return(0,n.jsxs)("div",{className:W(x.treeBody,x.wide),children:[oe&&(0,n.jsx)("span",{className:x.listTopDropIndicator,"aria-hidden":"true"}),(0,n.jsxs)("div",{className:W(x.list,oe&&x.listTopDropActive),role:"tree","aria-label":S("section.sessions"),children:[G.length===0&&(0,n.jsx)("div",{className:x.empty,children:S("empty.none")}),G.map(p=>{const M=p.workspaceId,A=M!==void 0&&D?.over?.id===M?D.over.half:null,q=M===void 0?void 0:{start:s(()=>{J.current=!1,K({workspaceId:M,over:null})},"start"),end:s(()=>{D?.over!==null&&D?.over!==void 0?ve(D,D.over):K(null),J.current=!1},"end")},B=M===void 0?void 0:E=>{K(V=>V===null?V:{...V,over:{id:M,half:E}})},H=M===void 0?void 0:E=>{D!==null&&ve(D,{id:M,half:E})};return(0,n.jsxs)("div",{className:W(x.groupSection,A==="before"&&x.workspaceDropBefore,A==="after"&&x.workspaceDropAfter),onDragOver:D===null||B===void 0?void 0:E=>{E.preventDefault(),E.dataTransfer.dropEffect="move",B(Xe(E))},onDrop:D===null||H===void 0?void 0:E=>{E.preventDefault(),H(Xe(E))},children:[(0,n.jsx)(js,{group:p,t:S,onToggle:s(()=>{p.expanded&&Z(E=>E.filter(V=>V!==p.key)),O(p.key,!p.expanded)},"onToggle"),onCreate:s(()=>{p.workspaceId!==void 0&&(O(p.key,!0),t(p.workspaceId))},"onCreate"),drag:q,actions:p.workspaceId===void 0?void 0:{rename:s(()=>{p.workspaceId!==void 0&&d(p.workspaceId,p.label)},"rename"),delete:s(()=>{p.workspaceId!==void 0&&a(p.workspaceId,p.label)},"delete")}}),(j.includes(p.key)?p.sessions:p.sessions.slice(0,Se)).map(E=>{const V=L!==null&&L.accountKey===p.key,ee={start:s(()=>{z.current=!1,R({accountKey:p.key,sessionId:E.id,over:null})},"start"),active:V,marker:V&&L.over?.id===E.id?L.over.half:null,hover:s(ne=>{R(C=>C===null?C:{...C,over:{id:E.id,half:ne}})},"hover"),drop:s(ne=>{L!==null&&te(L,{id:E.id,half:ne})},"drop"),end:s(()=>{L?.over!==null&&L?.over!==void 0?te(L,L.over):R(null),z.current=!1},"end")};return(0,n.jsx)(He,{node:E,currentId:F,now:se,onOpen:o,onRename:g,onFork:r,onArchive:u,drag:ee,t:S},E.id)}),p.sessions.length>Se&&(0,n.jsx)("button",{type:"button",className:x.sessionOverflowButton,"aria-expanded":j.includes(p.key),onClick:s(()=>{Z(E=>Cs(E,p.key))},"onClick"),children:j.includes(p.key)?S("sessions.collapse"):S("sessions.expand",{n:p.sessions.length-Se})})]},p.key)})]}),(0,n.jsx)("span",{className:x.fade})]})}s(Ts,"SessionTree");function Ws({useSessions:e,open:t,forkSession:o,onSessionRename:r,onSessionArchive:i,archivedSessionIds:l,orderBy:d,sessionOrderByAccount:a,sessionUpdatedAtByAccount:g,syncSessionOrderAccount:u,setSessionOrder:w,t:_}){const y=e(j=>j),I=(0,h.useMemo)(()=>_s(y,l),[y,l]),O=(0,h.useMemo)(()=>I.map(j=>j.id),[I]),N=(0,h.useRef)(d);(0,h.useEffect)(()=>{if(y.phase!=="ready")return;const j=a[ie],Z=g.__flat_session_order__??{},L=N.current!=="updated"&&d==="updated";N.current=d;const R=Je({sessionIds:O,previousOrder:j,previousUpdatedAt:Z,list:y,orderBy:d,sortByRecency:d==="updated"&&(j===void 0||L)});R.changed&&u(ie,R.order.map(z=>z),R.updatedAt)},[y,d,a,g,O,u]);const m=(0,h.useMemo)(()=>{const j=new Map(I.map(Z=>[Z.id,Z]));return ge(O,a[ie]).flatMap(Z=>{const L=j.get(Z);return L===void 0?[]:[L]})},[I,a,O]),[k,U]=(0,h.useState)(null),S=(0,h.useRef)(!1);Ve(k!==null);const f=s((j,Z)=>{if(S.current)return;S.current=!0,U(null);const L=m.findIndex(T=>T.id===Z.id);if(L===-1)return;const R=Z.half==="before"?Z.id:m[L+1]?.id;if(R===j.sessionId)return;const z=m.findIndex(T=>T.id===j.sessionId),D=R===void 0?m.length:m.findIndex(T=>T.id===R);if(z!==-1&&(D===z||D===z+1))return;const K=m.map(T=>T.id).filter(T=>T!==j.sessionId),J=R===void 0?K.length:K.indexOf(R);K.splice(J===-1?K.length:J,0,j.sessionId),w(ie,K.map(T=>T))},"commitDrag"),F=Date.now();return(0,n.jsxs)("div",{className:W(x.treeBody,x.wide),children:[(0,n.jsxs)("div",{className:W(x.list,x.flatList),role:"tree","aria-label":_("section.sessions"),children:[m.length===0&&(0,n.jsx)("div",{className:x.empty,children:_("empty.none")}),m.map(j=>{const Z=k!==null;return(0,n.jsx)(He,{node:j,currentId:y.current,now:F,onOpen:t,onRename:r,onFork:o,onArchive:i,flat:!0,drag:{start:s(()=>{S.current=!1,U({accountKey:ie,sessionId:j.id,over:null})},"start"),active:Z,marker:Z&&k.over?.id===j.id?k.over.half:null,hover:s(L=>{U(R=>R===null?R:{...R,over:{id:j.id,half:L}})},"hover"),drop:s(L=>{k!==null&&f(k,{id:j.id,half:L})},"drop"),end:s(()=>{k?.over!==null&&k?.over!==void 0?f(k,k.over):U(null),S.current=!1},"end")},t:_},j.id)})]}),(0,n.jsx)("span",{className:x.fade})]})}s(Ws,"FlatList");function Fs({useSessions:e,open:t,workspaces:o,archivedSessionIds:r,query:i,remote:l,resultLimit:d,t:a}){const g=e(I=>I),u=l.query===i?l:{query:i,status:"loading",items:[],hasMore:!1},w=(0,h.useMemo)(()=>ys(g,o,i,r,u,d),[g,o,i,r,u,d]),_=u.status==="loading",y=u.status==="error";return(0,n.jsxs)("div",{className:W(x.treeBody,x.wide),children:[(0,n.jsxs)("div",{className:x.list,children:[(0,n.jsx)("div",{className:x.searchTree,role:"tree","aria-label":a("search.results.aria"),children:w.items.map(I=>(0,n.jsx)(Gs,{result:I,currentId:g.current,onOpen:t,t:a},I.id))}),_&&(0,n.jsx)("div",{className:x.searchStatus,role:"status",children:a("search.pending")}),y&&(0,n.jsx)("div",{className:x.searchWarning,role:"status",children:a("search.unavailable")}),!_&&w.items.length===0&&(0,n.jsx)("div",{className:x.empty,children:a("search.noMatches")}),w.hasMore&&(0,n.jsx)("div",{className:x.searchStatus,children:a("search.hasMore",{n:d})})]}),(0,n.jsx)("span",{className:x.fade})]})}s(Fs,"SearchResults");function zs({wide:e,expandSidebar:t,useSessions:o,useWorkspaces:r,useStore:i,actions:l,startSession:d,open:a,renameSession:g,forkSession:u,renameWorkspace:w,deleteWorkspace:_,insertWorkspaceBefore:y,archiveSession:I,insertSessionBefore:O,createWorkspace:N,searchSessions:m,searchResultLimit:k,useDirectoryFlow:U,renderSlot:S,t:f}){const F=r(c=>c.items),j=r(c=>c.phase),Z=r(c=>c.archivedSessionIds),L=U(c=>c),R=i(c=>c.groupBy),z=i(c=>c.orderBy),D=i(c=>c.groupExpansion),K=i(c=>c.sessionOrderByAccount),J=i(c=>c.sessionUpdatedAtByAccount);(0,h.useEffect)(()=>{j==="ready"&&l.retainAccountKeys(["",ie,...F.map(c=>c.workspaceId)])},[l.retainAccountKeys,j,F]);const[T,X]=(0,h.useState)(""),[P,Y]=(0,h.useState)(!1),$=qe(T).trim(),[de,G]=(0,h.useState)({query:"",status:"idle",items:[],hasMore:!1}),se=(0,h.useRef)(null),te=(0,h.useRef)(null),[ve,oe]=(0,h.useState)(!1),p=(0,h.useRef)(null),M=(0,h.useRef)(!1),[A,q]=(0,h.useState)(!1);(0,h.useEffect)(()=>{if(e&&A){const c=window.setTimeout(()=>{te.current?.focus({preventScroll:!0}),q(!1)},Bs);return()=>{window.clearTimeout(c)}}},[e,A]),(0,h.useEffect)(()=>{!e||!P||A||te.current?.focus({preventScroll:!0})},[e,P,A]),(0,h.useEffect)(()=>{if(!e||!P)return;const c=s(Q=>{!(Q.target instanceof Node)||se.current?.contains(Q.target)===!0||(te.current?.blur(),$===""&&Y(!1))},"onClick");return document.addEventListener("click",c),()=>{document.removeEventListener("click",c)}},[$,e,P]),(0,h.useEffect)(()=>{if($===""){G({query:"",status:"idle",items:[],hasMore:!1});return}const c=new AbortController;G({query:$,status:"loading",items:[],hasMore:!1});const Q=window.setTimeout(()=>{m($,c.signal).then(fs=>{c.signal.aborted||G({query:$,status:"ready",items:fs.items,hasMore:fs.hasMore})}).catch(()=>{c.signal.aborted||G({query:$,status:"error",items:[],hasMore:!1})})},Os);return()=>{window.clearTimeout(Q),c.abort()}},[$,m]);const[B,H]=(0,h.useState)(null),[E,V]=(0,h.useState)(""),[ee,ne]=(0,h.useState)(!1),[C,ue]=(0,h.useState)(null),re=E.trim(),es=B!==null&&re!==""&&re!==B.currentTitle&&F.some(c=>c.title===re),ss=ee||re===""||B===null||re===B.currentTitle||es,ns=s(()=>{ee||(H(null),ue(null))},"closeRename"),ts=s(()=>{ss||(ne(!0),ue(null),w(B.workspaceId,re).then(()=>{ne(!1),H(null)}).catch(c=>{ne(!1),ue(c instanceof Error?c.message:String(c))}))},"confirmRename"),[je,Le]=(0,h.useState)(null),[os,rs]=(0,h.useState)(""),[be,Re]=(0,h.useState)(!1),[as,pe]=(0,h.useState)(null),is=os.trim(),ls=be||is===""||je===null,cs=s(()=>{be||(Le(null),pe(null))},"closeSessionRename"),ds=s(()=>{ls||(Re(!0),pe(null),g(je.sessionId,is).then(()=>{Re(!1),Le(null)}).catch(c=>{Re(!1),pe(c instanceof Error?c.message:String(c))}))},"confirmSessionRename"),us=s((c,Q)=>{Le({sessionId:c,currentTitle:Q}),rs(Q),pe(null)},"onSessionRename"),ps=s(c=>{I(c).catch(Q=>{console.warn("session archive rejected:",Q)})},"onSessionArchive"),[le,Ge]=(0,h.useState)(null),[he,Ae]=(0,h.useState)(!1),[Ze,Ne]=(0,h.useState)(null),[hs,_e]=(0,h.useState)(null);(0,h.useEffect)(()=>{Ze===null||F.some(c=>c.workspaceId===Ze)||(Ae(!1),Ne(null),Ge(null))},[Ze,F]);const xs=s(()=>{he||(Ge(null),_e(null))},"closeDelete"),Ys=s(()=>{he||le===null||(Ae(!0),Ne(null),_e(null),_(le.workspaceId).then(()=>{Ne(le.workspaceId)}).catch(c=>{Ae(!1),_e(c instanceof Error?c.message:String(c))}))},"confirmDelete");return(0,n.jsxs)("div",{className:W(x.root,!e&&x.rail),children:[(0,n.jsxs)("div",{className:x.sectionHeader,children:[e&&(0,n.jsx)("span",{className:W(x.sectionLabel,x.wide,P&&x.sectionLabelHidden),children:f(R==="flat"?"section.sessions":"section.workspaces")}),e&&(0,n.jsx)("div",{className:W(x.searchSlot,P&&x.searchSlotExpanded),children:(0,n.jsxs)("div",{ref:se,className:W(x.search,P&&x.searchExpanded),onClick:s(()=>{oe(!1),Y(!0),te.current?.focus()},"onClick"),children:[(0,n.jsx)(v.Tooltip,{label:f("search"),side:"bottom",delayMs:500,disabled:P,children:(0,n.jsx)("button",{type:"button",className:x.searchButton,"aria-label":f("search.sessions.aria"),"aria-expanded":P,onClick:s(()=>{oe(!1),Y(!0)},"onClick"),children:(0,n.jsx)(v.IconSearchOutline16,{size:P?11:14})})}),(0,n.jsx)("input",{ref:te,className:x.searchInput,type:"text",placeholder:f("search.placeholder"),maxLength:Ee,value:T,tabIndex:P?0:-1,onChange:s(c=>{X(qe(c.target.value))},"onChange"),onKeyDown:s(c=>{c.key==="Escape"&&(X(""),Y(!1))},"onKeyDown")}),P&&(0,n.jsx)("button",{type:"button",className:x.clearButton,"aria-label":f("search.clear"),onClick:s(c=>{c.stopPropagation(),X(""),Y(!1)},"onClick"),children:(0,n.jsx)(v.IconCloseFill14,{})})]})}),(0,n.jsxs)("div",{className:W(x.headerActions,e&&P&&x.headerActionsHidden),children:[e&&(0,n.jsx)(Ds,{groupBy:R,orderBy:z,onGroupPick:s(c=>{l.setGroupBy(c)},"onGroupPick"),onOrderPick:s(c=>{l.setOrderBy(c)},"onOrderPick"),t:f}),L&&(0,n.jsx)(v.Tooltip,{label:f("workspace.add"),side:"bottom",delayMs:500,children:(0,n.jsx)("button",{ref:p,type:"button",className:x.iconButton,"aria-label":f("workspace.add"),onClick:s(()=>{oe(c=>!c)},"onClick"),children:(0,n.jsx)(v.IconProjectAddOutline16,{size:e?16:18})})})]}),(0,n.jsx)(Ye,{t:f,open:ve,anchorRef:p,useWorkspaces:r,createWorkspace:N,useDirectoryFlow:U,renderDirectoryFlow:s(c=>S("sidebar.workspaces.directoryFlow",c),"renderDirectoryFlow"),addOnly:!0,side:"right",onPick:s(c=>{oe(!1),d(c)},"onPick"),onClose:s(()=>{oe(!1)},"onClose")})]}),!e&&(0,n.jsx)("div",{className:x.search,children:(0,n.jsx)(v.Tooltip,{label:f("search"),children:(0,n.jsx)("button",{type:"button",className:x.searchButton,"aria-label":f("search.sessions.aria"),onClick:s(()=>{Y(!0),q(!0),t()},"onClick"),children:(0,n.jsx)(v.IconSearchOutline16,{size:18})})})}),(0,n.jsx)("div",{className:x.listArea,children:e&&($!==""?(0,n.jsx)(Fs,{useSessions:o,open:a,workspaces:F,archivedSessionIds:Z,query:$,remote:de,resultLimit:k,t:f}):R==="flat"?(0,n.jsx)(Ws,{useSessions:o,open:a,forkSession:u,onSessionRename:us,onSessionArchive:ps,archivedSessionIds:Z,orderBy:z,sessionOrderByAccount:K,sessionUpdatedAtByAccount:J,syncSessionOrderAccount:l.syncSessionOrderAccount,setSessionOrder:l.setSessionOrder,t:f}):(0,n.jsx)(Ts,{useSessions:o,onSessionRename:us,onSessionArchive:ps,forkSession:u,workspaces:F,groupExpansion:D,setGroupExpanded:l.setGroupExpanded,sessionOrderByAccount:K,sessionUpdatedAtByAccount:J,syncSessionOrderAccount:l.syncSessionOrderAccount,setSessionOrder:l.setSessionOrder,archivedSessionIds:Z,startSession:d,open:a,insertWorkspaceBefore:y,insertSessionBefore:O,orderBy:z,t:f,onRenameRequest:s((c,Q)=>{H({workspaceId:c,currentTitle:Q}),V(Q),ue(null)},"onRenameRequest"),onDeleteRequest:s((c,Q)=>{Ge({workspaceId:c,title:Q}),_e(null)},"onDeleteRequest")}))}),(0,n.jsxs)(v.Modal,{open:B!==null,onClose:ns,closeLabel:f("close"),title:f("rename.workspace.title"),footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.Button,{variant:"outline",disabled:ee,onClick:ns,children:f("cancel")}),(0,n.jsx)(v.Button,{variant:"primary",disabled:ss,onClick:ts,children:f("rename")})]}),children:[(0,n.jsx)("input",{className:x.renameInput,value:E,"aria-label":f("field.workspaceName"),autoFocus:!0,disabled:ee,onFocus:s(c=>{c.target.select()},"onFocus"),onChange:s(c=>{V(c.target.value),ue(null)},"onChange"),onCompositionStart:s(()=>{M.current=!0},"onCompositionStart"),onCompositionEnd:s(()=>{M.current=!1},"onCompositionEnd"),onKeyDown:s(c=>{c.key==="Enter"&&!M.current&&(c.preventDefault(),ts())},"onKeyDown")}),es&&(0,n.jsx)("div",{className:x.renameError,role:"alert",children:f("conflict.named",{name:re})}),C!==null&&(0,n.jsx)("div",{className:x.renameError,role:"alert",children:C})]}),(0,n.jsxs)(v.Modal,{open:je!==null,onClose:cs,closeLabel:f("close"),title:f("rename.session.title"),footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.Button,{variant:"outline",disabled:be,onClick:cs,children:f("cancel")}),(0,n.jsx)(v.Button,{variant:"primary",disabled:ls,onClick:ds,children:f("rename")})]}),children:[(0,n.jsx)("input",{className:x.renameInput,value:os,"aria-label":f("field.sessionName"),autoFocus:!0,disabled:be,onFocus:s(c=>{c.target.select()},"onFocus"),onChange:s(c=>{rs(c.target.value),pe(null)},"onChange"),onCompositionStart:s(()=>{M.current=!0},"onCompositionStart"),onCompositionEnd:s(()=>{M.current=!1},"onCompositionEnd"),onKeyDown:s(c=>{c.key==="Enter"&&!M.current&&(c.preventDefault(),ds())},"onKeyDown")}),as!==null&&(0,n.jsx)("div",{className:x.renameError,role:"alert",children:as})]}),(0,n.jsxs)(v.Modal,{open:le!==null,onClose:xs,closeLabel:f("close"),title:f("delete.workspace"),...le===null?{}:{description:f("delete.desc",{name:le.title})},footer:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.Button,{variant:"outline",disabled:he,onClick:xs,children:f("cancel")}),(0,n.jsx)(v.Button,{variant:"outline",className:x.deleteAction,disabled:he,onClick:Ys,children:f("delete.workspace")})]}),children:[he&&(0,n.jsx)("div",{className:x.deleteStatus,role:"status",children:f("delete.pending")}),hs!==null&&(0,n.jsx)("div",{className:x.renameError,role:"alert",children:hs})]})]})}s(zs,"WorkspaceBrowser");const Ps={"group.ungrouped":"未分组","session.new":"新会话","section.workspaces":"工作区","section.sessions":"会话","viewOptions.label":"视图选项","groupBy.label":"分组方式","groupBy.workspace":"按工作区","groupBy.flat":"单列表","orderBy.label":"排序方式","orderBy.manual":"手动排序","orderBy.updated":"最近更新","sessions.expand":"展开其余 {n} 个会话","sessions.collapse":"收起","empty.none":"暂无会话","empty.noMatches":"无匹配结果","workspace.add":"添加工作区","search.sessions.aria":"搜索会话","search.placeholder":"搜索会话…","search.clear":"清除搜索","search.results.aria":"搜索结果","search.pending":"正在搜索会话历史…","search.unavailable":"内容搜索暂不可用,仅显示名称匹配。","search.noMatches":"无匹配会话","search.hasMore":"仅显示前 {n} 条结果,请缩小搜索范围。","menu.addWorkspace":"添加工作区…","picker.loading":"正在加载工作区…","conflict.named":"已存在名为“{name}”的工作区。","folderError.title":"无法打开文件夹","folderError.retry":"重新选择",rename:"重命名","rename.workspace.title":"重命名工作区","rename.session.title":"重命名会话","field.workspaceName":"工作区名称","field.sessionName":"会话名称","delete.workspace":"删除工作区","delete.desc":"将把“{name}”从工作区列表中移除。文件夹与会话记录会保留,其会话将显示在“未分组”下。","delete.pending":"正在删除工作区…","menu.fork":"分叉会话","menu.archiveSession":"归档会话","sessions.count.one":"{n} 个会话","sessions.count.other":"{n} 个会话","actions.workspace.aria":"工作区“{name}”的操作","actions.session.aria":"会话“{name}”的操作","actions.newSession.aria":"在“{name}”中新建会话","status.running":"进行中","status.subagentsRunning.one":"{n} 个子代理运行中","status.subagentsRunning.other":"{n} 个子代理运行中","status.idle":"空闲","status.waitingApproval":"等待审批","status.planReview":"计划待审","status.waitingAnswer":"等待回答","status.completed":"已完成","hover.created":"创建于 {time}","hover.copied":"已复制","date.ymd":"{y}年{m}月{d}日","time.now":"刚刚","time.minutes":"{n}分钟","time.hours":"{n}小时","time.days":"{n}天","time.months":"{n}个月","time.years":"{n}年","time.ago":"{t}前"},Hs={"group.ungrouped":"Ungrouped","session.new":"New Session","section.workspaces":"Workspaces","section.sessions":"Sessions","viewOptions.label":"View options","groupBy.label":"Group by","groupBy.workspace":"WorkSpace","groupBy.flat":"In one list","orderBy.label":"Order by","orderBy.manual":"Manual","orderBy.updated":"Last updated","sessions.expand":"Show {n} more sessions","sessions.collapse":"Show less","empty.none":"No sessions yet","empty.noMatches":"No matches","workspace.add":"Add workspace","search.sessions.aria":"Search sessions","search.placeholder":"Search sessions...","search.clear":"Clear search","search.results.aria":"Search results","search.pending":"Searching session history…","search.unavailable":"Content search is temporarily unavailable. Showing name matches.","search.noMatches":"No matching sessions","search.hasMore":"Showing the first {n} results. Narrow your search.","menu.addWorkspace":"Add workspace…","picker.loading":"Loading workspaces…","conflict.named":"A workspace named “{name}” already exists.","folderError.title":"Couldn’t open folder","folderError.retry":"Choose again",rename:"Rename","rename.workspace.title":"Rename workspace","rename.session.title":"Rename session","field.workspaceName":"Workspace name","field.sessionName":"Session name","delete.workspace":"Delete workspace","delete.desc":"This removes “{name}” from the workspace list. The folder and session logs will be kept. Its sessions will appear under Ungrouped.","delete.pending":"Deleting workspace…","menu.fork":"Fork session","menu.archiveSession":"Archive session","sessions.count.one":"{n} session","sessions.count.other":"{n} sessions","actions.workspace.aria":"Workspace actions for {name}","actions.session.aria":"Session actions for {name}","actions.newSession.aria":"New session in {name}","status.running":"Running","status.subagentsRunning.one":"{n} subagent running","status.subagentsRunning.other":"{n} subagents running","status.idle":"Idle","status.waitingApproval":"Waiting for approval","status.planReview":"Plan awaiting review","status.waitingAnswer":"Waiting for answer","status.completed":"Completed","hover.created":"Created {time}","hover.copied":"Copied","date.ymd":"{y}-{m}-{d}","time.now":"now","time.minutes":"{n}min","time.hours":"{n}h","time.days":"{n}d","time.months":"{n}mo","time.years":"{n}y","time.ago":"{t} ago"},Me="workspace",Us=["slots","sessions","workspaces","locale"];function Ks(e){e.effect(()=>e.locale.register(Me,{zh:Ps,en:Hs}),"ui-workspace: dictionaries");const t=s(async(a,g)=>{const u=await e.sessions.search(a,g);if(!u.ok)throw new Error(u.error.message);return u.value},"searchSessions"),o=s(a=>({getSnapshot:s(()=>e.slots.entries(a).length>0,"getSnapshot"),subscribe:s(g=>e.slots.subscribe(a,g),"subscribe")}),"flowSource"),r=o("sidebar.workspaces.directoryFlow"),i=o("conversation.hero.workspace.directoryFlow"),l=s(()=>({startSession:s(a=>{e.workspaces.startSession(a)},"startSession"),open:s(a=>{e.sessions.open(a)},"open"),searchSessions:t,searchResultLimit:e.sessions.searchResultLimit,renameSession:s(async(a,g)=>{const u=e.sessions.binding(a)?.session;if(u===void 0)throw new Error(`unknown session "${a}"`);const w=await u.rename(g);if(!w.ok)throw new Error(w.error.message)},"renameSession"),forkSession:s(a=>{e.sessions.fork({sessionId:a,increaseTitle:!0}).then(g=>{e.sessions.open(g)}).catch(()=>{})},"forkSession"),renameWorkspace:s(async(a,g)=>{await e.workspaces.rename(a,g)},"renameWorkspace"),deleteWorkspace:s(async a=>{await e.workspaces.delete(a)},"deleteWorkspace"),insertWorkspaceBefore:s(async(a,g)=>{await e.workspaces.insertBefore(a,g)},"insertWorkspaceBefore"),archiveSession:s(async a=>{await e.workspaces.archiveSession(a)},"archiveSession"),insertSessionBefore:s(async(a,g,u)=>{await e.workspaces.insertSessionBefore(a,g,u)},"insertSessionBefore"),createWorkspace:s(a=>e.workspaces.create(a),"createWorkspace"),hooks:{directoryFlow:r}}),"browserInjected"),d=s(()=>({createWorkspace:s(a=>e.workspaces.create(a),"createWorkspace"),hooks:{directoryFlow:i}}),"pickerInjected");e.slots.inject("sidebar.workspaces",()=>e.slots.register({name:"sidebar.workspaces",children:{"sidebar.workspaces.directoryFlow":{kind:"single",scope:"root"}},store:ms(),inject:l,locale:Me},zs)),e.slots.inject("conversation.hero.workspace",()=>e.slots.register({name:"conversation.hero.workspace",children:{"conversation.hero.workspace.directoryFlow":{kind:"single",scope:"root"}},inject:d,locale:Me},Zs))}return s(Ks,"apply"),ye.apply=Ks,ye.inject=Us,xe.exports},"factory")});
@@ -1 +1 @@
1
- {"name":"@deepseek-ai/dsh-client-ui-workspace","version":"0.0.15","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./client":{"types":"./lib/types/client/index.d.ts","default":"./lib/client.js"},"./src/*":"./src/*","./package.json":"./package.json"},"dsh":{"client":{"inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation","@deepseek-ai/dsh-client-ui-sidebar"],"platform":"web"}},"license":"MIT","dependencies":{"clsx":"^2.0.0"},"peerDependencies":{"react":"^18.2.0","@deepseek-ai/dsh-client-locale":"^0.0.15","@deepseek-ai/dsh-client-ui-primitives":"^0.0.15","@deepseek-ai/dsh-invariants":"^0.0.15","@deepseek-ai/dsh-client-ui-slots":"^0.0.15","@deepseek-ai/dsh-client-runtime":"^0.0.15","@deepseek-ai/cordis":"^4.0.1"}}
1
+ {"name":"@deepseek-ai/dsh-client-ui-workspace","version":"0.1.0","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./client":{"types":"./lib/types/client/index.d.ts","default":"./lib/client.js"},"./src/*":"./src/*","./package.json":"./package.json"},"dsh":{"client":{"inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation","@deepseek-ai/dsh-client-ui-sidebar"],"platform":"web"}},"license":"MIT","dependencies":{"clsx":"^2.0.0"},"peerDependencies":{"react":"^18.2.0","@deepseek-ai/dsh-client-locale":"^0.1.0","@deepseek-ai/dsh-client-runtime":"^0.1.0","@deepseek-ai/dsh-client-ui-primitives":"^0.1.0","@deepseek-ai/dsh-client-ui-slots":"^0.1.0","@deepseek-ai/dsh-invariants":"^0.1.0","@deepseek-ai/cordis":"^4.0.1"}}
@@ -1 +1 @@
1
- {"name":"@deepseek-ai/dsh-client-web","version":"0.0.15","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","dependencies":{"react":"^18.2.0","react-dom":"^18.2.0","@deepseek-ai/dsh-client-modules":"^0.0.15","@deepseek-ai/dsh-client-schema-form":"^0.0.15","@deepseek-ai/dsh-client-ui-attachment":"^0.0.15","@deepseek-ai/dsh-client-ui-slots":"^0.0.15","@deepseek-ai/dsh-client-ui-primitives":"^0.0.15","@deepseek-ai/dsh-client-ui-theme":"^0.0.15","@deepseek-ai/dsh-client-web-react":"^0.0.15"},"peerDependencies":{"@deepseek-ai/dsh-invariants":"^0.0.15","@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/cordis-plugin-loader":"^1.0.2"}}
1
+ {"name":"@deepseek-ai/dsh-client-web","version":"0.1.0","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","dependencies":{"react":"^18.2.0","react-dom":"^18.2.0","@deepseek-ai/dsh-client-schema-form":"^0.1.0","@deepseek-ai/dsh-client-ui-slots":"^0.1.0","@deepseek-ai/dsh-client-ui-primitives":"^0.1.0","@deepseek-ai/dsh-client-web-react":"^0.1.0","@deepseek-ai/dsh-client-modules":"^0.1.0","@deepseek-ai/dsh-client-ui-attachment":"^0.1.0","@deepseek-ai/dsh-client-ui-theme":"^0.1.0"},"peerDependencies":{"@deepseek-ai/cordis-plugin-loader":"^1.0.2","@deepseek-ai/dsh-invariants":"^0.1.0","@deepseek-ai/cordis":"^4.0.1"}}
@@ -1 +1 @@
1
- {"name":"@deepseek-ai/dsh-client-web-react","version":"0.0.15","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","dependencies":{"react":"^18.2.0","use-sync-external-store":"1.2.0","@deepseek-ai/dsh-client-ui-slots":"^0.0.15"},"peerDependencies":{"@deepseek-ai/dsh-invariants":"^0.0.15","@deepseek-ai/cordis":"^4.0.1"}}
1
+ {"name":"@deepseek-ai/dsh-client-web-react","version":"0.1.0","publishConfig":{"access":"public"},"type":"module","main":"lib/index.js","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./src/*":"./src/*","./package.json":"./package.json"},"license":"MIT","dependencies":{"react":"^18.2.0","use-sync-external-store":"1.2.0","@deepseek-ai/dsh-client-ui-slots":"^0.1.0"},"peerDependencies":{"@deepseek-ai/dsh-invariants":"^0.1.0","@deepseek-ai/cordis":"^4.0.1"}}