@lemoncat7/dsh-partner 2.8.3 → 2.8.6

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 (248) hide show
  1. package/README.md +27 -406
  2. package/docs/THIRD_PARTY_LICENSES.md +4 -0
  3. package/docs/bark-notifications.md +27 -0
  4. package/docs/concern-workflow.md +39 -0
  5. package/docs/director-skills.md +8 -3
  6. package/docs/dsh-021-compatibility.md +9 -0
  7. package/docs/package-distribution.md +11 -0
  8. package/docs/releases/1.12.0.md +16 -0
  9. package/docs/releases/1.14.2.md +8 -0
  10. package/docs/releases/1.15.0.md +15 -0
  11. package/docs/releases/1.16.0.md +15 -0
  12. package/docs/releases/1.16.1.md +12 -0
  13. package/docs/releases/1.16.2.md +12 -0
  14. package/docs/releases/2.0.0.md +19 -0
  15. package/docs/releases/2.1.0.md +8 -0
  16. package/docs/releases/2.2.0.md +8 -0
  17. package/docs/releases/2.3.0.md +8 -0
  18. package/docs/releases/2.4.0.md +8 -0
  19. package/docs/releases/2.5.0.md +8 -0
  20. package/docs/releases/2.8.0.md +6 -0
  21. package/docs/releases/2.8.4.md +35 -0
  22. package/docs/releases/2.8.5.md +23 -0
  23. package/docs/releases/2.8.6.md +22 -0
  24. package/docs/releases/README.md +14 -0
  25. package/lib/agent-runtime.d.ts +1 -0
  26. package/lib/agent-runtime.d.ts.map +1 -1
  27. package/lib/agent-runtime.js +14 -5
  28. package/lib/agent-runtime.js.map +1 -1
  29. package/lib/api/features/push-api.d.ts +4 -0
  30. package/lib/api/features/push-api.d.ts.map +1 -0
  31. package/lib/api/features/push-api.js +47 -0
  32. package/lib/api/features/push-api.js.map +1 -0
  33. package/lib/api.d.ts +2 -0
  34. package/lib/api.d.ts.map +1 -1
  35. package/lib/api.js +5 -1
  36. package/lib/api.js.map +1 -1
  37. package/lib/autonomy.d.ts.map +1 -1
  38. package/lib/autonomy.js +5 -4
  39. package/lib/autonomy.js.map +1 -1
  40. package/lib/channels/direct/message-format.js +13 -8
  41. package/lib/channels/direct/message-format.js.map +3 -3
  42. package/lib/client-api.d.ts +1 -0
  43. package/lib/client-api.d.ts.map +1 -1
  44. package/lib/client-api.js.map +1 -1
  45. package/lib/client.d.ts.map +1 -1
  46. package/lib/client.js +1170 -646
  47. package/lib/client.js.map +4 -4
  48. package/lib/collaboration/composition.d.ts.map +1 -1
  49. package/lib/collaboration/composition.js +1 -0
  50. package/lib/collaboration/composition.js.map +1 -1
  51. package/lib/collaboration/ssh-task-access.d.ts +33 -0
  52. package/lib/collaboration/ssh-task-access.d.ts.map +1 -0
  53. package/lib/collaboration/ssh-task-access.js +26 -0
  54. package/lib/collaboration/ssh-task-access.js.map +1 -0
  55. package/lib/companions/removal.d.ts.map +1 -1
  56. package/lib/companions/removal.js +4 -0
  57. package/lib/companions/removal.js.map +1 -1
  58. package/lib/concern-domain.d.ts +2 -0
  59. package/lib/concern-domain.d.ts.map +1 -1
  60. package/lib/concern-domain.js.map +1 -1
  61. package/lib/concern-execution-notes.d.ts +2 -0
  62. package/lib/concern-execution-notes.d.ts.map +1 -1
  63. package/lib/concern-execution-notes.js +9 -2
  64. package/lib/concern-execution-notes.js.map +1 -1
  65. package/lib/concern-execution-receipt.d.ts.map +1 -1
  66. package/lib/concern-execution-receipt.js +3 -2
  67. package/lib/concern-execution-receipt.js.map +1 -1
  68. package/lib/concern-execution.d.ts.map +1 -1
  69. package/lib/concern-execution.js +1 -0
  70. package/lib/concern-execution.js.map +1 -1
  71. package/lib/concern-knowledge-source.d.ts +23 -0
  72. package/lib/concern-knowledge-source.d.ts.map +1 -0
  73. package/lib/concern-knowledge-source.js +30 -0
  74. package/lib/concern-knowledge-source.js.map +1 -0
  75. package/lib/concern-note-source.d.ts +2 -1
  76. package/lib/concern-note-source.d.ts.map +1 -1
  77. package/lib/concern-note-source.js +6 -2
  78. package/lib/concern-note-source.js.map +1 -1
  79. package/lib/concern-store.d.ts.map +1 -1
  80. package/lib/concern-store.js +5 -0
  81. package/lib/concern-store.js.map +1 -1
  82. package/lib/domain.d.ts +2 -0
  83. package/lib/domain.d.ts.map +1 -1
  84. package/lib/domain.js.map +1 -1
  85. package/lib/index.d.ts.map +1 -1
  86. package/lib/index.js +18 -1
  87. package/lib/index.js.map +1 -1
  88. package/lib/notifications/bark-adapter.d.ts +9 -0
  89. package/lib/notifications/bark-adapter.d.ts.map +1 -0
  90. package/lib/notifications/bark-adapter.js +69 -0
  91. package/lib/notifications/bark-adapter.js.map +1 -0
  92. package/lib/notifications/push-config.d.ts +10 -0
  93. package/lib/notifications/push-config.d.ts.map +1 -0
  94. package/lib/notifications/push-config.js +79 -0
  95. package/lib/notifications/push-config.js.map +1 -0
  96. package/lib/notifications/push-credentials.d.ts +9 -0
  97. package/lib/notifications/push-credentials.d.ts.map +1 -0
  98. package/lib/notifications/push-credentials.js +16 -0
  99. package/lib/notifications/push-credentials.js.map +1 -0
  100. package/lib/notifications/push-domain.d.ts +66 -0
  101. package/lib/notifications/push-domain.d.ts.map +1 -0
  102. package/lib/notifications/push-domain.js +6 -0
  103. package/lib/notifications/push-domain.js.map +1 -0
  104. package/lib/notifications/push-observer.d.ts +19 -0
  105. package/lib/notifications/push-observer.d.ts.map +1 -0
  106. package/lib/notifications/push-observer.js +96 -0
  107. package/lib/notifications/push-observer.js.map +1 -0
  108. package/lib/notifications/push-service.d.ts +33 -0
  109. package/lib/notifications/push-service.d.ts.map +1 -0
  110. package/lib/notifications/push-service.js +228 -0
  111. package/lib/notifications/push-service.js.map +1 -0
  112. package/lib/notifications/push-state.d.ts +3 -0
  113. package/lib/notifications/push-state.d.ts.map +1 -0
  114. package/lib/notifications/push-state.js +23 -0
  115. package/lib/notifications/push-state.js.map +1 -0
  116. package/lib/observation-budget.d.ts +3 -2
  117. package/lib/observation-budget.d.ts.map +1 -1
  118. package/lib/observation-budget.js +5 -3
  119. package/lib/observation-budget.js.map +1 -1
  120. package/lib/observation-loop.d.ts +1 -0
  121. package/lib/observation-loop.d.ts.map +1 -1
  122. package/lib/observation-loop.js +129 -21
  123. package/lib/observation-loop.js.map +1 -1
  124. package/lib/observation-model-retry.d.ts +20 -0
  125. package/lib/observation-model-retry.d.ts.map +1 -0
  126. package/lib/observation-model-retry.js +48 -0
  127. package/lib/observation-model-retry.js.map +1 -0
  128. package/lib/observation-progress.d.ts +1 -0
  129. package/lib/observation-progress.d.ts.map +1 -1
  130. package/lib/observation-progress.js +24 -4
  131. package/lib/observation-progress.js.map +1 -1
  132. package/lib/observation-workflow.d.ts +40 -0
  133. package/lib/observation-workflow.d.ts.map +1 -0
  134. package/lib/observation-workflow.js +154 -0
  135. package/lib/observation-workflow.js.map +1 -0
  136. package/lib/recording-snapshot.d.ts.map +1 -1
  137. package/lib/recording-snapshot.js +12 -2
  138. package/lib/recording-snapshot.js.map +1 -1
  139. package/lib/skills/ai-camera-language-builtin.d.ts +3 -0
  140. package/lib/skills/ai-camera-language-builtin.d.ts.map +1 -0
  141. package/lib/skills/ai-camera-language-builtin.js +89 -0
  142. package/lib/skills/ai-camera-language-builtin.js.map +1 -0
  143. package/lib/skills/builtin.d.ts.map +1 -1
  144. package/lib/skills/builtin.js +2 -0
  145. package/lib/skills/builtin.js.map +1 -1
  146. package/lib/skills/story-builtins.js +2 -2
  147. package/lib/skills/story-builtins.js.map +1 -1
  148. package/lib/storage/migrate-layout.d.ts.map +1 -1
  149. package/lib/storage/migrate-layout.js +2 -0
  150. package/lib/storage/migrate-layout.js.map +1 -1
  151. package/lib/storage/split-state.js +2 -2
  152. package/lib/storage/split-state.js.map +1 -1
  153. package/lib/store.d.ts.map +1 -1
  154. package/lib/store.js +2 -0
  155. package/lib/store.js.map +1 -1
  156. package/lib/ui/capability-editor.d.ts.map +1 -1
  157. package/lib/ui/capability-editor.js +3 -5
  158. package/lib/ui/capability-editor.js.map +1 -1
  159. package/lib/ui/channels-panel.d.ts.map +1 -1
  160. package/lib/ui/channels-panel.js +7 -1
  161. package/lib/ui/channels-panel.js.map +1 -1
  162. package/lib/ui/push-channels.d.ts +11 -0
  163. package/lib/ui/push-channels.d.ts.map +1 -0
  164. package/lib/ui/push-channels.js +28 -0
  165. package/lib/ui/push-channels.js.map +1 -0
  166. package/lib/ui/push-draft.d.ts +30 -0
  167. package/lib/ui/push-draft.d.ts.map +1 -0
  168. package/lib/ui/push-draft.js +13 -0
  169. package/lib/ui/push-draft.js.map +1 -0
  170. package/lib/ui/push-editor.d.ts +10 -0
  171. package/lib/ui/push-editor.d.ts.map +1 -0
  172. package/lib/ui/push-editor.js +99 -0
  173. package/lib/ui/push-editor.js.map +1 -0
  174. package/lib/ui/runtime-settings.d.ts +18 -0
  175. package/lib/ui/runtime-settings.d.ts.map +1 -0
  176. package/lib/ui/runtime-settings.js +25 -0
  177. package/lib/ui/runtime-settings.js.map +1 -0
  178. package/lib/ui/workspace-components.d.ts +7 -1
  179. package/lib/ui/workspace-components.d.ts.map +1 -1
  180. package/lib/ui/workspace-components.js +8 -4
  181. package/lib/ui/workspace-components.js.map +1 -1
  182. package/package.json +56 -47
  183. package/resources/skills/ai-camera-language/manifest.json +26 -0
  184. package/resources/skills/ai-camera-language/references/camera-dictionary.md +315 -0
  185. package/resources/skills/ai-camera-language/references/prompt-workflow.md +186 -0
  186. package/resources/skills/ai-camera-language/references/video-summary.md +123 -0
  187. package/resources/skills/novel-game-creation/manifest.json +2 -245
  188. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/BUILD_BRIEF.md +0 -219
  189. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/.vercelignore +0 -3
  190. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/RUN.md +0 -138
  191. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/bg/compound_new_guofeng.webp +0 -0
  192. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/fate_coda.webp +0 -0
  193. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/meng.webp +0 -0
  194. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/pan.webp +0 -0
  195. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/pinger.webp +0 -0
  196. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/xuee.webp +0 -0
  197. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/finale/yue.webp +0 -0
  198. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/inner_court_accord_five.webp +0 -0
  199. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/inner_court_afterglow_five.webp +0 -0
  200. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/inner_court_alliance.webp +0 -0
  201. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/public_day10.webp +0 -0
  202. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/public_day15.webp +0 -0
  203. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/public_day5.webp +0 -0
  204. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/group/title_new_guofeng.webp +0 -0
  205. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/joint/pan_pinger.webp +0 -0
  206. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/joint/pan_xuee.webp +0 -0
  207. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/joint/yue_meng.webp +0 -0
  208. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/joint/yue_pan.webp +0 -0
  209. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/joint/yue_pinger.webp +0 -0
  210. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/meng/explicit.webp +0 -0
  211. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/meng/prelude.webp +0 -0
  212. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/milestone/meng.webp +0 -0
  213. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/milestone/pan.webp +0 -0
  214. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/milestone/pinger.webp +0 -0
  215. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/milestone/xuee.webp +0 -0
  216. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/milestone/yue.webp +0 -0
  217. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/pan/explicit.webp +0 -0
  218. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/pan/prelude.webp +0 -0
  219. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/pinger/explicit.webp +0 -0
  220. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/pinger/prelude.webp +0 -0
  221. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/xuee/explicit.webp +0 -0
  222. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/xuee/prelude.webp +0 -0
  223. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/yue/explicit.webp +0 -0
  224. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/cg/yue/prelude.webp +0 -0
  225. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/heroine/meng/night.webp +0 -0
  226. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/heroine/pan/night.webp +0 -0
  227. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/heroine/pinger/night.webp +0 -0
  228. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/heroine/xuee/night.webp +0 -0
  229. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/heroine/yue/night.webp +0 -0
  230. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/household/li_jiaoer.webp +0 -0
  231. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/assets/scene/gate_collector.webp +0 -0
  232. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/css/new-guofeng.css +0 -1494
  233. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/css/style.css +0 -2508
  234. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/index.html +0 -18
  235. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/assets.js +0 -147
  236. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/audio.js +0 -332
  237. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/data.js +0 -7470
  238. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/engine.js +0 -13066
  239. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/main.js +0 -3051
  240. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/js/text.js +0 -32
  241. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/package.json +0 -11
  242. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/app/vercel.json +0 -23
  243. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/build/art/generated-art.json +0 -161
  244. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/example.json +0 -12
  245. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/qa/README.md +0 -26
  246. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/qa/playable-model.json +0 -99
  247. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/qa/verification.json +0 -41
  248. package/resources/skills/novel-game-creation/upstream/examples/jin-ping-mei/qa/verify_playable_model.mjs +0 -152
package/lib/client.js CHANGED
@@ -35,7 +35,7 @@ __export(client_exports, {
35
35
  inject: () => inject
36
36
  });
37
37
  module.exports = __toCommonJS(client_exports);
38
- var import_react55 = require("react");
38
+ var import_react58 = require("react");
39
39
 
40
40
  // src/workspace-ownership.ts
41
41
  var WORKSPACE_ACTIVATE_EVENT = "@lemoncat7/dsh-plugin-ui/workspace-activate";
@@ -54,7 +54,7 @@ function observePluginWorkspace(pluginId, close) {
54
54
  }
55
55
 
56
56
  // src/client.tsx
57
- var import_dsh_client_ui_primitives25 = require("@deepseek-ai/dsh-client-ui-primitives");
57
+ var import_dsh_client_ui_primitives26 = require("@deepseek-ai/dsh-client-ui-primitives");
58
58
 
59
59
  // node_modules/qrcode.react/lib/esm/index.js
60
60
  var import_react = __toESM(require("react"), 1);
@@ -1943,8 +1943,6 @@ body[data-ds-dark-theme] .dsh-partner-workspace {
1943
1943
  .dsh-partner-section p { max-width: 640px; margin: 0; color: var(--partner-text-secondary); font-size: var(--partner-font-body); line-height: 1.65; }
1944
1944
  .dsh-partner-fields { display: grid; gap: 14px; }
1945
1945
  .dsh-partner-fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
1946
- .dsh-partner-runtime-fields { display: grid; grid-template-columns: minmax(190px, 1.15fr) minmax(160px, .85fr) minmax(190px, 1.15fr); gap: 14px; }
1947
- .dsh-partner-runtime-fields > .dsh-partner-field { margin-bottom: 18px; }
1948
1946
  .dsh-partner-field { display: grid; min-width: 0; gap: 8px; margin-bottom: 16px; }
1949
1947
  .dsh-partner-field > span { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
1950
1948
  .dsh-partner-field strong { font-size: var(--partner-font-body); font-weight: 610; }
@@ -2719,7 +2717,6 @@ body[data-ds-dark-theme] .dsh-partner-workspace {
2719
2717
  }
2720
2718
  @media (max-width: 760px) {
2721
2719
  .dsh-partner-access-list { grid-template-columns: 1fr; }
2722
- .dsh-partner-runtime-fields { grid-template-columns: 1fr; }
2723
2720
  .dsh-partner-topbar { align-items: stretch; flex-direction: column; gap: 7px; padding: 7px 9px; }
2724
2721
  .dsh-partner-mobile-workspace-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
2725
2722
  .dsh-partner-mobile-workspace-nav button { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 5px; padding: 0 8px; border: 1px solid transparent; border-radius: 9px; color: var(--partner-text-tertiary); background: transparent; font: 580 var(--partner-font-caption)/1 var(--partner-font-family); cursor: pointer; }
@@ -2829,6 +2826,36 @@ body[data-ds-dark-theme] .dsh-partner-workspace {
2829
2826
  .dsh-partner-concern-execution > header { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
2830
2827
  .dsh-partner-concern-execution > header > span { display: grid; gap: 4px; min-width: 0; }
2831
2828
  .dsh-partner-concern-execution .dsh-partner-switch { flex-shrink: 0; }
2829
+ .dsh-partner-push-form .dsh-partner-push-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; }
2830
+ .dsh-partner-push-form .dsh-partner-push-heading > label { display:flex; align-items:center; gap:8px; }
2831
+ .dsh-partner-push-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
2832
+ .dsh-partner-push-form .dsh-partner-channel-field { display:grid; min-width:0; gap:6px; }
2833
+ .dsh-partner-push-form .dsh-partner-channel-field :is(input,select) { width:100%; min-width:0; box-sizing:border-box; }
2834
+ .dsh-partner-push-form p,.dsh-partner-push-form small { margin:0; line-height:1.5; color:var(--partner-text-secondary); overflow-wrap:anywhere; }
2835
+ .dsh-partner-push-form p[role=alert] { color:var(--ds-color-danger, #c64444); }
2836
+ .dsh-partner-workspace .dsh-partner-push-form > p:not([role=alert]) { background:transparent; padding:0; color:var(--partner-text-secondary); }
2837
+ .dsh-partner-workspace .dsh-partner-push-form > p[role=status] { color:var(--partner-success); }
2838
+ .dsh-partner-workspace .dsh-partner-bark-dialog { width:min(760px,100%); }
2839
+ .dsh-partner-push-targets { display:grid; gap:10px; }
2840
+ .dsh-partner-push-target { display:grid; grid-template-columns:24px minmax(100px,.8fr) minmax(150px,1.2fr) auto; gap:10px; align-items:end; padding-bottom:12px; border-bottom:1px solid var(--partner-separator); }
2841
+ .dsh-partner-push-enable { align-self:center; }
2842
+ .dsh-partner-push-target-actions { display:flex; gap:6px; }
2843
+ /* Keep native/theme checkmarks invisible; the shared partner-check indicator
2844
+ is the only painted control, while the input retains keyboard semantics. */
2845
+ .dsh-partner-workspace .dsh-partner-push-form .dsh-partner-check { position:relative; }
2846
+ .dsh-partner-workspace .dsh-partner-push-form .dsh-partner-check > input[type=checkbox] { position:absolute!important; width:1px!important; height:1px!important; min-height:1px!important; padding:0!important; margin:0!important; opacity:0!important; clip-path:inset(50%)!important; pointer-events:none; }
2847
+ .dsh-partner-push-form .dsh-partner-check > i { flex:0 0 20px; box-sizing:border-box; }
2848
+ .dsh-partner-push-form .dsh-partner-check:has(input:disabled) { opacity:.5; cursor:not-allowed; }
2849
+ .dsh-partner-push-form details > .dsh-partner-push-fields { margin-block:12px; }
2850
+ .dsh-partner-push-records { display:grid; gap:12px; border-top:1px solid var(--partner-separator); padding-top:12px; }
2851
+ .dsh-partner-push-records > div:not(:first-child) { display:flex; align-items:center; justify-content:space-between; gap:12px; }
2852
+ .dsh-partner-push-records > div > span { display:grid; gap:4px; min-width:0; overflow-wrap:anywhere; }
2853
+ @media(max-width:640px) {
2854
+ .dsh-partner-push-fields { grid-template-columns:minmax(0,1fr); }
2855
+ .dsh-partner-push-target { grid-template-columns:24px minmax(0,1fr); }
2856
+ .dsh-partner-push-target > .dsh-partner-channel-field,.dsh-partner-push-target-actions { grid-column:2; }
2857
+ .dsh-partner-push-enable { grid-row:1; }
2858
+ }
2832
2859
  `;
2833
2860
 
2834
2861
  // src/ui/workspace-ui.css
@@ -3344,7 +3371,7 @@ function WorkspaceBlock({ title, detail, actions, children, className = "" }) {
3344
3371
  children
3345
3372
  ] });
3346
3373
  }
3347
- function WorkspaceDialog({ eyebrow = "CREATE & CONFIGURE", title, detail, close, children, width = "regular", className = "" }) {
3374
+ function WorkspaceDialog({ eyebrow = "CREATE & CONFIGURE", title, detail, close, children, width = "regular", className = "", confirmation = false }) {
3348
3375
  const titleId = (0, import_react2.useId)();
3349
3376
  const detailId = (0, import_react2.useId)();
3350
3377
  const layerRef = (0, import_react2.useRef)(null);
@@ -3355,7 +3382,7 @@ function WorkspaceDialog({ eyebrow = "CREATE & CONFIGURE", title, detail, close,
3355
3382
  layer?.showModal();
3356
3383
  const frame = requestAnimationFrame(() => {
3357
3384
  const panel = panelRef.current;
3358
- const target = panel?.querySelector("[autofocus]") ?? panel?.querySelector("input, textarea, select, button");
3385
+ const target = panel?.querySelector("[data-dialog-initial-focus], [autofocus]") ?? panel?.querySelector("input:not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled])");
3359
3386
  target?.focus({ preventScroll: true });
3360
3387
  });
3361
3388
  return () => {
@@ -3384,13 +3411,13 @@ function WorkspaceDialog({ eyebrow = "CREATE & CONFIGURE", title, detail, close,
3384
3411
  first?.focus();
3385
3412
  }
3386
3413
  };
3387
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dialog", { ref: layerRef, className: "dsh-partner-workspace-dialog-layer", "aria-modal": "true", "aria-labelledby": titleId, "aria-describedby": detailId, onCancel: (event) => {
3414
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dialog", { ref: layerRef, className: "dsh-partner-workspace-dialog-layer", role: confirmation ? "alertdialog" : void 0, "aria-modal": "true", "aria-labelledby": titleId, "aria-describedby": detailId, onCancel: (event) => {
3388
3415
  event.preventDefault();
3389
3416
  event.stopPropagation();
3390
3417
  close();
3391
3418
  }, onPointerDown: (event) => {
3392
3419
  if (event.target === event.currentTarget) close();
3393
- }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { ref: panelRef, className: `dsh-partner-workspace-dialog is-${width} ${className}`, onKeyDown: keyDown, children: [
3420
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { ref: panelRef, className: `dsh-partner-workspace-dialog is-${width}${confirmation ? " is-confirmation" : ""} ${className}`, onKeyDown: keyDown, children: [
3394
3421
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [
3395
3422
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
3396
3423
  eyebrow && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: eyebrow }),
@@ -3402,6 +3429,12 @@ function WorkspaceDialog({ eyebrow = "CREATE & CONFIGURE", title, detail, close,
3402
3429
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-workspace-dialog-body", children })
3403
3430
  ] }) });
3404
3431
  }
3432
+ function DiscardChangesDialog({ keepEditing, discard }) {
3433
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WorkspaceDialog, { confirmation: true, eyebrow: "", title: "\u653E\u5F03\u672A\u4FDD\u5B58\u7684\u4FEE\u6539\uFF1F", detail: "\u5173\u95ED\u540E\u8FD9\u4E9B\u4FEE\u6539\u4E0D\u4F1A\u4FDD\u5B58\u3002\u4F60\u4E5F\u53EF\u4EE5\u7EE7\u7EED\u7F16\u8F91\u3002", close: keepEditing, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-form-actions", children: [
3434
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", "data-dialog-initial-focus": true, onClick: keepEditing, children: "\u7EE7\u7EED\u7F16\u8F91" }),
3435
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "is-danger", onClick: discard, children: "\u653E\u5F03\u4FEE\u6539" })
3436
+ ] }) });
3437
+ }
3405
3438
  function WorkspaceNotice({ children, kind = "error" }) {
3406
3439
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: `dsh-partner-workspace-notice is-${kind}`, role: kind === "error" ? "alert" : "status", children: [
3407
3440
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", {}),
@@ -12485,15 +12518,12 @@ function findAndReplace(tree, list2, options) {
12485
12518
  find.lastIndex = position2 + 1;
12486
12519
  } else {
12487
12520
  if (start !== position2) {
12488
- nodes.push({
12489
- type: "text",
12490
- value: node2.value.slice(start, position2)
12491
- });
12521
+ add({ type: "text", value: node2.value.slice(start, position2) });
12492
12522
  }
12493
12523
  if (Array.isArray(value)) {
12494
- nodes.push(...value);
12524
+ for (const child of value) add(child);
12495
12525
  } else if (value) {
12496
- nodes.push(value);
12526
+ add(value);
12497
12527
  }
12498
12528
  start = position2 + match[0].length;
12499
12529
  change = true;
@@ -12505,20 +12535,28 @@ function findAndReplace(tree, list2, options) {
12505
12535
  }
12506
12536
  if (change) {
12507
12537
  if (start < node2.value.length) {
12508
- nodes.push({ type: "text", value: node2.value.slice(start) });
12538
+ add({ type: "text", value: node2.value.slice(start) });
12509
12539
  }
12510
12540
  parent.children.splice(index2, 1, ...nodes);
12511
12541
  } else {
12512
12542
  nodes = [node2];
12513
12543
  }
12514
12544
  return index2 + nodes.length;
12545
+ function add(child) {
12546
+ const previous3 = nodes[nodes.length - 1];
12547
+ if (previous3 && previous3.type === "text" && child.type === "text") {
12548
+ previous3.value += child.value;
12549
+ } else {
12550
+ nodes.push(child);
12551
+ }
12552
+ }
12515
12553
  }
12516
12554
  }
12517
12555
  function toPairs(tupleOrList) {
12518
- const result = [];
12519
12556
  if (!Array.isArray(tupleOrList)) {
12520
12557
  throw new TypeError("Expected find and replace tuple or list of tuples");
12521
12558
  }
12559
+ const result = [];
12522
12560
  const list2 = !tupleOrList[0] || Array.isArray(tupleOrList[0]) ? tupleOrList : [tupleOrList];
12523
12561
  let index2 = -1;
12524
12562
  while (++index2 < list2.length) {
@@ -15896,8 +15934,8 @@ function companionName(companions, id) {
15896
15934
  }
15897
15935
 
15898
15936
  // src/ui/capability-editor.tsx
15899
- var import_react45 = require("react");
15900
- var import_dsh_client_ui_primitives20 = require("@deepseek-ai/dsh-client-ui-primitives");
15937
+ var import_react46 = require("react");
15938
+ var import_dsh_client_ui_primitives21 = require("@deepseek-ai/dsh-client-ui-primitives");
15901
15939
 
15902
15940
  // src/capabilities.ts
15903
15941
  var COMPANION_CAPABILITIES = ["knowledge", "skills", "mcp", "ssh", "git", "companions", "schedules", "access", "administration"];
@@ -16116,35 +16154,121 @@ function CapabilityResources({ companionId, capabilities, disabled, children })
16116
16154
  ] });
16117
16155
  }
16118
16156
 
16157
+ // src/ui/runtime-settings.tsx
16158
+ var import_react45 = require("react");
16159
+ var import_dsh_client_ui_primitives20 = require("@deepseek-ai/dsh-client-ui-primitives");
16160
+ var import_jsx_runtime42 = require("react/jsx-runtime");
16161
+ function RuntimeSettings({ value, catalog, presets, saving, error, saved, change }) {
16162
+ const [open, setOpen] = (0, import_react45.useState)(false);
16163
+ const [query, setQuery] = (0, import_react45.useState)("");
16164
+ const providerId = value.provider || catalog?.defaultSelection.provider || "";
16165
+ const provider = catalog?.providers.find((item) => item.id === providerId);
16166
+ const models = provider?.models ?? [];
16167
+ const presetName = presets.find((item) => item.id === value.presetId)?.name || value.presetId || "\u8DDF\u968F DSH \u9ED8\u8BA4";
16168
+ const modelId = value.model || catalog?.defaultSelection.model || "";
16169
+ const modelName = models.find((item) => item.id === modelId)?.name || modelId || "\u8DDF\u968F DSH \u9ED8\u8BA4";
16170
+ const providerName = provider?.name || providerId;
16171
+ const missingModel = Boolean(value.model) && !models.some((item) => item.id === value.model);
16172
+ const normalized = query.trim().toLocaleLowerCase();
16173
+ const filtered = models.filter((item) => `${item.name} ${item.id}`.toLocaleLowerCase().includes(normalized));
16174
+ const close = () => {
16175
+ if (!saving) setOpen(false);
16176
+ };
16177
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
16178
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("section", { className: "dsh-partner-runtime-summary", "aria-label": "\u8FD0\u884C\u914D\u7F6E", children: [
16179
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
16180
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "Agent Preset" }),
16181
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { title: presetName, children: presetName })
16182
+ ] }),
16183
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
16184
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("small", { children: [
16185
+ "\u6A21\u578B",
16186
+ providerName ? ` \xB7 ${providerName}` : ""
16187
+ ] }),
16188
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { title: `${providerName} / ${modelName}`, children: modelName })
16189
+ ] }),
16190
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", disabled: saving, "aria-haspopup": "dialog", onClick: () => {
16191
+ setQuery("");
16192
+ setOpen(true);
16193
+ }, "aria-label": "\u8C03\u6574\u8FD0\u884C\u914D\u7F6E", children: "\u8C03\u6574" })
16194
+ ] }),
16195
+ open && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WorkspaceDialog, { eyebrow: "", title: "\u8FD0\u884C\u914D\u7F6E", detail: "\u9009\u62E9\u81EA\u52A8\u4FDD\u5B58\uFF1B\u4F5C\u4E3A\u4F1A\u8BDD\u9ED8\u8BA4\u914D\u7F6E\uFF0C\u4E0D\u8986\u76D6\u5DF2\u6709\u4F1A\u8BDD\u7684\u9009\u62E9\u3002", close, className: "dsh-partner-runtime-dialog", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-runtime-editor", children: [
16196
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-runtime-options", children: [
16197
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField, { label: "Agent Preset", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("select", { "aria-label": "Agent Preset", disabled: saving, value: value.presetId, onChange: (event) => change({ presetId: event.target.value }), children: [
16198
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: "", children: "\u8DDF\u968F DSH \u9ED8\u8BA4" }),
16199
+ value.presetId && !presets.some((item) => !item.broken && item.id === value.presetId) && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("option", { value: value.presetId, children: [
16200
+ "\u5F53\u524D\u914D\u7F6E \xB7 ",
16201
+ value.presetId
16202
+ ] }),
16203
+ presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: item.id, children: item.name }, item.id))
16204
+ ] }) }),
16205
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField, { label: "\u6A21\u578B\u63D0\u4F9B\u65B9", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("select", { "aria-label": "\u6A21\u578B\u63D0\u4F9B\u65B9", disabled: saving || !catalog, value: value.provider, onChange: (event) => {
16206
+ setQuery("");
16207
+ change({ provider: event.target.value, model: "" });
16208
+ }, children: [
16209
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("option", { value: "", children: [
16210
+ "\u8DDF\u968F DSH \u9ED8\u8BA4",
16211
+ catalog?.defaultSelection.provider ? ` \xB7 ${catalog.defaultSelection.provider}` : ""
16212
+ ] }),
16213
+ value.provider && !catalog?.providers.some((item) => item.id === value.provider) && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("option", { value: value.provider, children: [
16214
+ "\u5F53\u524D\u914D\u7F6E \xB7 ",
16215
+ value.provider
16216
+ ] }),
16217
+ catalog?.providers.map((item) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: item.id, children: item.name || item.id }, item.id))
16218
+ ] }) })
16219
+ ] }),
16220
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { className: "dsh-partner-runtime-search", children: [
16221
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: "\u9009\u62E9\u6A21\u578B" }),
16222
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { type: "search", value: query, onChange: (event) => setQuery(event.target.value), placeholder: "\u641C\u7D22\u6A21\u578B\u540D\u79F0\u6216 ID" })
16223
+ ] }),
16224
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-runtime-models", role: "group", "aria-label": "\u53EF\u7528\u6A21\u578B", "aria-busy": saving, children: [
16225
+ [{ id: "", name: "\u8DDF\u968F DSH \u9ED8\u8BA4\u6A21\u578B", detail: catalog?.defaultSelection.model || "\u4F7F\u7528\u9ED8\u8BA4\u914D\u7F6E" }, ...missingModel ? [{ id: value.model, name: value.model, detail: "\u5F53\u524D\u914D\u7F6E \xB7 \u4E0D\u5728\u6A21\u578B\u76EE\u5F55\u4E2D" }] : [], ...filtered.map((item) => ({ ...item, detail: item.id }))].map((item) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("button", { type: "button", disabled: saving, "aria-pressed": item.id === value.model, onClick: () => {
16226
+ if (item.id !== value.model) change({ model: item.id });
16227
+ }, children: [
16228
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
16229
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: item.name || item.id }),
16230
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: item.detail })
16231
+ ] }),
16232
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("i", { "aria-hidden": "true", children: item.id === value.model && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives20.IconCheckOutlineRegular, { size: 16 }) })
16233
+ ] }, item.id)),
16234
+ !catalog && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { role: "status", children: "\u6A21\u578B\u76EE\u5F55\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u5F00\u6216\u5237\u65B0\u9875\u9762\u3002" }),
16235
+ catalog && !filtered.length && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { role: "status", children: query ? "\u6CA1\u6709\u5339\u914D\u7684\u6A21\u578B\uFF0C\u8BD5\u8BD5\u5176\u4ED6\u5173\u952E\u8BCD\u3002" : "\u5F53\u524D\u63D0\u4F9B\u65B9\u6CA1\u6709\u53EF\u9009\u6A21\u578B\u3002" })
16236
+ ] }),
16237
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("footer", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { role: "status", children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : error ? "\u4FDD\u5B58\u672A\u6210\u529F" : saved ? "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u751F\u6548" : "\u9009\u62E9\u81EA\u52A8\u4FDD\u5B58" }) }),
16238
+ error && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error })
16239
+ ] }) })
16240
+ ] });
16241
+ }
16242
+
16119
16243
  // src/ui/companion-draft.ts
16120
16244
  function companionDraft(companion) {
16121
16245
  return { name: companion.name, role: companion.role, description: companion.description, instructions: companion.instructions, presetId: companion.presetId ?? "", provider: companion.provider ?? "", model: companion.model ?? "", capabilities: [...companion.capabilities] };
16122
16246
  }
16123
16247
 
16124
16248
  // src/ui/capability-editor.tsx
16125
- var import_jsx_runtime42 = require("react/jsx-runtime");
16249
+ var import_jsx_runtime43 = require("react/jsx-runtime");
16126
16250
  function CapabilityEditor({ companion, presets, onChanged }) {
16127
- const [form, setForm] = (0, import_react45.useState)(() => companionDraft(companion));
16128
- const [persistedCapabilities, setPersistedCapabilities] = (0, import_react45.useState)(companion.capabilities);
16129
- const [modelCatalog, setModelCatalog] = (0, import_react45.useState)();
16130
- const [saving, setSaving] = (0, import_react45.useState)(false);
16131
- const [saved, setSaved] = (0, import_react45.useState)(false);
16132
- const [error, setError] = (0, import_react45.useState)();
16133
- const savingRef = (0, import_react45.useRef)(false);
16134
- const mounted = (0, import_react45.useRef)(true);
16135
- (0, import_react45.useEffect)(() => {
16251
+ const [form, setForm] = (0, import_react46.useState)(() => companionDraft(companion));
16252
+ const [persistedCapabilities, setPersistedCapabilities] = (0, import_react46.useState)(companion.capabilities);
16253
+ const [modelCatalog, setModelCatalog] = (0, import_react46.useState)();
16254
+ const [saving, setSaving] = (0, import_react46.useState)(false);
16255
+ const [saved, setSaved] = (0, import_react46.useState)(false);
16256
+ const [error, setError] = (0, import_react46.useState)();
16257
+ const savingRef = (0, import_react46.useRef)(false);
16258
+ const mounted = (0, import_react46.useRef)(true);
16259
+ (0, import_react46.useEffect)(() => {
16136
16260
  mounted.current = true;
16137
16261
  return () => {
16138
16262
  mounted.current = false;
16139
16263
  };
16140
16264
  }, []);
16141
- (0, import_react45.useEffect)(() => {
16265
+ (0, import_react46.useEffect)(() => {
16142
16266
  if (!savingRef.current) {
16143
16267
  setForm(companionDraft(companion));
16144
16268
  setPersistedCapabilities(companion.capabilities);
16145
16269
  }
16146
16270
  }, [companion.id, companion.updatedAt]);
16147
- (0, import_react45.useEffect)(() => {
16271
+ (0, import_react46.useEffect)(() => {
16148
16272
  void api("/models").then((value) => {
16149
16273
  if (mounted.current) setModelCatalog(value);
16150
16274
  }).catch((reason) => {
@@ -16201,73 +16325,47 @@ function CapabilityEditor({ companion, presets, onChanged }) {
16201
16325
  { id: "administration", title: CAPABILITY_LABELS.administration, detail: "\u4FEE\u6539\u5176\u4ED6\u4F19\u4F34\u7684\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E Preset\u3001\u534F\u4F5C\u3001Skill \u548C\u77E5\u8BC6\u5E93\u6302\u8F7D\u3002\u4E0D\u5171\u4EAB\u4F1A\u8BDD\u3001\u8BB0\u5FC6\u6216\u51ED\u636E\uFF1B\u4E0D\u80FD\u81EA\u6539\u6216\u8F6C\u6388\u672C\u6743\u9650\u3002" }
16202
16326
  ] }
16203
16327
  ];
16204
- const selectedProvider = form.provider || modelCatalog?.defaultSelection.provider || "";
16205
- const modelOptions = modelCatalog?.providers.find((item) => item.id === selectedProvider)?.models ?? [];
16206
- const currentModelMissing = Boolean(form.model) && !modelOptions.some((item) => item.id === form.model);
16207
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-form is-capabilities", children: [
16208
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SectionHeading, { eyebrow: "COMPOSITION", title: "\u80FD\u529B\u7EC4\u5408", detail: "\u4F19\u4F34\u58F0\u660E\u610F\u56FE\u8303\u56F4\uFF1B\u771F\u6B63\u53EF\u8C03\u7528\u7684\u5DE5\u5177\u4ECD\u6765\u81EA\u6240\u9009 Agent Preset\uFF0C\u5E76\u7EE7\u7EED\u6267\u884C\u5404\u63D2\u4EF6\u6743\u9650\u3002" }),
16209
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-capability-save-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: [
16328
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-form is-capabilities", children: [
16329
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SectionHeading, { eyebrow: "COMPOSITION", title: "\u80FD\u529B\u7EC4\u5408", detail: "\u4F19\u4F34\u58F0\u660E\u610F\u56FE\u8303\u56F4\uFF1B\u771F\u6B63\u53EF\u8C03\u7528\u7684\u5DE5\u5177\u4ECD\u6765\u81EA\u6240\u9009 Agent Preset\uFF0C\u5E76\u7EE7\u7EED\u6267\u884C\u5404\u63D2\u4EF6\u6743\u9650\u3002" }),
16330
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-capability-save-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: [
16210
16331
  saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : saved ? "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u751F\u6548" : "\u4FEE\u6539\u81EA\u52A8\u4FDD\u5B58\uFF0C\u65E0\u9700\u5E94\u7528\u7EC4\u5408\u3002",
16211
- error && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error })
16212
- ] }),
16213
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-runtime-fields", children: [
16214
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField, { label: "Agent Preset", hint: "\u5DE5\u5177\u3001Skill \u4E0E\u7CFB\u7EDF\u63D0\u793A", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("select", { disabled: saving, value: form.presetId, onChange: (event) => edit({ ...form, presetId: event.target.value }), children: [
16215
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: "", children: "\u8DDF\u968F DSH \u9ED8\u8BA4 Preset" }),
16216
- presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: item.id, children: item.name }, item.id))
16217
- ] }) }),
16218
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField, { label: "\u6A21\u578B\u63D0\u4F9B\u65B9", hint: "\u6765\u81EA\u5F53\u524D\u5BA2\u6237\u7AEF", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("select", { disabled: saving, value: form.provider, onChange: (event) => edit({ ...form, provider: event.target.value, model: "" }), children: [
16219
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("option", { value: "", children: [
16220
- "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
16221
- modelCatalog?.defaultSelection.provider || "\u6B63\u5728\u8BFB\u53D6"
16222
- ] }),
16223
- modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
16224
- ] }) }),
16225
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField, { label: "\u6A21\u578B", hint: "\u968F\u63D0\u4F9B\u65B9\u8054\u52A8", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("select", { disabled: saving, value: form.model, onChange: (event) => edit({ ...form, model: event.target.value }), children: [
16226
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("option", { value: "", children: [
16227
- "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
16228
- modelCatalog?.defaultSelection.model || "\u6B63\u5728\u8BFB\u53D6"
16229
- ] }),
16230
- currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("option", { value: form.model, children: [
16231
- "\u5F53\u524D\u914D\u7F6E \xB7 ",
16232
- form.model
16233
- ] }),
16234
- modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
16235
- ] }) })
16332
+ error && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error })
16236
16333
  ] }),
16237
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "dsh-partner-inline-note", children: "\u8EAB\u4EFD\u4E0E\u80FD\u529B\u5728\u4E0B\u4E00\u8F6E\u6267\u884C\u524D\u66F4\u65B0\uFF1BPreset \u4E0E\u6A21\u578B\u4F5C\u4E3A\u4F1A\u8BDD\u9ED8\u8BA4\u914D\u7F6E\uFF0C\u4E0D\u8986\u76D6\u5DF2\u6709\u4F1A\u8BDD\u7684\u9009\u62E9\u3002" }),
16238
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(CapabilityResources, { companionId: companion.id, capabilities: persistedCapabilities, disabled: saving, children: (manage) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "dsh-partner-capability-groups", children: groups.map((group) => {
16334
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(RuntimeSettings, { value: form, catalog: modelCatalog, presets, saving, saved, error, change: (patch) => edit({ ...form, ...patch }) }),
16335
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "dsh-partner-inline-note", children: "\u8EAB\u4EFD\u4E0E\u80FD\u529B\u5728\u4E0B\u4E00\u8F6E\u6267\u884C\u524D\u66F4\u65B0\uFF1BPreset \u4E0E\u6A21\u578B\u4F5C\u4E3A\u4F1A\u8BDD\u9ED8\u8BA4\u914D\u7F6E\uFF0C\u4E0D\u8986\u76D6\u5DF2\u6709\u4F1A\u8BDD\u7684\u9009\u62E9\u3002" }),
16336
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(CapabilityResources, { companionId: companion.id, capabilities: persistedCapabilities, disabled: saving, children: (manage) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "dsh-partner-capability-groups", children: groups.map((group) => {
16239
16337
  const enabled = group.choices.filter((choice) => form.capabilities.includes(choice.id)).length;
16240
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("section", { className: "dsh-partner-capability-group", "aria-labelledby": `partner-capability-${group.id}`, children: [
16241
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("header", { children: [
16242
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
16243
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: group.eyebrow }),
16244
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { id: `partner-capability-${group.id}`, children: group.title }),
16245
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: group.detail })
16338
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("section", { className: "dsh-partner-capability-group", "aria-labelledby": `partner-capability-${group.id}`, children: [
16339
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("header", { children: [
16340
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { children: [
16341
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("small", { children: group.eyebrow }),
16342
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("strong", { id: `partner-capability-${group.id}`, children: group.title }),
16343
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { children: group.detail })
16246
16344
  ] }),
16247
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("em", { children: [
16345
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("em", { children: [
16248
16346
  enabled,
16249
16347
  " / ",
16250
16348
  group.choices.length,
16251
16349
  " \u5DF2\u542F\u7528"
16252
16350
  ] })
16253
16351
  ] }),
16254
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-capabilities", children: [
16352
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-capabilities", children: [
16255
16353
  group.choices.map((choice) => {
16256
16354
  const active2 = form.capabilities.includes(choice.id);
16257
- const control = /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("button", { type: "button", disabled: saving, className: active2 ? "is-active" : "", "aria-pressed": active2, onClick: () => toggle(choice.id), children: [
16258
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: active2 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives20.IconCheckOutlineRegular, { size: 14 }) }),
16259
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: choice.title }),
16260
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: choice.detail })
16355
+ const control = /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("button", { type: "button", disabled: saving, className: active2 ? "is-active" : "", "aria-pressed": active2, onClick: () => toggle(choice.id), children: [
16356
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: active2 && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_dsh_client_ui_primitives21.IconCheckOutlineRegular, { size: 14 }) }),
16357
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("strong", { children: choice.title }),
16358
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("small", { children: choice.detail })
16261
16359
  ] });
16262
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-capability-card", children: [
16360
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-capability-card", children: [
16263
16361
  control,
16264
16362
  (choice.id === "skills" || choice.id === "mcp") && manage(choice.id)
16265
16363
  ] }, choice.id);
16266
16364
  }),
16267
- group.id === "coordination" && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-capability-card is-access", children: [
16268
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-capability-card-copy", children: [
16269
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: "\u53EF\u8BBF\u95EE\u4F19\u4F34" }),
16270
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "\u9009\u62E9\u80FD\u4E86\u89E3\u5176\u80FD\u529B\u5E76\u59D4\u6D3E\u4EFB\u52A1\u7684\u4F19\u4F34\u3002" })
16365
+ group.id === "coordination" && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-capability-card is-access", children: [
16366
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-capability-card-copy", children: [
16367
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("strong", { children: "\u53EF\u8BBF\u95EE\u4F19\u4F34" }),
16368
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("small", { children: "\u9009\u62E9\u80FD\u4E86\u89E3\u5176\u80FD\u529B\u5E76\u59D4\u6D3E\u4EFB\u52A1\u7684\u4F19\u4F34\u3002" })
16271
16369
  ] }),
16272
16370
  manage("access")
16273
16371
  ] })
@@ -16278,26 +16376,26 @@ function CapabilityEditor({ companion, presets, onChanged }) {
16278
16376
  }
16279
16377
 
16280
16378
  // src/ui/identity-editor.tsx
16281
- var import_react46 = require("react");
16282
- var import_dsh_client_ui_primitives21 = require("@deepseek-ai/dsh-client-ui-primitives");
16283
- var import_jsx_runtime43 = require("react/jsx-runtime");
16379
+ var import_react47 = require("react");
16380
+ var import_dsh_client_ui_primitives22 = require("@deepseek-ai/dsh-client-ui-primitives");
16381
+ var import_jsx_runtime44 = require("react/jsx-runtime");
16284
16382
  function IdentityEditor(props) {
16285
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(IdentityEditorForm, { ...props }, props.companion.id);
16383
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(IdentityEditorForm, { ...props }, props.companion.id);
16286
16384
  }
16287
16385
  function IdentityEditorForm({ companion, onChanged }) {
16288
- const [form, setForm] = (0, import_react46.useState)(() => companionDraft(companion));
16289
- const [operation, setOperation] = (0, import_react46.useState)();
16290
- const [saved, setSaved] = (0, import_react46.useState)(false);
16291
- const [error, setError] = (0, import_react46.useState)();
16292
- const locked = (0, import_react46.useRef)(false);
16293
- const alive = (0, import_react46.useRef)(true);
16294
- (0, import_react46.useEffect)(() => {
16386
+ const [form, setForm] = (0, import_react47.useState)(() => companionDraft(companion));
16387
+ const [operation, setOperation] = (0, import_react47.useState)();
16388
+ const [saved, setSaved] = (0, import_react47.useState)(false);
16389
+ const [error, setError] = (0, import_react47.useState)();
16390
+ const locked = (0, import_react47.useRef)(false);
16391
+ const alive = (0, import_react47.useRef)(true);
16392
+ (0, import_react47.useEffect)(() => {
16295
16393
  alive.current = true;
16296
16394
  return () => {
16297
16395
  alive.current = false;
16298
16396
  };
16299
16397
  }, []);
16300
- (0, import_react46.useEffect)(() => {
16398
+ (0, import_react47.useEffect)(() => {
16301
16399
  setForm(companionDraft(companion));
16302
16400
  setSaved(false);
16303
16401
  }, [companion.updatedAt]);
@@ -16321,40 +16419,40 @@ function IdentityEditorForm({ companion, onChanged }) {
16321
16419
  if (alive.current) setOperation(void 0);
16322
16420
  }
16323
16421
  };
16324
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("form", { id: "dsh-partner-identity-editor", className: "dsh-partner-form is-identity", "aria-busy": operation !== void 0, onSubmit: (event) => {
16422
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("form", { id: "dsh-partner-identity-editor", className: "dsh-partner-form is-identity", "aria-busy": operation !== void 0, onSubmit: (event) => {
16325
16423
  void submit(event);
16326
16424
  }, children: [
16327
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SectionHeading, { eyebrow: "IDENTITY", title: "\u5DE5\u4F5C\u8EAB\u4EFD", detail: "\u5B83\u4E0D\u662F\u4E00\u6B21\u5BF9\u8BDD\u7684\u63D0\u793A\u8BCD\uFF0C\u800C\u662F\u8FD9\u4E2A\u4F19\u4F34\u5728\u684C\u9762\u548C\u5FAE\u4FE1\u4E2D\u7684\u957F\u671F\u884C\u4E3A\u57FA\u7EBF\u3002" }),
16328
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("section", { className: "dsh-partner-identity-card", "aria-label": "\u8EAB\u4EFD\u914D\u7F6E", children: [
16329
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-fields two", children: [
16330
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormField, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("input", { disabled: busy, required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
16331
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormField, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("input", { disabled: busy, required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
16425
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SectionHeading, { eyebrow: "IDENTITY", title: "\u5DE5\u4F5C\u8EAB\u4EFD", detail: "\u5B83\u4E0D\u662F\u4E00\u6B21\u5BF9\u8BDD\u7684\u63D0\u793A\u8BCD\uFF0C\u800C\u662F\u8FD9\u4E2A\u4F19\u4F34\u5728\u684C\u9762\u548C\u5FAE\u4FE1\u4E2D\u7684\u957F\u671F\u884C\u4E3A\u57FA\u7EBF\u3002" }),
16426
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("section", { className: "dsh-partner-identity-card", "aria-label": "\u8EAB\u4EFD\u914D\u7F6E", children: [
16427
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "dsh-partner-fields two", children: [
16428
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormField, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("input", { disabled: busy, required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
16429
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormField, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("input", { disabled: busy, required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
16332
16430
  ] }),
16333
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormField, { label: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D", hint: "\u7528\u4E8E\u540D\u518C\u8BC6\u522B\uFF0C\u4E0D\u4F1A\u66FF\u4EE3\u5B8C\u6574\u884C\u4E3A\u51C6\u5219\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("textarea", { disabled: busy, rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
16334
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormField, { label: "\u957F\u671F\u884C\u4E3A\u51C6\u5219", hint: "\u5EFA\u8BAE\u5199\u804C\u8D23\u3001\u8868\u8FBE\u65B9\u5F0F\u4E0E\u8FB9\u754C\uFF1B\u6E20\u9053\u3001\u5DE5\u5177\u548C\u6388\u6743\u7531\u7CFB\u7EDF\u5355\u72EC\u63A7\u5236\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("textarea", { disabled: busy, rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
16335
- error && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
16336
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-form-actions", children: [
16337
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { role: "status", children: saved && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
16338
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_dsh_client_ui_primitives21.IconCheckOutlineRegular, { size: 14 }),
16431
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormField, { label: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D", hint: "\u7528\u4E8E\u540D\u518C\u8BC6\u522B\uFF0C\u4E0D\u4F1A\u66FF\u4EE3\u5B8C\u6574\u884C\u4E3A\u51C6\u5219\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("textarea", { disabled: busy, rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
16432
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FormField, { label: "\u957F\u671F\u884C\u4E3A\u51C6\u5219", hint: "\u5EFA\u8BAE\u5199\u804C\u8D23\u3001\u8868\u8FBE\u65B9\u5F0F\u4E0E\u8FB9\u754C\uFF1B\u6E20\u9053\u3001\u5DE5\u5177\u548C\u6388\u6743\u7531\u7CFB\u7EDF\u5355\u72EC\u63A7\u5236\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("textarea", { disabled: busy, rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
16433
+ error && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
16434
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "dsh-partner-form-actions", children: [
16435
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { role: "status", children: saved && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
16436
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_dsh_client_ui_primitives22.IconCheckOutlineRegular, { size: 14 }),
16339
16437
  "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u5C06\u4F7F\u7528\u65B0\u8EAB\u4EFD"
16340
16438
  ] }) }),
16341
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { disabled: busy, children: operation === "save" ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
16439
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { disabled: busy, children: operation === "save" ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
16342
16440
  ] })
16343
16441
  ] })
16344
16442
  ] });
16345
16443
  }
16346
16444
 
16347
16445
  // src/ui/companion-deletion.tsx
16348
- var import_react47 = require("react");
16349
- var import_dsh_client_ui_primitives22 = require("@deepseek-ai/dsh-client-ui-primitives");
16350
- var import_jsx_runtime44 = require("react/jsx-runtime");
16446
+ var import_react48 = require("react");
16447
+ var import_dsh_client_ui_primitives23 = require("@deepseek-ai/dsh-client-ui-primitives");
16448
+ var import_jsx_runtime45 = require("react/jsx-runtime");
16351
16449
  function CompanionDeletion({ companion, count, channelCount, onRemoved }) {
16352
- const [open, setOpen] = (0, import_react47.useState)(false);
16353
- const [busy, setBusy] = (0, import_react47.useState)(false);
16354
- const [removed, setRemoved] = (0, import_react47.useState)(false);
16355
- const [error, setError] = (0, import_react47.useState)("");
16356
- const locked = (0, import_react47.useRef)(false), alive = (0, import_react47.useRef)(true);
16357
- (0, import_react47.useEffect)(() => {
16450
+ const [open, setOpen] = (0, import_react48.useState)(false);
16451
+ const [busy, setBusy] = (0, import_react48.useState)(false);
16452
+ const [removed, setRemoved] = (0, import_react48.useState)(false);
16453
+ const [error, setError] = (0, import_react48.useState)("");
16454
+ const locked = (0, import_react48.useRef)(false), alive = (0, import_react48.useRef)(true);
16455
+ (0, import_react48.useEffect)(() => {
16358
16456
  alive.current = true;
16359
16457
  return () => {
16360
16458
  alive.current = false;
@@ -16382,25 +16480,25 @@ function CompanionDeletion({ companion, count, channelCount, onRemoved }) {
16382
16480
  if (alive.current) setBusy(false);
16383
16481
  }
16384
16482
  };
16385
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "dsh-partner-overview-delete", children: [
16386
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("button", { type: "button", className: "is-danger", disabled: busy || removed || count <= 1, title: count <= 1 ? "\u81F3\u5C11\u4FDD\u7559\u4E00\u4E2A\u4F19\u4F34" : void 0, onClick: () => {
16483
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "dsh-partner-overview-delete", children: [
16484
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("button", { type: "button", className: "is-danger", disabled: busy || removed || count <= 1, title: count <= 1 ? "\u81F3\u5C11\u4FDD\u7559\u4E00\u4E2A\u4F19\u4F34" : void 0, onClick: () => {
16387
16485
  setError("");
16388
16486
  setOpen(true);
16389
16487
  }, children: [
16390
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_dsh_client_ui_primitives22.IconTrashOutlineRegular, { size: 16 }),
16488
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_dsh_client_ui_primitives23.IconTrashOutlineRegular, { size: 16 }),
16391
16489
  "\u5220\u9664\u4F19\u4F34"
16392
16490
  ] }),
16393
- !open && error && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
16394
- open && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(WorkspaceDialog, { title: `\u5220\u9664\u300C${companion.name}\u300D\uFF1F`, detail: "\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\uFF0C\u53EA\u5220\u9664\u5F53\u524D\u786E\u8BA4\u7684\u4F19\u4F34\u3002", close: () => {
16491
+ !open && error && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
16492
+ open && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(WorkspaceDialog, { title: `\u5220\u9664\u300C${companion.name}\u300D\uFF1F`, detail: "\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\uFF0C\u53EA\u5220\u9664\u5F53\u524D\u786E\u8BA4\u7684\u4F19\u4F34\u3002", close: () => {
16395
16493
  if (!locked.current) setOpen(false);
16396
16494
  }, children: [
16397
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { children: "\u5C06\u6E05\u7406\u8EAB\u4EFD\u3001\u8BB0\u5FC6\u3001\u6301\u7EED\u5173\u6CE8\u3001\u80FD\u529B\u7ED1\u5B9A\u3001\u5B9A\u65F6\u4EFB\u52A1\u53CA\u4E13\u5C5E\u76EE\u5F55\u4E2D\u7684\u5168\u90E8\u6587\u4EF6\u3002" }),
16398
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { children: channelCount ? `\u5DF2\u7ED1\u5B9A ${channelCount} \u4E2A\u6E20\u9053\u3002\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u505C\u6B62\u5E76\u5220\u9664\u8FD9\u4E9B\u6E20\u9053\u3001\u767B\u5F55\u51ED\u636E\u548C\u8054\u7CFB\u4EBA\u6388\u6743\uFF0C\u65E0\u9700\u5148\u624B\u52A8\u89E3\u7ED1\u3002` : "\u8BE5\u4F19\u4F34\u6CA1\u6709\u7ED1\u5B9A\u6E20\u9053\u3002" }),
16399
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { children: "DSH \u539F\u4F1A\u8BDD\u65E5\u5FD7\u7531\u5BBF\u4E3B\u7BA1\u7406\uFF0C\u4E0D\u5728\u6B64\u6B21\u5220\u9664\u8303\u56F4\u3002\u6B63\u5728\u6267\u884C\u7684\u4EFB\u52A1\u53CA\u5171\u4EAB\u6216\u5F02\u5E38\u76EE\u5F55\u4ECD\u4F1A\u62E6\u622A\u5220\u9664\u3002" }),
16400
- error && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
16401
- /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "dsh-partner-form-actions", children: [
16402
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", disabled: busy, onClick: () => setOpen(false), children: "\u53D6\u6D88" }),
16403
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: () => {
16495
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { children: "\u5C06\u6E05\u7406\u8EAB\u4EFD\u3001\u8BB0\u5FC6\u3001\u6301\u7EED\u5173\u6CE8\u3001\u80FD\u529B\u7ED1\u5B9A\u3001\u5B9A\u65F6\u4EFB\u52A1\u53CA\u4E13\u5C5E\u76EE\u5F55\u4E2D\u7684\u5168\u90E8\u6587\u4EF6\u3002" }),
16496
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { children: channelCount ? `\u5DF2\u7ED1\u5B9A ${channelCount} \u4E2A\u6E20\u9053\u3002\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u505C\u6B62\u5E76\u5220\u9664\u8FD9\u4E9B\u6E20\u9053\u3001\u767B\u5F55\u51ED\u636E\u548C\u8054\u7CFB\u4EBA\u6388\u6743\uFF0C\u65E0\u9700\u5148\u624B\u52A8\u89E3\u7ED1\u3002` : "\u8BE5\u4F19\u4F34\u6CA1\u6709\u7ED1\u5B9A\u6E20\u9053\u3002" }),
16497
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { children: "DSH \u539F\u4F1A\u8BDD\u65E5\u5FD7\u7531\u5BBF\u4E3B\u7BA1\u7406\uFF0C\u4E0D\u5728\u6B64\u6B21\u5220\u9664\u8303\u56F4\u3002\u6B63\u5728\u6267\u884C\u7684\u4EFB\u52A1\u53CA\u5171\u4EAB\u6216\u5F02\u5E38\u76EE\u5F55\u4ECD\u4F1A\u62E6\u622A\u5220\u9664\u3002" }),
16498
+ error && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
16499
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "dsh-partner-form-actions", children: [
16500
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { type: "button", disabled: busy, onClick: () => setOpen(false), children: "\u53D6\u6D88" }),
16501
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: () => {
16404
16502
  void remove();
16405
16503
  }, children: busy ? "\u6B63\u5728\u5220\u9664\u2026" : "\u786E\u8BA4\u5220\u9664" })
16406
16504
  ] })
@@ -16409,25 +16507,25 @@ function CompanionDeletion({ companion, count, channelCount, onRemoved }) {
16409
16507
  }
16410
16508
 
16411
16509
  // src/ui/channels-panel.tsx
16412
- var import_react49 = require("react");
16510
+ var import_react52 = require("react");
16413
16511
 
16414
16512
  // src/ui/notification-settings.tsx
16415
- var import_react48 = require("react");
16416
- var import_jsx_runtime45 = require("react/jsx-runtime");
16513
+ var import_react49 = require("react");
16514
+ var import_jsx_runtime46 = require("react/jsx-runtime");
16417
16515
  function NotificationSettings({ companion, snapshot, onChanged }) {
16418
16516
  const channels = snapshot.channels.filter((c) => c.companionId === companion.id);
16419
16517
  const pairings = snapshot.pairings.filter((p) => channels.some((c) => c.id === p.channelId));
16420
- const [mode, setMode] = (0, import_react48.useState)(companion.notificationDelivery?.mode ?? "recent");
16421
- const [targets, setTargets] = (0, import_react48.useState)(companion.notificationDelivery?.targets ?? []);
16422
- const [selectedChannels, setSelectedChannels] = (0, import_react48.useState)(targets.map((t) => t.channelId));
16423
- const [busy, setBusy] = (0, import_react48.useState)(false), [feedback, setFeedback] = (0, import_react48.useState)(""), [failed, setFailed] = (0, import_react48.useState)(false);
16424
- const saveRef = (0, import_react48.useRef)(null);
16425
- (0, import_react48.useEffect)(() => {
16518
+ const [mode, setMode] = (0, import_react49.useState)(companion.notificationDelivery?.mode ?? "recent");
16519
+ const [targets, setTargets] = (0, import_react49.useState)(companion.notificationDelivery?.targets ?? []);
16520
+ const [selectedChannels, setSelectedChannels] = (0, import_react49.useState)(targets.map((t) => t.channelId));
16521
+ const [busy, setBusy] = (0, import_react49.useState)(false), [feedback, setFeedback] = (0, import_react49.useState)(""), [failed, setFailed] = (0, import_react49.useState)(false);
16522
+ const saveRef = (0, import_react49.useRef)(null);
16523
+ (0, import_react49.useEffect)(() => {
16426
16524
  if (!busy && feedback && document.activeElement === document.body) saveRef.current?.focus();
16427
16525
  }, [busy, feedback]);
16428
16526
  const unavailable = targets.filter((t) => !pairings.some((p) => p.channelId === t.channelId && p.userId === t.userId && p.status === "approved") || !channels.some((c) => c.id === t.channelId && c.enabled));
16429
- const emptyChannel = selectedChannels.some((id) => !targets.some((t) => t.channelId === id));
16430
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-channel-form dsh-partner-delivery-form", "aria-busy": busy, onSubmit: (e) => {
16527
+ const emptyChannel2 = selectedChannels.some((id) => !targets.some((t) => t.channelId === id));
16528
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-channel-form dsh-partner-delivery-form", "aria-busy": busy, onSubmit: (e) => {
16431
16529
  e.preventDefault();
16432
16530
  if (busy) return;
16433
16531
  setBusy(true);
@@ -16442,41 +16540,41 @@ function NotificationSettings({ companion, snapshot, onChanged }) {
16442
16540
  setFeedback(errorMessage(error));
16443
16541
  }).finally(() => setBusy(false));
16444
16542
  }, children: [
16445
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "dsh-partner-channel-field", children: [
16446
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: "\u901A\u77E5\u53D1\u9001\u5230" }),
16447
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("select", { disabled: busy, value: mode, onChange: (e) => setMode(e.target.value), children: [
16448
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("option", { value: "recent", children: "\u6700\u8FD1\u8054\u7CFB\u7684\u6E20\u9053\u4E0E\u7528\u6237" }),
16449
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("option", { value: "selected", children: "\u6307\u5B9A\u6E20\u9053\u4E0E\u63A5\u6536\u4EBA" })
16543
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { className: "dsh-partner-channel-field", children: [
16544
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: "\u901A\u77E5\u53D1\u9001\u5230" }),
16545
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("select", { disabled: busy, value: mode, onChange: (e) => setMode(e.target.value), children: [
16546
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("option", { value: "recent", children: "\u6700\u8FD1\u8054\u7CFB\u7684\u6E20\u9053\u4E0E\u7528\u6237" }),
16547
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("option", { value: "selected", children: "\u6307\u5B9A\u6E20\u9053\u4E0E\u63A5\u6536\u4EBA" })
16450
16548
  ] })
16451
16549
  ] }),
16452
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { children: "\u4EC5\u5F71\u54CD\u4E3B\u52A8\u901A\u77E5\u4E0E\u7ED3\u679C\u4EA4\u4ED8\u3002\u5BF9\u8BDD\u56DE\u590D\u4ECD\u53D1\u9001\u5230\u6D88\u606F\u6765\u6E90\u6E20\u9053\u3002" }),
16453
- !companion.notificationDelivery && pairings.some((p) => p.deliveryTarget) && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { role: "status", children: "\u5F53\u524D\u4ECD\u4F7F\u7528\u65E7\u7684\u8054\u7CFB\u4EBA\u6295\u9012\u89C4\u5219\uFF0C\u4FDD\u5B58\u540E\u7EDF\u4E00\u4F7F\u7528\u8FD9\u91CC\u7684\u901A\u77E5\u8BBE\u7F6E\u3002" }),
16454
- mode === "selected" && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "dsh-partner-notification-choices", children: [
16455
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { children: "\u53EF\u9009\u62E9\u591A\u4E2A\u6E20\u9053\uFF1B\u6BCF\u4E2A\u6E20\u9053\u81F3\u5C11\u9009\u62E9\u4E00\u4F4D\u5DF2\u6388\u6743\u63A5\u6536\u4EBA\u3002\u4FDD\u5B58\u540E\u5BF9\u65B0\u901A\u77E5\u751F\u6548\uFF0C\u5F85\u91CD\u8BD5\u901A\u77E5\u4FDD\u7559\u539F\u63A5\u6536\u4EBA\u3002" }),
16456
- !channels.length && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { children: "\u8BF7\u5148\u6DFB\u52A0\u6E20\u9053\u5E76\u6388\u6743\u8054\u7CFB\u4EBA\u3002" }),
16457
- channels.map((channel) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("fieldset", { disabled: busy, className: "dsh-partner-notification-channel", children: [
16458
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("legend", { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { children: [
16459
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("input", { type: "checkbox", checked: selectedChannels.includes(channel.id), onChange: (e) => {
16550
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: "\u4EC5\u5F71\u54CD\u4E3B\u52A8\u901A\u77E5\u4E0E\u7ED3\u679C\u4EA4\u4ED8\u3002\u5BF9\u8BDD\u56DE\u590D\u4ECD\u53D1\u9001\u5230\u6D88\u606F\u6765\u6E90\u6E20\u9053\u3002" }),
16551
+ !companion.notificationDelivery && pairings.some((p) => p.deliveryTarget) && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { role: "status", children: "\u5F53\u524D\u4ECD\u4F7F\u7528\u65E7\u7684\u8054\u7CFB\u4EBA\u6295\u9012\u89C4\u5219\uFF0C\u4FDD\u5B58\u540E\u7EDF\u4E00\u4F7F\u7528\u8FD9\u91CC\u7684\u901A\u77E5\u8BBE\u7F6E\u3002" }),
16552
+ mode === "selected" && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-notification-choices", children: [
16553
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: "\u53EF\u9009\u62E9\u591A\u4E2A\u6E20\u9053\uFF1B\u6BCF\u4E2A\u6E20\u9053\u81F3\u5C11\u9009\u62E9\u4E00\u4F4D\u5DF2\u6388\u6743\u63A5\u6536\u4EBA\u3002\u4FDD\u5B58\u540E\u5BF9\u65B0\u901A\u77E5\u751F\u6548\uFF0C\u5F85\u91CD\u8BD5\u901A\u77E5\u4FDD\u7559\u539F\u63A5\u6536\u4EBA\u3002" }),
16554
+ !channels.length && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: "\u8BF7\u5148\u6DFB\u52A0\u6E20\u9053\u5E76\u6388\u6743\u8054\u7CFB\u4EBA\u3002" }),
16555
+ channels.map((channel) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("fieldset", { disabled: busy, className: "dsh-partner-notification-channel", children: [
16556
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("legend", { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { children: [
16557
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("input", { type: "checkbox", checked: selectedChannels.includes(channel.id), onChange: (e) => {
16460
16558
  setSelectedChannels((ids) => e.target.checked ? [...ids, channel.id] : ids.filter((id) => id !== channel.id));
16461
16559
  if (!e.target.checked) setTargets((items) => items.filter((t) => t.channelId !== channel.id));
16462
16560
  } }),
16463
16561
  channel.name,
16464
16562
  !channel.enabled ? "\uFF08\u5DF2\u505C\u7528\uFF09" : ""
16465
16563
  ] }) }),
16466
- selectedChannels.includes(channel.id) && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "dsh-partner-notification-users", children: [
16467
- !pairings.some((p) => p.channelId === channel.id && p.status === "approved") && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { children: "\u6682\u65E0\u5DF2\u6388\u6743\u63A5\u6536\u4EBA\uFF0C\u8BF7\u5148\u5728\u6E20\u9053\u914D\u7F6E\u4E2D\u6279\u51C6\u8054\u7CFB\u4EBA\u3002" }),
16468
- pairings.filter((p) => p.channelId === channel.id && p.status === "approved").map((p) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { children: [
16469
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("input", { type: "checkbox", checked: targets.some((t) => t.channelId === p.channelId && t.userId === p.userId), onChange: (e) => setTargets((items) => e.target.checked ? [...items, { channelId: p.channelId, userId: p.userId }] : items.filter((t) => t.channelId !== p.channelId || t.userId !== p.userId)) }),
16470
- /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { children: [
16564
+ selectedChannels.includes(channel.id) && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-notification-users", children: [
16565
+ !pairings.some((p) => p.channelId === channel.id && p.status === "approved") && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: "\u6682\u65E0\u5DF2\u6388\u6743\u63A5\u6536\u4EBA\uFF0C\u8BF7\u5148\u5728\u6E20\u9053\u914D\u7F6E\u4E2D\u6279\u51C6\u8054\u7CFB\u4EBA\u3002" }),
16566
+ pairings.filter((p) => p.channelId === channel.id && p.status === "approved").map((p) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { children: [
16567
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("input", { type: "checkbox", checked: targets.some((t) => t.channelId === p.channelId && t.userId === p.userId), onChange: (e) => setTargets((items) => e.target.checked ? [...items, { channelId: p.channelId, userId: p.userId }] : items.filter((t) => t.channelId !== p.channelId || t.userId !== p.userId)) }),
16568
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
16471
16569
  p.displayName,
16472
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("small", { children: p.userId })
16570
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: p.userId })
16473
16571
  ] })
16474
16572
  ] }, p.id))
16475
16573
  ] })
16476
16574
  ] }, channel.id)),
16477
- unavailable.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { role: "alert", children: [
16478
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { children: "\u90E8\u5206\u5DF2\u9009\u63A5\u6536\u4EBA\u5DF2\u5931\u6548\u6216\u6E20\u9053\u5DF2\u505C\u7528\u3002\u8BF7\u79FB\u9664\u6216\u6062\u590D\u6388\u6743\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6539\u53D1\u5176\u4ED6\u4EBA\u3002" }),
16479
- unavailable.map((t) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("button", { type: "button", disabled: busy, onClick: () => {
16575
+ unavailable.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { role: "alert", children: [
16576
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: "\u90E8\u5206\u5DF2\u9009\u63A5\u6536\u4EBA\u5DF2\u5931\u6548\u6216\u6E20\u9053\u5DF2\u505C\u7528\u3002\u8BF7\u79FB\u9664\u6216\u6062\u590D\u6388\u6743\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6539\u53D1\u5176\u4ED6\u4EBA\u3002" }),
16577
+ unavailable.map((t) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("button", { type: "button", disabled: busy, onClick: () => {
16480
16578
  setTargets((items) => items.filter((x) => x.channelId !== t.channelId || x.userId !== t.userId));
16481
16579
  if (!targets.some((x) => x.channelId === t.channelId && x.userId !== t.userId)) setSelectedChannels((ids) => ids.filter((id) => id !== t.channelId));
16482
16580
  }, children: [
@@ -16485,27 +16583,356 @@ function NotificationSettings({ companion, snapshot, onChanged }) {
16485
16583
  ] }, JSON.stringify(t)))
16486
16584
  ] })
16487
16585
  ] }),
16488
- feedback && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { role: failed ? "alert" : "status", children: feedback }),
16489
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("footer", { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { ref: saveRef, className: "is-primary", disabled: busy || mode === "selected" && (!targets.length || unavailable.length > 0 || emptyChannel), children: busy ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58\u901A\u77E5\u8BBE\u7F6E" }) })
16586
+ feedback && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { role: failed ? "alert" : "status", children: feedback }),
16587
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("footer", { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { ref: saveRef, className: "is-primary", disabled: busy || mode === "selected" && (!targets.length || unavailable.length > 0 || emptyChannel2), children: busy ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58\u901A\u77E5\u8BBE\u7F6E" }) })
16588
+ ] });
16589
+ }
16590
+
16591
+ // src/ui/push-channels.tsx
16592
+ var import_react51 = require("react");
16593
+
16594
+ // src/ui/push-editor.tsx
16595
+ var import_react50 = require("react");
16596
+
16597
+ // src/ui/push-draft.ts
16598
+ function pushDraft(channel) {
16599
+ return { ...channel, targets: channel.targets.map((target) => ({ ...target, key: "" })) };
16600
+ }
16601
+ function pushDraftSignature(form) {
16602
+ return JSON.stringify({
16603
+ name: form.name,
16604
+ baseUrl: form.baseUrl,
16605
+ enabled: form.enabled,
16606
+ notifyProblems: form.notifyProblems,
16607
+ content: form.content,
16608
+ group: form.group,
16609
+ sound: form.sound,
16610
+ openUrl: form.openUrl,
16611
+ targets: form.targets.map(({ id, name, enabled, key }) => ({ id, name, enabled, key }))
16612
+ });
16613
+ }
16614
+
16615
+ // src/ui/push-editor.tsx
16616
+ var import_jsx_runtime47 = require("react/jsx-runtime");
16617
+ var statusText = { pending: "\u7B49\u5F85\u53D1\u9001 / \u91CD\u8BD5", sending: "\u53D1\u9001\u4E2D", accepted: "\u670D\u52A1\u7AEF\u5DF2\u63A5\u53D7", failed: "\u53D1\u9001\u5931\u8D25", canceled: "\u5DF2\u53D6\u6D88" };
16618
+ function BarkEditor({ initial, onSaved, onChanged, onDelete, onBusy, onDirty }) {
16619
+ const [form, setForm] = (0, import_react50.useState)(() => pushDraft(initial));
16620
+ const [baseline, setBaseline] = (0, import_react50.useState)(() => pushDraftSignature(pushDraft(initial)));
16621
+ const [busy, setBusy] = (0, import_react50.useState)(false), [feedback, setFeedback] = (0, import_react50.useState)(""), [failed, setFailed] = (0, import_react50.useState)(false);
16622
+ const dirty = pushDraftSignature(form) !== baseline;
16623
+ const [records, setRecords] = (0, import_react50.useState)();
16624
+ const [confirmClear, setConfirmClear] = (0, import_react50.useState)(false);
16625
+ (0, import_react50.useLayoutEffect)(() => onDirty(dirty), [dirty, onDirty]);
16626
+ const recordsOpen = records !== void 0;
16627
+ (0, import_react50.useEffect)(() => {
16628
+ if (!recordsOpen || !initial.id || busy) return;
16629
+ let active2 = true, loading = false;
16630
+ const timer2 = window.setInterval(() => {
16631
+ if (loading || document.hidden) return;
16632
+ loading = true;
16633
+ void api(`/push-channels/${initial.id}/deliveries`).then((rows) => {
16634
+ if (active2) setRecords(rows);
16635
+ }).catch(() => {
16636
+ }).finally(() => {
16637
+ loading = false;
16638
+ });
16639
+ }, 5e3);
16640
+ return () => {
16641
+ active2 = false;
16642
+ clearInterval(timer2);
16643
+ };
16644
+ }, [recordsOpen, initial.id, busy]);
16645
+ const update = (patch) => {
16646
+ setForm((f) => ({ ...f, ...patch }));
16647
+ setFeedback("");
16648
+ };
16649
+ const target = (index2, patch) => update({ targets: form.targets.map((t, i) => i === index2 ? { ...t, ...patch } : t) });
16650
+ const run = async (action) => {
16651
+ if (busy) return;
16652
+ setBusy(true);
16653
+ onBusy(true);
16654
+ setFeedback("");
16655
+ setFailed(false);
16656
+ try {
16657
+ await action();
16658
+ } catch (e) {
16659
+ setFailed(true);
16660
+ setFeedback(errorMessage(e));
16661
+ } finally {
16662
+ setBusy(false);
16663
+ onBusy(false);
16664
+ }
16665
+ };
16666
+ const save = async () => {
16667
+ const saved = await api(initial.id ? `/push-channels/${initial.id}` : "/push-channels", { method: initial.id ? "PUT" : "POST", body: JSON.stringify(form) });
16668
+ const draft = pushDraft(saved);
16669
+ setForm(draft);
16670
+ setBaseline(pushDraftSignature(draft));
16671
+ onSaved(saved);
16672
+ try {
16673
+ await onChanged();
16674
+ } catch {
16675
+ setFailed(true);
16676
+ setFeedback("\u6E20\u9053\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u5217\u8868\u5237\u65B0\u5931\u8D25\u3002\u8BF7\u5237\u65B0\u9875\u9762\uFF0C\u65E0\u9700\u91CD\u590D\u4FDD\u5B58\u3002");
16677
+ return;
16678
+ }
16679
+ setFeedback("\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u6B21\u5B8C\u6210\u4E8B\u4EF6\u8D77\u81EA\u52A8\u901A\u77E5\u3002");
16680
+ };
16681
+ const importAddress = (index2, value) => {
16682
+ if (!/^https?:\/\//i.test(value)) return false;
16683
+ try {
16684
+ const url = new URL(value.trim()), segments = url.pathname.split("/").filter(Boolean), key = segments.pop();
16685
+ if (!key || !/^[A-Za-z0-9_-]+$/.test(key) || ["push", "ping"].includes(key) || url.search || url.hash || url.username || url.password) throw Error();
16686
+ url.pathname = segments.length ? `/${segments.join("/")}` : "/";
16687
+ const baseUrl = url.toString().replace(/\/$/, "");
16688
+ if (form.targets.some((t, i) => i !== index2 && (t.configured || t.key)) && form.baseUrl && baseUrl !== form.baseUrl.replace(/\/$/, "")) {
16689
+ setFailed(true);
16690
+ setFeedback("\u6B64\u5730\u5740\u5C5E\u4E8E\u53E6\u4E00\u4E2A\u670D\u52A1\u5668\uFF0C\u8BF7\u53E6\u5EFA Bark \u6E20\u9053\u3002");
16691
+ return true;
16692
+ }
16693
+ update({ baseUrl, targets: form.targets.map((t, i) => i === index2 ? { ...t, key } : t) });
16694
+ return true;
16695
+ } catch {
16696
+ setFailed(true);
16697
+ setFeedback("\u8BF7\u7C98\u8D34\u201C\u670D\u52A1\u5668/\u8BBE\u5907Key\u201D\u5730\u5740\uFF0C\u4E0D\u5305\u542B\u901A\u77E5\u6807\u9898\u3001\u6B63\u6587\u6216\u67E5\u8BE2\u53C2\u6570\u3002");
16698
+ return true;
16699
+ }
16700
+ };
16701
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-channel-form dsh-partner-push-form", "aria-busy": busy, onSubmit: (e) => {
16702
+ e.preventDefault();
16703
+ void run(save);
16704
+ }, children: [
16705
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "dsh-partner-push-heading", children: [
16706
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "dsh-partner-check", children: [
16707
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("input", { type: "checkbox", checked: form.enabled, disabled: busy, onChange: (e) => update({ enabled: e.target.checked }) }),
16708
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("i", { "aria-hidden": "true" }),
16709
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: "\u542F\u7528\u5B8C\u6210\u901A\u77E5" })
16710
+ ] }),
16711
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("small", { children: "\u5355\u5411\u63A8\u9001\uFF0C\u4E0D\u63A5\u6536\u56DE\u590D" })
16712
+ ] }),
16713
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "dsh-partner-push-fields", children: [
16714
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Field, { label: "\u6E20\u9053\u540D\u79F0", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("input", { disabled: busy, maxLength: 80, value: form.name, onChange: (e) => update({ name: e.target.value }), placeholder: "\u4F8B\u5982\uFF1A\u6211\u7684 Bark" }) }),
16715
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Field, { label: "\u670D\u52A1\u5668\u5730\u5740", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("input", { disabled: busy, required: true, type: "url", value: form.baseUrl, onChange: (e) => update({ baseUrl: e.target.value }), placeholder: "https://api.day.app" }) })
16716
+ ] }),
16717
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { children: "\u652F\u6301\u81EA\u5EFA\u6216\u5185\u7F51\u5730\u5740\uFF0C\u4F46\u5FC5\u987B\u80FD\u4ECE DSH \u670D\u52A1\u7AEF\u8BBF\u95EE\u3002HTTP \u4F1A\u660E\u6587\u4F20\u8F93 Key\uFF0C\u5EFA\u8BAE\u4F7F\u7528 HTTPS\u3002" }),
16718
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "dsh-partner-push-heading", children: [
16719
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("strong", { children: "\u53D1\u9001\u76EE\u6807" }),
16720
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("button", { type: "button", disabled: busy || form.targets.length >= 50, onClick: () => update({ targets: [...form.targets, { id: "", name: "", key: "", enabled: true, configured: false }] }), children: "\u6DFB\u52A0\u76EE\u6807" })
16721
+ ] }),
16722
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "dsh-partner-push-targets", children: form.targets.map((t, index2) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "dsh-partner-push-target", children: [
16723
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "dsh-partner-push-enable dsh-partner-check", children: [
16724
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("input", { type: "checkbox", disabled: busy, checked: t.enabled, onChange: (e) => target(index2, { enabled: e.target.checked }), "aria-label": `\u542F\u7528\u76EE\u6807 ${index2 + 1}` }),
16725
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("i", { "aria-hidden": "true" })
16726
+ ] }),
16727
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Field, { label: `\u8BBE\u5907\u540D\u79F0 ${index2 + 1}`, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("input", { disabled: busy, maxLength: 80, value: t.name, onChange: (e) => target(index2, { name: e.target.value }), placeholder: "\u6211\u7684 iPhone" }) }),
16728
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Field, { label: `Device Key ${index2 + 1}`, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("input", { disabled: busy, type: "password", autoComplete: "new-password", required: !t.configured, value: t.key, onChange: (e) => {
16729
+ if (!importAddress(index2, e.target.value)) target(index2, { key: e.target.value });
16730
+ }, onPaste: (e) => {
16731
+ const value = e.clipboardData.getData("text");
16732
+ if (/^https?:\/\//i.test(value)) {
16733
+ e.preventDefault();
16734
+ importAddress(index2, value);
16735
+ }
16736
+ }, placeholder: t.configured ? "\u5DF2\u4FDD\u5B58 \xB7 \u7559\u7A7A\u4E0D\u4FEE\u6539" : "\u8BBE\u5907 Key \u6216\u5B8C\u6574\u63A8\u9001\u5730\u5740" }) }),
16737
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "dsh-partner-push-target-actions", children: [
16738
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("button", { type: "button", disabled: busy || dirty || !t.id, title: dirty ? "\u8BF7\u5148\u4FDD\u5B58\u914D\u7F6E\u518D\u6D4B\u8BD5" : "\u5411\u6B64\u8BBE\u5907\u53D1\u9001\u6D4B\u8BD5\u901A\u77E5", onClick: () => void run(async () => {
16739
+ const result = await api(`/push-channels/${initial.id}/test`, { method: "POST", body: JSON.stringify({ targetId: t.id }) });
16740
+ setFeedback(result.message);
16741
+ }), children: "\u6D4B\u8BD5" }),
16742
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("button", { type: "button", disabled: busy || form.targets.length === 1, "aria-label": `\u79FB\u9664\u76EE\u6807 ${index2 + 1}`, onClick: () => update({ targets: form.targets.filter((_, i) => i !== index2) }), children: "\u79FB\u9664" })
16743
+ ] })
16744
+ ] }, t.id || `new-${index2}`)) }),
16745
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("small", { children: "\u4FDD\u5B58\u540E\u53EF\u9010\u4E2A\u6D4B\u8BD5\u3002\u4FEE\u6539\u6216\u505C\u7528\u6E20\u9053\u4F1A\u53D6\u6D88\u65E7\u7684\u5F85\u53D1\u9001\u901A\u77E5\uFF0C\u907F\u514D\u6539\u53D1\u5230\u65B0\u8BBE\u5907\u3002" }),
16746
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("details", { children: [
16747
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("summary", { children: "\u9AD8\u7EA7\u9009\u9879" }),
16748
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "dsh-partner-push-fields", children: [
16749
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Field, { label: "\u901A\u77E5\u5185\u5BB9", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("select", { disabled: busy, value: form.content, onChange: (e) => update({ content: e.target.value }), children: [
16750
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("option", { value: "summary", children: "\u6807\u9898\u548C\u7B80\u77ED\u6458\u8981" }),
16751
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("option", { value: "title", children: "\u4EC5\u6807\u9898\uFF0C\u9690\u85CF\u7ED3\u679C\u5185\u5BB9" })
16752
+ ] }) }),
16753
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Field, { label: "\u901A\u77E5\u5206\u7EC4", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("input", { disabled: busy, maxLength: 80, value: form.group, onChange: (e) => update({ group: e.target.value }), placeholder: "DSH \u4F19\u4F34" }) }),
16754
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Field, { label: "\u63D0\u793A\u97F3\u540D\u79F0", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("input", { disabled: busy, maxLength: 80, value: form.sound, onChange: (e) => update({ sound: e.target.value }), placeholder: "\u7559\u7A7A\u4F7F\u7528\u8BBE\u5907\u9ED8\u8BA4\u58F0\u97F3" }) }),
16755
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Field, { label: "\u70B9\u51FB\u8DF3\u8F6C\u5730\u5740", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("input", { disabled: busy, type: "url", value: form.openUrl, onChange: (e) => update({ openUrl: e.target.value }), placeholder: "\u624B\u673A\u53EF\u8BBF\u95EE\u7684 DSH \u5730\u5740\uFF08\u53EF\u9009\uFF09" }) })
16756
+ ] }),
16757
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "dsh-partner-check", children: [
16758
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("input", { type: "checkbox", disabled: busy, checked: form.notifyProblems, onChange: (e) => update({ notifyProblems: e.target.checked }) }),
16759
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("i", { "aria-hidden": "true" }),
16760
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: "\u540C\u65F6\u901A\u77E5\u6700\u7EC8\u5931\u8D25\u6216\u9700\u8981\u5904\u7406\u7684\u53D7\u963B\u7ED3\u679C" })
16761
+ ] })
16762
+ ] }),
16763
+ feedback && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { role: failed ? "alert" : "status", children: feedback }),
16764
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("footer", { children: [
16765
+ initial.id && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
16766
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("button", { type: "button", disabled: busy, className: "is-danger", onClick: () => onDelete(initial), children: "\u5220\u9664\u6E20\u9053" }),
16767
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("button", { type: "button", disabled: busy, onClick: () => void run(async () => setRecords(await api(`/push-channels/${initial.id}/deliveries`))), children: "\u53D1\u9001\u8BB0\u5F55" })
16768
+ ] }),
16769
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("button", { className: "is-primary", disabled: busy || !dirty, children: busy ? "\u5904\u7406\u4E2D\u2026" : "\u4FDD\u5B58\u6E20\u9053" })
16770
+ ] }),
16771
+ records && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("section", { className: "dsh-partner-push-records", children: [
16772
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "dsh-partner-push-heading", children: [
16773
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("strong", { children: "\u6700\u8FD1\u53D1\u9001\u8BB0\u5F55 \xB7 \u81EA\u52A8\u66F4\u65B0" }),
16774
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("button", { type: "button", onClick: () => setRecords(void 0), children: "\u6536\u8D77" })
16775
+ ] }),
16776
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "dsh-partner-push-heading", children: [
16777
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("small", { children: "\u4EC5\u4FDD\u7559\u6700\u8FD1\u8BB0\u5F55\uFF1B\u91CD\u8BD5\u4E0D\u4F1A\u91CD\u53D1\u5DF2\u6210\u529F\u7684\u76EE\u6807\u3002" }),
16778
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirmClear(true), children: "\u6E05\u7406\u5DF2\u7ED3\u675F\u8BB0\u5F55" })
16779
+ ] }),
16780
+ confirmClear && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { role: "group", "aria-label": "\u786E\u8BA4\u6E05\u7406\u53D1\u9001\u8BB0\u5F55", children: [
16781
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { children: "\u53EA\u6E05\u7406\u5DF2\u63A5\u53D7\u548C\u5DF2\u53D6\u6D88\u7684\u8BB0\u5F55\uFF0C\u5F85\u53D1\u9001\u548C\u5931\u8D25\u8BB0\u5F55\u4FDD\u7559\u3002" }),
16782
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirmClear(false), children: "\u53D6\u6D88" }),
16783
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("button", { type: "button", disabled: busy, onClick: () => void run(async () => {
16784
+ await api(`/push-channels/${initial.id}/deliveries`, { method: "DELETE" });
16785
+ setRecords(await api(`/push-channels/${initial.id}/deliveries`));
16786
+ setConfirmClear(false);
16787
+ await onChanged();
16788
+ }), children: "\u786E\u8BA4\u6E05\u7406" })
16789
+ ] }),
16790
+ !records.length && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { children: "\u6682\u65E0\u901A\u77E5\u3002\u4FDD\u5B58\u53EA\u5F71\u54CD\u4E4B\u540E\u7684\u65B0\u7ED3\u679C\uFF0C\u4E0D\u8865\u53D1\u5386\u53F2\u5BF9\u8BDD\u3002" }),
16791
+ records.map((row) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { children: [
16792
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { children: [
16793
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("strong", { children: row.title }),
16794
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("small", { children: [
16795
+ new Date(row.createdAt).toLocaleString(),
16796
+ " \xB7 ",
16797
+ form.targets.find((t) => t.id === row.targetId)?.name ?? "\u5DF2\u79FB\u9664\u76EE\u6807",
16798
+ " \xB7 ",
16799
+ statusText[row.status]
16800
+ ] }),
16801
+ row.lastError && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("small", { children: row.lastError })
16802
+ ] }),
16803
+ row.status === "failed" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("button", { type: "button", disabled: busy, onClick: () => void run(async () => {
16804
+ await api(`/push-channels/${initial.id}/deliveries/${row.id}/retry`, { method: "POST" });
16805
+ setRecords(await api(`/push-channels/${initial.id}/deliveries`));
16806
+ await onChanged();
16807
+ }), children: "\u91CD\u8BD5" })
16808
+ ] }, row.id))
16809
+ ] })
16810
+ ] });
16811
+ }
16812
+ function Field({ label, children }) {
16813
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "dsh-partner-channel-field", children: [
16814
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: label }),
16815
+ children
16490
16816
  ] });
16491
16817
  }
16492
16818
 
16819
+ // src/ui/push-channels.tsx
16820
+ var import_jsx_runtime48 = require("react/jsx-runtime");
16821
+ function PushChannels({ companion, snapshot, onChanged, adding, closeAdd }) {
16822
+ const [editing, setEditing] = (0, import_react51.useState)();
16823
+ const [removing, setRemoving] = (0, import_react51.useState)();
16824
+ const [busy, setBusy] = (0, import_react51.useState)(false), [error, setError] = (0, import_react51.useState)("");
16825
+ const [dirty, setDirty] = (0, import_react51.useState)(false), [discard, setDiscard] = (0, import_react51.useState)(false);
16826
+ const closeEditor = () => {
16827
+ closeAdd();
16828
+ setEditing(void 0);
16829
+ setDiscard(false);
16830
+ setDirty(false);
16831
+ };
16832
+ const channels = (snapshot.pushChannels ?? []).filter((c) => c.companionId === companion.id);
16833
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
16834
+ !channels.length && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-channel-row", children: [
16835
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
16836
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: "Bark" }),
16837
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: "iOS \u5355\u5411\u901A\u77E5 \xB7 \u65E0\u9700\u8054\u7CFB\u4EBA\u6388\u6743" })
16838
+ ] }),
16839
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", onClick: () => setEditing(emptyChannel(companion.id)), children: "\u914D\u7F6E" })
16840
+ ] }),
16841
+ channels.map((channel) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-channel-row", children: [
16842
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
16843
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: channel.name }),
16844
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("small", { children: [
16845
+ "Bark \xB7 ",
16846
+ channel.targets.filter((t) => t.enabled).length,
16847
+ " \u4E2A\u542F\u7528\u76EE\u6807 \xB7 ",
16848
+ channel.enabled ? "\u81EA\u52A8\u63A8\u9001" : "\u5DF2\u505C\u7528",
16849
+ channel.pending ? ` \xB7 ${channel.pending} \u6761\u5F85\u53D1\u9001` : "",
16850
+ channel.failed ? ` \xB7 ${channel.failed} \u6761\u5931\u8D25` : ""
16851
+ ] })
16852
+ ] }),
16853
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", "aria-label": `\u914D\u7F6E ${channel.name}`, onClick: () => setEditing(channel), children: "\u914D\u7F6E" })
16854
+ ] }, channel.id)),
16855
+ (adding || editing) && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(WorkspaceDialog, { className: "dsh-partner-bark-dialog", title: editing?.id ? `${editing.name} \xB7 Bark \u914D\u7F6E` : "\u6DFB\u52A0 Bark \u6E20\u9053", detail: "\u4FDD\u5B58\u542F\u7528\u540E\u81EA\u52A8\u63A8\u9001\u6700\u7EC8\u7ED3\u679C\uFF0C\u4E0D\u4F9D\u8D56\u8054\u7CFB\u4EBA\u6216\u201C\u901A\u77E5\u4E0E\u4EA4\u4ED8\u201D\u9009\u9879\u3002", close: () => {
16856
+ if (!busy) {
16857
+ if (dirty) setDiscard(true);
16858
+ else closeEditor();
16859
+ }
16860
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
16861
+ BarkEditor,
16862
+ {
16863
+ initial: editing ?? emptyChannel(companion.id),
16864
+ onBusy: setBusy,
16865
+ onDirty: setDirty,
16866
+ onChanged,
16867
+ onSaved: (saved) => {
16868
+ setEditing(saved);
16869
+ closeAdd();
16870
+ },
16871
+ onDelete: (channel) => {
16872
+ setRemoving(channel);
16873
+ setEditing(void 0);
16874
+ closeAdd();
16875
+ setError("");
16876
+ }
16877
+ }
16878
+ ) }),
16879
+ discard && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DiscardChangesDialog, { keepEditing: () => setDiscard(false), discard: closeEditor }),
16880
+ removing && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(WorkspaceDialog, { title: "\u5220\u9664 Bark \u6E20\u9053", detail: `\u5220\u9664\u201C${removing.name}\u201D\u53CA\u5176\u8BBE\u5907\u51ED\u636E\uFF0C\u5E76\u53D6\u6D88\u8BE5\u6E20\u9053\u5C1A\u672A\u53D1\u9001\u7684\u901A\u77E5\u3002\u5176\u4ED6\u6E20\u9053\u4E0D\u53D7\u5F71\u54CD\u3002`, close: () => {
16881
+ if (!busy) setRemoving(void 0);
16882
+ }, children: [
16883
+ error && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { role: "alert", children: error }),
16884
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-form-actions", children: [
16885
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { disabled: busy, onClick: () => setRemoving(void 0), children: "\u53D6\u6D88" }),
16886
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { disabled: busy, className: "is-danger", onClick: () => {
16887
+ setBusy(true);
16888
+ void api(`/push-channels/${removing.id}`, { method: "DELETE" }).then(async () => {
16889
+ await onChanged();
16890
+ setRemoving(void 0);
16891
+ }).catch((e) => setError(errorMessage(e))).finally(() => setBusy(false));
16892
+ }, children: busy ? "\u5220\u9664\u4E2D\u2026" : "\u786E\u8BA4\u5220\u9664" })
16893
+ ] })
16894
+ ] })
16895
+ ] });
16896
+ }
16897
+ function emptyChannel(companionId) {
16898
+ return {
16899
+ id: "",
16900
+ companionId,
16901
+ name: "",
16902
+ platform: "bark",
16903
+ baseUrl: "",
16904
+ enabled: true,
16905
+ revision: 0,
16906
+ createdAt: 0,
16907
+ updatedAt: 0,
16908
+ targets: [{ id: "", name: "\u6211\u7684 iPhone", enabled: true, configured: false }],
16909
+ notifyProblems: false,
16910
+ content: "summary",
16911
+ group: "",
16912
+ sound: "",
16913
+ openUrl: "",
16914
+ pending: 0,
16915
+ failed: 0
16916
+ };
16917
+ }
16918
+
16493
16919
  // src/ui/channels-panel.tsx
16494
- var import_jsx_runtime46 = require("react/jsx-runtime");
16920
+ var import_jsx_runtime49 = require("react/jsx-runtime");
16495
16921
  function ChannelsPanel({ companion, snapshot, onChanged, weixin }) {
16496
- const [platform, setPlatform] = (0, import_react49.useState)("matrix");
16497
- const [name, setName] = (0, import_react49.useState)("");
16498
- const [baseUrl, setBaseUrl] = (0, import_react49.useState)("");
16499
- const [targetId, setTargetId] = (0, import_react49.useState)("");
16500
- const [botToken, setToken] = (0, import_react49.useState)("");
16501
- const [authMode, setAuthMode] = (0, import_react49.useState)("password");
16502
- const [username, setUsername] = (0, import_react49.useState)(""), [password, setPassword] = (0, import_react49.useState)(""), [mfaToken, setMfaToken] = (0, import_react49.useState)("");
16503
- const [busy, setBusy] = (0, import_react49.useState)(false);
16504
- const [feedback, setFeedback] = (0, import_react49.useState)("");
16505
- const [deleting, setDeleting] = (0, import_react49.useState)();
16506
- const [adding, setAdding] = (0, import_react49.useState)(false);
16507
- const [fixedPlatform, setFixedPlatform] = (0, import_react49.useState)(false);
16508
- const [configuring, setConfiguring] = (0, import_react49.useState)();
16922
+ const [platform, setPlatform] = (0, import_react52.useState)("matrix");
16923
+ const [name, setName] = (0, import_react52.useState)("");
16924
+ const [baseUrl, setBaseUrl] = (0, import_react52.useState)("");
16925
+ const [targetId, setTargetId] = (0, import_react52.useState)("");
16926
+ const [botToken, setToken] = (0, import_react52.useState)("");
16927
+ const [authMode, setAuthMode] = (0, import_react52.useState)("password");
16928
+ const [username, setUsername] = (0, import_react52.useState)(""), [password, setPassword] = (0, import_react52.useState)(""), [mfaToken, setMfaToken] = (0, import_react52.useState)("");
16929
+ const [busy, setBusy] = (0, import_react52.useState)(false);
16930
+ const [feedback, setFeedback] = (0, import_react52.useState)("");
16931
+ const [deleting, setDeleting] = (0, import_react52.useState)();
16932
+ const [adding, setAdding] = (0, import_react52.useState)(false);
16933
+ const [addingPush, setAddingPush] = (0, import_react52.useState)(false);
16934
+ const [fixedPlatform, setFixedPlatform] = (0, import_react52.useState)(false);
16935
+ const [configuring, setConfiguring] = (0, import_react52.useState)();
16509
16936
  const closeAdd = () => {
16510
16937
  setAdding(false);
16511
16938
  setToken("");
@@ -16549,19 +16976,24 @@ function ChannelsPanel({ companion, snapshot, onChanged, weixin }) {
16549
16976
  }
16550
16977
  setFeedback(save ? "\u8D26\u53F7\u5DF2\u4FDD\u5B58\u3002\u8BF7\u542F\u7528\u6E20\u9053\uFF0C\u518D\u5411\u673A\u5668\u4EBA\u53D1\u9001\u79C1\u804A\u6D88\u606F\uFF0C\u6838\u5BF9\u914D\u5BF9\u7801\u5E76\u6279\u51C6\u8054\u7CFB\u4EBA\u3002" : "\u8D26\u53F7\u9A8C\u8BC1\u901A\u8FC7\uFF0C\u53EF\u4EE5\u4FDD\u5B58\u3002");
16551
16978
  });
16552
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { id: "dsh-partner-channels", className: "dsh-partner-form is-channel dsh-partner-channels", children: [
16553
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-channel-toolbar", children: [
16554
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SectionHeading, { eyebrow: "CHANNELS", title: "\u6211\u7684\u6E20\u9053", detail: "\u67E5\u770B\u8FDE\u63A5\u72B6\u6001\uFF0C\u7BA1\u7406\u8054\u7CFB\u4EBA\u4E0E\u901A\u77E5\u6295\u9012\u3002" }),
16555
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", onClick: () => openAdd(), children: "\u6DFB\u52A0\u6E20\u9053" })
16979
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { id: "dsh-partner-channels", className: "dsh-partner-form is-channel dsh-partner-channels", children: [
16980
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "dsh-partner-channel-toolbar", children: [
16981
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SectionHeading, { eyebrow: "CHANNELS", title: "\u6211\u7684\u6E20\u9053", detail: "\u67E5\u770B\u8FDE\u63A5\u72B6\u6001\uFF0C\u7BA1\u7406\u8054\u7CFB\u4EBA\u4E0E\u901A\u77E5\u6295\u9012\u3002" }),
16982
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", onClick: () => openAdd(), children: "\u6DFB\u52A0\u6E20\u9053" })
16556
16983
  ] }),
16557
- !adding && feedback && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { role: "status", children: feedback }),
16558
- adding && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WorkspaceDialog, { title: fixedPlatform ? `${platform === "matrix" ? "Matrix" : "Mattermost"} \u914D\u7F6E` : "\u6DFB\u52A0\u6E20\u9053", detail: platform === "matrix" ? "\u4EC5\u672A\u52A0\u5BC6\u7684\u53CC\u4EBA\u4F1A\u8BDD\u53EF\u83B7\u53D6\u914D\u5BF9\u7801\u3002\u8BF7\u65B0\u5EFA\u672A\u5F00\u542F\u7AEF\u5230\u7AEF\u52A0\u5BC6\u7684\u4F1A\u8BDD\uFF0C\u9080\u8BF7\u673A\u5668\u4EBA\u540E\u53D1\u9001\u6587\u5B57\u6D88\u606F\u3002" : "\u5148\u767B\u5F55\uFF0C\u518D\u5411\u673A\u5668\u4EBA\u53D1\u79C1\u804A\u6D88\u606F\uFF0C\u6838\u5BF9\u914D\u5BF9\u7801\u540E\u6388\u6743\u3002", close: () => {
16984
+ !adding && feedback && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { role: "status", children: feedback }),
16985
+ adding && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(WorkspaceDialog, { title: fixedPlatform ? `${platform === "matrix" ? "Matrix" : "Mattermost"} \u914D\u7F6E` : "\u6DFB\u52A0\u6E20\u9053", detail: platform === "matrix" ? "\u4EC5\u672A\u52A0\u5BC6\u7684\u53CC\u4EBA\u4F1A\u8BDD\u53EF\u83B7\u53D6\u914D\u5BF9\u7801\u3002\u8BF7\u65B0\u5EFA\u672A\u5F00\u542F\u7AEF\u5230\u7AEF\u52A0\u5BC6\u7684\u4F1A\u8BDD\uFF0C\u9080\u8BF7\u673A\u5668\u4EBA\u540E\u53D1\u9001\u6587\u5B57\u6D88\u606F\u3002" : "\u5148\u767B\u5F55\uFF0C\u518D\u5411\u673A\u5668\u4EBA\u53D1\u79C1\u804A\u6D88\u606F\uFF0C\u6838\u5BF9\u914D\u5BF9\u7801\u540E\u6388\u6743\u3002", close: () => {
16559
16986
  if (!busy) closeAdd();
16560
- }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-channel-form", "aria-busy": busy, onSubmit: (event) => {
16987
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-channel-form", "aria-busy": busy, onSubmit: (event) => {
16561
16988
  event.preventDefault();
16562
16989
  void configure2(true);
16563
16990
  }, children: [
16564
- !fixedPlatform && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormField2, { label: "\u5E73\u53F0", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("select", { autoFocus: true, disabled: busy, value: platform, onChange: (e) => {
16991
+ !fixedPlatform && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FormField2, { label: "\u5E73\u53F0", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("select", { autoFocus: true, disabled: busy, value: platform, onChange: (e) => {
16992
+ if (e.target.value === "bark") {
16993
+ closeAdd();
16994
+ setAddingPush(true);
16995
+ return;
16996
+ }
16565
16997
  setPlatform(e.target.value);
16566
16998
  setPassword("");
16567
16999
  setToken("");
@@ -16569,150 +17001,152 @@ function ChannelsPanel({ companion, snapshot, onChanged, weixin }) {
16569
17001
  setTargetId("");
16570
17002
  setFeedback("");
16571
17003
  }, children: [
16572
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("option", { value: "matrix", children: "Matrix" }),
16573
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("option", { value: "mattermost", children: "Mattermost" })
17004
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("option", { value: "matrix", children: "Matrix" }),
17005
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("option", { value: "mattermost", children: "Mattermost" }),
17006
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("option", { value: "bark", children: "Bark \xB7 \u5355\u5411\u901A\u77E5" })
16574
17007
  ] }) }),
16575
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormField2, { label: "\u6E20\u9053\u540D\u79F0", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("input", { autoFocus: fixedPlatform, disabled: busy, maxLength: 80, value: name, onChange: (e) => setName(e.target.value), placeholder: `\u4F8B\u5982\uFF1A\u6211\u7684 ${platform === "matrix" ? "Matrix" : "Mattermost"}` }) }),
16576
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormField2, { label: "\u670D\u52A1\u5668\u5730\u5740", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("input", { disabled: busy, required: true, type: "url", value: baseUrl, onChange: (e) => setBaseUrl(e.target.value), placeholder: "https://chat.example.com" }) }),
16577
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("details", { children: [
16578
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("summary", { children: "\u9AD8\u7EA7\u914D\u7F6E\uFF08\u53EF\u9009\uFF09" }),
16579
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormField2, { label: platform === "matrix" ? "\u56FA\u5B9A\u623F\u95F4 ID" : "\u56FA\u5B9A DM \u4F1A\u8BDD ID", hint: "\u7559\u7A7A\u5219\u81EA\u52A8\u53D1\u73B0\u79C1\u804A\uFF0C\u901A\u8FC7\u914D\u5BF9\u6388\u6743\u3002\u586B\u5199\u540E\u4EC5\u76D1\u542C\u6307\u5B9A\u4F1A\u8BDD\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("input", { disabled: busy, value: targetId, onChange: (e) => setTargetId(e.target.value), placeholder: platform === "matrix" ? "!room:example.com" : "DM channel ID" }) })
17008
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FormField2, { label: "\u6E20\u9053\u540D\u79F0", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("input", { autoFocus: fixedPlatform, disabled: busy, maxLength: 80, value: name, onChange: (e) => setName(e.target.value), placeholder: `\u4F8B\u5982\uFF1A\u6211\u7684 ${platform === "matrix" ? "Matrix" : "Mattermost"}` }) }),
17009
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FormField2, { label: "\u670D\u52A1\u5668\u5730\u5740", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("input", { disabled: busy, required: true, type: "url", value: baseUrl, onChange: (e) => setBaseUrl(e.target.value), placeholder: "https://chat.example.com" }) }),
17010
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("details", { children: [
17011
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("summary", { children: "\u9AD8\u7EA7\u914D\u7F6E\uFF08\u53EF\u9009\uFF09" }),
17012
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FormField2, { label: platform === "matrix" ? "\u56FA\u5B9A\u623F\u95F4 ID" : "\u56FA\u5B9A DM \u4F1A\u8BDD ID", hint: "\u7559\u7A7A\u5219\u81EA\u52A8\u53D1\u73B0\u79C1\u804A\uFF0C\u901A\u8FC7\u914D\u5BF9\u6388\u6743\u3002\u586B\u5199\u540E\u4EC5\u76D1\u542C\u6307\u5B9A\u4F1A\u8BDD\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("input", { disabled: busy, value: targetId, onChange: (e) => setTargetId(e.target.value), placeholder: platform === "matrix" ? "!room:example.com" : "DM channel ID" }) })
16580
17013
  ] }),
16581
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormField2, { label: "\u767B\u5F55\u65B9\u5F0F", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("select", { disabled: busy, value: authMode, onChange: (e) => {
17014
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FormField2, { label: "\u767B\u5F55\u65B9\u5F0F", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("select", { disabled: busy, value: authMode, onChange: (e) => {
16582
17015
  setAuthMode(e.target.value);
16583
17016
  setToken("");
16584
17017
  setPassword("");
16585
17018
  setMfaToken("");
16586
17019
  }, children: [
16587
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("option", { value: "password", children: "\u8D26\u53F7\u5BC6\u7801" }),
16588
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("option", { value: "token", children: "Access Token" })
17020
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("option", { value: "password", children: "\u8D26\u53F7\u5BC6\u7801" }),
17021
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("option", { value: "token", children: "Access Token" })
16589
17022
  ] }) }),
16590
- authMode === "password" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
16591
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormField2, { label: "\u8D26\u53F7", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("input", { disabled: busy, required: true, autoComplete: "username", value: username, onChange: (e) => setUsername(e.target.value), placeholder: platform === "matrix" ? "@\u8D26\u53F7:\u670D\u52A1\u5668\u57DF\u540D" : "\u7528\u6237\u540D\u6216\u90AE\u7BB1" }) }),
16592
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormField2, { label: "\u5BC6\u7801", hint: "\u4EC5\u7528\u4E8E\u6362\u53D6\u4EE4\u724C\uFF0C\u4E0D\u4FDD\u5B58\u5BC6\u7801\uFF1B\u8BF7\u4F18\u5148\u4F7F\u7528 HTTPS \u670D\u52A1\u5668\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("input", { disabled: busy, required: true, type: "password", autoComplete: "current-password", value: password, onChange: (e) => setPassword(e.target.value) }) }),
16593
- platform === "mattermost" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormField2, { label: "\u53CC\u91CD\u9A8C\u8BC1\u9A8C\u8BC1\u7801\uFF08\u5982\u5DF2\u5F00\u542F\uFF09", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("input", { disabled: busy, autoComplete: "one-time-code", inputMode: "numeric", value: mfaToken, onChange: (e) => setMfaToken(e.target.value) }) })
16594
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FormField2, { label: "Access Token", hint: "\u4EC5\u4FDD\u5B58\u81F3 DSH \u51ED\u636E\u5E93\uFF1B\u5EFA\u8BAE HTTPS\uFF0CHTTP \u4F1A\u660E\u6587\u4F20\u8F93\u51ED\u636E\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("input", { disabled: busy, required: true, type: "password", autoComplete: "new-password", value: botToken, onChange: (e) => setToken(e.target.value) }) }),
16595
- feedback && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { role: "status", children: feedback }),
16596
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("footer", { children: [
16597
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", disabled: busy, onClick: closeAdd, children: "\u53D6\u6D88" }),
16598
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", disabled: busy || !(authMode === "password" ? username && password : botToken) || !baseUrl, onClick: () => void configure2(false), children: "\u6D4B\u8BD5\u8FDE\u63A5" }),
16599
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { className: "is-primary", disabled: busy, children: busy ? "\u5904\u7406\u4E2D\u2026" : "\u4FDD\u5B58\u6E20\u9053" })
17023
+ authMode === "password" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
17024
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FormField2, { label: "\u8D26\u53F7", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("input", { disabled: busy, required: true, autoComplete: "username", value: username, onChange: (e) => setUsername(e.target.value), placeholder: platform === "matrix" ? "@\u8D26\u53F7:\u670D\u52A1\u5668\u57DF\u540D" : "\u7528\u6237\u540D\u6216\u90AE\u7BB1" }) }),
17025
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FormField2, { label: "\u5BC6\u7801", hint: "\u4EC5\u7528\u4E8E\u6362\u53D6\u4EE4\u724C\uFF0C\u4E0D\u4FDD\u5B58\u5BC6\u7801\uFF1B\u8BF7\u4F18\u5148\u4F7F\u7528 HTTPS \u670D\u52A1\u5668\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("input", { disabled: busy, required: true, type: "password", autoComplete: "current-password", value: password, onChange: (e) => setPassword(e.target.value) }) }),
17026
+ platform === "mattermost" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FormField2, { label: "\u53CC\u91CD\u9A8C\u8BC1\u9A8C\u8BC1\u7801\uFF08\u5982\u5DF2\u5F00\u542F\uFF09", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("input", { disabled: busy, autoComplete: "one-time-code", inputMode: "numeric", value: mfaToken, onChange: (e) => setMfaToken(e.target.value) }) })
17027
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FormField2, { label: "Access Token", hint: "\u4EC5\u4FDD\u5B58\u81F3 DSH \u51ED\u636E\u5E93\uFF1B\u5EFA\u8BAE HTTPS\uFF0CHTTP \u4F1A\u660E\u6587\u4F20\u8F93\u51ED\u636E\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("input", { disabled: busy, required: true, type: "password", autoComplete: "new-password", value: botToken, onChange: (e) => setToken(e.target.value) }) }),
17028
+ feedback && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { role: "status", children: feedback }),
17029
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("footer", { children: [
17030
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", disabled: busy, onClick: closeAdd, children: "\u53D6\u6D88" }),
17031
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", disabled: busy || !(authMode === "password" ? username && password : botToken) || !baseUrl, onClick: () => void configure2(false), children: "\u6D4B\u8BD5\u8FDE\u63A5" }),
17032
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { className: "is-primary", disabled: busy, children: busy ? "\u5904\u7406\u4E2D\u2026" : "\u4FDD\u5B58\u6E20\u9053" })
16600
17033
  ] })
16601
17034
  ] }) }),
16602
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-channel-list", children: [
16603
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-channel-row", children: [
16604
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
16605
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: "\u5FAE\u4FE1" }),
16606
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: channels.some((c) => !c.platform || c.platform === "weixin") ? "\u7BA1\u7406\u8FDE\u63A5\u4E0E\u79C1\u804A\u6388\u6743" : "\u5C1A\u672A\u8FDE\u63A5 \xB7 \u626B\u7801\u63A5\u5165" })
17035
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "dsh-partner-channel-list", children: [
17036
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PushChannels, { companion, snapshot, onChanged, adding: addingPush, closeAdd: () => setAddingPush(false) }),
17037
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "dsh-partner-channel-row", children: [
17038
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { children: [
17039
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("strong", { children: "\u5FAE\u4FE1" }),
17040
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("small", { children: channels.some((c) => !c.platform || c.platform === "weixin") ? "\u7BA1\u7406\u8FDE\u63A5\u4E0E\u79C1\u804A\u6388\u6743" : "\u5C1A\u672A\u8FDE\u63A5 \xB7 \u626B\u7801\u63A5\u5165" })
16607
17041
  ] }),
16608
- channels.find((c) => !c.platform || c.platform === "weixin") && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ChannelStatus, { channel: channels.find((c) => !c.platform || c.platform === "weixin") }),
16609
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", "aria-label": "\u914D\u7F6E\u5FAE\u4FE1", onClick: () => setConfiguring("weixin"), children: "\u914D\u7F6E" }),
16610
- configuring === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WorkspaceDialog, { title: "\u5FAE\u4FE1\u914D\u7F6E", detail: "\u7BA1\u7406\u626B\u7801\u767B\u5F55\u3001\u8FDE\u63A5\u4E0E\u8054\u7CFB\u4EBA\u6388\u6743\u3002", close: () => setConfiguring(void 0), children: weixin })
17042
+ channels.find((c) => !c.platform || c.platform === "weixin") && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ChannelStatus, { channel: channels.find((c) => !c.platform || c.platform === "weixin") }),
17043
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", "aria-label": "\u914D\u7F6E\u5FAE\u4FE1", onClick: () => setConfiguring("weixin"), children: "\u914D\u7F6E" }),
17044
+ configuring === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(WorkspaceDialog, { title: "\u5FAE\u4FE1\u914D\u7F6E", detail: "\u7BA1\u7406\u626B\u7801\u767B\u5F55\u3001\u8FDE\u63A5\u4E0E\u8054\u7CFB\u4EBA\u6388\u6743\u3002", close: () => setConfiguring(void 0), children: weixin })
16611
17045
  ] }),
16612
- ["matrix", "mattermost"].filter((platform2) => !channels.some((c) => c.platform === platform2)).map((platform2) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-channel-row", children: [
16613
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
16614
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: platform2 === "matrix" ? "Matrix" : "Mattermost" }),
16615
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "\u5C1A\u672A\u8FDE\u63A5" })
17046
+ ["matrix", "mattermost"].filter((platform2) => !channels.some((c) => c.platform === platform2)).map((platform2) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "dsh-partner-channel-row", children: [
17047
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { children: [
17048
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("strong", { children: platform2 === "matrix" ? "Matrix" : "Mattermost" }),
17049
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("small", { children: "\u5C1A\u672A\u8FDE\u63A5" })
16616
17050
  ] }),
16617
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", "aria-label": `\u914D\u7F6E ${platform2}`, onClick: () => openAdd(platform2), children: "\u914D\u7F6E" })
17051
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", "aria-label": `\u914D\u7F6E ${platform2}`, onClick: () => openAdd(platform2), children: "\u914D\u7F6E" })
16618
17052
  ] }, platform2)),
16619
- channels.filter((c) => c.platform && c.platform !== "weixin").map((channel) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-channel-row has-notice-slot", children: [
16620
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
16621
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: channel.name }),
16622
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("small", { children: [
17053
+ channels.filter((c) => c.platform && c.platform !== "weixin").map((channel) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "dsh-partner-channel-row has-notice-slot", children: [
17054
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { children: [
17055
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("strong", { children: channel.name }),
17056
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("small", { children: [
16623
17057
  channel.platform,
16624
17058
  " \xB7 ",
16625
17059
  pairings.filter((p) => p.channelId === channel.id && p.status === "pending").length,
16626
17060
  " \u4E2A\u5F85\u6388\u6743"
16627
17061
  ] })
16628
17062
  ] }),
16629
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ChannelStatus, { channel }),
16630
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", "aria-label": `\u914D\u7F6E ${channel.name}`, onClick: () => {
17063
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ChannelStatus, { channel }),
17064
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", "aria-label": `\u914D\u7F6E ${channel.name}`, onClick: () => {
16631
17065
  setFeedback("");
16632
17066
  setConfiguring(channel.id);
16633
17067
  }, children: "\u914D\u7F6E" }),
16634
- configuring === channel.id && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WorkspaceDialog, { title: `${channel.name} \xB7 \u914D\u7F6E`, detail: "\u7BA1\u7406\u8FDE\u63A5\u72B6\u6001\u53CA\u8054\u7CFB\u4EBA\u8BBF\u95EE\u6743\u9650\u3002", close: () => {
17068
+ configuring === channel.id && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(WorkspaceDialog, { title: `${channel.name} \xB7 \u914D\u7F6E`, detail: "\u7BA1\u7406\u8FDE\u63A5\u72B6\u6001\u53CA\u8054\u7CFB\u4EBA\u8BBF\u95EE\u6743\u9650\u3002", close: () => {
16635
17069
  if (!busy) {
16636
17070
  setConfiguring(void 0);
16637
17071
  setDeleting(void 0);
16638
17072
  }
16639
- }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-channel-detail dsh-partner-channel-manage", children: [
16640
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-channel-connection", children: [
16641
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
16642
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "\u767B\u5F55\u8D26\u53F7" }),
16643
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: channel.accountId }),
16644
- channel.direct?.targetId && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: channel.direct.targetId })
17073
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "dsh-partner-channel-detail dsh-partner-channel-manage", children: [
17074
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "dsh-partner-channel-connection", children: [
17075
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { children: [
17076
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("small", { children: "\u767B\u5F55\u8D26\u53F7" }),
17077
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("strong", { children: channel.accountId }),
17078
+ channel.direct?.targetId && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("small", { children: channel.direct.targetId })
16645
17079
  ] }),
16646
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ChannelStatus, { channel })
17080
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ChannelStatus, { channel })
16647
17081
  ] }),
16648
- channel.platform === "matrix" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: "\u4EC5\u652F\u6301\u672A\u52A0\u5BC6\u7684\u53CC\u4EBA\u4F1A\u8BDD\u3002\u52A0\u5BC6\u4F1A\u8BDD\u65E0\u6CD5\u8BFB\u53D6\u6D88\u606F\u6216\u53D1\u9001\u914D\u5BF9\u7801\uFF1B\u8BF7\u65B0\u5EFA\u672A\u5F00\u542F\u7AEF\u5230\u7AEF\u52A0\u5BC6\u7684\u4F1A\u8BDD\uFF0C\u9080\u8BF7\u673A\u5668\u4EBA\u540E\u53D1\u9001\u6587\u5B57\u6D88\u606F\u3002\u68C0\u6D4B\u5230\u52A0\u5BC6\u4F1A\u8BDD\u65F6\u4F1A\u5728\u6B64\u63D0\u793A\uFF0C\u4E0D\u5F71\u54CD\u5176\u4ED6\u672A\u52A0\u5BC6\u4F1A\u8BDD\u3002" }),
16649
- !channel.direct?.targetId && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: "\u5411\u673A\u5668\u4EBA\u53D1\u79C1\u804A\u6D88\u606F\uFF0C\u5728\u4E0B\u65B9\u6838\u5BF9\u914D\u5BF9\u7801\u540E\u6279\u51C6\u3002\u8BF7\u6C42\u4F1A\u81EA\u52A8\u66F4\u65B0\u3002" }),
16650
- channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { role: "alert", children: channel.lastError }),
16651
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-form-actions", children: [
16652
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
17082
+ channel.platform === "matrix" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { children: "\u4EC5\u652F\u6301\u672A\u52A0\u5BC6\u7684\u53CC\u4EBA\u4F1A\u8BDD\u3002\u52A0\u5BC6\u4F1A\u8BDD\u65E0\u6CD5\u8BFB\u53D6\u6D88\u606F\u6216\u53D1\u9001\u914D\u5BF9\u7801\uFF1B\u8BF7\u65B0\u5EFA\u672A\u5F00\u542F\u7AEF\u5230\u7AEF\u52A0\u5BC6\u7684\u4F1A\u8BDD\uFF0C\u9080\u8BF7\u673A\u5668\u4EBA\u540E\u53D1\u9001\u6587\u5B57\u6D88\u606F\u3002\u68C0\u6D4B\u5230\u52A0\u5BC6\u4F1A\u8BDD\u65F6\u4F1A\u5728\u6B64\u63D0\u793A\uFF0C\u4E0D\u5F71\u54CD\u5176\u4ED6\u672A\u52A0\u5BC6\u4F1A\u8BDD\u3002" }),
17083
+ !channel.direct?.targetId && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { children: "\u5411\u673A\u5668\u4EBA\u53D1\u79C1\u804A\u6D88\u606F\uFF0C\u5728\u4E0B\u65B9\u6838\u5BF9\u914D\u5BF9\u7801\u540E\u6279\u51C6\u3002\u8BF7\u6C42\u4F1A\u81EA\u52A8\u66F4\u65B0\u3002" }),
17084
+ channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { role: "alert", children: channel.lastError }),
17085
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "dsh-partner-form-actions", children: [
17086
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
16653
17087
  await api(`/channels/${channel.id}/enabled`, { method: "POST", body: JSON.stringify({ enabled: !channel.enabled }) });
16654
17088
  await onChanged();
16655
17089
  }), children: channel.enabled ? "\u505C\u7528" : "\u542F\u7528" }),
16656
- channel.enabled && channel.runtimeStatus === "error" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
17090
+ channel.enabled && channel.runtimeStatus === "error" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
16657
17091
  await api(`/channels/${channel.id}/enabled`, { method: "POST", body: JSON.stringify({ enabled: true }) });
16658
17092
  await onChanged();
16659
17093
  }), children: "\u91CD\u8FDE" }),
16660
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { disabled: busy, onClick: () => deleting === channel.id ? void run(async () => {
17094
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { disabled: busy, onClick: () => deleting === channel.id ? void run(async () => {
16661
17095
  await api(`/channels/${channel.id}`, { method: "DELETE" });
16662
17096
  setDeleting(void 0);
16663
17097
  await onChanged();
16664
17098
  }) : setDeleting(channel.id), children: deleting === channel.id ? "\u786E\u8BA4\u5220\u9664\u914D\u7F6E\u4E0E\u51ED\u636E" : "\u5220\u9664\u6E20\u9053" }),
16665
- deleting === channel.id && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { onClick: () => setDeleting(void 0), children: "\u53D6\u6D88" })
17099
+ deleting === channel.id && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { onClick: () => setDeleting(void 0), children: "\u53D6\u6D88" })
16666
17100
  ] }),
16667
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { className: "dsh-partner-channel-access", children: [
16668
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h3", { children: "\u8054\u7CFB\u4EBA\u6388\u6743" }),
16669
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("p", { role: "status", children: [
17101
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("section", { className: "dsh-partner-channel-access", children: [
17102
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h3", { children: "\u8054\u7CFB\u4EBA\u6388\u6743" }),
17103
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("p", { role: "status", children: [
16670
17104
  pairings.filter((p) => p.channelId === channel.id && p.status === "pending").length,
16671
17105
  " \u4E2A\u7B49\u5F85\u6279\u51C6 \xB7 \u81EA\u52A8\u5237\u65B0"
16672
17106
  ] }),
16673
- pairings.filter((p) => p.channelId === channel.id).map((p) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-channel-person", children: [
16674
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
16675
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: p.displayName }),
16676
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: p.status === "approved" ? "\u5DF2\u6388\u6743" : p.status === "pending" ? "\u7B49\u5F85\u6279\u51C6" : "\u5DF2\u963B\u6B62" }),
16677
- p.status === "pending" && p.pairingCode && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
17107
+ pairings.filter((p) => p.channelId === channel.id).map((p) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "dsh-partner-channel-person", children: [
17108
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { children: [
17109
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("strong", { children: p.displayName }),
17110
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("small", { children: p.status === "approved" ? "\u5DF2\u6388\u6743" : p.status === "pending" ? "\u7B49\u5F85\u6279\u51C6" : "\u5DF2\u963B\u6B62" }),
17111
+ p.status === "pending" && p.pairingCode && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { children: [
16678
17112
  "\u914D\u5BF9\u7801 ",
16679
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("code", { children: p.pairingCode })
17113
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("code", { children: p.pairingCode })
16680
17114
  ] })
16681
17115
  ] }),
16682
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
17116
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
16683
17117
  await api(`/pairings/${p.id}/status`, { method: "POST", body: JSON.stringify({ status: p.status === "approved" ? "blocked" : "approved" }) });
16684
17118
  await onChanged();
16685
17119
  }), children: p.status === "approved" ? "\u64A4\u9500\u6388\u6743" : "\u6279\u51C6\u8054\u7CFB\u4EBA" })
16686
17120
  ] }, p.id))
16687
17121
  ] }),
16688
- feedback && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { role: "status", children: feedback })
17122
+ feedback && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { role: "status", children: feedback })
16689
17123
  ] }) }),
16690
- channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-channel-inline-notice", role: "status", "aria-atomic": "true", children: [
16691
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: channel.runtimeStatus === "running" ? "\u4F1A\u8BDD\u63D0\u793A" : "\u8FDE\u63A5\u63D0\u793A" }),
16692
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: channel.lastError })
17124
+ channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "dsh-partner-channel-inline-notice", role: "status", "aria-atomic": "true", children: [
17125
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("strong", { children: channel.runtimeStatus === "running" ? "\u4F1A\u8BDD\u63D0\u793A" : "\u8FDE\u63A5\u63D0\u793A" }),
17126
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { children: channel.lastError })
16693
17127
  ] })
16694
17128
  ] }, channel.id))
16695
17129
  ] }),
16696
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("section", { className: "dsh-partner-channel-notifications", "aria-label": "\u901A\u77E5\u8BBE\u7F6E", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-channel-row", children: [
16697
- /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
16698
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: "\u901A\u77E5\u4E0E\u4EA4\u4ED8" }),
16699
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: companion.notificationDelivery?.mode === "selected" ? `\u5DF2\u6307\u5B9A ${companion.notificationDelivery.targets.length} \u4F4D\u63A5\u6536\u4EBA` : "\u9ED8\u8BA4\u8DDF\u968F\u6700\u8FD1\u6E20\u9053\u4E0E\u7528\u6237" })
17130
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("section", { className: "dsh-partner-channel-notifications", "aria-label": "\u901A\u77E5\u8BBE\u7F6E", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "dsh-partner-channel-row", children: [
17131
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { children: [
17132
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("strong", { children: "\u901A\u77E5\u4E0E\u4EA4\u4ED8" }),
17133
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("small", { children: companion.notificationDelivery?.mode === "selected" ? `\u5DF2\u6307\u5B9A ${companion.notificationDelivery.targets.length} \u4F4D\u63A5\u6536\u4EBA` : "\u9ED8\u8BA4\u8DDF\u968F\u6700\u8FD1\u6E20\u9053\u4E0E\u7528\u6237" })
16700
17134
  ] }),
16701
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", onClick: () => setConfiguring("delivery"), children: "\u914D\u7F6E" })
17135
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", onClick: () => setConfiguring("delivery"), children: "\u914D\u7F6E" })
16702
17136
  ] }) }),
16703
- configuring === "delivery" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WorkspaceDialog, { title: "\u901A\u77E5\u4E0E\u4EA4\u4ED8", detail: "\u9009\u62E9\u901A\u77E5\u6E20\u9053\uFF0C\u518D\u9009\u62E9\u5404\u6E20\u9053\u7684\u63A5\u6536\u4EBA\uFF1B\u652F\u6301\u540C\u65F6\u6295\u9012\u3002", close: () => setConfiguring(void 0), children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(NotificationSettings, { companion, snapshot, onChanged }) })
17137
+ configuring === "delivery" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(WorkspaceDialog, { title: "\u901A\u77E5\u4E0E\u4EA4\u4ED8", detail: "\u9009\u62E9\u901A\u77E5\u6E20\u9053\uFF0C\u518D\u9009\u62E9\u5404\u6E20\u9053\u7684\u63A5\u6536\u4EBA\uFF1B\u652F\u6301\u540C\u65F6\u6295\u9012\u3002", close: () => setConfiguring(void 0), children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(NotificationSettings, { companion, snapshot, onChanged }) })
16704
17138
  ] });
16705
17139
  }
16706
17140
  function FormField2({ label, hint, children }) {
16707
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("label", { className: "dsh-partner-channel-field", children: [
16708
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: label }),
17141
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "dsh-partner-channel-field", children: [
17142
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: label }),
16709
17143
  children,
16710
- hint && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: hint })
17144
+ hint && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("small", { children: hint })
16711
17145
  ] });
16712
17146
  }
16713
17147
 
16714
17148
  // src/ui/use-channel-status.ts
16715
- var import_react50 = require("react");
17149
+ var import_react53 = require("react");
16716
17150
  var listeners2 = /* @__PURE__ */ new Set();
16717
17151
  var timer;
16718
17152
  var active;
@@ -16737,7 +17171,7 @@ async function poll() {
16737
17171
  }
16738
17172
  }
16739
17173
  function useChannelStatus(setSnapshot) {
16740
- (0, import_react50.useEffect)(() => {
17174
+ (0, import_react53.useEffect)(() => {
16741
17175
  const update = (value) => setSnapshot((previous3) => previous3 ? { ...previous3, ...value } : previous3);
16742
17176
  listeners2.add(update);
16743
17177
  lastValue = "";
@@ -16771,7 +17205,7 @@ var form_surface_default = `/* Deliberate, local boundary against host themes wi
16771
17205
  .dsh-partner-workspace #dsh-partner-channels .dsh-partner-delivery-form { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 16px; margin: 0; padding: 0; }
16772
17206
  .dsh-partner-workspace #dsh-partner-channels .dsh-partner-delivery-form > p:not([role="alert"]) { color: var(--partner-text-secondary); background: transparent; padding: 0; }
16773
17207
  .dsh-partner-workspace #dsh-partner-channels .dsh-partner-delivery-form > p { grid-column: 1 / -1; margin: 0; }
16774
- .dsh-partner-workspace #dsh-partner-channels .dsh-partner-workspace-dialog:has(.dsh-partner-delivery-form) { width: min(560px, 100%); height: auto; align-self: center; max-height: calc(100% - 24px); border-radius: 16px !important; }
17208
+ .dsh-partner-workspace #dsh-partner-channels .dsh-partner-workspace-dialog:has(.dsh-partner-delivery-form) { width: min(640px, 100%); height: auto; align-self: center; max-height: 100%; border-radius: var(--partner-radius-dialog, 24px) !important; }
16775
17209
  .dsh-partner-workspace #dsh-partner-identity-editor.dsh-partner-form,
16776
17210
  .dsh-partner-workspace #dsh-partner-channels.dsh-partner-form {
16777
17211
  background: transparent !important;
@@ -16793,14 +17227,14 @@ var form_surface_default = `/* Deliberate, local boundary against host themes wi
16793
17227
  box-sizing: border-box;
16794
17228
  min-width: 0;
16795
17229
  width: 100%;
16796
- min-height: 40px;
16797
- padding: 10px 12px !important;
17230
+ min-height: var(--partner-control-height, 38px);
17231
+ padding: 6px 11px !important;
16798
17232
  color: var(--partner-text) !important;
16799
17233
  background-color: var(--partner-control) !important;
16800
17234
  border: 1px solid var(--partner-border) !important;
16801
- border-radius: 10px !important;
17235
+ border-radius: var(--partner-radius-control, 12px) !important;
16802
17236
  box-shadow: inset 0 1px 0 var(--partner-glass-highlight) !important;
16803
- font: var(--partner-font-label)/1.5 var(--partner-font-family) !important;
17237
+ font: var(--partner-control-font-size, 13px)/1.4 var(--partner-font-family) !important;
16804
17238
  }
16805
17239
  .dsh-partner-workspace #dsh-partner-identity-editor .dsh-partner-field :is(input, textarea),
16806
17240
  .dsh-partner-workspace #dsh-partner-channels .dsh-partner-channel-field > input { background-image: none !important; }
@@ -16820,7 +17254,7 @@ var form_surface_default = `/* Deliberate, local boundary against host themes wi
16820
17254
  min-height: 40px;
16821
17255
  padding: 8px 14px !important;
16822
17256
  border: 1px solid var(--partner-border) !important;
16823
- border-radius: 10px !important;
17257
+ border-radius: var(--partner-radius-control, 12px) !important;
16824
17258
  color: var(--partner-text) !important;
16825
17259
  background: var(--partner-control) !important;
16826
17260
  box-shadow: none !important;
@@ -16853,17 +17287,33 @@ var form_surface_default = `/* Deliberate, local boundary against host themes wi
16853
17287
  background: var(--partner-solid-panel) !important;
16854
17288
  color: var(--partner-text) !important;
16855
17289
  border: 1px solid var(--partner-border) !important;
16856
- border-radius: 16px !important;
17290
+ border-radius: var(--partner-radius-dialog, 24px) !important;
16857
17291
  font-family: var(--partner-font-family) !important;
16858
17292
  box-shadow: 0 22px 58px color-mix(in srgb, #000 18%, transparent), 0 4px 14px color-mix(in srgb, #000 8%, transparent), inset 0 1px 0 var(--partner-card-highlight) !important;
16859
17293
  }
17294
+ /* The native top-layer wrapper is not the visible panel. Host dialog resets
17295
+ must not paint it as a full-screen form surface. */
17296
+ .dsh-partner-workspace #dsh-partner-channels dialog.dsh-partner-workspace-dialog-layer {
17297
+ background: var(--partner-interaction-veil, var(--partner-dialog-veil)) !important;
17298
+ border: 0 !important;
17299
+ border-radius: 0 !important;
17300
+ box-shadow: none !important;
17301
+ color: var(--partner-text) !important;
17302
+ font-family: var(--partner-font-family) !important;
17303
+ }
16860
17304
  .dsh-partner-workspace #dsh-partner-channels .dsh-partner-workspace-dialog > header {
16861
- background: var(--partner-solid-raised) !important;
17305
+ background: transparent !important;
16862
17306
  color: var(--partner-text) !important;
16863
17307
  }
17308
+ .dsh-partner-workspace #dsh-partner-channels .dsh-partner-workspace-dialog.is-confirmation button.is-danger {
17309
+ color: var(--partner-danger) !important;
17310
+ border-color: color-mix(in srgb, var(--partner-danger) 30%, var(--partner-border)) !important;
17311
+ background: color-mix(in srgb, var(--partner-danger) 8%, var(--partner-control)) !important;
17312
+ }
16864
17313
  .dsh-partner-workspace #dsh-partner-channels .dsh-partner-workspace-dialog > header button {
16865
- width: 32px; min-height: 32px; padding: 0 !important;
16866
- background: transparent !important; border-color: transparent !important;
17314
+ width: 34px; min-width: 34px; min-height: 34px; padding: 0 !important;
17315
+ border-radius: 50% !important;
17316
+ background: var(--partner-interaction-well, var(--partner-hover)) !important; border-color: transparent !important;
16867
17317
  }
16868
17318
  .dsh-partner-workspace #dsh-partner-channels .dsh-partner-channel-form {
16869
17319
  background: transparent !important; box-shadow: none !important; border: 0 !important;
@@ -16873,7 +17323,7 @@ var form_surface_default = `/* Deliberate, local boundary against host themes wi
16873
17323
  @media (max-width: 640px) {
16874
17324
  .dsh-partner-workspace #dsh-partner-channels button,
16875
17325
  .dsh-partner-workspace #dsh-partner-identity-editor button { min-height: 44px; }
16876
- .dsh-partner-workspace #dsh-partner-channels .dsh-partner-workspace-dialog { border-radius: 0 !important; border-width: 0 !important; }
17326
+ .dsh-partner-workspace #dsh-partner-channels .dsh-partner-workspace-dialog { border-radius: var(--partner-radius-dialog, 22px) !important; border-width: 1px !important; }
16877
17327
  .dsh-partner-workspace #dsh-partner-channels .dsh-partner-channel-toolbar { align-items: flex-start; flex-wrap: wrap; }
16878
17328
  }
16879
17329
 
@@ -16890,13 +17340,85 @@ var form_surface_default = `/* Deliberate, local boundary against host themes wi
16890
17340
  .dsh-partner-workspace #dsh-partner-channels .dsh-partner-channel-inline-notice p { margin: 4px 0 0; color: var(--partner-text-secondary); }
16891
17341
  `;
16892
17342
 
17343
+ // src/ui/interaction-theme.css
17344
+ var interaction_theme_default = "/* Knowledge 2.13.12 interaction contract. No global theme overrides or\n background animations; pendant/WebGL and business state are untouched. */\n.dsh-partner-workspace {\n --partner-radius-control: 12px;\n --partner-radius-dialog: 24px;\n --partner-radius-menu: 15px;\n --partner-dialog-inset: 20px;\n --partner-interaction-well: color-mix(in srgb, var(--partner-text) 3%, transparent);\n --partner-dialog-surface: color-mix(in srgb, var(--partner-text) 3%, var(--partner-solid-panel));\n --partner-interaction-rim: inset 0 1px 0 var(--partner-card-highlight);\n --partner-interaction-veil: rgb(12 18 24 / 14%);\n}\n.dsh-partner-workspace :where(button:not(.dsh-partner-feature-switch)) {\n border-radius: var(--partner-radius-control);\n transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms var(--partner-ease-out);\n}\n.dsh-partner-workspace :is(.dsh-partner-form-actions, .dsh-partner-feature-hero-actions, .dsh-partner-workspace-dialog footer) > button {\n box-shadow: var(--partner-interaction-rim), 0 2px 4px color-mix(in srgb, var(--partner-text) 4%, transparent);\n}\n.dsh-partner-workspace :is(.dsh-partner-form-actions, .dsh-partner-workspace-dialog footer) > button:active:not(:disabled) { transform: scale(.97); }\n.dsh-partner-workspace :is(button, input, select, textarea, summary, a):focus-visible { outline: 2px solid var(--partner-text-secondary); outline-offset: 2px; }\n.dsh-partner-workspace :where(input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea, select) { border-radius: var(--partner-radius-control); transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }\n.dsh-partner-workspace :is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form, .dsh-partner-form-actions) :is(button, input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea, select) { border-radius: var(--partner-radius-control); }\n.dsh-partner-workspace .dsh-partner-tabs { gap: 4px; padding: 4px; border: 0; border-radius: 14px; background: var(--partner-interaction-well); }\n.dsh-partner-workspace .dsh-partner-tabs button { border-radius: 10px; white-space: nowrap; }\n.dsh-partner-workspace .dsh-partner-tabs button::after { display: none; }\n.dsh-partner-workspace .dsh-partner-tabs button.is-active { color: var(--partner-text); background: var(--partner-raised); box-shadow: var(--partner-interaction-rim), 0 2px 5px color-mix(in srgb, var(--partner-text) 8%, transparent); }\n.dsh-partner-workspace .dsh-partner-capability-card-copy { border-radius: 13px; transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease; }\n.dsh-partner-workspace .dsh-partner-capability-card:has([aria-pressed=true]) .dsh-partner-capability-card-copy { border-color: var(--partner-focus-ring); box-shadow: var(--partner-interaction-rim); }\n.dsh-partner-workspace .dsh-partner-workspace-dialog-layer { align-items: center; padding: 20px; background: var(--partner-interaction-veil); }\n.dsh-partner-workspace .dsh-partner-workspace-dialog {\n font: var(--partner-font-body)/1.5 var(--partner-font-family);\n width: min(640px, 100%); height: auto; max-height: min(800px, 100%); box-sizing: border-box;\n padding: 7px; border: 1px solid var(--partner-border); border-radius: var(--partner-radius-dialog);\n box-shadow: var(--partner-interaction-rim), 0 20px 64px rgb(0 0 0 / 20%);\n animation-duration: 220ms;\n}\n.dsh-partner-workspace .dsh-partner-workspace-dialog.is-wide { width: min(880px, 100%); height: auto; max-height: min(840px, 100%); }\n.dsh-partner-workspace .dsh-partner-workspace-dialog.is-capability-resources { width: min(1000px, 100%); }\n.dsh-partner-workspace .dsh-partner-workspace-dialog > header { padding: 18px 18px 16px; border: 0; background: transparent; }\n.dsh-partner-workspace .dsh-partner-workspace-dialog > header strong { font-size: 18px; line-height: 1.4; letter-spacing: normal; }\n.dsh-partner-workspace .dsh-partner-workspace-dialog > header p { max-width: 52ch; line-height: 1.65; }\n.dsh-partner-workspace .dsh-partner-workspace-dialog > header button { width: 34px; min-width: 34px; min-height: 34px; border-radius: 50%; background: var(--partner-interaction-well); }\n.dsh-partner-workspace .dsh-partner-workspace-dialog-body { padding: var(--partner-dialog-inset); border: 1px solid var(--partner-separator); border-radius: 17px; background: var(--partner-dialog-surface); scroll-padding-block: 12px 90px; scrollbar-gutter: auto; }\n.dsh-partner-workspace .dsh-partner-workspace-dialog-body > :is(form, .dsh-partner-task-detail) > footer:last-child {\n bottom: calc(-1 * var(--partner-dialog-inset)); margin: 4px calc(-1 * var(--partner-dialog-inset)) calc(-1 * var(--partner-dialog-inset));\n padding: 14px var(--partner-dialog-inset); gap: 10px; border-top: 1px solid var(--partner-separator); box-shadow: none;\n background: var(--partner-dialog-surface);\n}\n.dsh-partner-workspace .dsh-partner-workspace-dialog footer > button { min-height: 38px; border-radius: var(--partner-radius-control); }\n.dsh-partner-workspace .dsh-partner-workspace-dialog.is-confirmation { width: min(440px, 100%); }\n.dsh-partner-workspace .dsh-partner-workspace-dialog.is-confirmation .dsh-partner-form-actions { margin: 0; padding: 0; justify-content: flex-end; gap: 10px; }\n.dsh-partner-workspace .dsh-partner-workspace-dialog.is-confirmation .dsh-partner-form-actions button { min-height: 38px; padding: 8px 14px; border: 1px solid var(--partner-border); color: var(--partner-text); background: var(--partner-control); font: 600 var(--partner-font-body)/1.4 var(--partner-font-family); cursor: pointer; }\n.dsh-partner-workspace .dsh-partner-workspace-dialog.is-confirmation .dsh-partner-form-actions button.is-danger { color: var(--partner-danger); border-color: color-mix(in srgb, var(--partner-danger) 30%, var(--partner-border)); background: color-mix(in srgb, var(--partner-danger) 8%, var(--partner-control)); }\n.dsh-partner-workspace :is(.dsh-partner-workspace-notice, .dsh-partner-inline-error, .dsh-partner-capability-save-status) { border-radius: 12px; }\n@media (max-width: 760px) {\n .dsh-partner-workspace { --partner-radius-dialog: 22px; --partner-dialog-inset: 16px; }\n .dsh-partner-workspace .dsh-partner-workspace-dialog-layer { align-items: center; padding: 8px; }\n .dsh-partner-workspace .dsh-partner-workspace-dialog,\n .dsh-partner-workspace .dsh-partner-workspace-dialog.is-wide { width: 100%; height: auto; max-height: 100%; padding: 6px; border-width: 1px; border-radius: var(--partner-radius-dialog); }\n .dsh-partner-workspace .dsh-partner-workspace-dialog > header { padding: 12px; }\n .dsh-partner-workspace .dsh-partner-workspace-dialog footer { flex-wrap: wrap; gap: 8px; }\n .dsh-partner-workspace .dsh-partner-workspace-dialog :is(footer, .dsh-partner-form-actions) > button { min-height: 44px; }\n .dsh-partner-workspace .dsh-partner-workspace-dialog.is-confirmation { width: min(440px, 100%); }\n}\n@media (prefers-reduced-motion: reduce) {\n .dsh-partner-workspace :is(button, input, textarea, select, .dsh-partner-capability-card-copy) { transition: none; }\n .dsh-partner-workspace .dsh-partner-workspace-dialog { animation: none; }\n .dsh-partner-workspace :is(.dsh-partner-form-actions, .dsh-partner-workspace-dialog footer) > button:active:not(:disabled) { transform: none; }\n}\n";
17345
+
17346
+ // src/ui/control-surfaces.css
17347
+ var control_surfaces_default = `/* One control surface across feature pages and dialogs. Composite searches
17348
+ keep a single outer border; switches, ranges and file pickers are excluded. */
17349
+ .dsh-partner-workspace {
17350
+ --partner-control-height: 38px;
17351
+ --partner-control-font-size: 13px;
17352
+ --partner-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%238a8f98' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
17353
+ }
17354
+ .dsh-partner-workspace :is(input:not([type]), input[type=text], input[type=search], input[type=url], input[type=password], input[type=email], input[type=number], input[type=datetime-local], input[type=time], select, textarea) {
17355
+ box-sizing: border-box; min-width: 0; max-width: 100%; border: 1px solid var(--partner-border);
17356
+ border-radius: var(--partner-radius-control); color: var(--partner-text); background-color: var(--partner-control);
17357
+ box-shadow: inset 0 1px 0 var(--partner-glass-highlight); font-size: var(--partner-control-font-size);
17358
+ }
17359
+ .dsh-partner-workspace :is(input:not([type]), input[type=text], input[type=search], input[type=url], input[type=password], input[type=email], input[type=number], input[type=datetime-local], input[type=time], select) { min-height: var(--partner-control-height); height: var(--partner-control-height); padding: 6px 11px; line-height: 1.4; }
17360
+ .dsh-partner-workspace textarea { padding: 10px 11px; line-height: 1.6; resize: vertical; }
17361
+ .dsh-partner-workspace select:not([multiple]) { appearance: none; padding-right: 34px; background-image: var(--partner-select-arrow); background-position: right 10px center; background-size: 16px; background-repeat: no-repeat; text-overflow: ellipsis; cursor: pointer; }
17362
+ .dsh-partner-workspace select option { color: var(--partner-text); background: var(--partner-solid-panel); }
17363
+ .dsh-partner-workspace :is(input:not([type]), input[type=text], input[type=search], input[type=url], input[type=password], input[type=email], input[type=number], select, textarea):focus-visible { outline: 2px solid var(--partner-focus-ring); outline-offset: 2px; box-shadow: inset 0 1px 0 var(--partner-glass-highlight); }
17364
+ .dsh-partner-workspace :is(input, textarea)::placeholder { color: var(--partner-text-tertiary); opacity: 1; }
17365
+ .dsh-partner-workspace :is(input, select, textarea):disabled { opacity: .55; cursor: not-allowed; }
17366
+ .dsh-partner-workspace .dsh-partner-field { min-width: 0; }
17367
+ .dsh-partner-workspace .dsh-partner-field > span { gap: 4px; }
17368
+ .dsh-partner-workspace .dsh-partner-board-search > input { padding-left: 34px; padding-right: 38px; }
17369
+ .dsh-partner-workspace :is(.dsh-partner-skill-search, .dsh-partner-skill-search.is-compact) { box-sizing: border-box; min-height: 40px; gap: 6px; padding: 4px 8px; border: 1px solid var(--partner-border); border-radius: var(--partner-radius-control); background: var(--partner-control); box-shadow: inset 0 1px 0 var(--partner-glass-highlight); }
17370
+ .dsh-partner-workspace .dsh-partner-skill-search input { min-height: 30px; height: 30px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: none; }
17371
+ .dsh-partner-workspace .dsh-partner-skill-search:focus-within { outline: 2px solid var(--partner-focus-ring); outline-offset: 2px; }
17372
+ .dsh-partner-workspace .dsh-partner-skill-search-icon { width: 28px; height: 28px; background: transparent; box-shadow: none; }
17373
+ .dsh-partner-workspace .dsh-partner-memory-toolbar > label:not(.dsh-partner-memory-search) { flex: 0 1 190px; min-width: 0; }
17374
+ .dsh-partner-workspace .dsh-partner-memory-toolbar select { width: 100%; }
17375
+ .dsh-partner-workspace .dsh-partner-workspace-dialog-body > .dsh-partner-memory-settings > footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--partner-separator); }
17376
+ .dsh-partner-workspace .dsh-partner-memory-settings .dsh-partner-automation-fields.is-memory-model { grid-template-columns: repeat(2, minmax(0, 1fr)); }
17377
+ .dsh-partner-workspace .dsh-partner-memory-settings .is-memory-model > .dsh-partner-field:first-child { grid-column: 1 / -1; max-width: 220px; }
17378
+
17379
+ .dsh-partner-workspace .dsh-partner-runtime-summary { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--partner-border); border-radius: 14px; background: var(--partner-interaction-well); }
17380
+ .dsh-partner-workspace .dsh-partner-runtime-summary > span { display: grid; min-width: 0; gap: 3px; }
17381
+ .dsh-partner-workspace .dsh-partner-runtime-summary :is(small, strong) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
17382
+ .dsh-partner-workspace .dsh-partner-runtime-summary small { color: var(--partner-text-secondary); font-size: 12px; }
17383
+ .dsh-partner-workspace .dsh-partner-runtime-summary strong { font-size: 13px; font-weight: 600; }
17384
+ .dsh-partner-workspace :is(.dsh-partner-runtime-summary > button, .dsh-partner-runtime-editor footer > button) { min-height: var(--partner-control-height); padding: 6px 14px; border: 1px solid var(--partner-border); border-radius: var(--partner-radius-control); color: var(--partner-text); background: var(--partner-control); font: 600 13px/1.4 var(--partner-font-family); cursor: pointer; }
17385
+ .dsh-partner-workspace .dsh-partner-runtime-editor { display: grid; min-width: 0; gap: 14px; }
17386
+ .dsh-partner-workspace .dsh-partner-runtime-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
17387
+ .dsh-partner-workspace .dsh-partner-runtime-options .dsh-partner-field { margin: 0; }
17388
+ .dsh-partner-workspace .dsh-partner-runtime-search { display: grid; min-width: 0; gap: 7px; font-weight: 600; }
17389
+ .dsh-partner-workspace .dsh-partner-runtime-search input { width: 100%; }
17390
+ .dsh-partner-workspace .dsh-partner-runtime-models { display: grid; align-content: start; gap: 4px; max-height: 260px; overflow: auto; padding: 4px; border: 1px solid var(--partner-border); border-radius: 12px; scrollbar-gutter: stable; }
17391
+ .dsh-partner-workspace .dsh-partner-runtime-models > button { display: grid; grid-template-columns: minmax(0, 1fr) 20px; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--partner-text); text-align: left; font: inherit; cursor: pointer; }
17392
+ .dsh-partner-workspace .dsh-partner-runtime-models > button > span { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
17393
+ .dsh-partner-workspace .dsh-partner-runtime-models small { color: var(--partner-text-secondary); font-size: 12px; }
17394
+ .dsh-partner-workspace .dsh-partner-runtime-models > button:is(:hover, [aria-pressed=true]) { background: var(--partner-selected); }
17395
+ .dsh-partner-workspace .dsh-partner-runtime-models > button:focus-visible { outline-offset: -2px; }
17396
+ .dsh-partner-workspace .dsh-partner-runtime-models i { display: grid; place-items: center; }
17397
+ .dsh-partner-workspace .dsh-partner-runtime-models > p { margin: 0; padding: 10px; color: var(--partner-text-secondary); }
17398
+ .dsh-partner-workspace .dsh-partner-runtime-editor footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
17399
+ .dsh-partner-workspace .dsh-partner-runtime-editor footer > span { color: var(--partner-text-secondary); font-size: 12px; }
17400
+ @media (max-width: 760px) {
17401
+ .dsh-partner-workspace { --partner-control-height: 44px; --partner-control-font-size: 16px; }
17402
+ .dsh-partner-workspace .dsh-partner-skill-search input { min-height: 36px; height: 36px; }
17403
+ .dsh-partner-workspace .dsh-partner-memory-toolbar > label:not(.dsh-partner-memory-search) { flex: 1 1 130px; }
17404
+ }
17405
+ @media (max-width: 480px) {
17406
+ .dsh-partner-workspace .dsh-partner-runtime-summary { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
17407
+ .dsh-partner-workspace .dsh-partner-runtime-summary > span { grid-column: 1; }
17408
+ .dsh-partner-workspace .dsh-partner-runtime-summary > button { grid-column: 2; grid-row: 1 / 3; }
17409
+ .dsh-partner-workspace .dsh-partner-runtime-options { grid-template-columns: minmax(0, 1fr); }
17410
+ .dsh-partner-workspace .dsh-partner-memory-settings .dsh-partner-automation-fields.is-memory-model { grid-template-columns: minmax(0, 1fr); }
17411
+ .dsh-partner-workspace .dsh-partner-memory-settings .is-memory-model > .dsh-partner-field:first-child { max-width: none; }
17412
+ }
17413
+ `;
17414
+
16893
17415
  // src/ui/companion-create.tsx
16894
- var import_react51 = require("react");
16895
- var import_dsh_client_ui_primitives23 = require("@deepseek-ai/dsh-client-ui-primitives");
16896
- var import_jsx_runtime47 = require("react/jsx-runtime");
17416
+ var import_react54 = require("react");
17417
+ var import_dsh_client_ui_primitives24 = require("@deepseek-ai/dsh-client-ui-primitives");
17418
+ var import_jsx_runtime50 = require("react/jsx-runtime");
16897
17419
  function CompanionCreateDialog({ close, create }) {
16898
- const [busy, setBusy] = (0, import_react51.useState)(false);
16899
- const [error, setError] = (0, import_react51.useState)();
17420
+ const [busy, setBusy] = (0, import_react54.useState)(false);
17421
+ const [error, setError] = (0, import_react54.useState)();
16900
17422
  const submit = async (event) => {
16901
17423
  event.preventDefault();
16902
17424
  const data = new FormData(event.currentTarget);
@@ -16915,30 +17437,30 @@ function CompanionCreateDialog({ close, create }) {
16915
17437
  setBusy(false);
16916
17438
  }
16917
17439
  };
16918
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u4F19\u4F34", detail: "\u5148\u5EFA\u7ACB\u6E05\u6670\u7684\u8EAB\u4EFD\u548C\u804C\u8D23\u3002\u6A21\u578B\u3001\u5DE5\u5177\u3001Skill \u4E0E\u534F\u4F5C\u6743\u9650\u4F1A\u5728\u521B\u5EFA\u540E\u5355\u72EC\u914D\u7F6E\u3002", close, width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-companion-create-form", "aria-busy": busy, onSubmit: (event) => {
17440
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u4F19\u4F34", detail: "\u5148\u5EFA\u7ACB\u6E05\u6670\u7684\u8EAB\u4EFD\u548C\u804C\u8D23\u3002\u6A21\u578B\u3001\u5DE5\u5177\u3001Skill \u4E0E\u534F\u4F5C\u6743\u9650\u4F1A\u5728\u521B\u5EFA\u540E\u5355\u72EC\u914D\u7F6E\u3002", close, width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-companion-create-form", "aria-busy": busy, onSubmit: (event) => {
16919
17441
  void submit(event);
16920
17442
  }, children: [
16921
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { children: [
16922
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: "\u4F19\u4F34\u540D\u5B57" }),
16923
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("input", { name: "name", required: true, maxLength: 60, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u5C0F\u9ED1" })
17443
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("label", { children: [
17444
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: "\u4F19\u4F34\u540D\u5B57" }),
17445
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("input", { name: "name", required: true, maxLength: 60, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u5C0F\u9ED1" })
16924
17446
  ] }),
16925
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { children: [
16926
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: "\u4E3B\u8981\u89D2\u8272" }),
16927
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("input", { name: "role", required: true, maxLength: 120, placeholder: "\u4F8B\u5982\uFF1A\u4EA7\u54C1\u4E0E\u5DE5\u7A0B\u534F\u4F5C\u4F19\u4F34" })
17447
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("label", { children: [
17448
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: "\u4E3B\u8981\u89D2\u8272" }),
17449
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("input", { name: "role", required: true, maxLength: 120, placeholder: "\u4F8B\u5982\uFF1A\u4EA7\u54C1\u4E0E\u5DE5\u7A0B\u534F\u4F5C\u4F19\u4F34" })
16928
17450
  ] }),
16929
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "is-wide", children: [
16930
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D" }),
16931
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("input", { name: "description", maxLength: 500, placeholder: "\u5B83\u4E3B\u8981\u8D1F\u8D23\u4EC0\u4E48\uFF0C\u4EC0\u4E48\u65F6\u5019\u5E94\u8BE5\u627E\u5B83" })
17451
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("label", { className: "is-wide", children: [
17452
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D" }),
17453
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("input", { name: "description", maxLength: 500, placeholder: "\u5B83\u4E3B\u8981\u8D1F\u8D23\u4EC0\u4E48\uFF0C\u4EC0\u4E48\u65F6\u5019\u5E94\u8BE5\u627E\u5B83" })
16932
17454
  ] }),
16933
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "is-wide", children: [
16934
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: "\u521D\u59CB\u884C\u4E3A\u51C6\u5219" }),
16935
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("textarea", { name: "instructions", maxLength: 12e3, rows: 7, placeholder: "\u5199\u6E05\u804C\u8D23\u3001\u8868\u8FBE\u65B9\u5F0F\u3001\u5DE5\u4F5C\u8FB9\u754C\u548C\u4EA4\u4ED8\u6807\u51C6\uFF1B\u4E5F\u53EF\u4EE5\u521B\u5EFA\u540E\u518D\u5B8C\u5584" })
17455
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("label", { className: "is-wide", children: [
17456
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: "\u521D\u59CB\u884C\u4E3A\u51C6\u5219" }),
17457
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("textarea", { name: "instructions", maxLength: 12e3, rows: 7, placeholder: "\u5199\u6E05\u804C\u8D23\u3001\u8868\u8FBE\u65B9\u5F0F\u3001\u5DE5\u4F5C\u8FB9\u754C\u548C\u4EA4\u4ED8\u6807\u51C6\uFF1B\u4E5F\u53EF\u4EE5\u521B\u5EFA\u540E\u518D\u5B8C\u5584" })
16936
17458
  ] }),
16937
- error && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(WorkspaceNotice, { children: error }),
16938
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("footer", { children: [
16939
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
16940
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
16941
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_dsh_client_ui_primitives23.IconPlusOutlineRegular, { size: 14 }),
17459
+ error && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(WorkspaceNotice, { children: error }),
17460
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("footer", { children: [
17461
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
17462
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
17463
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_dsh_client_ui_primitives24.IconPlusOutlineRegular, { size: 14 }),
16942
17464
  busy ? "\u6B63\u5728\u521B\u5EFA\u2026" : "\u521B\u5EFA\u4F19\u4F34"
16943
17465
  ] })
16944
17466
  ] })
@@ -16946,7 +17468,7 @@ function CompanionCreateDialog({ close, create }) {
16946
17468
  }
16947
17469
 
16948
17470
  // src/main-panel-compat.ts
16949
- var import_react52 = require("react");
17471
+ var import_react55 = require("react");
16950
17472
  function registerMainPanel(ctx, id, priority, render, onHidden = () => {
16951
17473
  }) {
16952
17474
  const layout = ctx.layout;
@@ -16957,7 +17479,7 @@ function registerMainPanel(ctx, id, priority, render, onHidden = () => {
16957
17479
  let disposed = false;
16958
17480
  let generation = 0;
16959
17481
  const Body = (props) => {
16960
- (0, import_react52.useEffect)(() => {
17482
+ (0, import_react55.useEffect)(() => {
16961
17483
  const current2 = ++generation;
16962
17484
  return () => {
16963
17485
  queueMicrotask(() => {
@@ -17083,7 +17605,7 @@ function decisionReason(reason) {
17083
17605
  }
17084
17606
 
17085
17607
  // src/decision/conversation.tsx
17086
- var import_jsx_runtime48 = require("react/jsx-runtime");
17608
+ var import_jsx_runtime51 = require("react/jsx-runtime");
17087
17609
  var decisionDefinition = {
17088
17610
  kind: "partner-decision",
17089
17611
  target: "chat",
@@ -17108,13 +17630,13 @@ var decisionDefinition = {
17108
17630
  }
17109
17631
  };
17110
17632
  function DecisionCard({ data }) {
17111
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("section", { className: "dsh-partner-decision-card", "aria-label": "\u81EA\u52A8\u51B3\u7B56", children: [
17112
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { role: "status", "aria-atomic": "true", children: [
17113
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: "\u81EA\u52A8\u51B3\u7B56" }),
17114
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: decisionReason(data.reason) }),
17115
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: data.status === "running" ? "\u7B49\u5F85\u54CD\u5E94\u2026" : `${(data.durationMs / 1e3).toFixed(2)} \u79D2` })
17633
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("section", { className: "dsh-partner-decision-card", "aria-label": "\u81EA\u52A8\u51B3\u7B56", children: [
17634
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { role: "status", "aria-atomic": "true", children: [
17635
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("strong", { children: "\u81EA\u52A8\u51B3\u7B56" }),
17636
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { children: decisionReason(data.reason) }),
17637
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("small", { children: data.status === "running" ? "\u7B49\u5F85\u54CD\u5E94\u2026" : `${(data.durationMs / 1e3).toFixed(2)} \u79D2` })
17116
17638
  ] }),
17117
- data.suggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("ul", { children: data.suggestions.map((item) => {
17639
+ data.suggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("ul", { children: data.suggestions.map((item) => {
17118
17640
  const colon = item.indexOf("\uFF1A");
17119
17641
  let label = item;
17120
17642
  try {
@@ -17122,9 +17644,9 @@ function DecisionCard({ data }) {
17122
17644
  if (typeof value.name === "string") label = `${item.slice(0, colon)}\uFF1A${value.name}`;
17123
17645
  } catch {
17124
17646
  }
17125
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("li", { children: label }, item);
17647
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("li", { children: label }, item);
17126
17648
  }) }),
17127
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: "Skill \xB7 \u4F19\u4F34 \xB7 \u5DE5\u5177\uFF0C\u4EC5\u63D0\u4F9B\u5EFA\u8BAE\uFF0C\u4E0D\u4EE3\u8868\u5DF2\u6267\u884C\u3002" })
17649
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("small", { children: "Skill \xB7 \u4F19\u4F34 \xB7 \u5DE5\u5177\uFF0C\u4EC5\u63D0\u4F9B\u5EFA\u8BAE\uFF0C\u4E0D\u4EE3\u8868\u5DF2\u6267\u884C\u3002" })
17128
17650
  ] });
17129
17651
  }
17130
17652
  function registerDecisionCards(ctx) {
@@ -17146,15 +17668,15 @@ function registerDecisionCards(ctx) {
17146
17668
  runtime.inject(["conversationEvents"], (scope) => register(scope, true));
17147
17669
  runtime.slots.inject("conversation.chat.node", () => runtime.slots.register(
17148
17670
  { name: "conversation.chat.node", key: "partner-decision" },
17149
- (props) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DecisionCard, { data: props.node.data })
17671
+ (props) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(DecisionCard, { data: props.node.data })
17150
17672
  ));
17151
17673
  }
17152
17674
 
17153
17675
  // src/ui/workspace-navigation.tsx
17154
- var import_dsh_client_ui_primitives24 = require("@deepseek-ai/dsh-client-ui-primitives");
17676
+ var import_dsh_client_ui_primitives25 = require("@deepseek-ai/dsh-client-ui-primitives");
17155
17677
 
17156
17678
  // src/ui/storage-settings.tsx
17157
- var import_react54 = require("react");
17679
+ var import_react57 = require("react");
17158
17680
 
17159
17681
  // src/ui/storage-recovery.ts
17160
17682
  var StorageStatusError = class extends Error {
@@ -17202,16 +17724,16 @@ async function waitForStorage(signal, onWait, options = {}) {
17202
17724
  }
17203
17725
 
17204
17726
  // src/ui/attachment-storage.tsx
17205
- var import_react53 = require("react");
17206
- var import_jsx_runtime49 = require("react/jsx-runtime");
17727
+ var import_react56 = require("react");
17728
+ var import_jsx_runtime52 = require("react/jsx-runtime");
17207
17729
  var size = (bytes) => `${(bytes / 1048576).toFixed(2)} MiB`;
17208
17730
  function AttachmentStoragePanel() {
17209
- const [view, setView] = (0, import_react53.useState)(), [limit, setLimit] = (0, import_react53.useState)("512");
17210
- const [owner, setOwner] = (0, import_react53.useState)(""), [days, setDays] = (0, import_react53.useState)("0"), [offset, setOffset] = (0, import_react53.useState)(0);
17211
- const [selected, setSelected] = (0, import_react53.useState)([]), [busy, setBusy] = (0, import_react53.useState)(false), [confirm, setConfirm] = (0, import_react53.useState)(false);
17212
- const [error, setError] = (0, import_react53.useState)(""), [notice, setNotice] = (0, import_react53.useState)(""), [revision, setRevision] = (0, import_react53.useState)(0);
17213
- const [expanded, setExpanded] = (0, import_react53.useState)(false);
17214
- (0, import_react53.useEffect)(() => {
17731
+ const [view, setView] = (0, import_react56.useState)(), [limit, setLimit] = (0, import_react56.useState)("512");
17732
+ const [owner, setOwner] = (0, import_react56.useState)(""), [days, setDays] = (0, import_react56.useState)("0"), [offset, setOffset] = (0, import_react56.useState)(0);
17733
+ const [selected, setSelected] = (0, import_react56.useState)([]), [busy, setBusy] = (0, import_react56.useState)(false), [confirm, setConfirm] = (0, import_react56.useState)(false);
17734
+ const [error, setError] = (0, import_react56.useState)(""), [notice, setNotice] = (0, import_react56.useState)(""), [revision, setRevision] = (0, import_react56.useState)(0);
17735
+ const [expanded, setExpanded] = (0, import_react56.useState)(false);
17736
+ (0, import_react56.useEffect)(() => {
17215
17737
  const controller = new AbortController();
17216
17738
  setBusy(true);
17217
17739
  setSelected([]);
@@ -17255,65 +17777,65 @@ function AttachmentStoragePanel() {
17255
17777
  setBusy(false);
17256
17778
  }
17257
17779
  };
17258
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(WorkspaceBlock, { title: "\u9644\u4EF6\u5B58\u50A8", className: "attachment-storage-block", children: [
17259
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { id: "partner-attachment-storage", className: "dsh-partner-attachment-storage", "aria-busy": busy, children: [
17260
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "attachment-storage-overview", children: [
17261
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "attachment-storage-usage", children: [
17262
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("strong", { children: view ? `${size(view.usedBytes)} / ${view.limitMiB} MiB` : "\u6B63\u5728\u8BFB\u53D6\u2026" }),
17263
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("small", { children: view ? `${view.count} \u4E2A\u526F\u672C \xB7 \u5168\u90E8\u4F19\u4F34\u5171\u4EAB` : "\u6B63\u5728\u7EDF\u8BA1\u9644\u4EF6\u5360\u7528" })
17780
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(WorkspaceBlock, { title: "\u9644\u4EF6\u5B58\u50A8", className: "attachment-storage-block", children: [
17781
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { id: "partner-attachment-storage", className: "dsh-partner-attachment-storage", "aria-busy": busy, children: [
17782
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "attachment-storage-overview", children: [
17783
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "attachment-storage-usage", children: [
17784
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: view ? `${size(view.usedBytes)} / ${view.limitMiB} MiB` : "\u6B63\u5728\u8BFB\u53D6\u2026" }),
17785
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("small", { children: view ? `${view.count} \u4E2A\u526F\u672C \xB7 \u5168\u90E8\u4F19\u4F34\u5171\u4EAB` : "\u6B63\u5728\u7EDF\u8BA1\u9644\u4EF6\u5360\u7528" })
17264
17786
  ] }),
17265
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("form", { onSubmit: (e) => {
17787
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("form", { onSubmit: (e) => {
17266
17788
  e.preventDefault();
17267
17789
  void save();
17268
17790
  }, children: [
17269
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { children: [
17791
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("label", { children: [
17270
17792
  "\u989D\u5EA6",
17271
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("input", { "aria-label": "\u603B\u989D\u5EA6\uFF08MiB\uFF09", type: "number", min: "64", max: "1048576", step: "1", required: true, value: limit, disabled: busy, onChange: (e) => setLimit(e.target.value) }),
17272
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: "MiB" })
17793
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("input", { "aria-label": "\u603B\u989D\u5EA6\uFF08MiB\uFF09", type: "number", min: "64", max: "1048576", step: "1", required: true, value: limit, disabled: busy, onChange: (e) => setLimit(e.target.value) }),
17794
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: "MiB" })
17273
17795
  ] }),
17274
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { "aria-label": "\u4FDD\u5B58\u989D\u5EA6", disabled: busy || !view || Number(limit) === view.limitMiB, children: "\u4FDD\u5B58" })
17796
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { "aria-label": "\u4FDD\u5B58\u989D\u5EA6", disabled: busy || !view || Number(limit) === view.limitMiB, children: "\u4FDD\u5B58" })
17275
17797
  ] }),
17276
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", "aria-expanded": expanded, "aria-controls": "attachment-storage-manager", onClick: () => setExpanded((v) => !v), children: expanded ? "\u6536\u8D77\u660E\u7EC6" : "\u7BA1\u7406\u526F\u672C" })
17798
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "button", "aria-expanded": expanded, "aria-controls": "attachment-storage-manager", onClick: () => setExpanded((v) => !v), children: expanded ? "\u6536\u8D77\u660E\u7EC6" : "\u7BA1\u7406\u526F\u672C" })
17277
17799
  ] }),
17278
- expanded && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { id: "attachment-storage-manager", children: [
17279
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "attachment-storage-filters", children: [
17280
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { children: [
17800
+ expanded && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { id: "attachment-storage-manager", children: [
17801
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "attachment-storage-filters", children: [
17802
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("label", { children: [
17281
17803
  "\u4F19\u4F34",
17282
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("select", { value: owner, disabled: busy, onChange: (e) => {
17804
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("select", { value: owner, disabled: busy, onChange: (e) => {
17283
17805
  setOwner(e.target.value);
17284
17806
  setOffset(0);
17285
17807
  }, children: [
17286
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("option", { value: "", children: "\u5168\u90E8\u4F19\u4F34" }),
17287
- view?.owners.map((o) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("option", { value: o.id, children: o.name }, o.id))
17808
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("option", { value: "", children: "\u5168\u90E8\u4F19\u4F34" }),
17809
+ view?.owners.map((o) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("option", { value: o.id, children: o.name }, o.id))
17288
17810
  ] })
17289
17811
  ] }),
17290
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { children: [
17812
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("label", { children: [
17291
17813
  "\u521B\u5EFA\u65F6\u95F4",
17292
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("select", { value: days, disabled: busy, onChange: (e) => {
17814
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("select", { value: days, disabled: busy, onChange: (e) => {
17293
17815
  setDays(e.target.value);
17294
17816
  setOffset(0);
17295
17817
  }, children: [
17296
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("option", { value: "0", children: "\u5168\u90E8\u65F6\u95F4" }),
17297
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("option", { value: "7", children: "7 \u5929\u4EE5\u524D" }),
17298
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("option", { value: "30", children: "30 \u5929\u4EE5\u524D" }),
17299
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("option", { value: "90", children: "90 \u5929\u4EE5\u524D" })
17818
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("option", { value: "0", children: "\u5168\u90E8\u65F6\u95F4" }),
17819
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("option", { value: "7", children: "7 \u5929\u4EE5\u524D" }),
17820
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("option", { value: "30", children: "30 \u5929\u4EE5\u524D" }),
17821
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("option", { value: "90", children: "90 \u5929\u4EE5\u524D" })
17300
17822
  ] })
17301
17823
  ] }),
17302
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { disabled: busy, onClick: () => setRevision((v) => v + 1), children: "\u5237\u65B0" })
17824
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { disabled: busy, onClick: () => setRevision((v) => v + 1), children: "\u5237\u65B0" })
17303
17825
  ] }),
17304
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "attachment-storage-selection", children: [
17305
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { disabled: busy || !view?.items.some((i) => !i.protectedReason), onClick: () => setSelected(selected.length ? [] : view.items.filter((i) => !i.protectedReason).map((i) => i.id)), children: selected.length ? "\u53D6\u6D88\u9009\u62E9" : "\u9009\u62E9\u672C\u9875" }),
17306
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("small", { children: [
17826
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "attachment-storage-selection", children: [
17827
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { disabled: busy || !view?.items.some((i) => !i.protectedReason), onClick: () => setSelected(selected.length ? [] : view.items.filter((i) => !i.protectedReason).map((i) => i.id)), children: selected.length ? "\u53D6\u6D88\u9009\u62E9" : "\u9009\u62E9\u672C\u9875" }),
17828
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("small", { children: [
17307
17829
  "\u53EF\u6E05\u7406 ",
17308
17830
  size(view?.eligibleBytes ?? 0),
17309
17831
  " \xB7 \u4F7F\u7528\u4E2D\u7684\u526F\u672C\u53D7\u4FDD\u62A4"
17310
17832
  ] })
17311
17833
  ] }),
17312
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "attachment-storage-list", children: view?.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("label", { className: "attachment-storage-row", children: [
17313
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("input", { type: "checkbox", disabled: busy || !!item.protectedReason, checked: selected.includes(item.id), onChange: (e) => setSelected((ids) => e.target.checked ? [...ids, item.id] : ids.filter((id) => id !== item.id)) }),
17314
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { children: [
17315
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("strong", { title: item.name, children: item.name }),
17316
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("small", { children: [
17834
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "attachment-storage-list", children: view?.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("label", { className: "attachment-storage-row", children: [
17835
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("input", { type: "checkbox", disabled: busy || !!item.protectedReason, checked: selected.includes(item.id), onChange: (e) => setSelected((ids) => e.target.checked ? [...ids, item.id] : ids.filter((id) => id !== item.id)) }),
17836
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { children: [
17837
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { title: item.name, children: item.name }),
17838
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("small", { children: [
17317
17839
  item.companionName,
17318
17840
  " \xB7 ",
17319
17841
  size(item.size),
@@ -17324,60 +17846,60 @@ function AttachmentStoragePanel() {
17324
17846
  ] })
17325
17847
  ] })
17326
17848
  ] }, item.id)) }),
17327
- view && !view.items.length && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { children: "\u6CA1\u6709\u7B26\u5408\u6761\u4EF6\u7684\u526F\u672C\u3002" }),
17328
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "attachment-storage-filters", children: [
17329
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { disabled: busy || offset === 0, onClick: () => setOffset(Math.max(0, offset - 30)), children: "\u4E0A\u4E00\u9875" }),
17330
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("span", { children: [
17849
+ view && !view.items.length && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { children: "\u6CA1\u6709\u7B26\u5408\u6761\u4EF6\u7684\u526F\u672C\u3002" }),
17850
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "attachment-storage-filters", children: [
17851
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { disabled: busy || offset === 0, onClick: () => setOffset(Math.max(0, offset - 30)), children: "\u4E0A\u4E00\u9875" }),
17852
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { children: [
17331
17853
  "\u7B2C ",
17332
17854
  Math.floor(offset / 30) + 1,
17333
17855
  " \u9875 \xB7 \u5171 ",
17334
17856
  view?.filteredCount ?? 0,
17335
17857
  " \u9879"
17336
17858
  ] }),
17337
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { disabled: busy || !view || offset + 30 >= view.filteredCount, onClick: () => setOffset(offset + 30), children: "\u4E0B\u4E00\u9875" }),
17338
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("button", { disabled: busy || !selected.length, onClick: () => setConfirm(true), children: [
17859
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { disabled: busy || !view || offset + 30 >= view.filteredCount, onClick: () => setOffset(offset + 30), children: "\u4E0B\u4E00\u9875" }),
17860
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("button", { disabled: busy || !selected.length, onClick: () => setConfirm(true), children: [
17339
17861
  "\u6E05\u7406\u6240\u9009\uFF08",
17340
17862
  selected.length,
17341
17863
  "\uFF09"
17342
17864
  ] })
17343
17865
  ] }),
17344
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("details", { className: "attachment-storage-help", children: [
17345
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("summary", { children: "\u5B58\u50A8\u4E0E\u6E05\u7406\u8BF4\u660E" }),
17346
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { children: "\u526F\u672C\u7EDF\u4E00\u5B58\u653E\uFF0C\u539F\u6587\u4EF6\u4E0D\u53D7\u5F71\u54CD\u3002\u4E0D\u4F1A\u81EA\u52A8\u6E05\u7406\uFF1B\u964D\u4F4E\u989D\u5EA6\u4E0D\u5220\u9664\u65E7\u526F\u672C\uFF0C\u8D85\u989D\u65F6\u505C\u6B62\u65B0\u589E\u3002\u5355\u6587\u4EF6\u4E0A\u9650 64 MiB\u3002" }),
17347
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { children: "\u53D1\u9001\u4E2D\u3001\u5931\u8D25\u5F85\u91CD\u8BD5\u3001\u6700\u8FD1 5 \u5206\u949F\u521B\u5EFA\u53CA\u672A\u5B8C\u6210\u4EFB\u52A1/\u9700\u6C42\u5F15\u7528\u7684\u526F\u672C\u4E0D\u80FD\u6E05\u7406\u3002\u6E05\u7406\u540E\u5BF9\u5E94\u5386\u53F2\u4E0B\u8F7D\u94FE\u63A5\u5931\u6548\u3002" }),
17348
- [...new Set(view?.owners.map((o) => o.directory) ?? [])].map((directory) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("code", { children: directory }, directory))
17866
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("details", { className: "attachment-storage-help", children: [
17867
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("summary", { children: "\u5B58\u50A8\u4E0E\u6E05\u7406\u8BF4\u660E" }),
17868
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { children: "\u526F\u672C\u7EDF\u4E00\u5B58\u653E\uFF0C\u539F\u6587\u4EF6\u4E0D\u53D7\u5F71\u54CD\u3002\u4E0D\u4F1A\u81EA\u52A8\u6E05\u7406\uFF1B\u964D\u4F4E\u989D\u5EA6\u4E0D\u5220\u9664\u65E7\u526F\u672C\uFF0C\u8D85\u989D\u65F6\u505C\u6B62\u65B0\u589E\u3002\u5355\u6587\u4EF6\u4E0A\u9650 64 MiB\u3002" }),
17869
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { children: "\u53D1\u9001\u4E2D\u3001\u5931\u8D25\u5F85\u91CD\u8BD5\u3001\u6700\u8FD1 5 \u5206\u949F\u521B\u5EFA\u53CA\u672A\u5B8C\u6210\u4EFB\u52A1/\u9700\u6C42\u5F15\u7528\u7684\u526F\u672C\u4E0D\u80FD\u6E05\u7406\u3002\u6E05\u7406\u540E\u5BF9\u5E94\u5386\u53F2\u4E0B\u8F7D\u94FE\u63A5\u5931\u6548\u3002" }),
17870
+ [...new Set(view?.owners.map((o) => o.directory) ?? [])].map((directory) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("code", { children: directory }, directory))
17349
17871
  ] })
17350
17872
  ] }),
17351
- error && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { role: "alert", children: error }),
17352
- notice && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { role: "status", children: notice })
17873
+ error && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { role: "alert", children: error }),
17874
+ notice && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { role: "status", children: notice })
17353
17875
  ] }),
17354
- confirm && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(WorkspaceDialog, { eyebrow: "\u9644\u4EF6\u7BA1\u7406", title: "\u6E05\u7406\u4EA4\u4ED8\u526F\u672C", detail: `\u5DF2\u9009\u62E9 ${selected.length} \u4E2A\u526F\u672C\u3002\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002`, close: () => {
17876
+ confirm && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(WorkspaceDialog, { eyebrow: "\u9644\u4EF6\u7BA1\u7406", title: "\u6E05\u7406\u4EA4\u4ED8\u526F\u672C", detail: `\u5DF2\u9009\u62E9 ${selected.length} \u4E2A\u526F\u672C\u3002\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002`, close: () => {
17355
17877
  if (!busy) setConfirm(false);
17356
- }, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("form", { className: "dsh-partner-feature-form", onSubmit: (event) => {
17878
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("form", { className: "dsh-partner-feature-form", onSubmit: (event) => {
17357
17879
  event.preventDefault();
17358
17880
  if (!busy) void clean();
17359
17881
  }, children: [
17360
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "is-wide", children: "\u53EA\u5220\u9664\u4EA4\u4ED8\u526F\u672C\uFF0C\u539F\u59CB\u6587\u4EF6\u4FDD\u6301\u4E0D\u53D8\u3002\u5386\u53F2\u4F1A\u8BDD\u548C\u770B\u677F\u4E2D\u7684\u5BF9\u5E94\u9644\u4EF6\u4E0B\u8F7D\u94FE\u63A5\u5C06\u5931\u6548\u3002\u6267\u884C\u65F6\u4F1A\u518D\u6B21\u68C0\u67E5\u4FDD\u62A4\u72B6\u6001\u3002" }),
17361
- error && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "is-wide", role: "alert", children: error }),
17362
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("footer", { children: [
17363
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(false), children: "\u53D6\u6D88" }),
17364
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u6E05\u7406\u4E2D\u2026" : "\u786E\u8BA4\u6E05\u7406" })
17882
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "is-wide", children: "\u53EA\u5220\u9664\u4EA4\u4ED8\u526F\u672C\uFF0C\u539F\u59CB\u6587\u4EF6\u4FDD\u6301\u4E0D\u53D8\u3002\u5386\u53F2\u4F1A\u8BDD\u548C\u770B\u677F\u4E2D\u7684\u5BF9\u5E94\u9644\u4EF6\u4E0B\u8F7D\u94FE\u63A5\u5C06\u5931\u6548\u3002\u6267\u884C\u65F6\u4F1A\u518D\u6B21\u68C0\u67E5\u4FDD\u62A4\u72B6\u6001\u3002" }),
17883
+ error && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "is-wide", role: "alert", children: error }),
17884
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("footer", { children: [
17885
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(false), children: "\u53D6\u6D88" }),
17886
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u6E05\u7406\u4E2D\u2026" : "\u786E\u8BA4\u6E05\u7406" })
17365
17887
  ] })
17366
17888
  ] }) })
17367
17889
  ] });
17368
17890
  }
17369
17891
 
17370
17892
  // src/ui/storage-settings.tsx
17371
- var import_jsx_runtime50 = require("react/jsx-runtime");
17893
+ var import_jsx_runtime53 = require("react/jsx-runtime");
17372
17894
  function GeneralSettingsPanel() {
17373
- const [version, setVersion] = (0, import_react54.useState)();
17374
- const [inspection, setInspection] = (0, import_react54.useState)();
17375
- const [busy, setBusy] = (0, import_react54.useState)(false), [confirm, setConfirm] = (0, import_react54.useState)(false);
17376
- const [error, setError] = (0, import_react54.useState)(""), [notice, setNotice] = (0, import_react54.useState)("");
17377
- const request = (0, import_react54.useRef)();
17378
- const mounted = (0, import_react54.useRef)(true);
17379
- const [reconnect, setReconnect] = (0, import_react54.useState)(false);
17380
- const [cleanupPending, setCleanupPending] = (0, import_react54.useState)(0);
17895
+ const [version, setVersion] = (0, import_react57.useState)();
17896
+ const [inspection, setInspection] = (0, import_react57.useState)();
17897
+ const [busy, setBusy] = (0, import_react57.useState)(false), [confirm, setConfirm] = (0, import_react57.useState)(false);
17898
+ const [error, setError] = (0, import_react57.useState)(""), [notice, setNotice] = (0, import_react57.useState)("");
17899
+ const request = (0, import_react57.useRef)();
17900
+ const mounted = (0, import_react57.useRef)(true);
17901
+ const [reconnect, setReconnect] = (0, import_react57.useState)(false);
17902
+ const [cleanupPending, setCleanupPending] = (0, import_react57.useState)(0);
17381
17903
  const cleanup = version === 1 && cleanupPending > 0;
17382
17904
  const recover = async (expected = pendingStorageRecovery()) => {
17383
17905
  request.current?.abort();
@@ -17408,7 +17930,7 @@ function GeneralSettingsPanel() {
17408
17930
  if (!controller.signal.aborted) setBusy(false);
17409
17931
  }
17410
17932
  };
17411
- (0, import_react54.useEffect)(() => {
17933
+ (0, import_react57.useEffect)(() => {
17412
17934
  mounted.current = true;
17413
17935
  void recover();
17414
17936
  return () => {
@@ -17445,17 +17967,17 @@ function GeneralSettingsPanel() {
17445
17967
  }
17446
17968
  if (mounted.current) await recover(expected);
17447
17969
  };
17448
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("section", { className: "dsh-partner-general-settings", "aria-busy": busy, children: [
17449
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h2", { children: "\u57FA\u672C\u8BBE\u7F6E" }),
17450
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(AttachmentStoragePanel, {}),
17451
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(WorkspaceBlock, { className: "is-storage-migration", title: "\u5347\u7EA7\u8FC1\u79FB", detail: "\u624B\u52A8\u6574\u7406\u516C\u5171\u6570\u636E\u548C\u6BCF\u4F4D\u4F19\u4F34\u7684\u79C1\u6709\u76EE\u5F55\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6267\u884C\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("button", { type: "button", disabled: busy, onClick: () => void inspect(), children: busy ? "\u5904\u7406\u4E2D\u2026" : "\u68C0\u67E5\u8FC1\u79FB" }), children: [
17452
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("p", { children: [
17970
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("section", { className: "dsh-partner-general-settings", "aria-busy": busy, children: [
17971
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h2", { children: "\u57FA\u672C\u8BBE\u7F6E" }),
17972
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(AttachmentStoragePanel, {}),
17973
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(WorkspaceBlock, { className: "is-storage-migration", title: "\u5347\u7EA7\u8FC1\u79FB", detail: "\u624B\u52A8\u6574\u7406\u516C\u5171\u6570\u636E\u548C\u6BCF\u4F4D\u4F19\u4F34\u7684\u79C1\u6709\u76EE\u5F55\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6267\u884C\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("button", { type: "button", disabled: busy, onClick: () => void inspect(), children: busy ? "\u5904\u7406\u4E2D\u2026" : "\u68C0\u67E5\u8FC1\u79FB" }), children: [
17974
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("p", { children: [
17453
17975
  "\u6570\u636E\u5B58\u50A8\u7248\u672C\uFF1A",
17454
17976
  version === void 0 ? "\u6B63\u5728\u8BFB\u53D6\u2026" : `v${version}${version === 0 ? " \xB7 \u5F85\u8FC1\u79FB" : " \xB7 \u5DF2\u5347\u7EA7"}`
17455
17977
  ] }),
17456
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { children: "\u5347\u7EA7\u524D\u8BF7\u7ED3\u675F\u4F19\u4F34\u4F1A\u8BDD\u548C\u540E\u53F0\u6267\u884C\u3002\u5B8C\u6574\u5907\u4EFD\u5E76\u6821\u9A8C\u540E\u624D\u6E05\u7406\u5DF2\u8FC1\u79FB\u7684\u65E7\u8DEF\u5F84\uFF0C\u4E0D\u4FEE\u6539\u7528\u6237\u5DE5\u4F5C\u6587\u6863\uFF1B\u670D\u52A1\u91CD\u8F7D\u540E\u81EA\u52A8\u91CD\u65B0\u8FDE\u63A5\u3002" }),
17457
- inspection && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
17458
- inspection.steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("p", { children: [
17978
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { children: "\u5347\u7EA7\u524D\u8BF7\u7ED3\u675F\u4F19\u4F34\u4F1A\u8BDD\u548C\u540E\u53F0\u6267\u884C\u3002\u5B8C\u6574\u5907\u4EFD\u5E76\u6821\u9A8C\u540E\u624D\u6E05\u7406\u5DF2\u8FC1\u79FB\u7684\u65E7\u8DEF\u5F84\uFF0C\u4E0D\u4FEE\u6539\u7528\u6237\u5DE5\u4F5C\u6587\u6863\uFF1B\u670D\u52A1\u91CD\u8F7D\u540E\u81EA\u52A8\u91CD\u65B0\u8FDE\u63A5\u3002" }),
17979
+ inspection && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
17980
+ inspection.steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("p", { children: [
17459
17981
  "v",
17460
17982
  step.from,
17461
17983
  " \u2192 v",
@@ -17463,79 +17985,79 @@ function GeneralSettingsPanel() {
17463
17985
  " \xB7 ",
17464
17986
  step.title
17465
17987
  ] }, step.id)),
17466
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("details", { children: [
17467
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("summary", { children: "\u67E5\u770B\u76EE\u5F55\u4E0E\u68C0\u67E5\u8BE6\u60C5" }),
17468
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "dsh-partner-migration-paths", children: inspection.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { children: [
17469
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("strong", { children: item.label }),
17470
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("code", { children: item.source }),
17471
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { children: "\u8FC1\u79FB\u81F3" }),
17472
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("code", { children: item.target }),
17473
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("small", { children: item.exists ? `${item.files} \u4E2A\u6587\u4EF6 \xB7 ${(item.bytes / 1024 / 1024).toFixed(2)} MB` : "\u5F53\u524D\u65E0\u6587\u4EF6" })
17988
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("details", { children: [
17989
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("summary", { children: "\u67E5\u770B\u76EE\u5F55\u4E0E\u68C0\u67E5\u8BE6\u60C5" }),
17990
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "dsh-partner-migration-paths", children: inspection.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { children: [
17991
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("strong", { children: item.label }),
17992
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("code", { children: item.source }),
17993
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { children: "\u8FC1\u79FB\u81F3" }),
17994
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("code", { children: item.target }),
17995
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("small", { children: item.exists ? `${item.files} \u4E2A\u6587\u4EF6 \xB7 ${(item.bytes / 1024 / 1024).toFixed(2)} MB` : "\u5F53\u524D\u65E0\u6587\u4EF6" })
17474
17996
  ] }, i)) }),
17475
- inspection.notices.map((text4, i) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { children: text4 }, i))
17997
+ inspection.notices.map((text4, i) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { children: text4 }, i))
17476
17998
  ] }),
17477
- !!inspection.blockers.length && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { role: "alert", children: [
17478
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { children: "\u4EE5\u4E0B\u95EE\u9898\u9700\u8981\u5148\u5904\u7406\uFF1A" }),
17479
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("ul", { children: inspection.blockers.map((text4, i) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("li", { children: text4 }, i)) })
17999
+ !!inspection.blockers.length && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { role: "alert", children: [
18000
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { children: "\u4EE5\u4E0B\u95EE\u9898\u9700\u8981\u5148\u5904\u7406\uFF1A" }),
18001
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("ul", { children: inspection.blockers.map((text4, i) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("li", { children: text4 }, i)) })
17480
18002
  ] }),
17481
- inspection.migrationAvailable && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => setConfirm(true), children: "\u5347\u7EA7\u8FC1\u79FB" })
18003
+ inspection.migrationAvailable && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => setConfirm(true), children: "\u5347\u7EA7\u8FC1\u79FB" })
17482
18004
  ] }),
17483
- error && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { role: "alert", children: error }),
17484
- notice && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { role: "status", children: notice }),
17485
- reconnect && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("button", { type: "button", disabled: busy, onClick: () => void recover(), children: "\u91CD\u65B0\u8FDE\u63A5" }),
17486
- cleanup && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(true), children: "\u91CD\u8BD5\u6E05\u7406\u65E7\u8DEF\u5F84" })
18005
+ error && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { role: "alert", children: error }),
18006
+ notice && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { role: "status", children: notice }),
18007
+ reconnect && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("button", { type: "button", disabled: busy, onClick: () => void recover(), children: "\u91CD\u65B0\u8FDE\u63A5" }),
18008
+ cleanup && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(true), children: "\u91CD\u8BD5\u6E05\u7406\u65E7\u8DEF\u5F84" })
17487
18009
  ] }),
17488
- confirm && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(WorkspaceDialog, { title: cleanup ? "\u786E\u8BA4\u6E05\u7406\u65E7\u8DEF\u5F84" : "\u786E\u8BA4\u5347\u7EA7\u8FC1\u79FB", detail: cleanup ? "\u91CD\u65B0\u6838\u5BF9\u5B8C\u6574\u5907\u4EFD\uFF0C\u53EA\u6E05\u7406\u672A\u53D8\u5316\u7684\u65E7\u6587\u4EF6\uFF0C\u4E0D\u91CD\u65B0\u8FC1\u79FB\u6D3B\u52A8\u6570\u636E\u3002" : "\u516C\u5171\u6570\u636E\u4E0E\u6240\u6709\u4F19\u4F34\u79C1\u6709\u6570\u636E\u5C06\u4E00\u8D77\u8FC1\u79FB\uFF0C\u5168\u90E8\u6821\u9A8C\u540E\u624D\u5207\u6362\u76EE\u5F55\u7248\u672C\u3002", close: () => {
18010
+ confirm && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(WorkspaceDialog, { title: cleanup ? "\u786E\u8BA4\u6E05\u7406\u65E7\u8DEF\u5F84" : "\u786E\u8BA4\u5347\u7EA7\u8FC1\u79FB", detail: cleanup ? "\u91CD\u65B0\u6838\u5BF9\u5B8C\u6574\u5907\u4EFD\uFF0C\u53EA\u6E05\u7406\u672A\u53D8\u5316\u7684\u65E7\u6587\u4EF6\uFF0C\u4E0D\u91CD\u65B0\u8FC1\u79FB\u6D3B\u52A8\u6570\u636E\u3002" : "\u516C\u5171\u6570\u636E\u4E0E\u6240\u6709\u4F19\u4F34\u79C1\u6709\u6570\u636E\u5C06\u4E00\u8D77\u8FC1\u79FB\uFF0C\u5168\u90E8\u6821\u9A8C\u540E\u624D\u5207\u6362\u76EE\u5F55\u7248\u672C\u3002", close: () => {
17489
18011
  if (!busy) setConfirm(false);
17490
- }, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("form", { className: "dsh-partner-feature-form", onSubmit: (event) => {
18012
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("form", { className: "dsh-partner-feature-form", onSubmit: (event) => {
17491
18013
  event.preventDefault();
17492
18014
  void migrate();
17493
18015
  }, children: [
17494
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "is-wide", children: "\u5148\u5B8C\u6574\u5907\u4EFD\uFF0C\u7248\u672C\u63D0\u4EA4\u540E\u6E05\u7406\u5DF2\u6838\u9A8C\u7684\u65E7\u8DEF\u5F84\uFF1B\u5386\u53F2\u8BB0\u5FC6\u5907\u4EFD\u4F1A\u539F\u6837\u5F52\u6863\u3002\u5907\u4EFD\u4E0D\u4F1A\u81EA\u52A8\u5220\u9664\u3002\u8FC1\u79FB\u671F\u95F4\u8BF7\u52FF\u7F16\u8F91\u6587\u4EF6\u3001\u4FEE\u6539\u63D2\u4EF6\u914D\u7F6E\u6216\u542F\u52A8\u5176\u4ED6\u5B9E\u4F8B\u3002" }),
17495
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { className: "is-wide", children: "\u8D26\u53F7\u51ED\u636E\u548C\u5BBF\u4E3B\u4F1A\u8BDD\u4E0D\u642C\u52A8\u3002\u5347\u7EA7\u540E\u4E0D\u8981\u76F4\u63A5\u5B89\u88C5\u4E0D\u652F\u6301\u65B0\u7248\u5B58\u50A8\u7684\u65E7\u63D2\u4EF6\u3002" }),
17496
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("footer", { children: [
17497
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(false), children: "\u53D6\u6D88" }),
17498
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u6B63\u5728\u5904\u7406\uFF0C\u8BF7\u52FF\u5173\u95ED\u2026" : cleanup ? "\u786E\u8BA4\u6E05\u7406\u5DF2\u5907\u4EFD\u7684\u65E7\u8DEF\u5F84" : "\u786E\u8BA4\u8FC1\u79FB\u76EE\u5F55\u548C\u6570\u636E" })
18016
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "is-wide", children: "\u5148\u5B8C\u6574\u5907\u4EFD\uFF0C\u7248\u672C\u63D0\u4EA4\u540E\u6E05\u7406\u5DF2\u6838\u9A8C\u7684\u65E7\u8DEF\u5F84\uFF1B\u5386\u53F2\u8BB0\u5FC6\u5907\u4EFD\u4F1A\u539F\u6837\u5F52\u6863\u3002\u5907\u4EFD\u4E0D\u4F1A\u81EA\u52A8\u5220\u9664\u3002\u8FC1\u79FB\u671F\u95F4\u8BF7\u52FF\u7F16\u8F91\u6587\u4EF6\u3001\u4FEE\u6539\u63D2\u4EF6\u914D\u7F6E\u6216\u542F\u52A8\u5176\u4ED6\u5B9E\u4F8B\u3002" }),
18017
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "is-wide", children: "\u8D26\u53F7\u51ED\u636E\u548C\u5BBF\u4E3B\u4F1A\u8BDD\u4E0D\u642C\u52A8\u3002\u5347\u7EA7\u540E\u4E0D\u8981\u76F4\u63A5\u5B89\u88C5\u4E0D\u652F\u6301\u65B0\u7248\u5B58\u50A8\u7684\u65E7\u63D2\u4EF6\u3002" }),
18018
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("footer", { children: [
18019
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(false), children: "\u53D6\u6D88" }),
18020
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u6B63\u5728\u5904\u7406\uFF0C\u8BF7\u52FF\u5173\u95ED\u2026" : cleanup ? "\u786E\u8BA4\u6E05\u7406\u5DF2\u5907\u4EFD\u7684\u65E7\u8DEF\u5F84" : "\u786E\u8BA4\u8FC1\u79FB\u76EE\u5F55\u548C\u6570\u636E" })
17499
18021
  ] })
17500
18022
  ] }) })
17501
18023
  ] });
17502
18024
  }
17503
18025
 
17504
18026
  // src/ui/workspace-navigation.tsx
17505
- var import_jsx_runtime51 = require("react/jsx-runtime");
18027
+ var import_jsx_runtime54 = require("react/jsx-runtime");
17506
18028
  var workspaceGroups = [
17507
- { id: "features", label: "\u529F\u80FD", detail: "\u80FD\u529B\u3001\u534F\u4F5C\u4E0E\u8BA1\u5212", icon: import_dsh_client_ui_primitives24.IconBrowseOutlineRegular, pages: [
17508
- { id: "skills", label: "Skill \u5E02\u573A", icon: import_dsh_client_ui_primitives24.IconBrowseOutlineRegular },
17509
- { id: "mcp", label: "MCP \u670D\u52A1", icon: import_dsh_client_ui_primitives24.IconBrowseOutlineRegular },
17510
- { id: "board", label: "\u4EFB\u52A1\u770B\u677F", icon: import_dsh_client_ui_primitives24.IconListPenOutlineRegular },
17511
- { id: "schedules", label: "\u5B9A\u65F6\u4EFB\u52A1", icon: import_dsh_client_ui_primitives24.IconPlayOutlineRegular }
18029
+ { id: "features", label: "\u529F\u80FD", detail: "\u80FD\u529B\u3001\u534F\u4F5C\u4E0E\u8BA1\u5212", icon: import_dsh_client_ui_primitives25.IconBrowseOutlineRegular, pages: [
18030
+ { id: "skills", label: "Skill \u5E02\u573A", icon: import_dsh_client_ui_primitives25.IconBrowseOutlineRegular },
18031
+ { id: "mcp", label: "MCP \u670D\u52A1", icon: import_dsh_client_ui_primitives25.IconBrowseOutlineRegular },
18032
+ { id: "board", label: "\u4EFB\u52A1\u770B\u677F", icon: import_dsh_client_ui_primitives25.IconListPenOutlineRegular },
18033
+ { id: "schedules", label: "\u5B9A\u65F6\u4EFB\u52A1", icon: import_dsh_client_ui_primitives25.IconPlayOutlineRegular }
17512
18034
  ] },
17513
- { id: "settings", label: "\u8BBE\u7F6E", detail: "\u57FA\u672C\u8BBE\u7F6E\u4E0E\u5361\u7247\u5916\u89C2", icon: import_dsh_client_ui_primitives24.IconEditOutlineRegular, pages: [
17514
- { id: "general", label: "\u57FA\u672C\u8BBE\u7F6E", icon: import_dsh_client_ui_primitives24.IconEditOutlineRegular },
17515
- { id: "pendant", label: "\u5361\u7247\u8BBE\u7F6E", icon: import_dsh_client_ui_primitives24.IconEditOutlineRegular }
18035
+ { id: "settings", label: "\u8BBE\u7F6E", detail: "\u57FA\u672C\u8BBE\u7F6E\u4E0E\u5361\u7247\u5916\u89C2", icon: import_dsh_client_ui_primitives25.IconEditOutlineRegular, pages: [
18036
+ { id: "general", label: "\u57FA\u672C\u8BBE\u7F6E", icon: import_dsh_client_ui_primitives25.IconEditOutlineRegular },
18037
+ { id: "pendant", label: "\u5361\u7247\u8BBE\u7F6E", icon: import_dsh_client_ui_primitives25.IconEditOutlineRegular }
17516
18038
  ] }
17517
18039
  ];
17518
18040
  var workspaceGroup = (page) => workspaceGroups.find((group) => group.pages.some((item) => item.id === page));
17519
18041
  function WorkspaceGroupLinks({ view, open, compact = false }) {
17520
18042
  const active2 = workspaceGroup(view);
17521
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: workspaceGroups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("button", { type: "button", className: active2?.id === group.id ? "is-active" : "", "aria-current": active2?.id === group.id ? "page" : void 0, onClick: () => {
18043
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_jsx_runtime54.Fragment, { children: workspaceGroups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("button", { type: "button", className: active2?.id === group.id ? "is-active" : "", "aria-current": active2?.id === group.id ? "page" : void 0, onClick: () => {
17522
18044
  if (active2?.id !== group.id) open(group.pages[0].id);
17523
18045
  }, children: [
17524
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(group.icon, { size: 16 }) }),
17525
- compact ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { children: group.label }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
17526
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("strong", { children: group.label }),
17527
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("small", { children: group.detail })
18046
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(group.icon, { size: 16 }) }),
18047
+ compact ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { children: group.label }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
18048
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("strong", { children: group.label }),
18049
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("small", { children: group.detail })
17528
18050
  ] })
17529
18051
  ] }, group.id)) });
17530
18052
  }
17531
18053
  function WorkspaceGroupTabs({ view, open }) {
17532
18054
  const group = workspaceGroup(view);
17533
18055
  if (!group) return null;
17534
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("nav", { className: "dsh-partner-tabs dsh-partner-group-tabs", "aria-label": `${group.label}\u6807\u7B7E\u9875`, children: group.pages.map((page) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TabButton, { active: view === page.id, onClick: () => open(page.id), icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(page.icon, { size: 16 }), children: page.label }, page.id)) });
18056
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("nav", { className: "dsh-partner-tabs dsh-partner-group-tabs", "aria-label": `${group.label}\u6807\u7B7E\u9875`, children: group.pages.map((page) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(TabButton, { active: view === page.id, onClick: () => open(page.id), icon: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(page.icon, { size: 16 }), children: page.label }, page.id)) });
17535
18057
  }
17536
18058
 
17537
18059
  // src/client.tsx
17538
- var import_jsx_runtime52 = require("react/jsx-runtime");
18060
+ var import_jsx_runtime55 = require("react/jsx-runtime");
17539
18061
  var PLUGIN_ID = "@lemoncat7/dsh-partner";
17540
18062
  var STYLE_ID = `${PLUGIN_ID}/client`;
17541
18063
  var cssText = `${client_default}
@@ -17548,32 +18070,34 @@ ${settings_panel_default}
17548
18070
  ${memory_ui_default}
17549
18071
  ${identity_editor_default}
17550
18072
  ${form_surface_default}
17551
- ${mcp_default}`;
18073
+ ${mcp_default}
18074
+ ${interaction_theme_default}
18075
+ ${control_surfaces_default}`;
17552
18076
  var WORKSPACE_PAGES = /* @__PURE__ */ new Set(["skills", "mcp", "board", "schedules", "pendant", "general"]);
17553
18077
  var inject = ["slots", "layout", "sessions", "uiWorkspace"];
17554
18078
  function apply(ctx) {
17555
18079
  registerDecisionCards(ctx);
17556
18080
  ctx.effect(installStyles, "dsh-partner: styles");
17557
- const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(PartnerWorkspace, { ...props, controller: current2 }));
18081
+ const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(PartnerWorkspace, { ...props, controller: current2 }));
17558
18082
  if (pendingStorageRecovery() !== void 0) controller.open(void 0, { page: "general" });
17559
- ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(PartnerPendant, { controller })));
18083
+ ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(PartnerPendant, { controller })));
17560
18084
  ctx.effect(() => observePluginWorkspace(PLUGIN_ID, controller.close), "dsh-partner: exclusive workspace");
17561
18085
  ctx.effect(() => () => controller.close(), "dsh-partner: workspace lifecycle");
17562
18086
  ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({
17563
18087
  name: "sidebar.footer.action",
17564
18088
  id: "partner",
17565
18089
  order: -120
17566
- }, (props) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
18090
+ }, (props) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
17567
18091
  }
17568
18092
  function PartnerSidebar(props) {
17569
- const ref = (0, import_react55.useRef)(null);
18093
+ const ref = (0, import_react58.useRef)(null);
17570
18094
  useWorkspaceTopAnchor(ref);
17571
- const [open, setOpen] = (0, import_react55.useState)(true);
17572
- const [snapshot, setSnapshot] = (0, import_react55.useState)(cachedPartner);
18095
+ const [open, setOpen] = (0, import_react58.useState)(true);
18096
+ const [snapshot, setSnapshot] = (0, import_react58.useState)(cachedPartner);
17573
18097
  useChannelStatus(setSnapshot);
17574
- const [, update] = (0, import_react55.useState)(0);
17575
- (0, import_react55.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
17576
- (0, import_react55.useEffect)(() => {
18098
+ const [, update] = (0, import_react58.useState)(0);
18099
+ (0, import_react58.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
18100
+ (0, import_react58.useEffect)(() => {
17577
18101
  void loadPartner().then(setSnapshot).catch(() => {
17578
18102
  });
17579
18103
  }, [props.controller.isOpen()]);
@@ -17581,35 +18105,35 @@ function PartnerSidebar(props) {
17581
18105
  props.controller.open(id);
17582
18106
  if (props.wide && window.matchMedia("(max-width: 820px)").matches) props.collapse();
17583
18107
  };
17584
- if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "button", className: `dsh-partner-rail${props.controller.isOpen() ? " is-active" : ""}`, title: "\u4F19\u4F34", onClick: () => props.controller.toggle(), children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconAgentPresetOutlineRegular, { size: 18 }) }) });
17585
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
17586
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
17587
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconChevronDownOutlineRegular, { size: 14 }) }),
18108
+ if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { type: "button", className: `dsh-partner-rail${props.controller.isOpen() ? " is-active" : ""}`, title: "\u4F19\u4F34", onClick: () => props.controller.toggle(), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconAgentPresetOutlineRegular, { size: 18 }) }) });
18109
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
18110
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
18111
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconChevronDownOutlineRegular, { size: 14 }) }),
17588
18112
  "\u4F19\u4F34"
17589
18113
  ] }) }),
17590
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
17591
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconAgentPresetOutlineRegular, { size: 16 }) }),
17592
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { children: [
17593
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
17594
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("small", { children: snapshot ? `${snapshot.companions.length} \u4F4D\u4F19\u4F34 \xB7 ${snapshot.channels.filter((item) => item.runtimeStatus === "running").length} \u4E2A\u6E20\u9053\u5728\u7EBF` : "\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E\u6E20\u9053" })
18114
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
18115
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconAgentPresetOutlineRegular, { size: 16 }) }),
18116
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { children: [
18117
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
18118
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("small", { children: snapshot ? `${snapshot.companions.length} \u4F4D\u4F19\u4F34 \xB7 ${snapshot.channels.filter((item) => item.runtimeStatus === "running").length} \u4E2A\u6E20\u9053\u5728\u7EBF` : "\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E\u6E20\u9053" })
17595
18119
  ] }),
17596
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
18120
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
17597
18121
  ] }) }) })
17598
18122
  ] });
17599
18123
  }
17600
18124
  function PartnerWorkspace({ controller }) {
17601
- const [snapshot, setSnapshot] = (0, import_react55.useState)(cachedPartner);
18125
+ const [snapshot, setSnapshot] = (0, import_react58.useState)(cachedPartner);
17602
18126
  useChannelStatus(setSnapshot);
17603
- const [selectedId, setSelectedId] = (0, import_react55.useState)(() => controller.selected() ?? cachedPartner()?.companions[0]?.id);
17604
- const [view, setView] = (0, import_react55.useState)(controller.destination()?.page ?? "home");
17605
- const [requestedDestination, setRequestedDestination] = (0, import_react55.useState)(controller.destination());
17606
- const [error, setError] = (0, import_react55.useState)();
17607
- const [loading, setLoading] = (0, import_react55.useState)(() => !cachedPartner());
17608
- const [creatingCompanion, setCreatingCompanion] = (0, import_react55.useState)(false);
17609
- const [notice, setNotice] = (0, import_react55.useState)();
17610
- const selectionRef = (0, import_react55.useRef)({ selectedId, companions: snapshot?.companions });
18127
+ const [selectedId, setSelectedId] = (0, import_react58.useState)(() => controller.selected() ?? cachedPartner()?.companions[0]?.id);
18128
+ const [view, setView] = (0, import_react58.useState)(controller.destination()?.page ?? "home");
18129
+ const [requestedDestination, setRequestedDestination] = (0, import_react58.useState)(controller.destination());
18130
+ const [error, setError] = (0, import_react58.useState)();
18131
+ const [loading, setLoading] = (0, import_react58.useState)(() => !cachedPartner());
18132
+ const [creatingCompanion, setCreatingCompanion] = (0, import_react58.useState)(false);
18133
+ const [notice, setNotice] = (0, import_react58.useState)();
18134
+ const selectionRef = (0, import_react58.useRef)({ selectedId, companions: snapshot?.companions });
17611
18135
  selectionRef.current = { selectedId, companions: snapshot?.companions };
17612
- const refresh = (0, import_react55.useCallback)(async (throwOnError = false) => {
18136
+ const refresh = (0, import_react58.useCallback)(async (throwOnError = false) => {
17613
18137
  try {
17614
18138
  const next = await loadPartner();
17615
18139
  setSnapshot(next);
@@ -17622,10 +18146,10 @@ function PartnerWorkspace({ controller }) {
17622
18146
  setLoading(false);
17623
18147
  }
17624
18148
  }, []);
17625
- (0, import_react55.useEffect)(() => {
18149
+ (0, import_react58.useEffect)(() => {
17626
18150
  void refresh();
17627
18151
  }, [refresh]);
17628
- (0, import_react55.useEffect)(() => controller.subscribe(() => {
18152
+ (0, import_react58.useEffect)(() => controller.subscribe(() => {
17629
18153
  const next = controller.selected();
17630
18154
  if (next) setSelectedId(next);
17631
18155
  const destination = controller.destination();
@@ -17694,18 +18218,18 @@ function PartnerWorkspace({ controller }) {
17694
18218
  setSelectedId(id);
17695
18219
  setView("home");
17696
18220
  };
17697
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("main", { className: "dsh-partner-workspace", children: [
17698
- creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
17699
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("header", { className: "dsh-partner-topbar", children: [
17700
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
17701
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "button", "data-xiaohei-workspace-close": true, onClick: controller.close, "aria-label": "\u8FD4\u56DE\u4F1A\u8BDD", title: "\u8FD4\u56DE\u4F1A\u8BDD", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconChevronLeftOutlineRegular, { size: 15 }) }),
17702
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconAgentPresetOutlineRegular, { size: 18 }),
17703
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { children: [
17704
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: "\u4F19\u4F34" }),
17705
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u6D88\u606F\u6E20\u9053" })
18221
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("main", { className: "dsh-partner-workspace", children: [
18222
+ creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
18223
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("header", { className: "dsh-partner-topbar", children: [
18224
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
18225
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { type: "button", "data-xiaohei-workspace-close": true, onClick: controller.close, "aria-label": "\u8FD4\u56DE\u4F1A\u8BDD", title: "\u8FD4\u56DE\u4F1A\u8BDD", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconChevronLeftOutlineRegular, { size: 15 }) }),
18226
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconAgentPresetOutlineRegular, { size: 18 }),
18227
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { children: [
18228
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("strong", { children: "\u4F19\u4F34" }),
18229
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u6D88\u606F\u6E20\u9053" })
17706
18230
  ] })
17707
18231
  ] }),
17708
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
18232
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
17709
18233
  MobileWorkspaceControls,
17710
18234
  {
17711
18235
  companions: snapshot?.companions ?? [],
@@ -17717,90 +18241,90 @@ function PartnerWorkspace({ controller }) {
17717
18241
  }
17718
18242
  )
17719
18243
  ] }),
17720
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-grid", children: [
17721
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("aside", { className: "dsh-partner-roster", children: [
17722
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-roster-title", children: [
17723
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { children: [
17724
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("small", { children: "COMPANIONS" }),
17725
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
18244
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-grid", children: [
18245
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("aside", { className: "dsh-partner-roster", children: [
18246
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-roster-title", children: [
18247
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { children: [
18248
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("small", { children: "COMPANIONS" }),
18249
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
17726
18250
  ] }),
17727
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconPlusOutlineRegular, { size: 16 }) })
18251
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconPlusOutlineRegular, { size: 16 }) })
17728
18252
  ] }),
17729
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
18253
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
17730
18254
  const channel = snapshot.channels.find((item) => item.companionId === companion.id);
17731
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
17732
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Avatar, { name: companion.name }),
17733
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { children: [
17734
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: companion.name }),
17735
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("small", { children: companion.role })
18255
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
18256
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Avatar, { name: companion.name }),
18257
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { children: [
18258
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("strong", { children: companion.name }),
18259
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("small", { children: companion.role })
17736
18260
  ] }),
17737
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
18261
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
17738
18262
  ] }, companion.id);
17739
18263
  }) }),
17740
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(WorkspaceGroupLinks, { view, open: setView }) }),
17741
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-roster-note", children: [
17742
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconLinkOutlineRegular, { size: 16 }),
17743
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { children: [
17744
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
17745
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("small", { children: "\u6E20\u9053\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
18264
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(WorkspaceGroupLinks, { view, open: setView }) }),
18265
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-roster-note", children: [
18266
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconLinkOutlineRegular, { size: 16 }),
18267
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { children: [
18268
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
18269
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("small", { children: "\u6E20\u9053\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
17746
18270
  ] })
17747
18271
  ] })
17748
18272
  ] }),
17749
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
17750
- loading ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
17751
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "dsh-partner-group-heading", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h1", { children: workspaceGroup(view)?.label }) }),
17752
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(WorkspaceGroupTabs, { view, open: setView }),
17753
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
17754
- view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SkillsPanel, {}),
17755
- view === "mcp" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(McpPanel, {}),
17756
- view === "board" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(RequirementBoard, { initialTaskId: requestedDestination?.taskId, openRequest: requestedDestination }),
17757
- view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] }),
17758
- view === "pendant" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(PendantSettingsPanel, {}),
17759
- view === "general" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(GeneralSettingsPanel, {})
18273
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
18274
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
18275
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "dsh-partner-group-heading", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("h1", { children: workspaceGroup(view)?.label }) }),
18276
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(WorkspaceGroupTabs, { view, open: setView }),
18277
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
18278
+ view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SkillsPanel, {}),
18279
+ view === "mcp" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(McpPanel, {}),
18280
+ view === "board" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(RequirementBoard, { initialTaskId: requestedDestination?.taskId, openRequest: requestedDestination }),
18281
+ view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] }),
18282
+ view === "pendant" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(PendantSettingsPanel, {}),
18283
+ view === "general" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(GeneralSettingsPanel, {})
17760
18284
  ] })
17761
- ] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ContentState, { title: "\u521B\u5EFA\u7B2C\u4E00\u4E2A\u4F19\u4F34", detail: "\u4F19\u4F34\u4F1A\u4FDD\u5B58\u72EC\u7ACB\u8EAB\u4EFD\u3001\u80FD\u529B\u548C\u5FAE\u4FE1\u4F1A\u8BDD\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
17762
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-identity", children: [
17763
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Avatar, { name: selected.name }),
17764
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { children: [
17765
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("small", { children: "ACTIVE COMPANION" }),
17766
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h1", { children: selected.name }),
17767
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { children: selected.description || selected.role })
18285
+ ] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ContentState, { title: "\u521B\u5EFA\u7B2C\u4E00\u4E2A\u4F19\u4F34", detail: "\u4F19\u4F34\u4F1A\u4FDD\u5B58\u72EC\u7ACB\u8EAB\u4EFD\u3001\u80FD\u529B\u548C\u5FAE\u4FE1\u4F1A\u8BDD\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
18286
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-identity", children: [
18287
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Avatar, { name: selected.name }),
18288
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { children: [
18289
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("small", { children: "ACTIVE COMPANION" }),
18290
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("h1", { children: selected.name }),
18291
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { children: selected.description || selected.role })
17768
18292
  ] }),
17769
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
18293
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
17770
18294
  ] }),
17771
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
17772
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconAgentPresetOutlineRegular, { size: 16 }), children: "\u603B\u89C8" }),
17773
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconEditOutlineRegular, { size: 16 }), children: "\u8EAB\u4EFD" }),
17774
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconAgentPresetOutlineRegular, { size: 16 }), children: "\u80FD\u529B" }),
17775
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconLinkOutlineRegular, { size: 16 }), children: "\u6E20\u9053" }),
17776
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconDataOutlineRegular, { size: 16 }), children: "\u8BB0\u5FC6" }),
17777
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(TabButton, { active: view === "concerns", onClick: () => setView("concerns"), icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconBrowseOutlineRegular, { size: 16 }), children: "\u6301\u7EED\u5173\u6CE8" })
18295
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
18296
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconAgentPresetOutlineRegular, { size: 16 }), children: "\u603B\u89C8" }),
18297
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconEditOutlineRegular, { size: 16 }), children: "\u8EAB\u4EFD" }),
18298
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconAgentPresetOutlineRegular, { size: 16 }), children: "\u80FD\u529B" }),
18299
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconLinkOutlineRegular, { size: 16 }), children: "\u6E20\u9053" }),
18300
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconDataOutlineRegular, { size: 16 }), children: "\u8BB0\u5FC6" }),
18301
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TabButton, { active: view === "concerns", onClick: () => setView("concerns"), icon: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconBrowseOutlineRegular, { size: 16 }), children: "\u6301\u7EED\u5173\u6CE8" })
17778
18302
  ] }),
17779
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
17780
- notice && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "dsh-partner-inline-notice", role: "status", children: notice }),
17781
- view === "home" && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
17782
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(CompanionDeletion, { companion: selected, count: snapshot?.companions.length ?? 1, channelCount: snapshot.channels.filter((channel) => channel.companionId === selected.id).length, onRemoved: companionRemoved }, selected.id),
17783
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession })
18303
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
18304
+ notice && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "dsh-partner-inline-notice", role: "status", children: notice }),
18305
+ view === "home" && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
18306
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(CompanionDeletion, { companion: selected, count: snapshot?.companions.length ?? 1, channelCount: snapshot.channels.filter((channel) => channel.companionId === selected.id).length, onRemoved: companionRemoved }, selected.id),
18307
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession })
17784
18308
  ] }),
17785
- view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(IdentityEditor, { companion: selected, onChanged: () => refresh(true) }),
17786
- view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: () => refresh(true) }, selected.id),
17787
- view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ChannelsPanel, { companion: selected, snapshot, onChanged: refresh, weixin: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }) }, selected.id),
17788
- view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, startSession, renewSession, onChanged: refresh }, selected.id),
17789
- view === "concerns" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ConcernPanel, { companion: selected, snapshot, onChanged: refresh }, selected.id)
18309
+ view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(IdentityEditor, { companion: selected, onChanged: () => refresh(true) }),
18310
+ view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: () => refresh(true) }, selected.id),
18311
+ view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ChannelsPanel, { companion: selected, snapshot, onChanged: refresh, weixin: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }) }, selected.id),
18312
+ view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, startSession, renewSession, onChanged: refresh }, selected.id),
18313
+ view === "concerns" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ConcernPanel, { companion: selected, snapshot, onChanged: refresh }, selected.id)
17790
18314
  ] })
17791
18315
  ] }),
17792
- error && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
18316
+ error && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
17793
18317
  ] })
17794
18318
  ] })
17795
18319
  ] });
17796
18320
  }
17797
18321
  function MobileWorkspaceControls({ companions, selectedId, view, openCompanion, openPage, createCompanion }) {
17798
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
17799
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
17800
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
17801
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconPlusOutlineRegular, { size: 17 }) })
18322
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
18323
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
18324
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
18325
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconPlusOutlineRegular, { size: 17 }) })
17802
18326
  ] }),
17803
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(WorkspaceGroupLinks, { view, open: openPage, compact: true }) })
18327
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(WorkspaceGroupLinks, { view, open: openPage, compact: true }) })
17804
18328
  ] });
17805
18329
  }
17806
18330
  function HomePanel({ companion, snapshot, navigate, openSession, startSession, renewSession }) {
@@ -17811,91 +18335,91 @@ function HomePanel({ companion, snapshot, navigate, openSession, startSession, r
17811
18335
  const approved = channel ? snapshot.pairings.filter((item) => item.channelId === channel.id && item.status === "approved").length : 0;
17812
18336
  const capabilities = companion.capabilities.map((item) => CAPABILITY_LABELS[item]);
17813
18337
  const online = channel?.runtimeStatus === "running";
17814
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-home", children: [
17815
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("header", { className: "dsh-partner-home-heading", children: [
17816
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { children: [
17817
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
17818
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u6E20\u9053\u5F85\u547D` : `${companion.name} \u5DF2\u51C6\u5907\u5C31\u7EEA` })
18338
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-home", children: [
18339
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("header", { className: "dsh-partner-home-heading", children: [
18340
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { children: [
18341
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
18342
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u6E20\u9053\u5F85\u547D` : `${companion.name} \u5DF2\u51C6\u5907\u5C31\u7EEA` })
17819
18343
  ] }),
17820
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { children: online ? "\u6D88\u606F\u3001\u6388\u6743\u4E0E\u4E0A\u4E0B\u6587\u8FB9\u754C\u90FD\u5728\u8FD9\u91CC\u6C47\u603B\u3002" : "\u4F19\u4F34\u8EAB\u4EFD\u3001\u4F1A\u8BDD\u4E0E\u80FD\u529B\u5DF2\u7ECF\u51C6\u5907\u5B8C\u6210\u3002" })
18344
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { children: online ? "\u6D88\u606F\u3001\u6388\u6743\u4E0E\u4E0A\u4E0B\u6587\u8FB9\u754C\u90FD\u5728\u8FD9\u91CC\u6C47\u603B\u3002" : "\u4F19\u4F34\u8EAB\u4EFD\u3001\u4F1A\u8BDD\u4E0E\u80FD\u529B\u5DF2\u7ECF\u51C6\u5907\u5B8C\u6210\u3002" })
17821
18345
  ] }),
17822
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
17823
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
17824
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Avatar, { name: companion.name }),
17825
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("i", {}) }),
17826
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(WeixinGlyph, { large: true }) })
18346
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
18347
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
18348
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Avatar, { name: companion.name }),
18349
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", {}) }),
18350
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(WeixinGlyph, { large: true }) })
17827
18351
  ] }),
17828
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
17829
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
17830
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("i", {}),
18352
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
18353
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
18354
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", {}),
17831
18355
  "\u6D88\u606F\u6E20\u9053 \xB7 ",
17832
18356
  channel?.platform === "matrix" ? "Matrix" : channel?.platform === "mattermost" ? "Mattermost" : "\u5FAE\u4FE1"
17833
18357
  ] }),
17834
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h3", { children: !channel ? "\u7B49\u5F85\u626B\u7801\u8FDE\u63A5" : online ? "\u8FDE\u63A5\u6B63\u5E38\uFF0C\u6B63\u5728\u63A5\u6536\u6D88\u606F" : channel.runtimeStatus === "error" ? "\u6E20\u9053\u8FDE\u63A5\u9700\u8981\u5904\u7406" : "\u6E20\u9053\u5F53\u524D\u5DF2\u505C\u7528" }),
17835
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { children: !channel ? "\u8FDE\u63A5\u5FAE\u4FE1\u3001Matrix \u6216 Mattermost\uFF0C\u8054\u7CFB\u4EBA\u9996\u6B21\u53D1\u6D88\u606F\u9700\u6279\u51C6\u3002" : online ? "\u672C\u5730\u4E0E\u6240\u6709\u5DF2\u6388\u6743\u6E20\u9053\u5171\u7528\u4F19\u4F34\u4E3B\u5BF9\u8BDD\uFF0C\u56DE\u590D\u8FD4\u56DE\u6D88\u606F\u6765\u6E90\u3002" : channel.lastError || "\u6E20\u9053\u914D\u7F6E\u4ECD\u7136\u4FDD\u7559\uFF0C\u53EF\u4EE5\u968F\u65F6\u91CD\u65B0\u542F\u7528\u3002" }),
17836
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
17837
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "button", className: "is-primary", onClick: () => navigate("weixin"), children: !channel ? "\u8FDE\u63A5\u5FAE\u4FE1" : pending > 0 ? `\u5904\u7406 ${pending} \u4E2A\u8BF7\u6C42` : "\u7BA1\u7406\u6E20\u9053" }),
17838
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: !channel ? "\u9009\u62E9\u6E20\u9053\u5E76\u8FDE\u63A5\u8D26\u53F7" : `${approved} \u4F4D\u8054\u7CFB\u4EBA \xB7 \u5171\u7528\u4E3B\u5BF9\u8BDD` })
18358
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("h3", { children: !channel ? "\u7B49\u5F85\u626B\u7801\u8FDE\u63A5" : online ? "\u8FDE\u63A5\u6B63\u5E38\uFF0C\u6B63\u5728\u63A5\u6536\u6D88\u606F" : channel.runtimeStatus === "error" ? "\u6E20\u9053\u8FDE\u63A5\u9700\u8981\u5904\u7406" : "\u6E20\u9053\u5F53\u524D\u5DF2\u505C\u7528" }),
18359
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { children: !channel ? "\u8FDE\u63A5\u5FAE\u4FE1\u3001Matrix \u6216 Mattermost\uFF0C\u8054\u7CFB\u4EBA\u9996\u6B21\u53D1\u6D88\u606F\u9700\u6279\u51C6\u3002" : online ? "\u672C\u5730\u4E0E\u6240\u6709\u5DF2\u6388\u6743\u6E20\u9053\u5171\u7528\u4F19\u4F34\u4E3B\u5BF9\u8BDD\uFF0C\u56DE\u590D\u8FD4\u56DE\u6D88\u606F\u6765\u6E90\u3002" : channel.lastError || "\u6E20\u9053\u914D\u7F6E\u4ECD\u7136\u4FDD\u7559\uFF0C\u53EF\u4EE5\u968F\u65F6\u91CD\u65B0\u542F\u7528\u3002" }),
18360
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
18361
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { type: "button", className: "is-primary", onClick: () => navigate("weixin"), children: !channel ? "\u8FDE\u63A5\u5FAE\u4FE1" : pending > 0 ? `\u5904\u7406 ${pending} \u4E2A\u8BF7\u6C42` : "\u7BA1\u7406\u6E20\u9053" }),
18362
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { children: !channel ? "\u9009\u62E9\u6E20\u9053\u5E76\u8FDE\u63A5\u8D26\u53F7" : `${approved} \u4F4D\u8054\u7CFB\u4EBA \xB7 \u5171\u7528\u4E3B\u5BF9\u8BDD` })
17839
18363
  ] })
17840
18364
  ] })
17841
18365
  ] }),
17842
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-home-details", children: [
17843
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("section", { className: "dsh-partner-home-profile", children: [
17844
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("header", { children: [
17845
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconUserOutlineRegular, { size: 16 }) }),
17846
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
17847
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
17848
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: companion.role })
18366
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-home-details", children: [
18367
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("section", { className: "dsh-partner-home-profile", children: [
18368
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("header", { children: [
18369
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconUserOutlineRegular, { size: 16 }) }),
18370
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { children: [
18371
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
18372
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("strong", { children: companion.role })
17849
18373
  ] }),
17850
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
18374
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
17851
18375
  ] }),
17852
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
18376
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
17853
18377
  ] }),
17854
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
17855
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("header", { children: [
17856
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconAgentPresetOutlineRegular, { size: 16 }) }),
17857
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
17858
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
17859
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
18378
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
18379
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("header", { children: [
18380
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconAgentPresetOutlineRegular, { size: 16 }) }),
18381
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { children: [
18382
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
18383
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
17860
18384
  ] }),
17861
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
18385
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
17862
18386
  ] }),
17863
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
18387
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
17864
18388
  ] }),
17865
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
17866
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("header", { children: [
17867
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconDataOutlineRegular, { size: 16 }) }),
17868
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
17869
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
17870
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: localSession?.archived ? "\u4F1A\u8BDD\u5DF2\u5F52\u6863" : "\u4F19\u4F34\u4F1A\u8BDD\u5DF2\u5EFA\u7ACB" })
18389
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
18390
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("header", { children: [
18391
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconDataOutlineRegular, { size: 16 }) }),
18392
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { children: [
18393
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
18394
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("strong", { children: localSession?.archived ? "\u4F1A\u8BDD\u5DF2\u5F52\u6863" : "\u4F19\u4F34\u4F1A\u8BDD\u5DF2\u5EFA\u7ACB" })
17871
18395
  ] }),
17872
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "button", onClick: () => localSession === void 0 ? void startSession(companion.id) : localSession.archived ? void renewSession(localSession.id) : void openSession(localSession.id, localSession.sessionId), children: localSession === void 0 ? "\u5F00\u59CB\u5BF9\u8BDD" : localSession.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
18396
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { type: "button", onClick: () => localSession === void 0 ? void startSession(companion.id) : localSession.archived ? void renewSession(localSession.id) : void openSession(localSession.id, localSession.sessionId), children: localSession === void 0 ? "\u5F00\u59CB\u5BF9\u8BDD" : localSession.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
17873
18397
  ] }),
17874
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { children: localSession ? `\u6700\u8FD1\u6D3B\u52A8\u4E8E ${relativeTime(localSession.lastMessageAt)}\uFF1B\u672C\u5730\u4E0E\u6E20\u9053\u5728\u8FD9\u91CC\u63A5\u7740\u804A\u3002` : "\u4F19\u4F34\u4F1A\u8BDD\u6B63\u5728\u521D\u59CB\u5316\uFF0C\u7A0D\u540E\u5373\u53EF\u6253\u5F00\u3002" })
18398
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { children: localSession ? `\u6700\u8FD1\u6D3B\u52A8\u4E8E ${relativeTime(localSession.lastMessageAt)}\uFF1B\u672C\u5730\u4E0E\u6E20\u9053\u5728\u8FD9\u91CC\u63A5\u7740\u804A\u3002` : "\u4F19\u4F34\u4F1A\u8BDD\u6B63\u5728\u521D\u59CB\u5316\uFF0C\u7A0D\u540E\u5373\u53EF\u6253\u5F00\u3002" })
17875
18399
  ] })
17876
18400
  ] })
17877
18401
  ] });
17878
18402
  }
17879
18403
  function WeixinPanel({ companion, snapshot, onChanged }) {
17880
18404
  const channels = snapshot.channels.filter((item) => item.companionId === companion.id && (!item.platform || item.platform === "weixin"));
17881
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
17882
- channels.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("p", { className: "dsh-partner-inline-error", role: "alert", children: [
18405
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
18406
+ channels.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("p", { className: "dsh-partner-inline-error", role: "alert", children: [
17883
18407
  "\u53D1\u73B0 ",
17884
18408
  channels.length,
17885
18409
  " \u4E2A\u5386\u53F2\u5FAE\u4FE1\u6E20\u9053\u3002\u8BF7\u5148\u505C\u7528\u4E0D\u4F7F\u7528\u7684\u6E20\u9053\uFF0C\u518D\u5BF9\u9700\u8981\u4FDD\u7559\u7684\u6E20\u9053\u91CD\u65B0\u626B\u7801\uFF1B\u8054\u7CFB\u4EBA\u6388\u6743\u4E0D\u4F1A\u8DE8\u673A\u5668\u4EBA\u8FC1\u79FB\u3002"
17886
18410
  ] }),
17887
- channels.length ? channels.map((channel) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(WeixinChannelPanel, { companion, snapshot, onChanged, channel }, channel.id)) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(WeixinChannelPanel, { companion, snapshot, onChanged })
18411
+ channels.length ? channels.map((channel) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(WeixinChannelPanel, { companion, snapshot, onChanged, channel }, channel.id)) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(WeixinChannelPanel, { companion, snapshot, onChanged })
17888
18412
  ] });
17889
18413
  }
17890
18414
  function WeixinChannelPanel({ companion, snapshot, onChanged, channel }) {
17891
- const [confirmDelete, setConfirmDelete] = (0, import_react55.useState)(false);
17892
- const [login, setLogin] = (0, import_react55.useState)();
17893
- const [busy, setBusy] = (0, import_react55.useState)(false);
17894
- const [error, setError] = (0, import_react55.useState)();
17895
- const loginGeneration = (0, import_react55.useRef)(0);
17896
- const changedRef = (0, import_react55.useRef)(onChanged);
18415
+ const [confirmDelete, setConfirmDelete] = (0, import_react58.useState)(false);
18416
+ const [login, setLogin] = (0, import_react58.useState)();
18417
+ const [busy, setBusy] = (0, import_react58.useState)(false);
18418
+ const [error, setError] = (0, import_react58.useState)();
18419
+ const loginGeneration = (0, import_react58.useRef)(0);
18420
+ const changedRef = (0, import_react58.useRef)(onChanged);
17897
18421
  changedRef.current = onChanged;
17898
- (0, import_react55.useEffect)(() => {
18422
+ (0, import_react58.useEffect)(() => {
17899
18423
  if (!login || login.phase === "confirmed" || login.phase === "expired" || login.phase === "error") return;
17900
18424
  let disposed = false;
17901
18425
  let timer2;
@@ -17976,115 +18500,115 @@ function WeixinChannelPanel({ companion, snapshot, onChanged, channel }) {
17976
18500
  setError(errorMessage(reason));
17977
18501
  }
17978
18502
  };
17979
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
17980
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SectionHeading, { eyebrow: "PRIMARY CHANNEL", title: "\u5FAE\u4FE1\u6E20\u9053", detail: "\u4F7F\u7528\u5FAE\u4FE1 iLink Bot \u626B\u7801\u63A5\u5165\u3002\u6BCF\u4E2A\u673A\u5668\u4EBA\u53EA\u7ED1\u5B9A\u4E00\u4E2A\u4F19\u4F34\uFF0C\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u4FDD\u6301\u72EC\u7ACB DSH \u4F1A\u8BDD\u3002" }),
17981
- !channel && !login && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
17982
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(WeixinGlyph, { large: true }) }),
17983
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { children: [
17984
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("strong", { children: [
18503
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
18504
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SectionHeading, { eyebrow: "PRIMARY CHANNEL", title: "\u5FAE\u4FE1\u6E20\u9053", detail: "\u4F7F\u7528\u5FAE\u4FE1 iLink Bot \u626B\u7801\u63A5\u5165\u3002\u6BCF\u4E2A\u673A\u5668\u4EBA\u53EA\u7ED1\u5B9A\u4E00\u4E2A\u4F19\u4F34\uFF0C\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u4FDD\u6301\u72EC\u7ACB DSH \u4F1A\u8BDD\u3002" }),
18505
+ !channel && !login && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
18506
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(WeixinGlyph, { large: true }) }),
18507
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { children: [
18508
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("strong", { children: [
17985
18509
  "\u628A ",
17986
18510
  companion.name,
17987
18511
  " \u5E26\u5230\u5FAE\u4FE1"
17988
18512
  ] }),
17989
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { children: "\u626B\u7801\u540E\uFF0C\u673A\u5668\u4EBA\u51ED\u636E\u76F4\u63A5\u4FDD\u5B58\u8FDB DSH \u51ED\u636E\u5E93\uFF0C\u4E0D\u4F1A\u663E\u793A\u5728\u6D4F\u89C8\u5668\u6216\u666E\u901A\u914D\u7F6E\u6587\u4EF6\u4E2D\u3002" }),
17990
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("ul", { children: [
17991
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
17992
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
17993
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
18513
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { children: "\u626B\u7801\u540E\uFF0C\u673A\u5668\u4EBA\u51ED\u636E\u76F4\u63A5\u4FDD\u5B58\u8FDB DSH \u51ED\u636E\u5E93\uFF0C\u4E0D\u4F1A\u663E\u793A\u5728\u6D4F\u89C8\u5668\u6216\u666E\u901A\u914D\u7F6E\u6587\u4EF6\u4E2D\u3002" }),
18514
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("ul", { children: [
18515
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
18516
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
18517
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
17994
18518
  ] })
17995
18519
  ] }),
17996
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "button", disabled: busy, onClick: () => {
18520
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { type: "button", disabled: busy, onClick: () => {
17997
18521
  void begin();
17998
18522
  }, children: busy ? "\u6B63\u5728\u7533\u8BF7\u4E8C\u7EF4\u7801\u2026" : "\u626B\u7801\u8FDE\u63A5\u5FAE\u4FE1" })
17999
18523
  ] }),
18000
- login && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
18001
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
18002
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { children: [
18003
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("small", { children: "WECHAT ILINK BOT" }),
18004
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: login.phase === "scanned" ? "\u5DF2\u626B\u7801\uFF0C\u8BF7\u5728\u5FAE\u4FE1\u786E\u8BA4" : login.phase === "expired" ? "\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F" : login.phase === "error" ? "\u8FDE\u63A5\u5931\u8D25" : "\u4F7F\u7528\u5FAE\u4FE1\u626B\u7801" }),
18005
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { children: login.error || (login.phase === "scanned" ? "\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u542F\u52A8\u6E20\u9053\uFF0C\u4E0D\u9700\u8981\u590D\u5236 Token\u3002" : "\u4E8C\u7EF4\u7801\u7EA6 5 \u5206\u949F\u6709\u6548\u3002\u6B64\u9875\u9762\u53EF\u4EE5\u5B89\u5168\u5730\u4FDD\u6301\u6253\u5F00\u3002") }),
18006
- (login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("button", { type: "button", onClick: () => {
18524
+ login && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
18525
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
18526
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { children: [
18527
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("small", { children: "WECHAT ILINK BOT" }),
18528
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("strong", { children: login.phase === "scanned" ? "\u5DF2\u626B\u7801\uFF0C\u8BF7\u5728\u5FAE\u4FE1\u786E\u8BA4" : login.phase === "expired" ? "\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F" : login.phase === "error" ? "\u8FDE\u63A5\u5931\u8D25" : "\u4F7F\u7528\u5FAE\u4FE1\u626B\u7801" }),
18529
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { children: login.error || (login.phase === "scanned" ? "\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u542F\u52A8\u6E20\u9053\uFF0C\u4E0D\u9700\u8981\u590D\u5236 Token\u3002" : "\u4E8C\u7EF4\u7801\u7EA6 5 \u5206\u949F\u6709\u6548\u3002\u6B64\u9875\u9762\u53EF\u4EE5\u5B89\u5168\u5730\u4FDD\u6301\u6253\u5F00\u3002") }),
18530
+ (login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("button", { type: "button", onClick: () => {
18007
18531
  setLogin(void 0);
18008
18532
  void begin();
18009
18533
  }, children: [
18010
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconRefreshOutlineRegular, { size: 16 }),
18534
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconRefreshOutlineRegular, { size: 16 }),
18011
18535
  "\u91CD\u65B0\u751F\u6210"
18012
18536
  ] })
18013
18537
  ] })
18014
18538
  ] }),
18015
- channel && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
18016
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
18017
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(WeixinGlyph, { large: true }) }),
18018
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { children: [
18019
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("small", { children: "WECHAT CHANNEL" }),
18020
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: channel.name }),
18021
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { children: channel.accountId })
18539
+ channel && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
18540
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
18541
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(WeixinGlyph, { large: true }) }),
18542
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { children: [
18543
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("small", { children: "WECHAT CHANNEL" }),
18544
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("strong", { children: channel.name }),
18545
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { children: channel.accountId })
18022
18546
  ] }),
18023
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ChannelStatus, { channel }),
18024
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-weixin-actions", children: [
18025
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": channel.enabled, disabled: busy, role: "switch", "aria-checked": channel.enabled, "aria-label": channel.enabled ? "\u505C\u7528\u5FAE\u4FE1\u6E20\u9053" : "\u542F\u7528\u5FAE\u4FE1\u6E20\u9053", onClick: () => {
18547
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ChannelStatus, { channel }),
18548
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-weixin-actions", children: [
18549
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": channel.enabled, disabled: busy, role: "switch", "aria-checked": channel.enabled, "aria-label": channel.enabled ? "\u505C\u7528\u5FAE\u4FE1\u6E20\u9053" : "\u542F\u7528\u5FAE\u4FE1\u6E20\u9053", onClick: () => {
18026
18550
  void toggle();
18027
- }, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("i", {}) }),
18028
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("button", { type: "button", className: "dsh-partner-weixin-rescan", disabled: busy, title: "\u66F4\u65B0\u5F53\u524D\u673A\u5668\u4EBA\u7684\u767B\u5F55\u51ED\u636E\uFF0C\u4FDD\u7559\u8054\u7CFB\u4EBA\u6388\u6743", onClick: () => {
18551
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("i", {}) }),
18552
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("button", { type: "button", className: "dsh-partner-weixin-rescan", disabled: busy, title: "\u66F4\u65B0\u5F53\u524D\u673A\u5668\u4EBA\u7684\u767B\u5F55\u51ED\u636E\uFF0C\u4FDD\u7559\u8054\u7CFB\u4EBA\u6388\u6743", onClick: () => {
18029
18553
  void begin();
18030
18554
  }, children: [
18031
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconRefreshOutlineRegular, { size: 16 }),
18555
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconRefreshOutlineRegular, { size: 16 }),
18032
18556
  busy ? "\u8BF7\u7A0D\u5019\u2026" : "\u91CD\u65B0\u626B\u7801"
18033
18557
  ] })
18034
18558
  ] })
18035
18559
  ] }),
18036
- channel.enabled && channel.runtimeStatus === "starting" && !channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "dsh-partner-weixin-help", role: "status", children: "\u767B\u5F55\u51ED\u636E\u5DF2\u4FDD\u5B58\uFF0C\u6B63\u5728\u7B49\u5F85\u5FAE\u4FE1\u63A5\u6536\u901A\u9053\u9996\u6B21\u54CD\u5E94\u3002\u957F\u8F6E\u8BE2\u53EF\u80FD\u9700\u8981\u51E0\u5341\u79D2\uFF1B\u5411\u673A\u5668\u4EBA\u53D1\u9001\u4E00\u6761\u6D88\u606F\u53EF\u5E2E\u52A9\u786E\u8BA4\u6536\u53D1\u662F\u5426\u6B63\u5E38\uFF0C\u65E0\u9700\u91CD\u590D\u626B\u7801\u3002" }),
18037
- channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: channel.lastError }),
18038
- confirmDelete ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { role: "group", "aria-label": "\u786E\u8BA4\u5220\u9664\u5FAE\u4FE1\u6E20\u9053", children: [
18039
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("p", { className: "dsh-partner-inline-error", role: "alert", children: [
18560
+ channel.enabled && channel.runtimeStatus === "starting" && !channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "dsh-partner-weixin-help", role: "status", children: "\u767B\u5F55\u51ED\u636E\u5DF2\u4FDD\u5B58\uFF0C\u6B63\u5728\u7B49\u5F85\u5FAE\u4FE1\u63A5\u6536\u901A\u9053\u9996\u6B21\u54CD\u5E94\u3002\u957F\u8F6E\u8BE2\u53EF\u80FD\u9700\u8981\u51E0\u5341\u79D2\uFF1B\u5411\u673A\u5668\u4EBA\u53D1\u9001\u4E00\u6761\u6D88\u606F\u53EF\u5E2E\u52A9\u786E\u8BA4\u6536\u53D1\u662F\u5426\u6B63\u5E38\uFF0C\u65E0\u9700\u91CD\u590D\u626B\u7801\u3002" }),
18561
+ channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: channel.lastError }),
18562
+ confirmDelete ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { role: "group", "aria-label": "\u786E\u8BA4\u5220\u9664\u5FAE\u4FE1\u6E20\u9053", children: [
18563
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("p", { className: "dsh-partner-inline-error", role: "alert", children: [
18040
18564
  "\u786E\u8BA4\u5220\u9664 ",
18041
18565
  channel.accountId,
18042
18566
  "\uFF1F\u5C06\u79FB\u9664\u8BE5\u6E20\u9053\u51ED\u636E\u3001\u8054\u7CFB\u4EBA\u914D\u5BF9\u548C\u6E20\u9053\u4F1A\u8BDD\u5173\u8054\uFF0C\u4E0D\u4F1A\u8FC1\u79FB\u6388\u6743\uFF0C\u4E14\u4E0D\u53EF\u64A4\u9500\u3002"
18043
18567
  ] }),
18044
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-weixin-actions", children: [
18045
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirmDelete(false), children: "\u53D6\u6D88" }),
18046
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "button", disabled: busy, onClick: () => {
18568
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-weixin-actions", children: [
18569
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirmDelete(false), children: "\u53D6\u6D88" }),
18570
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { type: "button", disabled: busy, onClick: () => {
18047
18571
  void remove();
18048
18572
  }, children: busy ? "\u6B63\u5728\u5220\u9664\u2026" : "\u786E\u8BA4\u5220\u9664" })
18049
18573
  ] })
18050
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "dsh-partner-weixin-actions", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirmDelete(true), children: "\u5220\u9664\u6B64\u6E20\u9053" }) }),
18051
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
18052
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { children: [
18053
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("small", { children: "ACCESS" }),
18054
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
18574
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "dsh-partner-weixin-actions", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirmDelete(true), children: "\u5220\u9664\u6B64\u6E20\u9053" }) }),
18575
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
18576
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { children: [
18577
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("small", { children: "ACCESS" }),
18578
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
18055
18579
  ] }),
18056
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("em", { children: [
18580
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("em", { children: [
18057
18581
  pairings.filter((item) => item.status === "pending").length,
18058
18582
  " \u4E2A\u5F85\u5904\u7406"
18059
18583
  ] })
18060
18584
  ] }),
18061
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ContentState, { title: "\u7B49\u5F85\u9996\u6B21\u6D88\u606F", detail: "\u626B\u7801\u53EA\u5B8C\u6210\u673A\u5668\u4EBA\u767B\u5F55\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6388\u6743\u8054\u7CFB\u4EBA\u3002\u8BF7\u5148\u5728\u5FAE\u4FE1\u5411\u673A\u5668\u4EBA\u53D1\u9001\u4E00\u6761\u6D88\u606F\uFF0C\u518D\u56DE\u5230\u8FD9\u91CC\u70B9\u51FB\u300C\u6279\u51C6\u300D\uFF0C\u4E4B\u540E\u5373\u53EF\u5BF9\u8BDD\u3002", compact: true }) : pairings.map((pairing) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("article", { children: [
18062
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_dsh_client_ui_primitives25.IconUserOutlineRegular, { size: 16 }) }),
18063
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { children: [
18064
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("strong", { children: pairing.displayName }),
18065
- /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("small", { children: [
18585
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ContentState, { title: "\u7B49\u5F85\u9996\u6B21\u6D88\u606F", detail: "\u626B\u7801\u53EA\u5B8C\u6210\u673A\u5668\u4EBA\u767B\u5F55\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6388\u6743\u8054\u7CFB\u4EBA\u3002\u8BF7\u5148\u5728\u5FAE\u4FE1\u5411\u673A\u5668\u4EBA\u53D1\u9001\u4E00\u6761\u6D88\u606F\uFF0C\u518D\u56DE\u5230\u8FD9\u91CC\u70B9\u51FB\u300C\u6279\u51C6\u300D\uFF0C\u4E4B\u540E\u5373\u53EF\u5BF9\u8BDD\u3002", compact: true }) : pairings.map((pairing) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("article", { children: [
18586
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_dsh_client_ui_primitives26.IconUserOutlineRegular, { size: 16 }) }),
18587
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { children: [
18588
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("strong", { children: pairing.displayName }),
18589
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("small", { children: [
18066
18590
  pairing.status === "pending" ? "\u7B49\u5F85\u5BA1\u6279" : pairing.status === "approved" ? "\u5DF2\u6388\u6743\u72EC\u7ACB\u4F1A\u8BDD" : "\u5DF2\u963B\u6B62",
18067
18591
  " \xB7 ",
18068
18592
  new Date(pairing.updatedAt).toLocaleString()
18069
18593
  ] })
18070
18594
  ] }),
18071
- pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
18072
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { onClick: () => {
18595
+ pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
18596
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { onClick: () => {
18073
18597
  void actPairing(pairing.id, "blocked");
18074
18598
  }, children: "\u62D2\u7EDD" }),
18075
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { className: "is-primary", onClick: () => {
18599
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { className: "is-primary", onClick: () => {
18076
18600
  void actPairing(pairing.id, "approved");
18077
18601
  }, children: "\u6279\u51C6" })
18078
18602
  ] }),
18079
- pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { onClick: () => {
18603
+ pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { onClick: () => {
18080
18604
  void actPairing(pairing.id, "blocked");
18081
18605
  }, children: "\u64A4\u9500" }),
18082
- pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { onClick: () => {
18606
+ pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("button", { onClick: () => {
18083
18607
  void actPairing(pairing.id, "approved");
18084
18608
  }, children: "\u91CD\u65B0\u6279\u51C6" })
18085
18609
  ] }, pairing.id)) })
18086
18610
  ] }),
18087
- error && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "dsh-partner-inline-error", children: error })
18611
+ error && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "dsh-partner-inline-error", children: error })
18088
18612
  ] });
18089
18613
  }
18090
18614
  function installStyles() {