@lemoncat7/dsh-partner 1.0.0 → 1.3.9

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 (90) hide show
  1. package/README.md +24 -7
  2. package/lib/agent-runtime.d.ts +53 -4
  3. package/lib/agent-runtime.d.ts.map +1 -1
  4. package/lib/agent-runtime.js +674 -52
  5. package/lib/agent-runtime.js.map +1 -1
  6. package/lib/api.d.ts +2 -0
  7. package/lib/api.d.ts.map +1 -1
  8. package/lib/api.js +29 -2
  9. package/lib/api.js.map +1 -1
  10. package/lib/autonomy.d.ts +3 -0
  11. package/lib/autonomy.d.ts.map +1 -0
  12. package/lib/autonomy.js +44 -0
  13. package/lib/autonomy.js.map +1 -0
  14. package/lib/channel-message.d.ts +23 -0
  15. package/lib/channel-message.d.ts.map +1 -0
  16. package/lib/channel-message.js +8 -0
  17. package/lib/channel-message.js.map +1 -0
  18. package/lib/channels/manager.d.ts +28 -1
  19. package/lib/channels/manager.d.ts.map +1 -1
  20. package/lib/channels/manager.js +230 -15
  21. package/lib/channels/manager.js.map +1 -1
  22. package/lib/channels/weixin/api.d.ts +2 -0
  23. package/lib/channels/weixin/api.d.ts.map +1 -1
  24. package/lib/channels/weixin/api.js +80 -1
  25. package/lib/channels/weixin/api.js.map +1 -1
  26. package/lib/channels/weixin/media.d.ts +4 -0
  27. package/lib/channels/weixin/media.d.ts.map +1 -0
  28. package/lib/channels/weixin/media.js +78 -0
  29. package/lib/channels/weixin/media.js.map +1 -0
  30. package/lib/channels/weixin/types.d.ts +19 -2
  31. package/lib/channels/weixin/types.d.ts.map +1 -1
  32. package/lib/client-api.d.ts +43 -0
  33. package/lib/client-api.d.ts.map +1 -1
  34. package/lib/client-api.js.map +1 -1
  35. package/lib/client.d.ts.map +1 -1
  36. package/lib/client.js +939 -481
  37. package/lib/client.js.map +4 -4
  38. package/lib/concern-domain.d.ts +121 -0
  39. package/lib/concern-domain.d.ts.map +1 -0
  40. package/lib/concern-domain.js +182 -0
  41. package/lib/concern-domain.js.map +1 -0
  42. package/lib/concern-notification.d.ts +6 -0
  43. package/lib/concern-notification.d.ts.map +1 -0
  44. package/lib/concern-notification.js +27 -0
  45. package/lib/concern-notification.js.map +1 -0
  46. package/lib/concern-sources.d.ts +10 -0
  47. package/lib/concern-sources.d.ts.map +1 -0
  48. package/lib/concern-sources.js +81 -0
  49. package/lib/concern-sources.js.map +1 -0
  50. package/lib/concern-store.d.ts +41 -0
  51. package/lib/concern-store.d.ts.map +1 -0
  52. package/lib/concern-store.js +527 -0
  53. package/lib/concern-store.js.map +1 -0
  54. package/lib/daily-review.d.ts +3 -1
  55. package/lib/daily-review.d.ts.map +1 -1
  56. package/lib/daily-review.js +8 -2
  57. package/lib/daily-review.js.map +1 -1
  58. package/lib/domain.d.ts +4 -1
  59. package/lib/domain.d.ts.map +1 -1
  60. package/lib/domain.js +23 -0
  61. package/lib/domain.js.map +1 -1
  62. package/lib/heartbeat.d.ts +10 -2
  63. package/lib/heartbeat.d.ts.map +1 -1
  64. package/lib/heartbeat.js +81 -17
  65. package/lib/heartbeat.js.map +1 -1
  66. package/lib/index.d.ts.map +1 -1
  67. package/lib/index.js +39 -9
  68. package/lib/index.js.map +1 -1
  69. package/lib/memory-domain.d.ts +3 -0
  70. package/lib/memory-domain.d.ts.map +1 -1
  71. package/lib/memory-reflection.d.ts +8 -3
  72. package/lib/memory-reflection.d.ts.map +1 -1
  73. package/lib/memory-reflection.js +66 -13
  74. package/lib/memory-reflection.js.map +1 -1
  75. package/lib/memory-store.d.ts +8 -0
  76. package/lib/memory-store.d.ts.map +1 -1
  77. package/lib/memory-store.js +27 -0
  78. package/lib/memory-store.js.map +1 -1
  79. package/lib/store.d.ts.map +1 -1
  80. package/lib/store.js +39 -3
  81. package/lib/store.js.map +1 -1
  82. package/lib/time-format.d.ts +2 -0
  83. package/lib/time-format.d.ts.map +1 -0
  84. package/lib/time-format.js +20 -0
  85. package/lib/time-format.js.map +1 -0
  86. package/lib/workspace-ownership.d.ts +5 -0
  87. package/lib/workspace-ownership.d.ts.map +1 -0
  88. package/lib/workspace-ownership.js +18 -0
  89. package/lib/workspace-ownership.js.map +1 -0
  90. package/package.json +13 -2
package/lib/client.js CHANGED
@@ -35,32 +35,29 @@ __export(client_exports, {
35
35
  inject: () => inject
36
36
  });
37
37
  module.exports = __toCommonJS(client_exports);
38
- var import_react4 = require("react");
38
+ var import_react3 = require("react");
39
39
 
40
- // node_modules/@lemoncat7/dsh-plugin-ui/lib/index.js
41
- var import_jsx_runtime = require("react/jsx-runtime");
42
- var import_react = require("react");
43
- var PLUGIN_WORKSPACE_ACTIVATE_EVENT = "@lemoncat7/dsh-plugin-ui/workspace-activate";
40
+ // src/workspace-ownership.ts
41
+ var WORKSPACE_ACTIVATE_EVENT = "@lemoncat7/dsh-plugin-ui/workspace-activate";
44
42
  function activatePluginWorkspace(pluginId) {
45
- window.dispatchEvent(new CustomEvent(PLUGIN_WORKSPACE_ACTIVATE_EVENT, {
43
+ window.dispatchEvent(new CustomEvent(WORKSPACE_ACTIVATE_EVENT, {
46
44
  detail: { pluginId }
47
45
  }));
48
46
  }
49
47
  function observePluginWorkspace(pluginId, close) {
50
48
  const onActivate = (event) => {
51
49
  const detail = event.detail;
52
- if (detail?.pluginId !== pluginId)
53
- close();
50
+ if (detail?.pluginId !== pluginId) close();
54
51
  };
55
- window.addEventListener(PLUGIN_WORKSPACE_ACTIVATE_EVENT, onActivate);
56
- return () => window.removeEventListener(PLUGIN_WORKSPACE_ACTIVATE_EVENT, onActivate);
52
+ window.addEventListener(WORKSPACE_ACTIVATE_EVENT, onActivate);
53
+ return () => window.removeEventListener(WORKSPACE_ACTIVATE_EVENT, onActivate);
57
54
  }
58
55
 
59
56
  // src/client.tsx
60
57
  var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
61
58
 
62
59
  // node_modules/qrcode.react/lib/esm/index.js
63
- var import_react2 = __toESM(require("react"), 1);
60
+ var import_react = __toESM(require("react"), 1);
64
61
  var __defProp2 = Object.defineProperty;
65
62
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
66
63
  var __hasOwnProp2 = Object.prototype.hasOwnProperty;
@@ -893,7 +890,7 @@ function useQRCode({
893
890
  size,
894
891
  boostLevel
895
892
  }) {
896
- let qrcode = import_react2.default.useMemo(() => {
893
+ let qrcode = import_react.default.useMemo(() => {
897
894
  const values = Array.isArray(value) ? value : [value];
898
895
  const segments = values.reduce((accum, v) => {
899
896
  accum.push(...qrcodegen_default.QrSegment.makeSegments(v));
@@ -908,7 +905,7 @@ function useQRCode({
908
905
  boostLevel
909
906
  );
910
907
  }, [value, level, minVersion, boostLevel]);
911
- const { cells, margin, numCells, calculatedImageSettings } = import_react2.default.useMemo(() => {
908
+ const { cells, margin, numCells, calculatedImageSettings } = import_react.default.useMemo(() => {
912
909
  let cells2 = qrcode.getModules();
913
910
  const margin2 = getMarginSize(includeMargin, marginSize);
914
911
  const numCells2 = cells2.length + margin2 * 2;
@@ -941,7 +938,7 @@ var SUPPORTS_PATH2D = (function() {
941
938
  }
942
939
  return true;
943
940
  })();
944
- var QRCodeCanvas = import_react2.default.forwardRef(
941
+ var QRCodeCanvas = import_react.default.forwardRef(
945
942
  function QRCodeCanvas2(props, forwardedRef) {
946
943
  const _a = props, {
947
944
  value,
@@ -968,9 +965,9 @@ var QRCodeCanvas = import_react2.default.forwardRef(
968
965
  ]);
969
966
  const _b = extraProps, { style } = _b, otherProps = __objRest(_b, ["style"]);
970
967
  const imgSrc = imageSettings == null ? void 0 : imageSettings.src;
971
- const _canvas = import_react2.default.useRef(null);
972
- const _image = import_react2.default.useRef(null);
973
- const setCanvasRef = import_react2.default.useCallback(
968
+ const _canvas = import_react.default.useRef(null);
969
+ const _image = import_react.default.useRef(null);
970
+ const setCanvasRef = import_react.default.useCallback(
974
971
  (node) => {
975
972
  _canvas.current = node;
976
973
  if (typeof forwardedRef === "function") {
@@ -981,7 +978,7 @@ var QRCodeCanvas = import_react2.default.forwardRef(
981
978
  },
982
979
  [forwardedRef]
983
980
  );
984
- const [isImgLoaded, setIsImageLoaded] = import_react2.default.useState(false);
981
+ const [isImgLoaded, setIsImageLoaded] = import_react.default.useState(false);
985
982
  const { margin, cells, numCells, calculatedImageSettings } = useQRCode({
986
983
  value,
987
984
  level,
@@ -992,7 +989,7 @@ var QRCodeCanvas = import_react2.default.forwardRef(
992
989
  imageSettings,
993
990
  size
994
991
  });
995
- import_react2.default.useEffect(() => {
992
+ import_react.default.useEffect(() => {
996
993
  if (_canvas.current != null) {
997
994
  const canvas = _canvas.current;
998
995
  const ctx = canvas.getContext("2d");
@@ -1042,13 +1039,13 @@ var QRCodeCanvas = import_react2.default.forwardRef(
1042
1039
  }
1043
1040
  }
1044
1041
  });
1045
- import_react2.default.useEffect(() => {
1042
+ import_react.default.useEffect(() => {
1046
1043
  setIsImageLoaded(false);
1047
1044
  }, [imgSrc]);
1048
1045
  const canvasStyle = __spreadValues({ height: size, width: size }, style);
1049
1046
  let img = null;
1050
1047
  if (imgSrc != null) {
1051
- img = /* @__PURE__ */ import_react2.default.createElement(
1048
+ img = /* @__PURE__ */ import_react.default.createElement(
1052
1049
  "img",
1053
1050
  {
1054
1051
  src: imgSrc,
@@ -1062,7 +1059,7 @@ var QRCodeCanvas = import_react2.default.forwardRef(
1062
1059
  }
1063
1060
  );
1064
1061
  }
1065
- return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement(
1062
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
1066
1063
  "canvas",
1067
1064
  __spreadValues({
1068
1065
  style: canvasStyle,
@@ -1075,7 +1072,7 @@ var QRCodeCanvas = import_react2.default.forwardRef(
1075
1072
  }
1076
1073
  );
1077
1074
  QRCodeCanvas.displayName = "QRCodeCanvas";
1078
- var QRCodeSVG = import_react2.default.forwardRef(
1075
+ var QRCodeSVG = import_react.default.forwardRef(
1079
1076
  function QRCodeSVG2(props, forwardedRef) {
1080
1077
  const _a = props, {
1081
1078
  value,
@@ -1121,7 +1118,7 @@ var QRCodeSVG = import_react2.default.forwardRef(
1121
1118
  calculatedImageSettings.excavation
1122
1119
  );
1123
1120
  }
1124
- image = /* @__PURE__ */ import_react2.default.createElement(
1121
+ image = /* @__PURE__ */ import_react.default.createElement(
1125
1122
  "image",
1126
1123
  {
1127
1124
  href: imageSettings.src,
@@ -1136,7 +1133,7 @@ var QRCodeSVG = import_react2.default.forwardRef(
1136
1133
  );
1137
1134
  }
1138
1135
  const fgPath = generatePath(cellsToDraw, margin);
1139
- return /* @__PURE__ */ import_react2.default.createElement(
1136
+ return /* @__PURE__ */ import_react.default.createElement(
1140
1137
  "svg",
1141
1138
  __spreadValues({
1142
1139
  height: size,
@@ -1145,8 +1142,8 @@ var QRCodeSVG = import_react2.default.forwardRef(
1145
1142
  ref: forwardedRef,
1146
1143
  role: "img"
1147
1144
  }, otherProps),
1148
- !!title && /* @__PURE__ */ import_react2.default.createElement("title", null, title),
1149
- /* @__PURE__ */ import_react2.default.createElement(
1145
+ !!title && /* @__PURE__ */ import_react.default.createElement("title", null, title),
1146
+ /* @__PURE__ */ import_react.default.createElement(
1150
1147
  "path",
1151
1148
  {
1152
1149
  fill: bgColor,
@@ -1154,7 +1151,7 @@ var QRCodeSVG = import_react2.default.forwardRef(
1154
1151
  shapeRendering: "crispEdges"
1155
1152
  }
1156
1153
  ),
1157
- /* @__PURE__ */ import_react2.default.createElement("path", { fill: fgColor, d: fgPath, shapeRendering: "crispEdges" }),
1154
+ /* @__PURE__ */ import_react.default.createElement("path", { fill: fgColor, d: fgPath, shapeRendering: "crispEdges" }),
1158
1155
  image
1159
1156
  );
1160
1157
  }
@@ -1172,14 +1169,15 @@ var client_default = `.dsh-partner-sidebar,
1172
1169
  --partner-pane: var(--xiaohei-plugin-pane-fill, var(--partner-surface));
1173
1170
  --partner-raised: var(--xiaohei-plugin-raised-fill, color-mix(in srgb, var(--dsw-alias-bg-layer-2, #fff) 76%, transparent));
1174
1171
  --partner-control: var(--xiaohei-plugin-control-fill, var(--partner-raised));
1175
- --partner-font-caption: 11px;
1172
+ --partner-font-family: var(--ds-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif);
1173
+ --partner-font-caption: 12px;
1176
1174
  --partner-font-body: 13px;
1177
1175
  --partner-font-label: 14px;
1178
1176
  --partner-font-title: 18px;
1179
1177
  --partner-font-heading: 22px;
1180
1178
  --partner-font-display: clamp(24px, 2.2vw, 28px);
1181
1179
  color: var(--dsw-alias-label-primary);
1182
- font-family: var(--ds-font-family);
1180
+ font-family: var(--partner-font-family);
1183
1181
  }
1184
1182
 
1185
1183
  .dsh-partner-sidebar,
@@ -1193,7 +1191,10 @@ var client_default = `.dsh-partner-sidebar,
1193
1191
  border-radius: 0;
1194
1192
  appearance: none;
1195
1193
  color: inherit;
1196
- font: inherit;
1194
+ font-family: var(--partner-font-family);
1195
+ font-size: inherit;
1196
+ font-weight: inherit;
1197
+ line-height: inherit;
1197
1198
  letter-spacing: inherit;
1198
1199
  }
1199
1200
 
@@ -1245,7 +1246,7 @@ var client_default = `.dsh-partner-sidebar,
1245
1246
  .dsh-partner-sidebar { box-sizing: border-box; flex: none; margin: 0 8px 8px 2px; padding: 4px 0 7px; border-bottom: 1px solid color-mix(in srgb, var(--dsw-alias-border-l2) 62%, transparent); }
1246
1247
  .dsh-partner-sidebar.is-rail { width: 36px; margin: 0 0 8px; padding: 0; border: 0; }
1247
1248
  .dsh-partner-sidebar-heading { display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 0 4px 0 5px; }
1248
- .dsh-partner-sidebar-title { display: flex; min-width: 0; align-items: center; gap: 5px; height: 28px; padding: 0 5px; border: 0; border-radius: 7px; color: var(--dsw-alias-label-secondary); background: transparent; font: 600 var(--partner-font-body)/1 var(--ds-font-family); cursor: pointer; }
1249
+ .dsh-partner-sidebar-title { display: flex; min-width: 0; align-items: center; gap: 5px; height: 28px; padding: 0 5px; border: 0; border-radius: 7px; color: var(--dsw-alias-label-secondary); background: transparent; font: 600 var(--partner-font-body)/1 var(--partner-font-family); cursor: pointer; }
1249
1250
  .dsh-partner-sidebar-title > span { display: grid; place-items: center; transition: transform .16s ease; }
1250
1251
  .dsh-partner-sidebar-title > span[data-open="false"] { transform: rotate(-90deg); }
1251
1252
  .dsh-partner-sidebar-title:hover,
@@ -1279,8 +1280,28 @@ var client_default = `.dsh-partner-sidebar,
1279
1280
  .dsh-partner-topbar > div > span:last-child { display: grid; gap: 2px; }
1280
1281
  .dsh-partner-topbar strong { font-size: var(--partner-font-label); font-weight: 620; }
1281
1282
  .dsh-partner-topbar small { color: var(--dsw-alias-label-tertiary); font-size: var(--partner-font-caption); }
1282
- .dsh-partner-topbar > button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 9px; color: var(--dsw-alias-label-secondary); background: transparent; cursor: pointer; }
1283
- .dsh-partner-topbar > button:hover { color: var(--dsw-alias-label-primary); background: var(--dsw-alias-interactive-bg-hover); }
1283
+ .dsh-partner-topbar [data-xiaohei-workspace-close] {
1284
+ display: grid;
1285
+ place-items: center;
1286
+ flex: none;
1287
+ width: 30px;
1288
+ height: 30px;
1289
+ padding: 0;
1290
+ border: 1px solid transparent;
1291
+ border-radius: 9px;
1292
+ color: var(--dsw-alias-label-secondary);
1293
+ background: transparent;
1294
+ line-height: 1;
1295
+ cursor: pointer;
1296
+ transition: color 140ms ease, background 140ms ease, border-color 140ms ease, transform 140ms ease;
1297
+ }
1298
+ .dsh-partner-topbar [data-xiaohei-workspace-close]:hover {
1299
+ border-color: var(--partner-border);
1300
+ color: var(--dsw-alias-label-primary);
1301
+ background: var(--dsw-alias-interactive-bg-hover);
1302
+ }
1303
+ .dsh-partner-topbar [data-xiaohei-workspace-close]:active { transform: scale(.96); }
1304
+ .dsh-partner-topbar [data-xiaohei-workspace-close] > svg { display: block; pointer-events: none; }
1284
1305
  .dsh-partner-grid { display: grid; grid-template-columns: 206px minmax(520px, 1fr); min-width: 0; min-height: 0; }
1285
1306
 
1286
1307
  .dsh-partner-roster { display: flex; min-width: 0; min-height: 0; flex-direction: column; padding: 20px 10px 14px; border-right: 1px solid var(--partner-border); background: color-mix(in srgb, var(--partner-raised) 94%, var(--partner-surface)); }
@@ -1349,7 +1370,7 @@ var client_default = `.dsh-partner-sidebar,
1349
1370
  .dsh-partner-home-channel-copy h3 { margin: 1px 0 0; font-size: var(--partner-font-title); line-height: 1.28; font-weight: 650; letter-spacing: -.025em; }
1350
1371
  .dsh-partner-home-channel-copy p { max-width: 510px; margin: 0; color: var(--dsw-alias-label-secondary); font-size: var(--partner-font-body); line-height: 1.65; }
1351
1372
  .dsh-partner-home-channel-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 7px; }
1352
- .dsh-partner-home-channel-actions button { min-height: 36px; padding: 0 15px; border: 1px solid var(--partner-accent-strong); border-radius: 10px; color: #fff; background: var(--partner-accent-strong); font: 600 var(--partner-font-body)/1 var(--ds-font-family); cursor: pointer; transition: transform .16s ease, background .16s ease; }
1373
+ .dsh-partner-home-channel-actions button { min-height: 36px; padding: 0 15px; border: 1px solid var(--partner-accent-strong); border-radius: 10px; color: #fff; background: var(--partner-accent-strong); font: 600 var(--partner-font-body)/1 var(--partner-font-family); cursor: pointer; transition: transform .16s ease, background .16s ease; }
1353
1374
  .dsh-partner-home-channel-actions button:hover { background: color-mix(in srgb, var(--partner-accent-strong) 88%, #000); transform: translateY(-1px); }
1354
1375
  .dsh-partner-home-channel-actions button:active { transform: translateY(0) scale(.98); }
1355
1376
  .dsh-partner-home-channel-actions span { color: var(--dsw-alias-label-tertiary); font-size: var(--partner-font-caption); }
@@ -1361,7 +1382,7 @@ var client_default = `.dsh-partner-sidebar,
1361
1382
  .dsh-partner-home-details header > div { display: grid; min-width: 0; gap: 3px; }
1362
1383
  .dsh-partner-home-details header small { color: var(--dsw-alias-label-tertiary); font-size: var(--partner-font-caption); }
1363
1384
  .dsh-partner-home-details header strong { overflow: hidden; font-size: var(--partner-font-label); font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
1364
- .dsh-partner-home-details header button { padding: 5px 7px; border: 0; border-radius: 7px; color: var(--dsw-alias-label-tertiary); background: transparent; font: 560 var(--partner-font-caption)/1 var(--ds-font-family); cursor: pointer; }
1385
+ .dsh-partner-home-details header button { padding: 5px 7px; border: 0; border-radius: 7px; color: var(--dsw-alias-label-tertiary); background: transparent; font: 560 var(--partner-font-caption)/1 var(--partner-font-family); cursor: pointer; }
1365
1386
  .dsh-partner-home-details header button:hover { color: var(--partner-accent-strong); background: color-mix(in srgb, var(--partner-accent) 6%, transparent); }
1366
1387
  .dsh-partner-home-profile blockquote { display: -webkit-box; margin: 17px 2px 0 44px; overflow: hidden; color: var(--dsw-alias-label-secondary); font-size: var(--partner-font-body); line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 5; }
1367
1388
  .dsh-partner-home-capability-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0 44px; }
@@ -1387,7 +1408,7 @@ var client_default = `.dsh-partner-sidebar,
1387
1408
  .dsh-partner-field small { color: var(--dsw-alias-label-tertiary); font-size: var(--partner-font-caption); line-height: 1.35; text-align: right; }
1388
1409
  .dsh-partner-field input,
1389
1410
  .dsh-partner-field textarea,
1390
- .dsh-partner-field select { box-sizing: border-box; width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--partner-border); border-radius: 10px; outline: none; color: var(--dsw-alias-label-primary); background: var(--partner-control); font: var(--partner-font-label)/1.5 var(--ds-font-family); transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
1411
+ .dsh-partner-field select { box-sizing: border-box; width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--partner-border); border-radius: 10px; outline: none; color: var(--dsw-alias-label-primary); background: var(--partner-control); font: var(--partner-font-label)/1.5 var(--partner-font-family); transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
1391
1412
  .dsh-partner-field textarea { resize: vertical; }
1392
1413
  .dsh-partner-field input:focus,
1393
1414
  .dsh-partner-field textarea:focus,
@@ -1396,7 +1417,7 @@ var client_default = `.dsh-partner-sidebar,
1396
1417
  .dsh-partner-form-actions > span { display: inline-flex; align-items: center; gap: 5px; color: var(--partner-accent-strong); font-size: var(--partner-font-body); }
1397
1418
  .dsh-partner-form-actions > button,
1398
1419
  .dsh-partner-state > button,
1399
- .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: #fff; background: var(--partner-accent-strong); font: 600 var(--partner-font-body)/1 var(--ds-font-family); cursor: pointer; }
1420
+ .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: #fff; background: var(--partner-accent-strong); font: 600 var(--partner-font-body)/1 var(--partner-font-family); cursor: pointer; }
1400
1421
  .dsh-partner-form-actions > button:hover,
1401
1422
  .dsh-partner-state > button:hover,
1402
1423
  .dsh-partner-weixin-connect > button:hover { background: color-mix(in srgb, var(--partner-accent-strong) 88%, #000); }
@@ -1477,7 +1498,7 @@ var client_default = `.dsh-partner-sidebar,
1477
1498
  .dsh-partner-session-list article > div { display: grid; min-width: 0; flex: 1; gap: 3px; }
1478
1499
  .dsh-partner-session-list strong { font-size: var(--partner-font-body); }
1479
1500
  .dsh-partner-session-list small { overflow: hidden; color: var(--dsw-alias-label-tertiary); font: var(--partner-font-caption)/1.4 ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
1480
- .dsh-partner-session-list button { flex: none; min-height: 30px; padding: 0 10px; border: 1px solid var(--partner-border); border-radius: 8px; color: var(--dsw-alias-label-secondary); background: var(--partner-control); font: 560 var(--partner-font-caption)/1 var(--ds-font-family); cursor: pointer; }
1501
+ .dsh-partner-session-list button { flex: none; min-height: 30px; padding: 0 10px; border: 1px solid var(--partner-border); border-radius: 8px; color: var(--dsw-alias-label-secondary); background: var(--partner-control); font: 560 var(--partner-font-caption)/1 var(--partner-font-family); cursor: pointer; }
1481
1502
  .dsh-partner-session-list button:hover { color: var(--partner-accent-strong); border-color: color-mix(in srgb, var(--partner-accent) 24%, var(--partner-border)); }
1482
1503
  .dsh-partner-automation { display: grid; gap: 14px; margin-top: 16px; padding: 16px; border: 1px solid var(--partner-border); border-radius: 14px; background: color-mix(in srgb, var(--partner-raised) 72%, transparent); }
1483
1504
  .dsh-partner-automation-grid { display: grid; grid-template-columns: minmax(480px, .95fr) minmax(430px, 1.05fr); align-items: stretch; gap: 12px; margin-top: 17px; }
@@ -1496,8 +1517,115 @@ var client_default = `.dsh-partner-sidebar,
1496
1517
  .dsh-partner-automation-fields { display: grid; grid-template-columns: minmax(120px, 180px); gap: 10px; }
1497
1518
  .dsh-partner-automation-fields.is-memory-model { grid-template-columns: minmax(110px, .7fr) minmax(130px, 1fr) minmax(150px, 1.25fr); }
1498
1519
  .dsh-partner-automation-fields.is-heartbeat { grid-template-columns: repeat(4, minmax(100px, 1fr)); }
1520
+ .dsh-partner-concern-board { position: relative; display: grid; min-width: 0; overflow: visible; border: 1px solid var(--partner-border); border-radius: 11px; background: color-mix(in srgb, var(--partner-raised) 42%, transparent); }
1521
+ .dsh-partner-concern-board > header { display: flex; min-height: 46px; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 10px 7px 12px; }
1522
+ .dsh-partner-concern-board > header > span { display: flex; min-width: 0; align-items: baseline; gap: 8px; }
1523
+ .dsh-partner-concern-board > header strong { display: flex; align-items: center; gap: 6px; font-size: var(--partner-font-body); font-weight: 640; white-space: nowrap; }
1524
+ .dsh-partner-concern-board > header strong b { display: grid; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; place-items: center; color: var(--partner-accent-strong); background: color-mix(in srgb, var(--partner-accent) 9%, transparent); font-size: var(--partner-font-caption); font-variant-numeric: tabular-nums; }
1525
+ .dsh-partner-concern-board > header p { min-width: 0; margin: 0; overflow: hidden; color: var(--dsw-alias-label-tertiary); font-size: var(--partner-font-caption); text-overflow: ellipsis; white-space: nowrap; }
1526
+ .dsh-partner-concern-board > header > button { display: inline-flex; flex: none; height: 30px; align-items: center; gap: 5px; padding: 0 9px; border: 1px solid transparent; border-radius: 8px; color: var(--dsw-alias-label-secondary); background: transparent; font: 560 var(--partner-font-caption)/1 var(--partner-font-family); cursor: pointer; }
1527
+ .dsh-partner-concern-board > header > button:hover,
1528
+ .dsh-partner-concern-board > header > button[aria-expanded="true"] { color: var(--partner-accent-strong); background: color-mix(in srgb, var(--partner-accent) 8%, transparent); }
1529
+ .dsh-partner-concern-compose { display: grid; gap: 8px; padding: 10px 12px 11px; border-top: 1px solid var(--partner-border); background: color-mix(in srgb, var(--partner-control) 60%, transparent); animation: dsh-partner-reveal .16s ease-out; }
1530
+ .dsh-partner-concern-compose label { display: grid; gap: 6px; }
1531
+ .dsh-partner-concern-compose label > span { color: var(--dsw-alias-label-secondary); font-size: var(--partner-font-caption); font-weight: 600; }
1532
+ .dsh-partner-concern-compose input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--partner-border); border-radius: 8px; color: var(--dsw-alias-label-primary); background: var(--partner-raised); font: var(--partner-font-body)/1 var(--partner-font-family); transition: border-color .15s ease, box-shadow .15s ease; }
1533
+ .dsh-partner-concern-compose input:focus-visible { border-color: color-mix(in srgb, var(--partner-accent) 55%, var(--partner-border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--partner-accent) 9%, transparent); }
1534
+ .dsh-partner-concern-input-wrap { position: relative; min-width: 0; }
1535
+ .dsh-partner-concern-compose-hint { color: var(--dsw-alias-label-tertiary); font-size: var(--partner-font-caption); font-weight: 400; line-height: 1.45; }
1536
+ .dsh-partner-concern-compose-hint b { color: var(--partner-accent-strong); font-weight: 700; }
1537
+ .dsh-partner-concern-sources {
1538
+ position: absolute;
1539
+ z-index: 40;
1540
+ top: calc(100% + 6px);
1541
+ right: 0;
1542
+ left: 0;
1543
+ display: grid;
1544
+ max-height: 264px;
1545
+ overflow-y: auto;
1546
+ padding: 5px;
1547
+ border: 1px solid color-mix(in srgb, var(--partner-border) 88%, var(--dsw-alias-label-primary) 12%);
1548
+ border-radius: 10px;
1549
+ background: var(--dsw-alias-bg-layer-2, #fff);
1550
+ box-shadow: 0 14px 34px color-mix(in srgb, var(--dsw-alias-label-primary) 15%, transparent);
1551
+ scrollbar-width: thin;
1552
+ }
1553
+ .dsh-partner-concern-sources > p { margin: 0; padding: 14px 12px; color: var(--dsw-alias-label-secondary); font-size: var(--partner-font-caption); line-height: 1.45; }
1554
+ .dsh-partner-concern-sources > button {
1555
+ display: grid;
1556
+ min-height: 46px;
1557
+ grid-template-columns: 28px minmax(0, 1fr);
1558
+ grid-template-rows: auto auto;
1559
+ align-items: center;
1560
+ column-gap: 8px;
1561
+ padding: 6px 8px;
1562
+ border: 1px solid transparent;
1563
+ border-radius: 8px;
1564
+ color: var(--dsw-alias-label-primary);
1565
+ background: transparent;
1566
+ text-align: left;
1567
+ cursor: pointer;
1568
+ }
1569
+ .dsh-partner-concern-sources > button > span { display: grid; grid-row: 1 / 3; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: var(--partner-accent-strong); background: color-mix(in srgb, var(--partner-accent) 9%, var(--partner-control)); }
1570
+ .dsh-partner-concern-sources > button > strong { min-width: 0; overflow: hidden; font-size: var(--partner-font-body); font-weight: 610; text-overflow: ellipsis; white-space: nowrap; }
1571
+ .dsh-partner-concern-sources > button > small { min-width: 0; overflow: hidden; color: var(--dsw-alias-label-tertiary); font-size: var(--partner-font-caption); font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
1572
+ .dsh-partner-concern-sources > button:hover,
1573
+ .dsh-partner-concern-sources > button[aria-selected="true"] { border-color: color-mix(in srgb, var(--partner-accent) 22%, var(--partner-border)); background: color-mix(in srgb, var(--partner-accent) 8%, var(--dsw-alias-bg-layer-2, #fff)); }
1574
+ .dsh-partner-concern-compose > div { display: flex; justify-content: flex-end; gap: 6px; }
1575
+ .dsh-partner-concern-compose button { min-height: 30px; padding: 0 10px; border: 1px solid var(--partner-border); border-radius: 8px; color: var(--dsw-alias-label-secondary); background: var(--partner-raised); font: 560 var(--partner-font-caption)/1 var(--partner-font-family); cursor: pointer; }
1576
+ .dsh-partner-concern-compose button.is-primary { border-color: transparent; color: var(--dsw-alias-label-on-accent, #fff); background: var(--partner-accent-strong); }
1577
+ .dsh-partner-concern-list { display: grid; min-height: 0; border-top: 1px solid var(--partner-border); }
1578
+ .dsh-partner-concern-list > article { min-width: 0; border-bottom: 1px solid color-mix(in srgb, var(--partner-border) 72%, transparent); background: transparent; transition: background .15s ease; }
1579
+ .dsh-partner-concern-list > article:last-child { border-bottom: 0; }
1580
+ .dsh-partner-concern-list > article:hover,
1581
+ .dsh-partner-concern-list > article[data-expanded="true"] { background: color-mix(in srgb, var(--partner-accent) 4.5%, transparent); }
1582
+ .dsh-partner-concern-row { display: grid; width: 100%; min-height: 49px; grid-template-columns: 76px minmax(0, 1fr) auto 14px; align-items: center; gap: 9px; padding: 6px 11px 6px 12px; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
1583
+ .dsh-partner-concern-state { display: flex; align-items: center; gap: 7px; color: var(--dsw-alias-label-tertiary); font-size: var(--partner-font-caption); white-space: nowrap; }
1584
+ .dsh-partner-concern-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--partner-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--partner-accent) 9%, transparent); }
1585
+ .dsh-partner-concern-copy { display: grid; min-width: 0; gap: 3px; }
1586
+ .dsh-partner-concern-copy strong,
1587
+ .dsh-partner-concern-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1588
+ .dsh-partner-concern-copy strong { font-size: var(--partner-font-body); font-weight: 610; }
1589
+ .dsh-partner-concern-copy small { color: var(--dsw-alias-label-tertiary); font-size: var(--partner-font-caption); }
1590
+ .dsh-partner-concern-time { display: grid; justify-items: end; gap: 2px; color: var(--dsw-alias-label-tertiary); font-size: var(--partner-font-caption); font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; }
1591
+ .dsh-partner-concern-time small { font: inherit; }
1592
+ .dsh-partner-concern-time strong { color: var(--dsw-alias-label-secondary); font: 590 var(--partner-font-caption)/1.1 var(--partner-font-family); }
1593
+ .dsh-partner-concern-row > svg { color: var(--dsw-alias-label-tertiary); transition: transform .16s ease, color .16s ease; }
1594
+ .dsh-partner-concern-list > article[data-expanded="true"] .dsh-partner-concern-row > svg { color: var(--partner-accent); transform: rotate(180deg); }
1595
+ .dsh-partner-concern-detail { display: grid; gap: 7px; padding: 0 34px 11px 97px; animation: dsh-partner-reveal .16s ease-out; }
1596
+ .dsh-partner-concern-detail p,
1597
+ .dsh-partner-concern-detail blockquote { margin: 0; color: var(--dsw-alias-label-secondary); font-size: var(--partner-font-caption); line-height: 1.55; }
1598
+ .dsh-partner-concern-detail blockquote { padding-left: 9px; border-left: 2px solid color-mix(in srgb, var(--partner-accent) 40%, transparent); }
1599
+ .dsh-partner-concern-detail > small { color: var(--dsw-alias-label-tertiary); font-size: var(--partner-font-caption); }
1600
+ .dsh-partner-concern-decision { display: grid; min-width: 0; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 3px 8px; padding: 7px 9px; border: 1px solid var(--partner-border); border-radius: 8px; background: var(--partner-control); font-size: var(--partner-font-caption); }
1601
+ .dsh-partner-concern-decision strong { color: var(--partner-accent-strong); font-weight: 620; white-space: nowrap; }
1602
+ .dsh-partner-concern-decision span { min-width: 0; color: var(--dsw-alias-label-secondary); line-height: 1.45; }
1603
+ .dsh-partner-concern-decision small { grid-column: 1 / -1; color: var(--dsw-alias-label-tertiary); line-height: 1.45; overflow-wrap: anywhere; }
1604
+ .dsh-partner-concern-resources { display: flex; flex-wrap: wrap; gap: 5px; }
1605
+ .dsh-partner-concern-resources span { max-width: 100%; overflow: hidden; padding: 4px 7px; border-radius: 6px; color: var(--partner-accent-strong); background: color-mix(in srgb, var(--partner-accent) 8%, transparent); font-size: var(--partner-font-caption); text-overflow: ellipsis; white-space: nowrap; }
1606
+ .dsh-partner-concern-actions { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 2px; }
1607
+ .dsh-partner-concern-actions button,
1608
+ .dsh-partner-concern-resolved button { min-height: 28px; padding: 0 8px; border: 1px solid var(--partner-border); border-radius: 7px; color: var(--dsw-alias-label-secondary); background: var(--partner-control); font: 540 var(--partner-font-caption)/1 var(--partner-font-family); cursor: pointer; }
1609
+ .dsh-partner-concern-actions button:hover,
1610
+ .dsh-partner-concern-resolved button:hover { color: var(--partner-accent-strong); border-color: color-mix(in srgb, var(--partner-accent) 32%, var(--partner-border)); background: color-mix(in srgb, var(--partner-accent) 7%, var(--partner-control)); }
1611
+ .dsh-partner-concern-actions button.is-danger:hover { color: var(--partner-danger); border-color: color-mix(in srgb, var(--partner-danger) 35%, var(--partner-border)); background: color-mix(in srgb, var(--partner-danger) 7%, var(--partner-control)); }
1612
+ .dsh-partner-concern-more { display: flex; justify-content: center; padding: 5px; border-top: 1px solid var(--partner-border); }
1613
+ .dsh-partner-concern-more button { min-height: 26px; padding: 0 9px; border: 0; border-radius: 7px; color: var(--dsw-alias-label-tertiary); background: transparent; font: 540 var(--partner-font-caption)/1 var(--partner-font-family); cursor: pointer; }
1614
+ .dsh-partner-concern-more button:hover { color: var(--partner-accent-strong); background: color-mix(in srgb, var(--partner-accent) 7%, transparent); }
1615
+ .dsh-partner-concern-empty { margin: 0; padding: 13px 12px; color: var(--dsw-alias-label-tertiary); font-size: var(--partner-font-caption); line-height: 1.5; }
1616
+ .dsh-partner-concern-resolved { border-top: 1px solid var(--partner-border); }
1617
+ .dsh-partner-concern-resolved summary { min-height: 34px; padding: 9px 12px; color: var(--dsw-alias-label-tertiary); font-size: var(--partner-font-caption); cursor: pointer; list-style: none; }
1618
+ .dsh-partner-concern-resolved summary::-webkit-details-marker { display: none; }
1619
+ .dsh-partner-concern-resolved summary::before { display: inline-block; margin-right: 7px; content: '\\203A'; transition: transform .15s ease; }
1620
+ .dsh-partner-concern-resolved[open] summary::before { transform: rotate(90deg); }
1621
+ .dsh-partner-concern-resolved summary b { margin-left: 4px; color: var(--partner-accent); font-variant-numeric: tabular-nums; }
1622
+ .dsh-partner-concern-resolved > div { display: grid; max-height: 170px; overflow-y: auto; border-top: 1px solid color-mix(in srgb, var(--partner-border) 72%, transparent); }
1623
+ .dsh-partner-concern-resolved article { display: grid; min-height: 38px; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 4px 10px; border-bottom: 1px solid color-mix(in srgb, var(--partner-border) 60%, transparent); }
1624
+ .dsh-partner-concern-resolved article > span { display: grid; width: 20px; height: 20px; border-radius: 7px; place-items: center; color: var(--partner-accent); background: color-mix(in srgb, var(--partner-accent) 8%, transparent); }
1625
+ .dsh-partner-concern-resolved article strong { overflow: hidden; font-size: var(--partner-font-caption); font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
1626
+ @keyframes dsh-partner-reveal { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
1499
1627
  .dsh-partner-automation-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--partner-border); }
1500
- .dsh-partner-automation-actions button, .dsh-partner-section-heading button { min-height: 32px; padding: 0 12px; border: 1px solid var(--partner-border); border-radius: 9px; color: var(--dsw-alias-label-secondary); background: var(--partner-control); font: 560 var(--partner-font-caption)/1 var(--ds-font-family); cursor: pointer; }
1628
+ .dsh-partner-automation-actions button, .dsh-partner-section-heading button { min-height: 32px; padding: 0 12px; border: 1px solid var(--partner-border); border-radius: 9px; color: var(--dsw-alias-label-secondary); background: var(--partner-control); font: 560 var(--partner-font-caption)/1 var(--partner-font-family); cursor: pointer; }
1501
1629
  .dsh-partner-automation-actions button.is-primary { color: var(--partner-raised); border-color: transparent; background: var(--partner-accent-strong); }
1502
1630
  .dsh-partner-automation-actions button:disabled, .dsh-partner-section-heading button:disabled { opacity: .45; cursor: default; }
1503
1631
  .dsh-partner-inline-notice { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; color: var(--partner-accent-strong); font-size: var(--partner-font-caption); }
@@ -1534,7 +1662,7 @@ var client_default = `.dsh-partner-sidebar,
1534
1662
  .dsh-partner-library-list > button > strong { overflow: hidden; font-size: var(--partner-font-body); font-weight: 610; text-overflow: ellipsis; white-space: nowrap; }
1535
1663
  .dsh-partner-library-list > button > p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--dsw-alias-label-secondary); font-size: var(--partner-font-caption); line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
1536
1664
  .dsh-partner-library-list > button > small { color: var(--dsw-alias-label-tertiary); font-size: var(--partner-font-caption); }
1537
- .dsh-partner-library-list.is-diary time { color: var(--partner-accent); font: 600 var(--partner-font-caption)/1.2 ui-monospace, monospace; }
1665
+ .dsh-partner-library-list.is-diary time { color: var(--partner-accent); font: 600 var(--partner-font-caption)/1.2 var(--partner-font-family); font-variant-numeric: tabular-nums; }
1538
1666
  .dsh-partner-library-detail { min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 24px clamp(20px, 3vw, 34px) 40px; background: radial-gradient(circle at 92% 4%, color-mix(in srgb, var(--partner-accent) 6%, transparent), transparent 34%); scrollbar-gutter: stable; }
1539
1667
  .dsh-partner-library-detail > article:not(.dsh-partner-diary-detail) { display: grid; align-content: start; gap: 13px; }
1540
1668
  .dsh-partner-library-detail > article:not(.dsh-partner-diary-detail) > header,
@@ -1551,16 +1679,16 @@ var client_default = `.dsh-partner-sidebar,
1551
1679
  .dsh-partner-library-detail progress::-moz-progress-bar { background: var(--partner-accent); }
1552
1680
  .dsh-partner-library-detail footer small { color: var(--dsw-alias-label-tertiary); font-size: var(--partner-font-caption); }
1553
1681
  .dsh-partner-memory-editor { display: grid; gap: 9px; }
1554
- .dsh-partner-memory-editor input, .dsh-partner-memory-editor textarea { box-sizing: border-box; width: 100%; border: 1px solid var(--partner-border); border-radius: 9px; color: var(--dsw-alias-label-primary); outline: none; background: var(--partner-control); font: 500 var(--partner-font-caption)/1.5 var(--ds-font-family); }
1682
+ .dsh-partner-memory-editor input, .dsh-partner-memory-editor textarea { box-sizing: border-box; width: 100%; border: 1px solid var(--partner-border); border-radius: 9px; color: var(--dsw-alias-label-primary); outline: none; background: var(--partner-control); font: 500 var(--partner-font-caption)/1.5 var(--partner-font-family); }
1555
1683
  .dsh-partner-memory-editor input { min-height: 32px; padding: 0 10px; }
1556
1684
  .dsh-partner-memory-editor textarea { min-height: 76px; padding: 8px 10px; resize: vertical; }
1557
1685
  .dsh-partner-memory-editor input:focus, .dsh-partner-memory-editor textarea:focus { border-color: color-mix(in srgb, var(--partner-accent) 48%, var(--partner-border)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--partner-accent) 8%, transparent); }
1558
1686
  .dsh-partner-memory-editor footer { display: flex; justify-content: flex-end; gap: 7px; }
1559
- .dsh-partner-memory-editor button { min-height: 28px; padding: 0 10px; border: 1px solid var(--partner-border); border-radius: 8px; color: var(--dsw-alias-label-secondary); background: var(--partner-control); font: 560 var(--partner-font-caption)/1 var(--ds-font-family); cursor: pointer; }
1687
+ .dsh-partner-memory-editor button { min-height: 28px; padding: 0 10px; border: 1px solid var(--partner-border); border-radius: 8px; color: var(--dsw-alias-label-secondary); background: var(--partner-control); font: 560 var(--partner-font-caption)/1 var(--partner-font-family); cursor: pointer; }
1560
1688
  .dsh-partner-memory-editor button.is-primary { border-color: transparent; color: #fff; background: var(--partner-accent-strong); }
1561
1689
  .dsh-partner-diary-detail { display: grid; align-content: start; gap: 20px; }
1562
1690
  .dsh-partner-diary-detail > header { display: grid; gap: 5px; padding-bottom: 16px; border-bottom: 1px solid var(--partner-border); }
1563
- .dsh-partner-diary-detail > header time { color: var(--partner-accent); font: 600 var(--partner-font-caption)/1 ui-monospace, monospace; }
1691
+ .dsh-partner-diary-detail > header time { color: var(--partner-accent); font: 600 var(--partner-font-caption)/1 var(--partner-font-family); font-variant-numeric: tabular-nums; }
1564
1692
  .dsh-partner-diary-detail > header strong { font-size: var(--partner-font-title); letter-spacing: -.02em; }
1565
1693
  .dsh-partner-diary-detail > header small { color: var(--dsw-alias-label-tertiary); font-size: var(--partner-font-caption); }
1566
1694
  .dsh-partner-diary-detail > p { margin: 0; color: var(--dsw-alias-label-secondary); font-size: var(--partner-font-body); line-height: 1.75; text-wrap: pretty; }
@@ -1637,6 +1765,14 @@ var client_default = `.dsh-partner-sidebar,
1637
1765
  .dsh-partner-library-list { max-height: 300px; border-right: 0; border-bottom: 1px solid var(--partner-border); }
1638
1766
  .dsh-partner-library-detail { min-height: 280px; }
1639
1767
  .dsh-partner-review-policy { grid-template-columns: auto minmax(0, 1fr); }
1768
+ .dsh-partner-concern-board > header p { display: none; }
1769
+ .dsh-partner-concern-row { grid-template-columns: minmax(0, 1fr) auto 14px; gap: 7px; }
1770
+ .dsh-partner-concern-state { grid-column: 1; }
1771
+ .dsh-partner-concern-copy { grid-row: 2; grid-column: 1 / -1; padding-left: 13px; }
1772
+ .dsh-partner-concern-time { grid-row: 1; grid-column: 2; }
1773
+ .dsh-partner-concern-row > svg { grid-row: 1; grid-column: 3; }
1774
+ .dsh-partner-concern-detail { padding: 0 12px 11px 25px; }
1775
+ .dsh-partner-concern-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
1640
1776
  .dsh-partner-review-policy > label, .dsh-partner-review-policy > button:last-child { grid-column: span 1; }
1641
1777
  .dsh-partner-graph-browser { grid-template-columns: 1fr; height: auto; }
1642
1778
  .dsh-partner-graph-index { max-height: 280px; border-right: 0; border-bottom: 1px solid var(--partner-border); }
@@ -1670,9 +1806,9 @@ function loadPartner() {
1670
1806
  }
1671
1807
 
1672
1808
  // src/sidebar-anchor.ts
1673
- var import_react3 = require("react");
1809
+ var import_react2 = require("react");
1674
1810
  function useWorkspaceTopAnchor(ref) {
1675
- (0, import_react3.useEffect)(() => {
1811
+ (0, import_react2.useEffect)(() => {
1676
1812
  const element = ref.current;
1677
1813
  const originalParent = element?.parentElement;
1678
1814
  if (!element || !originalParent) return;
@@ -1707,8 +1843,25 @@ function useWorkspaceTopAnchor(ref) {
1707
1843
  }, [ref]);
1708
1844
  }
1709
1845
 
1846
+ // src/time-format.ts
1847
+ function futureTime(value, now = Date.now()) {
1848
+ const minutes = Math.ceil((value - now) / 6e4);
1849
+ if (minutes <= 0) return "\u5373\u5C06\u68C0\u67E5";
1850
+ if (minutes < 60) return `${minutes} \u5206\u949F\u540E`;
1851
+ const hours = Math.ceil(minutes / 60);
1852
+ if (hours < 24) return `${hours} \u5C0F\u65F6\u540E`;
1853
+ const days = Math.ceil(hours / 24);
1854
+ if (days <= 7) return `${days} \u5929\u540E`;
1855
+ const date = new Date(value);
1856
+ const month = String(date.getMonth() + 1).padStart(2, "0");
1857
+ const day = String(date.getDate()).padStart(2, "0");
1858
+ const hour = String(date.getHours()).padStart(2, "0");
1859
+ const minute = String(date.getMinutes()).padStart(2, "0");
1860
+ return `${month}/${day} ${hour}:${minute}`;
1861
+ }
1862
+
1710
1863
  // src/client.tsx
1711
- var import_jsx_runtime2 = require("react/jsx-runtime");
1864
+ var import_jsx_runtime = require("react/jsx-runtime");
1712
1865
  var PLUGIN_ID = "@lemoncat7/dsh-partner";
1713
1866
  var STYLE_ID = `${PLUGIN_ID}/client`;
1714
1867
  var inject = ["slots", "layout", "sessions"];
@@ -1721,7 +1874,7 @@ function apply(ctx) {
1721
1874
  name: "sidebar.footer.action",
1722
1875
  id: "partner",
1723
1876
  order: -120
1724
- }, (props) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
1877
+ }, (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
1725
1878
  }
1726
1879
  function createController(ctx) {
1727
1880
  const listeners = /* @__PURE__ */ new Set();
@@ -1735,7 +1888,7 @@ function createController(ctx) {
1735
1888
  if (companionId !== void 0) selected = companionId;
1736
1889
  if (dispose === void 0) {
1737
1890
  activatePluginWorkspace(PLUGIN_ID);
1738
- dispose = ctx.slots.register({ name: "conversation", priority: -3 }, (props) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PartnerWorkspace, { ...props, controller }));
1891
+ dispose = ctx.slots.register({ name: "conversation", priority: -3 }, (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PartnerWorkspace, { ...props, controller }));
1739
1892
  }
1740
1893
  notify();
1741
1894
  },
@@ -1772,13 +1925,13 @@ function createController(ctx) {
1772
1925
  return controller;
1773
1926
  }
1774
1927
  function PartnerSidebar(props) {
1775
- const ref = (0, import_react4.useRef)(null);
1928
+ const ref = (0, import_react3.useRef)(null);
1776
1929
  useWorkspaceTopAnchor(ref);
1777
- const [open, setOpen] = (0, import_react4.useState)(true);
1778
- const [snapshot, setSnapshot] = (0, import_react4.useState)();
1779
- const [, update] = (0, import_react4.useState)(0);
1780
- (0, import_react4.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
1781
- (0, import_react4.useEffect)(() => {
1930
+ const [open, setOpen] = (0, import_react3.useState)(true);
1931
+ const [snapshot, setSnapshot] = (0, import_react3.useState)();
1932
+ const [, update] = (0, import_react3.useState)(0);
1933
+ (0, import_react3.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
1934
+ (0, import_react3.useEffect)(() => {
1782
1935
  void loadPartner().then(setSnapshot).catch(() => {
1783
1936
  });
1784
1937
  }, [props.controller.isOpen()]);
@@ -1786,32 +1939,32 @@ function PartnerSidebar(props) {
1786
1939
  props.controller.open(id);
1787
1940
  if (props.wide && window.matchMedia("(max-width: 820px)").matches) props.collapse();
1788
1941
  };
1789
- if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime2.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_runtime2.jsx)(import_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 18 }) }) });
1790
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
1791
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-sidebar-heading", children: [
1792
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
1793
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconChevronDownOutline14, { size: 14 }) }),
1942
+ if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime.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_runtime.jsx)(import_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 18 }) }) });
1943
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
1944
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-sidebar-heading", children: [
1945
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
1946
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconChevronDownOutline14, { size: 14 }) }),
1794
1947
  "\u4F19\u4F34"
1795
1948
  ] }),
1796
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dsh-partner-sidebar-open", onClick: () => launch(), "aria-label": "\u6253\u5F00\u4F19\u4F34\u9762\u677F", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconPlusOutline16, { size: 16 }) })
1949
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-partner-sidebar-open", onClick: () => launch(), "aria-label": "\u6253\u5F00\u4F19\u4F34\u9762\u677F", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconPlusOutline16, { size: 16 }) })
1797
1950
  ] }),
1798
- open && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-sidebar-list", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { type: "button", className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
1799
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 16 }) }),
1800
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
1801
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
1802
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: snapshot ? `${snapshot.companions.length} \u4F4D\u4F19\u4F34 \xB7 ${snapshot.channels.filter((item) => item.runtimeStatus === "running").length} \u4E2A\u5FAE\u4FE1\u5728\u7EBF` : "\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E\u6E20\u9053" })
1951
+ open && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-sidebar-list", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
1952
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 16 }) }),
1953
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
1954
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
1955
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: snapshot ? `${snapshot.companions.length} \u4F4D\u4F19\u4F34 \xB7 ${snapshot.channels.filter((item) => item.runtimeStatus === "running").length} \u4E2A\u5FAE\u4FE1\u5728\u7EBF` : "\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E\u6E20\u9053" })
1803
1956
  ] }),
1804
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
1957
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
1805
1958
  ] }) })
1806
1959
  ] });
1807
1960
  }
1808
1961
  function PartnerWorkspace({ controller }) {
1809
- const [snapshot, setSnapshot] = (0, import_react4.useState)();
1810
- const [selectedId, setSelectedId] = (0, import_react4.useState)(controller.selected());
1811
- const [tab, setTab] = (0, import_react4.useState)("home");
1812
- const [error, setError] = (0, import_react4.useState)();
1813
- const [loading, setLoading] = (0, import_react4.useState)(true);
1814
- const refresh = (0, import_react4.useCallback)(async () => {
1962
+ const [snapshot, setSnapshot] = (0, import_react3.useState)();
1963
+ const [selectedId, setSelectedId] = (0, import_react3.useState)(controller.selected());
1964
+ const [tab, setTab] = (0, import_react3.useState)("home");
1965
+ const [error, setError] = (0, import_react3.useState)();
1966
+ const [loading, setLoading] = (0, import_react3.useState)(true);
1967
+ const refresh = (0, import_react3.useCallback)(async () => {
1815
1968
  try {
1816
1969
  const next = await loadPartner();
1817
1970
  setSnapshot(next);
@@ -1823,10 +1976,10 @@ function PartnerWorkspace({ controller }) {
1823
1976
  setLoading(false);
1824
1977
  }
1825
1978
  }, []);
1826
- (0, import_react4.useEffect)(() => {
1979
+ (0, import_react3.useEffect)(() => {
1827
1980
  void refresh();
1828
1981
  }, [refresh]);
1829
- (0, import_react4.useEffect)(() => controller.subscribe(() => {
1982
+ (0, import_react3.useEffect)(() => controller.subscribe(() => {
1830
1983
  const next = controller.selected();
1831
1984
  if (next) setSelectedId(next);
1832
1985
  }), [controller]);
@@ -1863,77 +2016,77 @@ function PartnerWorkspace({ controller }) {
1863
2016
  setError(message(reason));
1864
2017
  }
1865
2018
  };
1866
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("main", { className: "dsh-partner-workspace", "data-xiaohei-surface": "plugin-workspace", children: [
1867
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("header", { className: "dsh-partner-topbar", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
1868
- /* @__PURE__ */ (0, import_jsx_runtime2.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_runtime2.jsx)(import_dsh_client_ui_primitives.IconChevronLeftOutline14, { size: 15 }) }),
1869
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 18 }),
1870
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
1871
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: "\u4F19\u4F34" }),
1872
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u5FAE\u4FE1\u6E20\u9053" })
2019
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("main", { className: "dsh-partner-workspace", "data-xiaohei-surface": "plugin-workspace", children: [
2020
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("header", { className: "dsh-partner-topbar", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
2021
+ /* @__PURE__ */ (0, import_jsx_runtime.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_runtime.jsx)(import_dsh_client_ui_primitives.IconChevronLeftOutline14, { size: 15 }) }),
2022
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 18 }),
2023
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2024
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: "\u4F19\u4F34" }),
2025
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u5FAE\u4FE1\u6E20\u9053" })
1873
2026
  ] })
1874
2027
  ] }) }),
1875
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-grid", children: [
1876
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("aside", { className: "dsh-partner-roster", children: [
1877
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-roster-title", children: [
1878
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
1879
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "COMPANIONS" }),
1880
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
2028
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-grid", children: [
2029
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("aside", { className: "dsh-partner-roster", children: [
2030
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-roster-title", children: [
2031
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2032
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "COMPANIONS" }),
2033
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
1881
2034
  ] }),
1882
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", onClick: () => {
2035
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: () => {
1883
2036
  void create();
1884
- }, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconPlusOutline16, { size: 16 }) })
2037
+ }, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconPlusOutline16, { size: 16 }) })
1885
2038
  ] }),
1886
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
2039
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
1887
2040
  const channel = snapshot.channels.find((item) => item.companionId === companion.id);
1888
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { type: "button", className: selectedId === companion.id ? "is-active" : "", onClick: () => {
2041
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: selectedId === companion.id ? "is-active" : "", onClick: () => {
1889
2042
  setSelectedId(companion.id);
1890
2043
  setTab("home");
1891
2044
  }, children: [
1892
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Avatar, { name: companion.name }),
1893
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
1894
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: companion.name }),
1895
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: companion.role })
2045
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Avatar, { name: companion.name }),
2046
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2047
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: companion.name }),
2048
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: companion.role })
1896
2049
  ] }),
1897
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
2050
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
1898
2051
  ] }, companion.id);
1899
2052
  }) }),
1900
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-roster-note", children: [
1901
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconLinkOutline16, { size: 16 }),
1902
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
1903
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
1904
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "\u5FAE\u4FE1\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
2053
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-roster-note", children: [
2054
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconLinkOutline16, { size: 16 }),
2055
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2056
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
2057
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "\u5FAE\u4FE1\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
1905
2058
  ] })
1906
2059
  ] })
1907
2060
  ] }),
1908
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: "dsh-partner-stage", children: [
1909
- loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(State, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(State, { 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_runtime2.jsx)("button", { onClick: () => {
2061
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dsh-partner-stage", children: [
2062
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(State, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(State, { 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_runtime.jsx)("button", { onClick: () => {
1910
2063
  void create();
1911
- }, children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
1912
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-identity", children: [
1913
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Avatar, { name: selected.name }),
1914
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
1915
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "ACTIVE COMPANION" }),
1916
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h1", { children: selected.name }),
1917
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: selected.description || selected.role })
2064
+ }, children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
2065
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-identity", children: [
2066
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Avatar, { name: selected.name }),
2067
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2068
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "ACTIVE COMPANION" }),
2069
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { children: selected.name }),
2070
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: selected.description || selected.role })
1918
2071
  ] }),
1919
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Status, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
2072
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Status, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
1920
2073
  ] }),
1921
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
1922
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TabButton, { active: tab === "home", onClick: () => setTab("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 16 }), children: "\u603B\u89C8" }),
1923
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TabButton, { active: tab === "identity", onClick: () => setTab("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconEditOutline16, { size: 16 }), children: "\u8EAB\u4EFD" }),
1924
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TabButton, { active: tab === "capabilities", onClick: () => setTab("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 16 }), children: "\u80FD\u529B" }),
1925
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TabButton, { active: tab === "weixin", onClick: () => setTab("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(WeixinGlyph, {}), children: "\u5FAE\u4FE1" }),
1926
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TabButton, { active: tab === "memory", onClick: () => setTab("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconDataOutline16, { size: 16 }), children: "\u8BB0\u5FC6" })
2074
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
2075
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabButton, { active: tab === "home", onClick: () => setTab("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 16 }), children: "\u603B\u89C8" }),
2076
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabButton, { active: tab === "identity", onClick: () => setTab("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconEditOutline16, { size: 16 }), children: "\u8EAB\u4EFD" }),
2077
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabButton, { active: tab === "capabilities", onClick: () => setTab("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 16 }), children: "\u80FD\u529B" }),
2078
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabButton, { active: tab === "weixin", onClick: () => setTab("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WeixinGlyph, {}), children: "\u5FAE\u4FE1" }),
2079
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TabButton, { active: tab === "memory", onClick: () => setTab("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconDataOutline16, { size: 16 }), children: "\u8BB0\u5FC6" })
1927
2080
  ] }),
1928
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
1929
- tab === "home" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(HomePanel, { companion: selected, snapshot, navigate: setTab, openSession, renewSession }),
1930
- tab === "identity" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(IdentityEditor, { companion: selected, count: snapshot?.companions.length ?? 1, onChanged: refresh }),
1931
- tab === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: refresh }),
1932
- tab === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }),
1933
- tab === "memory" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, renewSession, onChanged: refresh })
2081
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
2082
+ tab === "home" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HomePanel, { companion: selected, snapshot, navigate: setTab, openSession, renewSession }),
2083
+ tab === "identity" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IdentityEditor, { companion: selected, count: snapshot?.companions.length ?? 1, onChanged: refresh }),
2084
+ tab === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: refresh }),
2085
+ tab === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }),
2086
+ tab === "memory" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, renewSession, onChanged: refresh })
1934
2087
  ] })
1935
2088
  ] }),
1936
- error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
2089
+ error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
1937
2090
  ] })
1938
2091
  ] })
1939
2092
  ] });
@@ -1946,76 +2099,76 @@ function HomePanel({ companion, snapshot, navigate, openSession, renewSession })
1946
2099
  const capabilities = companion.capabilities.map((item) => ({ knowledge: "\u77E5\u8BC6\u5E93", skills: "\u6280\u80FD", ssh: "SSH", git: "Git" })[item]);
1947
2100
  const online = channel?.runtimeStatus === "running";
1948
2101
  const latestSession = sessions.reduce((latest, item) => latest === void 0 || item.lastMessageAt > latest.lastMessageAt ? item : latest, void 0);
1949
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-home", children: [
1950
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { className: "dsh-partner-home-heading", children: [
1951
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
1952
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
1953
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u5FAE\u4FE1\u5F85\u547D` : `\u8FDE\u63A5 ${companion.name} \u7684\u7B2C\u4E00\u6761\u6E20\u9053` })
2102
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-home", children: [
2103
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className: "dsh-partner-home-heading", children: [
2104
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2105
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
2106
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u5FAE\u4FE1\u5F85\u547D` : `\u8FDE\u63A5 ${companion.name} \u7684\u7B2C\u4E00\u6761\u6E20\u9053` })
1954
2107
  ] }),
1955
- /* @__PURE__ */ (0, import_jsx_runtime2.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\u5DF2\u7ECF\u5C31\u7EEA\uFF0C\u8FDE\u63A5\u5FAE\u4FE1\u540E\u5373\u53EF\u5F00\u59CB\u6301\u7EED\u5DE5\u4F5C\u3002" })
2108
+ /* @__PURE__ */ (0, import_jsx_runtime.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\u5DF2\u7ECF\u5C31\u7EEA\uFF0C\u8FDE\u63A5\u5FAE\u4FE1\u540E\u5373\u53EF\u5F00\u59CB\u6301\u7EED\u5DE5\u4F5C\u3002" })
1956
2109
  ] }),
1957
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
1958
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
1959
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Avatar, { name: companion.name }),
1960
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", {}) }),
1961
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(WeixinGlyph, { large: true }) })
2110
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
2111
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
2112
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Avatar, { name: companion.name }),
2113
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", {}) }),
2114
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WeixinGlyph, { large: true }) })
1962
2115
  ] }),
1963
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
1964
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
1965
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", {}),
2116
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
2117
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
2118
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", {}),
1966
2119
  "\u4E3B\u8981\u6E20\u9053 \xB7 \u5FAE\u4FE1"
1967
2120
  ] }),
1968
- /* @__PURE__ */ (0, import_jsx_runtime2.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" }),
1969
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: !channel ? "\u901A\u8FC7\u5FAE\u4FE1 iLink Bot \u63A5\u5165\u3002\u51ED\u636E\u53EA\u8FDB\u5165 DSH \u51ED\u636E\u5E93\uFF0C\u8054\u7CFB\u4EBA\u9996\u6B21\u53D1\u6D88\u606F\u4ECD\u9700\u4F60\u7684\u6279\u51C6\u3002" : online ? "\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u62E5\u6709\u72EC\u7ACB DSH \u4F1A\u8BDD\uFF0C\u4F19\u4F34\u8EAB\u4EFD\u4E00\u81F4\uFF0C\u4F46\u4E0A\u4E0B\u6587\u4E0D\u4F1A\u4E92\u76F8\u6DF7\u5408\u3002" : channel.lastError || "\u6E20\u9053\u914D\u7F6E\u4ECD\u7136\u4FDD\u7559\uFF0C\u53EF\u4EE5\u968F\u65F6\u91CD\u65B0\u542F\u7528\u3002" }),
1970
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
1971
- /* @__PURE__ */ (0, import_jsx_runtime2.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" }),
1972
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: !channel ? "\u626B\u7801\u5B8C\u6210\uFF0C\u65E0\u9700\u7C98\u8D34 Token" : `${approved} \u4F4D\u8054\u7CFB\u4EBA \xB7 ${sessions.length} \u4E2A\u72EC\u7ACB\u4F1A\u8BDD` })
2121
+ /* @__PURE__ */ (0, import_jsx_runtime.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" }),
2122
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: !channel ? "\u901A\u8FC7\u5FAE\u4FE1 iLink Bot \u63A5\u5165\u3002\u51ED\u636E\u53EA\u8FDB\u5165 DSH \u51ED\u636E\u5E93\uFF0C\u8054\u7CFB\u4EBA\u9996\u6B21\u53D1\u6D88\u606F\u4ECD\u9700\u4F60\u7684\u6279\u51C6\u3002" : online ? "\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u62E5\u6709\u72EC\u7ACB DSH \u4F1A\u8BDD\uFF0C\u4F19\u4F34\u8EAB\u4EFD\u4E00\u81F4\uFF0C\u4F46\u4E0A\u4E0B\u6587\u4E0D\u4F1A\u4E92\u76F8\u6DF7\u5408\u3002" : channel.lastError || "\u6E20\u9053\u914D\u7F6E\u4ECD\u7136\u4FDD\u7559\uFF0C\u53EF\u4EE5\u968F\u65F6\u91CD\u65B0\u542F\u7528\u3002" }),
2123
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
2124
+ /* @__PURE__ */ (0, import_jsx_runtime.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" }),
2125
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: !channel ? "\u626B\u7801\u5B8C\u6210\uFF0C\u65E0\u9700\u7C98\u8D34 Token" : `${approved} \u4F4D\u8054\u7CFB\u4EBA \xB7 ${sessions.length} \u4E2A\u72EC\u7ACB\u4F1A\u8BDD` })
1973
2126
  ] })
1974
2127
  ] })
1975
2128
  ] }),
1976
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-home-details", children: [
1977
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: "dsh-partner-home-profile", children: [
1978
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { children: [
1979
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconUserOutline16, { size: 16 }) }),
1980
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
1981
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
1982
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: companion.role })
2129
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-home-details", children: [
2130
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dsh-partner-home-profile", children: [
2131
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [
2132
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconUserOutline16, { size: 16 }) }),
2133
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
2134
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
2135
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: companion.role })
1983
2136
  ] }),
1984
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
2137
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
1985
2138
  ] }),
1986
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
2139
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
1987
2140
  ] }),
1988
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
1989
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { children: [
1990
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 16 }) }),
1991
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
1992
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
1993
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
2141
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
2142
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [
2143
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 16 }) }),
2144
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
2145
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
2146
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
1994
2147
  ] }),
1995
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
2148
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
1996
2149
  ] }),
1997
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
2150
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
1998
2151
  ] }),
1999
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
2000
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { children: [
2001
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconDataOutline16, { size: 16 }) }),
2002
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
2003
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "\u4F1A\u8BDD\u8FDE\u7EED\u6027" }),
2004
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: sessions.length ? `${sessions.length} \u4E2A\u5171\u4EAB\u4F1A\u8BDD` : "\u7B49\u5F85\u7B2C\u4E00\u6761\u6D88\u606F" })
2152
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
2153
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [
2154
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconDataOutline16, { size: 16 }) }),
2155
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
2156
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "\u4F1A\u8BDD\u8FDE\u7EED\u6027" }),
2157
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: sessions.length ? `${sessions.length} \u4E2A\u5171\u4EAB\u4F1A\u8BDD` : "\u7B49\u5F85\u7B2C\u4E00\u6761\u6D88\u606F" })
2005
2158
  ] }),
2006
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", onClick: () => latestSession === void 0 ? navigate("memory") : latestSession.archived ? void renewSession(latestSession.id) : void openSession(latestSession.id, latestSession.sessionId), children: latestSession === void 0 ? "\u67E5\u770B" : latestSession.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
2159
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: () => latestSession === void 0 ? navigate("memory") : latestSession.archived ? void renewSession(latestSession.id) : void openSession(latestSession.id, latestSession.sessionId), children: latestSession === void 0 ? "\u67E5\u770B" : latestSession.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
2007
2160
  ] }),
2008
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: sessions.length ? `\u6700\u8FD1\u6D3B\u52A8\u4E8E ${relativeTime(Math.max(...sessions.map((item) => item.lastMessageAt)))}` : "\u5FAE\u4FE1\u8054\u7CFB\u4EBA\u901A\u8FC7\u914D\u5BF9\u540E\uFF0C\u5C06\u5728\u8FD9\u91CC\u5EFA\u7ACB\u72EC\u7ACB\u4E0A\u4E0B\u6587\u3002" })
2161
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: sessions.length ? `\u6700\u8FD1\u6D3B\u52A8\u4E8E ${relativeTime(Math.max(...sessions.map((item) => item.lastMessageAt)))}` : "\u5FAE\u4FE1\u8054\u7CFB\u4EBA\u901A\u8FC7\u914D\u5BF9\u540E\uFF0C\u5C06\u5728\u8FD9\u91CC\u5EFA\u7ACB\u72EC\u7ACB\u4E0A\u4E0B\u6587\u3002" })
2009
2162
  ] })
2010
2163
  ] })
2011
2164
  ] });
2012
2165
  }
2013
2166
  function IdentityEditor({ companion, count, onChanged }) {
2014
- const [form, setForm] = (0, import_react4.useState)(() => companionDraft(companion));
2015
- const [saving, setSaving] = (0, import_react4.useState)(false);
2016
- const [saved, setSaved] = (0, import_react4.useState)(false);
2017
- const [error, setError] = (0, import_react4.useState)();
2018
- (0, import_react4.useEffect)(() => {
2167
+ const [form, setForm] = (0, import_react3.useState)(() => companionDraft(companion));
2168
+ const [saving, setSaving] = (0, import_react3.useState)(false);
2169
+ const [saved, setSaved] = (0, import_react3.useState)(false);
2170
+ const [error, setError] = (0, import_react3.useState)();
2171
+ (0, import_react3.useEffect)(() => {
2019
2172
  setForm(companionDraft(companion));
2020
2173
  setSaved(false);
2021
2174
  }, [companion.id, companion.updatedAt]);
@@ -2042,45 +2195,45 @@ function IdentityEditor({ companion, count, onChanged }) {
2042
2195
  setError(message(reason));
2043
2196
  }
2044
2197
  };
2045
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("form", { className: "dsh-partner-form is-identity", onSubmit: (event) => {
2198
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { className: "dsh-partner-form is-identity", onSubmit: (event) => {
2046
2199
  void submit(event);
2047
2200
  }, children: [
2048
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Section, { 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" }),
2049
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-fields two", children: [
2050
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Field, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("input", { required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
2051
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Field, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("input", { required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
2201
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, { 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" }),
2202
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-fields two", children: [
2203
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
2204
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
2052
2205
  ] }),
2053
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Field, { 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_runtime2.jsx)("textarea", { rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
2054
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Field, { 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_runtime2.jsx)("textarea", { rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
2055
- error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
2056
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-form-actions", children: [
2057
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: saved && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
2058
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconCheckOutline14, { size: 14 }),
2206
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, { 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_runtime.jsx)("textarea", { rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
2207
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, { 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_runtime.jsx)("textarea", { rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
2208
+ error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
2209
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-form-actions", children: [
2210
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: saved && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
2211
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconCheckOutline14, { size: 14 }),
2059
2212
  "\u5DF2\u4FDD\u5B58\uFF0C\u540E\u7EED\u5FAE\u4FE1\u6D88\u606F\u5C06\u4F7F\u7528\u65B0\u8EAB\u4EFD"
2060
2213
  ] }) }),
2061
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { disabled: saving, children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
2214
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { disabled: saving, children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
2062
2215
  ] }),
2063
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-identity-danger", children: [
2064
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
2065
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: "\u5220\u9664\u4F19\u4F34" }),
2066
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "\u5FC5\u987B\u5148\u79FB\u9664\u5DF2\u7ED1\u5B9A\u5FAE\u4FE1\u6E20\u9053\uFF1B\u4E0D\u4F1A\u81EA\u52A8\u628A\u8054\u7CFB\u4EBA\u8F6C\u4EA4\u7ED9\u5176\u4ED6\u4F19\u4F34\u3002" })
2216
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-identity-danger", children: [
2217
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2218
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: "\u5220\u9664\u4F19\u4F34" }),
2219
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "\u5FC5\u987B\u5148\u79FB\u9664\u5DF2\u7ED1\u5B9A\u5FAE\u4FE1\u6E20\u9053\uFF1B\u4E0D\u4F1A\u81EA\u52A8\u628A\u8054\u7CFB\u4EBA\u8F6C\u4EA4\u7ED9\u5176\u4ED6\u4F19\u4F34\u3002" })
2067
2220
  ] }),
2068
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { type: "button", disabled: count <= 1, onClick: () => {
2221
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", disabled: count <= 1, onClick: () => {
2069
2222
  void remove();
2070
2223
  }, children: [
2071
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconTrashOutline16, { size: 16 }),
2224
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconTrashOutline16, { size: 16 }),
2072
2225
  "\u5220\u9664"
2073
2226
  ] })
2074
2227
  ] })
2075
2228
  ] });
2076
2229
  }
2077
2230
  function CapabilityEditor({ companion, presets, onChanged }) {
2078
- const [form, setForm] = (0, import_react4.useState)(() => companionDraft(companion));
2079
- const [modelCatalog, setModelCatalog] = (0, import_react4.useState)();
2080
- const [saving, setSaving] = (0, import_react4.useState)(false);
2081
- const [error, setError] = (0, import_react4.useState)();
2082
- (0, import_react4.useEffect)(() => setForm(companionDraft(companion)), [companion.id, companion.updatedAt]);
2083
- (0, import_react4.useEffect)(() => {
2231
+ const [form, setForm] = (0, import_react3.useState)(() => companionDraft(companion));
2232
+ const [modelCatalog, setModelCatalog] = (0, import_react3.useState)();
2233
+ const [saving, setSaving] = (0, import_react3.useState)(false);
2234
+ const [error, setError] = (0, import_react3.useState)();
2235
+ (0, import_react3.useEffect)(() => setForm(companionDraft(companion)), [companion.id, companion.updatedAt]);
2236
+ (0, import_react3.useEffect)(() => {
2084
2237
  void api("/models").then(setModelCatalog).catch((reason) => setError(message(reason)));
2085
2238
  }, []);
2086
2239
  const toggle = (capability) => setForm((current) => ({ ...current, capabilities: current.capabilities.includes(capability) ? current.capabilities.filter((item) => item !== capability) : [...current.capabilities, capability] }));
@@ -2105,41 +2258,41 @@ function CapabilityEditor({ companion, presets, onChanged }) {
2105
2258
  const selectedProvider = form.provider || modelCatalog?.defaultSelection.provider || "";
2106
2259
  const modelOptions = modelCatalog?.providers.find((item) => item.id === selectedProvider)?.models ?? [];
2107
2260
  const currentModelMissing = Boolean(form.model) && !modelOptions.some((item) => item.id === form.model);
2108
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-form is-capabilities", children: [
2109
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Section, { 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" }),
2110
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Field, { label: "Agent Preset", hint: "\u51B3\u5B9A\u8FD9\u4E2A\u4F19\u4F34\u5B9E\u9645\u52A0\u8F7D\u54EA\u4E9B\u5DE5\u5177\u3001\u6280\u80FD\u548C\u7CFB\u7EDF\u63D0\u793A\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("select", { value: form.presetId, onChange: (event) => setForm({ ...form, presetId: event.target.value }), children: [
2111
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: "", children: "\u8DDF\u968F DSH \u9ED8\u8BA4 Preset" }),
2112
- presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: item.id, children: item.name }, item.id))
2261
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-form is-capabilities", children: [
2262
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, { 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" }),
2263
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, { label: "Agent Preset", hint: "\u51B3\u5B9A\u8FD9\u4E2A\u4F19\u4F34\u5B9E\u9645\u52A0\u8F7D\u54EA\u4E9B\u5DE5\u5177\u3001\u6280\u80FD\u548C\u7CFB\u7EDF\u63D0\u793A\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", { value: form.presetId, onChange: (event) => setForm({ ...form, presetId: event.target.value }), children: [
2264
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "", children: "\u8DDF\u968F DSH \u9ED8\u8BA4 Preset" }),
2265
+ presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: item.id, children: item.name }, item.id))
2113
2266
  ] }) }),
2114
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-capabilities", children: choices.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { type: "button", className: form.capabilities.includes(choice.id) ? "is-active" : "", onClick: () => toggle(choice.id), children: [
2115
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: form.capabilities.includes(choice.id) && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconCheckOutline14, { size: 14 }) }),
2116
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: choice.title }),
2117
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: choice.detail })
2267
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-capabilities", children: choices.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: form.capabilities.includes(choice.id) ? "is-active" : "", onClick: () => toggle(choice.id), children: [
2268
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: form.capabilities.includes(choice.id) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconCheckOutline14, { size: 14 }) }),
2269
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: choice.title }),
2270
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: choice.detail })
2118
2271
  ] }, choice.id)) }),
2119
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-fields two", children: [
2120
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Field, { label: "\u6A21\u578B\u63D0\u4F9B\u65B9", hint: "\u6A21\u578B\u76EE\u5F55\u6765\u81EA\u5F53\u524D\u5BA2\u6237\u7AEF", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("select", { value: form.provider, onChange: (event) => setForm({ ...form, provider: event.target.value, model: "" }), children: [
2121
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("option", { value: "", children: [
2272
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-fields two", children: [
2273
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, { label: "\u6A21\u578B\u63D0\u4F9B\u65B9", hint: "\u6A21\u578B\u76EE\u5F55\u6765\u81EA\u5F53\u524D\u5BA2\u6237\u7AEF", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", { value: form.provider, onChange: (event) => setForm({ ...form, provider: event.target.value, model: "" }), children: [
2274
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("option", { value: "", children: [
2122
2275
  "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
2123
2276
  modelCatalog?.defaultSelection.provider || "\u6B63\u5728\u8BFB\u53D6"
2124
2277
  ] }),
2125
- modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
2278
+ modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
2126
2279
  ] }) }),
2127
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Field, { label: "\u6A21\u578B", hint: "\u968F\u63D0\u4F9B\u65B9\u8054\u52A8", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("select", { value: form.model, onChange: (event) => setForm({ ...form, model: event.target.value }), children: [
2128
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("option", { value: "", children: [
2280
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, { label: "\u6A21\u578B", hint: "\u968F\u63D0\u4F9B\u65B9\u8054\u52A8", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", { value: form.model, onChange: (event) => setForm({ ...form, model: event.target.value }), children: [
2281
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("option", { value: "", children: [
2129
2282
  "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
2130
2283
  modelCatalog?.defaultSelection.model || "\u6B63\u5728\u8BFB\u53D6"
2131
2284
  ] }),
2132
- currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("option", { value: form.model, children: [
2285
+ currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("option", { value: form.model, children: [
2133
2286
  "\u5F53\u524D\u914D\u7F6E \xB7 ",
2134
2287
  form.model
2135
2288
  ] }),
2136
- modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
2289
+ modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
2137
2290
  ] }) })
2138
2291
  ] }),
2139
- error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
2140
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-form-actions", children: [
2141
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {}),
2142
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", disabled: saving, onClick: () => {
2292
+ error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
2293
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-form-actions", children: [
2294
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}),
2295
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", disabled: saving, onClick: () => {
2143
2296
  void save();
2144
2297
  }, children: saving ? "\u6B63\u5728\u5E94\u7528\u2026" : "\u5E94\u7528\u80FD\u529B\u7EC4\u5408" })
2145
2298
  ] })
@@ -2147,10 +2300,10 @@ function CapabilityEditor({ companion, presets, onChanged }) {
2147
2300
  }
2148
2301
  function WeixinPanel({ companion, snapshot, onChanged }) {
2149
2302
  const channel = snapshot.channels.find((item) => item.companionId === companion.id);
2150
- const [login, setLogin] = (0, import_react4.useState)();
2151
- const [busy, setBusy] = (0, import_react4.useState)(false);
2152
- const [error, setError] = (0, import_react4.useState)();
2153
- (0, import_react4.useEffect)(() => {
2303
+ const [login, setLogin] = (0, import_react3.useState)();
2304
+ const [busy, setBusy] = (0, import_react3.useState)(false);
2305
+ const [error, setError] = (0, import_react3.useState)();
2306
+ (0, import_react3.useEffect)(() => {
2154
2307
  if (!login || login.phase === "confirmed" || login.phase === "expired" || login.phase === "error") return;
2155
2308
  const timer = window.setInterval(() => {
2156
2309
  void api(`/weixin/login/${login.id}`).then(async (result) => {
@@ -2196,118 +2349,121 @@ function WeixinPanel({ companion, snapshot, onChanged }) {
2196
2349
  setError(message(reason));
2197
2350
  }
2198
2351
  };
2199
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
2200
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Section, { 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" }),
2201
- !channel && !login && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-weixin-connect", children: [
2202
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(WeixinGlyph, { large: true }) }),
2203
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
2204
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("strong", { children: [
2352
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
2353
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, { 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" }),
2354
+ !channel && !login && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-weixin-connect", children: [
2355
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WeixinGlyph, { large: true }) }),
2356
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2357
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("strong", { children: [
2205
2358
  "\u628A ",
2206
2359
  companion.name,
2207
2360
  " \u5E26\u5230\u5FAE\u4FE1"
2208
2361
  ] }),
2209
- /* @__PURE__ */ (0, import_jsx_runtime2.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" }),
2210
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("ul", { children: [
2211
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
2212
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
2213
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
2362
+ /* @__PURE__ */ (0, import_jsx_runtime.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" }),
2363
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("ul", { children: [
2364
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
2365
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
2366
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
2214
2367
  ] })
2215
2368
  ] }),
2216
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", disabled: busy, onClick: () => {
2369
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", disabled: busy, onClick: () => {
2217
2370
  void begin();
2218
2371
  }, children: busy ? "\u6B63\u5728\u7533\u8BF7\u4E8C\u7EF4\u7801\u2026" : "\u626B\u7801\u8FDE\u63A5\u5FAE\u4FE1" })
2219
2372
  ] }),
2220
- login && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-qr", children: [
2221
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
2222
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
2223
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "WECHAT ILINK BOT" }),
2224
- /* @__PURE__ */ (0, import_jsx_runtime2.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" }),
2225
- /* @__PURE__ */ (0, import_jsx_runtime2.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") }),
2226
- (login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { type: "button", onClick: () => {
2373
+ login && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-qr", children: [
2374
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
2375
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2376
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "WECHAT ILINK BOT" }),
2377
+ /* @__PURE__ */ (0, import_jsx_runtime.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" }),
2378
+ /* @__PURE__ */ (0, import_jsx_runtime.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") }),
2379
+ (login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", onClick: () => {
2227
2380
  setLogin(void 0);
2228
2381
  void begin();
2229
2382
  }, children: [
2230
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconRefreshOutline16, { size: 16 }),
2383
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconRefreshOutline16, { size: 16 }),
2231
2384
  "\u91CD\u65B0\u751F\u6210"
2232
2385
  ] })
2233
2386
  ] })
2234
2387
  ] }),
2235
- channel && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
2236
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-channel-card", children: [
2237
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(WeixinGlyph, { large: true }) }),
2238
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
2239
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "WECHAT CHANNEL" }),
2240
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: channel.name }),
2241
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: channel.accountId })
2388
+ channel && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
2389
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-channel-card", children: [
2390
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WeixinGlyph, { large: true }) }),
2391
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2392
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "WECHAT CHANNEL" }),
2393
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: channel.name }),
2394
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: channel.accountId })
2242
2395
  ] }),
2243
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Status, { channel }),
2244
- /* @__PURE__ */ (0, import_jsx_runtime2.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: () => {
2396
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Status, { channel }),
2397
+ /* @__PURE__ */ (0, import_jsx_runtime.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: () => {
2245
2398
  void toggle();
2246
- }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", {}) })
2399
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", {}) })
2247
2400
  ] }),
2248
- channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "dsh-partner-inline-error", children: channel.lastError }),
2249
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
2250
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
2251
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "ACCESS" }),
2252
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
2401
+ channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsh-partner-inline-error", children: channel.lastError }),
2402
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
2403
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2404
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "ACCESS" }),
2405
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
2253
2406
  ] }),
2254
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("em", { children: [
2407
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("em", { children: [
2255
2408
  pairings.filter((item) => item.status === "pending").length,
2256
2409
  " \u4E2A\u5F85\u5904\u7406"
2257
2410
  ] })
2258
2411
  ] }),
2259
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(State, { 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_runtime2.jsxs)("article", { children: [
2260
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconUserOutline16, { size: 16 }) }),
2261
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
2262
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: pairing.displayName }),
2263
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("small", { children: [
2412
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(State, { 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_runtime.jsxs)("article", { children: [
2413
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconUserOutline16, { size: 16 }) }),
2414
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
2415
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: pairing.displayName }),
2416
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("small", { children: [
2264
2417
  pairing.status === "pending" ? "\u7B49\u5F85\u5BA1\u6279" : pairing.status === "approved" ? "\u5DF2\u6388\u6743\u72EC\u7ACB\u4F1A\u8BDD" : "\u5DF2\u963B\u6B62",
2265
2418
  " \xB7 ",
2266
2419
  new Date(pairing.updatedAt).toLocaleString()
2267
2420
  ] })
2268
2421
  ] }),
2269
- pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
2270
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { onClick: () => {
2422
+ pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
2423
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { onClick: () => {
2271
2424
  void actPairing(pairing.id, "blocked");
2272
2425
  }, children: "\u62D2\u7EDD" }),
2273
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: "is-primary", onClick: () => {
2426
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { className: "is-primary", onClick: () => {
2274
2427
  void actPairing(pairing.id, "approved");
2275
2428
  }, children: "\u6279\u51C6" })
2276
2429
  ] }),
2277
- pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { onClick: () => {
2430
+ pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { onClick: () => {
2278
2431
  void actPairing(pairing.id, "blocked");
2279
2432
  }, children: "\u64A4\u9500" }),
2280
- pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { onClick: () => {
2433
+ pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { onClick: () => {
2281
2434
  void actPairing(pairing.id, "approved");
2282
2435
  }, children: "\u91CD\u65B0\u6279\u51C6" })
2283
2436
  ] }, pairing.id)) })
2284
2437
  ] }),
2285
- error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "dsh-partner-inline-error", children: error })
2438
+ error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsh-partner-inline-error", children: error })
2286
2439
  ] });
2287
2440
  }
2288
2441
  function MemoryPanel({ companion, snapshot, openSession, renewSession, onChanged }) {
2289
2442
  const sessions = snapshot.sessions.filter((item) => item.companionId === companion.id);
2290
2443
  const heartbeat = snapshot.heartbeatStates.find((item) => item.companionId === companion.id);
2291
- const [automation, setAutomation] = (0, import_react4.useState)(() => structuredClone(companion.automation));
2292
- const [memories, setMemories] = (0, import_react4.useState)([]);
2293
- const [reflections, setReflections] = (0, import_react4.useState)([]);
2294
- const [graph, setGraph] = (0, import_react4.useState)({ memories: [], relations: [] });
2295
- const [editing, setEditing] = (0, import_react4.useState)();
2296
- const [busy, setBusy] = (0, import_react4.useState)(false);
2297
- const [notice, setNotice] = (0, import_react4.useState)();
2298
- const [error, setError] = (0, import_react4.useState)();
2299
- const [modelCatalog, setModelCatalog] = (0, import_react4.useState)();
2300
- const loadMemory = (0, import_react4.useCallback)(async () => {
2301
- const [result, relations] = await Promise.all([api(`/companions/${companion.id}/memory`), api(`/companions/${companion.id}/memory/graph`)]);
2444
+ const [automation, setAutomation] = (0, import_react3.useState)(() => structuredClone(companion.automation));
2445
+ const [memories, setMemories] = (0, import_react3.useState)([]);
2446
+ const [reflections, setReflections] = (0, import_react3.useState)([]);
2447
+ const [concernActivity, setConcernActivity] = (0, import_react3.useState)({ concerns: [], observations: [] });
2448
+ const [newConcern, setNewConcern] = (0, import_react3.useState)("");
2449
+ const [graph, setGraph] = (0, import_react3.useState)({ memories: [], relations: [] });
2450
+ const [editing, setEditing] = (0, import_react3.useState)();
2451
+ const [busy, setBusy] = (0, import_react3.useState)(false);
2452
+ const [notice, setNotice] = (0, import_react3.useState)();
2453
+ const [error, setError] = (0, import_react3.useState)();
2454
+ const [modelCatalog, setModelCatalog] = (0, import_react3.useState)();
2455
+ const loadMemory = (0, import_react3.useCallback)(async () => {
2456
+ const [result, relations, activity] = await Promise.all([api(`/companions/${companion.id}/memory`), api(`/companions/${companion.id}/memory/graph`), api(`/companions/${companion.id}/concerns`)]);
2302
2457
  setMemories(result.memories);
2303
2458
  setReflections(result.reflections);
2304
2459
  setGraph(relations);
2460
+ setConcernActivity(activity);
2305
2461
  }, [companion.id]);
2306
- (0, import_react4.useEffect)(() => {
2462
+ (0, import_react3.useEffect)(() => {
2307
2463
  setAutomation(structuredClone(companion.automation));
2308
2464
  void loadMemory().catch((reason) => setError(message(reason)));
2309
2465
  }, [companion.id, companion.updatedAt, loadMemory]);
2310
- (0, import_react4.useEffect)(() => {
2466
+ (0, import_react3.useEffect)(() => {
2311
2467
  void api("/models").then(setModelCatalog).catch((reason) => setError(message(reason)));
2312
2468
  }, []);
2313
2469
  const inheritedProvider = companion.provider || modelCatalog?.defaultSelection.provider || "";
@@ -2327,12 +2483,15 @@ function MemoryPanel({ companion, snapshot, openSession, renewSession, onChanged
2327
2483
  setBusy(false);
2328
2484
  }
2329
2485
  };
2330
- const trigger = async () => {
2486
+ const trigger = async (concernId) => {
2331
2487
  setBusy(true);
2332
2488
  setError(void 0);
2333
2489
  setNotice(void 0);
2334
2490
  try {
2335
- const result = await api(`/companions/${companion.id}/heartbeat/trigger`, { method: "POST" });
2491
+ const result = await api(`/companions/${companion.id}/heartbeat/trigger`, {
2492
+ method: "POST",
2493
+ body: JSON.stringify(concernId ? { concernId } : {})
2494
+ });
2336
2495
  setNotice(result.sent ? "\u5FC3\u8DF3\u5DF2\u5B8C\u6210\u5E76\u53D1\u9001\u5FAE\u4FE1\u63D0\u9192" : result.reason ?? "\u5FC3\u8DF3\u68C0\u67E5\u5B8C\u6210");
2337
2496
  await Promise.all([onChanged(), loadMemory()]);
2338
2497
  } catch (reason) {
@@ -2384,256 +2543,543 @@ function MemoryPanel({ companion, snapshot, openSession, renewSession, onChanged
2384
2543
  setBusy(false);
2385
2544
  }
2386
2545
  };
2387
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-form is-memory", children: [
2388
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Section, { eyebrow: "CONTINUITY", title: "\u4F1A\u8BDD\u8BB0\u5FC6", detail: "\u8FD9\u91CC\u5C55\u793A\u6E20\u9053\u4F1A\u8BDD\u8FB9\u754C\u3002\u77E5\u8BC6\u5E93\u4ECD\u7531\u77E5\u8BC6\u5E93\u63D2\u4EF6\u7BA1\u7406\uFF0C\u4F19\u4F34\u4E0D\u4F1A\u628A\u4E0D\u540C\u5FAE\u4FE1\u8054\u7CFB\u4EBA\u7684\u539F\u59CB\u4E0A\u4E0B\u6587\u6DF7\u5728\u4E00\u8D77\u3002" }),
2389
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-metrics", children: [
2390
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("article", { children: [
2391
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "\u6E20\u9053\u4F1A\u8BDD" }),
2392
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: sessions.length }),
2393
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: "\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u72EC\u7ACB" })
2546
+ const addConcern = async () => {
2547
+ const subject = newConcern.trim();
2548
+ if (!subject) return;
2549
+ setBusy(true);
2550
+ setError(void 0);
2551
+ setNotice(void 0);
2552
+ try {
2553
+ await api(`/companions/${companion.id}/concerns`, { method: "POST", body: JSON.stringify({ subject }) });
2554
+ setNewConcern("");
2555
+ setNotice("\u4F19\u4F34\u4F1A\u7EE7\u7EED\u7559\u610F\u8FD9\u4EF6\u4E8B");
2556
+ await loadMemory();
2557
+ } catch (reason) {
2558
+ setError(message(reason));
2559
+ } finally {
2560
+ setBusy(false);
2561
+ }
2562
+ };
2563
+ const actConcern = async (item, action) => {
2564
+ setBusy(true);
2565
+ setError(void 0);
2566
+ setNotice(void 0);
2567
+ try {
2568
+ await api(`/companions/${companion.id}/concerns/${encodeURIComponent(item.id)}/action`, { method: "POST", body: JSON.stringify({ action }) });
2569
+ setNotice(action === "ignore" ? "\u4F19\u4F34\u4E0D\u518D\u5173\u6CE8\u8FD9\u4EF6\u4E8B" : action === "resolve" ? "\u5DF2\u6807\u8BB0\u4E3A\u89E3\u51B3" : action === "prioritize" ? "\u5DF2\u63D0\u9AD8\u5173\u6CE8" : "\u4F1A\u7EE7\u7EED\u7559\u610F");
2570
+ await loadMemory();
2571
+ } catch (reason) {
2572
+ setError(message(reason));
2573
+ } finally {
2574
+ setBusy(false);
2575
+ }
2576
+ };
2577
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-form is-memory", children: [
2578
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, { eyebrow: "CONTINUITY", title: "\u4F1A\u8BDD\u8BB0\u5FC6", detail: "\u8FD9\u91CC\u5C55\u793A\u6E20\u9053\u4F1A\u8BDD\u8FB9\u754C\u3002\u77E5\u8BC6\u5E93\u4ECD\u7531\u77E5\u8BC6\u5E93\u63D2\u4EF6\u7BA1\u7406\uFF0C\u4F19\u4F34\u4E0D\u4F1A\u628A\u4E0D\u540C\u5FAE\u4FE1\u8054\u7CFB\u4EBA\u7684\u539F\u59CB\u4E0A\u4E0B\u6587\u6DF7\u5728\u4E00\u8D77\u3002" }),
2579
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-metrics", children: [
2580
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", { children: [
2581
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "\u6E20\u9053\u4F1A\u8BDD" }),
2582
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: sessions.length }),
2583
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u72EC\u7ACB" })
2394
2584
  ] }),
2395
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("article", { children: [
2396
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "\u957F\u671F\u8BB0\u5FC6" }),
2397
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: memories.filter((item) => item.status === "active").length }),
2398
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("p", { children: [
2585
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", { children: [
2586
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "\u957F\u671F\u8BB0\u5FC6" }),
2587
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: memories.filter((item) => item.status === "active").length }),
2588
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [
2399
2589
  reflections.length,
2400
2590
  " \u7BC7\u6BCF\u65E5\u56DE\u987E"
2401
2591
  ] })
2402
2592
  ] }),
2403
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("article", { children: [
2404
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "\u6700\u8FD1\u5FC3\u8DF3" }),
2405
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: heartbeat?.lastCheckedAt ? relativeTime(heartbeat.lastCheckedAt) : "\u5C1A\u672A" }),
2406
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: heartbeat?.lastError ? "\u4E0A\u6B21\u6267\u884C\u5F02\u5E38" : `\u4ECA\u65E5\u53D1\u9001 ${heartbeat?.sentCount ?? 0} \u6B21` })
2593
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", { children: [
2594
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "\u6700\u8FD1\u5FC3\u8DF3" }),
2595
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: heartbeat?.lastCheckedAt ? relativeTime(heartbeat.lastCheckedAt) : "\u5C1A\u672A" }),
2596
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: heartbeat?.lastError ? "\u4E0A\u6B21\u6267\u884C\u5F02\u5E38" : `\u4ECA\u65E5\u53D1\u9001 ${heartbeat?.sentCount ?? 0} \u6B21` })
2407
2597
  ] })
2408
2598
  ] }),
2409
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-automation-grid", children: [
2410
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: "dsh-partner-automation", children: [
2411
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { children: [
2412
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
2413
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: "\u5B66\u4E60\u4E0E\u957F\u671F\u8BB0\u5FC6" }),
2414
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "\u6309\u8054\u7CFB\u4EBA\u5F52\u6863\u5B8C\u6574\u5BF9\u8BDD\uFF0C\u63D0\u70BC\u6BCF\u65E5\u56DE\u987E\u548C\u7ED3\u6784\u5316\u8BB0\u5FC6\uFF0C\u5E76\u5728\u76F8\u5173\u8BDD\u9898\u51FA\u73B0\u65F6\u53EC\u56DE\u3002" })
2599
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-automation-grid", children: [
2600
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dsh-partner-automation", children: [
2601
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [
2602
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2603
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: "\u5B66\u4E60\u4E0E\u957F\u671F\u8BB0\u5FC6" }),
2604
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "\u6309\u8054\u7CFB\u4EBA\u5F52\u6863\u5B8C\u6574\u5BF9\u8BDD\uFF0C\u63D0\u70BC\u6BCF\u65E5\u56DE\u987E\u548C\u7ED3\u6784\u5316\u8BB0\u5FC6\uFF0C\u5E76\u5728\u76F8\u5173\u8BDD\u9898\u51FA\u73B0\u65F6\u53EC\u56DE\u3002" })
2415
2605
  ] }),
2416
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.memory.enabled, "aria-label": "\u542F\u7528\u4F19\u4F34\u5B66\u4E60", onClick: () => setAutomation((current) => ({ ...current, memory: { ...current.memory, enabled: !current.memory.enabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", {}) })
2606
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.memory.enabled, "aria-label": "\u542F\u7528\u4F19\u4F34\u5B66\u4E60", onClick: () => setAutomation((current) => ({ ...current, memory: { ...current.memory, enabled: !current.memory.enabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", {}) })
2417
2607
  ] }),
2418
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-automation-fields is-memory-model", children: [
2419
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Field, { label: "\u4FDD\u7559\u671F\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("select", { value: automation.memory.retentionDays, onChange: (event) => setAutomation((current) => ({ ...current, memory: { ...current.memory, retentionDays: Number(event.target.value) } })), children: [
2420
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 0, children: "\u6C38\u4E45\u4FDD\u7559" }),
2421
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 30, children: "30 \u5929" }),
2422
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 90, children: "90 \u5929" }),
2423
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 180, children: "180 \u5929" }),
2424
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 365, children: "1 \u5E74" }),
2425
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 1095, children: "3 \u5E74" })
2608
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-automation-fields is-memory-model", children: [
2609
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, { label: "\u4FDD\u7559\u671F\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", { value: automation.memory.retentionDays, onChange: (event) => setAutomation((current) => ({ ...current, memory: { ...current.memory, retentionDays: Number(event.target.value) } })), children: [
2610
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 0, children: "\u6C38\u4E45\u4FDD\u7559" }),
2611
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 30, children: "30 \u5929" }),
2612
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 90, children: "90 \u5929" }),
2613
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 180, children: "180 \u5929" }),
2614
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 365, children: "1 \u5E74" }),
2615
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 1095, children: "3 \u5E74" })
2426
2616
  ] }) }),
2427
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Field, { label: "\u63D0\u70BC Provider", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("select", { value: automation.memory.provider ?? "", onChange: (event) => setAutomation((current) => ({ ...current, memory: { ...current.memory, provider: event.target.value, model: "" } })), children: [
2428
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("option", { value: "", children: [
2617
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, { label: "\u63D0\u70BC Provider", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", { value: automation.memory.provider ?? "", onChange: (event) => setAutomation((current) => ({ ...current, memory: { ...current.memory, provider: event.target.value, model: "" } })), children: [
2618
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("option", { value: "", children: [
2429
2619
  "\u8DDF\u968F\u4F19\u4F34 \xB7 ",
2430
2620
  inheritedProvider || "DSH \u9ED8\u8BA4"
2431
2621
  ] }),
2432
- modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
2622
+ modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
2433
2623
  ] }) }),
2434
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Field, { label: "\u63D0\u70BC\u6A21\u578B", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("select", { value: automation.memory.model ?? "", onChange: (event) => setAutomation((current) => ({ ...current, memory: { ...current.memory, model: event.target.value } })), children: [
2435
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("option", { value: "", children: [
2624
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, { label: "\u63D0\u70BC\u6A21\u578B", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", { value: automation.memory.model ?? "", onChange: (event) => setAutomation((current) => ({ ...current, memory: { ...current.memory, model: event.target.value } })), children: [
2625
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("option", { value: "", children: [
2436
2626
  "\u8DDF\u968F\u4F19\u4F34 \xB7 ",
2437
2627
  companion.model || modelCatalog?.defaultSelection.model || "DSH \u9ED8\u8BA4"
2438
2628
  ] }),
2439
- modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
2629
+ modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
2440
2630
  ] }) })
2441
2631
  ] }),
2442
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-review-policy", children: [
2443
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.memory.dailyReviewEnabled, "aria-label": "\u542F\u7528\u6BCF\u65E5\u7EC8\u5BA1", onClick: () => setAutomation((current) => ({ ...current, memory: { ...current.memory, dailyReviewEnabled: !current.memory.dailyReviewEnabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", {}) }),
2444
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
2445
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: "\u6BCF\u65E5\u7EC8\u5BA1" }),
2446
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "\u6B21\u65E5\u81EA\u52A8\u5408\u5E76\u91CD\u590D\u3001\u7EA0\u6B63\u504F\u5DEE\u5E76\u5EFA\u7ACB\u8BB0\u5FC6\u5173\u7CFB" })
2632
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-review-policy", children: [
2633
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.memory.dailyReviewEnabled, "aria-label": "\u542F\u7528\u6BCF\u65E5\u7EC8\u5BA1", onClick: () => setAutomation((current) => ({ ...current, memory: { ...current.memory, dailyReviewEnabled: !current.memory.dailyReviewEnabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", {}) }),
2634
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2635
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: "\u6BCF\u65E5\u7EC8\u5BA1" }),
2636
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "\u6B21\u65E5\u81EA\u52A8\u5408\u5E76\u91CD\u590D\u3001\u7EA0\u6B63\u504F\u5DEE\u5E76\u5EFA\u7ACB\u8BB0\u5FC6\u5173\u7CFB" })
2447
2637
  ] }),
2448
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("select", { "aria-label": "\u6BCF\u65E5\u7EC8\u5BA1\u65F6\u95F4", value: automation.memory.dailyReviewHour, onChange: (event) => setAutomation((current) => ({ ...current, memory: { ...current.memory, dailyReviewHour: Number(event.target.value) } })), children: Array.from({ length: 24 }, (_, hour) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("option", { value: hour, children: [
2638
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("select", { "aria-label": "\u6BCF\u65E5\u7EC8\u5BA1\u65F6\u95F4", value: automation.memory.dailyReviewHour, onChange: (event) => setAutomation((current) => ({ ...current, memory: { ...current.memory, dailyReviewHour: Number(event.target.value) } })), children: Array.from({ length: 24 }, (_, hour) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("option", { value: hour, children: [
2449
2639
  String(hour).padStart(2, "0"),
2450
2640
  ":00"
2451
2641
  ] }, hour)) }) }),
2452
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", disabled: busy || reflections.length === 0, onClick: () => {
2642
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", disabled: busy || reflections.length === 0, onClick: () => {
2453
2643
  void review();
2454
2644
  }, children: "\u7ACB\u5373\u7EC8\u5BA1" })
2455
2645
  ] })
2456
2646
  ] }),
2457
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: "dsh-partner-automation", children: [
2458
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { children: [
2459
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
2460
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: "\u4F4E\u6253\u6270\u5FC3\u8DF3" }),
2461
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "\u6309\u5468\u671F\u68C0\u67E5\u672A\u5B8C\u6210\u4E8B\u9879\u548C\u771F\u6B63\u6709\u4EF7\u503C\u7684\u65B0\u4FE1\u606F\uFF1B\u65E0\u5185\u5BB9\u65F6\u4E0D\u4F1A\u53D1\u6D88\u606F\u3002" })
2647
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dsh-partner-automation", children: [
2648
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [
2649
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2650
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: "\u6301\u7EED\u611F\u77E5" }),
2651
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "\u4F19\u4F34\u53EA\u89C2\u5BDF\u5C1A\u672A\u95ED\u73AF\u7684\u4E8B\u60C5\u662F\u5426\u51FA\u73B0\u65B0\u53D8\u5316\uFF0C\u5E76\u7531\u514B\u5236\u7684\u6253\u6270\u7B56\u7565\u51B3\u5B9A\u4F55\u65F6\u544A\u8BC9\u4F60\u3002" })
2462
2652
  ] }),
2463
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.heartbeat.enabled, "aria-label": "\u542F\u7528\u4F19\u4F34\u5FC3\u8DF3", onClick: () => setAutomation((current) => ({ ...current, heartbeat: { ...current.heartbeat, enabled: !current.heartbeat.enabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", {}) })
2653
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.heartbeat.enabled, "aria-label": "\u542F\u7528\u4F19\u4F34\u5FC3\u8DF3", onClick: () => setAutomation((current) => ({ ...current, heartbeat: { ...current.heartbeat, enabled: !current.heartbeat.enabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", {}) })
2464
2654
  ] }),
2465
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-automation-fields is-heartbeat", children: [
2466
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Field, { label: "\u68C0\u67E5\u95F4\u9694", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("select", { value: automation.heartbeat.intervalMinutes, onChange: (event) => setAutomation((current) => ({ ...current, heartbeat: { ...current.heartbeat, intervalMinutes: Number(event.target.value) } })), children: [
2467
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 30, children: "30 \u5206\u949F" }),
2468
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 60, children: "1 \u5C0F\u65F6" }),
2469
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 180, children: "3 \u5C0F\u65F6" }),
2470
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 360, children: "6 \u5C0F\u65F6" }),
2471
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 720, children: "12 \u5C0F\u65F6" }),
2472
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 1440, children: "24 \u5C0F\u65F6" })
2655
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-automation-fields is-heartbeat", children: [
2656
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, { label: "\u68C0\u67E5\u95F4\u9694", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", { value: automation.heartbeat.intervalMinutes, onChange: (event) => setAutomation((current) => ({ ...current, heartbeat: { ...current.heartbeat, intervalMinutes: Number(event.target.value) } })), children: [
2657
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 30, children: "30 \u5206\u949F" }),
2658
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 60, children: "1 \u5C0F\u65F6" }),
2659
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 180, children: "3 \u5C0F\u65F6" }),
2660
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 360, children: "6 \u5C0F\u65F6" }),
2661
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 720, children: "12 \u5C0F\u65F6" }),
2662
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 1440, children: "24 \u5C0F\u65F6" })
2473
2663
  ] }) }),
2474
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Field, { label: "\u514D\u6253\u6270\u5F00\u59CB", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("input", { type: "number", min: 0, max: 23, value: automation.heartbeat.quietStartHour, onChange: (event) => setAutomation((current) => ({ ...current, heartbeat: { ...current.heartbeat, quietStartHour: Number(event.target.value) } })) }) }),
2475
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Field, { label: "\u514D\u6253\u6270\u7ED3\u675F", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("input", { type: "number", min: 0, max: 23, value: automation.heartbeat.quietEndHour, onChange: (event) => setAutomation((current) => ({ ...current, heartbeat: { ...current.heartbeat, quietEndHour: Number(event.target.value) } })) }) }),
2476
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Field, { label: "\u6BCF\u65E5\u4E0A\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("select", { value: automation.heartbeat.dailyLimit, onChange: (event) => setAutomation((current) => ({ ...current, heartbeat: { ...current.heartbeat, dailyLimit: Number(event.target.value) } })), children: [
2477
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 0, children: "\u4E0D\u9650" }),
2478
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 1, children: "1 \u6B21" }),
2479
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 2, children: "2 \u6B21" }),
2480
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 3, children: "3 \u6B21" }),
2481
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 5, children: "5 \u6B21" }),
2482
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("option", { value: 8, children: "8 \u6B21" })
2664
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, { label: "\u514D\u6253\u6270\u5F00\u59CB", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "number", min: 0, max: 23, value: automation.heartbeat.quietStartHour, onChange: (event) => setAutomation((current) => ({ ...current, heartbeat: { ...current.heartbeat, quietStartHour: Number(event.target.value) } })) }) }),
2665
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, { label: "\u514D\u6253\u6270\u7ED3\u675F", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "number", min: 0, max: 23, value: automation.heartbeat.quietEndHour, onChange: (event) => setAutomation((current) => ({ ...current, heartbeat: { ...current.heartbeat, quietEndHour: Number(event.target.value) } })) }) }),
2666
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, { label: "\u6BCF\u65E5\u4E0A\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", { value: automation.heartbeat.dailyLimit, onChange: (event) => setAutomation((current) => ({ ...current, heartbeat: { ...current.heartbeat, dailyLimit: Number(event.target.value) } })), children: [
2667
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 0, children: "\u4E0D\u9650" }),
2668
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 1, children: "1 \u6B21" }),
2669
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 2, children: "2 \u6B21" }),
2670
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 3, children: "3 \u6B21" }),
2671
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 5, children: "5 \u6B21" }),
2672
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: 8, children: "8 \u6B21" })
2483
2673
  ] }) })
2484
2674
  ] }),
2485
- heartbeat?.lastError && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "dsh-partner-inline-error", children: heartbeat.lastError }),
2486
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-automation-actions", children: [
2487
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", disabled: busy || sessions.length === 0, onClick: () => {
2675
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConcernBoard, { companionId: companion.id, activity: concernActivity, value: newConcern, busy, onValue: setNewConcern, onAdd: () => {
2676
+ void addConcern();
2677
+ }, onCheck: (item) => {
2678
+ void trigger(item.id);
2679
+ }, onAct: (item, action) => {
2680
+ void actConcern(item, action);
2681
+ } }),
2682
+ heartbeat?.lastError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsh-partner-inline-error", children: heartbeat.lastError }),
2683
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-automation-actions", children: [
2684
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", disabled: busy || sessions.length === 0, onClick: () => {
2488
2685
  void trigger();
2489
- }, children: "\u7ACB\u5373\u68C0\u67E5\u4E00\u6B21" }),
2490
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => {
2686
+ }, children: "\u68C0\u67E5\u5230\u671F\u9879" }),
2687
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => {
2491
2688
  void save();
2492
2689
  }, children: busy ? "\u6B63\u5728\u5904\u7406\u2026" : "\u4FDD\u5B58\u8BBE\u7F6E" })
2493
2690
  ] })
2494
2691
  ] })
2495
2692
  ] }),
2496
- notice && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("p", { className: "dsh-partner-inline-notice", children: [
2497
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconCheckOutline14, { size: 14 }),
2693
+ notice && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "dsh-partner-inline-notice", children: [
2694
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconCheckOutline14, { size: 14 }),
2498
2695
  notice
2499
2696
  ] }),
2500
- error && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
2501
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MemoryLibrary, { memories, reflections, graph, editing, busy, setEditing, save: () => {
2697
+ error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
2698
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MemoryLibrary, { memories, reflections, graph, editing, busy, setEditing, save: () => {
2502
2699
  void saveMemory();
2503
2700
  }, remove: (item) => {
2504
2701
  void deleteMemory(item);
2505
2702
  } }),
2506
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-section-heading", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
2507
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "SESSIONS" }),
2508
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: "\u5171\u4EAB\u4F1A\u8BDD" })
2703
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-section-heading", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2704
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "SESSIONS" }),
2705
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: "\u5171\u4EAB\u4F1A\u8BDD" })
2509
2706
  ] }) }),
2510
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-session-list", children: [
2511
- sessions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("article", { "data-archived": item.archived, children: [
2512
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconDataOutline16, { size: 16 }) }),
2513
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
2514
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("strong", { children: [
2707
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-session-list", children: [
2708
+ sessions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", { "data-archived": item.archived, children: [
2709
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconDataOutline16, { size: 16 }) }),
2710
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
2711
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("strong", { children: [
2515
2712
  "\u5FAE\u4FE1\u8054\u7CFB\u4EBA \xB7 ",
2516
2713
  item.userId.slice(-6)
2517
2714
  ] }),
2518
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: item.archived ? "\u5DF2\u5F52\u6863 \xB7 \u957F\u671F\u8BB0\u5FC6\u4FDD\u7559" : `${item.sessionId} \xB7 ${new Date(item.lastMessageAt).toLocaleString()}` })
2715
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: item.archived ? "\u5DF2\u5F52\u6863 \xB7 \u957F\u671F\u8BB0\u5FC6\u4FDD\u7559" : `${item.sessionId} \xB7 ${new Date(item.lastMessageAt).toLocaleString()}` })
2519
2716
  ] }),
2520
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: item.archived ? "is-primary" : void 0, onClick: () => {
2717
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: item.archived ? "is-primary" : void 0, onClick: () => {
2521
2718
  if (item.archived) void renewSession(item.id);
2522
2719
  else void openSession(item.id, item.sessionId);
2523
2720
  }, children: item.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
2524
2721
  ] }, item.id)),
2525
- sessions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(State, { title: "\u8FD8\u6CA1\u6709\u5171\u4EAB\u4F1A\u8BDD", detail: "\u8054\u7CFB\u4EBA\u5B8C\u6210\u914D\u5BF9\u5E76\u53D1\u6765\u7B2C\u4E00\u6761\u6D88\u606F\u540E\uFF0C\u4F19\u4F34\u4F1A\u521B\u5EFA\u7F51\u9875\u4E0E\u5FAE\u4FE1\u5171\u7528\u7684\u4F1A\u8BDD\u3002", compact: true })
2722
+ sessions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(State, { title: "\u8FD8\u6CA1\u6709\u5171\u4EAB\u4F1A\u8BDD", detail: "\u8054\u7CFB\u4EBA\u5B8C\u6210\u914D\u5BF9\u5E76\u53D1\u6765\u7B2C\u4E00\u6761\u6D88\u606F\u540E\uFF0C\u4F19\u4F34\u4F1A\u521B\u5EFA\u7F51\u9875\u4E0E\u5FAE\u4FE1\u5171\u7528\u7684\u4F1A\u8BDD\u3002", compact: true })
2723
+ ] })
2724
+ ] });
2725
+ }
2726
+ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCheck, onAct }) {
2727
+ const visible = activity.concerns.filter((item) => item.state !== "archived");
2728
+ const active = visible.filter((item) => item.state !== "resolved");
2729
+ const resolved = visible.filter((item) => item.state === "resolved");
2730
+ const latest = new Map([...activity.observations].reverse().map((item) => [item.concernId, item]));
2731
+ const [composing, setComposing] = (0, import_react3.useState)(false);
2732
+ const [expandedId, setExpandedId] = (0, import_react3.useState)();
2733
+ const [visibleCount, setVisibleCount] = (0, import_react3.useState)(5);
2734
+ const [mention, setMention] = (0, import_react3.useState)();
2735
+ const [sources, setSources] = (0, import_react3.useState)([]);
2736
+ const [sourcesLoading, setSourcesLoading] = (0, import_react3.useState)(false);
2737
+ const [sourceError, setSourceError] = (0, import_react3.useState)();
2738
+ const [activeSource, setActiveSource] = (0, import_react3.useState)(0);
2739
+ const inputRef = (0, import_react3.useRef)(null);
2740
+ const listboxId = (0, import_react3.useId)();
2741
+ const shown = active.slice(0, visibleCount);
2742
+ const suggestionsOpen = composing && mention !== void 0;
2743
+ (0, import_react3.useEffect)(() => {
2744
+ if (!suggestionsOpen || mention === void 0) {
2745
+ setSources([]);
2746
+ setSourcesLoading(false);
2747
+ setSourceError(void 0);
2748
+ return;
2749
+ }
2750
+ const controller = new AbortController();
2751
+ const timer = window.setTimeout(() => {
2752
+ setSourcesLoading(true);
2753
+ setSourceError(void 0);
2754
+ const params = new URLSearchParams({ q: mention.query });
2755
+ void api(`/companions/${encodeURIComponent(companionId)}/concern-sources?${params}`).then((result) => {
2756
+ if (!controller.signal.aborted) {
2757
+ setSources(result.items);
2758
+ setActiveSource(0);
2759
+ }
2760
+ }).catch((reason) => {
2761
+ if (!controller.signal.aborted) {
2762
+ setSources([]);
2763
+ setSourceError(message(reason));
2764
+ }
2765
+ }).finally(() => {
2766
+ if (!controller.signal.aborted) setSourcesLoading(false);
2767
+ });
2768
+ }, 150);
2769
+ return () => {
2770
+ window.clearTimeout(timer);
2771
+ controller.abort();
2772
+ };
2773
+ }, [companionId, mention?.query, suggestionsOpen]);
2774
+ const submit = (event) => {
2775
+ event.preventDefault();
2776
+ onAdd();
2777
+ setComposing(false);
2778
+ setMention(void 0);
2779
+ };
2780
+ const chooseSource = (source) => {
2781
+ if (mention === void 0) return;
2782
+ const next = `${value.slice(0, mention.start)}${source.token} ${value.slice(mention.end)}`;
2783
+ const cursor = mention.start + source.token.length + 1;
2784
+ onValue(next);
2785
+ setMention(void 0);
2786
+ setSources([]);
2787
+ window.requestAnimationFrame(() => {
2788
+ inputRef.current?.focus();
2789
+ inputRef.current?.setSelectionRange(cursor, cursor);
2790
+ });
2791
+ };
2792
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dsh-partner-concern-board", "aria-labelledby": "partner-concerns-title", children: [
2793
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [
2794
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2795
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("strong", { id: "partner-concerns-title", children: [
2796
+ "\u4F19\u4F34\u5728\u610F\u7684\u4E8B ",
2797
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("b", { children: active.length })
2798
+ ] }),
2799
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "\u5C1A\u672A\u95ED\u73AF\u3001\u503C\u5F97\u7EE7\u7EED\u7559\u610F\u7684\u4E8B\u60C5" })
2800
+ ] }),
2801
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", "aria-expanded": composing, onClick: () => setComposing((current) => !current), children: [
2802
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconPlusOutline16, { size: 14 }),
2803
+ "\u4EA4\u4EE3\u4E00\u4EF6\u4E8B"
2804
+ ] })
2805
+ ] }),
2806
+ composing && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { className: "dsh-partner-concern-compose", onSubmit: submit, children: [
2807
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { children: [
2808
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "\u9700\u8981\u7559\u610F\u7684\u4E8B" }),
2809
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-concern-input-wrap", children: [
2810
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2811
+ "input",
2812
+ {
2813
+ ref: inputRef,
2814
+ autoFocus: true,
2815
+ value,
2816
+ maxLength: 300,
2817
+ placeholder: "\u8F93\u5165 @ \u9009\u62E9\u6587\u4EF6\u6216\u77E5\u8BC6\u6587\u6863",
2818
+ role: "combobox",
2819
+ "aria-autocomplete": "list",
2820
+ "aria-expanded": suggestionsOpen,
2821
+ "aria-controls": suggestionsOpen ? listboxId : void 0,
2822
+ "aria-activedescendant": suggestionsOpen && sources[activeSource] ? `${listboxId}-option-${activeSource}` : void 0,
2823
+ onChange: (event) => {
2824
+ onValue(event.target.value);
2825
+ setMention(activeMention(event.target.value, event.target.selectionStart ?? event.target.value.length));
2826
+ },
2827
+ onClick: (event) => setMention(activeMention(event.currentTarget.value, event.currentTarget.selectionStart ?? event.currentTarget.value.length)),
2828
+ onKeyDown: (event) => {
2829
+ if (!suggestionsOpen) return;
2830
+ if (event.key === "ArrowDown") {
2831
+ event.preventDefault();
2832
+ setActiveSource((index) => sources.length === 0 ? 0 : (index + 1) % sources.length);
2833
+ } else if (event.key === "ArrowUp") {
2834
+ event.preventDefault();
2835
+ setActiveSource((index) => sources.length === 0 ? 0 : (index - 1 + sources.length) % sources.length);
2836
+ } else if (event.key === "Enter" && sources[activeSource]) {
2837
+ event.preventDefault();
2838
+ chooseSource(sources[activeSource]);
2839
+ } else if (event.key === "Escape") {
2840
+ event.preventDefault();
2841
+ setMention(void 0);
2842
+ }
2843
+ }
2844
+ }
2845
+ ),
2846
+ suggestionsOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { id: listboxId, className: "dsh-partner-concern-sources", role: "listbox", "aria-label": "\u53EF\u5F15\u7528\u7684\u6587\u4EF6\u4E0E\u77E5\u8BC6\u6587\u6863", children: sourcesLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { role: "status", children: "\u6B63\u5728\u67E5\u627E\u53EF\u5F15\u7528\u5185\u5BB9\u2026" }) : sourceError ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { role: "status", children: [
2847
+ "\u5019\u9009\u52A0\u8F7D\u5931\u8D25\uFF1A",
2848
+ sourceError
2849
+ ] }) : sources.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { role: "status", children: "\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u6587\u4EF6\u6216\u5DF2\u6302\u8F7D\u77E5\u8BC6\u6587\u6863" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: sources.map((source, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
2850
+ "button",
2851
+ {
2852
+ type: "button",
2853
+ role: "option",
2854
+ id: `${listboxId}-option-${index}`,
2855
+ "aria-selected": index === activeSource,
2856
+ "data-kind": source.kind,
2857
+ onMouseDown: (event) => event.preventDefault(),
2858
+ onMouseEnter: () => setActiveSource(index),
2859
+ onClick: () => chooseSource(source),
2860
+ children: [
2861
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: source.kind === "file" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconDataOutline16, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconLinkOutline16, { size: 15 }) }),
2862
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: source.label }),
2863
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: source.detail })
2864
+ ]
2865
+ },
2866
+ `${source.kind}:${source.token}`
2867
+ )) }) })
2868
+ ] }),
2869
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("small", { className: "dsh-partner-concern-compose-hint", children: [
2870
+ "\u8F93\u5165 ",
2871
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("b", { children: "@" }),
2872
+ " \u4F1A\u5217\u51FA\u5F53\u524D\u4F1A\u8BDD\u6587\u4EF6\u548C\u5DF2\u6302\u8F7D\u7684\u77E5\u8BC6\u6587\u6863\uFF0C\u4E5F\u53EF\u4EE5\u7EE7\u7EED\u8F93\u5165\u5173\u952E\u8BCD\u7B5B\u9009\u3002"
2873
+ ] })
2874
+ ] }),
2875
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
2876
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: () => {
2877
+ setComposing(false);
2878
+ setMention(void 0);
2879
+ onValue("");
2880
+ }, children: "\u53D6\u6D88" }),
2881
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !value.trim(), children: "\u8BA9\u4F19\u4F34\u8BB0\u7740" })
2882
+ ] })
2883
+ ] }),
2884
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-concern-list", role: "list", children: active.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dsh-partner-concern-empty", children: "\u6700\u8FD1\u6CA1\u6709\u672A\u95ED\u73AF\u7684\u4E8B\u3002\u4F60\u4E5F\u53EF\u4EE5\u76F4\u63A5\u5BF9\u4F19\u4F34\u8BF4\u201C\u8FD9\u4E2A\u5E2E\u6211\u7559\u610F\u201D\u3002" }) : shown.map((item) => {
2885
+ const observation = latest.get(item.id);
2886
+ const expanded = expandedId === item.id;
2887
+ const status = observation ? concernObservationStatus(observation) : item.state === "active" ? "\u6B63\u5728\u7559\u610F" : "\u6682\u65F6\u8BB0\u7740";
2888
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", { role: "listitem", "data-state": item.state, "data-expanded": expanded, children: [
2889
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: "dsh-partner-concern-row", "aria-expanded": expanded, onClick: () => setExpandedId((current) => current === item.id ? void 0 : item.id), children: [
2890
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "dsh-partner-concern-state", children: [
2891
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", {}),
2892
+ status
2893
+ ] }),
2894
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "dsh-partner-concern-copy", children: [
2895
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: item.subject }),
2896
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: observation ? observation.event : item.reason })
2897
+ ] }),
2898
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "dsh-partner-concern-time", title: `\u8BA1\u5212\u4E8E ${new Date(item.nextCheckAt).toLocaleString()} \u518D\u6B21\u7559\u610F`, children: [
2899
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "\u4E0B\u6B21\u7559\u610F" }),
2900
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: futureTime(item.nextCheckAt) })
2901
+ ] }),
2902
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconChevronDownOutline14, { size: 14 })
2903
+ ] }),
2904
+ expanded && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-concern-detail", children: [
2905
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: item.reason }),
2906
+ observation && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
2907
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("blockquote", { children: observation.event }),
2908
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-concern-decision", "data-decision": observation.decision, children: [
2909
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: concernObservationStatus(observation) }),
2910
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: observation.decisionReason || concernObservationExplanation(observation) }),
2911
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("small", { children: [
2912
+ "\u6253\u6270\u5206\u6570 ",
2913
+ Math.round(observation.interruptScore * 100),
2914
+ observation.notificationRuleEffect !== "auto" && observation.notificationRuleReason ? ` \xB7 \u77E5\u8BC6\u89C4\u5219\uFF1A${observation.notificationRuleReason}` : ""
2915
+ ] })
2916
+ ] })
2917
+ ] }),
2918
+ item.resources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-concern-resources", children: item.resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2919
+ resource.kind === "file" ? "\u6587\u4EF6" : "\u77E5\u8BC6",
2920
+ " \xB7 ",
2921
+ resource.label
2922
+ ] }, `${resource.kind}:${resource.locator}`)) }),
2923
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("small", { children: [
2924
+ item.origin === "explicit" ? "\u4F60\u660E\u786E\u4EA4\u4EE3" : "\u4F19\u4F34\u4ECE\u5BF9\u8BDD\u4E2D\u6CE8\u610F\u5230",
2925
+ " \xB7 ",
2926
+ watchKindLabel(item.watchKind)
2927
+ ] }),
2928
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-concern-actions", "aria-label": `${item.subject} \u7684\u64CD\u4F5C`, children: [
2929
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", disabled: busy, onClick: () => onCheck(item), children: "\u7ACB\u5373\u68C0\u67E5\u8FD9\u6761" }),
2930
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u7EE7\u7EED\u7559\u610F" }),
2931
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "prioritize"), children: "\u63D0\u9AD8\u5173\u6CE8" }),
2932
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "resolve"), children: "\u5DF2\u7ECF\u89E3\u51B3" }),
2933
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: () => onAct(item, "ignore"), children: "\u522B\u7BA1\u8FD9\u4E2A" })
2934
+ ] })
2935
+ ] })
2936
+ ] }, item.id);
2937
+ }) }),
2938
+ (active.length > shown.length || visibleCount > 5) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-concern-more", children: active.length > shown.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", onClick: () => setVisibleCount((count) => Math.min(active.length, count + 20)), children: [
2939
+ "\u518D\u663E\u793A ",
2940
+ Math.min(20, active.length - shown.length),
2941
+ " \u6761"
2942
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: () => setVisibleCount(5), children: "\u6536\u8D77\u5217\u8868" }) }),
2943
+ resolved.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", { className: "dsh-partner-concern-resolved", children: [
2944
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("summary", { children: [
2945
+ "\u5DF2\u7ECF\u89E3\u51B3 ",
2946
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("b", { children: resolved.length })
2947
+ ] }),
2948
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: resolved.slice(0, 30).map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", { children: [
2949
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconCheckOutline14, { size: 13 }) }),
2950
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: item.subject }),
2951
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u91CD\u65B0\u7559\u610F" })
2952
+ ] }, item.id)) })
2526
2953
  ] })
2527
2954
  ] });
2528
2955
  }
2956
+ function activeMention(value, cursor) {
2957
+ const prefix = value.slice(0, cursor);
2958
+ const start = prefix.lastIndexOf("@");
2959
+ if (start < 0 || start > 0 && !/\s/u.test(prefix[start - 1] ?? "")) return void 0;
2960
+ const fragment = prefix.slice(start + 1);
2961
+ if (fragment.startsWith("\u77E5\u8BC6\u5E93[")) {
2962
+ if (fragment.includes("]")) return void 0;
2963
+ return { start, end: cursor, query: fragment.slice(4) };
2964
+ }
2965
+ if (fragment.startsWith('"')) {
2966
+ if (fragment.slice(1).includes('"')) return void 0;
2967
+ return { start, end: cursor, query: fragment.slice(1) };
2968
+ }
2969
+ if (/\s/u.test(fragment)) return void 0;
2970
+ return { start, end: cursor, query: fragment };
2971
+ }
2972
+ function watchKindLabel(value) {
2973
+ return value === "knowledge" ? "\u77E5\u8BC6\u5E93\u53D8\u5316" : value === "workspace" ? "\u9879\u76EE\u53D8\u5316" : value === "web" ? "\u5916\u90E8\u53D8\u5316" : "\u6309\u4E8B\u60C5\u5224\u65AD\u6765\u6E90";
2974
+ }
2529
2975
  var MEMORY_KINDS = ["all", "profile", "preference", "task", "event", "relationship", "emotion"];
2530
2976
  function MemoryLibrary({ memories, reflections, graph, editing, busy, setEditing, save, remove }) {
2531
- const activeMemories = (0, import_react4.useMemo)(() => memories.filter((item) => item.status === "active"), [memories]);
2532
- const [mode, setMode] = (0, import_react4.useState)("memory");
2533
- const [kind, setKind] = (0, import_react4.useState)("all");
2534
- const [query, setQuery] = (0, import_react4.useState)("");
2535
- const [selectedMemoryId, setSelectedMemoryId] = (0, import_react4.useState)();
2536
- const [selectedDate, setSelectedDate] = (0, import_react4.useState)();
2977
+ const activeMemories = (0, import_react3.useMemo)(() => memories.filter((item) => item.status === "active"), [memories]);
2978
+ const [mode, setMode] = (0, import_react3.useState)("memory");
2979
+ const [kind, setKind] = (0, import_react3.useState)("all");
2980
+ const [query, setQuery] = (0, import_react3.useState)("");
2981
+ const [selectedMemoryId, setSelectedMemoryId] = (0, import_react3.useState)();
2982
+ const [selectedDate, setSelectedDate] = (0, import_react3.useState)();
2537
2983
  const normalized = query.trim().toLocaleLowerCase();
2538
- const filteredMemories = (0, import_react4.useMemo)(() => activeMemories.filter(
2984
+ const filteredMemories = (0, import_react3.useMemo)(() => activeMemories.filter(
2539
2985
  (item) => (kind === "all" || item.kind === kind) && (!normalized || `${item.subject} ${item.content}`.toLocaleLowerCase().includes(normalized))
2540
2986
  ), [activeMemories, kind, normalized]);
2541
- const filteredReflections = (0, import_react4.useMemo)(() => reflections.filter(
2987
+ const filteredReflections = (0, import_react3.useMemo)(() => reflections.filter(
2542
2988
  (item) => !normalized || `${item.date} ${item.summary} ${item.events.join(" ")} ${item.openTasks.join(" ")} ${item.learnings.join(" ")}`.toLocaleLowerCase().includes(normalized)
2543
2989
  ), [reflections, normalized]);
2544
2990
  const selectedMemory = filteredMemories.find((item) => item.id === selectedMemoryId) ?? filteredMemories[0];
2545
2991
  const selectedReflection = filteredReflections.find((item) => item.date === selectedDate) ?? filteredReflections[0];
2546
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: "dsh-partner-memory-library", children: [
2547
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { className: "dsh-partner-library-header", children: [
2548
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
2549
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: "MEMORY LIBRARY" }),
2550
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: "\u4F19\u4F34\u8BB0\u5FC6\u5E93" }),
2551
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: "\u6309\u7C7B\u578B\u68C0\u7D22\u957F\u671F\u7406\u89E3\uFF0C\u6216\u6309\u65E5\u671F\u56DE\u770B\u6BCF\u5929\u7684\u8BA4\u8BC6\u53D8\u5316\u3002" })
2992
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dsh-partner-memory-library", children: [
2993
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className: "dsh-partner-library-header", children: [
2994
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
2995
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: "MEMORY LIBRARY" }),
2996
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: "\u4F19\u4F34\u8BB0\u5FC6\u5E93" }),
2997
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "\u6309\u7C7B\u578B\u68C0\u7D22\u957F\u671F\u7406\u89E3\uFF0C\u6216\u6309\u65E5\u671F\u56DE\u770B\u6BCF\u5929\u7684\u8BA4\u8BC6\u53D8\u5316\u3002" })
2552
2998
  ] }),
2553
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("nav", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", children: [
2554
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { type: "button", className: mode === "memory" ? "is-active" : "", onClick: () => setMode("memory"), children: [
2999
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("nav", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", children: [
3000
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: mode === "memory" ? "is-active" : "", onClick: () => setMode("memory"), children: [
2555
3001
  "\u957F\u671F\u8BB0\u5FC6 ",
2556
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("b", { children: activeMemories.length })
3002
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("b", { children: activeMemories.length })
2557
3003
  ] }),
2558
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { type: "button", className: mode === "reflection" ? "is-active" : "", onClick: () => setMode("reflection"), children: [
3004
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: mode === "reflection" ? "is-active" : "", onClick: () => setMode("reflection"), children: [
2559
3005
  "\u6BCF\u65E5\u56DE\u987E ",
2560
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("b", { children: reflections.length })
3006
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("b", { children: reflections.length })
2561
3007
  ] }),
2562
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { type: "button", className: mode === "graph" ? "is-active" : "", onClick: () => setMode("graph"), children: [
3008
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: mode === "graph" ? "is-active" : "", onClick: () => setMode("graph"), children: [
2563
3009
  "\u5173\u7CFB\u56FE\u8C31 ",
2564
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("b", { children: graph.relations.length })
3010
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("b", { children: graph.relations.length })
2565
3011
  ] })
2566
3012
  ] })
2567
3013
  ] }),
2568
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-library-tools", children: [
2569
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { children: [
2570
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u8BB0\u5FC6" }),
2571
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: mode === "memory" ? "\u641C\u7D22\u4E3B\u9898\u6216\u8BB0\u5FC6\u5185\u5BB9" : "\u641C\u7D22\u65E5\u671F\u3001\u603B\u7ED3\u6216\u5F85\u529E" })
3014
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-library-tools", children: [
3015
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { children: [
3016
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u8BB0\u5FC6" }),
3017
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: mode === "memory" ? "\u641C\u7D22\u4E3B\u9898\u6216\u8BB0\u5FC6\u5185\u5BB9" : "\u641C\u7D22\u65E5\u671F\u3001\u603B\u7ED3\u6216\u5F85\u529E" })
2572
3018
  ] }),
2573
- mode === "memory" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-memory-kinds", children: MEMORY_KINDS.map((value) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: kind === value ? "is-active" : "", onClick: () => setKind(value), children: value === "all" ? "\u5168\u90E8" : memoryKind(value) }, value)) })
3019
+ mode === "memory" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-memory-kinds", children: MEMORY_KINDS.map((value) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: kind === value ? "is-active" : "", onClick: () => setKind(value), children: value === "all" ? "\u5168\u90E8" : memoryKind(value) }, value)) })
2574
3020
  ] }),
2575
- mode === "memory" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-library-browser", children: [
2576
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-library-list", role: "list", children: filteredMemories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(State, { title: activeMemories.length === 0 ? "\u8FD8\u6CA1\u6709\u957F\u671F\u8BB0\u5FC6" : "\u6CA1\u6709\u5339\u914D\u7684\u8BB0\u5FC6", detail: activeMemories.length === 0 ? "\u4F19\u4F34\u5B8C\u6210\u5BF9\u8BDD\u540E\u4F1A\u81EA\u52A8\u63D0\u70BC\u503C\u5F97\u957F\u671F\u4FDD\u7559\u7684\u4FE1\u606F\u3002" : "\u6362\u4E2A\u5173\u952E\u8BCD\u6216\u7C7B\u578B\u8BD5\u8BD5\u3002", compact: true }) : filteredMemories.map((item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { type: "button", role: "listitem", className: selectedMemory?.id === item.id ? "is-active" : "", onClick: () => {
3021
+ mode === "memory" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-library-browser", children: [
3022
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-library-list", role: "list", children: filteredMemories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(State, { title: activeMemories.length === 0 ? "\u8FD8\u6CA1\u6709\u957F\u671F\u8BB0\u5FC6" : "\u6CA1\u6709\u5339\u914D\u7684\u8BB0\u5FC6", detail: activeMemories.length === 0 ? "\u4F19\u4F34\u5B8C\u6210\u5BF9\u8BDD\u540E\u4F1A\u81EA\u52A8\u63D0\u70BC\u503C\u5F97\u957F\u671F\u4FDD\u7559\u7684\u4FE1\u606F\u3002" : "\u6362\u4E2A\u5173\u952E\u8BCD\u6216\u7C7B\u578B\u8BD5\u8BD5\u3002", compact: true }) : filteredMemories.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", role: "listitem", className: selectedMemory?.id === item.id ? "is-active" : "", onClick: () => {
2577
3023
  setSelectedMemoryId(item.id);
2578
3024
  setEditing(void 0);
2579
3025
  }, children: [
2580
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "data-kind": item.kind, children: memoryKind(item.kind) }),
2581
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: item.subject }),
2582
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: item.content }),
2583
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: relativeTime(item.updatedAt) })
3026
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "data-kind": item.kind, children: memoryKind(item.kind) }),
3027
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: item.subject }),
3028
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: item.content }),
3029
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: relativeTime(item.updatedAt) })
2584
3030
  ] }, item.id)) }),
2585
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-library-detail", children: selectedMemory ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MemoryCard, { item: selectedMemory, editing: editing?.id === selectedMemory.id ? editing : void 0, busy, setEditing, save, remove: () => remove(selectedMemory) }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(State, { title: "\u9009\u62E9\u4E00\u6761\u8BB0\u5FC6", detail: "\u8BB0\u5FC6\u8BE6\u60C5\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
2586
- ] }) : mode === "reflection" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-library-browser", children: [
2587
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-library-list is-diary", role: "list", children: filteredReflections.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(State, { title: reflections.length === 0 ? "\u8FD8\u6CA1\u6709\u6BCF\u65E5\u56DE\u987E" : "\u6CA1\u6709\u5339\u914D\u7684\u56DE\u987E", detail: reflections.length === 0 ? "\u6BCF\u65E5\u56DE\u987E\u4F1A\u5728\u6BCF\u8F6E\u5B8C\u6574\u5BF9\u8BDD\u540E\u6301\u7EED\u66F4\u65B0\u3002" : "\u6362\u4E2A\u5173\u952E\u8BCD\u6216\u65E5\u671F\u8BD5\u8BD5\u3002", compact: true }) : filteredReflections.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { type: "button", role: "listitem", className: selectedReflection?.date === entry.date ? "is-active" : "", onClick: () => setSelectedDate(entry.date), children: [
2588
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("time", { children: entry.date }),
2589
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("strong", { children: [
3031
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-library-detail", children: selectedMemory ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MemoryCard, { item: selectedMemory, editing: editing?.id === selectedMemory.id ? editing : void 0, busy, setEditing, save, remove: () => remove(selectedMemory) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(State, { title: "\u9009\u62E9\u4E00\u6761\u8BB0\u5FC6", detail: "\u8BB0\u5FC6\u8BE6\u60C5\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
3032
+ ] }) : mode === "reflection" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-library-browser", children: [
3033
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-library-list is-diary", role: "list", children: filteredReflections.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(State, { title: reflections.length === 0 ? "\u8FD8\u6CA1\u6709\u6BCF\u65E5\u56DE\u987E" : "\u6CA1\u6709\u5339\u914D\u7684\u56DE\u987E", detail: reflections.length === 0 ? "\u6BCF\u65E5\u56DE\u987E\u4F1A\u5728\u6BCF\u8F6E\u5B8C\u6574\u5BF9\u8BDD\u540E\u6301\u7EED\u66F4\u65B0\u3002" : "\u6362\u4E2A\u5173\u952E\u8BCD\u6216\u65E5\u671F\u8BD5\u8BD5\u3002", compact: true }) : filteredReflections.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", role: "listitem", className: selectedReflection?.date === entry.date ? "is-active" : "", onClick: () => setSelectedDate(entry.date), children: [
3034
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", { children: entry.date }),
3035
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("strong", { children: [
2590
3036
  entry.turnCount,
2591
3037
  " \u8F6E\u4EA4\u6D41"
2592
3038
  ] }),
2593
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: entry.summary }),
2594
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("small", { children: [
3039
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: entry.summary }),
3040
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("small", { children: [
2595
3041
  entry.openTasks.length,
2596
3042
  " \u9879\u5F85\u8DDF\u8FDB \xB7 ",
2597
3043
  entry.learnings.length,
2598
3044
  " \u9879\u7406\u89E3"
2599
3045
  ] })
2600
3046
  ] }, entry.date)) }),
2601
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-library-detail", children: selectedReflection ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DailyReflectionDetail, { entry: selectedReflection }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(State, { title: "\u9009\u62E9\u4E00\u5929", detail: "\u5F53\u5929\u7684\u603B\u7ED3\u4E0E\u5F85\u529E\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
2602
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(MemoryGraph, { graph, query: normalized })
3047
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-library-detail", children: selectedReflection ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DailyReflectionDetail, { entry: selectedReflection }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(State, { title: "\u9009\u62E9\u4E00\u5929", detail: "\u5F53\u5929\u7684\u603B\u7ED3\u4E0E\u5F85\u529E\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
3048
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MemoryGraph, { graph, query: normalized })
2603
3049
  ] });
2604
3050
  }
2605
3051
  function MemoryGraph({ graph, query }) {
2606
3052
  const visible = graph.memories.filter((item) => !query || `${item.subject} ${item.content}`.toLocaleLowerCase().includes(query));
2607
- const [selectedId, setSelectedId] = (0, import_react4.useState)();
3053
+ const [selectedId, setSelectedId] = (0, import_react3.useState)();
2608
3054
  const selected = visible.find((item) => item.id === selectedId) ?? visible[0];
2609
3055
  const related = selected ? graph.relations.filter((item) => item.sourceMemoryId === selected.id || item.targetMemoryId === selected.id) : [];
2610
3056
  const byId = new Map(graph.memories.map((item) => [item.id, item]));
2611
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-graph-browser", children: [
2612
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-graph-index", children: visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(State, { title: "\u8FD8\u6CA1\u6709\u5173\u7CFB\u56FE\u8C31", detail: "\u5B8C\u6210\u6BCF\u65E5\u7EC8\u5BA1\u540E\uFF0C\u4F1A\u628A\u6709\u53EF\u9760\u8BC1\u636E\u7684\u8BB0\u5FC6\u5173\u7CFB\u6574\u7406\u5230\u8FD9\u91CC\u3002", compact: true }) : visible.map((item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { type: "button", className: selected?.id === item.id ? "is-active" : "", onClick: () => setSelectedId(item.id), children: [
2613
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "data-kind": item.kind, children: memoryKind(item.kind) }),
2614
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: item.subject }),
2615
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("small", { children: [
3057
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-graph-browser", children: [
3058
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-graph-index", children: visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(State, { title: "\u8FD8\u6CA1\u6709\u5173\u7CFB\u56FE\u8C31", detail: "\u5B8C\u6210\u6BCF\u65E5\u7EC8\u5BA1\u540E\uFF0C\u4F1A\u628A\u6709\u53EF\u9760\u8BC1\u636E\u7684\u8BB0\u5FC6\u5173\u7CFB\u6574\u7406\u5230\u8FD9\u91CC\u3002", compact: true }) : visible.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: selected?.id === item.id ? "is-active" : "", onClick: () => setSelectedId(item.id), children: [
3059
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "data-kind": item.kind, children: memoryKind(item.kind) }),
3060
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: item.subject }),
3061
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("small", { children: [
2616
3062
  graph.relations.filter((edge) => edge.sourceMemoryId === item.id || edge.targetMemoryId === item.id).length,
2617
3063
  " \u6761\u5173\u7CFB"
2618
3064
  ] })
2619
3065
  ] }, item.id)) }),
2620
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-graph-stage", children: selected ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
2621
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { children: [
2622
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "data-kind": selected.kind, children: memoryKind(selected.kind) }),
2623
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: selected.subject }),
2624
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: selected.content })
3066
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-graph-stage", children: selected ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
3067
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [
3068
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "data-kind": selected.kind, children: memoryKind(selected.kind) }),
3069
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: selected.subject }),
3070
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: selected.content })
2625
3071
  ] }),
2626
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "dsh-partner-graph-links", children: related.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(State, { title: "\u6682\u65E0\u53EF\u9760\u5173\u7CFB", detail: "\u7EC8\u5BA1\u4E0D\u4F1A\u4E3A\u4E86\u586B\u6EE1\u56FE\u8C31\u800C\u731C\u6D4B\u5173\u7CFB\u3002", compact: true }) : related.map((edge) => {
3072
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-partner-graph-links", children: related.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(State, { title: "\u6682\u65E0\u53EF\u9760\u5173\u7CFB", detail: "\u7EC8\u5BA1\u4E0D\u4F1A\u4E3A\u4E86\u586B\u6EE1\u56FE\u8C31\u800C\u731C\u6D4B\u5173\u7CFB\u3002", compact: true }) : related.map((edge) => {
2627
3073
  const outgoing = edge.sourceMemoryId === selected.id;
2628
3074
  const target = byId.get(outgoing ? edge.targetMemoryId : edge.sourceMemoryId);
2629
- return target ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { type: "button", onClick: () => setSelectedId(target.id), children: [
2630
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", {}),
2631
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
2632
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: outgoing ? relationLabel(edge.kind) : `\u88AB${relationLabel(edge.kind)}` }),
2633
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: target.subject }),
2634
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: edge.label })
3075
+ return target ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", onClick: () => setSelectedId(target.id), children: [
3076
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", {}),
3077
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
3078
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: outgoing ? relationLabel(edge.kind) : `\u88AB${relationLabel(edge.kind)}` }),
3079
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: target.subject }),
3080
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: edge.label })
2635
3081
  ] }),
2636
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("b", { children: [
3082
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("b", { children: [
2637
3083
  Math.round(edge.confidence * 100),
2638
3084
  "%"
2639
3085
  ] })
@@ -2646,53 +3092,53 @@ function relationLabel(kind) {
2646
3092
  return { supports: "\u652F\u6301", depends_on: "\u4F9D\u8D56", about: "\u5173\u4E8E", conflicts_with: "\u51B2\u7A81", follows: "\u540E\u7EED" }[kind];
2647
3093
  }
2648
3094
  function DailyReflectionDetail({ entry }) {
2649
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("article", { className: "dsh-partner-diary-detail", children: [
2650
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { children: [
2651
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("time", { children: entry.date }),
2652
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("strong", { children: [
3095
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", { className: "dsh-partner-diary-detail", children: [
3096
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [
3097
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", { children: entry.date }),
3098
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("strong", { children: [
2653
3099
  entry.turnCount,
2654
3100
  " \u8F6E\u4EA4\u6D41\u540E\u7684\u7406\u89E3"
2655
3101
  ] }),
2656
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("small", { children: [
3102
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("small", { children: [
2657
3103
  "\u66F4\u65B0\u4E8E ",
2658
3104
  new Date(entry.updatedAt).toLocaleString()
2659
3105
  ] })
2660
3106
  ] }),
2661
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: entry.summary }),
2662
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ReflectionGroup, { title: "\u5F85\u8DDF\u8FDB", items: entry.openTasks }),
2663
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ReflectionGroup, { title: "\u5F53\u5929\u4E8B\u4EF6", items: entry.events }),
2664
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ReflectionGroup, { title: "\u65B0\u7406\u89E3", items: entry.learnings }),
2665
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ReflectionGroup, { title: "\u5DF2\u5B8C\u6210", items: entry.completedTasks })
3107
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: entry.summary }),
3108
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ReflectionGroup, { title: "\u5F85\u8DDF\u8FDB", items: entry.openTasks }),
3109
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ReflectionGroup, { title: "\u5F53\u5929\u4E8B\u4EF6", items: entry.events }),
3110
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ReflectionGroup, { title: "\u65B0\u7406\u89E3", items: entry.learnings }),
3111
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ReflectionGroup, { title: "\u5DF2\u5B8C\u6210", items: entry.completedTasks })
2666
3112
  ] });
2667
3113
  }
2668
3114
  function ReflectionGroup({ title, items }) {
2669
3115
  if (items.length === 0) return null;
2670
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { children: [
2671
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: title }),
2672
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", { children: item }, item)) })
3116
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { children: [
3117
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: title }),
3118
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: item }, item)) })
2673
3119
  ] });
2674
3120
  }
2675
3121
  function MemoryCard({ item, editing, busy, setEditing, save, remove }) {
2676
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("article", { "data-kind": item.kind, children: editing ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-memory-editor", children: [
2677
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("input", { "aria-label": "\u8BB0\u5FC6\u4E3B\u9898", value: editing.subject, onChange: (event) => setEditing({ ...editing, subject: event.target.value }) }),
2678
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("textarea", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", value: editing.content, onChange: (event) => setEditing({ ...editing, content: event.target.value }) }),
2679
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("footer", { children: [
2680
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", onClick: () => setEditing(void 0), children: "\u53D6\u6D88" }),
2681
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "is-primary", disabled: busy || !editing.subject.trim() || !editing.content.trim(), onClick: save, children: "\u4FDD\u5B58\u4FEE\u6B63" })
3122
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("article", { "data-kind": item.kind, children: editing ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-partner-memory-editor", children: [
3123
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { "aria-label": "\u8BB0\u5FC6\u4E3B\u9898", value: editing.subject, onChange: (event) => setEditing({ ...editing, subject: event.target.value }) }),
3124
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("textarea", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", value: editing.content, onChange: (event) => setEditing({ ...editing, content: event.target.value }) }),
3125
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("footer", { children: [
3126
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: () => setEditing(void 0), children: "\u53D6\u6D88" }),
3127
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "is-primary", disabled: busy || !editing.subject.trim() || !editing.content.trim(), onClick: save, children: "\u4FDD\u5B58\u4FEE\u6B63" })
2682
3128
  ] })
2683
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
2684
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { children: [
2685
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: memoryKind(item.kind) }),
2686
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
2687
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", onClick: () => setEditing({ ...item }), children: "\u7F16\u8F91" }),
2688
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", onClick: remove, children: "\u5220\u9664" })
3129
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
3130
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [
3131
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: memoryKind(item.kind) }),
3132
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
3133
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: () => setEditing({ ...item }), children: "\u7F16\u8F91" }),
3134
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: remove, children: "\u5220\u9664" })
2689
3135
  ] })
2690
3136
  ] }),
2691
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: item.subject }),
2692
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: item.content }),
2693
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("footer", { children: [
2694
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("progress", { max: 1, value: item.confidence, "aria-label": `\u7F6E\u4FE1\u5EA6 ${Math.round(item.confidence * 100)}%` }),
2695
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("small", { children: [
3137
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: item.subject }),
3138
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: item.content }),
3139
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("footer", { children: [
3140
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("progress", { max: 1, value: item.confidence, "aria-label": `\u7F6E\u4FE1\u5EA6 ${Math.round(item.confidence * 100)}%` }),
3141
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("small", { children: [
2696
3142
  item.locked ? "\u624B\u52A8\u786E\u8BA4" : `${Math.round(item.confidence * 100)}% \u53EF\u4FE1`,
2697
3143
  " \xB7 ",
2698
3144
  relativeTime(item.updatedAt)
@@ -2702,8 +3148,8 @@ function MemoryCard({ item, editing, busy, setEditing, save, remove }) {
2702
3148
  }
2703
3149
  function Status({ channel }) {
2704
3150
  const status = !channel ? "unbound" : channel.runtimeStatus;
2705
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: `dsh-partner-status is-${status}`, children: [
2706
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", {}),
3151
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: `dsh-partner-status is-${status}`, children: [
3152
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", {}),
2707
3153
  !channel ? "\u672A\u8FDE\u63A5" : statusLabel(channel.runtimeStatus)
2708
3154
  ] });
2709
3155
  }
@@ -2711,41 +3157,41 @@ function statusLabel(status) {
2711
3157
  return status === "running" ? "\u5FAE\u4FE1\u5728\u7EBF" : status === "starting" ? "\u8FDE\u63A5\u4E2D" : status === "error" ? "\u8FDE\u63A5\u5F02\u5E38" : "\u5DF2\u505C\u7528";
2712
3158
  }
2713
3159
  function Avatar({ name, small = false }) {
2714
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `dsh-partner-avatar${small ? " is-small" : ""}`, "aria-hidden": "true", children: [...name][0] ?? "\u4F34" });
3160
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `dsh-partner-avatar${small ? " is-small" : ""}`, "aria-hidden": "true", children: [...name][0] ?? "\u4F34" });
2715
3161
  }
2716
3162
  function WeixinGlyph({ large = false }) {
2717
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: `dsh-partner-weixin-glyph${large ? " is-large" : ""}`, "aria-hidden": "true", children: [
2718
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("i", {}),
2719
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("b", {})
3163
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: `dsh-partner-weixin-glyph${large ? " is-large" : ""}`, "aria-hidden": "true", children: [
3164
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", {}),
3165
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("b", {})
2720
3166
  ] });
2721
3167
  }
2722
3168
  function TabButton({ active, onClick, icon, children }) {
2723
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { type: "button", className: active ? "is-active" : "", onClick, children: [
3169
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: active ? "is-active" : "", onClick, children: [
2724
3170
  icon,
2725
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children })
3171
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children })
2726
3172
  ] });
2727
3173
  }
2728
3174
  function Field({ label, hint, children }) {
2729
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "dsh-partner-field", children: [
2730
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
2731
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: label }),
2732
- hint && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: hint })
3175
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: "dsh-partner-field", children: [
3176
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
3177
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: label }),
3178
+ hint && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: hint })
2733
3179
  ] }),
2734
3180
  children
2735
3181
  ] });
2736
3182
  }
2737
3183
  function Section({ eyebrow, title, detail }) {
2738
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { className: "dsh-partner-section", children: [
2739
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: eyebrow }),
2740
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { children: title }),
2741
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: detail })
3184
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className: "dsh-partner-section", children: [
3185
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: eyebrow }),
3186
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: title }),
3187
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: detail })
2742
3188
  ] });
2743
3189
  }
2744
3190
  function State({ title, detail, action, compact = false }) {
2745
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: `dsh-partner-state${compact ? " is-compact" : ""}`, children: [
2746
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 20 }),
2747
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: title }),
2748
- detail && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: detail }),
3191
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `dsh-partner-state${compact ? " is-compact" : ""}`, children: [
3192
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 20 }),
3193
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: title }),
3194
+ detail && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: detail }),
2749
3195
  action
2750
3196
  ] });
2751
3197
  }
@@ -2756,6 +3202,18 @@ function relativeTime(value) {
2756
3202
  const minutes = Math.floor((Date.now() - value) / 6e4);
2757
3203
  return minutes < 1 ? "\u521A\u521A" : minutes < 60 ? `${minutes} \u5206\u949F\u524D` : minutes < 1440 ? `${Math.floor(minutes / 60)} \u5C0F\u65F6\u524D` : `${Math.floor(minutes / 1440)} \u5929\u524D`;
2758
3204
  }
3205
+ function concernObservationStatus(item) {
3206
+ if (item.decision === "notify") return item.mentionedAt === void 0 ? "\u5F85\u63D0\u9192" : "\u5DF2\u63D0\u9192";
3207
+ if (item.decision === "feed") return "\u4F19\u4F34\u52A8\u6001";
3208
+ if (item.decision === "defer") return item.mentionedAt === void 0 ? "\u5F85\u987A\u5E26\u63D0" : "\u5DF2\u987A\u5E26\u63D0";
3209
+ return "\u9759\u9ED8\u8BB0\u4E0B";
3210
+ }
3211
+ function concernObservationExplanation(item) {
3212
+ if (item.decision === "notify") return item.mentionedAt === void 0 ? "\u8FBE\u5230\u4E3B\u52A8\u63D0\u9192\u6761\u4EF6\uFF0C\u7B49\u5F85\u6E20\u9053\u6295\u9012" : "\u5DF2\u7ECF\u901A\u8FC7\u6279\u51C6\u7684\u6E20\u9053\u4E3B\u52A8\u63D0\u9192";
3213
+ if (item.decision === "feed") return "\u53EA\u663E\u793A\u5728\u4F19\u4F34\u52A8\u6001\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u8F6C\u6210\u4E3B\u52A8\u63D0\u9192";
3214
+ if (item.decision === "defer") return item.mentionedAt === void 0 ? "\u4E0B\u6B21\u51FA\u73B0\u76F8\u5173\u5BF9\u8BDD\u65F6\u987A\u5E26\u63D0\u53CA" : "\u5DF2\u7ECF\u5728\u76F8\u5173\u5BF9\u8BDD\u4E2D\u987A\u5E26\u63D0\u53CA";
3215
+ return "\u4EC5\u4FDD\u7559\u4E3A\u89C2\u5BDF\u8BB0\u5F55\uFF0C\u4E0D\u6253\u6270\u4F60";
3216
+ }
2759
3217
  function memoryKind(value) {
2760
3218
  return { profile: "\u753B\u50CF", preference: "\u504F\u597D", task: "\u4EFB\u52A1", event: "\u4E8B\u4EF6", relationship: "\u5173\u7CFB", emotion: "\u60C5\u7EEA\u4FE1\u53F7" }[value];
2761
3219
  }