@lemoncat7/dsh-partner 2.3.0 → 2.4.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 +6 -0
- package/docs/mcp.md +54 -0
- package/docs/releases/2.4.0.md +11 -0
- package/lib/agent-runtime.d.ts.map +1 -1
- package/lib/agent-runtime.js +4 -0
- package/lib/agent-runtime.js.map +1 -1
- package/lib/api/features/mcp-api.d.ts +4 -0
- package/lib/api/features/mcp-api.d.ts.map +1 -0
- package/lib/api/features/mcp-api.js +37 -0
- package/lib/api/features/mcp-api.js.map +1 -0
- package/lib/api.d.ts +2 -0
- package/lib/api.d.ts.map +1 -1
- package/lib/api.js +3 -0
- package/lib/api.js.map +1 -1
- package/lib/capabilities.d.ts +1 -1
- package/lib/capabilities.d.ts.map +1 -1
- package/lib/capabilities.js +2 -2
- package/lib/capabilities.js.map +1 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +1461 -1026
- package/lib/client.js.map +4 -4
- package/lib/collaboration/composition.d.ts +3 -0
- package/lib/collaboration/composition.d.ts.map +1 -1
- package/lib/collaboration/composition.js +5 -1
- package/lib/collaboration/composition.js.map +1 -1
- package/lib/collaboration/domain.d.ts +3 -0
- package/lib/collaboration/domain.d.ts.map +1 -1
- package/lib/collaboration/domain.js.map +1 -1
- package/lib/collaboration/review-dispatch.d.ts +5 -0
- package/lib/collaboration/review-dispatch.d.ts.map +1 -0
- package/lib/collaboration/review-dispatch.js +23 -0
- package/lib/collaboration/review-dispatch.js.map +1 -0
- package/lib/collaboration/service.d.ts.map +1 -1
- package/lib/collaboration/service.js +12 -3
- package/lib/collaboration/service.js.map +1 -1
- package/lib/companions/management.d.ts +4 -4
- package/lib/companions/removal.d.ts.map +1 -1
- package/lib/companions/removal.js +2 -0
- package/lib/companions/removal.js.map +1 -1
- package/lib/companions/session-configuration.d.ts.map +1 -1
- package/lib/companions/session-configuration.js +2 -0
- package/lib/companions/session-configuration.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/execution/service.d.ts +3 -1
- package/lib/execution/service.d.ts.map +1 -1
- package/lib/execution/service.js +4 -0
- package/lib/execution/service.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -1
- package/lib/index.js.map +1 -1
- package/lib/mcp/config.d.ts +10 -0
- package/lib/mcp/config.d.ts.map +1 -0
- package/lib/mcp/config.js +54 -0
- package/lib/mcp/config.js.map +1 -0
- package/lib/mcp/connection-error.d.ts +3 -0
- package/lib/mcp/connection-error.d.ts.map +1 -0
- package/lib/mcp/connection-error.js +31 -0
- package/lib/mcp/connection-error.js.map +1 -0
- package/lib/mcp/connections.d.ts +11 -0
- package/lib/mcp/connections.d.ts.map +1 -0
- package/lib/mcp/connections.js +91 -0
- package/lib/mcp/connections.js.map +1 -0
- package/lib/mcp/credentials.d.ts +11 -0
- package/lib/mcp/credentials.d.ts.map +1 -0
- package/lib/mcp/credentials.js +25 -0
- package/lib/mcp/credentials.js.map +1 -0
- package/lib/mcp/domain.d.ts +41 -0
- package/lib/mcp/domain.d.ts.map +1 -0
- package/lib/mcp/domain.js +2 -0
- package/lib/mcp/domain.js.map +1 -0
- package/lib/mcp/edit-config.d.ts +6 -0
- package/lib/mcp/edit-config.d.ts.map +1 -0
- package/lib/mcp/edit-config.js +36 -0
- package/lib/mcp/edit-config.js.map +1 -0
- package/lib/mcp/service.d.ts +31 -0
- package/lib/mcp/service.d.ts.map +1 -0
- package/lib/mcp/service.js +227 -0
- package/lib/mcp/service.js.map +1 -0
- package/lib/mcp/state.d.ts +4 -0
- package/lib/mcp/state.d.ts.map +1 -0
- package/lib/mcp/state.js +29 -0
- package/lib/mcp/state.js.map +1 -0
- package/lib/requirements/plan-schema.d.ts +1 -0
- package/lib/requirements/plan-schema.d.ts.map +1 -1
- package/lib/requirements/plan-schema.js +2 -2
- package/lib/requirements/plan-schema.js.map +1 -1
- package/lib/skills/task-planning.d.ts +2 -2
- package/lib/skills/task-planning.d.ts.map +1 -1
- package/lib/skills/task-planning.js +3 -2
- package/lib/skills/task-planning.js.map +1 -1
- package/lib/storage/migrate-layout.d.ts.map +1 -1
- package/lib/storage/migrate-layout.js +1 -0
- package/lib/storage/migrate-layout.js.map +1 -1
- package/lib/storage/split-state.js +2 -2
- package/lib/storage/split-state.js.map +1 -1
- package/lib/store.d.ts.map +1 -1
- package/lib/store.js +2 -0
- package/lib/store.js.map +1 -1
- package/lib/tasks/scheduling.d.ts.map +1 -1
- package/lib/tasks/scheduling.js +3 -0
- package/lib/tasks/scheduling.js.map +1 -1
- package/lib/ui/capability-editor.d.ts.map +1 -1
- package/lib/ui/capability-editor.js +26 -17
- package/lib/ui/capability-editor.js.map +1 -1
- package/lib/ui/capability-resources.d.ts +12 -0
- package/lib/ui/capability-resources.d.ts.map +1 -0
- package/lib/ui/capability-resources.js +39 -0
- package/lib/ui/capability-resources.js.map +1 -0
- package/lib/ui/companion-access-panel.d.ts +2 -1
- package/lib/ui/companion-access-panel.d.ts.map +1 -1
- package/lib/ui/companion-access-panel.js +5 -1
- package/lib/ui/companion-access-panel.js.map +1 -1
- package/lib/ui/mcp-capabilities.d.ts +6 -0
- package/lib/ui/mcp-capabilities.d.ts.map +1 -0
- package/lib/ui/mcp-capabilities.js +53 -0
- package/lib/ui/mcp-capabilities.js.map +1 -0
- package/lib/ui/mcp-editor.d.ts +7 -0
- package/lib/ui/mcp-editor.d.ts.map +1 -0
- package/lib/ui/mcp-editor.js +85 -0
- package/lib/ui/mcp-editor.js.map +1 -0
- package/lib/ui/mcp-panel.d.ts +2 -0
- package/lib/ui/mcp-panel.d.ts.map +1 -0
- package/lib/ui/mcp-panel.js +61 -0
- package/lib/ui/mcp-panel.js.map +1 -0
- package/lib/ui/skills-panel.d.ts +2 -1
- package/lib/ui/skills-panel.d.ts.map +1 -1
- package/lib/ui/skills-panel.js +5 -1
- package/lib/ui/skills-panel.js.map +1 -1
- package/lib/ui/workspace-components.d.ts +2 -1
- package/lib/ui/workspace-components.d.ts.map +1 -1
- package/lib/ui/workspace-components.js +2 -2
- package/lib/ui/workspace-components.js.map +1 -1
- package/lib/ui/workspace-navigation.d.ts +9 -1
- package/lib/ui/workspace-navigation.d.ts.map +1 -1
- package/lib/ui/workspace-navigation.js +1 -0
- package/lib/ui/workspace-navigation.js.map +1 -1
- package/package.json +6 -3
package/lib/client.js
CHANGED
|
@@ -35,7 +35,7 @@ __export(client_exports, {
|
|
|
35
35
|
inject: () => inject
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(client_exports);
|
|
38
|
-
var
|
|
38
|
+
var import_react50 = require("react");
|
|
39
39
|
|
|
40
40
|
// src/workspace-ownership.ts
|
|
41
41
|
var WORKSPACE_ACTIVATE_EVENT = "@lemoncat7/dsh-plugin-ui/workspace-activate";
|
|
@@ -54,7 +54,7 @@ function observePluginWorkspace(pluginId, close) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
// src/client.tsx
|
|
57
|
-
var
|
|
57
|
+
var import_dsh_client_ui_primitives24 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
58
58
|
|
|
59
59
|
// node_modules/qrcode.react/lib/esm/index.js
|
|
60
60
|
var import_react = __toESM(require("react"), 1);
|
|
@@ -1942,9 +1942,30 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
|
|
|
1942
1942
|
.dsh-partner-field select:focus { border-color: var(--partner-focus-ring); background: var(--partner-raised); box-shadow: 0 0 0 3px color-mix(in srgb, var(--partner-focus-ring) 18%, transparent), inset 0 1px 0 var(--partner-glass-highlight); }
|
|
1943
1943
|
.dsh-partner-form-actions { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding-top: 5px; }
|
|
1944
1944
|
.dsh-partner-form-actions > span { display: inline-flex; align-items: center; gap: 5px; color: var(--partner-accent-strong); font-size: var(--partner-font-body); }
|
|
1945
|
-
.dsh-partner-
|
|
1946
|
-
.dsh-partner-
|
|
1947
|
-
.dsh-partner-
|
|
1945
|
+
.dsh-partner-capability-save-status { position: static; padding: 8px 12px; border: 1px solid var(--partner-separator); border-radius: 10px; background: var(--partner-raised); color: var(--partner-text-secondary); font-size: var(--partner-font-caption); }
|
|
1946
|
+
.dsh-partner-capability-picker { display: grid; gap: 12px; min-width: 0; }
|
|
1947
|
+
.dsh-partner-capability-card { position: relative; min-width: 0; }
|
|
1948
|
+
.dsh-partner-capability-card > button:first-child { width: 100%; height: 100%; }
|
|
1949
|
+
.dsh-partner-capability-card:has(.dsh-partner-capability-manage) > button:first-child strong { padding-right: 68px; }
|
|
1950
|
+
.dsh-partner-capability-card-copy { display: grid; gap: 4px; height: 100%; box-sizing: border-box; padding: 12px; border: 1px solid var(--partner-border); border-radius: 11px; background: var(--partner-raised); }
|
|
1951
|
+
.dsh-partner-capability-card-copy strong { padding-right: 76px; }
|
|
1952
|
+
.dsh-partner-capabilities .dsh-partner-capability-manage { position: absolute; inset: 6px 6px auto auto; display: inline-flex; align-items: center; justify-content: center; width: auto; height: auto; min-height: 32px; padding: 4px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--partner-text-secondary); font-size: var(--partner-font-caption); white-space: nowrap; }
|
|
1953
|
+
.dsh-partner-workspace-dialog.is-capability-resources { width: 100%; animation: none; }
|
|
1954
|
+
@media (min-width: 761px) {
|
|
1955
|
+
.dsh-partner-workspace-dialog.is-capability-resources { width: min(100%, clamp(640px, 76vw, 1040px)); max-height: 100%; }
|
|
1956
|
+
}
|
|
1957
|
+
.dsh-partner-workspace .dsh-partner-capabilities .dsh-partner-capability-manage { box-shadow: none; background: transparent; color: var(--partner-text-secondary); border: 0; }
|
|
1958
|
+
.dsh-partner-workspace .dsh-partner-capabilities .dsh-partner-capability-manage:hover:not(:disabled) { background: var(--partner-hover); color: var(--partner-text); }
|
|
1959
|
+
.is-capability-resources .dsh-partner-capability-detail { padding: 0; border: 0; background: transparent; box-shadow: none; }
|
|
1960
|
+
.is-capability-resources .dsh-partner-capability-detail > header > span,
|
|
1961
|
+
.is-capability-resources .dsh-partner-access > header,
|
|
1962
|
+
.is-capability-resources .dsh-partner-access-note { display: none; }
|
|
1963
|
+
.is-capability-resources .dsh-partner-capability-detail > header { justify-content: flex-end; }
|
|
1964
|
+
.is-capability-resources .dsh-partner-skill-installed.is-binding { grid-template-columns: minmax(0, 1fr); }
|
|
1965
|
+
.is-capability-resources .dsh-partner-skill-installed.is-binding > article { grid-template-columns: 28px minmax(0, 1fr) auto; min-height: 0; padding: 10px; align-items: center; }
|
|
1966
|
+
.is-capability-resources .dsh-partner-skill-installed.is-binding .dsh-partner-skill-binding-action { grid-column: auto; width: auto; }
|
|
1967
|
+
.is-capability-resources .dsh-partner-collection-empty { min-height: 120px; padding: 20px 12px; }
|
|
1968
|
+
@media (pointer: coarse) { .dsh-partner-capabilities .dsh-partner-capability-manage { min-height: 44px; min-width: 44px; inset-block-start: 0; } }
|
|
1948
1969
|
.dsh-partner-form-actions > button,
|
|
1949
1970
|
.dsh-partner-state > button,
|
|
1950
1971
|
.dsh-partner-weixin-connect > button { min-height: 34px; padding: 0 15px; border: 1px solid color-mix(in srgb, var(--partner-accent) 60%, transparent); border-radius: 10px; color: var(--partner-on-accent); background: var(--partner-accent-strong); font: 600 var(--partner-font-body)/1 var(--partner-font-family); cursor: pointer; }
|
|
@@ -3201,7 +3222,7 @@ function WorkspaceBlock({ title, detail, actions, children, className = "" }) {
|
|
|
3201
3222
|
children
|
|
3202
3223
|
] });
|
|
3203
3224
|
}
|
|
3204
|
-
function WorkspaceDialog({ eyebrow = "CREATE & CONFIGURE", title, detail, close, children, width = "regular" }) {
|
|
3225
|
+
function WorkspaceDialog({ eyebrow = "CREATE & CONFIGURE", title, detail, close, children, width = "regular", className = "" }) {
|
|
3205
3226
|
const titleId = (0, import_react2.useId)();
|
|
3206
3227
|
const detailId = (0, import_react2.useId)();
|
|
3207
3228
|
const layerRef = (0, import_react2.useRef)(null);
|
|
@@ -3247,10 +3268,10 @@ function WorkspaceDialog({ eyebrow = "CREATE & CONFIGURE", title, detail, close,
|
|
|
3247
3268
|
close();
|
|
3248
3269
|
}, onPointerDown: (event) => {
|
|
3249
3270
|
if (event.target === event.currentTarget) close();
|
|
3250
|
-
}, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { ref: panelRef, className: `dsh-partner-workspace-dialog is-${width}`, onKeyDown: keyDown, children: [
|
|
3271
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { ref: panelRef, className: `dsh-partner-workspace-dialog is-${width} ${className}`, onKeyDown: keyDown, children: [
|
|
3251
3272
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [
|
|
3252
3273
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
|
|
3253
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: eyebrow }),
|
|
3274
|
+
eyebrow && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: eyebrow }),
|
|
3254
3275
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { id: titleId, children: title }),
|
|
3255
3276
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { id: detailId, children: detail })
|
|
3256
3277
|
] }),
|
|
@@ -13349,7 +13370,7 @@ function SkillsPanel() {
|
|
|
13349
13370
|
] })
|
|
13350
13371
|
] });
|
|
13351
13372
|
}
|
|
13352
|
-
function CompanionSkillSettings({ companionId }) {
|
|
13373
|
+
function CompanionSkillSettings({ companionId, onBusyChange }) {
|
|
13353
13374
|
const [catalog, setCatalog] = (0, import_react30.useState)({ installed: [], bindings: [], sources: [] });
|
|
13354
13375
|
const [busy, setBusy] = (0, import_react30.useState)();
|
|
13355
13376
|
const [error, setError] = (0, import_react30.useState)();
|
|
@@ -13382,6 +13403,8 @@ function CompanionSkillSettings({ companionId }) {
|
|
|
13382
13403
|
const visibleEnabledSkills = showAll ? enabledSkills : enabledSkills.slice(0, 4);
|
|
13383
13404
|
const visibleAvailableSkills = availableSkills.slice(0, 80);
|
|
13384
13405
|
const setBinding = async (skillId, nextEnabled) => {
|
|
13406
|
+
if (busy) return;
|
|
13407
|
+
onBusyChange?.(true);
|
|
13385
13408
|
setBusy(skillId);
|
|
13386
13409
|
setError(void 0);
|
|
13387
13410
|
try {
|
|
@@ -13391,6 +13414,7 @@ function CompanionSkillSettings({ companionId }) {
|
|
|
13391
13414
|
setError(errorMessage(reason));
|
|
13392
13415
|
} finally {
|
|
13393
13416
|
setBusy(void 0);
|
|
13417
|
+
onBusyChange?.(false);
|
|
13394
13418
|
}
|
|
13395
13419
|
};
|
|
13396
13420
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("section", { className: "dsh-partner-capability-detail", "aria-labelledby": "dsh-partner-skill-capability-title", children: [
|
|
@@ -13653,18 +13677,254 @@ function skillScalar(value) {
|
|
|
13653
13677
|
return `"${value.replace(/[\r\n]+/g, " ").replace(/"/g, "'").trim()}"`;
|
|
13654
13678
|
}
|
|
13655
13679
|
|
|
13680
|
+
// src/ui/mcp-panel.tsx
|
|
13681
|
+
var import_react32 = require("react");
|
|
13682
|
+
var import_dsh_client_ui_primitives12 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
13683
|
+
|
|
13684
|
+
// src/ui/mcp-editor.tsx
|
|
13685
|
+
var import_react31 = require("react");
|
|
13686
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
13687
|
+
function McpEditor({ value, close, saved }) {
|
|
13688
|
+
const existing = typeof value === "object" ? value : void 0;
|
|
13689
|
+
const importing = value === "import";
|
|
13690
|
+
const [name, setName] = (0, import_react31.useState)(existing?.name ?? "");
|
|
13691
|
+
const [json, setJson] = (0, import_react31.useState)("");
|
|
13692
|
+
const [original, setOriginal] = (0, import_react31.useState)("");
|
|
13693
|
+
const [revision, setRevision] = (0, import_react31.useState)();
|
|
13694
|
+
const [revealed, setRevealed] = (0, import_react31.useState)(false);
|
|
13695
|
+
const [loading, setLoading] = (0, import_react31.useState)(!!existing);
|
|
13696
|
+
const [busy, setBusy] = (0, import_react31.useState)(false);
|
|
13697
|
+
const [error, setError] = (0, import_react31.useState)("");
|
|
13698
|
+
const mounted = (0, import_react31.useRef)(true);
|
|
13699
|
+
const field = (0, import_react31.useId)();
|
|
13700
|
+
const load2 = async (reveal) => {
|
|
13701
|
+
if (!existing) return;
|
|
13702
|
+
setLoading(true);
|
|
13703
|
+
setError("");
|
|
13704
|
+
try {
|
|
13705
|
+
const next = await api(`/mcp/${existing.id}/config${reveal ? "?reveal=1" : ""}`);
|
|
13706
|
+
if (!mounted.current) return;
|
|
13707
|
+
const text4 = JSON.stringify(next.config, null, 2);
|
|
13708
|
+
if (revision === void 0) setName(next.name);
|
|
13709
|
+
setJson(text4);
|
|
13710
|
+
setOriginal(text4);
|
|
13711
|
+
setRevision(next.revision);
|
|
13712
|
+
setRevealed(reveal);
|
|
13713
|
+
} catch (reason) {
|
|
13714
|
+
if (mounted.current) setError(errorMessage(reason));
|
|
13715
|
+
} finally {
|
|
13716
|
+
if (mounted.current) setLoading(false);
|
|
13717
|
+
}
|
|
13718
|
+
};
|
|
13719
|
+
(0, import_react31.useEffect)(() => {
|
|
13720
|
+
mounted.current = true;
|
|
13721
|
+
void load2(false);
|
|
13722
|
+
return () => {
|
|
13723
|
+
mounted.current = false;
|
|
13724
|
+
};
|
|
13725
|
+
}, []);
|
|
13726
|
+
const hint = importing ? "\u7C98\u8D34\u5305\u542B mcpServers \u7684\u5B8C\u6574\u914D\u7F6E\uFF0C\u670D\u52A1\u540D\u79F0\u53D6\u81EA\u5176\u4E2D\u7684\u952E\u540D\uFF1B\u53EF\u4E00\u6B21\u5BFC\u5165\u591A\u4E2A\u670D\u52A1\u3002\u5355\u4E2A url / command \u5BF9\u8C61\u8BF7\u7528\u300C\u65B0\u589E MCP\u300D\u3002" : existing ? "\u5DF2\u56DE\u586B\u5F53\u524D\u914D\u7F6E\u3002{{DSH_MCP_SAVED:\u2026}} \u8868\u793A\u5DF2\u4FDD\u5B58\u7684\u503C\uFF0C\u4FDD\u6301\u539F\u6837\u5373\u53EF\u4FDD\u7559\uFF1B\u586B\u5199\u65B0\u503C\u53EF\u66FF\u6362\uFF0C\u5220\u9664\u5B57\u6BB5\u5219\u79FB\u9664\u3002\u8BA4\u8BC1\u548C\u547D\u4EE4\u53C2\u6570\u9ED8\u8BA4\u9690\u85CF\uFF0C\u53EF\u70B9\u300C\u663E\u793A\u5B8C\u6574\u914D\u7F6E\u300D\u3002" : "\u8FD9\u91CC\u586B\u5199\u4E00\u4E2A\u670D\u52A1\u7684\u914D\u7F6E\uFF1AHTTP \u5305\u542B url\uFF0Cstdio \u5305\u542B command \u548C args\u3002\u4E5F\u652F\u6301\u76F4\u63A5\u7C98\u8D34\u4EC5\u542B\u4E00\u4E2A\u670D\u52A1\u7684\u5B8C\u6574 mcpServers \u914D\u7F6E\uFF1B\u591A\u4E2A\u670D\u52A1\u8BF7\u7528\u300C\u5BFC\u5165 JSON\u300D\u3002";
|
|
13727
|
+
const example = JSON.stringify(importing ? { mcpServers: { docmost: { type: "http", url: "http://docmost:3000/mcp", headers: { Authorization: "Bearer YOUR_TOKEN" } } } } : { type: "http", url: "http://docmost:3000/mcp", headers: { Authorization: "Bearer YOUR_TOKEN" } }, null, 2);
|
|
13728
|
+
const stdioExample = JSON.stringify(importing ? { mcpServers: { example: { command: "npx", args: ["-y", "your-mcp-package"] } } } : { command: "npx", args: ["-y", "your-mcp-package"] }, null, 2);
|
|
13729
|
+
const submit = async () => {
|
|
13730
|
+
if (busy || loading || existing && revision === void 0) return;
|
|
13731
|
+
setBusy(true);
|
|
13732
|
+
setError("");
|
|
13733
|
+
try {
|
|
13734
|
+
let parsed;
|
|
13735
|
+
if (json.trim()) {
|
|
13736
|
+
try {
|
|
13737
|
+
parsed = JSON.parse(json);
|
|
13738
|
+
} catch {
|
|
13739
|
+
throw Error("JSON \u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u8BF7\u68C0\u67E5\u53CC\u5F15\u53F7\u3001\u9017\u53F7\u548C\u62EC\u53F7\uFF1B\u53EF\u5C55\u5F00\u4E0B\u65B9\u683C\u5F0F\u793A\u4F8B\u5BF9\u7167\u3002");
|
|
13740
|
+
}
|
|
13741
|
+
}
|
|
13742
|
+
if (parsed === void 0) throw Error(existing ? "\u914D\u7F6E\u4E0D\u80FD\u4E3A\u7A7A\u3002\u5982\u9700\u4FDD\u7559\u5DF2\u6709\u503C\uFF0C\u8BF7\u4FDD\u7559\u539F\u914D\u7F6E\u548C\u5360\u4F4D\u7B26\u3002" : "\u8BF7\u586B\u5199 JSON \u914D\u7F6E\uFF0C\u53EF\u53C2\u8003\u4E0B\u65B9\u683C\u5F0F\u793A\u4F8B\u3002");
|
|
13743
|
+
const next = await api(importing ? "/mcp/import" : existing ? `/mcp/${existing.id}` : "/mcp", { method: existing ? "PUT" : "POST", body: JSON.stringify(importing ? parsed : { name, config: parsed, ...existing ? { expectedRevision: revision } : {} }) });
|
|
13744
|
+
if (mounted.current) saved(next);
|
|
13745
|
+
} catch (reason) {
|
|
13746
|
+
if (mounted.current) setError(errorMessage(reason));
|
|
13747
|
+
} finally {
|
|
13748
|
+
if (mounted.current) setBusy(false);
|
|
13749
|
+
}
|
|
13750
|
+
};
|
|
13751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(WorkspaceDialog, { title: importing ? "\u5BFC\u5165 MCP \u914D\u7F6E" : existing ? "\u7F16\u8F91 MCP \u670D\u52A1" : "\u65B0\u589E MCP \u670D\u52A1", detail: importing ? "\u5BFC\u5165\u5B8C\u6574\u7684\u5BA2\u6237\u7AEF\u914D\u7F6E\uFF0C\u53EF\u5305\u542B\u4E00\u4E2A\u6216\u591A\u4E2A\u670D\u52A1\u3002" : existing ? "\u4FEE\u6539\u5F53\u524D\u670D\u52A1\u914D\u7F6E\uFF0C\u4E0D\u9700\u8981\u91CD\u65B0\u586B\u5199\u5DF2\u4FDD\u5B58\u7684\u51ED\u636E\u3002" : "\u624B\u52A8\u6DFB\u52A0\u4E00\u4E2A\u670D\u52A1\uFF0C\u540D\u79F0\u4EC5\u7528\u4E8E\u9875\u9762\u5C55\u793A\u3002", close: () => {
|
|
13752
|
+
if (!busy) close();
|
|
13753
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("form", { className: "dsh-partner-feature-form", onSubmit: (e) => {
|
|
13754
|
+
e.preventDefault();
|
|
13755
|
+
void submit();
|
|
13756
|
+
}, children: [
|
|
13757
|
+
!importing && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: "is-wide", children: [
|
|
13758
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: "\u670D\u52A1\u540D\u79F0" }),
|
|
13759
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("input", { "aria-label": "\u670D\u52A1\u540D\u79F0", required: true, maxLength: 80, value: name, disabled: busy || loading, placeholder: "\u4F8B\u5982\uFF1ADocmost \u6587\u6863", onChange: (e) => setName(e.target.value) }),
|
|
13760
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("small", { children: "\u4F19\u4F34\u754C\u9762\u4E2D\u7684\u663E\u793A\u540D\u79F0\uFF0C\u4E0D\u662F\u670D\u52A1\u5730\u5740\uFF0C\u4E5F\u4E0D\u662F JSON \u5B57\u6BB5\u3002" })
|
|
13761
|
+
] }),
|
|
13762
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: "is-wide", htmlFor: field, children: [
|
|
13763
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: importing ? "\u5B8C\u6574\u914D\u7F6E JSON\uFF08\u5305\u542B mcpServers\uFF09" : "\u8FDE\u63A5\u914D\u7F6E JSON\uFF08\u5355\u4E2A\u670D\u52A1\uFF09" }),
|
|
13764
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("small", { id: `${field}-hint`, children: hint })
|
|
13765
|
+
] }),
|
|
13766
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("textarea", { className: "is-wide", id: field, rows: 10, value: json, disabled: busy || loading || !!existing && revision === void 0, spellCheck: false, autoComplete: "off", "aria-describedby": `${field}-hint${error ? ` ${field}-error` : ""}`, "aria-invalid": !!error, onChange: (e) => setJson(e.target.value), placeholder: loading ? "\u6B63\u5728\u8BFB\u53D6\u5F53\u524D\u914D\u7F6E\u2026" : example }),
|
|
13767
|
+
existing && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("p", { className: "dsh-partner-form-help is-wide", children: [
|
|
13768
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "button", disabled: busy || loading || revision !== void 0 && json !== original, onClick: () => {
|
|
13769
|
+
void load2(revision === void 0 ? false : !revealed);
|
|
13770
|
+
}, children: loading ? "\u6B63\u5728\u8BFB\u53D6\u2026" : revision === void 0 ? "\u91CD\u8BD5\u8BFB\u53D6\u914D\u7F6E" : revealed ? "\u9690\u85CF\u654F\u611F\u503C" : "\u663E\u793A\u5B8C\u6574\u914D\u7F6E" }),
|
|
13771
|
+
json !== original && " \u914D\u7F6E\u5DF2\u4FEE\u6539\uFF0C\u4FDD\u5B58\u540E\u53EF\u91CD\u65B0\u5207\u6362\u663E\u793A\u65B9\u5F0F\u3002"
|
|
13772
|
+
] }),
|
|
13773
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("details", { className: "dsh-partner-mcp-examples is-wide", children: [
|
|
13774
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("summary", { children: "\u67E5\u770B\u683C\u5F0F\u793A\u4F8B\uFF08\u4E0D\u4F1A\u8986\u76D6\u5DF2\u586B\u5199\u5185\u5BB9\uFF09" }),
|
|
13775
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("small", { children: "HTTP \u670D\u52A1" }),
|
|
13776
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("pre", { children: example }),
|
|
13777
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("small", { children: "\u672C\u673A\u547D\u4EE4 \xB7 stdio" }),
|
|
13778
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("pre", { children: stdioExample })
|
|
13779
|
+
] }),
|
|
13780
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "dsh-partner-form-help is-wide", children: "stdio \u5728 DSH \u6240\u5728\u673A\u5668\u6216\u5BB9\u5668\u4E2D\u6267\u884C\u547D\u4EE4\uFF0C\u8BF7\u53EA\u6DFB\u52A0\u53EF\u4FE1\u670D\u52A1\u3002\u914D\u7F6E\u4FDD\u5B58\u540E\uFF0C\u70B9\u51FB\u300C\u8FDE\u63A5 / \u5237\u65B0\u5DE5\u5177\u300D\uFF0C\u518D\u5728\u4F19\u4F34\u80FD\u529B\u4E2D\u6388\u6743\u3002" }),
|
|
13781
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "is-wide", id: `${field}-error`, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(WorkspaceNotice, { children: error }) }),
|
|
13782
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("footer", { children: [
|
|
13783
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
13784
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || loading || !!existing && revision === void 0, "aria-busy": busy, children: busy ? "\u4FDD\u5B58\u4E2D\u2026" : importing ? "\u5BFC\u5165\u914D\u7F6E" : "\u4FDD\u5B58\u914D\u7F6E" })
|
|
13785
|
+
] })
|
|
13786
|
+
] }) });
|
|
13787
|
+
}
|
|
13788
|
+
|
|
13789
|
+
// src/ui/mcp-panel.tsx
|
|
13790
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
13791
|
+
function McpPanel() {
|
|
13792
|
+
const [catalog, setCatalog] = (0, import_react32.useState)({ servers: [], bindings: [] });
|
|
13793
|
+
const [loading, setLoading] = (0, import_react32.useState)(true);
|
|
13794
|
+
const [busy, setBusy] = (0, import_react32.useState)("");
|
|
13795
|
+
const [error, setError] = (0, import_react32.useState)("");
|
|
13796
|
+
const [notice, setNotice] = (0, import_react32.useState)("");
|
|
13797
|
+
const [query, setQuery] = (0, import_react32.useState)("");
|
|
13798
|
+
const [editor, setEditor] = (0, import_react32.useState)();
|
|
13799
|
+
const [deleting, setDeleting] = (0, import_react32.useState)();
|
|
13800
|
+
const [details, setDetails] = (0, import_react32.useState)();
|
|
13801
|
+
const load2 = (0, import_react32.useCallback)(async () => {
|
|
13802
|
+
try {
|
|
13803
|
+
setCatalog(await api("/mcp"));
|
|
13804
|
+
setError("");
|
|
13805
|
+
} catch (reason) {
|
|
13806
|
+
setError(errorMessage(reason));
|
|
13807
|
+
} finally {
|
|
13808
|
+
setLoading(false);
|
|
13809
|
+
}
|
|
13810
|
+
}, []);
|
|
13811
|
+
(0, import_react32.useEffect)(() => {
|
|
13812
|
+
void load2();
|
|
13813
|
+
}, [load2]);
|
|
13814
|
+
const action = async (server, kind) => {
|
|
13815
|
+
setBusy(server.id);
|
|
13816
|
+
setError("");
|
|
13817
|
+
setNotice("");
|
|
13818
|
+
try {
|
|
13819
|
+
const next = await api(`/mcp/${server.id}${kind === "refresh" ? "/refresh" : ""}`, {
|
|
13820
|
+
method: kind === "refresh" ? "POST" : kind === "delete" ? "DELETE" : "PUT",
|
|
13821
|
+
...kind === "toggle" ? { body: JSON.stringify({ name: server.name, enabled: !server.enabled }) } : {}
|
|
13822
|
+
});
|
|
13823
|
+
setCatalog(next);
|
|
13824
|
+
setDeleting(void 0);
|
|
13825
|
+
setNotice(kind === "refresh" ? "\u8FDE\u63A5\u6210\u529F\uFF0C\u5DE5\u5177\u76EE\u5F55\u5DF2\u5237\u65B0\u3002\u5DF2\u6388\u6743\u4F19\u4F34\u5C06\u5728\u4E0B\u4E00\u8F6E\u5BF9\u8BDD\u4F7F\u7528\u6700\u65B0\u5DE5\u5177\u3002" : kind === "delete" ? "MCP \u670D\u52A1\u4E0E\u5173\u8054\u6388\u6743\u5DF2\u5220\u9664\u3002" : "\u72B6\u6001\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u751F\u6548\uFF1B\u505C\u7528\u540E\u7ACB\u5373\u963B\u6B62\u65B0\u7684\u8C03\u7528\u3002");
|
|
13826
|
+
} catch (reason) {
|
|
13827
|
+
setError(errorMessage(reason));
|
|
13828
|
+
if (kind === "refresh") {
|
|
13829
|
+
try {
|
|
13830
|
+
setCatalog(await api("/mcp"));
|
|
13831
|
+
} catch {
|
|
13832
|
+
}
|
|
13833
|
+
}
|
|
13834
|
+
} finally {
|
|
13835
|
+
setBusy("");
|
|
13836
|
+
}
|
|
13837
|
+
};
|
|
13838
|
+
const visible = catalog.servers.filter((s) => s.name.toLocaleLowerCase().includes(query.trim().toLocaleLowerCase()));
|
|
13839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "dsh-partner-feature-page", children: [
|
|
13840
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(WorkspaceHero, { eyebrow: "Capability catalog", title: "MCP \u670D\u52A1", detail: "\u96C6\u4E2D\u7BA1\u7406\u5916\u90E8\u5DE5\u5177\uFF0C\u518D\u5728\u4F19\u4F34\u80FD\u529B\u4E2D\u5355\u72EC\u6388\u6743\u3002\u914D\u7F6E\u4E0E\u5DE5\u5177\u76EE\u5F55\u7684\u66F4\u65B0\u5728\u4E0B\u4E00\u8F6E\u5BF9\u8BDD\u751F\u6548\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("button", { type: "button", disabled: loading || !!busy, onClick: () => {
|
|
13841
|
+
void load2();
|
|
13842
|
+
}, children: [
|
|
13843
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives12.IconRefreshOutline16, { size: 15 }),
|
|
13844
|
+
"\u5237\u65B0\u5217\u8868"
|
|
13845
|
+
] }) }),
|
|
13846
|
+
error && !deleting && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(WorkspaceNotice, { children: error }),
|
|
13847
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(WorkspaceNotice, { kind: "success", children: notice }),
|
|
13848
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(WorkspaceBlock, { title: "\u5DF2\u914D\u7F6E\u670D\u52A1", detail: `${catalog.servers.length} \u4E2A\u670D\u52A1 \xB7 \u5B89\u88C5\u4E0D\u7B49\u4E8E\u6388\u6743`, actions: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
13849
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", onClick: () => setEditor("import"), children: "\u5BFC\u5165 JSON" }),
|
|
13850
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("button", { type: "button", onClick: () => setEditor("new"), children: [
|
|
13851
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives12.IconPlusOutline16, { size: 14 }),
|
|
13852
|
+
"\u65B0\u589E MCP"
|
|
13853
|
+
] })
|
|
13854
|
+
] }), children: [
|
|
13855
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(FormField, { label: "\u641C\u7D22\u670D\u52A1", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("input", { value: query, onChange: (e) => setQuery(e.target.value), placeholder: "\u6309\u670D\u52A1\u540D\u79F0\u641C\u7D22" }) }),
|
|
13856
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CollectionSkeleton, { rows: 2 }) : !visible.length ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CollectionEmpty, { title: query ? "\u6CA1\u6709\u5339\u914D\u7684\u670D\u52A1" : "\u8FD8\u6CA1\u6709 MCP \u670D\u52A1", detail: "\u652F\u6301 Streamable HTTP \u548C stdio\uFF1B\u53EF\u76F4\u63A5\u5BFC\u5165 mcpServers JSON\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "dsh-partner-market-grid", children: visible.map((server) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("article", { children: [
|
|
13857
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { children: [
|
|
13858
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("small", { children: [
|
|
13859
|
+
server.transport === "stdio" ? "\u672C\u673A\u547D\u4EE4 \xB7 STDIO" : "\u8FDC\u7A0B\u670D\u52A1 \xB7 HTTP",
|
|
13860
|
+
" \xB7 ",
|
|
13861
|
+
server.enabled ? "\u5DF2\u542F\u7528" : "\u5DF2\u505C\u7528"
|
|
13862
|
+
] }),
|
|
13863
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("strong", { children: server.name }),
|
|
13864
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("p", { children: [
|
|
13865
|
+
server.tools.length,
|
|
13866
|
+
" \u4E2A\u5DE5\u5177 \xB7 ",
|
|
13867
|
+
catalog.bindings.filter((b) => b.serverId === server.id).length,
|
|
13868
|
+
" \u4E2A\u4F19\u4F34\u83B7\u6388\u6743"
|
|
13869
|
+
] }),
|
|
13870
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("small", { children: server.refreshedAt ? `\u4E0A\u6B21\u5237\u65B0 ${new Date(server.refreshedAt).toLocaleString()}` : "\u5C1A\u672A\u6D4B\u8BD5\u8FDE\u63A5\uFF0C\u8BF7\u5237\u65B0\u5DE5\u5177" })
|
|
13871
|
+
] }),
|
|
13872
|
+
server.error && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: server.error }),
|
|
13873
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("footer", { className: "dsh-partner-mcp-actions", children: [
|
|
13874
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", disabled: !!busy, onClick: () => {
|
|
13875
|
+
void action(server, "refresh");
|
|
13876
|
+
}, children: busy === server.id ? "\u5904\u7406\u4E2D\u2026" : "\u8FDE\u63A5 / \u5237\u65B0\u5DE5\u5177" }),
|
|
13877
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", onClick: () => setDetails(server), children: "\u5DE5\u5177\u5217\u8868" }),
|
|
13878
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", disabled: !!busy, onClick: () => setEditor(server), children: "\u7F16\u8F91" }),
|
|
13879
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", disabled: !!busy, onClick: () => {
|
|
13880
|
+
void action(server, "toggle");
|
|
13881
|
+
}, children: server.enabled ? "\u505C\u7528" : "\u542F\u7528" }),
|
|
13882
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", disabled: !!busy, onClick: () => {
|
|
13883
|
+
setError("");
|
|
13884
|
+
setDeleting(server);
|
|
13885
|
+
}, children: "\u5220\u9664" })
|
|
13886
|
+
] })
|
|
13887
|
+
] }, server.id)) })
|
|
13888
|
+
] }),
|
|
13889
|
+
editor && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(McpEditor, { value: editor, close: () => setEditor(void 0), saved: (next) => {
|
|
13890
|
+
setCatalog(next);
|
|
13891
|
+
setNotice("\u914D\u7F6E\u5DF2\u4FDD\u5B58\u3002\u8BF7\u8FDE\u63A5 / \u5237\u65B0\u5DE5\u5177\uFF0C\u7136\u540E\u5728\u4F19\u4F34\u80FD\u529B\u4E2D\u6388\u6743\u3002");
|
|
13892
|
+
setEditor(void 0);
|
|
13893
|
+
} }),
|
|
13894
|
+
details && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(WorkspaceDialog, { title: `${details.name} \xB7 \u5DE5\u5177\u5217\u8868`, detail: "\u5237\u65B0\u5DE5\u5177\u4F1A\u91CD\u65B0\u83B7\u53D6\u540D\u79F0\u3001\u8BF4\u660E\u548C\u53C2\u6570\uFF1B\u4E0D\u6267\u884C\u4EFB\u4F55\u4E1A\u52A1\u5DE5\u5177\u3002", close: () => setDetails(void 0), children: !details.tools.length ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CollectionEmpty, { title: "\u6682\u65E0\u5DE5\u5177", detail: "\u8BF7\u5148\u8FDE\u63A5 / \u5237\u65B0\u5DE5\u5177\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "dsh-partner-mcp-tool-list", children: details.tools.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("details", { children: [
|
|
13895
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("summary", { children: tool.name }),
|
|
13896
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { children: tool.description || "\u670D\u52A1\u672A\u63D0\u4F9B\u8BF4\u660E" }),
|
|
13897
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("pre", { children: JSON.stringify(tool.inputSchema, null, 2) })
|
|
13898
|
+
] }, tool.name)) }) }),
|
|
13899
|
+
deleting && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(WorkspaceDialog, { title: "\u5220\u9664 MCP \u670D\u52A1", detail: `\u786E\u8BA4\u5220\u9664\u201C${deleting.name}\u201D\uFF1F\u5173\u8054\u6388\u6743\u4E5F\u4F1A\u79FB\u9664\uFF0C\u4E0D\u4F1A\u5220\u9664\u8FDC\u7A0B\u670D\u52A1\u7684\u6570\u636E\u3002`, close: () => {
|
|
13900
|
+
if (!busy) setDeleting(void 0);
|
|
13901
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "dsh-partner-feature-form", children: [
|
|
13902
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(WorkspaceNotice, { children: error }),
|
|
13903
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("footer", { children: [
|
|
13904
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", disabled: !!busy, onClick: () => setDeleting(void 0), children: "\u53D6\u6D88" }),
|
|
13905
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("button", { type: "button", className: "is-primary", disabled: !!busy, onClick: () => {
|
|
13906
|
+
void action(deleting, "delete");
|
|
13907
|
+
}, children: busy ? "\u5220\u9664\u4E2D\u2026" : "\u786E\u8BA4\u5220\u9664" })
|
|
13908
|
+
] })
|
|
13909
|
+
] }) })
|
|
13910
|
+
] });
|
|
13911
|
+
}
|
|
13912
|
+
|
|
13913
|
+
// src/ui/mcp.css
|
|
13914
|
+
var mcp_default = ".dsh-partner-market-grid footer.dsh-partner-mcp-actions { flex-wrap: wrap; justify-content: flex-start; gap: 8px; }\n.dsh-partner-mcp-tool-list { display: grid; gap: 12px; min-width: 0; }\n.dsh-partner-mcp-tool-list summary { cursor: pointer; overflow-wrap: anywhere; }\n.dsh-partner-mcp-tool-list p, .dsh-partner-mcp-tool-list pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }\n.dsh-partner-mcp-examples { min-width: 0; color: var(--partner-text-secondary); font-size: var(--partner-font-body); }\n.dsh-partner-mcp-examples summary { cursor: pointer; padding: 8px 0; }\n.dsh-partner-mcp-examples pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--partner-font-caption); }\n.dsh-partner-skill-installed.dsh-partner-mcp-bindings > article { grid-template-columns: minmax(0, 1fr) auto; min-height: 0; gap: 12px; padding: 10px 12px; }\n.dsh-partner-mcp-bindings > article > span { display: grid; min-width: 0; gap: 2px; }\n.dsh-partner-mcp-bindings > article strong { overflow-wrap: anywhere; }\n.dsh-partner-mcp-bindings > article p { white-space: normal; font-size: var(--partner-font-caption); }\n.dsh-partner-workspace .dsh-partner-mcp-bindings > article > button,\n.dsh-partner-workspace-dialog .dsh-partner-mcp-bindings > article > button { width: auto; min-width: 0; min-height: 32px; height: auto; padding: 6px 10px; justify-self: end; align-self: center; white-space: nowrap; font-size: var(--partner-font-caption); line-height: 1.4; }\n@media (pointer: coarse) {\n .dsh-partner-workspace .dsh-partner-mcp-bindings > article > button,\n .dsh-partner-workspace-dialog .dsh-partner-mcp-bindings > article > button { min-height: 44px; min-width: 44px; }\n}\n";
|
|
13915
|
+
|
|
13656
13916
|
// src/ui/requirement-board.tsx
|
|
13657
|
-
var
|
|
13658
|
-
var
|
|
13917
|
+
var import_react37 = require("react");
|
|
13918
|
+
var import_dsh_client_ui_primitives16 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
13659
13919
|
|
|
13660
13920
|
// src/ui/board-refresh.ts
|
|
13661
|
-
var
|
|
13921
|
+
var import_react33 = require("react");
|
|
13662
13922
|
function useBoardRefresh(read, failed, enabled = true) {
|
|
13663
|
-
const readRef = (0,
|
|
13923
|
+
const readRef = (0, import_react33.useRef)(read), failedRef = (0, import_react33.useRef)(failed);
|
|
13664
13924
|
readRef.current = read;
|
|
13665
13925
|
failedRef.current = failed;
|
|
13666
|
-
const epoch = (0,
|
|
13667
|
-
const refresh = (0,
|
|
13926
|
+
const epoch = (0, import_react33.useRef)(0), pending = (0, import_react33.useRef)(), mounted = (0, import_react33.useRef)(false);
|
|
13927
|
+
const refresh = (0, import_react33.useCallback)(async () => {
|
|
13668
13928
|
const version = ++epoch.current;
|
|
13669
13929
|
await pending.current;
|
|
13670
13930
|
if (!mounted.current || version !== epoch.current) return;
|
|
@@ -13680,7 +13940,7 @@ function useBoardRefresh(read, failed, enabled = true) {
|
|
|
13680
13940
|
await request;
|
|
13681
13941
|
if (pending.current === request) pending.current = void 0;
|
|
13682
13942
|
}, []);
|
|
13683
|
-
(0,
|
|
13943
|
+
(0, import_react33.useEffect)(() => {
|
|
13684
13944
|
if (!enabled) return;
|
|
13685
13945
|
mounted.current = true;
|
|
13686
13946
|
void refresh();
|
|
@@ -13700,15 +13960,15 @@ function useBoardRefresh(read, failed, enabled = true) {
|
|
|
13700
13960
|
}
|
|
13701
13961
|
|
|
13702
13962
|
// src/ui/requirement-dialog.tsx
|
|
13703
|
-
var
|
|
13704
|
-
var
|
|
13705
|
-
var
|
|
13963
|
+
var import_react34 = require("react");
|
|
13964
|
+
var import_dsh_client_ui_primitives13 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
13965
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
13706
13966
|
function requirementStatus(item) {
|
|
13707
13967
|
if (item.lastError) return item.status === "done" ? "\u5DF2\u5F52\u6863 \xB7 \u901A\u77E5\u5F85\u91CD\u8BD5" : "\u6536\u5C3E\u5F85\u91CD\u8BD5";
|
|
13708
13968
|
return { planning: "\u89C4\u5212\u4E2D", active: "\u63A8\u8FDB\u4E2D", review: "\u6C47\u603B\u4E2D", done: "\u5DF2\u5F52\u6863" }[item.status];
|
|
13709
13969
|
}
|
|
13710
13970
|
function RequirementForm({ directory, close, created }) {
|
|
13711
|
-
const [busy, setBusy] = (0,
|
|
13971
|
+
const [busy, setBusy] = (0, import_react34.useState)(false), [error, setError] = (0, import_react34.useState)();
|
|
13712
13972
|
const submit = async (event) => {
|
|
13713
13973
|
event.preventDefault();
|
|
13714
13974
|
const data = new FormData(event.currentTarget);
|
|
@@ -13723,37 +13983,37 @@ function RequirementForm({ directory, close, created }) {
|
|
|
13723
13983
|
setBusy(false);
|
|
13724
13984
|
}
|
|
13725
13985
|
};
|
|
13726
|
-
return /* @__PURE__ */ (0,
|
|
13986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("form", { className: "dsh-partner-task-form", "aria-busy": busy, onSubmit: (event) => {
|
|
13727
13987
|
void submit(event);
|
|
13728
13988
|
}, children: [
|
|
13729
|
-
error && /* @__PURE__ */ (0,
|
|
13730
|
-
/* @__PURE__ */ (0,
|
|
13731
|
-
/* @__PURE__ */ (0,
|
|
13732
|
-
/* @__PURE__ */ (0,
|
|
13989
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(WorkspaceNotice, { children: error }),
|
|
13990
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "is-wide", children: [
|
|
13991
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "\u9700\u6C42\u540D\u79F0" }),
|
|
13992
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("input", { name: "title", autoFocus: true, required: true, maxLength: 200, placeholder: "\u8FD9\u6B21\u5E0C\u671B\u5B8C\u6210\u4EC0\u4E48" })
|
|
13733
13993
|
] }),
|
|
13734
|
-
/* @__PURE__ */ (0,
|
|
13735
|
-
/* @__PURE__ */ (0,
|
|
13736
|
-
/* @__PURE__ */ (0,
|
|
13994
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "is-wide", children: [
|
|
13995
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "\u4EA4\u4ED8\u76EE\u6807" }),
|
|
13996
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("textarea", { name: "description", rows: 5, maxLength: 8e3, placeholder: "\u80CC\u666F\u3001\u9884\u671F\u6210\u679C\u4E0E\u6574\u4F53\u5B8C\u6210\u6807\u51C6" })
|
|
13737
13997
|
] }),
|
|
13738
|
-
/* @__PURE__ */ (0,
|
|
13739
|
-
/* @__PURE__ */ (0,
|
|
13740
|
-
/* @__PURE__ */ (0,
|
|
13741
|
-
/* @__PURE__ */ (0,
|
|
13742
|
-
directory.map((c) => /* @__PURE__ */ (0,
|
|
13998
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "is-wide", children: [
|
|
13999
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "\u6536\u5C3E\u8D1F\u8D23\u4EBA" }),
|
|
14000
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("select", { name: "owner", defaultValue: "", children: [
|
|
14001
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: "", children: "\u4EBA\u5DE5\u6C47\u603B" }),
|
|
14002
|
+
directory.map((c) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("option", { value: c.id, children: [
|
|
13743
14003
|
"@",
|
|
13744
14004
|
c.name
|
|
13745
14005
|
] }, c.id))
|
|
13746
14006
|
] }),
|
|
13747
|
-
/* @__PURE__ */ (0,
|
|
14007
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("small", { children: "\u5B50\u4EFB\u52A1\u5168\u90E8\u901A\u8FC7\u9A8C\u6536\u540E\uFF0C\u7531\u8BE5\u4F19\u4F34\u603B\u7ED3\u5E76\u901A\u8FC7\u9700\u6C42\u6765\u6E90\u6E20\u9053\u901A\u77E5\u3002" })
|
|
13748
14008
|
] }),
|
|
13749
|
-
/* @__PURE__ */ (0,
|
|
13750
|
-
/* @__PURE__ */ (0,
|
|
13751
|
-
/* @__PURE__ */ (0,
|
|
14009
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("footer", { children: [
|
|
14010
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", onClick: close, disabled: busy, children: "\u53D6\u6D88" }),
|
|
14011
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u5E76\u5B89\u6392\u4EFB\u52A1" })
|
|
13752
14012
|
] })
|
|
13753
14013
|
] });
|
|
13754
14014
|
}
|
|
13755
14015
|
function RequirementDetail({ item, tasks, directory, changed: changed2, close }) {
|
|
13756
|
-
const [busy, setBusy] = (0,
|
|
14016
|
+
const [busy, setBusy] = (0, import_react34.useState)(false), [error, setError] = (0, import_react34.useState)(), [confirming, setConfirming] = (0, import_react34.useState)(false), [summary, setSummary] = (0, import_react34.useState)("");
|
|
13757
14017
|
const done = tasks.filter((t) => t.status === "done").length, ready = tasks.length > 0 && done === tasks.length && item.status !== "planning";
|
|
13758
14018
|
const act = async (action, body = {}) => {
|
|
13759
14019
|
setBusy(true);
|
|
@@ -13769,94 +14029,94 @@ function RequirementDetail({ item, tasks, directory, changed: changed2, close })
|
|
|
13769
14029
|
setBusy(false);
|
|
13770
14030
|
}
|
|
13771
14031
|
};
|
|
13772
|
-
return /* @__PURE__ */ (0,
|
|
13773
|
-
error && /* @__PURE__ */ (0,
|
|
13774
|
-
/* @__PURE__ */ (0,
|
|
13775
|
-
/* @__PURE__ */ (0,
|
|
13776
|
-
/* @__PURE__ */ (0,
|
|
14032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "dsh-partner-task-detail dsh-partner-requirement-detail", "aria-busy": busy, children: [
|
|
14033
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(WorkspaceNotice, { children: error }),
|
|
14034
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("section", { className: "dsh-partner-task-description", children: [
|
|
14035
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("strong", { children: "\u4EA4\u4ED8\u76EE\u6807" }),
|
|
14036
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { children: item.description || "\u672A\u8865\u5145\u4EA4\u4ED8\u76EE\u6807" })
|
|
13777
14037
|
] }),
|
|
13778
|
-
/* @__PURE__ */ (0,
|
|
13779
|
-
/* @__PURE__ */ (0,
|
|
14038
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "dsh-partner-requirement-facts", children: [
|
|
14039
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
|
|
13780
14040
|
"\u6536\u5C3E\u8D1F\u8D23\u4EBA",
|
|
13781
|
-
/* @__PURE__ */ (0,
|
|
14041
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("b", { children: directory.find((c) => c.id === item.ownerCompanionId)?.name ?? "\u4EBA\u5DE5\u6C47\u603B" })
|
|
13782
14042
|
] }),
|
|
13783
|
-
/* @__PURE__ */ (0,
|
|
14043
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
|
|
13784
14044
|
"\u5B50\u4EFB\u52A1\u9A8C\u6536",
|
|
13785
|
-
/* @__PURE__ */ (0,
|
|
14045
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("b", { children: item.status === "done" ? `${item.results?.length ?? done} \u9879\u5DF2\u5F52\u6863` : `${done} / ${tasks.length}` })
|
|
13786
14046
|
] }),
|
|
13787
|
-
/* @__PURE__ */ (0,
|
|
14047
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
|
|
13788
14048
|
"\u901A\u77E5\u65B9\u5F0F",
|
|
13789
|
-
/* @__PURE__ */ (0,
|
|
14049
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("b", { children: item.creatorSessionId ? "\u9700\u6C42\u6765\u6E90\u4F1A\u8BDD / \u6E20\u9053" : "\u770B\u677F\u5185\u67E5\u770B\u7ED3\u679C" })
|
|
13790
14050
|
] })
|
|
13791
14051
|
] }),
|
|
13792
|
-
item.lastError && /* @__PURE__ */ (0,
|
|
14052
|
+
item.lastError && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(WorkspaceNotice, { children: [
|
|
13793
14053
|
item.lastError,
|
|
13794
14054
|
" \xB7 \u7CFB\u7EDF\u4F1A\u81EA\u52A8\u91CD\u8BD5\uFF0C\u4E5F\u53EF\u7ACB\u5373\u91CD\u8BD5\u3002",
|
|
13795
|
-
/* @__PURE__ */ (0,
|
|
14055
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", disabled: busy, onClick: () => {
|
|
13796
14056
|
void act("retry");
|
|
13797
14057
|
}, children: "\u7ACB\u5373\u91CD\u8BD5" })
|
|
13798
14058
|
] }),
|
|
13799
|
-
item.summary && /* @__PURE__ */ (0,
|
|
13800
|
-
/* @__PURE__ */ (0,
|
|
13801
|
-
/* @__PURE__ */ (0,
|
|
14059
|
+
item.summary && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("section", { className: "dsh-partner-task-result", children: [
|
|
14060
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("strong", { children: "\u6700\u7EC8\u7ED3\u8BBA" }),
|
|
14061
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { children: item.summary })
|
|
13802
14062
|
] }),
|
|
13803
|
-
!!item.results?.length && /* @__PURE__ */ (0,
|
|
13804
|
-
/* @__PURE__ */ (0,
|
|
14063
|
+
!!item.results?.length && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
|
|
14064
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("summary", { children: [
|
|
13805
14065
|
"\u4EA4\u4ED8\u8BB0\u5F55 \xB7 ",
|
|
13806
14066
|
item.results.length,
|
|
13807
14067
|
" \u9879"
|
|
13808
14068
|
] }),
|
|
13809
|
-
item.results.map((result) => /* @__PURE__ */ (0,
|
|
13810
|
-
/* @__PURE__ */ (0,
|
|
13811
|
-
/* @__PURE__ */ (0,
|
|
14069
|
+
item.results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("section", { className: "dsh-partner-task-result", children: [
|
|
14070
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("strong", { children: result.title }),
|
|
14071
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { children: result.resultSummary || result.resultAbstract || "\u672A\u63D0\u4F9B\u7ED3\u679C\u6B63\u6587" })
|
|
13812
14072
|
] }, result.id))
|
|
13813
14073
|
] }),
|
|
13814
|
-
item.status !== "done" && /* @__PURE__ */ (0,
|
|
13815
|
-
/* @__PURE__ */ (0,
|
|
13816
|
-
/* @__PURE__ */ (0,
|
|
13817
|
-
/* @__PURE__ */ (0,
|
|
14074
|
+
item.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
14075
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "dsh-partner-requirement-owner", children: [
|
|
14076
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "\u8C03\u6574\u6536\u5C3E\u8D1F\u8D23\u4EBA" }),
|
|
14077
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("select", { "aria-label": "\u6536\u5C3E\u8D1F\u8D23\u4EBA", value: item.ownerCompanionId ?? "", disabled: busy, onChange: (event) => {
|
|
13818
14078
|
void act("owner", { ownerCompanionId: event.target.value });
|
|
13819
14079
|
}, children: [
|
|
13820
|
-
/* @__PURE__ */ (0,
|
|
13821
|
-
item.ownerCompanionId && !directory.some((c) => c.id === item.ownerCompanionId) && /* @__PURE__ */ (0,
|
|
13822
|
-
directory.map((c) => /* @__PURE__ */ (0,
|
|
14080
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: "", children: "\u4EBA\u5DE5\u6C47\u603B" }),
|
|
14081
|
+
item.ownerCompanionId && !directory.some((c) => c.id === item.ownerCompanionId) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: item.ownerCompanionId, children: "\u539F\u8D1F\u8D23\u4EBA\u5DF2\u5220\u9664" }),
|
|
14082
|
+
directory.map((c) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("option", { value: c.id, children: [
|
|
13823
14083
|
"@",
|
|
13824
14084
|
c.name
|
|
13825
14085
|
] }, c.id))
|
|
13826
14086
|
] })
|
|
13827
14087
|
] }),
|
|
13828
|
-
/* @__PURE__ */ (0,
|
|
13829
|
-
ready && /* @__PURE__ */ (0,
|
|
13830
|
-
/* @__PURE__ */ (0,
|
|
13831
|
-
/* @__PURE__ */ (0,
|
|
13832
|
-
/* @__PURE__ */ (0,
|
|
13833
|
-
/* @__PURE__ */ (0,
|
|
14088
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(WorkspaceNotice, { kind: "warning", children: item.status === "planning" ? "\u5168\u90E8\u5B50\u4EFB\u52A1\u5B89\u6392\u597D\u540E\uFF0C\u63D0\u4EA4\u672C\u6B21\u89C4\u5212\uFF1B\u5220\u9664\u5B50\u4EFB\u52A1\u4F1A\u91CD\u65B0\u6253\u5F00\u89C4\u5212\uFF0C\u9700\u786E\u8BA4\u65B0\u7684\u4EA4\u4ED8\u8303\u56F4\u3002" : "\u5B50\u4EFB\u52A1\u7684\u6267\u884C\u548C\u9A8C\u6536\u53EA\u5728\u5185\u90E8\u6D41\u8F6C\uFF0C\u5168\u90E8\u5B8C\u6210\u540E\u624D\u6C47\u603B\u9700\u6C42\u7ED3\u679C\u3002" }),
|
|
14089
|
+
ready && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
|
|
14090
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("summary", { children: "\u4EBA\u5DE5\u5B8C\u6210\u6536\u5C3E" }),
|
|
14091
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { children: [
|
|
14092
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "\u6700\u7EC8\u7ED3\u8BBA" }),
|
|
14093
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("textarea", { rows: 5, maxLength: 12e3, value: summary, onChange: (event) => setSummary(event.target.value), placeholder: "\u786E\u8BA4\u5B9E\u9645\u4EA4\u4ED8\u5185\u5BB9\u3001\u7ED3\u8BBA\u53CA\u9650\u5236" })
|
|
13834
14094
|
] }),
|
|
13835
|
-
/* @__PURE__ */ (0,
|
|
14095
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", disabled: busy || !summary.trim(), onClick: () => {
|
|
13836
14096
|
void act("finish", { summary });
|
|
13837
14097
|
}, children: "\u4FDD\u5B58\u603B\u7ED3\u5E76\u5F52\u6863" })
|
|
13838
14098
|
] })
|
|
13839
14099
|
] }),
|
|
13840
|
-
/* @__PURE__ */ (0,
|
|
13841
|
-
/* @__PURE__ */ (0,
|
|
13842
|
-
/* @__PURE__ */ (0,
|
|
13843
|
-
confirming ? /* @__PURE__ */ (0,
|
|
13844
|
-
/* @__PURE__ */ (0,
|
|
13845
|
-
/* @__PURE__ */ (0,
|
|
14100
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
|
|
14101
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("summary", { children: "\u7BA1\u7406\u9700\u6C42" }),
|
|
14102
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { children: "\u5220\u9664\u9700\u6C42\u4F1A\u540C\u65F6\u79FB\u9664\u5B50\u4EFB\u52A1\uFF0C\u5E76\u53D6\u6D88\u5173\u8054\u6267\u884C\u3002\u4E0D\u80FD\u64A4\u9500\uFF0C\u4E0D\u4F1A\u5220\u9664\u5DF2\u751F\u6210\u7684\u4EA4\u4ED8\u6587\u4EF6\u3002" }),
|
|
14103
|
+
confirming ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "dsh-partner-requirement-actions", children: [
|
|
14104
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirming(false), children: "\u4FDD\u7559\u9700\u6C42" }),
|
|
14105
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("button", { type: "button", className: "is-danger", disabled: busy, onClick: () => {
|
|
13846
14106
|
void act("remove");
|
|
13847
14107
|
}, children: [
|
|
13848
14108
|
"\u786E\u8BA4\u5220\u9664\u9700\u6C42\u548C ",
|
|
13849
14109
|
tasks.length,
|
|
13850
14110
|
" \u4E2A\u4EFB\u52A1"
|
|
13851
14111
|
] })
|
|
13852
|
-
] }) : /* @__PURE__ */ (0,
|
|
13853
|
-
/* @__PURE__ */ (0,
|
|
14112
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("button", { type: "button", className: "is-danger", onClick: () => setConfirming(true), children: [
|
|
14113
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_dsh_client_ui_primitives13.IconTrashOutline16, { size: 14 }),
|
|
13854
14114
|
"\u5220\u9664\u9700\u6C42"
|
|
13855
14115
|
] })
|
|
13856
14116
|
] }),
|
|
13857
|
-
/* @__PURE__ */ (0,
|
|
13858
|
-
/* @__PURE__ */ (0,
|
|
13859
|
-
item.status !== "done" && /* @__PURE__ */ (0,
|
|
14117
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("footer", { children: [
|
|
14118
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", onClick: close, disabled: busy, children: "\u5173\u95ED" }),
|
|
14119
|
+
item.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", className: "is-primary", disabled: busy || item.status === "planning" && !tasks.length, onClick: () => {
|
|
13860
14120
|
void act(item.status === "planning" ? "submit" : "reopen");
|
|
13861
14121
|
}, children: busy ? "\u5904\u7406\u4E2D\u2026" : item.status === "planning" ? "\u63D0\u4EA4\u89C4\u5212" : "\u8C03\u6574\u4EFB\u52A1\u8303\u56F4" })
|
|
13862
14122
|
] })
|
|
@@ -13864,109 +14124,109 @@ function RequirementDetail({ item, tasks, directory, changed: changed2, close })
|
|
|
13864
14124
|
}
|
|
13865
14125
|
|
|
13866
14126
|
// src/ui/requirement-tasks-panel.tsx
|
|
13867
|
-
var
|
|
13868
|
-
var
|
|
14127
|
+
var import_react36 = require("react");
|
|
14128
|
+
var import_dsh_client_ui_primitives15 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
13869
14129
|
|
|
13870
14130
|
// src/ui/task-board-stage.tsx
|
|
13871
|
-
var
|
|
13872
|
-
var
|
|
13873
|
-
var
|
|
14131
|
+
var import_react35 = require("react");
|
|
14132
|
+
var import_dsh_client_ui_primitives14 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
14133
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
13874
14134
|
function TaskBoardStage({ id, label, tasks, focused, filtered, renderTask }) {
|
|
13875
|
-
const [collapsed, setCollapsed] = (0,
|
|
13876
|
-
const [limit, setLimit] = (0,
|
|
14135
|
+
const [collapsed, setCollapsed] = (0, import_react35.useState)(false);
|
|
14136
|
+
const [limit, setLimit] = (0, import_react35.useState)(6);
|
|
13877
14137
|
const count = Math.max(limit, focused ? 12 : 6);
|
|
13878
14138
|
const titleId = `dsh-partner-board-${id}`, listId = `${titleId}-list`;
|
|
13879
14139
|
const expanded = !collapsed;
|
|
13880
|
-
return /* @__PURE__ */ (0,
|
|
13881
|
-
/* @__PURE__ */ (0,
|
|
13882
|
-
/* @__PURE__ */ (0,
|
|
13883
|
-
/* @__PURE__ */ (0,
|
|
13884
|
-
/* @__PURE__ */ (0,
|
|
14140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { "data-status": id, "data-empty": tasks.length === 0, "aria-labelledby": titleId, children: [
|
|
14141
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("header", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: "dsh-partner-board-stage-toggle", "aria-expanded": expanded, "aria-controls": listId, onClick: () => setCollapsed((value) => !value), children: [
|
|
14142
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_dsh_client_ui_primitives14.IconChevronRightOutline14, { size: 14 }),
|
|
14143
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("strong", { id: titleId, children: label }),
|
|
14144
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("b", { children: tasks.length })
|
|
13885
14145
|
] }) }),
|
|
13886
|
-
/* @__PURE__ */ (0,
|
|
13887
|
-
/* @__PURE__ */ (0,
|
|
13888
|
-
tasks.length > count && /* @__PURE__ */ (0,
|
|
14146
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { id: listId, hidden: !expanded, children: tasks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
14147
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "dsh-partner-board-column-list", children: tasks.slice(0, count).map(renderTask) }),
|
|
14148
|
+
tasks.length > count && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("button", { type: "button", className: "dsh-partner-board-more", onClick: () => setLimit(count + 12), children: [
|
|
13889
14149
|
"\u5C55\u5F00\u66F4\u591A \xB7 \u8FD8\u6709 ",
|
|
13890
14150
|
tasks.length - count,
|
|
13891
14151
|
" \u9879"
|
|
13892
14152
|
] })
|
|
13893
|
-
] }) : /* @__PURE__ */ (0,
|
|
14153
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "dsh-partner-board-empty", children: filtered ? "\u6CA1\u6709\u5339\u914D\u4EFB\u52A1" : "\u6682\u65E0\u4EFB\u52A1" }) })
|
|
13894
14154
|
] });
|
|
13895
14155
|
}
|
|
13896
14156
|
|
|
13897
14157
|
// src/ui/task-contract-panel.tsx
|
|
13898
|
-
var
|
|
14158
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
13899
14159
|
function TaskContractPanel({ task, checks, setChecks, busy }) {
|
|
13900
14160
|
if (!task.acceptanceCriteria?.length && !task.resourceKeys?.length) return null;
|
|
13901
14161
|
const editing = task.status === "review";
|
|
13902
14162
|
const change = (criterion, patch) => setChecks((task.acceptanceCriteria ?? []).map((_, i) => ({ criterion: i + 1, verdict: "unverified", ...checks.find((c) => c.criterion === i + 1), ...criterion === i + 1 ? patch : {} })));
|
|
13903
|
-
return /* @__PURE__ */ (0,
|
|
13904
|
-
Boolean(task.acceptanceCriteria?.length) && /* @__PURE__ */ (0,
|
|
13905
|
-
/* @__PURE__ */ (0,
|
|
14163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("section", { className: "dsh-partner-task-contract", children: [
|
|
14164
|
+
Boolean(task.acceptanceCriteria?.length) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("header", { children: [
|
|
14165
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("strong", { children: [
|
|
13906
14166
|
"\u9A8C\u6536\u6E05\u5355 \xB7 ",
|
|
13907
14167
|
task.acceptanceCriteria?.length
|
|
13908
14168
|
] }),
|
|
13909
|
-
/* @__PURE__ */ (0,
|
|
14169
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("small", { children: "\u4F19\u4F34 / \u4EBA\u5DE5\u6838\u9A8C\uFF0C\u4E0D\u7B49\u4E8E\u7A0B\u5E8F\u9A8C\u8BC1" })
|
|
13910
14170
|
] }),
|
|
13911
|
-
/* @__PURE__ */ (0,
|
|
14171
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("ol", { children: task.acceptanceCriteria?.map((text4, i) => {
|
|
13912
14172
|
const criterion = i + 1, check = checks.find((c) => c.criterion === criterion);
|
|
13913
14173
|
const saved = task.reviewChecks?.find((c) => c.criterion === criterion);
|
|
13914
14174
|
const previous3 = task.previousAttempt?.reviewChecks?.find((c) => c.criterion === criterion);
|
|
13915
14175
|
const evidence = (task.evidence ?? []).filter((e) => e.criterion === criterion);
|
|
13916
|
-
return /* @__PURE__ */ (0,
|
|
13917
|
-
/* @__PURE__ */ (0,
|
|
13918
|
-
evidence.length > 0 && /* @__PURE__ */ (0,
|
|
13919
|
-
/* @__PURE__ */ (0,
|
|
14176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("li", { children: [
|
|
14177
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { children: text4 }),
|
|
14178
|
+
evidence.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
|
|
14179
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("summary", { children: [
|
|
13920
14180
|
"\u6267\u884C\u8BC1\u636E \xB7 ",
|
|
13921
14181
|
evidence.length,
|
|
13922
14182
|
" \xB7 \u5C1A\u9700\u6838\u9A8C"
|
|
13923
14183
|
] }),
|
|
13924
|
-
evidence.map((e, j) => /* @__PURE__ */ (0,
|
|
13925
|
-
/* @__PURE__ */ (0,
|
|
13926
|
-
e.note && /* @__PURE__ */ (0,
|
|
14184
|
+
evidence.map((e, j) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
|
|
14185
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("code", { children: e.reference }),
|
|
14186
|
+
e.note && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("small", { children: e.note })
|
|
13927
14187
|
] }, j))
|
|
13928
14188
|
] }),
|
|
13929
|
-
previous3?.reason && /* @__PURE__ */ (0,
|
|
14189
|
+
previous3?.reason && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("small", { children: [
|
|
13930
14190
|
"\u4E0A\u6B21\u6838\u9A8C\uFF1A",
|
|
13931
14191
|
previous3.reason
|
|
13932
14192
|
] }),
|
|
13933
|
-
editing ? /* @__PURE__ */ (0,
|
|
13934
|
-
/* @__PURE__ */ (0,
|
|
13935
|
-
/* @__PURE__ */ (0,
|
|
14193
|
+
editing ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "dsh-partner-task-fields", children: [
|
|
14194
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { children: [
|
|
14195
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { children: [
|
|
13936
14196
|
"\u7B2C ",
|
|
13937
14197
|
criterion,
|
|
13938
14198
|
" \u9879\u7ED3\u8BBA"
|
|
13939
14199
|
] }),
|
|
13940
|
-
/* @__PURE__ */ (0,
|
|
13941
|
-
/* @__PURE__ */ (0,
|
|
13942
|
-
/* @__PURE__ */ (0,
|
|
13943
|
-
/* @__PURE__ */ (0,
|
|
14200
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("select", { disabled: busy, value: check?.verdict ?? "unverified", onChange: (e) => change(criterion, { verdict: e.target.value }), children: [
|
|
14201
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("option", { value: "unverified", children: "\u672A\u9A8C\u8BC1" }),
|
|
14202
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("option", { value: "passed", children: "\u5DF2\u6838\u9A8C\u901A\u8FC7" }),
|
|
14203
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("option", { value: "failed", children: "\u672A\u901A\u8FC7" })
|
|
13944
14204
|
] })
|
|
13945
14205
|
] }),
|
|
13946
|
-
/* @__PURE__ */ (0,
|
|
13947
|
-
/* @__PURE__ */ (0,
|
|
13948
|
-
/* @__PURE__ */ (0,
|
|
14206
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { children: [
|
|
14207
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: check?.verdict === "passed" ? "\u5B9E\u9645\u6838\u9A8C\u8BC1\u636E" : "\u7F3A\u9879 / \u65E0\u6CD5\u6838\u9A8C\u7684\u539F\u56E0" }),
|
|
14208
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("textarea", { rows: 2, maxLength: 1e3, disabled: busy, value: (check?.verdict === "passed" ? check.evidence : check?.reason) ?? "", onChange: (e) => change(criterion, check?.verdict === "passed" ? { evidence: e.target.value } : { reason: e.target.value }) })
|
|
13949
14209
|
] })
|
|
13950
|
-
] }) : saved && /* @__PURE__ */ (0,
|
|
14210
|
+
] }) : saved && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("small", { children: [
|
|
13951
14211
|
saved.verdict === "passed" ? "\u6838\u9A8C\u901A\u8FC7" : saved.verdict === "failed" ? "\u672A\u901A\u8FC7" : "\u672A\u9A8C\u8BC1",
|
|
13952
14212
|
" \xB7 ",
|
|
13953
14213
|
saved.evidence ?? saved.reason
|
|
13954
14214
|
] })
|
|
13955
14215
|
] }, criterion);
|
|
13956
14216
|
}) }),
|
|
13957
|
-
task.resourceKeys?.length ? /* @__PURE__ */ (0,
|
|
13958
|
-
/* @__PURE__ */ (0,
|
|
14217
|
+
task.resourceKeys?.length ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
|
|
14218
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("summary", { children: [
|
|
13959
14219
|
"\u72EC\u5360\u8D44\u6E90\u58F0\u660E \xB7 ",
|
|
13960
14220
|
task.resourceKeys.length
|
|
13961
14221
|
] }),
|
|
13962
|
-
task.resourceKeys.map((key) => /* @__PURE__ */ (0,
|
|
13963
|
-
/* @__PURE__ */ (0,
|
|
14222
|
+
task.resourceKeys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("code", { children: key }, key)),
|
|
14223
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("small", { children: "\u4EC5\u7EA6\u675F\u770B\u677F\u5185\u76F8\u540C\u58F0\u660E\uFF0C\u4E0D\u662F\u64CD\u4F5C\u7CFB\u7EDF\u9501\u3002" })
|
|
13964
14224
|
] }) : null
|
|
13965
14225
|
] });
|
|
13966
14226
|
}
|
|
13967
14227
|
|
|
13968
14228
|
// src/ui/requirement-tasks-panel.tsx
|
|
13969
|
-
var
|
|
14229
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
13970
14230
|
var COLUMNS = [
|
|
13971
14231
|
{ id: "backlog", label: "\u6536\u96C6\u7BB1" },
|
|
13972
14232
|
{ id: "ready", label: "\u5F85\u5F00\u59CB" },
|
|
@@ -13976,26 +14236,26 @@ var COLUMNS = [
|
|
|
13976
14236
|
{ id: "done", label: "\u5DF2\u5B8C\u6210" }
|
|
13977
14237
|
];
|
|
13978
14238
|
function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back, detailOnly = false } = {}) {
|
|
13979
|
-
const [board, setBoard] = (0,
|
|
13980
|
-
const [directory, setDirectory] = (0,
|
|
13981
|
-
const [delegations, setDelegations] = (0,
|
|
13982
|
-
const [creating, setCreating] = (0,
|
|
13983
|
-
const [requirementDetail, setRequirementDetail] = (0,
|
|
13984
|
-
const [selectedTaskId, setSelectedTaskId] = (0,
|
|
13985
|
-
(0,
|
|
14239
|
+
const [board, setBoard] = (0, import_react36.useState)({ tasks: [], activities: [] });
|
|
14240
|
+
const [directory, setDirectory] = (0, import_react36.useState)([]);
|
|
14241
|
+
const [delegations, setDelegations] = (0, import_react36.useState)([]);
|
|
14242
|
+
const [creating, setCreating] = (0, import_react36.useState)(false);
|
|
14243
|
+
const [requirementDetail, setRequirementDetail] = (0, import_react36.useState)(false);
|
|
14244
|
+
const [selectedTaskId, setSelectedTaskId] = (0, import_react36.useState)(initialTaskId);
|
|
14245
|
+
(0, import_react36.useEffect)(() => {
|
|
13986
14246
|
if (initialTaskId) setSelectedTaskId(initialTaskId);
|
|
13987
14247
|
}, [initialTaskId, openRequest]);
|
|
13988
|
-
const [busy, setBusy] = (0,
|
|
13989
|
-
const [loading, setLoading] = (0,
|
|
13990
|
-
const [error, setError] = (0,
|
|
13991
|
-
const [syncedAt, setSyncedAt] = (0,
|
|
13992
|
-
const [query, setQuery] = (0,
|
|
13993
|
-
const [statusFilter, setStatusFilter] = (0,
|
|
13994
|
-
const [assigneeFilter, setAssigneeFilter] = (0,
|
|
13995
|
-
const deferredQuery = (0,
|
|
13996
|
-
const tasksById = (0,
|
|
13997
|
-
const directoryById = (0,
|
|
13998
|
-
const activeDelegationByTaskId = (0,
|
|
14248
|
+
const [busy, setBusy] = (0, import_react36.useState)();
|
|
14249
|
+
const [loading, setLoading] = (0, import_react36.useState)(true);
|
|
14250
|
+
const [error, setError] = (0, import_react36.useState)();
|
|
14251
|
+
const [syncedAt, setSyncedAt] = (0, import_react36.useState)();
|
|
14252
|
+
const [query, setQuery] = (0, import_react36.useState)("");
|
|
14253
|
+
const [statusFilter, setStatusFilter] = (0, import_react36.useState)("all");
|
|
14254
|
+
const [assigneeFilter, setAssigneeFilter] = (0, import_react36.useState)("all");
|
|
14255
|
+
const deferredQuery = (0, import_react36.useDeferredValue)(query.trim().toLocaleLowerCase());
|
|
14256
|
+
const tasksById = (0, import_react36.useMemo)(() => new Map(board.tasks.map((item) => [item.id, item])), [board.tasks]);
|
|
14257
|
+
const directoryById = (0, import_react36.useMemo)(() => new Map(directory.map((item) => [item.id, item])), [directory]);
|
|
14258
|
+
const activeDelegationByTaskId = (0, import_react36.useMemo)(() => {
|
|
13999
14259
|
const result = /* @__PURE__ */ new Map();
|
|
14000
14260
|
for (const delegation of delegations) {
|
|
14001
14261
|
if ((delegation.status === "queued" || delegation.status === "running") && !result.has(delegation.taskId)) result.set(delegation.taskId, delegation);
|
|
@@ -14004,25 +14264,25 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
|
|
|
14004
14264
|
}, [delegations]);
|
|
14005
14265
|
const selectedTask = selectedTaskId ? tasksById.get(selectedTaskId) : void 0;
|
|
14006
14266
|
const requirement = board.requirements?.find((item) => item.id === requirementId);
|
|
14007
|
-
const requirementTasks = (0,
|
|
14008
|
-
const dependentsById = (0,
|
|
14267
|
+
const requirementTasks = (0, import_react36.useMemo)(() => board.tasks.filter((task) => !requirementId || (requirementId === "legacy" ? !task.requirementId : task.requirementId === requirementId)), [board.tasks, requirementId]);
|
|
14268
|
+
const dependentsById = (0, import_react36.useMemo)(() => {
|
|
14009
14269
|
const result = /* @__PURE__ */ new Map();
|
|
14010
14270
|
for (const task of board.tasks) for (const dependencyId of task.dependencyTaskIds) result.set(dependencyId, (result.get(dependencyId) ?? 0) + 1);
|
|
14011
14271
|
return result;
|
|
14012
14272
|
}, [board.tasks]);
|
|
14013
|
-
const scopedTasks = (0,
|
|
14273
|
+
const scopedTasks = (0, import_react36.useMemo)(() => requirementTasks.filter((task) => {
|
|
14014
14274
|
if (assigneeFilter !== "all" && (task.assigneeCompanionId ?? "unassigned") !== assigneeFilter) return false;
|
|
14015
14275
|
if (!deferredQuery) return true;
|
|
14016
14276
|
const dependencies = task.dependencyTaskIds.map((id) => tasksById.get(id)?.title ?? "");
|
|
14017
14277
|
return [task.title, task.description, task.resultAbstract, task.resultSummary, directoryById.get(task.assigneeCompanionId ?? "")?.name, ...dependencies].some((value) => value?.toLocaleLowerCase().includes(deferredQuery));
|
|
14018
14278
|
}), [assigneeFilter, requirementTasks, deferredQuery, directoryById, tasksById]);
|
|
14019
|
-
const statusCounts = (0,
|
|
14279
|
+
const statusCounts = (0, import_react36.useMemo)(() => {
|
|
14020
14280
|
const result = new Map(COLUMNS.map((column) => [column.id, 0]));
|
|
14021
14281
|
for (const task of scopedTasks) result.set(task.status, (result.get(task.status) ?? 0) + 1);
|
|
14022
14282
|
return result;
|
|
14023
14283
|
}, [scopedTasks]);
|
|
14024
14284
|
const visibleColumns = statusFilter === "all" ? COLUMNS.filter((column) => (statusCounts.get(column.id) ?? 0) > 0) : COLUMNS.filter((column) => column.id === statusFilter);
|
|
14025
|
-
const tasksByStatus = (0,
|
|
14285
|
+
const tasksByStatus = (0, import_react36.useMemo)(() => {
|
|
14026
14286
|
const priorityRank = { urgent: 3, high: 2, normal: 1, low: 0 };
|
|
14027
14287
|
const result = new Map(COLUMNS.map((column) => [column.id, []]));
|
|
14028
14288
|
for (const task of scopedTasks) {
|
|
@@ -14124,30 +14384,30 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
|
|
|
14124
14384
|
setBusy(void 0);
|
|
14125
14385
|
}
|
|
14126
14386
|
};
|
|
14127
|
-
return /* @__PURE__ */ (0,
|
|
14128
|
-
!detailOnly && /* @__PURE__ */ (0,
|
|
14129
|
-
back && /* @__PURE__ */ (0,
|
|
14130
|
-
/* @__PURE__ */ (0,
|
|
14131
|
-
/* @__PURE__ */ (0,
|
|
14132
|
-
/* @__PURE__ */ (0,
|
|
14387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "dsh-partner-feature-page is-board", children: [
|
|
14388
|
+
!detailOnly && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
14389
|
+
back && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("nav", { className: "dsh-partner-requirement-breadcrumb", children: [
|
|
14390
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", onClick: back, children: "\u9700\u6C42\u770B\u677F" }),
|
|
14391
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives15.IconChevronRightOutline14, { size: 14 }),
|
|
14392
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: requirement?.title ?? "\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1" })
|
|
14133
14393
|
] }),
|
|
14134
|
-
/* @__PURE__ */ (0,
|
|
14135
|
-
/* @__PURE__ */ (0,
|
|
14136
|
-
/* @__PURE__ */ (0,
|
|
14394
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WorkspaceHero, { eyebrow: requirement ? requirementStatus(requirement) : "\u65E7\u4EFB\u52A1", title: requirement?.title ?? "\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1", detail: requirement?.description || "\u4EFB\u52A1\u6309\u9636\u6BB5\u5C55\u793A\uFF0C\u70B9\u51FB\u67E5\u770B\u4EA4\u4ED8\u3001\u4F9D\u8D56\u548C\u6267\u884C\u72B6\u6001\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
14395
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "dsh-partner-board-live", title: syncedAt ? `\u6700\u8FD1\u540C\u6B65 ${new Date(syncedAt).toLocaleTimeString()}` : "\u6B63\u5728\u8FDE\u63A5", children: [
|
|
14396
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", {}),
|
|
14137
14397
|
"\u5B9E\u65F6\u540C\u6B65"
|
|
14138
14398
|
] }),
|
|
14139
|
-
requirement && /* @__PURE__ */ (0,
|
|
14140
|
-
requirement?.status === "planning" && /* @__PURE__ */ (0,
|
|
14141
|
-
/* @__PURE__ */ (0,
|
|
14399
|
+
requirement && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", onClick: () => setRequirementDetail(true), children: "\u9700\u6C42\u8BE6\u60C5" }),
|
|
14400
|
+
requirement?.status === "planning" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { type: "button", onClick: () => setCreating(true), children: [
|
|
14401
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives15.IconPlusOutline16, { size: 15 }),
|
|
14142
14402
|
"\u65B0\u4EFB\u52A1"
|
|
14143
14403
|
] })
|
|
14144
14404
|
] }) })
|
|
14145
14405
|
] }),
|
|
14146
|
-
error && /* @__PURE__ */ (0,
|
|
14147
|
-
requirementDetail && requirement && /* @__PURE__ */ (0,
|
|
14148
|
-
creating && requirement && /* @__PURE__ */ (0,
|
|
14149
|
-
selectedTask && /* @__PURE__ */ (0,
|
|
14150
|
-
/* @__PURE__ */ (0,
|
|
14406
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WorkspaceNotice, { children: error }),
|
|
14407
|
+
requirementDetail && requirement && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WorkspaceDialog, { eyebrow: "\u9700\u6C42\u8BE6\u60C5", title: requirement.title, detail: requirementStatus(requirement), close: () => setRequirementDetail(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RequirementDetail, { item: requirement, tasks: requirementTasks, directory, changed: load2, close: () => setRequirementDetail(false) }, requirement.id) }),
|
|
14408
|
+
creating && requirement && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u5B50\u4EFB\u52A1", detail: `\u6240\u5C5E\u9700\u6C42\uFF1A${requirement.title}`, close: () => setCreating(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TaskForm, { requirementId: requirement.id, companions: directory, tasks: requirementTasks, close: () => setCreating(false), changed: load2 }) }),
|
|
14409
|
+
selectedTask && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(WorkspaceDialog, { eyebrow: "TASK DETAIL", title: selectedTask.title, detail: taskDialogSummary(selectedTask, directory), close: () => setSelectedTaskId(void 0), width: "wide", children: [
|
|
14410
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
14151
14411
|
TaskDetail,
|
|
14152
14412
|
{
|
|
14153
14413
|
task: selectedTask,
|
|
@@ -14177,61 +14437,61 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
|
|
|
14177
14437
|
},
|
|
14178
14438
|
selectedTask.id
|
|
14179
14439
|
),
|
|
14180
|
-
error && /* @__PURE__ */ (0,
|
|
14440
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WorkspaceNotice, { children: error })
|
|
14181
14441
|
] }),
|
|
14182
|
-
!detailOnly && (loading ? /* @__PURE__ */ (0,
|
|
14183
|
-
/* @__PURE__ */ (0,
|
|
14184
|
-
/* @__PURE__ */ (0,
|
|
14185
|
-
/* @__PURE__ */ (0,
|
|
14186
|
-
/* @__PURE__ */ (0,
|
|
14187
|
-
/* @__PURE__ */ (0,
|
|
14188
|
-
query && /* @__PURE__ */ (0,
|
|
14442
|
+
!detailOnly && (loading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CollectionSkeleton, { rows: 6 }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
14443
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "dsh-partner-board-tools", children: [
|
|
14444
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "dsh-partner-board-search", children: [
|
|
14445
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u4EFB\u52A1" }),
|
|
14446
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives15.IconSearchOutline16, { size: 16 }) }),
|
|
14447
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: "\u641C\u7D22\u4EFB\u52A1\u3001\u8D1F\u8D23\u4EBA\u6216\u524D\u7F6E\u4EFB\u52A1" }),
|
|
14448
|
+
query && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", onClick: () => setQuery(""), "aria-label": "\u6E05\u9664\u4EFB\u52A1\u641C\u7D22", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives15.IconCloseOutline16, { size: 14 }) })
|
|
14189
14449
|
] }),
|
|
14190
|
-
/* @__PURE__ */ (0,
|
|
14191
|
-
/* @__PURE__ */ (0,
|
|
14192
|
-
/* @__PURE__ */ (0,
|
|
14193
|
-
/* @__PURE__ */ (0,
|
|
14194
|
-
/* @__PURE__ */ (0,
|
|
14195
|
-
directory.map((item) => /* @__PURE__ */ (0,
|
|
14450
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "dsh-partner-board-assignee", children: [
|
|
14451
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "sr-only", children: "\u6309\u8D1F\u8D23\u4EBA\u7B5B\u9009" }),
|
|
14452
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { value: assigneeFilter, onChange: (event) => setAssigneeFilter(event.target.value), children: [
|
|
14453
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "all", children: "\u5168\u90E8\u4F19\u4F34" }),
|
|
14454
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "unassigned", children: "\u672A\u6307\u6D3E" }),
|
|
14455
|
+
directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: item.id, children: [
|
|
14196
14456
|
"@",
|
|
14197
14457
|
item.name
|
|
14198
14458
|
] }, item.id))
|
|
14199
14459
|
] })
|
|
14200
14460
|
] }),
|
|
14201
|
-
/* @__PURE__ */ (0,
|
|
14202
|
-
/* @__PURE__ */ (0,
|
|
14203
|
-
/* @__PURE__ */ (0,
|
|
14204
|
-
/* @__PURE__ */ (0,
|
|
14461
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "dsh-partner-board-assignee is-mobile-stage", children: [
|
|
14462
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "sr-only", children: "\u6309\u4EFB\u52A1\u9636\u6BB5\u7B5B\u9009" }),
|
|
14463
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { value: statusFilter, onChange: (event) => setStatusFilter(event.target.value), children: [
|
|
14464
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: "all", children: [
|
|
14205
14465
|
"\u5168\u90E8\u9636\u6BB5 \xB7 ",
|
|
14206
14466
|
scopedTasks.length
|
|
14207
14467
|
] }),
|
|
14208
|
-
COLUMNS.map((column) => /* @__PURE__ */ (0,
|
|
14468
|
+
COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: column.id, children: [
|
|
14209
14469
|
column.label,
|
|
14210
14470
|
" \xB7 ",
|
|
14211
14471
|
statusCounts.get(column.id) ?? 0
|
|
14212
14472
|
] }, column.id))
|
|
14213
14473
|
] })
|
|
14214
14474
|
] }),
|
|
14215
|
-
/* @__PURE__ */ (0,
|
|
14475
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("small", { "aria-live": "polite", children: [
|
|
14216
14476
|
"\u663E\u793A ",
|
|
14217
14477
|
visibleTaskCount,
|
|
14218
14478
|
" / ",
|
|
14219
14479
|
board.tasks.length
|
|
14220
14480
|
] })
|
|
14221
14481
|
] }),
|
|
14222
|
-
/* @__PURE__ */ (0,
|
|
14223
|
-
/* @__PURE__ */ (0,
|
|
14224
|
-
/* @__PURE__ */ (0,
|
|
14225
|
-
/* @__PURE__ */ (0,
|
|
14482
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("nav", { className: "dsh-partner-board-statuses", "aria-label": "\u6309\u4EFB\u52A1\u72B6\u6001\u7B5B\u9009", children: [
|
|
14483
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { type: "button", className: statusFilter === "all" ? "is-active" : "", "aria-pressed": statusFilter === "all", onClick: () => setStatusFilter("all"), children: [
|
|
14484
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u5168\u90E8" }),
|
|
14485
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("b", { children: scopedTasks.length })
|
|
14226
14486
|
] }),
|
|
14227
|
-
COLUMNS.map((column) => /* @__PURE__ */ (0,
|
|
14228
|
-
/* @__PURE__ */ (0,
|
|
14229
|
-
/* @__PURE__ */ (0,
|
|
14487
|
+
COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { type: "button", className: statusFilter === column.id ? "is-active" : "", "aria-pressed": statusFilter === column.id, onClick: () => setStatusFilter(column.id), children: [
|
|
14488
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: column.label }),
|
|
14489
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("b", { children: statusCounts.get(column.id) ?? 0 })
|
|
14230
14490
|
] }, column.id))
|
|
14231
14491
|
] }),
|
|
14232
|
-
/* @__PURE__ */ (0,
|
|
14492
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "dsh-partner-board", "data-focused": statusFilter !== "all", "aria-label": "\u4EFB\u52A1\u770B\u677F", children: visibleColumns.map((column) => {
|
|
14233
14493
|
const tasks = tasksByStatus.get(column.id) ?? [];
|
|
14234
|
-
return /* @__PURE__ */ (0,
|
|
14494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TaskBoardStage, { id: column.id, label: column.label, tasks, focused: statusFilter !== "all", filtered: Boolean(query || assigneeFilter !== "all"), renderTask: (task) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
14235
14495
|
TaskCard,
|
|
14236
14496
|
{
|
|
14237
14497
|
task,
|
|
@@ -14244,9 +14504,9 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
|
|
|
14244
14504
|
task.id
|
|
14245
14505
|
) }, column.id);
|
|
14246
14506
|
}) }),
|
|
14247
|
-
!scopedTasks.length && /* @__PURE__ */ (0,
|
|
14248
|
-
/* @__PURE__ */ (0,
|
|
14249
|
-
/* @__PURE__ */ (0,
|
|
14507
|
+
!scopedTasks.length && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "dsh-partner-collection-empty", children: [
|
|
14508
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: query || assigneeFilter !== "all" ? "\u6CA1\u6709\u5339\u914D\u7684\u4EFB\u52A1" : "\u8FD8\u6CA1\u6709\u5B50\u4EFB\u52A1" }),
|
|
14509
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: requirement?.status === "planning" ? "\u6DFB\u52A0\u5B50\u4EFB\u52A1\u5E76\u5B89\u6392\u8D1F\u8D23\u4EBA\uFF0C\u5B8C\u6210\u5206\u5DE5\u540E\u5728\u9700\u6C42\u8BE6\u60C5\u4E2D\u63D0\u4EA4\u89C4\u5212\u3002" : "\u53EF\u8FD4\u56DE\u9700\u6C42\u770B\u677F\u67E5\u770B\u5176\u4ED6\u9700\u6C42\u3002" })
|
|
14250
14510
|
] })
|
|
14251
14511
|
] }))
|
|
14252
14512
|
] });
|
|
@@ -14257,48 +14517,48 @@ function TaskCard({ task, tasksById, directoryById, dependentCount, execution, o
|
|
|
14257
14517
|
const completedDependencies = dependencies.length - blockers.length;
|
|
14258
14518
|
const assignee = directoryById.get(task.assigneeCompanionId ?? "");
|
|
14259
14519
|
const executionState = task.scheduling ? { label: task.scheduling.message } : execution ? delegationState(execution, blockers.length) : task.autoRun && task.status === "ready" ? { label: blockers.length ? "\u7B49\u5F85\u524D\u7F6E\u5B8C\u6210" : "\u7B49\u5F85\u8C03\u5EA6" } : void 0;
|
|
14260
|
-
return /* @__PURE__ */ (0,
|
|
14261
|
-
/* @__PURE__ */ (0,
|
|
14262
|
-
/* @__PURE__ */ (0,
|
|
14263
|
-
/* @__PURE__ */ (0,
|
|
14264
|
-
/* @__PURE__ */ (0,
|
|
14520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("article", { className: "dsh-partner-task-card", "data-blocked": blockers.length > 0, "data-priority": task.priority, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { type: "button", className: "dsh-partner-task-summary", "aria-haspopup": "dialog", onClick: open, children: [
|
|
14521
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { children: [
|
|
14522
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "dsh-partner-task-card-title", children: [
|
|
14523
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { title: task.title, children: task.title }),
|
|
14524
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("em", { children: priorityLabel(task.priority) })
|
|
14265
14525
|
] }),
|
|
14266
|
-
/* @__PURE__ */ (0,
|
|
14526
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("small", { className: "dsh-partner-task-card-owner", children: [
|
|
14267
14527
|
assignee ? `@${assignee.name}` : "\u672A\u6307\u6D3E",
|
|
14268
14528
|
task.resultSummary ? " \xB7 \u5DF2\u6709\u7ED3\u679C" : "",
|
|
14269
14529
|
executionState ? ` \xB7 ${executionState.label}` : ""
|
|
14270
14530
|
] }),
|
|
14271
|
-
(dependencies.length > 0 || dependentCount > 0) && /* @__PURE__ */ (0,
|
|
14272
|
-
dependencies.length > 0 && /* @__PURE__ */ (0,
|
|
14531
|
+
(dependencies.length > 0 || dependentCount > 0) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "dsh-partner-task-relations", children: [
|
|
14532
|
+
dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("small", { "data-blocked": blockers.length > 0, children: [
|
|
14273
14533
|
"\u524D\u7F6E ",
|
|
14274
14534
|
completedDependencies,
|
|
14275
14535
|
"/",
|
|
14276
14536
|
dependencies.length
|
|
14277
14537
|
] }),
|
|
14278
|
-
dependentCount > 0 && /* @__PURE__ */ (0,
|
|
14538
|
+
dependentCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("small", { children: [
|
|
14279
14539
|
"\u5B8C\u6210\u540E\u89E3\u9501 ",
|
|
14280
14540
|
dependentCount
|
|
14281
14541
|
] })
|
|
14282
14542
|
] })
|
|
14283
14543
|
] }),
|
|
14284
|
-
/* @__PURE__ */ (0,
|
|
14544
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives15.IconChevronRightOutline14, { size: 14 })
|
|
14285
14545
|
] }) });
|
|
14286
14546
|
}
|
|
14287
14547
|
function TaskDetail({ task, tasks, activities, directory, execution, busy, update, delegate, review, accept, reject, remove }) {
|
|
14288
|
-
const [rejecting, setRejecting] = (0,
|
|
14289
|
-
const [checks, setChecks] = (0,
|
|
14290
|
-
(0,
|
|
14548
|
+
const [rejecting, setRejecting] = (0, import_react36.useState)(false);
|
|
14549
|
+
const [checks, setChecks] = (0, import_react36.useState)([]);
|
|
14550
|
+
(0, import_react36.useEffect)(() => {
|
|
14291
14551
|
setChecks([]);
|
|
14292
14552
|
}, [task.id, task.revision]);
|
|
14293
|
-
const [rejectReason, setRejectReason] = (0,
|
|
14294
|
-
(0,
|
|
14553
|
+
const [rejectReason, setRejectReason] = (0, import_react36.useState)("");
|
|
14554
|
+
(0, import_react36.useEffect)(() => {
|
|
14295
14555
|
if (task.status !== "review") {
|
|
14296
14556
|
setRejecting(false);
|
|
14297
14557
|
setRejectReason("");
|
|
14298
14558
|
}
|
|
14299
14559
|
}, [task.status]);
|
|
14300
|
-
const [confirmingDelete, setConfirmingDelete] = (0,
|
|
14301
|
-
const byId = (0,
|
|
14560
|
+
const [confirmingDelete, setConfirmingDelete] = (0, import_react36.useState)(false);
|
|
14561
|
+
const byId = (0, import_react36.useMemo)(() => new Map(tasks.map((item) => [item.id, item])), [tasks]);
|
|
14302
14562
|
const dependencies = task.dependencyTaskIds.map((id) => byId.get(id)).filter((item) => item !== void 0);
|
|
14303
14563
|
const blockers = dependencies.filter((item) => item.status !== "done");
|
|
14304
14564
|
const assignee = directory.find((item) => item.id === task.assigneeCompanionId);
|
|
@@ -14307,30 +14567,30 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
|
|
|
14307
14567
|
const canExecute = Boolean(task.assigneeCompanionId) && !execution && !["doing", "review", "done"].includes(task.status);
|
|
14308
14568
|
const recentActivities = [...activities].sort((left, right) => right.at - left.at).slice(0, 6);
|
|
14309
14569
|
const executionState = execution ? delegationState(execution, blockers.length) : void 0;
|
|
14310
|
-
return /* @__PURE__ */ (0,
|
|
14311
|
-
/* @__PURE__ */ (0,
|
|
14312
|
-
/* @__PURE__ */ (0,
|
|
14313
|
-
/* @__PURE__ */ (0,
|
|
14570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "dsh-partner-task-detail", children: [
|
|
14571
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("section", { className: "dsh-partner-task-description", children: [
|
|
14572
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
|
|
14573
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: task.description || "\u6CA1\u6709\u8865\u5145\u8BF4\u660E" })
|
|
14314
14574
|
] }),
|
|
14315
|
-
task.scheduling && task.status !== "done" && /* @__PURE__ */ (0,
|
|
14316
|
-
/* @__PURE__ */ (0,
|
|
14317
|
-
task.scheduling.taskIds?.length ? /* @__PURE__ */ (0,
|
|
14318
|
-
task.scheduling.retryAt ? /* @__PURE__ */ (0,
|
|
14575
|
+
task.scheduling && task.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("section", { className: "dsh-partner-task-description", children: [
|
|
14576
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: task.scheduling.message }),
|
|
14577
|
+
task.scheduling.taskIds?.length ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: task.scheduling.taskIds.map((id) => byId.get(id)?.title ?? "\u5DF2\u5220\u9664\u4EFB\u52A1").join("\u3001") }) : null,
|
|
14578
|
+
task.scheduling.retryAt ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("small", { children: [
|
|
14319
14579
|
"\u4E0B\u6B21\u91CD\u8BD5\uFF1A",
|
|
14320
14580
|
new Date(task.scheduling.retryAt).toLocaleString()
|
|
14321
14581
|
] }) : null
|
|
14322
14582
|
] }),
|
|
14323
|
-
/* @__PURE__ */ (0,
|
|
14324
|
-
/* @__PURE__ */ (0,
|
|
14325
|
-
/* @__PURE__ */ (0,
|
|
14326
|
-
/* @__PURE__ */ (0,
|
|
14327
|
-
/* @__PURE__ */ (0,
|
|
14583
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TaskContractPanel, { task, checks, setChecks, busy }),
|
|
14584
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "dsh-partner-task-fields", children: [
|
|
14585
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
|
|
14586
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u72B6\u6001" }),
|
|
14587
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("select", { value: task.status, disabled: busy, onChange: (event) => update({ status: event.target.value, ...event.target.value === "done" ? { checks } : {} }), children: COLUMNS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: item.id, disabled: (item.id === "doing" || item.id === "review" || item.id === "done") && blockers.length > 0 || item.id === "done" && task.status !== "review" && task.status !== "done", children: item.label }, item.id)) })
|
|
14328
14588
|
] }),
|
|
14329
|
-
/* @__PURE__ */ (0,
|
|
14330
|
-
/* @__PURE__ */ (0,
|
|
14331
|
-
/* @__PURE__ */ (0,
|
|
14332
|
-
/* @__PURE__ */ (0,
|
|
14333
|
-
directory.map((item) => /* @__PURE__ */ (0,
|
|
14589
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
|
|
14590
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
|
|
14591
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { value: task.assigneeCompanionId ?? "", disabled: busy || task.status === "doing", onChange: (event) => update({ assigneeCompanionId: event.target.value }), children: [
|
|
14592
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
|
|
14593
|
+
directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: item.id, children: [
|
|
14334
14594
|
"@",
|
|
14335
14595
|
item.name,
|
|
14336
14596
|
" \xB7 ",
|
|
@@ -14338,43 +14598,43 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
|
|
|
14338
14598
|
] }, item.id))
|
|
14339
14599
|
] })
|
|
14340
14600
|
] }),
|
|
14341
|
-
/* @__PURE__ */ (0,
|
|
14342
|
-
/* @__PURE__ */ (0,
|
|
14343
|
-
/* @__PURE__ */ (0,
|
|
14344
|
-
/* @__PURE__ */ (0,
|
|
14345
|
-
directory.map((item) => /* @__PURE__ */ (0,
|
|
14601
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
|
|
14602
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
|
|
14603
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { value: task.reviewerCompanionId ?? "", disabled: busy, onChange: (event) => update({ reviewerCompanionId: event.target.value }), children: [
|
|
14604
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
|
|
14605
|
+
directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: item.id, children: [
|
|
14346
14606
|
"@",
|
|
14347
14607
|
item.name
|
|
14348
14608
|
] }, item.id))
|
|
14349
14609
|
] })
|
|
14350
14610
|
] })
|
|
14351
14611
|
] }),
|
|
14352
|
-
executionState && /* @__PURE__ */ (0,
|
|
14353
|
-
/* @__PURE__ */ (0,
|
|
14354
|
-
/* @__PURE__ */ (0,
|
|
14355
|
-
/* @__PURE__ */ (0,
|
|
14356
|
-
/* @__PURE__ */ (0,
|
|
14612
|
+
executionState && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("section", { className: "dsh-partner-task-execution", "data-state": execution?.status, children: [
|
|
14613
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", {}),
|
|
14614
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { children: [
|
|
14615
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: executionState.title }),
|
|
14616
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("small", { children: executionState.detail })
|
|
14357
14617
|
] })
|
|
14358
14618
|
] }),
|
|
14359
|
-
/* @__PURE__ */ (0,
|
|
14360
|
-
/* @__PURE__ */ (0,
|
|
14361
|
-
/* @__PURE__ */ (0,
|
|
14362
|
-
/* @__PURE__ */ (0,
|
|
14619
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("section", { className: "dsh-partner-task-dependency", children: [
|
|
14620
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("header", { children: [
|
|
14621
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: "\u524D\u7F6E\u4EFB\u52A1" }),
|
|
14622
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("small", { children: blockers.length ? `${blockers.length} \u9879\u672A\u5B8C\u6210\uFF0C\u5F53\u524D\u4EFB\u52A1\u4E0D\u80FD\u542F\u52A8` : dependencies.length ? "\u5DF2\u5168\u90E8\u5B8C\u6210\uFF0C\u53EF\u4EE5\u542F\u52A8" : "\u6CA1\u6709\u524D\u7F6E\u4F9D\u8D56" })
|
|
14363
14623
|
] }),
|
|
14364
|
-
dependencies.length > 0 && /* @__PURE__ */ (0,
|
|
14365
|
-
/* @__PURE__ */ (0,
|
|
14366
|
-
/* @__PURE__ */ (0,
|
|
14367
|
-
/* @__PURE__ */ (0,
|
|
14624
|
+
dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: dependencies.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { "data-done": item.status === "done", children: [
|
|
14625
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", { children: item.status === "done" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives15.IconCheckOutline16, { size: 12 }) : "" }),
|
|
14626
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("b", { children: item.title }),
|
|
14627
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", disabled: busy || ["doing", "review", "done"].includes(task.status), "aria-label": `\u79FB\u9664\u524D\u7F6E\u4EFB\u52A1 ${item.title}`, onClick: () => update({ dependencyTaskIds: task.dependencyTaskIds.filter((id) => id !== item.id) }), children: "\u79FB\u9664" })
|
|
14368
14628
|
] }, item.id)) }),
|
|
14369
|
-
dependencyCandidates.length > 0 && /* @__PURE__ */ (0,
|
|
14370
|
-
/* @__PURE__ */ (0,
|
|
14371
|
-
/* @__PURE__ */ (0,
|
|
14629
|
+
dependencyCandidates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
|
|
14630
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "sr-only", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1" }),
|
|
14631
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { defaultValue: "", disabled: busy || ["doing", "review", "done"].includes(task.status), onChange: (event) => {
|
|
14372
14632
|
const id = event.currentTarget.value;
|
|
14373
14633
|
if (id) update({ dependencyTaskIds: [...task.dependencyTaskIds, id] });
|
|
14374
14634
|
event.currentTarget.value = "";
|
|
14375
14635
|
}, children: [
|
|
14376
|
-
/* @__PURE__ */ (0,
|
|
14377
|
-
dependencyCandidates.map((item) => /* @__PURE__ */ (0,
|
|
14636
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1\u2026" }),
|
|
14637
|
+
dependencyCandidates.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: item.id, children: [
|
|
14378
14638
|
item.title,
|
|
14379
14639
|
" \xB7 ",
|
|
14380
14640
|
statusLabel(item.status)
|
|
@@ -14382,70 +14642,70 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
|
|
|
14382
14642
|
] })
|
|
14383
14643
|
] })
|
|
14384
14644
|
] }),
|
|
14385
|
-
task.resultSummary && /* @__PURE__ */ (0,
|
|
14386
|
-
task.reviewSummary && /* @__PURE__ */ (0,
|
|
14387
|
-
recentActivities.length > 0 && /* @__PURE__ */ (0,
|
|
14388
|
-
/* @__PURE__ */ (0,
|
|
14645
|
+
task.resultSummary && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ResultBlock, { label: "\u6267\u884C\u7ED3\u679C", value: task.resultSummary }),
|
|
14646
|
+
task.reviewSummary && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ResultBlock, { label: `\u6838\u9A8C\u610F\u89C1${reviewer ? ` \xB7 @${reviewer.name}` : ""}`, value: task.reviewSummary }),
|
|
14647
|
+
recentActivities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("details", { className: "dsh-partner-task-activity dsh-partner-requirement-disclosure", children: [
|
|
14648
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("summary", { children: [
|
|
14389
14649
|
"\u6700\u8FD1\u6D3B\u52A8 \xB7 ",
|
|
14390
14650
|
recentActivities.length
|
|
14391
14651
|
] }),
|
|
14392
|
-
/* @__PURE__ */ (0,
|
|
14393
|
-
/* @__PURE__ */ (0,
|
|
14394
|
-
/* @__PURE__ */ (0,
|
|
14652
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("ol", { children: recentActivities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("li", { children: [
|
|
14653
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: item.message }),
|
|
14654
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("time", { children: new Date(item.at).toLocaleString() })
|
|
14395
14655
|
] }, item.id)) })
|
|
14396
14656
|
] }),
|
|
14397
|
-
rejecting && /* @__PURE__ */ (0,
|
|
14657
|
+
rejecting && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("form", { className: "dsh-partner-task-reject", onSubmit: (event) => {
|
|
14398
14658
|
event.preventDefault();
|
|
14399
14659
|
const reason = rejectReason.trim();
|
|
14400
14660
|
if (!reason) return;
|
|
14401
14661
|
reject(reason, checks);
|
|
14402
14662
|
}, children: [
|
|
14403
|
-
/* @__PURE__ */ (0,
|
|
14404
|
-
/* @__PURE__ */ (0,
|
|
14405
|
-
/* @__PURE__ */ (0,
|
|
14663
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
|
|
14664
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u6253\u56DE\u539F\u56E0" }),
|
|
14665
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("textarea", { autoFocus: true, value: rejectReason, onChange: (event) => setRejectReason(event.target.value), rows: 3, maxLength: 1200, placeholder: "\u8BF4\u660E\u9700\u8981\u91CD\u505A\u6216\u8865\u5145\u7684\u5185\u5BB9" })
|
|
14406
14666
|
] }),
|
|
14407
|
-
/* @__PURE__ */ (0,
|
|
14408
|
-
/* @__PURE__ */ (0,
|
|
14667
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
14668
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", onClick: () => {
|
|
14409
14669
|
setRejecting(false);
|
|
14410
14670
|
setRejectReason("");
|
|
14411
14671
|
}, children: "\u53D6\u6D88" }),
|
|
14412
|
-
/* @__PURE__ */ (0,
|
|
14672
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !rejectReason.trim(), children: "\u786E\u8BA4\u6253\u56DE" })
|
|
14413
14673
|
] })
|
|
14414
14674
|
] }),
|
|
14415
|
-
confirmingDelete && /* @__PURE__ */ (0,
|
|
14416
|
-
/* @__PURE__ */ (0,
|
|
14417
|
-
/* @__PURE__ */ (0,
|
|
14418
|
-
/* @__PURE__ */ (0,
|
|
14419
|
-
/* @__PURE__ */ (0,
|
|
14675
|
+
confirmingDelete && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "dsh-partner-task-delete-confirm", role: "alert", children: [
|
|
14676
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u5220\u9664\u4F1A\u53D6\u6D88\u5173\u8054\u6267\u884C\uFF0C\u4F9D\u8D56\u5B83\u7684\u672A\u5B8C\u6210\u4EFB\u52A1\u5C06\u6682\u505C\u3002\u9700\u6C42\u9700\u91CD\u65B0\u786E\u8BA4\u8303\u56F4\uFF1B\u4E0D\u80FD\u64A4\u9500\u3002" }),
|
|
14677
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
14678
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", onClick: () => setConfirmingDelete(false), children: "\u4FDD\u7559\u4EFB\u52A1" }),
|
|
14679
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
|
|
14420
14680
|
] })
|
|
14421
14681
|
] }),
|
|
14422
|
-
/* @__PURE__ */ (0,
|
|
14423
|
-
/* @__PURE__ */ (0,
|
|
14682
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("footer", { className: "dsh-partner-task-actions", children: [
|
|
14683
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("small", { children: [
|
|
14424
14684
|
"r",
|
|
14425
14685
|
task.revision,
|
|
14426
14686
|
" \xB7 ",
|
|
14427
14687
|
new Date(task.updatedAt).toLocaleString()
|
|
14428
14688
|
] }),
|
|
14429
|
-
/* @__PURE__ */ (0,
|
|
14430
|
-
task.status === "review" ? /* @__PURE__ */ (0,
|
|
14431
|
-
task.reviewerCompanionId && /* @__PURE__ */ (0,
|
|
14432
|
-
/* @__PURE__ */ (0,
|
|
14433
|
-
/* @__PURE__ */ (0,
|
|
14434
|
-
] }) : /* @__PURE__ */ (0,
|
|
14435
|
-
/* @__PURE__ */ (0,
|
|
14689
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { children: [
|
|
14690
|
+
task.status === "review" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
14691
|
+
task.reviewerCompanionId && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", disabled: busy, onClick: review, children: busy ? "\u6838\u9A8C\u4E2D\u2026" : `\u4EA4\u7ED9 @${reviewer?.name ?? "\u4F19\u4F34"} \u6838\u9A8C` }),
|
|
14692
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", disabled: busy, onClick: () => setRejecting(true), children: "\u6253\u56DE\u91CD\u505A" }),
|
|
14693
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", className: "is-primary", disabled: busy || Boolean(task.acceptanceCriteria?.length && (checks.length !== task.acceptanceCriteria.length || checks.some((c) => c.verdict !== "passed" || !c.evidence?.trim()))), onClick: () => accept(checks), children: "\u9A8C\u6536\u901A\u8FC7" })
|
|
14694
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", disabled: busy || !canExecute, title: blockers.length ? "\u53EF\u63D0\u524D\u6392\u961F\uFF0C\u4F9D\u8D56\u901A\u8FC7\u9A8C\u6536\u540E\u81EA\u52A8\u6267\u884C" : !task.assigneeCompanionId ? "\u8BF7\u5148\u9009\u62E9\u8D1F\u8D23\u4EBA" : void 0, onClick: delegate, children: busy ? "\u6267\u884C\u4E2D\u2026" : execution?.status === "queued" ? "\u5DF2\u63D0\u4EA4\uFF0C\u7B49\u5F85\u6267\u884C" : task.status === "doing" ? "\u6B63\u5728\u6267\u884C" : task.status === "done" ? "\u5DF2\u7ECF\u5B8C\u6210" : `\u4EA4\u7ED9 @${assignee?.name ?? "\u4F19\u4F34"}` }),
|
|
14695
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", className: "is-icon", "aria-label": `\u5220\u9664 ${task.title}`, "aria-expanded": confirmingDelete, disabled: busy, onClick: () => setConfirmingDelete(true), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives15.IconTrashOutline16, { size: 14 }) })
|
|
14436
14696
|
] })
|
|
14437
14697
|
] })
|
|
14438
14698
|
] });
|
|
14439
14699
|
}
|
|
14440
14700
|
function ResultBlock({ label, value }) {
|
|
14441
|
-
return /* @__PURE__ */ (0,
|
|
14442
|
-
/* @__PURE__ */ (0,
|
|
14443
|
-
/* @__PURE__ */ (0,
|
|
14701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("section", { className: "dsh-partner-task-result", children: [
|
|
14702
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("strong", { children: label }),
|
|
14703
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: value })
|
|
14444
14704
|
] });
|
|
14445
14705
|
}
|
|
14446
14706
|
function TaskForm({ requirementId, companions, tasks, close, changed: changed2 }) {
|
|
14447
|
-
const [error, setError] = (0,
|
|
14448
|
-
const [busy, setBusy] = (0,
|
|
14707
|
+
const [error, setError] = (0, import_react36.useState)();
|
|
14708
|
+
const [busy, setBusy] = (0, import_react36.useState)(false);
|
|
14449
14709
|
const dependencyOptions = tasks.filter((item) => item.status !== "done");
|
|
14450
14710
|
const submit = async (event) => {
|
|
14451
14711
|
event.preventDefault();
|
|
@@ -14473,79 +14733,79 @@ function TaskForm({ requirementId, companions, tasks, close, changed: changed2 }
|
|
|
14473
14733
|
setBusy(false);
|
|
14474
14734
|
}
|
|
14475
14735
|
};
|
|
14476
|
-
return /* @__PURE__ */ (0,
|
|
14736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("form", { className: "dsh-partner-task-form", "aria-busy": busy, onSubmit: (event) => {
|
|
14477
14737
|
void submit(event);
|
|
14478
14738
|
}, children: [
|
|
14479
|
-
/* @__PURE__ */ (0,
|
|
14480
|
-
/* @__PURE__ */ (0,
|
|
14481
|
-
/* @__PURE__ */ (0,
|
|
14739
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
|
|
14740
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u4EFB\u52A1\u540D\u79F0" }),
|
|
14741
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("input", { name: "title", maxLength: 200, required: true, autoFocus: true, placeholder: "\u4E00\u53E5\u8BDD\u8BF4\u660E\u4EA4\u4ED8\u76EE\u6807" })
|
|
14482
14742
|
] }),
|
|
14483
|
-
/* @__PURE__ */ (0,
|
|
14484
|
-
/* @__PURE__ */ (0,
|
|
14485
|
-
/* @__PURE__ */ (0,
|
|
14486
|
-
/* @__PURE__ */ (0,
|
|
14487
|
-
companions.map((item) => /* @__PURE__ */ (0,
|
|
14743
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
|
|
14744
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
|
|
14745
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { name: "assignee", defaultValue: "", children: [
|
|
14746
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
|
|
14747
|
+
companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: item.id, children: [
|
|
14488
14748
|
"@",
|
|
14489
14749
|
item.name
|
|
14490
14750
|
] }, item.id))
|
|
14491
14751
|
] })
|
|
14492
14752
|
] }),
|
|
14493
|
-
/* @__PURE__ */ (0,
|
|
14494
|
-
/* @__PURE__ */ (0,
|
|
14495
|
-
/* @__PURE__ */ (0,
|
|
14753
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "is-wide", children: [
|
|
14754
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
|
|
14755
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("textarea", { name: "description", maxLength: 8e3, rows: 5, placeholder: "\u8865\u5145\u80CC\u666F\u3001\u4EA4\u4ED8\u7269\u548C\u5B8C\u6210\u6761\u4EF6" })
|
|
14496
14756
|
] }),
|
|
14497
|
-
/* @__PURE__ */ (0,
|
|
14498
|
-
/* @__PURE__ */ (0,
|
|
14499
|
-
/* @__PURE__ */ (0,
|
|
14757
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "is-wide", children: [
|
|
14758
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u9A8C\u6536\u6E05\u5355 \xB7 \u53EF\u9009" }),
|
|
14759
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("textarea", { name: "acceptanceCriteria", rows: 3, maxLength: 1e4, placeholder: "\u6BCF\u884C\u4E00\u9879\u53EF\u6838\u9A8C\u4EA4\u4ED8\uFF0C\u6700\u591A 20 \u9879" })
|
|
14500
14760
|
] }),
|
|
14501
|
-
/* @__PURE__ */ (0,
|
|
14502
|
-
/* @__PURE__ */ (0,
|
|
14503
|
-
/* @__PURE__ */ (0,
|
|
14761
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "is-wide", children: [
|
|
14762
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u72EC\u5360\u8D44\u6E90 \xB7 \u53EF\u9009" }),
|
|
14763
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("textarea", { name: "resourceKeys", rows: 2, maxLength: 2400, placeholder: "\u6BCF\u884C\u4E00\u4E2A\u4E00\u81F4\u7684\u8D44\u6E90\u6807\u8BC6\uFF0C\u4F8B\u5982 repo:team/api\uFF1B\u76F8\u540C\u8D44\u6E90\u4E0D\u4F1A\u540C\u65F6\u6267\u884C" })
|
|
14504
14764
|
] }),
|
|
14505
|
-
/* @__PURE__ */ (0,
|
|
14506
|
-
/* @__PURE__ */ (0,
|
|
14507
|
-
/* @__PURE__ */ (0,
|
|
14508
|
-
/* @__PURE__ */ (0,
|
|
14509
|
-
/* @__PURE__ */ (0,
|
|
14510
|
-
/* @__PURE__ */ (0,
|
|
14511
|
-
/* @__PURE__ */ (0,
|
|
14765
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
|
|
14766
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u4F18\u5148\u7EA7" }),
|
|
14767
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { name: "priority", defaultValue: "normal", children: [
|
|
14768
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "low", children: "\u4F4E" }),
|
|
14769
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "normal", children: "\u666E\u901A" }),
|
|
14770
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "high", children: "\u9AD8" }),
|
|
14771
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "urgent", children: "\u7D27\u6025" })
|
|
14512
14772
|
] })
|
|
14513
14773
|
] }),
|
|
14514
|
-
/* @__PURE__ */ (0,
|
|
14515
|
-
/* @__PURE__ */ (0,
|
|
14516
|
-
/* @__PURE__ */ (0,
|
|
14517
|
-
/* @__PURE__ */ (0,
|
|
14518
|
-
companions.map((item) => /* @__PURE__ */ (0,
|
|
14774
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
|
|
14775
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
|
|
14776
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { name: "reviewer", defaultValue: "", children: [
|
|
14777
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
|
|
14778
|
+
companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("option", { value: item.id, children: [
|
|
14519
14779
|
"@",
|
|
14520
14780
|
item.name
|
|
14521
14781
|
] }, item.id))
|
|
14522
14782
|
] })
|
|
14523
14783
|
] }),
|
|
14524
|
-
/* @__PURE__ */ (0,
|
|
14525
|
-
/* @__PURE__ */ (0,
|
|
14784
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "dsh-partner-task-form-dependencies is-wide", children: [
|
|
14785
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { children: [
|
|
14526
14786
|
"\u4F9D\u8D56\u4EFB\u52A1 ",
|
|
14527
|
-
/* @__PURE__ */ (0,
|
|
14787
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("small", { children: "\u53EF\u9009" })
|
|
14528
14788
|
] }),
|
|
14529
|
-
dependencyOptions.length > 0 ? /* @__PURE__ */ (0,
|
|
14530
|
-
/* @__PURE__ */ (0,
|
|
14531
|
-
/* @__PURE__ */ (0,
|
|
14532
|
-
/* @__PURE__ */ (0,
|
|
14533
|
-
/* @__PURE__ */ (0,
|
|
14534
|
-
] }, item.id)) }) : /* @__PURE__ */ (0,
|
|
14535
|
-
/* @__PURE__ */ (0,
|
|
14789
|
+
dependencyOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: dependencyOptions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { children: [
|
|
14790
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("input", { type: "checkbox", name: "dependencyTaskId", value: item.id }),
|
|
14791
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("i", {}),
|
|
14792
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: item.title }),
|
|
14793
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("small", { children: statusLabel(item.status) })
|
|
14794
|
+
] }, item.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: "\u5F53\u524D\u6CA1\u6709\u53EF\u9009\u7684\u672A\u5B8C\u6210\u4EFB\u52A1" }),
|
|
14795
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("small", { children: "\u53EF\u4EE5\u9009\u62E9\u591A\u4E2A\uFF1B\u7559\u7A7A\u8868\u793A\u8BE5\u4EFB\u52A1\u4E0D\u4F9D\u8D56\u5176\u4ED6\u4EFB\u52A1\u3002" })
|
|
14536
14796
|
] }),
|
|
14537
|
-
/* @__PURE__ */ (0,
|
|
14538
|
-
/* @__PURE__ */ (0,
|
|
14539
|
-
/* @__PURE__ */ (0,
|
|
14540
|
-
/* @__PURE__ */ (0,
|
|
14541
|
-
/* @__PURE__ */ (0,
|
|
14797
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "is-wide", children: [
|
|
14798
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: "\u521B\u5EFA\u540E\u6267\u884C" }),
|
|
14799
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("select", { name: "submission", defaultValue: "run", children: [
|
|
14800
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "run", children: "\u5DF2\u6307\u5B9A\u8D1F\u8D23\u4EBA\u5219\u81EA\u52A8\u6392\u961F\uFF0C\u7B49\u5F85\u4F9D\u8D56\u5B8C\u6210\u540E\u6267\u884C" }),
|
|
14801
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "plan", children: "\u4EC5\u89C4\u5212\uFF0C\u7A0D\u540E\u624B\u52A8\u63D0\u4EA4" })
|
|
14542
14802
|
] })
|
|
14543
14803
|
] }),
|
|
14544
|
-
error && /* @__PURE__ */ (0,
|
|
14545
|
-
/* @__PURE__ */ (0,
|
|
14546
|
-
/* @__PURE__ */ (0,
|
|
14547
|
-
/* @__PURE__ */ (0,
|
|
14548
|
-
/* @__PURE__ */ (0,
|
|
14804
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(WorkspaceNotice, { children: error }),
|
|
14805
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("footer", { children: [
|
|
14806
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
14807
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
|
|
14808
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_dsh_client_ui_primitives15.IconPlusOutline16, { size: 14 }),
|
|
14549
14809
|
busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u4EFB\u52A1"
|
|
14550
14810
|
] })
|
|
14551
14811
|
] })
|
|
@@ -14583,15 +14843,15 @@ function delegationState(value, blockers = 0) {
|
|
|
14583
14843
|
}
|
|
14584
14844
|
|
|
14585
14845
|
// src/ui/requirement-board.tsx
|
|
14586
|
-
var
|
|
14846
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
14587
14847
|
function RequirementBoard({ initialTaskId, openRequest } = {}) {
|
|
14588
|
-
const [board, setBoard] = (0,
|
|
14589
|
-
const [directory, setDirectory] = (0,
|
|
14590
|
-
const [loading, setLoading] = (0,
|
|
14591
|
-
const [selected, setSelected] = (0,
|
|
14592
|
-
const [creating, setCreating] = (0,
|
|
14593
|
-
const [query, setQuery] = (0,
|
|
14594
|
-
(0,
|
|
14848
|
+
const [board, setBoard] = (0, import_react37.useState)({ tasks: [], activities: [], requirements: [] });
|
|
14849
|
+
const [directory, setDirectory] = (0, import_react37.useState)([]);
|
|
14850
|
+
const [loading, setLoading] = (0, import_react37.useState)(true), [error, setError] = (0, import_react37.useState)();
|
|
14851
|
+
const [selected, setSelected] = (0, import_react37.useState)(), [detailId, setDetailId] = (0, import_react37.useState)();
|
|
14852
|
+
const [creating, setCreating] = (0, import_react37.useState)(false), [archived, setArchived] = (0, import_react37.useState)(false);
|
|
14853
|
+
const [query, setQuery] = (0, import_react37.useState)(""), [limit, setLimit] = (0, import_react37.useState)(24);
|
|
14854
|
+
(0, import_react37.useEffect)(() => {
|
|
14595
14855
|
if (initialTaskId) {
|
|
14596
14856
|
setSelected(void 0);
|
|
14597
14857
|
setDetailId(void 0);
|
|
@@ -14612,7 +14872,7 @@ function RequirementBoard({ initialTaskId, openRequest } = {}) {
|
|
|
14612
14872
|
setLoading(false);
|
|
14613
14873
|
}, !selected);
|
|
14614
14874
|
const requirements = board.requirements ?? [];
|
|
14615
|
-
const groups = (0,
|
|
14875
|
+
const groups = (0, import_react37.useMemo)(() => {
|
|
14616
14876
|
const result = /* @__PURE__ */ new Map();
|
|
14617
14877
|
for (const task of board.tasks) {
|
|
14618
14878
|
const id = task.requirementId ?? "legacy";
|
|
@@ -14624,110 +14884,110 @@ function RequirementBoard({ initialTaskId, openRequest } = {}) {
|
|
|
14624
14884
|
}, [board.tasks]);
|
|
14625
14885
|
const visible = requirements.filter((r) => r.status === "done" === archived && [r.title, r.description, directory.find((c) => c.id === r.ownerCompanionId)?.name].some((v) => v?.toLocaleLowerCase().includes(query.trim().toLocaleLowerCase()))).sort((a, b) => b.updatedAt - a.updatedAt);
|
|
14626
14886
|
const detail = requirements.find((r) => r.id === detailId);
|
|
14627
|
-
if (selected) return /* @__PURE__ */ (0,
|
|
14887
|
+
if (selected) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RequirementTasksPanel, { requirementId: selected, back: () => {
|
|
14628
14888
|
setSelected(void 0);
|
|
14629
14889
|
void load2();
|
|
14630
14890
|
} }, selected);
|
|
14631
|
-
return /* @__PURE__ */ (0,
|
|
14632
|
-
/* @__PURE__ */ (0,
|
|
14633
|
-
/* @__PURE__ */ (0,
|
|
14891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "dsh-partner-feature-page is-board", children: [
|
|
14892
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(WorkspaceHero, { eyebrow: "Shared workspace", title: "\u9700\u6C42\u770B\u677F", detail: "\u6309\u9700\u6C42\u7EC4\u7EC7\u5DE5\u4F5C\uFF0C\u5B50\u4EFB\u52A1\u72EC\u7ACB\u63A8\u8FDB\uFF0C\u6574\u4F53\u5B8C\u6210\u540E\u7EDF\u4E00\u6C47\u603B\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("button", { type: "button", onClick: () => setCreating(true), children: [
|
|
14893
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_dsh_client_ui_primitives16.IconPlusOutline16, { size: 15 }),
|
|
14634
14894
|
"\u65B0\u9700\u6C42"
|
|
14635
14895
|
] }) }),
|
|
14636
|
-
error && /* @__PURE__ */ (0,
|
|
14896
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(WorkspaceNotice, { children: [
|
|
14637
14897
|
error,
|
|
14638
|
-
/* @__PURE__ */ (0,
|
|
14898
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { type: "button", onClick: () => {
|
|
14639
14899
|
void load2();
|
|
14640
14900
|
}, children: "\u91CD\u8BD5" })
|
|
14641
14901
|
] }),
|
|
14642
|
-
/* @__PURE__ */ (0,
|
|
14643
|
-
/* @__PURE__ */ (0,
|
|
14902
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "dsh-partner-requirement-toolbar", children: [
|
|
14903
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("nav", { className: "dsh-partner-board-statuses", "aria-label": "\u9700\u6C42\u8303\u56F4", children: [false, true].map((value) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("button", { type: "button", "aria-pressed": archived === value, className: archived === value ? "is-active" : "", onClick: () => {
|
|
14644
14904
|
setArchived(value);
|
|
14645
14905
|
setLimit(24);
|
|
14646
14906
|
}, children: [
|
|
14647
14907
|
value ? "\u5DF2\u5F52\u6863" : "\u8FDB\u884C\u4E2D",
|
|
14648
|
-
/* @__PURE__ */ (0,
|
|
14908
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("b", { children: requirements.filter((r) => r.status === "done" === value).length })
|
|
14649
14909
|
] }, String(value))) }),
|
|
14650
|
-
/* @__PURE__ */ (0,
|
|
14651
|
-
/* @__PURE__ */ (0,
|
|
14652
|
-
/* @__PURE__ */ (0,
|
|
14653
|
-
/* @__PURE__ */ (0,
|
|
14910
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("label", { className: "dsh-partner-board-search", children: [
|
|
14911
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u9700\u6C42" }),
|
|
14912
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_dsh_client_ui_primitives16.IconSearchOutline16, { size: 16 }) }),
|
|
14913
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("input", { placeholder: "\u641C\u7D22\u9700\u6C42\u6216\u8D1F\u8D23\u4EBA", value: query, onChange: (event) => {
|
|
14654
14914
|
setQuery(event.target.value);
|
|
14655
14915
|
setLimit(24);
|
|
14656
14916
|
} })
|
|
14657
14917
|
] })
|
|
14658
14918
|
] }),
|
|
14659
|
-
loading ? /* @__PURE__ */ (0,
|
|
14660
|
-
/* @__PURE__ */ (0,
|
|
14919
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CollectionSkeleton, { rows: 4 }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
14920
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "dsh-partner-requirement-grid", children: visible.slice(0, limit).map((item) => {
|
|
14661
14921
|
const tasks = groups.get(item.id) ?? [], total = item.status === "done" ? item.results?.length ?? tasks.length : tasks.length;
|
|
14662
14922
|
const done = item.status === "done" ? total : tasks.filter((t) => t.status === "done").length;
|
|
14663
14923
|
const blocked = tasks.filter((t) => t.status === "blocked").length;
|
|
14664
|
-
return /* @__PURE__ */ (0,
|
|
14665
|
-
/* @__PURE__ */ (0,
|
|
14666
|
-
/* @__PURE__ */ (0,
|
|
14667
|
-
/* @__PURE__ */ (0,
|
|
14668
|
-
/* @__PURE__ */ (0,
|
|
14924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("article", { className: "dsh-partner-requirement-card", children: [
|
|
14925
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("button", { type: "button", className: "dsh-partner-requirement-open", onClick: () => item.status === "done" ? setDetailId(item.id) : setSelected(item.id), children: [
|
|
14926
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "dsh-partner-requirement-meta", children: [
|
|
14927
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: requirementStatus(item) }),
|
|
14928
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("small", { children: directory.find((c) => c.id === item.ownerCompanionId)?.name ?? "\u4EBA\u5DE5\u6536\u5C3E" })
|
|
14669
14929
|
] }),
|
|
14670
|
-
/* @__PURE__ */ (0,
|
|
14671
|
-
/* @__PURE__ */ (0,
|
|
14672
|
-
/* @__PURE__ */ (0,
|
|
14673
|
-
/* @__PURE__ */ (0,
|
|
14674
|
-
/* @__PURE__ */ (0,
|
|
14930
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { title: item.title, children: item.title }),
|
|
14931
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { children: item.summary || item.description || "\u5C1A\u672A\u8865\u5145\u9700\u6C42\u8BF4\u660E" }),
|
|
14932
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "dsh-partner-requirement-progress", role: "progressbar", "aria-label": "\u5B50\u4EFB\u52A1\u9A8C\u6536\u8FDB\u5EA6", "aria-valuemin": 0, "aria-valuemax": Math.max(total, 1), "aria-valuenow": done, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("i", { style: { width: `${total ? done / total * 100 : 0}%` } }) }),
|
|
14933
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "dsh-partner-requirement-meta", children: [
|
|
14934
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("small", { children: [
|
|
14675
14935
|
done,
|
|
14676
14936
|
" / ",
|
|
14677
14937
|
total,
|
|
14678
14938
|
" \u5DF2\u9A8C\u6536",
|
|
14679
14939
|
blocked ? ` \xB7 ${blocked} \u53D7\u963B` : ""
|
|
14680
14940
|
] }),
|
|
14681
|
-
/* @__PURE__ */ (0,
|
|
14941
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_dsh_client_ui_primitives16.IconChevronRightOutline14, { size: 14 })
|
|
14682
14942
|
] })
|
|
14683
14943
|
] }),
|
|
14684
|
-
/* @__PURE__ */ (0,
|
|
14685
|
-
/* @__PURE__ */ (0,
|
|
14944
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("footer", { children: [
|
|
14945
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("small", { children: [
|
|
14686
14946
|
new Date(item.updatedAt).toLocaleDateString(),
|
|
14687
14947
|
" \u66F4\u65B0"
|
|
14688
14948
|
] }),
|
|
14689
|
-
/* @__PURE__ */ (0,
|
|
14949
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("button", { type: "button", onClick: () => setDetailId(item.id), "aria-haspopup": "dialog", children: item.lastError ? "\u67E5\u770B\u5F02\u5E38" : "\u9700\u6C42\u8BE6\u60C5" })
|
|
14690
14950
|
] })
|
|
14691
14951
|
] }, item.id);
|
|
14692
14952
|
}) }),
|
|
14693
|
-
!visible.length && /* @__PURE__ */ (0,
|
|
14694
|
-
/* @__PURE__ */ (0,
|
|
14695
|
-
/* @__PURE__ */ (0,
|
|
14953
|
+
!visible.length && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "dsh-partner-collection-empty", children: [
|
|
14954
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("strong", { children: query ? "\u6CA1\u6709\u5339\u914D\u7684\u9700\u6C42" : archived ? "\u8FD8\u6CA1\u6709\u5F52\u6863\u9700\u6C42" : "\u4ECE\u4E00\u4E2A\u9700\u6C42\u5F00\u59CB" }),
|
|
14955
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { children: archived ? "\u5B50\u4EFB\u52A1\u5168\u90E8\u9A8C\u6536\u901A\u8FC7\u3001\u5B8C\u6210\u603B\u7ED3\u540E\uFF0C\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002" : "\u5148\u5199\u6E05\u4EA4\u4ED8\u76EE\u6807\uFF0C\u518D\u5B89\u6392\u8D1F\u8D23\u4EBA\u548C\u5B50\u4EFB\u52A1\u3002" })
|
|
14696
14956
|
] }),
|
|
14697
|
-
visible.length > limit && /* @__PURE__ */ (0,
|
|
14957
|
+
visible.length > limit && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("button", { type: "button", onClick: () => setLimit((n) => n + 24), children: [
|
|
14698
14958
|
"\u663E\u793A\u66F4\u591A\u9700\u6C42 \xB7 \u8FD8\u6709 ",
|
|
14699
14959
|
visible.length - limit,
|
|
14700
14960
|
" \u9879"
|
|
14701
14961
|
] }),
|
|
14702
|
-
!archived && Boolean(groups.get("legacy")?.length) && /* @__PURE__ */ (0,
|
|
14962
|
+
!archived && Boolean(groups.get("legacy")?.length) && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("button", { type: "button", className: "dsh-partner-requirement-legacy", onClick: () => setSelected("legacy"), children: [
|
|
14703
14963
|
"\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1 ",
|
|
14704
|
-
/* @__PURE__ */ (0,
|
|
14705
|
-
/* @__PURE__ */ (0,
|
|
14706
|
-
/* @__PURE__ */ (0,
|
|
14964
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("b", { children: groups.get("legacy").length }),
|
|
14965
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: "\u4FDD\u7559\u539F\u8BB0\u5F55\uFF0C\u4E0D\u81EA\u52A8\u5408\u5E76" }),
|
|
14966
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_dsh_client_ui_primitives16.IconChevronRightOutline14, { size: 14 })
|
|
14707
14967
|
] })
|
|
14708
14968
|
] }),
|
|
14709
|
-
creating && /* @__PURE__ */ (0,
|
|
14969
|
+
creating && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u9700\u6C42", detail: "\u4E00\u4E2A\u9700\u6C42\u5BF9\u5E94\u4E00\u4EFD\u6700\u7EC8\u4EA4\u4ED8\uFF0C\u7531\u8D1F\u8D23\u4EBA\u7EDF\u4E00\u6536\u5C3E\u3002", close: () => setCreating(false), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RequirementForm, { directory, close: () => setCreating(false), created: async (item) => {
|
|
14710
14970
|
setCreating(false);
|
|
14711
14971
|
await load2();
|
|
14712
14972
|
setSelected(item.id);
|
|
14713
14973
|
} }) }),
|
|
14714
|
-
detail && /* @__PURE__ */ (0,
|
|
14715
|
-
initialTaskId && /* @__PURE__ */ (0,
|
|
14974
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(WorkspaceDialog, { title: detail.title, eyebrow: "\u9700\u6C42\u8BE6\u60C5", detail: requirementStatus(detail), close: () => setDetailId(void 0), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RequirementDetail, { item: detail, tasks: groups.get(detail.id) ?? [], directory, changed: load2, close: () => setDetailId(void 0) }, detail.id) }),
|
|
14975
|
+
initialTaskId && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RequirementTasksPanel, { initialTaskId, openRequest, detailOnly: true })
|
|
14716
14976
|
] });
|
|
14717
14977
|
}
|
|
14718
14978
|
|
|
14719
14979
|
// src/ui/schedule-panel.tsx
|
|
14720
|
-
var
|
|
14721
|
-
var
|
|
14722
|
-
var
|
|
14980
|
+
var import_react38 = require("react");
|
|
14981
|
+
var import_dsh_client_ui_primitives17 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
14982
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
14723
14983
|
function SchedulePanel({ companions }) {
|
|
14724
|
-
const [schedules, setSchedules] = (0,
|
|
14725
|
-
const [runs, setRuns] = (0,
|
|
14726
|
-
const [creating, setCreating] = (0,
|
|
14727
|
-
const [busy, setBusy] = (0,
|
|
14728
|
-
const [loading, setLoading] = (0,
|
|
14729
|
-
const [error, setError] = (0,
|
|
14730
|
-
const load2 = (0,
|
|
14984
|
+
const [schedules, setSchedules] = (0, import_react38.useState)([]);
|
|
14985
|
+
const [runs, setRuns] = (0, import_react38.useState)([]);
|
|
14986
|
+
const [creating, setCreating] = (0, import_react38.useState)(false);
|
|
14987
|
+
const [busy, setBusy] = (0, import_react38.useState)();
|
|
14988
|
+
const [loading, setLoading] = (0, import_react38.useState)(true);
|
|
14989
|
+
const [error, setError] = (0, import_react38.useState)();
|
|
14990
|
+
const load2 = (0, import_react38.useCallback)(async () => {
|
|
14731
14991
|
try {
|
|
14732
14992
|
const value = await api("/schedules");
|
|
14733
14993
|
setSchedules(value.schedules);
|
|
@@ -14739,7 +14999,7 @@ function SchedulePanel({ companions }) {
|
|
|
14739
14999
|
setLoading(false);
|
|
14740
15000
|
}
|
|
14741
15001
|
}, []);
|
|
14742
|
-
(0,
|
|
15002
|
+
(0, import_react38.useEffect)(() => {
|
|
14743
15003
|
void load2();
|
|
14744
15004
|
}, [load2]);
|
|
14745
15005
|
const update = async (entry, value) => {
|
|
@@ -14775,65 +15035,65 @@ function SchedulePanel({ companions }) {
|
|
|
14775
15035
|
setBusy(void 0);
|
|
14776
15036
|
}
|
|
14777
15037
|
};
|
|
14778
|
-
return /* @__PURE__ */ (0,
|
|
14779
|
-
/* @__PURE__ */ (0,
|
|
14780
|
-
/* @__PURE__ */ (0,
|
|
15038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "dsh-partner-feature-page", children: [
|
|
15039
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(WorkspaceHero, { eyebrow: "Ephemeral automation", title: "\u4F19\u4F34\u5B9A\u65F6\u4EFB\u52A1", detail: "\u7531\u6307\u5B9A\u4F19\u4F34\u5728\u9694\u79BB\u4E34\u65F6\u4F1A\u8BDD\u4E2D\u6267\u884C\uFF1B\u9ED8\u8BA4\u5B8C\u6210\u5373\u9500\u6BC1\uFF0C\u907F\u514D\u957F\u671F\u4F1A\u8BDD\u88AB\u540E\u53F0\u4EFB\u52A1\u6C61\u67D3\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
15040
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { type: "button", disabled: loading, onClick: () => {
|
|
14781
15041
|
void load2();
|
|
14782
15042
|
}, children: [
|
|
14783
|
-
/* @__PURE__ */ (0,
|
|
15043
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_dsh_client_ui_primitives17.IconRefreshOutline16, { size: 15 }),
|
|
14784
15044
|
"\u5237\u65B0"
|
|
14785
15045
|
] }),
|
|
14786
|
-
/* @__PURE__ */ (0,
|
|
14787
|
-
/* @__PURE__ */ (0,
|
|
15046
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
|
|
15047
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_dsh_client_ui_primitives17.IconPlusOutline16, { size: 15 }),
|
|
14788
15048
|
"\u65B0\u8BA1\u5212"
|
|
14789
15049
|
] })
|
|
14790
15050
|
] }) }),
|
|
14791
|
-
error && /* @__PURE__ */ (0,
|
|
14792
|
-
creating && /* @__PURE__ */ (0,
|
|
14793
|
-
/* @__PURE__ */ (0,
|
|
14794
|
-
/* @__PURE__ */ (0,
|
|
15051
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(WorkspaceNotice, { children: error }),
|
|
15052
|
+
creating && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u5B9A\u65F6\u4EFB\u52A1", detail: "\u9009\u62E9\u6267\u884C\u4F19\u4F34\u3001\u8FD0\u884C\u9891\u7387\u548C\u4F1A\u8BDD\u4FDD\u7559\u7B56\u7565\u3002\u8BA1\u5212\u521B\u5EFA\u540E\u53EF\u4EE5\u968F\u65F6\u505C\u7528\u6216\u7ACB\u5373\u6267\u884C\u3002", close: () => setCreating(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ScheduleForm, { companions, close: () => setCreating(false), changed: load2 }) }),
|
|
15053
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(WorkspaceBlock, { title: "\u6267\u884C\u8BA1\u5212", detail: `${schedules.filter((item) => item.enabled).length} \u4E2A\u542F\u7528`, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CollectionSkeleton, { rows: 3 }) : schedules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u5B9A\u65F6\u4EFB\u52A1", detail: "\u521B\u5EFA\u8BA1\u5212\u540E\uFF0C\u4F19\u4F34\u4F1A\u6309\u8BBE\u5B9A\u5728\u72EC\u7ACB\u4F1A\u8BDD\u4E2D\u6267\u884C\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
|
|
15054
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_dsh_client_ui_primitives17.IconPlusOutline16, { size: 14 }),
|
|
14795
15055
|
"\u521B\u5EFA\u7B2C\u4E00\u4E2A\u8BA1\u5212"
|
|
14796
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
14797
|
-
/* @__PURE__ */ (0,
|
|
14798
|
-
/* @__PURE__ */ (0,
|
|
14799
|
-
/* @__PURE__ */ (0,
|
|
14800
|
-
/* @__PURE__ */ (0,
|
|
14801
|
-
/* @__PURE__ */ (0,
|
|
15056
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "dsh-partner-schedule-list", children: schedules.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("article", { children: [
|
|
15057
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { children: [
|
|
15058
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("strong", { children: entry.title }),
|
|
15059
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: entry.prompt }),
|
|
15060
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "dsh-partner-schedule-meta", children: [
|
|
15061
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("em", { children: [
|
|
14802
15062
|
"@",
|
|
14803
15063
|
companionName(companions, entry.companionId)
|
|
14804
15064
|
] }),
|
|
14805
|
-
/* @__PURE__ */ (0,
|
|
14806
|
-
/* @__PURE__ */ (0,
|
|
15065
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("em", { children: scheduleLabel(entry) }),
|
|
15066
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("em", { children: [
|
|
14807
15067
|
"\u4E0B\u6B21 ",
|
|
14808
15068
|
new Date(entry.nextRunAt).toLocaleString()
|
|
14809
15069
|
] }),
|
|
14810
|
-
/* @__PURE__ */ (0,
|
|
15070
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("em", { children: entry.destroySessionAfterRun ? "\u6267\u884C\u540E\u9500\u6BC1" : "\u4FDD\u7559\u4F1A\u8BDD" })
|
|
14811
15071
|
] })
|
|
14812
15072
|
] }),
|
|
14813
|
-
/* @__PURE__ */ (0,
|
|
15073
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("button", { type: "button", className: "dsh-partner-feature-switch", "data-on": entry.enabled, "aria-pressed": entry.enabled, disabled: busy === entry.id, onClick: () => {
|
|
14814
15074
|
void update(entry, { enabled: !entry.enabled });
|
|
14815
|
-
}, children: /* @__PURE__ */ (0,
|
|
14816
|
-
/* @__PURE__ */ (0,
|
|
15075
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", {}) }),
|
|
15076
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { type: "button", disabled: busy === entry.id, onClick: () => {
|
|
14817
15077
|
void run(entry);
|
|
14818
15078
|
}, children: [
|
|
14819
|
-
/* @__PURE__ */ (0,
|
|
15079
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_dsh_client_ui_primitives17.IconPlayOutline16, { size: 14 }),
|
|
14820
15080
|
busy === entry.id ? "\u6267\u884C\u4E2D\u2026" : "\u7ACB\u5373\u6267\u884C"
|
|
14821
15081
|
] }),
|
|
14822
|
-
/* @__PURE__ */ (0,
|
|
15082
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("button", { type: "button", className: "is-icon", disabled: busy === entry.id, onClick: () => {
|
|
14823
15083
|
void remove(entry);
|
|
14824
|
-
}, "aria-label": `\u5220\u9664 ${entry.title}`, children: /* @__PURE__ */ (0,
|
|
15084
|
+
}, "aria-label": `\u5220\u9664 ${entry.title}`, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_dsh_client_ui_primitives17.IconTrashOutline16, { size: 14 }) })
|
|
14825
15085
|
] }, entry.id)) }) }),
|
|
14826
|
-
/* @__PURE__ */ (0,
|
|
14827
|
-
/* @__PURE__ */ (0,
|
|
14828
|
-
/* @__PURE__ */ (0,
|
|
14829
|
-
/* @__PURE__ */ (0,
|
|
14830
|
-
/* @__PURE__ */ (0,
|
|
15086
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(WorkspaceBlock, { title: "\u6700\u8FD1\u8FD0\u884C", detail: "\u4FDD\u7559\u6700\u8FD1\u7684\u72B6\u6001\u4E0E\u7ED3\u679C\u6458\u8981", children: [
|
|
15087
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "dsh-partner-run-list", children: runs.map((run2) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("article", { "data-status": run2.status, children: [
|
|
15088
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", {}),
|
|
15089
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { children: [
|
|
15090
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("strong", { children: [
|
|
14831
15091
|
schedules.find((item) => item.id === run2.sourceId)?.title ?? "\u5DF2\u5220\u9664\u8BA1\u5212",
|
|
14832
15092
|
" \xB7 @",
|
|
14833
15093
|
companionName(companions, run2.ownerCompanionId)
|
|
14834
15094
|
] }),
|
|
14835
|
-
/* @__PURE__ */ (0,
|
|
14836
|
-
/* @__PURE__ */ (0,
|
|
15095
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { children: run2.error || run2.outputSummary || "\u7B49\u5F85\u7ED3\u679C" }),
|
|
15096
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("small", { children: [
|
|
14837
15097
|
new Date(run2.startedAt).toLocaleString(),
|
|
14838
15098
|
" \xB7 ",
|
|
14839
15099
|
run2.status,
|
|
@@ -14842,14 +15102,14 @@ function SchedulePanel({ companions }) {
|
|
|
14842
15102
|
] })
|
|
14843
15103
|
] })
|
|
14844
15104
|
] }, run2.id)) }),
|
|
14845
|
-
!loading && runs.length === 0 && /* @__PURE__ */ (0,
|
|
15105
|
+
!loading && runs.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u6267\u884C\u8BB0\u5F55", detail: "\u8BA1\u5212\u7B2C\u4E00\u6B21\u6267\u884C\u540E\uFF0C\u7ED3\u679C\u548C\u8017\u65F6\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002" })
|
|
14846
15106
|
] })
|
|
14847
15107
|
] });
|
|
14848
15108
|
}
|
|
14849
15109
|
function ScheduleForm({ companions, close, changed: changed2 }) {
|
|
14850
|
-
const [kind, setKind] = (0,
|
|
14851
|
-
const [error, setError] = (0,
|
|
14852
|
-
const [busy, setBusy] = (0,
|
|
15110
|
+
const [kind, setKind] = (0, import_react38.useState)("interval");
|
|
15111
|
+
const [error, setError] = (0, import_react38.useState)();
|
|
15112
|
+
const [busy, setBusy] = (0, import_react38.useState)(false);
|
|
14853
15113
|
const submit = async (event) => {
|
|
14854
15114
|
event.preventDefault();
|
|
14855
15115
|
const data = new FormData(event.currentTarget);
|
|
@@ -14866,18 +15126,18 @@ function ScheduleForm({ companions, close, changed: changed2 }) {
|
|
|
14866
15126
|
setBusy(false);
|
|
14867
15127
|
}
|
|
14868
15128
|
};
|
|
14869
|
-
return /* @__PURE__ */ (0,
|
|
15129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("form", { className: "dsh-partner-schedule-form", "aria-busy": busy, onSubmit: (event) => {
|
|
14870
15130
|
void submit(event);
|
|
14871
15131
|
}, children: [
|
|
14872
|
-
/* @__PURE__ */ (0,
|
|
14873
|
-
/* @__PURE__ */ (0,
|
|
14874
|
-
/* @__PURE__ */ (0,
|
|
15132
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
|
|
15133
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u8BA1\u5212\u540D\u79F0" }),
|
|
15134
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { name: "title", required: true, maxLength: 160, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u6BCF\u65E5\u6574\u7406\u9879\u76EE\u53D8\u5316" })
|
|
14875
15135
|
] }),
|
|
14876
|
-
/* @__PURE__ */ (0,
|
|
14877
|
-
/* @__PURE__ */ (0,
|
|
14878
|
-
/* @__PURE__ */ (0,
|
|
14879
|
-
/* @__PURE__ */ (0,
|
|
14880
|
-
companions.map((companion) => /* @__PURE__ */ (0,
|
|
15136
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
|
|
15137
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u6267\u884C\u4F19\u4F34" }),
|
|
15138
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("select", { name: "companionId", required: true, defaultValue: companions[0]?.id ?? "", children: [
|
|
15139
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "", disabled: true, children: "\u9009\u62E9\u4F19\u4F34" }),
|
|
15140
|
+
companions.map((companion) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("option", { value: companion.id, children: [
|
|
14881
15141
|
"@",
|
|
14882
15142
|
companion.name,
|
|
14883
15143
|
" \xB7 ",
|
|
@@ -14885,51 +15145,51 @@ function ScheduleForm({ companions, close, changed: changed2 }) {
|
|
|
14885
15145
|
] }, companion.id))
|
|
14886
15146
|
] })
|
|
14887
15147
|
] }),
|
|
14888
|
-
/* @__PURE__ */ (0,
|
|
14889
|
-
/* @__PURE__ */ (0,
|
|
14890
|
-
/* @__PURE__ */ (0,
|
|
15148
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "is-wide", children: [
|
|
15149
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u6267\u884C\u5185\u5BB9" }),
|
|
15150
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("textarea", { name: "prompt", required: true, maxLength: 12e3, rows: 5, placeholder: "\u660E\u786E\u8BF4\u660E\u8981\u68C0\u67E5\u3001\u6574\u7406\u6216\u5B8C\u6210\u4EC0\u4E48\uFF0C\u4EE5\u53CA\u5E0C\u671B\u8FD4\u56DE\u4EC0\u4E48\u7ED3\u679C" })
|
|
14891
15151
|
] }),
|
|
14892
|
-
/* @__PURE__ */ (0,
|
|
14893
|
-
/* @__PURE__ */ (0,
|
|
14894
|
-
/* @__PURE__ */ (0,
|
|
14895
|
-
/* @__PURE__ */ (0,
|
|
14896
|
-
/* @__PURE__ */ (0,
|
|
15152
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
|
|
15153
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u9891\u7387" }),
|
|
15154
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("select", { value: kind, onChange: (event) => setKind(event.target.value), children: [
|
|
15155
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "interval", children: "\u6BCF\u9694\u4E00\u6BB5\u65F6\u95F4" }),
|
|
15156
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "daily", children: "\u6BCF\u5929\u56FA\u5B9A\u65F6\u95F4" })
|
|
14897
15157
|
] })
|
|
14898
15158
|
] }),
|
|
14899
|
-
kind === "interval" ? /* @__PURE__ */ (0,
|
|
14900
|
-
/* @__PURE__ */ (0,
|
|
14901
|
-
/* @__PURE__ */ (0,
|
|
14902
|
-
] }) : /* @__PURE__ */ (0,
|
|
14903
|
-
/* @__PURE__ */ (0,
|
|
14904
|
-
/* @__PURE__ */ (0,
|
|
14905
|
-
/* @__PURE__ */ (0,
|
|
15159
|
+
kind === "interval" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
|
|
15160
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u95F4\u9694\u5206\u949F" }),
|
|
15161
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { name: "minutes", type: "number", min: 5, max: 43200, defaultValue: 60 })
|
|
15162
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "dsh-partner-schedule-time", children: [
|
|
15163
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
|
|
15164
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u5C0F\u65F6" }),
|
|
15165
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { name: "hour", type: "number", min: 0, max: 23, defaultValue: 9 })
|
|
14906
15166
|
] }),
|
|
14907
|
-
/* @__PURE__ */ (0,
|
|
14908
|
-
/* @__PURE__ */ (0,
|
|
14909
|
-
/* @__PURE__ */ (0,
|
|
15167
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
|
|
15168
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u5206\u949F" }),
|
|
15169
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { name: "minute", type: "number", min: 0, max: 59, defaultValue: 0 })
|
|
14910
15170
|
] })
|
|
14911
15171
|
] }),
|
|
14912
|
-
/* @__PURE__ */ (0,
|
|
14913
|
-
/* @__PURE__ */ (0,
|
|
14914
|
-
/* @__PURE__ */ (0,
|
|
14915
|
-
/* @__PURE__ */ (0,
|
|
14916
|
-
/* @__PURE__ */ (0,
|
|
15172
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
|
|
15173
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u91CD\u53E0\u7B56\u7565" }),
|
|
15174
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("select", { name: "overlapPolicy", defaultValue: "skip", children: [
|
|
15175
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "skip", children: "\u8DF3\u8FC7\u91CD\u53E0" }),
|
|
15176
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "queue", children: "\u6392\u961F\u6267\u884C" })
|
|
14917
15177
|
] })
|
|
14918
15178
|
] }),
|
|
14919
|
-
/* @__PURE__ */ (0,
|
|
14920
|
-
/* @__PURE__ */ (0,
|
|
14921
|
-
/* @__PURE__ */ (0,
|
|
15179
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { children: [
|
|
15180
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u8D85\u65F6\u5206\u949F" }),
|
|
15181
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { name: "timeoutMinutes", type: "number", min: 1, max: 120, defaultValue: 10 })
|
|
14922
15182
|
] }),
|
|
14923
|
-
/* @__PURE__ */ (0,
|
|
14924
|
-
/* @__PURE__ */ (0,
|
|
14925
|
-
/* @__PURE__ */ (0,
|
|
14926
|
-
/* @__PURE__ */ (0,
|
|
15183
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "dsh-partner-check is-wide", children: [
|
|
15184
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { name: "retain", type: "checkbox" }),
|
|
15185
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", {}),
|
|
15186
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u6267\u884C\u540E\u4FDD\u7559\u4E34\u65F6\u4F1A\u8BDD" })
|
|
14927
15187
|
] }),
|
|
14928
|
-
error && /* @__PURE__ */ (0,
|
|
14929
|
-
/* @__PURE__ */ (0,
|
|
14930
|
-
/* @__PURE__ */ (0,
|
|
14931
|
-
/* @__PURE__ */ (0,
|
|
14932
|
-
/* @__PURE__ */ (0,
|
|
15188
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(WorkspaceNotice, { children: error }),
|
|
15189
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("footer", { children: [
|
|
15190
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
15191
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
|
|
15192
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_dsh_client_ui_primitives17.IconPlusOutline16, { size: 14 }),
|
|
14933
15193
|
busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u8BA1\u5212"
|
|
14934
15194
|
] })
|
|
14935
15195
|
] })
|
|
@@ -14943,14 +15203,15 @@ function companionName(companions, id) {
|
|
|
14943
15203
|
}
|
|
14944
15204
|
|
|
14945
15205
|
// src/ui/capability-editor.tsx
|
|
14946
|
-
var
|
|
14947
|
-
var
|
|
15206
|
+
var import_react42 = require("react");
|
|
15207
|
+
var import_dsh_client_ui_primitives20 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
14948
15208
|
|
|
14949
15209
|
// src/capabilities.ts
|
|
14950
|
-
var COMPANION_CAPABILITIES = ["knowledge", "skills", "ssh", "git", "companions", "schedules", "access", "administration"];
|
|
15210
|
+
var COMPANION_CAPABILITIES = ["knowledge", "skills", "mcp", "ssh", "git", "companions", "schedules", "access", "administration"];
|
|
14951
15211
|
var CAPABILITY_LABELS = {
|
|
14952
15212
|
knowledge: "\u77E5\u8BC6\u5E93",
|
|
14953
15213
|
skills: "Skill",
|
|
15214
|
+
mcp: "MCP",
|
|
14954
15215
|
ssh: "SSH",
|
|
14955
15216
|
git: "Git",
|
|
14956
15217
|
companions: "\u521B\u5EFA\u4F19\u4F34",
|
|
@@ -14962,15 +15223,114 @@ function isCompanionCapability(value) {
|
|
|
14962
15223
|
return COMPANION_CAPABILITIES.includes(value);
|
|
14963
15224
|
}
|
|
14964
15225
|
|
|
15226
|
+
// src/ui/capability-resources.tsx
|
|
15227
|
+
var import_react41 = require("react");
|
|
15228
|
+
|
|
15229
|
+
// src/ui/mcp-capabilities.tsx
|
|
15230
|
+
var import_react39 = require("react");
|
|
15231
|
+
var import_dsh_client_ui_primitives18 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
15232
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
15233
|
+
function CompanionMcpSettings({ companionId, embedded = false, onBusyChange }) {
|
|
15234
|
+
const [catalog, setCatalog] = (0, import_react39.useState)({ servers: [], bindings: [] });
|
|
15235
|
+
const [selecting, setSelecting] = (0, import_react39.useState)(false);
|
|
15236
|
+
const [showAll, setShowAll] = (0, import_react39.useState)(false);
|
|
15237
|
+
const [query, setQuery] = (0, import_react39.useState)("");
|
|
15238
|
+
const [busy, setBusy] = (0, import_react39.useState)(false);
|
|
15239
|
+
const [error, setError] = (0, import_react39.useState)("");
|
|
15240
|
+
const [notice, setNotice] = (0, import_react39.useState)("");
|
|
15241
|
+
const load2 = (0, import_react39.useCallback)(async () => {
|
|
15242
|
+
try {
|
|
15243
|
+
setCatalog(await api("/mcp"));
|
|
15244
|
+
setError("");
|
|
15245
|
+
} catch (reason) {
|
|
15246
|
+
setError(errorMessage(reason));
|
|
15247
|
+
}
|
|
15248
|
+
}, []);
|
|
15249
|
+
(0, import_react39.useEffect)(() => {
|
|
15250
|
+
void load2();
|
|
15251
|
+
}, [load2]);
|
|
15252
|
+
const ids = new Set(catalog.bindings.filter((b) => b.companionId === companionId).map((b) => b.serverId));
|
|
15253
|
+
const authorized = catalog.servers.filter((s) => ids.has(s.id));
|
|
15254
|
+
const toggle = async (serverId, enabled) => {
|
|
15255
|
+
if (busy) return;
|
|
15256
|
+
onBusyChange?.(true);
|
|
15257
|
+
setBusy(true);
|
|
15258
|
+
setError("");
|
|
15259
|
+
setNotice("");
|
|
15260
|
+
try {
|
|
15261
|
+
setCatalog(await api("/mcp/bindings", { method: "POST", body: JSON.stringify({ companionId, serverId, enabled }) }));
|
|
15262
|
+
setNotice(enabled ? "\u5DF2\u6388\u6743\uFF0C\u4E0B\u4E00\u8F6E\u5BF9\u8BDD\u751F\u6548\uFF0C\u65E0\u9700\u65B0\u5EFA\u4F1A\u8BDD\u3002" : "\u6388\u6743\u5DF2\u79FB\u9664\uFF0C\u7ACB\u5373\u963B\u6B62\u65B0\u7684\u8C03\u7528\uFF0C\u4E0B\u4E00\u8F6E\u79FB\u9664\u5DE5\u5177\u5217\u8868\u3002");
|
|
15263
|
+
} catch (reason) {
|
|
15264
|
+
setError(errorMessage(reason));
|
|
15265
|
+
} finally {
|
|
15266
|
+
setBusy(false);
|
|
15267
|
+
onBusyChange?.(false);
|
|
15268
|
+
}
|
|
15269
|
+
};
|
|
15270
|
+
const feedback = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
15271
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(WorkspaceNotice, { children: error }),
|
|
15272
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(WorkspaceNotice, { kind: "success", children: notice })
|
|
15273
|
+
] });
|
|
15274
|
+
const picker = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
15275
|
+
feedback,
|
|
15276
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FormField, { label: "\u641C\u7D22\u670D\u52A1", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("input", { value: query, onChange: (e) => setQuery(e.target.value) }) }),
|
|
15277
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "dsh-partner-skill-installed dsh-partner-mcp-bindings", children: catalog.servers.filter((s) => s.name.toLocaleLowerCase().includes(query.toLocaleLowerCase())).map((server) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("article", { children: [
|
|
15278
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { children: [
|
|
15279
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: server.name }),
|
|
15280
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("p", { children: [
|
|
15281
|
+
server.tools.length,
|
|
15282
|
+
" \u4E2A\u5DE5\u5177 \xB7 ",
|
|
15283
|
+
ids.has(server.id) ? "\u5DF2\u6388\u6743" : "\u672A\u6388\u6743",
|
|
15284
|
+
!server.enabled && " \xB7 \u5DF2\u505C\u7528"
|
|
15285
|
+
] })
|
|
15286
|
+
] }),
|
|
15287
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", "aria-pressed": ids.has(server.id), disabled: busy, onClick: () => {
|
|
15288
|
+
void toggle(server.id, !ids.has(server.id));
|
|
15289
|
+
}, children: ids.has(server.id) ? "\u79FB\u9664\u6388\u6743" : "\u6388\u6743" })
|
|
15290
|
+
] }, server.id)) }),
|
|
15291
|
+
!catalog.servers.length && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CollectionEmpty, { title: "\u6CA1\u6709\u53EF\u7528\u670D\u52A1", detail: "\u5148\u524D\u5F80 MCP \u670D\u52A1\u9875\u65B0\u589E\u6216\u5BFC\u5165\u914D\u7F6E\u3002" })
|
|
15292
|
+
] });
|
|
15293
|
+
if (embedded) return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("section", { className: "dsh-partner-capability-picker", children: [
|
|
15294
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "dsh-partner-inline-note", children: "\u6388\u6743\u670D\u52A1\u5373\u5141\u8BB8\u8C03\u7528\u8BE5\u670D\u52A1\u7684\u5DE5\u5177\u3002\u51ED\u636E\u4E0D\u4F1A\u63D0\u4F9B\u7ED9\u4F19\u4F34\uFF0C\u4FEE\u6539\u4E8E\u4E0B\u4E00\u8F6E\u751F\u6548\u3002" }),
|
|
15295
|
+
picker
|
|
15296
|
+
] });
|
|
15297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(WorkspaceBlock, { title: "\u5DF2\u6388\u6743 MCP", detail: "\u53EA\u6CE8\u5165\u9009\u4E2D\u7684\u670D\u52A1\uFF1B\u65B0\u589E\u6216\u4FEE\u6539\u5DE5\u5177\u540E\uFF0C\u5728 MCP \u670D\u52A1\u9875\u5237\u65B0\u5DE5\u5177\u5373\u53EF\u4E8E\u4E0B\u4E00\u8F6E\u751F\u6548\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("button", { type: "button", onClick: () => {
|
|
15298
|
+
setSelecting(true);
|
|
15299
|
+
void load2();
|
|
15300
|
+
}, children: [
|
|
15301
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_dsh_client_ui_primitives18.IconPlusOutline16, { size: 14 }),
|
|
15302
|
+
"\u9009\u62E9 MCP"
|
|
15303
|
+
] }), children: [
|
|
15304
|
+
!selecting && feedback,
|
|
15305
|
+
!authorized.length ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CollectionEmpty, { title: "\u5C1A\u672A\u6388\u6743 MCP \u670D\u52A1", detail: "\u5148\u5728 MCP \u670D\u52A1\u9875\u6DFB\u52A0\u914D\u7F6E\uFF0C\u518D\u5728\u6B64\u9009\u62E9\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "dsh-partner-skill-installed dsh-partner-mcp-bindings", children: (showAll ? authorized : authorized.slice(0, 4)).map((server) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("article", { children: [
|
|
15306
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { children: [
|
|
15307
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("strong", { children: server.name }),
|
|
15308
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("p", { children: [
|
|
15309
|
+
server.tools.length,
|
|
15310
|
+
" \u4E2A\u5DE5\u5177 \xB7 ",
|
|
15311
|
+
server.enabled ? "\u5DF2\u542F\u7528" : "\u670D\u52A1\u5DF2\u505C\u7528"
|
|
15312
|
+
] })
|
|
15313
|
+
] }),
|
|
15314
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", disabled: busy, onClick: () => {
|
|
15315
|
+
void toggle(server.id, false);
|
|
15316
|
+
}, children: "\u79FB\u9664\u6388\u6743" })
|
|
15317
|
+
] }, server.id)) }),
|
|
15318
|
+
authorized.length > 4 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", className: "dsh-partner-skill-disclosure", "aria-expanded": showAll, onClick: () => setShowAll((v) => !v), children: showAll ? "\u6536\u8D77" : `\u67E5\u770B\u5168\u90E8 ${authorized.length} \u4E2A MCP` }),
|
|
15319
|
+
selecting && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(WorkspaceDialog, { title: "\u9009\u62E9 MCP \u670D\u52A1", detail: "\u6388\u6743\u670D\u52A1\u5373\u5141\u8BB8\u8C03\u7528\u8BE5\u670D\u52A1\u5237\u65B0\u540E\u516C\u5E03\u7684\u6240\u6709\u5DE5\u5177\u3002\u51ED\u636E\u4E0D\u4F1A\u63D0\u4F9B\u7ED9\u4F19\u4F34\u3002", close: () => {
|
|
15320
|
+
if (!busy) setSelecting(false);
|
|
15321
|
+
}, children: picker })
|
|
15322
|
+
] });
|
|
15323
|
+
}
|
|
15324
|
+
|
|
14965
15325
|
// src/ui/companion-access-panel.tsx
|
|
14966
|
-
var
|
|
14967
|
-
var
|
|
14968
|
-
var
|
|
14969
|
-
function CompanionAccessPanel({ companionId }) {
|
|
14970
|
-
const [access, setAccess] = (0,
|
|
14971
|
-
const [busy, setBusy] = (0,
|
|
14972
|
-
const [error, setError] = (0,
|
|
14973
|
-
const load2 = (0,
|
|
15326
|
+
var import_react40 = require("react");
|
|
15327
|
+
var import_dsh_client_ui_primitives19 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
15328
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
15329
|
+
function CompanionAccessPanel({ companionId, onBusyChange }) {
|
|
15330
|
+
const [access, setAccess] = (0, import_react40.useState)({ targetIds: [], companions: [] });
|
|
15331
|
+
const [busy, setBusy] = (0, import_react40.useState)();
|
|
15332
|
+
const [error, setError] = (0, import_react40.useState)();
|
|
15333
|
+
const load2 = (0, import_react40.useCallback)(async () => {
|
|
14974
15334
|
try {
|
|
14975
15335
|
setAccess(await api(`/companions/${encodeURIComponent(companionId)}/access`));
|
|
14976
15336
|
setError(void 0);
|
|
@@ -14978,10 +15338,12 @@ function CompanionAccessPanel({ companionId }) {
|
|
|
14978
15338
|
setError(errorMessage(reason));
|
|
14979
15339
|
}
|
|
14980
15340
|
}, [companionId]);
|
|
14981
|
-
(0,
|
|
15341
|
+
(0, import_react40.useEffect)(() => {
|
|
14982
15342
|
void load2();
|
|
14983
15343
|
}, [load2]);
|
|
14984
15344
|
const toggle = async (targetId) => {
|
|
15345
|
+
if (busy) return;
|
|
15346
|
+
onBusyChange?.(true);
|
|
14985
15347
|
const previous3 = access.targetIds;
|
|
14986
15348
|
const targetIds = previous3.includes(targetId) ? previous3.filter((id) => id !== targetId) : [...previous3, targetId];
|
|
14987
15349
|
setBusy(targetId);
|
|
@@ -14995,71 +15357,132 @@ function CompanionAccessPanel({ companionId }) {
|
|
|
14995
15357
|
setError(errorMessage(reason));
|
|
14996
15358
|
} finally {
|
|
14997
15359
|
setBusy(void 0);
|
|
15360
|
+
onBusyChange?.(false);
|
|
14998
15361
|
}
|
|
14999
15362
|
};
|
|
15000
|
-
return /* @__PURE__ */ (0,
|
|
15001
|
-
/* @__PURE__ */ (0,
|
|
15002
|
-
/* @__PURE__ */ (0,
|
|
15003
|
-
/* @__PURE__ */ (0,
|
|
15004
|
-
/* @__PURE__ */ (0,
|
|
15363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("section", { className: "dsh-partner-capability-detail dsh-partner-access", "aria-labelledby": "dsh-partner-access-title", children: [
|
|
15364
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("header", { children: [
|
|
15365
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { children: [
|
|
15366
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("small", { children: "DIRECTED ACCESS" }),
|
|
15367
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("strong", { id: "dsh-partner-access-title", children: "\u53EF\u8BBF\u95EE\u7684\u4F19\u4F34" })
|
|
15005
15368
|
] }),
|
|
15006
|
-
/* @__PURE__ */ (0,
|
|
15369
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("em", { children: [
|
|
15007
15370
|
access.targetIds.length,
|
|
15008
15371
|
" \u4F4D\u5DF2\u6388\u6743"
|
|
15009
15372
|
] })
|
|
15010
15373
|
] }),
|
|
15011
|
-
/* @__PURE__ */ (0,
|
|
15012
|
-
access.companions.length === 0 ? /* @__PURE__ */ (0,
|
|
15374
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "dsh-partner-access-note", children: "\u52FE\u9009\u540E\uFF0C\u5F53\u524D\u4F19\u4F34\u80FD\u4E86\u89E3\u5BF9\u65B9\u7684\u516C\u5F00\u80FD\u529B\uFF0C\u5E76\u5728\u4EFB\u52A1\u770B\u677F\u4E2D `@` \u5BF9\u65B9\u6267\u884C\u4EFB\u52A1\u3002\u6388\u6743\u53EA\u6CBF\u5F53\u524D\u65B9\u5411\u751F\u6548\uFF0C\u4E0D\u4F1A\u53CD\u5411\u6388\u6743\uFF0C\u4E5F\u4E0D\u4F1A\u5171\u4EAB\u4F1A\u8BDD\u3001\u8BB0\u5FC6\u3001\u6E20\u9053\u6216\u51ED\u636E\u3002" }),
|
|
15375
|
+
access.companions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u53EF\u6388\u6743\u7684\u4F19\u4F34", detail: "\u521B\u5EFA\u7B2C\u4E8C\u4F4D\u4F19\u4F34\u540E\uFF0C\u53EF\u4EE5\u5728\u8FD9\u91CC\u5EFA\u7ACB\u5355\u5411\u534F\u4F5C\u6388\u6743\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "dsh-partner-access-list", children: access.companions.map((companion) => {
|
|
15013
15376
|
const selected = access.targetIds.includes(companion.id);
|
|
15014
15377
|
const abilities = companion.capabilities.map((capability) => isCompanionCapability(capability) ? CAPABILITY_LABELS[capability] : capability);
|
|
15015
|
-
return /* @__PURE__ */ (0,
|
|
15378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("button", { type: "button", className: selected ? "is-active" : "", "aria-pressed": selected, disabled: busy === companion.id, onClick: () => {
|
|
15016
15379
|
void toggle(companion.id);
|
|
15017
15380
|
}, children: [
|
|
15018
|
-
/* @__PURE__ */ (0,
|
|
15019
|
-
/* @__PURE__ */ (0,
|
|
15020
|
-
/* @__PURE__ */ (0,
|
|
15381
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "dsh-partner-access-avatar", "aria-hidden": "true", children: initials(companion.name) }),
|
|
15382
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "dsh-partner-access-copy", children: [
|
|
15383
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("strong", { children: [
|
|
15021
15384
|
"@",
|
|
15022
15385
|
companion.name
|
|
15023
15386
|
] }),
|
|
15024
|
-
/* @__PURE__ */ (0,
|
|
15025
|
-
/* @__PURE__ */ (0,
|
|
15026
|
-
/* @__PURE__ */ (0,
|
|
15387
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("small", { children: companion.role }),
|
|
15388
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { children: companion.description || "\u672A\u586B\u5199\u4F19\u4F34\u8BF4\u660E" }),
|
|
15389
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: [...abilities, ...companion.enabledSkills.map((skill) => skill.name)].map((item) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("em", { children: item }, item)) })
|
|
15027
15390
|
] }),
|
|
15028
|
-
/* @__PURE__ */ (0,
|
|
15391
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "dsh-partner-access-check", "aria-hidden": "true", children: selected && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_dsh_client_ui_primitives19.IconCheckOutline16, { size: 15 }) })
|
|
15029
15392
|
] }, companion.id);
|
|
15030
15393
|
}) }),
|
|
15031
|
-
error && /* @__PURE__ */ (0,
|
|
15394
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(WorkspaceNotice, { children: error })
|
|
15032
15395
|
] });
|
|
15033
15396
|
}
|
|
15034
15397
|
function initials(name) {
|
|
15035
15398
|
return [...name.trim()].slice(0, 2).join("").toUpperCase() || "AI";
|
|
15036
15399
|
}
|
|
15037
15400
|
|
|
15401
|
+
// src/ui/capability-resources.tsx
|
|
15402
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
15403
|
+
var titles = { skills: "Skill", access: "\u53EF\u8BBF\u95EE\u4F19\u4F34", mcp: "MCP \u670D\u52A1" };
|
|
15404
|
+
function CapabilityResources({ companionId, capabilities, disabled, children }) {
|
|
15405
|
+
const [opened, setOpened] = (0, import_react41.useState)();
|
|
15406
|
+
const [busy, setBusy] = (0, import_react41.useState)(false);
|
|
15407
|
+
const [revision, setRevision] = (0, import_react41.useState)(0);
|
|
15408
|
+
const [counts, setCounts] = (0, import_react41.useState)({});
|
|
15409
|
+
const [failed, setFailed] = (0, import_react41.useState)(false);
|
|
15410
|
+
(0, import_react41.useEffect)(() => {
|
|
15411
|
+
let live = true;
|
|
15412
|
+
setFailed(false);
|
|
15413
|
+
const requests = [
|
|
15414
|
+
["access", api(`/companions/${encodeURIComponent(companionId)}/access`).then((v) => v.targetIds.length)]
|
|
15415
|
+
];
|
|
15416
|
+
if (capabilities.includes("skills")) requests.push(["skills", api("/skills").then((v) => v.installed.filter((s) => v.bindings.some((b) => b.companionId === companionId && b.skillId === s.id && b.enabled)).length)]);
|
|
15417
|
+
if (capabilities.includes("mcp")) requests.push(["mcp", api("/mcp").then((v) => v.servers.filter((s) => v.bindings.some((b) => b.companionId === companionId && b.serverId === s.id)).length)]);
|
|
15418
|
+
for (const [key, request] of requests) void request.then((count) => {
|
|
15419
|
+
if (live) setCounts((v) => ({ ...v, [key]: count }));
|
|
15420
|
+
}).catch(() => {
|
|
15421
|
+
if (live) {
|
|
15422
|
+
setCounts((v) => ({ ...v, [key]: void 0 }));
|
|
15423
|
+
setFailed(true);
|
|
15424
|
+
}
|
|
15425
|
+
});
|
|
15426
|
+
return () => {
|
|
15427
|
+
live = false;
|
|
15428
|
+
};
|
|
15429
|
+
}, [companionId, capabilities, revision]);
|
|
15430
|
+
const close = () => {
|
|
15431
|
+
if (busy) return;
|
|
15432
|
+
setOpened(void 0);
|
|
15433
|
+
setRevision((v) => v + 1);
|
|
15434
|
+
};
|
|
15435
|
+
const manage = (key) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("button", { className: "dsh-partner-capability-manage", type: "button", disabled: disabled || key !== "access" && !capabilities.includes(key), "aria-haspopup": "dialog", "aria-label": `\u7BA1\u7406${titles[key]}`, onClick: () => {
|
|
15436
|
+
setBusy(false);
|
|
15437
|
+
setOpened(key);
|
|
15438
|
+
}, children: [
|
|
15439
|
+
"\u7BA1\u7406",
|
|
15440
|
+
counts[key] !== void 0 ? ` \xB7 ${counts[key]}` : ""
|
|
15441
|
+
] });
|
|
15442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
15443
|
+
children(manage),
|
|
15444
|
+
failed && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("p", { className: "dsh-partner-inline-note", children: [
|
|
15445
|
+
"\u90E8\u5206\u6570\u91CF\u8BFB\u53D6\u5931\u8D25\uFF0C\u53EF\u6253\u5F00\u7BA1\u7406\u91CD\u8BD5\u3002",
|
|
15446
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("button", { type: "button", onClick: () => setRevision((v) => v + 1), children: "\u5237\u65B0\u6570\u91CF" })
|
|
15447
|
+
] }),
|
|
15448
|
+
opened && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(WorkspaceDialog, { className: "is-capability-resources", eyebrow: "", title: `\u7BA1\u7406${titles[opened]}`, detail: opened === "access" ? "\u9009\u62E9\u6B64\u4F19\u4F34\u53EF\u4EE5\u8BBF\u95EE\u548C\u59D4\u6D3E\u7684\u4F19\u4F34\uFF0C\u5355\u5411\u6388\u6743\u3002" : "\u9009\u62E9\u9700\u8981\u542F\u7528\u7684\u80FD\u529B\uFF0C\u4FEE\u6539\u81EA\u52A8\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u751F\u6548\u3002", close, children: [
|
|
15449
|
+
busy && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { role: "status", className: "dsh-partner-inline-note", children: "\u6B63\u5728\u4FDD\u5B58\uFF0C\u8BF7\u7A0D\u5019\u2026" }),
|
|
15450
|
+
opened === "skills" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CompanionSkillSettings, { companionId, onBusyChange: setBusy }),
|
|
15451
|
+
opened === "access" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CompanionAccessPanel, { companionId, onBusyChange: setBusy }),
|
|
15452
|
+
opened === "mcp" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CompanionMcpSettings, { companionId, embedded: true, onBusyChange: setBusy })
|
|
15453
|
+
] })
|
|
15454
|
+
] });
|
|
15455
|
+
}
|
|
15456
|
+
|
|
15038
15457
|
// src/ui/companion-draft.ts
|
|
15039
15458
|
function companionDraft(companion) {
|
|
15040
15459
|
return { name: companion.name, role: companion.role, description: companion.description, instructions: companion.instructions, presetId: companion.presetId ?? "", provider: companion.provider ?? "", model: companion.model ?? "", capabilities: [...companion.capabilities] };
|
|
15041
15460
|
}
|
|
15042
15461
|
|
|
15043
15462
|
// src/ui/capability-editor.tsx
|
|
15044
|
-
var
|
|
15463
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
15045
15464
|
function CapabilityEditor({ companion, presets, onChanged }) {
|
|
15046
|
-
const [form, setForm] = (0,
|
|
15047
|
-
const [
|
|
15048
|
-
const [
|
|
15049
|
-
const [
|
|
15050
|
-
const [
|
|
15051
|
-
const
|
|
15052
|
-
const
|
|
15053
|
-
(0,
|
|
15465
|
+
const [form, setForm] = (0, import_react42.useState)(() => companionDraft(companion));
|
|
15466
|
+
const [persistedCapabilities, setPersistedCapabilities] = (0, import_react42.useState)(companion.capabilities);
|
|
15467
|
+
const [modelCatalog, setModelCatalog] = (0, import_react42.useState)();
|
|
15468
|
+
const [saving, setSaving] = (0, import_react42.useState)(false);
|
|
15469
|
+
const [saved, setSaved] = (0, import_react42.useState)(false);
|
|
15470
|
+
const [error, setError] = (0, import_react42.useState)();
|
|
15471
|
+
const savingRef = (0, import_react42.useRef)(false);
|
|
15472
|
+
const mounted = (0, import_react42.useRef)(true);
|
|
15473
|
+
(0, import_react42.useEffect)(() => {
|
|
15054
15474
|
mounted.current = true;
|
|
15055
15475
|
return () => {
|
|
15056
15476
|
mounted.current = false;
|
|
15057
15477
|
};
|
|
15058
15478
|
}, []);
|
|
15059
|
-
(0,
|
|
15060
|
-
if (!savingRef.current)
|
|
15479
|
+
(0, import_react42.useEffect)(() => {
|
|
15480
|
+
if (!savingRef.current) {
|
|
15481
|
+
setForm(companionDraft(companion));
|
|
15482
|
+
setPersistedCapabilities(companion.capabilities);
|
|
15483
|
+
}
|
|
15061
15484
|
}, [companion.id, companion.updatedAt]);
|
|
15062
|
-
(0,
|
|
15485
|
+
(0, import_react42.useEffect)(() => {
|
|
15063
15486
|
void api("/models").then((value) => {
|
|
15064
15487
|
if (mounted.current) setModelCatalog(value);
|
|
15065
15488
|
}).catch((reason) => {
|
|
@@ -15068,20 +15491,21 @@ function CapabilityEditor({ companion, presets, onChanged }) {
|
|
|
15068
15491
|
}, []);
|
|
15069
15492
|
const edit = (next) => {
|
|
15070
15493
|
if (savingRef.current) return;
|
|
15071
|
-
|
|
15072
|
-
setSaved(false);
|
|
15073
|
-
setError(void 0);
|
|
15494
|
+
void save(next);
|
|
15074
15495
|
};
|
|
15075
15496
|
const toggle = (capability) => edit({ ...form, capabilities: form.capabilities.includes(capability) ? form.capabilities.filter((item) => item !== capability) : [...form.capabilities, capability] });
|
|
15076
|
-
const save = async () => {
|
|
15497
|
+
const save = async (next) => {
|
|
15077
15498
|
if (savingRef.current) return;
|
|
15078
15499
|
savingRef.current = true;
|
|
15500
|
+
const previous3 = form;
|
|
15501
|
+
setForm(next);
|
|
15079
15502
|
setSaving(true);
|
|
15080
15503
|
setSaved(false);
|
|
15081
15504
|
setError(void 0);
|
|
15082
15505
|
try {
|
|
15083
|
-
await api(`/companions/${companion.id}`, { method: "PUT", body: JSON.stringify({ companion:
|
|
15506
|
+
await api(`/companions/${companion.id}`, { method: "PUT", body: JSON.stringify({ companion: next }) });
|
|
15084
15507
|
if (!mounted.current) return;
|
|
15508
|
+
setPersistedCapabilities(next.capabilities);
|
|
15085
15509
|
setSaved(true);
|
|
15086
15510
|
try {
|
|
15087
15511
|
await onChanged();
|
|
@@ -15089,7 +15513,10 @@ function CapabilityEditor({ companion, presets, onChanged }) {
|
|
|
15089
15513
|
if (mounted.current) setError("\u80FD\u529B\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u5217\u8868\u5237\u65B0\u5931\u8D25\u3002\u5237\u65B0\u9875\u9762\u5373\u53EF\uFF0C\u65E0\u9700\u91CD\u590D\u5E94\u7528\u3002");
|
|
15090
15514
|
}
|
|
15091
15515
|
} catch (reason) {
|
|
15092
|
-
if (mounted.current)
|
|
15516
|
+
if (mounted.current) {
|
|
15517
|
+
setForm(previous3);
|
|
15518
|
+
setError(`\u4FDD\u5B58\u5931\u8D25\uFF1A${errorMessage(reason)}\u3002\u5DF2\u6062\u590D\u539F\u9009\u62E9\uFF0C\u8BF7\u91CD\u65B0\u64CD\u4F5C\u3002`);
|
|
15519
|
+
}
|
|
15093
15520
|
} finally {
|
|
15094
15521
|
savingRef.current = false;
|
|
15095
15522
|
if (mounted.current) setSaving(false);
|
|
@@ -15099,6 +15526,7 @@ function CapabilityEditor({ companion, presets, onChanged }) {
|
|
|
15099
15526
|
{ id: "tools", eyebrow: "TOOLS", title: "\u5DE5\u4F5C\u5DE5\u5177", detail: "\u8FDE\u63A5\u5F53\u524D\u4F19\u4F34\u80FD\u591F\u4F7F\u7528\u7684\u4E13\u4E1A\u5DE5\u5177\u3002", choices: [
|
|
15100
15527
|
{ id: "knowledge", title: "\u77E5\u8BC6\u5E93", detail: "\u5728\u5DF2\u6302\u8F7D\u8303\u56F4\u5185\u68C0\u7D22\u4E0E\u56DE\u5199\u77E5\u8BC6\u3002" },
|
|
15101
15528
|
{ id: "skills", title: "Skill", detail: "\u4F7F\u7528\u5355\u72EC\u542F\u7528\u7684 Skill \u4E0E\u5DE5\u4F5C\u6D41\u7A0B\u3002" },
|
|
15529
|
+
{ id: "mcp", title: "MCP", detail: "\u4F7F\u7528\u5355\u72EC\u6388\u6743\u7684\u5916\u90E8 MCP \u670D\u52A1\u5DE5\u5177\u3002" },
|
|
15102
15530
|
{ id: "ssh", title: "SSH", detail: "\u5728 SSH \u63D2\u4EF6\u6388\u6743\u8FB9\u754C\u5185\u64CD\u4F5C\u4E3B\u673A\u3002" },
|
|
15103
15531
|
{ id: "git", title: "Git", detail: "\u9884\u7559 Git \u80FD\u529B\uFF0C\u9700\u5BF9\u5E94\u63D2\u4EF6\u5B9E\u9645\u5B89\u88C5\u3002" }
|
|
15104
15532
|
] },
|
|
@@ -15114,98 +15542,102 @@ function CapabilityEditor({ companion, presets, onChanged }) {
|
|
|
15114
15542
|
const selectedProvider = form.provider || modelCatalog?.defaultSelection.provider || "";
|
|
15115
15543
|
const modelOptions = modelCatalog?.providers.find((item) => item.id === selectedProvider)?.models ?? [];
|
|
15116
15544
|
const currentModelMissing = Boolean(form.model) && !modelOptions.some((item) => item.id === form.model);
|
|
15117
|
-
return /* @__PURE__ */ (0,
|
|
15118
|
-
/* @__PURE__ */ (0,
|
|
15119
|
-
/* @__PURE__ */ (0,
|
|
15120
|
-
|
|
15121
|
-
|
|
15122
|
-
|
|
15545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "dsh-partner-form is-capabilities", children: [
|
|
15546
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(SectionHeading, { eyebrow: "COMPOSITION", title: "\u80FD\u529B\u7EC4\u5408", detail: "\u4F19\u4F34\u58F0\u660E\u610F\u56FE\u8303\u56F4\uFF1B\u771F\u6B63\u53EF\u8C03\u7528\u7684\u5DE5\u5177\u4ECD\u6765\u81EA\u6240\u9009 Agent Preset\uFF0C\u5E76\u7EE7\u7EED\u6267\u884C\u5404\u63D2\u4EF6\u6743\u9650\u3002" }),
|
|
15547
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "dsh-partner-capability-save-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: [
|
|
15548
|
+
saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : saved ? "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u751F\u6548" : "\u4FEE\u6539\u81EA\u52A8\u4FDD\u5B58\uFF0C\u65E0\u9700\u5E94\u7528\u7EC4\u5408\u3002",
|
|
15549
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error })
|
|
15550
|
+
] }),
|
|
15551
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "dsh-partner-runtime-fields", children: [
|
|
15552
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FormField, { label: "Agent Preset", hint: "\u5DE5\u5177\u3001Skill \u4E0E\u7CFB\u7EDF\u63D0\u793A", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("select", { disabled: saving, value: form.presetId, onChange: (event) => edit({ ...form, presetId: event.target.value }), children: [
|
|
15553
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: "", children: "\u8DDF\u968F DSH \u9ED8\u8BA4 Preset" }),
|
|
15554
|
+
presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: item.id, children: item.name }, item.id))
|
|
15123
15555
|
] }) }),
|
|
15124
|
-
/* @__PURE__ */ (0,
|
|
15125
|
-
/* @__PURE__ */ (0,
|
|
15556
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FormField, { label: "\u6A21\u578B\u63D0\u4F9B\u65B9", hint: "\u6765\u81EA\u5F53\u524D\u5BA2\u6237\u7AEF", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("select", { disabled: saving, value: form.provider, onChange: (event) => edit({ ...form, provider: event.target.value, model: "" }), children: [
|
|
15557
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("option", { value: "", children: [
|
|
15126
15558
|
"\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
|
|
15127
15559
|
modelCatalog?.defaultSelection.provider || "\u6B63\u5728\u8BFB\u53D6"
|
|
15128
15560
|
] }),
|
|
15129
|
-
modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0,
|
|
15561
|
+
modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
|
|
15130
15562
|
] }) }),
|
|
15131
|
-
/* @__PURE__ */ (0,
|
|
15132
|
-
/* @__PURE__ */ (0,
|
|
15563
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FormField, { label: "\u6A21\u578B", hint: "\u968F\u63D0\u4F9B\u65B9\u8054\u52A8", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("select", { disabled: saving, value: form.model, onChange: (event) => edit({ ...form, model: event.target.value }), children: [
|
|
15564
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("option", { value: "", children: [
|
|
15133
15565
|
"\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
|
|
15134
15566
|
modelCatalog?.defaultSelection.model || "\u6B63\u5728\u8BFB\u53D6"
|
|
15135
15567
|
] }),
|
|
15136
|
-
currentModelMissing && /* @__PURE__ */ (0,
|
|
15568
|
+
currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("option", { value: form.model, children: [
|
|
15137
15569
|
"\u5F53\u524D\u914D\u7F6E \xB7 ",
|
|
15138
15570
|
form.model
|
|
15139
15571
|
] }),
|
|
15140
|
-
modelOptions.map((model) => /* @__PURE__ */ (0,
|
|
15572
|
+
modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
|
|
15141
15573
|
] }) })
|
|
15142
15574
|
] }),
|
|
15143
|
-
/* @__PURE__ */ (0,
|
|
15144
|
-
/* @__PURE__ */ (0,
|
|
15575
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "dsh-partner-inline-note", children: "\u8EAB\u4EFD\u4E0E\u80FD\u529B\u5728\u4E0B\u4E00\u8F6E\u6267\u884C\u524D\u66F4\u65B0\uFF1BPreset \u4E0E\u6A21\u578B\u4F5C\u4E3A\u4F1A\u8BDD\u9ED8\u8BA4\u914D\u7F6E\uFF0C\u4E0D\u8986\u76D6\u5DF2\u6709\u4F1A\u8BDD\u7684\u9009\u62E9\u3002" }),
|
|
15576
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CapabilityResources, { companionId: companion.id, capabilities: persistedCapabilities, disabled: saving, children: (manage) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "dsh-partner-capability-groups", children: groups.map((group) => {
|
|
15145
15577
|
const enabled = group.choices.filter((choice) => form.capabilities.includes(choice.id)).length;
|
|
15146
|
-
return /* @__PURE__ */ (0,
|
|
15147
|
-
/* @__PURE__ */ (0,
|
|
15148
|
-
/* @__PURE__ */ (0,
|
|
15149
|
-
/* @__PURE__ */ (0,
|
|
15150
|
-
/* @__PURE__ */ (0,
|
|
15151
|
-
/* @__PURE__ */ (0,
|
|
15578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("section", { className: "dsh-partner-capability-group", "aria-labelledby": `partner-capability-${group.id}`, children: [
|
|
15579
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("header", { children: [
|
|
15580
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { children: [
|
|
15581
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("small", { children: group.eyebrow }),
|
|
15582
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("strong", { id: `partner-capability-${group.id}`, children: group.title }),
|
|
15583
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { children: group.detail })
|
|
15152
15584
|
] }),
|
|
15153
|
-
/* @__PURE__ */ (0,
|
|
15585
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("em", { children: [
|
|
15154
15586
|
enabled,
|
|
15155
15587
|
" / ",
|
|
15156
15588
|
group.choices.length,
|
|
15157
15589
|
" \u5DF2\u542F\u7528"
|
|
15158
15590
|
] })
|
|
15159
15591
|
] }),
|
|
15160
|
-
/* @__PURE__ */ (0,
|
|
15161
|
-
|
|
15162
|
-
|
|
15163
|
-
/* @__PURE__ */ (0,
|
|
15164
|
-
|
|
15165
|
-
|
|
15166
|
-
|
|
15167
|
-
|
|
15592
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "dsh-partner-capabilities", children: [
|
|
15593
|
+
group.choices.map((choice) => {
|
|
15594
|
+
const active2 = form.capabilities.includes(choice.id);
|
|
15595
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("button", { type: "button", disabled: saving, className: active2 ? "is-active" : "", "aria-pressed": active2, onClick: () => toggle(choice.id), children: [
|
|
15596
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { children: active2 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_dsh_client_ui_primitives20.IconCheckOutline14, { size: 14 }) }),
|
|
15597
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("strong", { children: choice.title }),
|
|
15598
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("small", { children: choice.detail })
|
|
15599
|
+
] });
|
|
15600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "dsh-partner-capability-card", children: [
|
|
15601
|
+
control,
|
|
15602
|
+
(choice.id === "skills" || choice.id === "mcp") && manage(choice.id)
|
|
15603
|
+
] }, choice.id);
|
|
15604
|
+
}),
|
|
15605
|
+
group.id === "coordination" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "dsh-partner-capability-card is-access", children: [
|
|
15606
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "dsh-partner-capability-card-copy", children: [
|
|
15607
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("strong", { children: "\u53EF\u8BBF\u95EE\u4F19\u4F34" }),
|
|
15608
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("small", { children: "\u9009\u62E9\u80FD\u4E86\u89E3\u5176\u80FD\u529B\u5E76\u59D4\u6D3E\u4EFB\u52A1\u7684\u4F19\u4F34\u3002" })
|
|
15609
|
+
] }),
|
|
15610
|
+
manage("access")
|
|
15611
|
+
] })
|
|
15612
|
+
] })
|
|
15168
15613
|
] }, group.id);
|
|
15169
|
-
}) }),
|
|
15170
|
-
form.capabilities.includes("skills") && companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CompanionSkillSettings, { companionId: companion.id }),
|
|
15171
|
-
form.capabilities.includes("skills") && !companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "dsh-partner-inline-note", children: "\u5148\u5E94\u7528\u80FD\u529B\u7EC4\u5408\uFF0C\u518D\u4E3A\u5F53\u524D\u4F19\u4F34\u9009\u62E9\u5177\u4F53 Skill\u3002" }),
|
|
15172
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CompanionAccessPanel, { companionId: companion.id }),
|
|
15173
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
|
|
15174
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "dsh-partner-form-actions is-capability-save", children: [
|
|
15175
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { role: "status", "aria-live": "polite", "aria-atomic": "true", children: saved && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
15176
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_dsh_client_ui_primitives18.IconCheckOutline14, { size: 14 }),
|
|
15177
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u751F\u6548" })
|
|
15178
|
-
] }) }),
|
|
15179
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("button", { type: "button", disabled: saving, "aria-busy": saving, onClick: () => {
|
|
15180
|
-
void save();
|
|
15181
|
-
}, children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u5E94\u7528\u80FD\u529B\u7EC4\u5408" })
|
|
15182
|
-
] })
|
|
15614
|
+
}) }) }, companion.id)
|
|
15183
15615
|
] });
|
|
15184
15616
|
}
|
|
15185
15617
|
|
|
15186
15618
|
// src/ui/identity-editor.tsx
|
|
15187
|
-
var
|
|
15188
|
-
var
|
|
15189
|
-
var
|
|
15619
|
+
var import_react43 = require("react");
|
|
15620
|
+
var import_dsh_client_ui_primitives21 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
15621
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
15190
15622
|
function IdentityEditor(props) {
|
|
15191
|
-
return /* @__PURE__ */ (0,
|
|
15623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(IdentityEditorForm, { ...props }, props.companion.id);
|
|
15192
15624
|
}
|
|
15193
15625
|
function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
|
|
15194
|
-
const [form, setForm] = (0,
|
|
15195
|
-
const [operation, setOperation] = (0,
|
|
15196
|
-
const [saved, setSaved] = (0,
|
|
15197
|
-
const [removed, setRemoved] = (0,
|
|
15198
|
-
const [error, setError] = (0,
|
|
15199
|
-
const [confirmationId, setConfirmationId] = (0,
|
|
15200
|
-
const locked = (0,
|
|
15201
|
-
const alive = (0,
|
|
15202
|
-
(0,
|
|
15626
|
+
const [form, setForm] = (0, import_react43.useState)(() => companionDraft(companion));
|
|
15627
|
+
const [operation, setOperation] = (0, import_react43.useState)();
|
|
15628
|
+
const [saved, setSaved] = (0, import_react43.useState)(false);
|
|
15629
|
+
const [removed, setRemoved] = (0, import_react43.useState)(false);
|
|
15630
|
+
const [error, setError] = (0, import_react43.useState)();
|
|
15631
|
+
const [confirmationId, setConfirmationId] = (0, import_react43.useState)();
|
|
15632
|
+
const locked = (0, import_react43.useRef)(false);
|
|
15633
|
+
const alive = (0, import_react43.useRef)(true);
|
|
15634
|
+
(0, import_react43.useEffect)(() => {
|
|
15203
15635
|
alive.current = true;
|
|
15204
15636
|
return () => {
|
|
15205
15637
|
alive.current = false;
|
|
15206
15638
|
};
|
|
15207
15639
|
}, []);
|
|
15208
|
-
(0,
|
|
15640
|
+
(0, import_react43.useEffect)(() => {
|
|
15209
15641
|
setForm(companionDraft(companion));
|
|
15210
15642
|
setSaved(false);
|
|
15211
15643
|
setConfirmationId(void 0);
|
|
@@ -15252,35 +15684,35 @@ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
|
|
|
15252
15684
|
if (alive.current) setOperation(void 0);
|
|
15253
15685
|
}
|
|
15254
15686
|
};
|
|
15255
|
-
return /* @__PURE__ */ (0,
|
|
15687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("form", { id: "dsh-partner-identity-editor", className: "dsh-partner-form is-identity", "aria-busy": operation !== void 0, onSubmit: (event) => {
|
|
15256
15688
|
void submit(event);
|
|
15257
15689
|
}, children: [
|
|
15258
|
-
/* @__PURE__ */ (0,
|
|
15259
|
-
/* @__PURE__ */ (0,
|
|
15260
|
-
/* @__PURE__ */ (0,
|
|
15261
|
-
/* @__PURE__ */ (0,
|
|
15262
|
-
/* @__PURE__ */ (0,
|
|
15690
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SectionHeading, { eyebrow: "IDENTITY", title: "\u5DE5\u4F5C\u8EAB\u4EFD", detail: "\u5B83\u4E0D\u662F\u4E00\u6B21\u5BF9\u8BDD\u7684\u63D0\u793A\u8BCD\uFF0C\u800C\u662F\u8FD9\u4E2A\u4F19\u4F34\u5728\u684C\u9762\u548C\u5FAE\u4FE1\u4E2D\u7684\u957F\u671F\u884C\u4E3A\u57FA\u7EBF\u3002" }),
|
|
15691
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("section", { className: "dsh-partner-identity-card", "aria-label": "\u8EAB\u4EFD\u914D\u7F6E", children: [
|
|
15692
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "dsh-partner-fields two", children: [
|
|
15693
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormField, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("input", { disabled: busy, required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
|
|
15694
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormField, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("input", { disabled: busy, required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
|
|
15263
15695
|
] }),
|
|
15264
|
-
/* @__PURE__ */ (0,
|
|
15265
|
-
/* @__PURE__ */ (0,
|
|
15266
|
-
error && /* @__PURE__ */ (0,
|
|
15267
|
-
/* @__PURE__ */ (0,
|
|
15268
|
-
/* @__PURE__ */ (0,
|
|
15269
|
-
/* @__PURE__ */ (0,
|
|
15696
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormField, { label: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D", hint: "\u7528\u4E8E\u540D\u518C\u8BC6\u522B\uFF0C\u4E0D\u4F1A\u66FF\u4EE3\u5B8C\u6574\u884C\u4E3A\u51C6\u5219\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("textarea", { disabled: busy, rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
|
|
15697
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FormField, { label: "\u957F\u671F\u884C\u4E3A\u51C6\u5219", hint: "\u5EFA\u8BAE\u5199\u804C\u8D23\u3001\u8868\u8FBE\u65B9\u5F0F\u4E0E\u8FB9\u754C\uFF1B\u6E20\u9053\u3001\u5DE5\u5177\u548C\u6388\u6743\u7531\u7CFB\u7EDF\u5355\u72EC\u63A7\u5236\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("textarea", { disabled: busy, rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
|
|
15698
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
|
|
15699
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "dsh-partner-form-actions", children: [
|
|
15700
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { role: "status", children: saved && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
15701
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_dsh_client_ui_primitives21.IconCheckOutline14, { size: 14 }),
|
|
15270
15702
|
"\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u5C06\u4F7F\u7528\u65B0\u8EAB\u4EFD"
|
|
15271
15703
|
] }) }),
|
|
15272
|
-
/* @__PURE__ */ (0,
|
|
15704
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { disabled: busy, children: operation === "save" ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
|
|
15273
15705
|
] })
|
|
15274
15706
|
] }),
|
|
15275
|
-
/* @__PURE__ */ (0,
|
|
15276
|
-
/* @__PURE__ */ (0,
|
|
15277
|
-
/* @__PURE__ */ (0,
|
|
15278
|
-
/* @__PURE__ */ (0,
|
|
15707
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "dsh-partner-identity-danger", "data-confirming": confirming, children: [
|
|
15708
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { children: [
|
|
15709
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("strong", { children: removed ? "\u4F19\u4F34\u5DF2\u5220\u9664" : confirming ? `\u786E\u8BA4\u5220\u9664\u300C${companion.name}\u300D\uFF1F` : "\u5220\u9664\u4F19\u4F34" }),
|
|
15710
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("small", { children: confirming ? "\u5C06\u5220\u9664\u8BE5\u4F19\u4F34\u7684\u914D\u7F6E\u3001\u8BB0\u5FC6\u3001\u6302\u5FF5\u3001\u4E13\u5C5E\u76EE\u5F55\u53CA\u5176\u4E2D\u5168\u90E8\u6587\u4EF6\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002\u5171\u4EAB\u6216\u5F02\u5E38\u76EE\u5F55\u4F1A\u62E6\u622A\uFF1BDSH \u539F\u4F1A\u8BDD\u65E5\u5FD7\u4ECD\u7531\u5BBF\u4E3B\u7BA1\u7406\uFF0C\u4E0D\u5728\u6B64\u6B21\u6E05\u7406\u8303\u56F4\u5185\u3002" : "\u5FC5\u987B\u5148\u89E3\u7ED1\u5FAE\u4FE1\u5E76\u7ED3\u675F\u8FD0\u884C\u4E2D\u7684\u4EFB\u52A1\u3002\u5220\u9664\u53EA\u9488\u5BF9\u672C\u6B21\u786E\u8BA4\u7684\u4F19\u4F34\uFF0C\u4E0D\u4F1A\u8F6C\u4EA4\u8054\u7CFB\u4EBA\u3002" })
|
|
15279
15711
|
] }),
|
|
15280
|
-
/* @__PURE__ */ (0,
|
|
15281
|
-
confirming && /* @__PURE__ */ (0,
|
|
15282
|
-
/* @__PURE__ */ (0,
|
|
15283
|
-
/* @__PURE__ */ (0,
|
|
15712
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { children: [
|
|
15713
|
+
confirming && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { type: "button", disabled: busy, className: "is-secondary", onClick: () => setConfirmationId(void 0), children: "\u53D6\u6D88" }),
|
|
15714
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("button", { type: "button", className: confirming ? "is-danger" : "", disabled: busy || count <= 1, onClick: () => confirming ? void remove() : setConfirmationId(companion.id), children: [
|
|
15715
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_dsh_client_ui_primitives21.IconTrashOutline16, { size: 16 }),
|
|
15284
15716
|
operation === "remove" ? "\u6B63\u5728\u5220\u9664\u2026" : removed ? "\u5DF2\u5220\u9664" : confirming ? "\u786E\u8BA4\u5220\u9664" : "\u5220\u9664"
|
|
15285
15717
|
] })
|
|
15286
15718
|
] })
|
|
@@ -15289,25 +15721,25 @@ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
|
|
|
15289
15721
|
}
|
|
15290
15722
|
|
|
15291
15723
|
// src/ui/channels-panel.tsx
|
|
15292
|
-
var
|
|
15724
|
+
var import_react45 = require("react");
|
|
15293
15725
|
|
|
15294
15726
|
// src/ui/notification-settings.tsx
|
|
15295
|
-
var
|
|
15296
|
-
var
|
|
15727
|
+
var import_react44 = require("react");
|
|
15728
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
15297
15729
|
function NotificationSettings({ companion, snapshot, onChanged }) {
|
|
15298
15730
|
const channels = snapshot.channels.filter((c) => c.companionId === companion.id);
|
|
15299
15731
|
const pairings = snapshot.pairings.filter((p) => channels.some((c) => c.id === p.channelId));
|
|
15300
|
-
const [mode, setMode] = (0,
|
|
15301
|
-
const [targets, setTargets] = (0,
|
|
15302
|
-
const [selectedChannels, setSelectedChannels] = (0,
|
|
15303
|
-
const [busy, setBusy] = (0,
|
|
15304
|
-
const saveRef = (0,
|
|
15305
|
-
(0,
|
|
15732
|
+
const [mode, setMode] = (0, import_react44.useState)(companion.notificationDelivery?.mode ?? "recent");
|
|
15733
|
+
const [targets, setTargets] = (0, import_react44.useState)(companion.notificationDelivery?.targets ?? []);
|
|
15734
|
+
const [selectedChannels, setSelectedChannels] = (0, import_react44.useState)(targets.map((t) => t.channelId));
|
|
15735
|
+
const [busy, setBusy] = (0, import_react44.useState)(false), [feedback, setFeedback] = (0, import_react44.useState)(""), [failed, setFailed] = (0, import_react44.useState)(false);
|
|
15736
|
+
const saveRef = (0, import_react44.useRef)(null);
|
|
15737
|
+
(0, import_react44.useEffect)(() => {
|
|
15306
15738
|
if (!busy && feedback && document.activeElement === document.body) saveRef.current?.focus();
|
|
15307
15739
|
}, [busy, feedback]);
|
|
15308
15740
|
const unavailable = targets.filter((t) => !pairings.some((p) => p.channelId === t.channelId && p.userId === t.userId && p.status === "approved") || !channels.some((c) => c.id === t.channelId && c.enabled));
|
|
15309
15741
|
const emptyChannel = selectedChannels.some((id) => !targets.some((t) => t.channelId === id));
|
|
15310
|
-
return /* @__PURE__ */ (0,
|
|
15742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-channel-form dsh-partner-delivery-form", "aria-busy": busy, onSubmit: (e) => {
|
|
15311
15743
|
e.preventDefault();
|
|
15312
15744
|
if (busy) return;
|
|
15313
15745
|
setBusy(true);
|
|
@@ -15322,41 +15754,41 @@ function NotificationSettings({ companion, snapshot, onChanged }) {
|
|
|
15322
15754
|
setFeedback(errorMessage(error));
|
|
15323
15755
|
}).finally(() => setBusy(false));
|
|
15324
15756
|
}, children: [
|
|
15325
|
-
/* @__PURE__ */ (0,
|
|
15326
|
-
/* @__PURE__ */ (0,
|
|
15327
|
-
/* @__PURE__ */ (0,
|
|
15328
|
-
/* @__PURE__ */ (0,
|
|
15329
|
-
/* @__PURE__ */ (0,
|
|
15757
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { className: "dsh-partner-channel-field", children: [
|
|
15758
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: "\u901A\u77E5\u53D1\u9001\u5230" }),
|
|
15759
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("select", { disabled: busy, value: mode, onChange: (e) => setMode(e.target.value), children: [
|
|
15760
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("option", { value: "recent", children: "\u6700\u8FD1\u8054\u7CFB\u7684\u6E20\u9053\u4E0E\u7528\u6237" }),
|
|
15761
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("option", { value: "selected", children: "\u6307\u5B9A\u6E20\u9053\u4E0E\u63A5\u6536\u4EBA" })
|
|
15330
15762
|
] })
|
|
15331
15763
|
] }),
|
|
15332
|
-
/* @__PURE__ */ (0,
|
|
15333
|
-
!companion.notificationDelivery && pairings.some((p) => p.deliveryTarget) && /* @__PURE__ */ (0,
|
|
15334
|
-
mode === "selected" && /* @__PURE__ */ (0,
|
|
15335
|
-
/* @__PURE__ */ (0,
|
|
15336
|
-
!channels.length && /* @__PURE__ */ (0,
|
|
15337
|
-
channels.map((channel) => /* @__PURE__ */ (0,
|
|
15338
|
-
/* @__PURE__ */ (0,
|
|
15339
|
-
/* @__PURE__ */ (0,
|
|
15764
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: "\u4EC5\u5F71\u54CD\u4E3B\u52A8\u901A\u77E5\u4E0E\u7ED3\u679C\u4EA4\u4ED8\u3002\u5BF9\u8BDD\u56DE\u590D\u4ECD\u53D1\u9001\u5230\u6D88\u606F\u6765\u6E90\u6E20\u9053\u3002" }),
|
|
15765
|
+
!companion.notificationDelivery && pairings.some((p) => p.deliveryTarget) && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { role: "status", children: "\u5F53\u524D\u4ECD\u4F7F\u7528\u65E7\u7684\u8054\u7CFB\u4EBA\u6295\u9012\u89C4\u5219\uFF0C\u4FDD\u5B58\u540E\u7EDF\u4E00\u4F7F\u7528\u8FD9\u91CC\u7684\u901A\u77E5\u8BBE\u7F6E\u3002" }),
|
|
15766
|
+
mode === "selected" && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-notification-choices", children: [
|
|
15767
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: "\u53EF\u9009\u62E9\u591A\u4E2A\u6E20\u9053\uFF1B\u6BCF\u4E2A\u6E20\u9053\u81F3\u5C11\u9009\u62E9\u4E00\u4F4D\u5DF2\u6388\u6743\u63A5\u6536\u4EBA\u3002\u4FDD\u5B58\u540E\u5BF9\u65B0\u901A\u77E5\u751F\u6548\uFF0C\u5F85\u91CD\u8BD5\u901A\u77E5\u4FDD\u7559\u539F\u63A5\u6536\u4EBA\u3002" }),
|
|
15768
|
+
!channels.length && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: "\u8BF7\u5148\u6DFB\u52A0\u6E20\u9053\u5E76\u6388\u6743\u8054\u7CFB\u4EBA\u3002" }),
|
|
15769
|
+
channels.map((channel) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("fieldset", { disabled: busy, className: "dsh-partner-notification-channel", children: [
|
|
15770
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("legend", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { children: [
|
|
15771
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("input", { type: "checkbox", checked: selectedChannels.includes(channel.id), onChange: (e) => {
|
|
15340
15772
|
setSelectedChannels((ids) => e.target.checked ? [...ids, channel.id] : ids.filter((id) => id !== channel.id));
|
|
15341
15773
|
if (!e.target.checked) setTargets((items) => items.filter((t) => t.channelId !== channel.id));
|
|
15342
15774
|
} }),
|
|
15343
15775
|
channel.name,
|
|
15344
15776
|
!channel.enabled ? "\uFF08\u5DF2\u505C\u7528\uFF09" : ""
|
|
15345
15777
|
] }) }),
|
|
15346
|
-
selectedChannels.includes(channel.id) && /* @__PURE__ */ (0,
|
|
15347
|
-
!pairings.some((p) => p.channelId === channel.id && p.status === "approved") && /* @__PURE__ */ (0,
|
|
15348
|
-
pairings.filter((p) => p.channelId === channel.id && p.status === "approved").map((p) => /* @__PURE__ */ (0,
|
|
15349
|
-
/* @__PURE__ */ (0,
|
|
15350
|
-
/* @__PURE__ */ (0,
|
|
15778
|
+
selectedChannels.includes(channel.id) && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-notification-users", children: [
|
|
15779
|
+
!pairings.some((p) => p.channelId === channel.id && p.status === "approved") && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: "\u6682\u65E0\u5DF2\u6388\u6743\u63A5\u6536\u4EBA\uFF0C\u8BF7\u5148\u5728\u6E20\u9053\u914D\u7F6E\u4E2D\u6279\u51C6\u8054\u7CFB\u4EBA\u3002" }),
|
|
15780
|
+
pairings.filter((p) => p.channelId === channel.id && p.status === "approved").map((p) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { children: [
|
|
15781
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("input", { type: "checkbox", checked: targets.some((t) => t.channelId === p.channelId && t.userId === p.userId), onChange: (e) => setTargets((items) => e.target.checked ? [...items, { channelId: p.channelId, userId: p.userId }] : items.filter((t) => t.channelId !== p.channelId || t.userId !== p.userId)) }),
|
|
15782
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { children: [
|
|
15351
15783
|
p.displayName,
|
|
15352
|
-
/* @__PURE__ */ (0,
|
|
15784
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("small", { children: p.userId })
|
|
15353
15785
|
] })
|
|
15354
15786
|
] }, p.id))
|
|
15355
15787
|
] })
|
|
15356
15788
|
] }, channel.id)),
|
|
15357
|
-
unavailable.length > 0 && /* @__PURE__ */ (0,
|
|
15358
|
-
/* @__PURE__ */ (0,
|
|
15359
|
-
unavailable.map((t) => /* @__PURE__ */ (0,
|
|
15789
|
+
unavailable.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { role: "alert", children: [
|
|
15790
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: "\u90E8\u5206\u5DF2\u9009\u63A5\u6536\u4EBA\u5DF2\u5931\u6548\u6216\u6E20\u9053\u5DF2\u505C\u7528\u3002\u8BF7\u79FB\u9664\u6216\u6062\u590D\u6388\u6743\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6539\u53D1\u5176\u4ED6\u4EBA\u3002" }),
|
|
15791
|
+
unavailable.map((t) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("button", { type: "button", disabled: busy, onClick: () => {
|
|
15360
15792
|
setTargets((items) => items.filter((x) => x.channelId !== t.channelId || x.userId !== t.userId));
|
|
15361
15793
|
if (!targets.some((x) => x.channelId === t.channelId && x.userId !== t.userId)) setSelectedChannels((ids) => ids.filter((id) => id !== t.channelId));
|
|
15362
15794
|
}, children: [
|
|
@@ -15365,27 +15797,27 @@ function NotificationSettings({ companion, snapshot, onChanged }) {
|
|
|
15365
15797
|
] }, JSON.stringify(t)))
|
|
15366
15798
|
] })
|
|
15367
15799
|
] }),
|
|
15368
|
-
feedback && /* @__PURE__ */ (0,
|
|
15369
|
-
/* @__PURE__ */ (0,
|
|
15800
|
+
feedback && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { role: failed ? "alert" : "status", children: feedback }),
|
|
15801
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("footer", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { ref: saveRef, className: "is-primary", disabled: busy || mode === "selected" && (!targets.length || unavailable.length > 0 || emptyChannel), children: busy ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58\u901A\u77E5\u8BBE\u7F6E" }) })
|
|
15370
15802
|
] });
|
|
15371
15803
|
}
|
|
15372
15804
|
|
|
15373
15805
|
// src/ui/channels-panel.tsx
|
|
15374
|
-
var
|
|
15806
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
15375
15807
|
function ChannelsPanel({ companion, snapshot, onChanged, weixin }) {
|
|
15376
|
-
const [platform, setPlatform] = (0,
|
|
15377
|
-
const [name, setName] = (0,
|
|
15378
|
-
const [baseUrl, setBaseUrl] = (0,
|
|
15379
|
-
const [targetId, setTargetId] = (0,
|
|
15380
|
-
const [botToken, setToken] = (0,
|
|
15381
|
-
const [authMode, setAuthMode] = (0,
|
|
15382
|
-
const [username, setUsername] = (0,
|
|
15383
|
-
const [busy, setBusy] = (0,
|
|
15384
|
-
const [feedback, setFeedback] = (0,
|
|
15385
|
-
const [deleting, setDeleting] = (0,
|
|
15386
|
-
const [adding, setAdding] = (0,
|
|
15387
|
-
const [fixedPlatform, setFixedPlatform] = (0,
|
|
15388
|
-
const [configuring, setConfiguring] = (0,
|
|
15808
|
+
const [platform, setPlatform] = (0, import_react45.useState)("matrix");
|
|
15809
|
+
const [name, setName] = (0, import_react45.useState)("");
|
|
15810
|
+
const [baseUrl, setBaseUrl] = (0, import_react45.useState)("");
|
|
15811
|
+
const [targetId, setTargetId] = (0, import_react45.useState)("");
|
|
15812
|
+
const [botToken, setToken] = (0, import_react45.useState)("");
|
|
15813
|
+
const [authMode, setAuthMode] = (0, import_react45.useState)("password");
|
|
15814
|
+
const [username, setUsername] = (0, import_react45.useState)(""), [password, setPassword] = (0, import_react45.useState)(""), [mfaToken, setMfaToken] = (0, import_react45.useState)("");
|
|
15815
|
+
const [busy, setBusy] = (0, import_react45.useState)(false);
|
|
15816
|
+
const [feedback, setFeedback] = (0, import_react45.useState)("");
|
|
15817
|
+
const [deleting, setDeleting] = (0, import_react45.useState)();
|
|
15818
|
+
const [adding, setAdding] = (0, import_react45.useState)(false);
|
|
15819
|
+
const [fixedPlatform, setFixedPlatform] = (0, import_react45.useState)(false);
|
|
15820
|
+
const [configuring, setConfiguring] = (0, import_react45.useState)();
|
|
15389
15821
|
const closeAdd = () => {
|
|
15390
15822
|
setAdding(false);
|
|
15391
15823
|
setToken("");
|
|
@@ -15429,19 +15861,19 @@ function ChannelsPanel({ companion, snapshot, onChanged, weixin }) {
|
|
|
15429
15861
|
}
|
|
15430
15862
|
setFeedback(save ? "\u8D26\u53F7\u5DF2\u4FDD\u5B58\u3002\u8BF7\u542F\u7528\u6E20\u9053\uFF0C\u518D\u5411\u673A\u5668\u4EBA\u53D1\u9001\u79C1\u804A\u6D88\u606F\uFF0C\u6838\u5BF9\u914D\u5BF9\u7801\u5E76\u6279\u51C6\u8054\u7CFB\u4EBA\u3002" : "\u8D26\u53F7\u9A8C\u8BC1\u901A\u8FC7\uFF0C\u53EF\u4EE5\u4FDD\u5B58\u3002");
|
|
15431
15863
|
});
|
|
15432
|
-
return /* @__PURE__ */ (0,
|
|
15433
|
-
/* @__PURE__ */ (0,
|
|
15434
|
-
/* @__PURE__ */ (0,
|
|
15435
|
-
/* @__PURE__ */ (0,
|
|
15864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { id: "dsh-partner-channels", className: "dsh-partner-form is-channel dsh-partner-channels", children: [
|
|
15865
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-toolbar", children: [
|
|
15866
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SectionHeading, { eyebrow: "CHANNELS", title: "\u6211\u7684\u6E20\u9053", detail: "\u67E5\u770B\u8FDE\u63A5\u72B6\u6001\uFF0C\u7BA1\u7406\u8054\u7CFB\u4EBA\u4E0E\u901A\u77E5\u6295\u9012\u3002" }),
|
|
15867
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", onClick: () => openAdd(), children: "\u6DFB\u52A0\u6E20\u9053" })
|
|
15436
15868
|
] }),
|
|
15437
|
-
!adding && feedback && /* @__PURE__ */ (0,
|
|
15438
|
-
adding && /* @__PURE__ */ (0,
|
|
15869
|
+
!adding && feedback && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { role: "status", children: feedback }),
|
|
15870
|
+
adding && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WorkspaceDialog, { title: fixedPlatform ? `${platform === "matrix" ? "Matrix" : "Mattermost"} \u914D\u7F6E` : "\u6DFB\u52A0\u6E20\u9053", detail: platform === "matrix" ? "\u4EC5\u672A\u52A0\u5BC6\u7684\u53CC\u4EBA\u4F1A\u8BDD\u53EF\u83B7\u53D6\u914D\u5BF9\u7801\u3002\u8BF7\u65B0\u5EFA\u672A\u5F00\u542F\u7AEF\u5230\u7AEF\u52A0\u5BC6\u7684\u4F1A\u8BDD\uFF0C\u9080\u8BF7\u673A\u5668\u4EBA\u540E\u53D1\u9001\u6587\u5B57\u6D88\u606F\u3002" : "\u5148\u767B\u5F55\uFF0C\u518D\u5411\u673A\u5668\u4EBA\u53D1\u79C1\u804A\u6D88\u606F\uFF0C\u6838\u5BF9\u914D\u5BF9\u7801\u540E\u6388\u6743\u3002", close: () => {
|
|
15439
15871
|
if (!busy) closeAdd();
|
|
15440
|
-
}, children: /* @__PURE__ */ (0,
|
|
15872
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-channel-form", "aria-busy": busy, onSubmit: (event) => {
|
|
15441
15873
|
event.preventDefault();
|
|
15442
15874
|
void configure2(true);
|
|
15443
15875
|
}, children: [
|
|
15444
|
-
!fixedPlatform && /* @__PURE__ */ (0,
|
|
15876
|
+
!fixedPlatform && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: "\u5E73\u53F0", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("select", { autoFocus: true, disabled: busy, value: platform, onChange: (e) => {
|
|
15445
15877
|
setPlatform(e.target.value);
|
|
15446
15878
|
setPassword("");
|
|
15447
15879
|
setToken("");
|
|
@@ -15449,150 +15881,150 @@ function ChannelsPanel({ companion, snapshot, onChanged, weixin }) {
|
|
|
15449
15881
|
setTargetId("");
|
|
15450
15882
|
setFeedback("");
|
|
15451
15883
|
}, children: [
|
|
15452
|
-
/* @__PURE__ */ (0,
|
|
15453
|
-
/* @__PURE__ */ (0,
|
|
15884
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: "matrix", children: "Matrix" }),
|
|
15885
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: "mattermost", children: "Mattermost" })
|
|
15454
15886
|
] }) }),
|
|
15455
|
-
/* @__PURE__ */ (0,
|
|
15456
|
-
/* @__PURE__ */ (0,
|
|
15457
|
-
/* @__PURE__ */ (0,
|
|
15458
|
-
/* @__PURE__ */ (0,
|
|
15459
|
-
/* @__PURE__ */ (0,
|
|
15887
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: "\u6E20\u9053\u540D\u79F0", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { autoFocus: fixedPlatform, disabled: busy, maxLength: 80, value: name, onChange: (e) => setName(e.target.value), placeholder: `\u4F8B\u5982\uFF1A\u6211\u7684 ${platform === "matrix" ? "Matrix" : "Mattermost"}` }) }),
|
|
15888
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: "\u670D\u52A1\u5668\u5730\u5740", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { disabled: busy, required: true, type: "url", value: baseUrl, onChange: (e) => setBaseUrl(e.target.value), placeholder: "https://chat.example.com" }) }),
|
|
15889
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("details", { children: [
|
|
15890
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("summary", { children: "\u9AD8\u7EA7\u914D\u7F6E\uFF08\u53EF\u9009\uFF09" }),
|
|
15891
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: platform === "matrix" ? "\u56FA\u5B9A\u623F\u95F4 ID" : "\u56FA\u5B9A DM \u4F1A\u8BDD ID", hint: "\u7559\u7A7A\u5219\u81EA\u52A8\u53D1\u73B0\u79C1\u804A\uFF0C\u901A\u8FC7\u914D\u5BF9\u6388\u6743\u3002\u586B\u5199\u540E\u4EC5\u76D1\u542C\u6307\u5B9A\u4F1A\u8BDD\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { disabled: busy, value: targetId, onChange: (e) => setTargetId(e.target.value), placeholder: platform === "matrix" ? "!room:example.com" : "DM channel ID" }) })
|
|
15460
15892
|
] }),
|
|
15461
|
-
/* @__PURE__ */ (0,
|
|
15893
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: "\u767B\u5F55\u65B9\u5F0F", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("select", { disabled: busy, value: authMode, onChange: (e) => {
|
|
15462
15894
|
setAuthMode(e.target.value);
|
|
15463
15895
|
setToken("");
|
|
15464
15896
|
setPassword("");
|
|
15465
15897
|
setMfaToken("");
|
|
15466
15898
|
}, children: [
|
|
15467
|
-
/* @__PURE__ */ (0,
|
|
15468
|
-
/* @__PURE__ */ (0,
|
|
15899
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: "password", children: "\u8D26\u53F7\u5BC6\u7801" }),
|
|
15900
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: "token", children: "Access Token" })
|
|
15469
15901
|
] }) }),
|
|
15470
|
-
authMode === "password" ? /* @__PURE__ */ (0,
|
|
15471
|
-
/* @__PURE__ */ (0,
|
|
15472
|
-
/* @__PURE__ */ (0,
|
|
15473
|
-
platform === "mattermost" && /* @__PURE__ */ (0,
|
|
15474
|
-
] }) : /* @__PURE__ */ (0,
|
|
15475
|
-
feedback && /* @__PURE__ */ (0,
|
|
15476
|
-
/* @__PURE__ */ (0,
|
|
15477
|
-
/* @__PURE__ */ (0,
|
|
15478
|
-
/* @__PURE__ */ (0,
|
|
15479
|
-
/* @__PURE__ */ (0,
|
|
15902
|
+
authMode === "password" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
15903
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: "\u8D26\u53F7", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { disabled: busy, required: true, autoComplete: "username", value: username, onChange: (e) => setUsername(e.target.value), placeholder: platform === "matrix" ? "@\u8D26\u53F7:\u670D\u52A1\u5668\u57DF\u540D" : "\u7528\u6237\u540D\u6216\u90AE\u7BB1" }) }),
|
|
15904
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: "\u5BC6\u7801", hint: "\u4EC5\u7528\u4E8E\u6362\u53D6\u4EE4\u724C\uFF0C\u4E0D\u4FDD\u5B58\u5BC6\u7801\uFF1B\u8BF7\u4F18\u5148\u4F7F\u7528 HTTPS \u670D\u52A1\u5668\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { disabled: busy, required: true, type: "password", autoComplete: "current-password", value: password, onChange: (e) => setPassword(e.target.value) }) }),
|
|
15905
|
+
platform === "mattermost" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: "\u53CC\u91CD\u9A8C\u8BC1\u9A8C\u8BC1\u7801\uFF08\u5982\u5DF2\u5F00\u542F\uFF09", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { disabled: busy, autoComplete: "one-time-code", inputMode: "numeric", value: mfaToken, onChange: (e) => setMfaToken(e.target.value) }) })
|
|
15906
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FormField2, { label: "Access Token", hint: "\u4EC5\u4FDD\u5B58\u81F3 DSH \u51ED\u636E\u5E93\uFF1B\u5EFA\u8BAE HTTPS\uFF0CHTTP \u4F1A\u660E\u6587\u4F20\u8F93\u51ED\u636E\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { disabled: busy, required: true, type: "password", autoComplete: "new-password", value: botToken, onChange: (e) => setToken(e.target.value) }) }),
|
|
15907
|
+
feedback && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { role: "status", children: feedback }),
|
|
15908
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("footer", { children: [
|
|
15909
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", disabled: busy, onClick: closeAdd, children: "\u53D6\u6D88" }),
|
|
15910
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", disabled: busy || !(authMode === "password" ? username && password : botToken) || !baseUrl, onClick: () => void configure2(false), children: "\u6D4B\u8BD5\u8FDE\u63A5" }),
|
|
15911
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { className: "is-primary", disabled: busy, children: busy ? "\u5904\u7406\u4E2D\u2026" : "\u4FDD\u5B58\u6E20\u9053" })
|
|
15480
15912
|
] })
|
|
15481
15913
|
] }) }),
|
|
15482
|
-
/* @__PURE__ */ (0,
|
|
15483
|
-
/* @__PURE__ */ (0,
|
|
15484
|
-
/* @__PURE__ */ (0,
|
|
15485
|
-
/* @__PURE__ */ (0,
|
|
15486
|
-
/* @__PURE__ */ (0,
|
|
15914
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-list", children: [
|
|
15915
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-row", children: [
|
|
15916
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
|
|
15917
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: "\u5FAE\u4FE1" }),
|
|
15918
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: channels.some((c) => !c.platform || c.platform === "weixin") ? "\u7BA1\u7406\u8FDE\u63A5\u4E0E\u79C1\u804A\u6388\u6743" : "\u5C1A\u672A\u8FDE\u63A5 \xB7 \u626B\u7801\u63A5\u5165" })
|
|
15487
15919
|
] }),
|
|
15488
|
-
channels.find((c) => !c.platform || c.platform === "weixin") && /* @__PURE__ */ (0,
|
|
15489
|
-
/* @__PURE__ */ (0,
|
|
15490
|
-
configuring === "weixin" && /* @__PURE__ */ (0,
|
|
15920
|
+
channels.find((c) => !c.platform || c.platform === "weixin") && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ChannelStatus, { channel: channels.find((c) => !c.platform || c.platform === "weixin") }),
|
|
15921
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", "aria-label": "\u914D\u7F6E\u5FAE\u4FE1", onClick: () => setConfiguring("weixin"), children: "\u914D\u7F6E" }),
|
|
15922
|
+
configuring === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WorkspaceDialog, { title: "\u5FAE\u4FE1\u914D\u7F6E", detail: "\u7BA1\u7406\u626B\u7801\u767B\u5F55\u3001\u8FDE\u63A5\u4E0E\u8054\u7CFB\u4EBA\u6388\u6743\u3002", close: () => setConfiguring(void 0), children: weixin })
|
|
15491
15923
|
] }),
|
|
15492
|
-
["matrix", "mattermost"].filter((platform2) => !channels.some((c) => c.platform === platform2)).map((platform2) => /* @__PURE__ */ (0,
|
|
15493
|
-
/* @__PURE__ */ (0,
|
|
15494
|
-
/* @__PURE__ */ (0,
|
|
15495
|
-
/* @__PURE__ */ (0,
|
|
15924
|
+
["matrix", "mattermost"].filter((platform2) => !channels.some((c) => c.platform === platform2)).map((platform2) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-row", children: [
|
|
15925
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
|
|
15926
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: platform2 === "matrix" ? "Matrix" : "Mattermost" }),
|
|
15927
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "\u5C1A\u672A\u8FDE\u63A5" })
|
|
15496
15928
|
] }),
|
|
15497
|
-
/* @__PURE__ */ (0,
|
|
15929
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", "aria-label": `\u914D\u7F6E ${platform2}`, onClick: () => openAdd(platform2), children: "\u914D\u7F6E" })
|
|
15498
15930
|
] }, platform2)),
|
|
15499
|
-
channels.filter((c) => c.platform && c.platform !== "weixin").map((channel) => /* @__PURE__ */ (0,
|
|
15500
|
-
/* @__PURE__ */ (0,
|
|
15501
|
-
/* @__PURE__ */ (0,
|
|
15502
|
-
/* @__PURE__ */ (0,
|
|
15931
|
+
channels.filter((c) => c.platform && c.platform !== "weixin").map((channel) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-row has-notice-slot", children: [
|
|
15932
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
|
|
15933
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: channel.name }),
|
|
15934
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("small", { children: [
|
|
15503
15935
|
channel.platform,
|
|
15504
15936
|
" \xB7 ",
|
|
15505
15937
|
pairings.filter((p) => p.channelId === channel.id && p.status === "pending").length,
|
|
15506
15938
|
" \u4E2A\u5F85\u6388\u6743"
|
|
15507
15939
|
] })
|
|
15508
15940
|
] }),
|
|
15509
|
-
/* @__PURE__ */ (0,
|
|
15510
|
-
/* @__PURE__ */ (0,
|
|
15941
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ChannelStatus, { channel }),
|
|
15942
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", "aria-label": `\u914D\u7F6E ${channel.name}`, onClick: () => {
|
|
15511
15943
|
setFeedback("");
|
|
15512
15944
|
setConfiguring(channel.id);
|
|
15513
15945
|
}, children: "\u914D\u7F6E" }),
|
|
15514
|
-
configuring === channel.id && /* @__PURE__ */ (0,
|
|
15946
|
+
configuring === channel.id && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WorkspaceDialog, { title: `${channel.name} \xB7 \u914D\u7F6E`, detail: "\u7BA1\u7406\u8FDE\u63A5\u72B6\u6001\u53CA\u8054\u7CFB\u4EBA\u8BBF\u95EE\u6743\u9650\u3002", close: () => {
|
|
15515
15947
|
if (!busy) {
|
|
15516
15948
|
setConfiguring(void 0);
|
|
15517
15949
|
setDeleting(void 0);
|
|
15518
15950
|
}
|
|
15519
|
-
}, children: /* @__PURE__ */ (0,
|
|
15520
|
-
/* @__PURE__ */ (0,
|
|
15521
|
-
/* @__PURE__ */ (0,
|
|
15522
|
-
/* @__PURE__ */ (0,
|
|
15523
|
-
/* @__PURE__ */ (0,
|
|
15524
|
-
channel.direct?.targetId && /* @__PURE__ */ (0,
|
|
15951
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-detail dsh-partner-channel-manage", children: [
|
|
15952
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-connection", children: [
|
|
15953
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
|
|
15954
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: "\u767B\u5F55\u8D26\u53F7" }),
|
|
15955
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: channel.accountId }),
|
|
15956
|
+
channel.direct?.targetId && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: channel.direct.targetId })
|
|
15525
15957
|
] }),
|
|
15526
|
-
/* @__PURE__ */ (0,
|
|
15958
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ChannelStatus, { channel })
|
|
15527
15959
|
] }),
|
|
15528
|
-
channel.platform === "matrix" && /* @__PURE__ */ (0,
|
|
15529
|
-
!channel.direct?.targetId && /* @__PURE__ */ (0,
|
|
15530
|
-
channel.lastError && /* @__PURE__ */ (0,
|
|
15531
|
-
/* @__PURE__ */ (0,
|
|
15532
|
-
/* @__PURE__ */ (0,
|
|
15960
|
+
channel.platform === "matrix" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: "\u4EC5\u652F\u6301\u672A\u52A0\u5BC6\u7684\u53CC\u4EBA\u4F1A\u8BDD\u3002\u52A0\u5BC6\u4F1A\u8BDD\u65E0\u6CD5\u8BFB\u53D6\u6D88\u606F\u6216\u53D1\u9001\u914D\u5BF9\u7801\uFF1B\u8BF7\u65B0\u5EFA\u672A\u5F00\u542F\u7AEF\u5230\u7AEF\u52A0\u5BC6\u7684\u4F1A\u8BDD\uFF0C\u9080\u8BF7\u673A\u5668\u4EBA\u540E\u53D1\u9001\u6587\u5B57\u6D88\u606F\u3002\u68C0\u6D4B\u5230\u52A0\u5BC6\u4F1A\u8BDD\u65F6\u4F1A\u5728\u6B64\u63D0\u793A\uFF0C\u4E0D\u5F71\u54CD\u5176\u4ED6\u672A\u52A0\u5BC6\u4F1A\u8BDD\u3002" }),
|
|
15961
|
+
!channel.direct?.targetId && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: "\u5411\u673A\u5668\u4EBA\u53D1\u79C1\u804A\u6D88\u606F\uFF0C\u5728\u4E0B\u65B9\u6838\u5BF9\u914D\u5BF9\u7801\u540E\u6279\u51C6\u3002\u8BF7\u6C42\u4F1A\u81EA\u52A8\u66F4\u65B0\u3002" }),
|
|
15962
|
+
channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { role: "alert", children: channel.lastError }),
|
|
15963
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-form-actions", children: [
|
|
15964
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
|
|
15533
15965
|
await api(`/channels/${channel.id}/enabled`, { method: "POST", body: JSON.stringify({ enabled: !channel.enabled }) });
|
|
15534
15966
|
await onChanged();
|
|
15535
15967
|
}), children: channel.enabled ? "\u505C\u7528" : "\u542F\u7528" }),
|
|
15536
|
-
channel.enabled && channel.runtimeStatus === "error" && /* @__PURE__ */ (0,
|
|
15968
|
+
channel.enabled && channel.runtimeStatus === "error" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
|
|
15537
15969
|
await api(`/channels/${channel.id}/enabled`, { method: "POST", body: JSON.stringify({ enabled: true }) });
|
|
15538
15970
|
await onChanged();
|
|
15539
15971
|
}), children: "\u91CD\u8FDE" }),
|
|
15540
|
-
/* @__PURE__ */ (0,
|
|
15972
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { disabled: busy, onClick: () => deleting === channel.id ? void run(async () => {
|
|
15541
15973
|
await api(`/channels/${channel.id}`, { method: "DELETE" });
|
|
15542
15974
|
setDeleting(void 0);
|
|
15543
15975
|
await onChanged();
|
|
15544
15976
|
}) : setDeleting(channel.id), children: deleting === channel.id ? "\u786E\u8BA4\u5220\u9664\u914D\u7F6E\u4E0E\u51ED\u636E" : "\u5220\u9664\u6E20\u9053" }),
|
|
15545
|
-
deleting === channel.id && /* @__PURE__ */ (0,
|
|
15977
|
+
deleting === channel.id && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { onClick: () => setDeleting(void 0), children: "\u53D6\u6D88" })
|
|
15546
15978
|
] }),
|
|
15547
|
-
/* @__PURE__ */ (0,
|
|
15548
|
-
/* @__PURE__ */ (0,
|
|
15549
|
-
/* @__PURE__ */ (0,
|
|
15979
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("section", { className: "dsh-partner-channel-access", children: [
|
|
15980
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h3", { children: "\u8054\u7CFB\u4EBA\u6388\u6743" }),
|
|
15981
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("p", { role: "status", children: [
|
|
15550
15982
|
pairings.filter((p) => p.channelId === channel.id && p.status === "pending").length,
|
|
15551
15983
|
" \u4E2A\u7B49\u5F85\u6279\u51C6 \xB7 \u81EA\u52A8\u5237\u65B0"
|
|
15552
15984
|
] }),
|
|
15553
|
-
pairings.filter((p) => p.channelId === channel.id).map((p) => /* @__PURE__ */ (0,
|
|
15554
|
-
/* @__PURE__ */ (0,
|
|
15555
|
-
/* @__PURE__ */ (0,
|
|
15556
|
-
/* @__PURE__ */ (0,
|
|
15557
|
-
p.status === "pending" && p.pairingCode && /* @__PURE__ */ (0,
|
|
15985
|
+
pairings.filter((p) => p.channelId === channel.id).map((p) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-person", children: [
|
|
15986
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { children: [
|
|
15987
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: p.displayName }),
|
|
15988
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: p.status === "approved" ? "\u5DF2\u6388\u6743" : p.status === "pending" ? "\u7B49\u5F85\u6279\u51C6" : "\u5DF2\u963B\u6B62" }),
|
|
15989
|
+
p.status === "pending" && p.pairingCode && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
|
|
15558
15990
|
"\u914D\u5BF9\u7801 ",
|
|
15559
|
-
/* @__PURE__ */ (0,
|
|
15991
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("code", { children: p.pairingCode })
|
|
15560
15992
|
] })
|
|
15561
15993
|
] }),
|
|
15562
|
-
/* @__PURE__ */ (0,
|
|
15994
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
|
|
15563
15995
|
await api(`/pairings/${p.id}/status`, { method: "POST", body: JSON.stringify({ status: p.status === "approved" ? "blocked" : "approved" }) });
|
|
15564
15996
|
await onChanged();
|
|
15565
15997
|
}), children: p.status === "approved" ? "\u64A4\u9500\u6388\u6743" : "\u6279\u51C6\u8054\u7CFB\u4EBA" })
|
|
15566
15998
|
] }, p.id))
|
|
15567
15999
|
] }),
|
|
15568
|
-
feedback && /* @__PURE__ */ (0,
|
|
16000
|
+
feedback && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { role: "status", children: feedback })
|
|
15569
16001
|
] }) }),
|
|
15570
|
-
channel.lastError && /* @__PURE__ */ (0,
|
|
15571
|
-
/* @__PURE__ */ (0,
|
|
15572
|
-
/* @__PURE__ */ (0,
|
|
16002
|
+
channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-inline-notice", role: "status", "aria-atomic": "true", children: [
|
|
16003
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: channel.runtimeStatus === "running" ? "\u4F1A\u8BDD\u63D0\u793A" : "\u8FDE\u63A5\u63D0\u793A" }),
|
|
16004
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: channel.lastError })
|
|
15573
16005
|
] })
|
|
15574
16006
|
] }, channel.id))
|
|
15575
16007
|
] }),
|
|
15576
|
-
/* @__PURE__ */ (0,
|
|
15577
|
-
/* @__PURE__ */ (0,
|
|
15578
|
-
/* @__PURE__ */ (0,
|
|
15579
|
-
/* @__PURE__ */ (0,
|
|
16008
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("section", { className: "dsh-partner-channel-notifications", "aria-label": "\u901A\u77E5\u8BBE\u7F6E", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-channel-row", children: [
|
|
16009
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
|
|
16010
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("strong", { children: "\u901A\u77E5\u4E0E\u4EA4\u4ED8" }),
|
|
16011
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: companion.notificationDelivery?.mode === "selected" ? `\u5DF2\u6307\u5B9A ${companion.notificationDelivery.targets.length} \u4F4D\u63A5\u6536\u4EBA` : "\u9ED8\u8BA4\u8DDF\u968F\u6700\u8FD1\u6E20\u9053\u4E0E\u7528\u6237" })
|
|
15580
16012
|
] }),
|
|
15581
|
-
/* @__PURE__ */ (0,
|
|
16013
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", onClick: () => setConfiguring("delivery"), children: "\u914D\u7F6E" })
|
|
15582
16014
|
] }) }),
|
|
15583
|
-
configuring === "delivery" && /* @__PURE__ */ (0,
|
|
16015
|
+
configuring === "delivery" && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(WorkspaceDialog, { title: "\u901A\u77E5\u4E0E\u4EA4\u4ED8", detail: "\u9009\u62E9\u901A\u77E5\u6E20\u9053\uFF0C\u518D\u9009\u62E9\u5404\u6E20\u9053\u7684\u63A5\u6536\u4EBA\uFF1B\u652F\u6301\u540C\u65F6\u6295\u9012\u3002", close: () => setConfiguring(void 0), children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(NotificationSettings, { companion, snapshot, onChanged }) })
|
|
15584
16016
|
] });
|
|
15585
16017
|
}
|
|
15586
16018
|
function FormField2({ label, hint, children }) {
|
|
15587
|
-
return /* @__PURE__ */ (0,
|
|
15588
|
-
/* @__PURE__ */ (0,
|
|
16019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { className: "dsh-partner-channel-field", children: [
|
|
16020
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: label }),
|
|
15589
16021
|
children,
|
|
15590
|
-
hint && /* @__PURE__ */ (0,
|
|
16022
|
+
hint && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: hint })
|
|
15591
16023
|
] });
|
|
15592
16024
|
}
|
|
15593
16025
|
|
|
15594
16026
|
// src/ui/use-channel-status.ts
|
|
15595
|
-
var
|
|
16027
|
+
var import_react46 = require("react");
|
|
15596
16028
|
var listeners2 = /* @__PURE__ */ new Set();
|
|
15597
16029
|
var timer;
|
|
15598
16030
|
var active;
|
|
@@ -15617,7 +16049,7 @@ async function poll() {
|
|
|
15617
16049
|
}
|
|
15618
16050
|
}
|
|
15619
16051
|
function useChannelStatus(setSnapshot) {
|
|
15620
|
-
(0,
|
|
16052
|
+
(0, import_react46.useEffect)(() => {
|
|
15621
16053
|
const update = (value) => setSnapshot((previous3) => previous3 ? { ...previous3, ...value } : previous3);
|
|
15622
16054
|
listeners2.add(update);
|
|
15623
16055
|
lastValue = "";
|
|
@@ -15771,12 +16203,12 @@ var form_surface_default = `/* Deliberate, local boundary against host themes wi
|
|
|
15771
16203
|
`;
|
|
15772
16204
|
|
|
15773
16205
|
// src/ui/companion-create.tsx
|
|
15774
|
-
var
|
|
15775
|
-
var
|
|
15776
|
-
var
|
|
16206
|
+
var import_react47 = require("react");
|
|
16207
|
+
var import_dsh_client_ui_primitives22 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
16208
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
15777
16209
|
function CompanionCreateDialog({ close, create }) {
|
|
15778
|
-
const [busy, setBusy] = (0,
|
|
15779
|
-
const [error, setError] = (0,
|
|
16210
|
+
const [busy, setBusy] = (0, import_react47.useState)(false);
|
|
16211
|
+
const [error, setError] = (0, import_react47.useState)();
|
|
15780
16212
|
const submit = async (event) => {
|
|
15781
16213
|
event.preventDefault();
|
|
15782
16214
|
const data = new FormData(event.currentTarget);
|
|
@@ -15795,30 +16227,30 @@ function CompanionCreateDialog({ close, create }) {
|
|
|
15795
16227
|
setBusy(false);
|
|
15796
16228
|
}
|
|
15797
16229
|
};
|
|
15798
|
-
return /* @__PURE__ */ (0,
|
|
16230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u4F19\u4F34", detail: "\u5148\u5EFA\u7ACB\u6E05\u6670\u7684\u8EAB\u4EFD\u548C\u804C\u8D23\u3002\u6A21\u578B\u3001\u5DE5\u5177\u3001Skill \u4E0E\u534F\u4F5C\u6743\u9650\u4F1A\u5728\u521B\u5EFA\u540E\u5355\u72EC\u914D\u7F6E\u3002", close, width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-companion-create-form", "aria-busy": busy, onSubmit: (event) => {
|
|
15799
16231
|
void submit(event);
|
|
15800
16232
|
}, children: [
|
|
15801
|
-
/* @__PURE__ */ (0,
|
|
15802
|
-
/* @__PURE__ */ (0,
|
|
15803
|
-
/* @__PURE__ */ (0,
|
|
16233
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { children: [
|
|
16234
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: "\u4F19\u4F34\u540D\u5B57" }),
|
|
16235
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("input", { name: "name", required: true, maxLength: 60, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u5C0F\u9ED1" })
|
|
15804
16236
|
] }),
|
|
15805
|
-
/* @__PURE__ */ (0,
|
|
15806
|
-
/* @__PURE__ */ (0,
|
|
15807
|
-
/* @__PURE__ */ (0,
|
|
16237
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { children: [
|
|
16238
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: "\u4E3B\u8981\u89D2\u8272" }),
|
|
16239
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("input", { name: "role", required: true, maxLength: 120, placeholder: "\u4F8B\u5982\uFF1A\u4EA7\u54C1\u4E0E\u5DE5\u7A0B\u534F\u4F5C\u4F19\u4F34" })
|
|
15808
16240
|
] }),
|
|
15809
|
-
/* @__PURE__ */ (0,
|
|
15810
|
-
/* @__PURE__ */ (0,
|
|
15811
|
-
/* @__PURE__ */ (0,
|
|
16241
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { className: "is-wide", children: [
|
|
16242
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D" }),
|
|
16243
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("input", { name: "description", maxLength: 500, placeholder: "\u5B83\u4E3B\u8981\u8D1F\u8D23\u4EC0\u4E48\uFF0C\u4EC0\u4E48\u65F6\u5019\u5E94\u8BE5\u627E\u5B83" })
|
|
15812
16244
|
] }),
|
|
15813
|
-
/* @__PURE__ */ (0,
|
|
15814
|
-
/* @__PURE__ */ (0,
|
|
15815
|
-
/* @__PURE__ */ (0,
|
|
16245
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { className: "is-wide", children: [
|
|
16246
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: "\u521D\u59CB\u884C\u4E3A\u51C6\u5219" }),
|
|
16247
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("textarea", { name: "instructions", maxLength: 12e3, rows: 7, placeholder: "\u5199\u6E05\u804C\u8D23\u3001\u8868\u8FBE\u65B9\u5F0F\u3001\u5DE5\u4F5C\u8FB9\u754C\u548C\u4EA4\u4ED8\u6807\u51C6\uFF1B\u4E5F\u53EF\u4EE5\u521B\u5EFA\u540E\u518D\u5B8C\u5584" })
|
|
15816
16248
|
] }),
|
|
15817
|
-
error && /* @__PURE__ */ (0,
|
|
15818
|
-
/* @__PURE__ */ (0,
|
|
15819
|
-
/* @__PURE__ */ (0,
|
|
15820
|
-
/* @__PURE__ */ (0,
|
|
15821
|
-
/* @__PURE__ */ (0,
|
|
16249
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(WorkspaceNotice, { children: error }),
|
|
16250
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("footer", { children: [
|
|
16251
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
16252
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
|
|
16253
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_dsh_client_ui_primitives22.IconPlusOutline16, { size: 14 }),
|
|
15822
16254
|
busy ? "\u6B63\u5728\u521B\u5EFA\u2026" : "\u521B\u5EFA\u4F19\u4F34"
|
|
15823
16255
|
] })
|
|
15824
16256
|
] })
|
|
@@ -15826,7 +16258,7 @@ function CompanionCreateDialog({ close, create }) {
|
|
|
15826
16258
|
}
|
|
15827
16259
|
|
|
15828
16260
|
// src/main-panel-compat.ts
|
|
15829
|
-
var
|
|
16261
|
+
var import_react48 = require("react");
|
|
15830
16262
|
function registerMainPanel(ctx, id, priority, render, onHidden = () => {
|
|
15831
16263
|
}) {
|
|
15832
16264
|
const layout = ctx.layout;
|
|
@@ -15837,7 +16269,7 @@ function registerMainPanel(ctx, id, priority, render, onHidden = () => {
|
|
|
15837
16269
|
let disposed = false;
|
|
15838
16270
|
let generation = 0;
|
|
15839
16271
|
const Body = (props) => {
|
|
15840
|
-
(0,
|
|
16272
|
+
(0, import_react48.useEffect)(() => {
|
|
15841
16273
|
const current2 = ++generation;
|
|
15842
16274
|
return () => {
|
|
15843
16275
|
queueMicrotask(() => {
|
|
@@ -15944,10 +16376,10 @@ function sessions(ctx) {
|
|
|
15944
16376
|
}
|
|
15945
16377
|
|
|
15946
16378
|
// src/ui/workspace-navigation.tsx
|
|
15947
|
-
var
|
|
16379
|
+
var import_dsh_client_ui_primitives23 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
15948
16380
|
|
|
15949
16381
|
// src/ui/storage-settings.tsx
|
|
15950
|
-
var
|
|
16382
|
+
var import_react49 = require("react");
|
|
15951
16383
|
|
|
15952
16384
|
// src/ui/storage-recovery.ts
|
|
15953
16385
|
var StorageStatusError = class extends Error {
|
|
@@ -15995,16 +16427,16 @@ async function waitForStorage(signal, onWait, options = {}) {
|
|
|
15995
16427
|
}
|
|
15996
16428
|
|
|
15997
16429
|
// src/ui/storage-settings.tsx
|
|
15998
|
-
var
|
|
16430
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
15999
16431
|
function GeneralSettingsPanel() {
|
|
16000
|
-
const [version, setVersion] = (0,
|
|
16001
|
-
const [inspection, setInspection] = (0,
|
|
16002
|
-
const [busy, setBusy] = (0,
|
|
16003
|
-
const [error, setError] = (0,
|
|
16004
|
-
const request = (0,
|
|
16005
|
-
const mounted = (0,
|
|
16006
|
-
const [reconnect, setReconnect] = (0,
|
|
16007
|
-
const [cleanupPending, setCleanupPending] = (0,
|
|
16432
|
+
const [version, setVersion] = (0, import_react49.useState)();
|
|
16433
|
+
const [inspection, setInspection] = (0, import_react49.useState)();
|
|
16434
|
+
const [busy, setBusy] = (0, import_react49.useState)(false), [confirm, setConfirm] = (0, import_react49.useState)(false);
|
|
16435
|
+
const [error, setError] = (0, import_react49.useState)(""), [notice, setNotice] = (0, import_react49.useState)("");
|
|
16436
|
+
const request = (0, import_react49.useRef)();
|
|
16437
|
+
const mounted = (0, import_react49.useRef)(true);
|
|
16438
|
+
const [reconnect, setReconnect] = (0, import_react49.useState)(false);
|
|
16439
|
+
const [cleanupPending, setCleanupPending] = (0, import_react49.useState)(0);
|
|
16008
16440
|
const cleanup = version === 1 && cleanupPending > 0;
|
|
16009
16441
|
const recover = async (expected = pendingStorageRecovery()) => {
|
|
16010
16442
|
request.current?.abort();
|
|
@@ -16035,7 +16467,7 @@ function GeneralSettingsPanel() {
|
|
|
16035
16467
|
if (!controller.signal.aborted) setBusy(false);
|
|
16036
16468
|
}
|
|
16037
16469
|
};
|
|
16038
|
-
(0,
|
|
16470
|
+
(0, import_react49.useEffect)(() => {
|
|
16039
16471
|
mounted.current = true;
|
|
16040
16472
|
void recover();
|
|
16041
16473
|
return () => {
|
|
@@ -16072,16 +16504,16 @@ function GeneralSettingsPanel() {
|
|
|
16072
16504
|
}
|
|
16073
16505
|
if (mounted.current) await recover(expected);
|
|
16074
16506
|
};
|
|
16075
|
-
return /* @__PURE__ */ (0,
|
|
16076
|
-
/* @__PURE__ */ (0,
|
|
16077
|
-
/* @__PURE__ */ (0,
|
|
16078
|
-
/* @__PURE__ */ (0,
|
|
16507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("section", { className: "dsh-partner-general-settings", "aria-busy": busy, children: [
|
|
16508
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h2", { children: "\u57FA\u672C\u8BBE\u7F6E" }),
|
|
16509
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(WorkspaceBlock, { title: "\u5347\u7EA7\u8FC1\u79FB", detail: "\u624B\u52A8\u6574\u7406\u516C\u5171\u6570\u636E\u548C\u6BCF\u4F4D\u4F19\u4F34\u7684\u79C1\u6709\u76EE\u5F55\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6267\u884C\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", disabled: busy, onClick: () => void inspect(), children: busy ? "\u5904\u7406\u4E2D\u2026" : "\u68C0\u67E5\u8FC1\u79FB" }), children: [
|
|
16510
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { children: [
|
|
16079
16511
|
"\u6570\u636E\u5B58\u50A8\u7248\u672C\uFF1A",
|
|
16080
16512
|
version === void 0 ? "\u6B63\u5728\u8BFB\u53D6\u2026" : `v${version}${version === 0 ? " \xB7 \u5F85\u8FC1\u79FB" : " \xB7 \u5DF2\u5347\u7EA7"}`
|
|
16081
16513
|
] }),
|
|
16082
|
-
/* @__PURE__ */ (0,
|
|
16083
|
-
inspection && /* @__PURE__ */ (0,
|
|
16084
|
-
inspection.steps.map((step) => /* @__PURE__ */ (0,
|
|
16514
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { children: "\u5347\u7EA7\u524D\u8BF7\u7ED3\u675F\u4F19\u4F34\u4F1A\u8BDD\u548C\u540E\u53F0\u6267\u884C\u3002\u5B8C\u6574\u5907\u4EFD\u5E76\u6821\u9A8C\u540E\u624D\u6E05\u7406\u5DF2\u8FC1\u79FB\u7684\u65E7\u8DEF\u5F84\uFF0C\u4E0D\u4FEE\u6539\u7528\u6237\u5DE5\u4F5C\u6587\u6863\uFF1B\u670D\u52A1\u91CD\u8F7D\u540E\u81EA\u52A8\u91CD\u65B0\u8FDE\u63A5\u3002" }),
|
|
16515
|
+
inspection && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
16516
|
+
inspection.steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { children: [
|
|
16085
16517
|
"v",
|
|
16086
16518
|
step.from,
|
|
16087
16519
|
" \u2192 v",
|
|
@@ -16089,78 +16521,79 @@ function GeneralSettingsPanel() {
|
|
|
16089
16521
|
" \xB7 ",
|
|
16090
16522
|
step.title
|
|
16091
16523
|
] }, step.id)),
|
|
16092
|
-
/* @__PURE__ */ (0,
|
|
16093
|
-
/* @__PURE__ */ (0,
|
|
16094
|
-
/* @__PURE__ */ (0,
|
|
16095
|
-
/* @__PURE__ */ (0,
|
|
16096
|
-
/* @__PURE__ */ (0,
|
|
16097
|
-
/* @__PURE__ */ (0,
|
|
16098
|
-
/* @__PURE__ */ (0,
|
|
16099
|
-
/* @__PURE__ */ (0,
|
|
16524
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("details", { children: [
|
|
16525
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("summary", { children: "\u67E5\u770B\u76EE\u5F55\u4E0E\u68C0\u67E5\u8BE6\u60C5" }),
|
|
16526
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "dsh-partner-migration-paths", children: inspection.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { children: [
|
|
16527
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("strong", { children: item.label }),
|
|
16528
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("code", { children: item.source }),
|
|
16529
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: "\u8FC1\u79FB\u81F3" }),
|
|
16530
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("code", { children: item.target }),
|
|
16531
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("small", { children: item.exists ? `${item.files} \u4E2A\u6587\u4EF6 \xB7 ${(item.bytes / 1024 / 1024).toFixed(2)} MB` : "\u5F53\u524D\u65E0\u6587\u4EF6" })
|
|
16100
16532
|
] }, i)) }),
|
|
16101
|
-
inspection.notices.map((text4, i) => /* @__PURE__ */ (0,
|
|
16533
|
+
inspection.notices.map((text4, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { children: text4 }, i))
|
|
16102
16534
|
] }),
|
|
16103
|
-
!!inspection.blockers.length && /* @__PURE__ */ (0,
|
|
16104
|
-
/* @__PURE__ */ (0,
|
|
16105
|
-
/* @__PURE__ */ (0,
|
|
16535
|
+
!!inspection.blockers.length && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { role: "alert", children: [
|
|
16536
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { children: "\u4EE5\u4E0B\u95EE\u9898\u9700\u8981\u5148\u5904\u7406\uFF1A" }),
|
|
16537
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("ul", { children: inspection.blockers.map((text4, i) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("li", { children: text4 }, i)) })
|
|
16106
16538
|
] }),
|
|
16107
|
-
inspection.migrationAvailable && /* @__PURE__ */ (0,
|
|
16539
|
+
inspection.migrationAvailable && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => setConfirm(true), children: "\u5347\u7EA7\u8FC1\u79FB" })
|
|
16108
16540
|
] }),
|
|
16109
|
-
error && /* @__PURE__ */ (0,
|
|
16110
|
-
notice && /* @__PURE__ */ (0,
|
|
16111
|
-
reconnect && /* @__PURE__ */ (0,
|
|
16112
|
-
cleanup && /* @__PURE__ */ (0,
|
|
16541
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { role: "alert", children: error }),
|
|
16542
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { role: "status", children: notice }),
|
|
16543
|
+
reconnect && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", disabled: busy, onClick: () => void recover(), children: "\u91CD\u65B0\u8FDE\u63A5" }),
|
|
16544
|
+
cleanup && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(true), children: "\u91CD\u8BD5\u6E05\u7406\u65E7\u8DEF\u5F84" })
|
|
16113
16545
|
] }),
|
|
16114
|
-
confirm && /* @__PURE__ */ (0,
|
|
16546
|
+
confirm && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(WorkspaceDialog, { title: cleanup ? "\u786E\u8BA4\u6E05\u7406\u65E7\u8DEF\u5F84" : "\u786E\u8BA4\u5347\u7EA7\u8FC1\u79FB", detail: cleanup ? "\u91CD\u65B0\u6838\u5BF9\u5B8C\u6574\u5907\u4EFD\uFF0C\u53EA\u6E05\u7406\u672A\u53D8\u5316\u7684\u65E7\u6587\u4EF6\uFF0C\u4E0D\u91CD\u65B0\u8FC1\u79FB\u6D3B\u52A8\u6570\u636E\u3002" : "\u516C\u5171\u6570\u636E\u4E0E\u6240\u6709\u4F19\u4F34\u79C1\u6709\u6570\u636E\u5C06\u4E00\u8D77\u8FC1\u79FB\uFF0C\u5168\u90E8\u6821\u9A8C\u540E\u624D\u5207\u6362\u76EE\u5F55\u7248\u672C\u3002", close: () => {
|
|
16115
16547
|
if (!busy) setConfirm(false);
|
|
16116
|
-
}, children: /* @__PURE__ */ (0,
|
|
16548
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("form", { className: "dsh-partner-feature-form", onSubmit: (event) => {
|
|
16117
16549
|
event.preventDefault();
|
|
16118
16550
|
void migrate();
|
|
16119
16551
|
}, children: [
|
|
16120
|
-
/* @__PURE__ */ (0,
|
|
16121
|
-
/* @__PURE__ */ (0,
|
|
16122
|
-
/* @__PURE__ */ (0,
|
|
16123
|
-
/* @__PURE__ */ (0,
|
|
16124
|
-
/* @__PURE__ */ (0,
|
|
16552
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "is-wide", children: "\u5148\u5B8C\u6574\u5907\u4EFD\uFF0C\u7248\u672C\u63D0\u4EA4\u540E\u6E05\u7406\u5DF2\u6838\u9A8C\u7684\u65E7\u8DEF\u5F84\uFF1B\u5386\u53F2\u8BB0\u5FC6\u5907\u4EFD\u4F1A\u539F\u6837\u5F52\u6863\u3002\u5907\u4EFD\u4E0D\u4F1A\u81EA\u52A8\u5220\u9664\u3002\u8FC1\u79FB\u671F\u95F4\u8BF7\u52FF\u7F16\u8F91\u6587\u4EF6\u3001\u4FEE\u6539\u63D2\u4EF6\u914D\u7F6E\u6216\u542F\u52A8\u5176\u4ED6\u5B9E\u4F8B\u3002" }),
|
|
16553
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "is-wide", children: "\u8D26\u53F7\u51ED\u636E\u548C\u5BBF\u4E3B\u4F1A\u8BDD\u4E0D\u642C\u52A8\u3002\u5347\u7EA7\u540E\u4E0D\u8981\u76F4\u63A5\u5B89\u88C5\u4E0D\u652F\u6301\u65B0\u7248\u5B58\u50A8\u7684\u65E7\u63D2\u4EF6\u3002" }),
|
|
16554
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("footer", { children: [
|
|
16555
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(false), children: "\u53D6\u6D88" }),
|
|
16556
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u6B63\u5728\u5904\u7406\uFF0C\u8BF7\u52FF\u5173\u95ED\u2026" : cleanup ? "\u786E\u8BA4\u6E05\u7406\u5DF2\u5907\u4EFD\u7684\u65E7\u8DEF\u5F84" : "\u786E\u8BA4\u8FC1\u79FB\u76EE\u5F55\u548C\u6570\u636E" })
|
|
16125
16557
|
] })
|
|
16126
16558
|
] }) })
|
|
16127
16559
|
] });
|
|
16128
16560
|
}
|
|
16129
16561
|
|
|
16130
16562
|
// src/ui/workspace-navigation.tsx
|
|
16131
|
-
var
|
|
16563
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
16132
16564
|
var workspaceGroups = [
|
|
16133
|
-
{ id: "features", label: "\u529F\u80FD", detail: "\u80FD\u529B\u3001\u534F\u4F5C\u4E0E\u8BA1\u5212", icon:
|
|
16134
|
-
{ id: "skills", label: "Skill \u5E02\u573A", icon:
|
|
16135
|
-
{ id: "
|
|
16136
|
-
{ id: "
|
|
16565
|
+
{ id: "features", label: "\u529F\u80FD", detail: "\u80FD\u529B\u3001\u534F\u4F5C\u4E0E\u8BA1\u5212", icon: import_dsh_client_ui_primitives23.IconBrowseOutline16, pages: [
|
|
16566
|
+
{ id: "skills", label: "Skill \u5E02\u573A", icon: import_dsh_client_ui_primitives23.IconBrowseOutline16 },
|
|
16567
|
+
{ id: "mcp", label: "MCP \u670D\u52A1", icon: import_dsh_client_ui_primitives23.IconBrowseOutline16 },
|
|
16568
|
+
{ id: "board", label: "\u4EFB\u52A1\u770B\u677F", icon: import_dsh_client_ui_primitives23.IconListPenOutline16 },
|
|
16569
|
+
{ id: "schedules", label: "\u5B9A\u65F6\u4EFB\u52A1", icon: import_dsh_client_ui_primitives23.IconPlayOutline16 }
|
|
16137
16570
|
] },
|
|
16138
|
-
{ id: "settings", label: "\u8BBE\u7F6E", detail: "\u57FA\u672C\u8BBE\u7F6E\u4E0E\u5361\u7247\u5916\u89C2", icon:
|
|
16139
|
-
{ id: "general", label: "\u57FA\u672C\u8BBE\u7F6E", icon:
|
|
16140
|
-
{ id: "pendant", label: "\u5361\u7247\u8BBE\u7F6E", icon:
|
|
16571
|
+
{ id: "settings", label: "\u8BBE\u7F6E", detail: "\u57FA\u672C\u8BBE\u7F6E\u4E0E\u5361\u7247\u5916\u89C2", icon: import_dsh_client_ui_primitives23.IconEditOutline16, pages: [
|
|
16572
|
+
{ id: "general", label: "\u57FA\u672C\u8BBE\u7F6E", icon: import_dsh_client_ui_primitives23.IconEditOutline16 },
|
|
16573
|
+
{ id: "pendant", label: "\u5361\u7247\u8BBE\u7F6E", icon: import_dsh_client_ui_primitives23.IconEditOutline16 }
|
|
16141
16574
|
] }
|
|
16142
16575
|
];
|
|
16143
16576
|
var workspaceGroup = (page) => workspaceGroups.find((group) => group.pages.some((item) => item.id === page));
|
|
16144
16577
|
function WorkspaceGroupLinks({ view, open, compact = false }) {
|
|
16145
16578
|
const active2 = workspaceGroup(view);
|
|
16146
|
-
return /* @__PURE__ */ (0,
|
|
16579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, { children: workspaceGroups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("button", { type: "button", className: active2?.id === group.id ? "is-active" : "", "aria-current": active2?.id === group.id ? "page" : void 0, onClick: () => {
|
|
16147
16580
|
if (active2?.id !== group.id) open(group.pages[0].id);
|
|
16148
16581
|
}, children: [
|
|
16149
|
-
/* @__PURE__ */ (0,
|
|
16150
|
-
compact ? /* @__PURE__ */ (0,
|
|
16151
|
-
/* @__PURE__ */ (0,
|
|
16152
|
-
/* @__PURE__ */ (0,
|
|
16582
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(group.icon, { size: 16 }) }),
|
|
16583
|
+
compact ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: group.label }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
16584
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("strong", { children: group.label }),
|
|
16585
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("small", { children: group.detail })
|
|
16153
16586
|
] })
|
|
16154
16587
|
] }, group.id)) });
|
|
16155
16588
|
}
|
|
16156
16589
|
function WorkspaceGroupTabs({ view, open }) {
|
|
16157
16590
|
const group = workspaceGroup(view);
|
|
16158
16591
|
if (!group) return null;
|
|
16159
|
-
return /* @__PURE__ */ (0,
|
|
16592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("nav", { className: "dsh-partner-tabs dsh-partner-group-tabs", "aria-label": `${group.label}\u6807\u7B7E\u9875`, children: group.pages.map((page) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(TabButton, { active: view === page.id, onClick: () => open(page.id), icon: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(page.icon, { size: 16 }), children: page.label }, page.id)) });
|
|
16160
16593
|
}
|
|
16161
16594
|
|
|
16162
16595
|
// src/client.tsx
|
|
16163
|
-
var
|
|
16596
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
16164
16597
|
var PLUGIN_ID = "@lemoncat7/dsh-partner";
|
|
16165
16598
|
var STYLE_ID = `${PLUGIN_ID}/client`;
|
|
16166
16599
|
var cssText = `${client_default}
|
|
@@ -16172,31 +16605,32 @@ ${widget_default}
|
|
|
16172
16605
|
${settings_panel_default}
|
|
16173
16606
|
${memory_ui_default}
|
|
16174
16607
|
${identity_editor_default}
|
|
16175
|
-
${form_surface_default}
|
|
16176
|
-
|
|
16608
|
+
${form_surface_default}
|
|
16609
|
+
${mcp_default}`;
|
|
16610
|
+
var WORKSPACE_PAGES = /* @__PURE__ */ new Set(["skills", "mcp", "board", "schedules", "pendant", "general"]);
|
|
16177
16611
|
var inject = ["slots", "layout", "sessions"];
|
|
16178
16612
|
function apply(ctx) {
|
|
16179
16613
|
ctx.effect(installStyles, "dsh-partner: styles");
|
|
16180
|
-
const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0,
|
|
16614
|
+
const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PartnerWorkspace, { ...props, controller: current2 }));
|
|
16181
16615
|
if (pendingStorageRecovery() !== void 0) controller.open(void 0, { page: "general" });
|
|
16182
|
-
ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0,
|
|
16616
|
+
ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PartnerPendant, { controller })));
|
|
16183
16617
|
ctx.effect(() => observePluginWorkspace(PLUGIN_ID, controller.close), "dsh-partner: exclusive workspace");
|
|
16184
16618
|
ctx.effect(() => () => controller.close(), "dsh-partner: workspace lifecycle");
|
|
16185
16619
|
ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({
|
|
16186
16620
|
name: "sidebar.footer.action",
|
|
16187
16621
|
id: "partner",
|
|
16188
16622
|
order: -120
|
|
16189
|
-
}, (props) => /* @__PURE__ */ (0,
|
|
16623
|
+
}, (props) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
|
|
16190
16624
|
}
|
|
16191
16625
|
function PartnerSidebar(props) {
|
|
16192
|
-
const ref = (0,
|
|
16626
|
+
const ref = (0, import_react50.useRef)(null);
|
|
16193
16627
|
useWorkspaceTopAnchor(ref);
|
|
16194
|
-
const [open, setOpen] = (0,
|
|
16195
|
-
const [snapshot, setSnapshot] = (0,
|
|
16628
|
+
const [open, setOpen] = (0, import_react50.useState)(true);
|
|
16629
|
+
const [snapshot, setSnapshot] = (0, import_react50.useState)();
|
|
16196
16630
|
useChannelStatus(setSnapshot);
|
|
16197
|
-
const [, update] = (0,
|
|
16198
|
-
(0,
|
|
16199
|
-
(0,
|
|
16631
|
+
const [, update] = (0, import_react50.useState)(0);
|
|
16632
|
+
(0, import_react50.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
|
|
16633
|
+
(0, import_react50.useEffect)(() => {
|
|
16200
16634
|
void loadPartner().then(setSnapshot).catch(() => {
|
|
16201
16635
|
});
|
|
16202
16636
|
}, [props.controller.isOpen()]);
|
|
@@ -16204,35 +16638,35 @@ function PartnerSidebar(props) {
|
|
|
16204
16638
|
props.controller.open(id);
|
|
16205
16639
|
if (props.wide && window.matchMedia("(max-width: 820px)").matches) props.collapse();
|
|
16206
16640
|
};
|
|
16207
|
-
if (!props.wide) return /* @__PURE__ */ (0,
|
|
16208
|
-
return /* @__PURE__ */ (0,
|
|
16209
|
-
/* @__PURE__ */ (0,
|
|
16210
|
-
/* @__PURE__ */ (0,
|
|
16641
|
+
if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", className: `dsh-partner-rail${props.controller.isOpen() ? " is-active" : ""}`, title: "\u4F19\u4F34", onClick: () => props.controller.toggle(), children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconAgentPresetOutline16, { size: 18 }) }) });
|
|
16642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
|
|
16643
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
|
|
16644
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconChevronDownOutline14, { size: 14 }) }),
|
|
16211
16645
|
"\u4F19\u4F34"
|
|
16212
16646
|
] }) }),
|
|
16213
|
-
/* @__PURE__ */ (0,
|
|
16214
|
-
/* @__PURE__ */ (0,
|
|
16215
|
-
/* @__PURE__ */ (0,
|
|
16216
|
-
/* @__PURE__ */ (0,
|
|
16217
|
-
/* @__PURE__ */ (0,
|
|
16647
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
|
|
16648
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconAgentPresetOutline16, { size: 16 }) }),
|
|
16649
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
|
|
16650
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
|
|
16651
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: snapshot ? `${snapshot.companions.length} \u4F4D\u4F19\u4F34 \xB7 ${snapshot.channels.filter((item) => item.runtimeStatus === "running").length} \u4E2A\u6E20\u9053\u5728\u7EBF` : "\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E\u6E20\u9053" })
|
|
16218
16652
|
] }),
|
|
16219
|
-
/* @__PURE__ */ (0,
|
|
16653
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
|
|
16220
16654
|
] }) }) })
|
|
16221
16655
|
] });
|
|
16222
16656
|
}
|
|
16223
16657
|
function PartnerWorkspace({ controller }) {
|
|
16224
|
-
const [snapshot, setSnapshot] = (0,
|
|
16658
|
+
const [snapshot, setSnapshot] = (0, import_react50.useState)();
|
|
16225
16659
|
useChannelStatus(setSnapshot);
|
|
16226
|
-
const [selectedId, setSelectedId] = (0,
|
|
16227
|
-
const [view, setView] = (0,
|
|
16228
|
-
const [requestedDestination, setRequestedDestination] = (0,
|
|
16229
|
-
const [error, setError] = (0,
|
|
16230
|
-
const [loading, setLoading] = (0,
|
|
16231
|
-
const [creatingCompanion, setCreatingCompanion] = (0,
|
|
16232
|
-
const [notice, setNotice] = (0,
|
|
16233
|
-
const selectionRef = (0,
|
|
16660
|
+
const [selectedId, setSelectedId] = (0, import_react50.useState)(controller.selected());
|
|
16661
|
+
const [view, setView] = (0, import_react50.useState)(controller.destination()?.page ?? "home");
|
|
16662
|
+
const [requestedDestination, setRequestedDestination] = (0, import_react50.useState)(controller.destination());
|
|
16663
|
+
const [error, setError] = (0, import_react50.useState)();
|
|
16664
|
+
const [loading, setLoading] = (0, import_react50.useState)(true);
|
|
16665
|
+
const [creatingCompanion, setCreatingCompanion] = (0, import_react50.useState)(false);
|
|
16666
|
+
const [notice, setNotice] = (0, import_react50.useState)();
|
|
16667
|
+
const selectionRef = (0, import_react50.useRef)({ selectedId, companions: snapshot?.companions });
|
|
16234
16668
|
selectionRef.current = { selectedId, companions: snapshot?.companions };
|
|
16235
|
-
const refresh = (0,
|
|
16669
|
+
const refresh = (0, import_react50.useCallback)(async (throwOnError = false) => {
|
|
16236
16670
|
try {
|
|
16237
16671
|
const next = await loadPartner();
|
|
16238
16672
|
setSnapshot(next);
|
|
@@ -16245,10 +16679,10 @@ function PartnerWorkspace({ controller }) {
|
|
|
16245
16679
|
setLoading(false);
|
|
16246
16680
|
}
|
|
16247
16681
|
}, []);
|
|
16248
|
-
(0,
|
|
16682
|
+
(0, import_react50.useEffect)(() => {
|
|
16249
16683
|
void refresh();
|
|
16250
16684
|
}, [refresh]);
|
|
16251
|
-
(0,
|
|
16685
|
+
(0, import_react50.useEffect)(() => controller.subscribe(() => {
|
|
16252
16686
|
const next = controller.selected();
|
|
16253
16687
|
if (next) setSelectedId(next);
|
|
16254
16688
|
const destination = controller.destination();
|
|
@@ -16317,18 +16751,18 @@ function PartnerWorkspace({ controller }) {
|
|
|
16317
16751
|
setSelectedId(id);
|
|
16318
16752
|
setView("home");
|
|
16319
16753
|
};
|
|
16320
|
-
return /* @__PURE__ */ (0,
|
|
16321
|
-
creatingCompanion && /* @__PURE__ */ (0,
|
|
16322
|
-
/* @__PURE__ */ (0,
|
|
16323
|
-
/* @__PURE__ */ (0,
|
|
16324
|
-
/* @__PURE__ */ (0,
|
|
16325
|
-
/* @__PURE__ */ (0,
|
|
16326
|
-
/* @__PURE__ */ (0,
|
|
16327
|
-
/* @__PURE__ */ (0,
|
|
16328
|
-
/* @__PURE__ */ (0,
|
|
16754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("main", { className: "dsh-partner-workspace", children: [
|
|
16755
|
+
creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
|
|
16756
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { className: "dsh-partner-topbar", children: [
|
|
16757
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
|
|
16758
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", "data-xiaohei-workspace-close": true, onClick: controller.close, "aria-label": "\u8FD4\u56DE\u4F1A\u8BDD", title: "\u8FD4\u56DE\u4F1A\u8BDD", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconChevronLeftOutline14, { size: 15 }) }),
|
|
16759
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconAgentPresetOutline16, { size: 18 }),
|
|
16760
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
|
|
16761
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: "\u4F19\u4F34" }),
|
|
16762
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u6D88\u606F\u6E20\u9053" })
|
|
16329
16763
|
] })
|
|
16330
16764
|
] }),
|
|
16331
|
-
/* @__PURE__ */ (0,
|
|
16765
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
16332
16766
|
MobileWorkspaceControls,
|
|
16333
16767
|
{
|
|
16334
16768
|
companions: snapshot?.companions ?? [],
|
|
@@ -16340,86 +16774,87 @@ function PartnerWorkspace({ controller }) {
|
|
|
16340
16774
|
}
|
|
16341
16775
|
)
|
|
16342
16776
|
] }),
|
|
16343
|
-
/* @__PURE__ */ (0,
|
|
16344
|
-
/* @__PURE__ */ (0,
|
|
16345
|
-
/* @__PURE__ */ (0,
|
|
16346
|
-
/* @__PURE__ */ (0,
|
|
16347
|
-
/* @__PURE__ */ (0,
|
|
16348
|
-
/* @__PURE__ */ (0,
|
|
16777
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-grid", children: [
|
|
16778
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("aside", { className: "dsh-partner-roster", children: [
|
|
16779
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-roster-title", children: [
|
|
16780
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
|
|
16781
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "COMPANIONS" }),
|
|
16782
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
|
|
16349
16783
|
] }),
|
|
16350
|
-
/* @__PURE__ */ (0,
|
|
16784
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconPlusOutline16, { size: 16 }) })
|
|
16351
16785
|
] }),
|
|
16352
|
-
/* @__PURE__ */ (0,
|
|
16786
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
|
|
16353
16787
|
const channel = snapshot.channels.find((item) => item.companionId === companion.id);
|
|
16354
|
-
return /* @__PURE__ */ (0,
|
|
16355
|
-
/* @__PURE__ */ (0,
|
|
16356
|
-
/* @__PURE__ */ (0,
|
|
16357
|
-
/* @__PURE__ */ (0,
|
|
16358
|
-
/* @__PURE__ */ (0,
|
|
16788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
|
|
16789
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Avatar, { name: companion.name }),
|
|
16790
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
|
|
16791
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: companion.name }),
|
|
16792
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: companion.role })
|
|
16359
16793
|
] }),
|
|
16360
|
-
/* @__PURE__ */ (0,
|
|
16794
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
|
|
16361
16795
|
] }, companion.id);
|
|
16362
16796
|
}) }),
|
|
16363
|
-
/* @__PURE__ */ (0,
|
|
16364
|
-
/* @__PURE__ */ (0,
|
|
16365
|
-
/* @__PURE__ */ (0,
|
|
16366
|
-
/* @__PURE__ */ (0,
|
|
16367
|
-
/* @__PURE__ */ (0,
|
|
16368
|
-
/* @__PURE__ */ (0,
|
|
16797
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WorkspaceGroupLinks, { view, open: setView }) }),
|
|
16798
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-roster-note", children: [
|
|
16799
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconLinkOutline16, { size: 16 }),
|
|
16800
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
|
|
16801
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
|
|
16802
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "\u6E20\u9053\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
|
|
16369
16803
|
] })
|
|
16370
16804
|
] })
|
|
16371
16805
|
] }),
|
|
16372
|
-
/* @__PURE__ */ (0,
|
|
16373
|
-
loading ? /* @__PURE__ */ (0,
|
|
16374
|
-
/* @__PURE__ */ (0,
|
|
16375
|
-
/* @__PURE__ */ (0,
|
|
16376
|
-
/* @__PURE__ */ (0,
|
|
16377
|
-
view === "skills" && /* @__PURE__ */ (0,
|
|
16378
|
-
view === "
|
|
16379
|
-
view === "
|
|
16380
|
-
view === "
|
|
16381
|
-
view === "
|
|
16806
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
|
|
16807
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
16808
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-group-heading", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h1", { children: workspaceGroup(view)?.label }) }),
|
|
16809
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WorkspaceGroupTabs, { view, open: setView }),
|
|
16810
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
|
|
16811
|
+
view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SkillsPanel, {}),
|
|
16812
|
+
view === "mcp" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(McpPanel, {}),
|
|
16813
|
+
view === "board" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(RequirementBoard, { initialTaskId: requestedDestination?.taskId, openRequest: requestedDestination }),
|
|
16814
|
+
view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] }),
|
|
16815
|
+
view === "pendant" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(PendantSettingsPanel, {}),
|
|
16816
|
+
view === "general" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(GeneralSettingsPanel, {})
|
|
16382
16817
|
] })
|
|
16383
|
-
] }) : selected === void 0 ? /* @__PURE__ */ (0,
|
|
16384
|
-
/* @__PURE__ */ (0,
|
|
16385
|
-
/* @__PURE__ */ (0,
|
|
16386
|
-
/* @__PURE__ */ (0,
|
|
16387
|
-
/* @__PURE__ */ (0,
|
|
16388
|
-
/* @__PURE__ */ (0,
|
|
16389
|
-
/* @__PURE__ */ (0,
|
|
16818
|
+
] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ContentState, { title: "\u521B\u5EFA\u7B2C\u4E00\u4E2A\u4F19\u4F34", detail: "\u4F19\u4F34\u4F1A\u4FDD\u5B58\u72EC\u7ACB\u8EAB\u4EFD\u3001\u80FD\u529B\u548C\u5FAE\u4FE1\u4F1A\u8BDD\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
16819
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-identity", children: [
|
|
16820
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Avatar, { name: selected.name }),
|
|
16821
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
|
|
16822
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "ACTIVE COMPANION" }),
|
|
16823
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h1", { children: selected.name }),
|
|
16824
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: selected.description || selected.role })
|
|
16390
16825
|
] }),
|
|
16391
|
-
/* @__PURE__ */ (0,
|
|
16826
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
|
|
16392
16827
|
] }),
|
|
16393
|
-
/* @__PURE__ */ (0,
|
|
16394
|
-
/* @__PURE__ */ (0,
|
|
16395
|
-
/* @__PURE__ */ (0,
|
|
16396
|
-
/* @__PURE__ */ (0,
|
|
16397
|
-
/* @__PURE__ */ (0,
|
|
16398
|
-
/* @__PURE__ */ (0,
|
|
16399
|
-
/* @__PURE__ */ (0,
|
|
16828
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
|
|
16829
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconAgentPresetOutline16, { size: 16 }), children: "\u603B\u89C8" }),
|
|
16830
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconEditOutline16, { size: 16 }), children: "\u8EAB\u4EFD" }),
|
|
16831
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconAgentPresetOutline16, { size: 16 }), children: "\u80FD\u529B" }),
|
|
16832
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconLinkOutline16, { size: 16 }), children: "\u6E20\u9053" }),
|
|
16833
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconDataOutline16, { size: 16 }), children: "\u8BB0\u5FC6" }),
|
|
16834
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(TabButton, { active: view === "concerns", onClick: () => setView("concerns"), icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconBrowseOutline16, { size: 16 }), children: "\u6301\u7EED\u5173\u6CE8" })
|
|
16400
16835
|
] }),
|
|
16401
|
-
/* @__PURE__ */ (0,
|
|
16402
|
-
notice && /* @__PURE__ */ (0,
|
|
16403
|
-
view === "home" && /* @__PURE__ */ (0,
|
|
16404
|
-
view === "identity" && /* @__PURE__ */ (0,
|
|
16405
|
-
view === "capabilities" && /* @__PURE__ */ (0,
|
|
16406
|
-
view === "weixin" && /* @__PURE__ */ (0,
|
|
16407
|
-
view === "memory" && /* @__PURE__ */ (0,
|
|
16408
|
-
view === "concerns" && /* @__PURE__ */ (0,
|
|
16836
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
|
|
16837
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "dsh-partner-inline-notice", role: "status", children: notice }),
|
|
16838
|
+
view === "home" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession }),
|
|
16839
|
+
view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(IdentityEditor, { companion: selected, count: snapshot?.companions.length ?? 1, onChanged: () => refresh(true), onRemoved: companionRemoved }),
|
|
16840
|
+
view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: () => refresh(true) }, selected.id),
|
|
16841
|
+
view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ChannelsPanel, { companion: selected, snapshot, onChanged: refresh, weixin: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }) }, selected.id),
|
|
16842
|
+
view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, startSession, renewSession, onChanged: refresh }, selected.id),
|
|
16843
|
+
view === "concerns" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ConcernPanel, { companion: selected, snapshot, onChanged: refresh }, selected.id)
|
|
16409
16844
|
] })
|
|
16410
16845
|
] }),
|
|
16411
|
-
error && /* @__PURE__ */ (0,
|
|
16846
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
|
|
16412
16847
|
] })
|
|
16413
16848
|
] })
|
|
16414
16849
|
] });
|
|
16415
16850
|
}
|
|
16416
16851
|
function MobileWorkspaceControls({ companions, selectedId, view, openCompanion, openPage, createCompanion }) {
|
|
16417
|
-
return /* @__PURE__ */ (0,
|
|
16418
|
-
/* @__PURE__ */ (0,
|
|
16419
|
-
/* @__PURE__ */ (0,
|
|
16420
|
-
/* @__PURE__ */ (0,
|
|
16852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
|
|
16853
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
|
|
16854
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
|
|
16855
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconPlusOutline16, { size: 17 }) })
|
|
16421
16856
|
] }),
|
|
16422
|
-
/* @__PURE__ */ (0,
|
|
16857
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WorkspaceGroupLinks, { view, open: openPage, compact: true }) })
|
|
16423
16858
|
] });
|
|
16424
16859
|
}
|
|
16425
16860
|
function HomePanel({ companion, snapshot, navigate, openSession, startSession, renewSession }) {
|
|
@@ -16430,77 +16865,77 @@ function HomePanel({ companion, snapshot, navigate, openSession, startSession, r
|
|
|
16430
16865
|
const approved = channel ? snapshot.pairings.filter((item) => item.channelId === channel.id && item.status === "approved").length : 0;
|
|
16431
16866
|
const capabilities = companion.capabilities.map((item) => CAPABILITY_LABELS[item]);
|
|
16432
16867
|
const online = channel?.runtimeStatus === "running";
|
|
16433
|
-
return /* @__PURE__ */ (0,
|
|
16434
|
-
/* @__PURE__ */ (0,
|
|
16435
|
-
/* @__PURE__ */ (0,
|
|
16436
|
-
/* @__PURE__ */ (0,
|
|
16437
|
-
/* @__PURE__ */ (0,
|
|
16868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-home", children: [
|
|
16869
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { className: "dsh-partner-home-heading", children: [
|
|
16870
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
|
|
16871
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
|
|
16872
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u6E20\u9053\u5F85\u547D` : `${companion.name} \u5DF2\u51C6\u5907\u5C31\u7EEA` })
|
|
16438
16873
|
] }),
|
|
16439
|
-
/* @__PURE__ */ (0,
|
|
16874
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: online ? "\u6D88\u606F\u3001\u6388\u6743\u4E0E\u4E0A\u4E0B\u6587\u8FB9\u754C\u90FD\u5728\u8FD9\u91CC\u6C47\u603B\u3002" : "\u4F19\u4F34\u8EAB\u4EFD\u3001\u4F1A\u8BDD\u4E0E\u80FD\u529B\u5DF2\u7ECF\u51C6\u5907\u5B8C\u6210\u3002" })
|
|
16440
16875
|
] }),
|
|
16441
|
-
/* @__PURE__ */ (0,
|
|
16442
|
-
/* @__PURE__ */ (0,
|
|
16443
|
-
/* @__PURE__ */ (0,
|
|
16444
|
-
/* @__PURE__ */ (0,
|
|
16445
|
-
/* @__PURE__ */ (0,
|
|
16876
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
|
|
16877
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
|
|
16878
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Avatar, { name: companion.name }),
|
|
16879
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("i", {}) }),
|
|
16880
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WeixinGlyph, { large: true }) })
|
|
16446
16881
|
] }),
|
|
16447
|
-
/* @__PURE__ */ (0,
|
|
16448
|
-
/* @__PURE__ */ (0,
|
|
16449
|
-
/* @__PURE__ */ (0,
|
|
16882
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
|
|
16883
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
|
|
16884
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("i", {}),
|
|
16450
16885
|
"\u6D88\u606F\u6E20\u9053 \xB7 ",
|
|
16451
16886
|
channel?.platform === "matrix" ? "Matrix" : channel?.platform === "mattermost" ? "Mattermost" : "\u5FAE\u4FE1"
|
|
16452
16887
|
] }),
|
|
16453
|
-
/* @__PURE__ */ (0,
|
|
16454
|
-
/* @__PURE__ */ (0,
|
|
16455
|
-
/* @__PURE__ */ (0,
|
|
16456
|
-
/* @__PURE__ */ (0,
|
|
16457
|
-
/* @__PURE__ */ (0,
|
|
16888
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h3", { children: !channel ? "\u7B49\u5F85\u626B\u7801\u8FDE\u63A5" : online ? "\u8FDE\u63A5\u6B63\u5E38\uFF0C\u6B63\u5728\u63A5\u6536\u6D88\u606F" : channel.runtimeStatus === "error" ? "\u6E20\u9053\u8FDE\u63A5\u9700\u8981\u5904\u7406" : "\u6E20\u9053\u5F53\u524D\u5DF2\u505C\u7528" }),
|
|
16889
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: !channel ? "\u8FDE\u63A5\u5FAE\u4FE1\u3001Matrix \u6216 Mattermost\uFF0C\u8054\u7CFB\u4EBA\u9996\u6B21\u53D1\u6D88\u606F\u9700\u6279\u51C6\u3002" : online ? "\u672C\u5730\u4E0E\u6240\u6709\u5DF2\u6388\u6743\u6E20\u9053\u5171\u7528\u4F19\u4F34\u4E3B\u5BF9\u8BDD\uFF0C\u56DE\u590D\u8FD4\u56DE\u6D88\u606F\u6765\u6E90\u3002" : channel.lastError || "\u6E20\u9053\u914D\u7F6E\u4ECD\u7136\u4FDD\u7559\uFF0C\u53EF\u4EE5\u968F\u65F6\u91CD\u65B0\u542F\u7528\u3002" }),
|
|
16890
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
|
|
16891
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", className: "is-primary", onClick: () => navigate("weixin"), children: !channel ? "\u8FDE\u63A5\u5FAE\u4FE1" : pending > 0 ? `\u5904\u7406 ${pending} \u4E2A\u8BF7\u6C42` : "\u7BA1\u7406\u6E20\u9053" }),
|
|
16892
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: !channel ? "\u9009\u62E9\u6E20\u9053\u5E76\u8FDE\u63A5\u8D26\u53F7" : `${approved} \u4F4D\u8054\u7CFB\u4EBA \xB7 \u5171\u7528\u4E3B\u5BF9\u8BDD` })
|
|
16458
16893
|
] })
|
|
16459
16894
|
] })
|
|
16460
16895
|
] }),
|
|
16461
|
-
/* @__PURE__ */ (0,
|
|
16462
|
-
/* @__PURE__ */ (0,
|
|
16463
|
-
/* @__PURE__ */ (0,
|
|
16464
|
-
/* @__PURE__ */ (0,
|
|
16465
|
-
/* @__PURE__ */ (0,
|
|
16466
|
-
/* @__PURE__ */ (0,
|
|
16467
|
-
/* @__PURE__ */ (0,
|
|
16896
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-home-details", children: [
|
|
16897
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { className: "dsh-partner-home-profile", children: [
|
|
16898
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { children: [
|
|
16899
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconUserOutline16, { size: 16 }) }),
|
|
16900
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
|
|
16901
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
|
|
16902
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: companion.role })
|
|
16468
16903
|
] }),
|
|
16469
|
-
/* @__PURE__ */ (0,
|
|
16904
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
|
|
16470
16905
|
] }),
|
|
16471
|
-
/* @__PURE__ */ (0,
|
|
16906
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
|
|
16472
16907
|
] }),
|
|
16473
|
-
/* @__PURE__ */ (0,
|
|
16474
|
-
/* @__PURE__ */ (0,
|
|
16475
|
-
/* @__PURE__ */ (0,
|
|
16476
|
-
/* @__PURE__ */ (0,
|
|
16477
|
-
/* @__PURE__ */ (0,
|
|
16478
|
-
/* @__PURE__ */ (0,
|
|
16908
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
|
|
16909
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { children: [
|
|
16910
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconAgentPresetOutline16, { size: 16 }) }),
|
|
16911
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
|
|
16912
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
|
|
16913
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
|
|
16479
16914
|
] }),
|
|
16480
|
-
/* @__PURE__ */ (0,
|
|
16915
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
|
|
16481
16916
|
] }),
|
|
16482
|
-
/* @__PURE__ */ (0,
|
|
16917
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
|
|
16483
16918
|
] }),
|
|
16484
|
-
/* @__PURE__ */ (0,
|
|
16485
|
-
/* @__PURE__ */ (0,
|
|
16486
|
-
/* @__PURE__ */ (0,
|
|
16487
|
-
/* @__PURE__ */ (0,
|
|
16488
|
-
/* @__PURE__ */ (0,
|
|
16489
|
-
/* @__PURE__ */ (0,
|
|
16919
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
|
|
16920
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("header", { children: [
|
|
16921
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconDataOutline16, { size: 16 }) }),
|
|
16922
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
|
|
16923
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
|
|
16924
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: localSession?.archived ? "\u4F1A\u8BDD\u5DF2\u5F52\u6863" : "\u4F19\u4F34\u4F1A\u8BDD\u5DF2\u5EFA\u7ACB" })
|
|
16490
16925
|
] }),
|
|
16491
|
-
/* @__PURE__ */ (0,
|
|
16926
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", onClick: () => localSession === void 0 ? void startSession(companion.id) : localSession.archived ? void renewSession(localSession.id) : void openSession(localSession.id, localSession.sessionId), children: localSession === void 0 ? "\u5F00\u59CB\u5BF9\u8BDD" : localSession.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
|
|
16492
16927
|
] }),
|
|
16493
|
-
/* @__PURE__ */ (0,
|
|
16928
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: localSession ? `\u6700\u8FD1\u6D3B\u52A8\u4E8E ${relativeTime(localSession.lastMessageAt)}\uFF1B\u672C\u5730\u4E0E\u6E20\u9053\u5728\u8FD9\u91CC\u63A5\u7740\u804A\u3002` : "\u4F19\u4F34\u4F1A\u8BDD\u6B63\u5728\u521D\u59CB\u5316\uFF0C\u7A0D\u540E\u5373\u53EF\u6253\u5F00\u3002" })
|
|
16494
16929
|
] })
|
|
16495
16930
|
] })
|
|
16496
16931
|
] });
|
|
16497
16932
|
}
|
|
16498
16933
|
function WeixinPanel({ companion, snapshot, onChanged }) {
|
|
16499
16934
|
const channel = snapshot.channels.find((item) => item.companionId === companion.id && (!item.platform || item.platform === "weixin"));
|
|
16500
|
-
const [login, setLogin] = (0,
|
|
16501
|
-
const [busy, setBusy] = (0,
|
|
16502
|
-
const [error, setError] = (0,
|
|
16503
|
-
(0,
|
|
16935
|
+
const [login, setLogin] = (0, import_react50.useState)();
|
|
16936
|
+
const [busy, setBusy] = (0, import_react50.useState)(false);
|
|
16937
|
+
const [error, setError] = (0, import_react50.useState)();
|
|
16938
|
+
(0, import_react50.useEffect)(() => {
|
|
16504
16939
|
if (!login || login.phase === "confirmed" || login.phase === "expired" || login.phase === "error") return;
|
|
16505
16940
|
const timer2 = window.setInterval(() => {
|
|
16506
16941
|
void api(`/weixin/login/${login.id}`).then(async (result) => {
|
|
@@ -16546,93 +16981,93 @@ function WeixinPanel({ companion, snapshot, onChanged }) {
|
|
|
16546
16981
|
setError(errorMessage(reason));
|
|
16547
16982
|
}
|
|
16548
16983
|
};
|
|
16549
|
-
return /* @__PURE__ */ (0,
|
|
16550
|
-
/* @__PURE__ */ (0,
|
|
16551
|
-
!channel && !login && /* @__PURE__ */ (0,
|
|
16552
|
-
/* @__PURE__ */ (0,
|
|
16553
|
-
/* @__PURE__ */ (0,
|
|
16554
|
-
/* @__PURE__ */ (0,
|
|
16984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
|
|
16985
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(SectionHeading, { eyebrow: "PRIMARY CHANNEL", title: "\u5FAE\u4FE1\u6E20\u9053", detail: "\u4F7F\u7528\u5FAE\u4FE1 iLink Bot \u626B\u7801\u63A5\u5165\u3002\u6BCF\u4E2A\u673A\u5668\u4EBA\u53EA\u7ED1\u5B9A\u4E00\u4E2A\u4F19\u4F34\uFF0C\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u4FDD\u6301\u72EC\u7ACB DSH \u4F1A\u8BDD\u3002" }),
|
|
16986
|
+
!channel && !login && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
|
|
16987
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WeixinGlyph, { large: true }) }),
|
|
16988
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
|
|
16989
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("strong", { children: [
|
|
16555
16990
|
"\u628A ",
|
|
16556
16991
|
companion.name,
|
|
16557
16992
|
" \u5E26\u5230\u5FAE\u4FE1"
|
|
16558
16993
|
] }),
|
|
16559
|
-
/* @__PURE__ */ (0,
|
|
16560
|
-
/* @__PURE__ */ (0,
|
|
16561
|
-
/* @__PURE__ */ (0,
|
|
16562
|
-
/* @__PURE__ */ (0,
|
|
16563
|
-
/* @__PURE__ */ (0,
|
|
16994
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: "\u626B\u7801\u540E\uFF0C\u673A\u5668\u4EBA\u51ED\u636E\u76F4\u63A5\u4FDD\u5B58\u8FDB DSH \u51ED\u636E\u5E93\uFF0C\u4E0D\u4F1A\u663E\u793A\u5728\u6D4F\u89C8\u5668\u6216\u666E\u901A\u914D\u7F6E\u6587\u4EF6\u4E2D\u3002" }),
|
|
16995
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("ul", { children: [
|
|
16996
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
|
|
16997
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
|
|
16998
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
|
|
16564
16999
|
] })
|
|
16565
17000
|
] }),
|
|
16566
|
-
/* @__PURE__ */ (0,
|
|
17001
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", disabled: busy, onClick: () => {
|
|
16567
17002
|
void begin();
|
|
16568
17003
|
}, children: busy ? "\u6B63\u5728\u7533\u8BF7\u4E8C\u7EF4\u7801\u2026" : "\u626B\u7801\u8FDE\u63A5\u5FAE\u4FE1" })
|
|
16569
17004
|
] }),
|
|
16570
|
-
login && /* @__PURE__ */ (0,
|
|
16571
|
-
/* @__PURE__ */ (0,
|
|
16572
|
-
/* @__PURE__ */ (0,
|
|
16573
|
-
/* @__PURE__ */ (0,
|
|
16574
|
-
/* @__PURE__ */ (0,
|
|
16575
|
-
/* @__PURE__ */ (0,
|
|
16576
|
-
(login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0,
|
|
17005
|
+
login && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
|
|
17006
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
|
|
17007
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
|
|
17008
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "WECHAT ILINK BOT" }),
|
|
17009
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: login.phase === "scanned" ? "\u5DF2\u626B\u7801\uFF0C\u8BF7\u5728\u5FAE\u4FE1\u786E\u8BA4" : login.phase === "expired" ? "\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F" : login.phase === "error" ? "\u8FDE\u63A5\u5931\u8D25" : "\u4F7F\u7528\u5FAE\u4FE1\u626B\u7801" }),
|
|
17010
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: login.error || (login.phase === "scanned" ? "\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u542F\u52A8\u6E20\u9053\uFF0C\u4E0D\u9700\u8981\u590D\u5236 Token\u3002" : "\u4E8C\u7EF4\u7801\u7EA6 5 \u5206\u949F\u6709\u6548\u3002\u6B64\u9875\u9762\u53EF\u4EE5\u5B89\u5168\u5730\u4FDD\u6301\u6253\u5F00\u3002") }),
|
|
17011
|
+
(login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("button", { type: "button", onClick: () => {
|
|
16577
17012
|
setLogin(void 0);
|
|
16578
17013
|
void begin();
|
|
16579
17014
|
}, children: [
|
|
16580
|
-
/* @__PURE__ */ (0,
|
|
17015
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconRefreshOutline16, { size: 16 }),
|
|
16581
17016
|
"\u91CD\u65B0\u751F\u6210"
|
|
16582
17017
|
] })
|
|
16583
17018
|
] })
|
|
16584
17019
|
] }),
|
|
16585
|
-
channel && /* @__PURE__ */ (0,
|
|
16586
|
-
/* @__PURE__ */ (0,
|
|
16587
|
-
/* @__PURE__ */ (0,
|
|
16588
|
-
/* @__PURE__ */ (0,
|
|
16589
|
-
/* @__PURE__ */ (0,
|
|
16590
|
-
/* @__PURE__ */ (0,
|
|
16591
|
-
/* @__PURE__ */ (0,
|
|
17020
|
+
channel && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
17021
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
|
|
17022
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WeixinGlyph, { large: true }) }),
|
|
17023
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
|
|
17024
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "WECHAT CHANNEL" }),
|
|
17025
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: channel.name }),
|
|
17026
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: channel.accountId })
|
|
16592
17027
|
] }),
|
|
16593
|
-
/* @__PURE__ */ (0,
|
|
16594
|
-
/* @__PURE__ */ (0,
|
|
17028
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ChannelStatus, { channel }),
|
|
17029
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": channel.enabled, disabled: busy, "aria-label": channel.enabled ? "\u505C\u7528\u5FAE\u4FE1\u6E20\u9053" : "\u542F\u7528\u5FAE\u4FE1\u6E20\u9053", onClick: () => {
|
|
16595
17030
|
void toggle();
|
|
16596
|
-
}, children: /* @__PURE__ */ (0,
|
|
17031
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("i", {}) })
|
|
16597
17032
|
] }),
|
|
16598
|
-
channel.lastError && /* @__PURE__ */ (0,
|
|
16599
|
-
/* @__PURE__ */ (0,
|
|
16600
|
-
/* @__PURE__ */ (0,
|
|
16601
|
-
/* @__PURE__ */ (0,
|
|
16602
|
-
/* @__PURE__ */ (0,
|
|
17033
|
+
channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "dsh-partner-inline-error", children: channel.lastError }),
|
|
17034
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
|
|
17035
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { children: [
|
|
17036
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: "ACCESS" }),
|
|
17037
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
|
|
16603
17038
|
] }),
|
|
16604
|
-
/* @__PURE__ */ (0,
|
|
17039
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("em", { children: [
|
|
16605
17040
|
pairings.filter((item) => item.status === "pending").length,
|
|
16606
17041
|
" \u4E2A\u5F85\u5904\u7406"
|
|
16607
17042
|
] })
|
|
16608
17043
|
] }),
|
|
16609
|
-
/* @__PURE__ */ (0,
|
|
16610
|
-
/* @__PURE__ */ (0,
|
|
16611
|
-
/* @__PURE__ */ (0,
|
|
16612
|
-
/* @__PURE__ */ (0,
|
|
16613
|
-
/* @__PURE__ */ (0,
|
|
17044
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u8054\u7CFB\u4EBA", detail: "\u6709\u4EBA\u9996\u6B21\u5411\u673A\u5668\u4EBA\u53D1\u6D88\u606F\u540E\uFF0C\u914D\u5BF9\u8BF7\u6C42\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002", compact: true }) : pairings.map((pairing) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("article", { children: [
|
|
17045
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_dsh_client_ui_primitives24.IconUserOutline16, { size: 16 }) }),
|
|
17046
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
|
|
17047
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: pairing.displayName }),
|
|
17048
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("small", { children: [
|
|
16614
17049
|
pairing.status === "pending" ? "\u7B49\u5F85\u5BA1\u6279" : pairing.status === "approved" ? "\u5DF2\u6388\u6743\u72EC\u7ACB\u4F1A\u8BDD" : "\u5DF2\u963B\u6B62",
|
|
16615
17050
|
" \xB7 ",
|
|
16616
17051
|
new Date(pairing.updatedAt).toLocaleString()
|
|
16617
17052
|
] })
|
|
16618
17053
|
] }),
|
|
16619
|
-
pairing.status === "pending" && /* @__PURE__ */ (0,
|
|
16620
|
-
/* @__PURE__ */ (0,
|
|
17054
|
+
pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
17055
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { onClick: () => {
|
|
16621
17056
|
void actPairing(pairing.id, "blocked");
|
|
16622
17057
|
}, children: "\u62D2\u7EDD" }),
|
|
16623
|
-
/* @__PURE__ */ (0,
|
|
17058
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { className: "is-primary", onClick: () => {
|
|
16624
17059
|
void actPairing(pairing.id, "approved");
|
|
16625
17060
|
}, children: "\u6279\u51C6" })
|
|
16626
17061
|
] }),
|
|
16627
|
-
pairing.status === "approved" && /* @__PURE__ */ (0,
|
|
17062
|
+
pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { onClick: () => {
|
|
16628
17063
|
void actPairing(pairing.id, "blocked");
|
|
16629
17064
|
}, children: "\u64A4\u9500" }),
|
|
16630
|
-
pairing.status === "blocked" && /* @__PURE__ */ (0,
|
|
17065
|
+
pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { onClick: () => {
|
|
16631
17066
|
void actPairing(pairing.id, "approved");
|
|
16632
17067
|
}, children: "\u91CD\u65B0\u6279\u51C6" })
|
|
16633
17068
|
] }, pairing.id)) })
|
|
16634
17069
|
] }),
|
|
16635
|
-
error && /* @__PURE__ */ (0,
|
|
17070
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "dsh-partner-inline-error", children: error })
|
|
16636
17071
|
] });
|
|
16637
17072
|
}
|
|
16638
17073
|
function installStyles() {
|