@lemoncat7/dsh-partner 1.8.0 → 1.8.3

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 (65) hide show
  1. package/README.md +17 -2
  2. package/docs/architecture.md +18 -4
  3. package/lib/agent-runtime.d.ts +7 -2
  4. package/lib/agent-runtime.d.ts.map +1 -1
  5. package/lib/agent-runtime.js +93 -87
  6. package/lib/agent-runtime.js.map +1 -1
  7. package/lib/api/features/workspace-api.d.ts.map +1 -1
  8. package/lib/api/features/workspace-api.js +1 -10
  9. package/lib/api/features/workspace-api.js.map +1 -1
  10. package/lib/api.js +8 -11
  11. package/lib/api.js.map +1 -1
  12. package/lib/client.d.ts.map +1 -1
  13. package/lib/client.js +780 -733
  14. package/lib/client.js.map +4 -4
  15. package/lib/collaboration/composition.d.ts.map +1 -1
  16. package/lib/collaboration/composition.js +13 -5
  17. package/lib/collaboration/composition.js.map +1 -1
  18. package/lib/companions/management-tool.d.ts +1 -1
  19. package/lib/companions/management-tool.d.ts.map +1 -1
  20. package/lib/companions/management-tool.js +1 -1
  21. package/lib/companions/management-tool.js.map +1 -1
  22. package/lib/companions/management.d.ts +4 -2
  23. package/lib/companions/management.d.ts.map +1 -1
  24. package/lib/companions/management.js +2 -2
  25. package/lib/companions/management.js.map +1 -1
  26. package/lib/companions/session-configuration.d.ts +19 -0
  27. package/lib/companions/session-configuration.d.ts.map +1 -0
  28. package/lib/companions/session-configuration.js +38 -0
  29. package/lib/companions/session-configuration.js.map +1 -0
  30. package/lib/index.d.ts.map +1 -1
  31. package/lib/index.js +1 -3
  32. package/lib/index.js.map +1 -1
  33. package/lib/pendant/coordinates.d.ts +9 -0
  34. package/lib/pendant/coordinates.d.ts.map +1 -0
  35. package/lib/pendant/coordinates.js +20 -0
  36. package/lib/pendant/coordinates.js.map +1 -0
  37. package/lib/pendant/notice-motion.d.ts.map +1 -1
  38. package/lib/pendant/notice-motion.js +12 -6
  39. package/lib/pendant/notice-motion.js.map +1 -1
  40. package/lib/pendant/renderer.d.ts.map +1 -1
  41. package/lib/pendant/renderer.js +8 -3
  42. package/lib/pendant/renderer.js.map +1 -1
  43. package/lib/pendant/sheen.d.ts +1 -1
  44. package/lib/pendant/sheen.d.ts.map +1 -1
  45. package/lib/pendant/sheen.js +9 -8
  46. package/lib/pendant/sheen.js.map +1 -1
  47. package/lib/pendant/use-placement.d.ts.map +1 -1
  48. package/lib/pendant/use-placement.js +3 -4
  49. package/lib/pendant/use-placement.js.map +1 -1
  50. package/lib/pendant/widget.js +1 -1
  51. package/lib/pendant/widget.js.map +1 -1
  52. package/lib/pendant-renderer.js +168 -168
  53. package/lib/store.d.ts +3 -0
  54. package/lib/store.d.ts.map +1 -1
  55. package/lib/store.js +4 -0
  56. package/lib/store.js.map +1 -1
  57. package/lib/ui/capability-editor.d.ts +7 -0
  58. package/lib/ui/capability-editor.d.ts.map +1 -0
  59. package/lib/ui/capability-editor.js +85 -0
  60. package/lib/ui/capability-editor.js.map +1 -0
  61. package/lib/ui/companion-draft.d.ts +12 -0
  62. package/lib/ui/companion-draft.d.ts.map +1 -0
  63. package/lib/ui/companion-draft.js +2 -0
  64. package/lib/ui/companion-draft.js.map +1 -0
  65. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -35,7 +35,7 @@ __export(client_exports, {
35
35
  inject: () => inject
36
36
  });
37
37
  module.exports = __toCommonJS(client_exports);
38
- var import_react18 = require("react");
38
+ var import_react19 = require("react");
39
39
 
40
40
  // src/workspace-ownership.ts
41
41
  var WORKSPACE_ACTIVATE_EVENT = "@lemoncat7/dsh-plugin-ui/workspace-activate";
@@ -54,7 +54,7 @@ function observePluginWorkspace(pluginId, close) {
54
54
  }
55
55
 
56
56
  // src/client.tsx
57
- var import_dsh_client_ui_primitives11 = require("@deepseek-ai/dsh-client-ui-primitives");
57
+ var import_dsh_client_ui_primitives12 = require("@deepseek-ai/dsh-client-ui-primitives");
58
58
 
59
59
  // node_modules/qrcode.react/lib/esm/index.js
60
60
  var import_react = __toESM(require("react"), 1);
@@ -1886,6 +1886,9 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
1886
1886
  .dsh-partner-field select:focus { border-color: var(--partner-focus-ring); background: var(--partner-raised); box-shadow: 0 0 0 3px color-mix(in srgb, var(--partner-focus-ring) 18%, transparent), inset 0 1px 0 var(--partner-glass-highlight); }
1887
1887
  .dsh-partner-form-actions { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding-top: 5px; }
1888
1888
  .dsh-partner-form-actions > span { display: inline-flex; align-items: center; gap: 5px; color: var(--partner-accent-strong); font-size: var(--partner-font-body); }
1889
+ .dsh-partner-form-actions.is-capability-save { flex-wrap: wrap; gap: 12px; }
1890
+ .dsh-partner-form-actions.is-capability-save > span { min-height: 24px; }
1891
+ .dsh-partner-form-actions.is-capability-save > span svg { flex-shrink: 0; }
1889
1892
  .dsh-partner-form-actions > button,
1890
1893
  .dsh-partner-state > button,
1891
1894
  .dsh-partner-weixin-connect > button { min-height: 34px; padding: 0 15px; border: 1px solid color-mix(in srgb, var(--partner-accent) 60%, transparent); border-radius: 10px; color: var(--partner-on-accent); background: var(--partner-accent-strong); font: 600 var(--partner-font-body)/1 var(--partner-font-family); cursor: pointer; }
@@ -2860,6 +2863,8 @@ var widget_default = `.dsh-partner-pendant { position: fixed; z-index: 12; top:
2860
2863
  .dsh-partner-pendant button.dsh-partner-pendant-anchor { position: absolute; left: 50%; top: 2.42%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0 !important; border-radius: 50%; background: transparent !important; box-shadow: none !important; pointer-events: auto; touch-action: none; cursor: grab; }
2861
2864
  .dsh-partner-pendant-anchor > span { width: 14px; height: 6px; border: 1px solid #71817e; border-radius: 4px; background: #c3ced0; }
2862
2865
  .dsh-partner-pendant-anchor:hover > span { background: #e4ece8; }
2866
+ .dsh-partner-pendant-unread { position: absolute; left: calc(50% + 10px); top: 2.42%; transform: translateY(-50%); display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border: 1px solid rgb(255 255 255 / 70%); border-radius: 9px; background: #435950; color: #fff; font: 600 11px/1 var(--partner-font-family); font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; user-select: none; }
2867
+ body[data-ds-dark-theme] .dsh-partner-pendant-unread { border-color: rgb(200 220 213 / 24%); background: #b0c6bd; color: #202e29; }
2863
2868
  .dsh-partner-pendant-announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
2864
2869
  /* Own the reader's surface even under host-wide important focus rules. */
2865
2870
  .dsh-partner-pendant section#dsh-partner-pendant-inbox.dsh-partner-pendant-inbox {
@@ -3602,8 +3607,7 @@ function usePendantPlacement(root, handle) {
3602
3607
  down(event) {
3603
3608
  if (!event.isPrimary || event.button !== 0 || drag) return;
3604
3609
  event.preventDefault();
3605
- const box = element.getBoundingClientRect();
3606
- drag = { id: event.pointerId, x: event.clientX, y: event.clientY, left: box.left, top: box.top, button: event.currentTarget };
3610
+ drag = { id: event.pointerId, x: event.clientX, y: event.clientY, left: element.offsetLeft, top: element.offsetTop, button: event.currentTarget };
3607
3611
  event.currentTarget.setPointerCapture(event.pointerId);
3608
3612
  },
3609
3613
  move(event) {
@@ -3618,8 +3622,7 @@ function usePendantPlacement(root, handle) {
3618
3622
  const step = event.shiftKey ? 32 : 12, delta = { ArrowLeft: [-step, 0], ArrowRight: [step, 0], ArrowUp: [0, -step], ArrowDown: [0, step] }[event.key];
3619
3623
  if (!delta) return;
3620
3624
  event.preventDefault();
3621
- const box = element.getBoundingClientRect();
3622
- place({ x: box.left + delta[0], y: box.top + delta[1] });
3625
+ place({ x: element.offsetLeft + delta[0], y: element.offsetTop + delta[1] });
3623
3626
  persist();
3624
3627
  }
3625
3628
  };
@@ -3849,6 +3852,7 @@ function ActivePendant({ controller, settings }) {
3849
3852
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { children: failed ? inbox.unread ? `${inbox.unread} \u6761\u6D88\u606F` : "\u6D88\u606F" : "\u52A0\u8F7D\u6302\u9970\u2026" })
3850
3853
  ] }) }),
3851
3854
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", className: "dsh-partner-pendant-anchor", "aria-label": "\u79FB\u52A8\u6302\u9970\u4F4D\u7F6E", title: "\u62D6\u52A8\u6302\u70B9\u79FB\u52A8\u4F4D\u7F6E\uFF0C\u4E5F\u53EF\u7528\u65B9\u5411\u952E\u5FAE\u8C03", ...placement, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "aria-hidden": "true" }) }),
3855
+ inbox.unread > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsh-partner-pendant-unread", "aria-hidden": "true", children: inbox.unread > 99 ? "99+" : inbox.unread }),
3852
3856
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsh-partner-pendant-announcement", role: "status", "aria-live": "polite", "aria-atomic": "true", children: incoming ? `${incoming.companionName}\uFF1A${incoming.title}` : "" }),
3853
3857
  open && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PendantReader, { inbox, selected, error: error || navigationError, anchor: hit, onSelect: inspect, onClose: close, onVisit: (item) => {
3854
3858
  void visit(item);
@@ -5494,9 +5498,9 @@ function companionName(companions, id) {
5494
5498
  return companions.find((item) => item.id === id)?.name ?? "\u5DF2\u5220\u9664\u4F19\u4F34";
5495
5499
  }
5496
5500
 
5497
- // src/ui/companion-access-panel.tsx
5498
- var import_react16 = require("react");
5499
- var import_dsh_client_ui_primitives9 = require("@deepseek-ai/dsh-client-ui-primitives");
5501
+ // src/ui/capability-editor.tsx
5502
+ var import_react17 = require("react");
5503
+ var import_dsh_client_ui_primitives10 = require("@deepseek-ai/dsh-client-ui-primitives");
5500
5504
 
5501
5505
  // src/capabilities.ts
5502
5506
  var COMPANION_CAPABILITIES = ["knowledge", "skills", "ssh", "git", "companions", "schedules", "access", "administration"];
@@ -5515,6 +5519,8 @@ function isCompanionCapability(value) {
5515
5519
  }
5516
5520
 
5517
5521
  // src/ui/companion-access-panel.tsx
5522
+ var import_react16 = require("react");
5523
+ var import_dsh_client_ui_primitives9 = require("@deepseek-ai/dsh-client-ui-primitives");
5518
5524
  var import_jsx_runtime12 = require("react/jsx-runtime");
5519
5525
  function CompanionAccessPanel({ companionId }) {
5520
5526
  const [access, setAccess] = (0, import_react16.useState)({ targetIds: [], companions: [] });
@@ -5585,13 +5591,161 @@ function initials(name) {
5585
5591
  return [...name.trim()].slice(0, 2).join("").toUpperCase() || "AI";
5586
5592
  }
5587
5593
 
5588
- // src/ui/companion-create.tsx
5589
- var import_react17 = require("react");
5590
- var import_dsh_client_ui_primitives10 = require("@deepseek-ai/dsh-client-ui-primitives");
5594
+ // src/ui/companion-draft.ts
5595
+ function companionDraft(companion) {
5596
+ return { name: companion.name, role: companion.role, description: companion.description, instructions: companion.instructions, presetId: companion.presetId ?? "", provider: companion.provider ?? "", model: companion.model ?? "", capabilities: [...companion.capabilities] };
5597
+ }
5598
+
5599
+ // src/ui/capability-editor.tsx
5591
5600
  var import_jsx_runtime13 = require("react/jsx-runtime");
5592
- function CompanionCreateDialog({ close, create }) {
5593
- const [busy, setBusy] = (0, import_react17.useState)(false);
5601
+ function CapabilityEditor({ companion, presets, onChanged }) {
5602
+ const [form, setForm] = (0, import_react17.useState)(() => companionDraft(companion));
5603
+ const [modelCatalog, setModelCatalog] = (0, import_react17.useState)();
5604
+ const [saving, setSaving] = (0, import_react17.useState)(false);
5605
+ const [saved, setSaved] = (0, import_react17.useState)(false);
5594
5606
  const [error, setError] = (0, import_react17.useState)();
5607
+ const savingRef = (0, import_react17.useRef)(false);
5608
+ const mounted = (0, import_react17.useRef)(true);
5609
+ (0, import_react17.useEffect)(() => {
5610
+ mounted.current = true;
5611
+ return () => {
5612
+ mounted.current = false;
5613
+ };
5614
+ }, []);
5615
+ (0, import_react17.useEffect)(() => {
5616
+ if (!savingRef.current) setForm(companionDraft(companion));
5617
+ }, [companion.id, companion.updatedAt]);
5618
+ (0, import_react17.useEffect)(() => {
5619
+ void api("/models").then((value) => {
5620
+ if (mounted.current) setModelCatalog(value);
5621
+ }).catch((reason) => {
5622
+ if (mounted.current) setError(errorMessage(reason));
5623
+ });
5624
+ }, []);
5625
+ const edit = (next) => {
5626
+ if (savingRef.current) return;
5627
+ setForm(next);
5628
+ setSaved(false);
5629
+ setError(void 0);
5630
+ };
5631
+ const toggle = (capability) => edit({ ...form, capabilities: form.capabilities.includes(capability) ? form.capabilities.filter((item) => item !== capability) : [...form.capabilities, capability] });
5632
+ const save = async () => {
5633
+ if (savingRef.current) return;
5634
+ savingRef.current = true;
5635
+ setSaving(true);
5636
+ setSaved(false);
5637
+ setError(void 0);
5638
+ try {
5639
+ await api(`/companions/${companion.id}`, { method: "PUT", body: JSON.stringify({ companion: form }) });
5640
+ if (!mounted.current) return;
5641
+ setSaved(true);
5642
+ try {
5643
+ await onChanged();
5644
+ } catch {
5645
+ if (mounted.current) setError("\u80FD\u529B\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u5217\u8868\u5237\u65B0\u5931\u8D25\u3002\u5237\u65B0\u9875\u9762\u5373\u53EF\uFF0C\u65E0\u9700\u91CD\u590D\u5E94\u7528\u3002");
5646
+ }
5647
+ } catch (reason) {
5648
+ if (mounted.current) setError(`\u4FDD\u5B58\u5931\u8D25\uFF1A${errorMessage(reason)}\u3002\u5F53\u524D\u9009\u62E9\u5DF2\u4FDD\u7559\uFF0C\u53EF\u91CD\u8BD5\u3002`);
5649
+ } finally {
5650
+ savingRef.current = false;
5651
+ if (mounted.current) setSaving(false);
5652
+ }
5653
+ };
5654
+ const groups = [
5655
+ { id: "tools", eyebrow: "TOOLS", title: "\u5DE5\u4F5C\u5DE5\u5177", detail: "\u8FDE\u63A5\u5F53\u524D\u4F19\u4F34\u80FD\u591F\u4F7F\u7528\u7684\u4E13\u4E1A\u5DE5\u5177\u3002", choices: [
5656
+ { id: "knowledge", title: "\u77E5\u8BC6\u5E93", detail: "\u5728\u5DF2\u6302\u8F7D\u8303\u56F4\u5185\u68C0\u7D22\u4E0E\u56DE\u5199\u77E5\u8BC6\u3002" },
5657
+ { id: "skills", title: "Skill", detail: "\u4F7F\u7528\u5355\u72EC\u542F\u7528\u7684 Skill \u4E0E\u5DE5\u4F5C\u6D41\u7A0B\u3002" },
5658
+ { id: "ssh", title: "SSH", detail: "\u5728 SSH \u63D2\u4EF6\u6388\u6743\u8FB9\u754C\u5185\u64CD\u4F5C\u4E3B\u673A\u3002" },
5659
+ { id: "git", title: "Git", detail: "\u9884\u7559 Git \u80FD\u529B\uFF0C\u9700\u5BF9\u5E94\u63D2\u4EF6\u5B9E\u9645\u5B89\u88C5\u3002" }
5660
+ ] },
5661
+ { id: "coordination", eyebrow: "COORDINATION", title: "\u534F\u4F5C\u4E0E\u81EA\u52A8\u5316", detail: "\u63A7\u5236\u4F19\u4F34\u5EFA\u7ACB\u5173\u7CFB\u548C\u81EA\u4E3B\u5B89\u6392\u5DE5\u4F5C\u7684\u6743\u9650\u3002", choices: [
5662
+ { id: "companions", title: "\u521B\u5EFA\u4F19\u4F34", detail: "\u6309\u660E\u786E\u9700\u6C42\u521B\u5EFA\u9ED8\u8BA4\u65E0\u6743\u9650\u7684\u65B0\u4F19\u4F34\u3002" },
5663
+ { id: "access", title: "\u4F19\u4F34\u6388\u6743", detail: "\u6309\u660E\u786E\u8981\u6C42\u914D\u7F6E\u4F19\u4F34\u4E4B\u95F4\u7684\u5355\u5411\u8BBF\u95EE\u5173\u7CFB\u3002" },
5664
+ { id: "schedules", title: "\u5B9A\u65F6\u4EFB\u52A1", detail: "\u521B\u5EFA\u5E76\u7BA1\u7406\u7531\u81EA\u5DF1\u6267\u884C\u7684\u5468\u671F\u4EFB\u52A1\u3002" }
5665
+ ] },
5666
+ { id: "administration", eyebrow: "ADMINISTRATION", title: "\u9AD8\u6743\u9650\u7BA1\u7406", detail: "\u4EC5\u6388\u4E88\u53EF\u4FE1\u7684\u7BA1\u7406\u4F19\u4F34\uFF1B\u666E\u901A\u534F\u4F5C\u6388\u6743\u4E0D\u5305\u542B\u4FEE\u6539\u6743\u9650\u3002", choices: [
5667
+ { id: "administration", title: CAPABILITY_LABELS.administration, detail: "\u4FEE\u6539\u5176\u4ED6\u4F19\u4F34\u7684\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E Preset\u3001\u534F\u4F5C\u3001Skill \u548C\u77E5\u8BC6\u5E93\u6302\u8F7D\u3002\u4E0D\u5171\u4EAB\u4F1A\u8BDD\u3001\u8BB0\u5FC6\u6216\u51ED\u636E\uFF1B\u4E0D\u80FD\u81EA\u6539\u6216\u8F6C\u6388\u672C\u6743\u9650\u3002" }
5668
+ ] }
5669
+ ];
5670
+ const selectedProvider = form.provider || modelCatalog?.defaultSelection.provider || "";
5671
+ const modelOptions = modelCatalog?.providers.find((item) => item.id === selectedProvider)?.models ?? [];
5672
+ const currentModelMissing = Boolean(form.model) && !modelOptions.some((item) => item.id === form.model);
5673
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-partner-form is-capabilities", children: [
5674
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SectionHeading, { eyebrow: "COMPOSITION", title: "\u80FD\u529B\u7EC4\u5408", detail: "\u4F19\u4F34\u58F0\u660E\u610F\u56FE\u8303\u56F4\uFF1B\u771F\u6B63\u53EF\u8C03\u7528\u7684\u5DE5\u5177\u4ECD\u6765\u81EA\u6240\u9009 Agent Preset\uFF0C\u5E76\u7EE7\u7EED\u6267\u884C\u5404\u63D2\u4EF6\u6743\u9650\u3002" }),
5675
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-partner-runtime-fields", children: [
5676
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "Agent Preset", hint: "\u5DE5\u5177\u3001Skill \u4E0E\u7CFB\u7EDF\u63D0\u793A", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("select", { disabled: saving, value: form.presetId, onChange: (event) => edit({ ...form, presetId: event.target.value }), children: [
5677
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "", children: "\u8DDF\u968F DSH \u9ED8\u8BA4 Preset" }),
5678
+ presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: item.id, children: item.name }, item.id))
5679
+ ] }) }),
5680
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "\u6A21\u578B\u63D0\u4F9B\u65B9", hint: "\u6765\u81EA\u5F53\u524D\u5BA2\u6237\u7AEF", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("select", { disabled: saving, value: form.provider, onChange: (event) => edit({ ...form, provider: event.target.value, model: "" }), children: [
5681
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("option", { value: "", children: [
5682
+ "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
5683
+ modelCatalog?.defaultSelection.provider || "\u6B63\u5728\u8BFB\u53D6"
5684
+ ] }),
5685
+ modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
5686
+ ] }) }),
5687
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FormField, { label: "\u6A21\u578B", hint: "\u968F\u63D0\u4F9B\u65B9\u8054\u52A8", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("select", { disabled: saving, value: form.model, onChange: (event) => edit({ ...form, model: event.target.value }), children: [
5688
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("option", { value: "", children: [
5689
+ "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
5690
+ modelCatalog?.defaultSelection.model || "\u6B63\u5728\u8BFB\u53D6"
5691
+ ] }),
5692
+ currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("option", { value: form.model, children: [
5693
+ "\u5F53\u524D\u914D\u7F6E \xB7 ",
5694
+ form.model
5695
+ ] }),
5696
+ modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
5697
+ ] }) })
5698
+ ] }),
5699
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsh-partner-inline-note", children: "\u8EAB\u4EFD\u4E0E\u80FD\u529B\u5728\u4E0B\u4E00\u8F6E\u6267\u884C\u524D\u66F4\u65B0\uFF1BPreset \u4E0E\u6A21\u578B\u4F5C\u4E3A\u4F1A\u8BDD\u9ED8\u8BA4\u914D\u7F6E\uFF0C\u4E0D\u8986\u76D6\u5DF2\u6709\u4F1A\u8BDD\u7684\u9009\u62E9\u3002" }),
5700
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-partner-capability-groups", children: groups.map((group) => {
5701
+ const enabled = group.choices.filter((choice) => form.capabilities.includes(choice.id)).length;
5702
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: "dsh-partner-capability-group", "aria-labelledby": `partner-capability-${group.id}`, children: [
5703
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("header", { children: [
5704
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
5705
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: group.eyebrow }),
5706
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { id: `partner-capability-${group.id}`, children: group.title }),
5707
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: group.detail })
5708
+ ] }),
5709
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("em", { children: [
5710
+ enabled,
5711
+ " / ",
5712
+ group.choices.length,
5713
+ " \u5DF2\u542F\u7528"
5714
+ ] })
5715
+ ] }),
5716
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-partner-capabilities", children: group.choices.map((choice) => {
5717
+ const active = form.capabilities.includes(choice.id);
5718
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", disabled: saving, className: active ? "is-active" : "", "aria-pressed": active, onClick: () => toggle(choice.id), children: [
5719
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: active && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives10.IconCheckOutline14, { size: 14 }) }),
5720
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: choice.title }),
5721
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: choice.detail })
5722
+ ] }, choice.id);
5723
+ }) })
5724
+ ] }, group.id);
5725
+ }) }),
5726
+ form.capabilities.includes("skills") && companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CompanionSkillSettings, { companionId: companion.id }),
5727
+ form.capabilities.includes("skills") && !companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsh-partner-inline-note", children: "\u5148\u5E94\u7528\u80FD\u529B\u7EC4\u5408\uFF0C\u518D\u4E3A\u5F53\u524D\u4F19\u4F34\u9009\u62E9\u5177\u4F53 Skill\u3002" }),
5728
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CompanionAccessPanel, { companionId: companion.id }),
5729
+ error && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
5730
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-partner-form-actions is-capability-save", children: [
5731
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { role: "status", "aria-live": "polite", "aria-atomic": "true", children: saved && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
5732
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives10.IconCheckOutline14, { size: 14 }),
5733
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u751F\u6548" })
5734
+ ] }) }),
5735
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", disabled: saving, "aria-busy": saving, onClick: () => {
5736
+ void save();
5737
+ }, children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u5E94\u7528\u80FD\u529B\u7EC4\u5408" })
5738
+ ] })
5739
+ ] });
5740
+ }
5741
+
5742
+ // src/ui/companion-create.tsx
5743
+ var import_react18 = require("react");
5744
+ var import_dsh_client_ui_primitives11 = require("@deepseek-ai/dsh-client-ui-primitives");
5745
+ var import_jsx_runtime14 = require("react/jsx-runtime");
5746
+ function CompanionCreateDialog({ close, create }) {
5747
+ const [busy, setBusy] = (0, import_react18.useState)(false);
5748
+ const [error, setError] = (0, import_react18.useState)();
5595
5749
  const submit = async (event) => {
5596
5750
  event.preventDefault();
5597
5751
  const data = new FormData(event.currentTarget);
@@ -5610,30 +5764,30 @@ function CompanionCreateDialog({ close, create }) {
5610
5764
  setBusy(false);
5611
5765
  }
5612
5766
  };
5613
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u4F19\u4F34", detail: "\u5148\u5EFA\u7ACB\u6E05\u6670\u7684\u8EAB\u4EFD\u548C\u804C\u8D23\u3002\u6A21\u578B\u3001\u5DE5\u5177\u3001Skill \u4E0E\u534F\u4F5C\u6743\u9650\u4F1A\u5728\u521B\u5EFA\u540E\u5355\u72EC\u914D\u7F6E\u3002", close, width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-companion-create-form", "aria-busy": busy, onSubmit: (event) => {
5767
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u4F19\u4F34", detail: "\u5148\u5EFA\u7ACB\u6E05\u6670\u7684\u8EAB\u4EFD\u548C\u804C\u8D23\u3002\u6A21\u578B\u3001\u5DE5\u5177\u3001Skill \u4E0E\u534F\u4F5C\u6743\u9650\u4F1A\u5728\u521B\u5EFA\u540E\u5355\u72EC\u914D\u7F6E\u3002", close, width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-companion-create-form", "aria-busy": busy, onSubmit: (event) => {
5614
5768
  void submit(event);
5615
5769
  }, children: [
5616
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
5617
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u4F19\u4F34\u540D\u5B57" }),
5618
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { name: "name", required: true, maxLength: 60, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u5C0F\u9ED1" })
5770
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
5771
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u4F19\u4F34\u540D\u5B57" }),
5772
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "name", required: true, maxLength: 60, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u5C0F\u9ED1" })
5619
5773
  ] }),
5620
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
5621
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u4E3B\u8981\u89D2\u8272" }),
5622
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { name: "role", required: true, maxLength: 120, placeholder: "\u4F8B\u5982\uFF1A\u4EA7\u54C1\u4E0E\u5DE5\u7A0B\u534F\u4F5C\u4F19\u4F34" })
5774
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
5775
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u4E3B\u8981\u89D2\u8272" }),
5776
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "role", required: true, maxLength: 120, placeholder: "\u4F8B\u5982\uFF1A\u4EA7\u54C1\u4E0E\u5DE5\u7A0B\u534F\u4F5C\u4F19\u4F34" })
5623
5777
  ] }),
5624
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "is-wide", children: [
5625
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D" }),
5626
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { name: "description", maxLength: 500, placeholder: "\u5B83\u4E3B\u8981\u8D1F\u8D23\u4EC0\u4E48\uFF0C\u4EC0\u4E48\u65F6\u5019\u5E94\u8BE5\u627E\u5B83" })
5778
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "is-wide", children: [
5779
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D" }),
5780
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "description", maxLength: 500, placeholder: "\u5B83\u4E3B\u8981\u8D1F\u8D23\u4EC0\u4E48\uFF0C\u4EC0\u4E48\u65F6\u5019\u5E94\u8BE5\u627E\u5B83" })
5627
5781
  ] }),
5628
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "is-wide", children: [
5629
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u521D\u59CB\u884C\u4E3A\u51C6\u5219" }),
5630
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("textarea", { name: "instructions", maxLength: 12e3, rows: 7, placeholder: "\u5199\u6E05\u804C\u8D23\u3001\u8868\u8FBE\u65B9\u5F0F\u3001\u5DE5\u4F5C\u8FB9\u754C\u548C\u4EA4\u4ED8\u6807\u51C6\uFF1B\u4E5F\u53EF\u4EE5\u521B\u5EFA\u540E\u518D\u5B8C\u5584" })
5782
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "is-wide", children: [
5783
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u521D\u59CB\u884C\u4E3A\u51C6\u5219" }),
5784
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("textarea", { name: "instructions", maxLength: 12e3, rows: 7, placeholder: "\u5199\u6E05\u804C\u8D23\u3001\u8868\u8FBE\u65B9\u5F0F\u3001\u5DE5\u4F5C\u8FB9\u754C\u548C\u4EA4\u4ED8\u6807\u51C6\uFF1B\u4E5F\u53EF\u4EE5\u521B\u5EFA\u540E\u518D\u5B8C\u5584" })
5631
5785
  ] }),
5632
- error && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WorkspaceNotice, { children: error }),
5633
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("footer", { children: [
5634
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
5635
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
5636
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives10.IconPlusOutline16, { size: 14 }),
5786
+ error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WorkspaceNotice, { children: error }),
5787
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("footer", { children: [
5788
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
5789
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
5790
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlusOutline16, { size: 14 }),
5637
5791
  busy ? "\u6B63\u5728\u521B\u5EFA\u2026" : "\u521B\u5EFA\u4F19\u4F34"
5638
5792
  ] })
5639
5793
  ] })
@@ -5723,7 +5877,7 @@ function sessions(ctx) {
5723
5877
  }
5724
5878
 
5725
5879
  // src/client.tsx
5726
- var import_jsx_runtime14 = require("react/jsx-runtime");
5880
+ var import_jsx_runtime15 = require("react/jsx-runtime");
5727
5881
  var PLUGIN_ID = "@lemoncat7/dsh-partner";
5728
5882
  var STYLE_ID = `${PLUGIN_ID}/client`;
5729
5883
  var cssText = `${client_default}
@@ -5736,24 +5890,24 @@ var WORKSPACE_PAGES = /* @__PURE__ */ new Set(["skills", "board", "schedules", "
5736
5890
  var inject = ["slots", "layout", "sessions"];
5737
5891
  function apply(ctx) {
5738
5892
  ctx.effect(installStyles, "dsh-partner: styles");
5739
- const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PartnerWorkspace, { ...props, controller: current2 }));
5740
- ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PartnerPendant, { controller })));
5893
+ const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PartnerWorkspace, { ...props, controller: current2 }));
5894
+ ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PartnerPendant, { controller })));
5741
5895
  ctx.effect(() => observePluginWorkspace(PLUGIN_ID, controller.close), "dsh-partner: exclusive workspace");
5742
5896
  ctx.effect(() => () => controller.close(), "dsh-partner: workspace lifecycle");
5743
5897
  ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({
5744
5898
  name: "sidebar.footer.action",
5745
5899
  id: "partner",
5746
5900
  order: -120
5747
- }, (props) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
5901
+ }, (props) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
5748
5902
  }
5749
5903
  function PartnerSidebar(props) {
5750
- const ref = (0, import_react18.useRef)(null);
5904
+ const ref = (0, import_react19.useRef)(null);
5751
5905
  useWorkspaceTopAnchor(ref);
5752
- const [open, setOpen] = (0, import_react18.useState)(true);
5753
- const [snapshot, setSnapshot] = (0, import_react18.useState)();
5754
- const [, update] = (0, import_react18.useState)(0);
5755
- (0, import_react18.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
5756
- (0, import_react18.useEffect)(() => {
5906
+ const [open, setOpen] = (0, import_react19.useState)(true);
5907
+ const [snapshot, setSnapshot] = (0, import_react19.useState)();
5908
+ const [, update] = (0, import_react19.useState)(0);
5909
+ (0, import_react19.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
5910
+ (0, import_react19.useEffect)(() => {
5757
5911
  void loadPartner().then(setSnapshot).catch(() => {
5758
5912
  });
5759
5913
  }, [props.controller.isOpen()]);
@@ -5761,31 +5915,31 @@ function PartnerSidebar(props) {
5761
5915
  props.controller.open(id);
5762
5916
  if (props.wide && window.matchMedia("(max-width: 820px)").matches) props.collapse();
5763
5917
  };
5764
- if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: `dsh-partner-rail${props.controller.isOpen() ? " is-active" : ""}`, title: "\u4F19\u4F34", onClick: () => props.controller.toggle(), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconAgentPresetOutline16, { size: 18 }) }) });
5765
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
5766
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
5767
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconChevronDownOutline14, { size: 14 }) }),
5918
+ if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: `dsh-partner-rail${props.controller.isOpen() ? " is-active" : ""}`, title: "\u4F19\u4F34", onClick: () => props.controller.toggle(), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconAgentPresetOutline16, { size: 18 }) }) });
5919
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
5920
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
5921
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconChevronDownOutline14, { size: 14 }) }),
5768
5922
  "\u4F19\u4F34"
5769
5923
  ] }) }),
5770
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
5771
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconAgentPresetOutline16, { size: 16 }) }),
5772
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
5773
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
5774
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: snapshot ? `${snapshot.companions.length} \u4F4D\u4F19\u4F34 \xB7 ${snapshot.channels.filter((item) => item.runtimeStatus === "running").length} \u4E2A\u5FAE\u4FE1\u5728\u7EBF` : "\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E\u6E20\u9053" })
5924
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
5925
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconAgentPresetOutline16, { size: 16 }) }),
5926
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
5927
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
5928
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: snapshot ? `${snapshot.companions.length} \u4F4D\u4F19\u4F34 \xB7 ${snapshot.channels.filter((item) => item.runtimeStatus === "running").length} \u4E2A\u5FAE\u4FE1\u5728\u7EBF` : "\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E\u6E20\u9053" })
5775
5929
  ] }),
5776
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
5930
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
5777
5931
  ] }) }) })
5778
5932
  ] });
5779
5933
  }
5780
5934
  function PartnerWorkspace({ controller }) {
5781
- const [snapshot, setSnapshot] = (0, import_react18.useState)();
5782
- const [selectedId, setSelectedId] = (0, import_react18.useState)(controller.selected());
5783
- const [view, setView] = (0, import_react18.useState)(controller.destination()?.page ?? "home");
5784
- const [requestedDestination, setRequestedDestination] = (0, import_react18.useState)(controller.destination());
5785
- const [error, setError] = (0, import_react18.useState)();
5786
- const [loading, setLoading] = (0, import_react18.useState)(true);
5787
- const [creatingCompanion, setCreatingCompanion] = (0, import_react18.useState)(false);
5788
- const refresh = (0, import_react18.useCallback)(async () => {
5935
+ const [snapshot, setSnapshot] = (0, import_react19.useState)();
5936
+ const [selectedId, setSelectedId] = (0, import_react19.useState)(controller.selected());
5937
+ const [view, setView] = (0, import_react19.useState)(controller.destination()?.page ?? "home");
5938
+ const [requestedDestination, setRequestedDestination] = (0, import_react19.useState)(controller.destination());
5939
+ const [error, setError] = (0, import_react19.useState)();
5940
+ const [loading, setLoading] = (0, import_react19.useState)(true);
5941
+ const [creatingCompanion, setCreatingCompanion] = (0, import_react19.useState)(false);
5942
+ const refresh = (0, import_react19.useCallback)(async (throwOnError = false) => {
5789
5943
  try {
5790
5944
  const next = await loadPartner();
5791
5945
  setSnapshot(next);
@@ -5793,14 +5947,15 @@ function PartnerWorkspace({ controller }) {
5793
5947
  setError(void 0);
5794
5948
  } catch (reason) {
5795
5949
  setError(errorMessage(reason));
5950
+ if (throwOnError) throw reason;
5796
5951
  } finally {
5797
5952
  setLoading(false);
5798
5953
  }
5799
5954
  }, []);
5800
- (0, import_react18.useEffect)(() => {
5955
+ (0, import_react19.useEffect)(() => {
5801
5956
  void refresh();
5802
5957
  }, [refresh]);
5803
- (0, import_react18.useEffect)(() => controller.subscribe(() => {
5958
+ (0, import_react19.useEffect)(() => controller.subscribe(() => {
5804
5959
  const next = controller.selected();
5805
5960
  if (next) setSelectedId(next);
5806
5961
  const destination = controller.destination();
@@ -5854,18 +6009,18 @@ function PartnerWorkspace({ controller }) {
5854
6009
  setSelectedId(id);
5855
6010
  setView("home");
5856
6011
  };
5857
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("main", { className: "dsh-partner-workspace", children: [
5858
- creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
5859
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { className: "dsh-partner-topbar", children: [
5860
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
5861
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", "data-xiaohei-workspace-close": true, onClick: controller.close, "aria-label": "\u8FD4\u56DE\u4F1A\u8BDD", title: "\u8FD4\u56DE\u4F1A\u8BDD", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconChevronLeftOutline14, { size: 15 }) }),
5862
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconAgentPresetOutline16, { size: 18 }),
5863
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
5864
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u4F19\u4F34" }),
5865
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u5FAE\u4FE1\u6E20\u9053" })
6012
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("main", { className: "dsh-partner-workspace", children: [
6013
+ creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
6014
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { className: "dsh-partner-topbar", children: [
6015
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
6016
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", "data-xiaohei-workspace-close": true, onClick: controller.close, "aria-label": "\u8FD4\u56DE\u4F1A\u8BDD", title: "\u8FD4\u56DE\u4F1A\u8BDD", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconChevronLeftOutline14, { size: 15 }) }),
6017
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconAgentPresetOutline16, { size: 18 }),
6018
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6019
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u4F19\u4F34" }),
6020
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u5FAE\u4FE1\u6E20\u9053" })
5866
6021
  ] })
5867
6022
  ] }),
5868
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6023
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5869
6024
  MobileWorkspaceControls,
5870
6025
  {
5871
6026
  companions: snapshot?.companions ?? [],
@@ -5877,114 +6032,114 @@ function PartnerWorkspace({ controller }) {
5877
6032
  }
5878
6033
  )
5879
6034
  ] }),
5880
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-grid", children: [
5881
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("aside", { className: "dsh-partner-roster", children: [
5882
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-roster-title", children: [
5883
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
5884
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "COMPANIONS" }),
5885
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
6035
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-grid", children: [
6036
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("aside", { className: "dsh-partner-roster", children: [
6037
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-roster-title", children: [
6038
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6039
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "COMPANIONS" }),
6040
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
5886
6041
  ] }),
5887
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlusOutline16, { size: 16 }) })
6042
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconPlusOutline16, { size: 16 }) })
5888
6043
  ] }),
5889
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
6044
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
5890
6045
  const channel = snapshot.channels.find((item) => item.companionId === companion.id);
5891
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
5892
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Avatar, { name: companion.name }),
5893
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
5894
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: companion.name }),
5895
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: companion.role })
6046
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
6047
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Avatar, { name: companion.name }),
6048
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6049
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: companion.name }),
6050
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: companion.role })
5896
6051
  ] }),
5897
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
6052
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
5898
6053
  ] }, companion.id);
5899
6054
  }) }),
5900
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: [
5901
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-current": view === "skills" ? "page" : void 0, onClick: () => setView("skills"), children: [
5902
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconBrowseOutline16, { size: 16 }) }),
5903
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "Skill \u5E02\u573A" }),
5904
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u5B89\u88C5\u4E0E\u7BA1\u7406\u80FD\u529B" })
6055
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: [
6056
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-current": view === "skills" ? "page" : void 0, onClick: () => setView("skills"), children: [
6057
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconBrowseOutline16, { size: 16 }) }),
6058
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "Skill \u5E02\u573A" }),
6059
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u5B89\u88C5\u4E0E\u7BA1\u7406\u80FD\u529B" })
5905
6060
  ] }),
5906
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-current": view === "board" ? "page" : void 0, onClick: () => setView("board"), children: [
5907
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconListPenOutline16, { size: 16 }) }),
5908
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u4EFB\u52A1\u770B\u677F" }),
5909
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u534F\u4F5C\u3001\u59D4\u6D3E\u4E0E\u9A8C\u6536" })
6061
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-current": view === "board" ? "page" : void 0, onClick: () => setView("board"), children: [
6062
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconListPenOutline16, { size: 16 }) }),
6063
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u4EFB\u52A1\u770B\u677F" }),
6064
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u534F\u4F5C\u3001\u59D4\u6D3E\u4E0E\u9A8C\u6536" })
5910
6065
  ] }),
5911
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-current": view === "schedules" ? "page" : void 0, onClick: () => setView("schedules"), children: [
5912
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlayOutline16, { size: 16 }) }),
5913
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u5B9A\u65F6\u4EFB\u52A1" }),
5914
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u9009\u62E9\u4F19\u4F34\u5468\u671F\u6267\u884C" })
6066
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-current": view === "schedules" ? "page" : void 0, onClick: () => setView("schedules"), children: [
6067
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconPlayOutline16, { size: 16 }) }),
6068
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u5B9A\u65F6\u4EFB\u52A1" }),
6069
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u9009\u62E9\u4F19\u4F34\u5468\u671F\u6267\u884C" })
5915
6070
  ] }),
5916
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-current": view === "pendant" ? "page" : void 0, onClick: () => setView("pendant"), children: [
5917
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconEditOutline16, { size: 16 }) }),
5918
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u5361\u7247\u8BBE\u7F6E" }),
5919
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u6302\u9970\u3001\u7EF3\u5B50\u4E0E\u56FE\u6848" })
6071
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-current": view === "pendant" ? "page" : void 0, onClick: () => setView("pendant"), children: [
6072
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconEditOutline16, { size: 16 }) }),
6073
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u5361\u7247\u8BBE\u7F6E" }),
6074
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u6302\u9970\u3001\u7EF3\u5B50\u4E0E\u56FE\u6848" })
5920
6075
  ] })
5921
6076
  ] }),
5922
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-roster-note", children: [
5923
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconLinkOutline16, { size: 16 }),
5924
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
5925
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
5926
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u5FAE\u4FE1\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
6077
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-roster-note", children: [
6078
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconLinkOutline16, { size: 16 }),
6079
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6080
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
6081
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u5FAE\u4FE1\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
5927
6082
  ] })
5928
6083
  ] })
5929
6084
  ] }),
5930
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
5931
- loading ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
5932
- view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SkillsPanel, {}),
5933
- view === "board" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TaskBoardPanel, { initialTaskId: requestedDestination?.taskId, openRequest: requestedDestination }),
5934
- view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] }),
5935
- view === "pendant" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PendantSettingsPanel, {})
5936
- ] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: "\u521B\u5EFA\u7B2C\u4E00\u4E2A\u4F19\u4F34", detail: "\u4F19\u4F34\u4F1A\u4FDD\u5B58\u72EC\u7ACB\u8EAB\u4EFD\u3001\u80FD\u529B\u548C\u5FAE\u4FE1\u4F1A\u8BDD\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
5937
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-identity", children: [
5938
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Avatar, { name: selected.name }),
5939
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
5940
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "ACTIVE COMPANION" }),
5941
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h1", { children: selected.name }),
5942
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: selected.description || selected.role })
6085
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
6086
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
6087
+ view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SkillsPanel, {}),
6088
+ view === "board" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TaskBoardPanel, { initialTaskId: requestedDestination?.taskId, openRequest: requestedDestination }),
6089
+ view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] }),
6090
+ view === "pendant" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PendantSettingsPanel, {})
6091
+ ] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u521B\u5EFA\u7B2C\u4E00\u4E2A\u4F19\u4F34", detail: "\u4F19\u4F34\u4F1A\u4FDD\u5B58\u72EC\u7ACB\u8EAB\u4EFD\u3001\u80FD\u529B\u548C\u5FAE\u4FE1\u4F1A\u8BDD\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
6092
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-identity", children: [
6093
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Avatar, { name: selected.name }),
6094
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6095
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "ACTIVE COMPANION" }),
6096
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h1", { children: selected.name }),
6097
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: selected.description || selected.role })
5943
6098
  ] }),
5944
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
6099
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
5945
6100
  ] }),
5946
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
5947
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconAgentPresetOutline16, { size: 16 }), children: "\u603B\u89C8" }),
5948
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconEditOutline16, { size: 16 }), children: "\u8EAB\u4EFD" }),
5949
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconAgentPresetOutline16, { size: 16 }), children: "\u80FD\u529B" }),
5950
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WeixinGlyph, {}), children: "\u5FAE\u4FE1" }),
5951
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconDataOutline16, { size: 16 }), children: "\u8BB0\u5FC6" })
6101
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
6102
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconAgentPresetOutline16, { size: 16 }), children: "\u603B\u89C8" }),
6103
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconEditOutline16, { size: 16 }), children: "\u8EAB\u4EFD" }),
6104
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconAgentPresetOutline16, { size: 16 }), children: "\u80FD\u529B" }),
6105
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WeixinGlyph, {}), children: "\u5FAE\u4FE1" }),
6106
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconDataOutline16, { size: 16 }), children: "\u8BB0\u5FC6" })
5952
6107
  ] }),
5953
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
5954
- view === "home" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession }),
5955
- view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(IdentityEditor, { companion: selected, count: snapshot?.companions.length ?? 1, onChanged: refresh }),
5956
- view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: refresh }),
5957
- view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }),
5958
- view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, startSession, renewSession, onChanged: refresh })
6108
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
6109
+ view === "home" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession }),
6110
+ view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IdentityEditor, { companion: selected, count: snapshot?.companions.length ?? 1, onChanged: refresh }),
6111
+ view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: () => refresh(true) }, selected.id),
6112
+ view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }),
6113
+ view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, startSession, renewSession, onChanged: refresh })
5959
6114
  ] })
5960
6115
  ] }),
5961
- error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
6116
+ error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
5962
6117
  ] })
5963
6118
  ] })
5964
6119
  ] });
5965
6120
  }
5966
6121
  function MobileWorkspaceControls({ companions, selectedId, view, openCompanion, openPage, createCompanion }) {
5967
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
5968
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
5969
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
5970
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlusOutline16, { size: 17 }) })
6122
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
6123
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
6124
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
6125
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconPlusOutline16, { size: 17 }) })
5971
6126
  ] }),
5972
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: [
5973
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-pressed": view === "skills", onClick: () => openPage("skills"), children: [
5974
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconBrowseOutline16, { size: 16 }),
5975
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "Skill" })
6127
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: [
6128
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-pressed": view === "skills", onClick: () => openPage("skills"), children: [
6129
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconBrowseOutline16, { size: 16 }),
6130
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "Skill" })
5976
6131
  ] }),
5977
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-pressed": view === "board", onClick: () => openPage("board"), children: [
5978
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconListPenOutline16, { size: 16 }),
5979
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u770B\u677F" })
6132
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-pressed": view === "board", onClick: () => openPage("board"), children: [
6133
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconListPenOutline16, { size: 16 }),
6134
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u770B\u677F" })
5980
6135
  ] }),
5981
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-pressed": view === "schedules", onClick: () => openPage("schedules"), children: [
5982
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlayOutline16, { size: 16 }),
5983
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u5B9A\u65F6" })
6136
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-pressed": view === "schedules", onClick: () => openPage("schedules"), children: [
6137
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconPlayOutline16, { size: 16 }),
6138
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u5B9A\u65F6" })
5984
6139
  ] }),
5985
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-pressed": view === "pendant", onClick: () => openPage("pendant"), children: [
5986
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconEditOutline16, { size: 16 }),
5987
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u5361\u7247" })
6140
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-pressed": view === "pendant", onClick: () => openPage("pendant"), children: [
6141
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconEditOutline16, { size: 16 }),
6142
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u5361\u7247" })
5988
6143
  ] })
5989
6144
  ] })
5990
6145
  ] });
@@ -5997,77 +6152,77 @@ function HomePanel({ companion, snapshot, navigate, openSession, startSession, r
5997
6152
  const approved = channel ? snapshot.pairings.filter((item) => item.channelId === channel.id && item.status === "approved").length : 0;
5998
6153
  const capabilities = companion.capabilities.map((item) => CAPABILITY_LABELS[item]);
5999
6154
  const online = channel?.runtimeStatus === "running";
6000
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-home", children: [
6001
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { className: "dsh-partner-home-heading", children: [
6002
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6003
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
6004
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u5FAE\u4FE1\u5F85\u547D` : `${companion.name} \u5DF2\u51C6\u5907\u5C31\u7EEA` })
6155
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-home", children: [
6156
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { className: "dsh-partner-home-heading", children: [
6157
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6158
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
6159
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u5FAE\u4FE1\u5F85\u547D` : `${companion.name} \u5DF2\u51C6\u5907\u5C31\u7EEA` })
6005
6160
  ] }),
6006
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: online ? "\u6D88\u606F\u3001\u6388\u6743\u4E0E\u4E0A\u4E0B\u6587\u8FB9\u754C\u90FD\u5728\u8FD9\u91CC\u6C47\u603B\u3002" : "\u4F19\u4F34\u8EAB\u4EFD\u3001\u4F1A\u8BDD\u4E0E\u80FD\u529B\u5DF2\u7ECF\u51C6\u5907\u5B8C\u6210\u3002" })
6161
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: online ? "\u6D88\u606F\u3001\u6388\u6743\u4E0E\u4E0A\u4E0B\u6587\u8FB9\u754C\u90FD\u5728\u8FD9\u91CC\u6C47\u603B\u3002" : "\u4F19\u4F34\u8EAB\u4EFD\u3001\u4F1A\u8BDD\u4E0E\u80FD\u529B\u5DF2\u7ECF\u51C6\u5907\u5B8C\u6210\u3002" })
6007
6162
  ] }),
6008
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
6009
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
6010
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Avatar, { name: companion.name }),
6011
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}) }),
6012
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WeixinGlyph, { large: true }) })
6163
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
6164
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
6165
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Avatar, { name: companion.name }),
6166
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}) }),
6167
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WeixinGlyph, { large: true }) })
6013
6168
  ] }),
6014
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
6015
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
6016
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}),
6169
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
6170
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
6171
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
6017
6172
  "\u4E3B\u8981\u6E20\u9053 \xB7 \u5FAE\u4FE1"
6018
6173
  ] }),
6019
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h3", { children: !channel ? "\u7B49\u5F85\u626B\u7801\u8FDE\u63A5" : online ? "\u8FDE\u63A5\u6B63\u5E38\uFF0C\u6B63\u5728\u63A5\u6536\u6D88\u606F" : channel.runtimeStatus === "error" ? "\u6E20\u9053\u8FDE\u63A5\u9700\u8981\u5904\u7406" : "\u6E20\u9053\u5F53\u524D\u5DF2\u505C\u7528" }),
6020
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: !channel ? "\u901A\u8FC7\u5FAE\u4FE1 iLink Bot \u63A5\u5165\u3002\u51ED\u636E\u53EA\u8FDB\u5165 DSH \u51ED\u636E\u5E93\uFF0C\u8054\u7CFB\u4EBA\u9996\u6B21\u53D1\u6D88\u606F\u4ECD\u9700\u4F60\u7684\u6279\u51C6\u3002" : online ? "\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u62E5\u6709\u72EC\u7ACB DSH \u4F1A\u8BDD\uFF0C\u4F19\u4F34\u8EAB\u4EFD\u4E00\u81F4\uFF0C\u4F46\u4E0A\u4E0B\u6587\u4E0D\u4F1A\u4E92\u76F8\u6DF7\u5408\u3002" : channel.lastError || "\u6E20\u9053\u914D\u7F6E\u4ECD\u7136\u4FDD\u7559\uFF0C\u53EF\u4EE5\u968F\u65F6\u91CD\u65B0\u542F\u7528\u3002" }),
6021
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
6022
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "is-primary", onClick: () => navigate("weixin"), children: !channel ? "\u8FDE\u63A5\u5FAE\u4FE1" : pending > 0 ? `\u5904\u7406 ${pending} \u4E2A\u8BF7\u6C42` : "\u7BA1\u7406\u6E20\u9053" }),
6023
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: !channel ? "\u626B\u7801\u5B8C\u6210\uFF0C\u65E0\u9700\u7C98\u8D34 Token" : `${approved} \u4F4D\u8054\u7CFB\u4EBA \xB7 ${sessions2.length} \u4E2A\u72EC\u7ACB\u4F1A\u8BDD` })
6174
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h3", { children: !channel ? "\u7B49\u5F85\u626B\u7801\u8FDE\u63A5" : online ? "\u8FDE\u63A5\u6B63\u5E38\uFF0C\u6B63\u5728\u63A5\u6536\u6D88\u606F" : channel.runtimeStatus === "error" ? "\u6E20\u9053\u8FDE\u63A5\u9700\u8981\u5904\u7406" : "\u6E20\u9053\u5F53\u524D\u5DF2\u505C\u7528" }),
6175
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: !channel ? "\u901A\u8FC7\u5FAE\u4FE1 iLink Bot \u63A5\u5165\u3002\u51ED\u636E\u53EA\u8FDB\u5165 DSH \u51ED\u636E\u5E93\uFF0C\u8054\u7CFB\u4EBA\u9996\u6B21\u53D1\u6D88\u606F\u4ECD\u9700\u4F60\u7684\u6279\u51C6\u3002" : online ? "\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u62E5\u6709\u72EC\u7ACB DSH \u4F1A\u8BDD\uFF0C\u4F19\u4F34\u8EAB\u4EFD\u4E00\u81F4\uFF0C\u4F46\u4E0A\u4E0B\u6587\u4E0D\u4F1A\u4E92\u76F8\u6DF7\u5408\u3002" : channel.lastError || "\u6E20\u9053\u914D\u7F6E\u4ECD\u7136\u4FDD\u7559\uFF0C\u53EF\u4EE5\u968F\u65F6\u91CD\u65B0\u542F\u7528\u3002" }),
6176
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
6177
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "is-primary", onClick: () => navigate("weixin"), children: !channel ? "\u8FDE\u63A5\u5FAE\u4FE1" : pending > 0 ? `\u5904\u7406 ${pending} \u4E2A\u8BF7\u6C42` : "\u7BA1\u7406\u6E20\u9053" }),
6178
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: !channel ? "\u626B\u7801\u5B8C\u6210\uFF0C\u65E0\u9700\u7C98\u8D34 Token" : `${approved} \u4F4D\u8054\u7CFB\u4EBA \xB7 ${sessions2.length} \u4E2A\u72EC\u7ACB\u4F1A\u8BDD` })
6024
6179
  ] })
6025
6180
  ] })
6026
6181
  ] }),
6027
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-home-details", children: [
6028
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-home-profile", children: [
6029
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
6030
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconUserOutline16, { size: 16 }) }),
6031
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
6032
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
6033
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: companion.role })
6182
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-home-details", children: [
6183
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "dsh-partner-home-profile", children: [
6184
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
6185
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconUserOutline16, { size: 16 }) }),
6186
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6187
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
6188
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: companion.role })
6034
6189
  ] }),
6035
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
6190
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
6036
6191
  ] }),
6037
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
6192
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
6038
6193
  ] }),
6039
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
6040
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
6041
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconAgentPresetOutline16, { size: 16 }) }),
6042
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
6043
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
6044
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
6194
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
6195
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
6196
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconAgentPresetOutline16, { size: 16 }) }),
6197
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6198
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
6199
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
6045
6200
  ] }),
6046
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
6201
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
6047
6202
  ] }),
6048
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
6203
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
6049
6204
  ] }),
6050
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
6051
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
6052
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconDataOutline16, { size: 16 }) }),
6053
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
6054
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
6055
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: localSession?.archived ? "\u4F1A\u8BDD\u5DF2\u5F52\u6863" : "\u4F19\u4F34\u4F1A\u8BDD\u5DF2\u5EFA\u7ACB" })
6205
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
6206
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
6207
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconDataOutline16, { size: 16 }) }),
6208
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6209
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
6210
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: localSession?.archived ? "\u4F1A\u8BDD\u5DF2\u5F52\u6863" : "\u4F19\u4F34\u4F1A\u8BDD\u5DF2\u5EFA\u7ACB" })
6056
6211
  ] }),
6057
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => localSession === void 0 ? void startSession(companion.id) : localSession.archived ? void renewSession(localSession.id) : void openSession(localSession.id, localSession.sessionId), children: localSession === void 0 ? "\u5F00\u59CB\u5BF9\u8BDD" : localSession.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
6212
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => localSession === void 0 ? void startSession(companion.id) : localSession.archived ? void renewSession(localSession.id) : void openSession(localSession.id, localSession.sessionId), children: localSession === void 0 ? "\u5F00\u59CB\u5BF9\u8BDD" : localSession.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
6058
6213
  ] }),
6059
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: localSession ? `\u6700\u8FD1\u6D3B\u52A8\u4E8E ${relativeTime(localSession.lastMessageAt)}\uFF1B\u53E6\u6709 ${sessions2.filter((item) => item.kind === "channel").length} \u4E2A\u6E20\u9053\u4F1A\u8BDD\u3002` : "\u4F19\u4F34\u4F1A\u8BDD\u6B63\u5728\u521D\u59CB\u5316\uFF0C\u7A0D\u540E\u5373\u53EF\u6253\u5F00\u3002" })
6214
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: localSession ? `\u6700\u8FD1\u6D3B\u52A8\u4E8E ${relativeTime(localSession.lastMessageAt)}\uFF1B\u53E6\u6709 ${sessions2.filter((item) => item.kind === "channel").length} \u4E2A\u6E20\u9053\u4F1A\u8BDD\u3002` : "\u4F19\u4F34\u4F1A\u8BDD\u6B63\u5728\u521D\u59CB\u5316\uFF0C\u7A0D\u540E\u5373\u53EF\u6253\u5F00\u3002" })
6060
6215
  ] })
6061
6216
  ] })
6062
6217
  ] });
6063
6218
  }
6064
6219
  function IdentityEditor({ companion, count, onChanged }) {
6065
- const [form, setForm] = (0, import_react18.useState)(() => companionDraft(companion));
6066
- const [saving, setSaving] = (0, import_react18.useState)(false);
6067
- const [saved, setSaved] = (0, import_react18.useState)(false);
6068
- const [error, setError] = (0, import_react18.useState)();
6069
- const [confirmingRemove, setConfirmingRemove] = (0, import_react18.useState)(false);
6070
- (0, import_react18.useEffect)(() => {
6220
+ const [form, setForm] = (0, import_react19.useState)(() => companionDraft(companion));
6221
+ const [saving, setSaving] = (0, import_react19.useState)(false);
6222
+ const [saved, setSaved] = (0, import_react19.useState)(false);
6223
+ const [error, setError] = (0, import_react19.useState)();
6224
+ const [confirmingRemove, setConfirmingRemove] = (0, import_react19.useState)(false);
6225
+ (0, import_react19.useEffect)(() => {
6071
6226
  setForm(companionDraft(companion));
6072
6227
  setSaved(false);
6073
6228
  }, [companion.id, companion.updatedAt]);
@@ -6093,150 +6248,45 @@ function IdentityEditor({ companion, count, onChanged }) {
6093
6248
  setError(errorMessage(reason));
6094
6249
  }
6095
6250
  };
6096
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("form", { className: "dsh-partner-form is-identity", onSubmit: (event) => {
6251
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("form", { className: "dsh-partner-form is-identity", onSubmit: (event) => {
6097
6252
  void submit(event);
6098
6253
  }, children: [
6099
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SectionHeading, { eyebrow: "IDENTITY", title: "\u5DE5\u4F5C\u8EAB\u4EFD", detail: "\u5B83\u4E0D\u662F\u4E00\u6B21\u5BF9\u8BDD\u7684\u63D0\u793A\u8BCD\uFF0C\u800C\u662F\u8FD9\u4E2A\u4F19\u4F34\u5728\u684C\u9762\u548C\u5FAE\u4FE1\u4E2D\u7684\u957F\u671F\u884C\u4E3A\u57FA\u7EBF\u3002" }),
6100
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-fields two", children: [
6101
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
6102
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
6254
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SectionHeading, { eyebrow: "IDENTITY", title: "\u5DE5\u4F5C\u8EAB\u4EFD", detail: "\u5B83\u4E0D\u662F\u4E00\u6B21\u5BF9\u8BDD\u7684\u63D0\u793A\u8BCD\uFF0C\u800C\u662F\u8FD9\u4E2A\u4F19\u4F34\u5728\u684C\u9762\u548C\u5FAE\u4FE1\u4E2D\u7684\u957F\u671F\u884C\u4E3A\u57FA\u7EBF\u3002" }),
6255
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-fields two", children: [
6256
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
6257
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
6103
6258
  ] }),
6104
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D", hint: "\u7528\u4E8E\u540D\u518C\u8BC6\u522B\uFF0C\u4E0D\u4F1A\u66FF\u4EE3\u5B8C\u6574\u884C\u4E3A\u51C6\u5219\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("textarea", { rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
6105
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u957F\u671F\u884C\u4E3A\u51C6\u5219", hint: "\u5EFA\u8BAE\u5199\u804C\u8D23\u3001\u8868\u8FBE\u65B9\u5F0F\u4E0E\u8FB9\u754C\uFF1B\u6E20\u9053\u3001\u5DE5\u5177\u548C\u6388\u6743\u7531\u7CFB\u7EDF\u5355\u72EC\u63A7\u5236\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("textarea", { rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
6106
- error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
6107
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-form-actions", children: [
6108
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: saved && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
6109
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconCheckOutline14, { size: 14 }),
6110
- "\u5DF2\u4FDD\u5B58\uFF0C\u540E\u7EED\u5FAE\u4FE1\u6D88\u606F\u5C06\u4F7F\u7528\u65B0\u8EAB\u4EFD"
6259
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D", hint: "\u7528\u4E8E\u540D\u518C\u8BC6\u522B\uFF0C\u4E0D\u4F1A\u66FF\u4EE3\u5B8C\u6574\u884C\u4E3A\u51C6\u5219\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("textarea", { rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
6260
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u957F\u671F\u884C\u4E3A\u51C6\u5219", hint: "\u5EFA\u8BAE\u5199\u804C\u8D23\u3001\u8868\u8FBE\u65B9\u5F0F\u4E0E\u8FB9\u754C\uFF1B\u6E20\u9053\u3001\u5DE5\u5177\u548C\u6388\u6743\u7531\u7CFB\u7EDF\u5355\u72EC\u63A7\u5236\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("textarea", { rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
6261
+ error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
6262
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-form-actions", children: [
6263
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: saved && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
6264
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconCheckOutline14, { size: 14 }),
6265
+ "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u5C06\u4F7F\u7528\u65B0\u8EAB\u4EFD"
6111
6266
  ] }) }),
6112
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { disabled: saving, children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
6267
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { disabled: saving, children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
6113
6268
  ] }),
6114
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-identity-danger", "data-confirming": confirmingRemove, children: [
6115
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6116
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: confirmingRemove ? `\u786E\u8BA4\u5220\u9664\u300C${companion.name}\u300D\uFF1F` : "\u5220\u9664\u4F19\u4F34" }),
6117
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: confirmingRemove ? "\u8BE5\u4F19\u4F34\u7684\u672C\u5730\u914D\u7F6E\u4F1A\u88AB\u79FB\u9664\uFF1B\u5DF2\u6709\u6E20\u9053\u5FC5\u987B\u5148\u89E3\u7ED1\u3002" : "\u5FC5\u987B\u5148\u79FB\u9664\u5DF2\u7ED1\u5B9A\u5FAE\u4FE1\u6E20\u9053\uFF1B\u4E0D\u4F1A\u81EA\u52A8\u628A\u8054\u7CFB\u4EBA\u8F6C\u4EA4\u7ED9\u5176\u4ED6\u4F19\u4F34\u3002" })
6269
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-identity-danger", "data-confirming": confirmingRemove, children: [
6270
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6271
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: confirmingRemove ? `\u786E\u8BA4\u5220\u9664\u300C${companion.name}\u300D\uFF1F` : "\u5220\u9664\u4F19\u4F34" }),
6272
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: confirmingRemove ? "\u8BE5\u4F19\u4F34\u7684\u672C\u5730\u914D\u7F6E\u4F1A\u88AB\u79FB\u9664\uFF1B\u5DF2\u6709\u6E20\u9053\u5FC5\u987B\u5148\u89E3\u7ED1\u3002" : "\u5FC5\u987B\u5148\u79FB\u9664\u5DF2\u7ED1\u5B9A\u5FAE\u4FE1\u6E20\u9053\uFF1B\u4E0D\u4F1A\u81EA\u52A8\u628A\u8054\u7CFB\u4EBA\u8F6C\u4EA4\u7ED9\u5176\u4ED6\u4F19\u4F34\u3002" })
6118
6273
  ] }),
6119
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
6120
- confirmingRemove && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "is-secondary", onClick: () => setConfirmingRemove(false), children: "\u53D6\u6D88" }),
6121
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: confirmingRemove ? "is-danger" : "", disabled: count <= 1, onClick: () => confirmingRemove ? void remove() : setConfirmingRemove(true), children: [
6122
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconTrashOutline16, { size: 16 }),
6274
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6275
+ confirmingRemove && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "is-secondary", onClick: () => setConfirmingRemove(false), children: "\u53D6\u6D88" }),
6276
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: confirmingRemove ? "is-danger" : "", disabled: count <= 1, onClick: () => confirmingRemove ? void remove() : setConfirmingRemove(true), children: [
6277
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconTrashOutline16, { size: 16 }),
6123
6278
  confirmingRemove ? "\u786E\u8BA4\u5220\u9664" : "\u5220\u9664"
6124
6279
  ] })
6125
6280
  ] })
6126
6281
  ] })
6127
6282
  ] });
6128
6283
  }
6129
- function CapabilityEditor({ companion, presets, onChanged }) {
6130
- const [form, setForm] = (0, import_react18.useState)(() => companionDraft(companion));
6131
- const [modelCatalog, setModelCatalog] = (0, import_react18.useState)();
6132
- const [saving, setSaving] = (0, import_react18.useState)(false);
6133
- const [error, setError] = (0, import_react18.useState)();
6134
- (0, import_react18.useEffect)(() => setForm(companionDraft(companion)), [companion.id, companion.updatedAt]);
6135
- (0, import_react18.useEffect)(() => {
6136
- void api("/models").then(setModelCatalog).catch((reason) => setError(errorMessage(reason)));
6137
- }, []);
6138
- const toggle = (capability) => setForm((current2) => ({ ...current2, capabilities: current2.capabilities.includes(capability) ? current2.capabilities.filter((item) => item !== capability) : [...current2.capabilities, capability] }));
6139
- const save = async () => {
6140
- setSaving(true);
6141
- setError(void 0);
6142
- try {
6143
- await api(`/companions/${companion.id}`, { method: "PUT", body: JSON.stringify({ companion: form }) });
6144
- await onChanged();
6145
- } catch (reason) {
6146
- setError(errorMessage(reason));
6147
- } finally {
6148
- setSaving(false);
6149
- }
6150
- };
6151
- const groups = [
6152
- { id: "tools", eyebrow: "TOOLS", title: "\u5DE5\u4F5C\u5DE5\u5177", detail: "\u8FDE\u63A5\u5F53\u524D\u4F19\u4F34\u80FD\u591F\u4F7F\u7528\u7684\u4E13\u4E1A\u5DE5\u5177\u3002", choices: [
6153
- { id: "knowledge", title: "\u77E5\u8BC6\u5E93", detail: "\u5728\u5DF2\u6302\u8F7D\u8303\u56F4\u5185\u68C0\u7D22\u4E0E\u56DE\u5199\u77E5\u8BC6\u3002" },
6154
- { id: "skills", title: "Skill", detail: "\u4F7F\u7528\u5355\u72EC\u542F\u7528\u7684 Skill \u4E0E\u5DE5\u4F5C\u6D41\u7A0B\u3002" },
6155
- { id: "ssh", title: "SSH", detail: "\u5728 SSH \u63D2\u4EF6\u6388\u6743\u8FB9\u754C\u5185\u64CD\u4F5C\u4E3B\u673A\u3002" },
6156
- { id: "git", title: "Git", detail: "\u9884\u7559 Git \u80FD\u529B\uFF0C\u9700\u5BF9\u5E94\u63D2\u4EF6\u5B9E\u9645\u5B89\u88C5\u3002" }
6157
- ] },
6158
- { id: "coordination", eyebrow: "COORDINATION", title: "\u534F\u4F5C\u4E0E\u81EA\u52A8\u5316", detail: "\u63A7\u5236\u4F19\u4F34\u5EFA\u7ACB\u5173\u7CFB\u548C\u81EA\u4E3B\u5B89\u6392\u5DE5\u4F5C\u7684\u6743\u9650\u3002", choices: [
6159
- { id: "companions", title: "\u521B\u5EFA\u4F19\u4F34", detail: "\u6309\u660E\u786E\u9700\u6C42\u521B\u5EFA\u9ED8\u8BA4\u65E0\u6743\u9650\u7684\u65B0\u4F19\u4F34\u3002" },
6160
- { id: "access", title: "\u4F19\u4F34\u6388\u6743", detail: "\u6309\u660E\u786E\u8981\u6C42\u914D\u7F6E\u4F19\u4F34\u4E4B\u95F4\u7684\u5355\u5411\u8BBF\u95EE\u5173\u7CFB\u3002" },
6161
- { id: "schedules", title: "\u5B9A\u65F6\u4EFB\u52A1", detail: "\u521B\u5EFA\u5E76\u7BA1\u7406\u7531\u81EA\u5DF1\u6267\u884C\u7684\u5468\u671F\u4EFB\u52A1\u3002" }
6162
- ] },
6163
- { id: "administration", eyebrow: "ADMINISTRATION", title: "\u9AD8\u6743\u9650\u7BA1\u7406", detail: "\u4EC5\u6388\u4E88\u53EF\u4FE1\u7684\u7BA1\u7406\u4F19\u4F34\uFF1B\u666E\u901A\u534F\u4F5C\u6388\u6743\u4E0D\u5305\u542B\u4FEE\u6539\u6743\u9650\u3002", choices: [
6164
- { id: "administration", title: CAPABILITY_LABELS.administration, detail: "\u4FEE\u6539\u5176\u4ED6\u4F19\u4F34\u7684\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E Preset\u3001\u534F\u4F5C\u3001Skill \u548C\u77E5\u8BC6\u5E93\u6302\u8F7D\u3002\u4E0D\u5171\u4EAB\u4F1A\u8BDD\u3001\u8BB0\u5FC6\u6216\u51ED\u636E\uFF1B\u4E0D\u80FD\u81EA\u6539\u6216\u8F6C\u6388\u672C\u6743\u9650\u3002" }
6165
- ] }
6166
- ];
6167
- const selectedProvider = form.provider || modelCatalog?.defaultSelection.provider || "";
6168
- const modelOptions = modelCatalog?.providers.find((item) => item.id === selectedProvider)?.models ?? [];
6169
- const currentModelMissing = Boolean(form.model) && !modelOptions.some((item) => item.id === form.model);
6170
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-form is-capabilities", children: [
6171
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SectionHeading, { eyebrow: "COMPOSITION", title: "\u80FD\u529B\u7EC4\u5408", detail: "\u4F19\u4F34\u58F0\u660E\u610F\u56FE\u8303\u56F4\uFF1B\u771F\u6B63\u53EF\u8C03\u7528\u7684\u5DE5\u5177\u4ECD\u6765\u81EA\u6240\u9009 Agent Preset\uFF0C\u5E76\u7EE7\u7EED\u6267\u884C\u5404\u63D2\u4EF6\u6743\u9650\u3002" }),
6172
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-runtime-fields", children: [
6173
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "Agent Preset", hint: "\u5DE5\u5177\u3001Skill \u4E0E\u7CFB\u7EDF\u63D0\u793A", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { value: form.presetId, onChange: (event) => setForm({ ...form, presetId: event.target.value }), children: [
6174
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "", children: "\u8DDF\u968F DSH \u9ED8\u8BA4 Preset" }),
6175
- presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: item.id, children: item.name }, item.id))
6176
- ] }) }),
6177
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u6A21\u578B\u63D0\u4F9B\u65B9", hint: "\u6765\u81EA\u5F53\u524D\u5BA2\u6237\u7AEF", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { value: form.provider, onChange: (event) => setForm({ ...form, provider: event.target.value, model: "" }), children: [
6178
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: "", children: [
6179
- "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
6180
- modelCatalog?.defaultSelection.provider || "\u6B63\u5728\u8BFB\u53D6"
6181
- ] }),
6182
- modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
6183
- ] }) }),
6184
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u6A21\u578B", hint: "\u968F\u63D0\u4F9B\u65B9\u8054\u52A8", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { value: form.model, onChange: (event) => setForm({ ...form, model: event.target.value }), children: [
6185
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: "", children: [
6186
- "\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
6187
- modelCatalog?.defaultSelection.model || "\u6B63\u5728\u8BFB\u53D6"
6188
- ] }),
6189
- currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: form.model, children: [
6190
- "\u5F53\u524D\u914D\u7F6E \xB7 ",
6191
- form.model
6192
- ] }),
6193
- modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
6194
- ] }) })
6195
- ] }),
6196
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-capability-groups", children: groups.map((group) => {
6197
- const enabled = group.choices.filter((choice) => form.capabilities.includes(choice.id)).length;
6198
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-capability-group", "aria-labelledby": `partner-capability-${group.id}`, children: [
6199
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
6200
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6201
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: group.eyebrow }),
6202
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { id: `partner-capability-${group.id}`, children: group.title }),
6203
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: group.detail })
6204
- ] }),
6205
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("em", { children: [
6206
- enabled,
6207
- " / ",
6208
- group.choices.length,
6209
- " \u5DF2\u542F\u7528"
6210
- ] })
6211
- ] }),
6212
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-capabilities", children: group.choices.map((choice) => {
6213
- const active = form.capabilities.includes(choice.id);
6214
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: active ? "is-active" : "", "aria-pressed": active, onClick: () => toggle(choice.id), children: [
6215
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: active && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconCheckOutline14, { size: 14 }) }),
6216
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: choice.title }),
6217
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: choice.detail })
6218
- ] }, choice.id);
6219
- }) })
6220
- ] }, group.id);
6221
- }) }),
6222
- form.capabilities.includes("skills") && companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CompanionSkillSettings, { companionId: companion.id }),
6223
- form.capabilities.includes("skills") && !companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-note", children: "\u5148\u5E94\u7528\u80FD\u529B\u7EC4\u5408\uFF0C\u518D\u4E3A\u5F53\u524D\u4F19\u4F34\u9009\u62E9\u5177\u4F53 Skill\u3002" }),
6224
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CompanionAccessPanel, { companionId: companion.id }),
6225
- error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
6226
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-form-actions", children: [
6227
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", {}),
6228
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: saving, onClick: () => {
6229
- void save();
6230
- }, children: saving ? "\u6B63\u5728\u5E94\u7528\u2026" : "\u5E94\u7528\u80FD\u529B\u7EC4\u5408" })
6231
- ] })
6232
- ] });
6233
- }
6234
6284
  function WeixinPanel({ companion, snapshot, onChanged }) {
6235
6285
  const channel = snapshot.channels.find((item) => item.companionId === companion.id);
6236
- const [login, setLogin] = (0, import_react18.useState)();
6237
- const [busy, setBusy] = (0, import_react18.useState)(false);
6238
- const [error, setError] = (0, import_react18.useState)();
6239
- (0, import_react18.useEffect)(() => {
6286
+ const [login, setLogin] = (0, import_react19.useState)();
6287
+ const [busy, setBusy] = (0, import_react19.useState)(false);
6288
+ const [error, setError] = (0, import_react19.useState)();
6289
+ (0, import_react19.useEffect)(() => {
6240
6290
  if (!login || login.phase === "confirmed" || login.phase === "expired" || login.phase === "error") return;
6241
6291
  const timer = window.setInterval(() => {
6242
6292
  void api(`/weixin/login/${login.id}`).then(async (result) => {
@@ -6282,93 +6332,93 @@ function WeixinPanel({ companion, snapshot, onChanged }) {
6282
6332
  setError(errorMessage(reason));
6283
6333
  }
6284
6334
  };
6285
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
6286
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SectionHeading, { eyebrow: "PRIMARY CHANNEL", title: "\u5FAE\u4FE1\u6E20\u9053", detail: "\u4F7F\u7528\u5FAE\u4FE1 iLink Bot \u626B\u7801\u63A5\u5165\u3002\u6BCF\u4E2A\u673A\u5668\u4EBA\u53EA\u7ED1\u5B9A\u4E00\u4E2A\u4F19\u4F34\uFF0C\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u4FDD\u6301\u72EC\u7ACB DSH \u4F1A\u8BDD\u3002" }),
6287
- !channel && !login && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
6288
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WeixinGlyph, { large: true }) }),
6289
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6290
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
6335
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
6336
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SectionHeading, { eyebrow: "PRIMARY CHANNEL", title: "\u5FAE\u4FE1\u6E20\u9053", detail: "\u4F7F\u7528\u5FAE\u4FE1 iLink Bot \u626B\u7801\u63A5\u5165\u3002\u6BCF\u4E2A\u673A\u5668\u4EBA\u53EA\u7ED1\u5B9A\u4E00\u4E2A\u4F19\u4F34\uFF0C\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u4FDD\u6301\u72EC\u7ACB DSH \u4F1A\u8BDD\u3002" }),
6337
+ !channel && !login && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
6338
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WeixinGlyph, { large: true }) }),
6339
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6340
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
6291
6341
  "\u628A ",
6292
6342
  companion.name,
6293
6343
  " \u5E26\u5230\u5FAE\u4FE1"
6294
6344
  ] }),
6295
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: "\u626B\u7801\u540E\uFF0C\u673A\u5668\u4EBA\u51ED\u636E\u76F4\u63A5\u4FDD\u5B58\u8FDB DSH \u51ED\u636E\u5E93\uFF0C\u4E0D\u4F1A\u663E\u793A\u5728\u6D4F\u89C8\u5668\u6216\u666E\u901A\u914D\u7F6E\u6587\u4EF6\u4E2D\u3002" }),
6296
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("ul", { children: [
6297
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
6298
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
6299
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
6345
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: "\u626B\u7801\u540E\uFF0C\u673A\u5668\u4EBA\u51ED\u636E\u76F4\u63A5\u4FDD\u5B58\u8FDB DSH \u51ED\u636E\u5E93\uFF0C\u4E0D\u4F1A\u663E\u793A\u5728\u6D4F\u89C8\u5668\u6216\u666E\u901A\u914D\u7F6E\u6587\u4EF6\u4E2D\u3002" }),
6346
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("ul", { children: [
6347
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
6348
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
6349
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
6300
6350
  ] })
6301
6351
  ] }),
6302
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy, onClick: () => {
6352
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy, onClick: () => {
6303
6353
  void begin();
6304
6354
  }, children: busy ? "\u6B63\u5728\u7533\u8BF7\u4E8C\u7EF4\u7801\u2026" : "\u626B\u7801\u8FDE\u63A5\u5FAE\u4FE1" })
6305
6355
  ] }),
6306
- login && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
6307
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
6308
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6309
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "WECHAT ILINK BOT" }),
6310
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: login.phase === "scanned" ? "\u5DF2\u626B\u7801\uFF0C\u8BF7\u5728\u5FAE\u4FE1\u786E\u8BA4" : login.phase === "expired" ? "\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F" : login.phase === "error" ? "\u8FDE\u63A5\u5931\u8D25" : "\u4F7F\u7528\u5FAE\u4FE1\u626B\u7801" }),
6311
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: login.error || (login.phase === "scanned" ? "\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u542F\u52A8\u6E20\u9053\uFF0C\u4E0D\u9700\u8981\u590D\u5236 Token\u3002" : "\u4E8C\u7EF4\u7801\u7EA6 5 \u5206\u949F\u6709\u6548\u3002\u6B64\u9875\u9762\u53EF\u4EE5\u5B89\u5168\u5730\u4FDD\u6301\u6253\u5F00\u3002") }),
6312
- (login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", onClick: () => {
6356
+ login && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
6357
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
6358
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6359
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "WECHAT ILINK BOT" }),
6360
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: login.phase === "scanned" ? "\u5DF2\u626B\u7801\uFF0C\u8BF7\u5728\u5FAE\u4FE1\u786E\u8BA4" : login.phase === "expired" ? "\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F" : login.phase === "error" ? "\u8FDE\u63A5\u5931\u8D25" : "\u4F7F\u7528\u5FAE\u4FE1\u626B\u7801" }),
6361
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: login.error || (login.phase === "scanned" ? "\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u542F\u52A8\u6E20\u9053\uFF0C\u4E0D\u9700\u8981\u590D\u5236 Token\u3002" : "\u4E8C\u7EF4\u7801\u7EA6 5 \u5206\u949F\u6709\u6548\u3002\u6B64\u9875\u9762\u53EF\u4EE5\u5B89\u5168\u5730\u4FDD\u6301\u6253\u5F00\u3002") }),
6362
+ (login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", onClick: () => {
6313
6363
  setLogin(void 0);
6314
6364
  void begin();
6315
6365
  }, children: [
6316
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconRefreshOutline16, { size: 16 }),
6366
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconRefreshOutline16, { size: 16 }),
6317
6367
  "\u91CD\u65B0\u751F\u6210"
6318
6368
  ] })
6319
6369
  ] })
6320
6370
  ] }),
6321
- channel && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
6322
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
6323
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WeixinGlyph, { large: true }) }),
6324
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6325
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "WECHAT CHANNEL" }),
6326
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: channel.name }),
6327
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: channel.accountId })
6371
+ channel && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
6372
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
6373
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WeixinGlyph, { large: true }) }),
6374
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6375
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "WECHAT CHANNEL" }),
6376
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: channel.name }),
6377
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: channel.accountId })
6328
6378
  ] }),
6329
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ChannelStatus, { channel }),
6330
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": channel.enabled, disabled: busy, "aria-label": channel.enabled ? "\u505C\u7528\u5FAE\u4FE1\u6E20\u9053" : "\u542F\u7528\u5FAE\u4FE1\u6E20\u9053", onClick: () => {
6379
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ChannelStatus, { channel }),
6380
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": channel.enabled, disabled: busy, "aria-label": channel.enabled ? "\u505C\u7528\u5FAE\u4FE1\u6E20\u9053" : "\u542F\u7528\u5FAE\u4FE1\u6E20\u9053", onClick: () => {
6331
6381
  void toggle();
6332
- }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}) })
6382
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}) })
6333
6383
  ] }),
6334
- channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-error", children: channel.lastError }),
6335
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
6336
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6337
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "ACCESS" }),
6338
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
6384
+ channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "dsh-partner-inline-error", children: channel.lastError }),
6385
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
6386
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6387
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "ACCESS" }),
6388
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
6339
6389
  ] }),
6340
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("em", { children: [
6390
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("em", { children: [
6341
6391
  pairings.filter((item) => item.status === "pending").length,
6342
6392
  " \u4E2A\u5F85\u5904\u7406"
6343
6393
  ] })
6344
6394
  ] }),
6345
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u8054\u7CFB\u4EBA", detail: "\u6709\u4EBA\u9996\u6B21\u5411\u673A\u5668\u4EBA\u53D1\u6D88\u606F\u540E\uFF0C\u914D\u5BF9\u8BF7\u6C42\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002", compact: true }) : pairings.map((pairing) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { children: [
6346
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconUserOutline16, { size: 16 }) }),
6347
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
6348
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: pairing.displayName }),
6349
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
6395
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u8054\u7CFB\u4EBA", detail: "\u6709\u4EBA\u9996\u6B21\u5411\u673A\u5668\u4EBA\u53D1\u6D88\u606F\u540E\uFF0C\u914D\u5BF9\u8BF7\u6C42\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002", compact: true }) : pairings.map((pairing) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { children: [
6396
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconUserOutline16, { size: 16 }) }),
6397
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6398
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: pairing.displayName }),
6399
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
6350
6400
  pairing.status === "pending" ? "\u7B49\u5F85\u5BA1\u6279" : pairing.status === "approved" ? "\u5DF2\u6388\u6743\u72EC\u7ACB\u4F1A\u8BDD" : "\u5DF2\u963B\u6B62",
6351
6401
  " \xB7 ",
6352
6402
  new Date(pairing.updatedAt).toLocaleString()
6353
6403
  ] })
6354
6404
  ] }),
6355
- pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
6356
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { onClick: () => {
6405
+ pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
6406
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { onClick: () => {
6357
6407
  void actPairing(pairing.id, "blocked");
6358
6408
  }, children: "\u62D2\u7EDD" }),
6359
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { className: "is-primary", onClick: () => {
6409
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { className: "is-primary", onClick: () => {
6360
6410
  void actPairing(pairing.id, "approved");
6361
6411
  }, children: "\u6279\u51C6" })
6362
6412
  ] }),
6363
- pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { onClick: () => {
6413
+ pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { onClick: () => {
6364
6414
  void actPairing(pairing.id, "blocked");
6365
6415
  }, children: "\u64A4\u9500" }),
6366
- pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { onClick: () => {
6416
+ pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { onClick: () => {
6367
6417
  void actPairing(pairing.id, "approved");
6368
6418
  }, children: "\u91CD\u65B0\u6279\u51C6" })
6369
6419
  ] }, pairing.id)) })
6370
6420
  ] }),
6371
- error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-error", children: error })
6421
+ error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "dsh-partner-inline-error", children: error })
6372
6422
  ] });
6373
6423
  }
6374
6424
  function MemoryPanel({ companion, snapshot, openSession, startSession, renewSession, onChanged }) {
@@ -6376,19 +6426,19 @@ function MemoryPanel({ companion, snapshot, openSession, startSession, renewSess
6376
6426
  const localSession = sessions2.find((item) => item.kind === "local");
6377
6427
  const channelSessionCount = sessions2.filter((item) => item.kind === "channel").length;
6378
6428
  const heartbeat = snapshot.heartbeatStates.find((item) => item.companionId === companion.id);
6379
- const [automation, setAutomation] = (0, import_react18.useState)(() => structuredClone(companion.automation));
6380
- const [memories, setMemories] = (0, import_react18.useState)([]);
6381
- const [reflections, setReflections] = (0, import_react18.useState)([]);
6382
- const [profiles, setProfiles] = (0, import_react18.useState)([]);
6383
- const [concernActivity, setConcernActivity] = (0, import_react18.useState)({ concerns: [], observations: [] });
6384
- const [newConcern, setNewConcern] = (0, import_react18.useState)("");
6385
- const [memoryRevision, setMemoryRevision] = (0, import_react18.useState)(0);
6386
- const [editing, setEditing] = (0, import_react18.useState)();
6387
- const [busy, setBusy] = (0, import_react18.useState)(false);
6388
- const [notice, setNotice] = (0, import_react18.useState)();
6389
- const [error, setError] = (0, import_react18.useState)();
6390
- const [modelCatalog, setModelCatalog] = (0, import_react18.useState)();
6391
- const loadMemory = (0, import_react18.useCallback)(async () => {
6429
+ const [automation, setAutomation] = (0, import_react19.useState)(() => structuredClone(companion.automation));
6430
+ const [memories, setMemories] = (0, import_react19.useState)([]);
6431
+ const [reflections, setReflections] = (0, import_react19.useState)([]);
6432
+ const [profiles, setProfiles] = (0, import_react19.useState)([]);
6433
+ const [concernActivity, setConcernActivity] = (0, import_react19.useState)({ concerns: [], observations: [] });
6434
+ const [newConcern, setNewConcern] = (0, import_react19.useState)("");
6435
+ const [memoryRevision, setMemoryRevision] = (0, import_react19.useState)(0);
6436
+ const [editing, setEditing] = (0, import_react19.useState)();
6437
+ const [busy, setBusy] = (0, import_react19.useState)(false);
6438
+ const [notice, setNotice] = (0, import_react19.useState)();
6439
+ const [error, setError] = (0, import_react19.useState)();
6440
+ const [modelCatalog, setModelCatalog] = (0, import_react19.useState)();
6441
+ const loadMemory = (0, import_react19.useCallback)(async () => {
6392
6442
  const [result, activity] = await Promise.all([api(`/companions/${companion.id}/memory`), api(`/companions/${companion.id}/concerns`)]);
6393
6443
  setMemories(result.memories);
6394
6444
  setReflections(result.reflections);
@@ -6396,11 +6446,11 @@ function MemoryPanel({ companion, snapshot, openSession, startSession, renewSess
6396
6446
  setConcernActivity(activity);
6397
6447
  setMemoryRevision((value) => value + 1);
6398
6448
  }, [companion.id]);
6399
- (0, import_react18.useEffect)(() => {
6449
+ (0, import_react19.useEffect)(() => {
6400
6450
  setAutomation(structuredClone(companion.automation));
6401
6451
  void loadMemory().catch((reason) => setError(errorMessage(reason)));
6402
6452
  }, [companion.id, companion.updatedAt, loadMemory]);
6403
- (0, import_react18.useEffect)(() => {
6453
+ (0, import_react19.useEffect)(() => {
6404
6454
  void api("/models").then(setModelCatalog).catch((reason) => setError(errorMessage(reason)));
6405
6455
  }, []);
6406
6456
  const inheritedProvider = companion.provider || modelCatalog?.defaultSelection.provider || "";
@@ -6510,157 +6560,157 @@ function MemoryPanel({ companion, snapshot, openSession, startSession, renewSess
6510
6560
  setBusy(false);
6511
6561
  }
6512
6562
  };
6513
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-form is-memory", children: [
6514
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SectionHeading, { eyebrow: "CONTINUITY", title: "\u4F1A\u8BDD\u8BB0\u5FC6", detail: "\u4F19\u4F34\u53EF\u4EE5\u76F4\u63A5\u5728 DSH \u4E2D\u5EFA\u7ACB\u672C\u5730\u5BF9\u8BDD\uFF1B\u5FAE\u4FE1\u53EA\u662F\u53EF\u9009\u6E20\u9053\u3002\u4E0D\u540C\u8054\u7CFB\u4EBA\u4ECD\u4FDD\u6301\u72EC\u7ACB\u4E0A\u4E0B\u6587\uFF0C\u77E5\u8BC6\u5E93\u7EE7\u7EED\u7531\u77E5\u8BC6\u5E93\u63D2\u4EF6\u7BA1\u7406\u3002" }),
6515
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-metrics", children: [
6516
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { children: [
6517
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u4F19\u4F34\u4F1A\u8BDD" }),
6518
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: sessions2.length }),
6519
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: localSession ? `1 \u4E2A\u672C\u5730 \xB7 ${channelSessionCount} \u4E2A\u6E20\u9053` : `${channelSessionCount} \u4E2A\u6E20\u9053` })
6563
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-form is-memory", children: [
6564
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SectionHeading, { eyebrow: "CONTINUITY", title: "\u4F1A\u8BDD\u8BB0\u5FC6", detail: "\u4F19\u4F34\u53EF\u4EE5\u76F4\u63A5\u5728 DSH \u4E2D\u5EFA\u7ACB\u672C\u5730\u5BF9\u8BDD\uFF1B\u5FAE\u4FE1\u53EA\u662F\u53EF\u9009\u6E20\u9053\u3002\u4E0D\u540C\u8054\u7CFB\u4EBA\u4ECD\u4FDD\u6301\u72EC\u7ACB\u4E0A\u4E0B\u6587\uFF0C\u77E5\u8BC6\u5E93\u7EE7\u7EED\u7531\u77E5\u8BC6\u5E93\u63D2\u4EF6\u7BA1\u7406\u3002" }),
6565
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-metrics", children: [
6566
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { children: [
6567
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u4F19\u4F34\u4F1A\u8BDD" }),
6568
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: sessions2.length }),
6569
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: localSession ? `1 \u4E2A\u672C\u5730 \xB7 ${channelSessionCount} \u4E2A\u6E20\u9053` : `${channelSessionCount} \u4E2A\u6E20\u9053` })
6520
6570
  ] }),
6521
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { children: [
6522
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u957F\u671F\u8BB0\u5FC6" }),
6523
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: memories.filter((item) => item.status === "active").length }),
6524
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
6571
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { children: [
6572
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u957F\u671F\u8BB0\u5FC6" }),
6573
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: memories.filter((item) => item.status === "active").length }),
6574
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { children: [
6525
6575
  reflections.length,
6526
6576
  " \u7BC7\u6BCF\u65E5\u56DE\u987E"
6527
6577
  ] })
6528
6578
  ] }),
6529
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { children: [
6530
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u6700\u8FD1\u5FC3\u8DF3" }),
6531
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: heartbeat?.lastCheckedAt ? relativeTime(heartbeat.lastCheckedAt) : "\u5C1A\u672A" }),
6532
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: heartbeat?.lastError ? "\u4E0A\u6B21\u6267\u884C\u5F02\u5E38" : `\u4ECA\u65E5\u53D1\u9001 ${heartbeat?.sentCount ?? 0} \u6B21` })
6579
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { children: [
6580
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u6700\u8FD1\u5FC3\u8DF3" }),
6581
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: heartbeat?.lastCheckedAt ? relativeTime(heartbeat.lastCheckedAt) : "\u5C1A\u672A" }),
6582
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: heartbeat?.lastError ? "\u4E0A\u6B21\u6267\u884C\u5F02\u5E38" : `\u4ECA\u65E5\u53D1\u9001 ${heartbeat?.sentCount ?? 0} \u6B21` })
6533
6583
  ] })
6534
6584
  ] }),
6535
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-automation-grid", children: [
6536
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-automation", children: [
6537
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
6538
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6539
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u5B66\u4E60\u4E0E\u957F\u671F\u8BB0\u5FC6" }),
6540
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u6309\u8054\u7CFB\u4EBA\u5F52\u6863\u5B8C\u6574\u5BF9\u8BDD\uFF0C\u63D0\u70BC\u6BCF\u65E5\u56DE\u987E\u548C\u7ED3\u6784\u5316\u8BB0\u5FC6\uFF0C\u5E76\u5728\u76F8\u5173\u8BDD\u9898\u51FA\u73B0\u65F6\u53EC\u56DE\u3002" })
6585
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-automation-grid", children: [
6586
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "dsh-partner-automation", children: [
6587
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
6588
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6589
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u5B66\u4E60\u4E0E\u957F\u671F\u8BB0\u5FC6" }),
6590
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u6309\u8054\u7CFB\u4EBA\u5F52\u6863\u5B8C\u6574\u5BF9\u8BDD\uFF0C\u63D0\u70BC\u6BCF\u65E5\u56DE\u987E\u548C\u7ED3\u6784\u5316\u8BB0\u5FC6\uFF0C\u5E76\u5728\u76F8\u5173\u8BDD\u9898\u51FA\u73B0\u65F6\u53EC\u56DE\u3002" })
6541
6591
  ] }),
6542
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.memory.enabled, "aria-label": "\u542F\u7528\u4F19\u4F34\u5B66\u4E60", onClick: () => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, enabled: !current2.memory.enabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}) })
6592
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.memory.enabled, "aria-label": "\u542F\u7528\u4F19\u4F34\u5B66\u4E60", onClick: () => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, enabled: !current2.memory.enabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}) })
6543
6593
  ] }),
6544
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-automation-fields is-memory-model", children: [
6545
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u4FDD\u7559\u671F\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { value: automation.memory.retentionDays, onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, retentionDays: Number(event.target.value) } })), children: [
6546
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 0, children: "\u6C38\u4E45\u4FDD\u7559" }),
6547
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 30, children: "30 \u5929" }),
6548
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 90, children: "90 \u5929" }),
6549
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 180, children: "180 \u5929" }),
6550
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 365, children: "1 \u5E74" }),
6551
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 1095, children: "3 \u5E74" })
6594
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-automation-fields is-memory-model", children: [
6595
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u4FDD\u7559\u671F\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { value: automation.memory.retentionDays, onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, retentionDays: Number(event.target.value) } })), children: [
6596
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 0, children: "\u6C38\u4E45\u4FDD\u7559" }),
6597
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 30, children: "30 \u5929" }),
6598
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 90, children: "90 \u5929" }),
6599
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 180, children: "180 \u5929" }),
6600
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 365, children: "1 \u5E74" }),
6601
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 1095, children: "3 \u5E74" })
6552
6602
  ] }) }),
6553
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u63D0\u70BC Provider", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { value: automation.memory.provider ?? "", onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, provider: event.target.value, model: "" } })), children: [
6554
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: "", children: [
6603
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u63D0\u70BC Provider", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { value: automation.memory.provider ?? "", onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, provider: event.target.value, model: "" } })), children: [
6604
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: "", children: [
6555
6605
  "\u8DDF\u968F\u4F19\u4F34 \xB7 ",
6556
6606
  inheritedProvider || "DSH \u9ED8\u8BA4"
6557
6607
  ] }),
6558
- modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
6608
+ modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
6559
6609
  ] }) }),
6560
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u63D0\u70BC\u6A21\u578B", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { value: automation.memory.model ?? "", onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, model: event.target.value } })), children: [
6561
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: "", children: [
6610
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u63D0\u70BC\u6A21\u578B", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { value: automation.memory.model ?? "", onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, model: event.target.value } })), children: [
6611
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: "", children: [
6562
6612
  "\u8DDF\u968F\u4F19\u4F34 \xB7 ",
6563
6613
  companion.model || modelCatalog?.defaultSelection.model || "DSH \u9ED8\u8BA4"
6564
6614
  ] }),
6565
- modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
6615
+ modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
6566
6616
  ] }) })
6567
6617
  ] }),
6568
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-review-policy", children: [
6569
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.memory.dailyReviewEnabled, "aria-label": "\u542F\u7528\u6BCF\u65E5\u7EC8\u5BA1", onClick: () => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, dailyReviewEnabled: !current2.memory.dailyReviewEnabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}) }),
6570
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6571
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u6BCF\u65E5\u7EC8\u5BA1" }),
6572
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u6B21\u65E5\u81EA\u52A8\u5408\u5E76\u91CD\u590D\u3001\u7EA0\u6B63\u504F\u5DEE\u5E76\u5EFA\u7ACB\u8BB0\u5FC6\u5173\u7CFB" })
6618
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-review-policy", children: [
6619
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.memory.dailyReviewEnabled, "aria-label": "\u542F\u7528\u6BCF\u65E5\u7EC8\u5BA1", onClick: () => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, dailyReviewEnabled: !current2.memory.dailyReviewEnabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}) }),
6620
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6621
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u6BCF\u65E5\u7EC8\u5BA1" }),
6622
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u6B21\u65E5\u81EA\u52A8\u5408\u5E76\u91CD\u590D\u3001\u7EA0\u6B63\u504F\u5DEE\u5E76\u5EFA\u7ACB\u8BB0\u5FC6\u5173\u7CFB" })
6573
6623
  ] }),
6574
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("select", { "aria-label": "\u6BCF\u65E5\u7EC8\u5BA1\u65F6\u95F4", value: automation.memory.dailyReviewHour, onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, dailyReviewHour: Number(event.target.value) } })), children: Array.from({ length: 24 }, (_, hour) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("option", { value: hour, children: [
6624
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("label", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("select", { "aria-label": "\u6BCF\u65E5\u7EC8\u5BA1\u65F6\u95F4", value: automation.memory.dailyReviewHour, onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, dailyReviewHour: Number(event.target.value) } })), children: Array.from({ length: 24 }, (_, hour) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: hour, children: [
6575
6625
  String(hour).padStart(2, "0"),
6576
6626
  ":00"
6577
6627
  ] }, hour)) }) }),
6578
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy || reflections.length === 0, onClick: () => {
6628
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy || reflections.length === 0, onClick: () => {
6579
6629
  void review();
6580
6630
  }, children: "\u7ACB\u5373\u7EC8\u5BA1" })
6581
6631
  ] })
6582
6632
  ] }),
6583
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-automation", children: [
6584
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
6585
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6586
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u6301\u7EED\u611F\u77E5" }),
6587
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u4F19\u4F34\u53EA\u89C2\u5BDF\u5C1A\u672A\u95ED\u73AF\u7684\u4E8B\u60C5\u662F\u5426\u51FA\u73B0\u65B0\u53D8\u5316\uFF0C\u5E76\u7531\u514B\u5236\u7684\u6253\u6270\u7B56\u7565\u51B3\u5B9A\u4F55\u65F6\u544A\u8BC9\u4F60\u3002" })
6633
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "dsh-partner-automation", children: [
6634
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
6635
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6636
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u6301\u7EED\u611F\u77E5" }),
6637
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u4F19\u4F34\u53EA\u89C2\u5BDF\u5C1A\u672A\u95ED\u73AF\u7684\u4E8B\u60C5\u662F\u5426\u51FA\u73B0\u65B0\u53D8\u5316\uFF0C\u5E76\u7531\u514B\u5236\u7684\u6253\u6270\u7B56\u7565\u51B3\u5B9A\u4F55\u65F6\u544A\u8BC9\u4F60\u3002" })
6588
6638
  ] }),
6589
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.heartbeat.enabled, "aria-label": "\u542F\u7528\u4F19\u4F34\u5FC3\u8DF3", onClick: () => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, enabled: !current2.heartbeat.enabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}) })
6639
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.heartbeat.enabled, "aria-label": "\u542F\u7528\u4F19\u4F34\u5FC3\u8DF3", onClick: () => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, enabled: !current2.heartbeat.enabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}) })
6590
6640
  ] }),
6591
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-automation-fields is-heartbeat", children: [
6592
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u68C0\u67E5\u95F4\u9694", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { value: automation.heartbeat.intervalMinutes, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, intervalMinutes: Number(event.target.value) } })), children: [
6593
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 30, children: "30 \u5206\u949F" }),
6594
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 60, children: "1 \u5C0F\u65F6" }),
6595
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 180, children: "3 \u5C0F\u65F6" }),
6596
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 360, children: "6 \u5C0F\u65F6" }),
6597
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 720, children: "12 \u5C0F\u65F6" }),
6598
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 1440, children: "24 \u5C0F\u65F6" })
6641
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-automation-fields is-heartbeat", children: [
6642
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u68C0\u67E5\u95F4\u9694", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { value: automation.heartbeat.intervalMinutes, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, intervalMinutes: Number(event.target.value) } })), children: [
6643
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 30, children: "30 \u5206\u949F" }),
6644
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 60, children: "1 \u5C0F\u65F6" }),
6645
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 180, children: "3 \u5C0F\u65F6" }),
6646
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 360, children: "6 \u5C0F\u65F6" }),
6647
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 720, children: "12 \u5C0F\u65F6" }),
6648
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 1440, children: "24 \u5C0F\u65F6" })
6599
6649
  ] }) }),
6600
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u514D\u6253\u6270\u5F00\u59CB", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { type: "number", min: 0, max: 23, value: automation.heartbeat.quietStartHour, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, quietStartHour: Number(event.target.value) } })) }) }),
6601
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u514D\u6253\u6270\u7ED3\u675F", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { type: "number", min: 0, max: 23, value: automation.heartbeat.quietEndHour, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, quietEndHour: Number(event.target.value) } })) }) }),
6602
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "\u6BCF\u65E5\u4E0A\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { value: automation.heartbeat.dailyLimit, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, dailyLimit: Number(event.target.value) } })), children: [
6603
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 0, children: "\u4E0D\u9650" }),
6604
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 1, children: "1 \u6B21" }),
6605
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 2, children: "2 \u6B21" }),
6606
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 3, children: "3 \u6B21" }),
6607
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 5, children: "5 \u6B21" }),
6608
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: 8, children: "8 \u6B21" })
6650
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u514D\u6253\u6270\u5F00\u59CB", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { type: "number", min: 0, max: 23, value: automation.heartbeat.quietStartHour, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, quietStartHour: Number(event.target.value) } })) }) }),
6651
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u514D\u6253\u6270\u7ED3\u675F", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { type: "number", min: 0, max: 23, value: automation.heartbeat.quietEndHour, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, quietEndHour: Number(event.target.value) } })) }) }),
6652
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "\u6BCF\u65E5\u4E0A\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { value: automation.heartbeat.dailyLimit, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, dailyLimit: Number(event.target.value) } })), children: [
6653
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 0, children: "\u4E0D\u9650" }),
6654
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 1, children: "1 \u6B21" }),
6655
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 2, children: "2 \u6B21" }),
6656
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 3, children: "3 \u6B21" }),
6657
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 5, children: "5 \u6B21" }),
6658
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: 8, children: "8 \u6B21" })
6609
6659
  ] }) })
6610
6660
  ] }),
6611
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ConcernBoard, { companionId: companion.id, activity: concernActivity, value: newConcern, busy, onValue: setNewConcern, onAdd: () => {
6661
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ConcernBoard, { companionId: companion.id, activity: concernActivity, value: newConcern, busy, onValue: setNewConcern, onAdd: () => {
6612
6662
  void addConcern();
6613
6663
  }, onCheck: (item) => {
6614
6664
  void trigger(item.id);
6615
6665
  }, onAct: (item, action) => {
6616
6666
  void actConcern(item, action);
6617
6667
  } }),
6618
- heartbeat?.lastError && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-error", children: heartbeat.lastError }),
6619
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-automation-actions", children: [
6620
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy || sessions2.length === 0, onClick: () => {
6668
+ heartbeat?.lastError && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "dsh-partner-inline-error", children: heartbeat.lastError }),
6669
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-automation-actions", children: [
6670
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy || sessions2.length === 0, onClick: () => {
6621
6671
  void trigger();
6622
6672
  }, children: "\u68C0\u67E5\u5230\u671F\u9879" }),
6623
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => {
6673
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => {
6624
6674
  void save();
6625
6675
  }, children: busy ? "\u6B63\u5728\u5904\u7406\u2026" : "\u4FDD\u5B58\u8BBE\u7F6E" })
6626
6676
  ] })
6627
6677
  ] })
6628
6678
  ] }),
6629
- notice && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { className: "dsh-partner-inline-notice", children: [
6630
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconCheckOutline14, { size: 14 }),
6679
+ notice && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { className: "dsh-partner-inline-notice", children: [
6680
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconCheckOutline14, { size: 14 }),
6631
6681
  notice
6632
6682
  ] }),
6633
- error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
6634
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MemoryLibrary, { companionId: companion.id, revision: memoryRevision, profiles, memories, reflections, editing, busy, setEditing, save: () => {
6683
+ error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
6684
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MemoryLibrary, { companionId: companion.id, revision: memoryRevision, profiles, memories, reflections, editing, busy, setEditing, save: () => {
6635
6685
  void saveMemory();
6636
6686
  }, remove: (item) => {
6637
6687
  void deleteMemory(item);
6638
6688
  } }),
6639
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-section-heading", children: [
6640
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6641
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "SESSIONS" }),
6642
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u4F19\u4F34\u4F1A\u8BDD" })
6689
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-section-heading", children: [
6690
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6691
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "SESSIONS" }),
6692
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u4F19\u4F34\u4F1A\u8BDD" })
6643
6693
  ] }),
6644
- localSession === void 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", onClick: () => {
6694
+ localSession === void 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", onClick: () => {
6645
6695
  void startSession(companion.id);
6646
6696
  }, children: [
6647
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlusOutline16, { size: 14 }),
6697
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconPlusOutline16, { size: 14 }),
6648
6698
  "\u5F00\u59CB\u672C\u5730\u5BF9\u8BDD"
6649
6699
  ] })
6650
6700
  ] }),
6651
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-session-list", children: [
6652
- sessions2.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { "data-archived": item.archived, "data-kind": item.kind, children: [
6653
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconDataOutline16, { size: 16 }) }),
6654
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
6655
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: item.kind === "local" ? "\u672C\u5730\u4F19\u4F34\u4F1A\u8BDD" : `\u5FAE\u4FE1\u8054\u7CFB\u4EBA \xB7 ${item.userId.slice(-6)}` }),
6656
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: item.archived ? "\u5DF2\u5F52\u6863 \xB7 \u957F\u671F\u8BB0\u5FC6\u4FDD\u7559" : `${item.sessionId} \xB7 ${new Date(item.lastMessageAt).toLocaleString()}` })
6701
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-session-list", children: [
6702
+ sessions2.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { "data-archived": item.archived, "data-kind": item.kind, children: [
6703
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconDataOutline16, { size: 16 }) }),
6704
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6705
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: item.kind === "local" ? "\u672C\u5730\u4F19\u4F34\u4F1A\u8BDD" : `\u5FAE\u4FE1\u8054\u7CFB\u4EBA \xB7 ${item.userId.slice(-6)}` }),
6706
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: item.archived ? "\u5DF2\u5F52\u6863 \xB7 \u957F\u671F\u8BB0\u5FC6\u4FDD\u7559" : `${item.sessionId} \xB7 ${new Date(item.lastMessageAt).toLocaleString()}` })
6657
6707
  ] }),
6658
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: item.archived ? "is-primary" : void 0, onClick: () => {
6708
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: item.archived ? "is-primary" : void 0, onClick: () => {
6659
6709
  if (item.archived) void renewSession(item.id);
6660
6710
  else void openSession(item.id, item.sessionId);
6661
6711
  }, children: item.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
6662
6712
  ] }, item.id)),
6663
- sessions2.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u4F19\u4F34\u4F1A\u8BDD", detail: "\u65E0\u9700\u8FDE\u63A5\u5FAE\u4FE1\uFF0C\u76F4\u63A5\u5F00\u59CB\u672C\u5730\u5BF9\u8BDD\uFF1B\u4EE5\u540E\u8FDE\u63A5\u7684\u5FAE\u4FE1\u8054\u7CFB\u4EBA\u4F1A\u7EE7\u7EED\u4F7F\u7528\u5404\u81EA\u72EC\u7ACB\u7684\u6E20\u9053\u4F1A\u8BDD\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => {
6713
+ sessions2.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u4F19\u4F34\u4F1A\u8BDD", detail: "\u65E0\u9700\u8FDE\u63A5\u5FAE\u4FE1\uFF0C\u76F4\u63A5\u5F00\u59CB\u672C\u5730\u5BF9\u8BDD\uFF1B\u4EE5\u540E\u8FDE\u63A5\u7684\u5FAE\u4FE1\u8054\u7CFB\u4EBA\u4F1A\u7EE7\u7EED\u4F7F\u7528\u5404\u81EA\u72EC\u7ACB\u7684\u6E20\u9053\u4F1A\u8BDD\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => {
6664
6714
  void startSession(companion.id);
6665
6715
  }, children: "\u5F00\u59CB\u5BF9\u8BDD" }), compact: true })
6666
6716
  ] })
@@ -6671,19 +6721,19 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
6671
6721
  const active = visible.filter((item) => item.state !== "resolved");
6672
6722
  const resolved = visible.filter((item) => item.state === "resolved");
6673
6723
  const latest = new Map([...activity.observations].reverse().map((item) => [item.concernId, item]));
6674
- const [composing, setComposing] = (0, import_react18.useState)(false);
6675
- const [expandedId, setExpandedId] = (0, import_react18.useState)();
6676
- const [visibleCount, setVisibleCount] = (0, import_react18.useState)(5);
6677
- const [mention, setMention] = (0, import_react18.useState)();
6678
- const [sources, setSources] = (0, import_react18.useState)([]);
6679
- const [sourcesLoading, setSourcesLoading] = (0, import_react18.useState)(false);
6680
- const [sourceError, setSourceError] = (0, import_react18.useState)();
6681
- const [activeSource, setActiveSource] = (0, import_react18.useState)(0);
6682
- const inputRef = (0, import_react18.useRef)(null);
6683
- const listboxId = (0, import_react18.useId)();
6724
+ const [composing, setComposing] = (0, import_react19.useState)(false);
6725
+ const [expandedId, setExpandedId] = (0, import_react19.useState)();
6726
+ const [visibleCount, setVisibleCount] = (0, import_react19.useState)(5);
6727
+ const [mention, setMention] = (0, import_react19.useState)();
6728
+ const [sources, setSources] = (0, import_react19.useState)([]);
6729
+ const [sourcesLoading, setSourcesLoading] = (0, import_react19.useState)(false);
6730
+ const [sourceError, setSourceError] = (0, import_react19.useState)();
6731
+ const [activeSource, setActiveSource] = (0, import_react19.useState)(0);
6732
+ const inputRef = (0, import_react19.useRef)(null);
6733
+ const listboxId = (0, import_react19.useId)();
6684
6734
  const shown = active.slice(0, visibleCount);
6685
6735
  const suggestionsOpen = composing && mention !== void 0;
6686
- (0, import_react18.useEffect)(() => {
6736
+ (0, import_react19.useEffect)(() => {
6687
6737
  if (!suggestionsOpen || mention === void 0) {
6688
6738
  setSources([]);
6689
6739
  setSourcesLoading(false);
@@ -6732,25 +6782,25 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
6732
6782
  inputRef.current?.setSelectionRange(cursor, cursor);
6733
6783
  });
6734
6784
  };
6735
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-concern-board", "aria-labelledby": "partner-concerns-title", children: [
6736
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
6737
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6738
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { id: "partner-concerns-title", children: [
6785
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "dsh-partner-concern-board", "aria-labelledby": "partner-concerns-title", children: [
6786
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
6787
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6788
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { id: "partner-concerns-title", children: [
6739
6789
  "\u4F19\u4F34\u5728\u610F\u7684\u4E8B ",
6740
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: active.length })
6790
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: active.length })
6741
6791
  ] }),
6742
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: "\u5C1A\u672A\u95ED\u73AF\u3001\u503C\u5F97\u7EE7\u7EED\u7559\u610F\u7684\u4E8B\u60C5" })
6792
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: "\u5C1A\u672A\u95ED\u73AF\u3001\u503C\u5F97\u7EE7\u7EED\u7559\u610F\u7684\u4E8B\u60C5" })
6743
6793
  ] }),
6744
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", "aria-expanded": composing, onClick: () => setComposing((current2) => !current2), children: [
6745
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconPlusOutline16, { size: 14 }),
6794
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", "aria-expanded": composing, onClick: () => setComposing((current2) => !current2), children: [
6795
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconPlusOutline16, { size: 14 }),
6746
6796
  "\u4EA4\u4EE3\u4E00\u4EF6\u4E8B"
6747
6797
  ] })
6748
6798
  ] }),
6749
- composing && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("form", { className: "dsh-partner-concern-compose", onSubmit: submit, children: [
6750
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
6751
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u9700\u8981\u7559\u610F\u7684\u4E8B" }),
6752
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-concern-input-wrap", children: [
6753
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6799
+ composing && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("form", { className: "dsh-partner-concern-compose", onSubmit: submit, children: [
6800
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { children: [
6801
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u9700\u8981\u7559\u610F\u7684\u4E8B" }),
6802
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-concern-input-wrap", children: [
6803
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6754
6804
  "input",
6755
6805
  {
6756
6806
  ref: inputRef,
@@ -6786,10 +6836,10 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
6786
6836
  }
6787
6837
  }
6788
6838
  ),
6789
- suggestionsOpen && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { id: listboxId, className: "dsh-partner-concern-sources", role: "listbox", "aria-label": "\u53EF\u5F15\u7528\u7684\u6587\u4EF6\u4E0E\u77E5\u8BC6\u6587\u6863", children: sourcesLoading ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { role: "status", children: "\u6B63\u5728\u67E5\u627E\u53EF\u5F15\u7528\u5185\u5BB9\u2026" }) : sourceError ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { role: "status", children: [
6839
+ suggestionsOpen && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { id: listboxId, className: "dsh-partner-concern-sources", role: "listbox", "aria-label": "\u53EF\u5F15\u7528\u7684\u6587\u4EF6\u4E0E\u77E5\u8BC6\u6587\u6863", children: sourcesLoading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { role: "status", children: "\u6B63\u5728\u67E5\u627E\u53EF\u5F15\u7528\u5185\u5BB9\u2026" }) : sourceError ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { role: "status", children: [
6790
6840
  "\u5019\u9009\u52A0\u8F7D\u5931\u8D25\uFF1A",
6791
6841
  sourceError
6792
- ] }) : sources.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { role: "status", children: "\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u6587\u4EF6\u6216\u5DF2\u6302\u8F7D\u77E5\u8BC6\u6587\u6863" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: sources.map((source, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
6842
+ ] }) : sources.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { role: "status", children: "\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u6587\u4EF6\u6216\u5DF2\u6302\u8F7D\u77E5\u8BC6\u6587\u6863" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: sources.map((source, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6793
6843
  "button",
6794
6844
  {
6795
6845
  type: "button",
@@ -6801,97 +6851,97 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
6801
6851
  onMouseEnter: () => setActiveSource(index),
6802
6852
  onClick: () => chooseSource(source),
6803
6853
  children: [
6804
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: source.kind === "file" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconDataOutline16, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconLinkOutline16, { size: 15 }) }),
6805
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: source.label }),
6806
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: source.detail })
6854
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: source.kind === "file" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconDataOutline16, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconLinkOutline16, { size: 15 }) }),
6855
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: source.label }),
6856
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: source.detail })
6807
6857
  ]
6808
6858
  },
6809
6859
  `${source.kind}:${source.token}`
6810
6860
  )) }) })
6811
6861
  ] }),
6812
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { className: "dsh-partner-concern-compose-hint", children: [
6862
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { className: "dsh-partner-concern-compose-hint", children: [
6813
6863
  "\u8F93\u5165 ",
6814
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: "@" }),
6864
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: "@" }),
6815
6865
  " \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"
6816
6866
  ] })
6817
6867
  ] }),
6818
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
6819
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => {
6868
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6869
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => {
6820
6870
  setComposing(false);
6821
6871
  setMention(void 0);
6822
6872
  onValue("");
6823
6873
  }, children: "\u53D6\u6D88" }),
6824
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !value.trim(), children: "\u8BA9\u4F19\u4F34\u8BB0\u7740" })
6874
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !value.trim(), children: "\u8BA9\u4F19\u4F34\u8BB0\u7740" })
6825
6875
  ] })
6826
6876
  ] }),
6827
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-concern-list", role: "list", children: active.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-concern-empty", children: "\u6700\u8FD1\u6CA1\u6709\u672A\u95ED\u73AF\u7684\u4E8B\u3002\u4F60\u4E5F\u53EF\u4EE5\u76F4\u63A5\u5BF9\u4F19\u4F34\u8BF4\u201C\u8FD9\u4E2A\u5E2E\u6211\u7559\u610F\u201D\u3002" }) : shown.map((item) => {
6877
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-concern-list", role: "list", children: active.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "dsh-partner-concern-empty", children: "\u6700\u8FD1\u6CA1\u6709\u672A\u95ED\u73AF\u7684\u4E8B\u3002\u4F60\u4E5F\u53EF\u4EE5\u76F4\u63A5\u5BF9\u4F19\u4F34\u8BF4\u201C\u8FD9\u4E2A\u5E2E\u6211\u7559\u610F\u201D\u3002" }) : shown.map((item) => {
6828
6878
  const observation = latest.get(item.id);
6829
6879
  const expanded = expandedId === item.id;
6830
6880
  const status = observation ? concernObservationStatus(observation) : item.state === "active" ? "\u6B63\u5728\u7559\u610F" : "\u6682\u65F6\u8BB0\u7740";
6831
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { role: "listitem", "data-state": item.state, "data-expanded": expanded, children: [
6832
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "dsh-partner-concern-row", "aria-expanded": expanded, onClick: () => setExpandedId((current2) => current2 === item.id ? void 0 : item.id), children: [
6833
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "dsh-partner-concern-state", children: [
6834
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}),
6881
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { role: "listitem", "data-state": item.state, "data-expanded": expanded, children: [
6882
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: "dsh-partner-concern-row", "aria-expanded": expanded, onClick: () => setExpandedId((current2) => current2 === item.id ? void 0 : item.id), children: [
6883
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dsh-partner-concern-state", children: [
6884
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
6835
6885
  status
6836
6886
  ] }),
6837
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "dsh-partner-concern-copy", children: [
6838
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: item.subject }),
6839
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: observation ? observation.event : item.reason })
6887
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dsh-partner-concern-copy", children: [
6888
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: item.subject }),
6889
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: observation ? observation.event : item.reason })
6840
6890
  ] }),
6841
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "dsh-partner-concern-time", title: `\u8BA1\u5212\u4E8E ${new Date(item.nextCheckAt).toLocaleString()} \u518D\u6B21\u7559\u610F`, children: [
6842
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u4E0B\u6B21\u7559\u610F" }),
6843
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: futureTime(item.nextCheckAt) })
6891
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dsh-partner-concern-time", title: `\u8BA1\u5212\u4E8E ${new Date(item.nextCheckAt).toLocaleString()} \u518D\u6B21\u7559\u610F`, children: [
6892
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u4E0B\u6B21\u7559\u610F" }),
6893
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: futureTime(item.nextCheckAt) })
6844
6894
  ] }),
6845
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconChevronDownOutline14, { size: 14 })
6895
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconChevronDownOutline14, { size: 14 })
6846
6896
  ] }),
6847
- expanded && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-concern-detail", children: [
6848
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: item.reason }),
6849
- observation && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
6850
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("blockquote", { children: observation.event }),
6851
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-concern-decision", "data-decision": observation.decision, children: [
6852
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: concernObservationStatus(observation) }),
6853
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: observation.decisionReason || concernObservationExplanation(observation) }),
6854
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
6897
+ expanded && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-concern-detail", children: [
6898
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: item.reason }),
6899
+ observation && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
6900
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("blockquote", { children: observation.event }),
6901
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-concern-decision", "data-decision": observation.decision, children: [
6902
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: concernObservationStatus(observation) }),
6903
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: observation.decisionReason || concernObservationExplanation(observation) }),
6904
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
6855
6905
  "\u6253\u6270\u5206\u6570 ",
6856
6906
  Math.round(observation.interruptScore * 100),
6857
6907
  observation.notificationRuleEffect !== "auto" && observation.notificationRuleReason ? ` \xB7 \u77E5\u8BC6\u89C4\u5219\uFF1A${observation.notificationRuleReason}` : ""
6858
6908
  ] })
6859
6909
  ] })
6860
6910
  ] }),
6861
- item.resources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-concern-resources", children: item.resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6911
+ item.resources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-concern-resources", children: item.resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
6862
6912
  resource.kind === "file" ? "\u6587\u4EF6" : "\u77E5\u8BC6",
6863
6913
  " \xB7 ",
6864
6914
  resource.label
6865
6915
  ] }, `${resource.kind}:${resource.locator}`)) }),
6866
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
6916
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
6867
6917
  item.origin === "explicit" ? "\u4F60\u660E\u786E\u4EA4\u4EE3" : "\u4F19\u4F34\u4ECE\u5BF9\u8BDD\u4E2D\u6CE8\u610F\u5230",
6868
6918
  " \xB7 ",
6869
6919
  watchKindLabel(item.watchKind)
6870
6920
  ] }),
6871
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-concern-actions", "aria-label": `${item.subject} \u7684\u64CD\u4F5C`, children: [
6872
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy, onClick: () => onCheck(item), children: "\u7ACB\u5373\u68C0\u67E5\u8FD9\u6761" }),
6873
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u7EE7\u7EED\u7559\u610F" }),
6874
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "prioritize"), children: "\u63D0\u9AD8\u5173\u6CE8" }),
6875
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "resolve"), children: "\u5DF2\u7ECF\u89E3\u51B3" }),
6876
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: () => onAct(item, "ignore"), children: "\u522B\u7BA1\u8FD9\u4E2A" })
6921
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-concern-actions", "aria-label": `${item.subject} \u7684\u64CD\u4F5C`, children: [
6922
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy, onClick: () => onCheck(item), children: "\u7ACB\u5373\u68C0\u67E5\u8FD9\u6761" }),
6923
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u7EE7\u7EED\u7559\u610F" }),
6924
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "prioritize"), children: "\u63D0\u9AD8\u5173\u6CE8" }),
6925
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "resolve"), children: "\u5DF2\u7ECF\u89E3\u51B3" }),
6926
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: () => onAct(item, "ignore"), children: "\u522B\u7BA1\u8FD9\u4E2A" })
6877
6927
  ] })
6878
6928
  ] })
6879
6929
  ] }, item.id);
6880
6930
  }) }),
6881
- (active.length > shown.length || visibleCount > 5) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-concern-more", children: active.length > shown.length ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", onClick: () => setVisibleCount((count) => Math.min(active.length, count + 20)), children: [
6931
+ (active.length > shown.length || visibleCount > 5) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-concern-more", children: active.length > shown.length ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", onClick: () => setVisibleCount((count) => Math.min(active.length, count + 20)), children: [
6882
6932
  "\u518D\u663E\u793A ",
6883
6933
  Math.min(20, active.length - shown.length),
6884
6934
  " \u6761"
6885
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setVisibleCount(5), children: "\u6536\u8D77\u5217\u8868" }) }),
6886
- resolved.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("details", { className: "dsh-partner-concern-resolved", children: [
6887
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("summary", { children: [
6935
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => setVisibleCount(5), children: "\u6536\u8D77\u5217\u8868" }) }),
6936
+ resolved.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("details", { className: "dsh-partner-concern-resolved", children: [
6937
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("summary", { children: [
6888
6938
  "\u5DF2\u7ECF\u89E3\u51B3 ",
6889
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: resolved.length })
6939
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: resolved.length })
6890
6940
  ] }),
6891
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: resolved.slice(0, 30).map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { children: [
6892
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconCheckOutline14, { size: 13 }) }),
6893
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: item.subject }),
6894
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u91CD\u65B0\u7559\u610F" })
6941
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: resolved.slice(0, 30).map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { children: [
6942
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconCheckOutline14, { size: 13 }) }),
6943
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: item.subject }),
6944
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u91CD\u65B0\u7559\u610F" })
6895
6945
  ] }, item.id)) })
6896
6946
  ] })
6897
6947
  ] });
@@ -6917,23 +6967,23 @@ function watchKindLabel(value) {
6917
6967
  }
6918
6968
  var MEMORY_KINDS = ["all", "preference", "task", "event", "relationship", "emotion"];
6919
6969
  function MemoryLibrary({ companionId, revision, profiles, memories, reflections, editing, busy, setEditing, save, remove }) {
6920
- const activeMemories = (0, import_react18.useMemo)(() => memories.filter((item) => item.status === "active" && item.kind !== "profile"), [memories]);
6921
- const profileMemories = (0, import_react18.useMemo)(() => memories.filter((item) => item.status === "active" && item.kind === "profile"), [memories]);
6922
- const [mode, setMode] = (0, import_react18.useState)("profile");
6923
- const [kind, setKind] = (0, import_react18.useState)("all");
6924
- const [query, setQuery] = (0, import_react18.useState)("");
6925
- const [selectedMemoryId, setSelectedMemoryId] = (0, import_react18.useState)();
6926
- const [selectedDate, setSelectedDate] = (0, import_react18.useState)();
6927
- const [graph, setGraph] = (0, import_react18.useState)();
6928
- const [graphLoading, setGraphLoading] = (0, import_react18.useState)(false);
6929
- const [graphError, setGraphError] = (0, import_react18.useState)();
6930
- const [graphRequest, setGraphRequest] = (0, import_react18.useState)(0);
6931
- (0, import_react18.useEffect)(() => {
6970
+ const activeMemories = (0, import_react19.useMemo)(() => memories.filter((item) => item.status === "active" && item.kind !== "profile"), [memories]);
6971
+ const profileMemories = (0, import_react19.useMemo)(() => memories.filter((item) => item.status === "active" && item.kind === "profile"), [memories]);
6972
+ const [mode, setMode] = (0, import_react19.useState)("profile");
6973
+ const [kind, setKind] = (0, import_react19.useState)("all");
6974
+ const [query, setQuery] = (0, import_react19.useState)("");
6975
+ const [selectedMemoryId, setSelectedMemoryId] = (0, import_react19.useState)();
6976
+ const [selectedDate, setSelectedDate] = (0, import_react19.useState)();
6977
+ const [graph, setGraph] = (0, import_react19.useState)();
6978
+ const [graphLoading, setGraphLoading] = (0, import_react19.useState)(false);
6979
+ const [graphError, setGraphError] = (0, import_react19.useState)();
6980
+ const [graphRequest, setGraphRequest] = (0, import_react19.useState)(0);
6981
+ (0, import_react19.useEffect)(() => {
6932
6982
  setGraph(void 0);
6933
6983
  setGraphError(void 0);
6934
6984
  setGraphLoading(false);
6935
6985
  }, [companionId, revision]);
6936
- (0, import_react18.useEffect)(() => {
6986
+ (0, import_react19.useEffect)(() => {
6937
6987
  if (mode !== "graph" || graph !== void 0) return;
6938
6988
  const controller = new AbortController();
6939
6989
  setGraphLoading(true);
@@ -6948,75 +6998,75 @@ function MemoryLibrary({ companionId, revision, profiles, memories, reflections,
6948
6998
  return () => controller.abort();
6949
6999
  }, [companionId, graph, graphRequest, mode, revision]);
6950
7000
  const normalized = query.trim().toLocaleLowerCase();
6951
- const filteredMemories = (0, import_react18.useMemo)(() => activeMemories.filter(
7001
+ const filteredMemories = (0, import_react19.useMemo)(() => activeMemories.filter(
6952
7002
  (item) => (kind === "all" || item.kind === kind) && (!normalized || `${item.subject} ${item.content}`.toLocaleLowerCase().includes(normalized))
6953
7003
  ), [activeMemories, kind, normalized]);
6954
- const filteredReflections = (0, import_react18.useMemo)(() => reflections.filter(
7004
+ const filteredReflections = (0, import_react19.useMemo)(() => reflections.filter(
6955
7005
  (item) => !normalized || `${item.date} ${item.summary} ${item.events.join(" ")} ${item.openTasks.join(" ")} ${item.learnings.join(" ")}`.toLocaleLowerCase().includes(normalized)
6956
7006
  ), [reflections, normalized]);
6957
7007
  const selectedMemory = filteredMemories.find((item) => item.id === selectedMemoryId) ?? filteredMemories[0];
6958
7008
  const selectedReflection = filteredReflections.find((item) => item.date === selectedDate) ?? filteredReflections[0];
6959
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsh-partner-memory-library", children: [
6960
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { className: "dsh-partner-library-header", children: [
6961
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
6962
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "MEMORY LIBRARY" }),
6963
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "\u4F19\u4F34\u8BB0\u5FC6\u5E93" }),
6964
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: "\u67E5\u770B\u4F19\u4F34\u5982\u4F55\u4ECE\u957F\u671F\u5BF9\u8BDD\u4E2D\u8BA4\u8BC6\u4F60\uFF0C\u4EE5\u53CA\u8FD9\u4E9B\u7406\u89E3\u600E\u6837\u968F\u8BC1\u636E\u53D8\u5316\u3002" })
7009
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "dsh-partner-memory-library", children: [
7010
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { className: "dsh-partner-library-header", children: [
7011
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
7012
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "MEMORY LIBRARY" }),
7013
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "\u4F19\u4F34\u8BB0\u5FC6\u5E93" }),
7014
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: "\u67E5\u770B\u4F19\u4F34\u5982\u4F55\u4ECE\u957F\u671F\u5BF9\u8BDD\u4E2D\u8BA4\u8BC6\u4F60\uFF0C\u4EE5\u53CA\u8FD9\u4E9B\u7406\u89E3\u600E\u6837\u968F\u8BC1\u636E\u53D8\u5316\u3002" })
6965
7015
  ] }),
6966
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("nav", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", children: [
6967
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: mode === "profile" ? "is-active" : "", onClick: () => setMode("profile"), children: [
7016
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("nav", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", children: [
7017
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: mode === "profile" ? "is-active" : "", onClick: () => setMode("profile"), children: [
6968
7018
  "\u4EBA\u7269\u753B\u50CF ",
6969
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: profiles.length })
7019
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: profiles.length })
6970
7020
  ] }),
6971
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: mode === "memory" ? "is-active" : "", onClick: () => setMode("memory"), children: [
7021
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: mode === "memory" ? "is-active" : "", onClick: () => setMode("memory"), children: [
6972
7022
  "\u8BDD\u9898\u8BB0\u5FC6 ",
6973
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: activeMemories.length })
7023
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: activeMemories.length })
6974
7024
  ] }),
6975
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: mode === "reflection" ? "is-active" : "", onClick: () => setMode("reflection"), children: [
7025
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: mode === "reflection" ? "is-active" : "", onClick: () => setMode("reflection"), children: [
6976
7026
  "\u6BCF\u65E5\u56DE\u987E ",
6977
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: reflections.length })
7027
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: reflections.length })
6978
7028
  ] }),
6979
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: mode === "graph" ? "is-active" : "", onClick: () => setMode("graph"), children: [
7029
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: mode === "graph" ? "is-active" : "", onClick: () => setMode("graph"), children: [
6980
7030
  "\u5173\u7CFB\u56FE\u8C31 ",
6981
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: graph?.relations.length ?? "\u2014" })
7031
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: graph?.relations.length ?? "\u2014" })
6982
7032
  ] })
6983
7033
  ] })
6984
7034
  ] }),
6985
- mode !== "profile" && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-library-tools", children: [
6986
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
6987
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u8BB0\u5FC6" }),
6988
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: mode === "memory" ? "\u641C\u7D22\u4E3B\u9898\u6216\u8BB0\u5FC6\u5185\u5BB9" : "\u641C\u7D22\u65E5\u671F\u3001\u603B\u7ED3\u6216\u5F85\u529E" })
7035
+ mode !== "profile" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-library-tools", children: [
7036
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { children: [
7037
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u8BB0\u5FC6" }),
7038
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: mode === "memory" ? "\u641C\u7D22\u4E3B\u9898\u6216\u8BB0\u5FC6\u5185\u5BB9" : "\u641C\u7D22\u65E5\u671F\u3001\u603B\u7ED3\u6216\u5F85\u529E" })
6989
7039
  ] }),
6990
- mode === "memory" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-memory-kinds", children: MEMORY_KINDS.map((value) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: kind === value ? "is-active" : "", onClick: () => setKind(value), children: value === "all" ? "\u5168\u90E8" : memoryKind(value) }, value)) })
7040
+ mode === "memory" && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-memory-kinds", children: MEMORY_KINDS.map((value) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: kind === value ? "is-active" : "", onClick: () => setKind(value), children: value === "all" ? "\u5168\u90E8" : memoryKind(value) }, value)) })
6991
7041
  ] }),
6992
- mode === "profile" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ProfileLibrary, { profiles, memories: profileMemories, editing, busy, setEditing, save, remove }) : mode === "memory" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-library-browser", children: [
6993
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-library-list", role: "list", children: filteredMemories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: activeMemories.length === 0 ? "\u8FD8\u6CA1\u6709\u957F\u671F\u8BB0\u5FC6" : "\u6CA1\u6709\u5339\u914D\u7684\u8BB0\u5FC6", detail: activeMemories.length === 0 ? "\u4F19\u4F34\u5B8C\u6210\u5BF9\u8BDD\u540E\u4F1A\u81EA\u52A8\u63D0\u70BC\u503C\u5F97\u957F\u671F\u4FDD\u7559\u7684\u4FE1\u606F\u3002" : "\u6362\u4E2A\u5173\u952E\u8BCD\u6216\u7C7B\u578B\u8BD5\u8BD5\u3002", compact: true }) : filteredMemories.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "listitem", className: selectedMemory?.id === item.id ? "is-active" : "", onClick: () => {
7042
+ mode === "profile" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ProfileLibrary, { profiles, memories: profileMemories, editing, busy, setEditing, save, remove }) : mode === "memory" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-library-browser", children: [
7043
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-library-list", role: "list", children: filteredMemories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: activeMemories.length === 0 ? "\u8FD8\u6CA1\u6709\u957F\u671F\u8BB0\u5FC6" : "\u6CA1\u6709\u5339\u914D\u7684\u8BB0\u5FC6", detail: activeMemories.length === 0 ? "\u4F19\u4F34\u5B8C\u6210\u5BF9\u8BDD\u540E\u4F1A\u81EA\u52A8\u63D0\u70BC\u503C\u5F97\u957F\u671F\u4FDD\u7559\u7684\u4FE1\u606F\u3002" : "\u6362\u4E2A\u5173\u952E\u8BCD\u6216\u7C7B\u578B\u8BD5\u8BD5\u3002", compact: true }) : filteredMemories.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", role: "listitem", className: selectedMemory?.id === item.id ? "is-active" : "", onClick: () => {
6994
7044
  setSelectedMemoryId(item.id);
6995
7045
  setEditing(void 0);
6996
7046
  }, children: [
6997
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { "data-kind": item.kind, children: memoryKind(item.kind) }),
6998
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: item.subject }),
6999
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: item.content }),
7000
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: relativeTime(item.updatedAt) })
7047
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "data-kind": item.kind, children: memoryKind(item.kind) }),
7048
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: item.subject }),
7049
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: item.content }),
7050
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: relativeTime(item.updatedAt) })
7001
7051
  ] }, item.id)) }),
7002
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-library-detail", children: selectedMemory ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MemoryCard, { item: selectedMemory, editing: editing?.id === selectedMemory.id ? editing : void 0, busy, setEditing, save, remove: () => remove(selectedMemory) }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u6761\u8BB0\u5FC6", detail: "\u8BB0\u5FC6\u8BE6\u60C5\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
7003
- ] }) : mode === "reflection" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-library-browser", children: [
7004
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-library-list is-diary", role: "list", children: filteredReflections.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: reflections.length === 0 ? "\u8FD8\u6CA1\u6709\u6BCF\u65E5\u56DE\u987E" : "\u6CA1\u6709\u5339\u914D\u7684\u56DE\u987E", detail: reflections.length === 0 ? "\u6BCF\u65E5\u56DE\u987E\u4F1A\u5728\u6BCF\u8F6E\u5B8C\u6574\u5BF9\u8BDD\u540E\u6301\u7EED\u66F4\u65B0\u3002" : "\u6362\u4E2A\u5173\u952E\u8BCD\u6216\u65E5\u671F\u8BD5\u8BD5\u3002", compact: true }) : filteredReflections.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "listitem", className: selectedReflection?.date === entry.date ? "is-active" : "", onClick: () => setSelectedDate(entry.date), children: [
7005
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("time", { children: entry.date }),
7006
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
7052
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-library-detail", children: selectedMemory ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MemoryCard, { item: selectedMemory, editing: editing?.id === selectedMemory.id ? editing : void 0, busy, setEditing, save, remove: () => remove(selectedMemory) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u6761\u8BB0\u5FC6", detail: "\u8BB0\u5FC6\u8BE6\u60C5\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
7053
+ ] }) : mode === "reflection" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-library-browser", children: [
7054
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-library-list is-diary", role: "list", children: filteredReflections.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: reflections.length === 0 ? "\u8FD8\u6CA1\u6709\u6BCF\u65E5\u56DE\u987E" : "\u6CA1\u6709\u5339\u914D\u7684\u56DE\u987E", detail: reflections.length === 0 ? "\u6BCF\u65E5\u56DE\u987E\u4F1A\u5728\u6BCF\u8F6E\u5B8C\u6574\u5BF9\u8BDD\u540E\u6301\u7EED\u66F4\u65B0\u3002" : "\u6362\u4E2A\u5173\u952E\u8BCD\u6216\u65E5\u671F\u8BD5\u8BD5\u3002", compact: true }) : filteredReflections.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", role: "listitem", className: selectedReflection?.date === entry.date ? "is-active" : "", onClick: () => setSelectedDate(entry.date), children: [
7055
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("time", { children: entry.date }),
7056
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7007
7057
  entry.turnCount,
7008
7058
  " \u8F6E\u4EA4\u6D41"
7009
7059
  ] }),
7010
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: entry.summary }),
7011
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
7060
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: entry.summary }),
7061
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
7012
7062
  entry.openTasks.length,
7013
7063
  " \u9879\u5F85\u8DDF\u8FDB \xB7 ",
7014
7064
  entry.learnings.length,
7015
7065
  " \u9879\u7406\u89E3"
7016
7066
  ] })
7017
7067
  ] }, entry.date)) }),
7018
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-library-detail", children: selectedReflection ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DailyReflectionDetail, { entry: selectedReflection }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u5929", detail: "\u5F53\u5929\u7684\u603B\u7ED3\u4E0E\u5F85\u529E\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
7019
- ] }) : graphError ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: "\u5173\u7CFB\u56FE\u8C31\u52A0\u8F7D\u5931\u8D25", detail: graphError, action: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setGraphRequest((value) => value + 1), children: "\u91CD\u65B0\u52A0\u8F7D" }) }) : graphLoading || graph === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: "\u6B63\u5728\u52A0\u8F7D\u5173\u7CFB\u56FE\u8C31", detail: "\u53EA\u5728\u9700\u8981\u67E5\u770B\u5173\u7CFB\u65F6\u8BFB\u53D6\u5BA1\u8BA1\u6570\u636E\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MemoryGraph, { graph, profiles, query: normalized, inspect: (item) => {
7068
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-library-detail", children: selectedReflection ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DailyReflectionDetail, { entry: selectedReflection }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u5929", detail: "\u5F53\u5929\u7684\u603B\u7ED3\u4E0E\u5F85\u529E\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
7069
+ ] }) : graphError ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u5173\u7CFB\u56FE\u8C31\u52A0\u8F7D\u5931\u8D25", detail: graphError, action: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => setGraphRequest((value) => value + 1), children: "\u91CD\u65B0\u52A0\u8F7D" }) }) : graphLoading || graph === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u6B63\u5728\u52A0\u8F7D\u5173\u7CFB\u56FE\u8C31", detail: "\u53EA\u5728\u9700\u8981\u67E5\u770B\u5173\u7CFB\u65F6\u8BFB\u53D6\u5BA1\u8BA1\u6570\u636E\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MemoryGraph, { graph, profiles, query: normalized, inspect: (item) => {
7020
7070
  setEditing(void 0);
7021
7071
  if (item.kind === "profile") setMode("profile");
7022
7072
  else {
@@ -7027,71 +7077,71 @@ function MemoryLibrary({ companionId, revision, profiles, memories, reflections,
7027
7077
  ] });
7028
7078
  }
7029
7079
  function ProfileLibrary({ profiles, memories, editing, busy, setEditing, save, remove }) {
7030
- const [selectedScopeId, setSelectedScopeId] = (0, import_react18.useState)();
7080
+ const [selectedScopeId, setSelectedScopeId] = (0, import_react19.useState)();
7031
7081
  const selected = profiles.find((item) => item.scopeId === selectedScopeId) ?? profiles[0];
7032
- if (!selected) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u8054\u7CFB\u4EBA\u753B\u50CF", detail: "\u8054\u7CFB\u4EBA\u5F00\u59CB\u548C\u4F19\u4F34\u4EA4\u6D41\u540E\uFF0C\u8FD9\u91CC\u4F1A\u9010\u6B65\u5C55\u793A\u4F19\u4F34\u4ECE\u660E\u786E\u5BF9\u8BDD\u4E2D\u5F62\u6210\u7684\u957F\u671F\u7406\u89E3\u3002" });
7082
+ if (!selected) return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u8054\u7CFB\u4EBA\u753B\u50CF", detail: "\u8054\u7CFB\u4EBA\u5F00\u59CB\u548C\u4F19\u4F34\u4EA4\u6D41\u540E\uFF0C\u8FD9\u91CC\u4F1A\u9010\u6B65\u5C55\u793A\u4F19\u4F34\u4ECE\u660E\u786E\u5BF9\u8BDD\u4E2D\u5F62\u6210\u7684\u957F\u671F\u7406\u89E3\u3002" });
7033
7083
  const activeIds = new Set(selected.entries.map((item) => item.id));
7034
7084
  const pending = memories.filter((item) => item.scopeId === selected.scopeId && !activeIds.has(item.id));
7035
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-profile-browser", children: [
7036
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-profile-people", role: "list", "aria-label": "\u8054\u7CFB\u4EBA\u753B\u50CF", children: profiles.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "listitem", className: profile.scopeId === selected.scopeId ? "is-active" : "", onClick: () => {
7085
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-profile-browser", children: [
7086
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-profile-people", role: "list", "aria-label": "\u8054\u7CFB\u4EBA\u753B\u50CF", children: profiles.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", role: "listitem", className: profile.scopeId === selected.scopeId ? "is-active" : "", onClick: () => {
7037
7087
  setSelectedScopeId(profile.scopeId);
7038
7088
  setEditing(void 0);
7039
7089
  }, children: [
7040
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives11.IconUserOutline16, { size: 16 }) }),
7041
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
7042
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: profile.label }),
7043
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: profile.entries.length > 0 ? `${profile.entries.length} \u9879\u7A33\u5B9A\u7406\u89E3` : "\u8FD8\u5728\u8BA4\u8BC6\u4E2D" })
7090
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives12.IconUserOutline16, { size: 16 }) }),
7091
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
7092
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: profile.label }),
7093
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: profile.entries.length > 0 ? `${profile.entries.length} \u9879\u7A33\u5B9A\u7406\u89E3` : "\u8FD8\u5728\u8BA4\u8BC6\u4E2D" })
7044
7094
  ] }),
7045
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { "aria-hidden": "true" })
7095
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", { "aria-hidden": "true" })
7046
7096
  ] }, profile.scopeId)) }),
7047
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-profile-stage", children: [
7048
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { className: "dsh-partner-profile-heading", children: [
7049
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
7050
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "PARTNER UNDERSTANDING" }),
7051
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
7097
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-profile-stage", children: [
7098
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { className: "dsh-partner-profile-heading", children: [
7099
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
7100
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "PARTNER UNDERSTANDING" }),
7101
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7052
7102
  "\u4F19\u4F34\u773C\u4E2D\u7684 ",
7053
7103
  selected.label
7054
7104
  ] }),
7055
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: "\u8FD9\u4E9B\u5185\u5BB9\u6765\u81EA\u4F60\u5728\u5BF9\u8BDD\u4E2D\u7684\u660E\u786E\u8868\u8FBE\u3002\u4F19\u4F34\u4F1A\u7528\u5B83\u4FDD\u6301\u7406\u89E3\u8FDE\u7EED\uFF0C\u4F46\u4E0D\u4F1A\u628A\u753B\u50CF\u5F53\u6210\u6807\u7B7E\u53CD\u590D\u590D\u8FF0\u3002" })
7105
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: "\u8FD9\u4E9B\u5185\u5BB9\u6765\u81EA\u4F60\u5728\u5BF9\u8BDD\u4E2D\u7684\u660E\u786E\u8868\u8FBE\u3002\u4F19\u4F34\u4F1A\u7528\u5B83\u4FDD\u6301\u7406\u89E3\u8FDE\u7EED\uFF0C\u4F46\u4E0D\u4F1A\u628A\u753B\u50CF\u5F53\u6210\u6807\u7B7E\u53CD\u590D\u590D\u8FF0\u3002" })
7056
7106
  ] }),
7057
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { "data-ready": selected.entries.length > 0, children: [
7058
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}),
7107
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { "data-ready": selected.entries.length > 0, children: [
7108
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
7059
7109
  selected.entries.length > 0 ? "\u4E0A\u4E0B\u6587\u57FA\u7EBF\u5DF2\u5C31\u7EEA" : "\u7B49\u5F85\u53EF\u9760\u8BC1\u636E"
7060
7110
  ] })
7061
7111
  ] }),
7062
- selected.entries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
7063
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-profile-meta", children: [
7064
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
7065
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u753B\u50CF\u7248\u672C" }),
7066
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: selected.version })
7112
+ selected.entries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
7113
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-profile-meta", children: [
7114
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
7115
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u753B\u50CF\u7248\u672C" }),
7116
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: selected.version })
7067
7117
  ] }),
7068
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
7069
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u5BF9\u8BDD\u4F9D\u636E" }),
7070
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
7118
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
7119
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u5BF9\u8BDD\u4F9D\u636E" }),
7120
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7071
7121
  selected.evidenceCount,
7072
7122
  " \u5904"
7073
7123
  ] })
7074
7124
  ] }),
7075
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
7076
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u7528\u6237\u786E\u8BA4" }),
7077
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
7125
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
7126
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u7528\u6237\u786E\u8BA4" }),
7127
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7078
7128
  selected.lockedCount,
7079
7129
  " \u9879"
7080
7130
  ] })
7081
7131
  ] }),
7082
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
7083
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u6700\u8FD1\u4F9D\u636E" }),
7084
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: selected.updatedAt ? relativeTime(selected.updatedAt) : "\u5C1A\u672A" })
7132
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
7133
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u6700\u8FD1\u4F9D\u636E" }),
7134
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: selected.updatedAt ? relativeTime(selected.updatedAt) : "\u5C1A\u672A" })
7085
7135
  ] })
7086
7136
  ] }),
7087
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-profile-entries", children: selected.entries.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MemoryCard, { item, editing: editing?.id === item.id ? editing : void 0, busy, setEditing, save, remove: () => remove(item) }, item.id)) })
7088
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: "\u4F19\u4F34\u8FD8\u5728\u8BA4\u8BC6\u4F60", detail: "\u53EA\u6709\u660E\u786E\u3001\u7A33\u5B9A\u5E76\u8FBE\u5230\u53EF\u9760\u6807\u51C6\u7684\u957F\u671F\u4FE1\u606F\u624D\u4F1A\u8FDB\u5165\u753B\u50CF\uFF1B\u666E\u901A\u504F\u597D\u3001\u4E34\u65F6\u4EFB\u52A1\u548C\u4E00\u6B21\u6027\u60C5\u7EEA\u4E0D\u4F1A\u653E\u5728\u8FD9\u91CC\u3002", compact: true }),
7089
- pending.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("details", { className: "dsh-partner-profile-pending", children: [
7090
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("summary", { children: [
7137
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-profile-entries", children: selected.entries.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MemoryCard, { item, editing: editing?.id === item.id ? editing : void 0, busy, setEditing, save, remove: () => remove(item) }, item.id)) })
7138
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u4F19\u4F34\u8FD8\u5728\u8BA4\u8BC6\u4F60", detail: "\u53EA\u6709\u660E\u786E\u3001\u7A33\u5B9A\u5E76\u8FBE\u5230\u53EF\u9760\u6807\u51C6\u7684\u957F\u671F\u4FE1\u606F\u624D\u4F1A\u8FDB\u5165\u753B\u50CF\uFF1B\u666E\u901A\u504F\u597D\u3001\u4E34\u65F6\u4EFB\u52A1\u548C\u4E00\u6B21\u6027\u60C5\u7EEA\u4E0D\u4F1A\u653E\u5728\u8FD9\u91CC\u3002", compact: true }),
7139
+ pending.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("details", { className: "dsh-partner-profile-pending", children: [
7140
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("summary", { children: [
7091
7141
  "\u5F85\u786E\u8BA4\u7684\u7406\u89E3 ",
7092
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: pending.length })
7142
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: pending.length })
7093
7143
  ] }),
7094
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: pending.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MemoryCard, { item, editing: editing?.id === item.id ? editing : void 0, busy, setEditing, save, remove: () => remove(item) }, item.id)) })
7144
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: pending.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MemoryCard, { item, editing: editing?.id === item.id ? editing : void 0, busy, setEditing, save, remove: () => remove(item) }, item.id)) })
7095
7145
  ] })
7096
7146
  ] })
7097
7147
  ] });
@@ -7100,9 +7150,9 @@ var RELATION_FILTERS = ["all", "conflicts_with", "depends_on", "supports", "foll
7100
7150
  function MemoryGraph({ graph, profiles, query, inspect }) {
7101
7151
  const byId = new Map(graph.memories.map((item) => [item.id, item]));
7102
7152
  const scopeIds = [...new Set(graph.relations.map((item) => item.scopeId))];
7103
- const [requestedScopeId, setRequestedScopeId] = (0, import_react18.useState)();
7153
+ const [requestedScopeId, setRequestedScopeId] = (0, import_react19.useState)();
7104
7154
  const scopeId = scopeIds.includes(requestedScopeId ?? "") ? requestedScopeId : scopeIds[0];
7105
- const [filter, setFilter] = (0, import_react18.useState)("all");
7155
+ const [filter, setFilter] = (0, import_react19.useState)("all");
7106
7156
  const scoped = graph.relations.filter((item) => item.scopeId === scopeId);
7107
7157
  const visible = scoped.filter((item) => {
7108
7158
  if (filter !== "all" && item.kind !== filter) return false;
@@ -7110,115 +7160,115 @@ function MemoryGraph({ graph, profiles, query, inspect }) {
7110
7160
  const target2 = byId.get(item.targetMemoryId);
7111
7161
  return !query || `${source2?.subject ?? ""} ${source2?.content ?? ""} ${target2?.subject ?? ""} ${target2?.content ?? ""} ${item.label}`.toLocaleLowerCase().includes(query);
7112
7162
  }).sort((left, right) => Number(right.kind === "conflicts_with") - Number(left.kind === "conflicts_with") || right.confidence - left.confidence);
7113
- const [selectedRelationId, setSelectedRelationId] = (0, import_react18.useState)();
7163
+ const [selectedRelationId, setSelectedRelationId] = (0, import_react19.useState)();
7114
7164
  const selected = visible.find((item) => item.id === selectedRelationId) ?? visible[0];
7115
7165
  const source = selected ? byId.get(selected.sourceMemoryId) : void 0;
7116
7166
  const target = selected ? byId.get(selected.targetMemoryId) : void 0;
7117
7167
  const label = profiles.find((item) => item.scopeId === scopeId)?.label ?? (scopeId ? `\u8054\u7CFB\u4EBA ${scopeId.slice(-6)}` : "\u5F53\u524D\u8054\u7CFB\u4EBA");
7118
7168
  const conflictCount = scoped.filter((item) => item.kind === "conflicts_with").length;
7119
- if (graph.relations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u53EF\u9760\u5173\u7CFB", detail: "\u6BCF\u65E5\u7EC8\u5BA1\u53EA\u4F1A\u4FDD\u5B58\u6709\u660E\u786E\u8BC1\u636E\u7684\u8BB0\u5FC6\u8054\u7CFB\uFF0C\u4E0D\u4F1A\u4E3A\u4E86\u586B\u6EE1\u56FE\u8C31\u800C\u731C\u6D4B\u3002" });
7120
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-graph-audit", children: [
7121
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { className: "dsh-partner-graph-toolbar", children: [
7122
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
7123
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: "\u5173\u7CFB\u5BA1\u8BA1" }),
7124
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
7169
+ if (graph.relations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u53EF\u9760\u5173\u7CFB", detail: "\u6BCF\u65E5\u7EC8\u5BA1\u53EA\u4F1A\u4FDD\u5B58\u6709\u660E\u786E\u8BC1\u636E\u7684\u8BB0\u5FC6\u8054\u7CFB\uFF0C\u4E0D\u4F1A\u4E3A\u4E86\u586B\u6EE1\u56FE\u8C31\u800C\u731C\u6D4B\u3002" });
7170
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-graph-audit", children: [
7171
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { className: "dsh-partner-graph-toolbar", children: [
7172
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
7173
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: "\u5173\u7CFB\u5BA1\u8BA1" }),
7174
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7125
7175
  label,
7126
7176
  " \u7684\u7406\u89E3\u5173\u7CFB"
7127
7177
  ] }),
7128
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
7178
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { children: [
7129
7179
  scoped.length,
7130
7180
  " \u6761\u53EF\u9760\u8054\u7CFB",
7131
7181
  conflictCount > 0 ? `\uFF0C\u5176\u4E2D ${conflictCount} \u6761\u9700\u8981\u786E\u8BA4` : "\uFF0C\u6682\u65E0\u5F85\u786E\u8BA4\u51B2\u7A81"
7132
7182
  ] })
7133
7183
  ] }),
7134
- scopeIds.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { children: [
7135
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u8054\u7CFB\u4EBA" }),
7136
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("select", { value: scopeId, onChange: (event) => {
7184
+ scopeIds.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { children: [
7185
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u8054\u7CFB\u4EBA" }),
7186
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("select", { value: scopeId, onChange: (event) => {
7137
7187
  setRequestedScopeId(event.target.value);
7138
7188
  setSelectedRelationId(void 0);
7139
- }, children: scopeIds.map((value) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value, children: profiles.find((item) => item.scopeId === value)?.label ?? `\u8054\u7CFB\u4EBA ${value.slice(-6)}` }, value)) })
7189
+ }, children: scopeIds.map((value) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value, children: profiles.find((item) => item.scopeId === value)?.label ?? `\u8054\u7CFB\u4EBA ${value.slice(-6)}` }, value)) })
7140
7190
  ] })
7141
7191
  ] }),
7142
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("nav", { className: "dsh-partner-graph-filters", "aria-label": "\u5173\u7CFB\u7C7B\u578B", children: RELATION_FILTERS.map((value) => {
7192
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("nav", { className: "dsh-partner-graph-filters", "aria-label": "\u5173\u7CFB\u7C7B\u578B", children: RELATION_FILTERS.map((value) => {
7143
7193
  const count = value === "all" ? scoped.length : scoped.filter((item) => item.kind === value).length;
7144
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: filter === value ? "is-active" : "", "aria-pressed": filter === value, onClick: () => {
7194
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", className: filter === value ? "is-active" : "", "aria-pressed": filter === value, onClick: () => {
7145
7195
  setFilter(value);
7146
7196
  setSelectedRelationId(void 0);
7147
7197
  }, children: [
7148
7198
  value === "all" ? "\u5168\u90E8" : relationLabel(value),
7149
7199
  " ",
7150
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: count })
7200
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: count })
7151
7201
  ] }, value);
7152
7202
  }) }),
7153
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-graph-browser", children: [
7154
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-graph-index", role: "list", children: visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: "\u6CA1\u6709\u5339\u914D\u7684\u5173\u7CFB", detail: "\u8C03\u6574\u5173\u7CFB\u7C7B\u578B\u6216\u641C\u7D22\u5173\u952E\u8BCD\u540E\u518D\u8BD5\u3002", compact: true }) : visible.map((item) => {
7203
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-graph-browser", children: [
7204
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-graph-index", role: "list", children: visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u6CA1\u6709\u5339\u914D\u7684\u5173\u7CFB", detail: "\u8C03\u6574\u5173\u7CFB\u7C7B\u578B\u6216\u641C\u7D22\u5173\u952E\u8BCD\u540E\u518D\u8BD5\u3002", compact: true }) : visible.map((item) => {
7155
7205
  const from = byId.get(item.sourceMemoryId);
7156
7206
  const to = byId.get(item.targetMemoryId);
7157
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", role: "listitem", "data-kind": item.kind, className: selected?.id === item.id ? "is-active" : "", onClick: () => setSelectedRelationId(item.id), children: [
7158
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: relationLabel(item.kind) }),
7159
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
7207
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", role: "listitem", "data-kind": item.kind, className: selected?.id === item.id ? "is-active" : "", onClick: () => setSelectedRelationId(item.id), children: [
7208
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: relationLabel(item.kind) }),
7209
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7160
7210
  from?.subject ?? "\u5DF2\u5220\u9664\u8BB0\u5FC6",
7161
7211
  " ",
7162
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
7212
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
7163
7213
  " ",
7164
7214
  to?.subject ?? "\u5DF2\u5220\u9664\u8BB0\u5FC6"
7165
7215
  ] }),
7166
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: item.label }),
7167
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
7216
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: item.label }),
7217
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
7168
7218
  Math.round(item.confidence * 100),
7169
7219
  "% \u53EF\u4FE1"
7170
7220
  ] })
7171
7221
  ] }, item.id);
7172
7222
  }) }),
7173
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-graph-stage", children: selected && source && target ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { "data-kind": selected.kind, children: [
7174
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
7175
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: relationLabel(selected.kind) }),
7176
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
7223
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-graph-stage", children: selected && source && target ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { "data-kind": selected.kind, children: [
7224
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
7225
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: relationLabel(selected.kind) }),
7226
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7177
7227
  source.subject,
7178
7228
  " ",
7179
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
7229
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
7180
7230
  " ",
7181
7231
  target.subject
7182
7232
  ] }),
7183
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: selected.label }),
7184
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: relationGuidance(selected.kind) })
7233
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: selected.label }),
7234
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: relationGuidance(selected.kind) })
7185
7235
  ] }),
7186
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-graph-pair", children: [
7187
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GraphMemory, { item: source, side: "\u8D77\u70B9", inspect }),
7188
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { "aria-hidden": "true", children: [
7189
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {}),
7190
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: relationLabel(selected.kind) }),
7191
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", {})
7236
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-graph-pair", children: [
7237
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GraphMemory, { item: source, side: "\u8D77\u70B9", inspect }),
7238
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { "aria-hidden": "true", children: [
7239
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
7240
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: relationLabel(selected.kind) }),
7241
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {})
7192
7242
  ] }),
7193
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GraphMemory, { item: target, side: "\u5173\u8054\u9879", inspect })
7243
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GraphMemory, { item: target, side: "\u5173\u8054\u9879", inspect })
7194
7244
  ] }),
7195
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("footer", { children: [
7196
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
7245
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("footer", { children: [
7246
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
7197
7247
  "\u6700\u8FD1\u7EC8\u5BA1\u4E8E ",
7198
7248
  new Date(selected.updatedAt).toLocaleString()
7199
7249
  ] }),
7200
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
7250
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7201
7251
  "\u5173\u7CFB\u7F6E\u4FE1\u5EA6 ",
7202
7252
  Math.round(selected.confidence * 100),
7203
7253
  "%"
7204
7254
  ] })
7205
7255
  ] })
7206
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u6761\u5173\u7CFB", detail: "\u5173\u7CFB\u4E24\u7AEF\u7684\u8BB0\u5FC6\u4E0E\u4F7F\u7528\u65B9\u5F0F\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
7256
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u6761\u5173\u7CFB", detail: "\u5173\u7CFB\u4E24\u7AEF\u7684\u8BB0\u5FC6\u4E0E\u4F7F\u7528\u65B9\u5F0F\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
7207
7257
  ] })
7208
7258
  ] });
7209
7259
  }
7210
7260
  function GraphMemory({ item, side, inspect }) {
7211
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { children: [
7212
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
7213
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
7261
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { children: [
7262
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
7263
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
7214
7264
  side,
7215
7265
  " \xB7 ",
7216
7266
  memoryKind(item.kind)
7217
7267
  ] }),
7218
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: item.subject })
7268
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: item.subject })
7219
7269
  ] }),
7220
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: item.content }),
7221
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => inspect(item), children: "\u67E5\u770B\u5E76\u4FEE\u6B63" })
7270
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: item.content }),
7271
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => inspect(item), children: "\u67E5\u770B\u5E76\u4FEE\u6B63" })
7222
7272
  ] });
7223
7273
  }
7224
7274
  function relationLabel(kind) {
@@ -7234,77 +7284,74 @@ function relationGuidance(kind) {
7234
7284
  }[kind];
7235
7285
  }
7236
7286
  function DailyReflectionDetail({ entry }) {
7237
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { className: "dsh-partner-diary-detail", children: [
7238
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
7239
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("time", { children: entry.date }),
7240
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
7287
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { className: "dsh-partner-diary-detail", children: [
7288
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
7289
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("time", { children: entry.date }),
7290
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
7241
7291
  entry.turnCount,
7242
7292
  " \u8F6E\u4EA4\u6D41\u540E\u7684\u7406\u89E3"
7243
7293
  ] }),
7244
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
7294
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
7245
7295
  "\u66F4\u65B0\u4E8E ",
7246
7296
  new Date(entry.updatedAt).toLocaleString()
7247
7297
  ] })
7248
7298
  ] }),
7249
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: entry.summary }),
7250
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ReflectionGroup, { title: "\u5F85\u8DDF\u8FDB", items: entry.openTasks }),
7251
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ReflectionGroup, { title: "\u5F53\u5929\u4E8B\u4EF6", items: entry.events }),
7252
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ReflectionGroup, { title: "\u65B0\u7406\u89E3", items: entry.learnings }),
7253
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ReflectionGroup, { title: "\u5DF2\u5B8C\u6210", items: entry.completedTasks })
7299
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: entry.summary }),
7300
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ReflectionGroup, { title: "\u5F85\u8DDF\u8FDB", items: entry.openTasks }),
7301
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ReflectionGroup, { title: "\u5F53\u5929\u4E8B\u4EF6", items: entry.events }),
7302
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ReflectionGroup, { title: "\u65B0\u7406\u89E3", items: entry.learnings }),
7303
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ReflectionGroup, { title: "\u5DF2\u5B8C\u6210", items: entry.completedTasks })
7254
7304
  ] });
7255
7305
  }
7256
7306
  function ReflectionGroup({ title, items }) {
7257
7307
  if (items.length === 0) return null;
7258
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { children: [
7259
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: title }),
7260
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: item }, item)) })
7308
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { children: [
7309
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: title }),
7310
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ul", { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: item }, item)) })
7261
7311
  ] });
7262
7312
  }
7263
7313
  function MemoryCard({ item, editing, busy, setEditing, save, remove }) {
7264
- const [confirmingRemove, setConfirmingRemove] = (0, import_react18.useState)(false);
7265
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("article", { "data-kind": item.kind, children: editing ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-memory-editor", children: [
7266
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { "aria-label": "\u8BB0\u5FC6\u4E3B\u9898", value: editing.subject, onChange: (event) => setEditing({ ...editing, subject: event.target.value }) }),
7267
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("textarea", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", value: editing.content, onChange: (event) => setEditing({ ...editing, content: event.target.value }) }),
7268
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("footer", { children: [
7269
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setEditing(void 0), children: "\u53D6\u6D88" }),
7270
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "is-primary", disabled: busy || !editing.subject.trim() || !editing.content.trim(), onClick: save, children: "\u4FDD\u5B58\u4FEE\u6B63" })
7314
+ const [confirmingRemove, setConfirmingRemove] = (0, import_react19.useState)(false);
7315
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("article", { "data-kind": item.kind, children: editing ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-memory-editor", children: [
7316
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { "aria-label": "\u8BB0\u5FC6\u4E3B\u9898", value: editing.subject, onChange: (event) => setEditing({ ...editing, subject: event.target.value }) }),
7317
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("textarea", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", value: editing.content, onChange: (event) => setEditing({ ...editing, content: event.target.value }) }),
7318
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("footer", { children: [
7319
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => setEditing(void 0), children: "\u53D6\u6D88" }),
7320
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "is-primary", disabled: busy || !editing.subject.trim() || !editing.content.trim(), onClick: save, children: "\u4FDD\u5B58\u4FEE\u6B63" })
7271
7321
  ] })
7272
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
7273
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
7274
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: memoryKind(item.kind) }),
7275
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: confirmingRemove ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
7276
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setConfirmingRemove(false), children: "\u53D6\u6D88" }),
7277
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
7278
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
7279
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setEditing({ ...item }), children: "\u7F16\u8F91" }),
7280
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setConfirmingRemove(true), children: "\u5220\u9664" })
7322
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
7323
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("header", { children: [
7324
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: memoryKind(item.kind) }),
7325
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: confirmingRemove ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
7326
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => setConfirmingRemove(false), children: "\u53D6\u6D88" }),
7327
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
7328
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
7329
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => setEditing({ ...item }), children: "\u7F16\u8F91" }),
7330
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: () => setConfirmingRemove(true), children: "\u5220\u9664" })
7281
7331
  ] }) })
7282
7332
  ] }),
7283
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: item.subject }),
7284
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: item.content }),
7285
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("footer", { children: [
7286
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("progress", { max: 1, value: item.confidence, "aria-label": `\u7F6E\u4FE1\u5EA6 ${Math.round(item.confidence * 100)}%` }),
7287
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
7333
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: item.subject }),
7334
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: item.content }),
7335
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("footer", { children: [
7336
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("progress", { max: 1, value: item.confidence, "aria-label": `\u7F6E\u4FE1\u5EA6 ${Math.round(item.confidence * 100)}%` }),
7337
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
7288
7338
  item.locked ? "\u624B\u52A8\u786E\u8BA4" : `${Math.round(item.confidence * 100)}% \u53EF\u4FE1`,
7289
7339
  " \xB7 ",
7290
7340
  relativeTime(item.updatedAt)
7291
7341
  ] })
7292
7342
  ] }),
7293
- item.evidence.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("details", { className: "dsh-partner-memory-evidence", children: [
7294
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("summary", { children: [
7343
+ item.evidence.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("details", { className: "dsh-partner-memory-evidence", children: [
7344
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("summary", { children: [
7295
7345
  "\u67E5\u770B\u5BF9\u8BDD\u4F9D\u636E ",
7296
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: item.evidence.length })
7346
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: item.evidence.length })
7297
7347
  ] }),
7298
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: [...item.evidence].reverse().map((evidence) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("blockquote", { children: [
7299
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: evidence.excerpt }),
7300
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("time", { children: new Date(evidence.at).toLocaleString() })
7348
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: [...item.evidence].reverse().map((evidence) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("blockquote", { children: [
7349
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: evidence.excerpt }),
7350
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("time", { children: new Date(evidence.at).toLocaleString() })
7301
7351
  ] }, `${evidence.turnId}:${evidence.at}`)) })
7302
7352
  ] })
7303
7353
  ] }) });
7304
7354
  }
7305
- function companionDraft(companion) {
7306
- return { name: companion.name, role: companion.role, description: companion.description, instructions: companion.instructions, presetId: companion.presetId ?? "", provider: companion.provider ?? "", model: companion.model ?? "", capabilities: [...companion.capabilities] };
7307
- }
7308
7355
  function concernObservationStatus(item) {
7309
7356
  if (item.decision === "notify") return item.mentionedAt === void 0 ? "\u5F85\u63D0\u9192" : "\u5DF2\u63D0\u9192";
7310
7357
  if (item.decision === "feed") return "\u4F19\u4F34\u52A8\u6001";