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