@lemoncat7/dsh-partner 1.9.2 → 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 (136) hide show
  1. package/README.md +12 -1
  2. package/docs/architecture.md +14 -0
  3. package/lib/agent-runtime.d.ts +3 -2
  4. package/lib/agent-runtime.d.ts.map +1 -1
  5. package/lib/agent-runtime.js +24 -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.map +1 -1
  14. package/lib/channels/delivery-policy.d.ts +7 -0
  15. package/lib/channels/delivery-policy.d.ts.map +1 -1
  16. package/lib/channels/delivery-policy.js +44 -9
  17. package/lib/channels/delivery-policy.js.map +1 -1
  18. package/lib/channels/manager.d.ts +2 -0
  19. package/lib/channels/manager.d.ts.map +1 -1
  20. package/lib/channels/manager.js +36 -9
  21. package/lib/channels/manager.js.map +1 -1
  22. package/lib/channels/outbound-media.d.ts +6 -0
  23. package/lib/channels/outbound-media.d.ts.map +1 -0
  24. package/lib/channels/outbound-media.js +118 -0
  25. package/lib/channels/outbound-media.js.map +1 -0
  26. package/lib/client-api.d.ts +3 -0
  27. package/lib/client-api.d.ts.map +1 -1
  28. package/lib/client-api.js.map +1 -1
  29. package/lib/client.d.ts.map +1 -1
  30. package/lib/client.js +1424 -1067
  31. package/lib/client.js.map +4 -4
  32. package/lib/collaboration/composition.d.ts +3 -1
  33. package/lib/collaboration/composition.d.ts.map +1 -1
  34. package/lib/collaboration/composition.js +30 -13
  35. package/lib/collaboration/composition.js.map +1 -1
  36. package/lib/collaboration/service.d.ts +3 -0
  37. package/lib/collaboration/service.d.ts.map +1 -1
  38. package/lib/collaboration/service.js +46 -10
  39. package/lib/collaboration/service.js.map +1 -1
  40. package/lib/domain.d.ts +2 -0
  41. package/lib/domain.d.ts.map +1 -1
  42. package/lib/domain.js.map +1 -1
  43. package/lib/execution/agent-support.d.ts.map +1 -1
  44. package/lib/execution/agent-support.js +27 -3
  45. package/lib/execution/agent-support.js.map +1 -1
  46. package/lib/execution/service.d.ts +1 -0
  47. package/lib/execution/service.d.ts.map +1 -1
  48. package/lib/execution/service.js +8 -0
  49. package/lib/execution/service.js.map +1 -1
  50. package/lib/index.d.ts.map +1 -1
  51. package/lib/index.js +19 -3
  52. package/lib/index.js.map +1 -1
  53. package/lib/pendant/renderer.d.ts +1 -0
  54. package/lib/pendant/renderer.d.ts.map +1 -1
  55. package/lib/pendant/renderer.js +4 -0
  56. package/lib/pendant/renderer.js.map +1 -1
  57. package/lib/pendant/widget.js +3 -1
  58. package/lib/pendant/widget.js.map +1 -1
  59. package/lib/pendant-renderer.js +6 -6
  60. package/lib/requirements/archive.d.ts +4 -0
  61. package/lib/requirements/archive.d.ts.map +1 -0
  62. package/lib/requirements/archive.js +14 -0
  63. package/lib/requirements/archive.js.map +1 -0
  64. package/lib/requirements/consolidation.d.ts +11 -0
  65. package/lib/requirements/consolidation.d.ts.map +1 -0
  66. package/lib/requirements/consolidation.js +50 -0
  67. package/lib/requirements/consolidation.js.map +1 -0
  68. package/lib/requirements/domain.d.ts +41 -0
  69. package/lib/requirements/domain.d.ts.map +1 -0
  70. package/lib/requirements/domain.js +2 -0
  71. package/lib/requirements/domain.js.map +1 -0
  72. package/lib/requirements/progress.d.ts +7 -0
  73. package/lib/requirements/progress.d.ts.map +1 -0
  74. package/lib/requirements/progress.js +17 -0
  75. package/lib/requirements/progress.js.map +1 -0
  76. package/lib/requirements/service.d.ts +23 -0
  77. package/lib/requirements/service.d.ts.map +1 -0
  78. package/lib/requirements/service.js +163 -0
  79. package/lib/requirements/service.js.map +1 -0
  80. package/lib/requirements/tool.d.ts +5 -0
  81. package/lib/requirements/tool.d.ts.map +1 -0
  82. package/lib/requirements/tool.js +49 -0
  83. package/lib/requirements/tool.js.map +1 -0
  84. package/lib/requirements/worker.d.ts +30 -0
  85. package/lib/requirements/worker.d.ts.map +1 -0
  86. package/lib/requirements/worker.js +164 -0
  87. package/lib/requirements/worker.js.map +1 -0
  88. package/lib/skills/builtin.js +2 -2
  89. package/lib/skills/builtin.js.map +1 -1
  90. package/lib/skills/task-planning.d.ts +3 -1
  91. package/lib/skills/task-planning.d.ts.map +1 -1
  92. package/lib/skills/task-planning.js +29 -13
  93. package/lib/skills/task-planning.js.map +1 -1
  94. package/lib/store.js +2 -0
  95. package/lib/store.js.map +1 -1
  96. package/lib/tasks/context.d.ts +8 -0
  97. package/lib/tasks/context.d.ts.map +1 -0
  98. package/lib/tasks/context.js +48 -0
  99. package/lib/tasks/context.js.map +1 -0
  100. package/lib/tasks/domain.d.ts +10 -0
  101. package/lib/tasks/domain.d.ts.map +1 -1
  102. package/lib/tasks/removal.d.ts +5 -0
  103. package/lib/tasks/removal.d.ts.map +1 -0
  104. package/lib/tasks/removal.js +44 -0
  105. package/lib/tasks/removal.js.map +1 -0
  106. package/lib/tasks/requirement-link.d.ts +4 -0
  107. package/lib/tasks/requirement-link.d.ts.map +1 -0
  108. package/lib/tasks/requirement-link.js +11 -0
  109. package/lib/tasks/requirement-link.js.map +1 -0
  110. package/lib/tasks/service.d.ts +13 -5
  111. package/lib/tasks/service.d.ts.map +1 -1
  112. package/lib/tasks/service.js +91 -27
  113. package/lib/tasks/service.js.map +1 -1
  114. package/lib/ui/board-refresh.d.ts +3 -0
  115. package/lib/ui/board-refresh.d.ts.map +1 -0
  116. package/lib/ui/board-refresh.js +42 -0
  117. package/lib/ui/board-refresh.js.map +1 -0
  118. package/lib/ui/requirement-board.d.ts +5 -0
  119. package/lib/ui/requirement-board.d.ts.map +1 -0
  120. package/lib/ui/requirement-board.js +47 -0
  121. package/lib/ui/requirement-board.js.map +1 -0
  122. package/lib/ui/requirement-dialog.d.ts +15 -0
  123. package/lib/ui/requirement-dialog.d.ts.map +1 -0
  124. package/lib/ui/requirement-dialog.js +53 -0
  125. package/lib/ui/requirement-dialog.js.map +1 -0
  126. package/lib/ui/requirement-tasks-panel.d.ts +8 -0
  127. package/lib/ui/requirement-tasks-panel.d.ts.map +1 -0
  128. package/lib/ui/requirement-tasks-panel.js +269 -0
  129. package/lib/ui/requirement-tasks-panel.js.map +1 -0
  130. package/lib/ui/task-board-panel.d.ts +2 -4
  131. package/lib/ui/task-board-panel.d.ts.map +1 -1
  132. package/lib/ui/task-board-panel.js +2 -288
  133. package/lib/ui/task-board-panel.js.map +1 -1
  134. package/lib/ui/workspace-components.js +1 -1
  135. package/lib/ui/workspace-components.js.map +1 -1
  136. 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_react21 = 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_primitives14 = 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);
@@ -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,7 +1476,7 @@ 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; }
1478
- .dsh-partner-board-tools .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
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; }
1479
1480
  .dsh-partner-board-assignee.is-mobile-stage { display: none; }
1480
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; }
1481
1482
  .dsh-partner-board-search > input,
@@ -2618,6 +2619,9 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
2618
2619
  // src/ui/workspace-ui.css
2619
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';
2620
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";
2624
+
2621
2625
  // src/ui/responsive-ui.css
2622
2626
  var responsive_ui_default = `/* Mobile composition lives separately from the desktop visual system so each
2623
2627
  layout can evolve without selector-specificity patches. */
@@ -2868,7 +2872,8 @@ var widget_default = `.dsh-partner-pendant { position: fixed; z-index: 12; top:
2868
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; }
2869
2873
  .dsh-partner-pendant-anchor > span { width: 14px; height: 6px; border: 1px solid #71817e; border-radius: 4px; background: #c3ced0; }
2870
2874
  .dsh-partner-pendant-anchor:hover > span { background: #e4ece8; }
2871
- .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; }
2872
2877
  body[data-ds-dark-theme] .dsh-partner-pendant-unread { border-color: rgb(200 220 213 / 24%); background: #b0c6bd; color: #202e29; }
2873
2878
  .dsh-partner-pendant-announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
2874
2879
  /* Own the reader's surface even under host-wide important focus rules. */
@@ -3045,7 +3050,7 @@ function WorkspaceDialog({ eyebrow = "CREATE & CONFIGURE", title, detail, close,
3045
3050
  return;
3046
3051
  }
3047
3052
  if (event.key !== "Tab") return;
3048
- 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);
3049
3054
  if (focusable.length === 0) return;
3050
3055
  const first = focusable[0];
3051
3056
  const last = focusable.at(-1);
@@ -3764,6 +3769,7 @@ function PartnerPendant({ controller }) {
3764
3769
  }
3765
3770
  function ActivePendant({ controller, settings }) {
3766
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);
3767
3773
  const handle = (0, import_react9.useRef)(), toggle = (0, import_react9.useRef)(() => {
3768
3774
  });
3769
3775
  const [open, setOpen] = (0, import_react9.useState)(false), [ready, setReady] = (0, import_react9.useState)(false), [failed, setFailed] = (0, import_react9.useState)(false);
@@ -3809,7 +3815,8 @@ function ActivePendant({ controller, settings }) {
3809
3815
  handle.current = void 0;
3810
3816
  setReady(false);
3811
3817
  setFailed(true);
3812
- }
3818
+ },
3819
+ ...unreadBadge.current ? { unreadBadge: unreadBadge.current } : {}
3813
3820
  });
3814
3821
  if (abort.signal.aborted) {
3815
3822
  instance.destroy();
@@ -3857,7 +3864,7 @@ function ActivePendant({ controller, settings }) {
3857
3864
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { children: failed ? inbox.unread ? `${inbox.unread} \u6761\u6D88\u606F` : "\u6D88\u606F" : "\u52A0\u8F7D\u6302\u9970\u2026" })
3858
3865
  ] }) }),
3859
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" }) }),
3860
- 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 }),
3861
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}` : "" }),
3862
3869
  open && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PendantReader, { inbox, selected, error: error || navigationError, anchor: hit, onSelect: inspect, onClose: close, onVisit: (item) => {
3863
3870
  void visit(item);
@@ -4705,39 +4712,249 @@ function skillScalar(value) {
4705
4712
  return `"${value.replace(/[\r\n]+/g, " ").replace(/"/g, "'").trim()}"`;
4706
4713
  }
4707
4714
 
4708
- // src/ui/task-board-panel.tsx
4709
- var import_react15 = require("react");
4710
- var import_dsh_client_ui_primitives8 = require("@deepseek-ai/dsh-client-ui-primitives");
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");
4711
4718
 
4712
- // src/ui/task-board-stage.tsx
4719
+ // src/ui/board-refresh.ts
4713
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");
4714
4763
  var import_dsh_client_ui_primitives7 = require("@deepseek-ai/dsh-client-ui-primitives");
4715
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");
4716
4933
  function TaskBoardStage({ id, label, tasks, focused, filtered, renderTask }) {
4717
- const [collapsed, setCollapsed] = (0, import_react14.useState)(false);
4718
- const [limit, setLimit] = (0, import_react14.useState)(6);
4934
+ const [collapsed, setCollapsed] = (0, import_react16.useState)(false);
4935
+ const [limit, setLimit] = (0, import_react16.useState)(6);
4719
4936
  const count = Math.max(limit, focused ? 12 : 6);
4720
4937
  const titleId = `dsh-partner-board-${id}`, listId = `${titleId}-list`;
4721
4938
  const expanded = !collapsed;
4722
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { "data-status": id, "data-empty": tasks.length === 0, "aria-labelledby": titleId, children: [
4723
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("header", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "dsh-partner-board-stage-toggle", "aria-expanded": expanded, "aria-controls": listId, onClick: () => setCollapsed((value) => !value), children: [
4724
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives7.IconChevronRightOutline14, { size: 14 }),
4725
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { id: titleId, children: label }),
4726
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: tasks.length })
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 })
4727
4944
  ] }) }),
4728
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { id: listId, hidden: !expanded, children: tasks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
4729
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-board-column-list", children: tasks.slice(0, count).map(renderTask) }),
4730
- tasks.length > count && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "dsh-partner-board-more", onClick: () => setLimit(count + 12), children: [
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: [
4731
4948
  "\u5C55\u5F00\u66F4\u591A \xB7 \u8FD8\u6709 ",
4732
4949
  tasks.length - count,
4733
4950
  " \u9879"
4734
4951
  ] })
4735
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsh-partner-board-empty", children: filtered ? "\u6CA1\u6709\u5339\u914D\u4EFB\u52A1" : "\u6682\u65E0\u4EFB\u52A1" }) })
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" }) })
4736
4953
  ] });
4737
4954
  }
4738
4955
 
4739
- // src/ui/task-board-panel.tsx
4740
- var import_jsx_runtime11 = require("react/jsx-runtime");
4956
+ // src/ui/requirement-tasks-panel.tsx
4957
+ var import_jsx_runtime12 = require("react/jsx-runtime");
4741
4958
  var COLUMNS = [
4742
4959
  { id: "backlog", label: "\u6536\u96C6\u7BB1" },
4743
4960
  { id: "ready", label: "\u5F85\u5F00\u59CB" },
@@ -4746,27 +4963,27 @@ var COLUMNS = [
4746
4963
  { id: "blocked", label: "\u53D7\u963B" },
4747
4964
  { id: "done", label: "\u5DF2\u5B8C\u6210" }
4748
4965
  ];
4749
- var LIVE_REFRESH_MS = 4e3;
4750
- function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4751
- const [board, setBoard] = (0, import_react15.useState)({ tasks: [], activities: [] });
4752
- const [directory, setDirectory] = (0, import_react15.useState)([]);
4753
- const [delegations, setDelegations] = (0, import_react15.useState)([]);
4754
- const [creating, setCreating] = (0, import_react15.useState)(false);
4755
- const [selectedTaskId, setSelectedTaskId] = (0, import_react15.useState)(initialTaskId);
4756
- (0, import_react15.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)(() => {
4757
4974
  if (initialTaskId) setSelectedTaskId(initialTaskId);
4758
4975
  }, [initialTaskId, openRequest]);
4759
- const [busy, setBusy] = (0, import_react15.useState)();
4760
- const [loading, setLoading] = (0, import_react15.useState)(true);
4761
- const [error, setError] = (0, import_react15.useState)();
4762
- const [syncedAt, setSyncedAt] = (0, import_react15.useState)();
4763
- const [query, setQuery] = (0, import_react15.useState)("");
4764
- const [statusFilter, setStatusFilter] = (0, import_react15.useState)("all");
4765
- const [assigneeFilter, setAssigneeFilter] = (0, import_react15.useState)("all");
4766
- const deferredQuery = (0, import_react15.useDeferredValue)(query.trim().toLocaleLowerCase());
4767
- const tasksById = (0, import_react15.useMemo)(() => new Map(board.tasks.map((item) => [item.id, item])), [board.tasks]);
4768
- const directoryById = (0, import_react15.useMemo)(() => new Map(directory.map((item) => [item.id, item])), [directory]);
4769
- const activeDelegationByTaskId = (0, import_react15.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)(() => {
4770
4987
  const result = /* @__PURE__ */ new Map();
4771
4988
  for (const delegation of delegations) {
4772
4989
  if ((delegation.status === "queued" || delegation.status === "running") && !result.has(delegation.taskId)) result.set(delegation.taskId, delegation);
@@ -4774,24 +4991,26 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4774
4991
  return result;
4775
4992
  }, [delegations]);
4776
4993
  const selectedTask = selectedTaskId ? tasksById.get(selectedTaskId) : void 0;
4777
- const dependentsById = (0, import_react15.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)(() => {
4778
4997
  const result = /* @__PURE__ */ new Map();
4779
4998
  for (const task of board.tasks) for (const dependencyId of task.dependencyTaskIds) result.set(dependencyId, (result.get(dependencyId) ?? 0) + 1);
4780
4999
  return result;
4781
5000
  }, [board.tasks]);
4782
- const scopedTasks = (0, import_react15.useMemo)(() => board.tasks.filter((task) => {
5001
+ const scopedTasks = (0, import_react17.useMemo)(() => requirementTasks.filter((task) => {
4783
5002
  if (assigneeFilter !== "all" && (task.assigneeCompanionId ?? "unassigned") !== assigneeFilter) return false;
4784
5003
  if (!deferredQuery) return true;
4785
5004
  const dependencies = task.dependencyTaskIds.map((id) => tasksById.get(id)?.title ?? "");
4786
5005
  return [task.title, task.description, task.resultAbstract, task.resultSummary, directoryById.get(task.assigneeCompanionId ?? "")?.name, ...dependencies].some((value) => value?.toLocaleLowerCase().includes(deferredQuery));
4787
- }), [assigneeFilter, board.tasks, deferredQuery, directoryById, tasksById]);
4788
- const statusCounts = (0, import_react15.useMemo)(() => {
5006
+ }), [assigneeFilter, requirementTasks, deferredQuery, directoryById, tasksById]);
5007
+ const statusCounts = (0, import_react17.useMemo)(() => {
4789
5008
  const result = new Map(COLUMNS.map((column) => [column.id, 0]));
4790
5009
  for (const task of scopedTasks) result.set(task.status, (result.get(task.status) ?? 0) + 1);
4791
5010
  return result;
4792
5011
  }, [scopedTasks]);
4793
- const visibleColumns = statusFilter === "all" ? COLUMNS : COLUMNS.filter((column) => column.id === statusFilter);
4794
- const tasksByStatus = (0, import_react15.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)(() => {
4795
5014
  const priorityRank = { urgent: 3, high: 2, normal: 1, low: 0 };
4796
5015
  const result = new Map(COLUMNS.map((column) => [column.id, []]));
4797
5016
  for (const task of scopedTasks) {
@@ -4802,38 +5021,20 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4802
5021
  return result;
4803
5022
  }, [scopedTasks, statusFilter]);
4804
5023
  const visibleTaskCount = statusFilter === "all" ? scopedTasks.length : statusCounts.get(statusFilter) ?? 0;
4805
- const loadingRef = (0, import_react15.useRef)(false);
4806
- const load2 = (0, import_react15.useCallback)(async () => {
4807
- if (loadingRef.current) return;
4808
- loadingRef.current = true;
4809
- try {
4810
- 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 () => {
4811
5027
  setBoard(next);
4812
5028
  setDirectory(collaboration.companions);
4813
5029
  setDelegations(collaboration.delegations);
4814
5030
  setSyncedAt(Date.now());
4815
- setError(void 0);
4816
- } catch (reason) {
4817
- setError(errorMessage(reason));
4818
- } finally {
4819
- loadingRef.current = false;
4820
5031
  setLoading(false);
4821
- }
4822
- }, []);
4823
- (0, import_react15.useEffect)(() => {
4824
- void load2();
4825
- const timer = window.setInterval(() => {
4826
- if (document.visibilityState === "visible") void load2();
4827
- }, LIVE_REFRESH_MS);
4828
- const visible = () => {
4829
- if (document.visibilityState === "visible") void load2();
5032
+ setSelectedTaskId((id) => next.tasks.some((t) => t.id === id) ? id : void 0);
4830
5033
  };
4831
- document.addEventListener("visibilitychange", visible);
4832
- return () => {
4833
- window.clearInterval(timer);
4834
- document.removeEventListener("visibilitychange", visible);
4835
- };
4836
- }, [load2]);
5034
+ }, (reason) => {
5035
+ setError(errorMessage(reason));
5036
+ setLoading(false);
5037
+ });
4837
5038
  const update = async (task, change) => {
4838
5039
  setBusy(task.id);
4839
5040
  setError(void 0);
@@ -4841,6 +5042,7 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4841
5042
  await api(`/tasks/${task.id}`, { method: "PUT", body: JSON.stringify({ expectedRevision: task.revision, ...change }) });
4842
5043
  await load2();
4843
5044
  } catch (reason) {
5045
+ await load2();
4844
5046
  setError(errorMessage(reason));
4845
5047
  } finally {
4846
5048
  setBusy(void 0);
@@ -4876,7 +5078,7 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4876
5078
  setBusy(task.id);
4877
5079
  setError(void 0);
4878
5080
  try {
4879
- await api(`/tasks/${task.id}/accept`, { method: "POST" });
5081
+ await api(`/tasks/${task.id}/accept`, { method: "POST", body: JSON.stringify({ expectedRevision: task.revision }) });
4880
5082
  await load2();
4881
5083
  } catch (reason) {
4882
5084
  setError(errorMessage(reason));
@@ -4889,7 +5091,7 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4889
5091
  setBusy(task.id);
4890
5092
  setError(void 0);
4891
5093
  try {
4892
- 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 }) });
4893
5095
  await load2();
4894
5096
  } catch (cause) {
4895
5097
  setError(errorMessage(cause));
@@ -4910,102 +5112,114 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4910
5112
  setBusy(void 0);
4911
5113
  }
4912
5114
  };
4913
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-partner-feature-page is-board", children: [
4914
- /* @__PURE__ */ (0, import_jsx_runtime11.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_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
4915
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-partner-board-live", title: syncedAt ? `\u6700\u8FD1\u540C\u6B65 ${new Date(syncedAt).toLocaleTimeString()}` : "\u6B63\u5728\u8FDE\u63A5", children: [
4916
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", {}),
4917
- "\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" })
4918
5121
  ] }),
4919
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", onClick: () => setCreating(true), children: [
4920
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconPlusOutline16, { size: 15 }),
4921
- "\u65B0\u4EFB\u52A1"
4922
- ] })
4923
- ] }) }),
4924
- error && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WorkspaceNotice, { children: error }),
4925
- creating && /* @__PURE__ */ (0, import_jsx_runtime11.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_runtime11.jsx)(TaskForm, { companions: directory, tasks: board.tasks, close: () => setCreating(false), changed: load2 }) }),
4926
- selectedTask && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WorkspaceDialog, { eyebrow: "TASK DETAIL", title: selectedTask.title, detail: taskDialogSummary(selectedTask, directory), close: () => setSelectedTaskId(void 0), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4927
- TaskDetail,
4928
- {
4929
- task: selectedTask,
4930
- tasks: board.tasks,
4931
- activities: board.activities.filter((item) => item.taskId === selectedTask.id),
4932
- directory,
4933
- execution: activeDelegationByTaskId.get(selectedTask.id),
4934
- busy: busy === selectedTask.id,
4935
- update: (change) => {
4936
- void update(selectedTask, change);
4937
- },
4938
- delegate: () => {
4939
- void delegate(selectedTask);
4940
- },
4941
- review: () => {
4942
- void review(selectedTask);
4943
- },
4944
- accept: () => {
4945
- void accept(selectedTask);
4946
- },
4947
- reject: (reason) => {
4948
- 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
+ }
4949
5165
  },
4950
- remove: () => {
4951
- void remove(selectedTask);
4952
- }
4953
- },
4954
- selectedTask.id
4955
- ) }),
4956
- loading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CollectionSkeleton, { rows: 6 }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
4957
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-partner-board-tools", children: [
4958
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "dsh-partner-board-search", children: [
4959
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u4EFB\u52A1" }),
4960
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconSearchOutline16, { size: 16 }) }),
4961
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: "\u641C\u7D22\u4EFB\u52A1\u3001\u8D1F\u8D23\u4EBA\u6216\u524D\u7F6E\u4EFB\u52A1" }),
4962
- query && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", onClick: () => setQuery(""), "aria-label": "\u6E05\u9664\u4EFB\u52A1\u641C\u7D22", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.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 }) })
4963
5177
  ] }),
4964
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "dsh-partner-board-assignee", children: [
4965
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "\u6309\u8D1F\u8D23\u4EBA\u7B5B\u9009" }),
4966
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("select", { value: assigneeFilter, onChange: (event) => setAssigneeFilter(event.target.value), children: [
4967
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "all", children: "\u5168\u90E8\u4F19\u4F34" }),
4968
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "unassigned", children: "\u672A\u6307\u6D3E" }),
4969
- directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime11.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: [
4970
5184
  "@",
4971
5185
  item.name
4972
5186
  ] }, item.id))
4973
5187
  ] })
4974
5188
  ] }),
4975
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "dsh-partner-board-assignee is-mobile-stage", children: [
4976
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "\u6309\u4EFB\u52A1\u9636\u6BB5\u7B5B\u9009" }),
4977
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("select", { value: statusFilter, onChange: (event) => setStatusFilter(event.target.value), children: [
4978
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("option", { value: "all", 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: [
4979
5193
  "\u5168\u90E8\u9636\u6BB5 \xB7 ",
4980
5194
  scopedTasks.length
4981
5195
  ] }),
4982
- COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("option", { value: column.id, children: [
5196
+ COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("option", { value: column.id, children: [
4983
5197
  column.label,
4984
5198
  " \xB7 ",
4985
5199
  statusCounts.get(column.id) ?? 0
4986
5200
  ] }, column.id))
4987
5201
  ] })
4988
5202
  ] }),
4989
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("small", { "aria-live": "polite", children: [
5203
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("small", { "aria-live": "polite", children: [
4990
5204
  "\u663E\u793A ",
4991
5205
  visibleTaskCount,
4992
5206
  " / ",
4993
5207
  board.tasks.length
4994
5208
  ] })
4995
5209
  ] }),
4996
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("nav", { className: "dsh-partner-board-statuses", "aria-label": "\u6309\u4EFB\u52A1\u72B6\u6001\u7B5B\u9009", children: [
4997
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", className: statusFilter === "all" ? "is-active" : "", "aria-pressed": statusFilter === "all", onClick: () => setStatusFilter("all"), children: [
4998
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u5168\u90E8" }),
4999
- /* @__PURE__ */ (0, import_jsx_runtime11.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 })
5000
5214
  ] }),
5001
- COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", className: statusFilter === column.id ? "is-active" : "", "aria-pressed": statusFilter === column.id, onClick: () => setStatusFilter(column.id), children: [
5002
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: column.label }),
5003
- /* @__PURE__ */ (0, import_jsx_runtime11.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 })
5004
5218
  ] }, column.id))
5005
5219
  ] }),
5006
- /* @__PURE__ */ (0, import_jsx_runtime11.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) => {
5007
5221
  const tasks = tasksByStatus.get(column.id) ?? [];
5008
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TaskBoardStage, { id: column.id, label: column.label, tasks, focused: statusFilter !== "all", filtered: Boolean(query || assigneeFilter !== "all"), renderTask: (task) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
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)(
5009
5223
  TaskCard,
5010
5224
  {
5011
5225
  task,
@@ -5017,8 +5231,12 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
5017
5231
  },
5018
5232
  task.id
5019
5233
  ) }, column.id);
5020
- }) })
5021
- ] })
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
+ ] }))
5022
5240
  ] });
5023
5241
  }
5024
5242
  function TaskCard({ task, tasksById, directoryById, dependentCount, execution, open }) {
@@ -5027,38 +5245,38 @@ function TaskCard({ task, tasksById, directoryById, dependentCount, execution, o
5027
5245
  const completedDependencies = dependencies.length - blockers.length;
5028
5246
  const assignee = directoryById.get(task.assigneeCompanionId ?? "");
5029
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;
5030
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("article", { className: "dsh-partner-task-card", "data-blocked": blockers.length > 0, "data-priority": task.priority, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", className: "dsh-partner-task-summary", "aria-haspopup": "dialog", onClick: open, children: [
5031
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
5032
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-partner-task-card-title", children: [
5033
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { title: task.title, children: task.title }),
5034
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("em", { children: priorityLabel(task.priority) })
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) })
5035
5253
  ] }),
5036
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("small", { className: "dsh-partner-task-card-owner", children: [
5254
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("small", { className: "dsh-partner-task-card-owner", children: [
5037
5255
  assignee ? `@${assignee.name}` : "\u672A\u6307\u6D3E",
5038
5256
  task.resultSummary ? " \xB7 \u5DF2\u6709\u7ED3\u679C" : "",
5039
5257
  executionState ? ` \xB7 ${executionState.label}` : ""
5040
5258
  ] }),
5041
- (dependencies.length > 0 || dependentCount > 0) && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-partner-task-relations", children: [
5042
- dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.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: [
5043
5261
  "\u524D\u7F6E ",
5044
5262
  completedDependencies,
5045
5263
  "/",
5046
5264
  dependencies.length
5047
5265
  ] }),
5048
- dependentCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("small", { children: [
5266
+ dependentCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("small", { children: [
5049
5267
  "\u5B8C\u6210\u540E\u89E3\u9501 ",
5050
5268
  dependentCount
5051
5269
  ] })
5052
5270
  ] })
5053
5271
  ] }),
5054
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconChevronRightOutline14, { size: 14 })
5272
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.IconChevronRightOutline14, { size: 14 })
5055
5273
  ] }) });
5056
5274
  }
5057
5275
  function TaskDetail({ task, tasks, activities, directory, execution, busy, update, delegate, review, accept, reject, remove }) {
5058
- const [rejecting, setRejecting] = (0, import_react15.useState)(false);
5059
- const [rejectReason, setRejectReason] = (0, import_react15.useState)("");
5060
- const [confirmingDelete, setConfirmingDelete] = (0, import_react15.useState)(false);
5061
- const byId = (0, import_react15.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]);
5062
5280
  const dependencies = task.dependencyTaskIds.map((id) => byId.get(id)).filter((item) => item !== void 0);
5063
5281
  const blockers = dependencies.filter((item) => item.status !== "done");
5064
5282
  const assignee = directory.find((item) => item.id === task.assigneeCompanionId);
@@ -5067,21 +5285,21 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
5067
5285
  const canExecute = Boolean(task.assigneeCompanionId) && !execution && !["doing", "review", "done"].includes(task.status);
5068
5286
  const recentActivities = [...activities].sort((left, right) => right.at - left.at).slice(0, 6);
5069
5287
  const executionState = execution ? delegationState(execution, blockers.length) : void 0;
5070
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-partner-task-detail", children: [
5071
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsh-partner-task-description", children: [
5072
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
5073
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: task.description || "\u6CA1\u6709\u8865\u5145\u8BF4\u660E" })
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" })
5074
5292
  ] }),
5075
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-partner-task-fields", children: [
5076
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5077
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u72B6\u6001" }),
5078
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("select", { value: task.status, disabled: busy, onChange: (event) => update({ status: event.target.value }), children: COLUMNS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime11.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)) })
5079
5297
  ] }),
5080
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5081
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
5082
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("select", { value: task.assigneeCompanionId ?? "", disabled: busy || task.status === "doing", onChange: (event) => update({ assigneeCompanionId: event.target.value }), children: [
5083
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
5084
- directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime11.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: [
5085
5303
  "@",
5086
5304
  item.name,
5087
5305
  " \xB7 ",
@@ -5089,43 +5307,43 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
5089
5307
  ] }, item.id))
5090
5308
  ] })
5091
5309
  ] }),
5092
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5093
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
5094
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("select", { value: task.reviewerCompanionId ?? "", disabled: busy, onChange: (event) => update({ reviewerCompanionId: event.target.value }), children: [
5095
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
5096
- directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime11.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: [
5097
5315
  "@",
5098
5316
  item.name
5099
5317
  ] }, item.id))
5100
5318
  ] })
5101
5319
  ] })
5102
5320
  ] }),
5103
- executionState && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsh-partner-task-execution", "data-state": execution?.status, children: [
5104
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", {}),
5105
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
5106
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: executionState.title }),
5107
- /* @__PURE__ */ (0, import_jsx_runtime11.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 })
5108
5326
  ] })
5109
5327
  ] }),
5110
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsh-partner-task-dependency", children: [
5111
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("header", { children: [
5112
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "\u524D\u7F6E\u4EFB\u52A1" }),
5113
- /* @__PURE__ */ (0, import_jsx_runtime11.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" })
5114
5332
  ] }),
5115
- dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { children: dependencies.map((item) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { "data-done": item.status === "done", children: [
5116
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", { children: item.status === "done" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconCheckOutline16, { size: 12 }) : "" }),
5117
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("b", { children: item.title }),
5118
- /* @__PURE__ */ (0, import_jsx_runtime11.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" })
5119
5337
  ] }, item.id)) }),
5120
- dependencyCandidates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5121
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1" }),
5122
- /* @__PURE__ */ (0, import_jsx_runtime11.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) => {
5123
5341
  const id = event.currentTarget.value;
5124
5342
  if (id) update({ dependencyTaskIds: [...task.dependencyTaskIds, id] });
5125
5343
  event.currentTarget.value = "";
5126
5344
  }, children: [
5127
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1\u2026" }),
5128
- dependencyCandidates.map((item) => /* @__PURE__ */ (0, import_jsx_runtime11.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: [
5129
5347
  item.title,
5130
5348
  " \xB7 ",
5131
5349
  statusLabel(item.status)
@@ -5133,16 +5351,19 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
5133
5351
  ] })
5134
5352
  ] })
5135
5353
  ] }),
5136
- task.resultSummary && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ResultBlock, { label: "\u6267\u884C\u7ED3\u679C", value: task.resultSummary }),
5137
- task.reviewSummary && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ResultBlock, { label: `\u6838\u9A8C\u610F\u89C1${reviewer ? ` \xB7 @${reviewer.name}` : ""}`, value: task.reviewSummary }),
5138
- recentActivities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsh-partner-task-activity", children: [
5139
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "\u6700\u8FD1\u6D3B\u52A8" }),
5140
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("ol", { children: recentActivities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("li", { children: [
5141
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: item.message }),
5142
- /* @__PURE__ */ (0, import_jsx_runtime11.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() })
5143
5364
  ] }, item.id)) })
5144
5365
  ] }),
5145
- rejecting && /* @__PURE__ */ (0, import_jsx_runtime11.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) => {
5146
5367
  event.preventDefault();
5147
5368
  const reason = rejectReason.trim();
5148
5369
  if (!reason) return;
@@ -5150,52 +5371,52 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
5150
5371
  setRejecting(false);
5151
5372
  setRejectReason("");
5152
5373
  }, children: [
5153
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5154
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u6253\u56DE\u539F\u56E0" }),
5155
- /* @__PURE__ */ (0, import_jsx_runtime11.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" })
5156
5377
  ] }),
5157
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
5158
- /* @__PURE__ */ (0, import_jsx_runtime11.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: () => {
5159
5380
  setRejecting(false);
5160
5381
  setRejectReason("");
5161
5382
  }, children: "\u53D6\u6D88" }),
5162
- /* @__PURE__ */ (0, import_jsx_runtime11.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" })
5163
5384
  ] })
5164
5385
  ] }),
5165
- confirmingDelete && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-partner-task-delete-confirm", role: "alert", children: [
5166
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u5220\u9664\u540E\uFF0C\u4F9D\u8D56\u5B83\u7684\u4EFB\u52A1\u4F1A\u89E3\u9664\u8FD9\u6761\u524D\u7F6E\u5173\u7CFB\u3002" }),
5167
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
5168
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", onClick: () => setConfirmingDelete(false), children: "\u53D6\u6D88" }),
5169
- /* @__PURE__ */ (0, import_jsx_runtime11.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" })
5170
5391
  ] })
5171
5392
  ] }),
5172
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("footer", { className: "dsh-partner-task-actions", children: [
5173
- /* @__PURE__ */ (0, import_jsx_runtime11.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: [
5174
5395
  "r",
5175
5396
  task.revision,
5176
5397
  " \xB7 ",
5177
5398
  new Date(task.updatedAt).toLocaleString()
5178
5399
  ] }),
5179
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
5180
- task.status === "review" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
5181
- task.reviewerCompanionId && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", disabled: busy, onClick: review, children: busy ? "\u6838\u9A8C\u4E2D\u2026" : `\u4EA4\u7ED9 @${reviewer?.name ?? "\u4F19\u4F34"} \u6838\u9A8C` }),
5182
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", disabled: busy, onClick: () => setRejecting(true), children: "\u6253\u56DE\u91CD\u505A" }),
5183
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: accept, children: "\u9A8C\u6536\u901A\u8FC7" })
5184
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime11.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"}` }),
5185
- /* @__PURE__ */ (0, import_jsx_runtime11.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_runtime11.jsx)(import_dsh_client_ui_primitives8.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 }) })
5186
5407
  ] })
5187
5408
  ] })
5188
5409
  ] });
5189
5410
  }
5190
5411
  function ResultBlock({ label, value }) {
5191
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsh-partner-task-result", children: [
5192
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: label }),
5193
- /* @__PURE__ */ (0, import_jsx_runtime11.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 })
5194
5415
  ] });
5195
5416
  }
5196
- function TaskForm({ companions, tasks, close, changed: changed2 }) {
5197
- const [error, setError] = (0, import_react15.useState)();
5198
- const [busy, setBusy] = (0, import_react15.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);
5199
5420
  const dependencyOptions = tasks.filter((item) => item.status !== "done");
5200
5421
  const submit = async (event) => {
5201
5422
  event.preventDefault();
@@ -5204,6 +5425,7 @@ function TaskForm({ companions, tasks, close, changed: changed2 }) {
5204
5425
  setError(void 0);
5205
5426
  try {
5206
5427
  await api("/tasks", { method: "POST", body: JSON.stringify({
5428
+ requirementId,
5207
5429
  title: data.get("title"),
5208
5430
  description: data.get("description"),
5209
5431
  priority: data.get("priority"),
@@ -5220,71 +5442,71 @@ function TaskForm({ companions, tasks, close, changed: changed2 }) {
5220
5442
  setBusy(false);
5221
5443
  }
5222
5444
  };
5223
- return /* @__PURE__ */ (0, import_jsx_runtime11.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) => {
5224
5446
  void submit(event);
5225
5447
  }, children: [
5226
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5227
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u4EFB\u52A1\u540D\u79F0" }),
5228
- /* @__PURE__ */ (0, import_jsx_runtime11.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" })
5229
5451
  ] }),
5230
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5231
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
5232
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("select", { name: "assignee", defaultValue: "", children: [
5233
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
5234
- companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime11.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: [
5235
5457
  "@",
5236
5458
  item.name
5237
5459
  ] }, item.id))
5238
5460
  ] })
5239
5461
  ] }),
5240
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "is-wide", children: [
5241
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
5242
- /* @__PURE__ */ (0, import_jsx_runtime11.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" })
5243
5465
  ] }),
5244
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5245
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u4F18\u5148\u7EA7" }),
5246
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("select", { name: "priority", defaultValue: "normal", children: [
5247
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "low", children: "\u4F4E" }),
5248
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "normal", children: "\u666E\u901A" }),
5249
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "high", children: "\u9AD8" }),
5250
- /* @__PURE__ */ (0, import_jsx_runtime11.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" })
5251
5473
  ] })
5252
5474
  ] }),
5253
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5254
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
5255
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("select", { name: "reviewer", defaultValue: "", children: [
5256
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
5257
- companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime11.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: [
5258
5480
  "@",
5259
5481
  item.name
5260
5482
  ] }, item.id))
5261
5483
  ] })
5262
5484
  ] }),
5263
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-partner-task-form-dependencies is-wide", children: [
5264
- /* @__PURE__ */ (0, import_jsx_runtime11.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: [
5265
5487
  "\u4F9D\u8D56\u4EFB\u52A1 ",
5266
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("small", { children: "\u53EF\u9009" })
5488
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "\u53EF\u9009" })
5267
5489
  ] }),
5268
- dependencyOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { children: dependencyOptions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5269
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { type: "checkbox", name: "dependencyTaskId", value: item.id }),
5270
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", {}),
5271
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: item.title }),
5272
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("small", { children: statusLabel(item.status) })
5273
- ] }, item.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: "\u5F53\u524D\u6CA1\u6709\u53EF\u9009\u7684\u672A\u5B8C\u6210\u4EFB\u52A1" }),
5274
- /* @__PURE__ */ (0, import_jsx_runtime11.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" })
5275
5497
  ] }),
5276
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "is-wide", children: [
5277
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u521B\u5EFA\u540E\u6267\u884C" }),
5278
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("select", { name: "submission", defaultValue: "run", children: [
5279
- /* @__PURE__ */ (0, import_jsx_runtime11.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" }),
5280
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "plan", children: "\u4EC5\u89C4\u5212\uFF0C\u7A0D\u540E\u624B\u52A8\u63D0\u4EA4" })
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" })
5281
5503
  ] })
5282
5504
  ] }),
5283
- error && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WorkspaceNotice, { children: error }),
5284
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("footer", { children: [
5285
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
5286
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
5287
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconPlusOutline16, { size: 14 }),
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 }),
5288
5510
  busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u4EFB\u52A1"
5289
5511
  ] })
5290
5512
  ] })
@@ -5321,18 +5543,152 @@ function delegationState(value, blockers = 0) {
5321
5543
  };
5322
5544
  }
5323
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
+
5324
5680
  // src/ui/schedule-panel.tsx
5325
- var import_react16 = require("react");
5326
- var import_dsh_client_ui_primitives9 = require("@deepseek-ai/dsh-client-ui-primitives");
5327
- var import_jsx_runtime12 = 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");
5328
5684
  function SchedulePanel({ companions }) {
5329
- const [schedules, setSchedules] = (0, import_react16.useState)([]);
5330
- const [runs, setRuns] = (0, import_react16.useState)([]);
5331
- const [creating, setCreating] = (0, import_react16.useState)(false);
5332
- const [busy, setBusy] = (0, import_react16.useState)();
5333
- const [loading, setLoading] = (0, import_react16.useState)(true);
5334
- const [error, setError] = (0, import_react16.useState)();
5335
- const load2 = (0, import_react16.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 () => {
5336
5692
  try {
5337
5693
  const value = await api("/schedules");
5338
5694
  setSchedules(value.schedules);
@@ -5344,7 +5700,7 @@ function SchedulePanel({ companions }) {
5344
5700
  setLoading(false);
5345
5701
  }
5346
5702
  }, []);
5347
- (0, import_react16.useEffect)(() => {
5703
+ (0, import_react19.useEffect)(() => {
5348
5704
  void load2();
5349
5705
  }, [load2]);
5350
5706
  const update = async (entry, value) => {
@@ -5380,65 +5736,65 @@ function SchedulePanel({ companions }) {
5380
5736
  setBusy(void 0);
5381
5737
  }
5382
5738
  };
5383
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-partner-feature-page", children: [
5384
- /* @__PURE__ */ (0, import_jsx_runtime12.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_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
5385
- /* @__PURE__ */ (0, import_jsx_runtime12.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: () => {
5386
5742
  void load2();
5387
5743
  }, children: [
5388
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.IconRefreshOutline16, { size: 15 }),
5744
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconRefreshOutline16, { size: 15 }),
5389
5745
  "\u5237\u65B0"
5390
5746
  ] }),
5391
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
5392
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.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 }),
5393
5749
  "\u65B0\u8BA1\u5212"
5394
5750
  ] })
5395
5751
  ] }) }),
5396
- error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(WorkspaceNotice, { children: error }),
5397
- creating && /* @__PURE__ */ (0, import_jsx_runtime12.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_runtime12.jsx)(ScheduleForm, { companions, close: () => setCreating(false), changed: load2 }) }),
5398
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(WorkspaceBlock, { title: "\u6267\u884C\u8BA1\u5212", detail: `${schedules.filter((item) => item.enabled).length} \u4E2A\u542F\u7528`, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CollectionSkeleton, { rows: 3 }) : schedules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.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_runtime12.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
5399
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.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 }),
5400
5756
  "\u521B\u5EFA\u7B2C\u4E00\u4E2A\u8BA1\u5212"
5401
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "dsh-partner-schedule-list", children: schedules.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("article", { children: [
5402
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
5403
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: entry.title }),
5404
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: entry.prompt }),
5405
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsh-partner-schedule-meta", children: [
5406
- /* @__PURE__ */ (0, import_jsx_runtime12.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: [
5407
5763
  "@",
5408
5764
  companionName(companions, entry.companionId)
5409
5765
  ] }),
5410
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("em", { children: scheduleLabel(entry) }),
5411
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("em", { children: [
5766
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("em", { children: scheduleLabel(entry) }),
5767
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("em", { children: [
5412
5768
  "\u4E0B\u6B21 ",
5413
5769
  new Date(entry.nextRunAt).toLocaleString()
5414
5770
  ] }),
5415
- /* @__PURE__ */ (0, import_jsx_runtime12.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" })
5416
5772
  ] })
5417
5773
  ] }),
5418
- /* @__PURE__ */ (0, import_jsx_runtime12.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: () => {
5419
5775
  void update(entry, { enabled: !entry.enabled });
5420
- }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", {}) }),
5421
- /* @__PURE__ */ (0, import_jsx_runtime12.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: () => {
5422
5778
  void run(entry);
5423
5779
  }, children: [
5424
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.IconPlayOutline16, { size: 14 }),
5780
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlayOutline16, { size: 14 }),
5425
5781
  busy === entry.id ? "\u6267\u884C\u4E2D\u2026" : "\u7ACB\u5373\u6267\u884C"
5426
5782
  ] }),
5427
- /* @__PURE__ */ (0, import_jsx_runtime12.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: () => {
5428
5784
  void remove(entry);
5429
- }, "aria-label": `\u5220\u9664 ${entry.title}`, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.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 }) })
5430
5786
  ] }, entry.id)) }) }),
5431
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(WorkspaceBlock, { title: "\u6700\u8FD1\u8FD0\u884C", detail: "\u4FDD\u7559\u6700\u8FD1\u7684\u72B6\u6001\u4E0E\u7ED3\u679C\u6458\u8981", children: [
5432
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "dsh-partner-run-list", children: runs.map((run2) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("article", { "data-status": run2.status, children: [
5433
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", {}),
5434
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
5435
- /* @__PURE__ */ (0, import_jsx_runtime12.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: [
5436
5792
  schedules.find((item) => item.id === run2.sourceId)?.title ?? "\u5DF2\u5220\u9664\u8BA1\u5212",
5437
5793
  " \xB7 @",
5438
5794
  companionName(companions, run2.ownerCompanionId)
5439
5795
  ] }),
5440
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: run2.error || run2.outputSummary || "\u7B49\u5F85\u7ED3\u679C" }),
5441
- /* @__PURE__ */ (0, import_jsx_runtime12.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: [
5442
5798
  new Date(run2.startedAt).toLocaleString(),
5443
5799
  " \xB7 ",
5444
5800
  run2.status,
@@ -5447,14 +5803,14 @@ function SchedulePanel({ companions }) {
5447
5803
  ] })
5448
5804
  ] })
5449
5805
  ] }, run2.id)) }),
5450
- !loading && runs.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime12.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" })
5451
5807
  ] })
5452
5808
  ] });
5453
5809
  }
5454
5810
  function ScheduleForm({ companions, close, changed: changed2 }) {
5455
- const [kind, setKind] = (0, import_react16.useState)("interval");
5456
- const [error, setError] = (0, import_react16.useState)();
5457
- const [busy, setBusy] = (0, import_react16.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);
5458
5814
  const submit = async (event) => {
5459
5815
  event.preventDefault();
5460
5816
  const data = new FormData(event.currentTarget);
@@ -5471,18 +5827,18 @@ function ScheduleForm({ companions, close, changed: changed2 }) {
5471
5827
  setBusy(false);
5472
5828
  }
5473
5829
  };
5474
- return /* @__PURE__ */ (0, import_jsx_runtime12.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) => {
5475
5831
  void submit(event);
5476
5832
  }, children: [
5477
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5478
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u8BA1\u5212\u540D\u79F0" }),
5479
- /* @__PURE__ */ (0, import_jsx_runtime12.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" })
5480
5836
  ] }),
5481
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5482
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u6267\u884C\u4F19\u4F34" }),
5483
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("select", { name: "companionId", required: true, defaultValue: companions[0]?.id ?? "", children: [
5484
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", disabled: true, children: "\u9009\u62E9\u4F19\u4F34" }),
5485
- companions.map((companion) => /* @__PURE__ */ (0, import_jsx_runtime12.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: [
5486
5842
  "@",
5487
5843
  companion.name,
5488
5844
  " \xB7 ",
@@ -5490,51 +5846,51 @@ function ScheduleForm({ companions, close, changed: changed2 }) {
5490
5846
  ] }, companion.id))
5491
5847
  ] })
5492
5848
  ] }),
5493
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "is-wide", children: [
5494
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u6267\u884C\u5185\u5BB9" }),
5495
- /* @__PURE__ */ (0, import_jsx_runtime12.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" })
5496
5852
  ] }),
5497
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5498
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u9891\u7387" }),
5499
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("select", { value: kind, onChange: (event) => setKind(event.target.value), children: [
5500
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "interval", children: "\u6BCF\u9694\u4E00\u6BB5\u65F6\u95F4" }),
5501
- /* @__PURE__ */ (0, import_jsx_runtime12.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" })
5502
5858
  ] })
5503
5859
  ] }),
5504
- kind === "interval" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5505
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u95F4\u9694\u5206\u949F" }),
5506
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { name: "minutes", type: "number", min: 5, max: 43200, defaultValue: 60 })
5507
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-partner-schedule-time", children: [
5508
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5509
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u5C0F\u65F6" }),
5510
- /* @__PURE__ */ (0, import_jsx_runtime12.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 })
5511
5867
  ] }),
5512
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5513
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u5206\u949F" }),
5514
- /* @__PURE__ */ (0, import_jsx_runtime12.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 })
5515
5871
  ] })
5516
5872
  ] }),
5517
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5518
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u91CD\u53E0\u7B56\u7565" }),
5519
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("select", { name: "overlapPolicy", defaultValue: "skip", children: [
5520
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "skip", children: "\u8DF3\u8FC7\u91CD\u53E0" }),
5521
- /* @__PURE__ */ (0, import_jsx_runtime12.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" })
5522
5878
  ] })
5523
5879
  ] }),
5524
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
5525
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "\u8D85\u65F6\u5206\u949F" }),
5526
- /* @__PURE__ */ (0, import_jsx_runtime12.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 })
5527
5883
  ] }),
5528
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "dsh-partner-check is-wide", children: [
5529
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("input", { name: "retain", type: "checkbox" }),
5530
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", {}),
5531
- /* @__PURE__ */ (0, import_jsx_runtime12.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" })
5532
5888
  ] }),
5533
- error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(WorkspaceNotice, { children: error }),
5534
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("footer", { children: [
5535
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
5536
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
5537
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.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 }),
5538
5894
  busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u8BA1\u5212"
5539
5895
  ] })
5540
5896
  ] })
@@ -5548,8 +5904,8 @@ function companionName(companions, id) {
5548
5904
  }
5549
5905
 
5550
5906
  // src/ui/capability-editor.tsx
5551
- var import_react18 = require("react");
5552
- var import_dsh_client_ui_primitives11 = 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");
5553
5909
 
5554
5910
  // src/capabilities.ts
5555
5911
  var COMPANION_CAPABILITIES = ["knowledge", "skills", "ssh", "git", "companions", "schedules", "access", "administration"];
@@ -5568,14 +5924,14 @@ function isCompanionCapability(value) {
5568
5924
  }
5569
5925
 
5570
5926
  // src/ui/companion-access-panel.tsx
5571
- var import_react17 = require("react");
5572
- var import_dsh_client_ui_primitives10 = require("@deepseek-ai/dsh-client-ui-primitives");
5573
- var import_jsx_runtime13 = 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");
5574
5930
  function CompanionAccessPanel({ companionId }) {
5575
- const [access, setAccess] = (0, import_react17.useState)({ targetIds: [], companions: [] });
5576
- const [busy, setBusy] = (0, import_react17.useState)();
5577
- const [error, setError] = (0, import_react17.useState)();
5578
- const load2 = (0, import_react17.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 () => {
5579
5935
  try {
5580
5936
  setAccess(await api(`/companions/${encodeURIComponent(companionId)}/access`));
5581
5937
  setError(void 0);
@@ -5583,7 +5939,7 @@ function CompanionAccessPanel({ companionId }) {
5583
5939
  setError(errorMessage(reason));
5584
5940
  }
5585
5941
  }, [companionId]);
5586
- (0, import_react17.useEffect)(() => {
5942
+ (0, import_react20.useEffect)(() => {
5587
5943
  void load2();
5588
5944
  }, [load2]);
5589
5945
  const toggle = async (targetId) => {
@@ -5602,38 +5958,38 @@ function CompanionAccessPanel({ companionId }) {
5602
5958
  setBusy(void 0);
5603
5959
  }
5604
5960
  };
5605
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: "dsh-partner-capability-detail dsh-partner-access", "aria-labelledby": "dsh-partner-access-title", children: [
5606
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("header", { children: [
5607
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
5608
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: "DIRECTED ACCESS" }),
5609
- /* @__PURE__ */ (0, import_jsx_runtime13.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" })
5610
5966
  ] }),
5611
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("em", { children: [
5967
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("em", { children: [
5612
5968
  access.targetIds.length,
5613
5969
  " \u4F4D\u5DF2\u6388\u6743"
5614
5970
  ] })
5615
5971
  ] }),
5616
- /* @__PURE__ */ (0, import_jsx_runtime13.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" }),
5617
- access.companions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.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_runtime13.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) => {
5618
5974
  const selected = access.targetIds.includes(companion.id);
5619
5975
  const abilities = companion.capabilities.map((capability) => isCompanionCapability(capability) ? CAPABILITY_LABELS[capability] : capability);
5620
- return /* @__PURE__ */ (0, import_jsx_runtime13.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: () => {
5621
5977
  void toggle(companion.id);
5622
5978
  }, children: [
5623
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "dsh-partner-access-avatar", "aria-hidden": "true", children: initials(companion.name) }),
5624
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "dsh-partner-access-copy", children: [
5625
- /* @__PURE__ */ (0, import_jsx_runtime13.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: [
5626
5982
  "@",
5627
5983
  companion.name
5628
5984
  ] }),
5629
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: companion.role }),
5630
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: companion.description || "\u672A\u586B\u5199\u4F19\u4F34\u8BF4\u660E" }),
5631
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: [...abilities, ...companion.enabledSkills.map((skill) => skill.name)].map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.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)) })
5632
5988
  ] }),
5633
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "dsh-partner-access-check", "aria-hidden": "true", children: selected && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives10.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 }) })
5634
5990
  ] }, companion.id);
5635
5991
  }) }),
5636
- error && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WorkspaceNotice, { children: error })
5992
+ error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WorkspaceNotice, { children: error })
5637
5993
  ] });
5638
5994
  }
5639
5995
  function initials(name) {
@@ -5646,25 +6002,25 @@ function companionDraft(companion) {
5646
6002
  }
5647
6003
 
5648
6004
  // src/ui/capability-editor.tsx
5649
- var import_jsx_runtime14 = require("react/jsx-runtime");
6005
+ var import_jsx_runtime16 = require("react/jsx-runtime");
5650
6006
  function CapabilityEditor({ companion, presets, onChanged }) {
5651
- const [form, setForm] = (0, import_react18.useState)(() => companionDraft(companion));
5652
- const [modelCatalog, setModelCatalog] = (0, import_react18.useState)();
5653
- const [saving, setSaving] = (0, import_react18.useState)(false);
5654
- const [saved, setSaved] = (0, import_react18.useState)(false);
5655
- const [error, setError] = (0, import_react18.useState)();
5656
- const savingRef = (0, import_react18.useRef)(false);
5657
- const mounted = (0, import_react18.useRef)(true);
5658
- (0, import_react18.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)(() => {
5659
6015
  mounted.current = true;
5660
6016
  return () => {
5661
6017
  mounted.current = false;
5662
6018
  };
5663
6019
  }, []);
5664
- (0, import_react18.useEffect)(() => {
6020
+ (0, import_react21.useEffect)(() => {
5665
6021
  if (!savingRef.current) setForm(companionDraft(companion));
5666
6022
  }, [companion.id, companion.updatedAt]);
5667
- (0, import_react18.useEffect)(() => {
6023
+ (0, import_react21.useEffect)(() => {
5668
6024
  void api("/models").then((value) => {
5669
6025
  if (mounted.current) setModelCatalog(value);
5670
6026
  }).catch((reason) => {
@@ -5719,69 +6075,69 @@ function CapabilityEditor({ companion, presets, onChanged }) {
5719
6075
  const selectedProvider = form.provider || modelCatalog?.defaultSelection.provider || "";
5720
6076
  const modelOptions = modelCatalog?.providers.find((item) => item.id === selectedProvider)?.models ?? [];
5721
6077
  const currentModelMissing = Boolean(form.model) && !modelOptions.some((item) => item.id === form.model);
5722
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-form is-capabilities", children: [
5723
- /* @__PURE__ */ (0, import_jsx_runtime14.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" }),
5724
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-runtime-fields", children: [
5725
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "Agent Preset", hint: "\u5DE5\u5177\u3001Skill \u4E0E\u7CFB\u7EDF\u63D0\u793A", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { disabled: saving, value: form.presetId, onChange: (event) => edit({ ...form, presetId: event.target.value }), children: [
5726
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "", children: "\u8DDF\u968F DSH \u9ED8\u8BA4 Preset" }),
5727
- presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.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))
5728
6084
  ] }) }),
5729
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u6A21\u578B\u63D0\u4F9B\u65B9", hint: "\u6765\u81EA\u5F53\u524D\u5BA2\u6237\u7AEF", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { disabled: saving, value: form.provider, onChange: (event) => edit({ ...form, provider: event.target.value, model: "" }), children: [
5730
- /* @__PURE__ */ (0, import_jsx_runtime14.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: [
5731
6087
  "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
5732
6088
  modelCatalog?.defaultSelection.provider || "\u6B63\u5728\u8BFB\u53D6"
5733
6089
  ] }),
5734
- modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime14.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))
5735
6091
  ] }) }),
5736
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u6A21\u578B", hint: "\u968F\u63D0\u4F9B\u65B9\u8054\u52A8", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { disabled: saving, value: form.model, onChange: (event) => edit({ ...form, model: event.target.value }), children: [
5737
- /* @__PURE__ */ (0, import_jsx_runtime14.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: [
5738
6094
  "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
5739
6095
  modelCatalog?.defaultSelection.model || "\u6B63\u5728\u8BFB\u53D6"
5740
6096
  ] }),
5741
- currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: form.model, children: [
6097
+ currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("option", { value: form.model, children: [
5742
6098
  "\u5F53\u524D\u914D\u7F6E \xB7 ",
5743
6099
  form.model
5744
6100
  ] }),
5745
- modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime14.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))
5746
6102
  ] }) })
5747
6103
  ] }),
5748
- /* @__PURE__ */ (0, import_jsx_runtime14.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" }),
5749
- /* @__PURE__ */ (0, import_jsx_runtime14.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) => {
5750
6106
  const enabled = group.choices.filter((choice) => form.capabilities.includes(choice.id)).length;
5751
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-capability-group", "aria-labelledby": `partner-capability-${group.id}`, children: [
5752
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
5753
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
5754
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: group.eyebrow }),
5755
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { id: `partner-capability-${group.id}`, children: group.title }),
5756
- /* @__PURE__ */ (0, import_jsx_runtime14.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 })
5757
6113
  ] }),
5758
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("em", { children: [
6114
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("em", { children: [
5759
6115
  enabled,
5760
6116
  " / ",
5761
6117
  group.choices.length,
5762
6118
  " \u5DF2\u542F\u7528"
5763
6119
  ] })
5764
6120
  ] }),
5765
- /* @__PURE__ */ (0, import_jsx_runtime14.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) => {
5766
6122
  const active = form.capabilities.includes(choice.id);
5767
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", disabled: saving, className: active ? "is-active" : "", "aria-pressed": active, onClick: () => toggle(choice.id), children: [
5768
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: active && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconCheckOutline14, { size: 14 }) }),
5769
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: choice.title }),
5770
- /* @__PURE__ */ (0, import_jsx_runtime14.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 })
5771
6127
  ] }, choice.id);
5772
6128
  }) })
5773
6129
  ] }, group.id);
5774
6130
  }) }),
5775
- form.capabilities.includes("skills") && companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CompanionSkillSettings, { companionId: companion.id }),
5776
- form.capabilities.includes("skills") && !companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime14.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" }),
5777
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CompanionAccessPanel, { companionId: companion.id }),
5778
- error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
5779
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-form-actions is-capability-save", children: [
5780
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { role: "status", "aria-live": "polite", "aria-atomic": "true", children: saved && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
5781
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconCheckOutline14, { size: 14 }),
5782
- /* @__PURE__ */ (0, import_jsx_runtime14.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" })
5783
6139
  ] }) }),
5784
- /* @__PURE__ */ (0, import_jsx_runtime14.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: () => {
5785
6141
  void save();
5786
6142
  }, children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u5E94\u7528\u80FD\u529B\u7EC4\u5408" })
5787
6143
  ] })
@@ -5789,28 +6145,28 @@ function CapabilityEditor({ companion, presets, onChanged }) {
5789
6145
  }
5790
6146
 
5791
6147
  // src/ui/identity-editor.tsx
5792
- var import_react19 = require("react");
5793
- var import_dsh_client_ui_primitives12 = require("@deepseek-ai/dsh-client-ui-primitives");
5794
- var import_jsx_runtime15 = require("react/jsx-runtime");
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");
5795
6151
  function IdentityEditor(props) {
5796
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IdentityEditorForm, { ...props }, props.companion.id);
6152
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IdentityEditorForm, { ...props }, props.companion.id);
5797
6153
  }
5798
6154
  function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
5799
- const [form, setForm] = (0, import_react19.useState)(() => companionDraft(companion));
5800
- const [operation, setOperation] = (0, import_react19.useState)();
5801
- const [saved, setSaved] = (0, import_react19.useState)(false);
5802
- const [removed, setRemoved] = (0, import_react19.useState)(false);
5803
- const [error, setError] = (0, import_react19.useState)();
5804
- const [confirmationId, setConfirmationId] = (0, import_react19.useState)();
5805
- const locked = (0, import_react19.useRef)(false);
5806
- const alive = (0, import_react19.useRef)(true);
5807
- (0, import_react19.useEffect)(() => {
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)(() => {
5808
6164
  alive.current = true;
5809
6165
  return () => {
5810
6166
  alive.current = false;
5811
6167
  };
5812
6168
  }, []);
5813
- (0, import_react19.useEffect)(() => {
6169
+ (0, import_react22.useEffect)(() => {
5814
6170
  setForm(companionDraft(companion));
5815
6171
  setSaved(false);
5816
6172
  setConfirmationId(void 0);
@@ -5857,33 +6213,33 @@ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
5857
6213
  if (alive.current) setOperation(void 0);
5858
6214
  }
5859
6215
  };
5860
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("form", { className: "dsh-partner-form is-identity", "aria-busy": operation !== void 0, onSubmit: (event) => {
6216
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("form", { className: "dsh-partner-form is-identity", "aria-busy": operation !== void 0, onSubmit: (event) => {
5861
6217
  void submit(event);
5862
6218
  }, children: [
5863
- /* @__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" }),
5864
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-fields two", children: [
5865
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { disabled: busy, required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
5866
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { disabled: busy, required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
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 }) }) })
5867
6223
  ] }),
5868
- /* @__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", { disabled: busy, rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
5869
- /* @__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", { disabled: busy, rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
5870
- error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
5871
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-form-actions", children: [
5872
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { role: "status", children: saved && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
5873
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconCheckOutline14, { size: 14 }),
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 }),
5874
6230
  "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u5C06\u4F7F\u7528\u65B0\u8EAB\u4EFD"
5875
6231
  ] }) }),
5876
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { disabled: busy, children: operation === "save" ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
6232
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { disabled: busy, children: operation === "save" ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
5877
6233
  ] }),
5878
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-identity-danger", "data-confirming": confirming, children: [
5879
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
5880
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: removed ? "\u4F19\u4F34\u5DF2\u5220\u9664" : confirming ? `\u786E\u8BA4\u5220\u9664\u300C${companion.name}\u300D\uFF1F` : "\u5220\u9664\u4F19\u4F34" }),
5881
- /* @__PURE__ */ (0, import_jsx_runtime15.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" })
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" })
5882
6238
  ] }),
5883
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
5884
- confirming && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy, className: "is-secondary", onClick: () => setConfirmationId(void 0), children: "\u53D6\u6D88" }),
5885
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: confirming ? "is-danger" : "", disabled: busy || count <= 1, onClick: () => confirming ? void remove() : setConfirmationId(companion.id), children: [
5886
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconTrashOutline16, { size: 16 }),
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 }),
5887
6243
  operation === "remove" ? "\u6B63\u5728\u5220\u9664\u2026" : removed ? "\u5DF2\u5220\u9664" : confirming ? "\u786E\u8BA4\u5220\u9664" : "\u5220\u9664"
5888
6244
  ] })
5889
6245
  ] })
@@ -5892,12 +6248,12 @@ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
5892
6248
  }
5893
6249
 
5894
6250
  // src/ui/companion-create.tsx
5895
- var import_react20 = require("react");
5896
- var import_dsh_client_ui_primitives13 = require("@deepseek-ai/dsh-client-ui-primitives");
5897
- var import_jsx_runtime16 = 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");
5898
6254
  function CompanionCreateDialog({ close, create }) {
5899
- const [busy, setBusy] = (0, import_react20.useState)(false);
5900
- const [error, setError] = (0, import_react20.useState)();
6255
+ const [busy, setBusy] = (0, import_react23.useState)(false);
6256
+ const [error, setError] = (0, import_react23.useState)();
5901
6257
  const submit = async (event) => {
5902
6258
  event.preventDefault();
5903
6259
  const data = new FormData(event.currentTarget);
@@ -5916,30 +6272,30 @@ function CompanionCreateDialog({ close, create }) {
5916
6272
  setBusy(false);
5917
6273
  }
5918
6274
  };
5919
- return /* @__PURE__ */ (0, import_jsx_runtime16.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_runtime16.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) => {
5920
6276
  void submit(event);
5921
6277
  }, children: [
5922
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { children: [
5923
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "\u4F19\u4F34\u540D\u5B57" }),
5924
- /* @__PURE__ */ (0, import_jsx_runtime16.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" })
5925
6281
  ] }),
5926
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { children: [
5927
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "\u4E3B\u8981\u89D2\u8272" }),
5928
- /* @__PURE__ */ (0, import_jsx_runtime16.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" })
5929
6285
  ] }),
5930
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "is-wide", children: [
5931
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D" }),
5932
- /* @__PURE__ */ (0, import_jsx_runtime16.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" })
5933
6289
  ] }),
5934
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "is-wide", children: [
5935
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "\u521D\u59CB\u884C\u4E3A\u51C6\u5219" }),
5936
- /* @__PURE__ */ (0, import_jsx_runtime16.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" })
5937
6293
  ] }),
5938
- error && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(WorkspaceNotice, { children: error }),
5939
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("footer", { children: [
5940
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
5941
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
5942
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_dsh_client_ui_primitives13.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 }),
5943
6299
  busy ? "\u6B63\u5728\u521B\u5EFA\u2026" : "\u521B\u5EFA\u4F19\u4F34"
5944
6300
  ] })
5945
6301
  ] })
@@ -6029,37 +6385,38 @@ function sessions(ctx) {
6029
6385
  }
6030
6386
 
6031
6387
  // src/client.tsx
6032
- var import_jsx_runtime17 = require("react/jsx-runtime");
6388
+ var import_jsx_runtime19 = require("react/jsx-runtime");
6033
6389
  var PLUGIN_ID = "@lemoncat7/dsh-partner";
6034
6390
  var STYLE_ID = `${PLUGIN_ID}/client`;
6035
6391
  var cssText = `${client_default}
6036
6392
  ${workspace_ui_default}
6037
6393
  ${companion_picker_default}
6038
6394
  ${responsive_ui_default}
6395
+ ${requirement_board_default}
6039
6396
  ${widget_default}
6040
6397
  ${settings_panel_default}`;
6041
6398
  var WORKSPACE_PAGES = /* @__PURE__ */ new Set(["skills", "board", "schedules", "pendant"]);
6042
6399
  var inject = ["slots", "layout", "sessions"];
6043
6400
  function apply(ctx) {
6044
6401
  ctx.effect(installStyles, "dsh-partner: styles");
6045
- const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PartnerWorkspace, { ...props, controller: current2 }));
6046
- ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0, import_jsx_runtime17.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 })));
6047
6404
  ctx.effect(() => observePluginWorkspace(PLUGIN_ID, controller.close), "dsh-partner: exclusive workspace");
6048
6405
  ctx.effect(() => () => controller.close(), "dsh-partner: workspace lifecycle");
6049
6406
  ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({
6050
6407
  name: "sidebar.footer.action",
6051
6408
  id: "partner",
6052
6409
  order: -120
6053
- }, (props) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
6410
+ }, (props) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
6054
6411
  }
6055
6412
  function PartnerSidebar(props) {
6056
- const ref = (0, import_react21.useRef)(null);
6413
+ const ref = (0, import_react24.useRef)(null);
6057
6414
  useWorkspaceTopAnchor(ref);
6058
- const [open, setOpen] = (0, import_react21.useState)(true);
6059
- const [snapshot, setSnapshot] = (0, import_react21.useState)();
6060
- const [, update] = (0, import_react21.useState)(0);
6061
- (0, import_react21.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
6062
- (0, import_react21.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)(() => {
6063
6420
  void loadPartner().then(setSnapshot).catch(() => {
6064
6421
  });
6065
6422
  }, [props.controller.isOpen()]);
@@ -6067,34 +6424,34 @@ function PartnerSidebar(props) {
6067
6424
  props.controller.open(id);
6068
6425
  if (props.wide && window.matchMedia("(max-width: 820px)").matches) props.collapse();
6069
6426
  };
6070
- if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.jsx)(import_dsh_client_ui_primitives14.IconAgentPresetOutline16, { size: 18 }) }) });
6071
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
6072
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
6073
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.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 }) }),
6074
6431
  "\u4F19\u4F34"
6075
6432
  ] }) }),
6076
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
6077
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconAgentPresetOutline16, { size: 16 }) }),
6078
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6079
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
6080
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6081
6438
  ] }),
6082
- /* @__PURE__ */ (0, import_jsx_runtime17.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" : "" })
6083
6440
  ] }) }) })
6084
6441
  ] });
6085
6442
  }
6086
6443
  function PartnerWorkspace({ controller }) {
6087
- const [snapshot, setSnapshot] = (0, import_react21.useState)();
6088
- const [selectedId, setSelectedId] = (0, import_react21.useState)(controller.selected());
6089
- const [view, setView] = (0, import_react21.useState)(controller.destination()?.page ?? "home");
6090
- const [requestedDestination, setRequestedDestination] = (0, import_react21.useState)(controller.destination());
6091
- const [error, setError] = (0, import_react21.useState)();
6092
- const [loading, setLoading] = (0, import_react21.useState)(true);
6093
- const [creatingCompanion, setCreatingCompanion] = (0, import_react21.useState)(false);
6094
- const [notice, setNotice] = (0, import_react21.useState)();
6095
- const selectionRef = (0, import_react21.useRef)({ selectedId, companions: snapshot?.companions });
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 });
6096
6453
  selectionRef.current = { selectedId, companions: snapshot?.companions };
6097
- const refresh = (0, import_react21.useCallback)(async (throwOnError = false) => {
6454
+ const refresh = (0, import_react24.useCallback)(async (throwOnError = false) => {
6098
6455
  try {
6099
6456
  const next = await loadPartner();
6100
6457
  setSnapshot(next);
@@ -6107,10 +6464,10 @@ function PartnerWorkspace({ controller }) {
6107
6464
  setLoading(false);
6108
6465
  }
6109
6466
  }, []);
6110
- (0, import_react21.useEffect)(() => {
6467
+ (0, import_react24.useEffect)(() => {
6111
6468
  void refresh();
6112
6469
  }, [refresh]);
6113
- (0, import_react21.useEffect)(() => controller.subscribe(() => {
6470
+ (0, import_react24.useEffect)(() => controller.subscribe(() => {
6114
6471
  const next = controller.selected();
6115
6472
  if (next) setSelectedId(next);
6116
6473
  const destination = controller.destination();
@@ -6179,18 +6536,18 @@ function PartnerWorkspace({ controller }) {
6179
6536
  setSelectedId(id);
6180
6537
  setView("home");
6181
6538
  };
6182
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("main", { className: "dsh-partner-workspace", children: [
6183
- creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
6184
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { className: "dsh-partner-topbar", children: [
6185
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
6186
- /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.jsx)(import_dsh_client_ui_primitives14.IconChevronLeftOutline14, { size: 15 }) }),
6187
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconAgentPresetOutline16, { size: 18 }),
6188
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6189
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: "\u4F19\u4F34" }),
6190
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6191
6548
  ] })
6192
6549
  ] }),
6193
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6550
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6194
6551
  MobileWorkspaceControls,
6195
6552
  {
6196
6553
  companions: snapshot?.companions ?? [],
@@ -6202,115 +6559,115 @@ function PartnerWorkspace({ controller }) {
6202
6559
  }
6203
6560
  )
6204
6561
  ] }),
6205
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-grid", children: [
6206
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("aside", { className: "dsh-partner-roster", children: [
6207
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-roster-title", children: [
6208
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6209
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "COMPANIONS" }),
6210
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6211
6568
  ] }),
6212
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.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 }) })
6213
6570
  ] }),
6214
- /* @__PURE__ */ (0, import_jsx_runtime17.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) => {
6215
6572
  const channel = snapshot.channels.find((item) => item.companionId === companion.id);
6216
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
6217
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { name: companion.name }),
6218
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6219
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: companion.name }),
6220
- /* @__PURE__ */ (0, import_jsx_runtime17.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 })
6221
6578
  ] }),
6222
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6223
6580
  ] }, companion.id);
6224
6581
  }) }),
6225
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: [
6226
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-current": view === "skills" ? "page" : void 0, onClick: () => setView("skills"), children: [
6227
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconBrowseOutline16, { size: 16 }) }),
6228
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: "Skill \u5E02\u573A" }),
6229
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6230
6587
  ] }),
6231
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-current": view === "board" ? "page" : void 0, onClick: () => setView("board"), children: [
6232
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconListPenOutline16, { size: 16 }) }),
6233
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: "\u4EFB\u52A1\u770B\u677F" }),
6234
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6235
6592
  ] }),
6236
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-current": view === "schedules" ? "page" : void 0, onClick: () => setView("schedules"), children: [
6237
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconPlayOutline16, { size: 16 }) }),
6238
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: "\u5B9A\u65F6\u4EFB\u52A1" }),
6239
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6240
6597
  ] }),
6241
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-current": view === "pendant" ? "page" : void 0, onClick: () => setView("pendant"), children: [
6242
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconEditOutline16, { size: 16 }) }),
6243
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: "\u5361\u7247\u8BBE\u7F6E" }),
6244
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6245
6602
  ] })
6246
6603
  ] }),
6247
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-roster-note", children: [
6248
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconLinkOutline16, { size: 16 }),
6249
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6250
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
6251
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6252
6609
  ] })
6253
6610
  ] })
6254
6611
  ] }),
6255
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
6256
- loading ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
6257
- view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SkillsPanel, {}),
6258
- view === "board" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TaskBoardPanel, { initialTaskId: requestedDestination?.taskId, openRequest: requestedDestination }),
6259
- view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] }),
6260
- view === "pendant" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PendantSettingsPanel, {})
6261
- ] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
6262
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-identity", children: [
6263
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { name: selected.name }),
6264
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6265
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "ACTIVE COMPANION" }),
6266
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h1", { children: selected.name }),
6267
- /* @__PURE__ */ (0, import_jsx_runtime17.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 })
6268
6625
  ] }),
6269
- /* @__PURE__ */ (0, import_jsx_runtime17.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) })
6270
6627
  ] }),
6271
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
6272
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconAgentPresetOutline16, { size: 16 }), children: "\u603B\u89C8" }),
6273
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconEditOutline16, { size: 16 }), children: "\u8EAB\u4EFD" }),
6274
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconAgentPresetOutline16, { size: 16 }), children: "\u80FD\u529B" }),
6275
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(WeixinGlyph, {}), children: "\u5FAE\u4FE1" }),
6276
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.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" })
6277
6634
  ] }),
6278
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
6279
- notice && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "dsh-partner-inline-notice", role: "status", children: notice }),
6280
- view === "home" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession }),
6281
- view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IdentityEditor, { companion: selected, count: snapshot?.companions.length ?? 1, onChanged: () => refresh(true), onRemoved: companionRemoved }),
6282
- view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: () => refresh(true) }, selected.id),
6283
- view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }),
6284
- view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime17.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 })
6285
6642
  ] })
6286
6643
  ] }),
6287
- error && /* @__PURE__ */ (0, import_jsx_runtime17.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 })
6288
6645
  ] })
6289
6646
  ] })
6290
6647
  ] });
6291
6648
  }
6292
6649
  function MobileWorkspaceControls({ companions, selectedId, view, openCompanion, openPage, createCompanion }) {
6293
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
6294
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
6295
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
6296
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.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 }) })
6297
6654
  ] }),
6298
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: [
6299
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-pressed": view === "skills", onClick: () => openPage("skills"), children: [
6300
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconBrowseOutline16, { size: 16 }),
6301
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6302
6659
  ] }),
6303
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-pressed": view === "board", onClick: () => openPage("board"), children: [
6304
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconListPenOutline16, { size: 16 }),
6305
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6306
6663
  ] }),
6307
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-pressed": view === "schedules", onClick: () => openPage("schedules"), children: [
6308
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconPlayOutline16, { size: 16 }),
6309
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6310
6667
  ] }),
6311
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-pressed": view === "pendant", onClick: () => openPage("pendant"), children: [
6312
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconEditOutline16, { size: 16 }),
6313
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6314
6671
  ] })
6315
6672
  ] })
6316
6673
  ] });
@@ -6323,76 +6680,76 @@ function HomePanel({ companion, snapshot, navigate, openSession, startSession, r
6323
6680
  const approved = channel ? snapshot.pairings.filter((item) => item.channelId === channel.id && item.status === "approved").length : 0;
6324
6681
  const capabilities = companion.capabilities.map((item) => CAPABILITY_LABELS[item]);
6325
6682
  const online = channel?.runtimeStatus === "running";
6326
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-home", children: [
6327
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { className: "dsh-partner-home-heading", children: [
6328
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6329
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
6330
- /* @__PURE__ */ (0, import_jsx_runtime17.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` })
6331
6688
  ] }),
6332
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6333
6690
  ] }),
6334
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
6335
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
6336
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Avatar, { name: companion.name }),
6337
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", {}) }),
6338
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime17.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 }) })
6339
6696
  ] }),
6340
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
6341
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
6342
- /* @__PURE__ */ (0, import_jsx_runtime17.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", {}),
6343
6700
  "\u4E3B\u8981\u6E20\u9053 \xB7 \u5FAE\u4FE1"
6344
6701
  ] }),
6345
- /* @__PURE__ */ (0, import_jsx_runtime17.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" }),
6346
- /* @__PURE__ */ (0, import_jsx_runtime17.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" }),
6347
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
6348
- /* @__PURE__ */ (0, import_jsx_runtime17.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" }),
6349
- /* @__PURE__ */ (0, import_jsx_runtime17.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` })
6350
6707
  ] })
6351
6708
  ] })
6352
6709
  ] }),
6353
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-home-details", children: [
6354
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: "dsh-partner-home-profile", children: [
6355
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { children: [
6356
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconUserOutline16, { size: 16 }) }),
6357
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
6358
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
6359
- /* @__PURE__ */ (0, import_jsx_runtime17.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 })
6360
6717
  ] }),
6361
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6362
6719
  ] }),
6363
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6364
6721
  ] }),
6365
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
6366
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { children: [
6367
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconAgentPresetOutline16, { size: 16 }) }),
6368
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
6369
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
6370
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6371
6728
  ] }),
6372
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6373
6730
  ] }),
6374
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime17.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" }) })
6375
6732
  ] }),
6376
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
6377
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { children: [
6378
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconDataOutline16, { size: 16 }) }),
6379
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
6380
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
6381
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6382
6739
  ] }),
6383
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6384
6741
  ] }),
6385
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
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" })
6386
6743
  ] })
6387
6744
  ] })
6388
6745
  ] });
6389
6746
  }
6390
6747
  function WeixinPanel({ companion, snapshot, onChanged }) {
6391
6748
  const channel = snapshot.channels.find((item) => item.companionId === companion.id);
6392
- const [login, setLogin] = (0, import_react21.useState)();
6393
- const [busy, setBusy] = (0, import_react21.useState)(false);
6394
- const [error, setError] = (0, import_react21.useState)();
6395
- (0, import_react21.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)(() => {
6396
6753
  if (!login || login.phase === "confirmed" || login.phase === "expired" || login.phase === "error") return;
6397
6754
  const timer = window.setInterval(() => {
6398
6755
  void api(`/weixin/login/${login.id}`).then(async (result) => {
@@ -6438,93 +6795,93 @@ function WeixinPanel({ companion, snapshot, onChanged }) {
6438
6795
  setError(errorMessage(reason));
6439
6796
  }
6440
6797
  };
6441
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
6442
- /* @__PURE__ */ (0, import_jsx_runtime17.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" }),
6443
- !channel && !login && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
6444
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(WeixinGlyph, { large: true }) }),
6445
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6446
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
6447
6804
  "\u628A ",
6448
6805
  companion.name,
6449
6806
  " \u5E26\u5230\u5FAE\u4FE1"
6450
6807
  ] }),
6451
- /* @__PURE__ */ (0, import_jsx_runtime17.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" }),
6452
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("ul", { children: [
6453
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
6454
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
6455
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6456
6813
  ] })
6457
6814
  ] }),
6458
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", disabled: busy, onClick: () => {
6815
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", disabled: busy, onClick: () => {
6459
6816
  void begin();
6460
6817
  }, children: busy ? "\u6B63\u5728\u7533\u8BF7\u4E8C\u7EF4\u7801\u2026" : "\u626B\u7801\u8FDE\u63A5\u5FAE\u4FE1" })
6461
6818
  ] }),
6462
- login && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
6463
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
6464
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6465
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "WECHAT ILINK BOT" }),
6466
- /* @__PURE__ */ (0, import_jsx_runtime17.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" }),
6467
- /* @__PURE__ */ (0, import_jsx_runtime17.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") }),
6468
- (login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime17.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: () => {
6469
6826
  setLogin(void 0);
6470
6827
  void begin();
6471
6828
  }, children: [
6472
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconRefreshOutline16, { size: 16 }),
6829
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconRefreshOutline16, { size: 16 }),
6473
6830
  "\u91CD\u65B0\u751F\u6210"
6474
6831
  ] })
6475
6832
  ] })
6476
6833
  ] }),
6477
- channel && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
6478
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
6479
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(WeixinGlyph, { large: true }) }),
6480
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6481
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "WECHAT CHANNEL" }),
6482
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: channel.name }),
6483
- /* @__PURE__ */ (0, import_jsx_runtime17.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 })
6484
6841
  ] }),
6485
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChannelStatus, { channel }),
6486
- /* @__PURE__ */ (0, import_jsx_runtime17.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: () => {
6487
6844
  void toggle();
6488
- }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", {}) })
6845
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", {}) })
6489
6846
  ] }),
6490
- channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "dsh-partner-inline-error", children: channel.lastError }),
6491
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
6492
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6493
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "ACCESS" }),
6494
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6495
6852
  ] }),
6496
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("em", { children: [
6853
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("em", { children: [
6497
6854
  pairings.filter((item) => item.status === "pending").length,
6498
6855
  " \u4E2A\u5F85\u5904\u7406"
6499
6856
  ] })
6500
6857
  ] }),
6501
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.jsxs)("article", { children: [
6502
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconUserOutline16, { size: 16 }) }),
6503
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
6504
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: pairing.displayName }),
6505
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
6506
6863
  pairing.status === "pending" ? "\u7B49\u5F85\u5BA1\u6279" : pairing.status === "approved" ? "\u5DF2\u6388\u6743\u72EC\u7ACB\u4F1A\u8BDD" : "\u5DF2\u963B\u6B62",
6507
6864
  " \xB7 ",
6508
6865
  new Date(pairing.updatedAt).toLocaleString()
6509
6866
  ] })
6510
6867
  ] }),
6511
- pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
6512
- /* @__PURE__ */ (0, import_jsx_runtime17.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: () => {
6513
6870
  void actPairing(pairing.id, "blocked");
6514
6871
  }, children: "\u62D2\u7EDD" }),
6515
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { className: "is-primary", onClick: () => {
6872
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { className: "is-primary", onClick: () => {
6516
6873
  void actPairing(pairing.id, "approved");
6517
6874
  }, children: "\u6279\u51C6" })
6518
6875
  ] }),
6519
- pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { onClick: () => {
6876
+ pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { onClick: () => {
6520
6877
  void actPairing(pairing.id, "blocked");
6521
6878
  }, children: "\u64A4\u9500" }),
6522
- pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { onClick: () => {
6879
+ pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { onClick: () => {
6523
6880
  void actPairing(pairing.id, "approved");
6524
6881
  }, children: "\u91CD\u65B0\u6279\u51C6" })
6525
6882
  ] }, pairing.id)) })
6526
6883
  ] }),
6527
- error && /* @__PURE__ */ (0, import_jsx_runtime17.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 })
6528
6885
  ] });
6529
6886
  }
6530
6887
  function MemoryPanel({ companion, snapshot, openSession, startSession, renewSession, onChanged }) {
@@ -6532,19 +6889,19 @@ function MemoryPanel({ companion, snapshot, openSession, startSession, renewSess
6532
6889
  const localSession = sessions2.find((item) => item.kind === "local");
6533
6890
  const channelSessionCount = sessions2.filter((item) => item.kind === "channel").length;
6534
6891
  const heartbeat = snapshot.heartbeatStates.find((item) => item.companionId === companion.id);
6535
- const [automation, setAutomation] = (0, import_react21.useState)(() => structuredClone(companion.automation));
6536
- const [memories, setMemories] = (0, import_react21.useState)([]);
6537
- const [reflections, setReflections] = (0, import_react21.useState)([]);
6538
- const [profiles, setProfiles] = (0, import_react21.useState)([]);
6539
- const [concernActivity, setConcernActivity] = (0, import_react21.useState)({ concerns: [], observations: [] });
6540
- const [newConcern, setNewConcern] = (0, import_react21.useState)("");
6541
- const [memoryRevision, setMemoryRevision] = (0, import_react21.useState)(0);
6542
- const [editing, setEditing] = (0, import_react21.useState)();
6543
- const [busy, setBusy] = (0, import_react21.useState)(false);
6544
- const [notice, setNotice] = (0, import_react21.useState)();
6545
- const [error, setError] = (0, import_react21.useState)();
6546
- const [modelCatalog, setModelCatalog] = (0, import_react21.useState)();
6547
- const loadMemory = (0, import_react21.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 () => {
6548
6905
  const [result, activity] = await Promise.all([api(`/companions/${companion.id}/memory`), api(`/companions/${companion.id}/concerns`)]);
6549
6906
  setMemories(result.memories);
6550
6907
  setReflections(result.reflections);
@@ -6552,11 +6909,11 @@ function MemoryPanel({ companion, snapshot, openSession, startSession, renewSess
6552
6909
  setConcernActivity(activity);
6553
6910
  setMemoryRevision((value) => value + 1);
6554
6911
  }, [companion.id]);
6555
- (0, import_react21.useEffect)(() => {
6912
+ (0, import_react24.useEffect)(() => {
6556
6913
  setAutomation(structuredClone(companion.automation));
6557
6914
  void loadMemory().catch((reason) => setError(errorMessage(reason)));
6558
6915
  }, [companion.id, companion.updatedAt, loadMemory]);
6559
- (0, import_react21.useEffect)(() => {
6916
+ (0, import_react24.useEffect)(() => {
6560
6917
  void api("/models").then(setModelCatalog).catch((reason) => setError(errorMessage(reason)));
6561
6918
  }, []);
6562
6919
  const inheritedProvider = companion.provider || modelCatalog?.defaultSelection.provider || "";
@@ -6666,157 +7023,157 @@ function MemoryPanel({ companion, snapshot, openSession, startSession, renewSess
6666
7023
  setBusy(false);
6667
7024
  }
6668
7025
  };
6669
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-form is-memory", children: [
6670
- /* @__PURE__ */ (0, import_jsx_runtime17.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" }),
6671
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-metrics", children: [
6672
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("article", { children: [
6673
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "\u4F19\u4F34\u4F1A\u8BDD" }),
6674
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: sessions2.length }),
6675
- /* @__PURE__ */ (0, import_jsx_runtime17.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` })
6676
7033
  ] }),
6677
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("article", { children: [
6678
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "\u957F\u671F\u8BB0\u5FC6" }),
6679
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: memories.filter((item) => item.status === "active").length }),
6680
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
6681
7038
  reflections.length,
6682
7039
  " \u7BC7\u6BCF\u65E5\u56DE\u987E"
6683
7040
  ] })
6684
7041
  ] }),
6685
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("article", { children: [
6686
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "\u6700\u8FD1\u5FC3\u8DF3" }),
6687
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: heartbeat?.lastCheckedAt ? relativeTime(heartbeat.lastCheckedAt) : "\u5C1A\u672A" }),
6688
- /* @__PURE__ */ (0, import_jsx_runtime17.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` })
6689
7046
  ] })
6690
7047
  ] }),
6691
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-automation-grid", children: [
6692
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: "dsh-partner-automation", children: [
6693
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { children: [
6694
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6695
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: "\u5B66\u4E60\u4E0E\u957F\u671F\u8BB0\u5FC6" }),
6696
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6697
7054
  ] }),
6698
- /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.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", {}) })
6699
7056
  ] }),
6700
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-automation-fields is-memory-model", children: [
6701
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormField, { label: "\u4FDD\u7559\u671F\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("select", { value: automation.memory.retentionDays, onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, retentionDays: Number(event.target.value) } })), children: [
6702
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: 0, children: "\u6C38\u4E45\u4FDD\u7559" }),
6703
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: 30, children: "30 \u5929" }),
6704
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: 90, children: "90 \u5929" }),
6705
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: 180, children: "180 \u5929" }),
6706
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: 365, children: "1 \u5E74" }),
6707
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6708
7065
  ] }) }),
6709
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormField, { label: "\u63D0\u70BC Provider", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("select", { value: automation.memory.provider ?? "", onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, provider: event.target.value, model: "" } })), children: [
6710
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
6711
7068
  "\u8DDF\u968F\u4F19\u4F34 \xB7 ",
6712
7069
  inheritedProvider || "DSH \u9ED8\u8BA4"
6713
7070
  ] }),
6714
- modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime17.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))
6715
7072
  ] }) }),
6716
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormField, { label: "\u63D0\u70BC\u6A21\u578B", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("select", { value: automation.memory.model ?? "", onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, model: event.target.value } })), children: [
6717
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
6718
7075
  "\u8DDF\u968F\u4F19\u4F34 \xB7 ",
6719
7076
  companion.model || modelCatalog?.defaultSelection.model || "DSH \u9ED8\u8BA4"
6720
7077
  ] }),
6721
- modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime17.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))
6722
7079
  ] }) })
6723
7080
  ] }),
6724
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-review-policy", children: [
6725
- /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.jsx)("i", {}) }),
6726
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6727
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: "\u6BCF\u65E5\u7EC8\u5BA1" }),
6728
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6729
7086
  ] }),
6730
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("label", { children: /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.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: [
6731
7088
  String(hour).padStart(2, "0"),
6732
7089
  ":00"
6733
7090
  ] }, hour)) }) }),
6734
- /* @__PURE__ */ (0, import_jsx_runtime17.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: () => {
6735
7092
  void review();
6736
7093
  }, children: "\u7ACB\u5373\u7EC8\u5BA1" })
6737
7094
  ] })
6738
7095
  ] }),
6739
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: "dsh-partner-automation", children: [
6740
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { children: [
6741
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6742
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: "\u6301\u7EED\u611F\u77E5" }),
6743
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6744
7101
  ] }),
6745
- /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.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", {}) })
6746
7103
  ] }),
6747
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-automation-fields is-heartbeat", children: [
6748
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormField, { label: "\u68C0\u67E5\u95F4\u9694", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("select", { value: automation.heartbeat.intervalMinutes, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, intervalMinutes: Number(event.target.value) } })), children: [
6749
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: 30, children: "30 \u5206\u949F" }),
6750
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: 60, children: "1 \u5C0F\u65F6" }),
6751
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: 180, children: "3 \u5C0F\u65F6" }),
6752
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: 360, children: "6 \u5C0F\u65F6" }),
6753
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: 720, children: "12 \u5C0F\u65F6" }),
6754
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6755
7112
  ] }) }),
6756
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormField, { label: "\u514D\u6253\u6270\u5F00\u59CB", children: /* @__PURE__ */ (0, import_jsx_runtime17.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) } })) }) }),
6757
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormField, { label: "\u514D\u6253\u6270\u7ED3\u675F", children: /* @__PURE__ */ (0, import_jsx_runtime17.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) } })) }) }),
6758
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormField, { label: "\u6BCF\u65E5\u4E0A\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("select", { value: automation.heartbeat.dailyLimit, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, dailyLimit: Number(event.target.value) } })), children: [
6759
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: 0, children: "\u4E0D\u9650" }),
6760
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: 1, children: "1 \u6B21" }),
6761
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: 2, children: "2 \u6B21" }),
6762
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: 3, children: "3 \u6B21" }),
6763
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: 5, children: "5 \u6B21" }),
6764
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6765
7122
  ] }) })
6766
7123
  ] }),
6767
- /* @__PURE__ */ (0, import_jsx_runtime17.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: () => {
6768
7125
  void addConcern();
6769
7126
  }, onCheck: (item) => {
6770
7127
  void trigger(item.id);
6771
7128
  }, onAct: (item, action) => {
6772
7129
  void actConcern(item, action);
6773
7130
  } }),
6774
- heartbeat?.lastError && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "dsh-partner-inline-error", children: heartbeat.lastError }),
6775
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-automation-actions", children: [
6776
- /* @__PURE__ */ (0, import_jsx_runtime17.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: () => {
6777
7134
  void trigger();
6778
7135
  }, children: "\u68C0\u67E5\u5230\u671F\u9879" }),
6779
- /* @__PURE__ */ (0, import_jsx_runtime17.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: () => {
6780
7137
  void save();
6781
7138
  }, children: busy ? "\u6B63\u5728\u5904\u7406\u2026" : "\u4FDD\u5B58\u8BBE\u7F6E" })
6782
7139
  ] })
6783
7140
  ] })
6784
7141
  ] }),
6785
- notice && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { className: "dsh-partner-inline-notice", children: [
6786
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.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 }),
6787
7144
  notice
6788
7145
  ] }),
6789
- error && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
6790
- /* @__PURE__ */ (0, import_jsx_runtime17.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: () => {
6791
7148
  void saveMemory();
6792
7149
  }, remove: (item) => {
6793
7150
  void deleteMemory(item);
6794
7151
  } }),
6795
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-section-heading", children: [
6796
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6797
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "SESSIONS" }),
6798
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6799
7156
  ] }),
6800
- localSession === void 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", onClick: () => {
7157
+ localSession === void 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", onClick: () => {
6801
7158
  void startSession(companion.id);
6802
7159
  }, children: [
6803
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconPlusOutline16, { size: 14 }),
7160
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconPlusOutline16, { size: 14 }),
6804
7161
  "\u5F00\u59CB\u672C\u5730\u5BF9\u8BDD"
6805
7162
  ] })
6806
7163
  ] }),
6807
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-session-list", children: [
6808
- sessions2.map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("article", { "data-archived": item.archived, "data-kind": item.kind, children: [
6809
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconDataOutline16, { size: 16 }) }),
6810
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
6811
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: item.kind === "local" ? "\u672C\u5730\u4F19\u4F34\u4F1A\u8BDD" : `\u5FAE\u4FE1\u8054\u7CFB\u4EBA \xB7 ${item.userId.slice(-6)}` }),
6812
- /* @__PURE__ */ (0, import_jsx_runtime17.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()}` })
6813
7170
  ] }),
6814
- /* @__PURE__ */ (0, import_jsx_runtime17.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: () => {
6815
7172
  if (item.archived) void renewSession(item.id);
6816
7173
  else void openSession(item.id, item.sessionId);
6817
7174
  }, children: item.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
6818
7175
  ] }, item.id)),
6819
- sessions2.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.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: () => {
6820
7177
  void startSession(companion.id);
6821
7178
  }, children: "\u5F00\u59CB\u5BF9\u8BDD" }), compact: true })
6822
7179
  ] })
@@ -6827,19 +7184,19 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
6827
7184
  const active = visible.filter((item) => item.state !== "resolved");
6828
7185
  const resolved = visible.filter((item) => item.state === "resolved");
6829
7186
  const latest = new Map([...activity.observations].reverse().map((item) => [item.concernId, item]));
6830
- const [composing, setComposing] = (0, import_react21.useState)(false);
6831
- const [expandedId, setExpandedId] = (0, import_react21.useState)();
6832
- const [visibleCount, setVisibleCount] = (0, import_react21.useState)(5);
6833
- const [mention, setMention] = (0, import_react21.useState)();
6834
- const [sources, setSources] = (0, import_react21.useState)([]);
6835
- const [sourcesLoading, setSourcesLoading] = (0, import_react21.useState)(false);
6836
- const [sourceError, setSourceError] = (0, import_react21.useState)();
6837
- const [activeSource, setActiveSource] = (0, import_react21.useState)(0);
6838
- const inputRef = (0, import_react21.useRef)(null);
6839
- const listboxId = (0, import_react21.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)();
6840
7197
  const shown = active.slice(0, visibleCount);
6841
7198
  const suggestionsOpen = composing && mention !== void 0;
6842
- (0, import_react21.useEffect)(() => {
7199
+ (0, import_react24.useEffect)(() => {
6843
7200
  if (!suggestionsOpen || mention === void 0) {
6844
7201
  setSources([]);
6845
7202
  setSourcesLoading(false);
@@ -6888,25 +7245,25 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
6888
7245
  inputRef.current?.setSelectionRange(cursor, cursor);
6889
7246
  });
6890
7247
  };
6891
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: "dsh-partner-concern-board", "aria-labelledby": "partner-concerns-title", children: [
6892
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { children: [
6893
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
6894
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
6895
7252
  "\u4F19\u4F34\u5728\u610F\u7684\u4E8B ",
6896
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: active.length })
7253
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: active.length })
6897
7254
  ] }),
6898
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6899
7256
  ] }),
6900
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", "aria-expanded": composing, onClick: () => setComposing((current2) => !current2), children: [
6901
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.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 }),
6902
7259
  "\u4EA4\u4EE3\u4E00\u4EF6\u4E8B"
6903
7260
  ] })
6904
7261
  ] }),
6905
- composing && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("form", { className: "dsh-partner-concern-compose", onSubmit: submit, children: [
6906
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("label", { children: [
6907
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "\u9700\u8981\u7559\u610F\u7684\u4E8B" }),
6908
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-concern-input-wrap", children: [
6909
- /* @__PURE__ */ (0, import_jsx_runtime17.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)(
6910
7267
  "input",
6911
7268
  {
6912
7269
  ref: inputRef,
@@ -6942,10 +7299,10 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
6942
7299
  }
6943
7300
  }
6944
7301
  ),
6945
- suggestionsOpen && /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.jsx)("p", { role: "status", children: "\u6B63\u5728\u67E5\u627E\u53EF\u5F15\u7528\u5185\u5BB9\u2026" }) : sourceError ? /* @__PURE__ */ (0, import_jsx_runtime17.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: [
6946
7303
  "\u5019\u9009\u52A0\u8F7D\u5931\u8D25\uFF1A",
6947
7304
  sourceError
6948
- ] }) : sources.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.jsx)(import_jsx_runtime17.Fragment, { children: sources.map((source, index) => /* @__PURE__ */ (0, import_jsx_runtime17.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)(
6949
7306
  "button",
6950
7307
  {
6951
7308
  type: "button",
@@ -6957,97 +7314,97 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
6957
7314
  onMouseEnter: () => setActiveSource(index),
6958
7315
  onClick: () => chooseSource(source),
6959
7316
  children: [
6960
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: source.kind === "file" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconDataOutline16, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconLinkOutline16, { size: 15 }) }),
6961
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: source.label }),
6962
- /* @__PURE__ */ (0, import_jsx_runtime17.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 })
6963
7320
  ]
6964
7321
  },
6965
7322
  `${source.kind}:${source.token}`
6966
7323
  )) }) })
6967
7324
  ] }),
6968
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { className: "dsh-partner-concern-compose-hint", children: [
7325
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { className: "dsh-partner-concern-compose-hint", children: [
6969
7326
  "\u8F93\u5165 ",
6970
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: "@" }),
7327
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: "@" }),
6971
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"
6972
7329
  ] })
6973
7330
  ] }),
6974
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
6975
- /* @__PURE__ */ (0, import_jsx_runtime17.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: () => {
6976
7333
  setComposing(false);
6977
7334
  setMention(void 0);
6978
7335
  onValue("");
6979
7336
  }, children: "\u53D6\u6D88" }),
6980
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
6981
7338
  ] })
6982
7339
  ] }),
6983
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-concern-list", role: "list", children: active.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.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) => {
6984
7341
  const observation = latest.get(item.id);
6985
7342
  const expanded = expandedId === item.id;
6986
7343
  const status = observation ? concernObservationStatus(observation) : item.state === "active" ? "\u6B63\u5728\u7559\u610F" : "\u6682\u65F6\u8BB0\u7740";
6987
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("article", { role: "listitem", "data-state": item.state, "data-expanded": expanded, children: [
6988
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: "dsh-partner-concern-row", "aria-expanded": expanded, onClick: () => setExpandedId((current2) => current2 === item.id ? void 0 : item.id), children: [
6989
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "dsh-partner-concern-state", children: [
6990
- /* @__PURE__ */ (0, import_jsx_runtime17.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", {}),
6991
7348
  status
6992
7349
  ] }),
6993
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "dsh-partner-concern-copy", children: [
6994
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: item.subject }),
6995
- /* @__PURE__ */ (0, import_jsx_runtime17.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 })
6996
7353
  ] }),
6997
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "dsh-partner-concern-time", title: `\u8BA1\u5212\u4E8E ${new Date(item.nextCheckAt).toLocaleString()} \u518D\u6B21\u7559\u610F`, children: [
6998
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "\u4E0B\u6B21\u7559\u610F" }),
6999
- /* @__PURE__ */ (0, import_jsx_runtime17.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) })
7000
7357
  ] }),
7001
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconChevronDownOutline14, { size: 14 })
7358
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives16.IconChevronDownOutline14, { size: 14 })
7002
7359
  ] }),
7003
- expanded && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-concern-detail", children: [
7004
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: item.reason }),
7005
- observation && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
7006
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("blockquote", { children: observation.event }),
7007
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-concern-decision", "data-decision": observation.decision, children: [
7008
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: concernObservationStatus(observation) }),
7009
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: observation.decisionReason || concernObservationExplanation(observation) }),
7010
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7011
7368
  "\u6253\u6270\u5206\u6570 ",
7012
7369
  Math.round(observation.interruptScore * 100),
7013
7370
  observation.notificationRuleEffect !== "auto" && observation.notificationRuleReason ? ` \xB7 \u77E5\u8BC6\u89C4\u5219\uFF1A${observation.notificationRuleReason}` : ""
7014
7371
  ] })
7015
7372
  ] })
7016
7373
  ] }),
7017
- item.resources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-concern-resources", children: item.resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7018
7375
  resource.kind === "file" ? "\u6587\u4EF6" : "\u77E5\u8BC6",
7019
7376
  " \xB7 ",
7020
7377
  resource.label
7021
7378
  ] }, `${resource.kind}:${resource.locator}`)) }),
7022
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
7379
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
7023
7380
  item.origin === "explicit" ? "\u4F60\u660E\u786E\u4EA4\u4EE3" : "\u4F19\u4F34\u4ECE\u5BF9\u8BDD\u4E2D\u6CE8\u610F\u5230",
7024
7381
  " \xB7 ",
7025
7382
  watchKindLabel(item.watchKind)
7026
7383
  ] }),
7027
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-concern-actions", "aria-label": `${item.subject} \u7684\u64CD\u4F5C`, children: [
7028
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", disabled: busy, onClick: () => onCheck(item), children: "\u7ACB\u5373\u68C0\u67E5\u8FD9\u6761" }),
7029
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u7EE7\u7EED\u7559\u610F" }),
7030
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "prioritize"), children: "\u63D0\u9AD8\u5173\u6CE8" }),
7031
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "resolve"), children: "\u5DF2\u7ECF\u89E3\u51B3" }),
7032
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
7033
7390
  ] })
7034
7391
  ] })
7035
7392
  ] }, item.id);
7036
7393
  }) }),
7037
- (active.length > shown.length || visibleCount > 5) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-concern-more", children: active.length > shown.length ? /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7038
7395
  "\u518D\u663E\u793A ",
7039
7396
  Math.min(20, active.length - shown.length),
7040
7397
  " \u6761"
7041
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: () => setVisibleCount(5), children: "\u6536\u8D77\u5217\u8868" }) }),
7042
- resolved.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("details", { className: "dsh-partner-concern-resolved", children: [
7043
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7044
7401
  "\u5DF2\u7ECF\u89E3\u51B3 ",
7045
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: resolved.length })
7402
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: resolved.length })
7046
7403
  ] }),
7047
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { children: resolved.slice(0, 30).map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("article", { children: [
7048
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconCheckOutline14, { size: 13 }) }),
7049
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: item.subject }),
7050
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
7051
7408
  ] }, item.id)) })
7052
7409
  ] })
7053
7410
  ] });
@@ -7073,23 +7430,23 @@ function watchKindLabel(value) {
7073
7430
  }
7074
7431
  var MEMORY_KINDS = ["all", "preference", "task", "event", "relationship", "emotion"];
7075
7432
  function MemoryLibrary({ companionId, revision, profiles, memories, reflections, editing, busy, setEditing, save, remove }) {
7076
- const activeMemories = (0, import_react21.useMemo)(() => memories.filter((item) => item.status === "active" && item.kind !== "profile"), [memories]);
7077
- const profileMemories = (0, import_react21.useMemo)(() => memories.filter((item) => item.status === "active" && item.kind === "profile"), [memories]);
7078
- const [mode, setMode] = (0, import_react21.useState)("profile");
7079
- const [kind, setKind] = (0, import_react21.useState)("all");
7080
- const [query, setQuery] = (0, import_react21.useState)("");
7081
- const [selectedMemoryId, setSelectedMemoryId] = (0, import_react21.useState)();
7082
- const [selectedDate, setSelectedDate] = (0, import_react21.useState)();
7083
- const [graph, setGraph] = (0, import_react21.useState)();
7084
- const [graphLoading, setGraphLoading] = (0, import_react21.useState)(false);
7085
- const [graphError, setGraphError] = (0, import_react21.useState)();
7086
- const [graphRequest, setGraphRequest] = (0, import_react21.useState)(0);
7087
- (0, import_react21.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)(() => {
7088
7445
  setGraph(void 0);
7089
7446
  setGraphError(void 0);
7090
7447
  setGraphLoading(false);
7091
7448
  }, [companionId, revision]);
7092
- (0, import_react21.useEffect)(() => {
7449
+ (0, import_react24.useEffect)(() => {
7093
7450
  if (mode !== "graph" || graph !== void 0) return;
7094
7451
  const controller = new AbortController();
7095
7452
  setGraphLoading(true);
@@ -7104,75 +7461,75 @@ function MemoryLibrary({ companionId, revision, profiles, memories, reflections,
7104
7461
  return () => controller.abort();
7105
7462
  }, [companionId, graph, graphRequest, mode, revision]);
7106
7463
  const normalized = query.trim().toLocaleLowerCase();
7107
- const filteredMemories = (0, import_react21.useMemo)(() => activeMemories.filter(
7464
+ const filteredMemories = (0, import_react24.useMemo)(() => activeMemories.filter(
7108
7465
  (item) => (kind === "all" || item.kind === kind) && (!normalized || `${item.subject} ${item.content}`.toLocaleLowerCase().includes(normalized))
7109
7466
  ), [activeMemories, kind, normalized]);
7110
- const filteredReflections = (0, import_react21.useMemo)(() => reflections.filter(
7467
+ const filteredReflections = (0, import_react24.useMemo)(() => reflections.filter(
7111
7468
  (item) => !normalized || `${item.date} ${item.summary} ${item.events.join(" ")} ${item.openTasks.join(" ")} ${item.learnings.join(" ")}`.toLocaleLowerCase().includes(normalized)
7112
7469
  ), [reflections, normalized]);
7113
7470
  const selectedMemory = filteredMemories.find((item) => item.id === selectedMemoryId) ?? filteredMemories[0];
7114
7471
  const selectedReflection = filteredReflections.find((item) => item.date === selectedDate) ?? filteredReflections[0];
7115
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: "dsh-partner-memory-library", children: [
7116
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { className: "dsh-partner-library-header", children: [
7117
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
7118
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "MEMORY LIBRARY" }),
7119
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: "\u4F19\u4F34\u8BB0\u5FC6\u5E93" }),
7120
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
7121
7478
  ] }),
7122
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("nav", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", children: [
7123
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7124
7481
  "\u4EBA\u7269\u753B\u50CF ",
7125
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: profiles.length })
7482
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: profiles.length })
7126
7483
  ] }),
7127
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7128
7485
  "\u8BDD\u9898\u8BB0\u5FC6 ",
7129
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: activeMemories.length })
7486
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: activeMemories.length })
7130
7487
  ] }),
7131
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7132
7489
  "\u6BCF\u65E5\u56DE\u987E ",
7133
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: reflections.length })
7490
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: reflections.length })
7134
7491
  ] }),
7135
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7136
7493
  "\u5173\u7CFB\u56FE\u8C31 ",
7137
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: graph?.relations.length ?? "\u2014" })
7494
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: graph?.relations.length ?? "\u2014" })
7138
7495
  ] })
7139
7496
  ] })
7140
7497
  ] }),
7141
- mode !== "profile" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-library-tools", children: [
7142
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("label", { children: [
7143
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u8BB0\u5FC6" }),
7144
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
7145
7502
  ] }),
7146
- mode === "memory" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-memory-kinds", children: MEMORY_KINDS.map((value) => /* @__PURE__ */ (0, import_jsx_runtime17.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)) })
7147
7504
  ] }),
7148
- mode === "profile" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ProfileLibrary, { profiles, memories: profileMemories, editing, busy, setEditing, save, remove }) : mode === "memory" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-library-browser", children: [
7149
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-library-list", role: "list", children: filteredMemories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.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: () => {
7150
7507
  setSelectedMemoryId(item.id);
7151
7508
  setEditing(void 0);
7152
7509
  }, children: [
7153
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "data-kind": item.kind, children: memoryKind(item.kind) }),
7154
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: item.subject }),
7155
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: item.content }),
7156
- /* @__PURE__ */ (0, import_jsx_runtime17.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) })
7157
7514
  ] }, item.id)) }),
7158
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-library-detail", children: selectedMemory ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(MemoryCard, { item: selectedMemory, editing: editing?.id === selectedMemory.id ? editing : void 0, busy, setEditing, save, remove: () => remove(selectedMemory) }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u6761\u8BB0\u5FC6", detail: "\u8BB0\u5FC6\u8BE6\u60C5\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
7159
- ] }) : mode === "reflection" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-library-browser", children: [
7160
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-library-list is-diary", role: "list", children: filteredReflections.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.jsxs)("button", { type: "button", role: "listitem", className: selectedReflection?.date === entry.date ? "is-active" : "", onClick: () => setSelectedDate(entry.date), children: [
7161
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("time", { children: entry.date }),
7162
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7163
7520
  entry.turnCount,
7164
7521
  " \u8F6E\u4EA4\u6D41"
7165
7522
  ] }),
7166
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: entry.summary }),
7167
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
7523
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: entry.summary }),
7524
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
7168
7525
  entry.openTasks.length,
7169
7526
  " \u9879\u5F85\u8DDF\u8FDB \xB7 ",
7170
7527
  entry.learnings.length,
7171
7528
  " \u9879\u7406\u89E3"
7172
7529
  ] })
7173
7530
  ] }, entry.date)) }),
7174
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-library-detail", children: selectedReflection ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DailyReflectionDetail, { entry: selectedReflection }) : /* @__PURE__ */ (0, import_jsx_runtime17.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 }) })
7175
- ] }) : graphError ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ContentState, { title: "\u5173\u7CFB\u56FE\u8C31\u52A0\u8F7D\u5931\u8D25", detail: graphError, action: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: () => setGraphRequest((value) => value + 1), children: "\u91CD\u65B0\u52A0\u8F7D" }) }) : graphLoading || graph === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.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) => {
7176
7533
  setEditing(void 0);
7177
7534
  if (item.kind === "profile") setMode("profile");
7178
7535
  else {
@@ -7183,71 +7540,71 @@ function MemoryLibrary({ companionId, revision, profiles, memories, reflections,
7183
7540
  ] });
7184
7541
  }
7185
7542
  function ProfileLibrary({ profiles, memories, editing, busy, setEditing, save, remove }) {
7186
- const [selectedScopeId, setSelectedScopeId] = (0, import_react21.useState)();
7543
+ const [selectedScopeId, setSelectedScopeId] = (0, import_react24.useState)();
7187
7544
  const selected = profiles.find((item) => item.scopeId === selectedScopeId) ?? profiles[0];
7188
- if (!selected) return /* @__PURE__ */ (0, import_jsx_runtime17.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" });
7189
7546
  const activeIds = new Set(selected.entries.map((item) => item.id));
7190
7547
  const pending = memories.filter((item) => item.scopeId === selected.scopeId && !activeIds.has(item.id));
7191
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-profile-browser", children: [
7192
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-profile-people", role: "list", "aria-label": "\u8054\u7CFB\u4EBA\u753B\u50CF", children: profiles.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime17.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: () => {
7193
7550
  setSelectedScopeId(profile.scopeId);
7194
7551
  setEditing(void 0);
7195
7552
  }, children: [
7196
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconUserOutline16, { size: 16 }) }),
7197
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
7198
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: profile.label }),
7199
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
7200
7557
  ] }),
7201
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", { "aria-hidden": "true" })
7558
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", { "aria-hidden": "true" })
7202
7559
  ] }, profile.scopeId)) }),
7203
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-profile-stage", children: [
7204
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { className: "dsh-partner-profile-heading", children: [
7205
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
7206
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "PARTNER UNDERSTANDING" }),
7207
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7208
7565
  "\u4F19\u4F34\u773C\u4E2D\u7684 ",
7209
7566
  selected.label
7210
7567
  ] }),
7211
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
7212
7569
  ] }),
7213
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { "data-ready": selected.entries.length > 0, children: [
7214
- /* @__PURE__ */ (0, import_jsx_runtime17.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", {}),
7215
7572
  selected.entries.length > 0 ? "\u4E0A\u4E0B\u6587\u57FA\u7EBF\u5DF2\u5C31\u7EEA" : "\u7B49\u5F85\u53EF\u9760\u8BC1\u636E"
7216
7573
  ] })
7217
7574
  ] }),
7218
- selected.entries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
7219
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-profile-meta", children: [
7220
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
7221
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "\u753B\u50CF\u7248\u672C" }),
7222
- /* @__PURE__ */ (0, import_jsx_runtime17.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 })
7223
7580
  ] }),
7224
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
7225
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "\u5BF9\u8BDD\u4F9D\u636E" }),
7226
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7227
7584
  selected.evidenceCount,
7228
7585
  " \u5904"
7229
7586
  ] })
7230
7587
  ] }),
7231
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
7232
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "\u7528\u6237\u786E\u8BA4" }),
7233
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7234
7591
  selected.lockedCount,
7235
7592
  " \u9879"
7236
7593
  ] })
7237
7594
  ] }),
7238
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
7239
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "\u6700\u8FD1\u4F9D\u636E" }),
7240
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
7241
7598
  ] })
7242
7599
  ] }),
7243
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-profile-entries", children: selected.entries.map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(MemoryCard, { item, editing: editing?.id === item.id ? editing : void 0, busy, setEditing, save, remove: () => remove(item) }, item.id)) })
7244
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.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 }),
7245
- pending.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("details", { className: "dsh-partner-profile-pending", children: [
7246
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7247
7604
  "\u5F85\u786E\u8BA4\u7684\u7406\u89E3 ",
7248
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: pending.length })
7605
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: pending.length })
7249
7606
  ] }),
7250
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { children: pending.map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.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)) })
7251
7608
  ] })
7252
7609
  ] })
7253
7610
  ] });
@@ -7256,9 +7613,9 @@ var RELATION_FILTERS = ["all", "conflicts_with", "depends_on", "supports", "foll
7256
7613
  function MemoryGraph({ graph, profiles, query, inspect }) {
7257
7614
  const byId = new Map(graph.memories.map((item) => [item.id, item]));
7258
7615
  const scopeIds = [...new Set(graph.relations.map((item) => item.scopeId))];
7259
- const [requestedScopeId, setRequestedScopeId] = (0, import_react21.useState)();
7616
+ const [requestedScopeId, setRequestedScopeId] = (0, import_react24.useState)();
7260
7617
  const scopeId = scopeIds.includes(requestedScopeId ?? "") ? requestedScopeId : scopeIds[0];
7261
- const [filter, setFilter] = (0, import_react21.useState)("all");
7618
+ const [filter, setFilter] = (0, import_react24.useState)("all");
7262
7619
  const scoped = graph.relations.filter((item) => item.scopeId === scopeId);
7263
7620
  const visible = scoped.filter((item) => {
7264
7621
  if (filter !== "all" && item.kind !== filter) return false;
@@ -7266,115 +7623,115 @@ function MemoryGraph({ graph, profiles, query, inspect }) {
7266
7623
  const target2 = byId.get(item.targetMemoryId);
7267
7624
  return !query || `${source2?.subject ?? ""} ${source2?.content ?? ""} ${target2?.subject ?? ""} ${target2?.content ?? ""} ${item.label}`.toLocaleLowerCase().includes(query);
7268
7625
  }).sort((left, right) => Number(right.kind === "conflicts_with") - Number(left.kind === "conflicts_with") || right.confidence - left.confidence);
7269
- const [selectedRelationId, setSelectedRelationId] = (0, import_react21.useState)();
7626
+ const [selectedRelationId, setSelectedRelationId] = (0, import_react24.useState)();
7270
7627
  const selected = visible.find((item) => item.id === selectedRelationId) ?? visible[0];
7271
7628
  const source = selected ? byId.get(selected.sourceMemoryId) : void 0;
7272
7629
  const target = selected ? byId.get(selected.targetMemoryId) : void 0;
7273
7630
  const label = profiles.find((item) => item.scopeId === scopeId)?.label ?? (scopeId ? `\u8054\u7CFB\u4EBA ${scopeId.slice(-6)}` : "\u5F53\u524D\u8054\u7CFB\u4EBA");
7274
7631
  const conflictCount = scoped.filter((item) => item.kind === "conflicts_with").length;
7275
- if (graph.relations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime17.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" });
7276
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-graph-audit", children: [
7277
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { className: "dsh-partner-graph-toolbar", children: [
7278
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
7279
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: "\u5173\u7CFB\u5BA1\u8BA1" }),
7280
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7281
7638
  label,
7282
7639
  " \u7684\u7406\u89E3\u5173\u7CFB"
7283
7640
  ] }),
7284
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { children: [
7641
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("p", { children: [
7285
7642
  scoped.length,
7286
7643
  " \u6761\u53EF\u9760\u8054\u7CFB",
7287
7644
  conflictCount > 0 ? `\uFF0C\u5176\u4E2D ${conflictCount} \u6761\u9700\u8981\u786E\u8BA4` : "\uFF0C\u6682\u65E0\u5F85\u786E\u8BA4\u51B2\u7A81"
7288
7645
  ] })
7289
7646
  ] }),
7290
- scopeIds.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("label", { children: [
7291
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "\u8054\u7CFB\u4EBA" }),
7292
- /* @__PURE__ */ (0, import_jsx_runtime17.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) => {
7293
7650
  setRequestedScopeId(event.target.value);
7294
7651
  setSelectedRelationId(void 0);
7295
- }, children: scopeIds.map((value) => /* @__PURE__ */ (0, import_jsx_runtime17.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)) })
7296
7653
  ] })
7297
7654
  ] }),
7298
- /* @__PURE__ */ (0, import_jsx_runtime17.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) => {
7299
7656
  const count = value === "all" ? scoped.length : scoped.filter((item) => item.kind === value).length;
7300
- return /* @__PURE__ */ (0, import_jsx_runtime17.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: () => {
7301
7658
  setFilter(value);
7302
7659
  setSelectedRelationId(void 0);
7303
7660
  }, children: [
7304
7661
  value === "all" ? "\u5168\u90E8" : relationLabel(value),
7305
7662
  " ",
7306
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: count })
7663
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: count })
7307
7664
  ] }, value);
7308
7665
  }) }),
7309
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-graph-browser", children: [
7310
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-graph-index", role: "list", children: visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.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) => {
7311
7668
  const from = byId.get(item.sourceMemoryId);
7312
7669
  const to = byId.get(item.targetMemoryId);
7313
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", role: "listitem", "data-kind": item.kind, className: selected?.id === item.id ? "is-active" : "", onClick: () => setSelectedRelationId(item.id), children: [
7314
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: relationLabel(item.kind) }),
7315
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7316
7673
  from?.subject ?? "\u5DF2\u5220\u9664\u8BB0\u5FC6",
7317
7674
  " ",
7318
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
7675
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
7319
7676
  " ",
7320
7677
  to?.subject ?? "\u5DF2\u5220\u9664\u8BB0\u5FC6"
7321
7678
  ] }),
7322
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: item.label }),
7323
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
7679
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: item.label }),
7680
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
7324
7681
  Math.round(item.confidence * 100),
7325
7682
  "% \u53EF\u4FE1"
7326
7683
  ] })
7327
7684
  ] }, item.id);
7328
7685
  }) }),
7329
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-graph-stage", children: selected && source && target ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("article", { "data-kind": selected.kind, children: [
7330
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { children: [
7331
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: relationLabel(selected.kind) }),
7332
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7333
7690
  source.subject,
7334
7691
  " ",
7335
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
7692
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
7336
7693
  " ",
7337
7694
  target.subject
7338
7695
  ] }),
7339
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: selected.label }),
7340
- /* @__PURE__ */ (0, import_jsx_runtime17.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) })
7341
7698
  ] }),
7342
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-graph-pair", children: [
7343
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GraphMemory, { item: source, side: "\u8D77\u70B9", inspect }),
7344
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { "aria-hidden": "true", children: [
7345
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", {}),
7346
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: relationLabel(selected.kind) }),
7347
- /* @__PURE__ */ (0, import_jsx_runtime17.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", {})
7348
7705
  ] }),
7349
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GraphMemory, { item: target, side: "\u5173\u8054\u9879", inspect })
7706
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GraphMemory, { item: target, side: "\u5173\u8054\u9879", inspect })
7350
7707
  ] }),
7351
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("footer", { children: [
7352
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
7708
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("footer", { children: [
7709
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
7353
7710
  "\u6700\u8FD1\u7EC8\u5BA1\u4E8E ",
7354
7711
  new Date(selected.updatedAt).toLocaleString()
7355
7712
  ] }),
7356
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("strong", { children: [
7713
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("strong", { children: [
7357
7714
  "\u5173\u7CFB\u7F6E\u4FE1\u5EA6 ",
7358
7715
  Math.round(selected.confidence * 100),
7359
7716
  "%"
7360
7717
  ] })
7361
7718
  ] })
7362
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.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 }) })
7363
7720
  ] })
7364
7721
  ] });
7365
7722
  }
7366
7723
  function GraphMemory({ item, side, inspect }) {
7367
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { children: [
7368
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { children: [
7369
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7370
7727
  side,
7371
7728
  " \xB7 ",
7372
7729
  memoryKind(item.kind)
7373
7730
  ] }),
7374
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: item.subject })
7731
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: item.subject })
7375
7732
  ] }),
7376
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: item.content }),
7377
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
7378
7735
  ] });
7379
7736
  }
7380
7737
  function relationLabel(kind) {
@@ -7390,70 +7747,70 @@ function relationGuidance(kind) {
7390
7747
  }[kind];
7391
7748
  }
7392
7749
  function DailyReflectionDetail({ entry }) {
7393
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("article", { className: "dsh-partner-diary-detail", children: [
7394
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { children: [
7395
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("time", { children: entry.date }),
7396
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7397
7754
  entry.turnCount,
7398
7755
  " \u8F6E\u4EA4\u6D41\u540E\u7684\u7406\u89E3"
7399
7756
  ] }),
7400
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
7757
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
7401
7758
  "\u66F4\u65B0\u4E8E ",
7402
7759
  new Date(entry.updatedAt).toLocaleString()
7403
7760
  ] })
7404
7761
  ] }),
7405
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: entry.summary }),
7406
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ReflectionGroup, { title: "\u5F85\u8DDF\u8FDB", items: entry.openTasks }),
7407
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ReflectionGroup, { title: "\u5F53\u5929\u4E8B\u4EF6", items: entry.events }),
7408
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ReflectionGroup, { title: "\u65B0\u7406\u89E3", items: entry.learnings }),
7409
- /* @__PURE__ */ (0, import_jsx_runtime17.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 })
7410
7767
  ] });
7411
7768
  }
7412
7769
  function ReflectionGroup({ title, items }) {
7413
7770
  if (items.length === 0) return null;
7414
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { children: [
7415
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: title }),
7416
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.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)) })
7417
7774
  ] });
7418
7775
  }
7419
7776
  function MemoryCard({ item, editing, busy, setEditing, save, remove }) {
7420
- const [confirmingRemove, setConfirmingRemove] = (0, import_react21.useState)(false);
7421
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("article", { "data-kind": item.kind, children: editing ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-memory-editor", children: [
7422
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("input", { "aria-label": "\u8BB0\u5FC6\u4E3B\u9898", value: editing.subject, onChange: (event) => setEditing({ ...editing, subject: event.target.value }) }),
7423
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("textarea", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", value: editing.content, onChange: (event) => setEditing({ ...editing, content: event.target.value }) }),
7424
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("footer", { children: [
7425
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: () => setEditing(void 0), children: "\u53D6\u6D88" }),
7426
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
7427
7784
  ] })
7428
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
7429
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { children: [
7430
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: memoryKind(item.kind) }),
7431
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { children: confirmingRemove ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
7432
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: () => setConfirmingRemove(false), children: "\u53D6\u6D88" }),
7433
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
7434
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
7435
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: () => setEditing({ ...item }), children: "\u7F16\u8F91" }),
7436
- /* @__PURE__ */ (0, import_jsx_runtime17.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" })
7437
7794
  ] }) })
7438
7795
  ] }),
7439
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: item.subject }),
7440
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: item.content }),
7441
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("footer", { children: [
7442
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("progress", { max: 1, value: item.confidence, "aria-label": `\u7F6E\u4FE1\u5EA6 ${Math.round(item.confidence * 100)}%` }),
7443
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7444
7801
  item.locked ? "\u624B\u52A8\u786E\u8BA4" : `${Math.round(item.confidence * 100)}% \u53EF\u4FE1`,
7445
7802
  " \xB7 ",
7446
7803
  relativeTime(item.updatedAt)
7447
7804
  ] })
7448
7805
  ] }),
7449
- item.evidence.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("details", { className: "dsh-partner-memory-evidence", children: [
7450
- /* @__PURE__ */ (0, import_jsx_runtime17.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: [
7451
7808
  "\u67E5\u770B\u5BF9\u8BDD\u4F9D\u636E ",
7452
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: item.evidence.length })
7809
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: item.evidence.length })
7453
7810
  ] }),
7454
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { children: [...item.evidence].reverse().map((evidence) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("blockquote", { children: [
7455
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: evidence.excerpt }),
7456
- /* @__PURE__ */ (0, import_jsx_runtime17.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() })
7457
7814
  ] }, `${evidence.turnId}:${evidence.at}`)) })
7458
7815
  ] })
7459
7816
  ] }) });