@lemoncat7/dsh-partner 2.3.0 → 2.4.1

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 (152) hide show
  1. package/README.md +6 -0
  2. package/docs/channel-message-format.md +2 -0
  3. package/docs/mcp.md +54 -0
  4. package/docs/releases/2.4.0.md +11 -0
  5. package/docs/releases/2.4.1.md +9 -0
  6. package/lib/agent-runtime.d.ts.map +1 -1
  7. package/lib/agent-runtime.js +4 -0
  8. package/lib/agent-runtime.js.map +1 -1
  9. package/lib/api/features/mcp-api.d.ts +4 -0
  10. package/lib/api/features/mcp-api.d.ts.map +1 -0
  11. package/lib/api/features/mcp-api.js +37 -0
  12. package/lib/api/features/mcp-api.js.map +1 -0
  13. package/lib/api.d.ts +2 -0
  14. package/lib/api.d.ts.map +1 -1
  15. package/lib/api.js +3 -0
  16. package/lib/api.js.map +1 -1
  17. package/lib/capabilities.d.ts +1 -1
  18. package/lib/capabilities.d.ts.map +1 -1
  19. package/lib/capabilities.js +2 -2
  20. package/lib/capabilities.js.map +1 -1
  21. package/lib/client.d.ts.map +1 -1
  22. package/lib/client.js +1480 -1033
  23. package/lib/client.js.map +4 -4
  24. package/lib/collaboration/composition.d.ts +3 -0
  25. package/lib/collaboration/composition.d.ts.map +1 -1
  26. package/lib/collaboration/composition.js +5 -1
  27. package/lib/collaboration/composition.js.map +1 -1
  28. package/lib/collaboration/domain.d.ts +3 -0
  29. package/lib/collaboration/domain.d.ts.map +1 -1
  30. package/lib/collaboration/domain.js.map +1 -1
  31. package/lib/collaboration/review-dispatch.d.ts +5 -0
  32. package/lib/collaboration/review-dispatch.d.ts.map +1 -0
  33. package/lib/collaboration/review-dispatch.js +23 -0
  34. package/lib/collaboration/review-dispatch.js.map +1 -0
  35. package/lib/collaboration/service.d.ts.map +1 -1
  36. package/lib/collaboration/service.js +12 -3
  37. package/lib/collaboration/service.js.map +1 -1
  38. package/lib/companions/management.d.ts +4 -4
  39. package/lib/companions/removal.d.ts.map +1 -1
  40. package/lib/companions/removal.js +2 -0
  41. package/lib/companions/removal.js.map +1 -1
  42. package/lib/companions/session-configuration.d.ts.map +1 -1
  43. package/lib/companions/session-configuration.js +2 -0
  44. package/lib/companions/session-configuration.js.map +1 -1
  45. package/lib/core/validation.d.ts +2 -0
  46. package/lib/core/validation.d.ts.map +1 -1
  47. package/lib/core/validation.js +9 -0
  48. package/lib/core/validation.js.map +1 -1
  49. package/lib/domain.d.ts +2 -0
  50. package/lib/domain.d.ts.map +1 -1
  51. package/lib/domain.js.map +1 -1
  52. package/lib/execution/service.d.ts +3 -1
  53. package/lib/execution/service.d.ts.map +1 -1
  54. package/lib/execution/service.js +4 -0
  55. package/lib/execution/service.js.map +1 -1
  56. package/lib/index.d.ts.map +1 -1
  57. package/lib/index.js +7 -1
  58. package/lib/index.js.map +1 -1
  59. package/lib/mcp/config.d.ts +10 -0
  60. package/lib/mcp/config.d.ts.map +1 -0
  61. package/lib/mcp/config.js +54 -0
  62. package/lib/mcp/config.js.map +1 -0
  63. package/lib/mcp/connection-error.d.ts +3 -0
  64. package/lib/mcp/connection-error.d.ts.map +1 -0
  65. package/lib/mcp/connection-error.js +31 -0
  66. package/lib/mcp/connection-error.js.map +1 -0
  67. package/lib/mcp/connections.d.ts +11 -0
  68. package/lib/mcp/connections.d.ts.map +1 -0
  69. package/lib/mcp/connections.js +91 -0
  70. package/lib/mcp/connections.js.map +1 -0
  71. package/lib/mcp/credentials.d.ts +11 -0
  72. package/lib/mcp/credentials.d.ts.map +1 -0
  73. package/lib/mcp/credentials.js +25 -0
  74. package/lib/mcp/credentials.js.map +1 -0
  75. package/lib/mcp/domain.d.ts +41 -0
  76. package/lib/mcp/domain.d.ts.map +1 -0
  77. package/lib/mcp/domain.js +2 -0
  78. package/lib/mcp/domain.js.map +1 -0
  79. package/lib/mcp/edit-config.d.ts +6 -0
  80. package/lib/mcp/edit-config.d.ts.map +1 -0
  81. package/lib/mcp/edit-config.js +36 -0
  82. package/lib/mcp/edit-config.js.map +1 -0
  83. package/lib/mcp/service.d.ts +31 -0
  84. package/lib/mcp/service.d.ts.map +1 -0
  85. package/lib/mcp/service.js +227 -0
  86. package/lib/mcp/service.js.map +1 -0
  87. package/lib/mcp/state.d.ts +4 -0
  88. package/lib/mcp/state.d.ts.map +1 -0
  89. package/lib/mcp/state.js +29 -0
  90. package/lib/mcp/state.js.map +1 -0
  91. package/lib/requirements/plan-schema.d.ts +1 -0
  92. package/lib/requirements/plan-schema.d.ts.map +1 -1
  93. package/lib/requirements/plan-schema.js +2 -2
  94. package/lib/requirements/plan-schema.js.map +1 -1
  95. package/lib/requirements/service.js +2 -2
  96. package/lib/requirements/service.js.map +1 -1
  97. package/lib/requirements/tool.js +2 -2
  98. package/lib/requirements/tool.js.map +1 -1
  99. package/lib/skills/task-planning.d.ts +2 -2
  100. package/lib/skills/task-planning.d.ts.map +1 -1
  101. package/lib/skills/task-planning.js +3 -2
  102. package/lib/skills/task-planning.js.map +1 -1
  103. package/lib/storage/migrate-layout.d.ts.map +1 -1
  104. package/lib/storage/migrate-layout.js +1 -0
  105. package/lib/storage/migrate-layout.js.map +1 -1
  106. package/lib/storage/split-state.js +2 -2
  107. package/lib/storage/split-state.js.map +1 -1
  108. package/lib/store.d.ts.map +1 -1
  109. package/lib/store.js +2 -0
  110. package/lib/store.js.map +1 -1
  111. package/lib/tasks/result.d.ts.map +1 -1
  112. package/lib/tasks/result.js +4 -18
  113. package/lib/tasks/result.js.map +1 -1
  114. package/lib/tasks/scheduling.d.ts.map +1 -1
  115. package/lib/tasks/scheduling.js +3 -0
  116. package/lib/tasks/scheduling.js.map +1 -1
  117. package/lib/ui/capability-editor.d.ts.map +1 -1
  118. package/lib/ui/capability-editor.js +26 -17
  119. package/lib/ui/capability-editor.js.map +1 -1
  120. package/lib/ui/capability-resources.d.ts +12 -0
  121. package/lib/ui/capability-resources.d.ts.map +1 -0
  122. package/lib/ui/capability-resources.js +39 -0
  123. package/lib/ui/capability-resources.js.map +1 -0
  124. package/lib/ui/companion-access-panel.d.ts +2 -1
  125. package/lib/ui/companion-access-panel.d.ts.map +1 -1
  126. package/lib/ui/companion-access-panel.js +5 -1
  127. package/lib/ui/companion-access-panel.js.map +1 -1
  128. package/lib/ui/mcp-capabilities.d.ts +6 -0
  129. package/lib/ui/mcp-capabilities.d.ts.map +1 -0
  130. package/lib/ui/mcp-capabilities.js +53 -0
  131. package/lib/ui/mcp-capabilities.js.map +1 -0
  132. package/lib/ui/mcp-editor.d.ts +7 -0
  133. package/lib/ui/mcp-editor.d.ts.map +1 -0
  134. package/lib/ui/mcp-editor.js +85 -0
  135. package/lib/ui/mcp-editor.js.map +1 -0
  136. package/lib/ui/mcp-panel.d.ts +2 -0
  137. package/lib/ui/mcp-panel.d.ts.map +1 -0
  138. package/lib/ui/mcp-panel.js +61 -0
  139. package/lib/ui/mcp-panel.js.map +1 -0
  140. package/lib/ui/skills-panel.d.ts +2 -1
  141. package/lib/ui/skills-panel.d.ts.map +1 -1
  142. package/lib/ui/skills-panel.js +5 -1
  143. package/lib/ui/skills-panel.js.map +1 -1
  144. package/lib/ui/workspace-components.d.ts +2 -1
  145. package/lib/ui/workspace-components.d.ts.map +1 -1
  146. package/lib/ui/workspace-components.js +2 -2
  147. package/lib/ui/workspace-components.js.map +1 -1
  148. package/lib/ui/workspace-navigation.d.ts +9 -1
  149. package/lib/ui/workspace-navigation.d.ts.map +1 -1
  150. package/lib/ui/workspace-navigation.js +1 -0
  151. package/lib/ui/workspace-navigation.js.map +1 -1
  152. package/package.json +7 -3
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_react46 = require("react");
38
+ var import_react50 = 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_primitives22 = require("@deepseek-ai/dsh-client-ui-primitives");
57
+ var import_dsh_client_ui_primitives24 = 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);
@@ -1229,9 +1229,11 @@ var client_default = `.dsh-partner-channel-toolbar { display:flex; align-items:c
1229
1229
  --partner-glass-thick: rgba(255, 255, 255, .42);
1230
1230
  --partner-glass-highlight: rgba(255, 255, 255, .7);
1231
1231
  --partner-glass-rim-shadow: rgba(60, 60, 67, .11);
1232
- --partner-glass-filter: saturate(.65) contrast(1.015) blur(24px);
1233
- --partner-frosted-filter: saturate(.65) contrast(1.015) blur(24px);
1234
- --partner-toolbar-filter: saturate(.18) contrast(1.015) blur(24px);
1232
+ /* Share Knowledge's material without desaturating the host backdrop. */
1233
+ --partner-glass-filter: saturate(1.22) contrast(1.03) blur(32px);
1234
+ --partner-frosted-filter: var(--partner-glass-filter);
1235
+ --partner-toolbar-filter: var(--partner-glass-filter);
1236
+ --partner-toolbar-surface: rgb(255 255 255 / 16%);
1235
1237
  --partner-shadow-sm: 0 1px 2px rgba(0, 0, 0, .055);
1236
1238
  --partner-shadow-md: 0 10px 28px rgba(31, 31, 35, .085);
1237
1239
  --partner-shadow-lg: 0 24px 64px rgba(31, 31, 35, .14);
@@ -1291,14 +1293,24 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
1291
1293
  --partner-glass-thick: rgba(0, 0, 0, .26);
1292
1294
  --partner-glass-highlight: rgba(255, 255, 255, .16);
1293
1295
  --partner-glass-rim-shadow: rgba(0, 0, 0, .3);
1294
- --partner-glass-filter: saturate(.55) contrast(1.02) blur(24px);
1295
- --partner-frosted-filter: saturate(.55) contrast(1.02) blur(24px);
1296
- --partner-toolbar-filter: saturate(.45) contrast(1.02) blur(24px);
1296
+ --partner-toolbar-surface: rgb(25 33 35 / 16%);
1297
1297
  --partner-shadow-sm: 0 1px 2px rgba(0, 0, 0, .28);
1298
1298
  --partner-shadow-md: 0 12px 32px rgba(0, 0, 0, .34);
1299
1299
  --partner-shadow-lg: 0 28px 72px rgba(0, 0, 0, .48);
1300
1300
  }
1301
1301
 
1302
+ /* Lift workspace cards to neutral graphite without changing the pendant,
1303
+ host canvas, or the opaque dialog/control fallback palette. */
1304
+ body[data-ds-dark-theme] .dsh-partner-workspace {
1305
+ --partner-raised: rgb(76 78 82 / 58%);
1306
+ --partner-card-surface: var(--partner-raised);
1307
+ --partner-card-highlight: rgb(255 255 255 / 13%);
1308
+ --partner-card-shadow:
1309
+ inset 0 1px 0 var(--partner-card-highlight),
1310
+ inset 0 -1px 0 rgb(0 0 0 / 14%),
1311
+ 0 6px 18px rgb(0 0 0 / 14%);
1312
+ }
1313
+
1302
1314
  .dsh-partner-sidebar,
1303
1315
  .dsh-partner-sidebar *,
1304
1316
  .dsh-partner-workspace,
@@ -1757,7 +1769,7 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
1757
1769
  }
1758
1770
  .dsh-partner-glass-surface.is-interactive:hover::after { opacity: .72; }
1759
1771
  }
1760
- .dsh-partner-topbar { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; min-height: 52px; margin: 8px 10px 0; padding: 7px 14px; border: 1px solid var(--partner-border); border-radius: 14px 14px 11px 11px; background: transparent; -webkit-backdrop-filter: var(--partner-toolbar-filter); backdrop-filter: var(--partner-toolbar-filter); box-shadow: var(--partner-glass-shadow); }
1772
+ .dsh-partner-topbar { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; min-height: 52px; margin: 8px 10px 0; padding: 7px 14px; border: 1px solid var(--partner-border); border-radius: 14px 14px 11px 11px; background: var(--partner-toolbar-surface); -webkit-backdrop-filter: var(--partner-toolbar-filter); backdrop-filter: var(--partner-toolbar-filter); box-shadow: var(--partner-glass-shadow); }
1761
1773
  .dsh-partner-topbar > div { display: flex; align-items: center; gap: 10px; }
1762
1774
  .dsh-partner-topbar > div > span:last-child { display: grid; gap: 2px; }
1763
1775
  .dsh-partner-topbar strong { font-size: var(--partner-font-label); font-weight: 620; }
@@ -1942,9 +1954,30 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
1942
1954
  .dsh-partner-field select:focus { border-color: var(--partner-focus-ring); background: var(--partner-raised); box-shadow: 0 0 0 3px color-mix(in srgb, var(--partner-focus-ring) 18%, transparent), inset 0 1px 0 var(--partner-glass-highlight); }
1943
1955
  .dsh-partner-form-actions { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding-top: 5px; }
1944
1956
  .dsh-partner-form-actions > span { display: inline-flex; align-items: center; gap: 5px; color: var(--partner-accent-strong); font-size: var(--partner-font-body); }
1945
- .dsh-partner-form-actions.is-capability-save { flex-wrap: wrap; gap: 12px; }
1946
- .dsh-partner-form-actions.is-capability-save > span { min-height: 24px; }
1947
- .dsh-partner-form-actions.is-capability-save > span svg { flex-shrink: 0; }
1957
+ .dsh-partner-capability-save-status { position: static; padding: 8px 12px; border: 1px solid var(--partner-separator); border-radius: 10px; background: var(--partner-raised); color: var(--partner-text-secondary); font-size: var(--partner-font-caption); }
1958
+ .dsh-partner-capability-picker { display: grid; gap: 12px; min-width: 0; }
1959
+ .dsh-partner-capability-card { position: relative; min-width: 0; }
1960
+ .dsh-partner-capability-card > button:first-child { width: 100%; height: 100%; }
1961
+ .dsh-partner-capability-card:has(.dsh-partner-capability-manage) > button:first-child strong { padding-right: 68px; }
1962
+ .dsh-partner-capability-card-copy { display: grid; gap: 4px; height: 100%; box-sizing: border-box; padding: 12px; border: 1px solid var(--partner-border); border-radius: 11px; background: var(--partner-raised); }
1963
+ .dsh-partner-capability-card-copy strong { padding-right: 76px; }
1964
+ .dsh-partner-capabilities .dsh-partner-capability-manage { position: absolute; inset: 6px 6px auto auto; display: inline-flex; align-items: center; justify-content: center; width: auto; height: auto; min-height: 32px; padding: 4px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--partner-text-secondary); font-size: var(--partner-font-caption); white-space: nowrap; }
1965
+ .dsh-partner-workspace-dialog.is-capability-resources { width: 100%; animation: none; }
1966
+ @media (min-width: 761px) {
1967
+ .dsh-partner-workspace-dialog.is-capability-resources { width: min(100%, clamp(640px, 76vw, 1040px)); max-height: 100%; }
1968
+ }
1969
+ .dsh-partner-workspace .dsh-partner-capabilities .dsh-partner-capability-manage { box-shadow: none; background: transparent; color: var(--partner-text-secondary); border: 0; }
1970
+ .dsh-partner-workspace .dsh-partner-capabilities .dsh-partner-capability-manage:hover:not(:disabled) { background: var(--partner-hover); color: var(--partner-text); }
1971
+ .is-capability-resources .dsh-partner-capability-detail { padding: 0; border: 0; background: transparent; box-shadow: none; }
1972
+ .is-capability-resources .dsh-partner-capability-detail > header > span,
1973
+ .is-capability-resources .dsh-partner-access > header,
1974
+ .is-capability-resources .dsh-partner-access-note { display: none; }
1975
+ .is-capability-resources .dsh-partner-capability-detail > header { justify-content: flex-end; }
1976
+ .is-capability-resources .dsh-partner-skill-installed.is-binding { grid-template-columns: minmax(0, 1fr); }
1977
+ .is-capability-resources .dsh-partner-skill-installed.is-binding > article { grid-template-columns: 28px minmax(0, 1fr) auto; min-height: 0; padding: 10px; align-items: center; }
1978
+ .is-capability-resources .dsh-partner-skill-installed.is-binding .dsh-partner-skill-binding-action { grid-column: auto; width: auto; }
1979
+ .is-capability-resources .dsh-partner-collection-empty { min-height: 120px; padding: 20px 12px; }
1980
+ @media (pointer: coarse) { .dsh-partner-capabilities .dsh-partner-capability-manage { min-height: 44px; min-width: 44px; inset-block-start: 0; } }
1948
1981
  .dsh-partner-form-actions > button,
1949
1982
  .dsh-partner-state > button,
1950
1983
  .dsh-partner-weixin-connect > button { min-height: 34px; padding: 0 15px; border: 1px solid color-mix(in srgb, var(--partner-accent) 60%, transparent); border-radius: 10px; color: var(--partner-on-accent); background: var(--partner-accent-strong); font: 600 var(--partner-font-body)/1 var(--partner-font-family); cursor: pointer; }
@@ -3201,7 +3234,7 @@ function WorkspaceBlock({ title, detail, actions, children, className = "" }) {
3201
3234
  children
3202
3235
  ] });
3203
3236
  }
3204
- function WorkspaceDialog({ eyebrow = "CREATE & CONFIGURE", title, detail, close, children, width = "regular" }) {
3237
+ function WorkspaceDialog({ eyebrow = "CREATE & CONFIGURE", title, detail, close, children, width = "regular", className = "" }) {
3205
3238
  const titleId = (0, import_react2.useId)();
3206
3239
  const detailId = (0, import_react2.useId)();
3207
3240
  const layerRef = (0, import_react2.useRef)(null);
@@ -3247,10 +3280,10 @@ function WorkspaceDialog({ eyebrow = "CREATE & CONFIGURE", title, detail, close,
3247
3280
  close();
3248
3281
  }, onPointerDown: (event) => {
3249
3282
  if (event.target === event.currentTarget) close();
3250
- }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { ref: panelRef, className: `dsh-partner-workspace-dialog is-${width}`, onKeyDown: keyDown, children: [
3283
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { ref: panelRef, className: `dsh-partner-workspace-dialog is-${width} ${className}`, onKeyDown: keyDown, children: [
3251
3284
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [
3252
3285
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
3253
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: eyebrow }),
3286
+ eyebrow && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: eyebrow }),
3254
3287
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { id: titleId, children: title }),
3255
3288
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { id: detailId, children: detail })
3256
3289
  ] }),
@@ -13349,7 +13382,7 @@ function SkillsPanel() {
13349
13382
  ] })
13350
13383
  ] });
13351
13384
  }
13352
- function CompanionSkillSettings({ companionId }) {
13385
+ function CompanionSkillSettings({ companionId, onBusyChange }) {
13353
13386
  const [catalog, setCatalog] = (0, import_react30.useState)({ installed: [], bindings: [], sources: [] });
13354
13387
  const [busy, setBusy] = (0, import_react30.useState)();
13355
13388
  const [error, setError] = (0, import_react30.useState)();
@@ -13382,6 +13415,8 @@ function CompanionSkillSettings({ companionId }) {
13382
13415
  const visibleEnabledSkills = showAll ? enabledSkills : enabledSkills.slice(0, 4);
13383
13416
  const visibleAvailableSkills = availableSkills.slice(0, 80);
13384
13417
  const setBinding = async (skillId, nextEnabled) => {
13418
+ if (busy) return;
13419
+ onBusyChange?.(true);
13385
13420
  setBusy(skillId);
13386
13421
  setError(void 0);
13387
13422
  try {
@@ -13391,6 +13426,7 @@ function CompanionSkillSettings({ companionId }) {
13391
13426
  setError(errorMessage(reason));
13392
13427
  } finally {
13393
13428
  setBusy(void 0);
13429
+ onBusyChange?.(false);
13394
13430
  }
13395
13431
  };
13396
13432
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("section", { className: "dsh-partner-capability-detail", "aria-labelledby": "dsh-partner-skill-capability-title", children: [
@@ -13653,18 +13689,254 @@ function skillScalar(value) {
13653
13689
  return `"${value.replace(/[\r\n]+/g, " ").replace(/"/g, "'").trim()}"`;
13654
13690
  }
13655
13691
 
13692
+ // src/ui/mcp-panel.tsx
13693
+ var import_react32 = require("react");
13694
+ var import_dsh_client_ui_primitives12 = require("@deepseek-ai/dsh-client-ui-primitives");
13695
+
13696
+ // src/ui/mcp-editor.tsx
13697
+ var import_react31 = require("react");
13698
+ var import_jsx_runtime28 = require("react/jsx-runtime");
13699
+ function McpEditor({ value, close, saved }) {
13700
+ const existing = typeof value === "object" ? value : void 0;
13701
+ const importing = value === "import";
13702
+ const [name, setName] = (0, import_react31.useState)(existing?.name ?? "");
13703
+ const [json, setJson] = (0, import_react31.useState)("");
13704
+ const [original, setOriginal] = (0, import_react31.useState)("");
13705
+ const [revision, setRevision] = (0, import_react31.useState)();
13706
+ const [revealed, setRevealed] = (0, import_react31.useState)(false);
13707
+ const [loading, setLoading] = (0, import_react31.useState)(!!existing);
13708
+ const [busy, setBusy] = (0, import_react31.useState)(false);
13709
+ const [error, setError] = (0, import_react31.useState)("");
13710
+ const mounted = (0, import_react31.useRef)(true);
13711
+ const field = (0, import_react31.useId)();
13712
+ const load2 = async (reveal) => {
13713
+ if (!existing) return;
13714
+ setLoading(true);
13715
+ setError("");
13716
+ try {
13717
+ const next = await api(`/mcp/${existing.id}/config${reveal ? "?reveal=1" : ""}`);
13718
+ if (!mounted.current) return;
13719
+ const text4 = JSON.stringify(next.config, null, 2);
13720
+ if (revision === void 0) setName(next.name);
13721
+ setJson(text4);
13722
+ setOriginal(text4);
13723
+ setRevision(next.revision);
13724
+ setRevealed(reveal);
13725
+ } catch (reason) {
13726
+ if (mounted.current) setError(errorMessage(reason));
13727
+ } finally {
13728
+ if (mounted.current) setLoading(false);
13729
+ }
13730
+ };
13731
+ (0, import_react31.useEffect)(() => {
13732
+ mounted.current = true;
13733
+ void load2(false);
13734
+ return () => {
13735
+ mounted.current = false;
13736
+ };
13737
+ }, []);
13738
+ const hint = importing ? "\u7C98\u8D34\u5305\u542B mcpServers \u7684\u5B8C\u6574\u914D\u7F6E\uFF0C\u670D\u52A1\u540D\u79F0\u53D6\u81EA\u5176\u4E2D\u7684\u952E\u540D\uFF1B\u53EF\u4E00\u6B21\u5BFC\u5165\u591A\u4E2A\u670D\u52A1\u3002\u5355\u4E2A url / command \u5BF9\u8C61\u8BF7\u7528\u300C\u65B0\u589E MCP\u300D\u3002" : existing ? "\u5DF2\u56DE\u586B\u5F53\u524D\u914D\u7F6E\u3002{{DSH_MCP_SAVED:\u2026}} \u8868\u793A\u5DF2\u4FDD\u5B58\u7684\u503C\uFF0C\u4FDD\u6301\u539F\u6837\u5373\u53EF\u4FDD\u7559\uFF1B\u586B\u5199\u65B0\u503C\u53EF\u66FF\u6362\uFF0C\u5220\u9664\u5B57\u6BB5\u5219\u79FB\u9664\u3002\u8BA4\u8BC1\u548C\u547D\u4EE4\u53C2\u6570\u9ED8\u8BA4\u9690\u85CF\uFF0C\u53EF\u70B9\u300C\u663E\u793A\u5B8C\u6574\u914D\u7F6E\u300D\u3002" : "\u8FD9\u91CC\u586B\u5199\u4E00\u4E2A\u670D\u52A1\u7684\u914D\u7F6E\uFF1AHTTP \u5305\u542B url\uFF0Cstdio \u5305\u542B command \u548C args\u3002\u4E5F\u652F\u6301\u76F4\u63A5\u7C98\u8D34\u4EC5\u542B\u4E00\u4E2A\u670D\u52A1\u7684\u5B8C\u6574 mcpServers \u914D\u7F6E\uFF1B\u591A\u4E2A\u670D\u52A1\u8BF7\u7528\u300C\u5BFC\u5165 JSON\u300D\u3002";
13739
+ const example = JSON.stringify(importing ? { mcpServers: { docmost: { type: "http", url: "http://docmost:3000/mcp", headers: { Authorization: "Bearer YOUR_TOKEN" } } } } : { type: "http", url: "http://docmost:3000/mcp", headers: { Authorization: "Bearer YOUR_TOKEN" } }, null, 2);
13740
+ const stdioExample = JSON.stringify(importing ? { mcpServers: { example: { command: "npx", args: ["-y", "your-mcp-package"] } } } : { command: "npx", args: ["-y", "your-mcp-package"] }, null, 2);
13741
+ const submit = async () => {
13742
+ if (busy || loading || existing && revision === void 0) return;
13743
+ setBusy(true);
13744
+ setError("");
13745
+ try {
13746
+ let parsed;
13747
+ if (json.trim()) {
13748
+ try {
13749
+ parsed = JSON.parse(json);
13750
+ } catch {
13751
+ throw Error("JSON \u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u8BF7\u68C0\u67E5\u53CC\u5F15\u53F7\u3001\u9017\u53F7\u548C\u62EC\u53F7\uFF1B\u53EF\u5C55\u5F00\u4E0B\u65B9\u683C\u5F0F\u793A\u4F8B\u5BF9\u7167\u3002");
13752
+ }
13753
+ }
13754
+ if (parsed === void 0) throw Error(existing ? "\u914D\u7F6E\u4E0D\u80FD\u4E3A\u7A7A\u3002\u5982\u9700\u4FDD\u7559\u5DF2\u6709\u503C\uFF0C\u8BF7\u4FDD\u7559\u539F\u914D\u7F6E\u548C\u5360\u4F4D\u7B26\u3002" : "\u8BF7\u586B\u5199 JSON \u914D\u7F6E\uFF0C\u53EF\u53C2\u8003\u4E0B\u65B9\u683C\u5F0F\u793A\u4F8B\u3002");
13755
+ const next = await api(importing ? "/mcp/import" : existing ? `/mcp/${existing.id}` : "/mcp", { method: existing ? "PUT" : "POST", body: JSON.stringify(importing ? parsed : { name, config: parsed, ...existing ? { expectedRevision: revision } : {} }) });
13756
+ if (mounted.current) saved(next);
13757
+ } catch (reason) {
13758
+ if (mounted.current) setError(errorMessage(reason));
13759
+ } finally {
13760
+ if (mounted.current) setBusy(false);
13761
+ }
13762
+ };
13763
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(WorkspaceDialog, { title: importing ? "\u5BFC\u5165 MCP \u914D\u7F6E" : existing ? "\u7F16\u8F91 MCP \u670D\u52A1" : "\u65B0\u589E MCP \u670D\u52A1", detail: importing ? "\u5BFC\u5165\u5B8C\u6574\u7684\u5BA2\u6237\u7AEF\u914D\u7F6E\uFF0C\u53EF\u5305\u542B\u4E00\u4E2A\u6216\u591A\u4E2A\u670D\u52A1\u3002" : existing ? "\u4FEE\u6539\u5F53\u524D\u670D\u52A1\u914D\u7F6E\uFF0C\u4E0D\u9700\u8981\u91CD\u65B0\u586B\u5199\u5DF2\u4FDD\u5B58\u7684\u51ED\u636E\u3002" : "\u624B\u52A8\u6DFB\u52A0\u4E00\u4E2A\u670D\u52A1\uFF0C\u540D\u79F0\u4EC5\u7528\u4E8E\u9875\u9762\u5C55\u793A\u3002", close: () => {
13764
+ if (!busy) close();
13765
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("form", { className: "dsh-partner-feature-form", onSubmit: (e) => {
13766
+ e.preventDefault();
13767
+ void submit();
13768
+ }, children: [
13769
+ !importing && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: "is-wide", children: [
13770
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "\u670D\u52A1\u540D\u79F0" }),
13771
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("input", { "aria-label": "\u670D\u52A1\u540D\u79F0", required: true, maxLength: 80, value: name, disabled: busy || loading, placeholder: "\u4F8B\u5982\uFF1ADocmost \u6587\u6863", onChange: (e) => setName(e.target.value) }),
13772
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("small", { children: "\u4F19\u4F34\u754C\u9762\u4E2D\u7684\u663E\u793A\u540D\u79F0\uFF0C\u4E0D\u662F\u670D\u52A1\u5730\u5740\uFF0C\u4E5F\u4E0D\u662F JSON \u5B57\u6BB5\u3002" })
13773
+ ] }),
13774
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: "is-wide", htmlFor: field, children: [
13775
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: importing ? "\u5B8C\u6574\u914D\u7F6E JSON\uFF08\u5305\u542B mcpServers\uFF09" : "\u8FDE\u63A5\u914D\u7F6E JSON\uFF08\u5355\u4E2A\u670D\u52A1\uFF09" }),
13776
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("small", { id: `${field}-hint`, children: hint })
13777
+ ] }),
13778
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("textarea", { className: "is-wide", id: field, rows: 10, value: json, disabled: busy || loading || !!existing && revision === void 0, spellCheck: false, autoComplete: "off", "aria-describedby": `${field}-hint${error ? ` ${field}-error` : ""}`, "aria-invalid": !!error, onChange: (e) => setJson(e.target.value), placeholder: loading ? "\u6B63\u5728\u8BFB\u53D6\u5F53\u524D\u914D\u7F6E\u2026" : example }),
13779
+ existing && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("p", { className: "dsh-partner-form-help is-wide", children: [
13780
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "button", disabled: busy || loading || revision !== void 0 && json !== original, onClick: () => {
13781
+ void load2(revision === void 0 ? false : !revealed);
13782
+ }, children: loading ? "\u6B63\u5728\u8BFB\u53D6\u2026" : revision === void 0 ? "\u91CD\u8BD5\u8BFB\u53D6\u914D\u7F6E" : revealed ? "\u9690\u85CF\u654F\u611F\u503C" : "\u663E\u793A\u5B8C\u6574\u914D\u7F6E" }),
13783
+ json !== original && " \u914D\u7F6E\u5DF2\u4FEE\u6539\uFF0C\u4FDD\u5B58\u540E\u53EF\u91CD\u65B0\u5207\u6362\u663E\u793A\u65B9\u5F0F\u3002"
13784
+ ] }),
13785
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("details", { className: "dsh-partner-mcp-examples is-wide", children: [
13786
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("summary", { children: "\u67E5\u770B\u683C\u5F0F\u793A\u4F8B\uFF08\u4E0D\u4F1A\u8986\u76D6\u5DF2\u586B\u5199\u5185\u5BB9\uFF09" }),
13787
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("small", { children: "HTTP \u670D\u52A1" }),
13788
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("pre", { children: example }),
13789
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("small", { children: "\u672C\u673A\u547D\u4EE4 \xB7 stdio" }),
13790
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("pre", { children: stdioExample })
13791
+ ] }),
13792
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "dsh-partner-form-help is-wide", children: "stdio \u5728 DSH \u6240\u5728\u673A\u5668\u6216\u5BB9\u5668\u4E2D\u6267\u884C\u547D\u4EE4\uFF0C\u8BF7\u53EA\u6DFB\u52A0\u53EF\u4FE1\u670D\u52A1\u3002\u914D\u7F6E\u4FDD\u5B58\u540E\uFF0C\u70B9\u51FB\u300C\u8FDE\u63A5 / \u5237\u65B0\u5DE5\u5177\u300D\uFF0C\u518D\u5728\u4F19\u4F34\u80FD\u529B\u4E2D\u6388\u6743\u3002" }),
13793
+ error && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "is-wide", id: `${field}-error`, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(WorkspaceNotice, { children: error }) }),
13794
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("footer", { children: [
13795
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
13796
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || loading || !!existing && revision === void 0, "aria-busy": busy, children: busy ? "\u4FDD\u5B58\u4E2D\u2026" : importing ? "\u5BFC\u5165\u914D\u7F6E" : "\u4FDD\u5B58\u914D\u7F6E" })
13797
+ ] })
13798
+ ] }) });
13799
+ }
13800
+
13801
+ // src/ui/mcp-panel.tsx
13802
+ var import_jsx_runtime29 = require("react/jsx-runtime");
13803
+ function McpPanel() {
13804
+ const [catalog, setCatalog] = (0, import_react32.useState)({ servers: [], bindings: [] });
13805
+ const [loading, setLoading] = (0, import_react32.useState)(true);
13806
+ const [busy, setBusy] = (0, import_react32.useState)("");
13807
+ const [error, setError] = (0, import_react32.useState)("");
13808
+ const [notice, setNotice] = (0, import_react32.useState)("");
13809
+ const [query, setQuery] = (0, import_react32.useState)("");
13810
+ const [editor, setEditor] = (0, import_react32.useState)();
13811
+ const [deleting, setDeleting] = (0, import_react32.useState)();
13812
+ const [details, setDetails] = (0, import_react32.useState)();
13813
+ const load2 = (0, import_react32.useCallback)(async () => {
13814
+ try {
13815
+ setCatalog(await api("/mcp"));
13816
+ setError("");
13817
+ } catch (reason) {
13818
+ setError(errorMessage(reason));
13819
+ } finally {
13820
+ setLoading(false);
13821
+ }
13822
+ }, []);
13823
+ (0, import_react32.useEffect)(() => {
13824
+ void load2();
13825
+ }, [load2]);
13826
+ const action = async (server, kind) => {
13827
+ setBusy(server.id);
13828
+ setError("");
13829
+ setNotice("");
13830
+ try {
13831
+ const next = await api(`/mcp/${server.id}${kind === "refresh" ? "/refresh" : ""}`, {
13832
+ method: kind === "refresh" ? "POST" : kind === "delete" ? "DELETE" : "PUT",
13833
+ ...kind === "toggle" ? { body: JSON.stringify({ name: server.name, enabled: !server.enabled }) } : {}
13834
+ });
13835
+ setCatalog(next);
13836
+ setDeleting(void 0);
13837
+ setNotice(kind === "refresh" ? "\u8FDE\u63A5\u6210\u529F\uFF0C\u5DE5\u5177\u76EE\u5F55\u5DF2\u5237\u65B0\u3002\u5DF2\u6388\u6743\u4F19\u4F34\u5C06\u5728\u4E0B\u4E00\u8F6E\u5BF9\u8BDD\u4F7F\u7528\u6700\u65B0\u5DE5\u5177\u3002" : kind === "delete" ? "MCP \u670D\u52A1\u4E0E\u5173\u8054\u6388\u6743\u5DF2\u5220\u9664\u3002" : "\u72B6\u6001\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u751F\u6548\uFF1B\u505C\u7528\u540E\u7ACB\u5373\u963B\u6B62\u65B0\u7684\u8C03\u7528\u3002");
13838
+ } catch (reason) {
13839
+ setError(errorMessage(reason));
13840
+ if (kind === "refresh") {
13841
+ try {
13842
+ setCatalog(await api("/mcp"));
13843
+ } catch {
13844
+ }
13845
+ }
13846
+ } finally {
13847
+ setBusy("");
13848
+ }
13849
+ };
13850
+ const visible = catalog.servers.filter((s) => s.name.toLocaleLowerCase().includes(query.trim().toLocaleLowerCase()));
13851
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "dsh-partner-feature-page", children: [
13852
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(WorkspaceHero, { eyebrow: "Capability catalog", title: "MCP \u670D\u52A1", detail: "\u96C6\u4E2D\u7BA1\u7406\u5916\u90E8\u5DE5\u5177\uFF0C\u518D\u5728\u4F19\u4F34\u80FD\u529B\u4E2D\u5355\u72EC\u6388\u6743\u3002\u914D\u7F6E\u4E0E\u5DE5\u5177\u76EE\u5F55\u7684\u66F4\u65B0\u5728\u4E0B\u4E00\u8F6E\u5BF9\u8BDD\u751F\u6548\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("button", { type: "button", disabled: loading || !!busy, onClick: () => {
13853
+ void load2();
13854
+ }, children: [
13855
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives12.IconRefreshOutline16, { size: 15 }),
13856
+ "\u5237\u65B0\u5217\u8868"
13857
+ ] }) }),
13858
+ error && !deleting && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(WorkspaceNotice, { children: error }),
13859
+ notice && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(WorkspaceNotice, { kind: "success", children: notice }),
13860
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(WorkspaceBlock, { title: "\u5DF2\u914D\u7F6E\u670D\u52A1", detail: `${catalog.servers.length} \u4E2A\u670D\u52A1 \xB7 \u5B89\u88C5\u4E0D\u7B49\u4E8E\u6388\u6743`, actions: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
13861
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", onClick: () => setEditor("import"), children: "\u5BFC\u5165 JSON" }),
13862
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("button", { type: "button", onClick: () => setEditor("new"), children: [
13863
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives12.IconPlusOutline16, { size: 14 }),
13864
+ "\u65B0\u589E MCP"
13865
+ ] })
13866
+ ] }), children: [
13867
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormField, { label: "\u641C\u7D22\u670D\u52A1", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("input", { value: query, onChange: (e) => setQuery(e.target.value), placeholder: "\u6309\u670D\u52A1\u540D\u79F0\u641C\u7D22" }) }),
13868
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CollectionSkeleton, { rows: 2 }) : !visible.length ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CollectionEmpty, { title: query ? "\u6CA1\u6709\u5339\u914D\u7684\u670D\u52A1" : "\u8FD8\u6CA1\u6709 MCP \u670D\u52A1", detail: "\u652F\u6301 Streamable HTTP \u548C stdio\uFF1B\u53EF\u76F4\u63A5\u5BFC\u5165 mcpServers JSON\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "dsh-partner-market-grid", children: visible.map((server) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("article", { children: [
13869
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { children: [
13870
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("small", { children: [
13871
+ server.transport === "stdio" ? "\u672C\u673A\u547D\u4EE4 \xB7 STDIO" : "\u8FDC\u7A0B\u670D\u52A1 \xB7 HTTP",
13872
+ " \xB7 ",
13873
+ server.enabled ? "\u5DF2\u542F\u7528" : "\u5DF2\u505C\u7528"
13874
+ ] }),
13875
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("strong", { children: server.name }),
13876
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("p", { children: [
13877
+ server.tools.length,
13878
+ " \u4E2A\u5DE5\u5177 \xB7 ",
13879
+ catalog.bindings.filter((b) => b.serverId === server.id).length,
13880
+ " \u4E2A\u4F19\u4F34\u83B7\u6388\u6743"
13881
+ ] }),
13882
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("small", { children: server.refreshedAt ? `\u4E0A\u6B21\u5237\u65B0 ${new Date(server.refreshedAt).toLocaleString()}` : "\u5C1A\u672A\u6D4B\u8BD5\u8FDE\u63A5\uFF0C\u8BF7\u5237\u65B0\u5DE5\u5177" })
13883
+ ] }),
13884
+ server.error && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: server.error }),
13885
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("footer", { className: "dsh-partner-mcp-actions", children: [
13886
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", disabled: !!busy, onClick: () => {
13887
+ void action(server, "refresh");
13888
+ }, children: busy === server.id ? "\u5904\u7406\u4E2D\u2026" : "\u8FDE\u63A5 / \u5237\u65B0\u5DE5\u5177" }),
13889
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", onClick: () => setDetails(server), children: "\u5DE5\u5177\u5217\u8868" }),
13890
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", disabled: !!busy, onClick: () => setEditor(server), children: "\u7F16\u8F91" }),
13891
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", disabled: !!busy, onClick: () => {
13892
+ void action(server, "toggle");
13893
+ }, children: server.enabled ? "\u505C\u7528" : "\u542F\u7528" }),
13894
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", disabled: !!busy, onClick: () => {
13895
+ setError("");
13896
+ setDeleting(server);
13897
+ }, children: "\u5220\u9664" })
13898
+ ] })
13899
+ ] }, server.id)) })
13900
+ ] }),
13901
+ editor && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(McpEditor, { value: editor, close: () => setEditor(void 0), saved: (next) => {
13902
+ setCatalog(next);
13903
+ setNotice("\u914D\u7F6E\u5DF2\u4FDD\u5B58\u3002\u8BF7\u8FDE\u63A5 / \u5237\u65B0\u5DE5\u5177\uFF0C\u7136\u540E\u5728\u4F19\u4F34\u80FD\u529B\u4E2D\u6388\u6743\u3002");
13904
+ setEditor(void 0);
13905
+ } }),
13906
+ details && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(WorkspaceDialog, { title: `${details.name} \xB7 \u5DE5\u5177\u5217\u8868`, detail: "\u5237\u65B0\u5DE5\u5177\u4F1A\u91CD\u65B0\u83B7\u53D6\u540D\u79F0\u3001\u8BF4\u660E\u548C\u53C2\u6570\uFF1B\u4E0D\u6267\u884C\u4EFB\u4F55\u4E1A\u52A1\u5DE5\u5177\u3002", close: () => setDetails(void 0), children: !details.tools.length ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CollectionEmpty, { title: "\u6682\u65E0\u5DE5\u5177", detail: "\u8BF7\u5148\u8FDE\u63A5 / \u5237\u65B0\u5DE5\u5177\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "dsh-partner-mcp-tool-list", children: details.tools.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("details", { children: [
13907
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("summary", { children: tool.name }),
13908
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { children: tool.description || "\u670D\u52A1\u672A\u63D0\u4F9B\u8BF4\u660E" }),
13909
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("pre", { children: JSON.stringify(tool.inputSchema, null, 2) })
13910
+ ] }, tool.name)) }) }),
13911
+ deleting && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(WorkspaceDialog, { title: "\u5220\u9664 MCP \u670D\u52A1", detail: `\u786E\u8BA4\u5220\u9664\u201C${deleting.name}\u201D\uFF1F\u5173\u8054\u6388\u6743\u4E5F\u4F1A\u79FB\u9664\uFF0C\u4E0D\u4F1A\u5220\u9664\u8FDC\u7A0B\u670D\u52A1\u7684\u6570\u636E\u3002`, close: () => {
13912
+ if (!busy) setDeleting(void 0);
13913
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "dsh-partner-feature-form", children: [
13914
+ error && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(WorkspaceNotice, { children: error }),
13915
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("footer", { children: [
13916
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", disabled: !!busy, onClick: () => setDeleting(void 0), children: "\u53D6\u6D88" }),
13917
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", className: "is-primary", disabled: !!busy, onClick: () => {
13918
+ void action(deleting, "delete");
13919
+ }, children: busy ? "\u5220\u9664\u4E2D\u2026" : "\u786E\u8BA4\u5220\u9664" })
13920
+ ] })
13921
+ ] }) })
13922
+ ] });
13923
+ }
13924
+
13925
+ // src/ui/mcp.css
13926
+ var mcp_default = ".dsh-partner-market-grid footer.dsh-partner-mcp-actions { flex-wrap: wrap; justify-content: flex-start; gap: 8px; }\n.dsh-partner-mcp-tool-list { display: grid; gap: 12px; min-width: 0; }\n.dsh-partner-mcp-tool-list summary { cursor: pointer; overflow-wrap: anywhere; }\n.dsh-partner-mcp-tool-list p, .dsh-partner-mcp-tool-list pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }\n.dsh-partner-mcp-examples { min-width: 0; color: var(--partner-text-secondary); font-size: var(--partner-font-body); }\n.dsh-partner-mcp-examples summary { cursor: pointer; padding: 8px 0; }\n.dsh-partner-mcp-examples pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--partner-font-caption); }\n.dsh-partner-skill-installed.dsh-partner-mcp-bindings > article { grid-template-columns: minmax(0, 1fr) auto; min-height: 0; gap: 12px; padding: 10px 12px; }\n.dsh-partner-mcp-bindings > article > span { display: grid; min-width: 0; gap: 2px; }\n.dsh-partner-mcp-bindings > article strong { overflow-wrap: anywhere; }\n.dsh-partner-mcp-bindings > article p { white-space: normal; font-size: var(--partner-font-caption); }\n.dsh-partner-workspace .dsh-partner-mcp-bindings > article > button,\n.dsh-partner-workspace-dialog .dsh-partner-mcp-bindings > article > button { width: auto; min-width: 0; min-height: 32px; height: auto; padding: 6px 10px; justify-self: end; align-self: center; white-space: nowrap; font-size: var(--partner-font-caption); line-height: 1.4; }\n@media (pointer: coarse) {\n .dsh-partner-workspace .dsh-partner-mcp-bindings > article > button,\n .dsh-partner-workspace-dialog .dsh-partner-mcp-bindings > article > button { min-height: 44px; min-width: 44px; }\n}\n";
13927
+
13656
13928
  // src/ui/requirement-board.tsx
13657
- var import_react35 = require("react");
13658
- var import_dsh_client_ui_primitives15 = require("@deepseek-ai/dsh-client-ui-primitives");
13929
+ var import_react37 = require("react");
13930
+ var import_dsh_client_ui_primitives16 = require("@deepseek-ai/dsh-client-ui-primitives");
13659
13931
 
13660
13932
  // src/ui/board-refresh.ts
13661
- var import_react31 = require("react");
13933
+ var import_react33 = require("react");
13662
13934
  function useBoardRefresh(read, failed, enabled = true) {
13663
- const readRef = (0, import_react31.useRef)(read), failedRef = (0, import_react31.useRef)(failed);
13935
+ const readRef = (0, import_react33.useRef)(read), failedRef = (0, import_react33.useRef)(failed);
13664
13936
  readRef.current = read;
13665
13937
  failedRef.current = failed;
13666
- const epoch = (0, import_react31.useRef)(0), pending = (0, import_react31.useRef)(), mounted = (0, import_react31.useRef)(false);
13667
- const refresh = (0, import_react31.useCallback)(async () => {
13938
+ const epoch = (0, import_react33.useRef)(0), pending = (0, import_react33.useRef)(), mounted = (0, import_react33.useRef)(false);
13939
+ const refresh = (0, import_react33.useCallback)(async () => {
13668
13940
  const version = ++epoch.current;
13669
13941
  await pending.current;
13670
13942
  if (!mounted.current || version !== epoch.current) return;
@@ -13680,7 +13952,7 @@ function useBoardRefresh(read, failed, enabled = true) {
13680
13952
  await request;
13681
13953
  if (pending.current === request) pending.current = void 0;
13682
13954
  }, []);
13683
- (0, import_react31.useEffect)(() => {
13955
+ (0, import_react33.useEffect)(() => {
13684
13956
  if (!enabled) return;
13685
13957
  mounted.current = true;
13686
13958
  void refresh();
@@ -13700,15 +13972,15 @@ function useBoardRefresh(read, failed, enabled = true) {
13700
13972
  }
13701
13973
 
13702
13974
  // src/ui/requirement-dialog.tsx
13703
- var import_react32 = require("react");
13704
- var import_dsh_client_ui_primitives12 = require("@deepseek-ai/dsh-client-ui-primitives");
13705
- var import_jsx_runtime28 = require("react/jsx-runtime");
13975
+ var import_react34 = require("react");
13976
+ var import_dsh_client_ui_primitives13 = require("@deepseek-ai/dsh-client-ui-primitives");
13977
+ var import_jsx_runtime30 = require("react/jsx-runtime");
13706
13978
  function requirementStatus(item) {
13707
13979
  if (item.lastError) return item.status === "done" ? "\u5DF2\u5F52\u6863 \xB7 \u901A\u77E5\u5F85\u91CD\u8BD5" : "\u6536\u5C3E\u5F85\u91CD\u8BD5";
13708
13980
  return { planning: "\u89C4\u5212\u4E2D", active: "\u63A8\u8FDB\u4E2D", review: "\u6C47\u603B\u4E2D", done: "\u5DF2\u5F52\u6863" }[item.status];
13709
13981
  }
13710
13982
  function RequirementForm({ directory, close, created }) {
13711
- const [busy, setBusy] = (0, import_react32.useState)(false), [error, setError] = (0, import_react32.useState)();
13983
+ const [busy, setBusy] = (0, import_react34.useState)(false), [error, setError] = (0, import_react34.useState)();
13712
13984
  const submit = async (event) => {
13713
13985
  event.preventDefault();
13714
13986
  const data = new FormData(event.currentTarget);
@@ -13723,37 +13995,37 @@ function RequirementForm({ directory, close, created }) {
13723
13995
  setBusy(false);
13724
13996
  }
13725
13997
  };
13726
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("form", { className: "dsh-partner-task-form", "aria-busy": busy, onSubmit: (event) => {
13998
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("form", { className: "dsh-partner-task-form", "aria-busy": busy, onSubmit: (event) => {
13727
13999
  void submit(event);
13728
14000
  }, children: [
13729
- error && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(WorkspaceNotice, { children: error }),
13730
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: "is-wide", children: [
13731
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "\u9700\u6C42\u540D\u79F0" }),
13732
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("input", { name: "title", autoFocus: true, required: true, maxLength: 200, placeholder: "\u8FD9\u6B21\u5E0C\u671B\u5B8C\u6210\u4EC0\u4E48" })
14001
+ error && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(WorkspaceNotice, { children: error }),
14002
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "is-wide", children: [
14003
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "\u9700\u6C42\u540D\u79F0" }),
14004
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("input", { name: "title", autoFocus: true, required: true, maxLength: 200, placeholder: "\u8FD9\u6B21\u5E0C\u671B\u5B8C\u6210\u4EC0\u4E48" })
13733
14005
  ] }),
13734
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: "is-wide", children: [
13735
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "\u4EA4\u4ED8\u76EE\u6807" }),
13736
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("textarea", { name: "description", rows: 5, maxLength: 8e3, placeholder: "\u80CC\u666F\u3001\u9884\u671F\u6210\u679C\u4E0E\u6574\u4F53\u5B8C\u6210\u6807\u51C6" })
14006
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "is-wide", children: [
14007
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "\u4EA4\u4ED8\u76EE\u6807" }),
14008
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("textarea", { name: "description", rows: 5, maxLength: 8e3, placeholder: "\u80CC\u666F\u3001\u9884\u671F\u6210\u679C\u4E0E\u6574\u4F53\u5B8C\u6210\u6807\u51C6" })
13737
14009
  ] }),
13738
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: "is-wide", children: [
13739
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "\u6536\u5C3E\u8D1F\u8D23\u4EBA" }),
13740
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("select", { name: "owner", defaultValue: "", children: [
13741
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: "", children: "\u4EBA\u5DE5\u6C47\u603B" }),
13742
- directory.map((c) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("option", { value: c.id, children: [
14010
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "is-wide", children: [
14011
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "\u6536\u5C3E\u8D1F\u8D23\u4EBA" }),
14012
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("select", { name: "owner", defaultValue: "", children: [
14013
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: "", children: "\u4EBA\u5DE5\u6C47\u603B" }),
14014
+ directory.map((c) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("option", { value: c.id, children: [
13743
14015
  "@",
13744
14016
  c.name
13745
14017
  ] }, c.id))
13746
14018
  ] }),
13747
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("small", { children: "\u5B50\u4EFB\u52A1\u5168\u90E8\u901A\u8FC7\u9A8C\u6536\u540E\uFF0C\u7531\u8BE5\u4F19\u4F34\u603B\u7ED3\u5E76\u901A\u8FC7\u9700\u6C42\u6765\u6E90\u6E20\u9053\u901A\u77E5\u3002" })
14019
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("small", { children: "\u5B50\u4EFB\u52A1\u5168\u90E8\u901A\u8FC7\u9A8C\u6536\u540E\uFF0C\u7531\u8BE5\u4F19\u4F34\u603B\u7ED3\u5E76\u901A\u8FC7\u9700\u6C42\u6765\u6E90\u6E20\u9053\u901A\u77E5\u3002" })
13748
14020
  ] }),
13749
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("footer", { children: [
13750
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "button", onClick: close, disabled: busy, children: "\u53D6\u6D88" }),
13751
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u5E76\u5B89\u6392\u4EFB\u52A1" })
14021
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("footer", { children: [
14022
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", onClick: close, disabled: busy, children: "\u53D6\u6D88" }),
14023
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u5E76\u5B89\u6392\u4EFB\u52A1" })
13752
14024
  ] })
13753
14025
  ] });
13754
14026
  }
13755
14027
  function RequirementDetail({ item, tasks, directory, changed: changed2, close }) {
13756
- const [busy, setBusy] = (0, import_react32.useState)(false), [error, setError] = (0, import_react32.useState)(), [confirming, setConfirming] = (0, import_react32.useState)(false), [summary, setSummary] = (0, import_react32.useState)("");
14028
+ const [busy, setBusy] = (0, import_react34.useState)(false), [error, setError] = (0, import_react34.useState)(), [confirming, setConfirming] = (0, import_react34.useState)(false), [summary, setSummary] = (0, import_react34.useState)("");
13757
14029
  const done = tasks.filter((t) => t.status === "done").length, ready = tasks.length > 0 && done === tasks.length && item.status !== "planning";
13758
14030
  const act = async (action, body = {}) => {
13759
14031
  setBusy(true);
@@ -13769,94 +14041,94 @@ function RequirementDetail({ item, tasks, directory, changed: changed2, close })
13769
14041
  setBusy(false);
13770
14042
  }
13771
14043
  };
13772
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "dsh-partner-task-detail dsh-partner-requirement-detail", "aria-busy": busy, children: [
13773
- error && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(WorkspaceNotice, { children: error }),
13774
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("section", { className: "dsh-partner-task-description", children: [
13775
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("strong", { children: "\u4EA4\u4ED8\u76EE\u6807" }),
13776
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: item.description || "\u672A\u8865\u5145\u4EA4\u4ED8\u76EE\u6807" })
14044
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "dsh-partner-task-detail dsh-partner-requirement-detail", "aria-busy": busy, children: [
14045
+ error && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(WorkspaceNotice, { children: error }),
14046
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("section", { className: "dsh-partner-task-description", children: [
14047
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("strong", { children: "\u4EA4\u4ED8\u76EE\u6807" }),
14048
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { children: item.description || "\u672A\u8865\u5145\u4EA4\u4ED8\u76EE\u6807" })
13777
14049
  ] }),
13778
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "dsh-partner-requirement-facts", children: [
13779
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { children: [
14050
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "dsh-partner-requirement-facts", children: [
14051
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
13780
14052
  "\u6536\u5C3E\u8D1F\u8D23\u4EBA",
13781
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("b", { children: directory.find((c) => c.id === item.ownerCompanionId)?.name ?? "\u4EBA\u5DE5\u6C47\u603B" })
14053
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("b", { children: directory.find((c) => c.id === item.ownerCompanionId)?.name ?? "\u4EBA\u5DE5\u6C47\u603B" })
13782
14054
  ] }),
13783
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { children: [
14055
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
13784
14056
  "\u5B50\u4EFB\u52A1\u9A8C\u6536",
13785
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("b", { children: item.status === "done" ? `${item.results?.length ?? done} \u9879\u5DF2\u5F52\u6863` : `${done} / ${tasks.length}` })
14057
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("b", { children: item.status === "done" ? `${item.results?.length ?? done} \u9879\u5DF2\u5F52\u6863` : `${done} / ${tasks.length}` })
13786
14058
  ] }),
13787
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { children: [
14059
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
13788
14060
  "\u901A\u77E5\u65B9\u5F0F",
13789
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("b", { children: item.creatorSessionId ? "\u9700\u6C42\u6765\u6E90\u4F1A\u8BDD / \u6E20\u9053" : "\u770B\u677F\u5185\u67E5\u770B\u7ED3\u679C" })
14061
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("b", { children: item.creatorSessionId ? "\u9700\u6C42\u6765\u6E90\u4F1A\u8BDD / \u6E20\u9053" : "\u770B\u677F\u5185\u67E5\u770B\u7ED3\u679C" })
13790
14062
  ] })
13791
14063
  ] }),
13792
- item.lastError && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(WorkspaceNotice, { children: [
14064
+ item.lastError && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(WorkspaceNotice, { children: [
13793
14065
  item.lastError,
13794
14066
  " \xB7 \u7CFB\u7EDF\u4F1A\u81EA\u52A8\u91CD\u8BD5\uFF0C\u4E5F\u53EF\u7ACB\u5373\u91CD\u8BD5\u3002",
13795
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "button", disabled: busy, onClick: () => {
14067
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", disabled: busy, onClick: () => {
13796
14068
  void act("retry");
13797
14069
  }, children: "\u7ACB\u5373\u91CD\u8BD5" })
13798
14070
  ] }),
13799
- item.summary && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("section", { className: "dsh-partner-task-result", children: [
13800
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("strong", { children: "\u6700\u7EC8\u7ED3\u8BBA" }),
13801
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: item.summary })
14071
+ item.summary && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("section", { className: "dsh-partner-task-result", children: [
14072
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("strong", { children: "\u6700\u7EC8\u7ED3\u8BBA" }),
14073
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { children: item.summary })
13802
14074
  ] }),
13803
- !!item.results?.length && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
13804
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("summary", { children: [
14075
+ !!item.results?.length && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
14076
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("summary", { children: [
13805
14077
  "\u4EA4\u4ED8\u8BB0\u5F55 \xB7 ",
13806
14078
  item.results.length,
13807
14079
  " \u9879"
13808
14080
  ] }),
13809
- item.results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("section", { className: "dsh-partner-task-result", children: [
13810
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("strong", { children: result.title }),
13811
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: result.resultSummary || result.resultAbstract || "\u672A\u63D0\u4F9B\u7ED3\u679C\u6B63\u6587" })
14081
+ item.results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("section", { className: "dsh-partner-task-result", children: [
14082
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("strong", { children: result.title }),
14083
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { children: result.resultSummary || result.resultAbstract || "\u672A\u63D0\u4F9B\u7ED3\u679C\u6B63\u6587" })
13812
14084
  ] }, result.id))
13813
14085
  ] }),
13814
- item.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
13815
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: "dsh-partner-requirement-owner", children: [
13816
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "\u8C03\u6574\u6536\u5C3E\u8D1F\u8D23\u4EBA" }),
13817
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("select", { "aria-label": "\u6536\u5C3E\u8D1F\u8D23\u4EBA", value: item.ownerCompanionId ?? "", disabled: busy, onChange: (event) => {
14086
+ item.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
14087
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "dsh-partner-requirement-owner", children: [
14088
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "\u8C03\u6574\u6536\u5C3E\u8D1F\u8D23\u4EBA" }),
14089
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("select", { "aria-label": "\u6536\u5C3E\u8D1F\u8D23\u4EBA", value: item.ownerCompanionId ?? "", disabled: busy, onChange: (event) => {
13818
14090
  void act("owner", { ownerCompanionId: event.target.value });
13819
14091
  }, children: [
13820
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: "", children: "\u4EBA\u5DE5\u6C47\u603B" }),
13821
- item.ownerCompanionId && !directory.some((c) => c.id === item.ownerCompanionId) && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { value: item.ownerCompanionId, children: "\u539F\u8D1F\u8D23\u4EBA\u5DF2\u5220\u9664" }),
13822
- directory.map((c) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("option", { value: c.id, children: [
14092
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: "", children: "\u4EBA\u5DE5\u6C47\u603B" }),
14093
+ item.ownerCompanionId && !directory.some((c) => c.id === item.ownerCompanionId) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: item.ownerCompanionId, children: "\u539F\u8D1F\u8D23\u4EBA\u5DF2\u5220\u9664" }),
14094
+ directory.map((c) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("option", { value: c.id, children: [
13823
14095
  "@",
13824
14096
  c.name
13825
14097
  ] }, c.id))
13826
14098
  ] })
13827
14099
  ] }),
13828
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(WorkspaceNotice, { kind: "warning", children: item.status === "planning" ? "\u5168\u90E8\u5B50\u4EFB\u52A1\u5B89\u6392\u597D\u540E\uFF0C\u63D0\u4EA4\u672C\u6B21\u89C4\u5212\uFF1B\u5220\u9664\u5B50\u4EFB\u52A1\u4F1A\u91CD\u65B0\u6253\u5F00\u89C4\u5212\uFF0C\u9700\u786E\u8BA4\u65B0\u7684\u4EA4\u4ED8\u8303\u56F4\u3002" : "\u5B50\u4EFB\u52A1\u7684\u6267\u884C\u548C\u9A8C\u6536\u53EA\u5728\u5185\u90E8\u6D41\u8F6C\uFF0C\u5168\u90E8\u5B8C\u6210\u540E\u624D\u6C47\u603B\u9700\u6C42\u7ED3\u679C\u3002" }),
13829
- ready && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
13830
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("summary", { children: "\u4EBA\u5DE5\u5B8C\u6210\u6536\u5C3E" }),
13831
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { children: [
13832
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "\u6700\u7EC8\u7ED3\u8BBA" }),
13833
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("textarea", { rows: 5, maxLength: 12e3, value: summary, onChange: (event) => setSummary(event.target.value), placeholder: "\u786E\u8BA4\u5B9E\u9645\u4EA4\u4ED8\u5185\u5BB9\u3001\u7ED3\u8BBA\u53CA\u9650\u5236" })
14100
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(WorkspaceNotice, { kind: "warning", children: item.status === "planning" ? "\u5168\u90E8\u5B50\u4EFB\u52A1\u5B89\u6392\u597D\u540E\uFF0C\u63D0\u4EA4\u672C\u6B21\u89C4\u5212\uFF1B\u5220\u9664\u5B50\u4EFB\u52A1\u4F1A\u91CD\u65B0\u6253\u5F00\u89C4\u5212\uFF0C\u9700\u786E\u8BA4\u65B0\u7684\u4EA4\u4ED8\u8303\u56F4\u3002" : "\u5B50\u4EFB\u52A1\u7684\u6267\u884C\u548C\u9A8C\u6536\u53EA\u5728\u5185\u90E8\u6D41\u8F6C\uFF0C\u5168\u90E8\u5B8C\u6210\u540E\u624D\u6C47\u603B\u9700\u6C42\u7ED3\u679C\u3002" }),
14101
+ ready && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
14102
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("summary", { children: "\u4EBA\u5DE5\u5B8C\u6210\u6536\u5C3E" }),
14103
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { children: [
14104
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "\u6700\u7EC8\u7ED3\u8BBA" }),
14105
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("textarea", { rows: 5, maxLength: 12e3, value: summary, onChange: (event) => setSummary(event.target.value), placeholder: "\u786E\u8BA4\u5B9E\u9645\u4EA4\u4ED8\u5185\u5BB9\u3001\u7ED3\u8BBA\u53CA\u9650\u5236" })
13834
14106
  ] }),
13835
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "button", disabled: busy || !summary.trim(), onClick: () => {
14107
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", disabled: busy || !summary.trim(), onClick: () => {
13836
14108
  void act("finish", { summary });
13837
14109
  }, children: "\u4FDD\u5B58\u603B\u7ED3\u5E76\u5F52\u6863" })
13838
14110
  ] })
13839
14111
  ] }),
13840
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
13841
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("summary", { children: "\u7BA1\u7406\u9700\u6C42" }),
13842
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: "\u5220\u9664\u9700\u6C42\u4F1A\u540C\u65F6\u79FB\u9664\u5B50\u4EFB\u52A1\uFF0C\u5E76\u53D6\u6D88\u5173\u8054\u6267\u884C\u3002\u4E0D\u80FD\u64A4\u9500\uFF0C\u4E0D\u4F1A\u5220\u9664\u5DF2\u751F\u6210\u7684\u4EA4\u4ED8\u6587\u4EF6\u3002" }),
13843
- confirming ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "dsh-partner-requirement-actions", children: [
13844
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirming(false), children: "\u4FDD\u7559\u9700\u6C42" }),
13845
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("button", { type: "button", className: "is-danger", disabled: busy, onClick: () => {
14112
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
14113
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("summary", { children: "\u7BA1\u7406\u9700\u6C42" }),
14114
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { children: "\u5220\u9664\u9700\u6C42\u4F1A\u540C\u65F6\u79FB\u9664\u5B50\u4EFB\u52A1\uFF0C\u5E76\u53D6\u6D88\u5173\u8054\u6267\u884C\u3002\u4E0D\u80FD\u64A4\u9500\uFF0C\u4E0D\u4F1A\u5220\u9664\u5DF2\u751F\u6210\u7684\u4EA4\u4ED8\u6587\u4EF6\u3002" }),
14115
+ confirming ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "dsh-partner-requirement-actions", children: [
14116
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirming(false), children: "\u4FDD\u7559\u9700\u6C42" }),
14117
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("button", { type: "button", className: "is-danger", disabled: busy, onClick: () => {
13846
14118
  void act("remove");
13847
14119
  }, children: [
13848
14120
  "\u786E\u8BA4\u5220\u9664\u9700\u6C42\u548C ",
13849
14121
  tasks.length,
13850
14122
  " \u4E2A\u4EFB\u52A1"
13851
14123
  ] })
13852
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("button", { type: "button", className: "is-danger", onClick: () => setConfirming(true), children: [
13853
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_dsh_client_ui_primitives12.IconTrashOutline16, { size: 14 }),
14124
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("button", { type: "button", className: "is-danger", onClick: () => setConfirming(true), children: [
14125
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_dsh_client_ui_primitives13.IconTrashOutline16, { size: 14 }),
13854
14126
  "\u5220\u9664\u9700\u6C42"
13855
14127
  ] })
13856
14128
  ] }),
13857
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("footer", { children: [
13858
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "button", onClick: close, disabled: busy, children: "\u5173\u95ED" }),
13859
- item.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "button", className: "is-primary", disabled: busy || item.status === "planning" && !tasks.length, onClick: () => {
14129
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("footer", { children: [
14130
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", onClick: close, disabled: busy, children: "\u5173\u95ED" }),
14131
+ item.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", className: "is-primary", disabled: busy || item.status === "planning" && !tasks.length, onClick: () => {
13860
14132
  void act(item.status === "planning" ? "submit" : "reopen");
13861
14133
  }, children: busy ? "\u5904\u7406\u4E2D\u2026" : item.status === "planning" ? "\u63D0\u4EA4\u89C4\u5212" : "\u8C03\u6574\u4EFB\u52A1\u8303\u56F4" })
13862
14134
  ] })
@@ -13864,109 +14136,109 @@ function RequirementDetail({ item, tasks, directory, changed: changed2, close })
13864
14136
  }
13865
14137
 
13866
14138
  // src/ui/requirement-tasks-panel.tsx
13867
- var import_react34 = require("react");
13868
- var import_dsh_client_ui_primitives14 = require("@deepseek-ai/dsh-client-ui-primitives");
14139
+ var import_react36 = require("react");
14140
+ var import_dsh_client_ui_primitives15 = require("@deepseek-ai/dsh-client-ui-primitives");
13869
14141
 
13870
14142
  // src/ui/task-board-stage.tsx
13871
- var import_react33 = require("react");
13872
- var import_dsh_client_ui_primitives13 = require("@deepseek-ai/dsh-client-ui-primitives");
13873
- var import_jsx_runtime29 = require("react/jsx-runtime");
14143
+ var import_react35 = require("react");
14144
+ var import_dsh_client_ui_primitives14 = require("@deepseek-ai/dsh-client-ui-primitives");
14145
+ var import_jsx_runtime31 = require("react/jsx-runtime");
13874
14146
  function TaskBoardStage({ id, label, tasks, focused, filtered, renderTask }) {
13875
- const [collapsed, setCollapsed] = (0, import_react33.useState)(false);
13876
- const [limit, setLimit] = (0, import_react33.useState)(6);
14147
+ const [collapsed, setCollapsed] = (0, import_react35.useState)(false);
14148
+ const [limit, setLimit] = (0, import_react35.useState)(6);
13877
14149
  const count = Math.max(limit, focused ? 12 : 6);
13878
14150
  const titleId = `dsh-partner-board-${id}`, listId = `${titleId}-list`;
13879
14151
  const expanded = !collapsed;
13880
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("section", { "data-status": id, "data-empty": tasks.length === 0, "aria-labelledby": titleId, children: [
13881
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("header", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("button", { type: "button", className: "dsh-partner-board-stage-toggle", "aria-expanded": expanded, "aria-controls": listId, onClick: () => setCollapsed((value) => !value), children: [
13882
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives13.IconChevronRightOutline14, { size: 14 }),
13883
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("strong", { id: titleId, children: label }),
13884
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("b", { children: tasks.length })
14152
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { "data-status": id, "data-empty": tasks.length === 0, "aria-labelledby": titleId, children: [
14153
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("header", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: "dsh-partner-board-stage-toggle", "aria-expanded": expanded, "aria-controls": listId, onClick: () => setCollapsed((value) => !value), children: [
14154
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives14.IconChevronRightOutline14, { size: 14 }),
14155
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { id: titleId, children: label }),
14156
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("b", { children: tasks.length })
13885
14157
  ] }) }),
13886
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { id: listId, hidden: !expanded, children: tasks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
13887
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "dsh-partner-board-column-list", children: tasks.slice(0, count).map(renderTask) }),
13888
- tasks.length > count && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("button", { type: "button", className: "dsh-partner-board-more", onClick: () => setLimit(count + 12), children: [
14158
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { id: listId, hidden: !expanded, children: tasks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
14159
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "dsh-partner-board-column-list", children: tasks.slice(0, count).map(renderTask) }),
14160
+ tasks.length > count && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: "dsh-partner-board-more", onClick: () => setLimit(count + 12), children: [
13889
14161
  "\u5C55\u5F00\u66F4\u591A \xB7 \u8FD8\u6709 ",
13890
14162
  tasks.length - count,
13891
14163
  " \u9879"
13892
14164
  ] })
13893
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "dsh-partner-board-empty", children: filtered ? "\u6CA1\u6709\u5339\u914D\u4EFB\u52A1" : "\u6682\u65E0\u4EFB\u52A1" }) })
14165
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "dsh-partner-board-empty", children: filtered ? "\u6CA1\u6709\u5339\u914D\u4EFB\u52A1" : "\u6682\u65E0\u4EFB\u52A1" }) })
13894
14166
  ] });
13895
14167
  }
13896
14168
 
13897
14169
  // src/ui/task-contract-panel.tsx
13898
- var import_jsx_runtime30 = require("react/jsx-runtime");
14170
+ var import_jsx_runtime32 = require("react/jsx-runtime");
13899
14171
  function TaskContractPanel({ task, checks, setChecks, busy }) {
13900
14172
  if (!task.acceptanceCriteria?.length && !task.resourceKeys?.length) return null;
13901
14173
  const editing = task.status === "review";
13902
14174
  const change = (criterion, patch) => setChecks((task.acceptanceCriteria ?? []).map((_, i) => ({ criterion: i + 1, verdict: "unverified", ...checks.find((c) => c.criterion === i + 1), ...criterion === i + 1 ? patch : {} })));
13903
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("section", { className: "dsh-partner-task-contract", children: [
13904
- Boolean(task.acceptanceCriteria?.length) && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("header", { children: [
13905
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("strong", { children: [
14175
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("section", { className: "dsh-partner-task-contract", children: [
14176
+ Boolean(task.acceptanceCriteria?.length) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("header", { children: [
14177
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("strong", { children: [
13906
14178
  "\u9A8C\u6536\u6E05\u5355 \xB7 ",
13907
14179
  task.acceptanceCriteria?.length
13908
14180
  ] }),
13909
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("small", { children: "\u4F19\u4F34 / \u4EBA\u5DE5\u6838\u9A8C\uFF0C\u4E0D\u7B49\u4E8E\u7A0B\u5E8F\u9A8C\u8BC1" })
14181
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("small", { children: "\u4F19\u4F34 / \u4EBA\u5DE5\u6838\u9A8C\uFF0C\u4E0D\u7B49\u4E8E\u7A0B\u5E8F\u9A8C\u8BC1" })
13910
14182
  ] }),
13911
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("ol", { children: task.acceptanceCriteria?.map((text4, i) => {
14183
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("ol", { children: task.acceptanceCriteria?.map((text4, i) => {
13912
14184
  const criterion = i + 1, check = checks.find((c) => c.criterion === criterion);
13913
14185
  const saved = task.reviewChecks?.find((c) => c.criterion === criterion);
13914
14186
  const previous3 = task.previousAttempt?.reviewChecks?.find((c) => c.criterion === criterion);
13915
14187
  const evidence = (task.evidence ?? []).filter((e) => e.criterion === criterion);
13916
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("li", { children: [
13917
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { children: text4 }),
13918
- evidence.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
13919
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("summary", { children: [
14188
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("li", { children: [
14189
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { children: text4 }),
14190
+ evidence.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
14191
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("summary", { children: [
13920
14192
  "\u6267\u884C\u8BC1\u636E \xB7 ",
13921
14193
  evidence.length,
13922
14194
  " \xB7 \u5C1A\u9700\u6838\u9A8C"
13923
14195
  ] }),
13924
- evidence.map((e, j) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
13925
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("code", { children: e.reference }),
13926
- e.note && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("small", { children: e.note })
14196
+ evidence.map((e, j) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
14197
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("code", { children: e.reference }),
14198
+ e.note && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("small", { children: e.note })
13927
14199
  ] }, j))
13928
14200
  ] }),
13929
- previous3?.reason && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("small", { children: [
14201
+ previous3?.reason && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("small", { children: [
13930
14202
  "\u4E0A\u6B21\u6838\u9A8C\uFF1A",
13931
14203
  previous3.reason
13932
14204
  ] }),
13933
- editing ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "dsh-partner-task-fields", children: [
13934
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { children: [
13935
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
14205
+ editing ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "dsh-partner-task-fields", children: [
14206
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { children: [
14207
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { children: [
13936
14208
  "\u7B2C ",
13937
14209
  criterion,
13938
14210
  " \u9879\u7ED3\u8BBA"
13939
14211
  ] }),
13940
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("select", { disabled: busy, value: check?.verdict ?? "unverified", onChange: (e) => change(criterion, { verdict: e.target.value }), children: [
13941
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: "unverified", children: "\u672A\u9A8C\u8BC1" }),
13942
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: "passed", children: "\u5DF2\u6838\u9A8C\u901A\u8FC7" }),
13943
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: "failed", children: "\u672A\u901A\u8FC7" })
14212
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("select", { disabled: busy, value: check?.verdict ?? "unverified", onChange: (e) => change(criterion, { verdict: e.target.value }), children: [
14213
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("option", { value: "unverified", children: "\u672A\u9A8C\u8BC1" }),
14214
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("option", { value: "passed", children: "\u5DF2\u6838\u9A8C\u901A\u8FC7" }),
14215
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("option", { value: "failed", children: "\u672A\u901A\u8FC7" })
13944
14216
  ] })
13945
14217
  ] }),
13946
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { children: [
13947
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: check?.verdict === "passed" ? "\u5B9E\u9645\u6838\u9A8C\u8BC1\u636E" : "\u7F3A\u9879 / \u65E0\u6CD5\u6838\u9A8C\u7684\u539F\u56E0" }),
13948
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("textarea", { rows: 2, maxLength: 1e3, disabled: busy, value: (check?.verdict === "passed" ? check.evidence : check?.reason) ?? "", onChange: (e) => change(criterion, check?.verdict === "passed" ? { evidence: e.target.value } : { reason: e.target.value }) })
14218
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { children: [
14219
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: check?.verdict === "passed" ? "\u5B9E\u9645\u6838\u9A8C\u8BC1\u636E" : "\u7F3A\u9879 / \u65E0\u6CD5\u6838\u9A8C\u7684\u539F\u56E0" }),
14220
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("textarea", { rows: 2, maxLength: 1e3, disabled: busy, value: (check?.verdict === "passed" ? check.evidence : check?.reason) ?? "", onChange: (e) => change(criterion, check?.verdict === "passed" ? { evidence: e.target.value } : { reason: e.target.value }) })
13949
14221
  ] })
13950
- ] }) : saved && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("small", { children: [
14222
+ ] }) : saved && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("small", { children: [
13951
14223
  saved.verdict === "passed" ? "\u6838\u9A8C\u901A\u8FC7" : saved.verdict === "failed" ? "\u672A\u901A\u8FC7" : "\u672A\u9A8C\u8BC1",
13952
14224
  " \xB7 ",
13953
14225
  saved.evidence ?? saved.reason
13954
14226
  ] })
13955
14227
  ] }, criterion);
13956
14228
  }) }),
13957
- task.resourceKeys?.length ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
13958
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("summary", { children: [
14229
+ task.resourceKeys?.length ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
14230
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("summary", { children: [
13959
14231
  "\u72EC\u5360\u8D44\u6E90\u58F0\u660E \xB7 ",
13960
14232
  task.resourceKeys.length
13961
14233
  ] }),
13962
- task.resourceKeys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("code", { children: key }, key)),
13963
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("small", { children: "\u4EC5\u7EA6\u675F\u770B\u677F\u5185\u76F8\u540C\u58F0\u660E\uFF0C\u4E0D\u662F\u64CD\u4F5C\u7CFB\u7EDF\u9501\u3002" })
14234
+ task.resourceKeys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("code", { children: key }, key)),
14235
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("small", { children: "\u4EC5\u7EA6\u675F\u770B\u677F\u5185\u76F8\u540C\u58F0\u660E\uFF0C\u4E0D\u662F\u64CD\u4F5C\u7CFB\u7EDF\u9501\u3002" })
13964
14236
  ] }) : null
13965
14237
  ] });
13966
14238
  }
13967
14239
 
13968
14240
  // src/ui/requirement-tasks-panel.tsx
13969
- var import_jsx_runtime31 = require("react/jsx-runtime");
14241
+ var import_jsx_runtime33 = require("react/jsx-runtime");
13970
14242
  var COLUMNS = [
13971
14243
  { id: "backlog", label: "\u6536\u96C6\u7BB1" },
13972
14244
  { id: "ready", label: "\u5F85\u5F00\u59CB" },
@@ -13976,26 +14248,26 @@ var COLUMNS = [
13976
14248
  { id: "done", label: "\u5DF2\u5B8C\u6210" }
13977
14249
  ];
13978
14250
  function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back, detailOnly = false } = {}) {
13979
- const [board, setBoard] = (0, import_react34.useState)({ tasks: [], activities: [] });
13980
- const [directory, setDirectory] = (0, import_react34.useState)([]);
13981
- const [delegations, setDelegations] = (0, import_react34.useState)([]);
13982
- const [creating, setCreating] = (0, import_react34.useState)(false);
13983
- const [requirementDetail, setRequirementDetail] = (0, import_react34.useState)(false);
13984
- const [selectedTaskId, setSelectedTaskId] = (0, import_react34.useState)(initialTaskId);
13985
- (0, import_react34.useEffect)(() => {
14251
+ const [board, setBoard] = (0, import_react36.useState)({ tasks: [], activities: [] });
14252
+ const [directory, setDirectory] = (0, import_react36.useState)([]);
14253
+ const [delegations, setDelegations] = (0, import_react36.useState)([]);
14254
+ const [creating, setCreating] = (0, import_react36.useState)(false);
14255
+ const [requirementDetail, setRequirementDetail] = (0, import_react36.useState)(false);
14256
+ const [selectedTaskId, setSelectedTaskId] = (0, import_react36.useState)(initialTaskId);
14257
+ (0, import_react36.useEffect)(() => {
13986
14258
  if (initialTaskId) setSelectedTaskId(initialTaskId);
13987
14259
  }, [initialTaskId, openRequest]);
13988
- const [busy, setBusy] = (0, import_react34.useState)();
13989
- const [loading, setLoading] = (0, import_react34.useState)(true);
13990
- const [error, setError] = (0, import_react34.useState)();
13991
- const [syncedAt, setSyncedAt] = (0, import_react34.useState)();
13992
- const [query, setQuery] = (0, import_react34.useState)("");
13993
- const [statusFilter, setStatusFilter] = (0, import_react34.useState)("all");
13994
- const [assigneeFilter, setAssigneeFilter] = (0, import_react34.useState)("all");
13995
- const deferredQuery = (0, import_react34.useDeferredValue)(query.trim().toLocaleLowerCase());
13996
- const tasksById = (0, import_react34.useMemo)(() => new Map(board.tasks.map((item) => [item.id, item])), [board.tasks]);
13997
- const directoryById = (0, import_react34.useMemo)(() => new Map(directory.map((item) => [item.id, item])), [directory]);
13998
- const activeDelegationByTaskId = (0, import_react34.useMemo)(() => {
14260
+ const [busy, setBusy] = (0, import_react36.useState)();
14261
+ const [loading, setLoading] = (0, import_react36.useState)(true);
14262
+ const [error, setError] = (0, import_react36.useState)();
14263
+ const [syncedAt, setSyncedAt] = (0, import_react36.useState)();
14264
+ const [query, setQuery] = (0, import_react36.useState)("");
14265
+ const [statusFilter, setStatusFilter] = (0, import_react36.useState)("all");
14266
+ const [assigneeFilter, setAssigneeFilter] = (0, import_react36.useState)("all");
14267
+ const deferredQuery = (0, import_react36.useDeferredValue)(query.trim().toLocaleLowerCase());
14268
+ const tasksById = (0, import_react36.useMemo)(() => new Map(board.tasks.map((item) => [item.id, item])), [board.tasks]);
14269
+ const directoryById = (0, import_react36.useMemo)(() => new Map(directory.map((item) => [item.id, item])), [directory]);
14270
+ const activeDelegationByTaskId = (0, import_react36.useMemo)(() => {
13999
14271
  const result = /* @__PURE__ */ new Map();
14000
14272
  for (const delegation of delegations) {
14001
14273
  if ((delegation.status === "queued" || delegation.status === "running") && !result.has(delegation.taskId)) result.set(delegation.taskId, delegation);
@@ -14004,25 +14276,25 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
14004
14276
  }, [delegations]);
14005
14277
  const selectedTask = selectedTaskId ? tasksById.get(selectedTaskId) : void 0;
14006
14278
  const requirement = board.requirements?.find((item) => item.id === requirementId);
14007
- const requirementTasks = (0, import_react34.useMemo)(() => board.tasks.filter((task) => !requirementId || (requirementId === "legacy" ? !task.requirementId : task.requirementId === requirementId)), [board.tasks, requirementId]);
14008
- const dependentsById = (0, import_react34.useMemo)(() => {
14279
+ const requirementTasks = (0, import_react36.useMemo)(() => board.tasks.filter((task) => !requirementId || (requirementId === "legacy" ? !task.requirementId : task.requirementId === requirementId)), [board.tasks, requirementId]);
14280
+ const dependentsById = (0, import_react36.useMemo)(() => {
14009
14281
  const result = /* @__PURE__ */ new Map();
14010
14282
  for (const task of board.tasks) for (const dependencyId of task.dependencyTaskIds) result.set(dependencyId, (result.get(dependencyId) ?? 0) + 1);
14011
14283
  return result;
14012
14284
  }, [board.tasks]);
14013
- const scopedTasks = (0, import_react34.useMemo)(() => requirementTasks.filter((task) => {
14285
+ const scopedTasks = (0, import_react36.useMemo)(() => requirementTasks.filter((task) => {
14014
14286
  if (assigneeFilter !== "all" && (task.assigneeCompanionId ?? "unassigned") !== assigneeFilter) return false;
14015
14287
  if (!deferredQuery) return true;
14016
14288
  const dependencies = task.dependencyTaskIds.map((id) => tasksById.get(id)?.title ?? "");
14017
14289
  return [task.title, task.description, task.resultAbstract, task.resultSummary, directoryById.get(task.assigneeCompanionId ?? "")?.name, ...dependencies].some((value) => value?.toLocaleLowerCase().includes(deferredQuery));
14018
14290
  }), [assigneeFilter, requirementTasks, deferredQuery, directoryById, tasksById]);
14019
- const statusCounts = (0, import_react34.useMemo)(() => {
14291
+ const statusCounts = (0, import_react36.useMemo)(() => {
14020
14292
  const result = new Map(COLUMNS.map((column) => [column.id, 0]));
14021
14293
  for (const task of scopedTasks) result.set(task.status, (result.get(task.status) ?? 0) + 1);
14022
14294
  return result;
14023
14295
  }, [scopedTasks]);
14024
14296
  const visibleColumns = statusFilter === "all" ? COLUMNS.filter((column) => (statusCounts.get(column.id) ?? 0) > 0) : COLUMNS.filter((column) => column.id === statusFilter);
14025
- const tasksByStatus = (0, import_react34.useMemo)(() => {
14297
+ const tasksByStatus = (0, import_react36.useMemo)(() => {
14026
14298
  const priorityRank = { urgent: 3, high: 2, normal: 1, low: 0 };
14027
14299
  const result = new Map(COLUMNS.map((column) => [column.id, []]));
14028
14300
  for (const task of scopedTasks) {
@@ -14124,30 +14396,30 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
14124
14396
  setBusy(void 0);
14125
14397
  }
14126
14398
  };
14127
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-feature-page is-board", children: [
14128
- !detailOnly && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
14129
- back && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("nav", { className: "dsh-partner-requirement-breadcrumb", children: [
14130
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", onClick: back, children: "\u9700\u6C42\u770B\u677F" }),
14131
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives14.IconChevronRightOutline14, { size: 14 }),
14132
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: requirement?.title ?? "\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1" })
14399
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "dsh-partner-feature-page is-board", children: [
14400
+ !detailOnly && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
14401
+ back && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("nav", { className: "dsh-partner-requirement-breadcrumb", children: [
14402
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", onClick: back, children: "\u9700\u6C42\u770B\u677F" }),
14403
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives15.IconChevronRightOutline14, { size: 14 }),
14404
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: requirement?.title ?? "\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1" })
14133
14405
  ] }),
14134
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(WorkspaceHero, { eyebrow: requirement ? requirementStatus(requirement) : "\u65E7\u4EFB\u52A1", title: requirement?.title ?? "\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1", detail: requirement?.description || "\u4EFB\u52A1\u6309\u9636\u6BB5\u5C55\u793A\uFF0C\u70B9\u51FB\u67E5\u770B\u4EA4\u4ED8\u3001\u4F9D\u8D56\u548C\u6267\u884C\u72B6\u6001\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
14135
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "dsh-partner-board-live", title: syncedAt ? `\u6700\u8FD1\u540C\u6B65 ${new Date(syncedAt).toLocaleTimeString()}` : "\u6B63\u5728\u8FDE\u63A5", children: [
14136
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("i", {}),
14406
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WorkspaceHero, { eyebrow: requirement ? requirementStatus(requirement) : "\u65E7\u4EFB\u52A1", title: requirement?.title ?? "\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1", detail: requirement?.description || "\u4EFB\u52A1\u6309\u9636\u6BB5\u5C55\u793A\uFF0C\u70B9\u51FB\u67E5\u770B\u4EA4\u4ED8\u3001\u4F9D\u8D56\u548C\u6267\u884C\u72B6\u6001\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
14407
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "dsh-partner-board-live", title: syncedAt ? `\u6700\u8FD1\u540C\u6B65 ${new Date(syncedAt).toLocaleTimeString()}` : "\u6B63\u5728\u8FDE\u63A5", children: [
14408
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", {}),
14137
14409
  "\u5B9E\u65F6\u540C\u6B65"
14138
14410
  ] }),
14139
- requirement && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", onClick: () => setRequirementDetail(true), children: "\u9700\u6C42\u8BE6\u60C5" }),
14140
- requirement?.status === "planning" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", onClick: () => setCreating(true), children: [
14141
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives14.IconPlusOutline16, { size: 15 }),
14411
+ requirement && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", onClick: () => setRequirementDetail(true), children: "\u9700\u6C42\u8BE6\u60C5" }),
14412
+ requirement?.status === "planning" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { type: "button", onClick: () => setCreating(true), children: [
14413
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives15.IconPlusOutline16, { size: 15 }),
14142
14414
  "\u65B0\u4EFB\u52A1"
14143
14415
  ] })
14144
14416
  ] }) })
14145
14417
  ] }),
14146
- error && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(WorkspaceNotice, { children: error }),
14147
- requirementDetail && requirement && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(WorkspaceDialog, { eyebrow: "\u9700\u6C42\u8BE6\u60C5", title: requirement.title, detail: requirementStatus(requirement), close: () => setRequirementDetail(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(RequirementDetail, { item: requirement, tasks: requirementTasks, directory, changed: load2, close: () => setRequirementDetail(false) }, requirement.id) }),
14148
- creating && requirement && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u5B50\u4EFB\u52A1", detail: `\u6240\u5C5E\u9700\u6C42\uFF1A${requirement.title}`, close: () => setCreating(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TaskForm, { requirementId: requirement.id, companions: directory, tasks: requirementTasks, close: () => setCreating(false), changed: load2 }) }),
14149
- selectedTask && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(WorkspaceDialog, { eyebrow: "TASK DETAIL", title: selectedTask.title, detail: taskDialogSummary(selectedTask, directory), close: () => setSelectedTaskId(void 0), width: "wide", children: [
14150
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
14418
+ error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WorkspaceNotice, { children: error }),
14419
+ requirementDetail && requirement && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WorkspaceDialog, { eyebrow: "\u9700\u6C42\u8BE6\u60C5", title: requirement.title, detail: requirementStatus(requirement), close: () => setRequirementDetail(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RequirementDetail, { item: requirement, tasks: requirementTasks, directory, changed: load2, close: () => setRequirementDetail(false) }, requirement.id) }),
14420
+ creating && requirement && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u5B50\u4EFB\u52A1", detail: `\u6240\u5C5E\u9700\u6C42\uFF1A${requirement.title}`, close: () => setCreating(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TaskForm, { requirementId: requirement.id, companions: directory, tasks: requirementTasks, close: () => setCreating(false), changed: load2 }) }),
14421
+ selectedTask && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(WorkspaceDialog, { eyebrow: "TASK DETAIL", title: selectedTask.title, detail: taskDialogSummary(selectedTask, directory), close: () => setSelectedTaskId(void 0), width: "wide", children: [
14422
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
14151
14423
  TaskDetail,
14152
14424
  {
14153
14425
  task: selectedTask,
@@ -14177,61 +14449,61 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
14177
14449
  },
14178
14450
  selectedTask.id
14179
14451
  ),
14180
- error && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(WorkspaceNotice, { children: error })
14452
+ error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WorkspaceNotice, { children: error })
14181
14453
  ] }),
14182
- !detailOnly && (loading ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CollectionSkeleton, { rows: 6 }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
14183
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-board-tools", children: [
14184
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "dsh-partner-board-search", children: [
14185
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u4EFB\u52A1" }),
14186
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives14.IconSearchOutline16, { size: 16 }) }),
14187
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: "\u641C\u7D22\u4EFB\u52A1\u3001\u8D1F\u8D23\u4EBA\u6216\u524D\u7F6E\u4EFB\u52A1" }),
14188
- query && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", onClick: () => setQuery(""), "aria-label": "\u6E05\u9664\u4EFB\u52A1\u641C\u7D22", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives14.IconCloseOutline16, { size: 14 }) })
14454
+ !detailOnly && (loading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CollectionSkeleton, { rows: 6 }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
14455
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "dsh-partner-board-tools", children: [
14456
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "dsh-partner-board-search", children: [
14457
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u4EFB\u52A1" }),
14458
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives15.IconSearchOutline16, { size: 16 }) }),
14459
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: "\u641C\u7D22\u4EFB\u52A1\u3001\u8D1F\u8D23\u4EBA\u6216\u524D\u7F6E\u4EFB\u52A1" }),
14460
+ query && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", onClick: () => setQuery(""), "aria-label": "\u6E05\u9664\u4EFB\u52A1\u641C\u7D22", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives15.IconCloseOutline16, { size: 14 }) })
14189
14461
  ] }),
14190
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "dsh-partner-board-assignee", children: [
14191
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "sr-only", children: "\u6309\u8D1F\u8D23\u4EBA\u7B5B\u9009" }),
14192
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("select", { value: assigneeFilter, onChange: (event) => setAssigneeFilter(event.target.value), children: [
14193
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "all", children: "\u5168\u90E8\u4F19\u4F34" }),
14194
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "unassigned", children: "\u672A\u6307\u6D3E" }),
14195
- directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("option", { value: item.id, children: [
14462
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "dsh-partner-board-assignee", children: [
14463
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "sr-only", children: "\u6309\u8D1F\u8D23\u4EBA\u7B5B\u9009" }),
14464
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { value: assigneeFilter, onChange: (event) => setAssigneeFilter(event.target.value), children: [
14465
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "all", children: "\u5168\u90E8\u4F19\u4F34" }),
14466
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "unassigned", children: "\u672A\u6307\u6D3E" }),
14467
+ directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: item.id, children: [
14196
14468
  "@",
14197
14469
  item.name
14198
14470
  ] }, item.id))
14199
14471
  ] })
14200
14472
  ] }),
14201
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "dsh-partner-board-assignee is-mobile-stage", children: [
14202
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "sr-only", children: "\u6309\u4EFB\u52A1\u9636\u6BB5\u7B5B\u9009" }),
14203
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("select", { value: statusFilter, onChange: (event) => setStatusFilter(event.target.value), children: [
14204
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("option", { value: "all", children: [
14473
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "dsh-partner-board-assignee is-mobile-stage", children: [
14474
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "sr-only", children: "\u6309\u4EFB\u52A1\u9636\u6BB5\u7B5B\u9009" }),
14475
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { value: statusFilter, onChange: (event) => setStatusFilter(event.target.value), children: [
14476
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: "all", children: [
14205
14477
  "\u5168\u90E8\u9636\u6BB5 \xB7 ",
14206
14478
  scopedTasks.length
14207
14479
  ] }),
14208
- COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("option", { value: column.id, children: [
14480
+ COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: column.id, children: [
14209
14481
  column.label,
14210
14482
  " \xB7 ",
14211
14483
  statusCounts.get(column.id) ?? 0
14212
14484
  ] }, column.id))
14213
14485
  ] })
14214
14486
  ] }),
14215
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("small", { "aria-live": "polite", children: [
14487
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("small", { "aria-live": "polite", children: [
14216
14488
  "\u663E\u793A ",
14217
14489
  visibleTaskCount,
14218
14490
  " / ",
14219
14491
  board.tasks.length
14220
14492
  ] })
14221
14493
  ] }),
14222
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("nav", { className: "dsh-partner-board-statuses", "aria-label": "\u6309\u4EFB\u52A1\u72B6\u6001\u7B5B\u9009", children: [
14223
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: statusFilter === "all" ? "is-active" : "", "aria-pressed": statusFilter === "all", onClick: () => setStatusFilter("all"), children: [
14224
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u5168\u90E8" }),
14225
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("b", { children: scopedTasks.length })
14494
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("nav", { className: "dsh-partner-board-statuses", "aria-label": "\u6309\u4EFB\u52A1\u72B6\u6001\u7B5B\u9009", children: [
14495
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { type: "button", className: statusFilter === "all" ? "is-active" : "", "aria-pressed": statusFilter === "all", onClick: () => setStatusFilter("all"), children: [
14496
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u5168\u90E8" }),
14497
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("b", { children: scopedTasks.length })
14226
14498
  ] }),
14227
- COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: statusFilter === column.id ? "is-active" : "", "aria-pressed": statusFilter === column.id, onClick: () => setStatusFilter(column.id), children: [
14228
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: column.label }),
14229
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("b", { children: statusCounts.get(column.id) ?? 0 })
14499
+ COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { type: "button", className: statusFilter === column.id ? "is-active" : "", "aria-pressed": statusFilter === column.id, onClick: () => setStatusFilter(column.id), children: [
14500
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: column.label }),
14501
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("b", { children: statusCounts.get(column.id) ?? 0 })
14230
14502
  ] }, column.id))
14231
14503
  ] }),
14232
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "dsh-partner-board", "data-focused": statusFilter !== "all", "aria-label": "\u4EFB\u52A1\u770B\u677F", children: visibleColumns.map((column) => {
14504
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "dsh-partner-board", "data-focused": statusFilter !== "all", "aria-label": "\u4EFB\u52A1\u770B\u677F", children: visibleColumns.map((column) => {
14233
14505
  const tasks = tasksByStatus.get(column.id) ?? [];
14234
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TaskBoardStage, { id: column.id, label: column.label, tasks, focused: statusFilter !== "all", filtered: Boolean(query || assigneeFilter !== "all"), renderTask: (task) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
14506
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TaskBoardStage, { id: column.id, label: column.label, tasks, focused: statusFilter !== "all", filtered: Boolean(query || assigneeFilter !== "all"), renderTask: (task) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
14235
14507
  TaskCard,
14236
14508
  {
14237
14509
  task,
@@ -14244,9 +14516,9 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
14244
14516
  task.id
14245
14517
  ) }, column.id);
14246
14518
  }) }),
14247
- !scopedTasks.length && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-collection-empty", children: [
14248
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: query || assigneeFilter !== "all" ? "\u6CA1\u6709\u5339\u914D\u7684\u4EFB\u52A1" : "\u8FD8\u6CA1\u6709\u5B50\u4EFB\u52A1" }),
14249
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { children: requirement?.status === "planning" ? "\u6DFB\u52A0\u5B50\u4EFB\u52A1\u5E76\u5B89\u6392\u8D1F\u8D23\u4EBA\uFF0C\u5B8C\u6210\u5206\u5DE5\u540E\u5728\u9700\u6C42\u8BE6\u60C5\u4E2D\u63D0\u4EA4\u89C4\u5212\u3002" : "\u53EF\u8FD4\u56DE\u9700\u6C42\u770B\u677F\u67E5\u770B\u5176\u4ED6\u9700\u6C42\u3002" })
14519
+ !scopedTasks.length && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "dsh-partner-collection-empty", children: [
14520
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: query || assigneeFilter !== "all" ? "\u6CA1\u6709\u5339\u914D\u7684\u4EFB\u52A1" : "\u8FD8\u6CA1\u6709\u5B50\u4EFB\u52A1" }),
14521
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: requirement?.status === "planning" ? "\u6DFB\u52A0\u5B50\u4EFB\u52A1\u5E76\u5B89\u6392\u8D1F\u8D23\u4EBA\uFF0C\u5B8C\u6210\u5206\u5DE5\u540E\u5728\u9700\u6C42\u8BE6\u60C5\u4E2D\u63D0\u4EA4\u89C4\u5212\u3002" : "\u53EF\u8FD4\u56DE\u9700\u6C42\u770B\u677F\u67E5\u770B\u5176\u4ED6\u9700\u6C42\u3002" })
14250
14522
  ] })
14251
14523
  ] }))
14252
14524
  ] });
@@ -14257,48 +14529,48 @@ function TaskCard({ task, tasksById, directoryById, dependentCount, execution, o
14257
14529
  const completedDependencies = dependencies.length - blockers.length;
14258
14530
  const assignee = directoryById.get(task.assigneeCompanionId ?? "");
14259
14531
  const executionState = task.scheduling ? { label: task.scheduling.message } : 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;
14260
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("article", { className: "dsh-partner-task-card", "data-blocked": blockers.length > 0, "data-priority": task.priority, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: "dsh-partner-task-summary", "aria-haspopup": "dialog", onClick: open, children: [
14261
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
14262
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "dsh-partner-task-card-title", children: [
14263
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { title: task.title, children: task.title }),
14264
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("em", { children: priorityLabel(task.priority) })
14532
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("article", { className: "dsh-partner-task-card", "data-blocked": blockers.length > 0, "data-priority": task.priority, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { type: "button", className: "dsh-partner-task-summary", "aria-haspopup": "dialog", onClick: open, children: [
14533
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { children: [
14534
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "dsh-partner-task-card-title", children: [
14535
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { title: task.title, children: task.title }),
14536
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("em", { children: priorityLabel(task.priority) })
14265
14537
  ] }),
14266
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("small", { className: "dsh-partner-task-card-owner", children: [
14538
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("small", { className: "dsh-partner-task-card-owner", children: [
14267
14539
  assignee ? `@${assignee.name}` : "\u672A\u6307\u6D3E",
14268
14540
  task.resultSummary ? " \xB7 \u5DF2\u6709\u7ED3\u679C" : "",
14269
14541
  executionState ? ` \xB7 ${executionState.label}` : ""
14270
14542
  ] }),
14271
- (dependencies.length > 0 || dependentCount > 0) && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "dsh-partner-task-relations", children: [
14272
- dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("small", { "data-blocked": blockers.length > 0, children: [
14543
+ (dependencies.length > 0 || dependentCount > 0) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "dsh-partner-task-relations", children: [
14544
+ dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("small", { "data-blocked": blockers.length > 0, children: [
14273
14545
  "\u524D\u7F6E ",
14274
14546
  completedDependencies,
14275
14547
  "/",
14276
14548
  dependencies.length
14277
14549
  ] }),
14278
- dependentCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("small", { children: [
14550
+ dependentCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("small", { children: [
14279
14551
  "\u5B8C\u6210\u540E\u89E3\u9501 ",
14280
14552
  dependentCount
14281
14553
  ] })
14282
14554
  ] })
14283
14555
  ] }),
14284
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives14.IconChevronRightOutline14, { size: 14 })
14556
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives15.IconChevronRightOutline14, { size: 14 })
14285
14557
  ] }) });
14286
14558
  }
14287
14559
  function TaskDetail({ task, tasks, activities, directory, execution, busy, update, delegate, review, accept, reject, remove }) {
14288
- const [rejecting, setRejecting] = (0, import_react34.useState)(false);
14289
- const [checks, setChecks] = (0, import_react34.useState)([]);
14290
- (0, import_react34.useEffect)(() => {
14560
+ const [rejecting, setRejecting] = (0, import_react36.useState)(false);
14561
+ const [checks, setChecks] = (0, import_react36.useState)([]);
14562
+ (0, import_react36.useEffect)(() => {
14291
14563
  setChecks([]);
14292
14564
  }, [task.id, task.revision]);
14293
- const [rejectReason, setRejectReason] = (0, import_react34.useState)("");
14294
- (0, import_react34.useEffect)(() => {
14565
+ const [rejectReason, setRejectReason] = (0, import_react36.useState)("");
14566
+ (0, import_react36.useEffect)(() => {
14295
14567
  if (task.status !== "review") {
14296
14568
  setRejecting(false);
14297
14569
  setRejectReason("");
14298
14570
  }
14299
14571
  }, [task.status]);
14300
- const [confirmingDelete, setConfirmingDelete] = (0, import_react34.useState)(false);
14301
- const byId = (0, import_react34.useMemo)(() => new Map(tasks.map((item) => [item.id, item])), [tasks]);
14572
+ const [confirmingDelete, setConfirmingDelete] = (0, import_react36.useState)(false);
14573
+ const byId = (0, import_react36.useMemo)(() => new Map(tasks.map((item) => [item.id, item])), [tasks]);
14302
14574
  const dependencies = task.dependencyTaskIds.map((id) => byId.get(id)).filter((item) => item !== void 0);
14303
14575
  const blockers = dependencies.filter((item) => item.status !== "done");
14304
14576
  const assignee = directory.find((item) => item.id === task.assigneeCompanionId);
@@ -14307,30 +14579,30 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
14307
14579
  const canExecute = Boolean(task.assigneeCompanionId) && !execution && !["doing", "review", "done"].includes(task.status);
14308
14580
  const recentActivities = [...activities].sort((left, right) => right.at - left.at).slice(0, 6);
14309
14581
  const executionState = execution ? delegationState(execution, blockers.length) : void 0;
14310
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-task-detail", children: [
14311
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { className: "dsh-partner-task-description", children: [
14312
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
14313
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { children: task.description || "\u6CA1\u6709\u8865\u5145\u8BF4\u660E" })
14582
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "dsh-partner-task-detail", children: [
14583
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("section", { className: "dsh-partner-task-description", children: [
14584
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
14585
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: task.description || "\u6CA1\u6709\u8865\u5145\u8BF4\u660E" })
14314
14586
  ] }),
14315
- task.scheduling && task.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { className: "dsh-partner-task-description", children: [
14316
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: task.scheduling.message }),
14317
- task.scheduling.taskIds?.length ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { children: task.scheduling.taskIds.map((id) => byId.get(id)?.title ?? "\u5DF2\u5220\u9664\u4EFB\u52A1").join("\u3001") }) : null,
14318
- task.scheduling.retryAt ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("small", { children: [
14587
+ task.scheduling && task.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("section", { className: "dsh-partner-task-description", children: [
14588
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: task.scheduling.message }),
14589
+ task.scheduling.taskIds?.length ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: task.scheduling.taskIds.map((id) => byId.get(id)?.title ?? "\u5DF2\u5220\u9664\u4EFB\u52A1").join("\u3001") }) : null,
14590
+ task.scheduling.retryAt ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("small", { children: [
14319
14591
  "\u4E0B\u6B21\u91CD\u8BD5\uFF1A",
14320
14592
  new Date(task.scheduling.retryAt).toLocaleString()
14321
14593
  ] }) : null
14322
14594
  ] }),
14323
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TaskContractPanel, { task, checks, setChecks, busy }),
14324
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-task-fields", children: [
14325
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { children: [
14326
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u72B6\u6001" }),
14327
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("select", { value: task.status, disabled: busy, onChange: (event) => update({ status: event.target.value, ...event.target.value === "done" ? { checks } : {} }), children: COLUMNS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime31.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)) })
14595
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TaskContractPanel, { task, checks, setChecks, busy }),
14596
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "dsh-partner-task-fields", children: [
14597
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14598
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u72B6\u6001" }),
14599
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("select", { value: task.status, disabled: busy, onChange: (event) => update({ status: event.target.value, ...event.target.value === "done" ? { checks } : {} }), children: COLUMNS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.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)) })
14328
14600
  ] }),
14329
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { children: [
14330
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
14331
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("select", { value: task.assigneeCompanionId ?? "", disabled: busy || task.status === "doing", onChange: (event) => update({ assigneeCompanionId: event.target.value }), children: [
14332
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
14333
- directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("option", { value: item.id, children: [
14601
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14602
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
14603
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { value: task.assigneeCompanionId ?? "", disabled: busy || task.status === "doing", onChange: (event) => update({ assigneeCompanionId: event.target.value }), children: [
14604
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
14605
+ directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: item.id, children: [
14334
14606
  "@",
14335
14607
  item.name,
14336
14608
  " \xB7 ",
@@ -14338,43 +14610,43 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
14338
14610
  ] }, item.id))
14339
14611
  ] })
14340
14612
  ] }),
14341
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { children: [
14342
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
14343
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("select", { value: task.reviewerCompanionId ?? "", disabled: busy, onChange: (event) => update({ reviewerCompanionId: event.target.value }), children: [
14344
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
14345
- directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("option", { value: item.id, children: [
14613
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14614
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
14615
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { value: task.reviewerCompanionId ?? "", disabled: busy, onChange: (event) => update({ reviewerCompanionId: event.target.value }), children: [
14616
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
14617
+ directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: item.id, children: [
14346
14618
  "@",
14347
14619
  item.name
14348
14620
  ] }, item.id))
14349
14621
  ] })
14350
14622
  ] })
14351
14623
  ] }),
14352
- executionState && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { className: "dsh-partner-task-execution", "data-state": execution?.status, children: [
14353
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("i", {}),
14354
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
14355
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: executionState.title }),
14356
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: executionState.detail })
14624
+ executionState && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("section", { className: "dsh-partner-task-execution", "data-state": execution?.status, children: [
14625
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", {}),
14626
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { children: [
14627
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: executionState.title }),
14628
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("small", { children: executionState.detail })
14357
14629
  ] })
14358
14630
  ] }),
14359
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { className: "dsh-partner-task-dependency", children: [
14360
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("header", { children: [
14361
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: "\u524D\u7F6E\u4EFB\u52A1" }),
14362
- /* @__PURE__ */ (0, import_jsx_runtime31.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" })
14631
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("section", { className: "dsh-partner-task-dependency", children: [
14632
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("header", { children: [
14633
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: "\u524D\u7F6E\u4EFB\u52A1" }),
14634
+ /* @__PURE__ */ (0, import_jsx_runtime33.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" })
14363
14635
  ] }),
14364
- dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: dependencies.map((item) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { "data-done": item.status === "done", children: [
14365
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("i", { children: item.status === "done" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives14.IconCheckOutline16, { size: 12 }) : "" }),
14366
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("b", { children: item.title }),
14367
- /* @__PURE__ */ (0, import_jsx_runtime31.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" })
14636
+ dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: dependencies.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { "data-done": item.status === "done", children: [
14637
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", { children: item.status === "done" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives15.IconCheckOutline16, { size: 12 }) : "" }),
14638
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("b", { children: item.title }),
14639
+ /* @__PURE__ */ (0, import_jsx_runtime33.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" })
14368
14640
  ] }, item.id)) }),
14369
- dependencyCandidates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { children: [
14370
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "sr-only", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1" }),
14371
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("select", { defaultValue: "", disabled: busy || ["doing", "review", "done"].includes(task.status), onChange: (event) => {
14641
+ dependencyCandidates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14642
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "sr-only", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1" }),
14643
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { defaultValue: "", disabled: busy || ["doing", "review", "done"].includes(task.status), onChange: (event) => {
14372
14644
  const id = event.currentTarget.value;
14373
14645
  if (id) update({ dependencyTaskIds: [...task.dependencyTaskIds, id] });
14374
14646
  event.currentTarget.value = "";
14375
14647
  }, children: [
14376
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1\u2026" }),
14377
- dependencyCandidates.map((item) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("option", { value: item.id, children: [
14648
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1\u2026" }),
14649
+ dependencyCandidates.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: item.id, children: [
14378
14650
  item.title,
14379
14651
  " \xB7 ",
14380
14652
  statusLabel(item.status)
@@ -14382,70 +14654,70 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
14382
14654
  ] })
14383
14655
  ] })
14384
14656
  ] }),
14385
- task.resultSummary && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ResultBlock, { label: "\u6267\u884C\u7ED3\u679C", value: task.resultSummary }),
14386
- task.reviewSummary && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ResultBlock, { label: `\u6838\u9A8C\u610F\u89C1${reviewer ? ` \xB7 @${reviewer.name}` : ""}`, value: task.reviewSummary }),
14387
- recentActivities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("details", { className: "dsh-partner-task-activity dsh-partner-requirement-disclosure", children: [
14388
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("summary", { children: [
14657
+ task.resultSummary && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ResultBlock, { label: "\u6267\u884C\u7ED3\u679C", value: task.resultSummary }),
14658
+ task.reviewSummary && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ResultBlock, { label: `\u6838\u9A8C\u610F\u89C1${reviewer ? ` \xB7 @${reviewer.name}` : ""}`, value: task.reviewSummary }),
14659
+ recentActivities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("details", { className: "dsh-partner-task-activity dsh-partner-requirement-disclosure", children: [
14660
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("summary", { children: [
14389
14661
  "\u6700\u8FD1\u6D3B\u52A8 \xB7 ",
14390
14662
  recentActivities.length
14391
14663
  ] }),
14392
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("ol", { children: recentActivities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("li", { children: [
14393
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: item.message }),
14394
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("time", { children: new Date(item.at).toLocaleString() })
14664
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("ol", { children: recentActivities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("li", { children: [
14665
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: item.message }),
14666
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("time", { children: new Date(item.at).toLocaleString() })
14395
14667
  ] }, item.id)) })
14396
14668
  ] }),
14397
- rejecting && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("form", { className: "dsh-partner-task-reject", onSubmit: (event) => {
14669
+ rejecting && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("form", { className: "dsh-partner-task-reject", onSubmit: (event) => {
14398
14670
  event.preventDefault();
14399
14671
  const reason = rejectReason.trim();
14400
14672
  if (!reason) return;
14401
14673
  reject(reason, checks);
14402
14674
  }, children: [
14403
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { children: [
14404
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u6253\u56DE\u539F\u56E0" }),
14405
- /* @__PURE__ */ (0, import_jsx_runtime31.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" })
14675
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14676
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u6253\u56DE\u539F\u56E0" }),
14677
+ /* @__PURE__ */ (0, import_jsx_runtime33.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" })
14406
14678
  ] }),
14407
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
14408
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", onClick: () => {
14679
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
14680
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", onClick: () => {
14409
14681
  setRejecting(false);
14410
14682
  setRejectReason("");
14411
14683
  }, children: "\u53D6\u6D88" }),
14412
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !rejectReason.trim(), children: "\u786E\u8BA4\u6253\u56DE" })
14684
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !rejectReason.trim(), children: "\u786E\u8BA4\u6253\u56DE" })
14413
14685
  ] })
14414
14686
  ] }),
14415
- confirmingDelete && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-task-delete-confirm", role: "alert", children: [
14416
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u5220\u9664\u4F1A\u53D6\u6D88\u5173\u8054\u6267\u884C\uFF0C\u4F9D\u8D56\u5B83\u7684\u672A\u5B8C\u6210\u4EFB\u52A1\u5C06\u6682\u505C\u3002\u9700\u6C42\u9700\u91CD\u65B0\u786E\u8BA4\u8303\u56F4\uFF1B\u4E0D\u80FD\u64A4\u9500\u3002" }),
14417
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
14418
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", onClick: () => setConfirmingDelete(false), children: "\u4FDD\u7559\u4EFB\u52A1" }),
14419
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
14687
+ confirmingDelete && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "dsh-partner-task-delete-confirm", role: "alert", children: [
14688
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u5220\u9664\u4F1A\u53D6\u6D88\u5173\u8054\u6267\u884C\uFF0C\u4F9D\u8D56\u5B83\u7684\u672A\u5B8C\u6210\u4EFB\u52A1\u5C06\u6682\u505C\u3002\u9700\u6C42\u9700\u91CD\u65B0\u786E\u8BA4\u8303\u56F4\uFF1B\u4E0D\u80FD\u64A4\u9500\u3002" }),
14689
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
14690
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", onClick: () => setConfirmingDelete(false), children: "\u4FDD\u7559\u4EFB\u52A1" }),
14691
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
14420
14692
  ] })
14421
14693
  ] }),
14422
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("footer", { className: "dsh-partner-task-actions", children: [
14423
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("small", { children: [
14694
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("footer", { className: "dsh-partner-task-actions", children: [
14695
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("small", { children: [
14424
14696
  "r",
14425
14697
  task.revision,
14426
14698
  " \xB7 ",
14427
14699
  new Date(task.updatedAt).toLocaleString()
14428
14700
  ] }),
14429
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
14430
- task.status === "review" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
14431
- task.reviewerCompanionId && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", disabled: busy, onClick: review, children: busy ? "\u6838\u9A8C\u4E2D\u2026" : `\u4EA4\u7ED9 @${reviewer?.name ?? "\u4F19\u4F34"} \u6838\u9A8C` }),
14432
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", disabled: busy, onClick: () => setRejecting(true), children: "\u6253\u56DE\u91CD\u505A" }),
14433
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", className: "is-primary", disabled: busy || Boolean(task.acceptanceCriteria?.length && (checks.length !== task.acceptanceCriteria.length || checks.some((c) => c.verdict !== "passed" || !c.evidence?.trim()))), onClick: () => accept(checks), children: "\u9A8C\u6536\u901A\u8FC7" })
14434
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime31.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"}` }),
14435
- /* @__PURE__ */ (0, import_jsx_runtime31.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_runtime31.jsx)(import_dsh_client_ui_primitives14.IconTrashOutline16, { size: 14 }) })
14701
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { children: [
14702
+ task.status === "review" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
14703
+ task.reviewerCompanionId && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", disabled: busy, onClick: review, children: busy ? "\u6838\u9A8C\u4E2D\u2026" : `\u4EA4\u7ED9 @${reviewer?.name ?? "\u4F19\u4F34"} \u6838\u9A8C` }),
14704
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", disabled: busy, onClick: () => setRejecting(true), children: "\u6253\u56DE\u91CD\u505A" }),
14705
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", className: "is-primary", disabled: busy || Boolean(task.acceptanceCriteria?.length && (checks.length !== task.acceptanceCriteria.length || checks.some((c) => c.verdict !== "passed" || !c.evidence?.trim()))), onClick: () => accept(checks), children: "\u9A8C\u6536\u901A\u8FC7" })
14706
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime33.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"}` }),
14707
+ /* @__PURE__ */ (0, import_jsx_runtime33.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_runtime33.jsx)(import_dsh_client_ui_primitives15.IconTrashOutline16, { size: 14 }) })
14436
14708
  ] })
14437
14709
  ] })
14438
14710
  ] });
14439
14711
  }
14440
14712
  function ResultBlock({ label, value }) {
14441
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { className: "dsh-partner-task-result", children: [
14442
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { children: label }),
14443
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { children: value })
14713
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("section", { className: "dsh-partner-task-result", children: [
14714
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: label }),
14715
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: value })
14444
14716
  ] });
14445
14717
  }
14446
14718
  function TaskForm({ requirementId, companions, tasks, close, changed: changed2 }) {
14447
- const [error, setError] = (0, import_react34.useState)();
14448
- const [busy, setBusy] = (0, import_react34.useState)(false);
14719
+ const [error, setError] = (0, import_react36.useState)();
14720
+ const [busy, setBusy] = (0, import_react36.useState)(false);
14449
14721
  const dependencyOptions = tasks.filter((item) => item.status !== "done");
14450
14722
  const submit = async (event) => {
14451
14723
  event.preventDefault();
@@ -14473,79 +14745,79 @@ function TaskForm({ requirementId, companions, tasks, close, changed: changed2 }
14473
14745
  setBusy(false);
14474
14746
  }
14475
14747
  };
14476
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("form", { className: "dsh-partner-task-form", "aria-busy": busy, onSubmit: (event) => {
14748
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("form", { className: "dsh-partner-task-form", "aria-busy": busy, onSubmit: (event) => {
14477
14749
  void submit(event);
14478
14750
  }, children: [
14479
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { children: [
14480
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u4EFB\u52A1\u540D\u79F0" }),
14481
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("input", { name: "title", maxLength: 200, required: true, autoFocus: true, placeholder: "\u4E00\u53E5\u8BDD\u8BF4\u660E\u4EA4\u4ED8\u76EE\u6807" })
14751
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14752
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u4EFB\u52A1\u540D\u79F0" }),
14753
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("input", { name: "title", maxLength: 200, required: true, autoFocus: true, placeholder: "\u4E00\u53E5\u8BDD\u8BF4\u660E\u4EA4\u4ED8\u76EE\u6807" })
14482
14754
  ] }),
14483
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { children: [
14484
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
14485
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("select", { name: "assignee", defaultValue: "", children: [
14486
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
14487
- companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("option", { value: item.id, children: [
14755
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14756
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
14757
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { name: "assignee", defaultValue: "", children: [
14758
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
14759
+ companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: item.id, children: [
14488
14760
  "@",
14489
14761
  item.name
14490
14762
  ] }, item.id))
14491
14763
  ] })
14492
14764
  ] }),
14493
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "is-wide", children: [
14494
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
14495
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("textarea", { name: "description", maxLength: 8e3, rows: 5, placeholder: "\u8865\u5145\u80CC\u666F\u3001\u4EA4\u4ED8\u7269\u548C\u5B8C\u6210\u6761\u4EF6" })
14765
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "is-wide", children: [
14766
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
14767
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("textarea", { name: "description", maxLength: 8e3, rows: 5, placeholder: "\u8865\u5145\u80CC\u666F\u3001\u4EA4\u4ED8\u7269\u548C\u5B8C\u6210\u6761\u4EF6" })
14496
14768
  ] }),
14497
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "is-wide", children: [
14498
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u9A8C\u6536\u6E05\u5355 \xB7 \u53EF\u9009" }),
14499
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("textarea", { name: "acceptanceCriteria", rows: 3, maxLength: 1e4, placeholder: "\u6BCF\u884C\u4E00\u9879\u53EF\u6838\u9A8C\u4EA4\u4ED8\uFF0C\u6700\u591A 20 \u9879" })
14769
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "is-wide", children: [
14770
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u9A8C\u6536\u6E05\u5355 \xB7 \u53EF\u9009" }),
14771
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("textarea", { name: "acceptanceCriteria", rows: 3, maxLength: 1e4, placeholder: "\u6BCF\u884C\u4E00\u9879\u53EF\u6838\u9A8C\u4EA4\u4ED8\uFF0C\u6700\u591A 20 \u9879" })
14500
14772
  ] }),
14501
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "is-wide", children: [
14502
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u72EC\u5360\u8D44\u6E90 \xB7 \u53EF\u9009" }),
14503
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("textarea", { name: "resourceKeys", rows: 2, maxLength: 2400, placeholder: "\u6BCF\u884C\u4E00\u4E2A\u4E00\u81F4\u7684\u8D44\u6E90\u6807\u8BC6\uFF0C\u4F8B\u5982 repo:team/api\uFF1B\u76F8\u540C\u8D44\u6E90\u4E0D\u4F1A\u540C\u65F6\u6267\u884C" })
14773
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "is-wide", children: [
14774
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u72EC\u5360\u8D44\u6E90 \xB7 \u53EF\u9009" }),
14775
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("textarea", { name: "resourceKeys", rows: 2, maxLength: 2400, placeholder: "\u6BCF\u884C\u4E00\u4E2A\u4E00\u81F4\u7684\u8D44\u6E90\u6807\u8BC6\uFF0C\u4F8B\u5982 repo:team/api\uFF1B\u76F8\u540C\u8D44\u6E90\u4E0D\u4F1A\u540C\u65F6\u6267\u884C" })
14504
14776
  ] }),
14505
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { children: [
14506
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u4F18\u5148\u7EA7" }),
14507
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("select", { name: "priority", defaultValue: "normal", children: [
14508
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "low", children: "\u4F4E" }),
14509
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "normal", children: "\u666E\u901A" }),
14510
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "high", children: "\u9AD8" }),
14511
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "urgent", children: "\u7D27\u6025" })
14777
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14778
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u4F18\u5148\u7EA7" }),
14779
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { name: "priority", defaultValue: "normal", children: [
14780
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "low", children: "\u4F4E" }),
14781
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "normal", children: "\u666E\u901A" }),
14782
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "high", children: "\u9AD8" }),
14783
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "urgent", children: "\u7D27\u6025" })
14512
14784
  ] })
14513
14785
  ] }),
14514
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { children: [
14515
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
14516
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("select", { name: "reviewer", defaultValue: "", children: [
14517
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
14518
- companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("option", { value: item.id, children: [
14786
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14787
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
14788
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { name: "reviewer", defaultValue: "", children: [
14789
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
14790
+ companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: item.id, children: [
14519
14791
  "@",
14520
14792
  item.name
14521
14793
  ] }, item.id))
14522
14794
  ] })
14523
14795
  ] }),
14524
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "dsh-partner-task-form-dependencies is-wide", children: [
14525
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
14796
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "dsh-partner-task-form-dependencies is-wide", children: [
14797
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { children: [
14526
14798
  "\u4F9D\u8D56\u4EFB\u52A1 ",
14527
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: "\u53EF\u9009" })
14799
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("small", { children: "\u53EF\u9009" })
14528
14800
  ] }),
14529
- dependencyOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: dependencyOptions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { children: [
14530
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("input", { type: "checkbox", name: "dependencyTaskId", value: item.id }),
14531
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("i", {}),
14532
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: item.title }),
14533
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("small", { children: statusLabel(item.status) })
14534
- ] }, item.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { children: "\u5F53\u524D\u6CA1\u6709\u53EF\u9009\u7684\u672A\u5B8C\u6210\u4EFB\u52A1" }),
14535
- /* @__PURE__ */ (0, import_jsx_runtime31.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" })
14801
+ dependencyOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: dependencyOptions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14802
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("input", { type: "checkbox", name: "dependencyTaskId", value: item.id }),
14803
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", {}),
14804
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: item.title }),
14805
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("small", { children: statusLabel(item.status) })
14806
+ ] }, item.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: "\u5F53\u524D\u6CA1\u6709\u53EF\u9009\u7684\u672A\u5B8C\u6210\u4EFB\u52A1" }),
14807
+ /* @__PURE__ */ (0, import_jsx_runtime33.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" })
14536
14808
  ] }),
14537
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "is-wide", children: [
14538
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: "\u521B\u5EFA\u540E\u6267\u884C" }),
14539
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("select", { name: "submission", defaultValue: "run", children: [
14540
- /* @__PURE__ */ (0, import_jsx_runtime31.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" }),
14541
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "plan", children: "\u4EC5\u89C4\u5212\uFF0C\u7A0D\u540E\u624B\u52A8\u63D0\u4EA4" })
14809
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "is-wide", children: [
14810
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u521B\u5EFA\u540E\u6267\u884C" }),
14811
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { name: "submission", defaultValue: "run", children: [
14812
+ /* @__PURE__ */ (0, import_jsx_runtime33.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" }),
14813
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "plan", children: "\u4EC5\u89C4\u5212\uFF0C\u7A0D\u540E\u624B\u52A8\u63D0\u4EA4" })
14542
14814
  ] })
14543
14815
  ] }),
14544
- error && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(WorkspaceNotice, { children: error }),
14545
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("footer", { children: [
14546
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
14547
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
14548
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives14.IconPlusOutline16, { size: 14 }),
14816
+ error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WorkspaceNotice, { children: error }),
14817
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("footer", { children: [
14818
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
14819
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
14820
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives15.IconPlusOutline16, { size: 14 }),
14549
14821
  busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u4EFB\u52A1"
14550
14822
  ] })
14551
14823
  ] })
@@ -14583,15 +14855,15 @@ function delegationState(value, blockers = 0) {
14583
14855
  }
14584
14856
 
14585
14857
  // src/ui/requirement-board.tsx
14586
- var import_jsx_runtime32 = require("react/jsx-runtime");
14858
+ var import_jsx_runtime34 = require("react/jsx-runtime");
14587
14859
  function RequirementBoard({ initialTaskId, openRequest } = {}) {
14588
- const [board, setBoard] = (0, import_react35.useState)({ tasks: [], activities: [], requirements: [] });
14589
- const [directory, setDirectory] = (0, import_react35.useState)([]);
14590
- const [loading, setLoading] = (0, import_react35.useState)(true), [error, setError] = (0, import_react35.useState)();
14591
- const [selected, setSelected] = (0, import_react35.useState)(), [detailId, setDetailId] = (0, import_react35.useState)();
14592
- const [creating, setCreating] = (0, import_react35.useState)(false), [archived, setArchived] = (0, import_react35.useState)(false);
14593
- const [query, setQuery] = (0, import_react35.useState)(""), [limit, setLimit] = (0, import_react35.useState)(24);
14594
- (0, import_react35.useEffect)(() => {
14860
+ const [board, setBoard] = (0, import_react37.useState)({ tasks: [], activities: [], requirements: [] });
14861
+ const [directory, setDirectory] = (0, import_react37.useState)([]);
14862
+ const [loading, setLoading] = (0, import_react37.useState)(true), [error, setError] = (0, import_react37.useState)();
14863
+ const [selected, setSelected] = (0, import_react37.useState)(), [detailId, setDetailId] = (0, import_react37.useState)();
14864
+ const [creating, setCreating] = (0, import_react37.useState)(false), [archived, setArchived] = (0, import_react37.useState)(false);
14865
+ const [query, setQuery] = (0, import_react37.useState)(""), [limit, setLimit] = (0, import_react37.useState)(24);
14866
+ (0, import_react37.useEffect)(() => {
14595
14867
  if (initialTaskId) {
14596
14868
  setSelected(void 0);
14597
14869
  setDetailId(void 0);
@@ -14612,7 +14884,7 @@ function RequirementBoard({ initialTaskId, openRequest } = {}) {
14612
14884
  setLoading(false);
14613
14885
  }, !selected);
14614
14886
  const requirements = board.requirements ?? [];
14615
- const groups = (0, import_react35.useMemo)(() => {
14887
+ const groups = (0, import_react37.useMemo)(() => {
14616
14888
  const result = /* @__PURE__ */ new Map();
14617
14889
  for (const task of board.tasks) {
14618
14890
  const id = task.requirementId ?? "legacy";
@@ -14624,110 +14896,110 @@ function RequirementBoard({ initialTaskId, openRequest } = {}) {
14624
14896
  }, [board.tasks]);
14625
14897
  const visible = requirements.filter((r) => r.status === "done" === archived && [r.title, r.description, directory.find((c) => c.id === r.ownerCompanionId)?.name].some((v) => v?.toLocaleLowerCase().includes(query.trim().toLocaleLowerCase()))).sort((a, b) => b.updatedAt - a.updatedAt);
14626
14898
  const detail = requirements.find((r) => r.id === detailId);
14627
- if (selected) return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(RequirementTasksPanel, { requirementId: selected, back: () => {
14899
+ if (selected) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RequirementTasksPanel, { requirementId: selected, back: () => {
14628
14900
  setSelected(void 0);
14629
14901
  void load2();
14630
14902
  } }, selected);
14631
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "dsh-partner-feature-page is-board", children: [
14632
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(WorkspaceHero, { eyebrow: "Shared workspace", title: "\u9700\u6C42\u770B\u677F", detail: "\u6309\u9700\u6C42\u7EC4\u7EC7\u5DE5\u4F5C\uFF0C\u5B50\u4EFB\u52A1\u72EC\u7ACB\u63A8\u8FDB\uFF0C\u6574\u4F53\u5B8C\u6210\u540E\u7EDF\u4E00\u6C47\u603B\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("button", { type: "button", onClick: () => setCreating(true), children: [
14633
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_dsh_client_ui_primitives15.IconPlusOutline16, { size: 15 }),
14903
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "dsh-partner-feature-page is-board", children: [
14904
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(WorkspaceHero, { eyebrow: "Shared workspace", title: "\u9700\u6C42\u770B\u677F", detail: "\u6309\u9700\u6C42\u7EC4\u7EC7\u5DE5\u4F5C\uFF0C\u5B50\u4EFB\u52A1\u72EC\u7ACB\u63A8\u8FDB\uFF0C\u6574\u4F53\u5B8C\u6210\u540E\u7EDF\u4E00\u6C47\u603B\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("button", { type: "button", onClick: () => setCreating(true), children: [
14905
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_dsh_client_ui_primitives16.IconPlusOutline16, { size: 15 }),
14634
14906
  "\u65B0\u9700\u6C42"
14635
14907
  ] }) }),
14636
- error && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(WorkspaceNotice, { children: [
14908
+ error && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(WorkspaceNotice, { children: [
14637
14909
  error,
14638
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", onClick: () => {
14910
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { type: "button", onClick: () => {
14639
14911
  void load2();
14640
14912
  }, children: "\u91CD\u8BD5" })
14641
14913
  ] }),
14642
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "dsh-partner-requirement-toolbar", children: [
14643
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("nav", { className: "dsh-partner-board-statuses", "aria-label": "\u9700\u6C42\u8303\u56F4", children: [false, true].map((value) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("button", { type: "button", "aria-pressed": archived === value, className: archived === value ? "is-active" : "", onClick: () => {
14914
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "dsh-partner-requirement-toolbar", children: [
14915
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("nav", { className: "dsh-partner-board-statuses", "aria-label": "\u9700\u6C42\u8303\u56F4", children: [false, true].map((value) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("button", { type: "button", "aria-pressed": archived === value, className: archived === value ? "is-active" : "", onClick: () => {
14644
14916
  setArchived(value);
14645
14917
  setLimit(24);
14646
14918
  }, children: [
14647
14919
  value ? "\u5DF2\u5F52\u6863" : "\u8FDB\u884C\u4E2D",
14648
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("b", { children: requirements.filter((r) => r.status === "done" === value).length })
14920
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("b", { children: requirements.filter((r) => r.status === "done" === value).length })
14649
14921
  ] }, String(value))) }),
14650
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "dsh-partner-board-search", children: [
14651
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u9700\u6C42" }),
14652
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_dsh_client_ui_primitives15.IconSearchOutline16, { size: 16 }) }),
14653
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("input", { placeholder: "\u641C\u7D22\u9700\u6C42\u6216\u8D1F\u8D23\u4EBA", value: query, onChange: (event) => {
14922
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "dsh-partner-board-search", children: [
14923
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u9700\u6C42" }),
14924
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_dsh_client_ui_primitives16.IconSearchOutline16, { size: 16 }) }),
14925
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("input", { placeholder: "\u641C\u7D22\u9700\u6C42\u6216\u8D1F\u8D23\u4EBA", value: query, onChange: (event) => {
14654
14926
  setQuery(event.target.value);
14655
14927
  setLimit(24);
14656
14928
  } })
14657
14929
  ] })
14658
14930
  ] }),
14659
- loading ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CollectionSkeleton, { rows: 4 }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
14660
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "dsh-partner-requirement-grid", children: visible.slice(0, limit).map((item) => {
14931
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CollectionSkeleton, { rows: 4 }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
14932
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "dsh-partner-requirement-grid", children: visible.slice(0, limit).map((item) => {
14661
14933
  const tasks = groups.get(item.id) ?? [], total = item.status === "done" ? item.results?.length ?? tasks.length : tasks.length;
14662
14934
  const done = item.status === "done" ? total : tasks.filter((t) => t.status === "done").length;
14663
14935
  const blocked = tasks.filter((t) => t.status === "blocked").length;
14664
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("article", { className: "dsh-partner-requirement-card", children: [
14665
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("button", { type: "button", className: "dsh-partner-requirement-open", onClick: () => item.status === "done" ? setDetailId(item.id) : setSelected(item.id), children: [
14666
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "dsh-partner-requirement-meta", children: [
14667
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: requirementStatus(item) }),
14668
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("small", { children: directory.find((c) => c.id === item.ownerCompanionId)?.name ?? "\u4EBA\u5DE5\u6536\u5C3E" })
14936
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("article", { className: "dsh-partner-requirement-card", children: [
14937
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("button", { type: "button", className: "dsh-partner-requirement-open", onClick: () => item.status === "done" ? setDetailId(item.id) : setSelected(item.id), children: [
14938
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "dsh-partner-requirement-meta", children: [
14939
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: requirementStatus(item) }),
14940
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("small", { children: directory.find((c) => c.id === item.ownerCompanionId)?.name ?? "\u4EBA\u5DE5\u6536\u5C3E" })
14669
14941
  ] }),
14670
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("strong", { title: item.title, children: item.title }),
14671
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { children: item.summary || item.description || "\u5C1A\u672A\u8865\u5145\u9700\u6C42\u8BF4\u660E" }),
14672
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "dsh-partner-requirement-progress", role: "progressbar", "aria-label": "\u5B50\u4EFB\u52A1\u9A8C\u6536\u8FDB\u5EA6", "aria-valuemin": 0, "aria-valuemax": Math.max(total, 1), "aria-valuenow": done, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("i", { style: { width: `${total ? done / total * 100 : 0}%` } }) }),
14673
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "dsh-partner-requirement-meta", children: [
14674
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("small", { children: [
14942
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { title: item.title, children: item.title }),
14943
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { children: item.summary || item.description || "\u5C1A\u672A\u8865\u5145\u9700\u6C42\u8BF4\u660E" }),
14944
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "dsh-partner-requirement-progress", role: "progressbar", "aria-label": "\u5B50\u4EFB\u52A1\u9A8C\u6536\u8FDB\u5EA6", "aria-valuemin": 0, "aria-valuemax": Math.max(total, 1), "aria-valuenow": done, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("i", { style: { width: `${total ? done / total * 100 : 0}%` } }) }),
14945
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "dsh-partner-requirement-meta", children: [
14946
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("small", { children: [
14675
14947
  done,
14676
14948
  " / ",
14677
14949
  total,
14678
14950
  " \u5DF2\u9A8C\u6536",
14679
14951
  blocked ? ` \xB7 ${blocked} \u53D7\u963B` : ""
14680
14952
  ] }),
14681
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_dsh_client_ui_primitives15.IconChevronRightOutline14, { size: 14 })
14953
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_dsh_client_ui_primitives16.IconChevronRightOutline14, { size: 14 })
14682
14954
  ] })
14683
14955
  ] }),
14684
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("footer", { children: [
14685
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("small", { children: [
14956
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("footer", { children: [
14957
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("small", { children: [
14686
14958
  new Date(item.updatedAt).toLocaleDateString(),
14687
14959
  " \u66F4\u65B0"
14688
14960
  ] }),
14689
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { type: "button", onClick: () => setDetailId(item.id), "aria-haspopup": "dialog", children: item.lastError ? "\u67E5\u770B\u5F02\u5E38" : "\u9700\u6C42\u8BE6\u60C5" })
14961
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { type: "button", onClick: () => setDetailId(item.id), "aria-haspopup": "dialog", children: item.lastError ? "\u67E5\u770B\u5F02\u5E38" : "\u9700\u6C42\u8BE6\u60C5" })
14690
14962
  ] })
14691
14963
  ] }, item.id);
14692
14964
  }) }),
14693
- !visible.length && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "dsh-partner-collection-empty", children: [
14694
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("strong", { children: query ? "\u6CA1\u6709\u5339\u914D\u7684\u9700\u6C42" : archived ? "\u8FD8\u6CA1\u6709\u5F52\u6863\u9700\u6C42" : "\u4ECE\u4E00\u4E2A\u9700\u6C42\u5F00\u59CB" }),
14695
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { children: archived ? "\u5B50\u4EFB\u52A1\u5168\u90E8\u9A8C\u6536\u901A\u8FC7\u3001\u5B8C\u6210\u603B\u7ED3\u540E\uFF0C\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002" : "\u5148\u5199\u6E05\u4EA4\u4ED8\u76EE\u6807\uFF0C\u518D\u5B89\u6392\u8D1F\u8D23\u4EBA\u548C\u5B50\u4EFB\u52A1\u3002" })
14965
+ !visible.length && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "dsh-partner-collection-empty", children: [
14966
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { children: query ? "\u6CA1\u6709\u5339\u914D\u7684\u9700\u6C42" : archived ? "\u8FD8\u6CA1\u6709\u5F52\u6863\u9700\u6C42" : "\u4ECE\u4E00\u4E2A\u9700\u6C42\u5F00\u59CB" }),
14967
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { children: archived ? "\u5B50\u4EFB\u52A1\u5168\u90E8\u9A8C\u6536\u901A\u8FC7\u3001\u5B8C\u6210\u603B\u7ED3\u540E\uFF0C\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002" : "\u5148\u5199\u6E05\u4EA4\u4ED8\u76EE\u6807\uFF0C\u518D\u5B89\u6392\u8D1F\u8D23\u4EBA\u548C\u5B50\u4EFB\u52A1\u3002" })
14696
14968
  ] }),
14697
- visible.length > limit && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("button", { type: "button", onClick: () => setLimit((n) => n + 24), children: [
14969
+ visible.length > limit && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("button", { type: "button", onClick: () => setLimit((n) => n + 24), children: [
14698
14970
  "\u663E\u793A\u66F4\u591A\u9700\u6C42 \xB7 \u8FD8\u6709 ",
14699
14971
  visible.length - limit,
14700
14972
  " \u9879"
14701
14973
  ] }),
14702
- !archived && Boolean(groups.get("legacy")?.length) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("button", { type: "button", className: "dsh-partner-requirement-legacy", onClick: () => setSelected("legacy"), children: [
14974
+ !archived && Boolean(groups.get("legacy")?.length) && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("button", { type: "button", className: "dsh-partner-requirement-legacy", onClick: () => setSelected("legacy"), children: [
14703
14975
  "\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1 ",
14704
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("b", { children: groups.get("legacy").length }),
14705
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: "\u4FDD\u7559\u539F\u8BB0\u5F55\uFF0C\u4E0D\u81EA\u52A8\u5408\u5E76" }),
14706
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_dsh_client_ui_primitives15.IconChevronRightOutline14, { size: 14 })
14976
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("b", { children: groups.get("legacy").length }),
14977
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: "\u4FDD\u7559\u539F\u8BB0\u5F55\uFF0C\u4E0D\u81EA\u52A8\u5408\u5E76" }),
14978
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_dsh_client_ui_primitives16.IconChevronRightOutline14, { size: 14 })
14707
14979
  ] })
14708
14980
  ] }),
14709
- creating && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u9700\u6C42", detail: "\u4E00\u4E2A\u9700\u6C42\u5BF9\u5E94\u4E00\u4EFD\u6700\u7EC8\u4EA4\u4ED8\uFF0C\u7531\u8D1F\u8D23\u4EBA\u7EDF\u4E00\u6536\u5C3E\u3002", close: () => setCreating(false), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(RequirementForm, { directory, close: () => setCreating(false), created: async (item) => {
14981
+ creating && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u9700\u6C42", detail: "\u4E00\u4E2A\u9700\u6C42\u5BF9\u5E94\u4E00\u4EFD\u6700\u7EC8\u4EA4\u4ED8\uFF0C\u7531\u8D1F\u8D23\u4EBA\u7EDF\u4E00\u6536\u5C3E\u3002", close: () => setCreating(false), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RequirementForm, { directory, close: () => setCreating(false), created: async (item) => {
14710
14982
  setCreating(false);
14711
14983
  await load2();
14712
14984
  setSelected(item.id);
14713
14985
  } }) }),
14714
- detail && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(WorkspaceDialog, { title: detail.title, eyebrow: "\u9700\u6C42\u8BE6\u60C5", detail: requirementStatus(detail), close: () => setDetailId(void 0), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(RequirementDetail, { item: detail, tasks: groups.get(detail.id) ?? [], directory, changed: load2, close: () => setDetailId(void 0) }, detail.id) }),
14715
- initialTaskId && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(RequirementTasksPanel, { initialTaskId, openRequest, detailOnly: true })
14986
+ detail && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(WorkspaceDialog, { title: detail.title, eyebrow: "\u9700\u6C42\u8BE6\u60C5", detail: requirementStatus(detail), close: () => setDetailId(void 0), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RequirementDetail, { item: detail, tasks: groups.get(detail.id) ?? [], directory, changed: load2, close: () => setDetailId(void 0) }, detail.id) }),
14987
+ initialTaskId && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RequirementTasksPanel, { initialTaskId, openRequest, detailOnly: true })
14716
14988
  ] });
14717
14989
  }
14718
14990
 
14719
14991
  // src/ui/schedule-panel.tsx
14720
- var import_react36 = require("react");
14721
- var import_dsh_client_ui_primitives16 = require("@deepseek-ai/dsh-client-ui-primitives");
14722
- var import_jsx_runtime33 = require("react/jsx-runtime");
14992
+ var import_react38 = require("react");
14993
+ var import_dsh_client_ui_primitives17 = require("@deepseek-ai/dsh-client-ui-primitives");
14994
+ var import_jsx_runtime35 = require("react/jsx-runtime");
14723
14995
  function SchedulePanel({ companions }) {
14724
- const [schedules, setSchedules] = (0, import_react36.useState)([]);
14725
- const [runs, setRuns] = (0, import_react36.useState)([]);
14726
- const [creating, setCreating] = (0, import_react36.useState)(false);
14727
- const [busy, setBusy] = (0, import_react36.useState)();
14728
- const [loading, setLoading] = (0, import_react36.useState)(true);
14729
- const [error, setError] = (0, import_react36.useState)();
14730
- const load2 = (0, import_react36.useCallback)(async () => {
14996
+ const [schedules, setSchedules] = (0, import_react38.useState)([]);
14997
+ const [runs, setRuns] = (0, import_react38.useState)([]);
14998
+ const [creating, setCreating] = (0, import_react38.useState)(false);
14999
+ const [busy, setBusy] = (0, import_react38.useState)();
15000
+ const [loading, setLoading] = (0, import_react38.useState)(true);
15001
+ const [error, setError] = (0, import_react38.useState)();
15002
+ const load2 = (0, import_react38.useCallback)(async () => {
14731
15003
  try {
14732
15004
  const value = await api("/schedules");
14733
15005
  setSchedules(value.schedules);
@@ -14739,7 +15011,7 @@ function SchedulePanel({ companions }) {
14739
15011
  setLoading(false);
14740
15012
  }
14741
15013
  }, []);
14742
- (0, import_react36.useEffect)(() => {
15014
+ (0, import_react38.useEffect)(() => {
14743
15015
  void load2();
14744
15016
  }, [load2]);
14745
15017
  const update = async (entry, value) => {
@@ -14775,65 +15047,65 @@ function SchedulePanel({ companions }) {
14775
15047
  setBusy(void 0);
14776
15048
  }
14777
15049
  };
14778
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "dsh-partner-feature-page", children: [
14779
- /* @__PURE__ */ (0, import_jsx_runtime33.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_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
14780
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { type: "button", disabled: loading, onClick: () => {
15050
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "dsh-partner-feature-page", children: [
15051
+ /* @__PURE__ */ (0, import_jsx_runtime35.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_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
15052
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { type: "button", disabled: loading, onClick: () => {
14781
15053
  void load2();
14782
15054
  }, children: [
14783
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives16.IconRefreshOutline16, { size: 15 }),
15055
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_dsh_client_ui_primitives17.IconRefreshOutline16, { size: 15 }),
14784
15056
  "\u5237\u65B0"
14785
15057
  ] }),
14786
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
14787
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives16.IconPlusOutline16, { size: 15 }),
15058
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
15059
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_dsh_client_ui_primitives17.IconPlusOutline16, { size: 15 }),
14788
15060
  "\u65B0\u8BA1\u5212"
14789
15061
  ] })
14790
15062
  ] }) }),
14791
- error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WorkspaceNotice, { children: error }),
14792
- creating && /* @__PURE__ */ (0, import_jsx_runtime33.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_runtime33.jsx)(ScheduleForm, { companions, close: () => setCreating(false), changed: load2 }) }),
14793
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WorkspaceBlock, { title: "\u6267\u884C\u8BA1\u5212", detail: `${schedules.filter((item) => item.enabled).length} \u4E2A\u542F\u7528`, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CollectionSkeleton, { rows: 3 }) : schedules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.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_runtime33.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
14794
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives16.IconPlusOutline16, { size: 14 }),
15063
+ error && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(WorkspaceNotice, { children: error }),
15064
+ creating && /* @__PURE__ */ (0, import_jsx_runtime35.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_runtime35.jsx)(ScheduleForm, { companions, close: () => setCreating(false), changed: load2 }) }),
15065
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(WorkspaceBlock, { title: "\u6267\u884C\u8BA1\u5212", detail: `${schedules.filter((item) => item.enabled).length} \u4E2A\u542F\u7528`, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CollectionSkeleton, { rows: 3 }) : schedules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.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_runtime35.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
15066
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_dsh_client_ui_primitives17.IconPlusOutline16, { size: 14 }),
14795
15067
  "\u521B\u5EFA\u7B2C\u4E00\u4E2A\u8BA1\u5212"
14796
- ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "dsh-partner-schedule-list", children: schedules.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("article", { children: [
14797
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { children: [
14798
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: entry.title }),
14799
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: entry.prompt }),
14800
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "dsh-partner-schedule-meta", children: [
14801
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("em", { children: [
15068
+ ] }) }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "dsh-partner-schedule-list", children: schedules.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("article", { children: [
15069
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { children: [
15070
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("strong", { children: entry.title }),
15071
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: entry.prompt }),
15072
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "dsh-partner-schedule-meta", children: [
15073
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("em", { children: [
14802
15074
  "@",
14803
15075
  companionName(companions, entry.companionId)
14804
15076
  ] }),
14805
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("em", { children: scheduleLabel(entry) }),
14806
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("em", { children: [
15077
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("em", { children: scheduleLabel(entry) }),
15078
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("em", { children: [
14807
15079
  "\u4E0B\u6B21 ",
14808
15080
  new Date(entry.nextRunAt).toLocaleString()
14809
15081
  ] }),
14810
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("em", { children: entry.destroySessionAfterRun ? "\u6267\u884C\u540E\u9500\u6BC1" : "\u4FDD\u7559\u4F1A\u8BDD" })
15082
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("em", { children: entry.destroySessionAfterRun ? "\u6267\u884C\u540E\u9500\u6BC1" : "\u4FDD\u7559\u4F1A\u8BDD" })
14811
15083
  ] })
14812
15084
  ] }),
14813
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", className: "dsh-partner-feature-switch", "data-on": entry.enabled, "aria-pressed": entry.enabled, disabled: busy === entry.id, onClick: () => {
15085
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("button", { type: "button", className: "dsh-partner-feature-switch", "data-on": entry.enabled, "aria-pressed": entry.enabled, disabled: busy === entry.id, onClick: () => {
14814
15086
  void update(entry, { enabled: !entry.enabled });
14815
- }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", {}) }),
14816
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { type: "button", disabled: busy === entry.id, onClick: () => {
15087
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", {}) }),
15088
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { type: "button", disabled: busy === entry.id, onClick: () => {
14817
15089
  void run(entry);
14818
15090
  }, children: [
14819
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives16.IconPlayOutline16, { size: 14 }),
15091
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_dsh_client_ui_primitives17.IconPlayOutline16, { size: 14 }),
14820
15092
  busy === entry.id ? "\u6267\u884C\u4E2D\u2026" : "\u7ACB\u5373\u6267\u884C"
14821
15093
  ] }),
14822
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", className: "is-icon", disabled: busy === entry.id, onClick: () => {
15094
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("button", { type: "button", className: "is-icon", disabled: busy === entry.id, onClick: () => {
14823
15095
  void remove(entry);
14824
- }, "aria-label": `\u5220\u9664 ${entry.title}`, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives16.IconTrashOutline16, { size: 14 }) })
15096
+ }, "aria-label": `\u5220\u9664 ${entry.title}`, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_dsh_client_ui_primitives17.IconTrashOutline16, { size: 14 }) })
14825
15097
  ] }, entry.id)) }) }),
14826
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(WorkspaceBlock, { title: "\u6700\u8FD1\u8FD0\u884C", detail: "\u4FDD\u7559\u6700\u8FD1\u7684\u72B6\u6001\u4E0E\u7ED3\u679C\u6458\u8981", children: [
14827
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "dsh-partner-run-list", children: runs.map((run2) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("article", { "data-status": run2.status, children: [
14828
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", {}),
14829
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { children: [
14830
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("strong", { children: [
15098
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(WorkspaceBlock, { title: "\u6700\u8FD1\u8FD0\u884C", detail: "\u4FDD\u7559\u6700\u8FD1\u7684\u72B6\u6001\u4E0E\u7ED3\u679C\u6458\u8981", children: [
15099
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "dsh-partner-run-list", children: runs.map((run2) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("article", { "data-status": run2.status, children: [
15100
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", {}),
15101
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { children: [
15102
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("strong", { children: [
14831
15103
  schedules.find((item) => item.id === run2.sourceId)?.title ?? "\u5DF2\u5220\u9664\u8BA1\u5212",
14832
15104
  " \xB7 @",
14833
15105
  companionName(companions, run2.ownerCompanionId)
14834
15106
  ] }),
14835
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: run2.error || run2.outputSummary || "\u7B49\u5F85\u7ED3\u679C" }),
14836
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("small", { children: [
15107
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: run2.error || run2.outputSummary || "\u7B49\u5F85\u7ED3\u679C" }),
15108
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("small", { children: [
14837
15109
  new Date(run2.startedAt).toLocaleString(),
14838
15110
  " \xB7 ",
14839
15111
  run2.status,
@@ -14842,14 +15114,14 @@ function SchedulePanel({ companions }) {
14842
15114
  ] })
14843
15115
  ] })
14844
15116
  ] }, run2.id)) }),
14845
- !loading && runs.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime33.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" })
15117
+ !loading && runs.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime35.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" })
14846
15118
  ] })
14847
15119
  ] });
14848
15120
  }
14849
15121
  function ScheduleForm({ companions, close, changed: changed2 }) {
14850
- const [kind, setKind] = (0, import_react36.useState)("interval");
14851
- const [error, setError] = (0, import_react36.useState)();
14852
- const [busy, setBusy] = (0, import_react36.useState)(false);
15122
+ const [kind, setKind] = (0, import_react38.useState)("interval");
15123
+ const [error, setError] = (0, import_react38.useState)();
15124
+ const [busy, setBusy] = (0, import_react38.useState)(false);
14853
15125
  const submit = async (event) => {
14854
15126
  event.preventDefault();
14855
15127
  const data = new FormData(event.currentTarget);
@@ -14866,18 +15138,18 @@ function ScheduleForm({ companions, close, changed: changed2 }) {
14866
15138
  setBusy(false);
14867
15139
  }
14868
15140
  };
14869
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("form", { className: "dsh-partner-schedule-form", "aria-busy": busy, onSubmit: (event) => {
15141
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("form", { className: "dsh-partner-schedule-form", "aria-busy": busy, onSubmit: (event) => {
14870
15142
  void submit(event);
14871
15143
  }, children: [
14872
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14873
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u8BA1\u5212\u540D\u79F0" }),
14874
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("input", { name: "title", required: true, maxLength: 160, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u6BCF\u65E5\u6574\u7406\u9879\u76EE\u53D8\u5316" })
15144
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
15145
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u8BA1\u5212\u540D\u79F0" }),
15146
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { name: "title", required: true, maxLength: 160, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u6BCF\u65E5\u6574\u7406\u9879\u76EE\u53D8\u5316" })
14875
15147
  ] }),
14876
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14877
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u6267\u884C\u4F19\u4F34" }),
14878
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { name: "companionId", required: true, defaultValue: companions[0]?.id ?? "", children: [
14879
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "", disabled: true, children: "\u9009\u62E9\u4F19\u4F34" }),
14880
- companions.map((companion) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: companion.id, children: [
15148
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
15149
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u6267\u884C\u4F19\u4F34" }),
15150
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("select", { name: "companionId", required: true, defaultValue: companions[0]?.id ?? "", children: [
15151
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "", disabled: true, children: "\u9009\u62E9\u4F19\u4F34" }),
15152
+ companions.map((companion) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("option", { value: companion.id, children: [
14881
15153
  "@",
14882
15154
  companion.name,
14883
15155
  " \xB7 ",
@@ -14885,51 +15157,51 @@ function ScheduleForm({ companions, close, changed: changed2 }) {
14885
15157
  ] }, companion.id))
14886
15158
  ] })
14887
15159
  ] }),
14888
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "is-wide", children: [
14889
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u6267\u884C\u5185\u5BB9" }),
14890
- /* @__PURE__ */ (0, import_jsx_runtime33.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" })
15160
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "is-wide", children: [
15161
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u6267\u884C\u5185\u5BB9" }),
15162
+ /* @__PURE__ */ (0, import_jsx_runtime35.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" })
14891
15163
  ] }),
14892
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14893
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u9891\u7387" }),
14894
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { value: kind, onChange: (event) => setKind(event.target.value), children: [
14895
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "interval", children: "\u6BCF\u9694\u4E00\u6BB5\u65F6\u95F4" }),
14896
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "daily", children: "\u6BCF\u5929\u56FA\u5B9A\u65F6\u95F4" })
15164
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
15165
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u9891\u7387" }),
15166
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("select", { value: kind, onChange: (event) => setKind(event.target.value), children: [
15167
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "interval", children: "\u6BCF\u9694\u4E00\u6BB5\u65F6\u95F4" }),
15168
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "daily", children: "\u6BCF\u5929\u56FA\u5B9A\u65F6\u95F4" })
14897
15169
  ] })
14898
15170
  ] }),
14899
- kind === "interval" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14900
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u95F4\u9694\u5206\u949F" }),
14901
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("input", { name: "minutes", type: "number", min: 5, max: 43200, defaultValue: 60 })
14902
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "dsh-partner-schedule-time", children: [
14903
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14904
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u5C0F\u65F6" }),
14905
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("input", { name: "hour", type: "number", min: 0, max: 23, defaultValue: 9 })
15171
+ kind === "interval" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
15172
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u95F4\u9694\u5206\u949F" }),
15173
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { name: "minutes", type: "number", min: 5, max: 43200, defaultValue: 60 })
15174
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "dsh-partner-schedule-time", children: [
15175
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
15176
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u5C0F\u65F6" }),
15177
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { name: "hour", type: "number", min: 0, max: 23, defaultValue: 9 })
14906
15178
  ] }),
14907
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14908
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u5206\u949F" }),
14909
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("input", { name: "minute", type: "number", min: 0, max: 59, defaultValue: 0 })
15179
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
15180
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u5206\u949F" }),
15181
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { name: "minute", type: "number", min: 0, max: 59, defaultValue: 0 })
14910
15182
  ] })
14911
15183
  ] }),
14912
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14913
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u91CD\u53E0\u7B56\u7565" }),
14914
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { name: "overlapPolicy", defaultValue: "skip", children: [
14915
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "skip", children: "\u8DF3\u8FC7\u91CD\u53E0" }),
14916
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "queue", children: "\u6392\u961F\u6267\u884C" })
15184
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
15185
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u91CD\u53E0\u7B56\u7565" }),
15186
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("select", { name: "overlapPolicy", defaultValue: "skip", children: [
15187
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "skip", children: "\u8DF3\u8FC7\u91CD\u53E0" }),
15188
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "queue", children: "\u6392\u961F\u6267\u884C" })
14917
15189
  ] })
14918
15190
  ] }),
14919
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
14920
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u8D85\u65F6\u5206\u949F" }),
14921
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("input", { name: "timeoutMinutes", type: "number", min: 1, max: 120, defaultValue: 10 })
15191
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
15192
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u8D85\u65F6\u5206\u949F" }),
15193
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { name: "timeoutMinutes", type: "number", min: 1, max: 120, defaultValue: 10 })
14922
15194
  ] }),
14923
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "dsh-partner-check is-wide", children: [
14924
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("input", { name: "retain", type: "checkbox" }),
14925
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", {}),
14926
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u6267\u884C\u540E\u4FDD\u7559\u4E34\u65F6\u4F1A\u8BDD" })
15195
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "dsh-partner-check is-wide", children: [
15196
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { name: "retain", type: "checkbox" }),
15197
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", {}),
15198
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u6267\u884C\u540E\u4FDD\u7559\u4E34\u65F6\u4F1A\u8BDD" })
14927
15199
  ] }),
14928
- error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WorkspaceNotice, { children: error }),
14929
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("footer", { children: [
14930
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
14931
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
14932
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives16.IconPlusOutline16, { size: 14 }),
15200
+ error && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(WorkspaceNotice, { children: error }),
15201
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("footer", { children: [
15202
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
15203
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
15204
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_dsh_client_ui_primitives17.IconPlusOutline16, { size: 14 }),
14933
15205
  busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u8BA1\u5212"
14934
15206
  ] })
14935
15207
  ] })
@@ -14943,14 +15215,15 @@ function companionName(companions, id) {
14943
15215
  }
14944
15216
 
14945
15217
  // src/ui/capability-editor.tsx
14946
- var import_react38 = require("react");
14947
- var import_dsh_client_ui_primitives18 = require("@deepseek-ai/dsh-client-ui-primitives");
15218
+ var import_react42 = require("react");
15219
+ var import_dsh_client_ui_primitives20 = require("@deepseek-ai/dsh-client-ui-primitives");
14948
15220
 
14949
15221
  // src/capabilities.ts
14950
- var COMPANION_CAPABILITIES = ["knowledge", "skills", "ssh", "git", "companions", "schedules", "access", "administration"];
15222
+ var COMPANION_CAPABILITIES = ["knowledge", "skills", "mcp", "ssh", "git", "companions", "schedules", "access", "administration"];
14951
15223
  var CAPABILITY_LABELS = {
14952
15224
  knowledge: "\u77E5\u8BC6\u5E93",
14953
15225
  skills: "Skill",
15226
+ mcp: "MCP",
14954
15227
  ssh: "SSH",
14955
15228
  git: "Git",
14956
15229
  companions: "\u521B\u5EFA\u4F19\u4F34",
@@ -14962,15 +15235,114 @@ function isCompanionCapability(value) {
14962
15235
  return COMPANION_CAPABILITIES.includes(value);
14963
15236
  }
14964
15237
 
15238
+ // src/ui/capability-resources.tsx
15239
+ var import_react41 = require("react");
15240
+
15241
+ // src/ui/mcp-capabilities.tsx
15242
+ var import_react39 = require("react");
15243
+ var import_dsh_client_ui_primitives18 = require("@deepseek-ai/dsh-client-ui-primitives");
15244
+ var import_jsx_runtime36 = require("react/jsx-runtime");
15245
+ function CompanionMcpSettings({ companionId, embedded = false, onBusyChange }) {
15246
+ const [catalog, setCatalog] = (0, import_react39.useState)({ servers: [], bindings: [] });
15247
+ const [selecting, setSelecting] = (0, import_react39.useState)(false);
15248
+ const [showAll, setShowAll] = (0, import_react39.useState)(false);
15249
+ const [query, setQuery] = (0, import_react39.useState)("");
15250
+ const [busy, setBusy] = (0, import_react39.useState)(false);
15251
+ const [error, setError] = (0, import_react39.useState)("");
15252
+ const [notice, setNotice] = (0, import_react39.useState)("");
15253
+ const load2 = (0, import_react39.useCallback)(async () => {
15254
+ try {
15255
+ setCatalog(await api("/mcp"));
15256
+ setError("");
15257
+ } catch (reason) {
15258
+ setError(errorMessage(reason));
15259
+ }
15260
+ }, []);
15261
+ (0, import_react39.useEffect)(() => {
15262
+ void load2();
15263
+ }, [load2]);
15264
+ const ids = new Set(catalog.bindings.filter((b) => b.companionId === companionId).map((b) => b.serverId));
15265
+ const authorized = catalog.servers.filter((s) => ids.has(s.id));
15266
+ const toggle = async (serverId, enabled) => {
15267
+ if (busy) return;
15268
+ onBusyChange?.(true);
15269
+ setBusy(true);
15270
+ setError("");
15271
+ setNotice("");
15272
+ try {
15273
+ setCatalog(await api("/mcp/bindings", { method: "POST", body: JSON.stringify({ companionId, serverId, enabled }) }));
15274
+ setNotice(enabled ? "\u5DF2\u6388\u6743\uFF0C\u4E0B\u4E00\u8F6E\u5BF9\u8BDD\u751F\u6548\uFF0C\u65E0\u9700\u65B0\u5EFA\u4F1A\u8BDD\u3002" : "\u6388\u6743\u5DF2\u79FB\u9664\uFF0C\u7ACB\u5373\u963B\u6B62\u65B0\u7684\u8C03\u7528\uFF0C\u4E0B\u4E00\u8F6E\u79FB\u9664\u5DE5\u5177\u5217\u8868\u3002");
15275
+ } catch (reason) {
15276
+ setError(errorMessage(reason));
15277
+ } finally {
15278
+ setBusy(false);
15279
+ onBusyChange?.(false);
15280
+ }
15281
+ };
15282
+ const feedback = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
15283
+ error && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(WorkspaceNotice, { children: error }),
15284
+ notice && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(WorkspaceNotice, { kind: "success", children: notice })
15285
+ ] });
15286
+ const picker = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
15287
+ feedback,
15288
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormField, { label: "\u641C\u7D22\u670D\u52A1", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("input", { value: query, onChange: (e) => setQuery(e.target.value) }) }),
15289
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "dsh-partner-skill-installed dsh-partner-mcp-bindings", children: catalog.servers.filter((s) => s.name.toLocaleLowerCase().includes(query.toLocaleLowerCase())).map((server) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("article", { children: [
15290
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { children: [
15291
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: server.name }),
15292
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("p", { children: [
15293
+ server.tools.length,
15294
+ " \u4E2A\u5DE5\u5177 \xB7 ",
15295
+ ids.has(server.id) ? "\u5DF2\u6388\u6743" : "\u672A\u6388\u6743",
15296
+ !server.enabled && " \xB7 \u5DF2\u505C\u7528"
15297
+ ] })
15298
+ ] }),
15299
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", "aria-pressed": ids.has(server.id), disabled: busy, onClick: () => {
15300
+ void toggle(server.id, !ids.has(server.id));
15301
+ }, children: ids.has(server.id) ? "\u79FB\u9664\u6388\u6743" : "\u6388\u6743" })
15302
+ ] }, server.id)) }),
15303
+ !catalog.servers.length && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CollectionEmpty, { title: "\u6CA1\u6709\u53EF\u7528\u670D\u52A1", detail: "\u5148\u524D\u5F80 MCP \u670D\u52A1\u9875\u65B0\u589E\u6216\u5BFC\u5165\u914D\u7F6E\u3002" })
15304
+ ] });
15305
+ if (embedded) return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("section", { className: "dsh-partner-capability-picker", children: [
15306
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "dsh-partner-inline-note", children: "\u6388\u6743\u670D\u52A1\u5373\u5141\u8BB8\u8C03\u7528\u8BE5\u670D\u52A1\u7684\u5DE5\u5177\u3002\u51ED\u636E\u4E0D\u4F1A\u63D0\u4F9B\u7ED9\u4F19\u4F34\uFF0C\u4FEE\u6539\u4E8E\u4E0B\u4E00\u8F6E\u751F\u6548\u3002" }),
15307
+ picker
15308
+ ] });
15309
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(WorkspaceBlock, { title: "\u5DF2\u6388\u6743 MCP", detail: "\u53EA\u6CE8\u5165\u9009\u4E2D\u7684\u670D\u52A1\uFF1B\u65B0\u589E\u6216\u4FEE\u6539\u5DE5\u5177\u540E\uFF0C\u5728 MCP \u670D\u52A1\u9875\u5237\u65B0\u5DE5\u5177\u5373\u53EF\u4E8E\u4E0B\u4E00\u8F6E\u751F\u6548\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("button", { type: "button", onClick: () => {
15310
+ setSelecting(true);
15311
+ void load2();
15312
+ }, children: [
15313
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_dsh_client_ui_primitives18.IconPlusOutline16, { size: 14 }),
15314
+ "\u9009\u62E9 MCP"
15315
+ ] }), children: [
15316
+ !selecting && feedback,
15317
+ !authorized.length ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CollectionEmpty, { title: "\u5C1A\u672A\u6388\u6743 MCP \u670D\u52A1", detail: "\u5148\u5728 MCP \u670D\u52A1\u9875\u6DFB\u52A0\u914D\u7F6E\uFF0C\u518D\u5728\u6B64\u9009\u62E9\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "dsh-partner-skill-installed dsh-partner-mcp-bindings", children: (showAll ? authorized : authorized.slice(0, 4)).map((server) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("article", { children: [
15318
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { children: [
15319
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: server.name }),
15320
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("p", { children: [
15321
+ server.tools.length,
15322
+ " \u4E2A\u5DE5\u5177 \xB7 ",
15323
+ server.enabled ? "\u5DF2\u542F\u7528" : "\u670D\u52A1\u5DF2\u505C\u7528"
15324
+ ] })
15325
+ ] }),
15326
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", disabled: busy, onClick: () => {
15327
+ void toggle(server.id, false);
15328
+ }, children: "\u79FB\u9664\u6388\u6743" })
15329
+ ] }, server.id)) }),
15330
+ authorized.length > 4 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", className: "dsh-partner-skill-disclosure", "aria-expanded": showAll, onClick: () => setShowAll((v) => !v), children: showAll ? "\u6536\u8D77" : `\u67E5\u770B\u5168\u90E8 ${authorized.length} \u4E2A MCP` }),
15331
+ selecting && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(WorkspaceDialog, { title: "\u9009\u62E9 MCP \u670D\u52A1", detail: "\u6388\u6743\u670D\u52A1\u5373\u5141\u8BB8\u8C03\u7528\u8BE5\u670D\u52A1\u5237\u65B0\u540E\u516C\u5E03\u7684\u6240\u6709\u5DE5\u5177\u3002\u51ED\u636E\u4E0D\u4F1A\u63D0\u4F9B\u7ED9\u4F19\u4F34\u3002", close: () => {
15332
+ if (!busy) setSelecting(false);
15333
+ }, children: picker })
15334
+ ] });
15335
+ }
15336
+
14965
15337
  // src/ui/companion-access-panel.tsx
14966
- var import_react37 = require("react");
14967
- var import_dsh_client_ui_primitives17 = require("@deepseek-ai/dsh-client-ui-primitives");
14968
- var import_jsx_runtime34 = require("react/jsx-runtime");
14969
- function CompanionAccessPanel({ companionId }) {
14970
- const [access, setAccess] = (0, import_react37.useState)({ targetIds: [], companions: [] });
14971
- const [busy, setBusy] = (0, import_react37.useState)();
14972
- const [error, setError] = (0, import_react37.useState)();
14973
- const load2 = (0, import_react37.useCallback)(async () => {
15338
+ var import_react40 = require("react");
15339
+ var import_dsh_client_ui_primitives19 = require("@deepseek-ai/dsh-client-ui-primitives");
15340
+ var import_jsx_runtime37 = require("react/jsx-runtime");
15341
+ function CompanionAccessPanel({ companionId, onBusyChange }) {
15342
+ const [access, setAccess] = (0, import_react40.useState)({ targetIds: [], companions: [] });
15343
+ const [busy, setBusy] = (0, import_react40.useState)();
15344
+ const [error, setError] = (0, import_react40.useState)();
15345
+ const load2 = (0, import_react40.useCallback)(async () => {
14974
15346
  try {
14975
15347
  setAccess(await api(`/companions/${encodeURIComponent(companionId)}/access`));
14976
15348
  setError(void 0);
@@ -14978,10 +15350,12 @@ function CompanionAccessPanel({ companionId }) {
14978
15350
  setError(errorMessage(reason));
14979
15351
  }
14980
15352
  }, [companionId]);
14981
- (0, import_react37.useEffect)(() => {
15353
+ (0, import_react40.useEffect)(() => {
14982
15354
  void load2();
14983
15355
  }, [load2]);
14984
15356
  const toggle = async (targetId) => {
15357
+ if (busy) return;
15358
+ onBusyChange?.(true);
14985
15359
  const previous3 = access.targetIds;
14986
15360
  const targetIds = previous3.includes(targetId) ? previous3.filter((id) => id !== targetId) : [...previous3, targetId];
14987
15361
  setBusy(targetId);
@@ -14995,71 +15369,132 @@ function CompanionAccessPanel({ companionId }) {
14995
15369
  setError(errorMessage(reason));
14996
15370
  } finally {
14997
15371
  setBusy(void 0);
15372
+ onBusyChange?.(false);
14998
15373
  }
14999
15374
  };
15000
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("section", { className: "dsh-partner-capability-detail dsh-partner-access", "aria-labelledby": "dsh-partner-access-title", children: [
15001
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("header", { children: [
15002
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { children: [
15003
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("small", { children: "DIRECTED ACCESS" }),
15004
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { id: "dsh-partner-access-title", children: "\u53EF\u8BBF\u95EE\u7684\u4F19\u4F34" })
15375
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("section", { className: "dsh-partner-capability-detail dsh-partner-access", "aria-labelledby": "dsh-partner-access-title", children: [
15376
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("header", { children: [
15377
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { children: [
15378
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("small", { children: "DIRECTED ACCESS" }),
15379
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("strong", { id: "dsh-partner-access-title", children: "\u53EF\u8BBF\u95EE\u7684\u4F19\u4F34" })
15005
15380
  ] }),
15006
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("em", { children: [
15381
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("em", { children: [
15007
15382
  access.targetIds.length,
15008
15383
  " \u4F4D\u5DF2\u6388\u6743"
15009
15384
  ] })
15010
15385
  ] }),
15011
- /* @__PURE__ */ (0, import_jsx_runtime34.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" }),
15012
- access.companions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.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_runtime34.jsx)("div", { className: "dsh-partner-access-list", children: access.companions.map((companion) => {
15386
+ /* @__PURE__ */ (0, import_jsx_runtime37.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" }),
15387
+ access.companions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime37.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_runtime37.jsx)("div", { className: "dsh-partner-access-list", children: access.companions.map((companion) => {
15013
15388
  const selected = access.targetIds.includes(companion.id);
15014
15389
  const abilities = companion.capabilities.map((capability) => isCompanionCapability(capability) ? CAPABILITY_LABELS[capability] : capability);
15015
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("button", { type: "button", className: selected ? "is-active" : "", "aria-pressed": selected, disabled: busy === companion.id, onClick: () => {
15390
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("button", { type: "button", className: selected ? "is-active" : "", "aria-pressed": selected, disabled: busy === companion.id, onClick: () => {
15016
15391
  void toggle(companion.id);
15017
15392
  }, children: [
15018
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "dsh-partner-access-avatar", "aria-hidden": "true", children: initials(companion.name) }),
15019
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "dsh-partner-access-copy", children: [
15020
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("strong", { children: [
15393
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "dsh-partner-access-avatar", "aria-hidden": "true", children: initials(companion.name) }),
15394
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "dsh-partner-access-copy", children: [
15395
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("strong", { children: [
15021
15396
  "@",
15022
15397
  companion.name
15023
15398
  ] }),
15024
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("small", { children: companion.role }),
15025
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { children: companion.description || "\u672A\u586B\u5199\u4F19\u4F34\u8BF4\u660E" }),
15026
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: [...abilities, ...companion.enabledSkills.map((skill) => skill.name)].map((item) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("em", { children: item }, item)) })
15399
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("small", { children: companion.role }),
15400
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { children: companion.description || "\u672A\u586B\u5199\u4F19\u4F34\u8BF4\u660E" }),
15401
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: [...abilities, ...companion.enabledSkills.map((skill) => skill.name)].map((item) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("em", { children: item }, item)) })
15027
15402
  ] }),
15028
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "dsh-partner-access-check", "aria-hidden": "true", children: selected && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_dsh_client_ui_primitives17.IconCheckOutline16, { size: 15 }) })
15403
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "dsh-partner-access-check", "aria-hidden": "true", children: selected && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_dsh_client_ui_primitives19.IconCheckOutline16, { size: 15 }) })
15029
15404
  ] }, companion.id);
15030
15405
  }) }),
15031
- error && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(WorkspaceNotice, { children: error })
15406
+ error && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(WorkspaceNotice, { children: error })
15032
15407
  ] });
15033
15408
  }
15034
15409
  function initials(name) {
15035
15410
  return [...name.trim()].slice(0, 2).join("").toUpperCase() || "AI";
15036
15411
  }
15037
15412
 
15413
+ // src/ui/capability-resources.tsx
15414
+ var import_jsx_runtime38 = require("react/jsx-runtime");
15415
+ var titles = { skills: "Skill", access: "\u53EF\u8BBF\u95EE\u4F19\u4F34", mcp: "MCP \u670D\u52A1" };
15416
+ function CapabilityResources({ companionId, capabilities, disabled, children }) {
15417
+ const [opened, setOpened] = (0, import_react41.useState)();
15418
+ const [busy, setBusy] = (0, import_react41.useState)(false);
15419
+ const [revision, setRevision] = (0, import_react41.useState)(0);
15420
+ const [counts, setCounts] = (0, import_react41.useState)({});
15421
+ const [failed, setFailed] = (0, import_react41.useState)(false);
15422
+ (0, import_react41.useEffect)(() => {
15423
+ let live = true;
15424
+ setFailed(false);
15425
+ const requests = [
15426
+ ["access", api(`/companions/${encodeURIComponent(companionId)}/access`).then((v) => v.targetIds.length)]
15427
+ ];
15428
+ if (capabilities.includes("skills")) requests.push(["skills", api("/skills").then((v) => v.installed.filter((s) => v.bindings.some((b) => b.companionId === companionId && b.skillId === s.id && b.enabled)).length)]);
15429
+ if (capabilities.includes("mcp")) requests.push(["mcp", api("/mcp").then((v) => v.servers.filter((s) => v.bindings.some((b) => b.companionId === companionId && b.serverId === s.id)).length)]);
15430
+ for (const [key, request] of requests) void request.then((count) => {
15431
+ if (live) setCounts((v) => ({ ...v, [key]: count }));
15432
+ }).catch(() => {
15433
+ if (live) {
15434
+ setCounts((v) => ({ ...v, [key]: void 0 }));
15435
+ setFailed(true);
15436
+ }
15437
+ });
15438
+ return () => {
15439
+ live = false;
15440
+ };
15441
+ }, [companionId, capabilities, revision]);
15442
+ const close = () => {
15443
+ if (busy) return;
15444
+ setOpened(void 0);
15445
+ setRevision((v) => v + 1);
15446
+ };
15447
+ const manage = (key) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("button", { className: "dsh-partner-capability-manage", type: "button", disabled: disabled || key !== "access" && !capabilities.includes(key), "aria-haspopup": "dialog", "aria-label": `\u7BA1\u7406${titles[key]}`, onClick: () => {
15448
+ setBusy(false);
15449
+ setOpened(key);
15450
+ }, children: [
15451
+ "\u7BA1\u7406",
15452
+ counts[key] !== void 0 ? ` \xB7 ${counts[key]}` : ""
15453
+ ] });
15454
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
15455
+ children(manage),
15456
+ failed && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("p", { className: "dsh-partner-inline-note", children: [
15457
+ "\u90E8\u5206\u6570\u91CF\u8BFB\u53D6\u5931\u8D25\uFF0C\u53EF\u6253\u5F00\u7BA1\u7406\u91CD\u8BD5\u3002",
15458
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", onClick: () => setRevision((v) => v + 1), children: "\u5237\u65B0\u6570\u91CF" })
15459
+ ] }),
15460
+ opened && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(WorkspaceDialog, { className: "is-capability-resources", eyebrow: "", title: `\u7BA1\u7406${titles[opened]}`, detail: opened === "access" ? "\u9009\u62E9\u6B64\u4F19\u4F34\u53EF\u4EE5\u8BBF\u95EE\u548C\u59D4\u6D3E\u7684\u4F19\u4F34\uFF0C\u5355\u5411\u6388\u6743\u3002" : "\u9009\u62E9\u9700\u8981\u542F\u7528\u7684\u80FD\u529B\uFF0C\u4FEE\u6539\u81EA\u52A8\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u751F\u6548\u3002", close, children: [
15461
+ busy && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { role: "status", className: "dsh-partner-inline-note", children: "\u6B63\u5728\u4FDD\u5B58\uFF0C\u8BF7\u7A0D\u5019\u2026" }),
15462
+ opened === "skills" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CompanionSkillSettings, { companionId, onBusyChange: setBusy }),
15463
+ opened === "access" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CompanionAccessPanel, { companionId, onBusyChange: setBusy }),
15464
+ opened === "mcp" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CompanionMcpSettings, { companionId, embedded: true, onBusyChange: setBusy })
15465
+ ] })
15466
+ ] });
15467
+ }
15468
+
15038
15469
  // src/ui/companion-draft.ts
15039
15470
  function companionDraft(companion) {
15040
15471
  return { name: companion.name, role: companion.role, description: companion.description, instructions: companion.instructions, presetId: companion.presetId ?? "", provider: companion.provider ?? "", model: companion.model ?? "", capabilities: [...companion.capabilities] };
15041
15472
  }
15042
15473
 
15043
15474
  // src/ui/capability-editor.tsx
15044
- var import_jsx_runtime35 = require("react/jsx-runtime");
15475
+ var import_jsx_runtime39 = require("react/jsx-runtime");
15045
15476
  function CapabilityEditor({ companion, presets, onChanged }) {
15046
- const [form, setForm] = (0, import_react38.useState)(() => companionDraft(companion));
15047
- const [modelCatalog, setModelCatalog] = (0, import_react38.useState)();
15048
- const [saving, setSaving] = (0, import_react38.useState)(false);
15049
- const [saved, setSaved] = (0, import_react38.useState)(false);
15050
- const [error, setError] = (0, import_react38.useState)();
15051
- const savingRef = (0, import_react38.useRef)(false);
15052
- const mounted = (0, import_react38.useRef)(true);
15053
- (0, import_react38.useEffect)(() => {
15477
+ const [form, setForm] = (0, import_react42.useState)(() => companionDraft(companion));
15478
+ const [persistedCapabilities, setPersistedCapabilities] = (0, import_react42.useState)(companion.capabilities);
15479
+ const [modelCatalog, setModelCatalog] = (0, import_react42.useState)();
15480
+ const [saving, setSaving] = (0, import_react42.useState)(false);
15481
+ const [saved, setSaved] = (0, import_react42.useState)(false);
15482
+ const [error, setError] = (0, import_react42.useState)();
15483
+ const savingRef = (0, import_react42.useRef)(false);
15484
+ const mounted = (0, import_react42.useRef)(true);
15485
+ (0, import_react42.useEffect)(() => {
15054
15486
  mounted.current = true;
15055
15487
  return () => {
15056
15488
  mounted.current = false;
15057
15489
  };
15058
15490
  }, []);
15059
- (0, import_react38.useEffect)(() => {
15060
- if (!savingRef.current) setForm(companionDraft(companion));
15491
+ (0, import_react42.useEffect)(() => {
15492
+ if (!savingRef.current) {
15493
+ setForm(companionDraft(companion));
15494
+ setPersistedCapabilities(companion.capabilities);
15495
+ }
15061
15496
  }, [companion.id, companion.updatedAt]);
15062
- (0, import_react38.useEffect)(() => {
15497
+ (0, import_react42.useEffect)(() => {
15063
15498
  void api("/models").then((value) => {
15064
15499
  if (mounted.current) setModelCatalog(value);
15065
15500
  }).catch((reason) => {
@@ -15068,20 +15503,21 @@ function CapabilityEditor({ companion, presets, onChanged }) {
15068
15503
  }, []);
15069
15504
  const edit = (next) => {
15070
15505
  if (savingRef.current) return;
15071
- setForm(next);
15072
- setSaved(false);
15073
- setError(void 0);
15506
+ void save(next);
15074
15507
  };
15075
15508
  const toggle = (capability) => edit({ ...form, capabilities: form.capabilities.includes(capability) ? form.capabilities.filter((item) => item !== capability) : [...form.capabilities, capability] });
15076
- const save = async () => {
15509
+ const save = async (next) => {
15077
15510
  if (savingRef.current) return;
15078
15511
  savingRef.current = true;
15512
+ const previous3 = form;
15513
+ setForm(next);
15079
15514
  setSaving(true);
15080
15515
  setSaved(false);
15081
15516
  setError(void 0);
15082
15517
  try {
15083
- await api(`/companions/${companion.id}`, { method: "PUT", body: JSON.stringify({ companion: form }) });
15518
+ await api(`/companions/${companion.id}`, { method: "PUT", body: JSON.stringify({ companion: next }) });
15084
15519
  if (!mounted.current) return;
15520
+ setPersistedCapabilities(next.capabilities);
15085
15521
  setSaved(true);
15086
15522
  try {
15087
15523
  await onChanged();
@@ -15089,7 +15525,10 @@ function CapabilityEditor({ companion, presets, onChanged }) {
15089
15525
  if (mounted.current) setError("\u80FD\u529B\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u5217\u8868\u5237\u65B0\u5931\u8D25\u3002\u5237\u65B0\u9875\u9762\u5373\u53EF\uFF0C\u65E0\u9700\u91CD\u590D\u5E94\u7528\u3002");
15090
15526
  }
15091
15527
  } catch (reason) {
15092
- if (mounted.current) setError(`\u4FDD\u5B58\u5931\u8D25\uFF1A${errorMessage(reason)}\u3002\u5F53\u524D\u9009\u62E9\u5DF2\u4FDD\u7559\uFF0C\u53EF\u91CD\u8BD5\u3002`);
15528
+ if (mounted.current) {
15529
+ setForm(previous3);
15530
+ setError(`\u4FDD\u5B58\u5931\u8D25\uFF1A${errorMessage(reason)}\u3002\u5DF2\u6062\u590D\u539F\u9009\u62E9\uFF0C\u8BF7\u91CD\u65B0\u64CD\u4F5C\u3002`);
15531
+ }
15093
15532
  } finally {
15094
15533
  savingRef.current = false;
15095
15534
  if (mounted.current) setSaving(false);
@@ -15099,6 +15538,7 @@ function CapabilityEditor({ companion, presets, onChanged }) {
15099
15538
  { id: "tools", eyebrow: "TOOLS", title: "\u5DE5\u4F5C\u5DE5\u5177", detail: "\u8FDE\u63A5\u5F53\u524D\u4F19\u4F34\u80FD\u591F\u4F7F\u7528\u7684\u4E13\u4E1A\u5DE5\u5177\u3002", choices: [
15100
15539
  { id: "knowledge", title: "\u77E5\u8BC6\u5E93", detail: "\u5728\u5DF2\u6302\u8F7D\u8303\u56F4\u5185\u68C0\u7D22\u4E0E\u56DE\u5199\u77E5\u8BC6\u3002" },
15101
15540
  { id: "skills", title: "Skill", detail: "\u4F7F\u7528\u5355\u72EC\u542F\u7528\u7684 Skill \u4E0E\u5DE5\u4F5C\u6D41\u7A0B\u3002" },
15541
+ { id: "mcp", title: "MCP", detail: "\u4F7F\u7528\u5355\u72EC\u6388\u6743\u7684\u5916\u90E8 MCP \u670D\u52A1\u5DE5\u5177\u3002" },
15102
15542
  { id: "ssh", title: "SSH", detail: "\u5728 SSH \u63D2\u4EF6\u6388\u6743\u8FB9\u754C\u5185\u64CD\u4F5C\u4E3B\u673A\u3002" },
15103
15543
  { id: "git", title: "Git", detail: "\u9884\u7559 Git \u80FD\u529B\uFF0C\u9700\u5BF9\u5E94\u63D2\u4EF6\u5B9E\u9645\u5B89\u88C5\u3002" }
15104
15544
  ] },
@@ -15114,98 +15554,102 @@ function CapabilityEditor({ companion, presets, onChanged }) {
15114
15554
  const selectedProvider = form.provider || modelCatalog?.defaultSelection.provider || "";
15115
15555
  const modelOptions = modelCatalog?.providers.find((item) => item.id === selectedProvider)?.models ?? [];
15116
15556
  const currentModelMissing = Boolean(form.model) && !modelOptions.some((item) => item.id === form.model);
15117
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "dsh-partner-form is-capabilities", children: [
15118
- /* @__PURE__ */ (0, import_jsx_runtime35.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" }),
15119
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "dsh-partner-runtime-fields", children: [
15120
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FormField, { label: "Agent Preset", hint: "\u5DE5\u5177\u3001Skill \u4E0E\u7CFB\u7EDF\u63D0\u793A", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("select", { disabled: saving, value: form.presetId, onChange: (event) => edit({ ...form, presetId: event.target.value }), children: [
15121
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "", children: "\u8DDF\u968F DSH \u9ED8\u8BA4 Preset" }),
15122
- presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: item.id, children: item.name }, item.id))
15557
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "dsh-partner-form is-capabilities", children: [
15558
+ /* @__PURE__ */ (0, import_jsx_runtime39.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" }),
15559
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "dsh-partner-capability-save-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: [
15560
+ saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : saved ? "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u751F\u6548" : "\u4FEE\u6539\u81EA\u52A8\u4FDD\u5B58\uFF0C\u65E0\u9700\u5E94\u7528\u7EC4\u5408\u3002",
15561
+ error && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error })
15562
+ ] }),
15563
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "dsh-partner-runtime-fields", children: [
15564
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FormField, { label: "Agent Preset", hint: "\u5DE5\u5177\u3001Skill \u4E0E\u7CFB\u7EDF\u63D0\u793A", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("select", { disabled: saving, value: form.presetId, onChange: (event) => edit({ ...form, presetId: event.target.value }), children: [
15565
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: "", children: "\u8DDF\u968F DSH \u9ED8\u8BA4 Preset" }),
15566
+ presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: item.id, children: item.name }, item.id))
15123
15567
  ] }) }),
15124
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FormField, { label: "\u6A21\u578B\u63D0\u4F9B\u65B9", hint: "\u6765\u81EA\u5F53\u524D\u5BA2\u6237\u7AEF", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("select", { disabled: saving, value: form.provider, onChange: (event) => edit({ ...form, provider: event.target.value, model: "" }), children: [
15125
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("option", { value: "", children: [
15568
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FormField, { label: "\u6A21\u578B\u63D0\u4F9B\u65B9", hint: "\u6765\u81EA\u5F53\u524D\u5BA2\u6237\u7AEF", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("select", { disabled: saving, value: form.provider, onChange: (event) => edit({ ...form, provider: event.target.value, model: "" }), children: [
15569
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("option", { value: "", children: [
15126
15570
  "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
15127
15571
  modelCatalog?.defaultSelection.provider || "\u6B63\u5728\u8BFB\u53D6"
15128
15572
  ] }),
15129
- modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
15573
+ modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
15130
15574
  ] }) }),
15131
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FormField, { label: "\u6A21\u578B", hint: "\u968F\u63D0\u4F9B\u65B9\u8054\u52A8", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("select", { disabled: saving, value: form.model, onChange: (event) => edit({ ...form, model: event.target.value }), children: [
15132
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("option", { value: "", children: [
15575
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FormField, { label: "\u6A21\u578B", hint: "\u968F\u63D0\u4F9B\u65B9\u8054\u52A8", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("select", { disabled: saving, value: form.model, onChange: (event) => edit({ ...form, model: event.target.value }), children: [
15576
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("option", { value: "", children: [
15133
15577
  "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
15134
15578
  modelCatalog?.defaultSelection.model || "\u6B63\u5728\u8BFB\u53D6"
15135
15579
  ] }),
15136
- currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("option", { value: form.model, children: [
15580
+ currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("option", { value: form.model, children: [
15137
15581
  "\u5F53\u524D\u914D\u7F6E \xB7 ",
15138
15582
  form.model
15139
15583
  ] }),
15140
- modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
15584
+ modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
15141
15585
  ] }) })
15142
15586
  ] }),
15143
- /* @__PURE__ */ (0, import_jsx_runtime35.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" }),
15144
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "dsh-partner-capability-groups", children: groups.map((group) => {
15587
+ /* @__PURE__ */ (0, import_jsx_runtime39.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" }),
15588
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CapabilityResources, { companionId: companion.id, capabilities: persistedCapabilities, disabled: saving, children: (manage) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "dsh-partner-capability-groups", children: groups.map((group) => {
15145
15589
  const enabled = group.choices.filter((choice) => form.capabilities.includes(choice.id)).length;
15146
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("section", { className: "dsh-partner-capability-group", "aria-labelledby": `partner-capability-${group.id}`, children: [
15147
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("header", { children: [
15148
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { children: [
15149
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("small", { children: group.eyebrow }),
15150
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("strong", { id: `partner-capability-${group.id}`, children: group.title }),
15151
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: group.detail })
15590
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("section", { className: "dsh-partner-capability-group", "aria-labelledby": `partner-capability-${group.id}`, children: [
15591
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("header", { children: [
15592
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { children: [
15593
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("small", { children: group.eyebrow }),
15594
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("strong", { id: `partner-capability-${group.id}`, children: group.title }),
15595
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { children: group.detail })
15152
15596
  ] }),
15153
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("em", { children: [
15597
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("em", { children: [
15154
15598
  enabled,
15155
15599
  " / ",
15156
15600
  group.choices.length,
15157
15601
  " \u5DF2\u542F\u7528"
15158
15602
  ] })
15159
15603
  ] }),
15160
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "dsh-partner-capabilities", children: group.choices.map((choice) => {
15161
- const active2 = form.capabilities.includes(choice.id);
15162
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { type: "button", disabled: saving, className: active2 ? "is-active" : "", "aria-pressed": active2, onClick: () => toggle(choice.id), children: [
15163
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: active2 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_dsh_client_ui_primitives18.IconCheckOutline14, { size: 14 }) }),
15164
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("strong", { children: choice.title }),
15165
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("small", { children: choice.detail })
15166
- ] }, choice.id);
15167
- }) })
15604
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "dsh-partner-capabilities", children: [
15605
+ group.choices.map((choice) => {
15606
+ const active2 = form.capabilities.includes(choice.id);
15607
+ const control = /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("button", { type: "button", disabled: saving, className: active2 ? "is-active" : "", "aria-pressed": active2, onClick: () => toggle(choice.id), children: [
15608
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: active2 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_dsh_client_ui_primitives20.IconCheckOutline14, { size: 14 }) }),
15609
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("strong", { children: choice.title }),
15610
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("small", { children: choice.detail })
15611
+ ] });
15612
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "dsh-partner-capability-card", children: [
15613
+ control,
15614
+ (choice.id === "skills" || choice.id === "mcp") && manage(choice.id)
15615
+ ] }, choice.id);
15616
+ }),
15617
+ group.id === "coordination" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "dsh-partner-capability-card is-access", children: [
15618
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "dsh-partner-capability-card-copy", children: [
15619
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("strong", { children: "\u53EF\u8BBF\u95EE\u4F19\u4F34" }),
15620
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("small", { children: "\u9009\u62E9\u80FD\u4E86\u89E3\u5176\u80FD\u529B\u5E76\u59D4\u6D3E\u4EFB\u52A1\u7684\u4F19\u4F34\u3002" })
15621
+ ] }),
15622
+ manage("access")
15623
+ ] })
15624
+ ] })
15168
15625
  ] }, group.id);
15169
- }) }),
15170
- form.capabilities.includes("skills") && companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CompanionSkillSettings, { companionId: companion.id }),
15171
- form.capabilities.includes("skills") && !companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime35.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" }),
15172
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CompanionAccessPanel, { companionId: companion.id }),
15173
- error && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
15174
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "dsh-partner-form-actions is-capability-save", children: [
15175
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { role: "status", "aria-live": "polite", "aria-atomic": "true", children: saved && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
15176
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_dsh_client_ui_primitives18.IconCheckOutline14, { size: 14 }),
15177
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u751F\u6548" })
15178
- ] }) }),
15179
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("button", { type: "button", disabled: saving, "aria-busy": saving, onClick: () => {
15180
- void save();
15181
- }, children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u5E94\u7528\u80FD\u529B\u7EC4\u5408" })
15182
- ] })
15626
+ }) }) }, companion.id)
15183
15627
  ] });
15184
15628
  }
15185
15629
 
15186
15630
  // src/ui/identity-editor.tsx
15187
- var import_react39 = require("react");
15188
- var import_dsh_client_ui_primitives19 = require("@deepseek-ai/dsh-client-ui-primitives");
15189
- var import_jsx_runtime36 = require("react/jsx-runtime");
15631
+ var import_react43 = require("react");
15632
+ var import_dsh_client_ui_primitives21 = require("@deepseek-ai/dsh-client-ui-primitives");
15633
+ var import_jsx_runtime40 = require("react/jsx-runtime");
15190
15634
  function IdentityEditor(props) {
15191
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(IdentityEditorForm, { ...props }, props.companion.id);
15635
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(IdentityEditorForm, { ...props }, props.companion.id);
15192
15636
  }
15193
15637
  function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
15194
- const [form, setForm] = (0, import_react39.useState)(() => companionDraft(companion));
15195
- const [operation, setOperation] = (0, import_react39.useState)();
15196
- const [saved, setSaved] = (0, import_react39.useState)(false);
15197
- const [removed, setRemoved] = (0, import_react39.useState)(false);
15198
- const [error, setError] = (0, import_react39.useState)();
15199
- const [confirmationId, setConfirmationId] = (0, import_react39.useState)();
15200
- const locked = (0, import_react39.useRef)(false);
15201
- const alive = (0, import_react39.useRef)(true);
15202
- (0, import_react39.useEffect)(() => {
15638
+ const [form, setForm] = (0, import_react43.useState)(() => companionDraft(companion));
15639
+ const [operation, setOperation] = (0, import_react43.useState)();
15640
+ const [saved, setSaved] = (0, import_react43.useState)(false);
15641
+ const [removed, setRemoved] = (0, import_react43.useState)(false);
15642
+ const [error, setError] = (0, import_react43.useState)();
15643
+ const [confirmationId, setConfirmationId] = (0, import_react43.useState)();
15644
+ const locked = (0, import_react43.useRef)(false);
15645
+ const alive = (0, import_react43.useRef)(true);
15646
+ (0, import_react43.useEffect)(() => {
15203
15647
  alive.current = true;
15204
15648
  return () => {
15205
15649
  alive.current = false;
15206
15650
  };
15207
15651
  }, []);
15208
- (0, import_react39.useEffect)(() => {
15652
+ (0, import_react43.useEffect)(() => {
15209
15653
  setForm(companionDraft(companion));
15210
15654
  setSaved(false);
15211
15655
  setConfirmationId(void 0);
@@ -15252,35 +15696,35 @@ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
15252
15696
  if (alive.current) setOperation(void 0);
15253
15697
  }
15254
15698
  };
15255
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("form", { id: "dsh-partner-identity-editor", className: "dsh-partner-form is-identity", "aria-busy": operation !== void 0, onSubmit: (event) => {
15699
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("form", { id: "dsh-partner-identity-editor", className: "dsh-partner-form is-identity", "aria-busy": operation !== void 0, onSubmit: (event) => {
15256
15700
  void submit(event);
15257
15701
  }, children: [
15258
- /* @__PURE__ */ (0, import_jsx_runtime36.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" }),
15259
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("section", { className: "dsh-partner-identity-card", "aria-label": "\u8EAB\u4EFD\u914D\u7F6E", children: [
15260
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "dsh-partner-fields two", children: [
15261
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormField, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("input", { disabled: busy, required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
15262
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormField, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("input", { disabled: busy, required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
15702
+ /* @__PURE__ */ (0, import_jsx_runtime40.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" }),
15703
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("section", { className: "dsh-partner-identity-card", "aria-label": "\u8EAB\u4EFD\u914D\u7F6E", children: [
15704
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "dsh-partner-fields two", children: [
15705
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormField, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("input", { disabled: busy, required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
15706
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormField, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("input", { disabled: busy, required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
15263
15707
  ] }),
15264
- /* @__PURE__ */ (0, import_jsx_runtime36.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_runtime36.jsx)("textarea", { disabled: busy, rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
15265
- /* @__PURE__ */ (0, import_jsx_runtime36.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_runtime36.jsx)("textarea", { disabled: busy, rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
15266
- error && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
15267
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "dsh-partner-form-actions", children: [
15268
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { role: "status", children: saved && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
15269
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_dsh_client_ui_primitives19.IconCheckOutline14, { size: 14 }),
15708
+ /* @__PURE__ */ (0, import_jsx_runtime40.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_runtime40.jsx)("textarea", { disabled: busy, rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
15709
+ /* @__PURE__ */ (0, import_jsx_runtime40.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_runtime40.jsx)("textarea", { disabled: busy, rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
15710
+ error && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
15711
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "dsh-partner-form-actions", children: [
15712
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { role: "status", children: saved && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
15713
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_dsh_client_ui_primitives21.IconCheckOutline14, { size: 14 }),
15270
15714
  "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u5C06\u4F7F\u7528\u65B0\u8EAB\u4EFD"
15271
15715
  ] }) }),
15272
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { disabled: busy, children: operation === "save" ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
15716
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { disabled: busy, children: operation === "save" ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
15273
15717
  ] })
15274
15718
  ] }),
15275
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "dsh-partner-identity-danger", "data-confirming": confirming, children: [
15276
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { children: [
15277
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: removed ? "\u4F19\u4F34\u5DF2\u5220\u9664" : confirming ? `\u786E\u8BA4\u5220\u9664\u300C${companion.name}\u300D\uFF1F` : "\u5220\u9664\u4F19\u4F34" }),
15278
- /* @__PURE__ */ (0, import_jsx_runtime36.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" })
15719
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "dsh-partner-identity-danger", "data-confirming": confirming, children: [
15720
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { children: [
15721
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("strong", { children: removed ? "\u4F19\u4F34\u5DF2\u5220\u9664" : confirming ? `\u786E\u8BA4\u5220\u9664\u300C${companion.name}\u300D\uFF1F` : "\u5220\u9664\u4F19\u4F34" }),
15722
+ /* @__PURE__ */ (0, import_jsx_runtime40.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" })
15279
15723
  ] }),
15280
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { children: [
15281
- confirming && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", disabled: busy, className: "is-secondary", onClick: () => setConfirmationId(void 0), children: "\u53D6\u6D88" }),
15282
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("button", { type: "button", className: confirming ? "is-danger" : "", disabled: busy || count <= 1, onClick: () => confirming ? void remove() : setConfirmationId(companion.id), children: [
15283
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_dsh_client_ui_primitives19.IconTrashOutline16, { size: 16 }),
15724
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { children: [
15725
+ confirming && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { type: "button", disabled: busy, className: "is-secondary", onClick: () => setConfirmationId(void 0), children: "\u53D6\u6D88" }),
15726
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("button", { type: "button", className: confirming ? "is-danger" : "", disabled: busy || count <= 1, onClick: () => confirming ? void remove() : setConfirmationId(companion.id), children: [
15727
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_dsh_client_ui_primitives21.IconTrashOutline16, { size: 16 }),
15284
15728
  operation === "remove" ? "\u6B63\u5728\u5220\u9664\u2026" : removed ? "\u5DF2\u5220\u9664" : confirming ? "\u786E\u8BA4\u5220\u9664" : "\u5220\u9664"
15285
15729
  ] })
15286
15730
  ] })
@@ -15289,25 +15733,25 @@ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
15289
15733
  }
15290
15734
 
15291
15735
  // src/ui/channels-panel.tsx
15292
- var import_react41 = require("react");
15736
+ var import_react45 = require("react");
15293
15737
 
15294
15738
  // src/ui/notification-settings.tsx
15295
- var import_react40 = require("react");
15296
- var import_jsx_runtime37 = require("react/jsx-runtime");
15739
+ var import_react44 = require("react");
15740
+ var import_jsx_runtime41 = require("react/jsx-runtime");
15297
15741
  function NotificationSettings({ companion, snapshot, onChanged }) {
15298
15742
  const channels = snapshot.channels.filter((c) => c.companionId === companion.id);
15299
15743
  const pairings = snapshot.pairings.filter((p) => channels.some((c) => c.id === p.channelId));
15300
- const [mode, setMode] = (0, import_react40.useState)(companion.notificationDelivery?.mode ?? "recent");
15301
- const [targets, setTargets] = (0, import_react40.useState)(companion.notificationDelivery?.targets ?? []);
15302
- const [selectedChannels, setSelectedChannels] = (0, import_react40.useState)(targets.map((t) => t.channelId));
15303
- const [busy, setBusy] = (0, import_react40.useState)(false), [feedback, setFeedback] = (0, import_react40.useState)(""), [failed, setFailed] = (0, import_react40.useState)(false);
15304
- const saveRef = (0, import_react40.useRef)(null);
15305
- (0, import_react40.useEffect)(() => {
15744
+ const [mode, setMode] = (0, import_react44.useState)(companion.notificationDelivery?.mode ?? "recent");
15745
+ const [targets, setTargets] = (0, import_react44.useState)(companion.notificationDelivery?.targets ?? []);
15746
+ const [selectedChannels, setSelectedChannels] = (0, import_react44.useState)(targets.map((t) => t.channelId));
15747
+ const [busy, setBusy] = (0, import_react44.useState)(false), [feedback, setFeedback] = (0, import_react44.useState)(""), [failed, setFailed] = (0, import_react44.useState)(false);
15748
+ const saveRef = (0, import_react44.useRef)(null);
15749
+ (0, import_react44.useEffect)(() => {
15306
15750
  if (!busy && feedback && document.activeElement === document.body) saveRef.current?.focus();
15307
15751
  }, [busy, feedback]);
15308
15752
  const unavailable = targets.filter((t) => !pairings.some((p) => p.channelId === t.channelId && p.userId === t.userId && p.status === "approved") || !channels.some((c) => c.id === t.channelId && c.enabled));
15309
15753
  const emptyChannel = selectedChannels.some((id) => !targets.some((t) => t.channelId === id));
15310
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-channel-form dsh-partner-delivery-form", "aria-busy": busy, onSubmit: (e) => {
15754
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-channel-form dsh-partner-delivery-form", "aria-busy": busy, onSubmit: (e) => {
15311
15755
  e.preventDefault();
15312
15756
  if (busy) return;
15313
15757
  setBusy(true);
@@ -15322,41 +15766,41 @@ function NotificationSettings({ companion, snapshot, onChanged }) {
15322
15766
  setFeedback(errorMessage(error));
15323
15767
  }).finally(() => setBusy(false));
15324
15768
  }, children: [
15325
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("label", { className: "dsh-partner-channel-field", children: [
15326
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: "\u901A\u77E5\u53D1\u9001\u5230" }),
15327
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("select", { disabled: busy, value: mode, onChange: (e) => setMode(e.target.value), children: [
15328
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("option", { value: "recent", children: "\u6700\u8FD1\u8054\u7CFB\u7684\u6E20\u9053\u4E0E\u7528\u6237" }),
15329
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("option", { value: "selected", children: "\u6307\u5B9A\u6E20\u9053\u4E0E\u63A5\u6536\u4EBA" })
15769
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { className: "dsh-partner-channel-field", children: [
15770
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: "\u901A\u77E5\u53D1\u9001\u5230" }),
15771
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("select", { disabled: busy, value: mode, onChange: (e) => setMode(e.target.value), children: [
15772
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("option", { value: "recent", children: "\u6700\u8FD1\u8054\u7CFB\u7684\u6E20\u9053\u4E0E\u7528\u6237" }),
15773
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("option", { value: "selected", children: "\u6307\u5B9A\u6E20\u9053\u4E0E\u63A5\u6536\u4EBA" })
15330
15774
  ] })
15331
15775
  ] }),
15332
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { children: "\u4EC5\u5F71\u54CD\u4E3B\u52A8\u901A\u77E5\u4E0E\u7ED3\u679C\u4EA4\u4ED8\u3002\u5BF9\u8BDD\u56DE\u590D\u4ECD\u53D1\u9001\u5230\u6D88\u606F\u6765\u6E90\u6E20\u9053\u3002" }),
15333
- !companion.notificationDelivery && pairings.some((p) => p.deliveryTarget) && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { role: "status", children: "\u5F53\u524D\u4ECD\u4F7F\u7528\u65E7\u7684\u8054\u7CFB\u4EBA\u6295\u9012\u89C4\u5219\uFF0C\u4FDD\u5B58\u540E\u7EDF\u4E00\u4F7F\u7528\u8FD9\u91CC\u7684\u901A\u77E5\u8BBE\u7F6E\u3002" }),
15334
- mode === "selected" && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "dsh-partner-notification-choices", children: [
15335
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { children: "\u53EF\u9009\u62E9\u591A\u4E2A\u6E20\u9053\uFF1B\u6BCF\u4E2A\u6E20\u9053\u81F3\u5C11\u9009\u62E9\u4E00\u4F4D\u5DF2\u6388\u6743\u63A5\u6536\u4EBA\u3002\u4FDD\u5B58\u540E\u5BF9\u65B0\u901A\u77E5\u751F\u6548\uFF0C\u5F85\u91CD\u8BD5\u901A\u77E5\u4FDD\u7559\u539F\u63A5\u6536\u4EBA\u3002" }),
15336
- !channels.length && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { children: "\u8BF7\u5148\u6DFB\u52A0\u6E20\u9053\u5E76\u6388\u6743\u8054\u7CFB\u4EBA\u3002" }),
15337
- channels.map((channel) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("fieldset", { disabled: busy, className: "dsh-partner-notification-channel", children: [
15338
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("legend", { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("label", { children: [
15339
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("input", { type: "checkbox", checked: selectedChannels.includes(channel.id), onChange: (e) => {
15776
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: "\u4EC5\u5F71\u54CD\u4E3B\u52A8\u901A\u77E5\u4E0E\u7ED3\u679C\u4EA4\u4ED8\u3002\u5BF9\u8BDD\u56DE\u590D\u4ECD\u53D1\u9001\u5230\u6D88\u606F\u6765\u6E90\u6E20\u9053\u3002" }),
15777
+ !companion.notificationDelivery && pairings.some((p) => p.deliveryTarget) && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { role: "status", children: "\u5F53\u524D\u4ECD\u4F7F\u7528\u65E7\u7684\u8054\u7CFB\u4EBA\u6295\u9012\u89C4\u5219\uFF0C\u4FDD\u5B58\u540E\u7EDF\u4E00\u4F7F\u7528\u8FD9\u91CC\u7684\u901A\u77E5\u8BBE\u7F6E\u3002" }),
15778
+ mode === "selected" && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-notification-choices", children: [
15779
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: "\u53EF\u9009\u62E9\u591A\u4E2A\u6E20\u9053\uFF1B\u6BCF\u4E2A\u6E20\u9053\u81F3\u5C11\u9009\u62E9\u4E00\u4F4D\u5DF2\u6388\u6743\u63A5\u6536\u4EBA\u3002\u4FDD\u5B58\u540E\u5BF9\u65B0\u901A\u77E5\u751F\u6548\uFF0C\u5F85\u91CD\u8BD5\u901A\u77E5\u4FDD\u7559\u539F\u63A5\u6536\u4EBA\u3002" }),
15780
+ !channels.length && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: "\u8BF7\u5148\u6DFB\u52A0\u6E20\u9053\u5E76\u6388\u6743\u8054\u7CFB\u4EBA\u3002" }),
15781
+ channels.map((channel) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("fieldset", { disabled: busy, className: "dsh-partner-notification-channel", children: [
15782
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("legend", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { children: [
15783
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("input", { type: "checkbox", checked: selectedChannels.includes(channel.id), onChange: (e) => {
15340
15784
  setSelectedChannels((ids) => e.target.checked ? [...ids, channel.id] : ids.filter((id) => id !== channel.id));
15341
15785
  if (!e.target.checked) setTargets((items) => items.filter((t) => t.channelId !== channel.id));
15342
15786
  } }),
15343
15787
  channel.name,
15344
15788
  !channel.enabled ? "\uFF08\u5DF2\u505C\u7528\uFF09" : ""
15345
15789
  ] }) }),
15346
- selectedChannels.includes(channel.id) && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "dsh-partner-notification-users", children: [
15347
- !pairings.some((p) => p.channelId === channel.id && p.status === "approved") && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { children: "\u6682\u65E0\u5DF2\u6388\u6743\u63A5\u6536\u4EBA\uFF0C\u8BF7\u5148\u5728\u6E20\u9053\u914D\u7F6E\u4E2D\u6279\u51C6\u8054\u7CFB\u4EBA\u3002" }),
15348
- pairings.filter((p) => p.channelId === channel.id && p.status === "approved").map((p) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("label", { children: [
15349
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("input", { type: "checkbox", checked: targets.some((t) => t.channelId === p.channelId && t.userId === p.userId), onChange: (e) => setTargets((items) => e.target.checked ? [...items, { channelId: p.channelId, userId: p.userId }] : items.filter((t) => t.channelId !== p.channelId || t.userId !== p.userId)) }),
15350
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { children: [
15790
+ selectedChannels.includes(channel.id) && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-notification-users", children: [
15791
+ !pairings.some((p) => p.channelId === channel.id && p.status === "approved") && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: "\u6682\u65E0\u5DF2\u6388\u6743\u63A5\u6536\u4EBA\uFF0C\u8BF7\u5148\u5728\u6E20\u9053\u914D\u7F6E\u4E2D\u6279\u51C6\u8054\u7CFB\u4EBA\u3002" }),
15792
+ pairings.filter((p) => p.channelId === channel.id && p.status === "approved").map((p) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { children: [
15793
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("input", { type: "checkbox", checked: targets.some((t) => t.channelId === p.channelId && t.userId === p.userId), onChange: (e) => setTargets((items) => e.target.checked ? [...items, { channelId: p.channelId, userId: p.userId }] : items.filter((t) => t.channelId !== p.channelId || t.userId !== p.userId)) }),
15794
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { children: [
15351
15795
  p.displayName,
15352
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("small", { children: p.userId })
15796
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: p.userId })
15353
15797
  ] })
15354
15798
  ] }, p.id))
15355
15799
  ] })
15356
15800
  ] }, channel.id)),
15357
- unavailable.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { role: "alert", children: [
15358
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { children: "\u90E8\u5206\u5DF2\u9009\u63A5\u6536\u4EBA\u5DF2\u5931\u6548\u6216\u6E20\u9053\u5DF2\u505C\u7528\u3002\u8BF7\u79FB\u9664\u6216\u6062\u590D\u6388\u6743\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6539\u53D1\u5176\u4ED6\u4EBA\u3002" }),
15359
- unavailable.map((t) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("button", { type: "button", disabled: busy, onClick: () => {
15801
+ unavailable.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { role: "alert", children: [
15802
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: "\u90E8\u5206\u5DF2\u9009\u63A5\u6536\u4EBA\u5DF2\u5931\u6548\u6216\u6E20\u9053\u5DF2\u505C\u7528\u3002\u8BF7\u79FB\u9664\u6216\u6062\u590D\u6388\u6743\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6539\u53D1\u5176\u4ED6\u4EBA\u3002" }),
15803
+ unavailable.map((t) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("button", { type: "button", disabled: busy, onClick: () => {
15360
15804
  setTargets((items) => items.filter((x) => x.channelId !== t.channelId || x.userId !== t.userId));
15361
15805
  if (!targets.some((x) => x.channelId === t.channelId && x.userId !== t.userId)) setSelectedChannels((ids) => ids.filter((id) => id !== t.channelId));
15362
15806
  }, children: [
@@ -15365,27 +15809,27 @@ function NotificationSettings({ companion, snapshot, onChanged }) {
15365
15809
  ] }, JSON.stringify(t)))
15366
15810
  ] })
15367
15811
  ] }),
15368
- feedback && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { role: failed ? "alert" : "status", children: feedback }),
15369
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("footer", { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("button", { ref: saveRef, className: "is-primary", disabled: busy || mode === "selected" && (!targets.length || unavailable.length > 0 || emptyChannel), children: busy ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58\u901A\u77E5\u8BBE\u7F6E" }) })
15812
+ feedback && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { role: failed ? "alert" : "status", children: feedback }),
15813
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("footer", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { ref: saveRef, className: "is-primary", disabled: busy || mode === "selected" && (!targets.length || unavailable.length > 0 || emptyChannel), children: busy ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58\u901A\u77E5\u8BBE\u7F6E" }) })
15370
15814
  ] });
15371
15815
  }
15372
15816
 
15373
15817
  // src/ui/channels-panel.tsx
15374
- var import_jsx_runtime38 = require("react/jsx-runtime");
15818
+ var import_jsx_runtime42 = require("react/jsx-runtime");
15375
15819
  function ChannelsPanel({ companion, snapshot, onChanged, weixin }) {
15376
- const [platform, setPlatform] = (0, import_react41.useState)("matrix");
15377
- const [name, setName] = (0, import_react41.useState)("");
15378
- const [baseUrl, setBaseUrl] = (0, import_react41.useState)("");
15379
- const [targetId, setTargetId] = (0, import_react41.useState)("");
15380
- const [botToken, setToken] = (0, import_react41.useState)("");
15381
- const [authMode, setAuthMode] = (0, import_react41.useState)("password");
15382
- const [username, setUsername] = (0, import_react41.useState)(""), [password, setPassword] = (0, import_react41.useState)(""), [mfaToken, setMfaToken] = (0, import_react41.useState)("");
15383
- const [busy, setBusy] = (0, import_react41.useState)(false);
15384
- const [feedback, setFeedback] = (0, import_react41.useState)("");
15385
- const [deleting, setDeleting] = (0, import_react41.useState)();
15386
- const [adding, setAdding] = (0, import_react41.useState)(false);
15387
- const [fixedPlatform, setFixedPlatform] = (0, import_react41.useState)(false);
15388
- const [configuring, setConfiguring] = (0, import_react41.useState)();
15820
+ const [platform, setPlatform] = (0, import_react45.useState)("matrix");
15821
+ const [name, setName] = (0, import_react45.useState)("");
15822
+ const [baseUrl, setBaseUrl] = (0, import_react45.useState)("");
15823
+ const [targetId, setTargetId] = (0, import_react45.useState)("");
15824
+ const [botToken, setToken] = (0, import_react45.useState)("");
15825
+ const [authMode, setAuthMode] = (0, import_react45.useState)("password");
15826
+ const [username, setUsername] = (0, import_react45.useState)(""), [password, setPassword] = (0, import_react45.useState)(""), [mfaToken, setMfaToken] = (0, import_react45.useState)("");
15827
+ const [busy, setBusy] = (0, import_react45.useState)(false);
15828
+ const [feedback, setFeedback] = (0, import_react45.useState)("");
15829
+ const [deleting, setDeleting] = (0, import_react45.useState)();
15830
+ const [adding, setAdding] = (0, import_react45.useState)(false);
15831
+ const [fixedPlatform, setFixedPlatform] = (0, import_react45.useState)(false);
15832
+ const [configuring, setConfiguring] = (0, import_react45.useState)();
15389
15833
  const closeAdd = () => {
15390
15834
  setAdding(false);
15391
15835
  setToken("");
@@ -15429,19 +15873,19 @@ function ChannelsPanel({ companion, snapshot, onChanged, weixin }) {
15429
15873
  }
15430
15874
  setFeedback(save ? "\u8D26\u53F7\u5DF2\u4FDD\u5B58\u3002\u8BF7\u542F\u7528\u6E20\u9053\uFF0C\u518D\u5411\u673A\u5668\u4EBA\u53D1\u9001\u79C1\u804A\u6D88\u606F\uFF0C\u6838\u5BF9\u914D\u5BF9\u7801\u5E76\u6279\u51C6\u8054\u7CFB\u4EBA\u3002" : "\u8D26\u53F7\u9A8C\u8BC1\u901A\u8FC7\uFF0C\u53EF\u4EE5\u4FDD\u5B58\u3002");
15431
15875
  });
15432
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { id: "dsh-partner-channels", className: "dsh-partner-form is-channel dsh-partner-channels", children: [
15433
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-channel-toolbar", children: [
15434
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SectionHeading, { eyebrow: "CHANNELS", title: "\u6211\u7684\u6E20\u9053", detail: "\u67E5\u770B\u8FDE\u63A5\u72B6\u6001\uFF0C\u7BA1\u7406\u8054\u7CFB\u4EBA\u4E0E\u901A\u77E5\u6295\u9012\u3002" }),
15435
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", onClick: () => openAdd(), children: "\u6DFB\u52A0\u6E20\u9053" })
15876
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { id: "dsh-partner-channels", className: "dsh-partner-form is-channel dsh-partner-channels", children: [
15877
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-toolbar", children: [
15878
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SectionHeading, { eyebrow: "CHANNELS", title: "\u6211\u7684\u6E20\u9053", detail: "\u67E5\u770B\u8FDE\u63A5\u72B6\u6001\uFF0C\u7BA1\u7406\u8054\u7CFB\u4EBA\u4E0E\u901A\u77E5\u6295\u9012\u3002" }),
15879
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", onClick: () => openAdd(), children: "\u6DFB\u52A0\u6E20\u9053" })
15436
15880
  ] }),
15437
- !adding && feedback && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { role: "status", children: feedback }),
15438
- adding && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(WorkspaceDialog, { title: fixedPlatform ? `${platform === "matrix" ? "Matrix" : "Mattermost"} \u914D\u7F6E` : "\u6DFB\u52A0\u6E20\u9053", detail: platform === "matrix" ? "\u4EC5\u672A\u52A0\u5BC6\u7684\u53CC\u4EBA\u4F1A\u8BDD\u53EF\u83B7\u53D6\u914D\u5BF9\u7801\u3002\u8BF7\u65B0\u5EFA\u672A\u5F00\u542F\u7AEF\u5230\u7AEF\u52A0\u5BC6\u7684\u4F1A\u8BDD\uFF0C\u9080\u8BF7\u673A\u5668\u4EBA\u540E\u53D1\u9001\u6587\u5B57\u6D88\u606F\u3002" : "\u5148\u767B\u5F55\uFF0C\u518D\u5411\u673A\u5668\u4EBA\u53D1\u79C1\u804A\u6D88\u606F\uFF0C\u6838\u5BF9\u914D\u5BF9\u7801\u540E\u6388\u6743\u3002", close: () => {
15881
+ !adding && feedback && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { role: "status", children: feedback }),
15882
+ adding && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WorkspaceDialog, { title: fixedPlatform ? `${platform === "matrix" ? "Matrix" : "Mattermost"} \u914D\u7F6E` : "\u6DFB\u52A0\u6E20\u9053", detail: platform === "matrix" ? "\u4EC5\u672A\u52A0\u5BC6\u7684\u53CC\u4EBA\u4F1A\u8BDD\u53EF\u83B7\u53D6\u914D\u5BF9\u7801\u3002\u8BF7\u65B0\u5EFA\u672A\u5F00\u542F\u7AEF\u5230\u7AEF\u52A0\u5BC6\u7684\u4F1A\u8BDD\uFF0C\u9080\u8BF7\u673A\u5668\u4EBA\u540E\u53D1\u9001\u6587\u5B57\u6D88\u606F\u3002" : "\u5148\u767B\u5F55\uFF0C\u518D\u5411\u673A\u5668\u4EBA\u53D1\u79C1\u804A\u6D88\u606F\uFF0C\u6838\u5BF9\u914D\u5BF9\u7801\u540E\u6388\u6743\u3002", close: () => {
15439
15883
  if (!busy) closeAdd();
15440
- }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-channel-form", "aria-busy": busy, onSubmit: (event) => {
15884
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-channel-form", "aria-busy": busy, onSubmit: (event) => {
15441
15885
  event.preventDefault();
15442
15886
  void configure2(true);
15443
15887
  }, children: [
15444
- !fixedPlatform && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FormField2, { label: "\u5E73\u53F0", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("select", { autoFocus: true, disabled: busy, value: platform, onChange: (e) => {
15888
+ !fixedPlatform && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: "\u5E73\u53F0", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("select", { autoFocus: true, disabled: busy, value: platform, onChange: (e) => {
15445
15889
  setPlatform(e.target.value);
15446
15890
  setPassword("");
15447
15891
  setToken("");
@@ -15449,150 +15893,150 @@ function ChannelsPanel({ companion, snapshot, onChanged, weixin }) {
15449
15893
  setTargetId("");
15450
15894
  setFeedback("");
15451
15895
  }, children: [
15452
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("option", { value: "matrix", children: "Matrix" }),
15453
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("option", { value: "mattermost", children: "Mattermost" })
15896
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: "matrix", children: "Matrix" }),
15897
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: "mattermost", children: "Mattermost" })
15454
15898
  ] }) }),
15455
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FormField2, { label: "\u6E20\u9053\u540D\u79F0", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("input", { autoFocus: fixedPlatform, disabled: busy, maxLength: 80, value: name, onChange: (e) => setName(e.target.value), placeholder: `\u4F8B\u5982\uFF1A\u6211\u7684 ${platform === "matrix" ? "Matrix" : "Mattermost"}` }) }),
15456
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FormField2, { label: "\u670D\u52A1\u5668\u5730\u5740", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("input", { disabled: busy, required: true, type: "url", value: baseUrl, onChange: (e) => setBaseUrl(e.target.value), placeholder: "https://chat.example.com" }) }),
15457
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("details", { children: [
15458
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("summary", { children: "\u9AD8\u7EA7\u914D\u7F6E\uFF08\u53EF\u9009\uFF09" }),
15459
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FormField2, { label: platform === "matrix" ? "\u56FA\u5B9A\u623F\u95F4 ID" : "\u56FA\u5B9A DM \u4F1A\u8BDD ID", hint: "\u7559\u7A7A\u5219\u81EA\u52A8\u53D1\u73B0\u79C1\u804A\uFF0C\u901A\u8FC7\u914D\u5BF9\u6388\u6743\u3002\u586B\u5199\u540E\u4EC5\u76D1\u542C\u6307\u5B9A\u4F1A\u8BDD\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("input", { disabled: busy, value: targetId, onChange: (e) => setTargetId(e.target.value), placeholder: platform === "matrix" ? "!room:example.com" : "DM channel ID" }) })
15899
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: "\u6E20\u9053\u540D\u79F0", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { autoFocus: fixedPlatform, disabled: busy, maxLength: 80, value: name, onChange: (e) => setName(e.target.value), placeholder: `\u4F8B\u5982\uFF1A\u6211\u7684 ${platform === "matrix" ? "Matrix" : "Mattermost"}` }) }),
15900
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: "\u670D\u52A1\u5668\u5730\u5740", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { disabled: busy, required: true, type: "url", value: baseUrl, onChange: (e) => setBaseUrl(e.target.value), placeholder: "https://chat.example.com" }) }),
15901
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("details", { children: [
15902
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("summary", { children: "\u9AD8\u7EA7\u914D\u7F6E\uFF08\u53EF\u9009\uFF09" }),
15903
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: platform === "matrix" ? "\u56FA\u5B9A\u623F\u95F4 ID" : "\u56FA\u5B9A DM \u4F1A\u8BDD ID", hint: "\u7559\u7A7A\u5219\u81EA\u52A8\u53D1\u73B0\u79C1\u804A\uFF0C\u901A\u8FC7\u914D\u5BF9\u6388\u6743\u3002\u586B\u5199\u540E\u4EC5\u76D1\u542C\u6307\u5B9A\u4F1A\u8BDD\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { disabled: busy, value: targetId, onChange: (e) => setTargetId(e.target.value), placeholder: platform === "matrix" ? "!room:example.com" : "DM channel ID" }) })
15460
15904
  ] }),
15461
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FormField2, { label: "\u767B\u5F55\u65B9\u5F0F", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("select", { disabled: busy, value: authMode, onChange: (e) => {
15905
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: "\u767B\u5F55\u65B9\u5F0F", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("select", { disabled: busy, value: authMode, onChange: (e) => {
15462
15906
  setAuthMode(e.target.value);
15463
15907
  setToken("");
15464
15908
  setPassword("");
15465
15909
  setMfaToken("");
15466
15910
  }, children: [
15467
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("option", { value: "password", children: "\u8D26\u53F7\u5BC6\u7801" }),
15468
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("option", { value: "token", children: "Access Token" })
15911
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: "password", children: "\u8D26\u53F7\u5BC6\u7801" }),
15912
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: "token", children: "Access Token" })
15469
15913
  ] }) }),
15470
- authMode === "password" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
15471
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FormField2, { label: "\u8D26\u53F7", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("input", { disabled: busy, required: true, autoComplete: "username", value: username, onChange: (e) => setUsername(e.target.value), placeholder: platform === "matrix" ? "@\u8D26\u53F7:\u670D\u52A1\u5668\u57DF\u540D" : "\u7528\u6237\u540D\u6216\u90AE\u7BB1" }) }),
15472
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FormField2, { label: "\u5BC6\u7801", hint: "\u4EC5\u7528\u4E8E\u6362\u53D6\u4EE4\u724C\uFF0C\u4E0D\u4FDD\u5B58\u5BC6\u7801\uFF1B\u8BF7\u4F18\u5148\u4F7F\u7528 HTTPS \u670D\u52A1\u5668\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("input", { disabled: busy, required: true, type: "password", autoComplete: "current-password", value: password, onChange: (e) => setPassword(e.target.value) }) }),
15473
- platform === "mattermost" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FormField2, { label: "\u53CC\u91CD\u9A8C\u8BC1\u9A8C\u8BC1\u7801\uFF08\u5982\u5DF2\u5F00\u542F\uFF09", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("input", { disabled: busy, autoComplete: "one-time-code", inputMode: "numeric", value: mfaToken, onChange: (e) => setMfaToken(e.target.value) }) })
15474
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FormField2, { label: "Access Token", hint: "\u4EC5\u4FDD\u5B58\u81F3 DSH \u51ED\u636E\u5E93\uFF1B\u5EFA\u8BAE HTTPS\uFF0CHTTP \u4F1A\u660E\u6587\u4F20\u8F93\u51ED\u636E\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("input", { disabled: busy, required: true, type: "password", autoComplete: "new-password", value: botToken, onChange: (e) => setToken(e.target.value) }) }),
15475
- feedback && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { role: "status", children: feedback }),
15476
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("footer", { children: [
15477
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", disabled: busy, onClick: closeAdd, children: "\u53D6\u6D88" }),
15478
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", disabled: busy || !(authMode === "password" ? username && password : botToken) || !baseUrl, onClick: () => void configure2(false), children: "\u6D4B\u8BD5\u8FDE\u63A5" }),
15479
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { className: "is-primary", disabled: busy, children: busy ? "\u5904\u7406\u4E2D\u2026" : "\u4FDD\u5B58\u6E20\u9053" })
15914
+ authMode === "password" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
15915
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: "\u8D26\u53F7", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { disabled: busy, required: true, autoComplete: "username", value: username, onChange: (e) => setUsername(e.target.value), placeholder: platform === "matrix" ? "@\u8D26\u53F7:\u670D\u52A1\u5668\u57DF\u540D" : "\u7528\u6237\u540D\u6216\u90AE\u7BB1" }) }),
15916
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: "\u5BC6\u7801", hint: "\u4EC5\u7528\u4E8E\u6362\u53D6\u4EE4\u724C\uFF0C\u4E0D\u4FDD\u5B58\u5BC6\u7801\uFF1B\u8BF7\u4F18\u5148\u4F7F\u7528 HTTPS \u670D\u52A1\u5668\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { disabled: busy, required: true, type: "password", autoComplete: "current-password", value: password, onChange: (e) => setPassword(e.target.value) }) }),
15917
+ platform === "mattermost" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: "\u53CC\u91CD\u9A8C\u8BC1\u9A8C\u8BC1\u7801\uFF08\u5982\u5DF2\u5F00\u542F\uFF09", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { disabled: busy, autoComplete: "one-time-code", inputMode: "numeric", value: mfaToken, onChange: (e) => setMfaToken(e.target.value) }) })
15918
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: "Access Token", hint: "\u4EC5\u4FDD\u5B58\u81F3 DSH \u51ED\u636E\u5E93\uFF1B\u5EFA\u8BAE HTTPS\uFF0CHTTP \u4F1A\u660E\u6587\u4F20\u8F93\u51ED\u636E\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { disabled: busy, required: true, type: "password", autoComplete: "new-password", value: botToken, onChange: (e) => setToken(e.target.value) }) }),
15919
+ feedback && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { role: "status", children: feedback }),
15920
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("footer", { children: [
15921
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", disabled: busy, onClick: closeAdd, children: "\u53D6\u6D88" }),
15922
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", disabled: busy || !(authMode === "password" ? username && password : botToken) || !baseUrl, onClick: () => void configure2(false), children: "\u6D4B\u8BD5\u8FDE\u63A5" }),
15923
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { className: "is-primary", disabled: busy, children: busy ? "\u5904\u7406\u4E2D\u2026" : "\u4FDD\u5B58\u6E20\u9053" })
15480
15924
  ] })
15481
15925
  ] }) }),
15482
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-channel-list", children: [
15483
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-channel-row", children: [
15484
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
15485
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: "\u5FAE\u4FE1" }),
15486
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: channels.some((c) => !c.platform || c.platform === "weixin") ? "\u7BA1\u7406\u8FDE\u63A5\u4E0E\u79C1\u804A\u6388\u6743" : "\u5C1A\u672A\u8FDE\u63A5 \xB7 \u626B\u7801\u63A5\u5165" })
15926
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-list", children: [
15927
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-row", children: [
15928
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
15929
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: "\u5FAE\u4FE1" }),
15930
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: channels.some((c) => !c.platform || c.platform === "weixin") ? "\u7BA1\u7406\u8FDE\u63A5\u4E0E\u79C1\u804A\u6388\u6743" : "\u5C1A\u672A\u8FDE\u63A5 \xB7 \u626B\u7801\u63A5\u5165" })
15487
15931
  ] }),
15488
- channels.find((c) => !c.platform || c.platform === "weixin") && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChannelStatus, { channel: channels.find((c) => !c.platform || c.platform === "weixin") }),
15489
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", "aria-label": "\u914D\u7F6E\u5FAE\u4FE1", onClick: () => setConfiguring("weixin"), children: "\u914D\u7F6E" }),
15490
- configuring === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(WorkspaceDialog, { title: "\u5FAE\u4FE1\u914D\u7F6E", detail: "\u7BA1\u7406\u626B\u7801\u767B\u5F55\u3001\u8FDE\u63A5\u4E0E\u8054\u7CFB\u4EBA\u6388\u6743\u3002", close: () => setConfiguring(void 0), children: weixin })
15932
+ channels.find((c) => !c.platform || c.platform === "weixin") && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ChannelStatus, { channel: channels.find((c) => !c.platform || c.platform === "weixin") }),
15933
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", "aria-label": "\u914D\u7F6E\u5FAE\u4FE1", onClick: () => setConfiguring("weixin"), children: "\u914D\u7F6E" }),
15934
+ configuring === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WorkspaceDialog, { title: "\u5FAE\u4FE1\u914D\u7F6E", detail: "\u7BA1\u7406\u626B\u7801\u767B\u5F55\u3001\u8FDE\u63A5\u4E0E\u8054\u7CFB\u4EBA\u6388\u6743\u3002", close: () => setConfiguring(void 0), children: weixin })
15491
15935
  ] }),
15492
- ["matrix", "mattermost"].filter((platform2) => !channels.some((c) => c.platform === platform2)).map((platform2) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-channel-row", children: [
15493
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
15494
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: platform2 === "matrix" ? "Matrix" : "Mattermost" }),
15495
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "\u5C1A\u672A\u8FDE\u63A5" })
15936
+ ["matrix", "mattermost"].filter((platform2) => !channels.some((c) => c.platform === platform2)).map((platform2) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-row", children: [
15937
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
15938
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: platform2 === "matrix" ? "Matrix" : "Mattermost" }),
15939
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "\u5C1A\u672A\u8FDE\u63A5" })
15496
15940
  ] }),
15497
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", "aria-label": `\u914D\u7F6E ${platform2}`, onClick: () => openAdd(platform2), children: "\u914D\u7F6E" })
15941
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", "aria-label": `\u914D\u7F6E ${platform2}`, onClick: () => openAdd(platform2), children: "\u914D\u7F6E" })
15498
15942
  ] }, platform2)),
15499
- channels.filter((c) => c.platform && c.platform !== "weixin").map((channel) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-channel-row has-notice-slot", children: [
15500
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
15501
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: channel.name }),
15502
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("small", { children: [
15943
+ channels.filter((c) => c.platform && c.platform !== "weixin").map((channel) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-row has-notice-slot", children: [
15944
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
15945
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: channel.name }),
15946
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("small", { children: [
15503
15947
  channel.platform,
15504
15948
  " \xB7 ",
15505
15949
  pairings.filter((p) => p.channelId === channel.id && p.status === "pending").length,
15506
15950
  " \u4E2A\u5F85\u6388\u6743"
15507
15951
  ] })
15508
15952
  ] }),
15509
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChannelStatus, { channel }),
15510
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", "aria-label": `\u914D\u7F6E ${channel.name}`, onClick: () => {
15953
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ChannelStatus, { channel }),
15954
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", "aria-label": `\u914D\u7F6E ${channel.name}`, onClick: () => {
15511
15955
  setFeedback("");
15512
15956
  setConfiguring(channel.id);
15513
15957
  }, children: "\u914D\u7F6E" }),
15514
- configuring === channel.id && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(WorkspaceDialog, { title: `${channel.name} \xB7 \u914D\u7F6E`, detail: "\u7BA1\u7406\u8FDE\u63A5\u72B6\u6001\u53CA\u8054\u7CFB\u4EBA\u8BBF\u95EE\u6743\u9650\u3002", close: () => {
15958
+ configuring === channel.id && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WorkspaceDialog, { title: `${channel.name} \xB7 \u914D\u7F6E`, detail: "\u7BA1\u7406\u8FDE\u63A5\u72B6\u6001\u53CA\u8054\u7CFB\u4EBA\u8BBF\u95EE\u6743\u9650\u3002", close: () => {
15515
15959
  if (!busy) {
15516
15960
  setConfiguring(void 0);
15517
15961
  setDeleting(void 0);
15518
15962
  }
15519
- }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-channel-detail dsh-partner-channel-manage", children: [
15520
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-channel-connection", children: [
15521
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
15522
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: "\u767B\u5F55\u8D26\u53F7" }),
15523
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: channel.accountId }),
15524
- channel.direct?.targetId && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: channel.direct.targetId })
15963
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-detail dsh-partner-channel-manage", children: [
15964
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-connection", children: [
15965
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
15966
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "\u767B\u5F55\u8D26\u53F7" }),
15967
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: channel.accountId }),
15968
+ channel.direct?.targetId && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: channel.direct.targetId })
15525
15969
  ] }),
15526
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ChannelStatus, { channel })
15970
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ChannelStatus, { channel })
15527
15971
  ] }),
15528
- channel.platform === "matrix" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: "\u4EC5\u652F\u6301\u672A\u52A0\u5BC6\u7684\u53CC\u4EBA\u4F1A\u8BDD\u3002\u52A0\u5BC6\u4F1A\u8BDD\u65E0\u6CD5\u8BFB\u53D6\u6D88\u606F\u6216\u53D1\u9001\u914D\u5BF9\u7801\uFF1B\u8BF7\u65B0\u5EFA\u672A\u5F00\u542F\u7AEF\u5230\u7AEF\u52A0\u5BC6\u7684\u4F1A\u8BDD\uFF0C\u9080\u8BF7\u673A\u5668\u4EBA\u540E\u53D1\u9001\u6587\u5B57\u6D88\u606F\u3002\u68C0\u6D4B\u5230\u52A0\u5BC6\u4F1A\u8BDD\u65F6\u4F1A\u5728\u6B64\u63D0\u793A\uFF0C\u4E0D\u5F71\u54CD\u5176\u4ED6\u672A\u52A0\u5BC6\u4F1A\u8BDD\u3002" }),
15529
- !channel.direct?.targetId && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: "\u5411\u673A\u5668\u4EBA\u53D1\u79C1\u804A\u6D88\u606F\uFF0C\u5728\u4E0B\u65B9\u6838\u5BF9\u914D\u5BF9\u7801\u540E\u6279\u51C6\u3002\u8BF7\u6C42\u4F1A\u81EA\u52A8\u66F4\u65B0\u3002" }),
15530
- channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { role: "alert", children: channel.lastError }),
15531
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-form-actions", children: [
15532
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
15972
+ channel.platform === "matrix" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: "\u4EC5\u652F\u6301\u672A\u52A0\u5BC6\u7684\u53CC\u4EBA\u4F1A\u8BDD\u3002\u52A0\u5BC6\u4F1A\u8BDD\u65E0\u6CD5\u8BFB\u53D6\u6D88\u606F\u6216\u53D1\u9001\u914D\u5BF9\u7801\uFF1B\u8BF7\u65B0\u5EFA\u672A\u5F00\u542F\u7AEF\u5230\u7AEF\u52A0\u5BC6\u7684\u4F1A\u8BDD\uFF0C\u9080\u8BF7\u673A\u5668\u4EBA\u540E\u53D1\u9001\u6587\u5B57\u6D88\u606F\u3002\u68C0\u6D4B\u5230\u52A0\u5BC6\u4F1A\u8BDD\u65F6\u4F1A\u5728\u6B64\u63D0\u793A\uFF0C\u4E0D\u5F71\u54CD\u5176\u4ED6\u672A\u52A0\u5BC6\u4F1A\u8BDD\u3002" }),
15973
+ !channel.direct?.targetId && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: "\u5411\u673A\u5668\u4EBA\u53D1\u79C1\u804A\u6D88\u606F\uFF0C\u5728\u4E0B\u65B9\u6838\u5BF9\u914D\u5BF9\u7801\u540E\u6279\u51C6\u3002\u8BF7\u6C42\u4F1A\u81EA\u52A8\u66F4\u65B0\u3002" }),
15974
+ channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { role: "alert", children: channel.lastError }),
15975
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-form-actions", children: [
15976
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
15533
15977
  await api(`/channels/${channel.id}/enabled`, { method: "POST", body: JSON.stringify({ enabled: !channel.enabled }) });
15534
15978
  await onChanged();
15535
15979
  }), children: channel.enabled ? "\u505C\u7528" : "\u542F\u7528" }),
15536
- channel.enabled && channel.runtimeStatus === "error" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
15980
+ channel.enabled && channel.runtimeStatus === "error" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
15537
15981
  await api(`/channels/${channel.id}/enabled`, { method: "POST", body: JSON.stringify({ enabled: true }) });
15538
15982
  await onChanged();
15539
15983
  }), children: "\u91CD\u8FDE" }),
15540
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { disabled: busy, onClick: () => deleting === channel.id ? void run(async () => {
15984
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { disabled: busy, onClick: () => deleting === channel.id ? void run(async () => {
15541
15985
  await api(`/channels/${channel.id}`, { method: "DELETE" });
15542
15986
  setDeleting(void 0);
15543
15987
  await onChanged();
15544
15988
  }) : setDeleting(channel.id), children: deleting === channel.id ? "\u786E\u8BA4\u5220\u9664\u914D\u7F6E\u4E0E\u51ED\u636E" : "\u5220\u9664\u6E20\u9053" }),
15545
- deleting === channel.id && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { onClick: () => setDeleting(void 0), children: "\u53D6\u6D88" })
15989
+ deleting === channel.id && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { onClick: () => setDeleting(void 0), children: "\u53D6\u6D88" })
15546
15990
  ] }),
15547
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("section", { className: "dsh-partner-channel-access", children: [
15548
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h3", { children: "\u8054\u7CFB\u4EBA\u6388\u6743" }),
15549
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("p", { role: "status", children: [
15991
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("section", { className: "dsh-partner-channel-access", children: [
15992
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h3", { children: "\u8054\u7CFB\u4EBA\u6388\u6743" }),
15993
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("p", { role: "status", children: [
15550
15994
  pairings.filter((p) => p.channelId === channel.id && p.status === "pending").length,
15551
15995
  " \u4E2A\u7B49\u5F85\u6279\u51C6 \xB7 \u81EA\u52A8\u5237\u65B0"
15552
15996
  ] }),
15553
- pairings.filter((p) => p.channelId === channel.id).map((p) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-channel-person", children: [
15554
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
15555
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: p.displayName }),
15556
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: p.status === "approved" ? "\u5DF2\u6388\u6743" : p.status === "pending" ? "\u7B49\u5F85\u6279\u51C6" : "\u5DF2\u963B\u6B62" }),
15557
- p.status === "pending" && p.pairingCode && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
15997
+ pairings.filter((p) => p.channelId === channel.id).map((p) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-person", children: [
15998
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { children: [
15999
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: p.displayName }),
16000
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: p.status === "approved" ? "\u5DF2\u6388\u6743" : p.status === "pending" ? "\u7B49\u5F85\u6279\u51C6" : "\u5DF2\u963B\u6B62" }),
16001
+ p.status === "pending" && p.pairingCode && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
15558
16002
  "\u914D\u5BF9\u7801 ",
15559
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("code", { children: p.pairingCode })
16003
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("code", { children: p.pairingCode })
15560
16004
  ] })
15561
16005
  ] }),
15562
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
16006
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
15563
16007
  await api(`/pairings/${p.id}/status`, { method: "POST", body: JSON.stringify({ status: p.status === "approved" ? "blocked" : "approved" }) });
15564
16008
  await onChanged();
15565
16009
  }), children: p.status === "approved" ? "\u64A4\u9500\u6388\u6743" : "\u6279\u51C6\u8054\u7CFB\u4EBA" })
15566
16010
  ] }, p.id))
15567
16011
  ] }),
15568
- feedback && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { role: "status", children: feedback })
16012
+ feedback && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { role: "status", children: feedback })
15569
16013
  ] }) }),
15570
- channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-channel-inline-notice", role: "status", "aria-atomic": "true", children: [
15571
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: channel.runtimeStatus === "running" ? "\u4F1A\u8BDD\u63D0\u793A" : "\u8FDE\u63A5\u63D0\u793A" }),
15572
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: channel.lastError })
16014
+ channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-inline-notice", role: "status", "aria-atomic": "true", children: [
16015
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: channel.runtimeStatus === "running" ? "\u4F1A\u8BDD\u63D0\u793A" : "\u8FDE\u63A5\u63D0\u793A" }),
16016
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: channel.lastError })
15573
16017
  ] })
15574
16018
  ] }, channel.id))
15575
16019
  ] }),
15576
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("section", { className: "dsh-partner-channel-notifications", "aria-label": "\u901A\u77E5\u8BBE\u7F6E", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "dsh-partner-channel-row", children: [
15577
- /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
15578
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("strong", { children: "\u901A\u77E5\u4E0E\u4EA4\u4ED8" }),
15579
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: companion.notificationDelivery?.mode === "selected" ? `\u5DF2\u6307\u5B9A ${companion.notificationDelivery.targets.length} \u4F4D\u63A5\u6536\u4EBA` : "\u9ED8\u8BA4\u8DDF\u968F\u6700\u8FD1\u6E20\u9053\u4E0E\u7528\u6237" })
16020
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("section", { className: "dsh-partner-channel-notifications", "aria-label": "\u901A\u77E5\u8BBE\u7F6E", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-row", children: [
16021
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
16022
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: "\u901A\u77E5\u4E0E\u4EA4\u4ED8" }),
16023
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: companion.notificationDelivery?.mode === "selected" ? `\u5DF2\u6307\u5B9A ${companion.notificationDelivery.targets.length} \u4F4D\u63A5\u6536\u4EBA` : "\u9ED8\u8BA4\u8DDF\u968F\u6700\u8FD1\u6E20\u9053\u4E0E\u7528\u6237" })
15580
16024
  ] }),
15581
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", onClick: () => setConfiguring("delivery"), children: "\u914D\u7F6E" })
16025
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", onClick: () => setConfiguring("delivery"), children: "\u914D\u7F6E" })
15582
16026
  ] }) }),
15583
- configuring === "delivery" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(WorkspaceDialog, { title: "\u901A\u77E5\u4E0E\u4EA4\u4ED8", detail: "\u9009\u62E9\u901A\u77E5\u6E20\u9053\uFF0C\u518D\u9009\u62E9\u5404\u6E20\u9053\u7684\u63A5\u6536\u4EBA\uFF1B\u652F\u6301\u540C\u65F6\u6295\u9012\u3002", close: () => setConfiguring(void 0), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(NotificationSettings, { companion, snapshot, onChanged }) })
16027
+ configuring === "delivery" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WorkspaceDialog, { title: "\u901A\u77E5\u4E0E\u4EA4\u4ED8", detail: "\u9009\u62E9\u901A\u77E5\u6E20\u9053\uFF0C\u518D\u9009\u62E9\u5404\u6E20\u9053\u7684\u63A5\u6536\u4EBA\uFF1B\u652F\u6301\u540C\u65F6\u6295\u9012\u3002", close: () => setConfiguring(void 0), children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(NotificationSettings, { companion, snapshot, onChanged }) })
15584
16028
  ] });
15585
16029
  }
15586
16030
  function FormField2({ label, hint, children }) {
15587
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("label", { className: "dsh-partner-channel-field", children: [
15588
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: label }),
16031
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { className: "dsh-partner-channel-field", children: [
16032
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: label }),
15589
16033
  children,
15590
- hint && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("small", { children: hint })
16034
+ hint && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: hint })
15591
16035
  ] });
15592
16036
  }
15593
16037
 
15594
16038
  // src/ui/use-channel-status.ts
15595
- var import_react42 = require("react");
16039
+ var import_react46 = require("react");
15596
16040
  var listeners2 = /* @__PURE__ */ new Set();
15597
16041
  var timer;
15598
16042
  var active;
@@ -15617,7 +16061,7 @@ async function poll() {
15617
16061
  }
15618
16062
  }
15619
16063
  function useChannelStatus(setSnapshot) {
15620
- (0, import_react42.useEffect)(() => {
16064
+ (0, import_react46.useEffect)(() => {
15621
16065
  const update = (value) => setSnapshot((previous3) => previous3 ? { ...previous3, ...value } : previous3);
15622
16066
  listeners2.add(update);
15623
16067
  lastValue = "";
@@ -15771,12 +16215,12 @@ var form_surface_default = `/* Deliberate, local boundary against host themes wi
15771
16215
  `;
15772
16216
 
15773
16217
  // src/ui/companion-create.tsx
15774
- var import_react43 = require("react");
15775
- var import_dsh_client_ui_primitives20 = require("@deepseek-ai/dsh-client-ui-primitives");
15776
- var import_jsx_runtime39 = require("react/jsx-runtime");
16218
+ var import_react47 = require("react");
16219
+ var import_dsh_client_ui_primitives22 = require("@deepseek-ai/dsh-client-ui-primitives");
16220
+ var import_jsx_runtime43 = require("react/jsx-runtime");
15777
16221
  function CompanionCreateDialog({ close, create }) {
15778
- const [busy, setBusy] = (0, import_react43.useState)(false);
15779
- const [error, setError] = (0, import_react43.useState)();
16222
+ const [busy, setBusy] = (0, import_react47.useState)(false);
16223
+ const [error, setError] = (0, import_react47.useState)();
15780
16224
  const submit = async (event) => {
15781
16225
  event.preventDefault();
15782
16226
  const data = new FormData(event.currentTarget);
@@ -15795,30 +16239,30 @@ function CompanionCreateDialog({ close, create }) {
15795
16239
  setBusy(false);
15796
16240
  }
15797
16241
  };
15798
- return /* @__PURE__ */ (0, import_jsx_runtime39.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_runtime39.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-companion-create-form", "aria-busy": busy, onSubmit: (event) => {
16242
+ return /* @__PURE__ */ (0, import_jsx_runtime43.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_runtime43.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-companion-create-form", "aria-busy": busy, onSubmit: (event) => {
15799
16243
  void submit(event);
15800
16244
  }, children: [
15801
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { children: [
15802
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: "\u4F19\u4F34\u540D\u5B57" }),
15803
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("input", { name: "name", required: true, maxLength: 60, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u5C0F\u9ED1" })
16245
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { children: [
16246
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: "\u4F19\u4F34\u540D\u5B57" }),
16247
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("input", { name: "name", required: true, maxLength: 60, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u5C0F\u9ED1" })
15804
16248
  ] }),
15805
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { children: [
15806
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: "\u4E3B\u8981\u89D2\u8272" }),
15807
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("input", { name: "role", required: true, maxLength: 120, placeholder: "\u4F8B\u5982\uFF1A\u4EA7\u54C1\u4E0E\u5DE5\u7A0B\u534F\u4F5C\u4F19\u4F34" })
16249
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { children: [
16250
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: "\u4E3B\u8981\u89D2\u8272" }),
16251
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("input", { name: "role", required: true, maxLength: 120, placeholder: "\u4F8B\u5982\uFF1A\u4EA7\u54C1\u4E0E\u5DE5\u7A0B\u534F\u4F5C\u4F19\u4F34" })
15808
16252
  ] }),
15809
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "is-wide", children: [
15810
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D" }),
15811
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("input", { name: "description", maxLength: 500, placeholder: "\u5B83\u4E3B\u8981\u8D1F\u8D23\u4EC0\u4E48\uFF0C\u4EC0\u4E48\u65F6\u5019\u5E94\u8BE5\u627E\u5B83" })
16253
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { className: "is-wide", children: [
16254
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D" }),
16255
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("input", { name: "description", maxLength: 500, placeholder: "\u5B83\u4E3B\u8981\u8D1F\u8D23\u4EC0\u4E48\uFF0C\u4EC0\u4E48\u65F6\u5019\u5E94\u8BE5\u627E\u5B83" })
15812
16256
  ] }),
15813
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("label", { className: "is-wide", children: [
15814
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: "\u521D\u59CB\u884C\u4E3A\u51C6\u5219" }),
15815
- /* @__PURE__ */ (0, import_jsx_runtime39.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" })
16257
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { className: "is-wide", children: [
16258
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: "\u521D\u59CB\u884C\u4E3A\u51C6\u5219" }),
16259
+ /* @__PURE__ */ (0, import_jsx_runtime43.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" })
15816
16260
  ] }),
15817
- error && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(WorkspaceNotice, { children: error }),
15818
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("footer", { children: [
15819
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
15820
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
15821
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_dsh_client_ui_primitives20.IconPlusOutline16, { size: 14 }),
16261
+ error && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(WorkspaceNotice, { children: error }),
16262
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("footer", { children: [
16263
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
16264
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
16265
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_dsh_client_ui_primitives22.IconPlusOutline16, { size: 14 }),
15822
16266
  busy ? "\u6B63\u5728\u521B\u5EFA\u2026" : "\u521B\u5EFA\u4F19\u4F34"
15823
16267
  ] })
15824
16268
  ] })
@@ -15826,7 +16270,7 @@ function CompanionCreateDialog({ close, create }) {
15826
16270
  }
15827
16271
 
15828
16272
  // src/main-panel-compat.ts
15829
- var import_react44 = require("react");
16273
+ var import_react48 = require("react");
15830
16274
  function registerMainPanel(ctx, id, priority, render, onHidden = () => {
15831
16275
  }) {
15832
16276
  const layout = ctx.layout;
@@ -15837,7 +16281,7 @@ function registerMainPanel(ctx, id, priority, render, onHidden = () => {
15837
16281
  let disposed = false;
15838
16282
  let generation = 0;
15839
16283
  const Body = (props) => {
15840
- (0, import_react44.useEffect)(() => {
16284
+ (0, import_react48.useEffect)(() => {
15841
16285
  const current2 = ++generation;
15842
16286
  return () => {
15843
16287
  queueMicrotask(() => {
@@ -15944,10 +16388,10 @@ function sessions(ctx) {
15944
16388
  }
15945
16389
 
15946
16390
  // src/ui/workspace-navigation.tsx
15947
- var import_dsh_client_ui_primitives21 = require("@deepseek-ai/dsh-client-ui-primitives");
16391
+ var import_dsh_client_ui_primitives23 = require("@deepseek-ai/dsh-client-ui-primitives");
15948
16392
 
15949
16393
  // src/ui/storage-settings.tsx
15950
- var import_react45 = require("react");
16394
+ var import_react49 = require("react");
15951
16395
 
15952
16396
  // src/ui/storage-recovery.ts
15953
16397
  var StorageStatusError = class extends Error {
@@ -15995,16 +16439,16 @@ async function waitForStorage(signal, onWait, options = {}) {
15995
16439
  }
15996
16440
 
15997
16441
  // src/ui/storage-settings.tsx
15998
- var import_jsx_runtime40 = require("react/jsx-runtime");
16442
+ var import_jsx_runtime44 = require("react/jsx-runtime");
15999
16443
  function GeneralSettingsPanel() {
16000
- const [version, setVersion] = (0, import_react45.useState)();
16001
- const [inspection, setInspection] = (0, import_react45.useState)();
16002
- const [busy, setBusy] = (0, import_react45.useState)(false), [confirm, setConfirm] = (0, import_react45.useState)(false);
16003
- const [error, setError] = (0, import_react45.useState)(""), [notice, setNotice] = (0, import_react45.useState)("");
16004
- const request = (0, import_react45.useRef)();
16005
- const mounted = (0, import_react45.useRef)(true);
16006
- const [reconnect, setReconnect] = (0, import_react45.useState)(false);
16007
- const [cleanupPending, setCleanupPending] = (0, import_react45.useState)(0);
16444
+ const [version, setVersion] = (0, import_react49.useState)();
16445
+ const [inspection, setInspection] = (0, import_react49.useState)();
16446
+ const [busy, setBusy] = (0, import_react49.useState)(false), [confirm, setConfirm] = (0, import_react49.useState)(false);
16447
+ const [error, setError] = (0, import_react49.useState)(""), [notice, setNotice] = (0, import_react49.useState)("");
16448
+ const request = (0, import_react49.useRef)();
16449
+ const mounted = (0, import_react49.useRef)(true);
16450
+ const [reconnect, setReconnect] = (0, import_react49.useState)(false);
16451
+ const [cleanupPending, setCleanupPending] = (0, import_react49.useState)(0);
16008
16452
  const cleanup = version === 1 && cleanupPending > 0;
16009
16453
  const recover = async (expected = pendingStorageRecovery()) => {
16010
16454
  request.current?.abort();
@@ -16035,7 +16479,7 @@ function GeneralSettingsPanel() {
16035
16479
  if (!controller.signal.aborted) setBusy(false);
16036
16480
  }
16037
16481
  };
16038
- (0, import_react45.useEffect)(() => {
16482
+ (0, import_react49.useEffect)(() => {
16039
16483
  mounted.current = true;
16040
16484
  void recover();
16041
16485
  return () => {
@@ -16072,16 +16516,16 @@ function GeneralSettingsPanel() {
16072
16516
  }
16073
16517
  if (mounted.current) await recover(expected);
16074
16518
  };
16075
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("section", { className: "dsh-partner-general-settings", "aria-busy": busy, children: [
16076
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("h2", { children: "\u57FA\u672C\u8BBE\u7F6E" }),
16077
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(WorkspaceBlock, { title: "\u5347\u7EA7\u8FC1\u79FB", detail: "\u624B\u52A8\u6574\u7406\u516C\u5171\u6570\u636E\u548C\u6BCF\u4F4D\u4F19\u4F34\u7684\u79C1\u6709\u76EE\u5F55\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6267\u884C\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { type: "button", disabled: busy, onClick: () => void inspect(), children: busy ? "\u5904\u7406\u4E2D\u2026" : "\u68C0\u67E5\u8FC1\u79FB" }), children: [
16078
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("p", { children: [
16519
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("section", { className: "dsh-partner-general-settings", "aria-busy": busy, children: [
16520
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h2", { children: "\u57FA\u672C\u8BBE\u7F6E" }),
16521
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(WorkspaceBlock, { title: "\u5347\u7EA7\u8FC1\u79FB", detail: "\u624B\u52A8\u6574\u7406\u516C\u5171\u6570\u636E\u548C\u6BCF\u4F4D\u4F19\u4F34\u7684\u79C1\u6709\u76EE\u5F55\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6267\u884C\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", disabled: busy, onClick: () => void inspect(), children: busy ? "\u5904\u7406\u4E2D\u2026" : "\u68C0\u67E5\u8FC1\u79FB" }), children: [
16522
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { children: [
16079
16523
  "\u6570\u636E\u5B58\u50A8\u7248\u672C\uFF1A",
16080
16524
  version === void 0 ? "\u6B63\u5728\u8BFB\u53D6\u2026" : `v${version}${version === 0 ? " \xB7 \u5F85\u8FC1\u79FB" : " \xB7 \u5DF2\u5347\u7EA7"}`
16081
16525
  ] }),
16082
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { children: "\u5347\u7EA7\u524D\u8BF7\u7ED3\u675F\u4F19\u4F34\u4F1A\u8BDD\u548C\u540E\u53F0\u6267\u884C\u3002\u5B8C\u6574\u5907\u4EFD\u5E76\u6821\u9A8C\u540E\u624D\u6E05\u7406\u5DF2\u8FC1\u79FB\u7684\u65E7\u8DEF\u5F84\uFF0C\u4E0D\u4FEE\u6539\u7528\u6237\u5DE5\u4F5C\u6587\u6863\uFF1B\u670D\u52A1\u91CD\u8F7D\u540E\u81EA\u52A8\u91CD\u65B0\u8FDE\u63A5\u3002" }),
16083
- inspection && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
16084
- inspection.steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("p", { children: [
16526
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { children: "\u5347\u7EA7\u524D\u8BF7\u7ED3\u675F\u4F19\u4F34\u4F1A\u8BDD\u548C\u540E\u53F0\u6267\u884C\u3002\u5B8C\u6574\u5907\u4EFD\u5E76\u6821\u9A8C\u540E\u624D\u6E05\u7406\u5DF2\u8FC1\u79FB\u7684\u65E7\u8DEF\u5F84\uFF0C\u4E0D\u4FEE\u6539\u7528\u6237\u5DE5\u4F5C\u6587\u6863\uFF1B\u670D\u52A1\u91CD\u8F7D\u540E\u81EA\u52A8\u91CD\u65B0\u8FDE\u63A5\u3002" }),
16527
+ inspection && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
16528
+ inspection.steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { children: [
16085
16529
  "v",
16086
16530
  step.from,
16087
16531
  " \u2192 v",
@@ -16089,78 +16533,79 @@ function GeneralSettingsPanel() {
16089
16533
  " \xB7 ",
16090
16534
  step.title
16091
16535
  ] }, step.id)),
16092
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("details", { children: [
16093
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("summary", { children: "\u67E5\u770B\u76EE\u5F55\u4E0E\u68C0\u67E5\u8BE6\u60C5" }),
16094
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "dsh-partner-migration-paths", children: inspection.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { children: [
16095
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("strong", { children: item.label }),
16096
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("code", { children: item.source }),
16097
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: "\u8FC1\u79FB\u81F3" }),
16098
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("code", { children: item.target }),
16099
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("small", { children: item.exists ? `${item.files} \u4E2A\u6587\u4EF6 \xB7 ${(item.bytes / 1024 / 1024).toFixed(2)} MB` : "\u5F53\u524D\u65E0\u6587\u4EF6" })
16536
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("details", { children: [
16537
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("summary", { children: "\u67E5\u770B\u76EE\u5F55\u4E0E\u68C0\u67E5\u8BE6\u60C5" }),
16538
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "dsh-partner-migration-paths", children: inspection.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { children: [
16539
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("strong", { children: item.label }),
16540
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("code", { children: item.source }),
16541
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: "\u8FC1\u79FB\u81F3" }),
16542
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("code", { children: item.target }),
16543
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("small", { children: item.exists ? `${item.files} \u4E2A\u6587\u4EF6 \xB7 ${(item.bytes / 1024 / 1024).toFixed(2)} MB` : "\u5F53\u524D\u65E0\u6587\u4EF6" })
16100
16544
  ] }, i)) }),
16101
- inspection.notices.map((text4, i) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { children: text4 }, i))
16545
+ inspection.notices.map((text4, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { children: text4 }, i))
16102
16546
  ] }),
16103
- !!inspection.blockers.length && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { role: "alert", children: [
16104
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { children: "\u4EE5\u4E0B\u95EE\u9898\u9700\u8981\u5148\u5904\u7406\uFF1A" }),
16105
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("ul", { children: inspection.blockers.map((text4, i) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("li", { children: text4 }, i)) })
16547
+ !!inspection.blockers.length && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { role: "alert", children: [
16548
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { children: "\u4EE5\u4E0B\u95EE\u9898\u9700\u8981\u5148\u5904\u7406\uFF1A" }),
16549
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("ul", { children: inspection.blockers.map((text4, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("li", { children: text4 }, i)) })
16106
16550
  ] }),
16107
- inspection.migrationAvailable && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => setConfirm(true), children: "\u5347\u7EA7\u8FC1\u79FB" })
16551
+ inspection.migrationAvailable && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => setConfirm(true), children: "\u5347\u7EA7\u8FC1\u79FB" })
16108
16552
  ] }),
16109
- error && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { role: "alert", children: error }),
16110
- notice && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { role: "status", children: notice }),
16111
- reconnect && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { type: "button", disabled: busy, onClick: () => void recover(), children: "\u91CD\u65B0\u8FDE\u63A5" }),
16112
- cleanup && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(true), children: "\u91CD\u8BD5\u6E05\u7406\u65E7\u8DEF\u5F84" })
16553
+ error && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { role: "alert", children: error }),
16554
+ notice && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { role: "status", children: notice }),
16555
+ reconnect && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", disabled: busy, onClick: () => void recover(), children: "\u91CD\u65B0\u8FDE\u63A5" }),
16556
+ cleanup && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(true), children: "\u91CD\u8BD5\u6E05\u7406\u65E7\u8DEF\u5F84" })
16113
16557
  ] }),
16114
- confirm && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(WorkspaceDialog, { title: cleanup ? "\u786E\u8BA4\u6E05\u7406\u65E7\u8DEF\u5F84" : "\u786E\u8BA4\u5347\u7EA7\u8FC1\u79FB", detail: cleanup ? "\u91CD\u65B0\u6838\u5BF9\u5B8C\u6574\u5907\u4EFD\uFF0C\u53EA\u6E05\u7406\u672A\u53D8\u5316\u7684\u65E7\u6587\u4EF6\uFF0C\u4E0D\u91CD\u65B0\u8FC1\u79FB\u6D3B\u52A8\u6570\u636E\u3002" : "\u516C\u5171\u6570\u636E\u4E0E\u6240\u6709\u4F19\u4F34\u79C1\u6709\u6570\u636E\u5C06\u4E00\u8D77\u8FC1\u79FB\uFF0C\u5168\u90E8\u6821\u9A8C\u540E\u624D\u5207\u6362\u76EE\u5F55\u7248\u672C\u3002", close: () => {
16558
+ confirm && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(WorkspaceDialog, { title: cleanup ? "\u786E\u8BA4\u6E05\u7406\u65E7\u8DEF\u5F84" : "\u786E\u8BA4\u5347\u7EA7\u8FC1\u79FB", detail: cleanup ? "\u91CD\u65B0\u6838\u5BF9\u5B8C\u6574\u5907\u4EFD\uFF0C\u53EA\u6E05\u7406\u672A\u53D8\u5316\u7684\u65E7\u6587\u4EF6\uFF0C\u4E0D\u91CD\u65B0\u8FC1\u79FB\u6D3B\u52A8\u6570\u636E\u3002" : "\u516C\u5171\u6570\u636E\u4E0E\u6240\u6709\u4F19\u4F34\u79C1\u6709\u6570\u636E\u5C06\u4E00\u8D77\u8FC1\u79FB\uFF0C\u5168\u90E8\u6821\u9A8C\u540E\u624D\u5207\u6362\u76EE\u5F55\u7248\u672C\u3002", close: () => {
16115
16559
  if (!busy) setConfirm(false);
16116
- }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("form", { className: "dsh-partner-feature-form", onSubmit: (event) => {
16560
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("form", { className: "dsh-partner-feature-form", onSubmit: (event) => {
16117
16561
  event.preventDefault();
16118
16562
  void migrate();
16119
16563
  }, children: [
16120
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "is-wide", children: "\u5148\u5B8C\u6574\u5907\u4EFD\uFF0C\u7248\u672C\u63D0\u4EA4\u540E\u6E05\u7406\u5DF2\u6838\u9A8C\u7684\u65E7\u8DEF\u5F84\uFF1B\u5386\u53F2\u8BB0\u5FC6\u5907\u4EFD\u4F1A\u539F\u6837\u5F52\u6863\u3002\u5907\u4EFD\u4E0D\u4F1A\u81EA\u52A8\u5220\u9664\u3002\u8FC1\u79FB\u671F\u95F4\u8BF7\u52FF\u7F16\u8F91\u6587\u4EF6\u3001\u4FEE\u6539\u63D2\u4EF6\u914D\u7F6E\u6216\u542F\u52A8\u5176\u4ED6\u5B9E\u4F8B\u3002" }),
16121
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "is-wide", children: "\u8D26\u53F7\u51ED\u636E\u548C\u5BBF\u4E3B\u4F1A\u8BDD\u4E0D\u642C\u52A8\u3002\u5347\u7EA7\u540E\u4E0D\u8981\u76F4\u63A5\u5B89\u88C5\u4E0D\u652F\u6301\u65B0\u7248\u5B58\u50A8\u7684\u65E7\u63D2\u4EF6\u3002" }),
16122
- /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("footer", { children: [
16123
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(false), children: "\u53D6\u6D88" }),
16124
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u6B63\u5728\u5904\u7406\uFF0C\u8BF7\u52FF\u5173\u95ED\u2026" : cleanup ? "\u786E\u8BA4\u6E05\u7406\u5DF2\u5907\u4EFD\u7684\u65E7\u8DEF\u5F84" : "\u786E\u8BA4\u8FC1\u79FB\u76EE\u5F55\u548C\u6570\u636E" })
16564
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "is-wide", children: "\u5148\u5B8C\u6574\u5907\u4EFD\uFF0C\u7248\u672C\u63D0\u4EA4\u540E\u6E05\u7406\u5DF2\u6838\u9A8C\u7684\u65E7\u8DEF\u5F84\uFF1B\u5386\u53F2\u8BB0\u5FC6\u5907\u4EFD\u4F1A\u539F\u6837\u5F52\u6863\u3002\u5907\u4EFD\u4E0D\u4F1A\u81EA\u52A8\u5220\u9664\u3002\u8FC1\u79FB\u671F\u95F4\u8BF7\u52FF\u7F16\u8F91\u6587\u4EF6\u3001\u4FEE\u6539\u63D2\u4EF6\u914D\u7F6E\u6216\u542F\u52A8\u5176\u4ED6\u5B9E\u4F8B\u3002" }),
16565
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "is-wide", children: "\u8D26\u53F7\u51ED\u636E\u548C\u5BBF\u4E3B\u4F1A\u8BDD\u4E0D\u642C\u52A8\u3002\u5347\u7EA7\u540E\u4E0D\u8981\u76F4\u63A5\u5B89\u88C5\u4E0D\u652F\u6301\u65B0\u7248\u5B58\u50A8\u7684\u65E7\u63D2\u4EF6\u3002" }),
16566
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("footer", { children: [
16567
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(false), children: "\u53D6\u6D88" }),
16568
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u6B63\u5728\u5904\u7406\uFF0C\u8BF7\u52FF\u5173\u95ED\u2026" : cleanup ? "\u786E\u8BA4\u6E05\u7406\u5DF2\u5907\u4EFD\u7684\u65E7\u8DEF\u5F84" : "\u786E\u8BA4\u8FC1\u79FB\u76EE\u5F55\u548C\u6570\u636E" })
16125
16569
  ] })
16126
16570
  ] }) })
16127
16571
  ] });
16128
16572
  }
16129
16573
 
16130
16574
  // src/ui/workspace-navigation.tsx
16131
- var import_jsx_runtime41 = require("react/jsx-runtime");
16575
+ var import_jsx_runtime45 = require("react/jsx-runtime");
16132
16576
  var workspaceGroups = [
16133
- { id: "features", label: "\u529F\u80FD", detail: "\u80FD\u529B\u3001\u534F\u4F5C\u4E0E\u8BA1\u5212", icon: import_dsh_client_ui_primitives21.IconBrowseOutline16, pages: [
16134
- { id: "skills", label: "Skill \u5E02\u573A", icon: import_dsh_client_ui_primitives21.IconBrowseOutline16 },
16135
- { id: "board", label: "\u4EFB\u52A1\u770B\u677F", icon: import_dsh_client_ui_primitives21.IconListPenOutline16 },
16136
- { id: "schedules", label: "\u5B9A\u65F6\u4EFB\u52A1", icon: import_dsh_client_ui_primitives21.IconPlayOutline16 }
16577
+ { id: "features", label: "\u529F\u80FD", detail: "\u80FD\u529B\u3001\u534F\u4F5C\u4E0E\u8BA1\u5212", icon: import_dsh_client_ui_primitives23.IconBrowseOutline16, pages: [
16578
+ { id: "skills", label: "Skill \u5E02\u573A", icon: import_dsh_client_ui_primitives23.IconBrowseOutline16 },
16579
+ { id: "mcp", label: "MCP \u670D\u52A1", icon: import_dsh_client_ui_primitives23.IconBrowseOutline16 },
16580
+ { id: "board", label: "\u4EFB\u52A1\u770B\u677F", icon: import_dsh_client_ui_primitives23.IconListPenOutline16 },
16581
+ { id: "schedules", label: "\u5B9A\u65F6\u4EFB\u52A1", icon: import_dsh_client_ui_primitives23.IconPlayOutline16 }
16137
16582
  ] },
16138
- { id: "settings", label: "\u8BBE\u7F6E", detail: "\u57FA\u672C\u8BBE\u7F6E\u4E0E\u5361\u7247\u5916\u89C2", icon: import_dsh_client_ui_primitives21.IconEditOutline16, pages: [
16139
- { id: "general", label: "\u57FA\u672C\u8BBE\u7F6E", icon: import_dsh_client_ui_primitives21.IconEditOutline16 },
16140
- { id: "pendant", label: "\u5361\u7247\u8BBE\u7F6E", icon: import_dsh_client_ui_primitives21.IconEditOutline16 }
16583
+ { id: "settings", label: "\u8BBE\u7F6E", detail: "\u57FA\u672C\u8BBE\u7F6E\u4E0E\u5361\u7247\u5916\u89C2", icon: import_dsh_client_ui_primitives23.IconEditOutline16, pages: [
16584
+ { id: "general", label: "\u57FA\u672C\u8BBE\u7F6E", icon: import_dsh_client_ui_primitives23.IconEditOutline16 },
16585
+ { id: "pendant", label: "\u5361\u7247\u8BBE\u7F6E", icon: import_dsh_client_ui_primitives23.IconEditOutline16 }
16141
16586
  ] }
16142
16587
  ];
16143
16588
  var workspaceGroup = (page) => workspaceGroups.find((group) => group.pages.some((item) => item.id === page));
16144
16589
  function WorkspaceGroupLinks({ view, open, compact = false }) {
16145
16590
  const active2 = workspaceGroup(view);
16146
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_jsx_runtime41.Fragment, { children: workspaceGroups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("button", { type: "button", className: active2?.id === group.id ? "is-active" : "", "aria-current": active2?.id === group.id ? "page" : void 0, onClick: () => {
16591
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children: workspaceGroups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("button", { type: "button", className: active2?.id === group.id ? "is-active" : "", "aria-current": active2?.id === group.id ? "page" : void 0, onClick: () => {
16147
16592
  if (active2?.id !== group.id) open(group.pages[0].id);
16148
16593
  }, children: [
16149
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(group.icon, { size: 16 }) }),
16150
- compact ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: group.label }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
16151
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("strong", { children: group.label }),
16152
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: group.detail })
16594
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(group.icon, { size: 16 }) }),
16595
+ compact ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: group.label }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
16596
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("strong", { children: group.label }),
16597
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("small", { children: group.detail })
16153
16598
  ] })
16154
16599
  ] }, group.id)) });
16155
16600
  }
16156
16601
  function WorkspaceGroupTabs({ view, open }) {
16157
16602
  const group = workspaceGroup(view);
16158
16603
  if (!group) return null;
16159
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("nav", { className: "dsh-partner-tabs dsh-partner-group-tabs", "aria-label": `${group.label}\u6807\u7B7E\u9875`, children: group.pages.map((page) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TabButton, { active: view === page.id, onClick: () => open(page.id), icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(page.icon, { size: 16 }), children: page.label }, page.id)) });
16604
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("nav", { className: "dsh-partner-tabs dsh-partner-group-tabs", "aria-label": `${group.label}\u6807\u7B7E\u9875`, children: group.pages.map((page) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TabButton, { active: view === page.id, onClick: () => open(page.id), icon: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(page.icon, { size: 16 }), children: page.label }, page.id)) });
16160
16605
  }
16161
16606
 
16162
16607
  // src/client.tsx
16163
- var import_jsx_runtime42 = require("react/jsx-runtime");
16608
+ var import_jsx_runtime46 = require("react/jsx-runtime");
16164
16609
  var PLUGIN_ID = "@lemoncat7/dsh-partner";
16165
16610
  var STYLE_ID = `${PLUGIN_ID}/client`;
16166
16611
  var cssText = `${client_default}
@@ -16172,31 +16617,32 @@ ${widget_default}
16172
16617
  ${settings_panel_default}
16173
16618
  ${memory_ui_default}
16174
16619
  ${identity_editor_default}
16175
- ${form_surface_default}`;
16176
- var WORKSPACE_PAGES = /* @__PURE__ */ new Set(["skills", "board", "schedules", "pendant", "general"]);
16620
+ ${form_surface_default}
16621
+ ${mcp_default}`;
16622
+ var WORKSPACE_PAGES = /* @__PURE__ */ new Set(["skills", "mcp", "board", "schedules", "pendant", "general"]);
16177
16623
  var inject = ["slots", "layout", "sessions"];
16178
16624
  function apply(ctx) {
16179
16625
  ctx.effect(installStyles, "dsh-partner: styles");
16180
- const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PartnerWorkspace, { ...props, controller: current2 }));
16626
+ const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PartnerWorkspace, { ...props, controller: current2 }));
16181
16627
  if (pendingStorageRecovery() !== void 0) controller.open(void 0, { page: "general" });
16182
- ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PartnerPendant, { controller })));
16628
+ ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PartnerPendant, { controller })));
16183
16629
  ctx.effect(() => observePluginWorkspace(PLUGIN_ID, controller.close), "dsh-partner: exclusive workspace");
16184
16630
  ctx.effect(() => () => controller.close(), "dsh-partner: workspace lifecycle");
16185
16631
  ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({
16186
16632
  name: "sidebar.footer.action",
16187
16633
  id: "partner",
16188
16634
  order: -120
16189
- }, (props) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
16635
+ }, (props) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
16190
16636
  }
16191
16637
  function PartnerSidebar(props) {
16192
- const ref = (0, import_react46.useRef)(null);
16638
+ const ref = (0, import_react50.useRef)(null);
16193
16639
  useWorkspaceTopAnchor(ref);
16194
- const [open, setOpen] = (0, import_react46.useState)(true);
16195
- const [snapshot, setSnapshot] = (0, import_react46.useState)();
16640
+ const [open, setOpen] = (0, import_react50.useState)(true);
16641
+ const [snapshot, setSnapshot] = (0, import_react50.useState)();
16196
16642
  useChannelStatus(setSnapshot);
16197
- const [, update] = (0, import_react46.useState)(0);
16198
- (0, import_react46.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
16199
- (0, import_react46.useEffect)(() => {
16643
+ const [, update] = (0, import_react50.useState)(0);
16644
+ (0, import_react50.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
16645
+ (0, import_react50.useEffect)(() => {
16200
16646
  void loadPartner().then(setSnapshot).catch(() => {
16201
16647
  });
16202
16648
  }, [props.controller.isOpen()]);
@@ -16204,35 +16650,35 @@ function PartnerSidebar(props) {
16204
16650
  props.controller.open(id);
16205
16651
  if (props.wide && window.matchMedia("(max-width: 820px)").matches) props.collapse();
16206
16652
  };
16207
- if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime42.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_runtime42.jsx)(import_dsh_client_ui_primitives22.IconAgentPresetOutline16, { size: 18 }) }) });
16208
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
16209
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
16210
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconChevronDownOutline14, { size: 14 }) }),
16653
+ if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime46.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_runtime46.jsx)(import_dsh_client_ui_primitives24.IconAgentPresetOutline16, { size: 18 }) }) });
16654
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
16655
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
16656
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconChevronDownOutline14, { size: 14 }) }),
16211
16657
  "\u4F19\u4F34"
16212
16658
  ] }) }),
16213
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
16214
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconAgentPresetOutline16, { size: 16 }) }),
16215
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
16216
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
16217
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: snapshot ? `${snapshot.companions.length} \u4F4D\u4F19\u4F34 \xB7 ${snapshot.channels.filter((item) => item.runtimeStatus === "running").length} \u4E2A\u6E20\u9053\u5728\u7EBF` : "\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E\u6E20\u9053" })
16659
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
16660
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconAgentPresetOutline16, { size: 16 }) }),
16661
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
16662
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
16663
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: snapshot ? `${snapshot.companions.length} \u4F4D\u4F19\u4F34 \xB7 ${snapshot.channels.filter((item) => item.runtimeStatus === "running").length} \u4E2A\u6E20\u9053\u5728\u7EBF` : "\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E\u6E20\u9053" })
16218
16664
  ] }),
16219
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
16665
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
16220
16666
  ] }) }) })
16221
16667
  ] });
16222
16668
  }
16223
16669
  function PartnerWorkspace({ controller }) {
16224
- const [snapshot, setSnapshot] = (0, import_react46.useState)();
16670
+ const [snapshot, setSnapshot] = (0, import_react50.useState)();
16225
16671
  useChannelStatus(setSnapshot);
16226
- const [selectedId, setSelectedId] = (0, import_react46.useState)(controller.selected());
16227
- const [view, setView] = (0, import_react46.useState)(controller.destination()?.page ?? "home");
16228
- const [requestedDestination, setRequestedDestination] = (0, import_react46.useState)(controller.destination());
16229
- const [error, setError] = (0, import_react46.useState)();
16230
- const [loading, setLoading] = (0, import_react46.useState)(true);
16231
- const [creatingCompanion, setCreatingCompanion] = (0, import_react46.useState)(false);
16232
- const [notice, setNotice] = (0, import_react46.useState)();
16233
- const selectionRef = (0, import_react46.useRef)({ selectedId, companions: snapshot?.companions });
16672
+ const [selectedId, setSelectedId] = (0, import_react50.useState)(controller.selected());
16673
+ const [view, setView] = (0, import_react50.useState)(controller.destination()?.page ?? "home");
16674
+ const [requestedDestination, setRequestedDestination] = (0, import_react50.useState)(controller.destination());
16675
+ const [error, setError] = (0, import_react50.useState)();
16676
+ const [loading, setLoading] = (0, import_react50.useState)(true);
16677
+ const [creatingCompanion, setCreatingCompanion] = (0, import_react50.useState)(false);
16678
+ const [notice, setNotice] = (0, import_react50.useState)();
16679
+ const selectionRef = (0, import_react50.useRef)({ selectedId, companions: snapshot?.companions });
16234
16680
  selectionRef.current = { selectedId, companions: snapshot?.companions };
16235
- const refresh = (0, import_react46.useCallback)(async (throwOnError = false) => {
16681
+ const refresh = (0, import_react50.useCallback)(async (throwOnError = false) => {
16236
16682
  try {
16237
16683
  const next = await loadPartner();
16238
16684
  setSnapshot(next);
@@ -16245,10 +16691,10 @@ function PartnerWorkspace({ controller }) {
16245
16691
  setLoading(false);
16246
16692
  }
16247
16693
  }, []);
16248
- (0, import_react46.useEffect)(() => {
16694
+ (0, import_react50.useEffect)(() => {
16249
16695
  void refresh();
16250
16696
  }, [refresh]);
16251
- (0, import_react46.useEffect)(() => controller.subscribe(() => {
16697
+ (0, import_react50.useEffect)(() => controller.subscribe(() => {
16252
16698
  const next = controller.selected();
16253
16699
  if (next) setSelectedId(next);
16254
16700
  const destination = controller.destination();
@@ -16317,18 +16763,18 @@ function PartnerWorkspace({ controller }) {
16317
16763
  setSelectedId(id);
16318
16764
  setView("home");
16319
16765
  };
16320
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("main", { className: "dsh-partner-workspace", children: [
16321
- creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
16322
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("header", { className: "dsh-partner-topbar", children: [
16323
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
16324
- /* @__PURE__ */ (0, import_jsx_runtime42.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_runtime42.jsx)(import_dsh_client_ui_primitives22.IconChevronLeftOutline14, { size: 15 }) }),
16325
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconAgentPresetOutline16, { size: 18 }),
16326
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
16327
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: "\u4F19\u4F34" }),
16328
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u6D88\u606F\u6E20\u9053" })
16766
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("main", { className: "dsh-partner-workspace", children: [
16767
+ creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
16768
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { className: "dsh-partner-topbar", children: [
16769
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
16770
+ /* @__PURE__ */ (0, import_jsx_runtime46.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_runtime46.jsx)(import_dsh_client_ui_primitives24.IconChevronLeftOutline14, { size: 15 }) }),
16771
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconAgentPresetOutline16, { size: 18 }),
16772
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
16773
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: "\u4F19\u4F34" }),
16774
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u6D88\u606F\u6E20\u9053" })
16329
16775
  ] })
16330
16776
  ] }),
16331
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
16777
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
16332
16778
  MobileWorkspaceControls,
16333
16779
  {
16334
16780
  companions: snapshot?.companions ?? [],
@@ -16340,86 +16786,87 @@ function PartnerWorkspace({ controller }) {
16340
16786
  }
16341
16787
  )
16342
16788
  ] }),
16343
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-grid", children: [
16344
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("aside", { className: "dsh-partner-roster", children: [
16345
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-roster-title", children: [
16346
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
16347
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "COMPANIONS" }),
16348
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
16789
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-grid", children: [
16790
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("aside", { className: "dsh-partner-roster", children: [
16791
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-roster-title", children: [
16792
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
16793
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "COMPANIONS" }),
16794
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
16349
16795
  ] }),
16350
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconPlusOutline16, { size: 16 }) })
16796
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconPlusOutline16, { size: 16 }) })
16351
16797
  ] }),
16352
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
16798
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
16353
16799
  const channel = snapshot.channels.find((item) => item.companionId === companion.id);
16354
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
16355
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Avatar, { name: companion.name }),
16356
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
16357
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: companion.name }),
16358
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: companion.role })
16800
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
16801
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Avatar, { name: companion.name }),
16802
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
16803
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: companion.name }),
16804
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: companion.role })
16359
16805
  ] }),
16360
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
16806
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
16361
16807
  ] }, companion.id);
16362
16808
  }) }),
16363
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WorkspaceGroupLinks, { view, open: setView }) }),
16364
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-roster-note", children: [
16365
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconLinkOutline16, { size: 16 }),
16366
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
16367
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
16368
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "\u6E20\u9053\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
16809
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WorkspaceGroupLinks, { view, open: setView }) }),
16810
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-roster-note", children: [
16811
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconLinkOutline16, { size: 16 }),
16812
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
16813
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
16814
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "\u6E20\u9053\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
16369
16815
  ] })
16370
16816
  ] })
16371
16817
  ] }),
16372
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
16373
- loading ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
16374
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "dsh-partner-group-heading", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h1", { children: workspaceGroup(view)?.label }) }),
16375
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WorkspaceGroupTabs, { view, open: setView }),
16376
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
16377
- view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SkillsPanel, {}),
16378
- view === "board" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(RequirementBoard, { initialTaskId: requestedDestination?.taskId, openRequest: requestedDestination }),
16379
- view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] }),
16380
- view === "pendant" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PendantSettingsPanel, {}),
16381
- view === "general" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GeneralSettingsPanel, {})
16818
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
16819
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
16820
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-group-heading", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h1", { children: workspaceGroup(view)?.label }) }),
16821
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WorkspaceGroupTabs, { view, open: setView }),
16822
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
16823
+ view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SkillsPanel, {}),
16824
+ view === "mcp" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(McpPanel, {}),
16825
+ view === "board" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(RequirementBoard, { initialTaskId: requestedDestination?.taskId, openRequest: requestedDestination }),
16826
+ view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] }),
16827
+ view === "pendant" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PendantSettingsPanel, {}),
16828
+ view === "general" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(GeneralSettingsPanel, {})
16382
16829
  ] })
16383
- ] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime42.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_runtime42.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
16384
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-identity", children: [
16385
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Avatar, { name: selected.name }),
16386
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
16387
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "ACTIVE COMPANION" }),
16388
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h1", { children: selected.name }),
16389
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: selected.description || selected.role })
16830
+ ] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime46.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_runtime46.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
16831
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-identity", children: [
16832
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Avatar, { name: selected.name }),
16833
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
16834
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "ACTIVE COMPANION" }),
16835
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h1", { children: selected.name }),
16836
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: selected.description || selected.role })
16390
16837
  ] }),
16391
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
16838
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
16392
16839
  ] }),
16393
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
16394
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconAgentPresetOutline16, { size: 16 }), children: "\u603B\u89C8" }),
16395
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconEditOutline16, { size: 16 }), children: "\u8EAB\u4EFD" }),
16396
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconAgentPresetOutline16, { size: 16 }), children: "\u80FD\u529B" }),
16397
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconLinkOutline16, { size: 16 }), children: "\u6E20\u9053" }),
16398
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconDataOutline16, { size: 16 }), children: "\u8BB0\u5FC6" }),
16399
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TabButton, { active: view === "concerns", onClick: () => setView("concerns"), icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconBrowseOutline16, { size: 16 }), children: "\u6301\u7EED\u5173\u6CE8" })
16840
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
16841
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconAgentPresetOutline16, { size: 16 }), children: "\u603B\u89C8" }),
16842
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconEditOutline16, { size: 16 }), children: "\u8EAB\u4EFD" }),
16843
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconAgentPresetOutline16, { size: 16 }), children: "\u80FD\u529B" }),
16844
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconLinkOutline16, { size: 16 }), children: "\u6E20\u9053" }),
16845
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconDataOutline16, { size: 16 }), children: "\u8BB0\u5FC6" }),
16846
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TabButton, { active: view === "concerns", onClick: () => setView("concerns"), icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconBrowseOutline16, { size: 16 }), children: "\u6301\u7EED\u5173\u6CE8" })
16400
16847
  ] }),
16401
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
16402
- notice && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "dsh-partner-inline-notice", role: "status", children: notice }),
16403
- view === "home" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession }),
16404
- view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(IdentityEditor, { companion: selected, count: snapshot?.companions.length ?? 1, onChanged: () => refresh(true), onRemoved: companionRemoved }),
16405
- view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: () => refresh(true) }, selected.id),
16406
- view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ChannelsPanel, { companion: selected, snapshot, onChanged: refresh, weixin: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }) }, selected.id),
16407
- view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, startSession, renewSession, onChanged: refresh }, selected.id),
16408
- view === "concerns" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ConcernPanel, { companion: selected, snapshot, onChanged: refresh }, selected.id)
16848
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
16849
+ notice && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "dsh-partner-inline-notice", role: "status", children: notice }),
16850
+ view === "home" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession }),
16851
+ view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(IdentityEditor, { companion: selected, count: snapshot?.companions.length ?? 1, onChanged: () => refresh(true), onRemoved: companionRemoved }),
16852
+ view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: () => refresh(true) }, selected.id),
16853
+ view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ChannelsPanel, { companion: selected, snapshot, onChanged: refresh, weixin: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }) }, selected.id),
16854
+ view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, startSession, renewSession, onChanged: refresh }, selected.id),
16855
+ view === "concerns" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ConcernPanel, { companion: selected, snapshot, onChanged: refresh }, selected.id)
16409
16856
  ] })
16410
16857
  ] }),
16411
- error && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
16858
+ error && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
16412
16859
  ] })
16413
16860
  ] })
16414
16861
  ] });
16415
16862
  }
16416
16863
  function MobileWorkspaceControls({ companions, selectedId, view, openCompanion, openPage, createCompanion }) {
16417
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
16418
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
16419
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
16420
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconPlusOutline16, { size: 17 }) })
16864
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
16865
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
16866
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
16867
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconPlusOutline16, { size: 17 }) })
16421
16868
  ] }),
16422
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WorkspaceGroupLinks, { view, open: openPage, compact: true }) })
16869
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WorkspaceGroupLinks, { view, open: openPage, compact: true }) })
16423
16870
  ] });
16424
16871
  }
16425
16872
  function HomePanel({ companion, snapshot, navigate, openSession, startSession, renewSession }) {
@@ -16430,77 +16877,77 @@ function HomePanel({ companion, snapshot, navigate, openSession, startSession, r
16430
16877
  const approved = channel ? snapshot.pairings.filter((item) => item.channelId === channel.id && item.status === "approved").length : 0;
16431
16878
  const capabilities = companion.capabilities.map((item) => CAPABILITY_LABELS[item]);
16432
16879
  const online = channel?.runtimeStatus === "running";
16433
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-home", children: [
16434
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("header", { className: "dsh-partner-home-heading", children: [
16435
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
16436
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
16437
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u6E20\u9053\u5F85\u547D` : `${companion.name} \u5DF2\u51C6\u5907\u5C31\u7EEA` })
16880
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-home", children: [
16881
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { className: "dsh-partner-home-heading", children: [
16882
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
16883
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
16884
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u6E20\u9053\u5F85\u547D` : `${companion.name} \u5DF2\u51C6\u5907\u5C31\u7EEA` })
16438
16885
  ] }),
16439
- /* @__PURE__ */ (0, import_jsx_runtime42.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" })
16886
+ /* @__PURE__ */ (0, import_jsx_runtime46.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" })
16440
16887
  ] }),
16441
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
16442
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
16443
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Avatar, { name: companion.name }),
16444
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("i", {}) }),
16445
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WeixinGlyph, { large: true }) })
16888
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
16889
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
16890
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Avatar, { name: companion.name }),
16891
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("i", {}) }),
16892
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WeixinGlyph, { large: true }) })
16446
16893
  ] }),
16447
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
16448
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
16449
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("i", {}),
16894
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
16895
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
16896
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("i", {}),
16450
16897
  "\u6D88\u606F\u6E20\u9053 \xB7 ",
16451
16898
  channel?.platform === "matrix" ? "Matrix" : channel?.platform === "mattermost" ? "Mattermost" : "\u5FAE\u4FE1"
16452
16899
  ] }),
16453
- /* @__PURE__ */ (0, import_jsx_runtime42.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" }),
16454
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: !channel ? "\u8FDE\u63A5\u5FAE\u4FE1\u3001Matrix \u6216 Mattermost\uFF0C\u8054\u7CFB\u4EBA\u9996\u6B21\u53D1\u6D88\u606F\u9700\u6279\u51C6\u3002" : online ? "\u672C\u5730\u4E0E\u6240\u6709\u5DF2\u6388\u6743\u6E20\u9053\u5171\u7528\u4F19\u4F34\u4E3B\u5BF9\u8BDD\uFF0C\u56DE\u590D\u8FD4\u56DE\u6D88\u606F\u6765\u6E90\u3002" : channel.lastError || "\u6E20\u9053\u914D\u7F6E\u4ECD\u7136\u4FDD\u7559\uFF0C\u53EF\u4EE5\u968F\u65F6\u91CD\u65B0\u542F\u7528\u3002" }),
16455
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
16456
- /* @__PURE__ */ (0, import_jsx_runtime42.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" }),
16457
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: !channel ? "\u9009\u62E9\u6E20\u9053\u5E76\u8FDE\u63A5\u8D26\u53F7" : `${approved} \u4F4D\u8054\u7CFB\u4EBA \xB7 \u5171\u7528\u4E3B\u5BF9\u8BDD` })
16900
+ /* @__PURE__ */ (0, import_jsx_runtime46.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" }),
16901
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: !channel ? "\u8FDE\u63A5\u5FAE\u4FE1\u3001Matrix \u6216 Mattermost\uFF0C\u8054\u7CFB\u4EBA\u9996\u6B21\u53D1\u6D88\u606F\u9700\u6279\u51C6\u3002" : online ? "\u672C\u5730\u4E0E\u6240\u6709\u5DF2\u6388\u6743\u6E20\u9053\u5171\u7528\u4F19\u4F34\u4E3B\u5BF9\u8BDD\uFF0C\u56DE\u590D\u8FD4\u56DE\u6D88\u606F\u6765\u6E90\u3002" : channel.lastError || "\u6E20\u9053\u914D\u7F6E\u4ECD\u7136\u4FDD\u7559\uFF0C\u53EF\u4EE5\u968F\u65F6\u91CD\u65B0\u542F\u7528\u3002" }),
16902
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
16903
+ /* @__PURE__ */ (0, import_jsx_runtime46.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" }),
16904
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: !channel ? "\u9009\u62E9\u6E20\u9053\u5E76\u8FDE\u63A5\u8D26\u53F7" : `${approved} \u4F4D\u8054\u7CFB\u4EBA \xB7 \u5171\u7528\u4E3B\u5BF9\u8BDD` })
16458
16905
  ] })
16459
16906
  ] })
16460
16907
  ] }),
16461
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-home-details", children: [
16462
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("section", { className: "dsh-partner-home-profile", children: [
16463
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("header", { children: [
16464
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconUserOutline16, { size: 16 }) }),
16465
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { children: [
16466
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
16467
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: companion.role })
16908
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-home-details", children: [
16909
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { className: "dsh-partner-home-profile", children: [
16910
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { children: [
16911
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconUserOutline16, { size: 16 }) }),
16912
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
16913
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
16914
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: companion.role })
16468
16915
  ] }),
16469
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
16916
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
16470
16917
  ] }),
16471
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
16918
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
16472
16919
  ] }),
16473
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
16474
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("header", { children: [
16475
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconAgentPresetOutline16, { size: 16 }) }),
16476
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { children: [
16477
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
16478
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
16920
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
16921
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { children: [
16922
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconAgentPresetOutline16, { size: 16 }) }),
16923
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
16924
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
16925
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
16479
16926
  ] }),
16480
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
16927
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
16481
16928
  ] }),
16482
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
16929
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
16483
16930
  ] }),
16484
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
16485
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("header", { children: [
16486
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconDataOutline16, { size: 16 }) }),
16487
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { children: [
16488
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
16489
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: localSession?.archived ? "\u4F1A\u8BDD\u5DF2\u5F52\u6863" : "\u4F19\u4F34\u4F1A\u8BDD\u5DF2\u5EFA\u7ACB" })
16931
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
16932
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { children: [
16933
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconDataOutline16, { size: 16 }) }),
16934
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
16935
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
16936
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: localSession?.archived ? "\u4F1A\u8BDD\u5DF2\u5F52\u6863" : "\u4F19\u4F34\u4F1A\u8BDD\u5DF2\u5EFA\u7ACB" })
16490
16937
  ] }),
16491
- /* @__PURE__ */ (0, import_jsx_runtime42.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" })
16938
+ /* @__PURE__ */ (0, import_jsx_runtime46.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" })
16492
16939
  ] }),
16493
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: localSession ? `\u6700\u8FD1\u6D3B\u52A8\u4E8E ${relativeTime(localSession.lastMessageAt)}\uFF1B\u672C\u5730\u4E0E\u6E20\u9053\u5728\u8FD9\u91CC\u63A5\u7740\u804A\u3002` : "\u4F19\u4F34\u4F1A\u8BDD\u6B63\u5728\u521D\u59CB\u5316\uFF0C\u7A0D\u540E\u5373\u53EF\u6253\u5F00\u3002" })
16940
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: localSession ? `\u6700\u8FD1\u6D3B\u52A8\u4E8E ${relativeTime(localSession.lastMessageAt)}\uFF1B\u672C\u5730\u4E0E\u6E20\u9053\u5728\u8FD9\u91CC\u63A5\u7740\u804A\u3002` : "\u4F19\u4F34\u4F1A\u8BDD\u6B63\u5728\u521D\u59CB\u5316\uFF0C\u7A0D\u540E\u5373\u53EF\u6253\u5F00\u3002" })
16494
16941
  ] })
16495
16942
  ] })
16496
16943
  ] });
16497
16944
  }
16498
16945
  function WeixinPanel({ companion, snapshot, onChanged }) {
16499
16946
  const channel = snapshot.channels.find((item) => item.companionId === companion.id && (!item.platform || item.platform === "weixin"));
16500
- const [login, setLogin] = (0, import_react46.useState)();
16501
- const [busy, setBusy] = (0, import_react46.useState)(false);
16502
- const [error, setError] = (0, import_react46.useState)();
16503
- (0, import_react46.useEffect)(() => {
16947
+ const [login, setLogin] = (0, import_react50.useState)();
16948
+ const [busy, setBusy] = (0, import_react50.useState)(false);
16949
+ const [error, setError] = (0, import_react50.useState)();
16950
+ (0, import_react50.useEffect)(() => {
16504
16951
  if (!login || login.phase === "confirmed" || login.phase === "expired" || login.phase === "error") return;
16505
16952
  const timer2 = window.setInterval(() => {
16506
16953
  void api(`/weixin/login/${login.id}`).then(async (result) => {
@@ -16546,93 +16993,93 @@ function WeixinPanel({ companion, snapshot, onChanged }) {
16546
16993
  setError(errorMessage(reason));
16547
16994
  }
16548
16995
  };
16549
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
16550
- /* @__PURE__ */ (0, import_jsx_runtime42.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" }),
16551
- !channel && !login && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
16552
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WeixinGlyph, { large: true }) }),
16553
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
16554
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("strong", { children: [
16996
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
16997
+ /* @__PURE__ */ (0, import_jsx_runtime46.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" }),
16998
+ !channel && !login && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
16999
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WeixinGlyph, { large: true }) }),
17000
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
17001
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("strong", { children: [
16555
17002
  "\u628A ",
16556
17003
  companion.name,
16557
17004
  " \u5E26\u5230\u5FAE\u4FE1"
16558
17005
  ] }),
16559
- /* @__PURE__ */ (0, import_jsx_runtime42.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" }),
16560
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("ul", { children: [
16561
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
16562
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
16563
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
17006
+ /* @__PURE__ */ (0, import_jsx_runtime46.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" }),
17007
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("ul", { children: [
17008
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
17009
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
17010
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
16564
17011
  ] })
16565
17012
  ] }),
16566
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", disabled: busy, onClick: () => {
17013
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", disabled: busy, onClick: () => {
16567
17014
  void begin();
16568
17015
  }, children: busy ? "\u6B63\u5728\u7533\u8BF7\u4E8C\u7EF4\u7801\u2026" : "\u626B\u7801\u8FDE\u63A5\u5FAE\u4FE1" })
16569
17016
  ] }),
16570
- login && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
16571
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
16572
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
16573
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "WECHAT ILINK BOT" }),
16574
- /* @__PURE__ */ (0, import_jsx_runtime42.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" }),
16575
- /* @__PURE__ */ (0, import_jsx_runtime42.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") }),
16576
- (login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("button", { type: "button", onClick: () => {
17017
+ login && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
17018
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
17019
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
17020
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "WECHAT ILINK BOT" }),
17021
+ /* @__PURE__ */ (0, import_jsx_runtime46.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" }),
17022
+ /* @__PURE__ */ (0, import_jsx_runtime46.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") }),
17023
+ (login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("button", { type: "button", onClick: () => {
16577
17024
  setLogin(void 0);
16578
17025
  void begin();
16579
17026
  }, children: [
16580
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconRefreshOutline16, { size: 16 }),
17027
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconRefreshOutline16, { size: 16 }),
16581
17028
  "\u91CD\u65B0\u751F\u6210"
16582
17029
  ] })
16583
17030
  ] })
16584
17031
  ] }),
16585
- channel && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
16586
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
16587
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WeixinGlyph, { large: true }) }),
16588
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
16589
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "WECHAT CHANNEL" }),
16590
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: channel.name }),
16591
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: channel.accountId })
17032
+ channel && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
17033
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
17034
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WeixinGlyph, { large: true }) }),
17035
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
17036
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "WECHAT CHANNEL" }),
17037
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: channel.name }),
17038
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: channel.accountId })
16592
17039
  ] }),
16593
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ChannelStatus, { channel }),
16594
- /* @__PURE__ */ (0, import_jsx_runtime42.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: () => {
17040
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ChannelStatus, { channel }),
17041
+ /* @__PURE__ */ (0, import_jsx_runtime46.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: () => {
16595
17042
  void toggle();
16596
- }, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("i", {}) })
17043
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("i", {}) })
16597
17044
  ] }),
16598
- channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "dsh-partner-inline-error", children: channel.lastError }),
16599
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
16600
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
16601
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "ACCESS" }),
16602
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
17045
+ channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "dsh-partner-inline-error", children: channel.lastError }),
17046
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
17047
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
17048
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "ACCESS" }),
17049
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
16603
17050
  ] }),
16604
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("em", { children: [
17051
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("em", { children: [
16605
17052
  pairings.filter((item) => item.status === "pending").length,
16606
17053
  " \u4E2A\u5F85\u5904\u7406"
16607
17054
  ] })
16608
17055
  ] }),
16609
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime42.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_runtime42.jsxs)("article", { children: [
16610
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_dsh_client_ui_primitives22.IconUserOutline16, { size: 16 }) }),
16611
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { children: [
16612
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: pairing.displayName }),
16613
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("small", { children: [
17056
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime46.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_runtime46.jsxs)("article", { children: [
17057
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconUserOutline16, { size: 16 }) }),
17058
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
17059
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: pairing.displayName }),
17060
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("small", { children: [
16614
17061
  pairing.status === "pending" ? "\u7B49\u5F85\u5BA1\u6279" : pairing.status === "approved" ? "\u5DF2\u6388\u6743\u72EC\u7ACB\u4F1A\u8BDD" : "\u5DF2\u963B\u6B62",
16615
17062
  " \xB7 ",
16616
17063
  new Date(pairing.updatedAt).toLocaleString()
16617
17064
  ] })
16618
17065
  ] }),
16619
- pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
16620
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { onClick: () => {
17066
+ pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
17067
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { onClick: () => {
16621
17068
  void actPairing(pairing.id, "blocked");
16622
17069
  }, children: "\u62D2\u7EDD" }),
16623
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { className: "is-primary", onClick: () => {
17070
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { className: "is-primary", onClick: () => {
16624
17071
  void actPairing(pairing.id, "approved");
16625
17072
  }, children: "\u6279\u51C6" })
16626
17073
  ] }),
16627
- pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { onClick: () => {
17074
+ pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { onClick: () => {
16628
17075
  void actPairing(pairing.id, "blocked");
16629
17076
  }, children: "\u64A4\u9500" }),
16630
- pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { onClick: () => {
17077
+ pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { onClick: () => {
16631
17078
  void actPairing(pairing.id, "approved");
16632
17079
  }, children: "\u91CD\u65B0\u6279\u51C6" })
16633
17080
  ] }, pairing.id)) })
16634
17081
  ] }),
16635
- error && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "dsh-partner-inline-error", children: error })
17082
+ error && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "dsh-partner-inline-error", children: error })
16636
17083
  ] });
16637
17084
  }
16638
17085
  function installStyles() {