@lemoncat7/dsh-partner 1.8.2 → 1.9.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 (134) hide show
  1. package/README.md +34 -2
  2. package/docs/architecture.md +104 -12
  3. package/lib/agent-runtime.d.ts +15 -2
  4. package/lib/agent-runtime.d.ts.map +1 -1
  5. package/lib/agent-runtime.js +164 -106
  6. package/lib/agent-runtime.js.map +1 -1
  7. package/lib/api/features/workspace-api.d.ts.map +1 -1
  8. package/lib/api/features/workspace-api.js +1 -10
  9. package/lib/api/features/workspace-api.js.map +1 -1
  10. package/lib/api.js +21 -44
  11. package/lib/api.js.map +1 -1
  12. package/lib/channels/delivery-policy.d.ts +7 -0
  13. package/lib/channels/delivery-policy.d.ts.map +1 -0
  14. package/lib/channels/delivery-policy.js +47 -0
  15. package/lib/channels/delivery-policy.js.map +1 -0
  16. package/lib/channels/manager.d.ts +1 -2
  17. package/lib/channels/manager.d.ts.map +1 -1
  18. package/lib/channels/manager.js +5 -9
  19. package/lib/channels/manager.js.map +1 -1
  20. package/lib/client-api.d.ts +1 -0
  21. package/lib/client-api.d.ts.map +1 -1
  22. package/lib/client-api.js.map +1 -1
  23. package/lib/client.d.ts.map +1 -1
  24. package/lib/client.js +1255 -1100
  25. package/lib/client.js.map +4 -4
  26. package/lib/collaboration/composition.d.ts.map +1 -1
  27. package/lib/collaboration/composition.js +37 -13
  28. package/lib/collaboration/composition.js.map +1 -1
  29. package/lib/collaboration/service.d.ts +4 -0
  30. package/lib/collaboration/service.d.ts.map +1 -1
  31. package/lib/collaboration/service.js +109 -35
  32. package/lib/collaboration/service.js.map +1 -1
  33. package/lib/collaboration/task-dispatch.d.ts +18 -0
  34. package/lib/collaboration/task-dispatch.d.ts.map +1 -0
  35. package/lib/collaboration/task-dispatch.js +44 -0
  36. package/lib/collaboration/task-dispatch.js.map +1 -0
  37. package/lib/collaboration/task-recovery.d.ts +8 -0
  38. package/lib/collaboration/task-recovery.d.ts.map +1 -0
  39. package/lib/collaboration/task-recovery.js +30 -0
  40. package/lib/collaboration/task-recovery.js.map +1 -0
  41. package/lib/companions/directory-cleanup.d.ts +4 -0
  42. package/lib/companions/directory-cleanup.d.ts.map +1 -0
  43. package/lib/companions/directory-cleanup.js +77 -0
  44. package/lib/companions/directory-cleanup.js.map +1 -0
  45. package/lib/companions/management-tool.d.ts +1 -1
  46. package/lib/companions/management-tool.d.ts.map +1 -1
  47. package/lib/companions/management-tool.js +1 -1
  48. package/lib/companions/management-tool.js.map +1 -1
  49. package/lib/companions/management.d.ts +4 -2
  50. package/lib/companions/management.d.ts.map +1 -1
  51. package/lib/companions/management.js +2 -2
  52. package/lib/companions/management.js.map +1 -1
  53. package/lib/companions/removal.d.ts +20 -0
  54. package/lib/companions/removal.d.ts.map +1 -0
  55. package/lib/companions/removal.js +84 -0
  56. package/lib/companions/removal.js.map +1 -0
  57. package/lib/companions/service.d.ts +3 -0
  58. package/lib/companions/service.d.ts.map +1 -1
  59. package/lib/companions/service.js +4 -0
  60. package/lib/companions/service.js.map +1 -1
  61. package/lib/companions/session-configuration.d.ts +19 -0
  62. package/lib/companions/session-configuration.d.ts.map +1 -0
  63. package/lib/companions/session-configuration.js +38 -0
  64. package/lib/companions/session-configuration.js.map +1 -0
  65. package/lib/companions/workspace-cleanup.d.ts +4 -0
  66. package/lib/companions/workspace-cleanup.d.ts.map +1 -0
  67. package/lib/companions/workspace-cleanup.js +37 -0
  68. package/lib/companions/workspace-cleanup.js.map +1 -0
  69. package/lib/daily-review.d.ts +1 -0
  70. package/lib/daily-review.d.ts.map +1 -1
  71. package/lib/daily-review.js +3 -0
  72. package/lib/daily-review.js.map +1 -1
  73. package/lib/execution/service.d.ts.map +1 -1
  74. package/lib/execution/service.js +2 -0
  75. package/lib/execution/service.js.map +1 -1
  76. package/lib/heartbeat.d.ts +1 -0
  77. package/lib/heartbeat.d.ts.map +1 -1
  78. package/lib/heartbeat.js +3 -0
  79. package/lib/heartbeat.js.map +1 -1
  80. package/lib/index.d.ts.map +1 -1
  81. package/lib/index.js +5 -12
  82. package/lib/index.js.map +1 -1
  83. package/lib/pendant/notice-motion.d.ts.map +1 -1
  84. package/lib/pendant/notice-motion.js +12 -6
  85. package/lib/pendant/notice-motion.js.map +1 -1
  86. package/lib/pendant/sheen.d.ts +1 -1
  87. package/lib/pendant/sheen.d.ts.map +1 -1
  88. package/lib/pendant/sheen.js +9 -8
  89. package/lib/pendant/sheen.js.map +1 -1
  90. package/lib/pendant/widget.js +1 -1
  91. package/lib/pendant/widget.js.map +1 -1
  92. package/lib/pendant-renderer.js +17 -17
  93. package/lib/skills/builtin.d.ts.map +1 -1
  94. package/lib/skills/builtin.js +3 -2
  95. package/lib/skills/builtin.js.map +1 -1
  96. package/lib/skills/service.js +1 -1
  97. package/lib/skills/service.js.map +1 -1
  98. package/lib/skills/task-planning.d.ts +3 -0
  99. package/lib/skills/task-planning.d.ts.map +1 -0
  100. package/lib/skills/task-planning.js +31 -0
  101. package/lib/skills/task-planning.js.map +1 -0
  102. package/lib/store.d.ts +6 -0
  103. package/lib/store.d.ts.map +1 -1
  104. package/lib/store.js +12 -0
  105. package/lib/store.js.map +1 -1
  106. package/lib/tasks/domain.d.ts +2 -0
  107. package/lib/tasks/domain.d.ts.map +1 -1
  108. package/lib/tasks/progress-notifier.d.ts +4 -0
  109. package/lib/tasks/progress-notifier.d.ts.map +1 -0
  110. package/lib/tasks/progress-notifier.js +20 -0
  111. package/lib/tasks/progress-notifier.js.map +1 -0
  112. package/lib/tasks/service.d.ts.map +1 -1
  113. package/lib/tasks/service.js +22 -2
  114. package/lib/tasks/service.js.map +1 -1
  115. package/lib/ui/capability-editor.d.ts +7 -0
  116. package/lib/ui/capability-editor.d.ts.map +1 -0
  117. package/lib/ui/capability-editor.js +85 -0
  118. package/lib/ui/capability-editor.js.map +1 -0
  119. package/lib/ui/companion-draft.d.ts +12 -0
  120. package/lib/ui/companion-draft.d.ts.map +1 -0
  121. package/lib/ui/companion-draft.js +2 -0
  122. package/lib/ui/companion-draft.js.map +1 -0
  123. package/lib/ui/identity-editor.d.ts +11 -0
  124. package/lib/ui/identity-editor.d.ts.map +1 -0
  125. package/lib/ui/identity-editor.js +78 -0
  126. package/lib/ui/identity-editor.js.map +1 -0
  127. package/lib/ui/task-board-panel.d.ts.map +1 -1
  128. package/lib/ui/task-board-panel.js +15 -10
  129. package/lib/ui/task-board-panel.js.map +1 -1
  130. package/lib/ui/task-board-stage.d.ts +12 -0
  131. package/lib/ui/task-board-stage.d.ts.map +1 -0
  132. package/lib/ui/task-board-stage.js +13 -0
  133. package/lib/ui/task-board-stage.js.map +1 -0
  134. 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_react18 = require("react");
38
+ var import_react21 = 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_primitives11 = require("@deepseek-ai/dsh-client-ui-primitives");
57
+ var import_dsh_client_ui_primitives14 = require("@deepseek-ai/dsh-client-ui-primitives");
58
58
 
59
59
  // node_modules/qrcode.react/lib/esm/index.js
60
60
  var import_react = __toESM(require("react"), 1);
@@ -1336,7 +1336,7 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
1336
1336
 
1337
1337
  /* Skills, board and schedule modules share the partner workspace scale. */
1338
1338
  .dsh-partner-feature-page { display: grid; width: min(100%, 1180px); align-content: start; gap: 18px; margin: 0 auto; padding: 26px clamp(22px, 4vw, 52px) 52px; font: var(--partner-font-body)/1.5 var(--partner-font-family); }
1339
- .dsh-partner-feature-page.is-board { width: min(100%, 1180px); }
1339
+ .dsh-partner-feature-page.is-board { width: min(100%, 1480px); gap: 12px; }
1340
1340
  .dsh-partner-feature-hero { display: flex; min-height: 86px; align-items: end; justify-content: space-between; gap: 24px; padding: 0 2px 16px 14px; border-bottom: 1px solid var(--partner-border); }
1341
1341
  .dsh-partner-feature-hero > span { position: relative; display: grid; min-width: 0; gap: 4px; }
1342
1342
  .dsh-partner-feature-hero > span::before { position: absolute; top: 3px; bottom: 2px; left: -14px; width: 2px; border-radius: 2px; background: linear-gradient(var(--partner-text-secondary), transparent 92%); content: ''; }
@@ -1475,6 +1475,8 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
1475
1475
  .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
1476
  .dsh-partner-board-tools { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(140px, 180px) auto; align-items: center; gap: 8px; }
1477
1477
  .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-board-assignee.is-mobile-stage { display: none; }
1478
1480
  .dsh-partner-board-search > span:not(.sr-only) { position: absolute; z-index: 1; left: 11px; display: grid; place-items: center; color: var(--partner-text-tertiary); pointer-events: none; }
1479
1481
  .dsh-partner-board-search > input,
1480
1482
  .dsh-partner-board-assignee > select { width: 100%; min-height: 38px; border: 1px solid var(--partner-border); border-radius: 10px; color: var(--partner-text); background-color: var(--partner-control); font: var(--partner-font-body)/1.4 var(--partner-font-family); transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease; }
@@ -1493,19 +1495,21 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
1493
1495
  .dsh-partner-board-statuses > button:hover { border-color: var(--partner-border); color: var(--partner-text); background: var(--partner-hover); }
1494
1496
  .dsh-partner-board-statuses > button.is-active { border-color: color-mix(in srgb, var(--partner-text) 18%, var(--partner-border)); color: var(--partner-text); background: var(--partner-selected); }
1495
1497
  .dsh-partner-board-statuses b { min-width: 18px; color: inherit; font-size: inherit; font-variant-numeric: tabular-nums; font-weight: 650; text-align: center; }
1496
- .dsh-partner-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); align-items: start; gap: 10px; min-width: 0; }
1497
- .dsh-partner-board[data-focused="true"] { grid-template-columns: minmax(0, 1fr); }
1498
- .dsh-partner-board > section { display: grid; height: clamp(220px, 27vh, 280px); min-width: 0; grid-template-rows: auto minmax(0, 1fr); align-content: start; gap: 9px; padding: 11px 9px 9px 11px; border: 1px solid var(--partner-border); border-radius: 14px; background: color-mix(in srgb, var(--partner-raised) 66%, transparent); }
1499
- .dsh-partner-board > section[data-empty="true"] { height: 132px; }
1500
- .dsh-partner-board[data-focused="true"] > section { height: clamp(340px, 54vh, 560px); }
1501
- .dsh-partner-board[data-focused="true"] > section[data-empty="true"] { height: 240px; }
1502
- .dsh-partner-board > section > header { display: flex; min-height: 36px; align-items: center; justify-content: space-between; padding: 0 3px; }
1498
+ .dsh-partner-board { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 10px; min-width: 0; }
1499
+ .dsh-partner-board > section { display: grid; min-width: 0; align-content: start; padding: 8px 10px 10px; border: 1px solid var(--partner-border); border-radius: 14px; background: color-mix(in srgb, var(--partner-raised) 66%, transparent); }
1500
+ .dsh-partner-board > section > header { display: flex; min-height: 36px; align-items: center; padding: 0 0 6px; }
1501
+ .dsh-partner-board .dsh-partner-board-stage-toggle { display: flex; width: 100%; min-height: 32px; align-items: center; justify-content: flex-start; gap: 8px; padding: 4px; border: 0; border-radius: 7px; color: var(--partner-text); background: transparent; text-align: left; box-shadow: none; }
1502
+ .dsh-partner-board-stage-toggle:hover:not(:disabled) { background: var(--partner-hover); }
1503
+ .dsh-partner-board-stage-toggle[aria-expanded="true"] > svg { transform: rotate(90deg); }
1504
+ .dsh-partner-board > section > [hidden] { display: none; }
1503
1505
  .dsh-partner-board > section > header strong { font-size: var(--partner-font-label); font-weight: 620; }
1504
1506
  .dsh-partner-board > section > header b { display: grid; min-width: 22px; height: 22px; place-items: center; padding: 0 5px; border-radius: 7px; color: var(--partner-text-tertiary); background: var(--partner-selected); font-size: var(--partner-font-caption); }
1505
- .dsh-partner-board-column-list { display: grid; min-height: 0; grid-auto-rows: max-content; align-content: start; gap: 7px; overflow-y: auto; padding: 1px 3px 6px 0; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; }
1506
- .dsh-partner-board > section > p { align-self: center; margin: 0 0 22px; color: var(--partner-text-tertiary); font-size: var(--partner-font-body); text-align: center; }
1507
- .dsh-partner-task-card { position: relative; display: grid; min-height: 82px; overflow: hidden; border: 1px solid var(--partner-separator); border-radius: 11px; background: var(--partner-raised); box-shadow: var(--partner-shadow-sm); transition: border-color .16s ease, box-shadow .18s ease, transform .16s var(--partner-ease-out); }
1508
- .dsh-partner-task-card:hover { border-color: color-mix(in srgb, var(--partner-text) 22%, var(--partner-border)); box-shadow: var(--partner-shadow-md); transform: translateY(-1px); }
1507
+ .dsh-partner-board-column-list { display: grid; min-width: 0; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); align-items: stretch; align-content: start; gap: 8px; }
1508
+ .dsh-partner-board-empty { margin: 0; padding: 0 4px 2px; color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); }
1509
+ .dsh-partner-board-more { display: block; margin: 8px auto 0; min-height: 32px; padding: 4px 12px; border: 1px solid var(--partner-border); border-radius: 8px; background: transparent; color: var(--partner-text-secondary); box-shadow: none !important; }
1510
+ .dsh-partner-board-more:hover { background: var(--partner-hover); }
1511
+ .dsh-partner-task-card { position: relative; display: grid; min-height: 82px; overflow: hidden; border: 1px solid var(--partner-separator); border-radius: 11px; background: var(--partner-raised); box-shadow: none; transition: border-color .16s ease; }
1512
+ .dsh-partner-task-card:hover { border-color: color-mix(in srgb, var(--partner-text) 22%, var(--partner-border)); }
1509
1513
  .dsh-partner-task-card:focus-within { border-color: var(--partner-focus-ring); box-shadow: 0 0 0 2px color-mix(in srgb, var(--partner-focus-ring) 18%, transparent), var(--partner-shadow-md); }
1510
1514
  .dsh-partner-task-card[data-blocked="true"] { border-left-color: color-mix(in srgb, var(--partner-warning) 55%, var(--partner-border)); }
1511
1515
  .dsh-partner-task-summary { display: grid !important; min-height: 82px !important; grid-template-columns: minmax(0, 1fr) 16px; align-items: center !important; gap: 8px !important; padding: 10px 10px 10px 11px !important; border: 0 !important; border-radius: 0 !important; appearance: none; color: var(--partner-text) !important; background: transparent !important; box-shadow: none !important; font-family: var(--partner-font-family); text-align: left; cursor: pointer; }
@@ -1645,7 +1649,6 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
1645
1649
  .dsh-partner-board-assignee > select { min-height: 42px; }
1646
1650
  .dsh-partner-board-statuses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
1647
1651
  .dsh-partner-board-statuses > button { min-width: 0; justify-content: center; padding-inline: 6px; }
1648
- .dsh-partner-board > section, .dsh-partner-board[data-focused="true"] > section { height: min(430px, 58vh); }
1649
1652
  .dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form { grid-template-columns: 1fr; padding: 14px; }
1650
1653
  :is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > label { grid-column: 1 !important; }
1651
1654
  .dsh-partner-task-form-dependencies > div { grid-template-columns: 1fr; }
@@ -1886,6 +1889,9 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
1886
1889
  .dsh-partner-field select:focus { border-color: var(--partner-focus-ring); background: var(--partner-raised); box-shadow: 0 0 0 3px color-mix(in srgb, var(--partner-focus-ring) 18%, transparent), inset 0 1px 0 var(--partner-glass-highlight); }
1887
1890
  .dsh-partner-form-actions { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding-top: 5px; }
1888
1891
  .dsh-partner-form-actions > span { display: inline-flex; align-items: center; gap: 5px; color: var(--partner-accent-strong); font-size: var(--partner-font-body); }
1892
+ .dsh-partner-form-actions.is-capability-save { flex-wrap: wrap; gap: 12px; }
1893
+ .dsh-partner-form-actions.is-capability-save > span { min-height: 24px; }
1894
+ .dsh-partner-form-actions.is-capability-save > span svg { flex-shrink: 0; }
1889
1895
  .dsh-partner-form-actions > button,
1890
1896
  .dsh-partner-state > button,
1891
1897
  .dsh-partner-weixin-connect > button { min-height: 34px; padding: 0 15px; border: 1px solid color-mix(in srgb, var(--partner-accent) 60%, transparent); border-radius: 10px; color: var(--partner-on-accent); background: var(--partner-accent-strong); font: 600 var(--partner-font-body)/1 var(--partner-font-family); cursor: pointer; }
@@ -2610,7 +2616,7 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
2610
2616
  `;
2611
2617
 
2612
2618
  // src/ui/workspace-ui.css
2613
- var workspace_ui_default = '.dsh-partner-feature-hero-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }\n.dsh-partner-feature-page { gap: 20px; }\n.dsh-partner-feature-hero { min-height: 92px; padding-bottom: 18px; }\n.dsh-partner-feature-hero p { max-width: 62ch; text-wrap: pretty; }\n.dsh-partner-feature-block { gap: 16px; padding: 20px; border-radius: 18px; box-shadow: inset 0 1px 0 var(--partner-card-highlight), 0 5px 16px color-mix(in srgb, var(--partner-text) 4%, transparent); }\n.dsh-partner-feature-block > header { min-height: 40px; }\n.dsh-partner-feature-block > header strong { font-size: var(--partner-font-label); letter-spacing: -.01em; }\n.dsh-partner-feature-block > header small { margin-top: 1px; }\n\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) :where(input, textarea, select) { outline: 0; }\n.dsh-partner-workspace select:not([multiple]) {\n appearance: none;\n padding-right: 32px;\n border-color: var(--partner-border);\n border-radius: 9px;\n color: var(--partner-text);\n background-color: var(--partner-control);\n background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);\n background-position: calc(100% - 15px) calc(50% - 1px), calc(100% - 11px) calc(50% - 1px);\n background-repeat: no-repeat;\n background-size: 4px 4px, 4px 4px;\n box-shadow: inset 0 1px 0 color-mix(in srgb, var(--partner-card-highlight) 54%, transparent), inset 0 -1px 0 var(--partner-glass-rim-shadow);\n font-family: var(--partner-font-family);\n font-size: var(--partner-font-body);\n font-weight: 520;\n cursor: pointer;\n transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;\n}\n.dsh-partner-workspace select:not([multiple]):hover:not(:disabled) { border-color: color-mix(in srgb, var(--partner-text) 24%, var(--partner-border)); background-color: var(--partner-hover); }\n.dsh-partner-workspace select:not([multiple]):focus-visible { border-color: var(--partner-focus-ring); background-color: var(--partner-raised); box-shadow: 0 0 0 3px color-mix(in srgb, var(--partner-focus-ring) 16%, transparent), inset 0 1px 0 color-mix(in srgb, var(--partner-card-highlight) 66%, transparent); }\n.dsh-partner-workspace select:not([multiple]):disabled { cursor: not-allowed; }\n.dsh-partner-workspace select option { color: var(--partner-text); background: var(--partner-solid-control); font: inherit; }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > footer { align-items: center; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--partner-separator); }\n.dsh-partner-form-footer-spacer { flex: 1; }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > footer .is-primary { color: var(--partner-on-accent); border-color: var(--partner-accent-strong); background: var(--partner-accent-strong); }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > footer .is-primary:hover { color: var(--partner-on-accent); border-color: var(--partner-accent-strong); background: color-mix(in srgb, var(--partner-accent-strong) 88%, #000); }\n:is(.dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) > .dsh-partner-workspace-notice { grid-column: 1 / -1; margin: 0; }\n.dsh-partner-feature-page button:disabled { cursor: not-allowed; opacity: .48; }\n.dsh-partner-identity-danger > div { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }\n.dsh-partner-identity-danger[data-confirming="true"] { margin-inline: -12px; padding: 16px 12px 0; border-top-color: color-mix(in srgb, var(--partner-danger) 30%, var(--partner-border)); background: color-mix(in srgb, var(--partner-danger) 4%, transparent); }\n.dsh-partner-identity-danger button.is-secondary { border-color: var(--partner-border); color: var(--partner-text-secondary); background: var(--partner-control); }\n.dsh-partner-identity-danger button.is-danger { color: var(--partner-on-accent); border-color: var(--partner-danger); background: var(--partner-danger); }\n.dsh-partner-profile-entries article > header button.is-danger { color: var(--partner-danger); background: color-mix(in srgb, var(--partner-danger) 8%, transparent); }\n\n.dsh-partner-skill-installed > article,\n.dsh-partner-market-grid > article,\n.dsh-partner-schedule-list > article { transition: border-color 150ms ease, background-color 150ms ease, transform 180ms var(--partner-ease-out); }\n.dsh-partner-skill-installed > article:hover,\n.dsh-partner-schedule-list > article:hover { border-color: color-mix(in srgb, var(--partner-text) 20%, var(--partner-border)); background: color-mix(in srgb, var(--partner-hover) 60%, var(--partner-raised)); transform: translate3d(0, -1px, 0); }\n.dsh-partner-schedule-meta { display: flex !important; align-items: center; flex-wrap: wrap; gap: 5px 10px !important; margin-top: 2px; }\n.dsh-partner-schedule-meta > em { position: relative; color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); font-style: normal; font-variant-numeric: tabular-nums; }\n.dsh-partner-schedule-meta > em + em::before { position: absolute; top: 50%; left: -6px; width: 2px; height: 2px; border-radius: 50%; background: var(--partner-text-tertiary); content: ""; }\n.dsh-partner-run-list > article { border-radius: 9px; transition: background-color 140ms ease; }\n.dsh-partner-run-list > article:hover { background: var(--partner-hover); }\n.dsh-partner-board > section { border-radius: 16px; }\n.dsh-partner-task-card { box-shadow: none; }\n.dsh-partner-task-card[data-expanded="true"] { box-shadow: 0 6px 18px color-mix(in srgb, var(--partner-text) 6%, transparent); }\n\n@media (hover: hover) {\n .dsh-partner-skill-installed .is-icon,\n .dsh-partner-schedule-list .is-icon { opacity: .34; transition: opacity 140ms ease, color 140ms ease, background-color 140ms ease; }\n .dsh-partner-skill-installed > article:hover .is-icon,\n .dsh-partner-schedule-list > article:hover .is-icon,\n .dsh-partner-skill-installed .is-icon:focus-visible,\n .dsh-partner-schedule-list .is-icon:focus-visible { opacity: 1; }\n}\n\n.dsh-partner-workspace-dialog-layer { position: absolute; z-index: 12; inset: 0; display: flex; align-items: center; justify-content: center; padding: clamp(16px, 3vw, 32px); background: var(--partner-dialog-veil); }\n.dsh-partner-workspace-dialog { position: relative; inset: auto; display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(560px, 100%); max-width: none; height: auto; max-height: min(680px, 100%); margin: 0; padding: 0; overflow: hidden; border: 1px solid color-mix(in srgb, var(--partner-text) 18%, var(--partner-border)); border-radius: 16px; color: var(--partner-text); background: var(--partner-solid-panel); box-shadow: 0 22px 58px color-mix(in srgb, #000 18%, transparent), 0 4px 14px color-mix(in srgb, #000 8%, transparent), inset 0 1px 0 var(--partner-card-highlight); animation: dsh-partner-dialog-enter 200ms var(--partner-ease-out) both; }\n.dsh-partner-workspace-dialog.is-wide { width: min(680px, 100%); max-height: min(720px, 100%); }\n.dsh-partner-workspace-dialog > header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 20px; padding: 22px 22px 18px; border-bottom: 1px solid var(--partner-separator); background: var(--partner-solid-raised); }\n.dsh-partner-workspace-dialog > header > span { display: grid; gap: 5px; min-width: 0; }\n.dsh-partner-workspace-dialog > header small { color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); font-weight: 680; letter-spacing: .09em; }\n.dsh-partner-workspace-dialog > header strong { font-size: var(--partner-font-title); line-height: 1.25; font-weight: 660; letter-spacing: -.025em; text-wrap: balance; }\n.dsh-partner-workspace-dialog > header p { max-width: 58ch; margin: 0; color: var(--partner-text-secondary); font-size: var(--partner-font-body); line-height: 1.55; text-wrap: pretty; }\n.dsh-partner-workspace-dialog > header button { display: grid; place-items: center; width: 32px; min-height: 32px; padding: 0; border: 1px solid transparent; border-radius: 9px; color: var(--partner-text-tertiary); background: transparent; box-shadow: none; cursor: pointer; transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease, transform 140ms var(--partner-ease-out); }\n.dsh-partner-workspace-dialog > header button:hover { border-color: var(--partner-border); color: var(--partner-text); background: var(--partner-hover); }\n.dsh-partner-workspace-dialog > header button:active { transform: scale(.94); }\n.dsh-partner-workspace-dialog-body { min-width: 0; min-height: 0; overflow: auto; padding: 20px 22px 24px; overscroll-behavior: contain; scrollbar-gutter: stable; }\n.dsh-partner-workspace-dialog-body > :is(form, .dsh-partner-feature-form, .dsh-partner-task-form, .dsh-partner-schedule-form) { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }\n.dsh-partner-workspace-dialog-body > :is(form, .dsh-partner-task-detail) > footer:last-child { position: sticky; z-index: 2; bottom: -24px; margin: 4px -22px -24px; padding: 14px 22px; border-top: 1px solid var(--partner-separator); background: var(--partner-solid-raised); box-shadow: 0 -10px 24px color-mix(in srgb, #000 5%, transparent); }\n\n.dsh-partner-workspace-notice { display: grid; grid-template-columns: 7px minmax(0, 1fr); align-items: start; gap: 10px; margin: 0 0 14px; padding: 11px 13px; border: 1px solid var(--partner-border); border-radius: 10px; color: var(--partner-text-secondary); background: var(--partner-control); font-size: var(--partner-font-body); line-height: 1.5; }\n.dsh-partner-workspace-notice > i { width: 7px; height: 7px; margin-top: .42em; border-radius: 50%; background: var(--partner-text-tertiary); }\n.dsh-partner-workspace-notice.is-error { border-color: color-mix(in srgb, var(--partner-danger) 30%, var(--partner-border)); color: var(--partner-danger); }\n.dsh-partner-workspace-notice.is-error > i { background: var(--partner-danger); }\n.dsh-partner-workspace-notice.is-warning > i { background: var(--partner-warning); }\n.dsh-partner-workspace-notice.is-success > i { background: var(--partner-success); }\n\n.dsh-partner-collection-empty { display: grid; justify-items: center; padding: 38px 24px 42px; color: var(--partner-text-secondary); text-align: center; }\n.dsh-partner-collection-empty > span { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 12px; border: 1px solid var(--partner-border); border-radius: 13px; color: var(--partner-text-tertiary); background: var(--partner-control); }\n.dsh-partner-collection-empty > strong { color: var(--partner-text); font-size: var(--partner-font-label); font-weight: 620; }\n.dsh-partner-collection-empty > p { max-width: 46ch; margin: 6px 0 14px; color: var(--partner-text-tertiary); font-size: var(--partner-font-body); line-height: 1.55; text-wrap: pretty; }\n.dsh-partner-collection-empty > button { margin-top: 14px; }\n\n.dsh-partner-collection-skeleton { display: grid; gap: 8px; padding: 6px 0; }\n.dsh-partner-collection-skeleton > i { display: block; height: 68px; overflow: hidden; border: 1px solid var(--partner-border); border-radius: 12px; background: linear-gradient(100deg, var(--partner-control) 20%, var(--partner-hover) 38%, var(--partner-control) 56%); background-size: 220% 100%; animation: dsh-partner-skeleton 1.4s ease-in-out infinite; }\n\n.dsh-partner-count-label { display: inline-flex; align-items: baseline; gap: 5px; color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); font-variant-numeric: tabular-nums; }\n.dsh-partner-count-label > b { color: var(--partner-text); font-size: var(--partner-font-label); font-weight: 650; }\n\n@keyframes dsh-partner-dialog-enter { from { opacity: 0; transform: translate3d(0, 10px, 0) scale(.985); } to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); } }\n@keyframes dsh-partner-skeleton { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }\n\n@media (max-width: 760px) {\n .dsh-partner-workspace-dialog-layer { align-items: stretch; padding: 0; }\n .dsh-partner-workspace-dialog, .dsh-partner-workspace-dialog.is-wide { width: 100%; height: 100%; max-height: none; border-width: 0; border-radius: 0; }\n .dsh-partner-workspace-dialog > header { padding: 18px 18px 15px; }\n .dsh-partner-workspace-dialog-body { padding: 18px 18px 26px; }\n .dsh-partner-workspace-dialog-body > :is(form, .dsh-partner-task-detail) > footer:last-child { bottom: -26px; margin: 4px -18px -26px; padding: 13px 18px max(13px, env(safe-area-inset-bottom)); }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dsh-partner-workspace-dialog, .dsh-partner-collection-skeleton > i { animation: none; }\n}\n';
2619
+ 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';
2614
2620
 
2615
2621
  // src/ui/responsive-ui.css
2616
2622
  var responsive_ui_default = `/* Mobile composition lives separately from the desktop visual system so each
@@ -2787,10 +2793,12 @@ var responsive_ui_default = `/* Mobile composition lives separately from the des
2787
2793
  .dsh-partner-board-statuses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
2788
2794
  .dsh-partner-board-statuses > button { min-width: 0; min-height: 44px; justify-content: center; gap: 4px; padding-inline: 5px; }
2789
2795
  .dsh-partner-board { grid-template-columns: 1fr; }
2790
- .dsh-partner-board > section,
2791
- .dsh-partner-board[data-focused="true"] > section { height: min(430px, 55dvh); }
2792
- .dsh-partner-board > section[data-empty="true"],
2793
- .dsh-partner-board[data-focused="true"] > section[data-empty="true"] { height: 112px; }
2796
+ .dsh-partner-board .dsh-partner-board-stage-toggle, .dsh-partner-board-more { min-height: 44px; }
2797
+ .is-board .dsh-partner-board-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
2798
+ .is-board .dsh-partner-board-search, .is-board .dsh-partner-board-tools > small { grid-column: 1 / -1; }
2799
+ .is-board .dsh-partner-board-assignee { grid-column: auto; }
2800
+ .dsh-partner-board-assignee.is-mobile-stage { display: block; }
2801
+ .is-board .dsh-partner-board-statuses { display: none; }
2794
2802
  .dsh-partner-task-fields label { grid-template-columns: 1fr; gap: 5px; }
2795
2803
  .dsh-partner-task-dependency > div > span { min-height: 44px; grid-template-columns: 18px minmax(0, 1fr) 52px; }
2796
2804
  .dsh-partner-task-dependency > div button { min-height: 44px; }
@@ -2860,6 +2868,8 @@ var widget_default = `.dsh-partner-pendant { position: fixed; z-index: 12; top:
2860
2868
  .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; }
2861
2869
  .dsh-partner-pendant-anchor > span { width: 14px; height: 6px; border: 1px solid #71817e; border-radius: 4px; background: #c3ced0; }
2862
2870
  .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; }
2872
+ body[data-ds-dark-theme] .dsh-partner-pendant-unread { border-color: rgb(200 220 213 / 24%); background: #b0c6bd; color: #202e29; }
2863
2873
  .dsh-partner-pendant-announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
2864
2874
  /* Own the reader's surface even under host-wide important focus rules. */
2865
2875
  .dsh-partner-pendant section#dsh-partner-pendant-inbox.dsh-partner-pendant-inbox {
@@ -3847,6 +3857,7 @@ function ActivePendant({ controller, settings }) {
3847
3857
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { children: failed ? inbox.unread ? `${inbox.unread} \u6761\u6D88\u606F` : "\u6D88\u606F" : "\u52A0\u8F7D\u6302\u9970\u2026" })
3848
3858
  ] }) }),
3849
3859
  /* @__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 }),
3850
3861
  /* @__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}` : "" }),
3851
3862
  open && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PendantReader, { inbox, selected, error: error || navigationError, anchor: hit, onSelect: inspect, onClose: close, onVisit: (item) => {
3852
3863
  void visit(item);
@@ -4695,9 +4706,38 @@ function skillScalar(value) {
4695
4706
  }
4696
4707
 
4697
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");
4711
+
4712
+ // src/ui/task-board-stage.tsx
4698
4713
  var import_react14 = require("react");
4699
4714
  var import_dsh_client_ui_primitives7 = require("@deepseek-ai/dsh-client-ui-primitives");
4700
4715
  var import_jsx_runtime10 = require("react/jsx-runtime");
4716
+ 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);
4719
+ const count = Math.max(limit, focused ? 12 : 6);
4720
+ const titleId = `dsh-partner-board-${id}`, listId = `${titleId}-list`;
4721
+ 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 })
4727
+ ] }) }),
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: [
4731
+ "\u5C55\u5F00\u66F4\u591A \xB7 \u8FD8\u6709 ",
4732
+ tasks.length - count,
4733
+ " \u9879"
4734
+ ] })
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" }) })
4736
+ ] });
4737
+ }
4738
+
4739
+ // src/ui/task-board-panel.tsx
4740
+ var import_jsx_runtime11 = require("react/jsx-runtime");
4701
4741
  var COLUMNS = [
4702
4742
  { id: "backlog", label: "\u6536\u96C6\u7BB1" },
4703
4743
  { id: "ready", label: "\u5F85\u5F00\u59CB" },
@@ -4708,25 +4748,25 @@ var COLUMNS = [
4708
4748
  ];
4709
4749
  var LIVE_REFRESH_MS = 4e3;
4710
4750
  function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4711
- const [board, setBoard] = (0, import_react14.useState)({ tasks: [], activities: [] });
4712
- const [directory, setDirectory] = (0, import_react14.useState)([]);
4713
- const [delegations, setDelegations] = (0, import_react14.useState)([]);
4714
- const [creating, setCreating] = (0, import_react14.useState)(false);
4715
- const [selectedTaskId, setSelectedTaskId] = (0, import_react14.useState)(initialTaskId);
4716
- (0, import_react14.useEffect)(() => {
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)(() => {
4717
4757
  if (initialTaskId) setSelectedTaskId(initialTaskId);
4718
4758
  }, [initialTaskId, openRequest]);
4719
- const [busy, setBusy] = (0, import_react14.useState)();
4720
- const [loading, setLoading] = (0, import_react14.useState)(true);
4721
- const [error, setError] = (0, import_react14.useState)();
4722
- const [syncedAt, setSyncedAt] = (0, import_react14.useState)();
4723
- const [query, setQuery] = (0, import_react14.useState)("");
4724
- const [statusFilter, setStatusFilter] = (0, import_react14.useState)("all");
4725
- const [assigneeFilter, setAssigneeFilter] = (0, import_react14.useState)("all");
4726
- const deferredQuery = (0, import_react14.useDeferredValue)(query.trim().toLocaleLowerCase());
4727
- const tasksById = (0, import_react14.useMemo)(() => new Map(board.tasks.map((item) => [item.id, item])), [board.tasks]);
4728
- const directoryById = (0, import_react14.useMemo)(() => new Map(directory.map((item) => [item.id, item])), [directory]);
4729
- const activeDelegationByTaskId = (0, import_react14.useMemo)(() => {
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)(() => {
4730
4770
  const result = /* @__PURE__ */ new Map();
4731
4771
  for (const delegation of delegations) {
4732
4772
  if ((delegation.status === "queued" || delegation.status === "running") && !result.has(delegation.taskId)) result.set(delegation.taskId, delegation);
@@ -4734,24 +4774,24 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4734
4774
  return result;
4735
4775
  }, [delegations]);
4736
4776
  const selectedTask = selectedTaskId ? tasksById.get(selectedTaskId) : void 0;
4737
- const dependentsById = (0, import_react14.useMemo)(() => {
4777
+ const dependentsById = (0, import_react15.useMemo)(() => {
4738
4778
  const result = /* @__PURE__ */ new Map();
4739
4779
  for (const task of board.tasks) for (const dependencyId of task.dependencyTaskIds) result.set(dependencyId, (result.get(dependencyId) ?? 0) + 1);
4740
4780
  return result;
4741
4781
  }, [board.tasks]);
4742
- const scopedTasks = (0, import_react14.useMemo)(() => board.tasks.filter((task) => {
4782
+ const scopedTasks = (0, import_react15.useMemo)(() => board.tasks.filter((task) => {
4743
4783
  if (assigneeFilter !== "all" && (task.assigneeCompanionId ?? "unassigned") !== assigneeFilter) return false;
4744
4784
  if (!deferredQuery) return true;
4745
4785
  const dependencies = task.dependencyTaskIds.map((id) => tasksById.get(id)?.title ?? "");
4746
4786
  return [task.title, task.description, task.resultAbstract, task.resultSummary, directoryById.get(task.assigneeCompanionId ?? "")?.name, ...dependencies].some((value) => value?.toLocaleLowerCase().includes(deferredQuery));
4747
4787
  }), [assigneeFilter, board.tasks, deferredQuery, directoryById, tasksById]);
4748
- const statusCounts = (0, import_react14.useMemo)(() => {
4788
+ const statusCounts = (0, import_react15.useMemo)(() => {
4749
4789
  const result = new Map(COLUMNS.map((column) => [column.id, 0]));
4750
4790
  for (const task of scopedTasks) result.set(task.status, (result.get(task.status) ?? 0) + 1);
4751
4791
  return result;
4752
4792
  }, [scopedTasks]);
4753
4793
  const visibleColumns = statusFilter === "all" ? COLUMNS : COLUMNS.filter((column) => column.id === statusFilter);
4754
- const tasksByStatus = (0, import_react14.useMemo)(() => {
4794
+ const tasksByStatus = (0, import_react15.useMemo)(() => {
4755
4795
  const priorityRank = { urgent: 3, high: 2, normal: 1, low: 0 };
4756
4796
  const result = new Map(COLUMNS.map((column) => [column.id, []]));
4757
4797
  for (const task of scopedTasks) {
@@ -4762,8 +4802,8 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4762
4802
  return result;
4763
4803
  }, [scopedTasks, statusFilter]);
4764
4804
  const visibleTaskCount = statusFilter === "all" ? scopedTasks.length : statusCounts.get(statusFilter) ?? 0;
4765
- const loadingRef = (0, import_react14.useRef)(false);
4766
- const load2 = (0, import_react14.useCallback)(async () => {
4805
+ const loadingRef = (0, import_react15.useRef)(false);
4806
+ const load2 = (0, import_react15.useCallback)(async () => {
4767
4807
  if (loadingRef.current) return;
4768
4808
  loadingRef.current = true;
4769
4809
  try {
@@ -4780,7 +4820,7 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4780
4820
  setLoading(false);
4781
4821
  }
4782
4822
  }, []);
4783
- (0, import_react14.useEffect)(() => {
4823
+ (0, import_react15.useEffect)(() => {
4784
4824
  void load2();
4785
4825
  const timer = window.setInterval(() => {
4786
4826
  if (document.visibilityState === "visible") void load2();
@@ -4870,20 +4910,20 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4870
4910
  setBusy(void 0);
4871
4911
  }
4872
4912
  };
4873
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-feature-page is-board", children: [
4874
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WorkspaceHero, { eyebrow: "Shared workspace", title: "\u4F19\u4F34\u4EFB\u52A1\u770B\u677F", detail: "\u627F\u63A5\u591A\u6B65\u3001\u4F9D\u8D56\u548C\u8DE8\u4F19\u4F34\u5DE5\u4F5C\u3002\u524D\u7F6E\u4EFB\u52A1\u5B8C\u6210\u540E\u624D\u80FD\u6267\u884C\uFF0C\u7ED3\u679C\u9A8C\u6536\u901A\u8FC7\u540E\u624D\u4F1A\u89E3\u9501\u540E\u7EED\u4EFB\u52A1\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
4875
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "dsh-partner-board-live", title: syncedAt ? `\u6700\u8FD1\u540C\u6B65 ${new Date(syncedAt).toLocaleTimeString()}` : "\u6B63\u5728\u8FDE\u63A5", children: [
4876
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}),
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", {}),
4877
4917
  "\u5B9E\u65F6\u540C\u6B65"
4878
4918
  ] }),
4879
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", onClick: () => setCreating(true), children: [
4880
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives7.IconPlusOutline16, { size: 15 }),
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 }),
4881
4921
  "\u65B0\u4EFB\u52A1"
4882
4922
  ] })
4883
4923
  ] }) }),
4884
- error && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WorkspaceNotice, { children: error }),
4885
- creating && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u4EFB\u52A1", detail: "\u5199\u6E05\u76EE\u6807\u3001\u8D1F\u8D23\u4EBA\u548C\u9A8C\u6536\u8FB9\u754C\uFF1B\u53EA\u6709\u771F\u6B63\u5B58\u5728\u524D\u7F6E\u5173\u7CFB\u65F6\u624D\u6DFB\u52A0\u4F9D\u8D56\u3002", close: () => setCreating(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TaskForm, { companions: directory, tasks: board.tasks, close: () => setCreating(false), changed: load2 }) }),
4886
- selectedTask && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WorkspaceDialog, { eyebrow: "TASK DETAIL", title: selectedTask.title, detail: taskDialogSummary(selectedTask, directory), close: () => setSelectedTaskId(void 0), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
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)(
4887
4927
  TaskDetail,
4888
4928
  {
4889
4929
  task: selectedTask,
@@ -4913,63 +4953,70 @@ function TaskBoardPanel({ initialTaskId, openRequest } = {}) {
4913
4953
  },
4914
4954
  selectedTask.id
4915
4955
  ) }),
4916
- loading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CollectionSkeleton, { rows: 6 }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
4917
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-board-tools", children: [
4918
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "dsh-partner-board-search", children: [
4919
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u4EFB\u52A1" }),
4920
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives7.IconSearchOutline16, { size: 16 }) }),
4921
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: "\u641C\u7D22\u4EFB\u52A1\u3001\u8D1F\u8D23\u4EBA\u6216\u524D\u7F6E\u4EFB\u52A1" }),
4922
- query && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => setQuery(""), "aria-label": "\u6E05\u9664\u4EFB\u52A1\u641C\u7D22", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives7.IconCloseOutline16, { size: 14 }) })
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 }) })
4923
4963
  ] }),
4924
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "dsh-partner-board-assignee", children: [
4925
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "\u6309\u8D1F\u8D23\u4EBA\u7B5B\u9009" }),
4926
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { value: assigneeFilter, onChange: (event) => setAssigneeFilter(event.target.value), children: [
4927
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "all", children: "\u5168\u90E8\u4F19\u4F34" }),
4928
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "unassigned", children: "\u672A\u6307\u6D3E" }),
4929
- directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: item.id, children: [
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: [
4930
4970
  "@",
4931
4971
  item.name
4932
4972
  ] }, item.id))
4933
4973
  ] })
4934
4974
  ] }),
4935
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { "aria-live": "polite", children: [
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: [
4979
+ "\u5168\u90E8\u9636\u6BB5 \xB7 ",
4980
+ scopedTasks.length
4981
+ ] }),
4982
+ COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("option", { value: column.id, children: [
4983
+ column.label,
4984
+ " \xB7 ",
4985
+ statusCounts.get(column.id) ?? 0
4986
+ ] }, column.id))
4987
+ ] })
4988
+ ] }),
4989
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("small", { "aria-live": "polite", children: [
4936
4990
  "\u663E\u793A ",
4937
4991
  visibleTaskCount,
4938
4992
  " / ",
4939
4993
  board.tasks.length
4940
4994
  ] })
4941
4995
  ] }),
4942
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("nav", { className: "dsh-partner-board-statuses", "aria-label": "\u6309\u4EFB\u52A1\u72B6\u6001\u7B5B\u9009", children: [
4943
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: statusFilter === "all" ? "is-active" : "", "aria-pressed": statusFilter === "all", onClick: () => setStatusFilter("all"), children: [
4944
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u5168\u90E8" }),
4945
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: scopedTasks.length })
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 })
4946
5000
  ] }),
4947
- COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: statusFilter === column.id ? "is-active" : "", "aria-pressed": statusFilter === column.id, onClick: () => setStatusFilter(column.id), children: [
4948
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: column.label }),
4949
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: statusCounts.get(column.id) ?? 0 })
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 })
4950
5004
  ] }, column.id))
4951
5005
  ] }),
4952
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-board", "data-focused": statusFilter !== "all", "aria-label": "\u4EFB\u52A1\u770B\u677F", children: visibleColumns.map((column) => {
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) => {
4953
5007
  const tasks = tasksByStatus.get(column.id) ?? [];
4954
- const columnTitleId = `dsh-partner-board-${column.id}`;
4955
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { "data-status": column.id, "data-empty": tasks.length === 0, "aria-labelledby": columnTitleId, children: [
4956
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { children: [
4957
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { id: columnTitleId, children: column.label }),
4958
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: tasks.length })
4959
- ] }),
4960
- tasks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-board-column-list", children: tasks.map((task) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4961
- TaskCard,
4962
- {
4963
- task,
4964
- tasksById,
4965
- directoryById,
4966
- dependentCount: dependentsById.get(task.id) ?? 0,
4967
- execution: activeDelegationByTaskId.get(task.id),
4968
- open: () => setSelectedTaskId(task.id)
4969
- },
4970
- task.id
4971
- )) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: query || assigneeFilter !== "all" ? "\u6CA1\u6709\u5339\u914D\u4EFB\u52A1" : "\u6682\u65E0\u4EFB\u52A1" })
4972
- ] }, 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)(
5009
+ TaskCard,
5010
+ {
5011
+ task,
5012
+ tasksById,
5013
+ directoryById,
5014
+ dependentCount: dependentsById.get(task.id) ?? 0,
5015
+ execution: activeDelegationByTaskId.get(task.id),
5016
+ open: () => setSelectedTaskId(task.id)
5017
+ },
5018
+ task.id
5019
+ ) }, column.id);
4973
5020
  }) })
4974
5021
  ] })
4975
5022
  ] });
@@ -4979,62 +5026,62 @@ function TaskCard({ task, tasksById, directoryById, dependentCount, execution, o
4979
5026
  const blockers = dependencies.filter((item) => item.status !== "done");
4980
5027
  const completedDependencies = dependencies.length - blockers.length;
4981
5028
  const assignee = directoryById.get(task.assigneeCompanionId ?? "");
4982
- const executionState = execution ? delegationState(execution) : void 0;
4983
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("article", { className: "dsh-partner-task-card", "data-blocked": blockers.length > 0, "data-priority": task.priority, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "dsh-partner-task-summary", "aria-haspopup": "dialog", onClick: open, children: [
4984
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
4985
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "dsh-partner-task-card-title", children: [
4986
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { title: task.title, children: task.title }),
4987
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("em", { children: priorityLabel(task.priority) })
5029
+ 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) })
4988
5035
  ] }),
4989
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { className: "dsh-partner-task-card-owner", children: [
5036
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("small", { className: "dsh-partner-task-card-owner", children: [
4990
5037
  assignee ? `@${assignee.name}` : "\u672A\u6307\u6D3E",
4991
5038
  task.resultSummary ? " \xB7 \u5DF2\u6709\u7ED3\u679C" : "",
4992
5039
  executionState ? ` \xB7 ${executionState.label}` : ""
4993
5040
  ] }),
4994
- (dependencies.length > 0 || dependentCount > 0) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "dsh-partner-task-relations", children: [
4995
- dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { "data-blocked": blockers.length > 0, children: [
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: [
4996
5043
  "\u524D\u7F6E ",
4997
5044
  completedDependencies,
4998
5045
  "/",
4999
5046
  dependencies.length
5000
5047
  ] }),
5001
- dependentCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { children: [
5048
+ dependentCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("small", { children: [
5002
5049
  "\u5B8C\u6210\u540E\u89E3\u9501 ",
5003
5050
  dependentCount
5004
5051
  ] })
5005
5052
  ] })
5006
5053
  ] }),
5007
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives7.IconChevronRightOutline14, { size: 14 })
5054
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconChevronRightOutline14, { size: 14 })
5008
5055
  ] }) });
5009
5056
  }
5010
5057
  function TaskDetail({ task, tasks, activities, directory, execution, busy, update, delegate, review, accept, reject, remove }) {
5011
- const [rejecting, setRejecting] = (0, import_react14.useState)(false);
5012
- const [rejectReason, setRejectReason] = (0, import_react14.useState)("");
5013
- const [confirmingDelete, setConfirmingDelete] = (0, import_react14.useState)(false);
5014
- const byId = (0, import_react14.useMemo)(() => new Map(tasks.map((item) => [item.id, item])), [tasks]);
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]);
5015
5062
  const dependencies = task.dependencyTaskIds.map((id) => byId.get(id)).filter((item) => item !== void 0);
5016
5063
  const blockers = dependencies.filter((item) => item.status !== "done");
5017
5064
  const assignee = directory.find((item) => item.id === task.assigneeCompanionId);
5018
5065
  const reviewer = directory.find((item) => item.id === task.reviewerCompanionId);
5019
5066
  const dependencyCandidates = tasks.filter((item) => item.id !== task.id && !task.dependencyTaskIds.includes(item.id) && !dependsOn(item.id, task.id, byId));
5020
- const canExecute = Boolean(task.assigneeCompanionId) && blockers.length === 0 && !["doing", "review", "done"].includes(task.status);
5067
+ const canExecute = Boolean(task.assigneeCompanionId) && !execution && !["doing", "review", "done"].includes(task.status);
5021
5068
  const recentActivities = [...activities].sort((left, right) => right.at - left.at).slice(0, 6);
5022
- const executionState = execution ? delegationState(execution) : void 0;
5023
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-task-detail", children: [
5024
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-task-description", children: [
5025
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
5026
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: task.description || "\u6CA1\u6709\u8865\u5145\u8BF4\u660E" })
5069
+ 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" })
5027
5074
  ] }),
5028
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-task-fields", children: [
5029
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5030
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u72B6\u6001" }),
5031
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("select", { value: task.status, disabled: busy, onChange: (event) => update({ status: event.target.value }), children: COLUMNS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: item.id, disabled: (item.id === "doing" || item.id === "review" || item.id === "done") && blockers.length > 0 || item.id === "done" && task.status !== "review" && task.status !== "done", children: item.label }, item.id)) })
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)) })
5032
5079
  ] }),
5033
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5034
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
5035
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { value: task.assigneeCompanionId ?? "", disabled: busy || task.status === "doing", onChange: (event) => update({ assigneeCompanionId: event.target.value }), children: [
5036
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
5037
- directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: item.id, children: [
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: [
5038
5085
  "@",
5039
5086
  item.name,
5040
5087
  " \xB7 ",
@@ -5042,43 +5089,43 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
5042
5089
  ] }, item.id))
5043
5090
  ] })
5044
5091
  ] }),
5045
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5046
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
5047
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { value: task.reviewerCompanionId ?? "", disabled: busy, onChange: (event) => update({ reviewerCompanionId: event.target.value }), children: [
5048
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
5049
- directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: item.id, children: [
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: [
5050
5097
  "@",
5051
5098
  item.name
5052
5099
  ] }, item.id))
5053
5100
  ] })
5054
5101
  ] })
5055
5102
  ] }),
5056
- executionState && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-task-execution", "data-state": execution?.status, children: [
5057
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}),
5058
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
5059
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: executionState.title }),
5060
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: executionState.detail })
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 })
5061
5108
  ] })
5062
5109
  ] }),
5063
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-task-dependency", children: [
5064
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { children: [
5065
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u524D\u7F6E\u4EFB\u52A1" }),
5066
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: blockers.length ? `${blockers.length} \u9879\u672A\u5B8C\u6210\uFF0C\u5F53\u524D\u4EFB\u52A1\u4E0D\u80FD\u542F\u52A8` : dependencies.length ? "\u5DF2\u5168\u90E8\u5B8C\u6210\uFF0C\u53EF\u4EE5\u542F\u52A8" : "\u6CA1\u6709\u524D\u7F6E\u4F9D\u8D56" })
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" })
5067
5114
  ] }),
5068
- dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: dependencies.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { "data-done": item.status === "done", children: [
5069
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", { children: item.status === "done" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives7.IconCheckOutline16, { size: 12 }) : "" }),
5070
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: item.title }),
5071
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy || ["doing", "review", "done"].includes(task.status), "aria-label": `\u79FB\u9664\u524D\u7F6E\u4EFB\u52A1 ${item.title}`, onClick: () => update({ dependencyTaskIds: task.dependencyTaskIds.filter((id) => id !== item.id) }), children: "\u79FB\u9664" })
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" })
5072
5119
  ] }, item.id)) }),
5073
- dependencyCandidates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5074
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1" }),
5075
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { defaultValue: "", disabled: busy || ["doing", "review", "done"].includes(task.status), onChange: (event) => {
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) => {
5076
5123
  const id = event.currentTarget.value;
5077
5124
  if (id) update({ dependencyTaskIds: [...task.dependencyTaskIds, id] });
5078
5125
  event.currentTarget.value = "";
5079
5126
  }, children: [
5080
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1\u2026" }),
5081
- dependencyCandidates.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: item.id, 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: [
5082
5129
  item.title,
5083
5130
  " \xB7 ",
5084
5131
  statusLabel(item.status)
@@ -5086,16 +5133,16 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
5086
5133
  ] })
5087
5134
  ] })
5088
5135
  ] }),
5089
- task.resultSummary && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ResultBlock, { label: "\u6267\u884C\u7ED3\u679C", value: task.resultSummary }),
5090
- task.reviewSummary && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ResultBlock, { label: `\u6838\u9A8C\u610F\u89C1${reviewer ? ` \xB7 @${reviewer.name}` : ""}`, value: task.reviewSummary }),
5091
- recentActivities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-task-activity", children: [
5092
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u6700\u8FD1\u6D3B\u52A8" }),
5093
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ol", { children: recentActivities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("li", { children: [
5094
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: item.message }),
5095
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("time", { children: new Date(item.at).toLocaleString() })
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() })
5096
5143
  ] }, item.id)) })
5097
5144
  ] }),
5098
- rejecting && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { className: "dsh-partner-task-reject", onSubmit: (event) => {
5145
+ rejecting && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("form", { className: "dsh-partner-task-reject", onSubmit: (event) => {
5099
5146
  event.preventDefault();
5100
5147
  const reason = rejectReason.trim();
5101
5148
  if (!reason) return;
@@ -5103,52 +5150,52 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
5103
5150
  setRejecting(false);
5104
5151
  setRejectReason("");
5105
5152
  }, children: [
5106
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5107
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u6253\u56DE\u539F\u56E0" }),
5108
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("textarea", { autoFocus: true, value: rejectReason, onChange: (event) => setRejectReason(event.target.value), rows: 3, maxLength: 1200, placeholder: "\u8BF4\u660E\u9700\u8981\u91CD\u505A\u6216\u8865\u5145\u7684\u5185\u5BB9" })
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" })
5109
5156
  ] }),
5110
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
5111
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => {
5157
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
5158
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", onClick: () => {
5112
5159
  setRejecting(false);
5113
5160
  setRejectReason("");
5114
5161
  }, children: "\u53D6\u6D88" }),
5115
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !rejectReason.trim(), children: "\u786E\u8BA4\u6253\u56DE" })
5162
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !rejectReason.trim(), children: "\u786E\u8BA4\u6253\u56DE" })
5116
5163
  ] })
5117
5164
  ] }),
5118
- confirmingDelete && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-task-delete-confirm", role: "alert", children: [
5119
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u5220\u9664\u540E\uFF0C\u4F9D\u8D56\u5B83\u7684\u4EFB\u52A1\u4F1A\u89E3\u9664\u8FD9\u6761\u524D\u7F6E\u5173\u7CFB\u3002" }),
5120
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
5121
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => setConfirmingDelete(false), children: "\u53D6\u6D88" }),
5122
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
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" })
5123
5170
  ] })
5124
5171
  ] }),
5125
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("footer", { className: "dsh-partner-task-actions", children: [
5126
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { children: [
5172
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("footer", { className: "dsh-partner-task-actions", children: [
5173
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("small", { children: [
5127
5174
  "r",
5128
5175
  task.revision,
5129
5176
  " \xB7 ",
5130
5177
  new Date(task.updatedAt).toLocaleString()
5131
5178
  ] }),
5132
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
5133
- task.status === "review" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
5134
- task.reviewerCompanionId && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy, onClick: review, children: busy ? "\u6838\u9A8C\u4E2D\u2026" : `\u4EA4\u7ED9 @${reviewer?.name ?? "\u4F19\u4F34"} \u6838\u9A8C` }),
5135
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy, onClick: () => setRejecting(true), children: "\u6253\u56DE\u91CD\u505A" }),
5136
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: accept, children: "\u9A8C\u6536\u901A\u8FC7" })
5137
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy || !canExecute, title: blockers.length ? "\u524D\u7F6E\u4EFB\u52A1\u5C1A\u672A\u5B8C\u6210" : !task.assigneeCompanionId ? "\u8BF7\u5148\u9009\u62E9\u8D1F\u8D23\u4EBA" : void 0, onClick: delegate, children: busy ? "\u6267\u884C\u4E2D\u2026" : task.status === "doing" ? "\u6B63\u5728\u6267\u884C" : task.status === "done" ? "\u5DF2\u7ECF\u5B8C\u6210" : `\u4EA4\u7ED9 @${assignee?.name ?? "\u4F19\u4F34"}` }),
5138
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "is-icon", "aria-label": `\u5220\u9664 ${task.title}`, "aria-expanded": confirmingDelete, disabled: busy, onClick: () => setConfirmingDelete(true), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives7.IconTrashOutline16, { size: 14 }) })
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 }) })
5139
5186
  ] })
5140
5187
  ] })
5141
5188
  ] });
5142
5189
  }
5143
5190
  function ResultBlock({ label, value }) {
5144
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-task-result", children: [
5145
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: label }),
5146
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: 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 })
5147
5194
  ] });
5148
5195
  }
5149
5196
  function TaskForm({ companions, tasks, close, changed: changed2 }) {
5150
- const [error, setError] = (0, import_react14.useState)();
5151
- const [busy, setBusy] = (0, import_react14.useState)(false);
5197
+ const [error, setError] = (0, import_react15.useState)();
5198
+ const [busy, setBusy] = (0, import_react15.useState)(false);
5152
5199
  const dependencyOptions = tasks.filter((item) => item.status !== "done");
5153
5200
  const submit = async (event) => {
5154
5201
  event.preventDefault();
@@ -5160,7 +5207,7 @@ function TaskForm({ companions, tasks, close, changed: changed2 }) {
5160
5207
  title: data.get("title"),
5161
5208
  description: data.get("description"),
5162
5209
  priority: data.get("priority"),
5163
- status: "backlog",
5210
+ autoRun: data.get("submission") === "run" && Boolean(data.get("assignee")),
5164
5211
  assigneeCompanionId: data.get("assignee") || void 0,
5165
5212
  reviewerCompanionId: data.get("reviewer") || void 0,
5166
5213
  dependencyTaskIds: data.getAll("dependencyTaskId")
@@ -5173,64 +5220,71 @@ function TaskForm({ companions, tasks, close, changed: changed2 }) {
5173
5220
  setBusy(false);
5174
5221
  }
5175
5222
  };
5176
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { className: "dsh-partner-task-form", "aria-busy": busy, onSubmit: (event) => {
5223
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("form", { className: "dsh-partner-task-form", "aria-busy": busy, onSubmit: (event) => {
5177
5224
  void submit(event);
5178
5225
  }, children: [
5179
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5180
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u4EFB\u52A1\u540D\u79F0" }),
5181
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { name: "title", maxLength: 200, required: true, autoFocus: true, placeholder: "\u4E00\u53E5\u8BDD\u8BF4\u660E\u4EA4\u4ED8\u76EE\u6807" })
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" })
5182
5229
  ] }),
5183
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5184
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
5185
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { name: "assignee", defaultValue: "", children: [
5186
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
5187
- companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: item.id, children: [
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: [
5188
5235
  "@",
5189
5236
  item.name
5190
5237
  ] }, item.id))
5191
5238
  ] })
5192
5239
  ] }),
5193
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "is-wide", children: [
5194
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
5195
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("textarea", { name: "description", maxLength: 8e3, rows: 5, placeholder: "\u8865\u5145\u80CC\u666F\u3001\u4EA4\u4ED8\u7269\u548C\u5B8C\u6210\u6761\u4EF6" })
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" })
5196
5243
  ] }),
5197
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5198
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u4F18\u5148\u7EA7" }),
5199
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { name: "priority", defaultValue: "normal", children: [
5200
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "low", children: "\u4F4E" }),
5201
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "normal", children: "\u666E\u901A" }),
5202
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "high", children: "\u9AD8" }),
5203
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "urgent", children: "\u7D27\u6025" })
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" })
5204
5251
  ] })
5205
5252
  ] }),
5206
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5207
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
5208
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { name: "reviewer", defaultValue: "", children: [
5209
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
5210
- companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: item.id, children: [
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: [
5211
5258
  "@",
5212
5259
  item.name
5213
5260
  ] }, item.id))
5214
5261
  ] })
5215
5262
  ] }),
5216
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-task-form-dependencies is-wide", children: [
5217
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
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: [
5218
5265
  "\u4F9D\u8D56\u4EFB\u52A1 ",
5219
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u53EF\u9009" })
5266
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("small", { children: "\u53EF\u9009" })
5220
5267
  ] }),
5221
- dependencyOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: dependencyOptions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
5222
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { type: "checkbox", name: "dependencyTaskId", value: item.id }),
5223
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}),
5224
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: item.title }),
5225
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: statusLabel(item.status) })
5226
- ] }, item.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: "\u5F53\u524D\u6CA1\u6709\u53EF\u9009\u7684\u672A\u5B8C\u6210\u4EFB\u52A1" }),
5227
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u53EF\u4EE5\u9009\u62E9\u591A\u4E2A\uFF1B\u7559\u7A7A\u8868\u793A\u8BE5\u4EFB\u52A1\u4E0D\u4F9D\u8D56\u5176\u4ED6\u4EFB\u52A1\u3002" })
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" })
5275
+ ] }),
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" })
5281
+ ] })
5228
5282
  ] }),
5229
- error && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WorkspaceNotice, { children: error }),
5230
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("footer", { children: [
5231
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
5232
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
5233
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives7.IconPlusOutline16, { size: 14 }),
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 }),
5234
5288
  busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u4EFB\u52A1"
5235
5289
  ] })
5236
5290
  ] })
@@ -5252,9 +5306,10 @@ function taskDialogSummary(task, directory) {
5252
5306
  function priorityLabel(value) {
5253
5307
  return { low: "\u4F4E\u4F18\u5148\u7EA7", normal: "\u666E\u901A\u4F18\u5148\u7EA7", high: "\u9AD8\u4F18\u5148\u7EA7", urgent: "\u7D27\u6025" }[value];
5254
5308
  }
5255
- function delegationState(value) {
5309
+ function delegationState(value, blockers = 0) {
5256
5310
  const review = value.kind === "review";
5257
5311
  if (value.status === "queued") {
5312
+ if ((value.attempts ?? 0) === 0) return blockers ? { label: "\u7B49\u5F85\u524D\u7F6E\u5B8C\u6210", title: "\u4EFB\u52A1\u5DF2\u63D0\u4EA4\uFF0C\u7B49\u5F85\u4F9D\u8D56", detail: `\u8FD8\u6709 ${blockers} \u4E2A\u524D\u7F6E\u4EFB\u52A1\u672A\u901A\u8FC7\u9A8C\u6536\uFF1B\u5168\u90E8\u5B8C\u6210\u540E\u81EA\u52A8\u6267\u884C\uFF0C\u65E0\u9700\u518D\u6B21\u6307\u6D3E\u3002` } : { label: "\u6392\u961F\u4E2D", title: "\u4EFB\u52A1\u5DF2\u63D0\u4EA4", detail: "\u6B63\u5728\u7B49\u5F85\u53EF\u7528\u6267\u884C\u540D\u989D\uFF0C\u65E0\u9700\u518D\u6B21\u6307\u6D3E\u3002" };
5258
5313
  const at = value.nextAttemptAt ? new Date(value.nextAttemptAt).toLocaleString() : "\u7A0D\u540E";
5259
5314
  return { label: "\u7B49\u5F85\u81EA\u52A8\u6062\u590D", title: review ? "\u9A8C\u6536\u5C06\u5728\u8FDE\u63A5\u6062\u590D\u540E\u7EE7\u7EED" : "\u4EFB\u52A1\u5C06\u5728\u8FDE\u63A5\u6062\u590D\u540E\u7EE7\u7EED", detail: `${at} \u81EA\u52A8\u91CD\u8BD5${value.error ? ` \xB7 ${value.error}` : ""}` };
5260
5315
  }
@@ -5267,17 +5322,17 @@ function delegationState(value) {
5267
5322
  }
5268
5323
 
5269
5324
  // src/ui/schedule-panel.tsx
5270
- var import_react15 = require("react");
5271
- var import_dsh_client_ui_primitives8 = require("@deepseek-ai/dsh-client-ui-primitives");
5272
- var import_jsx_runtime11 = require("react/jsx-runtime");
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");
5273
5328
  function SchedulePanel({ companions }) {
5274
- const [schedules, setSchedules] = (0, import_react15.useState)([]);
5275
- const [runs, setRuns] = (0, import_react15.useState)([]);
5276
- const [creating, setCreating] = (0, import_react15.useState)(false);
5277
- const [busy, setBusy] = (0, import_react15.useState)();
5278
- const [loading, setLoading] = (0, import_react15.useState)(true);
5279
- const [error, setError] = (0, import_react15.useState)();
5280
- const load2 = (0, import_react15.useCallback)(async () => {
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 () => {
5281
5336
  try {
5282
5337
  const value = await api("/schedules");
5283
5338
  setSchedules(value.schedules);
@@ -5289,7 +5344,7 @@ function SchedulePanel({ companions }) {
5289
5344
  setLoading(false);
5290
5345
  }
5291
5346
  }, []);
5292
- (0, import_react15.useEffect)(() => {
5347
+ (0, import_react16.useEffect)(() => {
5293
5348
  void load2();
5294
5349
  }, [load2]);
5295
5350
  const update = async (entry, value) => {
@@ -5325,65 +5380,65 @@ function SchedulePanel({ companions }) {
5325
5380
  setBusy(void 0);
5326
5381
  }
5327
5382
  };
5328
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-partner-feature-page", children: [
5329
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WorkspaceHero, { eyebrow: "Ephemeral automation", title: "\u4F19\u4F34\u5B9A\u65F6\u4EFB\u52A1", detail: "\u7531\u6307\u5B9A\u4F19\u4F34\u5728\u9694\u79BB\u4E34\u65F6\u4F1A\u8BDD\u4E2D\u6267\u884C\uFF1B\u9ED8\u8BA4\u5B8C\u6210\u5373\u9500\u6BC1\uFF0C\u907F\u514D\u957F\u671F\u4F1A\u8BDD\u88AB\u540E\u53F0\u4EFB\u52A1\u6C61\u67D3\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
5330
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", disabled: loading, onClick: () => {
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: () => {
5331
5386
  void load2();
5332
5387
  }, children: [
5333
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconRefreshOutline16, { size: 15 }),
5388
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.IconRefreshOutline16, { size: 15 }),
5334
5389
  "\u5237\u65B0"
5335
5390
  ] }),
5336
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
5337
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconPlusOutline16, { size: 15 }),
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 }),
5338
5393
  "\u65B0\u8BA1\u5212"
5339
5394
  ] })
5340
5395
  ] }) }),
5341
- error && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WorkspaceNotice, { children: error }),
5342
- creating && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u5B9A\u65F6\u4EFB\u52A1", detail: "\u9009\u62E9\u6267\u884C\u4F19\u4F34\u3001\u8FD0\u884C\u9891\u7387\u548C\u4F1A\u8BDD\u4FDD\u7559\u7B56\u7565\u3002\u8BA1\u5212\u521B\u5EFA\u540E\u53EF\u4EE5\u968F\u65F6\u505C\u7528\u6216\u7ACB\u5373\u6267\u884C\u3002", close: () => setCreating(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ScheduleForm, { companions, close: () => setCreating(false), changed: load2 }) }),
5343
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WorkspaceBlock, { title: "\u6267\u884C\u8BA1\u5212", detail: `${schedules.filter((item) => item.enabled).length} \u4E2A\u542F\u7528`, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CollectionSkeleton, { rows: 3 }) : schedules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u5B9A\u65F6\u4EFB\u52A1", detail: "\u521B\u5EFA\u8BA1\u5212\u540E\uFF0C\u4F19\u4F34\u4F1A\u6309\u8BBE\u5B9A\u5728\u72EC\u7ACB\u4F1A\u8BDD\u4E2D\u6267\u884C\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
5344
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconPlusOutline16, { size: 14 }),
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 }),
5345
5400
  "\u521B\u5EFA\u7B2C\u4E00\u4E2A\u8BA1\u5212"
5346
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-partner-schedule-list", children: schedules.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("article", { children: [
5347
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
5348
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: entry.title }),
5349
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: entry.prompt }),
5350
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-partner-schedule-meta", children: [
5351
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("em", { children: [
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: [
5352
5407
  "@",
5353
5408
  companionName(companions, entry.companionId)
5354
5409
  ] }),
5355
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("em", { children: scheduleLabel(entry) }),
5356
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("em", { children: [
5410
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("em", { children: scheduleLabel(entry) }),
5411
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("em", { children: [
5357
5412
  "\u4E0B\u6B21 ",
5358
5413
  new Date(entry.nextRunAt).toLocaleString()
5359
5414
  ] }),
5360
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("em", { children: entry.destroySessionAfterRun ? "\u6267\u884C\u540E\u9500\u6BC1" : "\u4FDD\u7559\u4F1A\u8BDD" })
5415
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("em", { children: entry.destroySessionAfterRun ? "\u6267\u884C\u540E\u9500\u6BC1" : "\u4FDD\u7559\u4F1A\u8BDD" })
5361
5416
  ] })
5362
5417
  ] }),
5363
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "dsh-partner-feature-switch", "data-on": entry.enabled, "aria-pressed": entry.enabled, disabled: busy === entry.id, onClick: () => {
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: () => {
5364
5419
  void update(entry, { enabled: !entry.enabled });
5365
- }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", {}) }),
5366
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", disabled: busy === entry.id, onClick: () => {
5420
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", {}) }),
5421
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", disabled: busy === entry.id, onClick: () => {
5367
5422
  void run(entry);
5368
5423
  }, children: [
5369
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconPlayOutline16, { size: 14 }),
5424
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.IconPlayOutline16, { size: 14 }),
5370
5425
  busy === entry.id ? "\u6267\u884C\u4E2D\u2026" : "\u7ACB\u5373\u6267\u884C"
5371
5426
  ] }),
5372
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "is-icon", disabled: busy === entry.id, onClick: () => {
5427
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "is-icon", disabled: busy === entry.id, onClick: () => {
5373
5428
  void remove(entry);
5374
- }, "aria-label": `\u5220\u9664 ${entry.title}`, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconTrashOutline16, { size: 14 }) })
5429
+ }, "aria-label": `\u5220\u9664 ${entry.title}`, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.IconTrashOutline16, { size: 14 }) })
5375
5430
  ] }, entry.id)) }) }),
5376
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(WorkspaceBlock, { title: "\u6700\u8FD1\u8FD0\u884C", detail: "\u4FDD\u7559\u6700\u8FD1\u7684\u72B6\u6001\u4E0E\u7ED3\u679C\u6458\u8981", children: [
5377
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-partner-run-list", children: runs.map((run2) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("article", { "data-status": run2.status, children: [
5378
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", {}),
5379
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
5380
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("strong", { children: [
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: [
5381
5436
  schedules.find((item) => item.id === run2.sourceId)?.title ?? "\u5DF2\u5220\u9664\u8BA1\u5212",
5382
5437
  " \xB7 @",
5383
5438
  companionName(companions, run2.ownerCompanionId)
5384
5439
  ] }),
5385
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: run2.error || run2.outputSummary || "\u7B49\u5F85\u7ED3\u679C" }),
5386
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("small", { children: [
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: [
5387
5442
  new Date(run2.startedAt).toLocaleString(),
5388
5443
  " \xB7 ",
5389
5444
  run2.status,
@@ -5392,14 +5447,14 @@ function SchedulePanel({ companions }) {
5392
5447
  ] })
5393
5448
  ] })
5394
5449
  ] }, run2.id)) }),
5395
- !loading && runs.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u6267\u884C\u8BB0\u5F55", detail: "\u8BA1\u5212\u7B2C\u4E00\u6B21\u6267\u884C\u540E\uFF0C\u7ED3\u679C\u548C\u8017\u65F6\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002" })
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" })
5396
5451
  ] })
5397
5452
  ] });
5398
5453
  }
5399
5454
  function ScheduleForm({ companions, close, changed: changed2 }) {
5400
- const [kind, setKind] = (0, import_react15.useState)("interval");
5401
- const [error, setError] = (0, import_react15.useState)();
5402
- const [busy, setBusy] = (0, import_react15.useState)(false);
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);
5403
5458
  const submit = async (event) => {
5404
5459
  event.preventDefault();
5405
5460
  const data = new FormData(event.currentTarget);
@@ -5416,18 +5471,18 @@ function ScheduleForm({ companions, close, changed: changed2 }) {
5416
5471
  setBusy(false);
5417
5472
  }
5418
5473
  };
5419
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("form", { className: "dsh-partner-schedule-form", "aria-busy": busy, onSubmit: (event) => {
5474
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("form", { className: "dsh-partner-schedule-form", "aria-busy": busy, onSubmit: (event) => {
5420
5475
  void submit(event);
5421
5476
  }, children: [
5422
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5423
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u8BA1\u5212\u540D\u79F0" }),
5424
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { name: "title", required: true, maxLength: 160, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u6BCF\u65E5\u6574\u7406\u9879\u76EE\u53D8\u5316" })
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" })
5425
5480
  ] }),
5426
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5427
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u6267\u884C\u4F19\u4F34" }),
5428
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("select", { name: "companionId", required: true, defaultValue: companions[0]?.id ?? "", children: [
5429
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "", disabled: true, children: "\u9009\u62E9\u4F19\u4F34" }),
5430
- companions.map((companion) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("option", { value: companion.id, children: [
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: [
5431
5486
  "@",
5432
5487
  companion.name,
5433
5488
  " \xB7 ",
@@ -5435,51 +5490,51 @@ function ScheduleForm({ companions, close, changed: changed2 }) {
5435
5490
  ] }, companion.id))
5436
5491
  ] })
5437
5492
  ] }),
5438
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "is-wide", children: [
5439
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u6267\u884C\u5185\u5BB9" }),
5440
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("textarea", { name: "prompt", required: true, maxLength: 12e3, rows: 5, placeholder: "\u660E\u786E\u8BF4\u660E\u8981\u68C0\u67E5\u3001\u6574\u7406\u6216\u5B8C\u6210\u4EC0\u4E48\uFF0C\u4EE5\u53CA\u5E0C\u671B\u8FD4\u56DE\u4EC0\u4E48\u7ED3\u679C" })
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" })
5441
5496
  ] }),
5442
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5443
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u9891\u7387" }),
5444
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("select", { value: kind, onChange: (event) => setKind(event.target.value), children: [
5445
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "interval", children: "\u6BCF\u9694\u4E00\u6BB5\u65F6\u95F4" }),
5446
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "daily", children: "\u6BCF\u5929\u56FA\u5B9A\u65F6\u95F4" })
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" })
5447
5502
  ] })
5448
5503
  ] }),
5449
- kind === "interval" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5450
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u95F4\u9694\u5206\u949F" }),
5451
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { name: "minutes", type: "number", min: 5, max: 43200, defaultValue: 60 })
5452
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-partner-schedule-time", children: [
5453
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5454
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u5C0F\u65F6" }),
5455
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { name: "hour", type: "number", min: 0, max: 23, defaultValue: 9 })
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 })
5456
5511
  ] }),
5457
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5458
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u5206\u949F" }),
5459
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { name: "minute", type: "number", min: 0, max: 59, defaultValue: 0 })
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 })
5460
5515
  ] })
5461
5516
  ] }),
5462
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5463
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u91CD\u53E0\u7B56\u7565" }),
5464
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("select", { name: "overlapPolicy", defaultValue: "skip", children: [
5465
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "skip", children: "\u8DF3\u8FC7\u91CD\u53E0" }),
5466
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "queue", children: "\u6392\u961F\u6267\u884C" })
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" })
5467
5522
  ] })
5468
5523
  ] }),
5469
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
5470
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u8D85\u65F6\u5206\u949F" }),
5471
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { name: "timeoutMinutes", type: "number", min: 1, max: 120, defaultValue: 10 })
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 })
5472
5527
  ] }),
5473
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "dsh-partner-check is-wide", children: [
5474
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { name: "retain", type: "checkbox" }),
5475
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("i", {}),
5476
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: "\u6267\u884C\u540E\u4FDD\u7559\u4E34\u65F6\u4F1A\u8BDD" })
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" })
5477
5532
  ] }),
5478
- error && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WorkspaceNotice, { children: error }),
5479
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("footer", { children: [
5480
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
5481
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
5482
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives8.IconPlusOutline16, { size: 14 }),
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 }),
5483
5538
  busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u8BA1\u5212"
5484
5539
  ] })
5485
5540
  ] })
@@ -5492,9 +5547,9 @@ function companionName(companions, id) {
5492
5547
  return companions.find((item) => item.id === id)?.name ?? "\u5DF2\u5220\u9664\u4F19\u4F34";
5493
5548
  }
5494
5549
 
5495
- // src/ui/companion-access-panel.tsx
5496
- var import_react16 = require("react");
5497
- var import_dsh_client_ui_primitives9 = require("@deepseek-ai/dsh-client-ui-primitives");
5550
+ // 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");
5498
5553
 
5499
5554
  // src/capabilities.ts
5500
5555
  var COMPANION_CAPABILITIES = ["knowledge", "skills", "ssh", "git", "companions", "schedules", "access", "administration"];
@@ -5513,12 +5568,14 @@ function isCompanionCapability(value) {
5513
5568
  }
5514
5569
 
5515
5570
  // src/ui/companion-access-panel.tsx
5516
- var import_jsx_runtime12 = require("react/jsx-runtime");
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");
5517
5574
  function CompanionAccessPanel({ companionId }) {
5518
- const [access, setAccess] = (0, import_react16.useState)({ targetIds: [], companions: [] });
5519
- const [busy, setBusy] = (0, import_react16.useState)();
5520
- const [error, setError] = (0, import_react16.useState)();
5521
- const load2 = (0, import_react16.useCallback)(async () => {
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 () => {
5522
5579
  try {
5523
5580
  setAccess(await api(`/companions/${encodeURIComponent(companionId)}/access`));
5524
5581
  setError(void 0);
@@ -5526,7 +5583,7 @@ function CompanionAccessPanel({ companionId }) {
5526
5583
  setError(errorMessage(reason));
5527
5584
  }
5528
5585
  }, [companionId]);
5529
- (0, import_react16.useEffect)(() => {
5586
+ (0, import_react17.useEffect)(() => {
5530
5587
  void load2();
5531
5588
  }, [load2]);
5532
5589
  const toggle = async (targetId) => {
@@ -5545,51 +5602,302 @@ function CompanionAccessPanel({ companionId }) {
5545
5602
  setBusy(void 0);
5546
5603
  }
5547
5604
  };
5548
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: "dsh-partner-capability-detail dsh-partner-access", "aria-labelledby": "dsh-partner-access-title", children: [
5549
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("header", { children: [
5550
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
5551
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "DIRECTED ACCESS" }),
5552
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { id: "dsh-partner-access-title", children: "\u53EF\u8BBF\u95EE\u7684\u4F19\u4F34" })
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" })
5553
5610
  ] }),
5554
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("em", { children: [
5611
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("em", { children: [
5555
5612
  access.targetIds.length,
5556
5613
  " \u4F4D\u5DF2\u6388\u6743"
5557
5614
  ] })
5558
5615
  ] }),
5559
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsh-partner-access-note", children: "\u52FE\u9009\u540E\uFF0C\u5F53\u524D\u4F19\u4F34\u80FD\u4E86\u89E3\u5BF9\u65B9\u7684\u516C\u5F00\u80FD\u529B\uFF0C\u5E76\u5728\u4EFB\u52A1\u770B\u677F\u4E2D `@` \u5BF9\u65B9\u6267\u884C\u4EFB\u52A1\u3002\u6388\u6743\u53EA\u6CBF\u5F53\u524D\u65B9\u5411\u751F\u6548\uFF0C\u4E0D\u4F1A\u53CD\u5411\u6388\u6743\uFF0C\u4E5F\u4E0D\u4F1A\u5171\u4EAB\u4F1A\u8BDD\u3001\u8BB0\u5FC6\u3001\u6E20\u9053\u6216\u51ED\u636E\u3002" }),
5560
- access.companions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u53EF\u6388\u6743\u7684\u4F19\u4F34", detail: "\u521B\u5EFA\u7B2C\u4E8C\u4F4D\u4F19\u4F34\u540E\uFF0C\u53EF\u4EE5\u5728\u8FD9\u91CC\u5EFA\u7ACB\u5355\u5411\u534F\u4F5C\u6388\u6743\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "dsh-partner-access-list", children: access.companions.map((companion) => {
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) => {
5561
5618
  const selected = access.targetIds.includes(companion.id);
5562
5619
  const abilities = companion.capabilities.map((capability) => isCompanionCapability(capability) ? CAPABILITY_LABELS[capability] : capability);
5563
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", className: selected ? "is-active" : "", "aria-pressed": selected, disabled: busy === companion.id, onClick: () => {
5620
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", className: selected ? "is-active" : "", "aria-pressed": selected, disabled: busy === companion.id, onClick: () => {
5564
5621
  void toggle(companion.id);
5565
5622
  }, children: [
5566
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "dsh-partner-access-avatar", "aria-hidden": "true", children: initials(companion.name) }),
5567
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsh-partner-access-copy", children: [
5568
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("strong", { 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: [
5569
5626
  "@",
5570
5627
  companion.name
5571
5628
  ] }),
5572
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: companion.role }),
5573
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: companion.description || "\u672A\u586B\u5199\u4F19\u4F34\u8BF4\u660E" }),
5574
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: [...abilities, ...companion.enabledSkills.map((skill) => skill.name)].map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("em", { children: item }, item)) })
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)) })
5575
5632
  ] }),
5576
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "dsh-partner-access-check", "aria-hidden": "true", children: selected && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives9.IconCheckOutline16, { size: 15 }) })
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 }) })
5577
5634
  ] }, companion.id);
5578
5635
  }) }),
5579
- error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(WorkspaceNotice, { children: error })
5636
+ error && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WorkspaceNotice, { children: error })
5580
5637
  ] });
5581
5638
  }
5582
5639
  function initials(name) {
5583
5640
  return [...name.trim()].slice(0, 2).join("").toUpperCase() || "AI";
5584
5641
  }
5585
5642
 
5643
+ // src/ui/companion-draft.ts
5644
+ function companionDraft(companion) {
5645
+ return { name: companion.name, role: companion.role, description: companion.description, instructions: companion.instructions, presetId: companion.presetId ?? "", provider: companion.provider ?? "", model: companion.model ?? "", capabilities: [...companion.capabilities] };
5646
+ }
5647
+
5648
+ // src/ui/capability-editor.tsx
5649
+ var import_jsx_runtime14 = require("react/jsx-runtime");
5650
+ 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)(() => {
5659
+ mounted.current = true;
5660
+ return () => {
5661
+ mounted.current = false;
5662
+ };
5663
+ }, []);
5664
+ (0, import_react18.useEffect)(() => {
5665
+ if (!savingRef.current) setForm(companionDraft(companion));
5666
+ }, [companion.id, companion.updatedAt]);
5667
+ (0, import_react18.useEffect)(() => {
5668
+ void api("/models").then((value) => {
5669
+ if (mounted.current) setModelCatalog(value);
5670
+ }).catch((reason) => {
5671
+ if (mounted.current) setError(errorMessage(reason));
5672
+ });
5673
+ }, []);
5674
+ const edit = (next) => {
5675
+ if (savingRef.current) return;
5676
+ setForm(next);
5677
+ setSaved(false);
5678
+ setError(void 0);
5679
+ };
5680
+ const toggle = (capability) => edit({ ...form, capabilities: form.capabilities.includes(capability) ? form.capabilities.filter((item) => item !== capability) : [...form.capabilities, capability] });
5681
+ const save = async () => {
5682
+ if (savingRef.current) return;
5683
+ savingRef.current = true;
5684
+ setSaving(true);
5685
+ setSaved(false);
5686
+ setError(void 0);
5687
+ try {
5688
+ await api(`/companions/${companion.id}`, { method: "PUT", body: JSON.stringify({ companion: form }) });
5689
+ if (!mounted.current) return;
5690
+ setSaved(true);
5691
+ try {
5692
+ await onChanged();
5693
+ } catch {
5694
+ if (mounted.current) setError("\u80FD\u529B\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u5217\u8868\u5237\u65B0\u5931\u8D25\u3002\u5237\u65B0\u9875\u9762\u5373\u53EF\uFF0C\u65E0\u9700\u91CD\u590D\u5E94\u7528\u3002");
5695
+ }
5696
+ } catch (reason) {
5697
+ if (mounted.current) setError(`\u4FDD\u5B58\u5931\u8D25\uFF1A${errorMessage(reason)}\u3002\u5F53\u524D\u9009\u62E9\u5DF2\u4FDD\u7559\uFF0C\u53EF\u91CD\u8BD5\u3002`);
5698
+ } finally {
5699
+ savingRef.current = false;
5700
+ if (mounted.current) setSaving(false);
5701
+ }
5702
+ };
5703
+ const groups = [
5704
+ { id: "tools", eyebrow: "TOOLS", title: "\u5DE5\u4F5C\u5DE5\u5177", detail: "\u8FDE\u63A5\u5F53\u524D\u4F19\u4F34\u80FD\u591F\u4F7F\u7528\u7684\u4E13\u4E1A\u5DE5\u5177\u3002", choices: [
5705
+ { id: "knowledge", title: "\u77E5\u8BC6\u5E93", detail: "\u5728\u5DF2\u6302\u8F7D\u8303\u56F4\u5185\u68C0\u7D22\u4E0E\u56DE\u5199\u77E5\u8BC6\u3002" },
5706
+ { id: "skills", title: "Skill", detail: "\u4F7F\u7528\u5355\u72EC\u542F\u7528\u7684 Skill \u4E0E\u5DE5\u4F5C\u6D41\u7A0B\u3002" },
5707
+ { id: "ssh", title: "SSH", detail: "\u5728 SSH \u63D2\u4EF6\u6388\u6743\u8FB9\u754C\u5185\u64CD\u4F5C\u4E3B\u673A\u3002" },
5708
+ { id: "git", title: "Git", detail: "\u9884\u7559 Git \u80FD\u529B\uFF0C\u9700\u5BF9\u5E94\u63D2\u4EF6\u5B9E\u9645\u5B89\u88C5\u3002" }
5709
+ ] },
5710
+ { id: "coordination", eyebrow: "COORDINATION", title: "\u534F\u4F5C\u4E0E\u81EA\u52A8\u5316", detail: "\u63A7\u5236\u4F19\u4F34\u5EFA\u7ACB\u5173\u7CFB\u548C\u81EA\u4E3B\u5B89\u6392\u5DE5\u4F5C\u7684\u6743\u9650\u3002", choices: [
5711
+ { id: "companions", title: "\u521B\u5EFA\u4F19\u4F34", detail: "\u6309\u660E\u786E\u9700\u6C42\u521B\u5EFA\u9ED8\u8BA4\u65E0\u6743\u9650\u7684\u65B0\u4F19\u4F34\u3002" },
5712
+ { id: "access", title: "\u4F19\u4F34\u6388\u6743", detail: "\u6309\u660E\u786E\u8981\u6C42\u914D\u7F6E\u4F19\u4F34\u4E4B\u95F4\u7684\u5355\u5411\u8BBF\u95EE\u5173\u7CFB\u3002" },
5713
+ { id: "schedules", title: "\u5B9A\u65F6\u4EFB\u52A1", detail: "\u521B\u5EFA\u5E76\u7BA1\u7406\u7531\u81EA\u5DF1\u6267\u884C\u7684\u5468\u671F\u4EFB\u52A1\u3002" }
5714
+ ] },
5715
+ { id: "administration", eyebrow: "ADMINISTRATION", title: "\u9AD8\u6743\u9650\u7BA1\u7406", detail: "\u4EC5\u6388\u4E88\u53EF\u4FE1\u7684\u7BA1\u7406\u4F19\u4F34\uFF1B\u666E\u901A\u534F\u4F5C\u6388\u6743\u4E0D\u5305\u542B\u4FEE\u6539\u6743\u9650\u3002", choices: [
5716
+ { id: "administration", title: CAPABILITY_LABELS.administration, detail: "\u4FEE\u6539\u5176\u4ED6\u4F19\u4F34\u7684\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E Preset\u3001\u534F\u4F5C\u3001Skill \u548C\u77E5\u8BC6\u5E93\u6302\u8F7D\u3002\u4E0D\u5171\u4EAB\u4F1A\u8BDD\u3001\u8BB0\u5FC6\u6216\u51ED\u636E\uFF1B\u4E0D\u80FD\u81EA\u6539\u6216\u8F6C\u6388\u672C\u6743\u9650\u3002" }
5717
+ ] }
5718
+ ];
5719
+ const selectedProvider = form.provider || modelCatalog?.defaultSelection.provider || "";
5720
+ const modelOptions = modelCatalog?.providers.find((item) => item.id === selectedProvider)?.models ?? [];
5721
+ 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))
5728
+ ] }) }),
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: [
5731
+ "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
5732
+ modelCatalog?.defaultSelection.provider || "\u6B63\u5728\u8BFB\u53D6"
5733
+ ] }),
5734
+ modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
5735
+ ] }) }),
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: [
5738
+ "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
5739
+ modelCatalog?.defaultSelection.model || "\u6B63\u5728\u8BFB\u53D6"
5740
+ ] }),
5741
+ currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: form.model, children: [
5742
+ "\u5F53\u524D\u914D\u7F6E \xB7 ",
5743
+ form.model
5744
+ ] }),
5745
+ modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
5746
+ ] }) })
5747
+ ] }),
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) => {
5750
+ 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 })
5757
+ ] }),
5758
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("em", { children: [
5759
+ enabled,
5760
+ " / ",
5761
+ group.choices.length,
5762
+ " \u5DF2\u542F\u7528"
5763
+ ] })
5764
+ ] }),
5765
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-capabilities", children: group.choices.map((choice) => {
5766
+ 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 })
5771
+ ] }, choice.id);
5772
+ }) })
5773
+ ] }, group.id);
5774
+ }) }),
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" })
5783
+ ] }) }),
5784
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: saving, "aria-busy": saving, onClick: () => {
5785
+ void save();
5786
+ }, children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u5E94\u7528\u80FD\u529B\u7EC4\u5408" })
5787
+ ] })
5788
+ ] });
5789
+ }
5790
+
5791
+ // 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");
5795
+ function IdentityEditor(props) {
5796
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IdentityEditorForm, { ...props }, props.companion.id);
5797
+ }
5798
+ 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)(() => {
5808
+ alive.current = true;
5809
+ return () => {
5810
+ alive.current = false;
5811
+ };
5812
+ }, []);
5813
+ (0, import_react19.useEffect)(() => {
5814
+ setForm(companionDraft(companion));
5815
+ setSaved(false);
5816
+ setConfirmationId(void 0);
5817
+ }, [companion.updatedAt]);
5818
+ const confirming = confirmationId === companion.id;
5819
+ const busy = operation !== void 0 || removed;
5820
+ const submit = async (event) => {
5821
+ event.preventDefault();
5822
+ if (locked.current || removed) return;
5823
+ locked.current = true;
5824
+ setOperation("save");
5825
+ setError(void 0);
5826
+ setConfirmationId(void 0);
5827
+ let committed = false;
5828
+ try {
5829
+ await api(`/companions/${encodeURIComponent(companion.id)}`, { method: "PUT", body: JSON.stringify({ companion: form }) });
5830
+ committed = true;
5831
+ await onChanged();
5832
+ if (alive.current) setSaved(true);
5833
+ } catch (reason) {
5834
+ if (alive.current) setError(`${committed ? "\u8EAB\u4EFD\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u5237\u65B0\u5931\u8D25\uFF0C\u65E0\u9700\u91CD\u590D\u4FDD\u5B58\uFF1A" : "\u4FDD\u5B58\u5931\u8D25\uFF1A"}${errorMessage(reason)}`);
5835
+ } finally {
5836
+ locked.current = false;
5837
+ if (alive.current) setOperation(void 0);
5838
+ }
5839
+ };
5840
+ const remove = async () => {
5841
+ if (locked.current || removed || !confirming || count <= 1) return;
5842
+ const targetId = confirmationId;
5843
+ locked.current = true;
5844
+ setOperation("remove");
5845
+ setError(void 0);
5846
+ setConfirmationId(void 0);
5847
+ let committed = false;
5848
+ try {
5849
+ await api(`/companions/${encodeURIComponent(targetId)}?removeFiles=1`, { method: "DELETE" });
5850
+ committed = true;
5851
+ if (alive.current) setRemoved(true);
5852
+ await onRemoved(targetId);
5853
+ } catch (reason) {
5854
+ if (alive.current) setError(`${committed ? "\u4F19\u4F34\u5DF2\u5220\u9664\uFF0C\u4F46\u9875\u9762\u5237\u65B0\u5931\u8D25\uFF0C\u8BF7\u5237\u65B0\u9875\u9762\uFF0C\u4E0D\u8981\u518D\u6B21\u5220\u9664\uFF1A" : "\u5220\u9664\u5931\u8D25\uFF1A"}${errorMessage(reason)}`);
5855
+ } finally {
5856
+ locked.current = false;
5857
+ if (alive.current) setOperation(void 0);
5858
+ }
5859
+ };
5860
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("form", { className: "dsh-partner-form is-identity", "aria-busy": operation !== void 0, onSubmit: (event) => {
5861
+ void submit(event);
5862
+ }, 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 }) }) })
5867
+ ] }),
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 }),
5874
+ "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u5C06\u4F7F\u7528\u65B0\u8EAB\u4EFD"
5875
+ ] }) }),
5876
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { disabled: busy, children: operation === "save" ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
5877
+ ] }),
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" })
5882
+ ] }),
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 }),
5887
+ operation === "remove" ? "\u6B63\u5728\u5220\u9664\u2026" : removed ? "\u5DF2\u5220\u9664" : confirming ? "\u786E\u8BA4\u5220\u9664" : "\u5220\u9664"
5888
+ ] })
5889
+ ] })
5890
+ ] })
5891
+ ] });
5892
+ }
5893
+
5586
5894
  // src/ui/companion-create.tsx
5587
- var import_react17 = require("react");
5588
- var import_dsh_client_ui_primitives10 = require("@deepseek-ai/dsh-client-ui-primitives");
5589
- var import_jsx_runtime13 = require("react/jsx-runtime");
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");
5590
5898
  function CompanionCreateDialog({ close, create }) {
5591
- const [busy, setBusy] = (0, import_react17.useState)(false);
5592
- const [error, setError] = (0, import_react17.useState)();
5899
+ const [busy, setBusy] = (0, import_react20.useState)(false);
5900
+ const [error, setError] = (0, import_react20.useState)();
5593
5901
  const submit = async (event) => {
5594
5902
  event.preventDefault();
5595
5903
  const data = new FormData(event.currentTarget);
@@ -5608,30 +5916,30 @@ function CompanionCreateDialog({ close, create }) {
5608
5916
  setBusy(false);
5609
5917
  }
5610
5918
  };
5611
- return /* @__PURE__ */ (0, import_jsx_runtime13.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_runtime13.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-companion-create-form", "aria-busy": busy, onSubmit: (event) => {
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) => {
5612
5920
  void submit(event);
5613
5921
  }, children: [
5614
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
5615
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u4F19\u4F34\u540D\u5B57" }),
5616
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { name: "name", required: true, maxLength: 60, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u5C0F\u9ED1" })
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" })
5617
5925
  ] }),
5618
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
5619
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u4E3B\u8981\u89D2\u8272" }),
5620
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { name: "role", required: true, maxLength: 120, placeholder: "\u4F8B\u5982\uFF1A\u4EA7\u54C1\u4E0E\u5DE5\u7A0B\u534F\u4F5C\u4F19\u4F34" })
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" })
5621
5929
  ] }),
5622
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "is-wide", children: [
5623
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D" }),
5624
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { name: "description", maxLength: 500, placeholder: "\u5B83\u4E3B\u8981\u8D1F\u8D23\u4EC0\u4E48\uFF0C\u4EC0\u4E48\u65F6\u5019\u5E94\u8BE5\u627E\u5B83" })
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" })
5625
5933
  ] }),
5626
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "is-wide", children: [
5627
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u521D\u59CB\u884C\u4E3A\u51C6\u5219" }),
5628
- /* @__PURE__ */ (0, import_jsx_runtime13.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" })
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" })
5629
5937
  ] }),
5630
- error && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WorkspaceNotice, { children: error }),
5631
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("footer", { children: [
5632
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
5633
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
5634
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives10.IconPlusOutline16, { size: 14 }),
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 }),
5635
5943
  busy ? "\u6B63\u5728\u521B\u5EFA\u2026" : "\u521B\u5EFA\u4F19\u4F34"
5636
5944
  ] })
5637
5945
  ] })
@@ -5721,7 +6029,7 @@ function sessions(ctx) {
5721
6029
  }
5722
6030
 
5723
6031
  // src/client.tsx
5724
- var import_jsx_runtime14 = require("react/jsx-runtime");
6032
+ var import_jsx_runtime17 = require("react/jsx-runtime");
5725
6033
  var PLUGIN_ID = "@lemoncat7/dsh-partner";
5726
6034
  var STYLE_ID = `${PLUGIN_ID}/client`;
5727
6035
  var cssText = `${client_default}
@@ -5734,24 +6042,24 @@ var WORKSPACE_PAGES = /* @__PURE__ */ new Set(["skills", "board", "schedules", "
5734
6042
  var inject = ["slots", "layout", "sessions"];
5735
6043
  function apply(ctx) {
5736
6044
  ctx.effect(installStyles, "dsh-partner: styles");
5737
- const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PartnerWorkspace, { ...props, controller: current2 }));
5738
- ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PartnerPendant, { controller })));
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 })));
5739
6047
  ctx.effect(() => observePluginWorkspace(PLUGIN_ID, controller.close), "dsh-partner: exclusive workspace");
5740
6048
  ctx.effect(() => () => controller.close(), "dsh-partner: workspace lifecycle");
5741
6049
  ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({
5742
6050
  name: "sidebar.footer.action",
5743
6051
  id: "partner",
5744
6052
  order: -120
5745
- }, (props) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
6053
+ }, (props) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
5746
6054
  }
5747
6055
  function PartnerSidebar(props) {
5748
- const ref = (0, import_react18.useRef)(null);
6056
+ const ref = (0, import_react21.useRef)(null);
5749
6057
  useWorkspaceTopAnchor(ref);
5750
- const [open, setOpen] = (0, import_react18.useState)(true);
5751
- const [snapshot, setSnapshot] = (0, import_react18.useState)();
5752
- const [, update] = (0, import_react18.useState)(0);
5753
- (0, import_react18.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
5754
- (0, import_react18.useEffect)(() => {
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)(() => {
5755
6063
  void loadPartner().then(setSnapshot).catch(() => {
5756
6064
  });
5757
6065
  }, [props.controller.isOpen()]);
@@ -5759,31 +6067,34 @@ function PartnerSidebar(props) {
5759
6067
  props.controller.open(id);
5760
6068
  if (props.wide && window.matchMedia("(max-width: 820px)").matches) props.collapse();
5761
6069
  };
5762
- if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)(import_dsh_client_ui_primitives11.IconAgentPresetOutline16, { size: 18 }) }) });
5763
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
5764
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
5765
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconChevronDownOutline14, { size: 14 }) }),
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 }) }),
5766
6074
  "\u4F19\u4F34"
5767
6075
  ] }) }),
5768
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
5769
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconAgentPresetOutline16, { size: 16 }) }),
5770
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
5771
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
5772
- /* @__PURE__ */ (0, import_jsx_runtime14.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" })
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" })
5773
6081
  ] }),
5774
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
6082
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
5775
6083
  ] }) }) })
5776
6084
  ] });
5777
6085
  }
5778
6086
  function PartnerWorkspace({ controller }) {
5779
- const [snapshot, setSnapshot] = (0, import_react18.useState)();
5780
- const [selectedId, setSelectedId] = (0, import_react18.useState)(controller.selected());
5781
- const [view, setView] = (0, import_react18.useState)(controller.destination()?.page ?? "home");
5782
- const [requestedDestination, setRequestedDestination] = (0, import_react18.useState)(controller.destination());
5783
- const [error, setError] = (0, import_react18.useState)();
5784
- const [loading, setLoading] = (0, import_react18.useState)(true);
5785
- const [creatingCompanion, setCreatingCompanion] = (0, import_react18.useState)(false);
5786
- const refresh = (0, import_react18.useCallback)(async () => {
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 });
6096
+ selectionRef.current = { selectedId, companions: snapshot?.companions };
6097
+ const refresh = (0, import_react21.useCallback)(async (throwOnError = false) => {
5787
6098
  try {
5788
6099
  const next = await loadPartner();
5789
6100
  setSnapshot(next);
@@ -5791,14 +6102,15 @@ function PartnerWorkspace({ controller }) {
5791
6102
  setError(void 0);
5792
6103
  } catch (reason) {
5793
6104
  setError(errorMessage(reason));
6105
+ if (throwOnError) throw reason;
5794
6106
  } finally {
5795
6107
  setLoading(false);
5796
6108
  }
5797
6109
  }, []);
5798
- (0, import_react18.useEffect)(() => {
6110
+ (0, import_react21.useEffect)(() => {
5799
6111
  void refresh();
5800
6112
  }, [refresh]);
5801
- (0, import_react18.useEffect)(() => controller.subscribe(() => {
6113
+ (0, import_react21.useEffect)(() => controller.subscribe(() => {
5802
6114
  const next = controller.selected();
5803
6115
  if (next) setSelectedId(next);
5804
6116
  const destination = controller.destination();
@@ -5808,6 +6120,21 @@ function PartnerWorkspace({ controller }) {
5808
6120
  }
5809
6121
  }), [controller]);
5810
6122
  const selected = snapshot?.companions.find((item) => item.id === selectedId);
6123
+ const companionRemoved = async (id) => {
6124
+ const current2 = selectionRef.current;
6125
+ const name = current2.companions?.find((item) => item.id === id)?.name ?? "\u4F19\u4F34";
6126
+ setSnapshot((value) => value ? { ...value, companions: value.companions.filter((item) => item.id !== id), sessions: value.sessions.filter((item) => item.companionId !== id) } : value);
6127
+ if (current2.selectedId === id) {
6128
+ setSelectedId(current2.companions?.find((item) => item.id !== id)?.id);
6129
+ setView("home");
6130
+ }
6131
+ setNotice(`\u5DF2\u5220\u9664\u300C${name}\u300D\uFF0C\u5DF2\u9000\u51FA\u5220\u9664\u786E\u8BA4\u3002`);
6132
+ try {
6133
+ await refresh(true);
6134
+ } catch (reason) {
6135
+ setError(`\u4F19\u4F34\u5DF2\u5220\u9664\uFF0C\u4F46\u5237\u65B0\u5931\u8D25\uFF0C\u8BF7\u5237\u65B0\u9875\u9762\uFF0C\u65E0\u9700\u518D\u6B21\u5220\u9664\uFF1A${errorMessage(reason)}`);
6136
+ }
6137
+ };
5811
6138
  const create = async (draft) => {
5812
6139
  try {
5813
6140
  const companion = await api("/companions", { method: "POST", body: JSON.stringify({ companion: {
@@ -5852,18 +6179,18 @@ function PartnerWorkspace({ controller }) {
5852
6179
  setSelectedId(id);
5853
6180
  setView("home");
5854
6181
  };
5855
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("main", { className: "dsh-partner-workspace", children: [
5856
- creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
5857
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { className: "dsh-partner-topbar", children: [
5858
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
5859
- /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)(import_dsh_client_ui_primitives11.IconChevronLeftOutline14, { size: 15 }) }),
5860
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconAgentPresetOutline16, { size: 18 }),
5861
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
5862
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u4F19\u4F34" }),
5863
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u5FAE\u4FE1\u6E20\u9053" })
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" })
5864
6191
  ] })
5865
6192
  ] }),
5866
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6193
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5867
6194
  MobileWorkspaceControls,
5868
6195
  {
5869
6196
  companions: snapshot?.companions ?? [],
@@ -5875,114 +6202,115 @@ function PartnerWorkspace({ controller }) {
5875
6202
  }
5876
6203
  )
5877
6204
  ] }),
5878
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-grid", children: [
5879
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("aside", { className: "dsh-partner-roster", children: [
5880
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-roster-title", children: [
5881
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
5882
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "COMPANIONS" }),
5883
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
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" })
5884
6211
  ] }),
5885
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlusOutline16, { size: 16 }) })
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 }) })
5886
6213
  ] }),
5887
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
6214
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
5888
6215
  const channel = snapshot.channels.find((item) => item.companionId === companion.id);
5889
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
5890
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Avatar, { name: companion.name }),
5891
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
5892
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: companion.name }),
5893
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: companion.role })
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 })
5894
6221
  ] }),
5895
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
6222
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
5896
6223
  ] }, companion.id);
5897
6224
  }) }),
5898
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: [
5899
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-current": view === "skills" ? "page" : void 0, onClick: () => setView("skills"), children: [
5900
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconBrowseOutline16, { size: 16 }) }),
5901
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "Skill \u5E02\u573A" }),
5902
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u5B89\u88C5\u4E0E\u7BA1\u7406\u80FD\u529B" })
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" })
5903
6230
  ] }),
5904
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-current": view === "board" ? "page" : void 0, onClick: () => setView("board"), children: [
5905
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconListPenOutline16, { size: 16 }) }),
5906
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u4EFB\u52A1\u770B\u677F" }),
5907
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u534F\u4F5C\u3001\u59D4\u6D3E\u4E0E\u9A8C\u6536" })
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" })
5908
6235
  ] }),
5909
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-current": view === "schedules" ? "page" : void 0, onClick: () => setView("schedules"), children: [
5910
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlayOutline16, { size: 16 }) }),
5911
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u5B9A\u65F6\u4EFB\u52A1" }),
5912
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u9009\u62E9\u4F19\u4F34\u5468\u671F\u6267\u884C" })
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" })
5913
6240
  ] }),
5914
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-current": view === "pendant" ? "page" : void 0, onClick: () => setView("pendant"), children: [
5915
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconEditOutline16, { size: 16 }) }),
5916
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u5361\u7247\u8BBE\u7F6E" }),
5917
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u6302\u9970\u3001\u7EF3\u5B50\u4E0E\u56FE\u6848" })
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" })
5918
6245
  ] })
5919
6246
  ] }),
5920
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-roster-note", children: [
5921
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconLinkOutline16, { size: 16 }),
5922
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
5923
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
5924
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u5FAE\u4FE1\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
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" })
5925
6252
  ] })
5926
6253
  ] })
5927
6254
  ] }),
5928
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
5929
- loading ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
5930
- view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SkillsPanel, {}),
5931
- view === "board" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TaskBoardPanel, { initialTaskId: requestedDestination?.taskId, openRequest: requestedDestination }),
5932
- view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] }),
5933
- view === "pendant" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PendantSettingsPanel, {})
5934
- ] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
5935
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-identity", children: [
5936
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Avatar, { name: selected.name }),
5937
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
5938
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "ACTIVE COMPANION" }),
5939
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h1", { children: selected.name }),
5940
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: selected.description || selected.role })
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 })
5941
6268
  ] }),
5942
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
6269
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
5943
6270
  ] }),
5944
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
5945
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconAgentPresetOutline16, { size: 16 }), children: "\u603B\u89C8" }),
5946
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconEditOutline16, { size: 16 }), children: "\u8EAB\u4EFD" }),
5947
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconAgentPresetOutline16, { size: 16 }), children: "\u80FD\u529B" }),
5948
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WeixinGlyph, {}), children: "\u5FAE\u4FE1" }),
5949
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconDataOutline16, { size: 16 }), children: "\u8BB0\u5FC6" })
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" })
5950
6277
  ] }),
5951
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
5952
- view === "home" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession }),
5953
- view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(IdentityEditor, { companion: selected, count: snapshot?.companions.length ?? 1, onChanged: refresh }),
5954
- view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: refresh }),
5955
- view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }),
5956
- view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, startSession, renewSession, onChanged: refresh })
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 })
5957
6285
  ] })
5958
6286
  ] }),
5959
- error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
6287
+ error && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
5960
6288
  ] })
5961
6289
  ] })
5962
6290
  ] });
5963
6291
  }
5964
6292
  function MobileWorkspaceControls({ companions, selectedId, view, openCompanion, openPage, createCompanion }) {
5965
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
5966
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
5967
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
5968
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlusOutline16, { size: 17 }) })
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 }) })
5969
6297
  ] }),
5970
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: [
5971
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-pressed": view === "skills", onClick: () => openPage("skills"), children: [
5972
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconBrowseOutline16, { size: 16 }),
5973
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "Skill" })
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" })
5974
6302
  ] }),
5975
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-pressed": view === "board", onClick: () => openPage("board"), children: [
5976
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconListPenOutline16, { size: 16 }),
5977
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u770B\u677F" })
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" })
5978
6306
  ] }),
5979
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-pressed": view === "schedules", onClick: () => openPage("schedules"), children: [
5980
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlayOutline16, { size: 16 }),
5981
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u5B9A\u65F6" })
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" })
5982
6310
  ] }),
5983
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-pressed": view === "pendant", onClick: () => openPage("pendant"), children: [
5984
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconEditOutline16, { size: 16 }),
5985
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u5361\u7247" })
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" })
5986
6314
  ] })
5987
6315
  ] })
5988
6316
  ] });
@@ -5995,246 +6323,76 @@ function HomePanel({ companion, snapshot, navigate, openSession, startSession, r
5995
6323
  const approved = channel ? snapshot.pairings.filter((item) => item.channelId === channel.id && item.status === "approved").length : 0;
5996
6324
  const capabilities = companion.capabilities.map((item) => CAPABILITY_LABELS[item]);
5997
6325
  const online = channel?.runtimeStatus === "running";
5998
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-home", children: [
5999
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { className: "dsh-partner-home-heading", children: [
6000
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6001
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
6002
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u5FAE\u4FE1\u5F85\u547D` : `${companion.name} \u5DF2\u51C6\u5907\u5C31\u7EEA` })
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` })
6003
6331
  ] }),
6004
- /* @__PURE__ */ (0, import_jsx_runtime14.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" })
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" })
6005
6333
  ] }),
6006
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
6007
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
6008
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Avatar, { name: companion.name }),
6009
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}) }),
6010
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WeixinGlyph, { large: true }) })
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 }) })
6011
6339
  ] }),
6012
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
6013
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
6014
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}),
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", {}),
6015
6343
  "\u4E3B\u8981\u6E20\u9053 \xB7 \u5FAE\u4FE1"
6016
6344
  ] }),
6017
- /* @__PURE__ */ (0, import_jsx_runtime14.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" }),
6018
- /* @__PURE__ */ (0, import_jsx_runtime14.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" }),
6019
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
6020
- /* @__PURE__ */ (0, import_jsx_runtime14.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" }),
6021
- /* @__PURE__ */ (0, import_jsx_runtime14.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` })
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` })
6022
6350
  ] })
6023
6351
  ] })
6024
6352
  ] }),
6025
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-home-details", children: [
6026
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-home-profile", children: [
6027
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
6028
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconUserOutline16, { size: 16 }) }),
6029
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
6030
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
6031
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: companion.role })
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 })
6032
6360
  ] }),
6033
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
6361
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
6034
6362
  ] }),
6035
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
6363
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
6036
6364
  ] }),
6037
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
6038
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
6039
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconAgentPresetOutline16, { size: 16 }) }),
6040
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
6041
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
6042
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
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" })
6043
6371
  ] }),
6044
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
6372
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
6045
6373
  ] }),
6046
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
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" }) })
6047
6375
  ] }),
6048
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
6049
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
6050
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconDataOutline16, { size: 16 }) }),
6051
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
6052
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
6053
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: localSession?.archived ? "\u4F1A\u8BDD\u5DF2\u5F52\u6863" : "\u4F19\u4F34\u4F1A\u8BDD\u5DF2\u5EFA\u7ACB" })
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" })
6054
6382
  ] }),
6055
- /* @__PURE__ */ (0, import_jsx_runtime14.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" })
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" })
6056
6384
  ] }),
6057
- /* @__PURE__ */ (0, import_jsx_runtime14.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" })
6058
- ] })
6059
- ] })
6060
- ] });
6061
- }
6062
- function IdentityEditor({ companion, count, onChanged }) {
6063
- const [form, setForm] = (0, import_react18.useState)(() => companionDraft(companion));
6064
- const [saving, setSaving] = (0, import_react18.useState)(false);
6065
- const [saved, setSaved] = (0, import_react18.useState)(false);
6066
- const [error, setError] = (0, import_react18.useState)();
6067
- const [confirmingRemove, setConfirmingRemove] = (0, import_react18.useState)(false);
6068
- (0, import_react18.useEffect)(() => {
6069
- setForm(companionDraft(companion));
6070
- setSaved(false);
6071
- }, [companion.id, companion.updatedAt]);
6072
- const submit = async (event) => {
6073
- event.preventDefault();
6074
- setSaving(true);
6075
- setError(void 0);
6076
- try {
6077
- await api(`/companions/${companion.id}`, { method: "PUT", body: JSON.stringify({ companion: form }) });
6078
- setSaved(true);
6079
- await onChanged();
6080
- } catch (reason) {
6081
- setError(errorMessage(reason));
6082
- } finally {
6083
- setSaving(false);
6084
- }
6085
- };
6086
- const remove = async () => {
6087
- try {
6088
- await api(`/companions/${companion.id}`, { method: "DELETE" });
6089
- await onChanged();
6090
- } catch (reason) {
6091
- setError(errorMessage(reason));
6092
- }
6093
- };
6094
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("form", { className: "dsh-partner-form is-identity", onSubmit: (event) => {
6095
- void submit(event);
6096
- }, children: [
6097
- /* @__PURE__ */ (0, import_jsx_runtime14.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" }),
6098
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-fields two", children: [
6099
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
6100
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
6101
- ] }),
6102
- /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)("textarea", { rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
6103
- /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)("textarea", { rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
6104
- error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
6105
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-form-actions", children: [
6106
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: saved && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
6107
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconCheckOutline14, { size: 14 }),
6108
- "\u5DF2\u4FDD\u5B58\uFF0C\u540E\u7EED\u5FAE\u4FE1\u6D88\u606F\u5C06\u4F7F\u7528\u65B0\u8EAB\u4EFD"
6109
- ] }) }),
6110
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { disabled: saving, children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
6111
- ] }),
6112
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-identity-danger", "data-confirming": confirmingRemove, children: [
6113
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6114
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: confirmingRemove ? `\u786E\u8BA4\u5220\u9664\u300C${companion.name}\u300D\uFF1F` : "\u5220\u9664\u4F19\u4F34" }),
6115
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: confirmingRemove ? "\u8BE5\u4F19\u4F34\u7684\u672C\u5730\u914D\u7F6E\u4F1A\u88AB\u79FB\u9664\uFF1B\u5DF2\u6709\u6E20\u9053\u5FC5\u987B\u5148\u89E3\u7ED1\u3002" : "\u5FC5\u987B\u5148\u79FB\u9664\u5DF2\u7ED1\u5B9A\u5FAE\u4FE1\u6E20\u9053\uFF1B\u4E0D\u4F1A\u81EA\u52A8\u628A\u8054\u7CFB\u4EBA\u8F6C\u4EA4\u7ED9\u5176\u4ED6\u4F19\u4F34\u3002" })
6116
- ] }),
6117
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
6118
- confirmingRemove && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "is-secondary", onClick: () => setConfirmingRemove(false), children: "\u53D6\u6D88" }),
6119
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: confirmingRemove ? "is-danger" : "", disabled: count <= 1, onClick: () => confirmingRemove ? void remove() : setConfirmingRemove(true), children: [
6120
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconTrashOutline16, { size: 16 }),
6121
- confirmingRemove ? "\u786E\u8BA4\u5220\u9664" : "\u5220\u9664"
6122
- ] })
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" })
6123
6386
  ] })
6124
6387
  ] })
6125
6388
  ] });
6126
6389
  }
6127
- function CapabilityEditor({ companion, presets, onChanged }) {
6128
- const [form, setForm] = (0, import_react18.useState)(() => companionDraft(companion));
6129
- const [modelCatalog, setModelCatalog] = (0, import_react18.useState)();
6130
- const [saving, setSaving] = (0, import_react18.useState)(false);
6131
- const [error, setError] = (0, import_react18.useState)();
6132
- (0, import_react18.useEffect)(() => setForm(companionDraft(companion)), [companion.id, companion.updatedAt]);
6133
- (0, import_react18.useEffect)(() => {
6134
- void api("/models").then(setModelCatalog).catch((reason) => setError(errorMessage(reason)));
6135
- }, []);
6136
- const toggle = (capability) => setForm((current2) => ({ ...current2, capabilities: current2.capabilities.includes(capability) ? current2.capabilities.filter((item) => item !== capability) : [...current2.capabilities, capability] }));
6137
- const save = async () => {
6138
- setSaving(true);
6139
- setError(void 0);
6140
- try {
6141
- await api(`/companions/${companion.id}`, { method: "PUT", body: JSON.stringify({ companion: form }) });
6142
- await onChanged();
6143
- } catch (reason) {
6144
- setError(errorMessage(reason));
6145
- } finally {
6146
- setSaving(false);
6147
- }
6148
- };
6149
- const groups = [
6150
- { id: "tools", eyebrow: "TOOLS", title: "\u5DE5\u4F5C\u5DE5\u5177", detail: "\u8FDE\u63A5\u5F53\u524D\u4F19\u4F34\u80FD\u591F\u4F7F\u7528\u7684\u4E13\u4E1A\u5DE5\u5177\u3002", choices: [
6151
- { id: "knowledge", title: "\u77E5\u8BC6\u5E93", detail: "\u5728\u5DF2\u6302\u8F7D\u8303\u56F4\u5185\u68C0\u7D22\u4E0E\u56DE\u5199\u77E5\u8BC6\u3002" },
6152
- { id: "skills", title: "Skill", detail: "\u4F7F\u7528\u5355\u72EC\u542F\u7528\u7684 Skill \u4E0E\u5DE5\u4F5C\u6D41\u7A0B\u3002" },
6153
- { id: "ssh", title: "SSH", detail: "\u5728 SSH \u63D2\u4EF6\u6388\u6743\u8FB9\u754C\u5185\u64CD\u4F5C\u4E3B\u673A\u3002" },
6154
- { id: "git", title: "Git", detail: "\u9884\u7559 Git \u80FD\u529B\uFF0C\u9700\u5BF9\u5E94\u63D2\u4EF6\u5B9E\u9645\u5B89\u88C5\u3002" }
6155
- ] },
6156
- { id: "coordination", eyebrow: "COORDINATION", title: "\u534F\u4F5C\u4E0E\u81EA\u52A8\u5316", detail: "\u63A7\u5236\u4F19\u4F34\u5EFA\u7ACB\u5173\u7CFB\u548C\u81EA\u4E3B\u5B89\u6392\u5DE5\u4F5C\u7684\u6743\u9650\u3002", choices: [
6157
- { id: "companions", title: "\u521B\u5EFA\u4F19\u4F34", detail: "\u6309\u660E\u786E\u9700\u6C42\u521B\u5EFA\u9ED8\u8BA4\u65E0\u6743\u9650\u7684\u65B0\u4F19\u4F34\u3002" },
6158
- { id: "access", title: "\u4F19\u4F34\u6388\u6743", detail: "\u6309\u660E\u786E\u8981\u6C42\u914D\u7F6E\u4F19\u4F34\u4E4B\u95F4\u7684\u5355\u5411\u8BBF\u95EE\u5173\u7CFB\u3002" },
6159
- { id: "schedules", title: "\u5B9A\u65F6\u4EFB\u52A1", detail: "\u521B\u5EFA\u5E76\u7BA1\u7406\u7531\u81EA\u5DF1\u6267\u884C\u7684\u5468\u671F\u4EFB\u52A1\u3002" }
6160
- ] },
6161
- { id: "administration", eyebrow: "ADMINISTRATION", title: "\u9AD8\u6743\u9650\u7BA1\u7406", detail: "\u4EC5\u6388\u4E88\u53EF\u4FE1\u7684\u7BA1\u7406\u4F19\u4F34\uFF1B\u666E\u901A\u534F\u4F5C\u6388\u6743\u4E0D\u5305\u542B\u4FEE\u6539\u6743\u9650\u3002", choices: [
6162
- { id: "administration", title: CAPABILITY_LABELS.administration, detail: "\u4FEE\u6539\u5176\u4ED6\u4F19\u4F34\u7684\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E Preset\u3001\u534F\u4F5C\u3001Skill \u548C\u77E5\u8BC6\u5E93\u6302\u8F7D\u3002\u4E0D\u5171\u4EAB\u4F1A\u8BDD\u3001\u8BB0\u5FC6\u6216\u51ED\u636E\uFF1B\u4E0D\u80FD\u81EA\u6539\u6216\u8F6C\u6388\u672C\u6743\u9650\u3002" }
6163
- ] }
6164
- ];
6165
- const selectedProvider = form.provider || modelCatalog?.defaultSelection.provider || "";
6166
- const modelOptions = modelCatalog?.providers.find((item) => item.id === selectedProvider)?.models ?? [];
6167
- const currentModelMissing = Boolean(form.model) && !modelOptions.some((item) => item.id === form.model);
6168
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-form is-capabilities", children: [
6169
- /* @__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" }),
6170
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-runtime-fields", children: [
6171
- /* @__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", { value: form.presetId, onChange: (event) => setForm({ ...form, presetId: event.target.value }), children: [
6172
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "", children: "\u8DDF\u968F DSH \u9ED8\u8BA4 Preset" }),
6173
- presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: item.id, children: item.name }, item.id))
6174
- ] }) }),
6175
- /* @__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", { value: form.provider, onChange: (event) => setForm({ ...form, provider: event.target.value, model: "" }), children: [
6176
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: "", children: [
6177
- "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
6178
- modelCatalog?.defaultSelection.provider || "\u6B63\u5728\u8BFB\u53D6"
6179
- ] }),
6180
- modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
6181
- ] }) }),
6182
- /* @__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", { value: form.model, onChange: (event) => setForm({ ...form, model: event.target.value }), children: [
6183
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: "", children: [
6184
- "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
6185
- modelCatalog?.defaultSelection.model || "\u6B63\u5728\u8BFB\u53D6"
6186
- ] }),
6187
- currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: form.model, children: [
6188
- "\u5F53\u524D\u914D\u7F6E \xB7 ",
6189
- form.model
6190
- ] }),
6191
- modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
6192
- ] }) })
6193
- ] }),
6194
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-capability-groups", children: groups.map((group) => {
6195
- const enabled = group.choices.filter((choice) => form.capabilities.includes(choice.id)).length;
6196
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-capability-group", "aria-labelledby": `partner-capability-${group.id}`, children: [
6197
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
6198
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6199
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: group.eyebrow }),
6200
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { id: `partner-capability-${group.id}`, children: group.title }),
6201
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: group.detail })
6202
- ] }),
6203
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("em", { children: [
6204
- enabled,
6205
- " / ",
6206
- group.choices.length,
6207
- " \u5DF2\u542F\u7528"
6208
- ] })
6209
- ] }),
6210
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-capabilities", children: group.choices.map((choice) => {
6211
- const active = form.capabilities.includes(choice.id);
6212
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: active ? "is-active" : "", "aria-pressed": active, onClick: () => toggle(choice.id), children: [
6213
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: active && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconCheckOutline14, { size: 14 }) }),
6214
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: choice.title }),
6215
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: choice.detail })
6216
- ] }, choice.id);
6217
- }) })
6218
- ] }, group.id);
6219
- }) }),
6220
- form.capabilities.includes("skills") && companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CompanionSkillSettings, { companionId: companion.id }),
6221
- 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" }),
6222
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CompanionAccessPanel, { companionId: companion.id }),
6223
- error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
6224
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-form-actions", children: [
6225
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", {}),
6226
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: saving, onClick: () => {
6227
- void save();
6228
- }, children: saving ? "\u6B63\u5728\u5E94\u7528\u2026" : "\u5E94\u7528\u80FD\u529B\u7EC4\u5408" })
6229
- ] })
6230
- ] });
6231
- }
6232
6390
  function WeixinPanel({ companion, snapshot, onChanged }) {
6233
6391
  const channel = snapshot.channels.find((item) => item.companionId === companion.id);
6234
- const [login, setLogin] = (0, import_react18.useState)();
6235
- const [busy, setBusy] = (0, import_react18.useState)(false);
6236
- const [error, setError] = (0, import_react18.useState)();
6237
- (0, import_react18.useEffect)(() => {
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)(() => {
6238
6396
  if (!login || login.phase === "confirmed" || login.phase === "expired" || login.phase === "error") return;
6239
6397
  const timer = window.setInterval(() => {
6240
6398
  void api(`/weixin/login/${login.id}`).then(async (result) => {
@@ -6280,93 +6438,93 @@ function WeixinPanel({ companion, snapshot, onChanged }) {
6280
6438
  setError(errorMessage(reason));
6281
6439
  }
6282
6440
  };
6283
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
6284
- /* @__PURE__ */ (0, import_jsx_runtime14.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" }),
6285
- !channel && !login && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
6286
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WeixinGlyph, { large: true }) }),
6287
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6288
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
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: [
6289
6447
  "\u628A ",
6290
6448
  companion.name,
6291
6449
  " \u5E26\u5230\u5FAE\u4FE1"
6292
6450
  ] }),
6293
- /* @__PURE__ */ (0, import_jsx_runtime14.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" }),
6294
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("ul", { children: [
6295
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
6296
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
6297
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
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" })
6298
6456
  ] })
6299
6457
  ] }),
6300
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy, onClick: () => {
6458
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", disabled: busy, onClick: () => {
6301
6459
  void begin();
6302
6460
  }, children: busy ? "\u6B63\u5728\u7533\u8BF7\u4E8C\u7EF4\u7801\u2026" : "\u626B\u7801\u8FDE\u63A5\u5FAE\u4FE1" })
6303
6461
  ] }),
6304
- login && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
6305
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
6306
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6307
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "WECHAT ILINK BOT" }),
6308
- /* @__PURE__ */ (0, import_jsx_runtime14.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" }),
6309
- /* @__PURE__ */ (0, import_jsx_runtime14.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") }),
6310
- (login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", onClick: () => {
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: () => {
6311
6469
  setLogin(void 0);
6312
6470
  void begin();
6313
6471
  }, children: [
6314
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconRefreshOutline16, { size: 16 }),
6472
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconRefreshOutline16, { size: 16 }),
6315
6473
  "\u91CD\u65B0\u751F\u6210"
6316
6474
  ] })
6317
6475
  ] })
6318
6476
  ] }),
6319
- channel && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
6320
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
6321
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WeixinGlyph, { large: true }) }),
6322
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6323
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "WECHAT CHANNEL" }),
6324
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: channel.name }),
6325
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: channel.accountId })
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 })
6326
6484
  ] }),
6327
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ChannelStatus, { channel }),
6328
- /* @__PURE__ */ (0, import_jsx_runtime14.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: () => {
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: () => {
6329
6487
  void toggle();
6330
- }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}) })
6488
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", {}) })
6331
6489
  ] }),
6332
- channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-error", children: channel.lastError }),
6333
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
6334
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6335
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "ACCESS" }),
6336
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
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" })
6337
6495
  ] }),
6338
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("em", { children: [
6496
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("em", { children: [
6339
6497
  pairings.filter((item) => item.status === "pending").length,
6340
6498
  " \u4E2A\u5F85\u5904\u7406"
6341
6499
  ] })
6342
6500
  ] }),
6343
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsxs)("article", { children: [
6344
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconUserOutline16, { size: 16 }) }),
6345
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
6346
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: pairing.displayName }),
6347
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
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: [
6348
6506
  pairing.status === "pending" ? "\u7B49\u5F85\u5BA1\u6279" : pairing.status === "approved" ? "\u5DF2\u6388\u6743\u72EC\u7ACB\u4F1A\u8BDD" : "\u5DF2\u963B\u6B62",
6349
6507
  " \xB7 ",
6350
6508
  new Date(pairing.updatedAt).toLocaleString()
6351
6509
  ] })
6352
6510
  ] }),
6353
- pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
6354
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { onClick: () => {
6511
+ pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
6512
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { onClick: () => {
6355
6513
  void actPairing(pairing.id, "blocked");
6356
6514
  }, children: "\u62D2\u7EDD" }),
6357
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { className: "is-primary", onClick: () => {
6515
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { className: "is-primary", onClick: () => {
6358
6516
  void actPairing(pairing.id, "approved");
6359
6517
  }, children: "\u6279\u51C6" })
6360
6518
  ] }),
6361
- pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { onClick: () => {
6519
+ pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { onClick: () => {
6362
6520
  void actPairing(pairing.id, "blocked");
6363
6521
  }, children: "\u64A4\u9500" }),
6364
- pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { onClick: () => {
6522
+ pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { onClick: () => {
6365
6523
  void actPairing(pairing.id, "approved");
6366
6524
  }, children: "\u91CD\u65B0\u6279\u51C6" })
6367
6525
  ] }, pairing.id)) })
6368
6526
  ] }),
6369
- error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-error", children: error })
6527
+ error && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "dsh-partner-inline-error", children: error })
6370
6528
  ] });
6371
6529
  }
6372
6530
  function MemoryPanel({ companion, snapshot, openSession, startSession, renewSession, onChanged }) {
@@ -6374,19 +6532,19 @@ function MemoryPanel({ companion, snapshot, openSession, startSession, renewSess
6374
6532
  const localSession = sessions2.find((item) => item.kind === "local");
6375
6533
  const channelSessionCount = sessions2.filter((item) => item.kind === "channel").length;
6376
6534
  const heartbeat = snapshot.heartbeatStates.find((item) => item.companionId === companion.id);
6377
- const [automation, setAutomation] = (0, import_react18.useState)(() => structuredClone(companion.automation));
6378
- const [memories, setMemories] = (0, import_react18.useState)([]);
6379
- const [reflections, setReflections] = (0, import_react18.useState)([]);
6380
- const [profiles, setProfiles] = (0, import_react18.useState)([]);
6381
- const [concernActivity, setConcernActivity] = (0, import_react18.useState)({ concerns: [], observations: [] });
6382
- const [newConcern, setNewConcern] = (0, import_react18.useState)("");
6383
- const [memoryRevision, setMemoryRevision] = (0, import_react18.useState)(0);
6384
- const [editing, setEditing] = (0, import_react18.useState)();
6385
- const [busy, setBusy] = (0, import_react18.useState)(false);
6386
- const [notice, setNotice] = (0, import_react18.useState)();
6387
- const [error, setError] = (0, import_react18.useState)();
6388
- const [modelCatalog, setModelCatalog] = (0, import_react18.useState)();
6389
- const loadMemory = (0, import_react18.useCallback)(async () => {
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 () => {
6390
6548
  const [result, activity] = await Promise.all([api(`/companions/${companion.id}/memory`), api(`/companions/${companion.id}/concerns`)]);
6391
6549
  setMemories(result.memories);
6392
6550
  setReflections(result.reflections);
@@ -6394,11 +6552,11 @@ function MemoryPanel({ companion, snapshot, openSession, startSession, renewSess
6394
6552
  setConcernActivity(activity);
6395
6553
  setMemoryRevision((value) => value + 1);
6396
6554
  }, [companion.id]);
6397
- (0, import_react18.useEffect)(() => {
6555
+ (0, import_react21.useEffect)(() => {
6398
6556
  setAutomation(structuredClone(companion.automation));
6399
6557
  void loadMemory().catch((reason) => setError(errorMessage(reason)));
6400
6558
  }, [companion.id, companion.updatedAt, loadMemory]);
6401
- (0, import_react18.useEffect)(() => {
6559
+ (0, import_react21.useEffect)(() => {
6402
6560
  void api("/models").then(setModelCatalog).catch((reason) => setError(errorMessage(reason)));
6403
6561
  }, []);
6404
6562
  const inheritedProvider = companion.provider || modelCatalog?.defaultSelection.provider || "";
@@ -6508,157 +6666,157 @@ function MemoryPanel({ companion, snapshot, openSession, startSession, renewSess
6508
6666
  setBusy(false);
6509
6667
  }
6510
6668
  };
6511
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-form is-memory", children: [
6512
- /* @__PURE__ */ (0, import_jsx_runtime14.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" }),
6513
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-metrics", children: [
6514
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { children: [
6515
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u4F19\u4F34\u4F1A\u8BDD" }),
6516
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: sessions2.length }),
6517
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: localSession ? `1 \u4E2A\u672C\u5730 \xB7 ${channelSessionCount} \u4E2A\u6E20\u9053` : `${channelSessionCount} \u4E2A\u6E20\u9053` })
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` })
6518
6676
  ] }),
6519
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { children: [
6520
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u957F\u671F\u8BB0\u5FC6" }),
6521
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: memories.filter((item) => item.status === "active").length }),
6522
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
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: [
6523
6681
  reflections.length,
6524
6682
  " \u7BC7\u6BCF\u65E5\u56DE\u987E"
6525
6683
  ] })
6526
6684
  ] }),
6527
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { children: [
6528
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u6700\u8FD1\u5FC3\u8DF3" }),
6529
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: heartbeat?.lastCheckedAt ? relativeTime(heartbeat.lastCheckedAt) : "\u5C1A\u672A" }),
6530
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: heartbeat?.lastError ? "\u4E0A\u6B21\u6267\u884C\u5F02\u5E38" : `\u4ECA\u65E5\u53D1\u9001 ${heartbeat?.sentCount ?? 0} \u6B21` })
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` })
6531
6689
  ] })
6532
6690
  ] }),
6533
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-automation-grid", children: [
6534
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-automation", children: [
6535
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
6536
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6537
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u5B66\u4E60\u4E0E\u957F\u671F\u8BB0\u5FC6" }),
6538
- /* @__PURE__ */ (0, import_jsx_runtime14.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" })
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" })
6539
6697
  ] }),
6540
- /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)("i", {}) })
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", {}) })
6541
6699
  ] }),
6542
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-automation-fields is-memory-model", children: [
6543
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u4FDD\u7559\u671F\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { value: automation.memory.retentionDays, onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, retentionDays: Number(event.target.value) } })), children: [
6544
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 0, children: "\u6C38\u4E45\u4FDD\u7559" }),
6545
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 30, children: "30 \u5929" }),
6546
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 90, children: "90 \u5929" }),
6547
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 180, children: "180 \u5929" }),
6548
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 365, children: "1 \u5E74" }),
6549
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 1095, children: "3 \u5E74" })
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" })
6550
6708
  ] }) }),
6551
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u63D0\u70BC Provider", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { value: automation.memory.provider ?? "", onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, provider: event.target.value, model: "" } })), children: [
6552
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: "", children: [
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: [
6553
6711
  "\u8DDF\u968F\u4F19\u4F34 \xB7 ",
6554
6712
  inheritedProvider || "DSH \u9ED8\u8BA4"
6555
6713
  ] }),
6556
- modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
6714
+ modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
6557
6715
  ] }) }),
6558
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u63D0\u70BC\u6A21\u578B", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { value: automation.memory.model ?? "", onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, model: event.target.value } })), children: [
6559
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: "", children: [
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: [
6560
6718
  "\u8DDF\u968F\u4F19\u4F34 \xB7 ",
6561
6719
  companion.model || modelCatalog?.defaultSelection.model || "DSH \u9ED8\u8BA4"
6562
6720
  ] }),
6563
- modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
6721
+ modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
6564
6722
  ] }) })
6565
6723
  ] }),
6566
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-review-policy", children: [
6567
- /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)("i", {}) }),
6568
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6569
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u6BCF\u65E5\u7EC8\u5BA1" }),
6570
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u6B21\u65E5\u81EA\u52A8\u5408\u5E76\u91CD\u590D\u3001\u7EA0\u6B63\u504F\u5DEE\u5E76\u5EFA\u7ACB\u8BB0\u5FC6\u5173\u7CFB" })
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" })
6571
6729
  ] }),
6572
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { children: /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsxs)("option", { value: hour, children: [
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: [
6573
6731
  String(hour).padStart(2, "0"),
6574
6732
  ":00"
6575
6733
  ] }, hour)) }) }),
6576
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy || reflections.length === 0, onClick: () => {
6734
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", disabled: busy || reflections.length === 0, onClick: () => {
6577
6735
  void review();
6578
6736
  }, children: "\u7ACB\u5373\u7EC8\u5BA1" })
6579
6737
  ] })
6580
6738
  ] }),
6581
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-automation", children: [
6582
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
6583
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6584
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u6301\u7EED\u611F\u77E5" }),
6585
- /* @__PURE__ */ (0, import_jsx_runtime14.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" })
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" })
6586
6744
  ] }),
6587
- /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)("i", {}) })
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", {}) })
6588
6746
  ] }),
6589
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-automation-fields is-heartbeat", children: [
6590
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u68C0\u67E5\u95F4\u9694", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { value: automation.heartbeat.intervalMinutes, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, intervalMinutes: Number(event.target.value) } })), children: [
6591
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 30, children: "30 \u5206\u949F" }),
6592
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 60, children: "1 \u5C0F\u65F6" }),
6593
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 180, children: "3 \u5C0F\u65F6" }),
6594
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 360, children: "6 \u5C0F\u65F6" }),
6595
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 720, children: "12 \u5C0F\u65F6" }),
6596
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 1440, children: "24 \u5C0F\u65F6" })
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" })
6597
6755
  ] }) }),
6598
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u514D\u6253\u6270\u5F00\u59CB", children: /* @__PURE__ */ (0, import_jsx_runtime14.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) } })) }) }),
6599
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u514D\u6253\u6270\u7ED3\u675F", children: /* @__PURE__ */ (0, import_jsx_runtime14.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) } })) }) }),
6600
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u6BCF\u65E5\u4E0A\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { value: automation.heartbeat.dailyLimit, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, dailyLimit: Number(event.target.value) } })), children: [
6601
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 0, children: "\u4E0D\u9650" }),
6602
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 1, children: "1 \u6B21" }),
6603
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 2, children: "2 \u6B21" }),
6604
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 3, children: "3 \u6B21" }),
6605
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 5, children: "5 \u6B21" }),
6606
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 8, children: "8 \u6B21" })
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" })
6607
6765
  ] }) })
6608
6766
  ] }),
6609
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ConcernBoard, { companionId: companion.id, activity: concernActivity, value: newConcern, busy, onValue: setNewConcern, onAdd: () => {
6767
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ConcernBoard, { companionId: companion.id, activity: concernActivity, value: newConcern, busy, onValue: setNewConcern, onAdd: () => {
6610
6768
  void addConcern();
6611
6769
  }, onCheck: (item) => {
6612
6770
  void trigger(item.id);
6613
6771
  }, onAct: (item, action) => {
6614
6772
  void actConcern(item, action);
6615
6773
  } }),
6616
- heartbeat?.lastError && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-error", children: heartbeat.lastError }),
6617
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-automation-actions", children: [
6618
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy || sessions2.length === 0, onClick: () => {
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: () => {
6619
6777
  void trigger();
6620
6778
  }, children: "\u68C0\u67E5\u5230\u671F\u9879" }),
6621
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => {
6779
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => {
6622
6780
  void save();
6623
6781
  }, children: busy ? "\u6B63\u5728\u5904\u7406\u2026" : "\u4FDD\u5B58\u8BBE\u7F6E" })
6624
6782
  ] })
6625
6783
  ] })
6626
6784
  ] }),
6627
- notice && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { className: "dsh-partner-inline-notice", children: [
6628
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconCheckOutline14, { size: 14 }),
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 }),
6629
6787
  notice
6630
6788
  ] }),
6631
- error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
6632
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MemoryLibrary, { companionId: companion.id, revision: memoryRevision, profiles, memories, reflections, editing, busy, setEditing, save: () => {
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: () => {
6633
6791
  void saveMemory();
6634
6792
  }, remove: (item) => {
6635
6793
  void deleteMemory(item);
6636
6794
  } }),
6637
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-section-heading", children: [
6638
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6639
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "SESSIONS" }),
6640
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u4F19\u4F34\u4F1A\u8BDD" })
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" })
6641
6799
  ] }),
6642
- localSession === void 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", onClick: () => {
6800
+ localSession === void 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", onClick: () => {
6643
6801
  void startSession(companion.id);
6644
6802
  }, children: [
6645
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlusOutline16, { size: 14 }),
6803
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconPlusOutline16, { size: 14 }),
6646
6804
  "\u5F00\u59CB\u672C\u5730\u5BF9\u8BDD"
6647
6805
  ] })
6648
6806
  ] }),
6649
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-session-list", children: [
6650
- sessions2.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { "data-archived": item.archived, "data-kind": item.kind, children: [
6651
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconDataOutline16, { size: 16 }) }),
6652
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
6653
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: item.kind === "local" ? "\u672C\u5730\u4F19\u4F34\u4F1A\u8BDD" : `\u5FAE\u4FE1\u8054\u7CFB\u4EBA \xB7 ${item.userId.slice(-6)}` }),
6654
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: item.archived ? "\u5DF2\u5F52\u6863 \xB7 \u957F\u671F\u8BB0\u5FC6\u4FDD\u7559" : `${item.sessionId} \xB7 ${new Date(item.lastMessageAt).toLocaleString()}` })
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()}` })
6655
6813
  ] }),
6656
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: item.archived ? "is-primary" : void 0, onClick: () => {
6814
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", className: item.archived ? "is-primary" : void 0, onClick: () => {
6657
6815
  if (item.archived) void renewSession(item.id);
6658
6816
  else void openSession(item.id, item.sessionId);
6659
6817
  }, children: item.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
6660
6818
  ] }, item.id)),
6661
- sessions2.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)("button", { type: "button", onClick: () => {
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: () => {
6662
6820
  void startSession(companion.id);
6663
6821
  }, children: "\u5F00\u59CB\u5BF9\u8BDD" }), compact: true })
6664
6822
  ] })
@@ -6669,19 +6827,19 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
6669
6827
  const active = visible.filter((item) => item.state !== "resolved");
6670
6828
  const resolved = visible.filter((item) => item.state === "resolved");
6671
6829
  const latest = new Map([...activity.observations].reverse().map((item) => [item.concernId, item]));
6672
- const [composing, setComposing] = (0, import_react18.useState)(false);
6673
- const [expandedId, setExpandedId] = (0, import_react18.useState)();
6674
- const [visibleCount, setVisibleCount] = (0, import_react18.useState)(5);
6675
- const [mention, setMention] = (0, import_react18.useState)();
6676
- const [sources, setSources] = (0, import_react18.useState)([]);
6677
- const [sourcesLoading, setSourcesLoading] = (0, import_react18.useState)(false);
6678
- const [sourceError, setSourceError] = (0, import_react18.useState)();
6679
- const [activeSource, setActiveSource] = (0, import_react18.useState)(0);
6680
- const inputRef = (0, import_react18.useRef)(null);
6681
- const listboxId = (0, import_react18.useId)();
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)();
6682
6840
  const shown = active.slice(0, visibleCount);
6683
6841
  const suggestionsOpen = composing && mention !== void 0;
6684
- (0, import_react18.useEffect)(() => {
6842
+ (0, import_react21.useEffect)(() => {
6685
6843
  if (!suggestionsOpen || mention === void 0) {
6686
6844
  setSources([]);
6687
6845
  setSourcesLoading(false);
@@ -6730,25 +6888,25 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
6730
6888
  inputRef.current?.setSelectionRange(cursor, cursor);
6731
6889
  });
6732
6890
  };
6733
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-concern-board", "aria-labelledby": "partner-concerns-title", children: [
6734
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
6735
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6736
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { id: "partner-concerns-title", children: [
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: [
6737
6895
  "\u4F19\u4F34\u5728\u610F\u7684\u4E8B ",
6738
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: active.length })
6896
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: active.length })
6739
6897
  ] }),
6740
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: "\u5C1A\u672A\u95ED\u73AF\u3001\u503C\u5F97\u7EE7\u7EED\u7559\u610F\u7684\u4E8B\u60C5" })
6898
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: "\u5C1A\u672A\u95ED\u73AF\u3001\u503C\u5F97\u7EE7\u7EED\u7559\u610F\u7684\u4E8B\u60C5" })
6741
6899
  ] }),
6742
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", "aria-expanded": composing, onClick: () => setComposing((current2) => !current2), children: [
6743
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlusOutline16, { size: 14 }),
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 }),
6744
6902
  "\u4EA4\u4EE3\u4E00\u4EF6\u4E8B"
6745
6903
  ] })
6746
6904
  ] }),
6747
- composing && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("form", { className: "dsh-partner-concern-compose", onSubmit: submit, children: [
6748
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
6749
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u9700\u8981\u7559\u610F\u7684\u4E8B" }),
6750
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-concern-input-wrap", children: [
6751
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
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)(
6752
6910
  "input",
6753
6911
  {
6754
6912
  ref: inputRef,
@@ -6784,10 +6942,10 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
6784
6942
  }
6785
6943
  }
6786
6944
  ),
6787
- suggestionsOpen && /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)("p", { role: "status", children: "\u6B63\u5728\u67E5\u627E\u53EF\u5F15\u7528\u5185\u5BB9\u2026" }) : sourceError ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { role: "status", children: [
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: [
6788
6946
  "\u5019\u9009\u52A0\u8F7D\u5931\u8D25\uFF1A",
6789
6947
  sourceError
6790
- ] }) : sources.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: sources.map((source, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
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)(
6791
6949
  "button",
6792
6950
  {
6793
6951
  type: "button",
@@ -6799,97 +6957,97 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
6799
6957
  onMouseEnter: () => setActiveSource(index),
6800
6958
  onClick: () => chooseSource(source),
6801
6959
  children: [
6802
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: source.kind === "file" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconDataOutline16, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconLinkOutline16, { size: 15 }) }),
6803
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: source.label }),
6804
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: source.detail })
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 })
6805
6963
  ]
6806
6964
  },
6807
6965
  `${source.kind}:${source.token}`
6808
6966
  )) }) })
6809
6967
  ] }),
6810
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { className: "dsh-partner-concern-compose-hint", children: [
6968
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { className: "dsh-partner-concern-compose-hint", children: [
6811
6969
  "\u8F93\u5165 ",
6812
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: "@" }),
6970
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: "@" }),
6813
6971
  " \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"
6814
6972
  ] })
6815
6973
  ] }),
6816
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
6817
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => {
6974
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
6975
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: () => {
6818
6976
  setComposing(false);
6819
6977
  setMention(void 0);
6820
6978
  onValue("");
6821
6979
  }, children: "\u53D6\u6D88" }),
6822
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !value.trim(), children: "\u8BA9\u4F19\u4F34\u8BB0\u7740" })
6980
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !value.trim(), children: "\u8BA9\u4F19\u4F34\u8BB0\u7740" })
6823
6981
  ] })
6824
6982
  ] }),
6825
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-concern-list", role: "list", children: active.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.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) => {
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) => {
6826
6984
  const observation = latest.get(item.id);
6827
6985
  const expanded = expandedId === item.id;
6828
6986
  const status = observation ? concernObservationStatus(observation) : item.state === "active" ? "\u6B63\u5728\u7559\u610F" : "\u6682\u65F6\u8BB0\u7740";
6829
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { role: "listitem", "data-state": item.state, "data-expanded": expanded, children: [
6830
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "dsh-partner-concern-row", "aria-expanded": expanded, onClick: () => setExpandedId((current2) => current2 === item.id ? void 0 : item.id), children: [
6831
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "dsh-partner-concern-state", children: [
6832
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}),
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", {}),
6833
6991
  status
6834
6992
  ] }),
6835
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "dsh-partner-concern-copy", children: [
6836
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: item.subject }),
6837
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: observation ? observation.event : item.reason })
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 })
6838
6996
  ] }),
6839
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "dsh-partner-concern-time", title: `\u8BA1\u5212\u4E8E ${new Date(item.nextCheckAt).toLocaleString()} \u518D\u6B21\u7559\u610F`, children: [
6840
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u4E0B\u6B21\u7559\u610F" }),
6841
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: futureTime(item.nextCheckAt) })
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) })
6842
7000
  ] }),
6843
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconChevronDownOutline14, { size: 14 })
7001
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives14.IconChevronDownOutline14, { size: 14 })
6844
7002
  ] }),
6845
- expanded && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-concern-detail", children: [
6846
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: item.reason }),
6847
- observation && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
6848
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("blockquote", { children: observation.event }),
6849
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-concern-decision", "data-decision": observation.decision, children: [
6850
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: concernObservationStatus(observation) }),
6851
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: observation.decisionReason || concernObservationExplanation(observation) }),
6852
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
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: [
6853
7011
  "\u6253\u6270\u5206\u6570 ",
6854
7012
  Math.round(observation.interruptScore * 100),
6855
7013
  observation.notificationRuleEffect !== "auto" && observation.notificationRuleReason ? ` \xB7 \u77E5\u8BC6\u89C4\u5219\uFF1A${observation.notificationRuleReason}` : ""
6856
7014
  ] })
6857
7015
  ] })
6858
7016
  ] }),
6859
- item.resources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-concern-resources", children: item.resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
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: [
6860
7018
  resource.kind === "file" ? "\u6587\u4EF6" : "\u77E5\u8BC6",
6861
7019
  " \xB7 ",
6862
7020
  resource.label
6863
7021
  ] }, `${resource.kind}:${resource.locator}`)) }),
6864
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
7022
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
6865
7023
  item.origin === "explicit" ? "\u4F60\u660E\u786E\u4EA4\u4EE3" : "\u4F19\u4F34\u4ECE\u5BF9\u8BDD\u4E2D\u6CE8\u610F\u5230",
6866
7024
  " \xB7 ",
6867
7025
  watchKindLabel(item.watchKind)
6868
7026
  ] }),
6869
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-concern-actions", "aria-label": `${item.subject} \u7684\u64CD\u4F5C`, children: [
6870
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy, onClick: () => onCheck(item), children: "\u7ACB\u5373\u68C0\u67E5\u8FD9\u6761" }),
6871
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u7EE7\u7EED\u7559\u610F" }),
6872
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "prioritize"), children: "\u63D0\u9AD8\u5173\u6CE8" }),
6873
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "resolve"), children: "\u5DF2\u7ECF\u89E3\u51B3" }),
6874
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: () => onAct(item, "ignore"), children: "\u522B\u7BA1\u8FD9\u4E2A" })
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" })
6875
7033
  ] })
6876
7034
  ] })
6877
7035
  ] }, item.id);
6878
7036
  }) }),
6879
- (active.length > shown.length || visibleCount > 5) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-concern-more", children: active.length > shown.length ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", onClick: () => setVisibleCount((count) => Math.min(active.length, count + 20)), children: [
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: [
6880
7038
  "\u518D\u663E\u793A ",
6881
7039
  Math.min(20, active.length - shown.length),
6882
7040
  " \u6761"
6883
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setVisibleCount(5), children: "\u6536\u8D77\u5217\u8868" }) }),
6884
- resolved.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("details", { className: "dsh-partner-concern-resolved", children: [
6885
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("summary", { children: [
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: [
6886
7044
  "\u5DF2\u7ECF\u89E3\u51B3 ",
6887
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: resolved.length })
7045
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: resolved.length })
6888
7046
  ] }),
6889
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: resolved.slice(0, 30).map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { children: [
6890
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconCheckOutline14, { size: 13 }) }),
6891
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: item.subject }),
6892
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u91CD\u65B0\u7559\u610F" })
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" })
6893
7051
  ] }, item.id)) })
6894
7052
  ] })
6895
7053
  ] });
@@ -6915,23 +7073,23 @@ function watchKindLabel(value) {
6915
7073
  }
6916
7074
  var MEMORY_KINDS = ["all", "preference", "task", "event", "relationship", "emotion"];
6917
7075
  function MemoryLibrary({ companionId, revision, profiles, memories, reflections, editing, busy, setEditing, save, remove }) {
6918
- const activeMemories = (0, import_react18.useMemo)(() => memories.filter((item) => item.status === "active" && item.kind !== "profile"), [memories]);
6919
- const profileMemories = (0, import_react18.useMemo)(() => memories.filter((item) => item.status === "active" && item.kind === "profile"), [memories]);
6920
- const [mode, setMode] = (0, import_react18.useState)("profile");
6921
- const [kind, setKind] = (0, import_react18.useState)("all");
6922
- const [query, setQuery] = (0, import_react18.useState)("");
6923
- const [selectedMemoryId, setSelectedMemoryId] = (0, import_react18.useState)();
6924
- const [selectedDate, setSelectedDate] = (0, import_react18.useState)();
6925
- const [graph, setGraph] = (0, import_react18.useState)();
6926
- const [graphLoading, setGraphLoading] = (0, import_react18.useState)(false);
6927
- const [graphError, setGraphError] = (0, import_react18.useState)();
6928
- const [graphRequest, setGraphRequest] = (0, import_react18.useState)(0);
6929
- (0, import_react18.useEffect)(() => {
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)(() => {
6930
7088
  setGraph(void 0);
6931
7089
  setGraphError(void 0);
6932
7090
  setGraphLoading(false);
6933
7091
  }, [companionId, revision]);
6934
- (0, import_react18.useEffect)(() => {
7092
+ (0, import_react21.useEffect)(() => {
6935
7093
  if (mode !== "graph" || graph !== void 0) return;
6936
7094
  const controller = new AbortController();
6937
7095
  setGraphLoading(true);
@@ -6946,75 +7104,75 @@ function MemoryLibrary({ companionId, revision, profiles, memories, reflections,
6946
7104
  return () => controller.abort();
6947
7105
  }, [companionId, graph, graphRequest, mode, revision]);
6948
7106
  const normalized = query.trim().toLocaleLowerCase();
6949
- const filteredMemories = (0, import_react18.useMemo)(() => activeMemories.filter(
7107
+ const filteredMemories = (0, import_react21.useMemo)(() => activeMemories.filter(
6950
7108
  (item) => (kind === "all" || item.kind === kind) && (!normalized || `${item.subject} ${item.content}`.toLocaleLowerCase().includes(normalized))
6951
7109
  ), [activeMemories, kind, normalized]);
6952
- const filteredReflections = (0, import_react18.useMemo)(() => reflections.filter(
7110
+ const filteredReflections = (0, import_react21.useMemo)(() => reflections.filter(
6953
7111
  (item) => !normalized || `${item.date} ${item.summary} ${item.events.join(" ")} ${item.openTasks.join(" ")} ${item.learnings.join(" ")}`.toLocaleLowerCase().includes(normalized)
6954
7112
  ), [reflections, normalized]);
6955
7113
  const selectedMemory = filteredMemories.find((item) => item.id === selectedMemoryId) ?? filteredMemories[0];
6956
7114
  const selectedReflection = filteredReflections.find((item) => item.date === selectedDate) ?? filteredReflections[0];
6957
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-memory-library", children: [
6958
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { className: "dsh-partner-library-header", children: [
6959
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6960
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "MEMORY LIBRARY" }),
6961
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u4F19\u4F34\u8BB0\u5FC6\u5E93" }),
6962
- /* @__PURE__ */ (0, import_jsx_runtime14.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" })
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" })
6963
7121
  ] }),
6964
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("nav", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", children: [
6965
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: mode === "profile" ? "is-active" : "", onClick: () => setMode("profile"), children: [
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: [
6966
7124
  "\u4EBA\u7269\u753B\u50CF ",
6967
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: profiles.length })
7125
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: profiles.length })
6968
7126
  ] }),
6969
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: mode === "memory" ? "is-active" : "", onClick: () => setMode("memory"), children: [
7127
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: mode === "memory" ? "is-active" : "", onClick: () => setMode("memory"), children: [
6970
7128
  "\u8BDD\u9898\u8BB0\u5FC6 ",
6971
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: activeMemories.length })
7129
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: activeMemories.length })
6972
7130
  ] }),
6973
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: mode === "reflection" ? "is-active" : "", onClick: () => setMode("reflection"), children: [
7131
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: mode === "reflection" ? "is-active" : "", onClick: () => setMode("reflection"), children: [
6974
7132
  "\u6BCF\u65E5\u56DE\u987E ",
6975
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: reflections.length })
7133
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: reflections.length })
6976
7134
  ] }),
6977
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: mode === "graph" ? "is-active" : "", onClick: () => setMode("graph"), children: [
7135
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: mode === "graph" ? "is-active" : "", onClick: () => setMode("graph"), children: [
6978
7136
  "\u5173\u7CFB\u56FE\u8C31 ",
6979
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: graph?.relations.length ?? "\u2014" })
7137
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: graph?.relations.length ?? "\u2014" })
6980
7138
  ] })
6981
7139
  ] })
6982
7140
  ] }),
6983
- mode !== "profile" && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-library-tools", children: [
6984
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
6985
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u8BB0\u5FC6" }),
6986
- /* @__PURE__ */ (0, import_jsx_runtime14.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" })
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" })
6987
7145
  ] }),
6988
- mode === "memory" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-memory-kinds", children: MEMORY_KINDS.map((value) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: kind === value ? "is-active" : "", onClick: () => setKind(value), children: value === "all" ? "\u5168\u90E8" : memoryKind(value) }, value)) })
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)) })
6989
7147
  ] }),
6990
- mode === "profile" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ProfileLibrary, { profiles, memories: profileMemories, editing, busy, setEditing, save, remove }) : mode === "memory" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-library-browser", children: [
6991
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-library-list", role: "list", children: filteredMemories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsxs)("button", { type: "button", role: "listitem", className: selectedMemory?.id === item.id ? "is-active" : "", onClick: () => {
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: () => {
6992
7150
  setSelectedMemoryId(item.id);
6993
7151
  setEditing(void 0);
6994
7152
  }, children: [
6995
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { "data-kind": item.kind, children: memoryKind(item.kind) }),
6996
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: item.subject }),
6997
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: item.content }),
6998
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: relativeTime(item.updatedAt) })
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) })
6999
7157
  ] }, item.id)) }),
7000
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-library-detail", children: selectedMemory ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MemoryCard, { item: selectedMemory, editing: editing?.id === selectedMemory.id ? editing : void 0, busy, setEditing, save, remove: () => remove(selectedMemory) }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u6761\u8BB0\u5FC6", detail: "\u8BB0\u5FC6\u8BE6\u60C5\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
7001
- ] }) : mode === "reflection" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-library-browser", children: [
7002
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-library-list is-diary", role: "list", children: filteredReflections.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsxs)("button", { type: "button", role: "listitem", className: selectedReflection?.date === entry.date ? "is-active" : "", onClick: () => setSelectedDate(entry.date), children: [
7003
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("time", { children: entry.date }),
7004
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
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: [
7005
7163
  entry.turnCount,
7006
7164
  " \u8F6E\u4EA4\u6D41"
7007
7165
  ] }),
7008
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: entry.summary }),
7009
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
7166
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: entry.summary }),
7167
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
7010
7168
  entry.openTasks.length,
7011
7169
  " \u9879\u5F85\u8DDF\u8FDB \xB7 ",
7012
7170
  entry.learnings.length,
7013
7171
  " \u9879\u7406\u89E3"
7014
7172
  ] })
7015
7173
  ] }, entry.date)) }),
7016
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-library-detail", children: selectedReflection ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DailyReflectionDetail, { entry: selectedReflection }) : /* @__PURE__ */ (0, import_jsx_runtime14.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 }) })
7017
- ] }) : graphError ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: "\u5173\u7CFB\u56FE\u8C31\u52A0\u8F7D\u5931\u8D25", detail: graphError, action: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setGraphRequest((value) => value + 1), children: "\u91CD\u65B0\u52A0\u8F7D" }) }) : graphLoading || graph === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)(MemoryGraph, { graph, profiles, query: normalized, inspect: (item) => {
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) => {
7018
7176
  setEditing(void 0);
7019
7177
  if (item.kind === "profile") setMode("profile");
7020
7178
  else {
@@ -7025,71 +7183,71 @@ function MemoryLibrary({ companionId, revision, profiles, memories, reflections,
7025
7183
  ] });
7026
7184
  }
7027
7185
  function ProfileLibrary({ profiles, memories, editing, busy, setEditing, save, remove }) {
7028
- const [selectedScopeId, setSelectedScopeId] = (0, import_react18.useState)();
7186
+ const [selectedScopeId, setSelectedScopeId] = (0, import_react21.useState)();
7029
7187
  const selected = profiles.find((item) => item.scopeId === selectedScopeId) ?? profiles[0];
7030
- if (!selected) return /* @__PURE__ */ (0, import_jsx_runtime14.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" });
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" });
7031
7189
  const activeIds = new Set(selected.entries.map((item) => item.id));
7032
7190
  const pending = memories.filter((item) => item.scopeId === selected.scopeId && !activeIds.has(item.id));
7033
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-profile-browser", children: [
7034
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-profile-people", role: "list", "aria-label": "\u8054\u7CFB\u4EBA\u753B\u50CF", children: profiles.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "listitem", className: profile.scopeId === selected.scopeId ? "is-active" : "", onClick: () => {
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: () => {
7035
7193
  setSelectedScopeId(profile.scopeId);
7036
7194
  setEditing(void 0);
7037
7195
  }, children: [
7038
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconUserOutline16, { size: 16 }) }),
7039
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
7040
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: profile.label }),
7041
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: profile.entries.length > 0 ? `${profile.entries.length} \u9879\u7A33\u5B9A\u7406\u89E3` : "\u8FD8\u5728\u8BA4\u8BC6\u4E2D" })
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" })
7042
7200
  ] }),
7043
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { "aria-hidden": "true" })
7201
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", { "aria-hidden": "true" })
7044
7202
  ] }, profile.scopeId)) }),
7045
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-profile-stage", children: [
7046
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { className: "dsh-partner-profile-heading", children: [
7047
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
7048
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "PARTNER UNDERSTANDING" }),
7049
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
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: [
7050
7208
  "\u4F19\u4F34\u773C\u4E2D\u7684 ",
7051
7209
  selected.label
7052
7210
  ] }),
7053
- /* @__PURE__ */ (0, import_jsx_runtime14.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" })
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" })
7054
7212
  ] }),
7055
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { "data-ready": selected.entries.length > 0, children: [
7056
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}),
7213
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { "data-ready": selected.entries.length > 0, children: [
7214
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", {}),
7057
7215
  selected.entries.length > 0 ? "\u4E0A\u4E0B\u6587\u57FA\u7EBF\u5DF2\u5C31\u7EEA" : "\u7B49\u5F85\u53EF\u9760\u8BC1\u636E"
7058
7216
  ] })
7059
7217
  ] }),
7060
- selected.entries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
7061
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-profile-meta", children: [
7062
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
7063
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u753B\u50CF\u7248\u672C" }),
7064
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: selected.version })
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 })
7065
7223
  ] }),
7066
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
7067
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u5BF9\u8BDD\u4F9D\u636E" }),
7068
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
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: [
7069
7227
  selected.evidenceCount,
7070
7228
  " \u5904"
7071
7229
  ] })
7072
7230
  ] }),
7073
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
7074
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u7528\u6237\u786E\u8BA4" }),
7075
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
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: [
7076
7234
  selected.lockedCount,
7077
7235
  " \u9879"
7078
7236
  ] })
7079
7237
  ] }),
7080
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
7081
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u6700\u8FD1\u4F9D\u636E" }),
7082
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: selected.updatedAt ? relativeTime(selected.updatedAt) : "\u5C1A\u672A" })
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" })
7083
7241
  ] })
7084
7242
  ] }),
7085
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-profile-entries", children: selected.entries.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MemoryCard, { item, editing: editing?.id === item.id ? editing : void 0, busy, setEditing, save, remove: () => remove(item) }, item.id)) })
7086
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.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 }),
7087
- pending.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("details", { className: "dsh-partner-profile-pending", children: [
7088
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("summary", { children: [
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: [
7089
7247
  "\u5F85\u786E\u8BA4\u7684\u7406\u89E3 ",
7090
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: pending.length })
7248
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: pending.length })
7091
7249
  ] }),
7092
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: pending.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MemoryCard, { item, editing: editing?.id === item.id ? editing : void 0, busy, setEditing, save, remove: () => remove(item) }, item.id)) })
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)) })
7093
7251
  ] })
7094
7252
  ] })
7095
7253
  ] });
@@ -7098,9 +7256,9 @@ var RELATION_FILTERS = ["all", "conflicts_with", "depends_on", "supports", "foll
7098
7256
  function MemoryGraph({ graph, profiles, query, inspect }) {
7099
7257
  const byId = new Map(graph.memories.map((item) => [item.id, item]));
7100
7258
  const scopeIds = [...new Set(graph.relations.map((item) => item.scopeId))];
7101
- const [requestedScopeId, setRequestedScopeId] = (0, import_react18.useState)();
7259
+ const [requestedScopeId, setRequestedScopeId] = (0, import_react21.useState)();
7102
7260
  const scopeId = scopeIds.includes(requestedScopeId ?? "") ? requestedScopeId : scopeIds[0];
7103
- const [filter, setFilter] = (0, import_react18.useState)("all");
7261
+ const [filter, setFilter] = (0, import_react21.useState)("all");
7104
7262
  const scoped = graph.relations.filter((item) => item.scopeId === scopeId);
7105
7263
  const visible = scoped.filter((item) => {
7106
7264
  if (filter !== "all" && item.kind !== filter) return false;
@@ -7108,115 +7266,115 @@ function MemoryGraph({ graph, profiles, query, inspect }) {
7108
7266
  const target2 = byId.get(item.targetMemoryId);
7109
7267
  return !query || `${source2?.subject ?? ""} ${source2?.content ?? ""} ${target2?.subject ?? ""} ${target2?.content ?? ""} ${item.label}`.toLocaleLowerCase().includes(query);
7110
7268
  }).sort((left, right) => Number(right.kind === "conflicts_with") - Number(left.kind === "conflicts_with") || right.confidence - left.confidence);
7111
- const [selectedRelationId, setSelectedRelationId] = (0, import_react18.useState)();
7269
+ const [selectedRelationId, setSelectedRelationId] = (0, import_react21.useState)();
7112
7270
  const selected = visible.find((item) => item.id === selectedRelationId) ?? visible[0];
7113
7271
  const source = selected ? byId.get(selected.sourceMemoryId) : void 0;
7114
7272
  const target = selected ? byId.get(selected.targetMemoryId) : void 0;
7115
7273
  const label = profiles.find((item) => item.scopeId === scopeId)?.label ?? (scopeId ? `\u8054\u7CFB\u4EBA ${scopeId.slice(-6)}` : "\u5F53\u524D\u8054\u7CFB\u4EBA");
7116
7274
  const conflictCount = scoped.filter((item) => item.kind === "conflicts_with").length;
7117
- if (graph.relations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime14.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" });
7118
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-graph-audit", children: [
7119
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { className: "dsh-partner-graph-toolbar", children: [
7120
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
7121
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u5173\u7CFB\u5BA1\u8BA1" }),
7122
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
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: [
7123
7281
  label,
7124
7282
  " \u7684\u7406\u89E3\u5173\u7CFB"
7125
7283
  ] }),
7126
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
7284
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { children: [
7127
7285
  scoped.length,
7128
7286
  " \u6761\u53EF\u9760\u8054\u7CFB",
7129
7287
  conflictCount > 0 ? `\uFF0C\u5176\u4E2D ${conflictCount} \u6761\u9700\u8981\u786E\u8BA4` : "\uFF0C\u6682\u65E0\u5F85\u786E\u8BA4\u51B2\u7A81"
7130
7288
  ] })
7131
7289
  ] }),
7132
- scopeIds.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
7133
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u8054\u7CFB\u4EBA" }),
7134
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("select", { value: scopeId, onChange: (event) => {
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) => {
7135
7293
  setRequestedScopeId(event.target.value);
7136
7294
  setSelectedRelationId(void 0);
7137
- }, children: scopeIds.map((value) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value, children: profiles.find((item) => item.scopeId === value)?.label ?? `\u8054\u7CFB\u4EBA ${value.slice(-6)}` }, value)) })
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)) })
7138
7296
  ] })
7139
7297
  ] }),
7140
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("nav", { className: "dsh-partner-graph-filters", "aria-label": "\u5173\u7CFB\u7C7B\u578B", children: RELATION_FILTERS.map((value) => {
7298
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("nav", { className: "dsh-partner-graph-filters", "aria-label": "\u5173\u7CFB\u7C7B\u578B", children: RELATION_FILTERS.map((value) => {
7141
7299
  const count = value === "all" ? scoped.length : scoped.filter((item) => item.kind === value).length;
7142
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: filter === value ? "is-active" : "", "aria-pressed": filter === value, onClick: () => {
7300
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", className: filter === value ? "is-active" : "", "aria-pressed": filter === value, onClick: () => {
7143
7301
  setFilter(value);
7144
7302
  setSelectedRelationId(void 0);
7145
7303
  }, children: [
7146
7304
  value === "all" ? "\u5168\u90E8" : relationLabel(value),
7147
7305
  " ",
7148
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: count })
7306
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: count })
7149
7307
  ] }, value);
7150
7308
  }) }),
7151
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-graph-browser", children: [
7152
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-graph-index", role: "list", children: visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.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) => {
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) => {
7153
7311
  const from = byId.get(item.sourceMemoryId);
7154
7312
  const to = byId.get(item.targetMemoryId);
7155
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "listitem", "data-kind": item.kind, className: selected?.id === item.id ? "is-active" : "", onClick: () => setSelectedRelationId(item.id), children: [
7156
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: relationLabel(item.kind) }),
7157
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
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: [
7158
7316
  from?.subject ?? "\u5DF2\u5220\u9664\u8BB0\u5FC6",
7159
7317
  " ",
7160
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
7318
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
7161
7319
  " ",
7162
7320
  to?.subject ?? "\u5DF2\u5220\u9664\u8BB0\u5FC6"
7163
7321
  ] }),
7164
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: item.label }),
7165
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
7322
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: item.label }),
7323
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
7166
7324
  Math.round(item.confidence * 100),
7167
7325
  "% \u53EF\u4FE1"
7168
7326
  ] })
7169
7327
  ] }, item.id);
7170
7328
  }) }),
7171
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-graph-stage", children: selected && source && target ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { "data-kind": selected.kind, children: [
7172
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
7173
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: relationLabel(selected.kind) }),
7174
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
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: [
7175
7333
  source.subject,
7176
7334
  " ",
7177
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
7335
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
7178
7336
  " ",
7179
7337
  target.subject
7180
7338
  ] }),
7181
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: selected.label }),
7182
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: relationGuidance(selected.kind) })
7339
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: selected.label }),
7340
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: relationGuidance(selected.kind) })
7183
7341
  ] }),
7184
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-graph-pair", children: [
7185
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GraphMemory, { item: source, side: "\u8D77\u70B9", inspect }),
7186
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { "aria-hidden": "true", children: [
7187
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}),
7188
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: relationLabel(selected.kind) }),
7189
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {})
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", {})
7190
7348
  ] }),
7191
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GraphMemory, { item: target, side: "\u5173\u8054\u9879", inspect })
7349
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GraphMemory, { item: target, side: "\u5173\u8054\u9879", inspect })
7192
7350
  ] }),
7193
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("footer", { children: [
7194
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
7351
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("footer", { children: [
7352
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
7195
7353
  "\u6700\u8FD1\u7EC8\u5BA1\u4E8E ",
7196
7354
  new Date(selected.updatedAt).toLocaleString()
7197
7355
  ] }),
7198
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
7356
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("strong", { children: [
7199
7357
  "\u5173\u7CFB\u7F6E\u4FE1\u5EA6 ",
7200
7358
  Math.round(selected.confidence * 100),
7201
7359
  "%"
7202
7360
  ] })
7203
7361
  ] })
7204
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.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 }) })
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 }) })
7205
7363
  ] })
7206
7364
  ] });
7207
7365
  }
7208
7366
  function GraphMemory({ item, side, inspect }) {
7209
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { children: [
7210
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
7211
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
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: [
7212
7370
  side,
7213
7371
  " \xB7 ",
7214
7372
  memoryKind(item.kind)
7215
7373
  ] }),
7216
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: item.subject })
7374
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: item.subject })
7217
7375
  ] }),
7218
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: item.content }),
7219
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => inspect(item), children: "\u67E5\u770B\u5E76\u4FEE\u6B63" })
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" })
7220
7378
  ] });
7221
7379
  }
7222
7380
  function relationLabel(kind) {
@@ -7232,77 +7390,74 @@ function relationGuidance(kind) {
7232
7390
  }[kind];
7233
7391
  }
7234
7392
  function DailyReflectionDetail({ entry }) {
7235
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { className: "dsh-partner-diary-detail", children: [
7236
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
7237
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("time", { children: entry.date }),
7238
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
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: [
7239
7397
  entry.turnCount,
7240
7398
  " \u8F6E\u4EA4\u6D41\u540E\u7684\u7406\u89E3"
7241
7399
  ] }),
7242
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
7400
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("small", { children: [
7243
7401
  "\u66F4\u65B0\u4E8E ",
7244
7402
  new Date(entry.updatedAt).toLocaleString()
7245
7403
  ] })
7246
7404
  ] }),
7247
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: entry.summary }),
7248
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ReflectionGroup, { title: "\u5F85\u8DDF\u8FDB", items: entry.openTasks }),
7249
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ReflectionGroup, { title: "\u5F53\u5929\u4E8B\u4EF6", items: entry.events }),
7250
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ReflectionGroup, { title: "\u65B0\u7406\u89E3", items: entry.learnings }),
7251
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ReflectionGroup, { title: "\u5DF2\u5B8C\u6210", items: entry.completedTasks })
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 })
7252
7410
  ] });
7253
7411
  }
7254
7412
  function ReflectionGroup({ title, items }) {
7255
7413
  if (items.length === 0) return null;
7256
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { children: [
7257
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: title }),
7258
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: item }, item)) })
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)) })
7259
7417
  ] });
7260
7418
  }
7261
7419
  function MemoryCard({ item, editing, busy, setEditing, save, remove }) {
7262
- const [confirmingRemove, setConfirmingRemove] = (0, import_react18.useState)(false);
7263
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("article", { "data-kind": item.kind, children: editing ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-memory-editor", children: [
7264
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { "aria-label": "\u8BB0\u5FC6\u4E3B\u9898", value: editing.subject, onChange: (event) => setEditing({ ...editing, subject: event.target.value }) }),
7265
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("textarea", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", value: editing.content, onChange: (event) => setEditing({ ...editing, content: event.target.value }) }),
7266
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("footer", { children: [
7267
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setEditing(void 0), children: "\u53D6\u6D88" }),
7268
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "is-primary", disabled: busy || !editing.subject.trim() || !editing.content.trim(), onClick: save, children: "\u4FDD\u5B58\u4FEE\u6B63" })
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" })
7269
7427
  ] })
7270
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
7271
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
7272
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: memoryKind(item.kind) }),
7273
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: confirmingRemove ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
7274
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setConfirmingRemove(false), children: "\u53D6\u6D88" }),
7275
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
7276
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
7277
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setEditing({ ...item }), children: "\u7F16\u8F91" }),
7278
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setConfirmingRemove(true), children: "\u5220\u9664" })
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" })
7279
7437
  ] }) })
7280
7438
  ] }),
7281
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: item.subject }),
7282
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: item.content }),
7283
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("footer", { children: [
7284
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("progress", { max: 1, value: item.confidence, "aria-label": `\u7F6E\u4FE1\u5EA6 ${Math.round(item.confidence * 100)}%` }),
7285
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
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: [
7286
7444
  item.locked ? "\u624B\u52A8\u786E\u8BA4" : `${Math.round(item.confidence * 100)}% \u53EF\u4FE1`,
7287
7445
  " \xB7 ",
7288
7446
  relativeTime(item.updatedAt)
7289
7447
  ] })
7290
7448
  ] }),
7291
- item.evidence.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("details", { className: "dsh-partner-memory-evidence", children: [
7292
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("summary", { children: [
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: [
7293
7451
  "\u67E5\u770B\u5BF9\u8BDD\u4F9D\u636E ",
7294
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: item.evidence.length })
7452
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: item.evidence.length })
7295
7453
  ] }),
7296
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: [...item.evidence].reverse().map((evidence) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("blockquote", { children: [
7297
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: evidence.excerpt }),
7298
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("time", { children: new Date(evidence.at).toLocaleString() })
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() })
7299
7457
  ] }, `${evidence.turnId}:${evidence.at}`)) })
7300
7458
  ] })
7301
7459
  ] }) });
7302
7460
  }
7303
- function companionDraft(companion) {
7304
- return { name: companion.name, role: companion.role, description: companion.description, instructions: companion.instructions, presetId: companion.presetId ?? "", provider: companion.provider ?? "", model: companion.model ?? "", capabilities: [...companion.capabilities] };
7305
- }
7306
7461
  function concernObservationStatus(item) {
7307
7462
  if (item.decision === "notify") return item.mentionedAt === void 0 ? "\u5F85\u63D0\u9192" : "\u5DF2\u63D0\u9192";
7308
7463
  if (item.decision === "feed") return "\u4F19\u4F34\u52A8\u6001";