@lemoncat7/dsh-partner 1.16.2 → 2.1.0
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.
- package/README.md +21 -0
- package/cordis.patch.yml +1 -0
- package/docs/channel-questions-and-avatar.md +30 -0
- package/docs/releases/2.0.0.md +34 -0
- package/docs/releases/2.1.0.md +13 -0
- package/docs/storage-migration.md +72 -0
- package/lib/agent-runtime.d.ts +1 -0
- package/lib/agent-runtime.d.ts.map +1 -1
- package/lib/agent-runtime.js +15 -3
- package/lib/agent-runtime.js.map +1 -1
- package/lib/api.d.ts +2 -0
- package/lib/api.d.ts.map +1 -1
- package/lib/api.js +49 -1
- package/lib/api.js.map +1 -1
- package/lib/attachments/service.d.ts +10 -0
- package/lib/attachments/service.d.ts.map +1 -1
- package/lib/attachments/service.js +68 -9
- package/lib/attachments/service.js.map +1 -1
- package/lib/channels/avatar-file.d.ts +3 -0
- package/lib/channels/avatar-file.d.ts.map +1 -0
- package/lib/channels/avatar-file.js +43 -0
- package/lib/channels/avatar-file.js.map +1 -0
- package/lib/channels/avatar-tool.d.ts +12 -0
- package/lib/channels/avatar-tool.d.ts.map +1 -0
- package/lib/channels/avatar-tool.js +78 -0
- package/lib/channels/avatar-tool.js.map +1 -0
- package/lib/channels/direct/avatar.d.ts +11 -0
- package/lib/channels/direct/avatar.d.ts.map +1 -0
- package/lib/channels/direct/avatar.js +57 -0
- package/lib/channels/direct/avatar.js.map +1 -0
- package/lib/channels/manager.d.ts +1 -0
- package/lib/channels/manager.d.ts.map +1 -1
- package/lib/channels/manager.js +67 -14
- package/lib/channels/manager.js.map +1 -1
- package/lib/channels/question-origin.d.ts +5 -0
- package/lib/channels/question-origin.d.ts.map +1 -0
- package/lib/channels/question-origin.js +14 -0
- package/lib/channels/question-origin.js.map +1 -0
- package/lib/client-controller.d.ts +1 -1
- package/lib/client-controller.d.ts.map +1 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +460 -239
- package/lib/client.js.map +4 -4
- package/lib/collaboration/composition.d.ts +2 -0
- package/lib/collaboration/composition.d.ts.map +1 -1
- package/lib/collaboration/composition.js +4 -0
- package/lib/collaboration/composition.js.map +1 -1
- package/lib/companions/removal.d.ts.map +1 -1
- package/lib/companions/removal.js +3 -0
- package/lib/companions/removal.js.map +1 -1
- package/lib/concern-store.d.ts +5 -1
- package/lib/concern-store.d.ts.map +1 -1
- package/lib/concern-store.js +13 -4
- package/lib/concern-store.js.map +1 -1
- package/lib/config.d.ts +1 -0
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +6 -0
- package/lib/config.js.map +1 -1
- package/lib/domain.d.ts +2 -0
- package/lib/domain.d.ts.map +1 -1
- package/lib/domain.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +165 -132
- package/lib/index.js.map +1 -1
- package/lib/memory-store.d.ts +4 -1
- package/lib/memory-store.d.ts.map +1 -1
- package/lib/memory-store.js +10 -2
- package/lib/memory-store.js.map +1 -1
- package/lib/notifications/domain.d.ts +2 -1
- package/lib/notifications/domain.d.ts.map +1 -1
- package/lib/notifications/store.d.ts +8 -0
- package/lib/notifications/store.d.ts.map +1 -1
- package/lib/notifications/store.js +81 -17
- package/lib/notifications/store.js.map +1 -1
- package/lib/pendant/reader.js +1 -1
- package/lib/pendant/reader.js.map +1 -1
- package/lib/pendant/widget.d.ts.map +1 -1
- package/lib/pendant/widget.js +5 -1
- package/lib/pendant/widget.js.map +1 -1
- package/lib/storage/atomic.d.ts +3 -0
- package/lib/storage/atomic.d.ts.map +1 -0
- package/lib/storage/atomic.js +35 -0
- package/lib/storage/atomic.js.map +1 -0
- package/lib/storage/bootstrap.d.ts +8 -0
- package/lib/storage/bootstrap.d.ts.map +1 -0
- package/lib/storage/bootstrap.js +31 -0
- package/lib/storage/bootstrap.js.map +1 -0
- package/lib/storage/coordinator.d.ts +36 -0
- package/lib/storage/coordinator.d.ts.map +1 -0
- package/lib/storage/coordinator.js +103 -0
- package/lib/storage/coordinator.js.map +1 -0
- package/lib/storage/layout.d.ts +13 -0
- package/lib/storage/layout.d.ts.map +1 -0
- package/lib/storage/layout.js +30 -0
- package/lib/storage/layout.js.map +1 -0
- package/lib/storage/lease.d.ts +5 -0
- package/lib/storage/lease.d.ts.map +1 -0
- package/lib/storage/lease.js +25 -0
- package/lib/storage/lease.js.map +1 -0
- package/lib/storage/legacy-backups.d.ts +3 -0
- package/lib/storage/legacy-backups.d.ts.map +1 -0
- package/lib/storage/legacy-backups.js +14 -0
- package/lib/storage/legacy-backups.js.map +1 -0
- package/lib/storage/migrate-layout.d.ts +18 -0
- package/lib/storage/migrate-layout.d.ts.map +1 -0
- package/lib/storage/migrate-layout.js +204 -0
- package/lib/storage/migrate-layout.js.map +1 -0
- package/lib/storage/migrations/index.d.ts +3 -0
- package/lib/storage/migrations/index.d.ts.map +1 -0
- package/lib/storage/migrations/index.js +4 -0
- package/lib/storage/migrations/index.js.map +1 -0
- package/lib/storage/migrations/registry.d.ts +19 -0
- package/lib/storage/migrations/registry.d.ts.map +1 -0
- package/lib/storage/migrations/registry.js +40 -0
- package/lib/storage/migrations/registry.js.map +1 -0
- package/lib/storage/migrations/v0-to-v1.d.ts +5 -0
- package/lib/storage/migrations/v0-to-v1.d.ts.map +1 -0
- package/lib/storage/migrations/v0-to-v1.js +11 -0
- package/lib/storage/migrations/v0-to-v1.js.map +1 -0
- package/lib/storage/notice.d.ts +4 -0
- package/lib/storage/notice.d.ts.map +1 -0
- package/lib/storage/notice.js +13 -0
- package/lib/storage/notice.js.map +1 -0
- package/lib/storage/preflight.d.ts +40 -0
- package/lib/storage/preflight.d.ts.map +1 -0
- package/lib/storage/preflight.js +208 -0
- package/lib/storage/preflight.js.map +1 -0
- package/lib/storage/safe-files.d.ts +6 -0
- package/lib/storage/safe-files.d.ts.map +1 -0
- package/lib/storage/safe-files.js +125 -0
- package/lib/storage/safe-files.js.map +1 -0
- package/lib/storage/source-archive.d.ts +14 -0
- package/lib/storage/source-archive.d.ts.map +1 -0
- package/lib/storage/source-archive.js +98 -0
- package/lib/storage/source-archive.js.map +1 -0
- package/lib/storage/split-state.d.ts +14 -0
- package/lib/storage/split-state.d.ts.map +1 -0
- package/lib/storage/split-state.js +107 -0
- package/lib/storage/split-state.js.map +1 -0
- package/lib/store.d.ts +5 -0
- package/lib/store.d.ts.map +1 -1
- package/lib/store.js +12 -1
- package/lib/store.js.map +1 -1
- package/lib/ui/storage-recovery-marker.d.ts +4 -0
- package/lib/ui/storage-recovery-marker.d.ts.map +1 -0
- package/lib/ui/storage-recovery-marker.js +19 -0
- package/lib/ui/storage-recovery-marker.js.map +1 -0
- package/lib/ui/storage-recovery.d.ts +20 -0
- package/lib/ui/storage-recovery.d.ts.map +1 -0
- package/lib/ui/storage-recovery.js +39 -0
- package/lib/ui/storage-recovery.js.map +1 -0
- package/lib/ui/storage-settings.d.ts +2 -0
- package/lib/ui/storage-settings.d.ts.map +1 -0
- package/lib/ui/storage-settings.js +90 -0
- package/lib/ui/storage-settings.js.map +1 -0
- package/lib/ui/workspace-navigation.d.ts +78 -0
- package/lib/ui/workspace-navigation.d.ts.map +1 -0
- package/lib/ui/workspace-navigation.js +28 -0
- package/lib/ui/workspace-navigation.js.map +1 -0
- package/package.json +5 -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
|
|
38
|
+
var import_react45 = 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
|
|
57
|
+
var import_dsh_client_ui_primitives22 = 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);
|
|
@@ -1380,6 +1380,7 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
|
|
|
1380
1380
|
:where(.dsh-partner-feature-page.is-board) button,
|
|
1381
1381
|
.dsh-partner-schedule-list button,
|
|
1382
1382
|
.dsh-partner-feature-form button,
|
|
1383
|
+
.dsh-partner-general-settings button,
|
|
1383
1384
|
.dsh-partner-task-form button,
|
|
1384
1385
|
.dsh-partner-schedule-form button { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; border: 1px solid var(--partner-border); border-radius: 9px; color: var(--partner-text-secondary); background: var(--partner-control); box-shadow: inset 0 1px 0 var(--partner-glass-highlight); font: 590 var(--partner-font-body)/1 var(--partner-font-family); cursor: pointer; transition: color .15s ease, border-color .15s ease, background .15s ease, transform .15s var(--partner-ease-out); }
|
|
1385
1386
|
.dsh-partner-feature-page button:not(:disabled):hover { color: var(--partner-text); border-color: color-mix(in srgb, var(--partner-text) 24%, var(--partner-border)); background: var(--partner-hover); }
|
|
@@ -1784,6 +1785,17 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
|
|
|
1784
1785
|
.dsh-partner-topbar [data-xiaohei-workspace-close]:active { transform: scale(.96); }
|
|
1785
1786
|
.dsh-partner-topbar [data-xiaohei-workspace-close] > svg { display: block; pointer-events: none; }
|
|
1786
1787
|
.dsh-partner-mobile-workspace-nav { display: none; }
|
|
1788
|
+
.dsh-partner-group-heading { flex: none; padding: 20px 24px 8px; }
|
|
1789
|
+
.dsh-partner-group-heading h1 { margin: 0; font-size: 20px; color: var(--partner-text); }
|
|
1790
|
+
.dsh-partner-group-tabs { flex-shrink: 0; flex-wrap: wrap; }
|
|
1791
|
+
.dsh-partner-general-settings { padding: 16px clamp(20px, 4vw, 46px); color: var(--partner-text); }
|
|
1792
|
+
.dsh-partner-general-settings h2 { font-size: 18px; }
|
|
1793
|
+
.dsh-partner-general-settings p { color: var(--partner-text-secondary); line-height: 1.7; overflow-wrap: anywhere; }
|
|
1794
|
+
.dsh-partner-migration-paths { display: grid; gap: 12px; margin-top: 12px; min-width: 0; }
|
|
1795
|
+
.dsh-partner-migration-paths > div { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--partner-border); border-radius: 10px; min-width: 0; }
|
|
1796
|
+
.dsh-partner-migration-paths code { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
|
|
1797
|
+
.dsh-partner-general-settings :is(summary,button) { min-height: 44px; }
|
|
1798
|
+
.dsh-partner-general-settings [role="alert"] { color: var(--partner-danger); overflow-wrap: anywhere; }
|
|
1787
1799
|
.dsh-partner-grid { display: grid; grid-template-columns: 214px minmax(520px, 1fr); min-width: 0; min-height: 0; padding: 8px 10px 10px; gap: 8px; }
|
|
1788
1800
|
|
|
1789
1801
|
.dsh-partner-roster { position: relative; display: flex; min-width: 0; min-height: 0; flex-direction: column; padding: 17px 10px 13px; overflow: hidden; border: 1px solid var(--partner-border); border-radius: 15px; background: var(--partner-pane); -webkit-backdrop-filter: var(--partner-frosted-filter); backdrop-filter: var(--partner-frosted-filter); box-shadow: var(--partner-glass-shadow); }
|
|
@@ -1822,7 +1834,7 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
|
|
|
1822
1834
|
.dsh-partner-roster-note small { font-size: var(--partner-font-caption); line-height: 1.5; }
|
|
1823
1835
|
|
|
1824
1836
|
.dsh-partner-stage { position: relative; display: grid; grid-template-rows: auto auto minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--partner-border); border-radius: 15px; background: var(--partner-pane); -webkit-backdrop-filter: var(--partner-frosted-filter); backdrop-filter: var(--partner-frosted-filter); box-shadow: var(--partner-glass-shadow); }
|
|
1825
|
-
.dsh-partner-stage.is-workspace-page { grid-template-rows: minmax(0, 1fr); }
|
|
1837
|
+
.dsh-partner-stage.is-workspace-page { grid-template-rows: auto auto minmax(0, 1fr); }
|
|
1826
1838
|
.dsh-partner-identity { display: flex; align-items: center; gap: 12px; min-height: 86px; padding: 18px clamp(20px, 4vw, 46px) 13px; }
|
|
1827
1839
|
.dsh-partner-identity > span:nth-child(2) { display: grid; min-width: 0; flex: 1; gap: 3px; }
|
|
1828
1840
|
.dsh-partner-identity h1 { margin: 0; font-size: var(--partner-font-heading); line-height: 1.15; font-weight: 650; letter-spacing: -.025em; }
|
|
@@ -2650,7 +2662,7 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
|
|
|
2650
2662
|
.dsh-partner-access-list { grid-template-columns: 1fr; }
|
|
2651
2663
|
.dsh-partner-runtime-fields { grid-template-columns: 1fr; }
|
|
2652
2664
|
.dsh-partner-topbar { align-items: stretch; flex-direction: column; gap: 7px; padding: 7px 9px; }
|
|
2653
|
-
.dsh-partner-mobile-workspace-nav { display: grid; grid-template-columns: repeat(
|
|
2665
|
+
.dsh-partner-mobile-workspace-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
|
|
2654
2666
|
.dsh-partner-mobile-workspace-nav button { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 5px; padding: 0 8px; border: 1px solid transparent; border-radius: 9px; color: var(--partner-text-tertiary); background: transparent; font: 580 var(--partner-font-caption)/1 var(--partner-font-family); cursor: pointer; }
|
|
2655
2667
|
.dsh-partner-mobile-workspace-nav button.is-active { border-color: var(--partner-border); color: var(--partner-text); background: var(--partner-selected); }
|
|
2656
2668
|
.dsh-partner-grid { grid-template-columns: 1fr; }
|
|
@@ -12478,7 +12490,7 @@ function PendantReader({ inbox, selected, error, anchor, onSelect, onClose, onVi
|
|
|
12478
12490
|
!detail && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "dsh-partner-pendant-reader-icon", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_dsh_client_ui_primitives9.IconNewChatOutline16, { size: 18 }) }),
|
|
12479
12491
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "dsh-partner-pendant-reader-heading", children: [
|
|
12480
12492
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("strong", { children: detail ? detail.companionName : "\u4F19\u4F34\u6D88\u606F" }),
|
|
12481
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { children: detail ? "\u6765\u81EA\u4F19\u4F34\u7684\u6D88\u606F" : "\u56DE\u590D\u4E0E\u4EFB\u52A1\u52A8\u6001" })
|
|
12493
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { children: detail ? detail.kind === "system" ? "\u63D2\u4EF6\u7CFB\u7EDF\u901A\u77E5" : "\u6765\u81EA\u4F19\u4F34\u7684\u6D88\u606F" : "\u56DE\u590D\u4E0E\u4EFB\u52A1\u52A8\u6001" })
|
|
12482
12494
|
] }),
|
|
12483
12495
|
!!inbox.unread && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "dsh-partner-pendant-reader-count", "aria-label": `${inbox.unread} \u6761\u672A\u8BFB`, children: inbox.unread }),
|
|
12484
12496
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", "aria-label": "\u5173\u95ED\u4F19\u4F34\u6D88\u606F", onClick: (event) => onClose(event.detail === 0), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_dsh_client_ui_primitives9.IconCloseOutline16, { size: 16 }) })
|
|
@@ -12487,7 +12499,7 @@ function PendantReader({ inbox, selected, error, anchor, onSelect, onClose, onVi
|
|
|
12487
12499
|
detail ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
12488
12500
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("article", { className: "dsh-partner-pendant-detail", children: [
|
|
12489
12501
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "dsh-partner-pendant-reader-meta", children: [
|
|
12490
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: detail.kind === "task" ? "\u4EFB\u52A1\u52A8\u6001" : detail.kind === "schedule" ? "\u5B9A\u65F6\u4EFB\u52A1" : "\u4F1A\u8BDD\u56DE\u590D" }),
|
|
12502
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: detail.kind === "system" ? "\u5347\u7EA7\u63D0\u9192" : detail.kind === "task" ? "\u4EFB\u52A1\u52A8\u6001" : detail.kind === "schedule" ? "\u5B9A\u65F6\u4EFB\u52A1" : "\u4F1A\u8BDD\u56DE\u590D" }),
|
|
12491
12503
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("time", { dateTime: new Date(detail.createdAt).toISOString(), children: new Date(detail.createdAt).toLocaleString([], { month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit" }) })
|
|
12492
12504
|
] }),
|
|
12493
12505
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h3", { children: detail.title }),
|
|
@@ -12500,7 +12512,7 @@ function PendantReader({ inbox, selected, error, anchor, onSelect, onClose, onVi
|
|
|
12500
12512
|
] }),
|
|
12501
12513
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("button", { type: "button", className: "dsh-partner-pendant-source", onClick: () => onVisit(detail), children: [
|
|
12502
12514
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_dsh_client_ui_primitives9.IconLinkOutline16, { size: 15 }),
|
|
12503
|
-
detail.kind === "task" ? "\u67E5\u770B\u4EFB\u52A1" : detail.kind === "schedule" ? "\u67E5\u770B\u5B9A\u65F6\u4EFB\u52A1" : "\u8FDB\u5165\u4F1A\u8BDD"
|
|
12515
|
+
detail.kind === "system" ? "\u524D\u5F80\u5347\u7EA7\u8FC1\u79FB" : detail.kind === "task" ? "\u67E5\u770B\u4EFB\u52A1" : detail.kind === "schedule" ? "\u67E5\u770B\u5B9A\u65F6\u4EFB\u52A1" : "\u8FDB\u5165\u4F1A\u8BDD"
|
|
12504
12516
|
] })
|
|
12505
12517
|
] })
|
|
12506
12518
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
@@ -12533,6 +12545,7 @@ function PendantReader({ inbox, selected, error, anchor, onSelect, onClose, onVi
|
|
|
12533
12545
|
// src/pendant/widget.tsx
|
|
12534
12546
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
12535
12547
|
function messageLabel(notice) {
|
|
12548
|
+
if (notice.kind === "system") return "\u9700\u8981\u5347\u7EA7\u8FC1\u79FB";
|
|
12536
12549
|
if (notice.kind === "reply") return "\u6709\u65B0\u56DE\u590D";
|
|
12537
12550
|
if (notice.kind === "task" && notice.title.startsWith("\u9047\u5230\u963B\u585E \xB7 ")) return "\u4EFB\u52A1\u53D7\u963B";
|
|
12538
12551
|
if (notice.kind === "schedule" && notice.title.startsWith("\u672A\u5B8C\u6210 \xB7 ")) return "\u5C1A\u672A\u5B8C\u6210";
|
|
@@ -12622,7 +12635,8 @@ function ActivePendant({ controller, settings }) {
|
|
|
12622
12635
|
const visit = async (item) => {
|
|
12623
12636
|
setNavigationError("");
|
|
12624
12637
|
try {
|
|
12625
|
-
if (item.
|
|
12638
|
+
if (item.kind === "system" && item.action === "storage-migration") controller.open(void 0, { page: "general" });
|
|
12639
|
+
else if (item.routeId && item.sessionId) await controller.openSession(item.routeId, item.sessionId);
|
|
12626
12640
|
else controller.open(item.companionId, { page: item.kind === "task" ? "board" : item.kind === "schedule" ? "schedules" : "home", ...item.taskId ? { taskId: item.taskId } : {} });
|
|
12627
12641
|
close();
|
|
12628
12642
|
} catch (reason) {
|
|
@@ -12771,6 +12785,29 @@ function useWorkspaceTopAnchor(ref) {
|
|
|
12771
12785
|
}, [ref]);
|
|
12772
12786
|
}
|
|
12773
12787
|
|
|
12788
|
+
// src/ui/storage-recovery-marker.ts
|
|
12789
|
+
var KEY2 = "dsh-partner:storage-recovery";
|
|
12790
|
+
function pendingStorageRecovery() {
|
|
12791
|
+
try {
|
|
12792
|
+
const value = JSON.parse(sessionStorage.getItem(KEY2) ?? "null");
|
|
12793
|
+
if (value && Number.isSafeInteger(value.target) && value.target > 0 && Date.now() - value.at < 30 * 6e4) return value.target;
|
|
12794
|
+
} catch {
|
|
12795
|
+
}
|
|
12796
|
+
return void 0;
|
|
12797
|
+
}
|
|
12798
|
+
function rememberStorageRecovery(target) {
|
|
12799
|
+
try {
|
|
12800
|
+
sessionStorage.setItem(KEY2, JSON.stringify({ target, at: Date.now() }));
|
|
12801
|
+
} catch {
|
|
12802
|
+
}
|
|
12803
|
+
}
|
|
12804
|
+
function clearStorageRecovery() {
|
|
12805
|
+
try {
|
|
12806
|
+
sessionStorage.removeItem(KEY2);
|
|
12807
|
+
} catch {
|
|
12808
|
+
}
|
|
12809
|
+
}
|
|
12810
|
+
|
|
12774
12811
|
// src/glass-surface.tsx
|
|
12775
12812
|
var import_react27 = require("react");
|
|
12776
12813
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
@@ -15809,8 +15846,224 @@ function sessions(ctx) {
|
|
|
15809
15846
|
return ctx.sessions;
|
|
15810
15847
|
}
|
|
15811
15848
|
|
|
15812
|
-
// src/
|
|
15849
|
+
// src/ui/workspace-navigation.tsx
|
|
15850
|
+
var import_dsh_client_ui_primitives21 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
15851
|
+
|
|
15852
|
+
// src/ui/storage-settings.tsx
|
|
15853
|
+
var import_react44 = require("react");
|
|
15854
|
+
|
|
15855
|
+
// src/ui/storage-recovery.ts
|
|
15856
|
+
var StorageStatusError = class extends Error {
|
|
15857
|
+
constructor(status) {
|
|
15858
|
+
super(status === 401 || status === 403 ? "\u767B\u5F55\u5DF2\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u540E\u68C0\u67E5\u8FC1\u79FB\u72B6\u6001" : `\u72B6\u6001\u8BF7\u6C42\u5931\u8D25\uFF08${status}\uFF09`);
|
|
15859
|
+
this.status = status;
|
|
15860
|
+
}
|
|
15861
|
+
};
|
|
15862
|
+
async function readStorageStatus(signal) {
|
|
15863
|
+
const response = await fetch(`${PARTNER_API}/storage/status`, { signal: AbortSignal.any([signal, AbortSignal.timeout(8e3)]), cache: "no-store" });
|
|
15864
|
+
if (!response.ok) throw new StorageStatusError(response.status);
|
|
15865
|
+
const value = await response.json();
|
|
15866
|
+
if (!Number.isSafeInteger(value.currentVersion) || !Number.isSafeInteger(value.targetVersion)) throw Error("\u8FC1\u79FB\u72B6\u6001\u54CD\u5E94\u65E0\u6548");
|
|
15867
|
+
return value;
|
|
15868
|
+
}
|
|
15869
|
+
function pause(ms, signal) {
|
|
15870
|
+
return new Promise((resolve, reject) => {
|
|
15871
|
+
signal.throwIfAborted();
|
|
15872
|
+
const stop = () => {
|
|
15873
|
+
clearTimeout(timer2);
|
|
15874
|
+
reject(signal.reason);
|
|
15875
|
+
};
|
|
15876
|
+
const timer2 = setTimeout(() => {
|
|
15877
|
+
signal.removeEventListener("abort", stop);
|
|
15878
|
+
resolve();
|
|
15879
|
+
}, ms);
|
|
15880
|
+
signal.addEventListener("abort", stop, { once: true });
|
|
15881
|
+
});
|
|
15882
|
+
}
|
|
15883
|
+
async function waitForStorage(signal, onWait, options = {}) {
|
|
15884
|
+
const read = options.read ?? readStorageStatus;
|
|
15885
|
+
for (let attempt = 0; attempt < (options.attempts ?? 60); attempt++) {
|
|
15886
|
+
signal.throwIfAborted();
|
|
15887
|
+
try {
|
|
15888
|
+
const value = await read(signal);
|
|
15889
|
+
if (!value.running) return value;
|
|
15890
|
+
} catch (error) {
|
|
15891
|
+
signal.throwIfAborted();
|
|
15892
|
+
if (error instanceof StorageStatusError && ![404, 408, 429, 502, 503, 504].includes(error.status)) throw error;
|
|
15893
|
+
}
|
|
15894
|
+
onWait();
|
|
15895
|
+
await pause(options.delayMs ?? 2e3, signal);
|
|
15896
|
+
}
|
|
15897
|
+
throw Error("\u670D\u52A1\u5C1A\u672A\u6062\u590D\uFF0C\u5DF2\u505C\u6B62\u81EA\u52A8\u68C0\u67E5\u3002\u8BF7\u7A0D\u540E\u70B9\u51FB\u300C\u91CD\u65B0\u8FDE\u63A5\u300D\uFF1B\u4E0D\u8981\u91CD\u590D\u63D0\u4EA4\u8FC1\u79FB\u3002");
|
|
15898
|
+
}
|
|
15899
|
+
|
|
15900
|
+
// src/ui/storage-settings.tsx
|
|
15813
15901
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
15902
|
+
function GeneralSettingsPanel() {
|
|
15903
|
+
const [version, setVersion] = (0, import_react44.useState)();
|
|
15904
|
+
const [inspection, setInspection] = (0, import_react44.useState)();
|
|
15905
|
+
const [busy, setBusy] = (0, import_react44.useState)(false), [confirm, setConfirm] = (0, import_react44.useState)(false);
|
|
15906
|
+
const [error, setError] = (0, import_react44.useState)(""), [notice, setNotice] = (0, import_react44.useState)("");
|
|
15907
|
+
const request = (0, import_react44.useRef)();
|
|
15908
|
+
const mounted = (0, import_react44.useRef)(true);
|
|
15909
|
+
const [reconnect, setReconnect] = (0, import_react44.useState)(false);
|
|
15910
|
+
const [cleanupPending, setCleanupPending] = (0, import_react44.useState)(0);
|
|
15911
|
+
const cleanup = version === 1 && cleanupPending > 0;
|
|
15912
|
+
const recover = async (expected = pendingStorageRecovery()) => {
|
|
15913
|
+
request.current?.abort();
|
|
15914
|
+
const controller = new AbortController();
|
|
15915
|
+
request.current = controller;
|
|
15916
|
+
setBusy(true);
|
|
15917
|
+
setError("");
|
|
15918
|
+
setReconnect(false);
|
|
15919
|
+
try {
|
|
15920
|
+
const status = await waitForStorage(controller.signal, () => setNotice("\u8FC1\u79FB\u6216\u670D\u52A1\u91CD\u8F7D\u4E2D\uFF0C\u6B63\u5728\u81EA\u52A8\u7B49\u5F85\u6062\u590D\u2026\u8BF7\u52FF\u91CD\u590D\u63D0\u4EA4\u3002"));
|
|
15921
|
+
clearStorageRecovery();
|
|
15922
|
+
setVersion(status.currentVersion);
|
|
15923
|
+
setInspection(void 0);
|
|
15924
|
+
setCleanupPending(status.cleanupPending ?? 0);
|
|
15925
|
+
if (status.currentVersion >= status.targetVersion) {
|
|
15926
|
+
setNotice(`\u5DF2\u8FDE\u63A5\uFF0C\u5B58\u50A8\u7248\u672C v${status.currentVersion}\u3002${status.cleanupPending ? "\u6709\u65E7\u8DEF\u5F84\u5C1A\u672A\u6E05\u7406\uFF0C\u539F\u6587\u4EF6\u5DF2\u4FDD\u7559\uFF0C\u8BF7\u6838\u67E5\u3002" : "\u8FC1\u79FB\u5DF2\u5B8C\u6210\u3002"}${status.backupPath ? ` \u5B8C\u6574\u5907\u4EFD\uFF1A${status.backupPath}` : ""}`);
|
|
15927
|
+
} else {
|
|
15928
|
+
setNotice("");
|
|
15929
|
+
if (expected !== void 0) setError(status.lastError || "\u670D\u52A1\u5DF2\u6062\u590D\uFF0C\u4F46\u8FC1\u79FB\u5C1A\u672A\u63D0\u4EA4\u3002\u8BF7\u91CD\u65B0\u68C0\u67E5\u539F\u56E0\uFF0C\u518D\u624B\u52A8\u8FC1\u79FB\u3002");
|
|
15930
|
+
}
|
|
15931
|
+
} catch (e) {
|
|
15932
|
+
if (!controller.signal.aborted) {
|
|
15933
|
+
setNotice("");
|
|
15934
|
+
setError(errorMessage(e));
|
|
15935
|
+
setReconnect(true);
|
|
15936
|
+
}
|
|
15937
|
+
} finally {
|
|
15938
|
+
if (!controller.signal.aborted) setBusy(false);
|
|
15939
|
+
}
|
|
15940
|
+
};
|
|
15941
|
+
(0, import_react44.useEffect)(() => {
|
|
15942
|
+
mounted.current = true;
|
|
15943
|
+
void recover();
|
|
15944
|
+
return () => {
|
|
15945
|
+
mounted.current = false;
|
|
15946
|
+
request.current?.abort();
|
|
15947
|
+
};
|
|
15948
|
+
}, []);
|
|
15949
|
+
const inspect = async () => {
|
|
15950
|
+
setBusy(true);
|
|
15951
|
+
setError("");
|
|
15952
|
+
setNotice("");
|
|
15953
|
+
try {
|
|
15954
|
+
const result = await api("/storage/inspect");
|
|
15955
|
+
setInspection(result);
|
|
15956
|
+
setVersion(result.currentVersion);
|
|
15957
|
+
} catch (e) {
|
|
15958
|
+
setError(errorMessage(e));
|
|
15959
|
+
} finally {
|
|
15960
|
+
setBusy(false);
|
|
15961
|
+
}
|
|
15962
|
+
};
|
|
15963
|
+
const migrate = async () => {
|
|
15964
|
+
if (busy || !cleanup && !inspection?.migrationAvailable) return;
|
|
15965
|
+
setBusy(true);
|
|
15966
|
+
setError("");
|
|
15967
|
+
setConfirm(false);
|
|
15968
|
+
setNotice("\u6B63\u5728\u63D0\u4EA4\u8FC1\u79FB\uFF0C\u5B8C\u6210\u540E\u4F1A\u81EA\u52A8\u91CD\u65B0\u8FDE\u63A5\u2026");
|
|
15969
|
+
const expected = cleanup ? 1 : inspection.targetVersion;
|
|
15970
|
+
rememberStorageRecovery(expected);
|
|
15971
|
+
try {
|
|
15972
|
+
await api(cleanup ? "/storage/cleanup" : "/storage/migrate", { method: "POST", signal: AbortSignal.timeout(15e3), body: JSON.stringify({ confirm: true, expectedVersion: cleanup ? 1 : inspection.currentVersion }) });
|
|
15973
|
+
} catch {
|
|
15974
|
+
if (mounted.current) setNotice("\u8FDE\u63A5\u6682\u65F6\u4E2D\u65AD\uFF0C\u6B63\u5728\u6838\u5BF9\u5B9E\u9645\u8FC1\u79FB\u7ED3\u679C\u2026");
|
|
15975
|
+
}
|
|
15976
|
+
if (mounted.current) await recover(expected);
|
|
15977
|
+
};
|
|
15978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("section", { className: "dsh-partner-general-settings", "aria-busy": busy, children: [
|
|
15979
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h2", { children: "\u57FA\u672C\u8BBE\u7F6E" }),
|
|
15980
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(WorkspaceBlock, { title: "\u5347\u7EA7\u8FC1\u79FB", detail: "\u624B\u52A8\u6574\u7406\u516C\u5171\u6570\u636E\u548C\u6BCF\u4F4D\u4F19\u4F34\u7684\u79C1\u6709\u76EE\u5F55\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6267\u884C\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("button", { type: "button", disabled: busy, onClick: () => void inspect(), children: busy ? "\u5904\u7406\u4E2D\u2026" : "\u68C0\u67E5\u8FC1\u79FB" }), children: [
|
|
15981
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("p", { children: [
|
|
15982
|
+
"\u6570\u636E\u5B58\u50A8\u7248\u672C\uFF1A",
|
|
15983
|
+
version === void 0 ? "\u6B63\u5728\u8BFB\u53D6\u2026" : `v${version}${version === 0 ? " \xB7 \u5F85\u8FC1\u79FB" : " \xB7 \u5DF2\u5347\u7EA7"}`
|
|
15984
|
+
] }),
|
|
15985
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { children: "\u5347\u7EA7\u524D\u8BF7\u7ED3\u675F\u4F19\u4F34\u4F1A\u8BDD\u548C\u540E\u53F0\u6267\u884C\u3002\u5B8C\u6574\u5907\u4EFD\u5E76\u6821\u9A8C\u540E\u624D\u6E05\u7406\u5DF2\u8FC1\u79FB\u7684\u65E7\u8DEF\u5F84\uFF0C\u4E0D\u4FEE\u6539\u7528\u6237\u5DE5\u4F5C\u6587\u6863\uFF1B\u670D\u52A1\u91CD\u8F7D\u540E\u81EA\u52A8\u91CD\u65B0\u8FDE\u63A5\u3002" }),
|
|
15986
|
+
inspection && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
15987
|
+
inspection.steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("p", { children: [
|
|
15988
|
+
"v",
|
|
15989
|
+
step.from,
|
|
15990
|
+
" \u2192 v",
|
|
15991
|
+
step.to,
|
|
15992
|
+
" \xB7 ",
|
|
15993
|
+
step.title
|
|
15994
|
+
] }, step.id)),
|
|
15995
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("details", { children: [
|
|
15996
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("summary", { children: "\u67E5\u770B\u76EE\u5F55\u4E0E\u68C0\u67E5\u8BE6\u60C5" }),
|
|
15997
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "dsh-partner-migration-paths", children: inspection.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { children: [
|
|
15998
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("strong", { children: item.label }),
|
|
15999
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("code", { children: item.source }),
|
|
16000
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: "\u8FC1\u79FB\u81F3" }),
|
|
16001
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("code", { children: item.target }),
|
|
16002
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("small", { children: item.exists ? `${item.files} \u4E2A\u6587\u4EF6 \xB7 ${(item.bytes / 1024 / 1024).toFixed(2)} MB` : "\u5F53\u524D\u65E0\u6587\u4EF6" })
|
|
16003
|
+
] }, i)) }),
|
|
16004
|
+
inspection.notices.map((text4, i) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { children: text4 }, i))
|
|
16005
|
+
] }),
|
|
16006
|
+
!!inspection.blockers.length && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { role: "alert", children: [
|
|
16007
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { children: "\u4EE5\u4E0B\u95EE\u9898\u9700\u8981\u5148\u5904\u7406\uFF1A" }),
|
|
16008
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("ul", { children: inspection.blockers.map((text4, i) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("li", { children: text4 }, i)) })
|
|
16009
|
+
] }),
|
|
16010
|
+
inspection.migrationAvailable && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => setConfirm(true), children: "\u5347\u7EA7\u8FC1\u79FB" })
|
|
16011
|
+
] }),
|
|
16012
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { role: "alert", children: error }),
|
|
16013
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { role: "status", children: notice }),
|
|
16014
|
+
reconnect && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("button", { type: "button", disabled: busy, onClick: () => void recover(), children: "\u91CD\u65B0\u8FDE\u63A5" }),
|
|
16015
|
+
cleanup && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(true), children: "\u91CD\u8BD5\u6E05\u7406\u65E7\u8DEF\u5F84" })
|
|
16016
|
+
] }),
|
|
16017
|
+
confirm && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(WorkspaceDialog, { title: cleanup ? "\u786E\u8BA4\u6E05\u7406\u65E7\u8DEF\u5F84" : "\u786E\u8BA4\u5347\u7EA7\u8FC1\u79FB", detail: cleanup ? "\u91CD\u65B0\u6838\u5BF9\u5B8C\u6574\u5907\u4EFD\uFF0C\u53EA\u6E05\u7406\u672A\u53D8\u5316\u7684\u65E7\u6587\u4EF6\uFF0C\u4E0D\u91CD\u65B0\u8FC1\u79FB\u6D3B\u52A8\u6570\u636E\u3002" : "\u516C\u5171\u6570\u636E\u4E0E\u6240\u6709\u4F19\u4F34\u79C1\u6709\u6570\u636E\u5C06\u4E00\u8D77\u8FC1\u79FB\uFF0C\u5168\u90E8\u6821\u9A8C\u540E\u624D\u5207\u6362\u76EE\u5F55\u7248\u672C\u3002", close: () => {
|
|
16018
|
+
if (!busy) setConfirm(false);
|
|
16019
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("form", { className: "dsh-partner-feature-form", onSubmit: (event) => {
|
|
16020
|
+
event.preventDefault();
|
|
16021
|
+
void migrate();
|
|
16022
|
+
}, children: [
|
|
16023
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "is-wide", children: "\u5148\u5B8C\u6574\u5907\u4EFD\uFF0C\u7248\u672C\u63D0\u4EA4\u540E\u6E05\u7406\u5DF2\u6838\u9A8C\u7684\u65E7\u8DEF\u5F84\uFF1B\u5386\u53F2\u8BB0\u5FC6\u5907\u4EFD\u4F1A\u539F\u6837\u5F52\u6863\u3002\u5907\u4EFD\u4E0D\u4F1A\u81EA\u52A8\u5220\u9664\u3002\u8FC1\u79FB\u671F\u95F4\u8BF7\u52FF\u7F16\u8F91\u6587\u4EF6\u3001\u4FEE\u6539\u63D2\u4EF6\u914D\u7F6E\u6216\u542F\u52A8\u5176\u4ED6\u5B9E\u4F8B\u3002" }),
|
|
16024
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "is-wide", children: "\u8D26\u53F7\u51ED\u636E\u548C\u5BBF\u4E3B\u4F1A\u8BDD\u4E0D\u642C\u52A8\u3002\u5347\u7EA7\u540E\u4E0D\u8981\u76F4\u63A5\u5B89\u88C5\u4E0D\u652F\u6301\u65B0\u7248\u5B58\u50A8\u7684\u65E7\u63D2\u4EF6\u3002" }),
|
|
16025
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("footer", { children: [
|
|
16026
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(false), children: "\u53D6\u6D88" }),
|
|
16027
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u6B63\u5728\u5904\u7406\uFF0C\u8BF7\u52FF\u5173\u95ED\u2026" : cleanup ? "\u786E\u8BA4\u6E05\u7406\u5DF2\u5907\u4EFD\u7684\u65E7\u8DEF\u5F84" : "\u786E\u8BA4\u8FC1\u79FB\u76EE\u5F55\u548C\u6570\u636E" })
|
|
16028
|
+
] })
|
|
16029
|
+
] }) })
|
|
16030
|
+
] });
|
|
16031
|
+
}
|
|
16032
|
+
|
|
16033
|
+
// src/ui/workspace-navigation.tsx
|
|
16034
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
16035
|
+
var workspaceGroups = [
|
|
16036
|
+
{ id: "features", label: "\u529F\u80FD", detail: "\u80FD\u529B\u3001\u534F\u4F5C\u4E0E\u8BA1\u5212", icon: import_dsh_client_ui_primitives21.IconBrowseOutline16, pages: [
|
|
16037
|
+
{ id: "skills", label: "Skill \u5E02\u573A", icon: import_dsh_client_ui_primitives21.IconBrowseOutline16 },
|
|
16038
|
+
{ id: "board", label: "\u4EFB\u52A1\u770B\u677F", icon: import_dsh_client_ui_primitives21.IconListPenOutline16 },
|
|
16039
|
+
{ id: "schedules", label: "\u5B9A\u65F6\u4EFB\u52A1", icon: import_dsh_client_ui_primitives21.IconPlayOutline16 }
|
|
16040
|
+
] },
|
|
16041
|
+
{ id: "settings", label: "\u8BBE\u7F6E", detail: "\u57FA\u672C\u8BBE\u7F6E\u4E0E\u5361\u7247\u5916\u89C2", icon: import_dsh_client_ui_primitives21.IconEditOutline16, pages: [
|
|
16042
|
+
{ id: "general", label: "\u57FA\u672C\u8BBE\u7F6E", icon: import_dsh_client_ui_primitives21.IconEditOutline16 },
|
|
16043
|
+
{ id: "pendant", label: "\u5361\u7247\u8BBE\u7F6E", icon: import_dsh_client_ui_primitives21.IconEditOutline16 }
|
|
16044
|
+
] }
|
|
16045
|
+
];
|
|
16046
|
+
var workspaceGroup = (page) => workspaceGroups.find((group) => group.pages.some((item) => item.id === page));
|
|
16047
|
+
function WorkspaceGroupLinks({ view, open, compact = false }) {
|
|
16048
|
+
const active2 = workspaceGroup(view);
|
|
16049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_jsx_runtime40.Fragment, { children: workspaceGroups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("button", { type: "button", className: active2?.id === group.id ? "is-active" : "", "aria-current": active2?.id === group.id ? "page" : void 0, onClick: () => {
|
|
16050
|
+
if (active2?.id !== group.id) open(group.pages[0].id);
|
|
16051
|
+
}, children: [
|
|
16052
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(group.icon, { size: 16 }) }),
|
|
16053
|
+
compact ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: group.label }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
16054
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("strong", { children: group.label }),
|
|
16055
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("small", { children: group.detail })
|
|
16056
|
+
] })
|
|
16057
|
+
] }, group.id)) });
|
|
16058
|
+
}
|
|
16059
|
+
function WorkspaceGroupTabs({ view, open }) {
|
|
16060
|
+
const group = workspaceGroup(view);
|
|
16061
|
+
if (!group) return null;
|
|
16062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("nav", { className: "dsh-partner-tabs dsh-partner-group-tabs", "aria-label": `${group.label}\u6807\u7B7E\u9875`, children: group.pages.map((page) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TabButton, { active: view === page.id, onClick: () => open(page.id), icon: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(page.icon, { size: 16 }), children: page.label }, page.id)) });
|
|
16063
|
+
}
|
|
16064
|
+
|
|
16065
|
+
// src/client.tsx
|
|
16066
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
15814
16067
|
var PLUGIN_ID = "@lemoncat7/dsh-partner";
|
|
15815
16068
|
var STYLE_ID = `${PLUGIN_ID}/client`;
|
|
15816
16069
|
var cssText = `${client_default}
|
|
@@ -15823,29 +16076,30 @@ ${settings_panel_default}
|
|
|
15823
16076
|
${memory_ui_default}
|
|
15824
16077
|
${identity_editor_default}
|
|
15825
16078
|
${form_surface_default}`;
|
|
15826
|
-
var WORKSPACE_PAGES = /* @__PURE__ */ new Set(["skills", "board", "schedules", "pendant"]);
|
|
16079
|
+
var WORKSPACE_PAGES = /* @__PURE__ */ new Set(["skills", "board", "schedules", "pendant", "general"]);
|
|
15827
16080
|
var inject = ["slots", "layout", "sessions"];
|
|
15828
16081
|
function apply(ctx) {
|
|
15829
16082
|
ctx.effect(installStyles, "dsh-partner: styles");
|
|
15830
|
-
const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0,
|
|
15831
|
-
|
|
16083
|
+
const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(PartnerWorkspace, { ...props, controller: current2 }));
|
|
16084
|
+
if (pendingStorageRecovery() !== void 0) controller.open(void 0, { page: "general" });
|
|
16085
|
+
ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(PartnerPendant, { controller })));
|
|
15832
16086
|
ctx.effect(() => observePluginWorkspace(PLUGIN_ID, controller.close), "dsh-partner: exclusive workspace");
|
|
15833
16087
|
ctx.effect(() => () => controller.close(), "dsh-partner: workspace lifecycle");
|
|
15834
16088
|
ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({
|
|
15835
16089
|
name: "sidebar.footer.action",
|
|
15836
16090
|
id: "partner",
|
|
15837
16091
|
order: -120
|
|
15838
|
-
}, (props) => /* @__PURE__ */ (0,
|
|
16092
|
+
}, (props) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
|
|
15839
16093
|
}
|
|
15840
16094
|
function PartnerSidebar(props) {
|
|
15841
|
-
const ref = (0,
|
|
16095
|
+
const ref = (0, import_react45.useRef)(null);
|
|
15842
16096
|
useWorkspaceTopAnchor(ref);
|
|
15843
|
-
const [open, setOpen] = (0,
|
|
15844
|
-
const [snapshot, setSnapshot] = (0,
|
|
16097
|
+
const [open, setOpen] = (0, import_react45.useState)(true);
|
|
16098
|
+
const [snapshot, setSnapshot] = (0, import_react45.useState)();
|
|
15845
16099
|
useChannelStatus(setSnapshot);
|
|
15846
|
-
const [, update] = (0,
|
|
15847
|
-
(0,
|
|
15848
|
-
(0,
|
|
16100
|
+
const [, update] = (0, import_react45.useState)(0);
|
|
16101
|
+
(0, import_react45.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
|
|
16102
|
+
(0, import_react45.useEffect)(() => {
|
|
15849
16103
|
void loadPartner().then(setSnapshot).catch(() => {
|
|
15850
16104
|
});
|
|
15851
16105
|
}, [props.controller.isOpen()]);
|
|
@@ -15853,35 +16107,35 @@ function PartnerSidebar(props) {
|
|
|
15853
16107
|
props.controller.open(id);
|
|
15854
16108
|
if (props.wide && window.matchMedia("(max-width: 820px)").matches) props.collapse();
|
|
15855
16109
|
};
|
|
15856
|
-
if (!props.wide) return /* @__PURE__ */ (0,
|
|
15857
|
-
return /* @__PURE__ */ (0,
|
|
15858
|
-
/* @__PURE__ */ (0,
|
|
15859
|
-
/* @__PURE__ */ (0,
|
|
16110
|
+
if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime41.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_runtime41.jsx)(import_dsh_client_ui_primitives22.IconAgentPresetOutline16, { size: 18 }) }) });
|
|
16111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
|
|
16112
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
|
|
16113
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconChevronDownOutline14, { size: 14 }) }),
|
|
15860
16114
|
"\u4F19\u4F34"
|
|
15861
16115
|
] }) }),
|
|
15862
|
-
/* @__PURE__ */ (0,
|
|
15863
|
-
/* @__PURE__ */ (0,
|
|
15864
|
-
/* @__PURE__ */ (0,
|
|
15865
|
-
/* @__PURE__ */ (0,
|
|
15866
|
-
/* @__PURE__ */ (0,
|
|
16116
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
|
|
16117
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconAgentPresetOutline16, { size: 16 }) }),
|
|
16118
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { children: [
|
|
16119
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
|
|
16120
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: snapshot ? `${snapshot.companions.length} \u4F4D\u4F19\u4F34 \xB7 ${snapshot.channels.filter((item) => item.runtimeStatus === "running").length} \u4E2A\u6E20\u9053\u5728\u7EBF` : "\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E\u6E20\u9053" })
|
|
15867
16121
|
] }),
|
|
15868
|
-
/* @__PURE__ */ (0,
|
|
16122
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
|
|
15869
16123
|
] }) }) })
|
|
15870
16124
|
] });
|
|
15871
16125
|
}
|
|
15872
16126
|
function PartnerWorkspace({ controller }) {
|
|
15873
|
-
const [snapshot, setSnapshot] = (0,
|
|
16127
|
+
const [snapshot, setSnapshot] = (0, import_react45.useState)();
|
|
15874
16128
|
useChannelStatus(setSnapshot);
|
|
15875
|
-
const [selectedId, setSelectedId] = (0,
|
|
15876
|
-
const [view, setView] = (0,
|
|
15877
|
-
const [requestedDestination, setRequestedDestination] = (0,
|
|
15878
|
-
const [error, setError] = (0,
|
|
15879
|
-
const [loading, setLoading] = (0,
|
|
15880
|
-
const [creatingCompanion, setCreatingCompanion] = (0,
|
|
15881
|
-
const [notice, setNotice] = (0,
|
|
15882
|
-
const selectionRef = (0,
|
|
16129
|
+
const [selectedId, setSelectedId] = (0, import_react45.useState)(controller.selected());
|
|
16130
|
+
const [view, setView] = (0, import_react45.useState)(controller.destination()?.page ?? "home");
|
|
16131
|
+
const [requestedDestination, setRequestedDestination] = (0, import_react45.useState)(controller.destination());
|
|
16132
|
+
const [error, setError] = (0, import_react45.useState)();
|
|
16133
|
+
const [loading, setLoading] = (0, import_react45.useState)(true);
|
|
16134
|
+
const [creatingCompanion, setCreatingCompanion] = (0, import_react45.useState)(false);
|
|
16135
|
+
const [notice, setNotice] = (0, import_react45.useState)();
|
|
16136
|
+
const selectionRef = (0, import_react45.useRef)({ selectedId, companions: snapshot?.companions });
|
|
15883
16137
|
selectionRef.current = { selectedId, companions: snapshot?.companions };
|
|
15884
|
-
const refresh = (0,
|
|
16138
|
+
const refresh = (0, import_react45.useCallback)(async (throwOnError = false) => {
|
|
15885
16139
|
try {
|
|
15886
16140
|
const next = await loadPartner();
|
|
15887
16141
|
setSnapshot(next);
|
|
@@ -15894,10 +16148,10 @@ function PartnerWorkspace({ controller }) {
|
|
|
15894
16148
|
setLoading(false);
|
|
15895
16149
|
}
|
|
15896
16150
|
}, []);
|
|
15897
|
-
(0,
|
|
16151
|
+
(0, import_react45.useEffect)(() => {
|
|
15898
16152
|
void refresh();
|
|
15899
16153
|
}, [refresh]);
|
|
15900
|
-
(0,
|
|
16154
|
+
(0, import_react45.useEffect)(() => controller.subscribe(() => {
|
|
15901
16155
|
const next = controller.selected();
|
|
15902
16156
|
if (next) setSelectedId(next);
|
|
15903
16157
|
const destination = controller.destination();
|
|
@@ -15966,18 +16220,18 @@ function PartnerWorkspace({ controller }) {
|
|
|
15966
16220
|
setSelectedId(id);
|
|
15967
16221
|
setView("home");
|
|
15968
16222
|
};
|
|
15969
|
-
return /* @__PURE__ */ (0,
|
|
15970
|
-
creatingCompanion && /* @__PURE__ */ (0,
|
|
15971
|
-
/* @__PURE__ */ (0,
|
|
15972
|
-
/* @__PURE__ */ (0,
|
|
15973
|
-
/* @__PURE__ */ (0,
|
|
15974
|
-
/* @__PURE__ */ (0,
|
|
15975
|
-
/* @__PURE__ */ (0,
|
|
15976
|
-
/* @__PURE__ */ (0,
|
|
15977
|
-
/* @__PURE__ */ (0,
|
|
16223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("main", { className: "dsh-partner-workspace", children: [
|
|
16224
|
+
creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
|
|
16225
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("header", { className: "dsh-partner-topbar", children: [
|
|
16226
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
|
|
16227
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.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_runtime41.jsx)(import_dsh_client_ui_primitives22.IconChevronLeftOutline14, { size: 15 }) }),
|
|
16228
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconAgentPresetOutline16, { size: 18 }),
|
|
16229
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { children: [
|
|
16230
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("strong", { children: "\u4F19\u4F34" }),
|
|
16231
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u6D88\u606F\u6E20\u9053" })
|
|
15978
16232
|
] })
|
|
15979
16233
|
] }),
|
|
15980
|
-
/* @__PURE__ */ (0,
|
|
16234
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
15981
16235
|
MobileWorkspaceControls,
|
|
15982
16236
|
{
|
|
15983
16237
|
companions: snapshot?.companions ?? [],
|
|
@@ -15989,119 +16243,86 @@ function PartnerWorkspace({ controller }) {
|
|
|
15989
16243
|
}
|
|
15990
16244
|
)
|
|
15991
16245
|
] }),
|
|
15992
|
-
/* @__PURE__ */ (0,
|
|
15993
|
-
/* @__PURE__ */ (0,
|
|
15994
|
-
/* @__PURE__ */ (0,
|
|
15995
|
-
/* @__PURE__ */ (0,
|
|
15996
|
-
/* @__PURE__ */ (0,
|
|
15997
|
-
/* @__PURE__ */ (0,
|
|
16246
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-grid", children: [
|
|
16247
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("aside", { className: "dsh-partner-roster", children: [
|
|
16248
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-roster-title", children: [
|
|
16249
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { children: [
|
|
16250
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: "COMPANIONS" }),
|
|
16251
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
|
|
15998
16252
|
] }),
|
|
15999
|
-
/* @__PURE__ */ (0,
|
|
16253
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconPlusOutline16, { size: 16 }) })
|
|
16000
16254
|
] }),
|
|
16001
|
-
/* @__PURE__ */ (0,
|
|
16255
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
|
|
16002
16256
|
const channel = snapshot.channels.find((item) => item.companionId === companion.id);
|
|
16003
|
-
return /* @__PURE__ */ (0,
|
|
16004
|
-
/* @__PURE__ */ (0,
|
|
16005
|
-
/* @__PURE__ */ (0,
|
|
16006
|
-
/* @__PURE__ */ (0,
|
|
16007
|
-
/* @__PURE__ */ (0,
|
|
16257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
|
|
16258
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Avatar, { name: companion.name }),
|
|
16259
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { children: [
|
|
16260
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("strong", { children: companion.name }),
|
|
16261
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: companion.role })
|
|
16008
16262
|
] }),
|
|
16009
|
-
/* @__PURE__ */ (0,
|
|
16263
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
|
|
16010
16264
|
] }, companion.id);
|
|
16011
16265
|
}) }),
|
|
16012
|
-
/* @__PURE__ */ (0,
|
|
16013
|
-
|
|
16014
|
-
|
|
16015
|
-
|
|
16016
|
-
/* @__PURE__ */ (0,
|
|
16017
|
-
|
|
16018
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-current": view === "board" ? "page" : void 0, onClick: () => setView("board"), children: [
|
|
16019
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_dsh_client_ui_primitives21.IconListPenOutline16, { size: 16 }) }),
|
|
16020
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("strong", { children: "\u4EFB\u52A1\u770B\u677F" }),
|
|
16021
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("small", { children: "\u534F\u4F5C\u3001\u59D4\u6D3E\u4E0E\u9A8C\u6536" })
|
|
16022
|
-
] }),
|
|
16023
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-current": view === "schedules" ? "page" : void 0, onClick: () => setView("schedules"), children: [
|
|
16024
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_dsh_client_ui_primitives21.IconPlayOutline16, { size: 16 }) }),
|
|
16025
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("strong", { children: "\u5B9A\u65F6\u4EFB\u52A1" }),
|
|
16026
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("small", { children: "\u9009\u62E9\u4F19\u4F34\u5468\u671F\u6267\u884C" })
|
|
16027
|
-
] }),
|
|
16028
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-current": view === "pendant" ? "page" : void 0, onClick: () => setView("pendant"), children: [
|
|
16029
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_dsh_client_ui_primitives21.IconEditOutline16, { size: 16 }) }),
|
|
16030
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("strong", { children: "\u5361\u7247\u8BBE\u7F6E" }),
|
|
16031
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("small", { children: "\u6302\u9970\u3001\u7EF3\u5B50\u4E0E\u56FE\u6848" })
|
|
16032
|
-
] })
|
|
16033
|
-
] }),
|
|
16034
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "dsh-partner-roster-note", children: [
|
|
16035
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_dsh_client_ui_primitives21.IconLinkOutline16, { size: 16 }),
|
|
16036
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { children: [
|
|
16037
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
|
|
16038
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("small", { children: "\u6E20\u9053\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
|
|
16266
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(WorkspaceGroupLinks, { view, open: setView }) }),
|
|
16267
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-roster-note", children: [
|
|
16268
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconLinkOutline16, { size: 16 }),
|
|
16269
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { children: [
|
|
16270
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
|
|
16271
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: "\u6E20\u9053\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
|
|
16039
16272
|
] })
|
|
16040
16273
|
] })
|
|
16041
16274
|
] }),
|
|
16042
|
-
/* @__PURE__ */ (0,
|
|
16043
|
-
loading ? /* @__PURE__ */ (0,
|
|
16044
|
-
|
|
16045
|
-
|
|
16046
|
-
|
|
16047
|
-
|
|
16048
|
-
|
|
16049
|
-
|
|
16050
|
-
/* @__PURE__ */ (0,
|
|
16051
|
-
/* @__PURE__ */ (0,
|
|
16052
|
-
|
|
16053
|
-
|
|
16054
|
-
|
|
16275
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
|
|
16276
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
16277
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "dsh-partner-group-heading", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("h1", { children: workspaceGroup(view)?.label }) }),
|
|
16278
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(WorkspaceGroupTabs, { view, open: setView }),
|
|
16279
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
|
|
16280
|
+
view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SkillsPanel, {}),
|
|
16281
|
+
view === "board" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(RequirementBoard, { initialTaskId: requestedDestination?.taskId, openRequest: requestedDestination }),
|
|
16282
|
+
view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] }),
|
|
16283
|
+
view === "pendant" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(PendantSettingsPanel, {}),
|
|
16284
|
+
view === "general" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(GeneralSettingsPanel, {})
|
|
16285
|
+
] })
|
|
16286
|
+
] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime41.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_runtime41.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
16287
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-identity", children: [
|
|
16288
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Avatar, { name: selected.name }),
|
|
16289
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { children: [
|
|
16290
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: "ACTIVE COMPANION" }),
|
|
16291
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("h1", { children: selected.name }),
|
|
16292
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: selected.description || selected.role })
|
|
16055
16293
|
] }),
|
|
16056
|
-
/* @__PURE__ */ (0,
|
|
16294
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
|
|
16057
16295
|
] }),
|
|
16058
|
-
/* @__PURE__ */ (0,
|
|
16059
|
-
/* @__PURE__ */ (0,
|
|
16060
|
-
/* @__PURE__ */ (0,
|
|
16061
|
-
/* @__PURE__ */ (0,
|
|
16062
|
-
/* @__PURE__ */ (0,
|
|
16063
|
-
/* @__PURE__ */ (0,
|
|
16064
|
-
/* @__PURE__ */ (0,
|
|
16296
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
|
|
16297
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconAgentPresetOutline16, { size: 16 }), children: "\u603B\u89C8" }),
|
|
16298
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconEditOutline16, { size: 16 }), children: "\u8EAB\u4EFD" }),
|
|
16299
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconAgentPresetOutline16, { size: 16 }), children: "\u80FD\u529B" }),
|
|
16300
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconLinkOutline16, { size: 16 }), children: "\u6E20\u9053" }),
|
|
16301
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconDataOutline16, { size: 16 }), children: "\u8BB0\u5FC6" }),
|
|
16302
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TabButton, { active: view === "concerns", onClick: () => setView("concerns"), icon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconBrowseOutline16, { size: 16 }), children: "\u6301\u7EED\u5173\u6CE8" })
|
|
16065
16303
|
] }),
|
|
16066
|
-
/* @__PURE__ */ (0,
|
|
16067
|
-
notice && /* @__PURE__ */ (0,
|
|
16068
|
-
view === "home" && /* @__PURE__ */ (0,
|
|
16069
|
-
view === "identity" && /* @__PURE__ */ (0,
|
|
16070
|
-
view === "capabilities" && /* @__PURE__ */ (0,
|
|
16071
|
-
view === "weixin" && /* @__PURE__ */ (0,
|
|
16072
|
-
view === "memory" && /* @__PURE__ */ (0,
|
|
16073
|
-
view === "concerns" && /* @__PURE__ */ (0,
|
|
16304
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
|
|
16305
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "dsh-partner-inline-notice", role: "status", children: notice }),
|
|
16306
|
+
view === "home" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession }),
|
|
16307
|
+
view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(IdentityEditor, { companion: selected, count: snapshot?.companions.length ?? 1, onChanged: () => refresh(true), onRemoved: companionRemoved }),
|
|
16308
|
+
view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: () => refresh(true) }, selected.id),
|
|
16309
|
+
view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChannelsPanel, { companion: selected, snapshot, onChanged: refresh, weixin: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }) }, selected.id),
|
|
16310
|
+
view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, startSession, renewSession, onChanged: refresh }, selected.id),
|
|
16311
|
+
view === "concerns" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ConcernPanel, { companion: selected, snapshot, onChanged: refresh }, selected.id)
|
|
16074
16312
|
] })
|
|
16075
16313
|
] }),
|
|
16076
|
-
error && /* @__PURE__ */ (0,
|
|
16314
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
|
|
16077
16315
|
] })
|
|
16078
16316
|
] })
|
|
16079
16317
|
] });
|
|
16080
16318
|
}
|
|
16081
16319
|
function MobileWorkspaceControls({ companions, selectedId, view, openCompanion, openPage, createCompanion }) {
|
|
16082
|
-
return /* @__PURE__ */ (0,
|
|
16083
|
-
/* @__PURE__ */ (0,
|
|
16084
|
-
/* @__PURE__ */ (0,
|
|
16085
|
-
/* @__PURE__ */ (0,
|
|
16320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
|
|
16321
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
|
|
16322
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
|
|
16323
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconPlusOutline16, { size: 17 }) })
|
|
16086
16324
|
] }),
|
|
16087
|
-
/* @__PURE__ */ (0,
|
|
16088
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-pressed": view === "skills", onClick: () => openPage("skills"), children: [
|
|
16089
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_dsh_client_ui_primitives21.IconBrowseOutline16, { size: 16 }),
|
|
16090
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: "Skill" })
|
|
16091
|
-
] }),
|
|
16092
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-pressed": view === "board", onClick: () => openPage("board"), children: [
|
|
16093
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_dsh_client_ui_primitives21.IconListPenOutline16, { size: 16 }),
|
|
16094
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: "\u770B\u677F" })
|
|
16095
|
-
] }),
|
|
16096
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-pressed": view === "schedules", onClick: () => openPage("schedules"), children: [
|
|
16097
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_dsh_client_ui_primitives21.IconPlayOutline16, { size: 16 }),
|
|
16098
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: "\u5B9A\u65F6" })
|
|
16099
|
-
] }),
|
|
16100
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-pressed": view === "pendant", onClick: () => openPage("pendant"), children: [
|
|
16101
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_dsh_client_ui_primitives21.IconEditOutline16, { size: 16 }),
|
|
16102
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: "\u5361\u7247" })
|
|
16103
|
-
] })
|
|
16104
|
-
] })
|
|
16325
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(WorkspaceGroupLinks, { view, open: openPage, compact: true }) })
|
|
16105
16326
|
] });
|
|
16106
16327
|
}
|
|
16107
16328
|
function HomePanel({ companion, snapshot, navigate, openSession, startSession, renewSession }) {
|
|
@@ -16112,77 +16333,77 @@ function HomePanel({ companion, snapshot, navigate, openSession, startSession, r
|
|
|
16112
16333
|
const approved = channel ? snapshot.pairings.filter((item) => item.channelId === channel.id && item.status === "approved").length : 0;
|
|
16113
16334
|
const capabilities = companion.capabilities.map((item) => CAPABILITY_LABELS[item]);
|
|
16114
16335
|
const online = channel?.runtimeStatus === "running";
|
|
16115
|
-
return /* @__PURE__ */ (0,
|
|
16116
|
-
/* @__PURE__ */ (0,
|
|
16117
|
-
/* @__PURE__ */ (0,
|
|
16118
|
-
/* @__PURE__ */ (0,
|
|
16119
|
-
/* @__PURE__ */ (0,
|
|
16336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-home", children: [
|
|
16337
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("header", { className: "dsh-partner-home-heading", children: [
|
|
16338
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { children: [
|
|
16339
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
|
|
16340
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u6E20\u9053\u5F85\u547D` : `${companion.name} \u5DF2\u51C6\u5907\u5C31\u7EEA` })
|
|
16120
16341
|
] }),
|
|
16121
|
-
/* @__PURE__ */ (0,
|
|
16342
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.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" })
|
|
16122
16343
|
] }),
|
|
16123
|
-
/* @__PURE__ */ (0,
|
|
16124
|
-
/* @__PURE__ */ (0,
|
|
16125
|
-
/* @__PURE__ */ (0,
|
|
16126
|
-
/* @__PURE__ */ (0,
|
|
16127
|
-
/* @__PURE__ */ (0,
|
|
16344
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
|
|
16345
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
|
|
16346
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Avatar, { name: companion.name }),
|
|
16347
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("i", {}) }),
|
|
16348
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(WeixinGlyph, { large: true }) })
|
|
16128
16349
|
] }),
|
|
16129
|
-
/* @__PURE__ */ (0,
|
|
16130
|
-
/* @__PURE__ */ (0,
|
|
16131
|
-
/* @__PURE__ */ (0,
|
|
16350
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
|
|
16351
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
|
|
16352
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("i", {}),
|
|
16132
16353
|
"\u6D88\u606F\u6E20\u9053 \xB7 ",
|
|
16133
16354
|
channel?.platform === "matrix" ? "Matrix" : channel?.platform === "mattermost" ? "Mattermost" : "\u5FAE\u4FE1"
|
|
16134
16355
|
] }),
|
|
16135
|
-
/* @__PURE__ */ (0,
|
|
16136
|
-
/* @__PURE__ */ (0,
|
|
16137
|
-
/* @__PURE__ */ (0,
|
|
16138
|
-
/* @__PURE__ */ (0,
|
|
16139
|
-
/* @__PURE__ */ (0,
|
|
16356
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.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" }),
|
|
16357
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: !channel ? "\u8FDE\u63A5\u5FAE\u4FE1\u3001Matrix \u6216 Mattermost\uFF0C\u8054\u7CFB\u4EBA\u9996\u6B21\u53D1\u6D88\u606F\u9700\u6279\u51C6\u3002" : online ? "\u672C\u5730\u4E0E\u6240\u6709\u5DF2\u6388\u6743\u6E20\u9053\u5171\u7528\u4F19\u4F34\u4E3B\u5BF9\u8BDD\uFF0C\u56DE\u590D\u8FD4\u56DE\u6D88\u606F\u6765\u6E90\u3002" : channel.lastError || "\u6E20\u9053\u914D\u7F6E\u4ECD\u7136\u4FDD\u7559\uFF0C\u53EF\u4EE5\u968F\u65F6\u91CD\u65B0\u542F\u7528\u3002" }),
|
|
16358
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
|
|
16359
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.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" }),
|
|
16360
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: !channel ? "\u9009\u62E9\u6E20\u9053\u5E76\u8FDE\u63A5\u8D26\u53F7" : `${approved} \u4F4D\u8054\u7CFB\u4EBA \xB7 \u5171\u7528\u4E3B\u5BF9\u8BDD` })
|
|
16140
16361
|
] })
|
|
16141
16362
|
] })
|
|
16142
16363
|
] }),
|
|
16143
|
-
/* @__PURE__ */ (0,
|
|
16144
|
-
/* @__PURE__ */ (0,
|
|
16145
|
-
/* @__PURE__ */ (0,
|
|
16146
|
-
/* @__PURE__ */ (0,
|
|
16147
|
-
/* @__PURE__ */ (0,
|
|
16148
|
-
/* @__PURE__ */ (0,
|
|
16149
|
-
/* @__PURE__ */ (0,
|
|
16364
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-home-details", children: [
|
|
16365
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("section", { className: "dsh-partner-home-profile", children: [
|
|
16366
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("header", { children: [
|
|
16367
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconUserOutline16, { size: 16 }) }),
|
|
16368
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
|
|
16369
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
|
|
16370
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("strong", { children: companion.role })
|
|
16150
16371
|
] }),
|
|
16151
|
-
/* @__PURE__ */ (0,
|
|
16372
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
|
|
16152
16373
|
] }),
|
|
16153
|
-
/* @__PURE__ */ (0,
|
|
16374
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
|
|
16154
16375
|
] }),
|
|
16155
|
-
/* @__PURE__ */ (0,
|
|
16156
|
-
/* @__PURE__ */ (0,
|
|
16157
|
-
/* @__PURE__ */ (0,
|
|
16158
|
-
/* @__PURE__ */ (0,
|
|
16159
|
-
/* @__PURE__ */ (0,
|
|
16160
|
-
/* @__PURE__ */ (0,
|
|
16376
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
|
|
16377
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("header", { children: [
|
|
16378
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconAgentPresetOutline16, { size: 16 }) }),
|
|
16379
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
|
|
16380
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
|
|
16381
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
|
|
16161
16382
|
] }),
|
|
16162
|
-
/* @__PURE__ */ (0,
|
|
16383
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
|
|
16163
16384
|
] }),
|
|
16164
|
-
/* @__PURE__ */ (0,
|
|
16385
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
|
|
16165
16386
|
] }),
|
|
16166
|
-
/* @__PURE__ */ (0,
|
|
16167
|
-
/* @__PURE__ */ (0,
|
|
16168
|
-
/* @__PURE__ */ (0,
|
|
16169
|
-
/* @__PURE__ */ (0,
|
|
16170
|
-
/* @__PURE__ */ (0,
|
|
16171
|
-
/* @__PURE__ */ (0,
|
|
16387
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
|
|
16388
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("header", { children: [
|
|
16389
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconDataOutline16, { size: 16 }) }),
|
|
16390
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
|
|
16391
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
|
|
16392
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("strong", { children: localSession?.archived ? "\u4F1A\u8BDD\u5DF2\u5F52\u6863" : "\u4F19\u4F34\u4F1A\u8BDD\u5DF2\u5EFA\u7ACB" })
|
|
16172
16393
|
] }),
|
|
16173
|
-
/* @__PURE__ */ (0,
|
|
16394
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.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" })
|
|
16174
16395
|
] }),
|
|
16175
|
-
/* @__PURE__ */ (0,
|
|
16396
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: localSession ? `\u6700\u8FD1\u6D3B\u52A8\u4E8E ${relativeTime(localSession.lastMessageAt)}\uFF1B\u672C\u5730\u4E0E\u6E20\u9053\u5728\u8FD9\u91CC\u63A5\u7740\u804A\u3002` : "\u4F19\u4F34\u4F1A\u8BDD\u6B63\u5728\u521D\u59CB\u5316\uFF0C\u7A0D\u540E\u5373\u53EF\u6253\u5F00\u3002" })
|
|
16176
16397
|
] })
|
|
16177
16398
|
] })
|
|
16178
16399
|
] });
|
|
16179
16400
|
}
|
|
16180
16401
|
function WeixinPanel({ companion, snapshot, onChanged }) {
|
|
16181
16402
|
const channel = snapshot.channels.find((item) => item.companionId === companion.id && (!item.platform || item.platform === "weixin"));
|
|
16182
|
-
const [login, setLogin] = (0,
|
|
16183
|
-
const [busy, setBusy] = (0,
|
|
16184
|
-
const [error, setError] = (0,
|
|
16185
|
-
(0,
|
|
16403
|
+
const [login, setLogin] = (0, import_react45.useState)();
|
|
16404
|
+
const [busy, setBusy] = (0, import_react45.useState)(false);
|
|
16405
|
+
const [error, setError] = (0, import_react45.useState)();
|
|
16406
|
+
(0, import_react45.useEffect)(() => {
|
|
16186
16407
|
if (!login || login.phase === "confirmed" || login.phase === "expired" || login.phase === "error") return;
|
|
16187
16408
|
const timer2 = window.setInterval(() => {
|
|
16188
16409
|
void api(`/weixin/login/${login.id}`).then(async (result) => {
|
|
@@ -16228,93 +16449,93 @@ function WeixinPanel({ companion, snapshot, onChanged }) {
|
|
|
16228
16449
|
setError(errorMessage(reason));
|
|
16229
16450
|
}
|
|
16230
16451
|
};
|
|
16231
|
-
return /* @__PURE__ */ (0,
|
|
16232
|
-
/* @__PURE__ */ (0,
|
|
16233
|
-
!channel && !login && /* @__PURE__ */ (0,
|
|
16234
|
-
/* @__PURE__ */ (0,
|
|
16235
|
-
/* @__PURE__ */ (0,
|
|
16236
|
-
/* @__PURE__ */ (0,
|
|
16452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
|
|
16453
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.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" }),
|
|
16454
|
+
!channel && !login && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
|
|
16455
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(WeixinGlyph, { large: true }) }),
|
|
16456
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { children: [
|
|
16457
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("strong", { children: [
|
|
16237
16458
|
"\u628A ",
|
|
16238
16459
|
companion.name,
|
|
16239
16460
|
" \u5E26\u5230\u5FAE\u4FE1"
|
|
16240
16461
|
] }),
|
|
16241
|
-
/* @__PURE__ */ (0,
|
|
16242
|
-
/* @__PURE__ */ (0,
|
|
16243
|
-
/* @__PURE__ */ (0,
|
|
16244
|
-
/* @__PURE__ */ (0,
|
|
16245
|
-
/* @__PURE__ */ (0,
|
|
16462
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.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" }),
|
|
16463
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("ul", { children: [
|
|
16464
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
|
|
16465
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
|
|
16466
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
|
|
16246
16467
|
] })
|
|
16247
16468
|
] }),
|
|
16248
|
-
/* @__PURE__ */ (0,
|
|
16469
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { type: "button", disabled: busy, onClick: () => {
|
|
16249
16470
|
void begin();
|
|
16250
16471
|
}, children: busy ? "\u6B63\u5728\u7533\u8BF7\u4E8C\u7EF4\u7801\u2026" : "\u626B\u7801\u8FDE\u63A5\u5FAE\u4FE1" })
|
|
16251
16472
|
] }),
|
|
16252
|
-
login && /* @__PURE__ */ (0,
|
|
16253
|
-
/* @__PURE__ */ (0,
|
|
16254
|
-
/* @__PURE__ */ (0,
|
|
16255
|
-
/* @__PURE__ */ (0,
|
|
16256
|
-
/* @__PURE__ */ (0,
|
|
16257
|
-
/* @__PURE__ */ (0,
|
|
16258
|
-
(login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0,
|
|
16473
|
+
login && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
|
|
16474
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
|
|
16475
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { children: [
|
|
16476
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: "WECHAT ILINK BOT" }),
|
|
16477
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.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" }),
|
|
16478
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.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") }),
|
|
16479
|
+
(login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("button", { type: "button", onClick: () => {
|
|
16259
16480
|
setLogin(void 0);
|
|
16260
16481
|
void begin();
|
|
16261
16482
|
}, children: [
|
|
16262
|
-
/* @__PURE__ */ (0,
|
|
16483
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconRefreshOutline16, { size: 16 }),
|
|
16263
16484
|
"\u91CD\u65B0\u751F\u6210"
|
|
16264
16485
|
] })
|
|
16265
16486
|
] })
|
|
16266
16487
|
] }),
|
|
16267
|
-
channel && /* @__PURE__ */ (0,
|
|
16268
|
-
/* @__PURE__ */ (0,
|
|
16269
|
-
/* @__PURE__ */ (0,
|
|
16270
|
-
/* @__PURE__ */ (0,
|
|
16271
|
-
/* @__PURE__ */ (0,
|
|
16272
|
-
/* @__PURE__ */ (0,
|
|
16273
|
-
/* @__PURE__ */ (0,
|
|
16488
|
+
channel && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
16489
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
|
|
16490
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(WeixinGlyph, { large: true }) }),
|
|
16491
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { children: [
|
|
16492
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: "WECHAT CHANNEL" }),
|
|
16493
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("strong", { children: channel.name }),
|
|
16494
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: channel.accountId })
|
|
16274
16495
|
] }),
|
|
16275
|
-
/* @__PURE__ */ (0,
|
|
16276
|
-
/* @__PURE__ */ (0,
|
|
16496
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ChannelStatus, { channel }),
|
|
16497
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.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: () => {
|
|
16277
16498
|
void toggle();
|
|
16278
|
-
}, children: /* @__PURE__ */ (0,
|
|
16499
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("i", {}) })
|
|
16279
16500
|
] }),
|
|
16280
|
-
channel.lastError && /* @__PURE__ */ (0,
|
|
16281
|
-
/* @__PURE__ */ (0,
|
|
16282
|
-
/* @__PURE__ */ (0,
|
|
16283
|
-
/* @__PURE__ */ (0,
|
|
16284
|
-
/* @__PURE__ */ (0,
|
|
16501
|
+
channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "dsh-partner-inline-error", children: channel.lastError }),
|
|
16502
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
|
|
16503
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { children: [
|
|
16504
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: "ACCESS" }),
|
|
16505
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
|
|
16285
16506
|
] }),
|
|
16286
|
-
/* @__PURE__ */ (0,
|
|
16507
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("em", { children: [
|
|
16287
16508
|
pairings.filter((item) => item.status === "pending").length,
|
|
16288
16509
|
" \u4E2A\u5F85\u5904\u7406"
|
|
16289
16510
|
] })
|
|
16290
16511
|
] }),
|
|
16291
|
-
/* @__PURE__ */ (0,
|
|
16292
|
-
/* @__PURE__ */ (0,
|
|
16293
|
-
/* @__PURE__ */ (0,
|
|
16294
|
-
/* @__PURE__ */ (0,
|
|
16295
|
-
/* @__PURE__ */ (0,
|
|
16512
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime41.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_runtime41.jsxs)("article", { children: [
|
|
16513
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconUserOutline16, { size: 16 }) }),
|
|
16514
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
|
|
16515
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("strong", { children: pairing.displayName }),
|
|
16516
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("small", { children: [
|
|
16296
16517
|
pairing.status === "pending" ? "\u7B49\u5F85\u5BA1\u6279" : pairing.status === "approved" ? "\u5DF2\u6388\u6743\u72EC\u7ACB\u4F1A\u8BDD" : "\u5DF2\u963B\u6B62",
|
|
16297
16518
|
" \xB7 ",
|
|
16298
16519
|
new Date(pairing.updatedAt).toLocaleString()
|
|
16299
16520
|
] })
|
|
16300
16521
|
] }),
|
|
16301
|
-
pairing.status === "pending" && /* @__PURE__ */ (0,
|
|
16302
|
-
/* @__PURE__ */ (0,
|
|
16522
|
+
pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
16523
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { onClick: () => {
|
|
16303
16524
|
void actPairing(pairing.id, "blocked");
|
|
16304
16525
|
}, children: "\u62D2\u7EDD" }),
|
|
16305
|
-
/* @__PURE__ */ (0,
|
|
16526
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { className: "is-primary", onClick: () => {
|
|
16306
16527
|
void actPairing(pairing.id, "approved");
|
|
16307
16528
|
}, children: "\u6279\u51C6" })
|
|
16308
16529
|
] }),
|
|
16309
|
-
pairing.status === "approved" && /* @__PURE__ */ (0,
|
|
16530
|
+
pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { onClick: () => {
|
|
16310
16531
|
void actPairing(pairing.id, "blocked");
|
|
16311
16532
|
}, children: "\u64A4\u9500" }),
|
|
16312
|
-
pairing.status === "blocked" && /* @__PURE__ */ (0,
|
|
16533
|
+
pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { onClick: () => {
|
|
16313
16534
|
void actPairing(pairing.id, "approved");
|
|
16314
16535
|
}, children: "\u91CD\u65B0\u6279\u51C6" })
|
|
16315
16536
|
] }, pairing.id)) })
|
|
16316
16537
|
] }),
|
|
16317
|
-
error && /* @__PURE__ */ (0,
|
|
16538
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "dsh-partner-inline-error", children: error })
|
|
16318
16539
|
] });
|
|
16319
16540
|
}
|
|
16320
16541
|
function installStyles() {
|