@lemoncat7/dsh-partner 1.8.3 → 1.10.2

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 (188) hide show
  1. package/README.md +36 -1
  2. package/docs/architecture.md +101 -1
  3. package/lib/agent-runtime.d.ts +11 -2
  4. package/lib/agent-runtime.d.ts.map +1 -1
  5. package/lib/agent-runtime.js +91 -66
  6. package/lib/agent-runtime.js.map +1 -1
  7. package/lib/api/features/workspace-api.d.ts +2 -0
  8. package/lib/api/features/workspace-api.d.ts.map +1 -1
  9. package/lib/api/features/workspace-api.js +49 -2
  10. package/lib/api/features/workspace-api.js.map +1 -1
  11. package/lib/api.d.ts +2 -0
  12. package/lib/api.d.ts.map +1 -1
  13. package/lib/api.js +13 -31
  14. package/lib/api.js.map +1 -1
  15. package/lib/channels/delivery-policy.d.ts +14 -0
  16. package/lib/channels/delivery-policy.d.ts.map +1 -0
  17. package/lib/channels/delivery-policy.js +82 -0
  18. package/lib/channels/delivery-policy.js.map +1 -0
  19. package/lib/channels/manager.d.ts +3 -2
  20. package/lib/channels/manager.d.ts.map +1 -1
  21. package/lib/channels/manager.js +40 -17
  22. package/lib/channels/manager.js.map +1 -1
  23. package/lib/channels/outbound-media.d.ts +6 -0
  24. package/lib/channels/outbound-media.d.ts.map +1 -0
  25. package/lib/channels/outbound-media.js +118 -0
  26. package/lib/channels/outbound-media.js.map +1 -0
  27. package/lib/client-api.d.ts +4 -0
  28. package/lib/client-api.d.ts.map +1 -1
  29. package/lib/client-api.js.map +1 -1
  30. package/lib/client.d.ts.map +1 -1
  31. package/lib/client.js +1572 -1109
  32. package/lib/client.js.map +4 -4
  33. package/lib/collaboration/composition.d.ts +3 -1
  34. package/lib/collaboration/composition.d.ts.map +1 -1
  35. package/lib/collaboration/composition.js +47 -14
  36. package/lib/collaboration/composition.js.map +1 -1
  37. package/lib/collaboration/service.d.ts +7 -0
  38. package/lib/collaboration/service.d.ts.map +1 -1
  39. package/lib/collaboration/service.js +154 -44
  40. package/lib/collaboration/service.js.map +1 -1
  41. package/lib/collaboration/task-dispatch.d.ts +18 -0
  42. package/lib/collaboration/task-dispatch.d.ts.map +1 -0
  43. package/lib/collaboration/task-dispatch.js +44 -0
  44. package/lib/collaboration/task-dispatch.js.map +1 -0
  45. package/lib/collaboration/task-recovery.d.ts +8 -0
  46. package/lib/collaboration/task-recovery.d.ts.map +1 -0
  47. package/lib/collaboration/task-recovery.js +30 -0
  48. package/lib/collaboration/task-recovery.js.map +1 -0
  49. package/lib/companions/directory-cleanup.d.ts +4 -0
  50. package/lib/companions/directory-cleanup.d.ts.map +1 -0
  51. package/lib/companions/directory-cleanup.js +77 -0
  52. package/lib/companions/directory-cleanup.js.map +1 -0
  53. package/lib/companions/removal.d.ts +20 -0
  54. package/lib/companions/removal.d.ts.map +1 -0
  55. package/lib/companions/removal.js +84 -0
  56. package/lib/companions/removal.js.map +1 -0
  57. package/lib/companions/service.d.ts +3 -0
  58. package/lib/companions/service.d.ts.map +1 -1
  59. package/lib/companions/service.js +4 -0
  60. package/lib/companions/service.js.map +1 -1
  61. package/lib/companions/session-configuration.js +1 -1
  62. package/lib/companions/session-configuration.js.map +1 -1
  63. package/lib/companions/workspace-cleanup.d.ts +4 -0
  64. package/lib/companions/workspace-cleanup.d.ts.map +1 -0
  65. package/lib/companions/workspace-cleanup.js +37 -0
  66. package/lib/companions/workspace-cleanup.js.map +1 -0
  67. package/lib/daily-review.d.ts +1 -0
  68. package/lib/daily-review.d.ts.map +1 -1
  69. package/lib/daily-review.js +3 -0
  70. package/lib/daily-review.js.map +1 -1
  71. package/lib/domain.d.ts +2 -0
  72. package/lib/domain.d.ts.map +1 -1
  73. package/lib/domain.js.map +1 -1
  74. package/lib/execution/agent-support.d.ts.map +1 -1
  75. package/lib/execution/agent-support.js +27 -3
  76. package/lib/execution/agent-support.js.map +1 -1
  77. package/lib/execution/service.d.ts +1 -0
  78. package/lib/execution/service.d.ts.map +1 -1
  79. package/lib/execution/service.js +10 -0
  80. package/lib/execution/service.js.map +1 -1
  81. package/lib/heartbeat.d.ts +1 -0
  82. package/lib/heartbeat.d.ts.map +1 -1
  83. package/lib/heartbeat.js +3 -0
  84. package/lib/heartbeat.js.map +1 -1
  85. package/lib/index.d.ts.map +1 -1
  86. package/lib/index.js +22 -11
  87. package/lib/index.js.map +1 -1
  88. package/lib/pendant/renderer.d.ts +1 -0
  89. package/lib/pendant/renderer.d.ts.map +1 -1
  90. package/lib/pendant/renderer.js +4 -0
  91. package/lib/pendant/renderer.js.map +1 -1
  92. package/lib/pendant/widget.js +3 -1
  93. package/lib/pendant/widget.js.map +1 -1
  94. package/lib/pendant-renderer.js +6 -6
  95. package/lib/requirements/archive.d.ts +4 -0
  96. package/lib/requirements/archive.d.ts.map +1 -0
  97. package/lib/requirements/archive.js +14 -0
  98. package/lib/requirements/archive.js.map +1 -0
  99. package/lib/requirements/consolidation.d.ts +11 -0
  100. package/lib/requirements/consolidation.d.ts.map +1 -0
  101. package/lib/requirements/consolidation.js +50 -0
  102. package/lib/requirements/consolidation.js.map +1 -0
  103. package/lib/requirements/domain.d.ts +41 -0
  104. package/lib/requirements/domain.d.ts.map +1 -0
  105. package/lib/requirements/domain.js +2 -0
  106. package/lib/requirements/domain.js.map +1 -0
  107. package/lib/requirements/progress.d.ts +7 -0
  108. package/lib/requirements/progress.d.ts.map +1 -0
  109. package/lib/requirements/progress.js +17 -0
  110. package/lib/requirements/progress.js.map +1 -0
  111. package/lib/requirements/service.d.ts +23 -0
  112. package/lib/requirements/service.d.ts.map +1 -0
  113. package/lib/requirements/service.js +163 -0
  114. package/lib/requirements/service.js.map +1 -0
  115. package/lib/requirements/tool.d.ts +5 -0
  116. package/lib/requirements/tool.d.ts.map +1 -0
  117. package/lib/requirements/tool.js +49 -0
  118. package/lib/requirements/tool.js.map +1 -0
  119. package/lib/requirements/worker.d.ts +30 -0
  120. package/lib/requirements/worker.d.ts.map +1 -0
  121. package/lib/requirements/worker.js +164 -0
  122. package/lib/requirements/worker.js.map +1 -0
  123. package/lib/skills/builtin.d.ts.map +1 -1
  124. package/lib/skills/builtin.js +3 -2
  125. package/lib/skills/builtin.js.map +1 -1
  126. package/lib/skills/service.js +1 -1
  127. package/lib/skills/service.js.map +1 -1
  128. package/lib/skills/task-planning.d.ts +5 -0
  129. package/lib/skills/task-planning.d.ts.map +1 -0
  130. package/lib/skills/task-planning.js +47 -0
  131. package/lib/skills/task-planning.js.map +1 -0
  132. package/lib/store.d.ts +3 -0
  133. package/lib/store.d.ts.map +1 -1
  134. package/lib/store.js +10 -0
  135. package/lib/store.js.map +1 -1
  136. package/lib/tasks/context.d.ts +8 -0
  137. package/lib/tasks/context.d.ts.map +1 -0
  138. package/lib/tasks/context.js +48 -0
  139. package/lib/tasks/context.js.map +1 -0
  140. package/lib/tasks/domain.d.ts +12 -0
  141. package/lib/tasks/domain.d.ts.map +1 -1
  142. package/lib/tasks/progress-notifier.d.ts +4 -0
  143. package/lib/tasks/progress-notifier.d.ts.map +1 -0
  144. package/lib/tasks/progress-notifier.js +20 -0
  145. package/lib/tasks/progress-notifier.js.map +1 -0
  146. package/lib/tasks/removal.d.ts +5 -0
  147. package/lib/tasks/removal.d.ts.map +1 -0
  148. package/lib/tasks/removal.js +44 -0
  149. package/lib/tasks/removal.js.map +1 -0
  150. package/lib/tasks/requirement-link.d.ts +4 -0
  151. package/lib/tasks/requirement-link.d.ts.map +1 -0
  152. package/lib/tasks/requirement-link.js +11 -0
  153. package/lib/tasks/requirement-link.js.map +1 -0
  154. package/lib/tasks/service.d.ts +13 -5
  155. package/lib/tasks/service.d.ts.map +1 -1
  156. package/lib/tasks/service.js +113 -29
  157. package/lib/tasks/service.js.map +1 -1
  158. package/lib/ui/board-refresh.d.ts +3 -0
  159. package/lib/ui/board-refresh.d.ts.map +1 -0
  160. package/lib/ui/board-refresh.js +42 -0
  161. package/lib/ui/board-refresh.js.map +1 -0
  162. package/lib/ui/identity-editor.d.ts +11 -0
  163. package/lib/ui/identity-editor.d.ts.map +1 -0
  164. package/lib/ui/identity-editor.js +78 -0
  165. package/lib/ui/identity-editor.js.map +1 -0
  166. package/lib/ui/requirement-board.d.ts +5 -0
  167. package/lib/ui/requirement-board.d.ts.map +1 -0
  168. package/lib/ui/requirement-board.js +47 -0
  169. package/lib/ui/requirement-board.js.map +1 -0
  170. package/lib/ui/requirement-dialog.d.ts +15 -0
  171. package/lib/ui/requirement-dialog.d.ts.map +1 -0
  172. package/lib/ui/requirement-dialog.js +53 -0
  173. package/lib/ui/requirement-dialog.js.map +1 -0
  174. package/lib/ui/requirement-tasks-panel.d.ts +8 -0
  175. package/lib/ui/requirement-tasks-panel.d.ts.map +1 -0
  176. package/lib/ui/requirement-tasks-panel.js +269 -0
  177. package/lib/ui/requirement-tasks-panel.js.map +1 -0
  178. package/lib/ui/task-board-panel.d.ts +2 -4
  179. package/lib/ui/task-board-panel.d.ts.map +1 -1
  180. package/lib/ui/task-board-panel.js +2 -283
  181. package/lib/ui/task-board-panel.js.map +1 -1
  182. package/lib/ui/task-board-stage.d.ts +12 -0
  183. package/lib/ui/task-board-stage.d.ts.map +1 -0
  184. package/lib/ui/task-board-stage.js +13 -0
  185. package/lib/ui/task-board-stage.js.map +1 -0
  186. package/lib/ui/workspace-components.js +1 -1
  187. package/lib/ui/workspace-components.js.map +1 -1
  188. package/package.json +1 -1
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_react19 = require("react");
38
+ var import_react24 = 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_primitives12 = require("@deepseek-ai/dsh-client-ui-primitives");
57
+ var import_dsh_client_ui_primitives16 = 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);
@@ -1336,7 +1336,7 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
1336
1336
 
1337
1337
  /* Skills, board and schedule modules share the partner workspace scale. */
1338
1338
  .dsh-partner-feature-page { display: grid; width: min(100%, 1180px); align-content: start; gap: 18px; margin: 0 auto; padding: 26px clamp(22px, 4vw, 52px) 52px; font: var(--partner-font-body)/1.5 var(--partner-font-family); }
1339
- .dsh-partner-feature-page.is-board { width: min(100%, 1180px); }
1339
+ .dsh-partner-feature-page.is-board { width: min(100%, 1480px); gap: 12px; }
1340
1340
  .dsh-partner-feature-hero { display: flex; min-height: 86px; align-items: end; justify-content: space-between; gap: 24px; padding: 0 2px 16px 14px; border-bottom: 1px solid var(--partner-border); }
1341
1341
  .dsh-partner-feature-hero > span { position: relative; display: grid; min-width: 0; gap: 4px; }
1342
1342
  .dsh-partner-feature-hero > span::before { position: absolute; top: 3px; bottom: 2px; left: -14px; width: 2px; border-radius: 2px; background: linear-gradient(var(--partner-text-secondary), transparent 92%); content: ''; }
@@ -1349,6 +1349,7 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
1349
1349
  .dsh-partner-feature-block > header button,
1350
1350
  .dsh-partner-market-grid button,
1351
1351
  .dsh-partner-board button,
1352
+ :where(.dsh-partner-feature-page.is-board) button,
1352
1353
  .dsh-partner-schedule-list button,
1353
1354
  .dsh-partner-feature-form button,
1354
1355
  .dsh-partner-task-form button,
@@ -1475,6 +1476,8 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
1475
1476
  .dsh-partner-board-live > i { width: 7px; height: 7px; border-radius: 50%; background: var(--partner-success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--partner-success) 10%, transparent); }
1476
1477
  .dsh-partner-board-tools { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(140px, 180px) auto; align-items: center; gap: 8px; }
1477
1478
  .dsh-partner-board-search { position: relative; display: flex; min-width: 0; align-items: center; }
1479
+ .dsh-partner-feature-page.is-board .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
1480
+ .dsh-partner-board-assignee.is-mobile-stage { display: none; }
1478
1481
  .dsh-partner-board-search > span:not(.sr-only) { position: absolute; z-index: 1; left: 11px; display: grid; place-items: center; color: var(--partner-text-tertiary); pointer-events: none; }
1479
1482
  .dsh-partner-board-search > input,
1480
1483
  .dsh-partner-board-assignee > select { width: 100%; min-height: 38px; border: 1px solid var(--partner-border); border-radius: 10px; color: var(--partner-text); background-color: var(--partner-control); font: var(--partner-font-body)/1.4 var(--partner-font-family); transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease; }
@@ -1493,19 +1496,21 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
1493
1496
  .dsh-partner-board-statuses > button:hover { border-color: var(--partner-border); color: var(--partner-text); background: var(--partner-hover); }
1494
1497
  .dsh-partner-board-statuses > button.is-active { border-color: color-mix(in srgb, var(--partner-text) 18%, var(--partner-border)); color: var(--partner-text); background: var(--partner-selected); }
1495
1498
  .dsh-partner-board-statuses b { min-width: 18px; color: inherit; font-size: inherit; font-variant-numeric: tabular-nums; font-weight: 650; text-align: center; }
1496
- .dsh-partner-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); align-items: start; gap: 10px; min-width: 0; }
1497
- .dsh-partner-board[data-focused="true"] { grid-template-columns: minmax(0, 1fr); }
1498
- .dsh-partner-board > section { display: grid; height: clamp(220px, 27vh, 280px); min-width: 0; grid-template-rows: auto minmax(0, 1fr); align-content: start; gap: 9px; padding: 11px 9px 9px 11px; border: 1px solid var(--partner-border); border-radius: 14px; background: color-mix(in srgb, var(--partner-raised) 66%, transparent); }
1499
- .dsh-partner-board > section[data-empty="true"] { height: 132px; }
1500
- .dsh-partner-board[data-focused="true"] > section { height: clamp(340px, 54vh, 560px); }
1501
- .dsh-partner-board[data-focused="true"] > section[data-empty="true"] { height: 240px; }
1502
- .dsh-partner-board > section > header { display: flex; min-height: 36px; align-items: center; justify-content: space-between; padding: 0 3px; }
1499
+ .dsh-partner-board { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 10px; min-width: 0; }
1500
+ .dsh-partner-board > section { display: grid; min-width: 0; align-content: start; padding: 8px 10px 10px; border: 1px solid var(--partner-border); border-radius: 14px; background: color-mix(in srgb, var(--partner-raised) 66%, transparent); }
1501
+ .dsh-partner-board > section > header { display: flex; min-height: 36px; align-items: center; padding: 0 0 6px; }
1502
+ .dsh-partner-board .dsh-partner-board-stage-toggle { display: flex; width: 100%; min-height: 32px; align-items: center; justify-content: flex-start; gap: 8px; padding: 4px; border: 0; border-radius: 7px; color: var(--partner-text); background: transparent; text-align: left; box-shadow: none; }
1503
+ .dsh-partner-board-stage-toggle:hover:not(:disabled) { background: var(--partner-hover); }
1504
+ .dsh-partner-board-stage-toggle[aria-expanded="true"] > svg { transform: rotate(90deg); }
1505
+ .dsh-partner-board > section > [hidden] { display: none; }
1503
1506
  .dsh-partner-board > section > header strong { font-size: var(--partner-font-label); font-weight: 620; }
1504
1507
  .dsh-partner-board > section > header b { display: grid; min-width: 22px; height: 22px; place-items: center; padding: 0 5px; border-radius: 7px; color: var(--partner-text-tertiary); background: var(--partner-selected); font-size: var(--partner-font-caption); }
1505
- .dsh-partner-board-column-list { display: grid; min-height: 0; grid-auto-rows: max-content; align-content: start; gap: 7px; overflow-y: auto; padding: 1px 3px 6px 0; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; }
1506
- .dsh-partner-board > section > p { align-self: center; margin: 0 0 22px; color: var(--partner-text-tertiary); font-size: var(--partner-font-body); text-align: center; }
1507
- .dsh-partner-task-card { position: relative; display: grid; min-height: 82px; overflow: hidden; border: 1px solid var(--partner-separator); border-radius: 11px; background: var(--partner-raised); box-shadow: var(--partner-shadow-sm); transition: border-color .16s ease, box-shadow .18s ease, transform .16s var(--partner-ease-out); }
1508
- .dsh-partner-task-card:hover { border-color: color-mix(in srgb, var(--partner-text) 22%, var(--partner-border)); box-shadow: var(--partner-shadow-md); transform: translateY(-1px); }
1508
+ .dsh-partner-board-column-list { display: grid; min-width: 0; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); align-items: stretch; align-content: start; gap: 8px; }
1509
+ .dsh-partner-board-empty { margin: 0; padding: 0 4px 2px; color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); }
1510
+ .dsh-partner-board-more { display: block; margin: 8px auto 0; min-height: 32px; padding: 4px 12px; border: 1px solid var(--partner-border); border-radius: 8px; background: transparent; color: var(--partner-text-secondary); box-shadow: none !important; }
1511
+ .dsh-partner-board-more:hover { background: var(--partner-hover); }
1512
+ .dsh-partner-task-card { position: relative; display: grid; min-height: 82px; overflow: hidden; border: 1px solid var(--partner-separator); border-radius: 11px; background: var(--partner-raised); box-shadow: none; transition: border-color .16s ease; }
1513
+ .dsh-partner-task-card:hover { border-color: color-mix(in srgb, var(--partner-text) 22%, var(--partner-border)); }
1509
1514
  .dsh-partner-task-card:focus-within { border-color: var(--partner-focus-ring); box-shadow: 0 0 0 2px color-mix(in srgb, var(--partner-focus-ring) 18%, transparent), var(--partner-shadow-md); }
1510
1515
  .dsh-partner-task-card[data-blocked="true"] { border-left-color: color-mix(in srgb, var(--partner-warning) 55%, var(--partner-border)); }
1511
1516
  .dsh-partner-task-summary { display: grid !important; min-height: 82px !important; grid-template-columns: minmax(0, 1fr) 16px; align-items: center !important; gap: 8px !important; padding: 10px 10px 10px 11px !important; border: 0 !important; border-radius: 0 !important; appearance: none; color: var(--partner-text) !important; background: transparent !important; box-shadow: none !important; font-family: var(--partner-font-family); text-align: left; cursor: pointer; }
@@ -1645,7 +1650,6 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
1645
1650
  .dsh-partner-board-assignee > select { min-height: 42px; }
1646
1651
  .dsh-partner-board-statuses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
1647
1652
  .dsh-partner-board-statuses > button { min-width: 0; justify-content: center; padding-inline: 6px; }
1648
- .dsh-partner-board > section, .dsh-partner-board[data-focused="true"] > section { height: min(430px, 58vh); }
1649
1653
  .dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form { grid-template-columns: 1fr; padding: 14px; }
1650
1654
  :is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > label { grid-column: 1 !important; }
1651
1655
  .dsh-partner-task-form-dependencies > div { grid-template-columns: 1fr; }
@@ -2613,7 +2617,10 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
2613
2617
  `;
2614
2618
 
2615
2619
  // src/ui/workspace-ui.css
2616
- var workspace_ui_default = '.dsh-partner-feature-hero-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }\n.dsh-partner-feature-page { gap: 20px; }\n.dsh-partner-feature-hero { min-height: 92px; padding-bottom: 18px; }\n.dsh-partner-feature-hero p { max-width: 62ch; text-wrap: pretty; }\n.dsh-partner-feature-block { gap: 16px; padding: 20px; border-radius: 18px; box-shadow: inset 0 1px 0 var(--partner-card-highlight), 0 5px 16px color-mix(in srgb, var(--partner-text) 4%, transparent); }\n.dsh-partner-feature-block > header { min-height: 40px; }\n.dsh-partner-feature-block > header strong { font-size: var(--partner-font-label); letter-spacing: -.01em; }\n.dsh-partner-feature-block > header small { margin-top: 1px; }\n\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) :where(input, textarea, select) { outline: 0; }\n.dsh-partner-workspace select:not([multiple]) {\n appearance: none;\n padding-right: 32px;\n border-color: var(--partner-border);\n border-radius: 9px;\n color: var(--partner-text);\n background-color: var(--partner-control);\n background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);\n background-position: calc(100% - 15px) calc(50% - 1px), calc(100% - 11px) calc(50% - 1px);\n background-repeat: no-repeat;\n background-size: 4px 4px, 4px 4px;\n box-shadow: inset 0 1px 0 color-mix(in srgb, var(--partner-card-highlight) 54%, transparent), inset 0 -1px 0 var(--partner-glass-rim-shadow);\n font-family: var(--partner-font-family);\n font-size: var(--partner-font-body);\n font-weight: 520;\n cursor: pointer;\n transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;\n}\n.dsh-partner-workspace select:not([multiple]):hover:not(:disabled) { border-color: color-mix(in srgb, var(--partner-text) 24%, var(--partner-border)); background-color: var(--partner-hover); }\n.dsh-partner-workspace select:not([multiple]):focus-visible { border-color: var(--partner-focus-ring); background-color: var(--partner-raised); box-shadow: 0 0 0 3px color-mix(in srgb, var(--partner-focus-ring) 16%, transparent), inset 0 1px 0 color-mix(in srgb, var(--partner-card-highlight) 66%, transparent); }\n.dsh-partner-workspace select:not([multiple]):disabled { cursor: not-allowed; }\n.dsh-partner-workspace select option { color: var(--partner-text); background: var(--partner-solid-control); font: inherit; }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > footer { align-items: center; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--partner-separator); }\n.dsh-partner-form-footer-spacer { flex: 1; }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > footer .is-primary { color: var(--partner-on-accent); border-color: var(--partner-accent-strong); background: var(--partner-accent-strong); }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > footer .is-primary:hover { color: var(--partner-on-accent); border-color: var(--partner-accent-strong); background: color-mix(in srgb, var(--partner-accent-strong) 88%, #000); }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > .dsh-partner-workspace-notice { grid-column: 1 / -1; margin: 0; }\n.dsh-partner-feature-page button:disabled { cursor: not-allowed; opacity: .48; }\n.dsh-partner-identity-danger > div { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }\n.dsh-partner-identity-danger[data-confirming="true"] { margin-inline: -12px; padding: 16px 12px 0; border-top-color: color-mix(in srgb, var(--partner-danger) 30%, var(--partner-border)); background: color-mix(in srgb, var(--partner-danger) 4%, transparent); }\n.dsh-partner-identity-danger button.is-secondary { border-color: var(--partner-border); color: var(--partner-text-secondary); background: var(--partner-control); }\n.dsh-partner-identity-danger button.is-danger { color: var(--partner-on-accent); border-color: var(--partner-danger); background: var(--partner-danger); }\n.dsh-partner-profile-entries article > header button.is-danger { color: var(--partner-danger); background: color-mix(in srgb, var(--partner-danger) 8%, transparent); }\n\n.dsh-partner-skill-installed > article,\n.dsh-partner-market-grid > article,\n.dsh-partner-schedule-list > article { transition: border-color 150ms ease, background-color 150ms ease, transform 180ms var(--partner-ease-out); }\n.dsh-partner-skill-installed > article:hover,\n.dsh-partner-schedule-list > article:hover { border-color: color-mix(in srgb, var(--partner-text) 20%, var(--partner-border)); background: color-mix(in srgb, var(--partner-hover) 60%, var(--partner-raised)); transform: translate3d(0, -1px, 0); }\n.dsh-partner-schedule-meta { display: flex !important; align-items: center; flex-wrap: wrap; gap: 5px 10px !important; margin-top: 2px; }\n.dsh-partner-schedule-meta > em { position: relative; color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); font-style: normal; font-variant-numeric: tabular-nums; }\n.dsh-partner-schedule-meta > em + em::before { position: absolute; top: 50%; left: -6px; width: 2px; height: 2px; border-radius: 50%; background: var(--partner-text-tertiary); content: ""; }\n.dsh-partner-run-list > article { border-radius: 9px; transition: background-color 140ms ease; }\n.dsh-partner-run-list > article:hover { background: var(--partner-hover); }\n.dsh-partner-board > section { border-radius: 16px; }\n.dsh-partner-task-card { box-shadow: none; }\n.dsh-partner-task-card[data-expanded="true"] { box-shadow: 0 6px 18px color-mix(in srgb, var(--partner-text) 6%, transparent); }\n\n@media (hover: hover) {\n .dsh-partner-skill-installed .is-icon,\n .dsh-partner-schedule-list .is-icon { opacity: .34; transition: opacity 140ms ease, color 140ms ease, background-color 140ms ease; }\n .dsh-partner-skill-installed > article:hover .is-icon,\n .dsh-partner-schedule-list > article:hover .is-icon,\n .dsh-partner-skill-installed .is-icon:focus-visible,\n .dsh-partner-schedule-list .is-icon:focus-visible { opacity: 1; }\n}\n\n.dsh-partner-workspace-dialog-layer { position: absolute; z-index: 12; inset: 0; display: flex; align-items: center; justify-content: center; padding: clamp(16px, 3vw, 32px); background: var(--partner-dialog-veil); }\n.dsh-partner-workspace-dialog { position: relative; inset: auto; display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(560px, 100%); max-width: none; height: auto; max-height: min(680px, 100%); margin: 0; padding: 0; overflow: hidden; border: 1px solid color-mix(in srgb, var(--partner-text) 18%, var(--partner-border)); border-radius: 16px; color: var(--partner-text); background: var(--partner-solid-panel); 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); animation: dsh-partner-dialog-enter 200ms var(--partner-ease-out) both; }\n.dsh-partner-workspace-dialog.is-wide { width: min(680px, 100%); max-height: min(720px, 100%); }\n.dsh-partner-workspace-dialog > header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 20px; padding: 22px 22px 18px; border-bottom: 1px solid var(--partner-separator); background: var(--partner-solid-raised); }\n.dsh-partner-workspace-dialog > header > span { display: grid; gap: 5px; min-width: 0; }\n.dsh-partner-workspace-dialog > header small { color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); font-weight: 680; letter-spacing: .09em; }\n.dsh-partner-workspace-dialog > header strong { font-size: var(--partner-font-title); line-height: 1.25; font-weight: 660; letter-spacing: -.025em; text-wrap: balance; }\n.dsh-partner-workspace-dialog > header p { max-width: 58ch; margin: 0; color: var(--partner-text-secondary); font-size: var(--partner-font-body); line-height: 1.55; text-wrap: pretty; }\n.dsh-partner-workspace-dialog > header button { display: grid; place-items: center; width: 32px; min-height: 32px; padding: 0; border: 1px solid transparent; border-radius: 9px; color: var(--partner-text-tertiary); background: transparent; box-shadow: none; cursor: pointer; transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease, transform 140ms var(--partner-ease-out); }\n.dsh-partner-workspace-dialog > header button:hover { border-color: var(--partner-border); color: var(--partner-text); background: var(--partner-hover); }\n.dsh-partner-workspace-dialog > header button:active { transform: scale(.94); }\n.dsh-partner-workspace-dialog-body { min-width: 0; min-height: 0; overflow: auto; padding: 20px 22px 24px; overscroll-behavior: contain; scrollbar-gutter: stable; }\n.dsh-partner-workspace-dialog-body > :is(form, .dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }\n.dsh-partner-workspace-dialog-body > :is(form, .dsh-partner-task-detail) > footer:last-child { position: sticky; z-index: 2; bottom: -24px; margin: 4px -22px -24px; padding: 14px 22px; border-top: 1px solid var(--partner-separator); background: var(--partner-solid-raised); box-shadow: 0 -10px 24px color-mix(in srgb, #000 5%, transparent); }\n\n.dsh-partner-workspace-notice { display: grid; grid-template-columns: 7px minmax(0, 1fr); align-items: start; gap: 10px; margin: 0 0 14px; padding: 11px 13px; border: 1px solid var(--partner-border); border-radius: 10px; color: var(--partner-text-secondary); background: var(--partner-control); font-size: var(--partner-font-body); line-height: 1.5; }\n.dsh-partner-workspace-notice > i { width: 7px; height: 7px; margin-top: .42em; border-radius: 50%; background: var(--partner-text-tertiary); }\n.dsh-partner-workspace-notice.is-error { border-color: color-mix(in srgb, var(--partner-danger) 30%, var(--partner-border)); color: var(--partner-danger); }\n.dsh-partner-workspace-notice.is-error > i { background: var(--partner-danger); }\n.dsh-partner-workspace-notice.is-warning > i { background: var(--partner-warning); }\n.dsh-partner-workspace-notice.is-success > i { background: var(--partner-success); }\n\n.dsh-partner-collection-empty { display: grid; justify-items: center; padding: 38px 24px 42px; color: var(--partner-text-secondary); text-align: center; }\n.dsh-partner-collection-empty > span { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 12px; border: 1px solid var(--partner-border); border-radius: 13px; color: var(--partner-text-tertiary); background: var(--partner-control); }\n.dsh-partner-collection-empty > strong { color: var(--partner-text); font-size: var(--partner-font-label); font-weight: 620; }\n.dsh-partner-collection-empty > p { max-width: 46ch; margin: 6px 0 14px; color: var(--partner-text-tertiary); font-size: var(--partner-font-body); line-height: 1.55; text-wrap: pretty; }\n.dsh-partner-collection-empty > button { margin-top: 14px; }\n\n.dsh-partner-collection-skeleton { display: grid; gap: 8px; padding: 6px 0; }\n.dsh-partner-collection-skeleton > i { display: block; height: 68px; overflow: hidden; border: 1px solid var(--partner-border); border-radius: 12px; background: linear-gradient(100deg, var(--partner-control) 20%, var(--partner-hover) 38%, var(--partner-control) 56%); background-size: 220% 100%; animation: dsh-partner-skeleton 1.4s ease-in-out infinite; }\n\n.dsh-partner-count-label { display: inline-flex; align-items: baseline; gap: 5px; color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); font-variant-numeric: tabular-nums; }\n.dsh-partner-count-label > b { color: var(--partner-text); font-size: var(--partner-font-label); font-weight: 650; }\n\n@keyframes dsh-partner-dialog-enter { from { opacity: 0; transform: translate3d(0, 10px, 0) scale(.985); } to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); } }\n@keyframes dsh-partner-skeleton { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }\n\n@media (max-width: 760px) {\n .dsh-partner-workspace-dialog-layer { align-items: stretch; padding: 0; }\n .dsh-partner-workspace-dialog, .dsh-partner-workspace-dialog.is-wide { width: 100%; height: 100%; max-height: none; border-width: 0; border-radius: 0; }\n .dsh-partner-workspace-dialog > header { padding: 18px 18px 15px; }\n .dsh-partner-workspace-dialog-body { padding: 18px 18px 26px; }\n .dsh-partner-workspace-dialog-body > :is(form, .dsh-partner-task-detail) > footer:last-child { bottom: -26px; margin: 4px -18px -26px; padding: 13px 18px max(13px, env(safe-area-inset-bottom)); }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dsh-partner-workspace-dialog, .dsh-partner-collection-skeleton > i { animation: none; }\n}\n';
2620
+ var workspace_ui_default = '.dsh-partner-feature-hero-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }\n.dsh-partner-feature-page { gap: 20px; }\n.dsh-partner-feature-hero { min-height: 92px; padding-bottom: 18px; }\n.dsh-partner-feature-hero p { max-width: 62ch; text-wrap: pretty; }\n.dsh-partner-feature-block { gap: 16px; padding: 20px; border-radius: 18px; box-shadow: inset 0 1px 0 var(--partner-card-highlight), 0 5px 16px color-mix(in srgb, var(--partner-text) 4%, transparent); }\n.dsh-partner-feature-block > header { min-height: 40px; }\n.dsh-partner-feature-block > header strong { font-size: var(--partner-font-label); letter-spacing: -.01em; }\n.dsh-partner-feature-block > header small { margin-top: 1px; }\n\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) :where(input, textarea, select) { outline: 0; }\n.dsh-partner-workspace select:not([multiple]) {\n appearance: none;\n padding-right: 32px;\n border-color: var(--partner-border);\n border-radius: 9px;\n color: var(--partner-text);\n background-color: var(--partner-control);\n background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);\n background-position: calc(100% - 15px) calc(50% - 1px), calc(100% - 11px) calc(50% - 1px);\n background-repeat: no-repeat;\n background-size: 4px 4px, 4px 4px;\n box-shadow: inset 0 1px 0 color-mix(in srgb, var(--partner-card-highlight) 54%, transparent), inset 0 -1px 0 var(--partner-glass-rim-shadow);\n font-family: var(--partner-font-family);\n font-size: var(--partner-font-body);\n font-weight: 520;\n cursor: pointer;\n transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;\n}\n.dsh-partner-workspace select:not([multiple]):hover:not(:disabled) { border-color: color-mix(in srgb, var(--partner-text) 24%, var(--partner-border)); background-color: var(--partner-hover); }\n.dsh-partner-workspace select:not([multiple]):focus-visible { border-color: var(--partner-focus-ring); background-color: var(--partner-raised); box-shadow: 0 0 0 3px color-mix(in srgb, var(--partner-focus-ring) 16%, transparent), inset 0 1px 0 color-mix(in srgb, var(--partner-card-highlight) 66%, transparent); }\n.dsh-partner-workspace select:not([multiple]):disabled { cursor: not-allowed; }\n.dsh-partner-workspace select option { color: var(--partner-text); background: var(--partner-solid-control); font: inherit; }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > footer { align-items: center; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--partner-separator); }\n.dsh-partner-form-footer-spacer { flex: 1; }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > footer .is-primary { color: var(--partner-on-accent); border-color: var(--partner-accent-strong); background: var(--partner-accent-strong); }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > footer .is-primary:hover { color: var(--partner-on-accent); border-color: var(--partner-accent-strong); background: color-mix(in srgb, var(--partner-accent-strong) 88%, #000); }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > .dsh-partner-workspace-notice { grid-column: 1 / -1; margin: 0; }\n.dsh-partner-feature-page button:disabled { cursor: not-allowed; opacity: .48; }\n.dsh-partner-identity-danger > div { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }\n.dsh-partner-identity-danger[data-confirming="true"] { margin-inline: -12px; padding: 16px 12px 0; border-top-color: color-mix(in srgb, var(--partner-danger) 30%, var(--partner-border)); background: color-mix(in srgb, var(--partner-danger) 4%, transparent); }\n.dsh-partner-identity-danger button.is-secondary { border-color: var(--partner-border); color: var(--partner-text-secondary); background: var(--partner-control); }\n.dsh-partner-identity-danger button.is-danger { color: var(--partner-on-accent); border-color: var(--partner-danger); background: var(--partner-danger); }\n.dsh-partner-profile-entries article > header button.is-danger { color: var(--partner-danger); background: color-mix(in srgb, var(--partner-danger) 8%, transparent); }\n\n.dsh-partner-skill-installed > article,\n.dsh-partner-market-grid > article,\n.dsh-partner-schedule-list > article { transition: border-color 150ms ease, background-color 150ms ease, transform 180ms var(--partner-ease-out); }\n.dsh-partner-skill-installed > article:hover,\n.dsh-partner-schedule-list > article:hover { border-color: color-mix(in srgb, var(--partner-text) 20%, var(--partner-border)); background: color-mix(in srgb, var(--partner-hover) 60%, var(--partner-raised)); transform: translate3d(0, -1px, 0); }\n.dsh-partner-schedule-meta { display: flex !important; align-items: center; flex-wrap: wrap; gap: 5px 10px !important; margin-top: 2px; }\n.dsh-partner-schedule-meta > em { position: relative; color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); font-style: normal; font-variant-numeric: tabular-nums; }\n.dsh-partner-schedule-meta > em + em::before { position: absolute; top: 50%; left: -6px; width: 2px; height: 2px; border-radius: 50%; background: var(--partner-text-tertiary); content: ""; }\n.dsh-partner-run-list > article { border-radius: 9px; transition: background-color 140ms ease; }\n.dsh-partner-run-list > article:hover { background: var(--partner-hover); }\n.dsh-partner-board > section { border-radius: 16px; box-shadow: none; }\n.dsh-partner-board .dsh-partner-task-card { box-shadow: none; }\n\n@media (hover: hover) {\n .dsh-partner-skill-installed .is-icon,\n .dsh-partner-schedule-list .is-icon { opacity: .34; transition: opacity 140ms ease, color 140ms ease, background-color 140ms ease; }\n .dsh-partner-skill-installed > article:hover .is-icon,\n .dsh-partner-schedule-list > article:hover .is-icon,\n .dsh-partner-skill-installed .is-icon:focus-visible,\n .dsh-partner-schedule-list .is-icon:focus-visible { opacity: 1; }\n}\n\n.dsh-partner-workspace-dialog-layer { position: absolute; z-index: 12; inset: 0; display: flex; align-items: center; justify-content: center; padding: clamp(16px, 3vw, 32px); background: var(--partner-dialog-veil); }\n.dsh-partner-workspace-dialog { position: relative; inset: auto; display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(560px, 100%); max-width: none; height: auto; max-height: min(680px, 100%); margin: 0; padding: 0; overflow: hidden; border: 1px solid color-mix(in srgb, var(--partner-text) 18%, var(--partner-border)); border-radius: 16px; color: var(--partner-text); background: var(--partner-solid-panel); 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); animation: dsh-partner-dialog-enter 200ms var(--partner-ease-out) both; }\n.dsh-partner-workspace-dialog.is-wide { width: min(680px, 100%); max-height: min(720px, 100%); }\n.dsh-partner-workspace-dialog > header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 20px; padding: 22px 22px 18px; border-bottom: 1px solid var(--partner-separator); background: var(--partner-solid-raised); }\n.dsh-partner-workspace-dialog > header > span { display: grid; gap: 5px; min-width: 0; }\n.dsh-partner-workspace-dialog > header small { color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); font-weight: 680; letter-spacing: .09em; }\n.dsh-partner-workspace-dialog > header strong { font-size: var(--partner-font-title); line-height: 1.25; font-weight: 660; letter-spacing: -.025em; text-wrap: balance; }\n.dsh-partner-workspace-dialog > header p { max-width: 58ch; margin: 0; color: var(--partner-text-secondary); font-size: var(--partner-font-body); line-height: 1.55; text-wrap: pretty; }\n.dsh-partner-workspace-dialog > header button { display: grid; place-items: center; width: 32px; min-height: 32px; padding: 0; border: 1px solid transparent; border-radius: 9px; color: var(--partner-text-tertiary); background: transparent; box-shadow: none; cursor: pointer; transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease, transform 140ms var(--partner-ease-out); }\n.dsh-partner-workspace-dialog > header button:hover { border-color: var(--partner-border); color: var(--partner-text); background: var(--partner-hover); }\n.dsh-partner-workspace-dialog > header button:active { transform: scale(.94); }\n.dsh-partner-workspace-dialog-body { min-width: 0; min-height: 0; overflow: auto; padding: 20px 22px 24px; overscroll-behavior: contain; scrollbar-gutter: stable; }\n.dsh-partner-workspace-dialog-body > :is(form, .dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }\n.dsh-partner-workspace-dialog-body > :is(form, .dsh-partner-task-detail) > footer:last-child { position: sticky; z-index: 2; bottom: -24px; margin: 4px -22px -24px; padding: 14px 22px; border-top: 1px solid var(--partner-separator); background: var(--partner-solid-raised); box-shadow: 0 -10px 24px color-mix(in srgb, #000 5%, transparent); }\n\n.dsh-partner-workspace-notice { display: grid; grid-template-columns: 7px minmax(0, 1fr); align-items: start; gap: 10px; margin: 0 0 14px; padding: 11px 13px; border: 1px solid var(--partner-border); border-radius: 10px; color: var(--partner-text-secondary); background: var(--partner-control); font-size: var(--partner-font-body); line-height: 1.5; }\n.dsh-partner-workspace-notice > i { width: 7px; height: 7px; margin-top: .42em; border-radius: 50%; background: var(--partner-text-tertiary); }\n.dsh-partner-workspace-notice.is-error { border-color: color-mix(in srgb, var(--partner-danger) 30%, var(--partner-border)); color: var(--partner-danger); }\n.dsh-partner-workspace-notice.is-error > i { background: var(--partner-danger); }\n.dsh-partner-workspace-notice.is-warning > i { background: var(--partner-warning); }\n.dsh-partner-workspace-notice.is-success > i { background: var(--partner-success); }\n\n.dsh-partner-collection-empty { display: grid; justify-items: center; padding: 38px 24px 42px; color: var(--partner-text-secondary); text-align: center; }\n.dsh-partner-collection-empty > span { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 12px; border: 1px solid var(--partner-border); border-radius: 13px; color: var(--partner-text-tertiary); background: var(--partner-control); }\n.dsh-partner-collection-empty > strong { color: var(--partner-text); font-size: var(--partner-font-label); font-weight: 620; }\n.dsh-partner-collection-empty > p { max-width: 46ch; margin: 6px 0 14px; color: var(--partner-text-tertiary); font-size: var(--partner-font-body); line-height: 1.55; text-wrap: pretty; }\n.dsh-partner-collection-empty > button { margin-top: 14px; }\n\n.dsh-partner-collection-skeleton { display: grid; gap: 8px; padding: 6px 0; }\n.dsh-partner-collection-skeleton > i { display: block; height: 68px; overflow: hidden; border: 1px solid var(--partner-border); border-radius: 12px; background: linear-gradient(100deg, var(--partner-control) 20%, var(--partner-hover) 38%, var(--partner-control) 56%); background-size: 220% 100%; animation: dsh-partner-skeleton 1.4s ease-in-out infinite; }\n\n.dsh-partner-count-label { display: inline-flex; align-items: baseline; gap: 5px; color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); font-variant-numeric: tabular-nums; }\n.dsh-partner-count-label > b { color: var(--partner-text); font-size: var(--partner-font-label); font-weight: 650; }\n\n@keyframes dsh-partner-dialog-enter { from { opacity: 0; transform: translate3d(0, 10px, 0) scale(.985); } to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); } }\n@keyframes dsh-partner-skeleton { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }\n\n@media (max-width: 760px) {\n .dsh-partner-workspace-dialog-layer { align-items: stretch; padding: 0; }\n .dsh-partner-workspace-dialog, .dsh-partner-workspace-dialog.is-wide { width: 100%; height: 100%; max-height: none; border-width: 0; border-radius: 0; }\n .dsh-partner-workspace-dialog > header { padding: 18px 18px 15px; }\n .dsh-partner-workspace-dialog-body { padding: 18px 18px 26px; }\n .dsh-partner-workspace-dialog-body > :is(form, .dsh-partner-task-detail) > footer:last-child { bottom: -26px; margin: 4px -18px -26px; padding: 13px 18px max(13px, env(safe-area-inset-bottom)); }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dsh-partner-workspace-dialog, .dsh-partner-collection-skeleton > i { animation: none; }\n}\n';
2621
+
2622
+ // src/ui/requirement-board.css
2623
+ var requirement_board_default = ".dsh-partner-requirement-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }\n.dsh-partner-requirement-toolbar .dsh-partner-board-statuses { margin: 0; flex: 1; }\n.dsh-partner-requirement-toolbar .dsh-partner-board-search { flex: 0 1 300px; }\n.dsh-partner-requirement-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }\n.dsh-partner-requirement-card { min-width: 0; border: 1px solid var(--partner-border); border-radius: 16px; overflow: hidden; background: var(--partner-raised); }\n.dsh-partner-feature-page .dsh-partner-requirement-open { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: 100%; min-height: 186px; padding: 18px; border: 0; border-radius: 0; background: transparent; color: var(--partner-text); text-align: left; box-shadow: none; }\n.dsh-partner-requirement-open:hover, .dsh-partner-requirement-open:focus-visible { background: var(--partner-hover); }\n.dsh-partner-requirement-open > strong { font-size: var(--partner-font-label); line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }\n.dsh-partner-requirement-open > p { margin: 0; min-height: 3em; font-size: var(--partner-font-body); color: var(--partner-text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }\n.dsh-partner-requirement-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--partner-font-caption); color: var(--partner-text-secondary); }\n.dsh-partner-requirement-meta > span { border-radius: 6px; padding: 3px 7px; background: var(--partner-control); color: var(--partner-text); }\n.dsh-partner-requirement-meta small { font: inherit; overflow-wrap: anywhere; }\n.dsh-partner-requirement-progress { height: 4px; width: 100%; border-radius: 4px; background: var(--partner-border); overflow: hidden; margin-top: auto; }\n.dsh-partner-requirement-progress > i { display: block; height: 100%; border-radius: inherit; background: var(--partner-text-secondary); }\n.dsh-partner-requirement-card > footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 18px; border-top: 1px solid var(--partner-separator); }\n.dsh-partner-requirement-card > footer > small { color: var(--partner-text-secondary); font-size: var(--partner-font-caption); }\n.dsh-partner-requirement-card > footer > button { border: 0; background: transparent; box-shadow: none; }\n.dsh-partner-requirement-legacy { width: 100%; display: flex; gap: 12px; margin-top: 20px; padding: 14px !important; text-align: left; }\n.dsh-partner-requirement-legacy > span { flex: 1; color: var(--partner-text-secondary); }\n.dsh-partner-requirement-breadcrumb { display: flex; align-items: center; gap: 8px; min-width: 0; margin-bottom: 12px; font-size: var(--partner-font-body); }\n.dsh-partner-requirement-breadcrumb > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }\n.dsh-partner-requirement-breadcrumb > button, .dsh-partner-requirement-breadcrumb > svg { flex-shrink: 0; }\n.dsh-partner-requirement-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-block: 12px; border-block: 1px solid var(--partner-separator); }\n.dsh-partner-requirement-facts > span { display: grid; gap: 6px; color: var(--partner-text-secondary); font-size: var(--partner-font-caption); }\n.dsh-partner-requirement-facts b { color: var(--partner-text); font-weight: 550; overflow-wrap: anywhere; }\n.dsh-partner-requirement-disclosure { border-top: 1px solid var(--partner-separator); padding-top: 8px; }\n.dsh-partner-requirement-disclosure > summary { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; color: var(--partner-text-secondary); font-size: var(--partner-font-body); list-style: none; }\n.dsh-partner-requirement-disclosure > summary::-webkit-details-marker { display: none; }\n.dsh-partner-requirement-disclosure > summary::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }\n.dsh-partner-requirement-disclosure[open] > summary::before { transform: rotate(45deg); }\n.dsh-partner-requirement-disclosure > p { color: var(--partner-text-secondary); font-size: var(--partner-font-body); line-height: 1.6; }\n.dsh-partner-requirement-disclosure > label { display: grid; gap: 8px; margin-bottom: 12px; }\n.dsh-partner-requirement-actions { display: flex; flex-wrap: wrap; gap: 8px; }\n.dsh-partner-requirement-owner { display: grid; gap: 8px; font-size: var(--partner-font-body); }\n.dsh-partner-requirement-detail :is(textarea, select) { box-sizing: border-box; width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--partner-border); border-radius: 9px; background: var(--partner-control); color: var(--partner-text); font: var(--partner-font-body)/1.5 var(--partner-font-family); }\n.dsh-partner-requirement-detail textarea { resize: vertical; }\n.dsh-partner-feature-page.is-board :is(button, summary, textarea):focus-visible { outline: 2px solid var(--partner-focus-ring); outline-offset: 2px; }\n.dsh-partner-feature-page.is-board button:not(:disabled):active { transform: none; }\n.dsh-partner-requirement-detail button.is-primary { background: var(--partner-accent-strong); color: var(--partner-on-accent); border-color: var(--partner-accent-strong); }\n.dsh-partner-requirement-detail button.is-danger { color: var(--partner-danger); }\n.dsh-partner-feature-page.is-board > .dsh-partner-feature-page.is-board { padding: 0; }\n.dsh-partner-requirement-detail > footer { display: flex; justify-content: flex-end; gap: 8px; }\n.dsh-partner-requirement-detail .dsh-partner-task-result { overflow-wrap: anywhere; }\n@media (max-width: 760px) {\n .dsh-partner-requirement-toolbar { align-items: stretch; }\n .dsh-partner-requirement-toolbar .dsh-partner-board-statuses { display: flex; }\n .dsh-partner-requirement-toolbar .dsh-partner-board-search { flex-basis: 100%; }\n .dsh-partner-requirement-facts { grid-template-columns: 1fr 1fr; }\n .dsh-partner-requirement-legacy { flex-wrap: wrap; }\n .dsh-partner-requirement-legacy > span { flex-basis: 100%; }\n .dsh-partner-requirement-detail button, .dsh-partner-requirement-card button, .dsh-partner-requirement-disclosure summary { min-height: 44px; }\n}\n";
2617
2624
 
2618
2625
  // src/ui/responsive-ui.css
2619
2626
  var responsive_ui_default = `/* Mobile composition lives separately from the desktop visual system so each
@@ -2790,10 +2797,12 @@ var responsive_ui_default = `/* Mobile composition lives separately from the des
2790
2797
  .dsh-partner-board-statuses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
2791
2798
  .dsh-partner-board-statuses > button { min-width: 0; min-height: 44px; justify-content: center; gap: 4px; padding-inline: 5px; }
2792
2799
  .dsh-partner-board { grid-template-columns: 1fr; }
2793
- .dsh-partner-board > section,
2794
- .dsh-partner-board[data-focused="true"] > section { height: min(430px, 55dvh); }
2795
- .dsh-partner-board > section[data-empty="true"],
2796
- .dsh-partner-board[data-focused="true"] > section[data-empty="true"] { height: 112px; }
2800
+ .dsh-partner-board .dsh-partner-board-stage-toggle, .dsh-partner-board-more { min-height: 44px; }
2801
+ .is-board .dsh-partner-board-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
2802
+ .is-board .dsh-partner-board-search, .is-board .dsh-partner-board-tools > small { grid-column: 1 / -1; }
2803
+ .is-board .dsh-partner-board-assignee { grid-column: auto; }
2804
+ .dsh-partner-board-assignee.is-mobile-stage { display: block; }
2805
+ .is-board .dsh-partner-board-statuses { display: none; }
2797
2806
  .dsh-partner-task-fields label { grid-template-columns: 1fr; gap: 5px; }
2798
2807
  .dsh-partner-task-dependency > div > span { min-height: 44px; grid-template-columns: 18px minmax(0, 1fr) 52px; }
2799
2808
  .dsh-partner-task-dependency > div button { min-height: 44px; }
@@ -2863,7 +2872,8 @@ var widget_default = `.dsh-partner-pendant { position: fixed; z-index: 12; top:
2863
2872
  .dsh-partner-pendant button.dsh-partner-pendant-anchor { position: absolute; left: 50%; top: 2.42%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0 !important; border-radius: 50%; background: transparent !important; box-shadow: none !important; pointer-events: auto; touch-action: none; cursor: grab; }
2864
2873
  .dsh-partner-pendant-anchor > span { width: 14px; height: 6px; border: 1px solid #71817e; border-radius: 4px; background: #c3ced0; }
2865
2874
  .dsh-partner-pendant-anchor:hover > span { background: #e4ece8; }
2866
- .dsh-partner-pendant-unread { position: absolute; left: calc(50% + 10px); top: 2.42%; transform: translateY(-50%); display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border: 1px solid rgb(255 255 255 / 70%); border-radius: 9px; background: #435950; color: #fff; font: 600 11px/1 var(--partner-font-family); font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; user-select: none; }
2875
+ .dsh-partner-pendant-unread { position: absolute; left: 0; top: 0; transform: translate(130px, 144px) translate(-50%, -100%); display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border: 1px solid rgb(255 255 255 / 70%); border-radius: 9px; background: #435950; color: #fff; font: 600 11px/1 var(--partner-font-family); font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; user-select: none; transition: none !important; }
2876
+ .dsh-partner-pendant-unread[hidden] { display: none; }
2867
2877
  body[data-ds-dark-theme] .dsh-partner-pendant-unread { border-color: rgb(200 220 213 / 24%); background: #b0c6bd; color: #202e29; }
2868
2878
  .dsh-partner-pendant-announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
2869
2879
  /* Own the reader's surface even under host-wide important focus rules. */
@@ -3040,7 +3050,7 @@ function WorkspaceDialog({ eyebrow = "CREATE & CONFIGURE", title, detail, close,
3040
3050
  return;
3041
3051
  }
3042
3052
  if (event.key !== "Tab") return;
3043
- const focusable = [...panelRef.current?.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])') ?? []];
3053
+ const focusable = [...panelRef.current?.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), summary, [tabindex]:not([tabindex="-1"])') ?? []].filter((node) => node.getClientRects().length > 0);
3044
3054
  if (focusable.length === 0) return;
3045
3055
  const first = focusable[0];
3046
3056
  const last = focusable.at(-1);
@@ -3759,6 +3769,7 @@ function PartnerPendant({ controller }) {
3759
3769
  }
3760
3770
  function ActivePendant({ controller, settings }) {
3761
3771
  const root = (0, import_react9.useRef)(null), canvas = (0, import_react9.useRef)(null), hit = (0, import_react9.useRef)(null);
3772
+ const unreadBadge = (0, import_react9.useRef)(null);
3762
3773
  const handle = (0, import_react9.useRef)(), toggle = (0, import_react9.useRef)(() => {
3763
3774
  });
3764
3775
  const [open, setOpen] = (0, import_react9.useState)(false), [ready, setReady] = (0, import_react9.useState)(false), [failed, setFailed] = (0, import_react9.useState)(false);
@@ -3804,7 +3815,8 @@ function ActivePendant({ controller, settings }) {
3804
3815
  handle.current = void 0;
3805
3816
  setReady(false);
3806
3817
  setFailed(true);
3807
- }
3818
+ },
3819
+ ...unreadBadge.current ? { unreadBadge: unreadBadge.current } : {}
3808
3820
  });
3809
3821
  if (abort.signal.aborted) {
3810
3822
  instance.destroy();
@@ -3852,7 +3864,7 @@ function ActivePendant({ controller, settings }) {
3852
3864
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { children: failed ? inbox.unread ? `${inbox.unread} \u6761\u6D88\u606F` : "\u6D88\u606F" : "\u52A0\u8F7D\u6302\u9970\u2026" })
3853
3865
  ] }) }),
3854
3866
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", className: "dsh-partner-pendant-anchor", "aria-label": "\u79FB\u52A8\u6302\u9970\u4F4D\u7F6E", title: "\u62D6\u52A8\u6302\u70B9\u79FB\u52A8\u4F4D\u7F6E\uFF0C\u4E5F\u53EF\u7528\u65B9\u5411\u952E\u5FAE\u8C03", ...placement, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "aria-hidden": "true" }) }),
3855
- inbox.unread > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsh-partner-pendant-unread", "aria-hidden": "true", children: inbox.unread > 99 ? "99+" : inbox.unread }),
3867
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { ref: unreadBadge, className: "dsh-partner-pendant-unread", hidden: inbox.unread === 0, "aria-hidden": "true", children: inbox.unread > 99 ? "99+" : inbox.unread }),
3856
3868
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsh-partner-pendant-announcement", role: "status", "aria-live": "polite", "aria-atomic": "true", children: incoming ? `${incoming.companionName}\uFF1A${incoming.title}` : "" }),
3857
3869
  open && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PendantReader, { inbox, selected, error: error || navigationError, anchor: hit, onSelect: inspect, onClose: close, onVisit: (item) => {
3858
3870
  void visit(item);
@@ -4700,10 +4712,249 @@ function skillScalar(value) {
4700
4712
  return `"${value.replace(/[\r\n]+/g, " ").replace(/"/g, "'").trim()}"`;
4701
4713
  }
4702
4714
 
4703
- // src/ui/task-board-panel.tsx
4715
+ // src/ui/requirement-board.tsx
4716
+ var import_react18 = require("react");
4717
+ var import_dsh_client_ui_primitives10 = require("@deepseek-ai/dsh-client-ui-primitives");
4718
+
4719
+ // src/ui/board-refresh.ts
4704
4720
  var import_react14 = require("react");
4721
+ function useBoardRefresh(read, failed, enabled = true) {
4722
+ const readRef = (0, import_react14.useRef)(read), failedRef = (0, import_react14.useRef)(failed);
4723
+ readRef.current = read;
4724
+ failedRef.current = failed;
4725
+ const epoch = (0, import_react14.useRef)(0), pending = (0, import_react14.useRef)(), mounted = (0, import_react14.useRef)(false);
4726
+ const refresh = (0, import_react14.useCallback)(async () => {
4727
+ const version = ++epoch.current;
4728
+ await pending.current;
4729
+ if (!mounted.current || version !== epoch.current) return;
4730
+ const request = (async () => {
4731
+ try {
4732
+ const commit = await readRef.current();
4733
+ if (mounted.current && version === epoch.current) commit();
4734
+ } catch (error) {
4735
+ if (mounted.current && version === epoch.current) failedRef.current(error);
4736
+ }
4737
+ })();
4738
+ pending.current = request;
4739
+ await request;
4740
+ if (pending.current === request) pending.current = void 0;
4741
+ }, []);
4742
+ (0, import_react14.useEffect)(() => {
4743
+ if (!enabled) return;
4744
+ mounted.current = true;
4745
+ void refresh();
4746
+ const poll = () => {
4747
+ if (!pending.current && document.visibilityState === "visible") void refresh();
4748
+ };
4749
+ const timer = window.setInterval(poll, 4e3);
4750
+ document.addEventListener("visibilitychange", poll);
4751
+ return () => {
4752
+ mounted.current = false;
4753
+ epoch.current++;
4754
+ window.clearInterval(timer);
4755
+ document.removeEventListener("visibilitychange", poll);
4756
+ };
4757
+ }, [refresh, enabled]);
4758
+ return refresh;
4759
+ }
4760
+
4761
+ // src/ui/requirement-dialog.tsx
4762
+ var import_react15 = require("react");
4705
4763
  var import_dsh_client_ui_primitives7 = require("@deepseek-ai/dsh-client-ui-primitives");
4706
4764
  var import_jsx_runtime10 = require("react/jsx-runtime");
4765
+ function requirementStatus(item) {
4766
+ if (item.lastError) return item.status === "done" ? "\u5DF2\u5F52\u6863 \xB7 \u901A\u77E5\u5F85\u91CD\u8BD5" : "\u6536\u5C3E\u5F85\u91CD\u8BD5";
4767
+ return { planning: "\u89C4\u5212\u4E2D", active: "\u63A8\u8FDB\u4E2D", review: "\u6C47\u603B\u4E2D", done: "\u5DF2\u5F52\u6863" }[item.status];
4768
+ }
4769
+ function RequirementForm({ directory, close, created }) {
4770
+ const [busy, setBusy] = (0, import_react15.useState)(false), [error, setError] = (0, import_react15.useState)();
4771
+ const submit = async (event) => {
4772
+ event.preventDefault();
4773
+ const data = new FormData(event.currentTarget);
4774
+ setBusy(true);
4775
+ setError(void 0);
4776
+ try {
4777
+ const item = await api("/requirements", { method: "POST", body: JSON.stringify({ title: data.get("title"), description: data.get("description"), ownerCompanionId: data.get("owner") || void 0 }) });
4778
+ await created(item);
4779
+ } catch (reason) {
4780
+ setError(errorMessage(reason));
4781
+ } finally {
4782
+ setBusy(false);
4783
+ }
4784
+ };
4785
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { className: "dsh-partner-task-form", "aria-busy": busy, onSubmit: (event) => {
4786
+ void submit(event);
4787
+ }, children: [
4788
+ error && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WorkspaceNotice, { children: error }),
4789
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "is-wide", children: [
4790
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u9700\u6C42\u540D\u79F0" }),
4791
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { name: "title", autoFocus: true, required: true, maxLength: 200, placeholder: "\u8FD9\u6B21\u5E0C\u671B\u5B8C\u6210\u4EC0\u4E48" })
4792
+ ] }),
4793
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "is-wide", children: [
4794
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u4EA4\u4ED8\u76EE\u6807" }),
4795
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("textarea", { name: "description", rows: 5, maxLength: 8e3, placeholder: "\u80CC\u666F\u3001\u9884\u671F\u6210\u679C\u4E0E\u6574\u4F53\u5B8C\u6210\u6807\u51C6" })
4796
+ ] }),
4797
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "is-wide", children: [
4798
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u6536\u5C3E\u8D1F\u8D23\u4EBA" }),
4799
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { name: "owner", defaultValue: "", children: [
4800
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "", children: "\u4EBA\u5DE5\u6C47\u603B" }),
4801
+ directory.map((c) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: c.id, children: [
4802
+ "@",
4803
+ c.name
4804
+ ] }, c.id))
4805
+ ] }),
4806
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u5B50\u4EFB\u52A1\u5168\u90E8\u901A\u8FC7\u9A8C\u6536\u540E\uFF0C\u7531\u8BE5\u4F19\u4F34\u603B\u7ED3\u5E76\u901A\u8FC7\u9700\u6C42\u6765\u6E90\u6E20\u9053\u901A\u77E5\u3002" })
4807
+ ] }),
4808
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("footer", { children: [
4809
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: close, disabled: busy, children: "\u53D6\u6D88" }),
4810
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u5E76\u5B89\u6392\u4EFB\u52A1" })
4811
+ ] })
4812
+ ] });
4813
+ }
4814
+ function RequirementDetail({ item, tasks, directory, changed: changed2, close }) {
4815
+ const [busy, setBusy] = (0, import_react15.useState)(false), [error, setError] = (0, import_react15.useState)(), [confirming, setConfirming] = (0, import_react15.useState)(false), [summary, setSummary] = (0, import_react15.useState)("");
4816
+ const done = tasks.filter((t) => t.status === "done").length, ready = tasks.length > 0 && done === tasks.length && item.status !== "planning";
4817
+ const act = async (action, body = {}) => {
4818
+ setBusy(true);
4819
+ setError(void 0);
4820
+ try {
4821
+ await api(`/requirements/${item.id}${action === "remove" ? "" : `/${action}`}`, { method: action === "remove" ? "DELETE" : "POST", body: JSON.stringify({ expectedRevision: item.revision, ...body }) });
4822
+ if (action === "remove") close();
4823
+ await changed2();
4824
+ } catch (reason) {
4825
+ await changed2();
4826
+ setError(errorMessage(reason));
4827
+ } finally {
4828
+ setBusy(false);
4829
+ }
4830
+ };
4831
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-task-detail dsh-partner-requirement-detail", "aria-busy": busy, children: [
4832
+ error && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WorkspaceNotice, { children: error }),
4833
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-task-description", children: [
4834
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u4EA4\u4ED8\u76EE\u6807" }),
4835
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: item.description || "\u672A\u8865\u5145\u4EA4\u4ED8\u76EE\u6807" })
4836
+ ] }),
4837
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-requirement-facts", children: [
4838
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
4839
+ "\u6536\u5C3E\u8D1F\u8D23\u4EBA",
4840
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: directory.find((c) => c.id === item.ownerCompanionId)?.name ?? "\u4EBA\u5DE5\u6C47\u603B" })
4841
+ ] }),
4842
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
4843
+ "\u5B50\u4EFB\u52A1\u9A8C\u6536",
4844
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: item.status === "done" ? `${item.results?.length ?? done} \u9879\u5DF2\u5F52\u6863` : `${done} / ${tasks.length}` })
4845
+ ] }),
4846
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
4847
+ "\u901A\u77E5\u65B9\u5F0F",
4848
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: item.creatorSessionId ? "\u9700\u6C42\u6765\u6E90\u4F1A\u8BDD / \u6E20\u9053" : "\u770B\u677F\u5185\u67E5\u770B\u7ED3\u679C" })
4849
+ ] })
4850
+ ] }),
4851
+ item.lastError && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(WorkspaceNotice, { children: [
4852
+ item.lastError,
4853
+ " \xB7 \u7CFB\u7EDF\u4F1A\u81EA\u52A8\u91CD\u8BD5\uFF0C\u4E5F\u53EF\u7ACB\u5373\u91CD\u8BD5\u3002",
4854
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy, onClick: () => {
4855
+ void act("retry");
4856
+ }, children: "\u7ACB\u5373\u91CD\u8BD5" })
4857
+ ] }),
4858
+ item.summary && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-task-result", children: [
4859
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u6700\u7EC8\u7ED3\u8BBA" }),
4860
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: item.summary })
4861
+ ] }),
4862
+ !!item.results?.length && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
4863
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("summary", { children: [
4864
+ "\u4EA4\u4ED8\u8BB0\u5F55 \xB7 ",
4865
+ item.results.length,
4866
+ " \u9879"
4867
+ ] }),
4868
+ item.results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-task-result", children: [
4869
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: result.title }),
4870
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: result.resultSummary || result.resultAbstract || "\u672A\u63D0\u4F9B\u7ED3\u679C\u6B63\u6587" })
4871
+ ] }, result.id))
4872
+ ] }),
4873
+ item.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
4874
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "dsh-partner-requirement-owner", children: [
4875
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u8C03\u6574\u6536\u5C3E\u8D1F\u8D23\u4EBA" }),
4876
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { "aria-label": "\u6536\u5C3E\u8D1F\u8D23\u4EBA", value: item.ownerCompanionId ?? "", disabled: busy, onChange: (event) => {
4877
+ void act("owner", { ownerCompanionId: event.target.value });
4878
+ }, children: [
4879
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "", children: "\u4EBA\u5DE5\u6C47\u603B" }),
4880
+ item.ownerCompanionId && !directory.some((c) => c.id === item.ownerCompanionId) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: item.ownerCompanionId, children: "\u539F\u8D1F\u8D23\u4EBA\u5DF2\u5220\u9664" }),
4881
+ directory.map((c) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: c.id, children: [
4882
+ "@",
4883
+ c.name
4884
+ ] }, c.id))
4885
+ ] })
4886
+ ] }),
4887
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WorkspaceNotice, { kind: "warning", children: item.status === "planning" ? "\u5168\u90E8\u5B50\u4EFB\u52A1\u5B89\u6392\u597D\u540E\uFF0C\u63D0\u4EA4\u672C\u6B21\u89C4\u5212\uFF1B\u5220\u9664\u5B50\u4EFB\u52A1\u4F1A\u91CD\u65B0\u6253\u5F00\u89C4\u5212\uFF0C\u9700\u786E\u8BA4\u65B0\u7684\u4EA4\u4ED8\u8303\u56F4\u3002" : "\u5B50\u4EFB\u52A1\u7684\u6267\u884C\u548C\u9A8C\u6536\u53EA\u5728\u5185\u90E8\u6D41\u8F6C\uFF0C\u5168\u90E8\u5B8C\u6210\u540E\u624D\u6C47\u603B\u9700\u6C42\u7ED3\u679C\u3002" }),
4888
+ ready && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
4889
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("summary", { children: "\u4EBA\u5DE5\u5B8C\u6210\u6536\u5C3E" }),
4890
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
4891
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u6700\u7EC8\u7ED3\u8BBA" }),
4892
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("textarea", { rows: 5, maxLength: 12e3, value: summary, onChange: (event) => setSummary(event.target.value), placeholder: "\u786E\u8BA4\u5B9E\u9645\u4EA4\u4ED8\u5185\u5BB9\u3001\u7ED3\u8BBA\u53CA\u9650\u5236" })
4893
+ ] }),
4894
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy || !summary.trim(), onClick: () => {
4895
+ void act("finish", { summary });
4896
+ }, children: "\u4FDD\u5B58\u603B\u7ED3\u5E76\u5F52\u6863" })
4897
+ ] })
4898
+ ] }),
4899
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
4900
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("summary", { children: "\u7BA1\u7406\u9700\u6C42" }),
4901
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: "\u5220\u9664\u9700\u6C42\u4F1A\u540C\u65F6\u79FB\u9664\u5B50\u4EFB\u52A1\uFF0C\u5E76\u53D6\u6D88\u5173\u8054\u6267\u884C\u3002\u4E0D\u80FD\u64A4\u9500\uFF0C\u4E0D\u4F1A\u5220\u9664\u5DF2\u751F\u6210\u7684\u4EA4\u4ED8\u6587\u4EF6\u3002" }),
4902
+ confirming ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-requirement-actions", children: [
4903
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirming(false), children: "\u4FDD\u7559\u9700\u6C42" }),
4904
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "is-danger", disabled: busy, onClick: () => {
4905
+ void act("remove");
4906
+ }, children: [
4907
+ "\u786E\u8BA4\u5220\u9664\u9700\u6C42\u548C ",
4908
+ tasks.length,
4909
+ " \u4E2A\u4EFB\u52A1"
4910
+ ] })
4911
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "is-danger", onClick: () => setConfirming(true), children: [
4912
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives7.IconTrashOutline16, { size: 14 }),
4913
+ "\u5220\u9664\u9700\u6C42"
4914
+ ] })
4915
+ ] }),
4916
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("footer", { children: [
4917
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: close, disabled: busy, children: "\u5173\u95ED" }),
4918
+ item.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "is-primary", disabled: busy || item.status === "planning" && !tasks.length, onClick: () => {
4919
+ void act(item.status === "planning" ? "submit" : "reopen");
4920
+ }, children: busy ? "\u5904\u7406\u4E2D\u2026" : item.status === "planning" ? "\u63D0\u4EA4\u89C4\u5212" : "\u8C03\u6574\u4EFB\u52A1\u8303\u56F4" })
4921
+ ] })
4922
+ ] });
4923
+ }
4924
+
4925
+ // src/ui/requirement-tasks-panel.tsx
4926
+ var import_react17 = require("react");
4927
+ var import_dsh_client_ui_primitives9 = require("@deepseek-ai/dsh-client-ui-primitives");
4928
+
4929
+ // src/ui/task-board-stage.tsx
4930
+ var import_react16 = require("react");
4931
+ var import_dsh_client_ui_primitives8 = require("@deepseek-ai/dsh-client-ui-primitives");
4932
+ var import_jsx_runtime11 = require("react/jsx-runtime");
4933
+ function TaskBoardStage({ id, label, tasks, focused, filtered, renderTask }) {
4934
+ const [collapsed, setCollapsed] = (0, import_react16.useState)(false);
4935
+ const [limit, setLimit] = (0, import_react16.useState)(6);
4936
+ const count = Math.max(limit, focused ? 12 : 6);
4937
+ const titleId = `dsh-partner-board-${id}`, listId = `${titleId}-list`;
4938
+ const expanded = !collapsed;
4939
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { "data-status": id, "data-empty": tasks.length === 0, "aria-labelledby": titleId, children: [
4940
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("header", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", className: "dsh-partner-board-stage-toggle", "aria-expanded": expanded, "aria-controls": listId, onClick: () => setCollapsed((value) => !value), children: [
4941
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconChevronRightOutline14, { size: 14 }),
4942
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { id: titleId, children: label }),
4943
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("b", { children: tasks.length })
4944
+ ] }) }),
4945
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { id: listId, hidden: !expanded, children: tasks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
4946
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-partner-board-column-list", children: tasks.slice(0, count).map(renderTask) }),
4947
+ tasks.length > count && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", className: "dsh-partner-board-more", onClick: () => setLimit(count + 12), children: [
4948
+ "\u5C55\u5F00\u66F4\u591A \xB7 \u8FD8\u6709 ",
4949
+ tasks.length - count,
4950
+ " \u9879"
4951
+ ] })
4952
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsh-partner-board-empty", children: filtered ? "\u6CA1\u6709\u5339\u914D\u4EFB\u52A1" : "\u6682\u65E0\u4EFB\u52A1" }) })
4953
+ ] });
4954
+ }
4955
+
4956
+ // src/ui/requirement-tasks-panel.tsx
4957
+ var import_jsx_runtime12 = require("react/jsx-runtime");
4707
4958
  var COLUMNS = [
4708
4959
  { id: "backlog", label: "\u6536\u96C6\u7BB1" },
4709
4960
  { id: "ready", label: "\u5F85\u5F00\u59CB" },
@@ -4712,27 +4963,27 @@ var COLUMNS = [
4712
4963
  { id: "blocked", label: "\u53D7\u963B" },
4713
4964
  { id: "done", label: "\u5DF2\u5B8C\u6210" }
4714
4965
  ];
4715
- var LIVE_REFRESH_MS = 4e3;
4716
- function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4717
- const [board, setBoard] = (0, import_react14.useState)({ tasks: [], activities: [] });
4718
- const [directory, setDirectory] = (0, import_react14.useState)([]);
4719
- const [delegations, setDelegations] = (0, import_react14.useState)([]);
4720
- const [creating, setCreating] = (0, import_react14.useState)(false);
4721
- const [selectedTaskId, setSelectedTaskId] = (0, import_react14.useState)(initialTaskId);
4722
- (0, import_react14.useEffect)(() => {
4966
+ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back, detailOnly = false } = {}) {
4967
+ const [board, setBoard] = (0, import_react17.useState)({ tasks: [], activities: [] });
4968
+ const [directory, setDirectory] = (0, import_react17.useState)([]);
4969
+ const [delegations, setDelegations] = (0, import_react17.useState)([]);
4970
+ const [creating, setCreating] = (0, import_react17.useState)(false);
4971
+ const [requirementDetail, setRequirementDetail] = (0, import_react17.useState)(false);
4972
+ const [selectedTaskId, setSelectedTaskId] = (0, import_react17.useState)(initialTaskId);
4973
+ (0, import_react17.useEffect)(() => {
4723
4974
  if (initialTaskId) setSelectedTaskId(initialTaskId);
4724
4975
  }, [initialTaskId, openRequest]);
4725
- const [busy, setBusy] = (0, import_react14.useState)();
4726
- const [loading, setLoading] = (0, import_react14.useState)(true);
4727
- const [error, setError] = (0, import_react14.useState)();
4728
- const [syncedAt, setSyncedAt] = (0, import_react14.useState)();
4729
- const [query, setQuery] = (0, import_react14.useState)("");
4730
- const [statusFilter, setStatusFilter] = (0, import_react14.useState)("all");
4731
- const [assigneeFilter, setAssigneeFilter] = (0, import_react14.useState)("all");
4732
- const deferredQuery = (0, import_react14.useDeferredValue)(query.trim().toLocaleLowerCase());
4733
- const tasksById = (0, import_react14.useMemo)(() => new Map(board.tasks.map((item) => [item.id, item])), [board.tasks]);
4734
- const directoryById = (0, import_react14.useMemo)(() => new Map(directory.map((item) => [item.id, item])), [directory]);
4735
- const activeDelegationByTaskId = (0, import_react14.useMemo)(() => {
4976
+ const [busy, setBusy] = (0, import_react17.useState)();
4977
+ const [loading, setLoading] = (0, import_react17.useState)(true);
4978
+ const [error, setError] = (0, import_react17.useState)();
4979
+ const [syncedAt, setSyncedAt] = (0, import_react17.useState)();
4980
+ const [query, setQuery] = (0, import_react17.useState)("");
4981
+ const [statusFilter, setStatusFilter] = (0, import_react17.useState)("all");
4982
+ const [assigneeFilter, setAssigneeFilter] = (0, import_react17.useState)("all");
4983
+ const deferredQuery = (0, import_react17.useDeferredValue)(query.trim().toLocaleLowerCase());
4984
+ const tasksById = (0, import_react17.useMemo)(() => new Map(board.tasks.map((item) => [item.id, item])), [board.tasks]);
4985
+ const directoryById = (0, import_react17.useMemo)(() => new Map(directory.map((item) => [item.id, item])), [directory]);
4986
+ const activeDelegationByTaskId = (0, import_react17.useMemo)(() => {
4736
4987
  const result = /* @__PURE__ */ new Map();
4737
4988
  for (const delegation of delegations) {
4738
4989
  if ((delegation.status === "queued" || delegation.status === "running") && !result.has(delegation.taskId)) result.set(delegation.taskId, delegation);
@@ -4740,24 +4991,26 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4740
4991
  return result;
4741
4992
  }, [delegations]);
4742
4993
  const selectedTask = selectedTaskId ? tasksById.get(selectedTaskId) : void 0;
4743
- const dependentsById = (0, import_react14.useMemo)(() => {
4994
+ const requirement = board.requirements?.find((item) => item.id === requirementId);
4995
+ const requirementTasks = (0, import_react17.useMemo)(() => board.tasks.filter((task) => !requirementId || (requirementId === "legacy" ? !task.requirementId : task.requirementId === requirementId)), [board.tasks, requirementId]);
4996
+ const dependentsById = (0, import_react17.useMemo)(() => {
4744
4997
  const result = /* @__PURE__ */ new Map();
4745
4998
  for (const task of board.tasks) for (const dependencyId of task.dependencyTaskIds) result.set(dependencyId, (result.get(dependencyId) ?? 0) + 1);
4746
4999
  return result;
4747
5000
  }, [board.tasks]);
4748
- const scopedTasks = (0, import_react14.useMemo)(() => board.tasks.filter((task) => {
5001
+ const scopedTasks = (0, import_react17.useMemo)(() => requirementTasks.filter((task) => {
4749
5002
  if (assigneeFilter !== "all" && (task.assigneeCompanionId ?? "unassigned") !== assigneeFilter) return false;
4750
5003
  if (!deferredQuery) return true;
4751
5004
  const dependencies = task.dependencyTaskIds.map((id) => tasksById.get(id)?.title ?? "");
4752
5005
  return [task.title, task.description, task.resultAbstract, task.resultSummary, directoryById.get(task.assigneeCompanionId ?? "")?.name, ...dependencies].some((value) => value?.toLocaleLowerCase().includes(deferredQuery));
4753
- }), [assigneeFilter, board.tasks, deferredQuery, directoryById, tasksById]);
4754
- const statusCounts = (0, import_react14.useMemo)(() => {
5006
+ }), [assigneeFilter, requirementTasks, deferredQuery, directoryById, tasksById]);
5007
+ const statusCounts = (0, import_react17.useMemo)(() => {
4755
5008
  const result = new Map(COLUMNS.map((column) => [column.id, 0]));
4756
5009
  for (const task of scopedTasks) result.set(task.status, (result.get(task.status) ?? 0) + 1);
4757
5010
  return result;
4758
5011
  }, [scopedTasks]);
4759
- const visibleColumns = statusFilter === "all" ? COLUMNS : COLUMNS.filter((column) => column.id === statusFilter);
4760
- const tasksByStatus = (0, import_react14.useMemo)(() => {
5012
+ const visibleColumns = statusFilter === "all" ? COLUMNS.filter((column) => (statusCounts.get(column.id) ?? 0) > 0) : COLUMNS.filter((column) => column.id === statusFilter);
5013
+ const tasksByStatus = (0, import_react17.useMemo)(() => {
4761
5014
  const priorityRank = { urgent: 3, high: 2, normal: 1, low: 0 };
4762
5015
  const result = new Map(COLUMNS.map((column) => [column.id, []]));
4763
5016
  for (const task of scopedTasks) {
@@ -4768,38 +5021,20 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4768
5021
  return result;
4769
5022
  }, [scopedTasks, statusFilter]);
4770
5023
  const visibleTaskCount = statusFilter === "all" ? scopedTasks.length : statusCounts.get(statusFilter) ?? 0;
4771
- const loadingRef = (0, import_react14.useRef)(false);
4772
- const load2 = (0, import_react14.useCallback)(async () => {
4773
- if (loadingRef.current) return;
4774
- loadingRef.current = true;
4775
- try {
4776
- const [next, collaboration] = await Promise.all([api("/tasks"), api("/collaboration")]);
5024
+ const load2 = useBoardRefresh(async () => {
5025
+ const [next, collaboration] = await Promise.all([api("/tasks"), api("/collaboration")]);
5026
+ return () => {
4777
5027
  setBoard(next);
4778
5028
  setDirectory(collaboration.companions);
4779
5029
  setDelegations(collaboration.delegations);
4780
5030
  setSyncedAt(Date.now());
4781
- setError(void 0);
4782
- } catch (reason) {
4783
- setError(errorMessage(reason));
4784
- } finally {
4785
- loadingRef.current = false;
4786
5031
  setLoading(false);
4787
- }
4788
- }, []);
4789
- (0, import_react14.useEffect)(() => {
4790
- void load2();
4791
- const timer = window.setInterval(() => {
4792
- if (document.visibilityState === "visible") void load2();
4793
- }, LIVE_REFRESH_MS);
4794
- const visible = () => {
4795
- if (document.visibilityState === "visible") void load2();
4796
- };
4797
- document.addEventListener("visibilitychange", visible);
4798
- return () => {
4799
- window.clearInterval(timer);
4800
- document.removeEventListener("visibilitychange", visible);
5032
+ setSelectedTaskId((id) => next.tasks.some((t) => t.id === id) ? id : void 0);
4801
5033
  };
4802
- }, [load2]);
5034
+ }, (reason) => {
5035
+ setError(errorMessage(reason));
5036
+ setLoading(false);
5037
+ });
4803
5038
  const update = async (task, change) => {
4804
5039
  setBusy(task.id);
4805
5040
  setError(void 0);
@@ -4807,6 +5042,7 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4807
5042
  await api(`/tasks/${task.id}`, { method: "PUT", body: JSON.stringify({ expectedRevision: task.revision, ...change }) });
4808
5043
  await load2();
4809
5044
  } catch (reason) {
5045
+ await load2();
4810
5046
  setError(errorMessage(reason));
4811
5047
  } finally {
4812
5048
  setBusy(void 0);
@@ -4842,7 +5078,7 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4842
5078
  setBusy(task.id);
4843
5079
  setError(void 0);
4844
5080
  try {
4845
- await api(`/tasks/${task.id}/accept`, { method: "POST" });
5081
+ await api(`/tasks/${task.id}/accept`, { method: "POST", body: JSON.stringify({ expectedRevision: task.revision }) });
4846
5082
  await load2();
4847
5083
  } catch (reason) {
4848
5084
  setError(errorMessage(reason));
@@ -4855,7 +5091,7 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4855
5091
  setBusy(task.id);
4856
5092
  setError(void 0);
4857
5093
  try {
4858
- await api(`/tasks/${task.id}/reject`, { method: "POST", body: JSON.stringify({ reason }) });
5094
+ await api(`/tasks/${task.id}/reject`, { method: "POST", body: JSON.stringify({ reason, expectedRevision: task.revision }) });
4859
5095
  await load2();
4860
5096
  } catch (cause) {
4861
5097
  setError(errorMessage(cause));
@@ -4876,108 +5112,131 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4876
5112
  setBusy(void 0);
4877
5113
  }
4878
5114
  };
4879
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-feature-page is-board", children: [
4880
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WorkspaceHero, { eyebrow: "Shared workspace", title: "\u4F19\u4F34\u4EFB\u52A1\u770B\u677F", detail: "\u627F\u63A5\u591A\u6B65\u3001\u4F9D\u8D56\u548C\u8DE8\u4F19\u4F34\u5DE5\u4F5C\u3002\u524D\u7F6E\u4EFB\u52A1\u5B8C\u6210\u540E\u624D\u80FD\u6267\u884C\uFF0C\u7ED3\u679C\u9A8C\u6536\u901A\u8FC7\u540E\u624D\u4F1A\u89E3\u9501\u540E\u7EED\u4EFB\u52A1\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
4881
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "dsh-partner-board-live", title: syncedAt ? `\u6700\u8FD1\u540C\u6B65 ${new Date(syncedAt).toLocaleTimeString()}` : "\u6B63\u5728\u8FDE\u63A5", children: [
4882
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}),
4883
- "\u5B9E\u65F6\u540C\u6B65"
5115
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-partner-feature-page is-board", children: [
5116
+ !detailOnly && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
5117
+ back && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("nav", { className: "dsh-partner-requirement-breadcrumb", children: [
5118
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", onClick: back, children: "\u9700\u6C42\u770B\u677F" }),
5119
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.IconChevronRightOutline14, { size: 14 }),
5120
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: requirement?.title ?? "\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1" })
4884
5121
  ] }),
4885
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", onClick: () => setCreating(true), children: [
4886
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives7.IconPlusOutline16, { size: 15 }),
4887
- "\u65B0\u4EFB\u52A1"
4888
- ] })
4889
- ] }) }),
4890
- error && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WorkspaceNotice, { children: error }),
4891
- creating && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u4EFB\u52A1", detail: "\u5199\u6E05\u76EE\u6807\u3001\u8D1F\u8D23\u4EBA\u548C\u9A8C\u6536\u8FB9\u754C\uFF1B\u53EA\u6709\u771F\u6B63\u5B58\u5728\u524D\u7F6E\u5173\u7CFB\u65F6\u624D\u6DFB\u52A0\u4F9D\u8D56\u3002", close: () => setCreating(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TaskForm, { companions: directory, tasks: board.tasks, close: () => setCreating(false), changed: load2 }) }),
4892
- selectedTask && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WorkspaceDialog, { eyebrow: "TASK DETAIL", title: selectedTask.title, detail: taskDialogSummary(selectedTask, directory), close: () => setSelectedTaskId(void 0), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4893
- TaskDetail,
4894
- {
4895
- task: selectedTask,
4896
- tasks: board.tasks,
4897
- activities: board.activities.filter((item) => item.taskId === selectedTask.id),
4898
- directory,
4899
- execution: activeDelegationByTaskId.get(selectedTask.id),
4900
- busy: busy === selectedTask.id,
4901
- update: (change) => {
4902
- void update(selectedTask, change);
4903
- },
4904
- delegate: () => {
4905
- void delegate(selectedTask);
4906
- },
4907
- review: () => {
4908
- void review(selectedTask);
4909
- },
4910
- accept: () => {
4911
- void accept(selectedTask);
4912
- },
4913
- reject: (reason) => {
4914
- void reject(selectedTask, reason);
5122
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(WorkspaceHero, { eyebrow: requirement ? requirementStatus(requirement) : "\u65E7\u4EFB\u52A1", title: requirement?.title ?? "\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1", detail: requirement?.description || "\u4EFB\u52A1\u6309\u9636\u6BB5\u5C55\u793A\uFF0C\u70B9\u51FB\u67E5\u770B\u4EA4\u4ED8\u3001\u4F9D\u8D56\u548C\u6267\u884C\u72B6\u6001\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
5123
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsh-partner-board-live", title: syncedAt ? `\u6700\u8FD1\u540C\u6B65 ${new Date(syncedAt).toLocaleTimeString()}` : "\u6B63\u5728\u8FDE\u63A5", children: [
5124
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", {}),
5125
+ "\u5B9E\u65F6\u540C\u6B65"
5126
+ ] }),
5127
+ requirement && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", onClick: () => setRequirementDetail(true), children: "\u9700\u6C42\u8BE6\u60C5" }),
5128
+ requirement?.status === "planning" && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", onClick: () => setCreating(true), children: [
5129
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.IconPlusOutline16, { size: 15 }),
5130
+ "\u65B0\u4EFB\u52A1"
5131
+ ] })
5132
+ ] }) })
5133
+ ] }),
5134
+ error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(WorkspaceNotice, { children: error }),
5135
+ requirementDetail && requirement && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(WorkspaceDialog, { eyebrow: "\u9700\u6C42\u8BE6\u60C5", title: requirement.title, detail: requirementStatus(requirement), close: () => setRequirementDetail(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RequirementDetail, { item: requirement, tasks: requirementTasks, directory, changed: load2, close: () => setRequirementDetail(false) }, requirement.id) }),
5136
+ creating && requirement && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u5B50\u4EFB\u52A1", detail: `\u6240\u5C5E\u9700\u6C42\uFF1A${requirement.title}`, close: () => setCreating(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TaskForm, { requirementId: requirement.id, companions: directory, tasks: requirementTasks, close: () => setCreating(false), changed: load2 }) }),
5137
+ selectedTask && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(WorkspaceDialog, { eyebrow: "TASK DETAIL", title: selectedTask.title, detail: taskDialogSummary(selectedTask, directory), close: () => setSelectedTaskId(void 0), width: "wide", children: [
5138
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5139
+ TaskDetail,
5140
+ {
5141
+ task: selectedTask,
5142
+ tasks: board.tasks,
5143
+ activities: board.activities.filter((item) => item.taskId === selectedTask.id),
5144
+ directory,
5145
+ execution: activeDelegationByTaskId.get(selectedTask.id),
5146
+ busy: busy === selectedTask.id,
5147
+ update: (change) => {
5148
+ void update(selectedTask, change);
5149
+ },
5150
+ delegate: () => {
5151
+ void delegate(selectedTask);
5152
+ },
5153
+ review: () => {
5154
+ void review(selectedTask);
5155
+ },
5156
+ accept: () => {
5157
+ void accept(selectedTask);
5158
+ },
5159
+ reject: (reason) => {
5160
+ void reject(selectedTask, reason);
5161
+ },
5162
+ remove: () => {
5163
+ void remove(selectedTask);
5164
+ }
4915
5165
  },
4916
- remove: () => {
4917
- void remove(selectedTask);
4918
- }
4919
- },
4920
- selectedTask.id
4921
- ) }),
4922
- loading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CollectionSkeleton, { rows: 6 }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
4923
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-board-tools", children: [
4924
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "dsh-partner-board-search", children: [
4925
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u4EFB\u52A1" }),
4926
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives7.IconSearchOutline16, { size: 16 }) }),
4927
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: "\u641C\u7D22\u4EFB\u52A1\u3001\u8D1F\u8D23\u4EBA\u6216\u524D\u7F6E\u4EFB\u52A1" }),
4928
- query && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => setQuery(""), "aria-label": "\u6E05\u9664\u4EFB\u52A1\u641C\u7D22", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives7.IconCloseOutline16, { size: 14 }) })
5166
+ selectedTask.id
5167
+ ),
5168
+ error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(WorkspaceNotice, { children: error })
5169
+ ] }),
5170
+ !detailOnly && (loading ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CollectionSkeleton, { rows: 6 }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
5171
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-partner-board-tools", children: [
5172
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "dsh-partner-board-search", children: [
5173
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u4EFB\u52A1" }),
5174
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.IconSearchOutline16, { size: 16 }) }),
5175
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: "\u641C\u7D22\u4EFB\u52A1\u3001\u8D1F\u8D23\u4EBA\u6216\u524D\u7F6E\u4EFB\u52A1" }),
5176
+ query && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", onClick: () => setQuery(""), "aria-label": "\u6E05\u9664\u4EFB\u52A1\u641C\u7D22", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.IconCloseOutline16, { size: 14 }) })
4929
5177
  ] }),
4930
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "dsh-partner-board-assignee", children: [
4931
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "\u6309\u8D1F\u8D23\u4EBA\u7B5B\u9009" }),
4932
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { value: assigneeFilter, onChange: (event) => setAssigneeFilter(event.target.value), children: [
4933
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "all", children: "\u5168\u90E8\u4F19\u4F34" }),
4934
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "unassigned", children: "\u672A\u6307\u6D3E" }),
4935
- directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: item.id, children: [
5178
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "dsh-partner-board-assignee", children: [
5179
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "sr-only", children: "\u6309\u8D1F\u8D23\u4EBA\u7B5B\u9009" }),
5180
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("select", { value: assigneeFilter, onChange: (event) => setAssigneeFilter(event.target.value), children: [
5181
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "all", children: "\u5168\u90E8\u4F19\u4F34" }),
5182
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "unassigned", children: "\u672A\u6307\u6D3E" }),
5183
+ directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("option", { value: item.id, children: [
4936
5184
  "@",
4937
5185
  item.name
4938
5186
  ] }, item.id))
4939
5187
  ] })
4940
5188
  ] }),
4941
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { "aria-live": "polite", children: [
5189
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "dsh-partner-board-assignee is-mobile-stage", children: [
5190
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "sr-only", children: "\u6309\u4EFB\u52A1\u9636\u6BB5\u7B5B\u9009" }),
5191
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("select", { value: statusFilter, onChange: (event) => setStatusFilter(event.target.value), children: [
5192
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("option", { value: "all", children: [
5193
+ "\u5168\u90E8\u9636\u6BB5 \xB7 ",
5194
+ scopedTasks.length
5195
+ ] }),
5196
+ COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("option", { value: column.id, children: [
5197
+ column.label,
5198
+ " \xB7 ",
5199
+ statusCounts.get(column.id) ?? 0
5200
+ ] }, column.id))
5201
+ ] })
5202
+ ] }),
5203
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("small", { "aria-live": "polite", children: [
4942
5204
  "\u663E\u793A ",
4943
5205
  visibleTaskCount,
4944
5206
  " / ",
4945
5207
  board.tasks.length
4946
5208
  ] })
4947
5209
  ] }),
4948
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("nav", { className: "dsh-partner-board-statuses", "aria-label": "\u6309\u4EFB\u52A1\u72B6\u6001\u7B5B\u9009", children: [
4949
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: statusFilter === "all" ? "is-active" : "", "aria-pressed": statusFilter === "all", onClick: () => setStatusFilter("all"), children: [
4950
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u5168\u90E8" }),
4951
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: scopedTasks.length })
5210
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("nav", { className: "dsh-partner-board-statuses", "aria-label": "\u6309\u4EFB\u52A1\u72B6\u6001\u7B5B\u9009", children: [
5211
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", className: statusFilter === "all" ? "is-active" : "", "aria-pressed": statusFilter === "all", onClick: () => setStatusFilter("all"), children: [
5212
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u5168\u90E8" }),
5213
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("b", { children: scopedTasks.length })
4952
5214
  ] }),
4953
- COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: statusFilter === column.id ? "is-active" : "", "aria-pressed": statusFilter === column.id, onClick: () => setStatusFilter(column.id), children: [
4954
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: column.label }),
4955
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: statusCounts.get(column.id) ?? 0 })
5215
+ COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", className: statusFilter === column.id ? "is-active" : "", "aria-pressed": statusFilter === column.id, onClick: () => setStatusFilter(column.id), children: [
5216
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: column.label }),
5217
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("b", { children: statusCounts.get(column.id) ?? 0 })
4956
5218
  ] }, column.id))
4957
5219
  ] }),
4958
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-board", "data-focused": statusFilter !== "all", "aria-label": "\u4EFB\u52A1\u770B\u677F", children: visibleColumns.map((column) => {
5220
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "dsh-partner-board", "data-focused": statusFilter !== "all", "aria-label": "\u4EFB\u52A1\u770B\u677F", children: visibleColumns.map((column) => {
4959
5221
  const tasks = tasksByStatus.get(column.id) ?? [];
4960
- const columnTitleId = `dsh-partner-board-${column.id}`;
4961
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { "data-status": column.id, "data-empty": tasks.length === 0, "aria-labelledby": columnTitleId, children: [
4962
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { children: [
4963
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { id: columnTitleId, children: column.label }),
4964
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: tasks.length })
4965
- ] }),
4966
- tasks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-board-column-list", children: tasks.map((task) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4967
- TaskCard,
4968
- {
4969
- task,
4970
- tasksById,
4971
- directoryById,
4972
- dependentCount: dependentsById.get(task.id) ?? 0,
4973
- execution: activeDelegationByTaskId.get(task.id),
4974
- open: () => setSelectedTaskId(task.id)
4975
- },
4976
- task.id
4977
- )) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: query || assigneeFilter !== "all" ? "\u6CA1\u6709\u5339\u914D\u4EFB\u52A1" : "\u6682\u65E0\u4EFB\u52A1" })
4978
- ] }, column.id);
4979
- }) })
4980
- ] })
5222
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TaskBoardStage, { id: column.id, label: column.label, tasks, focused: statusFilter !== "all", filtered: Boolean(query || assigneeFilter !== "all"), renderTask: (task) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5223
+ TaskCard,
5224
+ {
5225
+ task,
5226
+ tasksById,
5227
+ directoryById,
5228
+ dependentCount: dependentsById.get(task.id) ?? 0,
5229
+ execution: activeDelegationByTaskId.get(task.id),
5230
+ open: () => setSelectedTaskId(task.id)
5231
+ },
5232
+ task.id
5233
+ ) }, column.id);
5234
+ }) }),
5235
+ !scopedTasks.length && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-partner-collection-empty", children: [
5236
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: query || assigneeFilter !== "all" ? "\u6CA1\u6709\u5339\u914D\u7684\u4EFB\u52A1" : "\u8FD8\u6CA1\u6709\u5B50\u4EFB\u52A1" }),
5237
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: requirement?.status === "planning" ? "\u6DFB\u52A0\u5B50\u4EFB\u52A1\u5E76\u5B89\u6392\u8D1F\u8D23\u4EBA\uFF0C\u5B8C\u6210\u5206\u5DE5\u540E\u5728\u9700\u6C42\u8BE6\u60C5\u4E2D\u63D0\u4EA4\u89C4\u5212\u3002" : "\u53EF\u8FD4\u56DE\u9700\u6C42\u770B\u677F\u67E5\u770B\u5176\u4ED6\u9700\u6C42\u3002" })
5238
+ ] })
5239
+ ] }))
4981
5240
  ] });
4982
5241
  }
4983
5242
  function TaskCard({ task, tasksById, directoryById, dependentCount, execution, open }) {
@@ -4985,62 +5244,62 @@ function TaskCard({ task, tasksById, directoryById, dependentCount, execution, o
4985
5244
  const blockers = dependencies.filter((item) => item.status !== "done");
4986
5245
  const completedDependencies = dependencies.length - blockers.length;
4987
5246
  const assignee = directoryById.get(task.assigneeCompanionId ?? "");
4988
- const executionState = execution ? delegationState(execution) : void 0;
4989
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("article", { className: "dsh-partner-task-card", "data-blocked": blockers.length > 0, "data-priority": task.priority, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "dsh-partner-task-summary", "aria-haspopup": "dialog", onClick: open, children: [
4990
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
4991
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "dsh-partner-task-card-title", children: [
4992
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { title: task.title, children: task.title }),
4993
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("em", { children: priorityLabel(task.priority) })
5247
+ const executionState = execution ? delegationState(execution, blockers.length) : task.autoRun && task.status === "ready" ? { label: blockers.length ? "\u7B49\u5F85\u524D\u7F6E\u5B8C\u6210" : "\u7B49\u5F85\u8C03\u5EA6" } : void 0;
5248
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("article", { className: "dsh-partner-task-card", "data-blocked": blockers.length > 0, "data-priority": task.priority, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", className: "dsh-partner-task-summary", "aria-haspopup": "dialog", onClick: open, children: [
5249
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
5250
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsh-partner-task-card-title", children: [
5251
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { title: task.title, children: task.title }),
5252
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("em", { children: priorityLabel(task.priority) })
4994
5253
  ] }),
4995
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { className: "dsh-partner-task-card-owner", children: [
5254
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("small", { className: "dsh-partner-task-card-owner", children: [
4996
5255
  assignee ? `@${assignee.name}` : "\u672A\u6307\u6D3E",
4997
5256
  task.resultSummary ? " \xB7 \u5DF2\u6709\u7ED3\u679C" : "",
4998
5257
  executionState ? ` \xB7 ${executionState.label}` : ""
4999
5258
  ] }),
5000
- (dependencies.length > 0 || dependentCount > 0) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "dsh-partner-task-relations", children: [
5001
- dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { "data-blocked": blockers.length > 0, children: [
5259
+ (dependencies.length > 0 || dependentCount > 0) && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsh-partner-task-relations", children: [
5260
+ dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("small", { "data-blocked": blockers.length > 0, children: [
5002
5261
  "\u524D\u7F6E ",
5003
5262
  completedDependencies,
5004
5263
  "/",
5005
5264
  dependencies.length
5006
5265
  ] }),
5007
- dependentCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { children: [
5266
+ dependentCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("small", { children: [
5008
5267
  "\u5B8C\u6210\u540E\u89E3\u9501 ",
5009
5268
  dependentCount
5010
5269
  ] })
5011
5270
  ] })
5012
5271
  ] }),
5013
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives7.IconChevronRightOutline14, { size: 14 })
5272
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.IconChevronRightOutline14, { size: 14 })
5014
5273
  ] }) });
5015
5274
  }
5016
5275
  function TaskDetail({ task, tasks, activities, directory, execution, busy, update, delegate, review, accept, reject, remove }) {
5017
- const [rejecting, setRejecting] = (0, import_react14.useState)(false);
5018
- const [rejectReason, setRejectReason] = (0, import_react14.useState)("");
5019
- const [confirmingDelete, setConfirmingDelete] = (0, import_react14.useState)(false);
5020
- const byId = (0, import_react14.useMemo)(() => new Map(tasks.map((item) => [item.id, item])), [tasks]);
5276
+ const [rejecting, setRejecting] = (0, import_react17.useState)(false);
5277
+ const [rejectReason, setRejectReason] = (0, import_react17.useState)("");
5278
+ const [confirmingDelete, setConfirmingDelete] = (0, import_react17.useState)(false);
5279
+ const byId = (0, import_react17.useMemo)(() => new Map(tasks.map((item) => [item.id, item])), [tasks]);
5021
5280
  const dependencies = task.dependencyTaskIds.map((id) => byId.get(id)).filter((item) => item !== void 0);
5022
5281
  const blockers = dependencies.filter((item) => item.status !== "done");
5023
5282
  const assignee = directory.find((item) => item.id === task.assigneeCompanionId);
5024
5283
  const reviewer = directory.find((item) => item.id === task.reviewerCompanionId);
5025
5284
  const dependencyCandidates = tasks.filter((item) => item.id !== task.id && !task.dependencyTaskIds.includes(item.id) && !dependsOn(item.id, task.id, byId));
5026
- const canExecute = Boolean(task.assigneeCompanionId) && blockers.length === 0 && !["doing", "review", "done"].includes(task.status);
5285
+ const canExecute = Boolean(task.assigneeCompanionId) && !execution && !["doing", "review", "done"].includes(task.status);
5027
5286
  const recentActivities = [...activities].sort((left, right) => right.at - left.at).slice(0, 6);
5028
- const executionState = execution ? delegationState(execution) : void 0;
5029
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-task-detail", children: [
5030
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-task-description", children: [
5031
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
5032
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: task.description || "\u6CA1\u6709\u8865\u5145\u8BF4\u660E" })
5287
+ const executionState = execution ? delegationState(execution, blockers.length) : void 0;
5288
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-partner-task-detail", children: [
5289
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: "dsh-partner-task-description", children: [
5290
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
5291
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: task.description || "\u6CA1\u6709\u8865\u5145\u8BF4\u660E" })
5033
5292
  ] }),
5034
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-task-fields", children: [
5035
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5036
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u72B6\u6001" }),
5037
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("select", { value: task.status, disabled: busy, onChange: (event) => update({ status: event.target.value }), children: COLUMNS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: item.id, disabled: (item.id === "doing" || item.id === "review" || item.id === "done") && blockers.length > 0 || item.id === "done" && task.status !== "review" && task.status !== "done", children: item.label }, item.id)) })
5293
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-partner-task-fields", children: [
5294
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5295
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u72B6\u6001" }),
5296
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("select", { value: task.status, disabled: busy, onChange: (event) => update({ status: event.target.value }), children: COLUMNS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: item.id, disabled: (item.id === "doing" || item.id === "review" || item.id === "done") && blockers.length > 0 || item.id === "done" && task.status !== "review" && task.status !== "done", children: item.label }, item.id)) })
5038
5297
  ] }),
5039
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5040
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
5041
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { value: task.assigneeCompanionId ?? "", disabled: busy || task.status === "doing", onChange: (event) => update({ assigneeCompanionId: event.target.value }), children: [
5042
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
5043
- directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: item.id, children: [
5298
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5299
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
5300
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("select", { value: task.assigneeCompanionId ?? "", disabled: busy || task.status === "doing", onChange: (event) => update({ assigneeCompanionId: event.target.value }), children: [
5301
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
5302
+ directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("option", { value: item.id, children: [
5044
5303
  "@",
5045
5304
  item.name,
5046
5305
  " \xB7 ",
@@ -5048,43 +5307,43 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
5048
5307
  ] }, item.id))
5049
5308
  ] })
5050
5309
  ] }),
5051
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5052
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
5053
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { value: task.reviewerCompanionId ?? "", disabled: busy, onChange: (event) => update({ reviewerCompanionId: event.target.value }), children: [
5054
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
5055
- directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: item.id, children: [
5310
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5311
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
5312
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("select", { value: task.reviewerCompanionId ?? "", disabled: busy, onChange: (event) => update({ reviewerCompanionId: event.target.value }), children: [
5313
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
5314
+ directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("option", { value: item.id, children: [
5056
5315
  "@",
5057
5316
  item.name
5058
5317
  ] }, item.id))
5059
5318
  ] })
5060
5319
  ] })
5061
5320
  ] }),
5062
- executionState && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-task-execution", "data-state": execution?.status, children: [
5063
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}),
5064
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
5065
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: executionState.title }),
5066
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: executionState.detail })
5321
+ executionState && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: "dsh-partner-task-execution", "data-state": execution?.status, children: [
5322
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", {}),
5323
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
5324
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: executionState.title }),
5325
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: executionState.detail })
5067
5326
  ] })
5068
5327
  ] }),
5069
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-task-dependency", children: [
5070
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { children: [
5071
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u524D\u7F6E\u4EFB\u52A1" }),
5072
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: blockers.length ? `${blockers.length} \u9879\u672A\u5B8C\u6210\uFF0C\u5F53\u524D\u4EFB\u52A1\u4E0D\u80FD\u542F\u52A8` : dependencies.length ? "\u5DF2\u5168\u90E8\u5B8C\u6210\uFF0C\u53EF\u4EE5\u542F\u52A8" : "\u6CA1\u6709\u524D\u7F6E\u4F9D\u8D56" })
5328
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: "dsh-partner-task-dependency", children: [
5329
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("header", { children: [
5330
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "\u524D\u7F6E\u4EFB\u52A1" }),
5331
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: blockers.length ? `${blockers.length} \u9879\u672A\u5B8C\u6210\uFF0C\u5F53\u524D\u4EFB\u52A1\u4E0D\u80FD\u542F\u52A8` : dependencies.length ? "\u5DF2\u5168\u90E8\u5B8C\u6210\uFF0C\u53EF\u4EE5\u542F\u52A8" : "\u6CA1\u6709\u524D\u7F6E\u4F9D\u8D56" })
5073
5332
  ] }),
5074
- dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: dependencies.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { "data-done": item.status === "done", children: [
5075
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", { children: item.status === "done" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives7.IconCheckOutline16, { size: 12 }) : "" }),
5076
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: item.title }),
5077
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy || ["doing", "review", "done"].includes(task.status), "aria-label": `\u79FB\u9664\u524D\u7F6E\u4EFB\u52A1 ${item.title}`, onClick: () => update({ dependencyTaskIds: task.dependencyTaskIds.filter((id) => id !== item.id) }), children: "\u79FB\u9664" })
5333
+ dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { children: dependencies.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { "data-done": item.status === "done", children: [
5334
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", { children: item.status === "done" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.IconCheckOutline16, { size: 12 }) : "" }),
5335
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("b", { children: item.title }),
5336
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", disabled: busy || ["doing", "review", "done"].includes(task.status), "aria-label": `\u79FB\u9664\u524D\u7F6E\u4EFB\u52A1 ${item.title}`, onClick: () => update({ dependencyTaskIds: task.dependencyTaskIds.filter((id) => id !== item.id) }), children: "\u79FB\u9664" })
5078
5337
  ] }, item.id)) }),
5079
- dependencyCandidates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5080
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1" }),
5081
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { defaultValue: "", disabled: busy || ["doing", "review", "done"].includes(task.status), onChange: (event) => {
5338
+ dependencyCandidates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5339
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "sr-only", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1" }),
5340
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("select", { defaultValue: "", disabled: busy || ["doing", "review", "done"].includes(task.status), onChange: (event) => {
5082
5341
  const id = event.currentTarget.value;
5083
5342
  if (id) update({ dependencyTaskIds: [...task.dependencyTaskIds, id] });
5084
5343
  event.currentTarget.value = "";
5085
5344
  }, children: [
5086
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1\u2026" }),
5087
- dependencyCandidates.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: item.id, children: [
5345
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1\u2026" }),
5346
+ dependencyCandidates.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("option", { value: item.id, children: [
5088
5347
  item.title,
5089
5348
  " \xB7 ",
5090
5349
  statusLabel(item.status)
@@ -5092,16 +5351,19 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
5092
5351
  ] })
5093
5352
  ] })
5094
5353
  ] }),
5095
- task.resultSummary && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ResultBlock, { label: "\u6267\u884C\u7ED3\u679C", value: task.resultSummary }),
5096
- task.reviewSummary && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ResultBlock, { label: `\u6838\u9A8C\u610F\u89C1${reviewer ? ` \xB7 @${reviewer.name}` : ""}`, value: task.reviewSummary }),
5097
- recentActivities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-task-activity", children: [
5098
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u6700\u8FD1\u6D3B\u52A8" }),
5099
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ol", { children: recentActivities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("li", { children: [
5100
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: item.message }),
5101
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("time", { children: new Date(item.at).toLocaleString() })
5354
+ task.resultSummary && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ResultBlock, { label: "\u6267\u884C\u7ED3\u679C", value: task.resultSummary }),
5355
+ task.reviewSummary && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ResultBlock, { label: `\u6838\u9A8C\u610F\u89C1${reviewer ? ` \xB7 @${reviewer.name}` : ""}`, value: task.reviewSummary }),
5356
+ recentActivities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("details", { className: "dsh-partner-task-activity dsh-partner-requirement-disclosure", children: [
5357
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("summary", { children: [
5358
+ "\u6700\u8FD1\u6D3B\u52A8 \xB7 ",
5359
+ recentActivities.length
5360
+ ] }),
5361
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ol", { children: recentActivities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("li", { children: [
5362
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: item.message }),
5363
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("time", { children: new Date(item.at).toLocaleString() })
5102
5364
  ] }, item.id)) })
5103
5365
  ] }),
5104
- rejecting && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { className: "dsh-partner-task-reject", onSubmit: (event) => {
5366
+ rejecting && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("form", { className: "dsh-partner-task-reject", onSubmit: (event) => {
5105
5367
  event.preventDefault();
5106
5368
  const reason = rejectReason.trim();
5107
5369
  if (!reason) return;
@@ -5109,52 +5371,52 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
5109
5371
  setRejecting(false);
5110
5372
  setRejectReason("");
5111
5373
  }, children: [
5112
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5113
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u6253\u56DE\u539F\u56E0" }),
5114
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("textarea", { autoFocus: true, value: rejectReason, onChange: (event) => setRejectReason(event.target.value), rows: 3, maxLength: 1200, placeholder: "\u8BF4\u660E\u9700\u8981\u91CD\u505A\u6216\u8865\u5145\u7684\u5185\u5BB9" })
5374
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5375
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u6253\u56DE\u539F\u56E0" }),
5376
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("textarea", { autoFocus: true, value: rejectReason, onChange: (event) => setRejectReason(event.target.value), rows: 3, maxLength: 1200, placeholder: "\u8BF4\u660E\u9700\u8981\u91CD\u505A\u6216\u8865\u5145\u7684\u5185\u5BB9" })
5115
5377
  ] }),
5116
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
5117
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => {
5378
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
5379
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", onClick: () => {
5118
5380
  setRejecting(false);
5119
5381
  setRejectReason("");
5120
5382
  }, children: "\u53D6\u6D88" }),
5121
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !rejectReason.trim(), children: "\u786E\u8BA4\u6253\u56DE" })
5383
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !rejectReason.trim(), children: "\u786E\u8BA4\u6253\u56DE" })
5122
5384
  ] })
5123
5385
  ] }),
5124
- confirmingDelete && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-task-delete-confirm", role: "alert", children: [
5125
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u5220\u9664\u540E\uFF0C\u4F9D\u8D56\u5B83\u7684\u4EFB\u52A1\u4F1A\u89E3\u9664\u8FD9\u6761\u524D\u7F6E\u5173\u7CFB\u3002" }),
5126
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
5127
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => setConfirmingDelete(false), children: "\u53D6\u6D88" }),
5128
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
5386
+ confirmingDelete && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-partner-task-delete-confirm", role: "alert", children: [
5387
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u5220\u9664\u4F1A\u53D6\u6D88\u5173\u8054\u6267\u884C\uFF0C\u4F9D\u8D56\u5B83\u7684\u672A\u5B8C\u6210\u4EFB\u52A1\u5C06\u6682\u505C\u3002\u9700\u6C42\u9700\u91CD\u65B0\u786E\u8BA4\u8303\u56F4\uFF1B\u4E0D\u80FD\u64A4\u9500\u3002" }),
5388
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
5389
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", onClick: () => setConfirmingDelete(false), children: "\u4FDD\u7559\u4EFB\u52A1" }),
5390
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
5129
5391
  ] })
5130
5392
  ] }),
5131
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("footer", { className: "dsh-partner-task-actions", children: [
5132
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { children: [
5393
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("footer", { className: "dsh-partner-task-actions", children: [
5394
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("small", { children: [
5133
5395
  "r",
5134
5396
  task.revision,
5135
5397
  " \xB7 ",
5136
5398
  new Date(task.updatedAt).toLocaleString()
5137
5399
  ] }),
5138
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
5139
- task.status === "review" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
5140
- task.reviewerCompanionId && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy, onClick: review, children: busy ? "\u6838\u9A8C\u4E2D\u2026" : `\u4EA4\u7ED9 @${reviewer?.name ?? "\u4F19\u4F34"} \u6838\u9A8C` }),
5141
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy, onClick: () => setRejecting(true), children: "\u6253\u56DE\u91CD\u505A" }),
5142
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: accept, children: "\u9A8C\u6536\u901A\u8FC7" })
5143
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy || !canExecute, title: blockers.length ? "\u524D\u7F6E\u4EFB\u52A1\u5C1A\u672A\u5B8C\u6210" : !task.assigneeCompanionId ? "\u8BF7\u5148\u9009\u62E9\u8D1F\u8D23\u4EBA" : void 0, onClick: delegate, children: busy ? "\u6267\u884C\u4E2D\u2026" : task.status === "doing" ? "\u6B63\u5728\u6267\u884C" : task.status === "done" ? "\u5DF2\u7ECF\u5B8C\u6210" : `\u4EA4\u7ED9 @${assignee?.name ?? "\u4F19\u4F34"}` }),
5144
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "is-icon", "aria-label": `\u5220\u9664 ${task.title}`, "aria-expanded": confirmingDelete, disabled: busy, onClick: () => setConfirmingDelete(true), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives7.IconTrashOutline16, { size: 14 }) })
5400
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
5401
+ task.status === "review" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
5402
+ task.reviewerCompanionId && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", disabled: busy, onClick: review, children: busy ? "\u6838\u9A8C\u4E2D\u2026" : `\u4EA4\u7ED9 @${reviewer?.name ?? "\u4F19\u4F34"} \u6838\u9A8C` }),
5403
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", disabled: busy, onClick: () => setRejecting(true), children: "\u6253\u56DE\u91CD\u505A" }),
5404
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: accept, children: "\u9A8C\u6536\u901A\u8FC7" })
5405
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", disabled: busy || !canExecute, title: blockers.length ? "\u53EF\u63D0\u524D\u6392\u961F\uFF0C\u4F9D\u8D56\u901A\u8FC7\u9A8C\u6536\u540E\u81EA\u52A8\u6267\u884C" : !task.assigneeCompanionId ? "\u8BF7\u5148\u9009\u62E9\u8D1F\u8D23\u4EBA" : void 0, onClick: delegate, children: busy ? "\u6267\u884C\u4E2D\u2026" : execution?.status === "queued" ? "\u5DF2\u63D0\u4EA4\uFF0C\u7B49\u5F85\u6267\u884C" : task.status === "doing" ? "\u6B63\u5728\u6267\u884C" : task.status === "done" ? "\u5DF2\u7ECF\u5B8C\u6210" : `\u4EA4\u7ED9 @${assignee?.name ?? "\u4F19\u4F34"}` }),
5406
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "is-icon", "aria-label": `\u5220\u9664 ${task.title}`, "aria-expanded": confirmingDelete, disabled: busy, onClick: () => setConfirmingDelete(true), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.IconTrashOutline16, { size: 14 }) })
5145
5407
  ] })
5146
5408
  ] })
5147
5409
  ] });
5148
5410
  }
5149
5411
  function ResultBlock({ label, value }) {
5150
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-task-result", children: [
5151
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: label }),
5152
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: value })
5412
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: "dsh-partner-task-result", children: [
5413
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: label }),
5414
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: value })
5153
5415
  ] });
5154
5416
  }
5155
- function TaskForm({ companions, tasks, close, changed: changed2 }) {
5156
- const [error, setError] = (0, import_react14.useState)();
5157
- const [busy, setBusy] = (0, import_react14.useState)(false);
5417
+ function TaskForm({ requirementId, companions, tasks, close, changed: changed2 }) {
5418
+ const [error, setError] = (0, import_react17.useState)();
5419
+ const [busy, setBusy] = (0, import_react17.useState)(false);
5158
5420
  const dependencyOptions = tasks.filter((item) => item.status !== "done");
5159
5421
  const submit = async (event) => {
5160
5422
  event.preventDefault();
@@ -5163,10 +5425,11 @@ function TaskForm({ companions, tasks, close, changed: changed2 }) {
5163
5425
  setError(void 0);
5164
5426
  try {
5165
5427
  await api("/tasks", { method: "POST", body: JSON.stringify({
5428
+ requirementId,
5166
5429
  title: data.get("title"),
5167
5430
  description: data.get("description"),
5168
5431
  priority: data.get("priority"),
5169
- status: "backlog",
5432
+ autoRun: data.get("submission") === "run" && Boolean(data.get("assignee")),
5170
5433
  assigneeCompanionId: data.get("assignee") || void 0,
5171
5434
  reviewerCompanionId: data.get("reviewer") || void 0,
5172
5435
  dependencyTaskIds: data.getAll("dependencyTaskId")
@@ -5179,64 +5442,71 @@ function TaskForm({ companions, tasks, close, changed: changed2 }) {
5179
5442
  setBusy(false);
5180
5443
  }
5181
5444
  };
5182
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { className: "dsh-partner-task-form", "aria-busy": busy, onSubmit: (event) => {
5445
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("form", { className: "dsh-partner-task-form", "aria-busy": busy, onSubmit: (event) => {
5183
5446
  void submit(event);
5184
5447
  }, children: [
5185
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5186
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u4EFB\u52A1\u540D\u79F0" }),
5187
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { name: "title", maxLength: 200, required: true, autoFocus: true, placeholder: "\u4E00\u53E5\u8BDD\u8BF4\u660E\u4EA4\u4ED8\u76EE\u6807" })
5448
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5449
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u4EFB\u52A1\u540D\u79F0" }),
5450
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { name: "title", maxLength: 200, required: true, autoFocus: true, placeholder: "\u4E00\u53E5\u8BDD\u8BF4\u660E\u4EA4\u4ED8\u76EE\u6807" })
5188
5451
  ] }),
5189
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5190
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
5191
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { name: "assignee", defaultValue: "", children: [
5192
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
5193
- companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: item.id, children: [
5452
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5453
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
5454
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("select", { name: "assignee", defaultValue: "", children: [
5455
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
5456
+ companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("option", { value: item.id, children: [
5194
5457
  "@",
5195
5458
  item.name
5196
5459
  ] }, item.id))
5197
5460
  ] })
5198
5461
  ] }),
5199
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "is-wide", children: [
5200
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
5201
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("textarea", { name: "description", maxLength: 8e3, rows: 5, placeholder: "\u8865\u5145\u80CC\u666F\u3001\u4EA4\u4ED8\u7269\u548C\u5B8C\u6210\u6761\u4EF6" })
5462
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "is-wide", children: [
5463
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
5464
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("textarea", { name: "description", maxLength: 8e3, rows: 5, placeholder: "\u8865\u5145\u80CC\u666F\u3001\u4EA4\u4ED8\u7269\u548C\u5B8C\u6210\u6761\u4EF6" })
5202
5465
  ] }),
5203
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5204
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u4F18\u5148\u7EA7" }),
5205
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { name: "priority", defaultValue: "normal", children: [
5206
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "low", children: "\u4F4E" }),
5207
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "normal", children: "\u666E\u901A" }),
5208
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "high", children: "\u9AD8" }),
5209
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "urgent", children: "\u7D27\u6025" })
5466
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5467
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u4F18\u5148\u7EA7" }),
5468
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("select", { name: "priority", defaultValue: "normal", children: [
5469
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "low", children: "\u4F4E" }),
5470
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "normal", children: "\u666E\u901A" }),
5471
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "high", children: "\u9AD8" }),
5472
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "urgent", children: "\u7D27\u6025" })
5210
5473
  ] })
5211
5474
  ] }),
5212
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5213
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
5214
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { name: "reviewer", defaultValue: "", children: [
5215
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
5216
- companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: item.id, children: [
5475
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5476
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
5477
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("select", { name: "reviewer", defaultValue: "", children: [
5478
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
5479
+ companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("option", { value: item.id, children: [
5217
5480
  "@",
5218
5481
  item.name
5219
5482
  ] }, item.id))
5220
5483
  ] })
5221
5484
  ] }),
5222
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-task-form-dependencies is-wide", children: [
5223
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
5485
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-partner-task-form-dependencies is-wide", children: [
5486
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
5224
5487
  "\u4F9D\u8D56\u4EFB\u52A1 ",
5225
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u53EF\u9009" })
5488
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "\u53EF\u9009" })
5226
5489
  ] }),
5227
- dependencyOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: dependencyOptions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5228
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { type: "checkbox", name: "dependencyTaskId", value: item.id }),
5229
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}),
5230
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: item.title }),
5231
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: statusLabel(item.status) })
5232
- ] }, item.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: "\u5F53\u524D\u6CA1\u6709\u53EF\u9009\u7684\u672A\u5B8C\u6210\u4EFB\u52A1" }),
5233
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u53EF\u4EE5\u9009\u62E9\u591A\u4E2A\uFF1B\u7559\u7A7A\u8868\u793A\u8BE5\u4EFB\u52A1\u4E0D\u4F9D\u8D56\u5176\u4ED6\u4EFB\u52A1\u3002" })
5490
+ dependencyOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { children: dependencyOptions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5491
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { type: "checkbox", name: "dependencyTaskId", value: item.id }),
5492
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", {}),
5493
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: item.title }),
5494
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: statusLabel(item.status) })
5495
+ ] }, item.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: "\u5F53\u524D\u6CA1\u6709\u53EF\u9009\u7684\u672A\u5B8C\u6210\u4EFB\u52A1" }),
5496
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "\u53EF\u4EE5\u9009\u62E9\u591A\u4E2A\uFF1B\u7559\u7A7A\u8868\u793A\u8BE5\u4EFB\u52A1\u4E0D\u4F9D\u8D56\u5176\u4ED6\u4EFB\u52A1\u3002" })
5234
5497
  ] }),
5235
- error && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WorkspaceNotice, { children: error }),
5236
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("footer", { children: [
5237
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
5238
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
5239
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives7.IconPlusOutline16, { size: 14 }),
5498
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "is-wide", children: [
5499
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u521B\u5EFA\u540E\u6267\u884C" }),
5500
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("select", { name: "submission", defaultValue: "run", children: [
5501
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "run", children: "\u5DF2\u6307\u5B9A\u8D1F\u8D23\u4EBA\u5219\u81EA\u52A8\u6392\u961F\uFF0C\u7B49\u5F85\u4F9D\u8D56\u5B8C\u6210\u540E\u6267\u884C" }),
5502
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "plan", children: "\u4EC5\u89C4\u5212\uFF0C\u7A0D\u540E\u624B\u52A8\u63D0\u4EA4" })
5503
+ ] })
5504
+ ] }),
5505
+ error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(WorkspaceNotice, { children: error }),
5506
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("footer", { children: [
5507
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
5508
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
5509
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.IconPlusOutline16, { size: 14 }),
5240
5510
  busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u4EFB\u52A1"
5241
5511
  ] })
5242
5512
  ] })
@@ -5258,9 +5528,10 @@ function taskDialogSummary(task, directory) {
5258
5528
  function priorityLabel(value) {
5259
5529
  return { low: "\u4F4E\u4F18\u5148\u7EA7", normal: "\u666E\u901A\u4F18\u5148\u7EA7", high: "\u9AD8\u4F18\u5148\u7EA7", urgent: "\u7D27\u6025" }[value];
5260
5530
  }
5261
- function delegationState(value) {
5531
+ function delegationState(value, blockers = 0) {
5262
5532
  const review = value.kind === "review";
5263
5533
  if (value.status === "queued") {
5534
+ if ((value.attempts ?? 0) === 0) return blockers ? { label: "\u7B49\u5F85\u524D\u7F6E\u5B8C\u6210", title: "\u4EFB\u52A1\u5DF2\u63D0\u4EA4\uFF0C\u7B49\u5F85\u4F9D\u8D56", detail: `\u8FD8\u6709 ${blockers} \u4E2A\u524D\u7F6E\u4EFB\u52A1\u672A\u901A\u8FC7\u9A8C\u6536\uFF1B\u5168\u90E8\u5B8C\u6210\u540E\u81EA\u52A8\u6267\u884C\uFF0C\u65E0\u9700\u518D\u6B21\u6307\u6D3E\u3002` } : { label: "\u6392\u961F\u4E2D", title: "\u4EFB\u52A1\u5DF2\u63D0\u4EA4", detail: "\u6B63\u5728\u7B49\u5F85\u53EF\u7528\u6267\u884C\u540D\u989D\uFF0C\u65E0\u9700\u518D\u6B21\u6307\u6D3E\u3002" };
5264
5535
  const at = value.nextAttemptAt ? new Date(value.nextAttemptAt).toLocaleString() : "\u7A0D\u540E";
5265
5536
  return { label: "\u7B49\u5F85\u81EA\u52A8\u6062\u590D", title: review ? "\u9A8C\u6536\u5C06\u5728\u8FDE\u63A5\u6062\u590D\u540E\u7EE7\u7EED" : "\u4EFB\u52A1\u5C06\u5728\u8FDE\u63A5\u6062\u590D\u540E\u7EE7\u7EED", detail: `${at} \u81EA\u52A8\u91CD\u8BD5${value.error ? ` \xB7 ${value.error}` : ""}` };
5266
5537
  }
@@ -5272,18 +5543,152 @@ function delegationState(value) {
5272
5543
  };
5273
5544
  }
5274
5545
 
5546
+ // src/ui/requirement-board.tsx
5547
+ var import_jsx_runtime13 = require("react/jsx-runtime");
5548
+ function RequirementBoard({ initialTaskId, openRequest } = {}) {
5549
+ const [board, setBoard] = (0, import_react18.useState)({ tasks: [], activities: [], requirements: [] });
5550
+ const [directory, setDirectory] = (0, import_react18.useState)([]);
5551
+ const [loading, setLoading] = (0, import_react18.useState)(true), [error, setError] = (0, import_react18.useState)();
5552
+ const [selected, setSelected] = (0, import_react18.useState)(), [detailId, setDetailId] = (0, import_react18.useState)();
5553
+ const [creating, setCreating] = (0, import_react18.useState)(false), [archived, setArchived] = (0, import_react18.useState)(false);
5554
+ const [query, setQuery] = (0, import_react18.useState)(""), [limit, setLimit] = (0, import_react18.useState)(24);
5555
+ (0, import_react18.useEffect)(() => {
5556
+ if (initialTaskId) {
5557
+ setSelected(void 0);
5558
+ setDetailId(void 0);
5559
+ setCreating(false);
5560
+ }
5561
+ }, [initialTaskId, openRequest]);
5562
+ const load2 = useBoardRefresh(async () => {
5563
+ const [next, collaboration] = await Promise.all([api("/tasks"), api("/collaboration")]);
5564
+ return () => {
5565
+ setBoard(next);
5566
+ setDirectory(collaboration.companions);
5567
+ setLoading(false);
5568
+ setError(void 0);
5569
+ setDetailId((id) => next.requirements?.some((r) => r.id === id) ? id : void 0);
5570
+ };
5571
+ }, (reason) => {
5572
+ setError(errorMessage(reason));
5573
+ setLoading(false);
5574
+ }, !selected);
5575
+ const requirements = board.requirements ?? [];
5576
+ const groups = (0, import_react18.useMemo)(() => {
5577
+ const result = /* @__PURE__ */ new Map();
5578
+ for (const task of board.tasks) {
5579
+ const id = task.requirementId ?? "legacy";
5580
+ const group = result.get(id) ?? [];
5581
+ group.push(task);
5582
+ result.set(id, group);
5583
+ }
5584
+ return result;
5585
+ }, [board.tasks]);
5586
+ const visible = requirements.filter((r) => r.status === "done" === archived && [r.title, r.description, directory.find((c) => c.id === r.ownerCompanionId)?.name].some((v) => v?.toLocaleLowerCase().includes(query.trim().toLocaleLowerCase()))).sort((a, b) => b.updatedAt - a.updatedAt);
5587
+ const detail = requirements.find((r) => r.id === detailId);
5588
+ if (selected) return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RequirementTasksPanel, { requirementId: selected, back: () => {
5589
+ setSelected(void 0);
5590
+ void load2();
5591
+ } }, selected);
5592
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-partner-feature-page is-board", children: [
5593
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WorkspaceHero, { eyebrow: "Shared workspace", title: "\u9700\u6C42\u770B\u677F", detail: "\u6309\u9700\u6C42\u7EC4\u7EC7\u5DE5\u4F5C\uFF0C\u5B50\u4EFB\u52A1\u72EC\u7ACB\u63A8\u8FDB\uFF0C\u6574\u4F53\u5B8C\u6210\u540E\u7EDF\u4E00\u6C47\u603B\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", onClick: () => setCreating(true), children: [
5594
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives10.IconPlusOutline16, { size: 15 }),
5595
+ "\u65B0\u9700\u6C42"
5596
+ ] }) }),
5597
+ error && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(WorkspaceNotice, { children: [
5598
+ error,
5599
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: () => {
5600
+ void load2();
5601
+ }, children: "\u91CD\u8BD5" })
5602
+ ] }),
5603
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-partner-requirement-toolbar", children: [
5604
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("nav", { className: "dsh-partner-board-statuses", "aria-label": "\u9700\u6C42\u8303\u56F4", children: [false, true].map((value) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", "aria-pressed": archived === value, className: archived === value ? "is-active" : "", onClick: () => {
5605
+ setArchived(value);
5606
+ setLimit(24);
5607
+ }, children: [
5608
+ value ? "\u5DF2\u5F52\u6863" : "\u8FDB\u884C\u4E2D",
5609
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: requirements.filter((r) => r.status === "done" === value).length })
5610
+ ] }, String(value))) }),
5611
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "dsh-partner-board-search", children: [
5612
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u9700\u6C42" }),
5613
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives10.IconSearchOutline16, { size: 16 }) }),
5614
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { placeholder: "\u641C\u7D22\u9700\u6C42\u6216\u8D1F\u8D23\u4EBA", value: query, onChange: (event) => {
5615
+ setQuery(event.target.value);
5616
+ setLimit(24);
5617
+ } })
5618
+ ] })
5619
+ ] }),
5620
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CollectionSkeleton, { rows: 4 }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
5621
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-partner-requirement-grid", children: visible.slice(0, limit).map((item) => {
5622
+ const tasks = groups.get(item.id) ?? [], total = item.status === "done" ? item.results?.length ?? tasks.length : tasks.length;
5623
+ const done = item.status === "done" ? total : tasks.filter((t) => t.status === "done").length;
5624
+ const blocked = tasks.filter((t) => t.status === "blocked").length;
5625
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("article", { className: "dsh-partner-requirement-card", children: [
5626
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", className: "dsh-partner-requirement-open", onClick: () => item.status === "done" ? setDetailId(item.id) : setSelected(item.id), children: [
5627
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "dsh-partner-requirement-meta", children: [
5628
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: requirementStatus(item) }),
5629
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: directory.find((c) => c.id === item.ownerCompanionId)?.name ?? "\u4EBA\u5DE5\u6536\u5C3E" })
5630
+ ] }),
5631
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { title: item.title, children: item.title }),
5632
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: item.summary || item.description || "\u5C1A\u672A\u8865\u5145\u9700\u6C42\u8BF4\u660E" }),
5633
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "dsh-partner-requirement-progress", role: "progressbar", "aria-label": "\u5B50\u4EFB\u52A1\u9A8C\u6536\u8FDB\u5EA6", "aria-valuemin": 0, "aria-valuemax": Math.max(total, 1), "aria-valuenow": done, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", { style: { width: `${total ? done / total * 100 : 0}%` } }) }),
5634
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "dsh-partner-requirement-meta", children: [
5635
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("small", { children: [
5636
+ done,
5637
+ " / ",
5638
+ total,
5639
+ " \u5DF2\u9A8C\u6536",
5640
+ blocked ? ` \xB7 ${blocked} \u53D7\u963B` : ""
5641
+ ] }),
5642
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives10.IconChevronRightOutline14, { size: 14 })
5643
+ ] })
5644
+ ] }),
5645
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("footer", { children: [
5646
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("small", { children: [
5647
+ new Date(item.updatedAt).toLocaleDateString(),
5648
+ " \u66F4\u65B0"
5649
+ ] }),
5650
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: () => setDetailId(item.id), "aria-haspopup": "dialog", children: item.lastError ? "\u67E5\u770B\u5F02\u5E38" : "\u9700\u6C42\u8BE6\u60C5" })
5651
+ ] })
5652
+ ] }, item.id);
5653
+ }) }),
5654
+ !visible.length && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-partner-collection-empty", children: [
5655
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: query ? "\u6CA1\u6709\u5339\u914D\u7684\u9700\u6C42" : archived ? "\u8FD8\u6CA1\u6709\u5F52\u6863\u9700\u6C42" : "\u4ECE\u4E00\u4E2A\u9700\u6C42\u5F00\u59CB" }),
5656
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: archived ? "\u5B50\u4EFB\u52A1\u5168\u90E8\u9A8C\u6536\u901A\u8FC7\u3001\u5B8C\u6210\u603B\u7ED3\u540E\uFF0C\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002" : "\u5148\u5199\u6E05\u4EA4\u4ED8\u76EE\u6807\uFF0C\u518D\u5B89\u6392\u8D1F\u8D23\u4EBA\u548C\u5B50\u4EFB\u52A1\u3002" })
5657
+ ] }),
5658
+ visible.length > limit && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", onClick: () => setLimit((n) => n + 24), children: [
5659
+ "\u663E\u793A\u66F4\u591A\u9700\u6C42 \xB7 \u8FD8\u6709 ",
5660
+ visible.length - limit,
5661
+ " \u9879"
5662
+ ] }),
5663
+ !archived && Boolean(groups.get("legacy")?.length) && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", className: "dsh-partner-requirement-legacy", onClick: () => setSelected("legacy"), children: [
5664
+ "\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1 ",
5665
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: groups.get("legacy").length }),
5666
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u4FDD\u7559\u539F\u8BB0\u5F55\uFF0C\u4E0D\u81EA\u52A8\u5408\u5E76" }),
5667
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives10.IconChevronRightOutline14, { size: 14 })
5668
+ ] })
5669
+ ] }),
5670
+ creating && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u9700\u6C42", detail: "\u4E00\u4E2A\u9700\u6C42\u5BF9\u5E94\u4E00\u4EFD\u6700\u7EC8\u4EA4\u4ED8\uFF0C\u7531\u8D1F\u8D23\u4EBA\u7EDF\u4E00\u6536\u5C3E\u3002", close: () => setCreating(false), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RequirementForm, { directory, close: () => setCreating(false), created: async (item) => {
5671
+ setCreating(false);
5672
+ await load2();
5673
+ setSelected(item.id);
5674
+ } }) }),
5675
+ detail && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WorkspaceDialog, { title: detail.title, eyebrow: "\u9700\u6C42\u8BE6\u60C5", detail: requirementStatus(detail), close: () => setDetailId(void 0), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RequirementDetail, { item: detail, tasks: groups.get(detail.id) ?? [], directory, changed: load2, close: () => setDetailId(void 0) }, detail.id) }),
5676
+ initialTaskId && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RequirementTasksPanel, { initialTaskId, openRequest, detailOnly: true })
5677
+ ] });
5678
+ }
5679
+
5275
5680
  // src/ui/schedule-panel.tsx
5276
- var import_react15 = require("react");
5277
- var import_dsh_client_ui_primitives8 = require("@deepseek-ai/dsh-client-ui-primitives");
5278
- var import_jsx_runtime11 = require("react/jsx-runtime");
5681
+ var import_react19 = require("react");
5682
+ var import_dsh_client_ui_primitives11 = require("@deepseek-ai/dsh-client-ui-primitives");
5683
+ var import_jsx_runtime14 = require("react/jsx-runtime");
5279
5684
  function SchedulePanel({ companions }) {
5280
- const [schedules, setSchedules] = (0, import_react15.useState)([]);
5281
- const [runs, setRuns] = (0, import_react15.useState)([]);
5282
- const [creating, setCreating] = (0, import_react15.useState)(false);
5283
- const [busy, setBusy] = (0, import_react15.useState)();
5284
- const [loading, setLoading] = (0, import_react15.useState)(true);
5285
- const [error, setError] = (0, import_react15.useState)();
5286
- const load2 = (0, import_react15.useCallback)(async () => {
5685
+ const [schedules, setSchedules] = (0, import_react19.useState)([]);
5686
+ const [runs, setRuns] = (0, import_react19.useState)([]);
5687
+ const [creating, setCreating] = (0, import_react19.useState)(false);
5688
+ const [busy, setBusy] = (0, import_react19.useState)();
5689
+ const [loading, setLoading] = (0, import_react19.useState)(true);
5690
+ const [error, setError] = (0, import_react19.useState)();
5691
+ const load2 = (0, import_react19.useCallback)(async () => {
5287
5692
  try {
5288
5693
  const value = await api("/schedules");
5289
5694
  setSchedules(value.schedules);
@@ -5295,7 +5700,7 @@ function SchedulePanel({ companions }) {
5295
5700
  setLoading(false);
5296
5701
  }
5297
5702
  }, []);
5298
- (0, import_react15.useEffect)(() => {
5703
+ (0, import_react19.useEffect)(() => {
5299
5704
  void load2();
5300
5705
  }, [load2]);
5301
5706
  const update = async (entry, value) => {
@@ -5331,65 +5736,65 @@ function SchedulePanel({ companions }) {
5331
5736
  setBusy(void 0);
5332
5737
  }
5333
5738
  };
5334
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-partner-feature-page", children: [
5335
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WorkspaceHero, { eyebrow: "Ephemeral automation", title: "\u4F19\u4F34\u5B9A\u65F6\u4EFB\u52A1", detail: "\u7531\u6307\u5B9A\u4F19\u4F34\u5728\u9694\u79BB\u4E34\u65F6\u4F1A\u8BDD\u4E2D\u6267\u884C\uFF1B\u9ED8\u8BA4\u5B8C\u6210\u5373\u9500\u6BC1\uFF0C\u907F\u514D\u957F\u671F\u4F1A\u8BDD\u88AB\u540E\u53F0\u4EFB\u52A1\u6C61\u67D3\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
5336
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", disabled: loading, onClick: () => {
5739
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-feature-page", children: [
5740
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WorkspaceHero, { eyebrow: "Ephemeral automation", title: "\u4F19\u4F34\u5B9A\u65F6\u4EFB\u52A1", detail: "\u7531\u6307\u5B9A\u4F19\u4F34\u5728\u9694\u79BB\u4E34\u65F6\u4F1A\u8BDD\u4E2D\u6267\u884C\uFF1B\u9ED8\u8BA4\u5B8C\u6210\u5373\u9500\u6BC1\uFF0C\u907F\u514D\u957F\u671F\u4F1A\u8BDD\u88AB\u540E\u53F0\u4EFB\u52A1\u6C61\u67D3\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
5741
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", disabled: loading, onClick: () => {
5337
5742
  void load2();
5338
5743
  }, children: [
5339
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconRefreshOutline16, { size: 15 }),
5744
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconRefreshOutline16, { size: 15 }),
5340
5745
  "\u5237\u65B0"
5341
5746
  ] }),
5342
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
5343
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconPlusOutline16, { size: 15 }),
5747
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
5748
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlusOutline16, { size: 15 }),
5344
5749
  "\u65B0\u8BA1\u5212"
5345
5750
  ] })
5346
5751
  ] }) }),
5347
- error && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WorkspaceNotice, { children: error }),
5348
- creating && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u5B9A\u65F6\u4EFB\u52A1", detail: "\u9009\u62E9\u6267\u884C\u4F19\u4F34\u3001\u8FD0\u884C\u9891\u7387\u548C\u4F1A\u8BDD\u4FDD\u7559\u7B56\u7565\u3002\u8BA1\u5212\u521B\u5EFA\u540E\u53EF\u4EE5\u968F\u65F6\u505C\u7528\u6216\u7ACB\u5373\u6267\u884C\u3002", close: () => setCreating(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ScheduleForm, { companions, close: () => setCreating(false), changed: load2 }) }),
5349
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WorkspaceBlock, { title: "\u6267\u884C\u8BA1\u5212", detail: `${schedules.filter((item) => item.enabled).length} \u4E2A\u542F\u7528`, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CollectionSkeleton, { rows: 3 }) : schedules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u5B9A\u65F6\u4EFB\u52A1", detail: "\u521B\u5EFA\u8BA1\u5212\u540E\uFF0C\u4F19\u4F34\u4F1A\u6309\u8BBE\u5B9A\u5728\u72EC\u7ACB\u4F1A\u8BDD\u4E2D\u6267\u884C\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
5350
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconPlusOutline16, { size: 14 }),
5752
+ error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WorkspaceNotice, { children: error }),
5753
+ creating && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u5B9A\u65F6\u4EFB\u52A1", detail: "\u9009\u62E9\u6267\u884C\u4F19\u4F34\u3001\u8FD0\u884C\u9891\u7387\u548C\u4F1A\u8BDD\u4FDD\u7559\u7B56\u7565\u3002\u8BA1\u5212\u521B\u5EFA\u540E\u53EF\u4EE5\u968F\u65F6\u505C\u7528\u6216\u7ACB\u5373\u6267\u884C\u3002", close: () => setCreating(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ScheduleForm, { companions, close: () => setCreating(false), changed: load2 }) }),
5754
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WorkspaceBlock, { title: "\u6267\u884C\u8BA1\u5212", detail: `${schedules.filter((item) => item.enabled).length} \u4E2A\u542F\u7528`, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CollectionSkeleton, { rows: 3 }) : schedules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u5B9A\u65F6\u4EFB\u52A1", detail: "\u521B\u5EFA\u8BA1\u5212\u540E\uFF0C\u4F19\u4F34\u4F1A\u6309\u8BBE\u5B9A\u5728\u72EC\u7ACB\u4F1A\u8BDD\u4E2D\u6267\u884C\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
5755
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlusOutline16, { size: 14 }),
5351
5756
  "\u521B\u5EFA\u7B2C\u4E00\u4E2A\u8BA1\u5212"
5352
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-partner-schedule-list", children: schedules.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("article", { children: [
5353
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
5354
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: entry.title }),
5355
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: entry.prompt }),
5356
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-partner-schedule-meta", children: [
5357
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("em", { children: [
5757
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-schedule-list", children: schedules.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { children: [
5758
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
5759
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: entry.title }),
5760
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: entry.prompt }),
5761
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "dsh-partner-schedule-meta", children: [
5762
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("em", { children: [
5358
5763
  "@",
5359
5764
  companionName(companions, entry.companionId)
5360
5765
  ] }),
5361
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("em", { children: scheduleLabel(entry) }),
5362
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("em", { children: [
5766
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("em", { children: scheduleLabel(entry) }),
5767
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("em", { children: [
5363
5768
  "\u4E0B\u6B21 ",
5364
5769
  new Date(entry.nextRunAt).toLocaleString()
5365
5770
  ] }),
5366
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("em", { children: entry.destroySessionAfterRun ? "\u6267\u884C\u540E\u9500\u6BC1" : "\u4FDD\u7559\u4F1A\u8BDD" })
5771
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("em", { children: entry.destroySessionAfterRun ? "\u6267\u884C\u540E\u9500\u6BC1" : "\u4FDD\u7559\u4F1A\u8BDD" })
5367
5772
  ] })
5368
5773
  ] }),
5369
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "dsh-partner-feature-switch", "data-on": entry.enabled, "aria-pressed": entry.enabled, disabled: busy === entry.id, onClick: () => {
5774
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "dsh-partner-feature-switch", "data-on": entry.enabled, "aria-pressed": entry.enabled, disabled: busy === entry.id, onClick: () => {
5370
5775
  void update(entry, { enabled: !entry.enabled });
5371
- }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", {}) }),
5372
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", disabled: busy === entry.id, onClick: () => {
5776
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}) }),
5777
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", disabled: busy === entry.id, onClick: () => {
5373
5778
  void run(entry);
5374
5779
  }, children: [
5375
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconPlayOutline16, { size: 14 }),
5780
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlayOutline16, { size: 14 }),
5376
5781
  busy === entry.id ? "\u6267\u884C\u4E2D\u2026" : "\u7ACB\u5373\u6267\u884C"
5377
5782
  ] }),
5378
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "is-icon", disabled: busy === entry.id, onClick: () => {
5783
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "is-icon", disabled: busy === entry.id, onClick: () => {
5379
5784
  void remove(entry);
5380
- }, "aria-label": `\u5220\u9664 ${entry.title}`, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconTrashOutline16, { size: 14 }) })
5785
+ }, "aria-label": `\u5220\u9664 ${entry.title}`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconTrashOutline16, { size: 14 }) })
5381
5786
  ] }, entry.id)) }) }),
5382
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(WorkspaceBlock, { title: "\u6700\u8FD1\u8FD0\u884C", detail: "\u4FDD\u7559\u6700\u8FD1\u7684\u72B6\u6001\u4E0E\u7ED3\u679C\u6458\u8981", children: [
5383
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-partner-run-list", children: runs.map((run2) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("article", { "data-status": run2.status, children: [
5384
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", {}),
5385
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
5386
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("strong", { children: [
5787
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(WorkspaceBlock, { title: "\u6700\u8FD1\u8FD0\u884C", detail: "\u4FDD\u7559\u6700\u8FD1\u7684\u72B6\u6001\u4E0E\u7ED3\u679C\u6458\u8981", children: [
5788
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-run-list", children: runs.map((run2) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { "data-status": run2.status, children: [
5789
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}),
5790
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
5791
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
5387
5792
  schedules.find((item) => item.id === run2.sourceId)?.title ?? "\u5DF2\u5220\u9664\u8BA1\u5212",
5388
5793
  " \xB7 @",
5389
5794
  companionName(companions, run2.ownerCompanionId)
5390
5795
  ] }),
5391
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: run2.error || run2.outputSummary || "\u7B49\u5F85\u7ED3\u679C" }),
5392
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("small", { children: [
5796
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: run2.error || run2.outputSummary || "\u7B49\u5F85\u7ED3\u679C" }),
5797
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
5393
5798
  new Date(run2.startedAt).toLocaleString(),
5394
5799
  " \xB7 ",
5395
5800
  run2.status,
@@ -5398,14 +5803,14 @@ function SchedulePanel({ companions }) {
5398
5803
  ] })
5399
5804
  ] })
5400
5805
  ] }, run2.id)) }),
5401
- !loading && runs.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u6267\u884C\u8BB0\u5F55", detail: "\u8BA1\u5212\u7B2C\u4E00\u6B21\u6267\u884C\u540E\uFF0C\u7ED3\u679C\u548C\u8017\u65F6\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002" })
5806
+ !loading && runs.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u6267\u884C\u8BB0\u5F55", detail: "\u8BA1\u5212\u7B2C\u4E00\u6B21\u6267\u884C\u540E\uFF0C\u7ED3\u679C\u548C\u8017\u65F6\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002" })
5402
5807
  ] })
5403
5808
  ] });
5404
5809
  }
5405
5810
  function ScheduleForm({ companions, close, changed: changed2 }) {
5406
- const [kind, setKind] = (0, import_react15.useState)("interval");
5407
- const [error, setError] = (0, import_react15.useState)();
5408
- const [busy, setBusy] = (0, import_react15.useState)(false);
5811
+ const [kind, setKind] = (0, import_react19.useState)("interval");
5812
+ const [error, setError] = (0, import_react19.useState)();
5813
+ const [busy, setBusy] = (0, import_react19.useState)(false);
5409
5814
  const submit = async (event) => {
5410
5815
  event.preventDefault();
5411
5816
  const data = new FormData(event.currentTarget);
@@ -5422,18 +5827,18 @@ function ScheduleForm({ companions, close, changed: changed2 }) {
5422
5827
  setBusy(false);
5423
5828
  }
5424
5829
  };
5425
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("form", { className: "dsh-partner-schedule-form", "aria-busy": busy, onSubmit: (event) => {
5830
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("form", { className: "dsh-partner-schedule-form", "aria-busy": busy, onSubmit: (event) => {
5426
5831
  void submit(event);
5427
5832
  }, children: [
5428
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5429
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u8BA1\u5212\u540D\u79F0" }),
5430
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { name: "title", required: true, maxLength: 160, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u6BCF\u65E5\u6574\u7406\u9879\u76EE\u53D8\u5316" })
5833
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
5834
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u8BA1\u5212\u540D\u79F0" }),
5835
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "title", required: true, maxLength: 160, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u6BCF\u65E5\u6574\u7406\u9879\u76EE\u53D8\u5316" })
5431
5836
  ] }),
5432
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5433
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u6267\u884C\u4F19\u4F34" }),
5434
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("select", { name: "companionId", required: true, defaultValue: companions[0]?.id ?? "", children: [
5435
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "", disabled: true, children: "\u9009\u62E9\u4F19\u4F34" }),
5436
- companions.map((companion) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("option", { value: companion.id, children: [
5837
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
5838
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u6267\u884C\u4F19\u4F34" }),
5839
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { name: "companionId", required: true, defaultValue: companions[0]?.id ?? "", children: [
5840
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "", disabled: true, children: "\u9009\u62E9\u4F19\u4F34" }),
5841
+ companions.map((companion) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: companion.id, children: [
5437
5842
  "@",
5438
5843
  companion.name,
5439
5844
  " \xB7 ",
@@ -5441,51 +5846,51 @@ function ScheduleForm({ companions, close, changed: changed2 }) {
5441
5846
  ] }, companion.id))
5442
5847
  ] })
5443
5848
  ] }),
5444
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "is-wide", children: [
5445
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u6267\u884C\u5185\u5BB9" }),
5446
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("textarea", { name: "prompt", required: true, maxLength: 12e3, rows: 5, placeholder: "\u660E\u786E\u8BF4\u660E\u8981\u68C0\u67E5\u3001\u6574\u7406\u6216\u5B8C\u6210\u4EC0\u4E48\uFF0C\u4EE5\u53CA\u5E0C\u671B\u8FD4\u56DE\u4EC0\u4E48\u7ED3\u679C" })
5849
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "is-wide", children: [
5850
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u6267\u884C\u5185\u5BB9" }),
5851
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("textarea", { name: "prompt", required: true, maxLength: 12e3, rows: 5, placeholder: "\u660E\u786E\u8BF4\u660E\u8981\u68C0\u67E5\u3001\u6574\u7406\u6216\u5B8C\u6210\u4EC0\u4E48\uFF0C\u4EE5\u53CA\u5E0C\u671B\u8FD4\u56DE\u4EC0\u4E48\u7ED3\u679C" })
5447
5852
  ] }),
5448
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5449
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u9891\u7387" }),
5450
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("select", { value: kind, onChange: (event) => setKind(event.target.value), children: [
5451
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "interval", children: "\u6BCF\u9694\u4E00\u6BB5\u65F6\u95F4" }),
5452
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "daily", children: "\u6BCF\u5929\u56FA\u5B9A\u65F6\u95F4" })
5853
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
5854
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u9891\u7387" }),
5855
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { value: kind, onChange: (event) => setKind(event.target.value), children: [
5856
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "interval", children: "\u6BCF\u9694\u4E00\u6BB5\u65F6\u95F4" }),
5857
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "daily", children: "\u6BCF\u5929\u56FA\u5B9A\u65F6\u95F4" })
5453
5858
  ] })
5454
5859
  ] }),
5455
- kind === "interval" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5456
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u95F4\u9694\u5206\u949F" }),
5457
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { name: "minutes", type: "number", min: 5, max: 43200, defaultValue: 60 })
5458
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-partner-schedule-time", children: [
5459
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5460
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u5C0F\u65F6" }),
5461
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { name: "hour", type: "number", min: 0, max: 23, defaultValue: 9 })
5860
+ kind === "interval" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
5861
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u95F4\u9694\u5206\u949F" }),
5862
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "minutes", type: "number", min: 5, max: 43200, defaultValue: 60 })
5863
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-schedule-time", children: [
5864
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
5865
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u5C0F\u65F6" }),
5866
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "hour", type: "number", min: 0, max: 23, defaultValue: 9 })
5462
5867
  ] }),
5463
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5464
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u5206\u949F" }),
5465
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { name: "minute", type: "number", min: 0, max: 59, defaultValue: 0 })
5868
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
5869
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u5206\u949F" }),
5870
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "minute", type: "number", min: 0, max: 59, defaultValue: 0 })
5466
5871
  ] })
5467
5872
  ] }),
5468
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5469
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u91CD\u53E0\u7B56\u7565" }),
5470
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("select", { name: "overlapPolicy", defaultValue: "skip", children: [
5471
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "skip", children: "\u8DF3\u8FC7\u91CD\u53E0" }),
5472
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "queue", children: "\u6392\u961F\u6267\u884C" })
5873
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
5874
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u91CD\u53E0\u7B56\u7565" }),
5875
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { name: "overlapPolicy", defaultValue: "skip", children: [
5876
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "skip", children: "\u8DF3\u8FC7\u91CD\u53E0" }),
5877
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "queue", children: "\u6392\u961F\u6267\u884C" })
5473
5878
  ] })
5474
5879
  ] }),
5475
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5476
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u8D85\u65F6\u5206\u949F" }),
5477
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { name: "timeoutMinutes", type: "number", min: 1, max: 120, defaultValue: 10 })
5880
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
5881
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u8D85\u65F6\u5206\u949F" }),
5882
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "timeoutMinutes", type: "number", min: 1, max: 120, defaultValue: 10 })
5478
5883
  ] }),
5479
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "dsh-partner-check is-wide", children: [
5480
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { name: "retain", type: "checkbox" }),
5481
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", {}),
5482
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u6267\u884C\u540E\u4FDD\u7559\u4E34\u65F6\u4F1A\u8BDD" })
5884
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "dsh-partner-check is-wide", children: [
5885
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "retain", type: "checkbox" }),
5886
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}),
5887
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u6267\u884C\u540E\u4FDD\u7559\u4E34\u65F6\u4F1A\u8BDD" })
5483
5888
  ] }),
5484
- error && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WorkspaceNotice, { children: error }),
5485
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("footer", { children: [
5486
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
5487
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
5488
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconPlusOutline16, { size: 14 }),
5889
+ error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WorkspaceNotice, { children: error }),
5890
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("footer", { children: [
5891
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
5892
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
5893
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlusOutline16, { size: 14 }),
5489
5894
  busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u8BA1\u5212"
5490
5895
  ] })
5491
5896
  ] })
@@ -5499,8 +5904,8 @@ function companionName(companions, id) {
5499
5904
  }
5500
5905
 
5501
5906
  // src/ui/capability-editor.tsx
5502
- var import_react17 = require("react");
5503
- var import_dsh_client_ui_primitives10 = require("@deepseek-ai/dsh-client-ui-primitives");
5907
+ var import_react21 = require("react");
5908
+ var import_dsh_client_ui_primitives13 = require("@deepseek-ai/dsh-client-ui-primitives");
5504
5909
 
5505
5910
  // src/capabilities.ts
5506
5911
  var COMPANION_CAPABILITIES = ["knowledge", "skills", "ssh", "git", "companions", "schedules", "access", "administration"];
@@ -5519,14 +5924,14 @@ function isCompanionCapability(value) {
5519
5924
  }
5520
5925
 
5521
5926
  // src/ui/companion-access-panel.tsx
5522
- var import_react16 = require("react");
5523
- var import_dsh_client_ui_primitives9 = require("@deepseek-ai/dsh-client-ui-primitives");
5524
- var import_jsx_runtime12 = require("react/jsx-runtime");
5927
+ var import_react20 = require("react");
5928
+ var import_dsh_client_ui_primitives12 = require("@deepseek-ai/dsh-client-ui-primitives");
5929
+ var import_jsx_runtime15 = require("react/jsx-runtime");
5525
5930
  function CompanionAccessPanel({ companionId }) {
5526
- const [access, setAccess] = (0, import_react16.useState)({ targetIds: [], companions: [] });
5527
- const [busy, setBusy] = (0, import_react16.useState)();
5528
- const [error, setError] = (0, import_react16.useState)();
5529
- const load2 = (0, import_react16.useCallback)(async () => {
5931
+ const [access, setAccess] = (0, import_react20.useState)({ targetIds: [], companions: [] });
5932
+ const [busy, setBusy] = (0, import_react20.useState)();
5933
+ const [error, setError] = (0, import_react20.useState)();
5934
+ const load2 = (0, import_react20.useCallback)(async () => {
5530
5935
  try {
5531
5936
  setAccess(await api(`/companions/${encodeURIComponent(companionId)}/access`));
5532
5937
  setError(void 0);
@@ -5534,7 +5939,7 @@ function CompanionAccessPanel({ companionId }) {
5534
5939
  setError(errorMessage(reason));
5535
5940
  }
5536
5941
  }, [companionId]);
5537
- (0, import_react16.useEffect)(() => {
5942
+ (0, import_react20.useEffect)(() => {
5538
5943
  void load2();
5539
5944
  }, [load2]);
5540
5945
  const toggle = async (targetId) => {
@@ -5553,38 +5958,38 @@ function CompanionAccessPanel({ companionId }) {
5553
5958
  setBusy(void 0);
5554
5959
  }
5555
5960
  };
5556
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: "dsh-partner-capability-detail dsh-partner-access", "aria-labelledby": "dsh-partner-access-title", children: [
5557
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("header", { children: [
5558
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
5559
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "DIRECTED ACCESS" }),
5560
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { id: "dsh-partner-access-title", children: "\u53EF\u8BBF\u95EE\u7684\u4F19\u4F34" })
5961
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "dsh-partner-capability-detail dsh-partner-access", "aria-labelledby": "dsh-partner-access-title", children: [
5962
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
5963
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
5964
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "DIRECTED ACCESS" }),
5965
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { id: "dsh-partner-access-title", children: "\u53EF\u8BBF\u95EE\u7684\u4F19\u4F34" })
5561
5966
  ] }),
5562
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("em", { children: [
5967
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("em", { children: [
5563
5968
  access.targetIds.length,
5564
5969
  " \u4F4D\u5DF2\u6388\u6743"
5565
5970
  ] })
5566
5971
  ] }),
5567
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsh-partner-access-note", children: "\u52FE\u9009\u540E\uFF0C\u5F53\u524D\u4F19\u4F34\u80FD\u4E86\u89E3\u5BF9\u65B9\u7684\u516C\u5F00\u80FD\u529B\uFF0C\u5E76\u5728\u4EFB\u52A1\u770B\u677F\u4E2D `@` \u5BF9\u65B9\u6267\u884C\u4EFB\u52A1\u3002\u6388\u6743\u53EA\u6CBF\u5F53\u524D\u65B9\u5411\u751F\u6548\uFF0C\u4E0D\u4F1A\u53CD\u5411\u6388\u6743\uFF0C\u4E5F\u4E0D\u4F1A\u5171\u4EAB\u4F1A\u8BDD\u3001\u8BB0\u5FC6\u3001\u6E20\u9053\u6216\u51ED\u636E\u3002" }),
5568
- access.companions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u53EF\u6388\u6743\u7684\u4F19\u4F34", detail: "\u521B\u5EFA\u7B2C\u4E8C\u4F4D\u4F19\u4F34\u540E\uFF0C\u53EF\u4EE5\u5728\u8FD9\u91CC\u5EFA\u7ACB\u5355\u5411\u534F\u4F5C\u6388\u6743\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "dsh-partner-access-list", children: access.companions.map((companion) => {
5972
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "dsh-partner-access-note", children: "\u52FE\u9009\u540E\uFF0C\u5F53\u524D\u4F19\u4F34\u80FD\u4E86\u89E3\u5BF9\u65B9\u7684\u516C\u5F00\u80FD\u529B\uFF0C\u5E76\u5728\u4EFB\u52A1\u770B\u677F\u4E2D `@` \u5BF9\u65B9\u6267\u884C\u4EFB\u52A1\u3002\u6388\u6743\u53EA\u6CBF\u5F53\u524D\u65B9\u5411\u751F\u6548\uFF0C\u4E0D\u4F1A\u53CD\u5411\u6388\u6743\uFF0C\u4E5F\u4E0D\u4F1A\u5171\u4EAB\u4F1A\u8BDD\u3001\u8BB0\u5FC6\u3001\u6E20\u9053\u6216\u51ED\u636E\u3002" }),
5973
+ access.companions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u53EF\u6388\u6743\u7684\u4F19\u4F34", detail: "\u521B\u5EFA\u7B2C\u4E8C\u4F4D\u4F19\u4F34\u540E\uFF0C\u53EF\u4EE5\u5728\u8FD9\u91CC\u5EFA\u7ACB\u5355\u5411\u534F\u4F5C\u6388\u6743\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-access-list", children: access.companions.map((companion) => {
5569
5974
  const selected = access.targetIds.includes(companion.id);
5570
5975
  const abilities = companion.capabilities.map((capability) => isCompanionCapability(capability) ? CAPABILITY_LABELS[capability] : capability);
5571
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", className: selected ? "is-active" : "", "aria-pressed": selected, disabled: busy === companion.id, onClick: () => {
5976
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: selected ? "is-active" : "", "aria-pressed": selected, disabled: busy === companion.id, onClick: () => {
5572
5977
  void toggle(companion.id);
5573
5978
  }, children: [
5574
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "dsh-partner-access-avatar", "aria-hidden": "true", children: initials(companion.name) }),
5575
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsh-partner-access-copy", children: [
5576
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("strong", { children: [
5979
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dsh-partner-access-avatar", "aria-hidden": "true", children: initials(companion.name) }),
5980
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dsh-partner-access-copy", children: [
5981
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
5577
5982
  "@",
5578
5983
  companion.name
5579
5984
  ] }),
5580
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: companion.role }),
5581
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: companion.description || "\u672A\u586B\u5199\u4F19\u4F34\u8BF4\u660E" }),
5582
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: [...abilities, ...companion.enabledSkills.map((skill) => skill.name)].map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("em", { children: item }, item)) })
5985
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: companion.role }),
5986
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: companion.description || "\u672A\u586B\u5199\u4F19\u4F34\u8BF4\u660E" }),
5987
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: [...abilities, ...companion.enabledSkills.map((skill) => skill.name)].map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("em", { children: item }, item)) })
5583
5988
  ] }),
5584
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "dsh-partner-access-check", "aria-hidden": "true", children: selected && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.IconCheckOutline16, { size: 15 }) })
5989
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dsh-partner-access-check", "aria-hidden": "true", children: selected && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconCheckOutline16, { size: 15 }) })
5585
5990
  ] }, companion.id);
5586
5991
  }) }),
5587
- error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(WorkspaceNotice, { children: error })
5992
+ error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WorkspaceNotice, { children: error })
5588
5993
  ] });
5589
5994
  }
5590
5995
  function initials(name) {
@@ -5597,25 +6002,25 @@ function companionDraft(companion) {
5597
6002
  }
5598
6003
 
5599
6004
  // src/ui/capability-editor.tsx
5600
- var import_jsx_runtime13 = require("react/jsx-runtime");
6005
+ var import_jsx_runtime16 = require("react/jsx-runtime");
5601
6006
  function CapabilityEditor({ companion, presets, onChanged }) {
5602
- const [form, setForm] = (0, import_react17.useState)(() => companionDraft(companion));
5603
- const [modelCatalog, setModelCatalog] = (0, import_react17.useState)();
5604
- const [saving, setSaving] = (0, import_react17.useState)(false);
5605
- const [saved, setSaved] = (0, import_react17.useState)(false);
5606
- const [error, setError] = (0, import_react17.useState)();
5607
- const savingRef = (0, import_react17.useRef)(false);
5608
- const mounted = (0, import_react17.useRef)(true);
5609
- (0, import_react17.useEffect)(() => {
6007
+ const [form, setForm] = (0, import_react21.useState)(() => companionDraft(companion));
6008
+ const [modelCatalog, setModelCatalog] = (0, import_react21.useState)();
6009
+ const [saving, setSaving] = (0, import_react21.useState)(false);
6010
+ const [saved, setSaved] = (0, import_react21.useState)(false);
6011
+ const [error, setError] = (0, import_react21.useState)();
6012
+ const savingRef = (0, import_react21.useRef)(false);
6013
+ const mounted = (0, import_react21.useRef)(true);
6014
+ (0, import_react21.useEffect)(() => {
5610
6015
  mounted.current = true;
5611
6016
  return () => {
5612
6017
  mounted.current = false;
5613
6018
  };
5614
6019
  }, []);
5615
- (0, import_react17.useEffect)(() => {
6020
+ (0, import_react21.useEffect)(() => {
5616
6021
  if (!savingRef.current) setForm(companionDraft(companion));
5617
6022
  }, [companion.id, companion.updatedAt]);
5618
- (0, import_react17.useEffect)(() => {
6023
+ (0, import_react21.useEffect)(() => {
5619
6024
  void api("/models").then((value) => {
5620
6025
  if (mounted.current) setModelCatalog(value);
5621
6026
  }).catch((reason) => {
@@ -5670,82 +6075,185 @@ function CapabilityEditor({ companion, presets, onChanged }) {
5670
6075
  const selectedProvider = form.provider || modelCatalog?.defaultSelection.provider || "";
5671
6076
  const modelOptions = modelCatalog?.providers.find((item) => item.id === selectedProvider)?.models ?? [];
5672
6077
  const currentModelMissing = Boolean(form.model) && !modelOptions.some((item) => item.id === form.model);
5673
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-partner-form is-capabilities", children: [
5674
- /* @__PURE__ */ (0, import_jsx_runtime13.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" }),
5675
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-partner-runtime-fields", children: [
5676
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "Agent Preset", hint: "\u5DE5\u5177\u3001Skill \u4E0E\u7CFB\u7EDF\u63D0\u793A", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("select", { disabled: saving, value: form.presetId, onChange: (event) => edit({ ...form, presetId: event.target.value }), children: [
5677
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "", children: "\u8DDF\u968F DSH \u9ED8\u8BA4 Preset" }),
5678
- presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: item.id, children: item.name }, item.id))
6078
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "dsh-partner-form is-capabilities", children: [
6079
+ /* @__PURE__ */ (0, import_jsx_runtime16.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" }),
6080
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "dsh-partner-runtime-fields", children: [
6081
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FormField, { label: "Agent Preset", hint: "\u5DE5\u5177\u3001Skill \u4E0E\u7CFB\u7EDF\u63D0\u793A", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("select", { disabled: saving, value: form.presetId, onChange: (event) => edit({ ...form, presetId: event.target.value }), children: [
6082
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: "", children: "\u8DDF\u968F DSH \u9ED8\u8BA4 Preset" }),
6083
+ presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: item.id, children: item.name }, item.id))
5679
6084
  ] }) }),
5680
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "\u6A21\u578B\u63D0\u4F9B\u65B9", hint: "\u6765\u81EA\u5F53\u524D\u5BA2\u6237\u7AEF", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("select", { disabled: saving, value: form.provider, onChange: (event) => edit({ ...form, provider: event.target.value, model: "" }), children: [
5681
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("option", { value: "", children: [
6085
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FormField, { label: "\u6A21\u578B\u63D0\u4F9B\u65B9", hint: "\u6765\u81EA\u5F53\u524D\u5BA2\u6237\u7AEF", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("select", { disabled: saving, value: form.provider, onChange: (event) => edit({ ...form, provider: event.target.value, model: "" }), children: [
6086
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("option", { value: "", children: [
5682
6087
  "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
5683
6088
  modelCatalog?.defaultSelection.provider || "\u6B63\u5728\u8BFB\u53D6"
5684
6089
  ] }),
5685
- modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
6090
+ modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
5686
6091
  ] }) }),
5687
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "\u6A21\u578B", hint: "\u968F\u63D0\u4F9B\u65B9\u8054\u52A8", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("select", { disabled: saving, value: form.model, onChange: (event) => edit({ ...form, model: event.target.value }), children: [
5688
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("option", { value: "", children: [
6092
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FormField, { label: "\u6A21\u578B", hint: "\u968F\u63D0\u4F9B\u65B9\u8054\u52A8", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("select", { disabled: saving, value: form.model, onChange: (event) => edit({ ...form, model: event.target.value }), children: [
6093
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("option", { value: "", children: [
5689
6094
  "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
5690
6095
  modelCatalog?.defaultSelection.model || "\u6B63\u5728\u8BFB\u53D6"
5691
6096
  ] }),
5692
- currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("option", { value: form.model, children: [
6097
+ currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("option", { value: form.model, children: [
5693
6098
  "\u5F53\u524D\u914D\u7F6E \xB7 ",
5694
6099
  form.model
5695
6100
  ] }),
5696
- modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
6101
+ modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
5697
6102
  ] }) })
5698
6103
  ] }),
5699
- /* @__PURE__ */ (0, import_jsx_runtime13.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" }),
5700
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-partner-capability-groups", children: groups.map((group) => {
6104
+ /* @__PURE__ */ (0, import_jsx_runtime16.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" }),
6105
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "dsh-partner-capability-groups", children: groups.map((group) => {
5701
6106
  const enabled = group.choices.filter((choice) => form.capabilities.includes(choice.id)).length;
5702
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: "dsh-partner-capability-group", "aria-labelledby": `partner-capability-${group.id}`, children: [
5703
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("header", { children: [
5704
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
5705
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: group.eyebrow }),
5706
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { id: `partner-capability-${group.id}`, children: group.title }),
5707
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: group.detail })
6107
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("section", { className: "dsh-partner-capability-group", "aria-labelledby": `partner-capability-${group.id}`, children: [
6108
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("header", { children: [
6109
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { children: [
6110
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: group.eyebrow }),
6111
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("strong", { id: `partner-capability-${group.id}`, children: group.title }),
6112
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { children: group.detail })
5708
6113
  ] }),
5709
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("em", { children: [
6114
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("em", { children: [
5710
6115
  enabled,
5711
6116
  " / ",
5712
6117
  group.choices.length,
5713
6118
  " \u5DF2\u542F\u7528"
5714
6119
  ] })
5715
6120
  ] }),
5716
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-partner-capabilities", children: group.choices.map((choice) => {
6121
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "dsh-partner-capabilities", children: group.choices.map((choice) => {
5717
6122
  const active = form.capabilities.includes(choice.id);
5718
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", disabled: saving, className: active ? "is-active" : "", "aria-pressed": active, onClick: () => toggle(choice.id), children: [
5719
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: active && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives10.IconCheckOutline14, { size: 14 }) }),
5720
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: choice.title }),
5721
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: choice.detail })
6123
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("button", { type: "button", disabled: saving, className: active ? "is-active" : "", "aria-pressed": active, onClick: () => toggle(choice.id), children: [
6124
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: active && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_dsh_client_ui_primitives13.IconCheckOutline14, { size: 14 }) }),
6125
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("strong", { children: choice.title }),
6126
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: choice.detail })
5722
6127
  ] }, choice.id);
5723
6128
  }) })
5724
6129
  ] }, group.id);
5725
6130
  }) }),
5726
- form.capabilities.includes("skills") && companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CompanionSkillSettings, { companionId: companion.id }),
5727
- form.capabilities.includes("skills") && !companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsh-partner-inline-note", children: "\u5148\u5E94\u7528\u80FD\u529B\u7EC4\u5408\uFF0C\u518D\u4E3A\u5F53\u524D\u4F19\u4F34\u9009\u62E9\u5177\u4F53 Skill\u3002" }),
5728
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CompanionAccessPanel, { companionId: companion.id }),
5729
- error && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
5730
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-partner-form-actions is-capability-save", children: [
5731
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { role: "status", "aria-live": "polite", "aria-atomic": "true", children: saved && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
5732
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives10.IconCheckOutline14, { size: 14 }),
5733
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u751F\u6548" })
6131
+ form.capabilities.includes("skills") && companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CompanionSkillSettings, { companionId: companion.id }),
6132
+ form.capabilities.includes("skills") && !companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "dsh-partner-inline-note", children: "\u5148\u5E94\u7528\u80FD\u529B\u7EC4\u5408\uFF0C\u518D\u4E3A\u5F53\u524D\u4F19\u4F34\u9009\u62E9\u5177\u4F53 Skill\u3002" }),
6133
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CompanionAccessPanel, { companionId: companion.id }),
6134
+ error && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
6135
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "dsh-partner-form-actions is-capability-save", children: [
6136
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { role: "status", "aria-live": "polite", "aria-atomic": "true", children: saved && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
6137
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_dsh_client_ui_primitives13.IconCheckOutline14, { size: 14 }),
6138
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u751F\u6548" })
5734
6139
  ] }) }),
5735
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", disabled: saving, "aria-busy": saving, onClick: () => {
6140
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", disabled: saving, "aria-busy": saving, onClick: () => {
5736
6141
  void save();
5737
6142
  }, children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u5E94\u7528\u80FD\u529B\u7EC4\u5408" })
5738
6143
  ] })
5739
6144
  ] });
5740
6145
  }
5741
6146
 
6147
+ // src/ui/identity-editor.tsx
6148
+ var import_react22 = require("react");
6149
+ var import_dsh_client_ui_primitives14 = require("@deepseek-ai/dsh-client-ui-primitives");
6150
+ var import_jsx_runtime17 = require("react/jsx-runtime");
6151
+ function IdentityEditor(props) {
6152
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IdentityEditorForm, { ...props }, props.companion.id);
6153
+ }
6154
+ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
6155
+ const [form, setForm] = (0, import_react22.useState)(() => companionDraft(companion));
6156
+ const [operation, setOperation] = (0, import_react22.useState)();
6157
+ const [saved, setSaved] = (0, import_react22.useState)(false);
6158
+ const [removed, setRemoved] = (0, import_react22.useState)(false);
6159
+ const [error, setError] = (0, import_react22.useState)();
6160
+ const [confirmationId, setConfirmationId] = (0, import_react22.useState)();
6161
+ const locked = (0, import_react22.useRef)(false);
6162
+ const alive = (0, import_react22.useRef)(true);
6163
+ (0, import_react22.useEffect)(() => {
6164
+ alive.current = true;
6165
+ return () => {
6166
+ alive.current = false;
6167
+ };
6168
+ }, []);
6169
+ (0, import_react22.useEffect)(() => {
6170
+ setForm(companionDraft(companion));
6171
+ setSaved(false);
6172
+ setConfirmationId(void 0);
6173
+ }, [companion.updatedAt]);
6174
+ const confirming = confirmationId === companion.id;
6175
+ const busy = operation !== void 0 || removed;
6176
+ const submit = async (event) => {
6177
+ event.preventDefault();
6178
+ if (locked.current || removed) return;
6179
+ locked.current = true;
6180
+ setOperation("save");
6181
+ setError(void 0);
6182
+ setConfirmationId(void 0);
6183
+ let committed = false;
6184
+ try {
6185
+ await api(`/companions/${encodeURIComponent(companion.id)}`, { method: "PUT", body: JSON.stringify({ companion: form }) });
6186
+ committed = true;
6187
+ await onChanged();
6188
+ if (alive.current) setSaved(true);
6189
+ } catch (reason) {
6190
+ if (alive.current) setError(`${committed ? "\u8EAB\u4EFD\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u5237\u65B0\u5931\u8D25\uFF0C\u65E0\u9700\u91CD\u590D\u4FDD\u5B58\uFF1A" : "\u4FDD\u5B58\u5931\u8D25\uFF1A"}${errorMessage(reason)}`);
6191
+ } finally {
6192
+ locked.current = false;
6193
+ if (alive.current) setOperation(void 0);
6194
+ }
6195
+ };
6196
+ const remove = async () => {
6197
+ if (locked.current || removed || !confirming || count <= 1) return;
6198
+ const targetId = confirmationId;
6199
+ locked.current = true;
6200
+ setOperation("remove");
6201
+ setError(void 0);
6202
+ setConfirmationId(void 0);
6203
+ let committed = false;
6204
+ try {
6205
+ await api(`/companions/${encodeURIComponent(targetId)}?removeFiles=1`, { method: "DELETE" });
6206
+ committed = true;
6207
+ if (alive.current) setRemoved(true);
6208
+ await onRemoved(targetId);
6209
+ } catch (reason) {
6210
+ if (alive.current) setError(`${committed ? "\u4F19\u4F34\u5DF2\u5220\u9664\uFF0C\u4F46\u9875\u9762\u5237\u65B0\u5931\u8D25\uFF0C\u8BF7\u5237\u65B0\u9875\u9762\uFF0C\u4E0D\u8981\u518D\u6B21\u5220\u9664\uFF1A" : "\u5220\u9664\u5931\u8D25\uFF1A"}${errorMessage(reason)}`);
6211
+ } finally {
6212
+ locked.current = false;
6213
+ if (alive.current) setOperation(void 0);
6214
+ }
6215
+ };
6216
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("form", { className: "dsh-partner-form is-identity", "aria-busy": operation !== void 0, onSubmit: (event) => {
6217
+ void submit(event);
6218
+ }, children: [
6219
+ /* @__PURE__ */ (0, import_jsx_runtime17.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" }),
6220
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-fields two", children: [
6221
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormField, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("input", { disabled: busy, required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
6222
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormField, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("input", { disabled: busy, required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
6223
+ ] }),
6224
+ /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.jsx)("textarea", { disabled: busy, rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
6225
+ /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.jsx)("textarea", { disabled: busy, rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
6226
+ error && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
6227
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-form-actions", children: [
6228
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { role: "status", children: saved && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
6229
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconCheckOutline14, { size: 14 }),
6230
+ "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u5C06\u4F7F\u7528\u65B0\u8EAB\u4EFD"
6231
+ ] }) }),
6232
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { disabled: busy, children: operation === "save" ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
6233
+ ] }),
6234
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-identity-danger", "data-confirming": confirming, children: [
6235
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6236
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: removed ? "\u4F19\u4F34\u5DF2\u5220\u9664" : confirming ? `\u786E\u8BA4\u5220\u9664\u300C${companion.name}\u300D\uFF1F` : "\u5220\u9664\u4F19\u4F34" }),
6237
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: confirming ? "\u5C06\u5220\u9664\u8BE5\u4F19\u4F34\u7684\u914D\u7F6E\u3001\u8BB0\u5FC6\u3001\u6302\u5FF5\u3001\u4E13\u5C5E\u76EE\u5F55\u53CA\u5176\u4E2D\u5168\u90E8\u6587\u4EF6\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002\u5171\u4EAB\u6216\u5F02\u5E38\u76EE\u5F55\u4F1A\u62E6\u622A\uFF1BDSH \u539F\u4F1A\u8BDD\u65E5\u5FD7\u4ECD\u7531\u5BBF\u4E3B\u7BA1\u7406\uFF0C\u4E0D\u5728\u6B64\u6B21\u6E05\u7406\u8303\u56F4\u5185\u3002" : "\u5FC5\u987B\u5148\u89E3\u7ED1\u5FAE\u4FE1\u5E76\u7ED3\u675F\u8FD0\u884C\u4E2D\u7684\u4EFB\u52A1\u3002\u5220\u9664\u53EA\u9488\u5BF9\u672C\u6B21\u786E\u8BA4\u7684\u4F19\u4F34\uFF0C\u4E0D\u4F1A\u8F6C\u4EA4\u8054\u7CFB\u4EBA\u3002" })
6238
+ ] }),
6239
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
6240
+ confirming && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", disabled: busy, className: "is-secondary", onClick: () => setConfirmationId(void 0), children: "\u53D6\u6D88" }),
6241
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: confirming ? "is-danger" : "", disabled: busy || count <= 1, onClick: () => confirming ? void remove() : setConfirmationId(companion.id), children: [
6242
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconTrashOutline16, { size: 16 }),
6243
+ operation === "remove" ? "\u6B63\u5728\u5220\u9664\u2026" : removed ? "\u5DF2\u5220\u9664" : confirming ? "\u786E\u8BA4\u5220\u9664" : "\u5220\u9664"
6244
+ ] })
6245
+ ] })
6246
+ ] })
6247
+ ] });
6248
+ }
6249
+
5742
6250
  // src/ui/companion-create.tsx
5743
- var import_react18 = require("react");
5744
- var import_dsh_client_ui_primitives11 = require("@deepseek-ai/dsh-client-ui-primitives");
5745
- var import_jsx_runtime14 = require("react/jsx-runtime");
6251
+ var import_react23 = require("react");
6252
+ var import_dsh_client_ui_primitives15 = require("@deepseek-ai/dsh-client-ui-primitives");
6253
+ var import_jsx_runtime18 = require("react/jsx-runtime");
5746
6254
  function CompanionCreateDialog({ close, create }) {
5747
- const [busy, setBusy] = (0, import_react18.useState)(false);
5748
- const [error, setError] = (0, import_react18.useState)();
6255
+ const [busy, setBusy] = (0, import_react23.useState)(false);
6256
+ const [error, setError] = (0, import_react23.useState)();
5749
6257
  const submit = async (event) => {
5750
6258
  event.preventDefault();
5751
6259
  const data = new FormData(event.currentTarget);
@@ -5764,30 +6272,30 @@ function CompanionCreateDialog({ close, create }) {
5764
6272
  setBusy(false);
5765
6273
  }
5766
6274
  };
5767
- return /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-companion-create-form", "aria-busy": busy, onSubmit: (event) => {
6275
+ return /* @__PURE__ */ (0, import_jsx_runtime18.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_runtime18.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-companion-create-form", "aria-busy": busy, onSubmit: (event) => {
5768
6276
  void submit(event);
5769
6277
  }, children: [
5770
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
5771
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u4F19\u4F34\u540D\u5B57" }),
5772
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "name", required: true, maxLength: 60, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u5C0F\u9ED1" })
6278
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { children: [
6279
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: "\u4F19\u4F34\u540D\u5B57" }),
6280
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("input", { name: "name", required: true, maxLength: 60, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u5C0F\u9ED1" })
5773
6281
  ] }),
5774
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
5775
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u4E3B\u8981\u89D2\u8272" }),
5776
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "role", required: true, maxLength: 120, placeholder: "\u4F8B\u5982\uFF1A\u4EA7\u54C1\u4E0E\u5DE5\u7A0B\u534F\u4F5C\u4F19\u4F34" })
6282
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { children: [
6283
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: "\u4E3B\u8981\u89D2\u8272" }),
6284
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("input", { name: "role", required: true, maxLength: 120, placeholder: "\u4F8B\u5982\uFF1A\u4EA7\u54C1\u4E0E\u5DE5\u7A0B\u534F\u4F5C\u4F19\u4F34" })
5777
6285
  ] }),
5778
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "is-wide", children: [
5779
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D" }),
5780
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "description", maxLength: 500, placeholder: "\u5B83\u4E3B\u8981\u8D1F\u8D23\u4EC0\u4E48\uFF0C\u4EC0\u4E48\u65F6\u5019\u5E94\u8BE5\u627E\u5B83" })
6286
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { className: "is-wide", children: [
6287
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D" }),
6288
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("input", { name: "description", maxLength: 500, placeholder: "\u5B83\u4E3B\u8981\u8D1F\u8D23\u4EC0\u4E48\uFF0C\u4EC0\u4E48\u65F6\u5019\u5E94\u8BE5\u627E\u5B83" })
5781
6289
  ] }),
5782
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "is-wide", children: [
5783
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u521D\u59CB\u884C\u4E3A\u51C6\u5219" }),
5784
- /* @__PURE__ */ (0, import_jsx_runtime14.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" })
6290
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { className: "is-wide", children: [
6291
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: "\u521D\u59CB\u884C\u4E3A\u51C6\u5219" }),
6292
+ /* @__PURE__ */ (0, import_jsx_runtime18.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" })
5785
6293
  ] }),
5786
- error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WorkspaceNotice, { children: error }),
5787
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("footer", { children: [
5788
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
5789
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
5790
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlusOutline16, { size: 14 }),
6294
+ error && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(WorkspaceNotice, { children: error }),
6295
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("footer", { children: [
6296
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
6297
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
6298
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives15.IconPlusOutline16, { size: 14 }),
5791
6299
  busy ? "\u6B63\u5728\u521B\u5EFA\u2026" : "\u521B\u5EFA\u4F19\u4F34"
5792
6300
  ] })
5793
6301
  ] })
@@ -5877,37 +6385,38 @@ function sessions(ctx) {
5877
6385
  }
5878
6386
 
5879
6387
  // src/client.tsx
5880
- var import_jsx_runtime15 = require("react/jsx-runtime");
6388
+ var import_jsx_runtime19 = require("react/jsx-runtime");
5881
6389
  var PLUGIN_ID = "@lemoncat7/dsh-partner";
5882
6390
  var STYLE_ID = `${PLUGIN_ID}/client`;
5883
6391
  var cssText = `${client_default}
5884
6392
  ${workspace_ui_default}
5885
6393
  ${companion_picker_default}
5886
6394
  ${responsive_ui_default}
6395
+ ${requirement_board_default}
5887
6396
  ${widget_default}
5888
6397
  ${settings_panel_default}`;
5889
6398
  var WORKSPACE_PAGES = /* @__PURE__ */ new Set(["skills", "board", "schedules", "pendant"]);
5890
6399
  var inject = ["slots", "layout", "sessions"];
5891
6400
  function apply(ctx) {
5892
6401
  ctx.effect(installStyles, "dsh-partner: styles");
5893
- const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PartnerWorkspace, { ...props, controller: current2 }));
5894
- ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PartnerPendant, { controller })));
6402
+ const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PartnerWorkspace, { ...props, controller: current2 }));
6403
+ ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PartnerPendant, { controller })));
5895
6404
  ctx.effect(() => observePluginWorkspace(PLUGIN_ID, controller.close), "dsh-partner: exclusive workspace");
5896
6405
  ctx.effect(() => () => controller.close(), "dsh-partner: workspace lifecycle");
5897
6406
  ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({
5898
6407
  name: "sidebar.footer.action",
5899
6408
  id: "partner",
5900
6409
  order: -120
5901
- }, (props) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
6410
+ }, (props) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
5902
6411
  }
5903
6412
  function PartnerSidebar(props) {
5904
- const ref = (0, import_react19.useRef)(null);
6413
+ const ref = (0, import_react24.useRef)(null);
5905
6414
  useWorkspaceTopAnchor(ref);
5906
- const [open, setOpen] = (0, import_react19.useState)(true);
5907
- const [snapshot, setSnapshot] = (0, import_react19.useState)();
5908
- const [, update] = (0, import_react19.useState)(0);
5909
- (0, import_react19.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
5910
- (0, import_react19.useEffect)(() => {
6415
+ const [open, setOpen] = (0, import_react24.useState)(true);
6416
+ const [snapshot, setSnapshot] = (0, import_react24.useState)();
6417
+ const [, update] = (0, import_react24.useState)(0);
6418
+ (0, import_react24.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
6419
+ (0, import_react24.useEffect)(() => {
5911
6420
  void loadPartner().then(setSnapshot).catch(() => {
5912
6421
  });
5913
6422
  }, [props.controller.isOpen()]);
@@ -5915,31 +6424,34 @@ function PartnerSidebar(props) {
5915
6424
  props.controller.open(id);
5916
6425
  if (props.wide && window.matchMedia("(max-width: 820px)").matches) props.collapse();
5917
6426
  };
5918
- if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime15.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_runtime15.jsx)(import_dsh_client_ui_primitives12.IconAgentPresetOutline16, { size: 18 }) }) });
5919
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
5920
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
5921
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconChevronDownOutline14, { size: 14 }) }),
6427
+ if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime19.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_runtime19.jsx)(import_dsh_client_ui_primitives16.IconAgentPresetOutline16, { size: 18 }) }) });
6428
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
6429
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
6430
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconChevronDownOutline14, { size: 14 }) }),
5922
6431
  "\u4F19\u4F34"
5923
6432
  ] }) }),
5924
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
5925
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconAgentPresetOutline16, { size: 16 }) }),
5926
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
5927
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
5928
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: snapshot ? `${snapshot.companions.length} \u4F4D\u4F19\u4F34 \xB7 ${snapshot.channels.filter((item) => item.runtimeStatus === "running").length} \u4E2A\u5FAE\u4FE1\u5728\u7EBF` : "\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E\u6E20\u9053" })
6433
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
6434
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconAgentPresetOutline16, { size: 16 }) }),
6435
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
6436
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
6437
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: snapshot ? `${snapshot.companions.length} \u4F4D\u4F19\u4F34 \xB7 ${snapshot.channels.filter((item) => item.runtimeStatus === "running").length} \u4E2A\u5FAE\u4FE1\u5728\u7EBF` : "\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E\u6E20\u9053" })
5929
6438
  ] }),
5930
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
6439
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
5931
6440
  ] }) }) })
5932
6441
  ] });
5933
6442
  }
5934
6443
  function PartnerWorkspace({ controller }) {
5935
- const [snapshot, setSnapshot] = (0, import_react19.useState)();
5936
- const [selectedId, setSelectedId] = (0, import_react19.useState)(controller.selected());
5937
- const [view, setView] = (0, import_react19.useState)(controller.destination()?.page ?? "home");
5938
- const [requestedDestination, setRequestedDestination] = (0, import_react19.useState)(controller.destination());
5939
- const [error, setError] = (0, import_react19.useState)();
5940
- const [loading, setLoading] = (0, import_react19.useState)(true);
5941
- const [creatingCompanion, setCreatingCompanion] = (0, import_react19.useState)(false);
5942
- const refresh = (0, import_react19.useCallback)(async (throwOnError = false) => {
6444
+ const [snapshot, setSnapshot] = (0, import_react24.useState)();
6445
+ const [selectedId, setSelectedId] = (0, import_react24.useState)(controller.selected());
6446
+ const [view, setView] = (0, import_react24.useState)(controller.destination()?.page ?? "home");
6447
+ const [requestedDestination, setRequestedDestination] = (0, import_react24.useState)(controller.destination());
6448
+ const [error, setError] = (0, import_react24.useState)();
6449
+ const [loading, setLoading] = (0, import_react24.useState)(true);
6450
+ const [creatingCompanion, setCreatingCompanion] = (0, import_react24.useState)(false);
6451
+ const [notice, setNotice] = (0, import_react24.useState)();
6452
+ const selectionRef = (0, import_react24.useRef)({ selectedId, companions: snapshot?.companions });
6453
+ selectionRef.current = { selectedId, companions: snapshot?.companions };
6454
+ const refresh = (0, import_react24.useCallback)(async (throwOnError = false) => {
5943
6455
  try {
5944
6456
  const next = await loadPartner();
5945
6457
  setSnapshot(next);
@@ -5952,10 +6464,10 @@ function PartnerWorkspace({ controller }) {
5952
6464
  setLoading(false);
5953
6465
  }
5954
6466
  }, []);
5955
- (0, import_react19.useEffect)(() => {
6467
+ (0, import_react24.useEffect)(() => {
5956
6468
  void refresh();
5957
6469
  }, [refresh]);
5958
- (0, import_react19.useEffect)(() => controller.subscribe(() => {
6470
+ (0, import_react24.useEffect)(() => controller.subscribe(() => {
5959
6471
  const next = controller.selected();
5960
6472
  if (next) setSelectedId(next);
5961
6473
  const destination = controller.destination();
@@ -5965,6 +6477,21 @@ function PartnerWorkspace({ controller }) {
5965
6477
  }
5966
6478
  }), [controller]);
5967
6479
  const selected = snapshot?.companions.find((item) => item.id === selectedId);
6480
+ const companionRemoved = async (id) => {
6481
+ const current2 = selectionRef.current;
6482
+ const name = current2.companions?.find((item) => item.id === id)?.name ?? "\u4F19\u4F34";
6483
+ setSnapshot((value) => value ? { ...value, companions: value.companions.filter((item) => item.id !== id), sessions: value.sessions.filter((item) => item.companionId !== id) } : value);
6484
+ if (current2.selectedId === id) {
6485
+ setSelectedId(current2.companions?.find((item) => item.id !== id)?.id);
6486
+ setView("home");
6487
+ }
6488
+ setNotice(`\u5DF2\u5220\u9664\u300C${name}\u300D\uFF0C\u5DF2\u9000\u51FA\u5220\u9664\u786E\u8BA4\u3002`);
6489
+ try {
6490
+ await refresh(true);
6491
+ } catch (reason) {
6492
+ setError(`\u4F19\u4F34\u5DF2\u5220\u9664\uFF0C\u4F46\u5237\u65B0\u5931\u8D25\uFF0C\u8BF7\u5237\u65B0\u9875\u9762\uFF0C\u65E0\u9700\u518D\u6B21\u5220\u9664\uFF1A${errorMessage(reason)}`);
6493
+ }
6494
+ };
5968
6495
  const create = async (draft) => {
5969
6496
  try {
5970
6497
  const companion = await api("/companions", { method: "POST", body: JSON.stringify({ companion: {
@@ -6009,18 +6536,18 @@ function PartnerWorkspace({ controller }) {
6009
6536
  setSelectedId(id);
6010
6537
  setView("home");
6011
6538
  };
6012
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("main", { className: "dsh-partner-workspace", children: [
6013
- creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
6014
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { className: "dsh-partner-topbar", children: [
6015
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
6016
- /* @__PURE__ */ (0, import_jsx_runtime15.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_runtime15.jsx)(import_dsh_client_ui_primitives12.IconChevronLeftOutline14, { size: 15 }) }),
6017
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconAgentPresetOutline16, { size: 18 }),
6018
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6019
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u4F19\u4F34" }),
6020
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u5FAE\u4FE1\u6E20\u9053" })
6539
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("main", { className: "dsh-partner-workspace", children: [
6540
+ creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
6541
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { className: "dsh-partner-topbar", children: [
6542
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
6543
+ /* @__PURE__ */ (0, import_jsx_runtime19.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_runtime19.jsx)(import_dsh_client_ui_primitives16.IconChevronLeftOutline14, { size: 15 }) }),
6544
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconAgentPresetOutline16, { size: 18 }),
6545
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
6546
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: "\u4F19\u4F34" }),
6547
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u5FAE\u4FE1\u6E20\u9053" })
6021
6548
  ] })
6022
6549
  ] }),
6023
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6550
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6024
6551
  MobileWorkspaceControls,
6025
6552
  {
6026
6553
  companions: snapshot?.companions ?? [],
@@ -6032,114 +6559,115 @@ function PartnerWorkspace({ controller }) {
6032
6559
  }
6033
6560
  )
6034
6561
  ] }),
6035
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-grid", children: [
6036
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("aside", { className: "dsh-partner-roster", children: [
6037
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-roster-title", children: [
6038
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6039
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "COMPANIONS" }),
6040
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
6562
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-grid", children: [
6563
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("aside", { className: "dsh-partner-roster", children: [
6564
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-roster-title", children: [
6565
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
6566
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "COMPANIONS" }),
6567
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
6041
6568
  ] }),
6042
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconPlusOutline16, { size: 16 }) })
6569
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconPlusOutline16, { size: 16 }) })
6043
6570
  ] }),
6044
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
6571
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
6045
6572
  const channel = snapshot.channels.find((item) => item.companionId === companion.id);
6046
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
6047
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Avatar, { name: companion.name }),
6048
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6049
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: companion.name }),
6050
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: companion.role })
6573
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
6574
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Avatar, { name: companion.name }),
6575
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
6576
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: companion.name }),
6577
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: companion.role })
6051
6578
  ] }),
6052
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
6579
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
6053
6580
  ] }, companion.id);
6054
6581
  }) }),
6055
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: [
6056
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-current": view === "skills" ? "page" : void 0, onClick: () => setView("skills"), children: [
6057
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconBrowseOutline16, { size: 16 }) }),
6058
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "Skill \u5E02\u573A" }),
6059
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u5B89\u88C5\u4E0E\u7BA1\u7406\u80FD\u529B" })
6582
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: [
6583
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-current": view === "skills" ? "page" : void 0, onClick: () => setView("skills"), children: [
6584
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconBrowseOutline16, { size: 16 }) }),
6585
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: "Skill \u5E02\u573A" }),
6586
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u5B89\u88C5\u4E0E\u7BA1\u7406\u80FD\u529B" })
6060
6587
  ] }),
6061
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-current": view === "board" ? "page" : void 0, onClick: () => setView("board"), children: [
6062
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconListPenOutline16, { size: 16 }) }),
6063
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u4EFB\u52A1\u770B\u677F" }),
6064
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u534F\u4F5C\u3001\u59D4\u6D3E\u4E0E\u9A8C\u6536" })
6588
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-current": view === "board" ? "page" : void 0, onClick: () => setView("board"), children: [
6589
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconListPenOutline16, { size: 16 }) }),
6590
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: "\u4EFB\u52A1\u770B\u677F" }),
6591
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u534F\u4F5C\u3001\u59D4\u6D3E\u4E0E\u9A8C\u6536" })
6065
6592
  ] }),
6066
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-current": view === "schedules" ? "page" : void 0, onClick: () => setView("schedules"), children: [
6067
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconPlayOutline16, { size: 16 }) }),
6068
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u5B9A\u65F6\u4EFB\u52A1" }),
6069
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u9009\u62E9\u4F19\u4F34\u5468\u671F\u6267\u884C" })
6593
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-current": view === "schedules" ? "page" : void 0, onClick: () => setView("schedules"), children: [
6594
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconPlayOutline16, { size: 16 }) }),
6595
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: "\u5B9A\u65F6\u4EFB\u52A1" }),
6596
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u9009\u62E9\u4F19\u4F34\u5468\u671F\u6267\u884C" })
6070
6597
  ] }),
6071
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-current": view === "pendant" ? "page" : void 0, onClick: () => setView("pendant"), children: [
6072
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconEditOutline16, { size: 16 }) }),
6073
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u5361\u7247\u8BBE\u7F6E" }),
6074
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u6302\u9970\u3001\u7EF3\u5B50\u4E0E\u56FE\u6848" })
6598
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-current": view === "pendant" ? "page" : void 0, onClick: () => setView("pendant"), children: [
6599
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconEditOutline16, { size: 16 }) }),
6600
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: "\u5361\u7247\u8BBE\u7F6E" }),
6601
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u6302\u9970\u3001\u7EF3\u5B50\u4E0E\u56FE\u6848" })
6075
6602
  ] })
6076
6603
  ] }),
6077
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-roster-note", children: [
6078
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconLinkOutline16, { size: 16 }),
6079
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6080
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
6081
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u5FAE\u4FE1\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
6604
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-roster-note", children: [
6605
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconLinkOutline16, { size: 16 }),
6606
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
6607
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
6608
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u5FAE\u4FE1\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
6082
6609
  ] })
6083
6610
  ] })
6084
6611
  ] }),
6085
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
6086
- loading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
6087
- view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SkillsPanel, {}),
6088
- view === "board" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TaskBoardPanel, { initialTaskId: requestedDestination?.taskId, openRequest: requestedDestination }),
6089
- view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] }),
6090
- view === "pendant" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PendantSettingsPanel, {})
6091
- ] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.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_runtime15.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
6092
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-identity", children: [
6093
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Avatar, { name: selected.name }),
6094
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6095
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "ACTIVE COMPANION" }),
6096
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h1", { children: selected.name }),
6097
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: selected.description || selected.role })
6612
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
6613
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
6614
+ view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SkillsPanel, {}),
6615
+ view === "board" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(RequirementBoard, { initialTaskId: requestedDestination?.taskId, openRequest: requestedDestination }),
6616
+ view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] }),
6617
+ view === "pendant" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PendantSettingsPanel, {})
6618
+ ] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.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_runtime19.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
6619
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-identity", children: [
6620
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Avatar, { name: selected.name }),
6621
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
6622
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "ACTIVE COMPANION" }),
6623
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h1", { children: selected.name }),
6624
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: selected.description || selected.role })
6098
6625
  ] }),
6099
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
6626
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
6100
6627
  ] }),
6101
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
6102
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconAgentPresetOutline16, { size: 16 }), children: "\u603B\u89C8" }),
6103
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconEditOutline16, { size: 16 }), children: "\u8EAB\u4EFD" }),
6104
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconAgentPresetOutline16, { size: 16 }), children: "\u80FD\u529B" }),
6105
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WeixinGlyph, {}), children: "\u5FAE\u4FE1" }),
6106
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconDataOutline16, { size: 16 }), children: "\u8BB0\u5FC6" })
6628
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
6629
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconAgentPresetOutline16, { size: 16 }), children: "\u603B\u89C8" }),
6630
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconEditOutline16, { size: 16 }), children: "\u8EAB\u4EFD" }),
6631
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconAgentPresetOutline16, { size: 16 }), children: "\u80FD\u529B" }),
6632
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(WeixinGlyph, {}), children: "\u5FAE\u4FE1" }),
6633
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconDataOutline16, { size: 16 }), children: "\u8BB0\u5FC6" })
6107
6634
  ] }),
6108
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
6109
- view === "home" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession }),
6110
- view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IdentityEditor, { companion: selected, count: snapshot?.companions.length ?? 1, onChanged: refresh }),
6111
- view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: () => refresh(true) }, selected.id),
6112
- view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }),
6113
- view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, startSession, renewSession, onChanged: refresh })
6635
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
6636
+ notice && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "dsh-partner-inline-notice", role: "status", children: notice }),
6637
+ view === "home" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession }),
6638
+ view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(IdentityEditor, { companion: selected, count: snapshot?.companions.length ?? 1, onChanged: () => refresh(true), onRemoved: companionRemoved }),
6639
+ view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: () => refresh(true) }, selected.id),
6640
+ view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }),
6641
+ view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, startSession, renewSession, onChanged: refresh })
6114
6642
  ] })
6115
6643
  ] }),
6116
- error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
6644
+ error && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
6117
6645
  ] })
6118
6646
  ] })
6119
6647
  ] });
6120
6648
  }
6121
6649
  function MobileWorkspaceControls({ companions, selectedId, view, openCompanion, openPage, createCompanion }) {
6122
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
6123
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
6124
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
6125
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconPlusOutline16, { size: 17 }) })
6650
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
6651
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
6652
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
6653
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconPlusOutline16, { size: 17 }) })
6126
6654
  ] }),
6127
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: [
6128
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-pressed": view === "skills", onClick: () => openPage("skills"), children: [
6129
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconBrowseOutline16, { size: 16 }),
6130
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "Skill" })
6655
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: [
6656
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-pressed": view === "skills", onClick: () => openPage("skills"), children: [
6657
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconBrowseOutline16, { size: 16 }),
6658
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: "Skill" })
6131
6659
  ] }),
6132
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-pressed": view === "board", onClick: () => openPage("board"), children: [
6133
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconListPenOutline16, { size: 16 }),
6134
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u770B\u677F" })
6660
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-pressed": view === "board", onClick: () => openPage("board"), children: [
6661
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconListPenOutline16, { size: 16 }),
6662
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: "\u770B\u677F" })
6135
6663
  ] }),
6136
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-pressed": view === "schedules", onClick: () => openPage("schedules"), children: [
6137
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconPlayOutline16, { size: 16 }),
6138
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u5B9A\u65F6" })
6664
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-pressed": view === "schedules", onClick: () => openPage("schedules"), children: [
6665
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconPlayOutline16, { size: 16 }),
6666
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: "\u5B9A\u65F6" })
6139
6667
  ] }),
6140
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-pressed": view === "pendant", onClick: () => openPage("pendant"), children: [
6141
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconEditOutline16, { size: 16 }),
6142
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u5361\u7247" })
6668
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-pressed": view === "pendant", onClick: () => openPage("pendant"), children: [
6669
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconEditOutline16, { size: 16 }),
6670
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: "\u5361\u7247" })
6143
6671
  ] })
6144
6672
  ] })
6145
6673
  ] });
@@ -6152,141 +6680,76 @@ function HomePanel({ companion, snapshot, navigate, openSession, startSession, r
6152
6680
  const approved = channel ? snapshot.pairings.filter((item) => item.channelId === channel.id && item.status === "approved").length : 0;
6153
6681
  const capabilities = companion.capabilities.map((item) => CAPABILITY_LABELS[item]);
6154
6682
  const online = channel?.runtimeStatus === "running";
6155
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-home", children: [
6156
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { className: "dsh-partner-home-heading", children: [
6157
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6158
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
6159
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u5FAE\u4FE1\u5F85\u547D` : `${companion.name} \u5DF2\u51C6\u5907\u5C31\u7EEA` })
6683
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-home", children: [
6684
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { className: "dsh-partner-home-heading", children: [
6685
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
6686
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
6687
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u5FAE\u4FE1\u5F85\u547D` : `${companion.name} \u5DF2\u51C6\u5907\u5C31\u7EEA` })
6160
6688
  ] }),
6161
- /* @__PURE__ */ (0, import_jsx_runtime15.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" })
6689
+ /* @__PURE__ */ (0, import_jsx_runtime19.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" })
6162
6690
  ] }),
6163
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
6164
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
6165
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Avatar, { name: companion.name }),
6166
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}) }),
6167
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WeixinGlyph, { large: true }) })
6691
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
6692
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
6693
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Avatar, { name: companion.name }),
6694
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", {}) }),
6695
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(WeixinGlyph, { large: true }) })
6168
6696
  ] }),
6169
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
6170
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
6171
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
6697
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
6698
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
6699
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", {}),
6172
6700
  "\u4E3B\u8981\u6E20\u9053 \xB7 \u5FAE\u4FE1"
6173
6701
  ] }),
6174
- /* @__PURE__ */ (0, import_jsx_runtime15.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" }),
6175
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: !channel ? "\u901A\u8FC7\u5FAE\u4FE1 iLink Bot \u63A5\u5165\u3002\u51ED\u636E\u53EA\u8FDB\u5165 DSH \u51ED\u636E\u5E93\uFF0C\u8054\u7CFB\u4EBA\u9996\u6B21\u53D1\u6D88\u606F\u4ECD\u9700\u4F60\u7684\u6279\u51C6\u3002" : online ? "\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u62E5\u6709\u72EC\u7ACB DSH \u4F1A\u8BDD\uFF0C\u4F19\u4F34\u8EAB\u4EFD\u4E00\u81F4\uFF0C\u4F46\u4E0A\u4E0B\u6587\u4E0D\u4F1A\u4E92\u76F8\u6DF7\u5408\u3002" : channel.lastError || "\u6E20\u9053\u914D\u7F6E\u4ECD\u7136\u4FDD\u7559\uFF0C\u53EF\u4EE5\u968F\u65F6\u91CD\u65B0\u542F\u7528\u3002" }),
6176
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
6177
- /* @__PURE__ */ (0, import_jsx_runtime15.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" }),
6178
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: !channel ? "\u626B\u7801\u5B8C\u6210\uFF0C\u65E0\u9700\u7C98\u8D34 Token" : `${approved} \u4F4D\u8054\u7CFB\u4EBA \xB7 ${sessions2.length} \u4E2A\u72EC\u7ACB\u4F1A\u8BDD` })
6702
+ /* @__PURE__ */ (0, import_jsx_runtime19.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" }),
6703
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: !channel ? "\u901A\u8FC7\u5FAE\u4FE1 iLink Bot \u63A5\u5165\u3002\u51ED\u636E\u53EA\u8FDB\u5165 DSH \u51ED\u636E\u5E93\uFF0C\u8054\u7CFB\u4EBA\u9996\u6B21\u53D1\u6D88\u606F\u4ECD\u9700\u4F60\u7684\u6279\u51C6\u3002" : online ? "\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u62E5\u6709\u72EC\u7ACB DSH \u4F1A\u8BDD\uFF0C\u4F19\u4F34\u8EAB\u4EFD\u4E00\u81F4\uFF0C\u4F46\u4E0A\u4E0B\u6587\u4E0D\u4F1A\u4E92\u76F8\u6DF7\u5408\u3002" : channel.lastError || "\u6E20\u9053\u914D\u7F6E\u4ECD\u7136\u4FDD\u7559\uFF0C\u53EF\u4EE5\u968F\u65F6\u91CD\u65B0\u542F\u7528\u3002" }),
6704
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
6705
+ /* @__PURE__ */ (0, import_jsx_runtime19.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" }),
6706
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: !channel ? "\u626B\u7801\u5B8C\u6210\uFF0C\u65E0\u9700\u7C98\u8D34 Token" : `${approved} \u4F4D\u8054\u7CFB\u4EBA \xB7 ${sessions2.length} \u4E2A\u72EC\u7ACB\u4F1A\u8BDD` })
6179
6707
  ] })
6180
6708
  ] })
6181
6709
  ] }),
6182
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-home-details", children: [
6183
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "dsh-partner-home-profile", children: [
6184
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
6185
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconUserOutline16, { size: 16 }) }),
6186
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6187
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
6188
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: companion.role })
6710
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-home-details", children: [
6711
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { className: "dsh-partner-home-profile", children: [
6712
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { children: [
6713
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconUserOutline16, { size: 16 }) }),
6714
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
6715
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
6716
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: companion.role })
6189
6717
  ] }),
6190
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
6718
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
6191
6719
  ] }),
6192
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
6720
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
6193
6721
  ] }),
6194
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
6195
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
6196
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconAgentPresetOutline16, { size: 16 }) }),
6197
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6198
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
6199
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
6722
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
6723
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { children: [
6724
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconAgentPresetOutline16, { size: 16 }) }),
6725
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
6726
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
6727
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
6200
6728
  ] }),
6201
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
6729
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
6202
6730
  ] }),
6203
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
6731
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
6204
6732
  ] }),
6205
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
6206
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
6207
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconDataOutline16, { size: 16 }) }),
6208
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6209
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
6210
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: localSession?.archived ? "\u4F1A\u8BDD\u5DF2\u5F52\u6863" : "\u4F19\u4F34\u4F1A\u8BDD\u5DF2\u5EFA\u7ACB" })
6733
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
6734
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { children: [
6735
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconDataOutline16, { size: 16 }) }),
6736
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
6737
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
6738
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: localSession?.archived ? "\u4F1A\u8BDD\u5DF2\u5F52\u6863" : "\u4F19\u4F34\u4F1A\u8BDD\u5DF2\u5EFA\u7ACB" })
6211
6739
  ] }),
6212
- /* @__PURE__ */ (0, import_jsx_runtime15.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" })
6740
+ /* @__PURE__ */ (0, import_jsx_runtime19.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" })
6213
6741
  ] }),
6214
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: localSession ? `\u6700\u8FD1\u6D3B\u52A8\u4E8E ${relativeTime(localSession.lastMessageAt)}\uFF1B\u53E6\u6709 ${sessions2.filter((item) => item.kind === "channel").length} \u4E2A\u6E20\u9053\u4F1A\u8BDD\u3002` : "\u4F19\u4F34\u4F1A\u8BDD\u6B63\u5728\u521D\u59CB\u5316\uFF0C\u7A0D\u540E\u5373\u53EF\u6253\u5F00\u3002" })
6215
- ] })
6216
- ] })
6217
- ] });
6218
- }
6219
- function IdentityEditor({ companion, count, onChanged }) {
6220
- const [form, setForm] = (0, import_react19.useState)(() => companionDraft(companion));
6221
- const [saving, setSaving] = (0, import_react19.useState)(false);
6222
- const [saved, setSaved] = (0, import_react19.useState)(false);
6223
- const [error, setError] = (0, import_react19.useState)();
6224
- const [confirmingRemove, setConfirmingRemove] = (0, import_react19.useState)(false);
6225
- (0, import_react19.useEffect)(() => {
6226
- setForm(companionDraft(companion));
6227
- setSaved(false);
6228
- }, [companion.id, companion.updatedAt]);
6229
- const submit = async (event) => {
6230
- event.preventDefault();
6231
- setSaving(true);
6232
- setError(void 0);
6233
- try {
6234
- await api(`/companions/${companion.id}`, { method: "PUT", body: JSON.stringify({ companion: form }) });
6235
- setSaved(true);
6236
- await onChanged();
6237
- } catch (reason) {
6238
- setError(errorMessage(reason));
6239
- } finally {
6240
- setSaving(false);
6241
- }
6242
- };
6243
- const remove = async () => {
6244
- try {
6245
- await api(`/companions/${companion.id}`, { method: "DELETE" });
6246
- await onChanged();
6247
- } catch (reason) {
6248
- setError(errorMessage(reason));
6249
- }
6250
- };
6251
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("form", { className: "dsh-partner-form is-identity", onSubmit: (event) => {
6252
- void submit(event);
6253
- }, children: [
6254
- /* @__PURE__ */ (0, import_jsx_runtime15.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" }),
6255
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-fields two", children: [
6256
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
6257
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
6258
- ] }),
6259
- /* @__PURE__ */ (0, import_jsx_runtime15.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_runtime15.jsx)("textarea", { rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
6260
- /* @__PURE__ */ (0, import_jsx_runtime15.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_runtime15.jsx)("textarea", { rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
6261
- error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
6262
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-form-actions", children: [
6263
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: saved && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
6264
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconCheckOutline14, { size: 14 }),
6265
- "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u5C06\u4F7F\u7528\u65B0\u8EAB\u4EFD"
6266
- ] }) }),
6267
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { disabled: saving, children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
6268
- ] }),
6269
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-identity-danger", "data-confirming": confirmingRemove, children: [
6270
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6271
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: confirmingRemove ? `\u786E\u8BA4\u5220\u9664\u300C${companion.name}\u300D\uFF1F` : "\u5220\u9664\u4F19\u4F34" }),
6272
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: confirmingRemove ? "\u8BE5\u4F19\u4F34\u7684\u672C\u5730\u914D\u7F6E\u4F1A\u88AB\u79FB\u9664\uFF1B\u5DF2\u6709\u6E20\u9053\u5FC5\u987B\u5148\u89E3\u7ED1\u3002" : "\u5FC5\u987B\u5148\u79FB\u9664\u5DF2\u7ED1\u5B9A\u5FAE\u4FE1\u6E20\u9053\uFF1B\u4E0D\u4F1A\u81EA\u52A8\u628A\u8054\u7CFB\u4EBA\u8F6C\u4EA4\u7ED9\u5176\u4ED6\u4F19\u4F34\u3002" })
6273
- ] }),
6274
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6275
- confirmingRemove && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "is-secondary", onClick: () => setConfirmingRemove(false), children: "\u53D6\u6D88" }),
6276
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: confirmingRemove ? "is-danger" : "", disabled: count <= 1, onClick: () => confirmingRemove ? void remove() : setConfirmingRemove(true), children: [
6277
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconTrashOutline16, { size: 16 }),
6278
- confirmingRemove ? "\u786E\u8BA4\u5220\u9664" : "\u5220\u9664"
6279
- ] })
6742
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: localSession ? `\u6700\u8FD1\u6D3B\u52A8\u4E8E ${relativeTime(localSession.lastMessageAt)}\uFF1B\u53E6\u6709 ${sessions2.filter((item) => item.kind === "channel").length} \u4E2A\u6E20\u9053\u4F1A\u8BDD\u3002` : "\u4F19\u4F34\u4F1A\u8BDD\u6B63\u5728\u521D\u59CB\u5316\uFF0C\u7A0D\u540E\u5373\u53EF\u6253\u5F00\u3002" })
6280
6743
  ] })
6281
6744
  ] })
6282
6745
  ] });
6283
6746
  }
6284
6747
  function WeixinPanel({ companion, snapshot, onChanged }) {
6285
6748
  const channel = snapshot.channels.find((item) => item.companionId === companion.id);
6286
- const [login, setLogin] = (0, import_react19.useState)();
6287
- const [busy, setBusy] = (0, import_react19.useState)(false);
6288
- const [error, setError] = (0, import_react19.useState)();
6289
- (0, import_react19.useEffect)(() => {
6749
+ const [login, setLogin] = (0, import_react24.useState)();
6750
+ const [busy, setBusy] = (0, import_react24.useState)(false);
6751
+ const [error, setError] = (0, import_react24.useState)();
6752
+ (0, import_react24.useEffect)(() => {
6290
6753
  if (!login || login.phase === "confirmed" || login.phase === "expired" || login.phase === "error") return;
6291
6754
  const timer = window.setInterval(() => {
6292
6755
  void api(`/weixin/login/${login.id}`).then(async (result) => {
@@ -6332,93 +6795,93 @@ function WeixinPanel({ companion, snapshot, onChanged }) {
6332
6795
  setError(errorMessage(reason));
6333
6796
  }
6334
6797
  };
6335
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
6336
- /* @__PURE__ */ (0, import_jsx_runtime15.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" }),
6337
- !channel && !login && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
6338
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WeixinGlyph, { large: true }) }),
6339
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6340
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
6798
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
6799
+ /* @__PURE__ */ (0, import_jsx_runtime19.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" }),
6800
+ !channel && !login && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
6801
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(WeixinGlyph, { large: true }) }),
6802
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
6803
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("strong", { children: [
6341
6804
  "\u628A ",
6342
6805
  companion.name,
6343
6806
  " \u5E26\u5230\u5FAE\u4FE1"
6344
6807
  ] }),
6345
- /* @__PURE__ */ (0, import_jsx_runtime15.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" }),
6346
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("ul", { children: [
6347
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
6348
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
6349
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
6808
+ /* @__PURE__ */ (0, import_jsx_runtime19.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" }),
6809
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("ul", { children: [
6810
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
6811
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
6812
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
6350
6813
  ] })
6351
6814
  ] }),
6352
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy, onClick: () => {
6815
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", disabled: busy, onClick: () => {
6353
6816
  void begin();
6354
6817
  }, children: busy ? "\u6B63\u5728\u7533\u8BF7\u4E8C\u7EF4\u7801\u2026" : "\u626B\u7801\u8FDE\u63A5\u5FAE\u4FE1" })
6355
6818
  ] }),
6356
- login && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
6357
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
6358
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6359
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "WECHAT ILINK BOT" }),
6360
- /* @__PURE__ */ (0, import_jsx_runtime15.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" }),
6361
- /* @__PURE__ */ (0, import_jsx_runtime15.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") }),
6362
- (login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", onClick: () => {
6819
+ login && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
6820
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
6821
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
6822
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "WECHAT ILINK BOT" }),
6823
+ /* @__PURE__ */ (0, import_jsx_runtime19.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" }),
6824
+ /* @__PURE__ */ (0, import_jsx_runtime19.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") }),
6825
+ (login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", onClick: () => {
6363
6826
  setLogin(void 0);
6364
6827
  void begin();
6365
6828
  }, children: [
6366
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconRefreshOutline16, { size: 16 }),
6829
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconRefreshOutline16, { size: 16 }),
6367
6830
  "\u91CD\u65B0\u751F\u6210"
6368
6831
  ] })
6369
6832
  ] })
6370
6833
  ] }),
6371
- channel && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
6372
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
6373
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WeixinGlyph, { large: true }) }),
6374
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6375
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "WECHAT CHANNEL" }),
6376
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: channel.name }),
6377
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: channel.accountId })
6834
+ channel && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
6835
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
6836
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(WeixinGlyph, { large: true }) }),
6837
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
6838
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "WECHAT CHANNEL" }),
6839
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: channel.name }),
6840
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: channel.accountId })
6378
6841
  ] }),
6379
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChannelStatus, { channel }),
6380
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": channel.enabled, disabled: busy, "aria-label": channel.enabled ? "\u505C\u7528\u5FAE\u4FE1\u6E20\u9053" : "\u542F\u7528\u5FAE\u4FE1\u6E20\u9053", onClick: () => {
6842
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChannelStatus, { channel }),
6843
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": channel.enabled, disabled: busy, "aria-label": channel.enabled ? "\u505C\u7528\u5FAE\u4FE1\u6E20\u9053" : "\u542F\u7528\u5FAE\u4FE1\u6E20\u9053", onClick: () => {
6381
6844
  void toggle();
6382
- }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}) })
6845
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", {}) })
6383
6846
  ] }),
6384
- channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "dsh-partner-inline-error", children: channel.lastError }),
6385
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
6386
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6387
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "ACCESS" }),
6388
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
6847
+ channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "dsh-partner-inline-error", children: channel.lastError }),
6848
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
6849
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
6850
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "ACCESS" }),
6851
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
6389
6852
  ] }),
6390
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("em", { children: [
6853
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("em", { children: [
6391
6854
  pairings.filter((item) => item.status === "pending").length,
6392
6855
  " \u4E2A\u5F85\u5904\u7406"
6393
6856
  ] })
6394
6857
  ] }),
6395
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u8054\u7CFB\u4EBA", detail: "\u6709\u4EBA\u9996\u6B21\u5411\u673A\u5668\u4EBA\u53D1\u6D88\u606F\u540E\uFF0C\u914D\u5BF9\u8BF7\u6C42\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002", compact: true }) : pairings.map((pairing) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { children: [
6396
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconUserOutline16, { size: 16 }) }),
6397
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6398
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: pairing.displayName }),
6399
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
6858
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u8054\u7CFB\u4EBA", detail: "\u6709\u4EBA\u9996\u6B21\u5411\u673A\u5668\u4EBA\u53D1\u6D88\u606F\u540E\uFF0C\u914D\u5BF9\u8BF7\u6C42\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002", compact: true }) : pairings.map((pairing) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("article", { children: [
6859
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconUserOutline16, { size: 16 }) }),
6860
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
6861
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: pairing.displayName }),
6862
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
6400
6863
  pairing.status === "pending" ? "\u7B49\u5F85\u5BA1\u6279" : pairing.status === "approved" ? "\u5DF2\u6388\u6743\u72EC\u7ACB\u4F1A\u8BDD" : "\u5DF2\u963B\u6B62",
6401
6864
  " \xB7 ",
6402
6865
  new Date(pairing.updatedAt).toLocaleString()
6403
6866
  ] })
6404
6867
  ] }),
6405
- pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
6406
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { onClick: () => {
6868
+ pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
6869
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { onClick: () => {
6407
6870
  void actPairing(pairing.id, "blocked");
6408
6871
  }, children: "\u62D2\u7EDD" }),
6409
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "is-primary", onClick: () => {
6872
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { className: "is-primary", onClick: () => {
6410
6873
  void actPairing(pairing.id, "approved");
6411
6874
  }, children: "\u6279\u51C6" })
6412
6875
  ] }),
6413
- pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { onClick: () => {
6876
+ pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { onClick: () => {
6414
6877
  void actPairing(pairing.id, "blocked");
6415
6878
  }, children: "\u64A4\u9500" }),
6416
- pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { onClick: () => {
6879
+ pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { onClick: () => {
6417
6880
  void actPairing(pairing.id, "approved");
6418
6881
  }, children: "\u91CD\u65B0\u6279\u51C6" })
6419
6882
  ] }, pairing.id)) })
6420
6883
  ] }),
6421
- error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "dsh-partner-inline-error", children: error })
6884
+ error && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "dsh-partner-inline-error", children: error })
6422
6885
  ] });
6423
6886
  }
6424
6887
  function MemoryPanel({ companion, snapshot, openSession, startSession, renewSession, onChanged }) {
@@ -6426,19 +6889,19 @@ function MemoryPanel({ companion, snapshot, openSession, startSession, renewSess
6426
6889
  const localSession = sessions2.find((item) => item.kind === "local");
6427
6890
  const channelSessionCount = sessions2.filter((item) => item.kind === "channel").length;
6428
6891
  const heartbeat = snapshot.heartbeatStates.find((item) => item.companionId === companion.id);
6429
- const [automation, setAutomation] = (0, import_react19.useState)(() => structuredClone(companion.automation));
6430
- const [memories, setMemories] = (0, import_react19.useState)([]);
6431
- const [reflections, setReflections] = (0, import_react19.useState)([]);
6432
- const [profiles, setProfiles] = (0, import_react19.useState)([]);
6433
- const [concernActivity, setConcernActivity] = (0, import_react19.useState)({ concerns: [], observations: [] });
6434
- const [newConcern, setNewConcern] = (0, import_react19.useState)("");
6435
- const [memoryRevision, setMemoryRevision] = (0, import_react19.useState)(0);
6436
- const [editing, setEditing] = (0, import_react19.useState)();
6437
- const [busy, setBusy] = (0, import_react19.useState)(false);
6438
- const [notice, setNotice] = (0, import_react19.useState)();
6439
- const [error, setError] = (0, import_react19.useState)();
6440
- const [modelCatalog, setModelCatalog] = (0, import_react19.useState)();
6441
- const loadMemory = (0, import_react19.useCallback)(async () => {
6892
+ const [automation, setAutomation] = (0, import_react24.useState)(() => structuredClone(companion.automation));
6893
+ const [memories, setMemories] = (0, import_react24.useState)([]);
6894
+ const [reflections, setReflections] = (0, import_react24.useState)([]);
6895
+ const [profiles, setProfiles] = (0, import_react24.useState)([]);
6896
+ const [concernActivity, setConcernActivity] = (0, import_react24.useState)({ concerns: [], observations: [] });
6897
+ const [newConcern, setNewConcern] = (0, import_react24.useState)("");
6898
+ const [memoryRevision, setMemoryRevision] = (0, import_react24.useState)(0);
6899
+ const [editing, setEditing] = (0, import_react24.useState)();
6900
+ const [busy, setBusy] = (0, import_react24.useState)(false);
6901
+ const [notice, setNotice] = (0, import_react24.useState)();
6902
+ const [error, setError] = (0, import_react24.useState)();
6903
+ const [modelCatalog, setModelCatalog] = (0, import_react24.useState)();
6904
+ const loadMemory = (0, import_react24.useCallback)(async () => {
6442
6905
  const [result, activity] = await Promise.all([api(`/companions/${companion.id}/memory`), api(`/companions/${companion.id}/concerns`)]);
6443
6906
  setMemories(result.memories);
6444
6907
  setReflections(result.reflections);
@@ -6446,11 +6909,11 @@ function MemoryPanel({ companion, snapshot, openSession, startSession, renewSess
6446
6909
  setConcernActivity(activity);
6447
6910
  setMemoryRevision((value) => value + 1);
6448
6911
  }, [companion.id]);
6449
- (0, import_react19.useEffect)(() => {
6912
+ (0, import_react24.useEffect)(() => {
6450
6913
  setAutomation(structuredClone(companion.automation));
6451
6914
  void loadMemory().catch((reason) => setError(errorMessage(reason)));
6452
6915
  }, [companion.id, companion.updatedAt, loadMemory]);
6453
- (0, import_react19.useEffect)(() => {
6916
+ (0, import_react24.useEffect)(() => {
6454
6917
  void api("/models").then(setModelCatalog).catch((reason) => setError(errorMessage(reason)));
6455
6918
  }, []);
6456
6919
  const inheritedProvider = companion.provider || modelCatalog?.defaultSelection.provider || "";
@@ -6560,157 +7023,157 @@ function MemoryPanel({ companion, snapshot, openSession, startSession, renewSess
6560
7023
  setBusy(false);
6561
7024
  }
6562
7025
  };
6563
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-form is-memory", children: [
6564
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SectionHeading, { eyebrow: "CONTINUITY", title: "\u4F1A\u8BDD\u8BB0\u5FC6", detail: "\u4F19\u4F34\u53EF\u4EE5\u76F4\u63A5\u5728 DSH \u4E2D\u5EFA\u7ACB\u672C\u5730\u5BF9\u8BDD\uFF1B\u5FAE\u4FE1\u53EA\u662F\u53EF\u9009\u6E20\u9053\u3002\u4E0D\u540C\u8054\u7CFB\u4EBA\u4ECD\u4FDD\u6301\u72EC\u7ACB\u4E0A\u4E0B\u6587\uFF0C\u77E5\u8BC6\u5E93\u7EE7\u7EED\u7531\u77E5\u8BC6\u5E93\u63D2\u4EF6\u7BA1\u7406\u3002" }),
6565
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-metrics", children: [
6566
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { children: [
6567
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u4F19\u4F34\u4F1A\u8BDD" }),
6568
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: sessions2.length }),
6569
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: localSession ? `1 \u4E2A\u672C\u5730 \xB7 ${channelSessionCount} \u4E2A\u6E20\u9053` : `${channelSessionCount} \u4E2A\u6E20\u9053` })
7026
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-form is-memory", children: [
7027
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SectionHeading, { eyebrow: "CONTINUITY", title: "\u4F1A\u8BDD\u8BB0\u5FC6", detail: "\u4F19\u4F34\u53EF\u4EE5\u76F4\u63A5\u5728 DSH \u4E2D\u5EFA\u7ACB\u672C\u5730\u5BF9\u8BDD\uFF1B\u5FAE\u4FE1\u53EA\u662F\u53EF\u9009\u6E20\u9053\u3002\u4E0D\u540C\u8054\u7CFB\u4EBA\u4ECD\u4FDD\u6301\u72EC\u7ACB\u4E0A\u4E0B\u6587\uFF0C\u77E5\u8BC6\u5E93\u7EE7\u7EED\u7531\u77E5\u8BC6\u5E93\u63D2\u4EF6\u7BA1\u7406\u3002" }),
7028
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-metrics", children: [
7029
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("article", { children: [
7030
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u4F19\u4F34\u4F1A\u8BDD" }),
7031
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: sessions2.length }),
7032
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: localSession ? `1 \u4E2A\u672C\u5730 \xB7 ${channelSessionCount} \u4E2A\u6E20\u9053` : `${channelSessionCount} \u4E2A\u6E20\u9053` })
6570
7033
  ] }),
6571
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { children: [
6572
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u957F\u671F\u8BB0\u5FC6" }),
6573
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: memories.filter((item) => item.status === "active").length }),
6574
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { children: [
7034
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("article", { children: [
7035
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u957F\u671F\u8BB0\u5FC6" }),
7036
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: memories.filter((item) => item.status === "active").length }),
7037
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("p", { children: [
6575
7038
  reflections.length,
6576
7039
  " \u7BC7\u6BCF\u65E5\u56DE\u987E"
6577
7040
  ] })
6578
7041
  ] }),
6579
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { children: [
6580
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u6700\u8FD1\u5FC3\u8DF3" }),
6581
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: heartbeat?.lastCheckedAt ? relativeTime(heartbeat.lastCheckedAt) : "\u5C1A\u672A" }),
6582
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: heartbeat?.lastError ? "\u4E0A\u6B21\u6267\u884C\u5F02\u5E38" : `\u4ECA\u65E5\u53D1\u9001 ${heartbeat?.sentCount ?? 0} \u6B21` })
7042
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("article", { children: [
7043
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u6700\u8FD1\u5FC3\u8DF3" }),
7044
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: heartbeat?.lastCheckedAt ? relativeTime(heartbeat.lastCheckedAt) : "\u5C1A\u672A" }),
7045
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: heartbeat?.lastError ? "\u4E0A\u6B21\u6267\u884C\u5F02\u5E38" : `\u4ECA\u65E5\u53D1\u9001 ${heartbeat?.sentCount ?? 0} \u6B21` })
6583
7046
  ] })
6584
7047
  ] }),
6585
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-automation-grid", children: [
6586
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "dsh-partner-automation", children: [
6587
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
6588
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6589
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u5B66\u4E60\u4E0E\u957F\u671F\u8BB0\u5FC6" }),
6590
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u6309\u8054\u7CFB\u4EBA\u5F52\u6863\u5B8C\u6574\u5BF9\u8BDD\uFF0C\u63D0\u70BC\u6BCF\u65E5\u56DE\u987E\u548C\u7ED3\u6784\u5316\u8BB0\u5FC6\uFF0C\u5E76\u5728\u76F8\u5173\u8BDD\u9898\u51FA\u73B0\u65F6\u53EC\u56DE\u3002" })
7048
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-automation-grid", children: [
7049
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { className: "dsh-partner-automation", children: [
7050
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { children: [
7051
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
7052
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: "\u5B66\u4E60\u4E0E\u957F\u671F\u8BB0\u5FC6" }),
7053
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u6309\u8054\u7CFB\u4EBA\u5F52\u6863\u5B8C\u6574\u5BF9\u8BDD\uFF0C\u63D0\u70BC\u6BCF\u65E5\u56DE\u987E\u548C\u7ED3\u6784\u5316\u8BB0\u5FC6\uFF0C\u5E76\u5728\u76F8\u5173\u8BDD\u9898\u51FA\u73B0\u65F6\u53EC\u56DE\u3002" })
6591
7054
  ] }),
6592
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.memory.enabled, "aria-label": "\u542F\u7528\u4F19\u4F34\u5B66\u4E60", onClick: () => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, enabled: !current2.memory.enabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}) })
7055
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.memory.enabled, "aria-label": "\u542F\u7528\u4F19\u4F34\u5B66\u4E60", onClick: () => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, enabled: !current2.memory.enabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", {}) })
6593
7056
  ] }),
6594
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-automation-fields is-memory-model", children: [
6595
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u4FDD\u7559\u671F\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { value: automation.memory.retentionDays, onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, retentionDays: Number(event.target.value) } })), children: [
6596
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 0, children: "\u6C38\u4E45\u4FDD\u7559" }),
6597
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 30, children: "30 \u5929" }),
6598
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 90, children: "90 \u5929" }),
6599
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 180, children: "180 \u5929" }),
6600
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 365, children: "1 \u5E74" }),
6601
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 1095, children: "3 \u5E74" })
7057
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-automation-fields is-memory-model", children: [
7058
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FormField, { label: "\u4FDD\u7559\u671F\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("select", { value: automation.memory.retentionDays, onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, retentionDays: Number(event.target.value) } })), children: [
7059
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 0, children: "\u6C38\u4E45\u4FDD\u7559" }),
7060
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 30, children: "30 \u5929" }),
7061
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 90, children: "90 \u5929" }),
7062
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 180, children: "180 \u5929" }),
7063
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 365, children: "1 \u5E74" }),
7064
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 1095, children: "3 \u5E74" })
6602
7065
  ] }) }),
6603
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u63D0\u70BC Provider", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { value: automation.memory.provider ?? "", onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, provider: event.target.value, model: "" } })), children: [
6604
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: "", children: [
7066
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FormField, { label: "\u63D0\u70BC Provider", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("select", { value: automation.memory.provider ?? "", onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, provider: event.target.value, model: "" } })), children: [
7067
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("option", { value: "", children: [
6605
7068
  "\u8DDF\u968F\u4F19\u4F34 \xB7 ",
6606
7069
  inheritedProvider || "DSH \u9ED8\u8BA4"
6607
7070
  ] }),
6608
- modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
7071
+ modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
6609
7072
  ] }) }),
6610
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u63D0\u70BC\u6A21\u578B", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { value: automation.memory.model ?? "", onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, model: event.target.value } })), children: [
6611
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: "", children: [
7073
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FormField, { label: "\u63D0\u70BC\u6A21\u578B", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("select", { value: automation.memory.model ?? "", onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, model: event.target.value } })), children: [
7074
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("option", { value: "", children: [
6612
7075
  "\u8DDF\u968F\u4F19\u4F34 \xB7 ",
6613
7076
  companion.model || modelCatalog?.defaultSelection.model || "DSH \u9ED8\u8BA4"
6614
7077
  ] }),
6615
- modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
7078
+ modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
6616
7079
  ] }) })
6617
7080
  ] }),
6618
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-review-policy", children: [
6619
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.memory.dailyReviewEnabled, "aria-label": "\u542F\u7528\u6BCF\u65E5\u7EC8\u5BA1", onClick: () => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, dailyReviewEnabled: !current2.memory.dailyReviewEnabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}) }),
6620
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6621
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u6BCF\u65E5\u7EC8\u5BA1" }),
6622
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u6B21\u65E5\u81EA\u52A8\u5408\u5E76\u91CD\u590D\u3001\u7EA0\u6B63\u504F\u5DEE\u5E76\u5EFA\u7ACB\u8BB0\u5FC6\u5173\u7CFB" })
7081
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-review-policy", children: [
7082
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.memory.dailyReviewEnabled, "aria-label": "\u542F\u7528\u6BCF\u65E5\u7EC8\u5BA1", onClick: () => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, dailyReviewEnabled: !current2.memory.dailyReviewEnabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", {}) }),
7083
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
7084
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: "\u6BCF\u65E5\u7EC8\u5BA1" }),
7085
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u6B21\u65E5\u81EA\u52A8\u5408\u5E76\u91CD\u590D\u3001\u7EA0\u6B63\u504F\u5DEE\u5E76\u5EFA\u7ACB\u8BB0\u5FC6\u5173\u7CFB" })
6623
7086
  ] }),
6624
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("label", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("select", { "aria-label": "\u6BCF\u65E5\u7EC8\u5BA1\u65F6\u95F4", value: automation.memory.dailyReviewHour, onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, dailyReviewHour: Number(event.target.value) } })), children: Array.from({ length: 24 }, (_, hour) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: hour, children: [
7087
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("label", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("select", { "aria-label": "\u6BCF\u65E5\u7EC8\u5BA1\u65F6\u95F4", value: automation.memory.dailyReviewHour, onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, dailyReviewHour: Number(event.target.value) } })), children: Array.from({ length: 24 }, (_, hour) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("option", { value: hour, children: [
6625
7088
  String(hour).padStart(2, "0"),
6626
7089
  ":00"
6627
7090
  ] }, hour)) }) }),
6628
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy || reflections.length === 0, onClick: () => {
7091
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", disabled: busy || reflections.length === 0, onClick: () => {
6629
7092
  void review();
6630
7093
  }, children: "\u7ACB\u5373\u7EC8\u5BA1" })
6631
7094
  ] })
6632
7095
  ] }),
6633
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "dsh-partner-automation", children: [
6634
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
6635
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6636
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u6301\u7EED\u611F\u77E5" }),
6637
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u4F19\u4F34\u53EA\u89C2\u5BDF\u5C1A\u672A\u95ED\u73AF\u7684\u4E8B\u60C5\u662F\u5426\u51FA\u73B0\u65B0\u53D8\u5316\uFF0C\u5E76\u7531\u514B\u5236\u7684\u6253\u6270\u7B56\u7565\u51B3\u5B9A\u4F55\u65F6\u544A\u8BC9\u4F60\u3002" })
7096
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { className: "dsh-partner-automation", children: [
7097
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { children: [
7098
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
7099
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: "\u6301\u7EED\u611F\u77E5" }),
7100
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u4F19\u4F34\u53EA\u89C2\u5BDF\u5C1A\u672A\u95ED\u73AF\u7684\u4E8B\u60C5\u662F\u5426\u51FA\u73B0\u65B0\u53D8\u5316\uFF0C\u5E76\u7531\u514B\u5236\u7684\u6253\u6270\u7B56\u7565\u51B3\u5B9A\u4F55\u65F6\u544A\u8BC9\u4F60\u3002" })
6638
7101
  ] }),
6639
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.heartbeat.enabled, "aria-label": "\u542F\u7528\u4F19\u4F34\u5FC3\u8DF3", onClick: () => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, enabled: !current2.heartbeat.enabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}) })
7102
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.heartbeat.enabled, "aria-label": "\u542F\u7528\u4F19\u4F34\u5FC3\u8DF3", onClick: () => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, enabled: !current2.heartbeat.enabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", {}) })
6640
7103
  ] }),
6641
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-automation-fields is-heartbeat", children: [
6642
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u68C0\u67E5\u95F4\u9694", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { value: automation.heartbeat.intervalMinutes, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, intervalMinutes: Number(event.target.value) } })), children: [
6643
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 30, children: "30 \u5206\u949F" }),
6644
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 60, children: "1 \u5C0F\u65F6" }),
6645
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 180, children: "3 \u5C0F\u65F6" }),
6646
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 360, children: "6 \u5C0F\u65F6" }),
6647
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 720, children: "12 \u5C0F\u65F6" }),
6648
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 1440, children: "24 \u5C0F\u65F6" })
7104
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-automation-fields is-heartbeat", children: [
7105
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FormField, { label: "\u68C0\u67E5\u95F4\u9694", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("select", { value: automation.heartbeat.intervalMinutes, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, intervalMinutes: Number(event.target.value) } })), children: [
7106
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 30, children: "30 \u5206\u949F" }),
7107
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 60, children: "1 \u5C0F\u65F6" }),
7108
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 180, children: "3 \u5C0F\u65F6" }),
7109
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 360, children: "6 \u5C0F\u65F6" }),
7110
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 720, children: "12 \u5C0F\u65F6" }),
7111
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 1440, children: "24 \u5C0F\u65F6" })
6649
7112
  ] }) }),
6650
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u514D\u6253\u6270\u5F00\u59CB", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { type: "number", min: 0, max: 23, value: automation.heartbeat.quietStartHour, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, quietStartHour: Number(event.target.value) } })) }) }),
6651
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u514D\u6253\u6270\u7ED3\u675F", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { type: "number", min: 0, max: 23, value: automation.heartbeat.quietEndHour, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, quietEndHour: Number(event.target.value) } })) }) }),
6652
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u6BCF\u65E5\u4E0A\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { value: automation.heartbeat.dailyLimit, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, dailyLimit: Number(event.target.value) } })), children: [
6653
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 0, children: "\u4E0D\u9650" }),
6654
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 1, children: "1 \u6B21" }),
6655
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 2, children: "2 \u6B21" }),
6656
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 3, children: "3 \u6B21" }),
6657
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 5, children: "5 \u6B21" }),
6658
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 8, children: "8 \u6B21" })
7113
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FormField, { label: "\u514D\u6253\u6270\u5F00\u59CB", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", { type: "number", min: 0, max: 23, value: automation.heartbeat.quietStartHour, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, quietStartHour: Number(event.target.value) } })) }) }),
7114
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FormField, { label: "\u514D\u6253\u6270\u7ED3\u675F", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", { type: "number", min: 0, max: 23, value: automation.heartbeat.quietEndHour, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, quietEndHour: Number(event.target.value) } })) }) }),
7115
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FormField, { label: "\u6BCF\u65E5\u4E0A\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("select", { value: automation.heartbeat.dailyLimit, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, dailyLimit: Number(event.target.value) } })), children: [
7116
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 0, children: "\u4E0D\u9650" }),
7117
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 1, children: "1 \u6B21" }),
7118
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 2, children: "2 \u6B21" }),
7119
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 3, children: "3 \u6B21" }),
7120
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 5, children: "5 \u6B21" }),
7121
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value: 8, children: "8 \u6B21" })
6659
7122
  ] }) })
6660
7123
  ] }),
6661
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ConcernBoard, { companionId: companion.id, activity: concernActivity, value: newConcern, busy, onValue: setNewConcern, onAdd: () => {
7124
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ConcernBoard, { companionId: companion.id, activity: concernActivity, value: newConcern, busy, onValue: setNewConcern, onAdd: () => {
6662
7125
  void addConcern();
6663
7126
  }, onCheck: (item) => {
6664
7127
  void trigger(item.id);
6665
7128
  }, onAct: (item, action) => {
6666
7129
  void actConcern(item, action);
6667
7130
  } }),
6668
- heartbeat?.lastError && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "dsh-partner-inline-error", children: heartbeat.lastError }),
6669
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-automation-actions", children: [
6670
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy || sessions2.length === 0, onClick: () => {
7131
+ heartbeat?.lastError && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "dsh-partner-inline-error", children: heartbeat.lastError }),
7132
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-automation-actions", children: [
7133
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", disabled: busy || sessions2.length === 0, onClick: () => {
6671
7134
  void trigger();
6672
7135
  }, children: "\u68C0\u67E5\u5230\u671F\u9879" }),
6673
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => {
7136
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => {
6674
7137
  void save();
6675
7138
  }, children: busy ? "\u6B63\u5728\u5904\u7406\u2026" : "\u4FDD\u5B58\u8BBE\u7F6E" })
6676
7139
  ] })
6677
7140
  ] })
6678
7141
  ] }),
6679
- notice && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { className: "dsh-partner-inline-notice", children: [
6680
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconCheckOutline14, { size: 14 }),
7142
+ notice && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("p", { className: "dsh-partner-inline-notice", children: [
7143
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconCheckOutline14, { size: 14 }),
6681
7144
  notice
6682
7145
  ] }),
6683
- error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
6684
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MemoryLibrary, { companionId: companion.id, revision: memoryRevision, profiles, memories, reflections, editing, busy, setEditing, save: () => {
7146
+ error && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
7147
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(MemoryLibrary, { companionId: companion.id, revision: memoryRevision, profiles, memories, reflections, editing, busy, setEditing, save: () => {
6685
7148
  void saveMemory();
6686
7149
  }, remove: (item) => {
6687
7150
  void deleteMemory(item);
6688
7151
  } }),
6689
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-section-heading", children: [
6690
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6691
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "SESSIONS" }),
6692
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u4F19\u4F34\u4F1A\u8BDD" })
7152
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-section-heading", children: [
7153
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
7154
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "SESSIONS" }),
7155
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: "\u4F19\u4F34\u4F1A\u8BDD" })
6693
7156
  ] }),
6694
- localSession === void 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", onClick: () => {
7157
+ localSession === void 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", onClick: () => {
6695
7158
  void startSession(companion.id);
6696
7159
  }, children: [
6697
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconPlusOutline16, { size: 14 }),
7160
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconPlusOutline16, { size: 14 }),
6698
7161
  "\u5F00\u59CB\u672C\u5730\u5BF9\u8BDD"
6699
7162
  ] })
6700
7163
  ] }),
6701
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-session-list", children: [
6702
- sessions2.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { "data-archived": item.archived, "data-kind": item.kind, children: [
6703
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconDataOutline16, { size: 16 }) }),
6704
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6705
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: item.kind === "local" ? "\u672C\u5730\u4F19\u4F34\u4F1A\u8BDD" : `\u5FAE\u4FE1\u8054\u7CFB\u4EBA \xB7 ${item.userId.slice(-6)}` }),
6706
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: item.archived ? "\u5DF2\u5F52\u6863 \xB7 \u957F\u671F\u8BB0\u5FC6\u4FDD\u7559" : `${item.sessionId} \xB7 ${new Date(item.lastMessageAt).toLocaleString()}` })
7164
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-session-list", children: [
7165
+ sessions2.map((item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("article", { "data-archived": item.archived, "data-kind": item.kind, children: [
7166
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconDataOutline16, { size: 16 }) }),
7167
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
7168
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: item.kind === "local" ? "\u672C\u5730\u4F19\u4F34\u4F1A\u8BDD" : `\u5FAE\u4FE1\u8054\u7CFB\u4EBA \xB7 ${item.userId.slice(-6)}` }),
7169
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: item.archived ? "\u5DF2\u5F52\u6863 \xB7 \u957F\u671F\u8BB0\u5FC6\u4FDD\u7559" : `${item.sessionId} \xB7 ${new Date(item.lastMessageAt).toLocaleString()}` })
6707
7170
  ] }),
6708
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: item.archived ? "is-primary" : void 0, onClick: () => {
7171
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: item.archived ? "is-primary" : void 0, onClick: () => {
6709
7172
  if (item.archived) void renewSession(item.id);
6710
7173
  else void openSession(item.id, item.sessionId);
6711
7174
  }, children: item.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
6712
7175
  ] }, item.id)),
6713
- sessions2.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u4F19\u4F34\u4F1A\u8BDD", detail: "\u65E0\u9700\u8FDE\u63A5\u5FAE\u4FE1\uFF0C\u76F4\u63A5\u5F00\u59CB\u672C\u5730\u5BF9\u8BDD\uFF1B\u4EE5\u540E\u8FDE\u63A5\u7684\u5FAE\u4FE1\u8054\u7CFB\u4EBA\u4F1A\u7EE7\u7EED\u4F7F\u7528\u5404\u81EA\u72EC\u7ACB\u7684\u6E20\u9053\u4F1A\u8BDD\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => {
7176
+ sessions2.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u4F19\u4F34\u4F1A\u8BDD", detail: "\u65E0\u9700\u8FDE\u63A5\u5FAE\u4FE1\uFF0C\u76F4\u63A5\u5F00\u59CB\u672C\u5730\u5BF9\u8BDD\uFF1B\u4EE5\u540E\u8FDE\u63A5\u7684\u5FAE\u4FE1\u8054\u7CFB\u4EBA\u4F1A\u7EE7\u7EED\u4F7F\u7528\u5404\u81EA\u72EC\u7ACB\u7684\u6E20\u9053\u4F1A\u8BDD\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: () => {
6714
7177
  void startSession(companion.id);
6715
7178
  }, children: "\u5F00\u59CB\u5BF9\u8BDD" }), compact: true })
6716
7179
  ] })
@@ -6721,19 +7184,19 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
6721
7184
  const active = visible.filter((item) => item.state !== "resolved");
6722
7185
  const resolved = visible.filter((item) => item.state === "resolved");
6723
7186
  const latest = new Map([...activity.observations].reverse().map((item) => [item.concernId, item]));
6724
- const [composing, setComposing] = (0, import_react19.useState)(false);
6725
- const [expandedId, setExpandedId] = (0, import_react19.useState)();
6726
- const [visibleCount, setVisibleCount] = (0, import_react19.useState)(5);
6727
- const [mention, setMention] = (0, import_react19.useState)();
6728
- const [sources, setSources] = (0, import_react19.useState)([]);
6729
- const [sourcesLoading, setSourcesLoading] = (0, import_react19.useState)(false);
6730
- const [sourceError, setSourceError] = (0, import_react19.useState)();
6731
- const [activeSource, setActiveSource] = (0, import_react19.useState)(0);
6732
- const inputRef = (0, import_react19.useRef)(null);
6733
- const listboxId = (0, import_react19.useId)();
7187
+ const [composing, setComposing] = (0, import_react24.useState)(false);
7188
+ const [expandedId, setExpandedId] = (0, import_react24.useState)();
7189
+ const [visibleCount, setVisibleCount] = (0, import_react24.useState)(5);
7190
+ const [mention, setMention] = (0, import_react24.useState)();
7191
+ const [sources, setSources] = (0, import_react24.useState)([]);
7192
+ const [sourcesLoading, setSourcesLoading] = (0, import_react24.useState)(false);
7193
+ const [sourceError, setSourceError] = (0, import_react24.useState)();
7194
+ const [activeSource, setActiveSource] = (0, import_react24.useState)(0);
7195
+ const inputRef = (0, import_react24.useRef)(null);
7196
+ const listboxId = (0, import_react24.useId)();
6734
7197
  const shown = active.slice(0, visibleCount);
6735
7198
  const suggestionsOpen = composing && mention !== void 0;
6736
- (0, import_react19.useEffect)(() => {
7199
+ (0, import_react24.useEffect)(() => {
6737
7200
  if (!suggestionsOpen || mention === void 0) {
6738
7201
  setSources([]);
6739
7202
  setSourcesLoading(false);
@@ -6782,25 +7245,25 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
6782
7245
  inputRef.current?.setSelectionRange(cursor, cursor);
6783
7246
  });
6784
7247
  };
6785
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "dsh-partner-concern-board", "aria-labelledby": "partner-concerns-title", children: [
6786
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
6787
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6788
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { id: "partner-concerns-title", children: [
7248
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { className: "dsh-partner-concern-board", "aria-labelledby": "partner-concerns-title", children: [
7249
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { children: [
7250
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
7251
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("strong", { id: "partner-concerns-title", children: [
6789
7252
  "\u4F19\u4F34\u5728\u610F\u7684\u4E8B ",
6790
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: active.length })
7253
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: active.length })
6791
7254
  ] }),
6792
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: "\u5C1A\u672A\u95ED\u73AF\u3001\u503C\u5F97\u7EE7\u7EED\u7559\u610F\u7684\u4E8B\u60C5" })
7255
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: "\u5C1A\u672A\u95ED\u73AF\u3001\u503C\u5F97\u7EE7\u7EED\u7559\u610F\u7684\u4E8B\u60C5" })
6793
7256
  ] }),
6794
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", "aria-expanded": composing, onClick: () => setComposing((current2) => !current2), children: [
6795
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconPlusOutline16, { size: 14 }),
7257
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", "aria-expanded": composing, onClick: () => setComposing((current2) => !current2), children: [
7258
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconPlusOutline16, { size: 14 }),
6796
7259
  "\u4EA4\u4EE3\u4E00\u4EF6\u4E8B"
6797
7260
  ] })
6798
7261
  ] }),
6799
- composing && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("form", { className: "dsh-partner-concern-compose", onSubmit: submit, children: [
6800
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { children: [
6801
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u9700\u8981\u7559\u610F\u7684\u4E8B" }),
6802
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-concern-input-wrap", children: [
6803
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7262
+ composing && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("form", { className: "dsh-partner-concern-compose", onSubmit: submit, children: [
7263
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { children: [
7264
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: "\u9700\u8981\u7559\u610F\u7684\u4E8B" }),
7265
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-concern-input-wrap", children: [
7266
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6804
7267
  "input",
6805
7268
  {
6806
7269
  ref: inputRef,
@@ -6836,10 +7299,10 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
6836
7299
  }
6837
7300
  }
6838
7301
  ),
6839
- suggestionsOpen && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { id: listboxId, className: "dsh-partner-concern-sources", role: "listbox", "aria-label": "\u53EF\u5F15\u7528\u7684\u6587\u4EF6\u4E0E\u77E5\u8BC6\u6587\u6863", children: sourcesLoading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { role: "status", children: "\u6B63\u5728\u67E5\u627E\u53EF\u5F15\u7528\u5185\u5BB9\u2026" }) : sourceError ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { role: "status", children: [
7302
+ suggestionsOpen && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { id: listboxId, className: "dsh-partner-concern-sources", role: "listbox", "aria-label": "\u53EF\u5F15\u7528\u7684\u6587\u4EF6\u4E0E\u77E5\u8BC6\u6587\u6863", children: sourcesLoading ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { role: "status", children: "\u6B63\u5728\u67E5\u627E\u53EF\u5F15\u7528\u5185\u5BB9\u2026" }) : sourceError ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("p", { role: "status", children: [
6840
7303
  "\u5019\u9009\u52A0\u8F7D\u5931\u8D25\uFF1A",
6841
7304
  sourceError
6842
- ] }) : sources.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { role: "status", children: "\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u6587\u4EF6\u6216\u5DF2\u6302\u8F7D\u77E5\u8BC6\u6587\u6863" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: sources.map((source, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
7305
+ ] }) : sources.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { role: "status", children: "\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u6587\u4EF6\u6216\u5DF2\u6302\u8F7D\u77E5\u8BC6\u6587\u6863" }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, { children: sources.map((source, index) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
6843
7306
  "button",
6844
7307
  {
6845
7308
  type: "button",
@@ -6851,97 +7314,97 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
6851
7314
  onMouseEnter: () => setActiveSource(index),
6852
7315
  onClick: () => chooseSource(source),
6853
7316
  children: [
6854
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: source.kind === "file" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconDataOutline16, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconLinkOutline16, { size: 15 }) }),
6855
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: source.label }),
6856
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: source.detail })
7317
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: source.kind === "file" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconDataOutline16, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconLinkOutline16, { size: 15 }) }),
7318
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: source.label }),
7319
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: source.detail })
6857
7320
  ]
6858
7321
  },
6859
7322
  `${source.kind}:${source.token}`
6860
7323
  )) }) })
6861
7324
  ] }),
6862
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { className: "dsh-partner-concern-compose-hint", children: [
7325
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { className: "dsh-partner-concern-compose-hint", children: [
6863
7326
  "\u8F93\u5165 ",
6864
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: "@" }),
7327
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: "@" }),
6865
7328
  " \u4F1A\u5217\u51FA\u5F53\u524D\u4F1A\u8BDD\u6587\u4EF6\u548C\u5DF2\u6302\u8F7D\u7684\u77E5\u8BC6\u6587\u6863\uFF0C\u4E5F\u53EF\u4EE5\u7EE7\u7EED\u8F93\u5165\u5173\u952E\u8BCD\u7B5B\u9009\u3002"
6866
7329
  ] })
6867
7330
  ] }),
6868
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6869
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => {
7331
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
7332
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: () => {
6870
7333
  setComposing(false);
6871
7334
  setMention(void 0);
6872
7335
  onValue("");
6873
7336
  }, children: "\u53D6\u6D88" }),
6874
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !value.trim(), children: "\u8BA9\u4F19\u4F34\u8BB0\u7740" })
7337
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !value.trim(), children: "\u8BA9\u4F19\u4F34\u8BB0\u7740" })
6875
7338
  ] })
6876
7339
  ] }),
6877
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-concern-list", role: "list", children: active.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "dsh-partner-concern-empty", children: "\u6700\u8FD1\u6CA1\u6709\u672A\u95ED\u73AF\u7684\u4E8B\u3002\u4F60\u4E5F\u53EF\u4EE5\u76F4\u63A5\u5BF9\u4F19\u4F34\u8BF4\u201C\u8FD9\u4E2A\u5E2E\u6211\u7559\u610F\u201D\u3002" }) : shown.map((item) => {
7340
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-concern-list", role: "list", children: active.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "dsh-partner-concern-empty", children: "\u6700\u8FD1\u6CA1\u6709\u672A\u95ED\u73AF\u7684\u4E8B\u3002\u4F60\u4E5F\u53EF\u4EE5\u76F4\u63A5\u5BF9\u4F19\u4F34\u8BF4\u201C\u8FD9\u4E2A\u5E2E\u6211\u7559\u610F\u201D\u3002" }) : shown.map((item) => {
6878
7341
  const observation = latest.get(item.id);
6879
7342
  const expanded = expandedId === item.id;
6880
7343
  const status = observation ? concernObservationStatus(observation) : item.state === "active" ? "\u6B63\u5728\u7559\u610F" : "\u6682\u65F6\u8BB0\u7740";
6881
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { role: "listitem", "data-state": item.state, "data-expanded": expanded, children: [
6882
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dsh-partner-concern-row", "aria-expanded": expanded, onClick: () => setExpandedId((current2) => current2 === item.id ? void 0 : item.id), children: [
6883
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dsh-partner-concern-state", children: [
6884
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
7344
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("article", { role: "listitem", "data-state": item.state, "data-expanded": expanded, children: [
7345
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: "dsh-partner-concern-row", "aria-expanded": expanded, onClick: () => setExpandedId((current2) => current2 === item.id ? void 0 : item.id), children: [
7346
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "dsh-partner-concern-state", children: [
7347
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", {}),
6885
7348
  status
6886
7349
  ] }),
6887
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dsh-partner-concern-copy", children: [
6888
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: item.subject }),
6889
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: observation ? observation.event : item.reason })
7350
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "dsh-partner-concern-copy", children: [
7351
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: item.subject }),
7352
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: observation ? observation.event : item.reason })
6890
7353
  ] }),
6891
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dsh-partner-concern-time", title: `\u8BA1\u5212\u4E8E ${new Date(item.nextCheckAt).toLocaleString()} \u518D\u6B21\u7559\u610F`, children: [
6892
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u4E0B\u6B21\u7559\u610F" }),
6893
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: futureTime(item.nextCheckAt) })
7354
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "dsh-partner-concern-time", title: `\u8BA1\u5212\u4E8E ${new Date(item.nextCheckAt).toLocaleString()} \u518D\u6B21\u7559\u610F`, children: [
7355
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u4E0B\u6B21\u7559\u610F" }),
7356
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: futureTime(item.nextCheckAt) })
6894
7357
  ] }),
6895
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconChevronDownOutline14, { size: 14 })
7358
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconChevronDownOutline14, { size: 14 })
6896
7359
  ] }),
6897
- expanded && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-concern-detail", children: [
6898
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: item.reason }),
6899
- observation && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
6900
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("blockquote", { children: observation.event }),
6901
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-concern-decision", "data-decision": observation.decision, children: [
6902
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: concernObservationStatus(observation) }),
6903
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: observation.decisionReason || concernObservationExplanation(observation) }),
6904
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
7360
+ expanded && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-concern-detail", children: [
7361
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: item.reason }),
7362
+ observation && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
7363
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("blockquote", { children: observation.event }),
7364
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-concern-decision", "data-decision": observation.decision, children: [
7365
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: concernObservationStatus(observation) }),
7366
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: observation.decisionReason || concernObservationExplanation(observation) }),
7367
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
6905
7368
  "\u6253\u6270\u5206\u6570 ",
6906
7369
  Math.round(observation.interruptScore * 100),
6907
7370
  observation.notificationRuleEffect !== "auto" && observation.notificationRuleReason ? ` \xB7 \u77E5\u8BC6\u89C4\u5219\uFF1A${observation.notificationRuleReason}` : ""
6908
7371
  ] })
6909
7372
  ] })
6910
7373
  ] }),
6911
- item.resources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-concern-resources", children: item.resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
7374
+ item.resources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-concern-resources", children: item.resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
6912
7375
  resource.kind === "file" ? "\u6587\u4EF6" : "\u77E5\u8BC6",
6913
7376
  " \xB7 ",
6914
7377
  resource.label
6915
7378
  ] }, `${resource.kind}:${resource.locator}`)) }),
6916
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
7379
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
6917
7380
  item.origin === "explicit" ? "\u4F60\u660E\u786E\u4EA4\u4EE3" : "\u4F19\u4F34\u4ECE\u5BF9\u8BDD\u4E2D\u6CE8\u610F\u5230",
6918
7381
  " \xB7 ",
6919
7382
  watchKindLabel(item.watchKind)
6920
7383
  ] }),
6921
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-concern-actions", "aria-label": `${item.subject} \u7684\u64CD\u4F5C`, children: [
6922
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy, onClick: () => onCheck(item), children: "\u7ACB\u5373\u68C0\u67E5\u8FD9\u6761" }),
6923
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u7EE7\u7EED\u7559\u610F" }),
6924
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "prioritize"), children: "\u63D0\u9AD8\u5173\u6CE8" }),
6925
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "resolve"), children: "\u5DF2\u7ECF\u89E3\u51B3" }),
6926
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: () => onAct(item, "ignore"), children: "\u522B\u7BA1\u8FD9\u4E2A" })
7384
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-concern-actions", "aria-label": `${item.subject} \u7684\u64CD\u4F5C`, children: [
7385
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", disabled: busy, onClick: () => onCheck(item), children: "\u7ACB\u5373\u68C0\u67E5\u8FD9\u6761" }),
7386
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u7EE7\u7EED\u7559\u610F" }),
7387
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "prioritize"), children: "\u63D0\u9AD8\u5173\u6CE8" }),
7388
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "resolve"), children: "\u5DF2\u7ECF\u89E3\u51B3" }),
7389
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: () => onAct(item, "ignore"), children: "\u522B\u7BA1\u8FD9\u4E2A" })
6927
7390
  ] })
6928
7391
  ] })
6929
7392
  ] }, item.id);
6930
7393
  }) }),
6931
- (active.length > shown.length || visibleCount > 5) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-concern-more", children: active.length > shown.length ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", onClick: () => setVisibleCount((count) => Math.min(active.length, count + 20)), children: [
7394
+ (active.length > shown.length || visibleCount > 5) && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-concern-more", children: active.length > shown.length ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", onClick: () => setVisibleCount((count) => Math.min(active.length, count + 20)), children: [
6932
7395
  "\u518D\u663E\u793A ",
6933
7396
  Math.min(20, active.length - shown.length),
6934
7397
  " \u6761"
6935
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => setVisibleCount(5), children: "\u6536\u8D77\u5217\u8868" }) }),
6936
- resolved.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("details", { className: "dsh-partner-concern-resolved", children: [
6937
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("summary", { children: [
7398
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: () => setVisibleCount(5), children: "\u6536\u8D77\u5217\u8868" }) }),
7399
+ resolved.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("details", { className: "dsh-partner-concern-resolved", children: [
7400
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("summary", { children: [
6938
7401
  "\u5DF2\u7ECF\u89E3\u51B3 ",
6939
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: resolved.length })
7402
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: resolved.length })
6940
7403
  ] }),
6941
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: resolved.slice(0, 30).map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { children: [
6942
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconCheckOutline14, { size: 13 }) }),
6943
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: item.subject }),
6944
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u91CD\u65B0\u7559\u610F" })
7404
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { children: resolved.slice(0, 30).map((item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("article", { children: [
7405
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconCheckOutline14, { size: 13 }) }),
7406
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: item.subject }),
7407
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u91CD\u65B0\u7559\u610F" })
6945
7408
  ] }, item.id)) })
6946
7409
  ] })
6947
7410
  ] });
@@ -6967,23 +7430,23 @@ function watchKindLabel(value) {
6967
7430
  }
6968
7431
  var MEMORY_KINDS = ["all", "preference", "task", "event", "relationship", "emotion"];
6969
7432
  function MemoryLibrary({ companionId, revision, profiles, memories, reflections, editing, busy, setEditing, save, remove }) {
6970
- const activeMemories = (0, import_react19.useMemo)(() => memories.filter((item) => item.status === "active" && item.kind !== "profile"), [memories]);
6971
- const profileMemories = (0, import_react19.useMemo)(() => memories.filter((item) => item.status === "active" && item.kind === "profile"), [memories]);
6972
- const [mode, setMode] = (0, import_react19.useState)("profile");
6973
- const [kind, setKind] = (0, import_react19.useState)("all");
6974
- const [query, setQuery] = (0, import_react19.useState)("");
6975
- const [selectedMemoryId, setSelectedMemoryId] = (0, import_react19.useState)();
6976
- const [selectedDate, setSelectedDate] = (0, import_react19.useState)();
6977
- const [graph, setGraph] = (0, import_react19.useState)();
6978
- const [graphLoading, setGraphLoading] = (0, import_react19.useState)(false);
6979
- const [graphError, setGraphError] = (0, import_react19.useState)();
6980
- const [graphRequest, setGraphRequest] = (0, import_react19.useState)(0);
6981
- (0, import_react19.useEffect)(() => {
7433
+ const activeMemories = (0, import_react24.useMemo)(() => memories.filter((item) => item.status === "active" && item.kind !== "profile"), [memories]);
7434
+ const profileMemories = (0, import_react24.useMemo)(() => memories.filter((item) => item.status === "active" && item.kind === "profile"), [memories]);
7435
+ const [mode, setMode] = (0, import_react24.useState)("profile");
7436
+ const [kind, setKind] = (0, import_react24.useState)("all");
7437
+ const [query, setQuery] = (0, import_react24.useState)("");
7438
+ const [selectedMemoryId, setSelectedMemoryId] = (0, import_react24.useState)();
7439
+ const [selectedDate, setSelectedDate] = (0, import_react24.useState)();
7440
+ const [graph, setGraph] = (0, import_react24.useState)();
7441
+ const [graphLoading, setGraphLoading] = (0, import_react24.useState)(false);
7442
+ const [graphError, setGraphError] = (0, import_react24.useState)();
7443
+ const [graphRequest, setGraphRequest] = (0, import_react24.useState)(0);
7444
+ (0, import_react24.useEffect)(() => {
6982
7445
  setGraph(void 0);
6983
7446
  setGraphError(void 0);
6984
7447
  setGraphLoading(false);
6985
7448
  }, [companionId, revision]);
6986
- (0, import_react19.useEffect)(() => {
7449
+ (0, import_react24.useEffect)(() => {
6987
7450
  if (mode !== "graph" || graph !== void 0) return;
6988
7451
  const controller = new AbortController();
6989
7452
  setGraphLoading(true);
@@ -6998,75 +7461,75 @@ function MemoryLibrary({ companionId, revision, profiles, memories, reflections,
6998
7461
  return () => controller.abort();
6999
7462
  }, [companionId, graph, graphRequest, mode, revision]);
7000
7463
  const normalized = query.trim().toLocaleLowerCase();
7001
- const filteredMemories = (0, import_react19.useMemo)(() => activeMemories.filter(
7464
+ const filteredMemories = (0, import_react24.useMemo)(() => activeMemories.filter(
7002
7465
  (item) => (kind === "all" || item.kind === kind) && (!normalized || `${item.subject} ${item.content}`.toLocaleLowerCase().includes(normalized))
7003
7466
  ), [activeMemories, kind, normalized]);
7004
- const filteredReflections = (0, import_react19.useMemo)(() => reflections.filter(
7467
+ const filteredReflections = (0, import_react24.useMemo)(() => reflections.filter(
7005
7468
  (item) => !normalized || `${item.date} ${item.summary} ${item.events.join(" ")} ${item.openTasks.join(" ")} ${item.learnings.join(" ")}`.toLocaleLowerCase().includes(normalized)
7006
7469
  ), [reflections, normalized]);
7007
7470
  const selectedMemory = filteredMemories.find((item) => item.id === selectedMemoryId) ?? filteredMemories[0];
7008
7471
  const selectedReflection = filteredReflections.find((item) => item.date === selectedDate) ?? filteredReflections[0];
7009
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "dsh-partner-memory-library", children: [
7010
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { className: "dsh-partner-library-header", children: [
7011
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
7012
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "MEMORY LIBRARY" }),
7013
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u4F19\u4F34\u8BB0\u5FC6\u5E93" }),
7014
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: "\u67E5\u770B\u4F19\u4F34\u5982\u4F55\u4ECE\u957F\u671F\u5BF9\u8BDD\u4E2D\u8BA4\u8BC6\u4F60\uFF0C\u4EE5\u53CA\u8FD9\u4E9B\u7406\u89E3\u600E\u6837\u968F\u8BC1\u636E\u53D8\u5316\u3002" })
7472
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { className: "dsh-partner-memory-library", children: [
7473
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { className: "dsh-partner-library-header", children: [
7474
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
7475
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "MEMORY LIBRARY" }),
7476
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: "\u4F19\u4F34\u8BB0\u5FC6\u5E93" }),
7477
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: "\u67E5\u770B\u4F19\u4F34\u5982\u4F55\u4ECE\u957F\u671F\u5BF9\u8BDD\u4E2D\u8BA4\u8BC6\u4F60\uFF0C\u4EE5\u53CA\u8FD9\u4E9B\u7406\u89E3\u600E\u6837\u968F\u8BC1\u636E\u53D8\u5316\u3002" })
7015
7478
  ] }),
7016
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("nav", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", children: [
7017
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: mode === "profile" ? "is-active" : "", onClick: () => setMode("profile"), children: [
7479
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("nav", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", children: [
7480
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: mode === "profile" ? "is-active" : "", onClick: () => setMode("profile"), children: [
7018
7481
  "\u4EBA\u7269\u753B\u50CF ",
7019
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: profiles.length })
7482
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: profiles.length })
7020
7483
  ] }),
7021
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: mode === "memory" ? "is-active" : "", onClick: () => setMode("memory"), children: [
7484
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: mode === "memory" ? "is-active" : "", onClick: () => setMode("memory"), children: [
7022
7485
  "\u8BDD\u9898\u8BB0\u5FC6 ",
7023
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: activeMemories.length })
7486
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: activeMemories.length })
7024
7487
  ] }),
7025
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: mode === "reflection" ? "is-active" : "", onClick: () => setMode("reflection"), children: [
7488
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: mode === "reflection" ? "is-active" : "", onClick: () => setMode("reflection"), children: [
7026
7489
  "\u6BCF\u65E5\u56DE\u987E ",
7027
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: reflections.length })
7490
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: reflections.length })
7028
7491
  ] }),
7029
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: mode === "graph" ? "is-active" : "", onClick: () => setMode("graph"), children: [
7492
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: mode === "graph" ? "is-active" : "", onClick: () => setMode("graph"), children: [
7030
7493
  "\u5173\u7CFB\u56FE\u8C31 ",
7031
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: graph?.relations.length ?? "\u2014" })
7494
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: graph?.relations.length ?? "\u2014" })
7032
7495
  ] })
7033
7496
  ] })
7034
7497
  ] }),
7035
- mode !== "profile" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-library-tools", children: [
7036
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { children: [
7037
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u8BB0\u5FC6" }),
7038
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: mode === "memory" ? "\u641C\u7D22\u4E3B\u9898\u6216\u8BB0\u5FC6\u5185\u5BB9" : "\u641C\u7D22\u65E5\u671F\u3001\u603B\u7ED3\u6216\u5F85\u529E" })
7498
+ mode !== "profile" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-library-tools", children: [
7499
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { children: [
7500
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u8BB0\u5FC6" }),
7501
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: mode === "memory" ? "\u641C\u7D22\u4E3B\u9898\u6216\u8BB0\u5FC6\u5185\u5BB9" : "\u641C\u7D22\u65E5\u671F\u3001\u603B\u7ED3\u6216\u5F85\u529E" })
7039
7502
  ] }),
7040
- mode === "memory" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-memory-kinds", children: MEMORY_KINDS.map((value) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: kind === value ? "is-active" : "", onClick: () => setKind(value), children: value === "all" ? "\u5168\u90E8" : memoryKind(value) }, value)) })
7503
+ mode === "memory" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-memory-kinds", children: MEMORY_KINDS.map((value) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: kind === value ? "is-active" : "", onClick: () => setKind(value), children: value === "all" ? "\u5168\u90E8" : memoryKind(value) }, value)) })
7041
7504
  ] }),
7042
- mode === "profile" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ProfileLibrary, { profiles, memories: profileMemories, editing, busy, setEditing, save, remove }) : mode === "memory" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-library-browser", children: [
7043
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-library-list", role: "list", children: filteredMemories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: activeMemories.length === 0 ? "\u8FD8\u6CA1\u6709\u957F\u671F\u8BB0\u5FC6" : "\u6CA1\u6709\u5339\u914D\u7684\u8BB0\u5FC6", detail: activeMemories.length === 0 ? "\u4F19\u4F34\u5B8C\u6210\u5BF9\u8BDD\u540E\u4F1A\u81EA\u52A8\u63D0\u70BC\u503C\u5F97\u957F\u671F\u4FDD\u7559\u7684\u4FE1\u606F\u3002" : "\u6362\u4E2A\u5173\u952E\u8BCD\u6216\u7C7B\u578B\u8BD5\u8BD5\u3002", compact: true }) : filteredMemories.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", role: "listitem", className: selectedMemory?.id === item.id ? "is-active" : "", onClick: () => {
7505
+ mode === "profile" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ProfileLibrary, { profiles, memories: profileMemories, editing, busy, setEditing, save, remove }) : mode === "memory" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-library-browser", children: [
7506
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-library-list", role: "list", children: filteredMemories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ContentState, { title: activeMemories.length === 0 ? "\u8FD8\u6CA1\u6709\u957F\u671F\u8BB0\u5FC6" : "\u6CA1\u6709\u5339\u914D\u7684\u8BB0\u5FC6", detail: activeMemories.length === 0 ? "\u4F19\u4F34\u5B8C\u6210\u5BF9\u8BDD\u540E\u4F1A\u81EA\u52A8\u63D0\u70BC\u503C\u5F97\u957F\u671F\u4FDD\u7559\u7684\u4FE1\u606F\u3002" : "\u6362\u4E2A\u5173\u952E\u8BCD\u6216\u7C7B\u578B\u8BD5\u8BD5\u3002", compact: true }) : filteredMemories.map((item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "listitem", className: selectedMemory?.id === item.id ? "is-active" : "", onClick: () => {
7044
7507
  setSelectedMemoryId(item.id);
7045
7508
  setEditing(void 0);
7046
7509
  }, children: [
7047
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "data-kind": item.kind, children: memoryKind(item.kind) }),
7048
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: item.subject }),
7049
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: item.content }),
7050
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: relativeTime(item.updatedAt) })
7510
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { "data-kind": item.kind, children: memoryKind(item.kind) }),
7511
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: item.subject }),
7512
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: item.content }),
7513
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: relativeTime(item.updatedAt) })
7051
7514
  ] }, item.id)) }),
7052
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-library-detail", children: selectedMemory ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MemoryCard, { item: selectedMemory, editing: editing?.id === selectedMemory.id ? editing : void 0, busy, setEditing, save, remove: () => remove(selectedMemory) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u6761\u8BB0\u5FC6", detail: "\u8BB0\u5FC6\u8BE6\u60C5\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
7053
- ] }) : mode === "reflection" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-library-browser", children: [
7054
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-library-list is-diary", role: "list", children: filteredReflections.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: reflections.length === 0 ? "\u8FD8\u6CA1\u6709\u6BCF\u65E5\u56DE\u987E" : "\u6CA1\u6709\u5339\u914D\u7684\u56DE\u987E", detail: reflections.length === 0 ? "\u6BCF\u65E5\u56DE\u987E\u4F1A\u5728\u6BCF\u8F6E\u5B8C\u6574\u5BF9\u8BDD\u540E\u6301\u7EED\u66F4\u65B0\u3002" : "\u6362\u4E2A\u5173\u952E\u8BCD\u6216\u65E5\u671F\u8BD5\u8BD5\u3002", compact: true }) : filteredReflections.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", role: "listitem", className: selectedReflection?.date === entry.date ? "is-active" : "", onClick: () => setSelectedDate(entry.date), children: [
7055
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("time", { children: entry.date }),
7056
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7515
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-library-detail", children: selectedMemory ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(MemoryCard, { item: selectedMemory, editing: editing?.id === selectedMemory.id ? editing : void 0, busy, setEditing, save, remove: () => remove(selectedMemory) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u6761\u8BB0\u5FC6", detail: "\u8BB0\u5FC6\u8BE6\u60C5\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
7516
+ ] }) : mode === "reflection" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-library-browser", children: [
7517
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-library-list is-diary", role: "list", children: filteredReflections.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ContentState, { title: reflections.length === 0 ? "\u8FD8\u6CA1\u6709\u6BCF\u65E5\u56DE\u987E" : "\u6CA1\u6709\u5339\u914D\u7684\u56DE\u987E", detail: reflections.length === 0 ? "\u6BCF\u65E5\u56DE\u987E\u4F1A\u5728\u6BCF\u8F6E\u5B8C\u6574\u5BF9\u8BDD\u540E\u6301\u7EED\u66F4\u65B0\u3002" : "\u6362\u4E2A\u5173\u952E\u8BCD\u6216\u65E5\u671F\u8BD5\u8BD5\u3002", compact: true }) : filteredReflections.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "listitem", className: selectedReflection?.date === entry.date ? "is-active" : "", onClick: () => setSelectedDate(entry.date), children: [
7518
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("time", { children: entry.date }),
7519
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("strong", { children: [
7057
7520
  entry.turnCount,
7058
7521
  " \u8F6E\u4EA4\u6D41"
7059
7522
  ] }),
7060
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: entry.summary }),
7061
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
7523
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: entry.summary }),
7524
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
7062
7525
  entry.openTasks.length,
7063
7526
  " \u9879\u5F85\u8DDF\u8FDB \xB7 ",
7064
7527
  entry.learnings.length,
7065
7528
  " \u9879\u7406\u89E3"
7066
7529
  ] })
7067
7530
  ] }, entry.date)) }),
7068
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-library-detail", children: selectedReflection ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DailyReflectionDetail, { entry: selectedReflection }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u5929", detail: "\u5F53\u5929\u7684\u603B\u7ED3\u4E0E\u5F85\u529E\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
7069
- ] }) : graphError ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u5173\u7CFB\u56FE\u8C31\u52A0\u8F7D\u5931\u8D25", detail: graphError, action: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => setGraphRequest((value) => value + 1), children: "\u91CD\u65B0\u52A0\u8F7D" }) }) : graphLoading || graph === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u6B63\u5728\u52A0\u8F7D\u5173\u7CFB\u56FE\u8C31", detail: "\u53EA\u5728\u9700\u8981\u67E5\u770B\u5173\u7CFB\u65F6\u8BFB\u53D6\u5BA1\u8BA1\u6570\u636E\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MemoryGraph, { graph, profiles, query: normalized, inspect: (item) => {
7531
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-library-detail", children: selectedReflection ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DailyReflectionDetail, { entry: selectedReflection }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u5929", detail: "\u5F53\u5929\u7684\u603B\u7ED3\u4E0E\u5F85\u529E\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
7532
+ ] }) : graphError ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ContentState, { title: "\u5173\u7CFB\u56FE\u8C31\u52A0\u8F7D\u5931\u8D25", detail: graphError, action: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: () => setGraphRequest((value) => value + 1), children: "\u91CD\u65B0\u52A0\u8F7D" }) }) : graphLoading || graph === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ContentState, { title: "\u6B63\u5728\u52A0\u8F7D\u5173\u7CFB\u56FE\u8C31", detail: "\u53EA\u5728\u9700\u8981\u67E5\u770B\u5173\u7CFB\u65F6\u8BFB\u53D6\u5BA1\u8BA1\u6570\u636E\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(MemoryGraph, { graph, profiles, query: normalized, inspect: (item) => {
7070
7533
  setEditing(void 0);
7071
7534
  if (item.kind === "profile") setMode("profile");
7072
7535
  else {
@@ -7077,71 +7540,71 @@ function MemoryLibrary({ companionId, revision, profiles, memories, reflections,
7077
7540
  ] });
7078
7541
  }
7079
7542
  function ProfileLibrary({ profiles, memories, editing, busy, setEditing, save, remove }) {
7080
- const [selectedScopeId, setSelectedScopeId] = (0, import_react19.useState)();
7543
+ const [selectedScopeId, setSelectedScopeId] = (0, import_react24.useState)();
7081
7544
  const selected = profiles.find((item) => item.scopeId === selectedScopeId) ?? profiles[0];
7082
- if (!selected) return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u8054\u7CFB\u4EBA\u753B\u50CF", detail: "\u8054\u7CFB\u4EBA\u5F00\u59CB\u548C\u4F19\u4F34\u4EA4\u6D41\u540E\uFF0C\u8FD9\u91CC\u4F1A\u9010\u6B65\u5C55\u793A\u4F19\u4F34\u4ECE\u660E\u786E\u5BF9\u8BDD\u4E2D\u5F62\u6210\u7684\u957F\u671F\u7406\u89E3\u3002" });
7545
+ if (!selected) return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u8054\u7CFB\u4EBA\u753B\u50CF", detail: "\u8054\u7CFB\u4EBA\u5F00\u59CB\u548C\u4F19\u4F34\u4EA4\u6D41\u540E\uFF0C\u8FD9\u91CC\u4F1A\u9010\u6B65\u5C55\u793A\u4F19\u4F34\u4ECE\u660E\u786E\u5BF9\u8BDD\u4E2D\u5F62\u6210\u7684\u957F\u671F\u7406\u89E3\u3002" });
7083
7546
  const activeIds = new Set(selected.entries.map((item) => item.id));
7084
7547
  const pending = memories.filter((item) => item.scopeId === selected.scopeId && !activeIds.has(item.id));
7085
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-profile-browser", children: [
7086
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-profile-people", role: "list", "aria-label": "\u8054\u7CFB\u4EBA\u753B\u50CF", children: profiles.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", role: "listitem", className: profile.scopeId === selected.scopeId ? "is-active" : "", onClick: () => {
7548
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-profile-browser", children: [
7549
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-profile-people", role: "list", "aria-label": "\u8054\u7CFB\u4EBA\u753B\u50CF", children: profiles.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "listitem", className: profile.scopeId === selected.scopeId ? "is-active" : "", onClick: () => {
7087
7550
  setSelectedScopeId(profile.scopeId);
7088
7551
  setEditing(void 0);
7089
7552
  }, children: [
7090
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconUserOutline16, { size: 16 }) }),
7091
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
7092
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: profile.label }),
7093
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: profile.entries.length > 0 ? `${profile.entries.length} \u9879\u7A33\u5B9A\u7406\u89E3` : "\u8FD8\u5728\u8BA4\u8BC6\u4E2D" })
7553
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconUserOutline16, { size: 16 }) }),
7554
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
7555
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: profile.label }),
7556
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: profile.entries.length > 0 ? `${profile.entries.length} \u9879\u7A33\u5B9A\u7406\u89E3` : "\u8FD8\u5728\u8BA4\u8BC6\u4E2D" })
7094
7557
  ] }),
7095
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", { "aria-hidden": "true" })
7558
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", { "aria-hidden": "true" })
7096
7559
  ] }, profile.scopeId)) }),
7097
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-profile-stage", children: [
7098
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { className: "dsh-partner-profile-heading", children: [
7099
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
7100
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "PARTNER UNDERSTANDING" }),
7101
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7560
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-profile-stage", children: [
7561
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { className: "dsh-partner-profile-heading", children: [
7562
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
7563
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "PARTNER UNDERSTANDING" }),
7564
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("strong", { children: [
7102
7565
  "\u4F19\u4F34\u773C\u4E2D\u7684 ",
7103
7566
  selected.label
7104
7567
  ] }),
7105
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: "\u8FD9\u4E9B\u5185\u5BB9\u6765\u81EA\u4F60\u5728\u5BF9\u8BDD\u4E2D\u7684\u660E\u786E\u8868\u8FBE\u3002\u4F19\u4F34\u4F1A\u7528\u5B83\u4FDD\u6301\u7406\u89E3\u8FDE\u7EED\uFF0C\u4F46\u4E0D\u4F1A\u628A\u753B\u50CF\u5F53\u6210\u6807\u7B7E\u53CD\u590D\u590D\u8FF0\u3002" })
7568
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: "\u8FD9\u4E9B\u5185\u5BB9\u6765\u81EA\u4F60\u5728\u5BF9\u8BDD\u4E2D\u7684\u660E\u786E\u8868\u8FBE\u3002\u4F19\u4F34\u4F1A\u7528\u5B83\u4FDD\u6301\u7406\u89E3\u8FDE\u7EED\uFF0C\u4F46\u4E0D\u4F1A\u628A\u753B\u50CF\u5F53\u6210\u6807\u7B7E\u53CD\u590D\u590D\u8FF0\u3002" })
7106
7569
  ] }),
7107
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { "data-ready": selected.entries.length > 0, children: [
7108
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
7570
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { "data-ready": selected.entries.length > 0, children: [
7571
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", {}),
7109
7572
  selected.entries.length > 0 ? "\u4E0A\u4E0B\u6587\u57FA\u7EBF\u5DF2\u5C31\u7EEA" : "\u7B49\u5F85\u53EF\u9760\u8BC1\u636E"
7110
7573
  ] })
7111
7574
  ] }),
7112
- selected.entries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
7113
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-profile-meta", children: [
7114
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
7115
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u753B\u50CF\u7248\u672C" }),
7116
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: selected.version })
7575
+ selected.entries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
7576
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-profile-meta", children: [
7577
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
7578
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u753B\u50CF\u7248\u672C" }),
7579
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: selected.version })
7117
7580
  ] }),
7118
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
7119
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u5BF9\u8BDD\u4F9D\u636E" }),
7120
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7581
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
7582
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u5BF9\u8BDD\u4F9D\u636E" }),
7583
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("strong", { children: [
7121
7584
  selected.evidenceCount,
7122
7585
  " \u5904"
7123
7586
  ] })
7124
7587
  ] }),
7125
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
7126
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u7528\u6237\u786E\u8BA4" }),
7127
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7588
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
7589
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u7528\u6237\u786E\u8BA4" }),
7590
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("strong", { children: [
7128
7591
  selected.lockedCount,
7129
7592
  " \u9879"
7130
7593
  ] })
7131
7594
  ] }),
7132
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
7133
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u6700\u8FD1\u4F9D\u636E" }),
7134
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: selected.updatedAt ? relativeTime(selected.updatedAt) : "\u5C1A\u672A" })
7595
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
7596
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u6700\u8FD1\u4F9D\u636E" }),
7597
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: selected.updatedAt ? relativeTime(selected.updatedAt) : "\u5C1A\u672A" })
7135
7598
  ] })
7136
7599
  ] }),
7137
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-profile-entries", children: selected.entries.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MemoryCard, { item, editing: editing?.id === item.id ? editing : void 0, busy, setEditing, save, remove: () => remove(item) }, item.id)) })
7138
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u4F19\u4F34\u8FD8\u5728\u8BA4\u8BC6\u4F60", detail: "\u53EA\u6709\u660E\u786E\u3001\u7A33\u5B9A\u5E76\u8FBE\u5230\u53EF\u9760\u6807\u51C6\u7684\u957F\u671F\u4FE1\u606F\u624D\u4F1A\u8FDB\u5165\u753B\u50CF\uFF1B\u666E\u901A\u504F\u597D\u3001\u4E34\u65F6\u4EFB\u52A1\u548C\u4E00\u6B21\u6027\u60C5\u7EEA\u4E0D\u4F1A\u653E\u5728\u8FD9\u91CC\u3002", compact: true }),
7139
- pending.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("details", { className: "dsh-partner-profile-pending", children: [
7140
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("summary", { children: [
7600
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-profile-entries", children: selected.entries.map((item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(MemoryCard, { item, editing: editing?.id === item.id ? editing : void 0, busy, setEditing, save, remove: () => remove(item) }, item.id)) })
7601
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ContentState, { title: "\u4F19\u4F34\u8FD8\u5728\u8BA4\u8BC6\u4F60", detail: "\u53EA\u6709\u660E\u786E\u3001\u7A33\u5B9A\u5E76\u8FBE\u5230\u53EF\u9760\u6807\u51C6\u7684\u957F\u671F\u4FE1\u606F\u624D\u4F1A\u8FDB\u5165\u753B\u50CF\uFF1B\u666E\u901A\u504F\u597D\u3001\u4E34\u65F6\u4EFB\u52A1\u548C\u4E00\u6B21\u6027\u60C5\u7EEA\u4E0D\u4F1A\u653E\u5728\u8FD9\u91CC\u3002", compact: true }),
7602
+ pending.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("details", { className: "dsh-partner-profile-pending", children: [
7603
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("summary", { children: [
7141
7604
  "\u5F85\u786E\u8BA4\u7684\u7406\u89E3 ",
7142
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: pending.length })
7605
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: pending.length })
7143
7606
  ] }),
7144
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: pending.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MemoryCard, { item, editing: editing?.id === item.id ? editing : void 0, busy, setEditing, save, remove: () => remove(item) }, item.id)) })
7607
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { children: pending.map((item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(MemoryCard, { item, editing: editing?.id === item.id ? editing : void 0, busy, setEditing, save, remove: () => remove(item) }, item.id)) })
7145
7608
  ] })
7146
7609
  ] })
7147
7610
  ] });
@@ -7150,9 +7613,9 @@ var RELATION_FILTERS = ["all", "conflicts_with", "depends_on", "supports", "foll
7150
7613
  function MemoryGraph({ graph, profiles, query, inspect }) {
7151
7614
  const byId = new Map(graph.memories.map((item) => [item.id, item]));
7152
7615
  const scopeIds = [...new Set(graph.relations.map((item) => item.scopeId))];
7153
- const [requestedScopeId, setRequestedScopeId] = (0, import_react19.useState)();
7616
+ const [requestedScopeId, setRequestedScopeId] = (0, import_react24.useState)();
7154
7617
  const scopeId = scopeIds.includes(requestedScopeId ?? "") ? requestedScopeId : scopeIds[0];
7155
- const [filter, setFilter] = (0, import_react19.useState)("all");
7618
+ const [filter, setFilter] = (0, import_react24.useState)("all");
7156
7619
  const scoped = graph.relations.filter((item) => item.scopeId === scopeId);
7157
7620
  const visible = scoped.filter((item) => {
7158
7621
  if (filter !== "all" && item.kind !== filter) return false;
@@ -7160,115 +7623,115 @@ function MemoryGraph({ graph, profiles, query, inspect }) {
7160
7623
  const target2 = byId.get(item.targetMemoryId);
7161
7624
  return !query || `${source2?.subject ?? ""} ${source2?.content ?? ""} ${target2?.subject ?? ""} ${target2?.content ?? ""} ${item.label}`.toLocaleLowerCase().includes(query);
7162
7625
  }).sort((left, right) => Number(right.kind === "conflicts_with") - Number(left.kind === "conflicts_with") || right.confidence - left.confidence);
7163
- const [selectedRelationId, setSelectedRelationId] = (0, import_react19.useState)();
7626
+ const [selectedRelationId, setSelectedRelationId] = (0, import_react24.useState)();
7164
7627
  const selected = visible.find((item) => item.id === selectedRelationId) ?? visible[0];
7165
7628
  const source = selected ? byId.get(selected.sourceMemoryId) : void 0;
7166
7629
  const target = selected ? byId.get(selected.targetMemoryId) : void 0;
7167
7630
  const label = profiles.find((item) => item.scopeId === scopeId)?.label ?? (scopeId ? `\u8054\u7CFB\u4EBA ${scopeId.slice(-6)}` : "\u5F53\u524D\u8054\u7CFB\u4EBA");
7168
7631
  const conflictCount = scoped.filter((item) => item.kind === "conflicts_with").length;
7169
- if (graph.relations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u53EF\u9760\u5173\u7CFB", detail: "\u6BCF\u65E5\u7EC8\u5BA1\u53EA\u4F1A\u4FDD\u5B58\u6709\u660E\u786E\u8BC1\u636E\u7684\u8BB0\u5FC6\u8054\u7CFB\uFF0C\u4E0D\u4F1A\u4E3A\u4E86\u586B\u6EE1\u56FE\u8C31\u800C\u731C\u6D4B\u3002" });
7170
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-graph-audit", children: [
7171
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { className: "dsh-partner-graph-toolbar", children: [
7172
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
7173
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u5173\u7CFB\u5BA1\u8BA1" }),
7174
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7632
+ if (graph.relations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u53EF\u9760\u5173\u7CFB", detail: "\u6BCF\u65E5\u7EC8\u5BA1\u53EA\u4F1A\u4FDD\u5B58\u6709\u660E\u786E\u8BC1\u636E\u7684\u8BB0\u5FC6\u8054\u7CFB\uFF0C\u4E0D\u4F1A\u4E3A\u4E86\u586B\u6EE1\u56FE\u8C31\u800C\u731C\u6D4B\u3002" });
7633
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-graph-audit", children: [
7634
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { className: "dsh-partner-graph-toolbar", children: [
7635
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
7636
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: "\u5173\u7CFB\u5BA1\u8BA1" }),
7637
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("strong", { children: [
7175
7638
  label,
7176
7639
  " \u7684\u7406\u89E3\u5173\u7CFB"
7177
7640
  ] }),
7178
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { children: [
7641
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("p", { children: [
7179
7642
  scoped.length,
7180
7643
  " \u6761\u53EF\u9760\u8054\u7CFB",
7181
7644
  conflictCount > 0 ? `\uFF0C\u5176\u4E2D ${conflictCount} \u6761\u9700\u8981\u786E\u8BA4` : "\uFF0C\u6682\u65E0\u5F85\u786E\u8BA4\u51B2\u7A81"
7182
7645
  ] })
7183
7646
  ] }),
7184
- scopeIds.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { children: [
7185
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u8054\u7CFB\u4EBA" }),
7186
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("select", { value: scopeId, onChange: (event) => {
7647
+ scopeIds.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { children: [
7648
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: "\u8054\u7CFB\u4EBA" }),
7649
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("select", { value: scopeId, onChange: (event) => {
7187
7650
  setRequestedScopeId(event.target.value);
7188
7651
  setSelectedRelationId(void 0);
7189
- }, children: scopeIds.map((value) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value, children: profiles.find((item) => item.scopeId === value)?.label ?? `\u8054\u7CFB\u4EBA ${value.slice(-6)}` }, value)) })
7652
+ }, children: scopeIds.map((value) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("option", { value, children: profiles.find((item) => item.scopeId === value)?.label ?? `\u8054\u7CFB\u4EBA ${value.slice(-6)}` }, value)) })
7190
7653
  ] })
7191
7654
  ] }),
7192
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("nav", { className: "dsh-partner-graph-filters", "aria-label": "\u5173\u7CFB\u7C7B\u578B", children: RELATION_FILTERS.map((value) => {
7655
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("nav", { className: "dsh-partner-graph-filters", "aria-label": "\u5173\u7CFB\u7C7B\u578B", children: RELATION_FILTERS.map((value) => {
7193
7656
  const count = value === "all" ? scoped.length : scoped.filter((item) => item.kind === value).length;
7194
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: filter === value ? "is-active" : "", "aria-pressed": filter === value, onClick: () => {
7657
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: filter === value ? "is-active" : "", "aria-pressed": filter === value, onClick: () => {
7195
7658
  setFilter(value);
7196
7659
  setSelectedRelationId(void 0);
7197
7660
  }, children: [
7198
7661
  value === "all" ? "\u5168\u90E8" : relationLabel(value),
7199
7662
  " ",
7200
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: count })
7663
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: count })
7201
7664
  ] }, value);
7202
7665
  }) }),
7203
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-graph-browser", children: [
7204
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-graph-index", role: "list", children: visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u6CA1\u6709\u5339\u914D\u7684\u5173\u7CFB", detail: "\u8C03\u6574\u5173\u7CFB\u7C7B\u578B\u6216\u641C\u7D22\u5173\u952E\u8BCD\u540E\u518D\u8BD5\u3002", compact: true }) : visible.map((item) => {
7666
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-graph-browser", children: [
7667
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-graph-index", role: "list", children: visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ContentState, { title: "\u6CA1\u6709\u5339\u914D\u7684\u5173\u7CFB", detail: "\u8C03\u6574\u5173\u7CFB\u7C7B\u578B\u6216\u641C\u7D22\u5173\u952E\u8BCD\u540E\u518D\u8BD5\u3002", compact: true }) : visible.map((item) => {
7205
7668
  const from = byId.get(item.sourceMemoryId);
7206
7669
  const to = byId.get(item.targetMemoryId);
7207
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", role: "listitem", "data-kind": item.kind, className: selected?.id === item.id ? "is-active" : "", onClick: () => setSelectedRelationId(item.id), children: [
7208
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: relationLabel(item.kind) }),
7209
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7670
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "listitem", "data-kind": item.kind, className: selected?.id === item.id ? "is-active" : "", onClick: () => setSelectedRelationId(item.id), children: [
7671
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: relationLabel(item.kind) }),
7672
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("strong", { children: [
7210
7673
  from?.subject ?? "\u5DF2\u5220\u9664\u8BB0\u5FC6",
7211
7674
  " ",
7212
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
7675
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
7213
7676
  " ",
7214
7677
  to?.subject ?? "\u5DF2\u5220\u9664\u8BB0\u5FC6"
7215
7678
  ] }),
7216
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: item.label }),
7217
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
7679
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: item.label }),
7680
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
7218
7681
  Math.round(item.confidence * 100),
7219
7682
  "% \u53EF\u4FE1"
7220
7683
  ] })
7221
7684
  ] }, item.id);
7222
7685
  }) }),
7223
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-graph-stage", children: selected && source && target ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { "data-kind": selected.kind, children: [
7224
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
7225
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: relationLabel(selected.kind) }),
7226
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7686
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "dsh-partner-graph-stage", children: selected && source && target ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("article", { "data-kind": selected.kind, children: [
7687
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { children: [
7688
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: relationLabel(selected.kind) }),
7689
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("strong", { children: [
7227
7690
  source.subject,
7228
7691
  " ",
7229
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
7692
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
7230
7693
  " ",
7231
7694
  target.subject
7232
7695
  ] }),
7233
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: selected.label }),
7234
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: relationGuidance(selected.kind) })
7696
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: selected.label }),
7697
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: relationGuidance(selected.kind) })
7235
7698
  ] }),
7236
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-graph-pair", children: [
7237
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GraphMemory, { item: source, side: "\u8D77\u70B9", inspect }),
7238
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { "aria-hidden": "true", children: [
7239
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
7240
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: relationLabel(selected.kind) }),
7241
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {})
7699
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-graph-pair", children: [
7700
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GraphMemory, { item: source, side: "\u8D77\u70B9", inspect }),
7701
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { "aria-hidden": "true", children: [
7702
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", {}),
7703
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: relationLabel(selected.kind) }),
7704
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", {})
7242
7705
  ] }),
7243
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GraphMemory, { item: target, side: "\u5173\u8054\u9879", inspect })
7706
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GraphMemory, { item: target, side: "\u5173\u8054\u9879", inspect })
7244
7707
  ] }),
7245
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("footer", { children: [
7246
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
7708
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("footer", { children: [
7709
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
7247
7710
  "\u6700\u8FD1\u7EC8\u5BA1\u4E8E ",
7248
7711
  new Date(selected.updatedAt).toLocaleString()
7249
7712
  ] }),
7250
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7713
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("strong", { children: [
7251
7714
  "\u5173\u7CFB\u7F6E\u4FE1\u5EA6 ",
7252
7715
  Math.round(selected.confidence * 100),
7253
7716
  "%"
7254
7717
  ] })
7255
7718
  ] })
7256
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u6761\u5173\u7CFB", detail: "\u5173\u7CFB\u4E24\u7AEF\u7684\u8BB0\u5FC6\u4E0E\u4F7F\u7528\u65B9\u5F0F\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
7719
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u6761\u5173\u7CFB", detail: "\u5173\u7CFB\u4E24\u7AEF\u7684\u8BB0\u5FC6\u4E0E\u4F7F\u7528\u65B9\u5F0F\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
7257
7720
  ] })
7258
7721
  ] });
7259
7722
  }
7260
7723
  function GraphMemory({ item, side, inspect }) {
7261
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { children: [
7262
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
7263
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
7724
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { children: [
7725
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { children: [
7726
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
7264
7727
  side,
7265
7728
  " \xB7 ",
7266
7729
  memoryKind(item.kind)
7267
7730
  ] }),
7268
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: item.subject })
7731
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: item.subject })
7269
7732
  ] }),
7270
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: item.content }),
7271
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => inspect(item), children: "\u67E5\u770B\u5E76\u4FEE\u6B63" })
7733
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: item.content }),
7734
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: () => inspect(item), children: "\u67E5\u770B\u5E76\u4FEE\u6B63" })
7272
7735
  ] });
7273
7736
  }
7274
7737
  function relationLabel(kind) {
@@ -7284,70 +7747,70 @@ function relationGuidance(kind) {
7284
7747
  }[kind];
7285
7748
  }
7286
7749
  function DailyReflectionDetail({ entry }) {
7287
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { className: "dsh-partner-diary-detail", children: [
7288
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
7289
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("time", { children: entry.date }),
7290
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7750
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("article", { className: "dsh-partner-diary-detail", children: [
7751
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { children: [
7752
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("time", { children: entry.date }),
7753
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("strong", { children: [
7291
7754
  entry.turnCount,
7292
7755
  " \u8F6E\u4EA4\u6D41\u540E\u7684\u7406\u89E3"
7293
7756
  ] }),
7294
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
7757
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
7295
7758
  "\u66F4\u65B0\u4E8E ",
7296
7759
  new Date(entry.updatedAt).toLocaleString()
7297
7760
  ] })
7298
7761
  ] }),
7299
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: entry.summary }),
7300
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ReflectionGroup, { title: "\u5F85\u8DDF\u8FDB", items: entry.openTasks }),
7301
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ReflectionGroup, { title: "\u5F53\u5929\u4E8B\u4EF6", items: entry.events }),
7302
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ReflectionGroup, { title: "\u65B0\u7406\u89E3", items: entry.learnings }),
7303
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ReflectionGroup, { title: "\u5DF2\u5B8C\u6210", items: entry.completedTasks })
7762
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: entry.summary }),
7763
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ReflectionGroup, { title: "\u5F85\u8DDF\u8FDB", items: entry.openTasks }),
7764
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ReflectionGroup, { title: "\u5F53\u5929\u4E8B\u4EF6", items: entry.events }),
7765
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ReflectionGroup, { title: "\u65B0\u7406\u89E3", items: entry.learnings }),
7766
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ReflectionGroup, { title: "\u5DF2\u5B8C\u6210", items: entry.completedTasks })
7304
7767
  ] });
7305
7768
  }
7306
7769
  function ReflectionGroup({ title, items }) {
7307
7770
  if (items.length === 0) return null;
7308
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { children: [
7309
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: title }),
7310
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ul", { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: item }, item)) })
7771
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("section", { children: [
7772
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: title }),
7773
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("ul", { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("li", { children: item }, item)) })
7311
7774
  ] });
7312
7775
  }
7313
7776
  function MemoryCard({ item, editing, busy, setEditing, save, remove }) {
7314
- const [confirmingRemove, setConfirmingRemove] = (0, import_react19.useState)(false);
7315
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("article", { "data-kind": item.kind, children: editing ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-memory-editor", children: [
7316
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { "aria-label": "\u8BB0\u5FC6\u4E3B\u9898", value: editing.subject, onChange: (event) => setEditing({ ...editing, subject: event.target.value }) }),
7317
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("textarea", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", value: editing.content, onChange: (event) => setEditing({ ...editing, content: event.target.value }) }),
7318
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("footer", { children: [
7319
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => setEditing(void 0), children: "\u53D6\u6D88" }),
7320
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "is-primary", disabled: busy || !editing.subject.trim() || !editing.content.trim(), onClick: save, children: "\u4FDD\u5B58\u4FEE\u6B63" })
7777
+ const [confirmingRemove, setConfirmingRemove] = (0, import_react24.useState)(false);
7778
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("article", { "data-kind": item.kind, children: editing ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "dsh-partner-memory-editor", children: [
7779
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", { "aria-label": "\u8BB0\u5FC6\u4E3B\u9898", value: editing.subject, onChange: (event) => setEditing({ ...editing, subject: event.target.value }) }),
7780
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("textarea", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", value: editing.content, onChange: (event) => setEditing({ ...editing, content: event.target.value }) }),
7781
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("footer", { children: [
7782
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: () => setEditing(void 0), children: "\u53D6\u6D88" }),
7783
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: "is-primary", disabled: busy || !editing.subject.trim() || !editing.content.trim(), onClick: save, children: "\u4FDD\u5B58\u4FEE\u6B63" })
7321
7784
  ] })
7322
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
7323
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
7324
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: memoryKind(item.kind) }),
7325
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: confirmingRemove ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
7326
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => setConfirmingRemove(false), children: "\u53D6\u6D88" }),
7327
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
7328
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
7329
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => setEditing({ ...item }), children: "\u7F16\u8F91" }),
7330
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => setConfirmingRemove(true), children: "\u5220\u9664" })
7785
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
7786
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { children: [
7787
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: memoryKind(item.kind) }),
7788
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { children: confirmingRemove ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
7789
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: () => setConfirmingRemove(false), children: "\u53D6\u6D88" }),
7790
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
7791
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
7792
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: () => setEditing({ ...item }), children: "\u7F16\u8F91" }),
7793
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: () => setConfirmingRemove(true), children: "\u5220\u9664" })
7331
7794
  ] }) })
7332
7795
  ] }),
7333
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: item.subject }),
7334
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: item.content }),
7335
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("footer", { children: [
7336
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("progress", { max: 1, value: item.confidence, "aria-label": `\u7F6E\u4FE1\u5EA6 ${Math.round(item.confidence * 100)}%` }),
7337
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
7796
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: item.subject }),
7797
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: item.content }),
7798
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("footer", { children: [
7799
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("progress", { max: 1, value: item.confidence, "aria-label": `\u7F6E\u4FE1\u5EA6 ${Math.round(item.confidence * 100)}%` }),
7800
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
7338
7801
  item.locked ? "\u624B\u52A8\u786E\u8BA4" : `${Math.round(item.confidence * 100)}% \u53EF\u4FE1`,
7339
7802
  " \xB7 ",
7340
7803
  relativeTime(item.updatedAt)
7341
7804
  ] })
7342
7805
  ] }),
7343
- item.evidence.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("details", { className: "dsh-partner-memory-evidence", children: [
7344
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("summary", { children: [
7806
+ item.evidence.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("details", { className: "dsh-partner-memory-evidence", children: [
7807
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("summary", { children: [
7345
7808
  "\u67E5\u770B\u5BF9\u8BDD\u4F9D\u636E ",
7346
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: item.evidence.length })
7809
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: item.evidence.length })
7347
7810
  ] }),
7348
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: [...item.evidence].reverse().map((evidence) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("blockquote", { children: [
7349
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: evidence.excerpt }),
7350
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("time", { children: new Date(evidence.at).toLocaleString() })
7811
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { children: [...item.evidence].reverse().map((evidence) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("blockquote", { children: [
7812
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: evidence.excerpt }),
7813
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("time", { children: new Date(evidence.at).toLocaleString() })
7351
7814
  ] }, `${evidence.turnId}:${evidence.at}`)) })
7352
7815
  ] })
7353
7816
  ] }) });