@lemoncat7/dsh-partner 1.5.2 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/lib/agent-runtime.d.ts +3 -0
- package/lib/agent-runtime.d.ts.map +1 -1
- package/lib/agent-runtime.js +8 -1
- package/lib/agent-runtime.js.map +1 -1
- package/lib/channels/manager.d.ts +4 -7
- package/lib/channels/manager.d.ts.map +1 -1
- package/lib/channels/manager.js +60 -64
- package/lib/channels/manager.js.map +1 -1
- package/lib/client-controller.d.ts +1 -1
- package/lib/client-controller.d.ts.map +1 -1
- package/lib/client-controller.js.map +1 -1
- package/lib/client.d.ts +1 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +1379 -1321
- package/lib/client.js.map +4 -4
- package/lib/concern-tool.d.ts.map +1 -1
- package/lib/concern-tool.js +3 -2
- package/lib/concern-tool.js.map +1 -1
- package/lib/execution/agent-support.js +1 -1
- package/lib/execution/agent-support.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/ui/companion-picker.d.ts +8 -0
- package/lib/ui/companion-picker.d.ts.map +1 -0
- package/lib/ui/companion-picker.js +70 -0
- package/lib/ui/companion-picker.js.map +1 -0
- package/package.json +40 -39
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_react11 = 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_primitives9 = 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);
|
|
@@ -1162,11 +1162,14 @@ QRCodeSVG.displayName = "QRCodeSVG";
|
|
|
1162
1162
|
var client_default = `.dsh-partner-sidebar,
|
|
1163
1163
|
.dsh-partner-workspace {
|
|
1164
1164
|
color-scheme: light;
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
--partner-
|
|
1165
|
+
/* The host remains the canvas. Panes, cards and controls own progressively
|
|
1166
|
+
stronger materials, following the knowledge workspace contract. */
|
|
1167
|
+
--partner-surface: transparent;
|
|
1168
|
+
--partner-pane: rgba(255, 255, 255, .08);
|
|
1169
|
+
--partner-raised: rgba(255, 255, 255, .24);
|
|
1168
1170
|
--partner-control: rgba(255, 255, 255, .27);
|
|
1169
|
-
--partner-
|
|
1171
|
+
--partner-control-hover: rgba(255, 255, 255, .38);
|
|
1172
|
+
--partner-card-surface: rgba(255, 255, 255, .24);
|
|
1170
1173
|
--partner-card-highlight: rgba(255, 255, 255, .58);
|
|
1171
1174
|
--partner-solid-panel: #f4f4f4;
|
|
1172
1175
|
--partner-solid-raised: #fafafa;
|
|
@@ -1197,8 +1200,9 @@ var client_default = `.dsh-partner-sidebar,
|
|
|
1197
1200
|
--partner-glass-thick: rgba(255, 255, 255, .42);
|
|
1198
1201
|
--partner-glass-highlight: rgba(255, 255, 255, .7);
|
|
1199
1202
|
--partner-glass-rim-shadow: rgba(60, 60, 67, .11);
|
|
1200
|
-
--partner-glass-filter: saturate(
|
|
1201
|
-
--partner-frosted-filter:
|
|
1203
|
+
--partner-glass-filter: saturate(.65) contrast(1.015) blur(24px);
|
|
1204
|
+
--partner-frosted-filter: saturate(.65) contrast(1.015) blur(24px);
|
|
1205
|
+
--partner-toolbar-filter: saturate(.18) contrast(1.015) blur(24px);
|
|
1202
1206
|
--partner-shadow-sm: 0 1px 2px rgba(0, 0, 0, .055);
|
|
1203
1207
|
--partner-shadow-md: 0 10px 28px rgba(31, 31, 35, .085);
|
|
1204
1208
|
--partner-shadow-lg: 0 24px 64px rgba(31, 31, 35, .14);
|
|
@@ -1222,13 +1226,12 @@ var client_default = `.dsh-partner-sidebar,
|
|
|
1222
1226
|
|
|
1223
1227
|
body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace) {
|
|
1224
1228
|
color-scheme: dark;
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
--partner-
|
|
1228
|
-
--partner-
|
|
1229
|
-
--partner-
|
|
1230
|
-
--partner-
|
|
1231
|
-
--partner-card-surface: rgb(32 41 43 / 90%);
|
|
1229
|
+
--partner-surface: transparent;
|
|
1230
|
+
--partner-pane: rgb(16 23 25 / 18%);
|
|
1231
|
+
--partner-raised: rgb(32 41 43 / 58%);
|
|
1232
|
+
--partner-control: rgb(39 50 53 / 72%);
|
|
1233
|
+
--partner-control-hover: rgb(39 50 53 / 84%);
|
|
1234
|
+
--partner-card-surface: rgb(32 41 43 / 58%);
|
|
1232
1235
|
--partner-card-highlight: rgba(255, 255, 255, .11);
|
|
1233
1236
|
--partner-solid-panel: #182022;
|
|
1234
1237
|
--partner-solid-raised: #20292b;
|
|
@@ -1259,6 +1262,9 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace) {
|
|
|
1259
1262
|
--partner-glass-thick: rgba(0, 0, 0, .26);
|
|
1260
1263
|
--partner-glass-highlight: rgba(255, 255, 255, .16);
|
|
1261
1264
|
--partner-glass-rim-shadow: rgba(0, 0, 0, .3);
|
|
1265
|
+
--partner-glass-filter: saturate(.55) contrast(1.02) blur(24px);
|
|
1266
|
+
--partner-frosted-filter: saturate(.55) contrast(1.02) blur(24px);
|
|
1267
|
+
--partner-toolbar-filter: saturate(.45) contrast(1.02) blur(24px);
|
|
1262
1268
|
--partner-shadow-sm: 0 1px 2px rgba(0, 0, 0, .28);
|
|
1263
1269
|
--partner-shadow-md: 0 12px 32px rgba(0, 0, 0, .34);
|
|
1264
1270
|
--partner-shadow-lg: 0 28px 72px rgba(0, 0, 0, .48);
|
|
@@ -1705,7 +1711,7 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace) {
|
|
|
1705
1711
|
}
|
|
1706
1712
|
.dsh-partner-glass-surface.is-interactive:hover::after { opacity: .72; }
|
|
1707
1713
|
}
|
|
1708
|
-
.dsh-partner-topbar { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; min-height: 52px; margin: 8px 10px 0; padding: 7px 14px; border: 1px solid var(--partner-border); border-radius: 14px 14px 11px 11px; background:
|
|
1714
|
+
.dsh-partner-topbar { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; min-height: 52px; margin: 8px 10px 0; padding: 7px 14px; border: 1px solid var(--partner-border); border-radius: 14px 14px 11px 11px; background: transparent; -webkit-backdrop-filter: var(--partner-toolbar-filter); backdrop-filter: var(--partner-toolbar-filter); box-shadow: var(--partner-glass-shadow); }
|
|
1709
1715
|
.dsh-partner-topbar > div { display: flex; align-items: center; gap: 10px; }
|
|
1710
1716
|
.dsh-partner-topbar > div > span:last-child { display: grid; gap: 2px; }
|
|
1711
1717
|
.dsh-partner-topbar strong { font-size: var(--partner-font-label); font-weight: 620; }
|
|
@@ -1735,7 +1741,7 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace) {
|
|
|
1735
1741
|
.dsh-partner-mobile-workspace-nav { display: none; }
|
|
1736
1742
|
.dsh-partner-grid { display: grid; grid-template-columns: 214px minmax(520px, 1fr); min-width: 0; min-height: 0; padding: 8px 10px 10px; gap: 8px; }
|
|
1737
1743
|
|
|
1738
|
-
.dsh-partner-roster { position: relative; display: flex; min-width: 0; min-height: 0; flex-direction: column; padding: 17px 10px 13px; overflow: hidden; border: 1px solid var(--partner-border); border-radius: 15px; background:
|
|
1744
|
+
.dsh-partner-roster { position: relative; display: flex; min-width: 0; min-height: 0; flex-direction: column; padding: 17px 10px 13px; overflow: hidden; border: 1px solid var(--partner-border); border-radius: 15px; background: var(--partner-pane); -webkit-backdrop-filter: var(--partner-frosted-filter); backdrop-filter: var(--partner-frosted-filter); box-shadow: var(--partner-glass-shadow); }
|
|
1739
1745
|
.dsh-partner-roster-title { display: flex; align-items: flex-start; justify-content: space-between; padding: 0 5px 13px; }
|
|
1740
1746
|
.dsh-partner-roster-title > span { display: grid; gap: 5px; }
|
|
1741
1747
|
.dsh-partner-roster-title small,
|
|
@@ -1770,7 +1776,7 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace) {
|
|
|
1770
1776
|
.dsh-partner-roster-note strong { color: var(--partner-text-secondary); font-size: var(--partner-font-body); font-weight: 580; }
|
|
1771
1777
|
.dsh-partner-roster-note small { font-size: var(--partner-font-caption); line-height: 1.5; }
|
|
1772
1778
|
|
|
1773
|
-
.dsh-partner-stage { position: relative; display: grid; grid-template-rows: auto auto minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--partner-border); border-radius: 15px; background:
|
|
1779
|
+
.dsh-partner-stage { position: relative; display: grid; grid-template-rows: auto auto minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--partner-border); border-radius: 15px; background: var(--partner-pane); -webkit-backdrop-filter: var(--partner-frosted-filter); backdrop-filter: var(--partner-frosted-filter); box-shadow: var(--partner-glass-shadow); }
|
|
1774
1780
|
.dsh-partner-stage.is-workspace-page { grid-template-rows: minmax(0, 1fr); }
|
|
1775
1781
|
.dsh-partner-identity { display: flex; align-items: center; gap: 12px; min-height: 86px; padding: 18px clamp(20px, 4vw, 46px) 13px; }
|
|
1776
1782
|
.dsh-partner-identity > span:nth-child(2) { display: grid; min-width: 0; flex: 1; gap: 3px; }
|
|
@@ -1797,7 +1803,7 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace) {
|
|
|
1797
1803
|
.dsh-partner-home-heading small { color: var(--partner-accent); font-size: var(--partner-font-caption); font-weight: 700; letter-spacing: .08em; }
|
|
1798
1804
|
.dsh-partner-home-heading h2 { margin: 0; font-size: var(--partner-font-display); line-height: 1.18; font-weight: 660; letter-spacing: -.035em; }
|
|
1799
1805
|
.dsh-partner-home-heading p { max-width: 320px; margin: 0 0 2px; color: var(--partner-text-secondary); font-size: var(--partner-font-body); line-height: 1.55; text-align: right; }
|
|
1800
|
-
.dsh-partner-home-channel { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(330px, 1.2fr); align-items: center; min-height: 238px; overflow: hidden; border: 1px solid var(--partner-border); border-radius: 20px; background:
|
|
1806
|
+
.dsh-partner-home-channel { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(330px, 1.2fr); align-items: center; min-height: 238px; overflow: hidden; border: 1px solid var(--partner-border); border-radius: 20px; background: var(--partner-card-surface); box-shadow: var(--partner-card-shadow); }
|
|
1801
1807
|
.dsh-partner-home-route { position: relative; display: flex; align-items: center; justify-content: center; min-height: 100%; padding: 28px; background: radial-gradient(circle at 42% 50%, color-mix(in srgb, var(--partner-glass-highlight) 44%, transparent), transparent 58%); }
|
|
1802
1808
|
.dsh-partner-home-route > .dsh-partner-avatar { position: relative; z-index: 1; width: 58px; height: 58px; border-radius: 18px; background: var(--partner-raised); box-shadow: 0 9px 28px color-mix(in srgb, var(--partner-accent-strong) 10%, transparent); font-size: var(--partner-font-title); }
|
|
1803
1809
|
.dsh-partner-route-line { position: relative; width: clamp(58px, 7vw, 94px); height: 1px; margin: 0 10px; overflow: hidden; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--partner-accent) 25%, transparent) 0 4px, transparent 4px 9px); }
|
|
@@ -1823,14 +1829,8 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace) {
|
|
|
1823
1829
|
overflow: hidden;
|
|
1824
1830
|
border: 1px solid var(--partner-border);
|
|
1825
1831
|
border-radius: 15px;
|
|
1826
|
-
background:
|
|
1827
|
-
|
|
1828
|
-
var(--partner-glass-regular);
|
|
1829
|
-
box-shadow:
|
|
1830
|
-
inset 0 1px 0 var(--partner-glass-highlight),
|
|
1831
|
-
inset 0 -1px 0 var(--partner-glass-rim-shadow),
|
|
1832
|
-
0 8px 22px rgba(31, 31, 35, .075),
|
|
1833
|
-
0 2px 5px rgba(31, 31, 35, .045);
|
|
1832
|
+
background: var(--partner-card-surface);
|
|
1833
|
+
box-shadow: var(--partner-card-shadow);
|
|
1834
1834
|
}
|
|
1835
1835
|
.dsh-partner-home-details > section::after {
|
|
1836
1836
|
position: absolute;
|
|
@@ -2290,6 +2290,21 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace) {
|
|
|
2290
2290
|
Individual components own layout and state; this layer owns glass, edge
|
|
2291
2291
|
refraction and elevation so visual treatment cannot drift between tabs. */
|
|
2292
2292
|
:is(
|
|
2293
|
+
.dsh-partner-feature-block,
|
|
2294
|
+
.dsh-partner-capability-detail,
|
|
2295
|
+
.dsh-partner-feature-form,
|
|
2296
|
+
.dsh-partner-task-form,
|
|
2297
|
+
.dsh-partner-schedule-form,
|
|
2298
|
+
.dsh-partner-market-toolbar,
|
|
2299
|
+
.dsh-partner-skill-installed > article,
|
|
2300
|
+
.dsh-partner-skill-picker,
|
|
2301
|
+
.dsh-partner-skill-picker-list > article,
|
|
2302
|
+
.dsh-partner-access-list > button,
|
|
2303
|
+
.dsh-partner-market-grid > article,
|
|
2304
|
+
.dsh-partner-board > section,
|
|
2305
|
+
.dsh-partner-task-card,
|
|
2306
|
+
.dsh-partner-schedule-list > article,
|
|
2307
|
+
.dsh-partner-capability-group,
|
|
2293
2308
|
.dsh-partner-home-details > section,
|
|
2294
2309
|
.dsh-partner-capabilities button,
|
|
2295
2310
|
.dsh-partner-weixin-connect,
|
|
@@ -2302,9 +2317,7 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace) {
|
|
|
2302
2317
|
.dsh-partner-graph-pair > section
|
|
2303
2318
|
) {
|
|
2304
2319
|
border-color: var(--partner-border);
|
|
2305
|
-
background:
|
|
2306
|
-
linear-gradient(118deg, color-mix(in srgb, var(--partner-card-highlight) 18%, transparent), transparent 56%),
|
|
2307
|
-
var(--partner-card-surface);
|
|
2320
|
+
background: var(--partner-card-surface);
|
|
2308
2321
|
box-shadow: var(--partner-card-shadow);
|
|
2309
2322
|
}
|
|
2310
2323
|
|
|
@@ -2353,9 +2366,7 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace) {
|
|
|
2353
2366
|
|
|
2354
2367
|
.dsh-partner-capabilities button.is-active {
|
|
2355
2368
|
border-color: color-mix(in srgb, var(--partner-text) 24%, var(--partner-border));
|
|
2356
|
-
background:
|
|
2357
|
-
linear-gradient(145deg, color-mix(in srgb, var(--partner-card-highlight) 46%, transparent), transparent 58%),
|
|
2358
|
-
color-mix(in srgb, var(--partner-card-surface) 90%, var(--partner-card-highlight) 10%);
|
|
2369
|
+
background: var(--partner-control-hover);
|
|
2359
2370
|
box-shadow: var(--partner-card-shadow), inset 2px 0 var(--partner-text-secondary);
|
|
2360
2371
|
}
|
|
2361
2372
|
|
|
@@ -2481,13 +2492,8 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace) {
|
|
|
2481
2492
|
}
|
|
2482
2493
|
|
|
2483
2494
|
@media (prefers-reduced-transparency: reduce) {
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
--partner-pane: var(--partner-solid-panel);
|
|
2487
|
-
--partner-raised: var(--partner-solid-raised);
|
|
2488
|
-
--partner-control: var(--partner-solid-control);
|
|
2489
|
-
--partner-card-surface: var(--partner-solid-raised);
|
|
2490
|
-
}
|
|
2495
|
+
/* Preserve the same surface hierarchy as Knowledge. Only remove the blur;
|
|
2496
|
+
replacing every token with an opaque fallback produces a white sheet. */
|
|
2491
2497
|
.dsh-partner-topbar,
|
|
2492
2498
|
.dsh-partner-roster,
|
|
2493
2499
|
.dsh-partner-stage,
|
|
@@ -2608,7 +2614,7 @@ var workspace_ui_default = '.dsh-partner-feature-hero-actions { display: flex; a
|
|
|
2608
2614
|
// src/ui/responsive-ui.css
|
|
2609
2615
|
var responsive_ui_default = `/* Mobile composition lives separately from the desktop visual system so each
|
|
2610
2616
|
layout can evolve without selector-specificity patches. */
|
|
2611
|
-
.dsh-partner-mobile-controls { display: none; }
|
|
2617
|
+
.dsh-partner-topbar > .dsh-partner-mobile-controls { display: none; }
|
|
2612
2618
|
|
|
2613
2619
|
@media (max-width: 760px) {
|
|
2614
2620
|
.dsh-partner-workspace {
|
|
@@ -2620,6 +2626,10 @@ var responsive_ui_default = `/* Mobile composition lives separately from the des
|
|
|
2620
2626
|
}
|
|
2621
2627
|
|
|
2622
2628
|
.dsh-partner-topbar {
|
|
2629
|
+
display: grid;
|
|
2630
|
+
grid-template-columns: 44px minmax(0, 1fr);
|
|
2631
|
+
align-items: center;
|
|
2632
|
+
gap: 8px;
|
|
2623
2633
|
min-width: 0;
|
|
2624
2634
|
margin: max(6px, env(safe-area-inset-top)) 6px 0;
|
|
2625
2635
|
padding: 7px 8px 8px;
|
|
@@ -2634,46 +2644,16 @@ var responsive_ui_default = `/* Mobile composition lives separately from the des
|
|
|
2634
2644
|
}
|
|
2635
2645
|
|
|
2636
2646
|
.dsh-partner-topbar-brand > span:last-child { min-width: 0; }
|
|
2647
|
+
.dsh-partner-topbar-brand > :not(button) { display: none; }
|
|
2637
2648
|
.dsh-partner-topbar-brand strong,
|
|
2638
2649
|
.dsh-partner-topbar-brand small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2639
2650
|
.dsh-partner-topbar [data-xiaohei-workspace-close] { width: 44px; height: 44px; }
|
|
2640
2651
|
|
|
2641
2652
|
.dsh-partner-topbar > .dsh-partner-mobile-controls {
|
|
2642
|
-
display:
|
|
2643
|
-
width: 100%;
|
|
2644
|
-
gap: 6px;
|
|
2653
|
+
display: contents;
|
|
2645
2654
|
}
|
|
2646
2655
|
|
|
2647
2656
|
.dsh-partner-mobile-companion-row { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) 44px; gap: 6px; }
|
|
2648
|
-
.dsh-partner-mobile-companion-picker { position: relative; display: block; min-width: 0; }
|
|
2649
|
-
.dsh-partner-mobile-companion-picker::after {
|
|
2650
|
-
position: absolute;
|
|
2651
|
-
top: 50%;
|
|
2652
|
-
right: 16px;
|
|
2653
|
-
width: 7px;
|
|
2654
|
-
height: 7px;
|
|
2655
|
-
border-right: 1.5px solid currentColor;
|
|
2656
|
-
border-bottom: 1.5px solid currentColor;
|
|
2657
|
-
color: var(--partner-text-tertiary);
|
|
2658
|
-
content: '';
|
|
2659
|
-
transform: translateY(-70%) rotate(45deg);
|
|
2660
|
-
pointer-events: none;
|
|
2661
|
-
}
|
|
2662
|
-
.dsh-partner-mobile-companion-picker select {
|
|
2663
|
-
width: 100%;
|
|
2664
|
-
min-width: 0;
|
|
2665
|
-
min-height: 44px;
|
|
2666
|
-
padding: 0 38px 0 13px;
|
|
2667
|
-
overflow: hidden;
|
|
2668
|
-
border: 1px solid var(--partner-border);
|
|
2669
|
-
border-radius: 10px;
|
|
2670
|
-
color: var(--partner-text);
|
|
2671
|
-
background: var(--partner-control);
|
|
2672
|
-
background-image: none;
|
|
2673
|
-
box-shadow: inset 0 1px 0 var(--partner-glass-highlight);
|
|
2674
|
-
font: 560 16px/1.25 var(--partner-font-family);
|
|
2675
|
-
text-overflow: ellipsis;
|
|
2676
|
-
}
|
|
2677
2657
|
.dsh-partner-mobile-create {
|
|
2678
2658
|
display: grid;
|
|
2679
2659
|
width: 44px;
|
|
@@ -2687,7 +2667,7 @@ var responsive_ui_default = `/* Mobile composition lives separately from the des
|
|
|
2687
2667
|
box-shadow: inset 0 1px 0 var(--partner-glass-highlight);
|
|
2688
2668
|
}
|
|
2689
2669
|
|
|
2690
|
-
.dsh-partner-mobile-workspace-nav { gap: 6px; }
|
|
2670
|
+
.dsh-partner-mobile-workspace-nav { grid-column: 1 / -1; gap: 6px; }
|
|
2691
2671
|
.dsh-partner-mobile-workspace-nav button {
|
|
2692
2672
|
min-height: 44px;
|
|
2693
2673
|
padding: 0 9px;
|
|
@@ -2854,13 +2834,157 @@ var responsive_ui_default = `/* Mobile composition lives separately from the des
|
|
|
2854
2834
|
}
|
|
2855
2835
|
|
|
2856
2836
|
@media (max-width: 760px) and (max-height: 520px) and (orientation: landscape) {
|
|
2857
|
-
.dsh-partner-topbar { grid-template-columns: minmax(150px, .72fr) minmax(0, 1.28fr); align-items: center; flex-direction: row; gap: 8px; }
|
|
2858
|
-
.dsh-partner-mobile-controls { grid-template-columns: minmax(0, 1fr) minmax(190px, 1fr); }
|
|
2859
2837
|
.dsh-partner-stage-scroll { padding-bottom: 20px; }
|
|
2860
2838
|
.dsh-partner-workspace-dialog > header { padding-top: 10px; padding-bottom: 10px; }
|
|
2861
2839
|
}
|
|
2862
2840
|
`;
|
|
2863
2841
|
|
|
2842
|
+
// src/ui/companion-picker.css
|
|
2843
|
+
var companion_picker_default = '.dsh-partner-companion-picker { position: relative; min-width: 0; }\n.dsh-partner-companion-trigger,\n.dsh-partner-companion-options > button {\n display: flex;\n align-items: center;\n gap: 10px;\n width: 100%;\n min-width: 0;\n min-height: 48px;\n padding: 6px 10px;\n border: 1px solid var(--partner-border);\n border-radius: 10px;\n color: var(--partner-text);\n background: var(--partner-control);\n font: 500 var(--partner-font-body)/1.4 var(--partner-font-family);\n text-align: left;\n cursor: pointer;\n}\n.dsh-partner-companion-copy { display: grid; flex: 1; min-width: 0; gap: 2px; }\n.dsh-partner-companion-copy > strong { overflow: hidden; font-size: var(--partner-font-label); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-partner-companion-copy > small { overflow: hidden; color: var(--partner-text-secondary); font-size: var(--partner-font-caption); font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-partner-companion-picker .dsh-partner-avatar { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--partner-selected); box-shadow: none; }\n.dsh-partner-companion-chevron,\n.dsh-partner-companion-check { display: grid; flex: none; width: 16px; place-items: center; color: var(--partner-text-secondary); }\n.dsh-partner-companion-trigger[aria-expanded="true"] .dsh-partner-companion-chevron { transform: rotate(180deg); }\n.dsh-partner-companion-trigger:hover:not(:disabled),\n.dsh-partner-companion-trigger[aria-expanded="true"] { background: var(--partner-control-hover); border-color: var(--partner-text-tertiary); }\n/* Host themes target #root [role=listbox] with !important. Keep this one\n owned overlay legible without changing the host theme or workspace canvas. */\n:is(#root, .dsh-partner-workspace) .dsh-partner-companion-options[role="listbox"] {\n position: absolute;\n z-index: 10;\n top: calc(100% + 6px);\n left: 0;\n right: 0;\n display: grid;\n gap: 3px;\n max-height: min(320px, 45dvh);\n overflow-y: auto;\n overscroll-behavior: contain;\n scrollbar-width: thin;\n padding: 5px;\n border: 1px solid var(--partner-border) !important;\n border-radius: 12px !important;\n background: var(--partner-solid-panel) !important;\n -webkit-backdrop-filter: none;\n backdrop-filter: none;\n box-shadow: var(--partner-shadow-md) !important;\n}\n:is(#root, .dsh-partner-workspace) .dsh-partner-companion-options > [role="option"] {\n border-color: transparent;\n border-radius: 8px;\n color: var(--partner-text);\n background: transparent;\n box-shadow: none;\n transform: none;\n transition: none;\n}\n:is(#root, .dsh-partner-workspace) .dsh-partner-companion-options > [role="option"]:is(:hover, :focus-visible) { background: var(--partner-hover); }\n:is(#root, .dsh-partner-workspace) .dsh-partner-companion-options > [role="option"][aria-selected="true"] { background: var(--partner-selected); }\n:is(#root, .dsh-partner-workspace) .dsh-partner-companion-options > [role="option"]:focus-visible { outline: 2px solid var(--partner-focus-ring) !important; outline-offset: -2px !important; }\n';
|
|
2844
|
+
|
|
2845
|
+
// src/ui/companion-picker.tsx
|
|
2846
|
+
var import_react2 = require("react");
|
|
2847
|
+
var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
2848
|
+
|
|
2849
|
+
// src/ui/partner-components.tsx
|
|
2850
|
+
var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
2851
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
2852
|
+
function ChannelStatus({ channel }) {
|
|
2853
|
+
const status = channel?.runtimeStatus ?? "unbound";
|
|
2854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: `dsh-partner-status is-${status}`, children: [
|
|
2855
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", {}),
|
|
2856
|
+
channel ? channelStatusLabel(channel.runtimeStatus) : "\u672A\u8FDE\u63A5"
|
|
2857
|
+
] });
|
|
2858
|
+
}
|
|
2859
|
+
function Avatar({ name, small = false }) {
|
|
2860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `dsh-partner-avatar${small ? " is-small" : ""}`, "aria-hidden": "true", children: [...name][0] ?? "\u4F34" });
|
|
2861
|
+
}
|
|
2862
|
+
function WeixinGlyph({ large = false }) {
|
|
2863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: `dsh-partner-weixin-glyph${large ? " is-large" : ""}`, "aria-hidden": "true", children: [
|
|
2864
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", {}),
|
|
2865
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("b", {})
|
|
2866
|
+
] });
|
|
2867
|
+
}
|
|
2868
|
+
function TabButton({ active, onClick, icon, children }) {
|
|
2869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: active ? "is-active" : "", "aria-current": active ? "page" : void 0, onClick, children: [
|
|
2870
|
+
icon,
|
|
2871
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children })
|
|
2872
|
+
] });
|
|
2873
|
+
}
|
|
2874
|
+
function FormField({ label, hint, children }) {
|
|
2875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: "dsh-partner-field", children: [
|
|
2876
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
|
|
2877
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: label }),
|
|
2878
|
+
hint && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: hint })
|
|
2879
|
+
] }),
|
|
2880
|
+
children
|
|
2881
|
+
] });
|
|
2882
|
+
}
|
|
2883
|
+
function SectionHeading({ eyebrow, title, detail }) {
|
|
2884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className: "dsh-partner-section", children: [
|
|
2885
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: eyebrow }),
|
|
2886
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: title }),
|
|
2887
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: detail })
|
|
2888
|
+
] });
|
|
2889
|
+
}
|
|
2890
|
+
function ContentState({ title, detail, action, compact = false }) {
|
|
2891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `dsh-partner-state${compact ? " is-compact" : ""}`, children: [
|
|
2892
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconAgentPresetOutline16, { size: 20 }),
|
|
2893
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: title }),
|
|
2894
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: detail }),
|
|
2895
|
+
action
|
|
2896
|
+
] });
|
|
2897
|
+
}
|
|
2898
|
+
function relativeTime(value) {
|
|
2899
|
+
const minutes = Math.floor((Date.now() - value) / 6e4);
|
|
2900
|
+
return minutes < 1 ? "\u521A\u521A" : minutes < 60 ? `${minutes} \u5206\u949F\u524D` : minutes < 1440 ? `${Math.floor(minutes / 60)} \u5C0F\u65F6\u524D` : `${Math.floor(minutes / 1440)} \u5929\u524D`;
|
|
2901
|
+
}
|
|
2902
|
+
function channelStatusLabel(status) {
|
|
2903
|
+
return status === "running" ? "\u5FAE\u4FE1\u5728\u7EBF" : status === "starting" ? "\u8FDE\u63A5\u4E2D" : status === "error" ? "\u8FDE\u63A5\u5F02\u5E38" : "\u5DF2\u505C\u7528";
|
|
2904
|
+
}
|
|
2905
|
+
|
|
2906
|
+
// src/ui/companion-picker.tsx
|
|
2907
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
2908
|
+
function CompanionPicker({ companions, selectedId, onChange }) {
|
|
2909
|
+
const [open, setOpen] = (0, import_react2.useState)(false);
|
|
2910
|
+
const root = (0, import_react2.useRef)(null);
|
|
2911
|
+
const trigger = (0, import_react2.useRef)(null);
|
|
2912
|
+
const list = (0, import_react2.useRef)(null);
|
|
2913
|
+
const listId = (0, import_react2.useId)();
|
|
2914
|
+
const current = companions.find((item) => item.id === selectedId) ?? companions[0];
|
|
2915
|
+
(0, import_react2.useEffect)(() => {
|
|
2916
|
+
if (!open) return;
|
|
2917
|
+
const options = list.current?.querySelectorAll('[role="option"]');
|
|
2918
|
+
const selected = Math.max(0, companions.findIndex((item) => item.id === selectedId));
|
|
2919
|
+
options?.[selected]?.focus({ preventScroll: true });
|
|
2920
|
+
options?.[selected]?.scrollIntoView({ block: "nearest" });
|
|
2921
|
+
const outside = (event) => {
|
|
2922
|
+
if (!root.current?.contains(event.target)) setOpen(false);
|
|
2923
|
+
};
|
|
2924
|
+
const close = () => setOpen(false);
|
|
2925
|
+
const desktop = window.matchMedia("(min-width: 761px)");
|
|
2926
|
+
document.addEventListener("pointerdown", outside);
|
|
2927
|
+
window.addEventListener("blur", close);
|
|
2928
|
+
desktop.addEventListener("change", close);
|
|
2929
|
+
return () => {
|
|
2930
|
+
document.removeEventListener("pointerdown", outside);
|
|
2931
|
+
window.removeEventListener("blur", close);
|
|
2932
|
+
desktop.removeEventListener("change", close);
|
|
2933
|
+
};
|
|
2934
|
+
}, [open, companions, selectedId]);
|
|
2935
|
+
const dismiss = () => {
|
|
2936
|
+
setOpen(false);
|
|
2937
|
+
trigger.current?.focus({ preventScroll: true });
|
|
2938
|
+
};
|
|
2939
|
+
const navigate = (event) => {
|
|
2940
|
+
if (event.key === "Escape") {
|
|
2941
|
+
event.preventDefault();
|
|
2942
|
+
event.stopPropagation();
|
|
2943
|
+
dismiss();
|
|
2944
|
+
return;
|
|
2945
|
+
}
|
|
2946
|
+
const options = Array.from(list.current?.querySelectorAll('[role="option"]') ?? []);
|
|
2947
|
+
const index = options.indexOf(document.activeElement);
|
|
2948
|
+
let next;
|
|
2949
|
+
if (event.key === "ArrowDown") next = (index + 1) % options.length;
|
|
2950
|
+
else if (event.key === "ArrowUp") next = (index - 1 + options.length) % options.length;
|
|
2951
|
+
else if (event.key === "Home") next = 0;
|
|
2952
|
+
else if (event.key === "End") next = options.length - 1;
|
|
2953
|
+
else return;
|
|
2954
|
+
event.preventDefault();
|
|
2955
|
+
options[next]?.focus({ preventScroll: true });
|
|
2956
|
+
options[next]?.scrollIntoView({ block: "nearest" });
|
|
2957
|
+
};
|
|
2958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-partner-companion-picker", ref: root, onBlur: (event) => {
|
|
2959
|
+
if (!event.currentTarget.contains(event.relatedTarget)) setOpen(false);
|
|
2960
|
+
}, children: [
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { ref: trigger, type: "button", className: "dsh-partner-companion-trigger", "aria-label": `\u5207\u6362\u5F53\u524D\u4F19\u4F34${current ? `\uFF1A${current.name}` : ""}`, "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": open ? listId : void 0, disabled: !current, onClick: () => setOpen((value) => !value), onKeyDown: (event) => {
|
|
2962
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
2963
|
+
event.preventDefault();
|
|
2964
|
+
setOpen(true);
|
|
2965
|
+
}
|
|
2966
|
+
}, children: [
|
|
2967
|
+
current && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Avatar, { name: current.name, small: true }),
|
|
2968
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dsh-partner-companion-copy", children: [
|
|
2969
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: current?.name ?? "\u8FD8\u6CA1\u6709\u4F19\u4F34" }),
|
|
2970
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: current?.role || "\u9009\u62E9\u4F19\u4F34" })
|
|
2971
|
+
] }),
|
|
2972
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-partner-companion-chevron", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconChevronDownOutline14, { size: 14 }) })
|
|
2973
|
+
] }),
|
|
2974
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ref: list, id: listId, role: "listbox", "aria-label": "\u9009\u62E9\u4F19\u4F34", className: "dsh-partner-companion-options", onKeyDown: navigate, children: companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { type: "button", role: "option", "aria-selected": item.id === current?.id, tabIndex: item.id === current?.id ? 0 : -1, onClick: () => {
|
|
2975
|
+
dismiss();
|
|
2976
|
+
onChange(item.id);
|
|
2977
|
+
}, children: [
|
|
2978
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Avatar, { name: item.name, small: true }),
|
|
2979
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "dsh-partner-companion-copy", children: [
|
|
2980
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("strong", { children: item.name }),
|
|
2981
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("small", { children: item.role })
|
|
2982
|
+
] }),
|
|
2983
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-partner-companion-check", "aria-hidden": "true", children: item.id === current?.id && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconCheckOutline14, { size: 14 }) })
|
|
2984
|
+
] }, item.id)) })
|
|
2985
|
+
] });
|
|
2986
|
+
}
|
|
2987
|
+
|
|
2864
2988
|
// src/client-api.ts
|
|
2865
2989
|
var PARTNER_API = "/partner-local/v1";
|
|
2866
2990
|
async function api(path = "", init = {}) {
|
|
@@ -2883,9 +3007,9 @@ function loadPartner() {
|
|
|
2883
3007
|
}
|
|
2884
3008
|
|
|
2885
3009
|
// src/sidebar-anchor.ts
|
|
2886
|
-
var
|
|
3010
|
+
var import_react3 = require("react");
|
|
2887
3011
|
function useWorkspaceTopAnchor(ref) {
|
|
2888
|
-
(0,
|
|
3012
|
+
(0, import_react3.useEffect)(() => {
|
|
2889
3013
|
const element = ref.current;
|
|
2890
3014
|
const originalParent = element?.parentElement;
|
|
2891
3015
|
if (!element || !originalParent) return;
|
|
@@ -2938,8 +3062,8 @@ function futureTime(value, now = Date.now()) {
|
|
|
2938
3062
|
}
|
|
2939
3063
|
|
|
2940
3064
|
// src/glass-surface.tsx
|
|
2941
|
-
var
|
|
2942
|
-
var
|
|
3065
|
+
var import_react4 = require("react");
|
|
3066
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
2943
3067
|
function supportsSvgBackdropFilter(filterId) {
|
|
2944
3068
|
if (typeof window === "undefined" || typeof document === "undefined") return false;
|
|
2945
3069
|
if (window.matchMedia("(prefers-reduced-transparency: reduce)").matches) return false;
|
|
@@ -2979,22 +3103,22 @@ function GlassSurface({
|
|
|
2979
3103
|
saturation = 1.16,
|
|
2980
3104
|
...elementProps
|
|
2981
3105
|
}) {
|
|
2982
|
-
const uniqueId = (0,
|
|
3106
|
+
const uniqueId = (0, import_react4.useId)().replace(/:/g, "-");
|
|
2983
3107
|
const filterId = `partner-glass-filter-${uniqueId}`;
|
|
2984
3108
|
const redGradientId = `partner-glass-red-${uniqueId}`;
|
|
2985
3109
|
const blueGradientId = `partner-glass-blue-${uniqueId}`;
|
|
2986
|
-
const containerRef = (0,
|
|
2987
|
-
const imageRef = (0,
|
|
2988
|
-
const redRef = (0,
|
|
2989
|
-
const greenRef = (0,
|
|
2990
|
-
const blueRef = (0,
|
|
2991
|
-
const glareFrameRef = (0,
|
|
2992
|
-
const glarePointerRef = (0,
|
|
2993
|
-
const [svgSupported, setSvgSupported] = (0,
|
|
2994
|
-
(0,
|
|
3110
|
+
const containerRef = (0, import_react4.useRef)(null);
|
|
3111
|
+
const imageRef = (0, import_react4.useRef)(null);
|
|
3112
|
+
const redRef = (0, import_react4.useRef)(null);
|
|
3113
|
+
const greenRef = (0, import_react4.useRef)(null);
|
|
3114
|
+
const blueRef = (0, import_react4.useRef)(null);
|
|
3115
|
+
const glareFrameRef = (0, import_react4.useRef)(0);
|
|
3116
|
+
const glarePointerRef = (0, import_react4.useRef)();
|
|
3117
|
+
const [svgSupported, setSvgSupported] = (0, import_react4.useState)(false);
|
|
3118
|
+
(0, import_react4.useEffect)(() => {
|
|
2995
3119
|
setSvgSupported(supportsSvgBackdropFilter(filterId));
|
|
2996
3120
|
}, [filterId]);
|
|
2997
|
-
(0,
|
|
3121
|
+
(0, import_react4.useEffect)(() => {
|
|
2998
3122
|
if (!svgSupported) return;
|
|
2999
3123
|
const element = containerRef.current;
|
|
3000
3124
|
const image = imageRef.current;
|
|
@@ -3033,13 +3157,13 @@ function GlassSurface({
|
|
|
3033
3157
|
observer?.disconnect();
|
|
3034
3158
|
};
|
|
3035
3159
|
}, [blueGradientId, blur, borderRadius, borderWidth, brightness, opacity, redGradientId, svgSupported]);
|
|
3036
|
-
(0,
|
|
3160
|
+
(0, import_react4.useEffect)(() => {
|
|
3037
3161
|
if (!svgSupported) return;
|
|
3038
3162
|
const channels = [redRef.current, greenRef.current, blueRef.current];
|
|
3039
3163
|
const offsets = [0, 5, 10];
|
|
3040
3164
|
channels.forEach((channel, index) => channel?.setAttribute("scale", String(distortionScale + (offsets[index] ?? 0))));
|
|
3041
3165
|
}, [distortionScale, svgSupported]);
|
|
3042
|
-
(0,
|
|
3166
|
+
(0, import_react4.useEffect)(() => () => {
|
|
3043
3167
|
if (glareFrameRef.current !== 0) cancelAnimationFrame(glareFrameRef.current);
|
|
3044
3168
|
}, []);
|
|
3045
3169
|
const renderGlare = () => {
|
|
@@ -3078,7 +3202,7 @@ function GlassSurface({
|
|
|
3078
3202
|
"--partner-glare-x": "50%",
|
|
3079
3203
|
"--partner-glare-y": "50%"
|
|
3080
3204
|
};
|
|
3081
|
-
return /* @__PURE__ */ (0,
|
|
3205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3082
3206
|
Element,
|
|
3083
3207
|
{
|
|
3084
3208
|
...elementProps,
|
|
@@ -3088,17 +3212,17 @@ function GlassSurface({
|
|
|
3088
3212
|
onPointerMove: interactive ? (event) => moveGlare(event.clientX, event.clientY) : void 0,
|
|
3089
3213
|
onPointerLeave: interactive ? resetGlare : void 0,
|
|
3090
3214
|
children: [
|
|
3091
|
-
svgSupported && /* @__PURE__ */ (0,
|
|
3092
|
-
/* @__PURE__ */ (0,
|
|
3093
|
-
/* @__PURE__ */ (0,
|
|
3094
|
-
/* @__PURE__ */ (0,
|
|
3095
|
-
/* @__PURE__ */ (0,
|
|
3096
|
-
/* @__PURE__ */ (0,
|
|
3097
|
-
/* @__PURE__ */ (0,
|
|
3098
|
-
/* @__PURE__ */ (0,
|
|
3099
|
-
/* @__PURE__ */ (0,
|
|
3100
|
-
/* @__PURE__ */ (0,
|
|
3101
|
-
/* @__PURE__ */ (0,
|
|
3215
|
+
svgSupported && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { className: "dsh-partner-glass-filter", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("filter", { id: filterId, colorInterpolationFilters: "sRGB", x: "0%", y: "0%", width: "100%", height: "100%", children: [
|
|
3216
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("feImage", { ref: imageRef, x: "0", y: "0", width: "100%", height: "100%", preserveAspectRatio: "none", result: "map" }),
|
|
3217
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("feDisplacementMap", { ref: redRef, in: "SourceGraphic", in2: "map", result: "displaced-red" }),
|
|
3218
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("feColorMatrix", { in: "displaced-red", type: "matrix", values: "1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0", result: "red" }),
|
|
3219
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("feDisplacementMap", { ref: greenRef, in: "SourceGraphic", in2: "map", result: "displaced-green" }),
|
|
3220
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("feColorMatrix", { in: "displaced-green", type: "matrix", values: "0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0", result: "green" }),
|
|
3221
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("feDisplacementMap", { ref: blueRef, in: "SourceGraphic", in2: "map", result: "displaced-blue" }),
|
|
3222
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("feColorMatrix", { in: "displaced-blue", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0", result: "blue" }),
|
|
3223
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("feBlend", { in: "red", in2: "green", mode: "screen", result: "red-green" }),
|
|
3224
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("feBlend", { in: "red-green", in2: "blue", mode: "screen", result: "output" }),
|
|
3225
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("feGaussianBlur", { in: "output", stdDeviation: ".45" })
|
|
3102
3226
|
] }) }) }),
|
|
3103
3227
|
children
|
|
3104
3228
|
]
|
|
@@ -3107,40 +3231,40 @@ function GlassSurface({
|
|
|
3107
3231
|
}
|
|
3108
3232
|
|
|
3109
3233
|
// src/ui/skills-panel.tsx
|
|
3110
|
-
var
|
|
3111
|
-
var
|
|
3234
|
+
var import_react6 = require("react");
|
|
3235
|
+
var import_dsh_client_ui_primitives4 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
3112
3236
|
|
|
3113
3237
|
// src/ui/workspace-components.tsx
|
|
3114
|
-
var
|
|
3115
|
-
var
|
|
3116
|
-
var
|
|
3238
|
+
var import_react5 = require("react");
|
|
3239
|
+
var import_dsh_client_ui_primitives3 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
3240
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
3117
3241
|
function WorkspaceHero({ eyebrow, title, detail, actions }) {
|
|
3118
|
-
return /* @__PURE__ */ (0,
|
|
3119
|
-
/* @__PURE__ */ (0,
|
|
3120
|
-
/* @__PURE__ */ (0,
|
|
3121
|
-
/* @__PURE__ */ (0,
|
|
3122
|
-
/* @__PURE__ */ (0,
|
|
3242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { className: "dsh-partner-feature-hero", children: [
|
|
3243
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
|
|
3244
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("small", { children: eyebrow }),
|
|
3245
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { children: title }),
|
|
3246
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: detail })
|
|
3123
3247
|
] }),
|
|
3124
|
-
actions && /* @__PURE__ */ (0,
|
|
3248
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "dsh-partner-feature-hero-actions", children: actions })
|
|
3125
3249
|
] });
|
|
3126
3250
|
}
|
|
3127
3251
|
function WorkspaceBlock({ title, detail, actions, children, className = "" }) {
|
|
3128
|
-
return /* @__PURE__ */ (0,
|
|
3129
|
-
/* @__PURE__ */ (0,
|
|
3130
|
-
/* @__PURE__ */ (0,
|
|
3131
|
-
/* @__PURE__ */ (0,
|
|
3132
|
-
detail && /* @__PURE__ */ (0,
|
|
3252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: `dsh-partner-feature-block${className ? ` ${className}` : ""}`, children: [
|
|
3253
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { children: [
|
|
3254
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
|
|
3255
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: title }),
|
|
3256
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("small", { children: detail })
|
|
3133
3257
|
] }),
|
|
3134
|
-
actions && /* @__PURE__ */ (0,
|
|
3258
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { children: actions })
|
|
3135
3259
|
] }),
|
|
3136
3260
|
children
|
|
3137
3261
|
] });
|
|
3138
3262
|
}
|
|
3139
3263
|
function WorkspaceDialog({ eyebrow = "CREATE & CONFIGURE", title, detail, close, children, width = "regular" }) {
|
|
3140
|
-
const titleId = (0,
|
|
3141
|
-
const detailId = (0,
|
|
3142
|
-
const panelRef = (0,
|
|
3143
|
-
(0,
|
|
3264
|
+
const titleId = (0, import_react5.useId)();
|
|
3265
|
+
const detailId = (0, import_react5.useId)();
|
|
3266
|
+
const panelRef = (0, import_react5.useRef)(null);
|
|
3267
|
+
(0, import_react5.useEffect)(() => {
|
|
3144
3268
|
const previous = document.activeElement instanceof HTMLElement ? document.activeElement : void 0;
|
|
3145
3269
|
const frame = requestAnimationFrame(() => {
|
|
3146
3270
|
const panel = panelRef.current;
|
|
@@ -3171,58 +3295,58 @@ function WorkspaceDialog({ eyebrow = "CREATE & CONFIGURE", title, detail, close,
|
|
|
3171
3295
|
first?.focus();
|
|
3172
3296
|
}
|
|
3173
3297
|
};
|
|
3174
|
-
return /* @__PURE__ */ (0,
|
|
3298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "dsh-partner-workspace-dialog-layer", onPointerDown: (event) => {
|
|
3175
3299
|
if (event.target === event.currentTarget) close();
|
|
3176
|
-
}, children: /* @__PURE__ */ (0,
|
|
3177
|
-
/* @__PURE__ */ (0,
|
|
3178
|
-
/* @__PURE__ */ (0,
|
|
3179
|
-
/* @__PURE__ */ (0,
|
|
3180
|
-
/* @__PURE__ */ (0,
|
|
3181
|
-
/* @__PURE__ */ (0,
|
|
3300
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("dialog", { ref: panelRef, className: `dsh-partner-workspace-dialog is-${width}`, open: true, "aria-modal": "true", "aria-labelledby": titleId, "aria-describedby": detailId, onKeyDown: keyDown, children: [
|
|
3301
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("header", { children: [
|
|
3302
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { children: [
|
|
3303
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("small", { children: eyebrow }),
|
|
3304
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { id: titleId, children: title }),
|
|
3305
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id: detailId, children: detail })
|
|
3182
3306
|
] }),
|
|
3183
|
-
/* @__PURE__ */ (0,
|
|
3307
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", onClick: close, "aria-label": "\u5173\u95ED", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconCloseOutline16, { size: 16 }) })
|
|
3184
3308
|
] }),
|
|
3185
|
-
/* @__PURE__ */ (0,
|
|
3309
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "dsh-partner-workspace-dialog-body", children })
|
|
3186
3310
|
] }) });
|
|
3187
3311
|
}
|
|
3188
3312
|
function WorkspaceNotice({ children, kind = "error" }) {
|
|
3189
|
-
return /* @__PURE__ */ (0,
|
|
3190
|
-
/* @__PURE__ */ (0,
|
|
3313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { className: `dsh-partner-workspace-notice is-${kind}`, role: kind === "error" ? "alert" : "status", children: [
|
|
3314
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", {}),
|
|
3191
3315
|
children
|
|
3192
3316
|
] });
|
|
3193
3317
|
}
|
|
3194
3318
|
function CollectionEmpty({ title, detail, action }) {
|
|
3195
|
-
return /* @__PURE__ */ (0,
|
|
3196
|
-
/* @__PURE__ */ (0,
|
|
3197
|
-
/* @__PURE__ */ (0,
|
|
3198
|
-
detail && /* @__PURE__ */ (0,
|
|
3319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsh-partner-collection-empty", children: [
|
|
3320
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives3.IconAgentPresetOutline16, { size: 18 }) }),
|
|
3321
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: title }),
|
|
3322
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: detail }),
|
|
3199
3323
|
action
|
|
3200
3324
|
] });
|
|
3201
3325
|
}
|
|
3202
3326
|
function CollectionSkeleton({ rows = 3 }) {
|
|
3203
|
-
return /* @__PURE__ */ (0,
|
|
3327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "dsh-partner-collection-skeleton", "aria-label": "\u6B63\u5728\u52A0\u8F7D", "aria-busy": "true", children: Array.from({ length: rows }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("i", {}, index)) });
|
|
3204
3328
|
}
|
|
3205
3329
|
function errorMessage(value) {
|
|
3206
3330
|
return value instanceof Error ? value.message : String(value);
|
|
3207
3331
|
}
|
|
3208
3332
|
|
|
3209
3333
|
// src/ui/skills-panel.tsx
|
|
3210
|
-
var
|
|
3334
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
3211
3335
|
function SkillsPanel() {
|
|
3212
|
-
const [catalog, setCatalog] = (0,
|
|
3213
|
-
const [market, setMarket] = (0,
|
|
3214
|
-
const [query, setQuery] = (0,
|
|
3215
|
-
const [activeSource, setActiveSource] = (0,
|
|
3216
|
-
const [busy, setBusy] = (0,
|
|
3217
|
-
const [loading, setLoading] = (0,
|
|
3218
|
-
const [error, setError] = (0,
|
|
3219
|
-
const [actionError, setActionError] = (0,
|
|
3220
|
-
const [addingSource, setAddingSource] = (0,
|
|
3221
|
-
const [creatingSkill, setCreatingSkill] = (0,
|
|
3222
|
-
const [editingNetwork, setEditingNetwork] = (0,
|
|
3223
|
-
const [showAllInstalled, setShowAllInstalled] = (0,
|
|
3224
|
-
const [network, setNetwork] = (0,
|
|
3225
|
-
const load = (0,
|
|
3336
|
+
const [catalog, setCatalog] = (0, import_react6.useState)({ installed: [], bindings: [], sources: [] });
|
|
3337
|
+
const [market, setMarket] = (0, import_react6.useState)({ sources: [], entries: [], errors: [] });
|
|
3338
|
+
const [query, setQuery] = (0, import_react6.useState)("");
|
|
3339
|
+
const [activeSource, setActiveSource] = (0, import_react6.useState)("market-clawhub");
|
|
3340
|
+
const [busy, setBusy] = (0, import_react6.useState)();
|
|
3341
|
+
const [loading, setLoading] = (0, import_react6.useState)(true);
|
|
3342
|
+
const [error, setError] = (0, import_react6.useState)();
|
|
3343
|
+
const [actionError, setActionError] = (0, import_react6.useState)();
|
|
3344
|
+
const [addingSource, setAddingSource] = (0, import_react6.useState)(false);
|
|
3345
|
+
const [creatingSkill, setCreatingSkill] = (0, import_react6.useState)(false);
|
|
3346
|
+
const [editingNetwork, setEditingNetwork] = (0, import_react6.useState)(false);
|
|
3347
|
+
const [showAllInstalled, setShowAllInstalled] = (0, import_react6.useState)(false);
|
|
3348
|
+
const [network, setNetwork] = (0, import_react6.useState)({});
|
|
3349
|
+
const load = (0, import_react6.useCallback)(async (refresh = false) => {
|
|
3226
3350
|
try {
|
|
3227
3351
|
const [nextCatalog, nextMarket, nextNetwork] = await Promise.all([
|
|
3228
3352
|
api("/skills"),
|
|
@@ -3239,17 +3363,17 @@ function SkillsPanel() {
|
|
|
3239
3363
|
setLoading(false);
|
|
3240
3364
|
}
|
|
3241
3365
|
}, []);
|
|
3242
|
-
(0,
|
|
3366
|
+
(0, import_react6.useEffect)(() => {
|
|
3243
3367
|
void load();
|
|
3244
3368
|
}, [load]);
|
|
3245
3369
|
const installed = new Map(catalog.installed.map((item) => [item.id, item]));
|
|
3246
3370
|
const visibleInstalled = showAllInstalled ? catalog.installed : catalog.installed.slice(0, 4);
|
|
3247
|
-
const visible = (0,
|
|
3371
|
+
const visible = (0, import_react6.useMemo)(() => {
|
|
3248
3372
|
const normalized = query.trim().toLocaleLowerCase();
|
|
3249
3373
|
return market.entries.filter((item) => item.sourceId === activeSource && (!normalized || `${item.name} ${item.description} ${item.tags.join(" ")}`.toLocaleLowerCase().includes(normalized)));
|
|
3250
3374
|
}, [activeSource, market.entries, query]);
|
|
3251
3375
|
const sources = [{ id: "builtin", name: "\u5185\u7F6E\u7CBE\u9009" }, ...market.sources.map((source) => ({ id: source.id, name: source.name }))];
|
|
3252
|
-
const sourceCounts = (0,
|
|
3376
|
+
const sourceCounts = (0, import_react6.useMemo)(() => market.entries.reduce((counts, entry) => {
|
|
3253
3377
|
counts.set(entry.sourceId, (counts.get(entry.sourceId) ?? 0) + 1);
|
|
3254
3378
|
return counts;
|
|
3255
3379
|
}, /* @__PURE__ */ new Map()), [market.entries]);
|
|
@@ -3277,33 +3401,33 @@ function SkillsPanel() {
|
|
|
3277
3401
|
setBusy(void 0);
|
|
3278
3402
|
}
|
|
3279
3403
|
};
|
|
3280
|
-
return /* @__PURE__ */ (0,
|
|
3281
|
-
/* @__PURE__ */ (0,
|
|
3404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsh-partner-feature-page", children: [
|
|
3405
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WorkspaceHero, { eyebrow: "Capability catalog", title: "Skill \u5E02\u573A", detail: "\u96C6\u4E2D\u5B89\u88C5\u548C\u7EF4\u62A4\u5DE5\u4F5C\u80FD\u529B\uFF1B\u5B89\u88C5\u540E\uFF0C\u518D\u4E3A\u9700\u8981\u5B83\u7684\u4F19\u4F34\u5355\u72EC\u542F\u7528\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", { type: "button", disabled: loading, onClick: () => {
|
|
3282
3406
|
void load(true);
|
|
3283
3407
|
}, children: [
|
|
3284
|
-
/* @__PURE__ */ (0,
|
|
3408
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives4.IconRefreshOutline16, { size: 15 }),
|
|
3285
3409
|
loading ? "\u540C\u6B65\u4E2D\u2026" : "\u5237\u65B0\u5E02\u573A"
|
|
3286
3410
|
] }) }),
|
|
3287
|
-
error && /* @__PURE__ */ (0,
|
|
3288
|
-
creatingSkill && /* @__PURE__ */ (0,
|
|
3289
|
-
editingNetwork && /* @__PURE__ */ (0,
|
|
3411
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WorkspaceNotice, { children: error }),
|
|
3412
|
+
creatingSkill && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA Skill", detail: "\u521B\u5EFA\u4E00\u4E2A\u53EF\u590D\u7528\u7684\u5DE5\u4F5C\u6D41\u7A0B\uFF0C\u5E76\u660E\u786E\u6267\u884C\u4E0A\u4E0B\u6587\u3001\u5DE5\u5177\u8FB9\u754C\u548C\u9A8C\u6536\u6307\u4EE4\u3002", close: () => setCreatingSkill(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(NewSkillForm, { existingIds: catalog.installed.map((skill) => skill.id), close: () => setCreatingSkill(false), changed: load }) }),
|
|
3413
|
+
editingNetwork && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WorkspaceDialog, { title: "\u5E02\u573A\u7F51\u7EDC\u8BBE\u7F6E", detail: "\u914D\u7F6E Skill \u7D22\u5F15\u548C\u5B89\u88C5\u5305\u4E0B\u8F7D\u5171\u7528\u7684 HTTP \u4EE3\u7406\uFF0C\u5E76\u5728\u4FDD\u5B58\u524D\u6D4B\u8BD5\u8FDE\u901A\u6027\u3002", close: () => setEditingNetwork(false), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(NetworkSettingsForm, { value: network, close: () => setEditingNetwork(false), changed: async (next) => {
|
|
3290
3414
|
setNetwork(next);
|
|
3291
3415
|
await load(true);
|
|
3292
3416
|
} }) }),
|
|
3293
|
-
addingSource && /* @__PURE__ */ (0,
|
|
3294
|
-
/* @__PURE__ */ (0,
|
|
3295
|
-
/* @__PURE__ */ (0,
|
|
3417
|
+
addingSource && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WorkspaceDialog, { title: "\u6DFB\u52A0\u5E02\u573A\u6765\u6E90", detail: "\u63A5\u5165\u56E2\u961F\u6216\u4E2A\u4EBA\u7EF4\u62A4\u7684 Skill \u7D22\u5F15\u3002\u81EA\u5B9A\u4E49\u6765\u6E90\u9ED8\u8BA4\u6309\u4E0D\u53EF\u4FE1\u6765\u6E90\u9694\u79BB\u6267\u884C\u3002", close: () => setAddingSource(false), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(MarketSourceForm, { close: () => setAddingSource(false), changed: () => load(true) }) }),
|
|
3418
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WorkspaceBlock, { title: "\u5DF2\u5B89\u88C5", detail: `${catalog.installed.length} \u4E2A\u53EF\u4F9B\u4F19\u4F34\u4F7F\u7528`, actions: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", { type: "button", onClick: () => setCreatingSkill(true), children: [
|
|
3419
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives4.IconPlusOutline16, { size: 14 }),
|
|
3296
3420
|
"\u65B0\u5EFA Skill"
|
|
3297
|
-
] }), children: loading ? /* @__PURE__ */ (0,
|
|
3298
|
-
/* @__PURE__ */ (0,
|
|
3421
|
+
] }), children: loading ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CollectionSkeleton, { rows: 2 }) : catalog.installed.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u5B89\u88C5 Skill", detail: "\u53EF\u4EE5\u521B\u5EFA\u81EA\u5DF1\u7684 Skill\uFF0C\u6216\u4ECE\u4E0B\u65B9\u5E02\u573A\u9009\u62E9\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", { type: "button", onClick: () => setCreatingSkill(true), children: [
|
|
3422
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives4.IconPlusOutline16, { size: 14 }),
|
|
3299
3423
|
"\u65B0\u5EFA\u7B2C\u4E00\u4E2A Skill"
|
|
3300
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
3301
|
-
/* @__PURE__ */ (0,
|
|
3302
|
-
/* @__PURE__ */ (0,
|
|
3303
|
-
/* @__PURE__ */ (0,
|
|
3304
|
-
/* @__PURE__ */ (0,
|
|
3305
|
-
/* @__PURE__ */ (0,
|
|
3306
|
-
/* @__PURE__ */ (0,
|
|
3424
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
3425
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "dsh-partner-skill-installed is-market", children: visibleInstalled.map((skill) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("article", { children: [
|
|
3426
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsh-partner-skill-mark", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives4.IconCheckOutline16, { size: 16 }) }),
|
|
3427
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
|
|
3428
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: skill.displayName }),
|
|
3429
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: skill.description }),
|
|
3430
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("small", { children: [
|
|
3307
3431
|
skill.version,
|
|
3308
3432
|
" \xB7 ",
|
|
3309
3433
|
skill.executionContext === "fork" ? "\u4E34\u65F6\u4F1A\u8BDD" : "\u5F53\u524D\u4F1A\u8BDD",
|
|
@@ -3311,74 +3435,74 @@ function SkillsPanel() {
|
|
|
3311
3435
|
skill.source
|
|
3312
3436
|
] })
|
|
3313
3437
|
] }),
|
|
3314
|
-
/* @__PURE__ */ (0,
|
|
3438
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", className: "is-icon", disabled: busy === skill.id, "aria-label": `\u5378\u8F7D ${skill.displayName}`, onClick: () => {
|
|
3315
3439
|
void uninstall(skill.id);
|
|
3316
|
-
}, children: /* @__PURE__ */ (0,
|
|
3317
|
-
actionError?.kind === "uninstall" && actionError.id === skill.id && /* @__PURE__ */ (0,
|
|
3440
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives4.IconTrashOutline16, { size: 15 }) }),
|
|
3441
|
+
actionError?.kind === "uninstall" && actionError.id === skill.id && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { className: "dsh-partner-skill-action-error", role: "alert", children: [
|
|
3318
3442
|
"\u5378\u8F7D\u5931\u8D25\uFF1A",
|
|
3319
3443
|
actionError.message
|
|
3320
3444
|
] })
|
|
3321
3445
|
] }, skill.id)) }),
|
|
3322
|
-
catalog.installed.length > 4 && /* @__PURE__ */ (0,
|
|
3446
|
+
catalog.installed.length > 4 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", className: "dsh-partner-skill-disclosure", "aria-expanded": showAllInstalled, onClick: () => setShowAllInstalled((value) => !value), children: showAllInstalled ? "\u6536\u8D77\u5DF2\u5B89\u88C5 Skill" : `\u67E5\u770B\u5168\u90E8 ${catalog.installed.length} \u4E2A\u5DF2\u5B89\u88C5 Skill` })
|
|
3323
3447
|
] }) }),
|
|
3324
|
-
/* @__PURE__ */ (0,
|
|
3325
|
-
/* @__PURE__ */ (0,
|
|
3448
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(WorkspaceBlock, { title: "\u5E02\u573A\u76EE\u5F55", detail: "\u5185\u7F6E ClawHub\u3001LoopHub\u3001SkillHub\uFF0C\u4E0E nomifun \u5F53\u524D Skill \u699C\u5355\u4E00\u81F4", actions: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
3449
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", { type: "button", onClick: () => setEditingNetwork(true), children: [
|
|
3326
3450
|
"\u4EE3\u7406\u8BBE\u7F6E",
|
|
3327
3451
|
network.proxyUrl ? " \xB7 \u5DF2\u542F\u7528" : ""
|
|
3328
3452
|
] }),
|
|
3329
|
-
/* @__PURE__ */ (0,
|
|
3330
|
-
/* @__PURE__ */ (0,
|
|
3453
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", { type: "button", onClick: () => setAddingSource(true), children: [
|
|
3454
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives4.IconPlusOutline16, { size: 14 }),
|
|
3331
3455
|
"\u81EA\u5B9A\u4E49\u6E90"
|
|
3332
3456
|
] })
|
|
3333
3457
|
] }), children: [
|
|
3334
|
-
/* @__PURE__ */ (0,
|
|
3335
|
-
/* @__PURE__ */ (0,
|
|
3336
|
-
/* @__PURE__ */ (0,
|
|
3337
|
-
/* @__PURE__ */ (0,
|
|
3338
|
-
/* @__PURE__ */ (0,
|
|
3458
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsh-partner-market-toolbar", children: [
|
|
3459
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkillSearch, { value: query, change: setQuery, count: visible.length, label: "\u641C\u7D22 Skill \u5E02\u573A", placeholder: "\u641C\u7D22\u540D\u79F0\u3001\u8BF4\u660E\u6216\u6807\u7B7E", loading }),
|
|
3460
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("nav", { className: "dsh-partner-market-sources", "aria-label": "Skill \u5E02\u573A\u6765\u6E90", children: sources.map((source) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", { type: "button", className: activeSource === source.id ? "is-active" : "", "aria-pressed": activeSource === source.id, onClick: () => setActiveSource(source.id), children: [
|
|
3461
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: source.name }),
|
|
3462
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { children: sourceCounts.get(source.id) ?? 0 })
|
|
3339
3463
|
] }, source.id)) })
|
|
3340
3464
|
] }),
|
|
3341
|
-
market.errors.some((item) => item.sourceId === activeSource) && /* @__PURE__ */ (0,
|
|
3342
|
-
loading ? /* @__PURE__ */ (0,
|
|
3465
|
+
market.errors.some((item) => item.sourceId === activeSource) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsh-partner-inline-warning", children: market.errors.filter((item) => item.sourceId === activeSource).map((item) => item.error).join("\uFF1B") }),
|
|
3466
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CollectionSkeleton, { rows: 4 }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "dsh-partner-market-grid", children: visible.map((entry) => {
|
|
3343
3467
|
const current = installed.get(entry.id);
|
|
3344
3468
|
const cardError = actionError?.kind === "install" && actionError.id === entry.id ? actionError.message : void 0;
|
|
3345
3469
|
const errorId = cardError ? `dsh-partner-skill-error-${entry.id}` : void 0;
|
|
3346
|
-
return /* @__PURE__ */ (0,
|
|
3347
|
-
/* @__PURE__ */ (0,
|
|
3348
|
-
/* @__PURE__ */ (0,
|
|
3349
|
-
/* @__PURE__ */ (0,
|
|
3350
|
-
/* @__PURE__ */ (0,
|
|
3470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("article", { children: [
|
|
3471
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
|
|
3472
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { children: entry.tags.slice(0, 3).join(" \xB7 ") || "SKILL" }),
|
|
3473
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: entry.name }),
|
|
3474
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: entry.description })
|
|
3351
3475
|
] }),
|
|
3352
|
-
cardError && /* @__PURE__ */ (0,
|
|
3476
|
+
cardError && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { id: errorId, className: "dsh-partner-market-card-error", role: "alert", children: [
|
|
3353
3477
|
"\u5B89\u88C5\u5931\u8D25\uFF1A",
|
|
3354
3478
|
cardError
|
|
3355
3479
|
] }),
|
|
3356
|
-
/* @__PURE__ */ (0,
|
|
3357
|
-
/* @__PURE__ */ (0,
|
|
3480
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("footer", { children: [
|
|
3481
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("small", { children: [
|
|
3358
3482
|
"v",
|
|
3359
3483
|
entry.version
|
|
3360
3484
|
] }),
|
|
3361
|
-
current ? /* @__PURE__ */ (0,
|
|
3362
|
-
/* @__PURE__ */ (0,
|
|
3485
|
+
current ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", { type: "button", disabled: true, children: [
|
|
3486
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives4.IconCheckOutline16, { size: 14 }),
|
|
3363
3487
|
"\u5DF2\u5B89\u88C5"
|
|
3364
|
-
] }) : /* @__PURE__ */ (0,
|
|
3488
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", disabled: busy === entry.id, "aria-describedby": errorId, onClick: () => {
|
|
3365
3489
|
void install(entry);
|
|
3366
3490
|
}, children: busy === entry.id ? "\u5B89\u88C5\u4E2D\u2026" : cardError ? "\u91CD\u8BD5\u5B89\u88C5" : "\u5B89\u88C5" })
|
|
3367
3491
|
] })
|
|
3368
3492
|
] }, `${entry.sourceId}:${entry.id}`);
|
|
3369
3493
|
}) }),
|
|
3370
|
-
!loading && visible.length === 0 && /* @__PURE__ */ (0,
|
|
3494
|
+
!loading && visible.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CollectionEmpty, { title: query ? "\u6CA1\u6709\u5339\u914D\u7684 Skill" : "\u5F53\u524D\u6765\u6E90\u6682\u65F6\u4E0D\u53EF\u7528", detail: query ? "\u6362\u4E00\u4E2A\u5173\u952E\u8BCD\uFF0C\u6216\u5207\u6362\u5E02\u573A\u6765\u6E90\u3002" : "\u5237\u65B0\u5E02\u573A\uFF0C\u6216\u68C0\u67E5\u4EE3\u7406\u4E0E\u6765\u6E90\u914D\u7F6E\u3002" })
|
|
3371
3495
|
] })
|
|
3372
3496
|
] });
|
|
3373
3497
|
}
|
|
3374
3498
|
function CompanionSkillSettings({ companionId }) {
|
|
3375
|
-
const [catalog, setCatalog] = (0,
|
|
3376
|
-
const [busy, setBusy] = (0,
|
|
3377
|
-
const [error, setError] = (0,
|
|
3378
|
-
const [selecting, setSelecting] = (0,
|
|
3379
|
-
const [showAll, setShowAll] = (0,
|
|
3380
|
-
const [query, setQuery] = (0,
|
|
3381
|
-
const load = (0,
|
|
3499
|
+
const [catalog, setCatalog] = (0, import_react6.useState)({ installed: [], bindings: [], sources: [] });
|
|
3500
|
+
const [busy, setBusy] = (0, import_react6.useState)();
|
|
3501
|
+
const [error, setError] = (0, import_react6.useState)();
|
|
3502
|
+
const [selecting, setSelecting] = (0, import_react6.useState)(false);
|
|
3503
|
+
const [showAll, setShowAll] = (0, import_react6.useState)(false);
|
|
3504
|
+
const [query, setQuery] = (0, import_react6.useState)("");
|
|
3505
|
+
const load = (0, import_react6.useCallback)(async () => {
|
|
3382
3506
|
try {
|
|
3383
3507
|
setCatalog(await api("/skills"));
|
|
3384
3508
|
setError(void 0);
|
|
@@ -3386,18 +3510,18 @@ function CompanionSkillSettings({ companionId }) {
|
|
|
3386
3510
|
setError(errorMessage(reason));
|
|
3387
3511
|
}
|
|
3388
3512
|
}, []);
|
|
3389
|
-
(0,
|
|
3513
|
+
(0, import_react6.useEffect)(() => {
|
|
3390
3514
|
void load();
|
|
3391
3515
|
}, [load, companionId]);
|
|
3392
|
-
(0,
|
|
3516
|
+
(0, import_react6.useEffect)(() => {
|
|
3393
3517
|
setSelecting(false);
|
|
3394
3518
|
setShowAll(false);
|
|
3395
3519
|
setQuery("");
|
|
3396
3520
|
setError(void 0);
|
|
3397
3521
|
}, [companionId]);
|
|
3398
|
-
const enabled = (0,
|
|
3399
|
-
const enabledSkills = (0,
|
|
3400
|
-
const availableSkills = (0,
|
|
3522
|
+
const enabled = (0, import_react6.useMemo)(() => new Set(catalog.bindings.filter((item) => item.companionId === companionId && item.enabled).map((item) => item.skillId)), [catalog.bindings, companionId]);
|
|
3523
|
+
const enabledSkills = (0, import_react6.useMemo)(() => catalog.installed.filter((skill) => enabled.has(skill.id)), [catalog.installed, enabled]);
|
|
3524
|
+
const availableSkills = (0, import_react6.useMemo)(() => {
|
|
3401
3525
|
const normalized = query.trim().toLocaleLowerCase();
|
|
3402
3526
|
return catalog.installed.filter((skill) => !enabled.has(skill.id) && (!normalized || `${skill.displayName} ${skill.description} ${skill.id}`.toLocaleLowerCase().includes(normalized)));
|
|
3403
3527
|
}, [catalog.installed, enabled, query]);
|
|
@@ -3415,65 +3539,65 @@ function CompanionSkillSettings({ companionId }) {
|
|
|
3415
3539
|
setBusy(void 0);
|
|
3416
3540
|
}
|
|
3417
3541
|
};
|
|
3418
|
-
return /* @__PURE__ */ (0,
|
|
3419
|
-
/* @__PURE__ */ (0,
|
|
3420
|
-
/* @__PURE__ */ (0,
|
|
3421
|
-
/* @__PURE__ */ (0,
|
|
3422
|
-
/* @__PURE__ */ (0,
|
|
3542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("section", { className: "dsh-partner-capability-detail", "aria-labelledby": "dsh-partner-skill-capability-title", children: [
|
|
3543
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("header", { children: [
|
|
3544
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
|
|
3545
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { children: "PARTNER SKILLS" }),
|
|
3546
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { id: "dsh-partner-skill-capability-title", children: "\u5F53\u524D\u4F19\u4F34\u7684 Skill" })
|
|
3423
3547
|
] }),
|
|
3424
|
-
/* @__PURE__ */ (0,
|
|
3425
|
-
/* @__PURE__ */ (0,
|
|
3548
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsh-partner-capability-actions", children: [
|
|
3549
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("em", { children: [
|
|
3426
3550
|
enabledSkills.length,
|
|
3427
3551
|
" \u4E2A\u542F\u7528"
|
|
3428
3552
|
] }),
|
|
3429
|
-
catalog.installed.length > 0 && /* @__PURE__ */ (0,
|
|
3430
|
-
/* @__PURE__ */ (0,
|
|
3553
|
+
catalog.installed.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", { type: "button", "aria-expanded": selecting, onClick: () => setSelecting((value) => !value), children: [
|
|
3554
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives4.IconPlusOutline16, { size: 14 }),
|
|
3431
3555
|
"\u6DFB\u52A0 Skill"
|
|
3432
3556
|
] })
|
|
3433
3557
|
] })
|
|
3434
3558
|
] }),
|
|
3435
|
-
selecting && /* @__PURE__ */ (0,
|
|
3436
|
-
/* @__PURE__ */ (0,
|
|
3437
|
-
/* @__PURE__ */ (0,
|
|
3438
|
-
visibleAvailableSkills.map((skill) => /* @__PURE__ */ (0,
|
|
3439
|
-
/* @__PURE__ */ (0,
|
|
3440
|
-
/* @__PURE__ */ (0,
|
|
3441
|
-
/* @__PURE__ */ (0,
|
|
3442
|
-
/* @__PURE__ */ (0,
|
|
3559
|
+
selecting && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsh-partner-skill-picker", "aria-label": "\u6DFB\u52A0 Skill", children: [
|
|
3560
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkillSearch, { value: query, change: setQuery, count: availableSkills.length, label: "\u641C\u7D22\u53EF\u6DFB\u52A0\u7684 Skill", placeholder: "\u641C\u7D22\u540D\u79F0\u3001\u8BF4\u660E\u6216\u6807\u8BC6", autoFocus: true, compact: true }),
|
|
3561
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsh-partner-skill-picker-list", children: [
|
|
3562
|
+
visibleAvailableSkills.map((skill) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("article", { children: [
|
|
3563
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
|
|
3564
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: skill.displayName }),
|
|
3565
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: skill.description }),
|
|
3566
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { children: skill.executionContext === "fork" ? "\u9694\u79BB\u4E34\u65F6\u4F1A\u8BDD\u6267\u884C" : "\u53EF\u4FE1\u5F53\u524D\u4F1A\u8BDD\u6267\u884C" })
|
|
3443
3567
|
] }),
|
|
3444
|
-
/* @__PURE__ */ (0,
|
|
3568
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", disabled: busy === skill.id, onClick: () => {
|
|
3445
3569
|
void setBinding(skill.id, true);
|
|
3446
3570
|
}, children: busy === skill.id ? "\u6DFB\u52A0\u4E2D\u2026" : "\u6DFB\u52A0" })
|
|
3447
3571
|
] }, skill.id)),
|
|
3448
|
-
availableSkills.length === 0 && /* @__PURE__ */ (0,
|
|
3572
|
+
availableSkills.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsh-partner-skill-picker-empty", children: query ? "\u6CA1\u6709\u5339\u914D\u7684\u672A\u542F\u7528 Skill\u3002" : "\u6240\u6709\u5DF2\u5B89\u88C5 Skill \u90FD\u5DF2\u542F\u7528\u3002" })
|
|
3449
3573
|
] }),
|
|
3450
|
-
availableSkills.length > visibleAvailableSkills.length && /* @__PURE__ */ (0,
|
|
3574
|
+
availableSkills.length > visibleAvailableSkills.length && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("small", { className: "dsh-partner-skill-picker-limit", children: [
|
|
3451
3575
|
"\u8FD8\u6709 ",
|
|
3452
3576
|
availableSkills.length - visibleAvailableSkills.length,
|
|
3453
3577
|
" \u4E2A\u7ED3\u679C\uFF0C\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u7EE7\u7EED\u7B5B\u9009\u3002"
|
|
3454
3578
|
] })
|
|
3455
3579
|
] }),
|
|
3456
|
-
catalog.installed.length === 0 ? /* @__PURE__ */ (0,
|
|
3457
|
-
/* @__PURE__ */ (0,
|
|
3458
|
-
/* @__PURE__ */ (0,
|
|
3459
|
-
/* @__PURE__ */ (0,
|
|
3460
|
-
/* @__PURE__ */ (0,
|
|
3461
|
-
/* @__PURE__ */ (0,
|
|
3462
|
-
/* @__PURE__ */ (0,
|
|
3580
|
+
catalog.installed.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsh-partner-feature-empty", children: "\u5C1A\u672A\u5B89\u88C5 Skill\uFF0C\u8BF7\u5148\u4ECE\u5DE6\u4FA7\u7684 Skill \u5E02\u573A\u5B89\u88C5\u3002" }) : enabledSkills.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsh-partner-feature-empty", children: "\u5F53\u524D\u4F19\u4F34\u8FD8\u6CA1\u6709\u542F\u7528 Skill\u3002\u70B9\u51FB\u201C\u6DFB\u52A0 Skill\u201D\u9009\u62E9\u9700\u8981\u7684\u80FD\u529B\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
3581
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "dsh-partner-skill-installed is-binding", children: visibleEnabledSkills.map((skill) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("article", { children: [
|
|
3582
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsh-partner-skill-mark", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives4.IconCheckOutline16, { size: 16 }) }),
|
|
3583
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
|
|
3584
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: skill.displayName }),
|
|
3585
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: skill.description }),
|
|
3586
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { children: skill.executionContext === "fork" ? "\u9694\u79BB\u4E34\u65F6\u4F1A\u8BDD\u6267\u884C" : "\u53EF\u4FE1\u5F53\u524D\u4F1A\u8BDD\u6267\u884C" })
|
|
3463
3587
|
] }),
|
|
3464
|
-
/* @__PURE__ */ (0,
|
|
3588
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", className: "dsh-partner-skill-binding-action", disabled: busy === skill.id, "aria-label": `\u4ECE\u5F53\u524D\u4F19\u4F34\u505C\u7528 ${skill.displayName}`, onClick: () => {
|
|
3465
3589
|
void setBinding(skill.id, false);
|
|
3466
3590
|
}, children: busy === skill.id ? "\u5904\u7406\u4E2D\u2026" : "\u505C\u7528" })
|
|
3467
3591
|
] }, skill.id)) }),
|
|
3468
|
-
enabledSkills.length > 4 && /* @__PURE__ */ (0,
|
|
3592
|
+
enabledSkills.length > 4 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", className: "dsh-partner-skill-disclosure", "aria-expanded": showAll, onClick: () => setShowAll((value) => !value), children: showAll ? "\u6536\u8D77 Skill" : `\u67E5\u770B\u5168\u90E8 ${enabledSkills.length} \u4E2A Skill` })
|
|
3469
3593
|
] }),
|
|
3470
|
-
error && /* @__PURE__ */ (0,
|
|
3594
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error })
|
|
3471
3595
|
] });
|
|
3472
3596
|
}
|
|
3473
3597
|
function SkillSearch({ value, change, count, label, placeholder, loading = false, autoFocus = false, compact = false }) {
|
|
3474
|
-
return /* @__PURE__ */ (0,
|
|
3475
|
-
/* @__PURE__ */ (0,
|
|
3476
|
-
/* @__PURE__ */ (0,
|
|
3598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: `dsh-partner-skill-search${compact ? " is-compact" : ""}`, role: "search", "aria-label": label, children: [
|
|
3599
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsh-partner-skill-search-icon", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives4.IconSearchOutline16, { size: 16 }) }),
|
|
3600
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3477
3601
|
"input",
|
|
3478
3602
|
{
|
|
3479
3603
|
type: "search",
|
|
@@ -3490,13 +3614,13 @@ function SkillSearch({ value, change, count, label, placeholder, loading = false
|
|
|
3490
3614
|
}
|
|
3491
3615
|
}
|
|
3492
3616
|
),
|
|
3493
|
-
value && /* @__PURE__ */ (0,
|
|
3494
|
-
/* @__PURE__ */ (0,
|
|
3617
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", className: "dsh-partner-skill-search-clear", "aria-label": "\u6E05\u7A7A\u641C\u7D22", title: "\u6E05\u7A7A\u641C\u7D22", onClick: () => change(""), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives4.IconCloseOutline16, { size: 14 }) }),
|
|
3618
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsh-partner-skill-search-count", "aria-live": "polite", children: loading ? "\u540C\u6B65\u4E2D" : `${count} \u9879` })
|
|
3495
3619
|
] });
|
|
3496
3620
|
}
|
|
3497
3621
|
function NewSkillForm({ existingIds, close, changed }) {
|
|
3498
|
-
const [error, setError] = (0,
|
|
3499
|
-
const [busy, setBusy] = (0,
|
|
3622
|
+
const [error, setError] = (0, import_react6.useState)();
|
|
3623
|
+
const [busy, setBusy] = (0, import_react6.useState)(false);
|
|
3500
3624
|
const submit = async (event) => {
|
|
3501
3625
|
event.preventDefault();
|
|
3502
3626
|
const data = new FormData(event.currentTarget);
|
|
@@ -3525,51 +3649,51 @@ function NewSkillForm({ existingIds, close, changed }) {
|
|
|
3525
3649
|
setBusy(false);
|
|
3526
3650
|
}
|
|
3527
3651
|
};
|
|
3528
|
-
return /* @__PURE__ */ (0,
|
|
3652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-skill-form", "aria-busy": busy, onSubmit: (event) => {
|
|
3529
3653
|
void submit(event);
|
|
3530
3654
|
}, children: [
|
|
3531
|
-
/* @__PURE__ */ (0,
|
|
3532
|
-
/* @__PURE__ */ (0,
|
|
3533
|
-
/* @__PURE__ */ (0,
|
|
3655
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { children: [
|
|
3656
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "Skill \u540D\u79F0" }),
|
|
3657
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { name: "displayName", required: true, maxLength: 120, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u53D1\u5E03\u8BF4\u660E\u6574\u7406" })
|
|
3534
3658
|
] }),
|
|
3535
|
-
/* @__PURE__ */ (0,
|
|
3536
|
-
/* @__PURE__ */ (0,
|
|
3537
|
-
/* @__PURE__ */ (0,
|
|
3659
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { children: [
|
|
3660
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "Skill \u6807\u8BC6" }),
|
|
3661
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { name: "id", required: true, maxLength: 80, pattern: "[A-Za-z0-9][A-Za-z0-9._-]{0,79}", placeholder: "release-notes" })
|
|
3538
3662
|
] }),
|
|
3539
|
-
/* @__PURE__ */ (0,
|
|
3540
|
-
/* @__PURE__ */ (0,
|
|
3541
|
-
/* @__PURE__ */ (0,
|
|
3663
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "is-wide", children: [
|
|
3664
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u8BF4\u660E" }),
|
|
3665
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { name: "description", required: true, maxLength: 600, placeholder: "\u8BF4\u660E\u4EC0\u4E48\u65F6\u5019\u4F7F\u7528\uFF0C\u4EE5\u53CA\u8981\u89E3\u51B3\u4EC0\u4E48\u95EE\u9898" })
|
|
3542
3666
|
] }),
|
|
3543
|
-
/* @__PURE__ */ (0,
|
|
3544
|
-
/* @__PURE__ */ (0,
|
|
3545
|
-
/* @__PURE__ */ (0,
|
|
3546
|
-
/* @__PURE__ */ (0,
|
|
3547
|
-
/* @__PURE__ */ (0,
|
|
3667
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { children: [
|
|
3668
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u6267\u884C\u65B9\u5F0F" }),
|
|
3669
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("select", { name: "context", defaultValue: "fork", children: [
|
|
3670
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "fork", children: "\u9694\u79BB\u4E34\u65F6\u4F1A\u8BDD" }),
|
|
3671
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "inline", children: "\u53EF\u4FE1\u5F53\u524D\u4F1A\u8BDD" })
|
|
3548
3672
|
] })
|
|
3549
3673
|
] }),
|
|
3550
|
-
/* @__PURE__ */ (0,
|
|
3551
|
-
/* @__PURE__ */ (0,
|
|
3552
|
-
/* @__PURE__ */ (0,
|
|
3674
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { children: [
|
|
3675
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u5141\u8BB8\u7684\u5DE5\u5177" }),
|
|
3676
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { name: "allowedTools", maxLength: 1e3, placeholder: "\u591A\u4E2A\u5DE5\u5177\u7528\u9017\u53F7\u5206\u9694\uFF0C\u53EF\u7559\u7A7A" })
|
|
3553
3677
|
] }),
|
|
3554
|
-
/* @__PURE__ */ (0,
|
|
3555
|
-
/* @__PURE__ */ (0,
|
|
3556
|
-
/* @__PURE__ */ (0,
|
|
3678
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "is-wide", children: [
|
|
3679
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "Skill \u6307\u4EE4" }),
|
|
3680
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("textarea", { name: "instructions", required: true, maxLength: 5e5, rows: 8, placeholder: "\u5199\u6E05\u5DE5\u4F5C\u6B65\u9AA4\u3001\u8FB9\u754C\u3001\u8F93\u51FA\u683C\u5F0F\u548C\u9A8C\u6536\u6761\u4EF6" })
|
|
3557
3681
|
] }),
|
|
3558
|
-
error && /* @__PURE__ */ (0,
|
|
3559
|
-
/* @__PURE__ */ (0,
|
|
3560
|
-
/* @__PURE__ */ (0,
|
|
3561
|
-
/* @__PURE__ */ (0,
|
|
3562
|
-
/* @__PURE__ */ (0,
|
|
3682
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WorkspaceNotice, { children: error }),
|
|
3683
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("footer", { children: [
|
|
3684
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
3685
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
|
|
3686
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives4.IconPlusOutline16, { size: 14 }),
|
|
3563
3687
|
busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA Skill"
|
|
3564
3688
|
] })
|
|
3565
3689
|
] })
|
|
3566
3690
|
] });
|
|
3567
3691
|
}
|
|
3568
3692
|
function NetworkSettingsForm({ value, close, changed }) {
|
|
3569
|
-
const [proxyUrl, setProxyUrl] = (0,
|
|
3570
|
-
const [busy, setBusy] = (0,
|
|
3571
|
-
const [status, setStatus] = (0,
|
|
3572
|
-
const [error, setError] = (0,
|
|
3693
|
+
const [proxyUrl, setProxyUrl] = (0, import_react6.useState)(value.proxyUrl ?? "");
|
|
3694
|
+
const [busy, setBusy] = (0, import_react6.useState)();
|
|
3695
|
+
const [status, setStatus] = (0, import_react6.useState)();
|
|
3696
|
+
const [error, setError] = (0, import_react6.useState)();
|
|
3573
3697
|
const test = async () => {
|
|
3574
3698
|
setBusy("test");
|
|
3575
3699
|
setError(void 0);
|
|
@@ -3597,29 +3721,29 @@ function NetworkSettingsForm({ value, close, changed }) {
|
|
|
3597
3721
|
setBusy(void 0);
|
|
3598
3722
|
}
|
|
3599
3723
|
};
|
|
3600
|
-
return /* @__PURE__ */ (0,
|
|
3724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-network-form", "aria-busy": busy !== void 0, onSubmit: (event) => {
|
|
3601
3725
|
void save(event);
|
|
3602
3726
|
}, children: [
|
|
3603
|
-
/* @__PURE__ */ (0,
|
|
3604
|
-
/* @__PURE__ */ (0,
|
|
3605
|
-
/* @__PURE__ */ (0,
|
|
3606
|
-
/* @__PURE__ */ (0,
|
|
3727
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "is-wide", children: [
|
|
3728
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "HTTP \u4EE3\u7406" }),
|
|
3729
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { type: "url", autoFocus: true, value: proxyUrl, onChange: (event) => setProxyUrl(event.target.value), placeholder: "http://host.docker.internal:7893" }),
|
|
3730
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { children: "\u7559\u7A7A\u4E3A\u76F4\u8FDE\uFF1B\u5E02\u573A\u5217\u8868\u548C\u5B89\u88C5\u5305\u4E0B\u8F7D\u5171\u7528\u8FD9\u4E2A\u4EE3\u7406\u3002" })
|
|
3607
3731
|
] }),
|
|
3608
|
-
status && /* @__PURE__ */ (0,
|
|
3609
|
-
error && /* @__PURE__ */ (0,
|
|
3610
|
-
/* @__PURE__ */ (0,
|
|
3611
|
-
/* @__PURE__ */ (0,
|
|
3732
|
+
status && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WorkspaceNotice, { kind: "success", children: status }),
|
|
3733
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WorkspaceNotice, { children: error }),
|
|
3734
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("footer", { children: [
|
|
3735
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", disabled: busy !== void 0, onClick: () => {
|
|
3612
3736
|
void test();
|
|
3613
3737
|
}, children: busy === "test" ? "\u6D4B\u8BD5\u4E2D\u2026" : "\u6D4B\u8BD5\u8FDE\u63A5" }),
|
|
3614
|
-
/* @__PURE__ */ (0,
|
|
3615
|
-
/* @__PURE__ */ (0,
|
|
3616
|
-
/* @__PURE__ */ (0,
|
|
3738
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsh-partner-form-footer-spacer" }),
|
|
3739
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", disabled: busy !== void 0, onClick: close, children: "\u53D6\u6D88" }),
|
|
3740
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "submit", className: "is-primary", disabled: busy !== void 0, children: busy === "save" ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58\u8BBE\u7F6E" })
|
|
3617
3741
|
] })
|
|
3618
3742
|
] });
|
|
3619
3743
|
}
|
|
3620
3744
|
function MarketSourceForm({ close, changed }) {
|
|
3621
|
-
const [error, setError] = (0,
|
|
3622
|
-
const [busy, setBusy] = (0,
|
|
3745
|
+
const [error, setError] = (0, import_react6.useState)();
|
|
3746
|
+
const [busy, setBusy] = (0, import_react6.useState)(false);
|
|
3623
3747
|
const submit = async (event) => {
|
|
3624
3748
|
event.preventDefault();
|
|
3625
3749
|
const data = new FormData(event.currentTarget);
|
|
@@ -3635,21 +3759,21 @@ function MarketSourceForm({ close, changed }) {
|
|
|
3635
3759
|
setBusy(false);
|
|
3636
3760
|
}
|
|
3637
3761
|
};
|
|
3638
|
-
return /* @__PURE__ */ (0,
|
|
3762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-market-source-form", "aria-busy": busy, onSubmit: (event) => {
|
|
3639
3763
|
void submit(event);
|
|
3640
3764
|
}, children: [
|
|
3641
|
-
/* @__PURE__ */ (0,
|
|
3642
|
-
/* @__PURE__ */ (0,
|
|
3643
|
-
/* @__PURE__ */ (0,
|
|
3765
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { children: [
|
|
3766
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u6765\u6E90\u540D\u79F0" }),
|
|
3767
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { name: "name", required: true, maxLength: 100, autoFocus: true, placeholder: "\u56E2\u961F Skill \u5E02\u573A" })
|
|
3644
3768
|
] }),
|
|
3645
|
-
/* @__PURE__ */ (0,
|
|
3646
|
-
/* @__PURE__ */ (0,
|
|
3647
|
-
/* @__PURE__ */ (0,
|
|
3769
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { children: [
|
|
3770
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u7D22\u5F15 URL" }),
|
|
3771
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { name: "indexUrl", required: true, type: "url", placeholder: "https://example.com/skills.json" })
|
|
3648
3772
|
] }),
|
|
3649
|
-
error && /* @__PURE__ */ (0,
|
|
3650
|
-
/* @__PURE__ */ (0,
|
|
3651
|
-
/* @__PURE__ */ (0,
|
|
3652
|
-
/* @__PURE__ */ (0,
|
|
3773
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WorkspaceNotice, { children: error }),
|
|
3774
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("footer", { children: [
|
|
3775
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
3776
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u6DFB\u52A0\u4E2D\u2026" : "\u6DFB\u52A0\u6765\u6E90" })
|
|
3653
3777
|
] })
|
|
3654
3778
|
] });
|
|
3655
3779
|
}
|
|
@@ -3676,9 +3800,9 @@ function skillScalar(value) {
|
|
|
3676
3800
|
}
|
|
3677
3801
|
|
|
3678
3802
|
// src/ui/task-board-panel.tsx
|
|
3679
|
-
var
|
|
3680
|
-
var
|
|
3681
|
-
var
|
|
3803
|
+
var import_react7 = require("react");
|
|
3804
|
+
var import_dsh_client_ui_primitives5 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
3805
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
3682
3806
|
var COLUMNS = [
|
|
3683
3807
|
{ id: "backlog", label: "\u6536\u96C6\u7BB1" },
|
|
3684
3808
|
{ id: "ready", label: "\u5F85\u5F00\u59CB" },
|
|
@@ -3689,22 +3813,22 @@ var COLUMNS = [
|
|
|
3689
3813
|
];
|
|
3690
3814
|
var LIVE_REFRESH_MS = 4e3;
|
|
3691
3815
|
function TaskBoardPanel() {
|
|
3692
|
-
const [board, setBoard] = (0,
|
|
3693
|
-
const [directory, setDirectory] = (0,
|
|
3694
|
-
const [delegations, setDelegations] = (0,
|
|
3695
|
-
const [creating, setCreating] = (0,
|
|
3696
|
-
const [selectedTaskId, setSelectedTaskId] = (0,
|
|
3697
|
-
const [busy, setBusy] = (0,
|
|
3698
|
-
const [loading, setLoading] = (0,
|
|
3699
|
-
const [error, setError] = (0,
|
|
3700
|
-
const [syncedAt, setSyncedAt] = (0,
|
|
3701
|
-
const [query, setQuery] = (0,
|
|
3702
|
-
const [statusFilter, setStatusFilter] = (0,
|
|
3703
|
-
const [assigneeFilter, setAssigneeFilter] = (0,
|
|
3704
|
-
const deferredQuery = (0,
|
|
3705
|
-
const tasksById = (0,
|
|
3706
|
-
const directoryById = (0,
|
|
3707
|
-
const activeDelegationByTaskId = (0,
|
|
3816
|
+
const [board, setBoard] = (0, import_react7.useState)({ tasks: [], activities: [] });
|
|
3817
|
+
const [directory, setDirectory] = (0, import_react7.useState)([]);
|
|
3818
|
+
const [delegations, setDelegations] = (0, import_react7.useState)([]);
|
|
3819
|
+
const [creating, setCreating] = (0, import_react7.useState)(false);
|
|
3820
|
+
const [selectedTaskId, setSelectedTaskId] = (0, import_react7.useState)();
|
|
3821
|
+
const [busy, setBusy] = (0, import_react7.useState)();
|
|
3822
|
+
const [loading, setLoading] = (0, import_react7.useState)(true);
|
|
3823
|
+
const [error, setError] = (0, import_react7.useState)();
|
|
3824
|
+
const [syncedAt, setSyncedAt] = (0, import_react7.useState)();
|
|
3825
|
+
const [query, setQuery] = (0, import_react7.useState)("");
|
|
3826
|
+
const [statusFilter, setStatusFilter] = (0, import_react7.useState)("all");
|
|
3827
|
+
const [assigneeFilter, setAssigneeFilter] = (0, import_react7.useState)("all");
|
|
3828
|
+
const deferredQuery = (0, import_react7.useDeferredValue)(query.trim().toLocaleLowerCase());
|
|
3829
|
+
const tasksById = (0, import_react7.useMemo)(() => new Map(board.tasks.map((item) => [item.id, item])), [board.tasks]);
|
|
3830
|
+
const directoryById = (0, import_react7.useMemo)(() => new Map(directory.map((item) => [item.id, item])), [directory]);
|
|
3831
|
+
const activeDelegationByTaskId = (0, import_react7.useMemo)(() => {
|
|
3708
3832
|
const result = /* @__PURE__ */ new Map();
|
|
3709
3833
|
for (const delegation of delegations) {
|
|
3710
3834
|
if ((delegation.status === "queued" || delegation.status === "running") && !result.has(delegation.taskId)) result.set(delegation.taskId, delegation);
|
|
@@ -3712,24 +3836,24 @@ function TaskBoardPanel() {
|
|
|
3712
3836
|
return result;
|
|
3713
3837
|
}, [delegations]);
|
|
3714
3838
|
const selectedTask = selectedTaskId ? tasksById.get(selectedTaskId) : void 0;
|
|
3715
|
-
const dependentsById = (0,
|
|
3839
|
+
const dependentsById = (0, import_react7.useMemo)(() => {
|
|
3716
3840
|
const result = /* @__PURE__ */ new Map();
|
|
3717
3841
|
for (const task of board.tasks) for (const dependencyId of task.dependencyTaskIds) result.set(dependencyId, (result.get(dependencyId) ?? 0) + 1);
|
|
3718
3842
|
return result;
|
|
3719
3843
|
}, [board.tasks]);
|
|
3720
|
-
const scopedTasks = (0,
|
|
3844
|
+
const scopedTasks = (0, import_react7.useMemo)(() => board.tasks.filter((task) => {
|
|
3721
3845
|
if (assigneeFilter !== "all" && (task.assigneeCompanionId ?? "unassigned") !== assigneeFilter) return false;
|
|
3722
3846
|
if (!deferredQuery) return true;
|
|
3723
3847
|
const dependencies = task.dependencyTaskIds.map((id) => tasksById.get(id)?.title ?? "");
|
|
3724
3848
|
return [task.title, task.description, task.resultAbstract, task.resultSummary, directoryById.get(task.assigneeCompanionId ?? "")?.name, ...dependencies].some((value) => value?.toLocaleLowerCase().includes(deferredQuery));
|
|
3725
3849
|
}), [assigneeFilter, board.tasks, deferredQuery, directoryById, tasksById]);
|
|
3726
|
-
const statusCounts = (0,
|
|
3850
|
+
const statusCounts = (0, import_react7.useMemo)(() => {
|
|
3727
3851
|
const result = new Map(COLUMNS.map((column) => [column.id, 0]));
|
|
3728
3852
|
for (const task of scopedTasks) result.set(task.status, (result.get(task.status) ?? 0) + 1);
|
|
3729
3853
|
return result;
|
|
3730
3854
|
}, [scopedTasks]);
|
|
3731
3855
|
const visibleColumns = statusFilter === "all" ? COLUMNS : COLUMNS.filter((column) => column.id === statusFilter);
|
|
3732
|
-
const tasksByStatus = (0,
|
|
3856
|
+
const tasksByStatus = (0, import_react7.useMemo)(() => {
|
|
3733
3857
|
const priorityRank = { urgent: 3, high: 2, normal: 1, low: 0 };
|
|
3734
3858
|
const result = new Map(COLUMNS.map((column) => [column.id, []]));
|
|
3735
3859
|
for (const task of scopedTasks) {
|
|
@@ -3740,8 +3864,8 @@ function TaskBoardPanel() {
|
|
|
3740
3864
|
return result;
|
|
3741
3865
|
}, [scopedTasks, statusFilter]);
|
|
3742
3866
|
const visibleTaskCount = statusFilter === "all" ? scopedTasks.length : statusCounts.get(statusFilter) ?? 0;
|
|
3743
|
-
const loadingRef = (0,
|
|
3744
|
-
const load = (0,
|
|
3867
|
+
const loadingRef = (0, import_react7.useRef)(false);
|
|
3868
|
+
const load = (0, import_react7.useCallback)(async () => {
|
|
3745
3869
|
if (loadingRef.current) return;
|
|
3746
3870
|
loadingRef.current = true;
|
|
3747
3871
|
try {
|
|
@@ -3758,7 +3882,7 @@ function TaskBoardPanel() {
|
|
|
3758
3882
|
setLoading(false);
|
|
3759
3883
|
}
|
|
3760
3884
|
}, []);
|
|
3761
|
-
(0,
|
|
3885
|
+
(0, import_react7.useEffect)(() => {
|
|
3762
3886
|
void load();
|
|
3763
3887
|
const timer = window.setInterval(() => {
|
|
3764
3888
|
if (document.visibilityState === "visible") void load();
|
|
@@ -3848,20 +3972,20 @@ function TaskBoardPanel() {
|
|
|
3848
3972
|
setBusy(void 0);
|
|
3849
3973
|
}
|
|
3850
3974
|
};
|
|
3851
|
-
return /* @__PURE__ */ (0,
|
|
3852
|
-
/* @__PURE__ */ (0,
|
|
3853
|
-
/* @__PURE__ */ (0,
|
|
3854
|
-
/* @__PURE__ */ (0,
|
|
3975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsh-partner-feature-page is-board", children: [
|
|
3976
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WorkspaceHero, { eyebrow: "Shared workspace", title: "\u4F19\u4F34\u4EFB\u52A1\u770B\u677F", detail: "\u627F\u63A5\u591A\u6B65\u3001\u4F9D\u8D56\u548C\u8DE8\u4F19\u4F34\u5DE5\u4F5C\u3002\u524D\u7F6E\u4EFB\u52A1\u5B8C\u6210\u540E\u624D\u80FD\u6267\u884C\uFF0C\u7ED3\u679C\u9A8C\u6536\u901A\u8FC7\u540E\u624D\u4F1A\u89E3\u9501\u540E\u7EED\u4EFB\u52A1\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
3977
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "dsh-partner-board-live", title: syncedAt ? `\u6700\u8FD1\u540C\u6B65 ${new Date(syncedAt).toLocaleTimeString()}` : "\u6B63\u5728\u8FDE\u63A5", children: [
|
|
3978
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("i", {}),
|
|
3855
3979
|
"\u5B9E\u65F6\u540C\u6B65"
|
|
3856
3980
|
] }),
|
|
3857
|
-
/* @__PURE__ */ (0,
|
|
3858
|
-
/* @__PURE__ */ (0,
|
|
3981
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", onClick: () => setCreating(true), children: [
|
|
3982
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives5.IconPlusOutline16, { size: 15 }),
|
|
3859
3983
|
"\u65B0\u4EFB\u52A1"
|
|
3860
3984
|
] })
|
|
3861
3985
|
] }) }),
|
|
3862
|
-
error && /* @__PURE__ */ (0,
|
|
3863
|
-
creating && /* @__PURE__ */ (0,
|
|
3864
|
-
selectedTask && /* @__PURE__ */ (0,
|
|
3986
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WorkspaceNotice, { children: error }),
|
|
3987
|
+
creating && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u4EFB\u52A1", detail: "\u5199\u6E05\u76EE\u6807\u3001\u8D1F\u8D23\u4EBA\u548C\u9A8C\u6536\u8FB9\u754C\uFF1B\u53EA\u6709\u771F\u6B63\u5B58\u5728\u524D\u7F6E\u5173\u7CFB\u65F6\u624D\u6DFB\u52A0\u4F9D\u8D56\u3002", close: () => setCreating(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TaskForm, { companions: directory, tasks: board.tasks, close: () => setCreating(false), changed: load }) }),
|
|
3988
|
+
selectedTask && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WorkspaceDialog, { eyebrow: "TASK DETAIL", title: selectedTask.title, detail: taskDialogSummary(selectedTask, directory), close: () => setSelectedTaskId(void 0), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3865
3989
|
TaskDetail,
|
|
3866
3990
|
{
|
|
3867
3991
|
task: selectedTask,
|
|
@@ -3891,51 +4015,51 @@ function TaskBoardPanel() {
|
|
|
3891
4015
|
},
|
|
3892
4016
|
selectedTask.id
|
|
3893
4017
|
) }),
|
|
3894
|
-
loading ? /* @__PURE__ */ (0,
|
|
3895
|
-
/* @__PURE__ */ (0,
|
|
3896
|
-
/* @__PURE__ */ (0,
|
|
3897
|
-
/* @__PURE__ */ (0,
|
|
3898
|
-
/* @__PURE__ */ (0,
|
|
3899
|
-
/* @__PURE__ */ (0,
|
|
3900
|
-
query && /* @__PURE__ */ (0,
|
|
4018
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CollectionSkeleton, { rows: 6 }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
4019
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsh-partner-board-tools", children: [
|
|
4020
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "dsh-partner-board-search", children: [
|
|
4021
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u4EFB\u52A1" }),
|
|
4022
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives5.IconSearchOutline16, { size: 16 }) }),
|
|
4023
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: "\u641C\u7D22\u4EFB\u52A1\u3001\u8D1F\u8D23\u4EBA\u6216\u524D\u7F6E\u4EFB\u52A1" }),
|
|
4024
|
+
query && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: () => setQuery(""), "aria-label": "\u6E05\u9664\u4EFB\u52A1\u641C\u7D22", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives5.IconCloseOutline16, { size: 14 }) })
|
|
3901
4025
|
] }),
|
|
3902
|
-
/* @__PURE__ */ (0,
|
|
3903
|
-
/* @__PURE__ */ (0,
|
|
3904
|
-
/* @__PURE__ */ (0,
|
|
3905
|
-
/* @__PURE__ */ (0,
|
|
3906
|
-
/* @__PURE__ */ (0,
|
|
3907
|
-
directory.map((item) => /* @__PURE__ */ (0,
|
|
4026
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "dsh-partner-board-assignee", children: [
|
|
4027
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sr-only", children: "\u6309\u8D1F\u8D23\u4EBA\u7B5B\u9009" }),
|
|
4028
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("select", { value: assigneeFilter, onChange: (event) => setAssigneeFilter(event.target.value), children: [
|
|
4029
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "all", children: "\u5168\u90E8\u4F19\u4F34" }),
|
|
4030
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "unassigned", children: "\u672A\u6307\u6D3E" }),
|
|
4031
|
+
directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("option", { value: item.id, children: [
|
|
3908
4032
|
"@",
|
|
3909
4033
|
item.name
|
|
3910
4034
|
] }, item.id))
|
|
3911
4035
|
] })
|
|
3912
4036
|
] }),
|
|
3913
|
-
/* @__PURE__ */ (0,
|
|
4037
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("small", { "aria-live": "polite", children: [
|
|
3914
4038
|
"\u663E\u793A ",
|
|
3915
4039
|
visibleTaskCount,
|
|
3916
4040
|
" / ",
|
|
3917
4041
|
board.tasks.length
|
|
3918
4042
|
] })
|
|
3919
4043
|
] }),
|
|
3920
|
-
/* @__PURE__ */ (0,
|
|
3921
|
-
/* @__PURE__ */ (0,
|
|
3922
|
-
/* @__PURE__ */ (0,
|
|
3923
|
-
/* @__PURE__ */ (0,
|
|
4044
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("nav", { className: "dsh-partner-board-statuses", "aria-label": "\u6309\u4EFB\u52A1\u72B6\u6001\u7B5B\u9009", children: [
|
|
4045
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: statusFilter === "all" ? "is-active" : "", "aria-pressed": statusFilter === "all", onClick: () => setStatusFilter("all"), children: [
|
|
4046
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u5168\u90E8" }),
|
|
4047
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: scopedTasks.length })
|
|
3924
4048
|
] }),
|
|
3925
|
-
COLUMNS.map((column) => /* @__PURE__ */ (0,
|
|
3926
|
-
/* @__PURE__ */ (0,
|
|
3927
|
-
/* @__PURE__ */ (0,
|
|
4049
|
+
COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: statusFilter === column.id ? "is-active" : "", "aria-pressed": statusFilter === column.id, onClick: () => setStatusFilter(column.id), children: [
|
|
4050
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: column.label }),
|
|
4051
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: statusCounts.get(column.id) ?? 0 })
|
|
3928
4052
|
] }, column.id))
|
|
3929
4053
|
] }),
|
|
3930
|
-
/* @__PURE__ */ (0,
|
|
4054
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "dsh-partner-board", "data-focused": statusFilter !== "all", "aria-label": "\u4EFB\u52A1\u770B\u677F", children: visibleColumns.map((column) => {
|
|
3931
4055
|
const tasks = tasksByStatus.get(column.id) ?? [];
|
|
3932
4056
|
const columnTitleId = `dsh-partner-board-${column.id}`;
|
|
3933
|
-
return /* @__PURE__ */ (0,
|
|
3934
|
-
/* @__PURE__ */ (0,
|
|
3935
|
-
/* @__PURE__ */ (0,
|
|
3936
|
-
/* @__PURE__ */ (0,
|
|
4057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { "data-status": column.id, "data-empty": tasks.length === 0, "aria-labelledby": columnTitleId, children: [
|
|
4058
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { children: [
|
|
4059
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { id: columnTitleId, children: column.label }),
|
|
4060
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: tasks.length })
|
|
3937
4061
|
] }),
|
|
3938
|
-
tasks.length > 0 ? /* @__PURE__ */ (0,
|
|
4062
|
+
tasks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "dsh-partner-board-column-list", children: tasks.map((task) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3939
4063
|
TaskCard,
|
|
3940
4064
|
{
|
|
3941
4065
|
task,
|
|
@@ -3946,7 +4070,7 @@ function TaskBoardPanel() {
|
|
|
3946
4070
|
open: () => setSelectedTaskId(task.id)
|
|
3947
4071
|
},
|
|
3948
4072
|
task.id
|
|
3949
|
-
)) }) : /* @__PURE__ */ (0,
|
|
4073
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: query || assigneeFilter !== "all" ? "\u6CA1\u6709\u5339\u914D\u4EFB\u52A1" : "\u6682\u65E0\u4EFB\u52A1" })
|
|
3950
4074
|
] }, column.id);
|
|
3951
4075
|
}) })
|
|
3952
4076
|
] })
|
|
@@ -3958,38 +4082,38 @@ function TaskCard({ task, tasksById, directoryById, dependentCount, execution, o
|
|
|
3958
4082
|
const completedDependencies = dependencies.length - blockers.length;
|
|
3959
4083
|
const assignee = directoryById.get(task.assigneeCompanionId ?? "");
|
|
3960
4084
|
const executionState = execution ? delegationState(execution) : void 0;
|
|
3961
|
-
return /* @__PURE__ */ (0,
|
|
3962
|
-
/* @__PURE__ */ (0,
|
|
3963
|
-
/* @__PURE__ */ (0,
|
|
3964
|
-
/* @__PURE__ */ (0,
|
|
3965
|
-
/* @__PURE__ */ (0,
|
|
4085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("article", { className: "dsh-partner-task-card", "data-blocked": blockers.length > 0, "data-priority": task.priority, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "button", className: "dsh-partner-task-summary", "aria-haspopup": "dialog", onClick: open, children: [
|
|
4086
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
|
|
4087
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "dsh-partner-task-card-title", children: [
|
|
4088
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { title: task.title, children: task.title }),
|
|
4089
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("em", { children: priorityLabel(task.priority) })
|
|
3966
4090
|
] }),
|
|
3967
|
-
/* @__PURE__ */ (0,
|
|
4091
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("small", { className: "dsh-partner-task-card-owner", children: [
|
|
3968
4092
|
assignee ? `@${assignee.name}` : "\u672A\u6307\u6D3E",
|
|
3969
4093
|
task.resultSummary ? " \xB7 \u5DF2\u6709\u7ED3\u679C" : "",
|
|
3970
4094
|
executionState ? ` \xB7 ${executionState.label}` : ""
|
|
3971
4095
|
] }),
|
|
3972
|
-
(dependencies.length > 0 || dependentCount > 0) && /* @__PURE__ */ (0,
|
|
3973
|
-
dependencies.length > 0 && /* @__PURE__ */ (0,
|
|
4096
|
+
(dependencies.length > 0 || dependentCount > 0) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "dsh-partner-task-relations", children: [
|
|
4097
|
+
dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("small", { "data-blocked": blockers.length > 0, children: [
|
|
3974
4098
|
"\u524D\u7F6E ",
|
|
3975
4099
|
completedDependencies,
|
|
3976
4100
|
"/",
|
|
3977
4101
|
dependencies.length
|
|
3978
4102
|
] }),
|
|
3979
|
-
dependentCount > 0 && /* @__PURE__ */ (0,
|
|
4103
|
+
dependentCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("small", { children: [
|
|
3980
4104
|
"\u5B8C\u6210\u540E\u89E3\u9501 ",
|
|
3981
4105
|
dependentCount
|
|
3982
4106
|
] })
|
|
3983
4107
|
] })
|
|
3984
4108
|
] }),
|
|
3985
|
-
/* @__PURE__ */ (0,
|
|
4109
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives5.IconChevronRightOutline14, { size: 14 })
|
|
3986
4110
|
] }) });
|
|
3987
4111
|
}
|
|
3988
4112
|
function TaskDetail({ task, tasks, activities, directory, execution, busy, update, delegate, review, accept, reject, remove }) {
|
|
3989
|
-
const [rejecting, setRejecting] = (0,
|
|
3990
|
-
const [rejectReason, setRejectReason] = (0,
|
|
3991
|
-
const [confirmingDelete, setConfirmingDelete] = (0,
|
|
3992
|
-
const byId = (0,
|
|
4113
|
+
const [rejecting, setRejecting] = (0, import_react7.useState)(false);
|
|
4114
|
+
const [rejectReason, setRejectReason] = (0, import_react7.useState)("");
|
|
4115
|
+
const [confirmingDelete, setConfirmingDelete] = (0, import_react7.useState)(false);
|
|
4116
|
+
const byId = (0, import_react7.useMemo)(() => new Map(tasks.map((item) => [item.id, item])), [tasks]);
|
|
3993
4117
|
const dependencies = task.dependencyTaskIds.map((id) => byId.get(id)).filter((item) => item !== void 0);
|
|
3994
4118
|
const blockers = dependencies.filter((item) => item.status !== "done");
|
|
3995
4119
|
const assignee = directory.find((item) => item.id === task.assigneeCompanionId);
|
|
@@ -3998,21 +4122,21 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
|
|
|
3998
4122
|
const canExecute = Boolean(task.assigneeCompanionId) && blockers.length === 0 && !["doing", "review", "done"].includes(task.status);
|
|
3999
4123
|
const recentActivities = [...activities].sort((left, right) => right.at - left.at).slice(0, 6);
|
|
4000
4124
|
const executionState = execution ? delegationState(execution) : void 0;
|
|
4001
|
-
return /* @__PURE__ */ (0,
|
|
4002
|
-
/* @__PURE__ */ (0,
|
|
4003
|
-
/* @__PURE__ */ (0,
|
|
4004
|
-
/* @__PURE__ */ (0,
|
|
4125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsh-partner-task-detail", children: [
|
|
4126
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "dsh-partner-task-description", children: [
|
|
4127
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
|
|
4128
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: task.description || "\u6CA1\u6709\u8865\u5145\u8BF4\u660E" })
|
|
4005
4129
|
] }),
|
|
4006
|
-
/* @__PURE__ */ (0,
|
|
4007
|
-
/* @__PURE__ */ (0,
|
|
4008
|
-
/* @__PURE__ */ (0,
|
|
4009
|
-
/* @__PURE__ */ (0,
|
|
4130
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsh-partner-task-fields", children: [
|
|
4131
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { children: [
|
|
4132
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u72B6\u6001" }),
|
|
4133
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("select", { value: task.status, disabled: busy, onChange: (event) => update({ status: event.target.value }), children: COLUMNS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.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)) })
|
|
4010
4134
|
] }),
|
|
4011
|
-
/* @__PURE__ */ (0,
|
|
4012
|
-
/* @__PURE__ */ (0,
|
|
4013
|
-
/* @__PURE__ */ (0,
|
|
4014
|
-
/* @__PURE__ */ (0,
|
|
4015
|
-
directory.map((item) => /* @__PURE__ */ (0,
|
|
4135
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { children: [
|
|
4136
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
|
|
4137
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("select", { value: task.assigneeCompanionId ?? "", disabled: busy || task.status === "doing", onChange: (event) => update({ assigneeCompanionId: event.target.value }), children: [
|
|
4138
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
|
|
4139
|
+
directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("option", { value: item.id, children: [
|
|
4016
4140
|
"@",
|
|
4017
4141
|
item.name,
|
|
4018
4142
|
" \xB7 ",
|
|
@@ -4020,43 +4144,43 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
|
|
|
4020
4144
|
] }, item.id))
|
|
4021
4145
|
] })
|
|
4022
4146
|
] }),
|
|
4023
|
-
/* @__PURE__ */ (0,
|
|
4024
|
-
/* @__PURE__ */ (0,
|
|
4025
|
-
/* @__PURE__ */ (0,
|
|
4026
|
-
/* @__PURE__ */ (0,
|
|
4027
|
-
directory.map((item) => /* @__PURE__ */ (0,
|
|
4147
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { children: [
|
|
4148
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
|
|
4149
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("select", { value: task.reviewerCompanionId ?? "", disabled: busy, onChange: (event) => update({ reviewerCompanionId: event.target.value }), children: [
|
|
4150
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
|
|
4151
|
+
directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("option", { value: item.id, children: [
|
|
4028
4152
|
"@",
|
|
4029
4153
|
item.name
|
|
4030
4154
|
] }, item.id))
|
|
4031
4155
|
] })
|
|
4032
4156
|
] })
|
|
4033
4157
|
] }),
|
|
4034
|
-
executionState && /* @__PURE__ */ (0,
|
|
4035
|
-
/* @__PURE__ */ (0,
|
|
4036
|
-
/* @__PURE__ */ (0,
|
|
4037
|
-
/* @__PURE__ */ (0,
|
|
4038
|
-
/* @__PURE__ */ (0,
|
|
4158
|
+
executionState && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "dsh-partner-task-execution", "data-state": execution?.status, children: [
|
|
4159
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("i", {}),
|
|
4160
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
|
|
4161
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: executionState.title }),
|
|
4162
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("small", { children: executionState.detail })
|
|
4039
4163
|
] })
|
|
4040
4164
|
] }),
|
|
4041
|
-
/* @__PURE__ */ (0,
|
|
4042
|
-
/* @__PURE__ */ (0,
|
|
4043
|
-
/* @__PURE__ */ (0,
|
|
4044
|
-
/* @__PURE__ */ (0,
|
|
4165
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "dsh-partner-task-dependency", children: [
|
|
4166
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { children: [
|
|
4167
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: "\u524D\u7F6E\u4EFB\u52A1" }),
|
|
4168
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.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" })
|
|
4045
4169
|
] }),
|
|
4046
|
-
dependencies.length > 0 && /* @__PURE__ */ (0,
|
|
4047
|
-
/* @__PURE__ */ (0,
|
|
4048
|
-
/* @__PURE__ */ (0,
|
|
4049
|
-
/* @__PURE__ */ (0,
|
|
4170
|
+
dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { children: dependencies.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { "data-done": item.status === "done", children: [
|
|
4171
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("i", { children: item.status === "done" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives5.IconCheckOutline16, { size: 12 }) : "" }),
|
|
4172
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: item.title }),
|
|
4173
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.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" })
|
|
4050
4174
|
] }, item.id)) }),
|
|
4051
|
-
dependencyCandidates.length > 0 && /* @__PURE__ */ (0,
|
|
4052
|
-
/* @__PURE__ */ (0,
|
|
4053
|
-
/* @__PURE__ */ (0,
|
|
4175
|
+
dependencyCandidates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { children: [
|
|
4176
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sr-only", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1" }),
|
|
4177
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("select", { defaultValue: "", disabled: busy || ["doing", "review", "done"].includes(task.status), onChange: (event) => {
|
|
4054
4178
|
const id = event.currentTarget.value;
|
|
4055
4179
|
if (id) update({ dependencyTaskIds: [...task.dependencyTaskIds, id] });
|
|
4056
4180
|
event.currentTarget.value = "";
|
|
4057
4181
|
}, children: [
|
|
4058
|
-
/* @__PURE__ */ (0,
|
|
4059
|
-
dependencyCandidates.map((item) => /* @__PURE__ */ (0,
|
|
4182
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1\u2026" }),
|
|
4183
|
+
dependencyCandidates.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("option", { value: item.id, children: [
|
|
4060
4184
|
item.title,
|
|
4061
4185
|
" \xB7 ",
|
|
4062
4186
|
statusLabel(item.status)
|
|
@@ -4064,16 +4188,16 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
|
|
|
4064
4188
|
] })
|
|
4065
4189
|
] })
|
|
4066
4190
|
] }),
|
|
4067
|
-
task.resultSummary && /* @__PURE__ */ (0,
|
|
4068
|
-
task.reviewSummary && /* @__PURE__ */ (0,
|
|
4069
|
-
recentActivities.length > 0 && /* @__PURE__ */ (0,
|
|
4070
|
-
/* @__PURE__ */ (0,
|
|
4071
|
-
/* @__PURE__ */ (0,
|
|
4072
|
-
/* @__PURE__ */ (0,
|
|
4073
|
-
/* @__PURE__ */ (0,
|
|
4191
|
+
task.resultSummary && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ResultBlock, { label: "\u6267\u884C\u7ED3\u679C", value: task.resultSummary }),
|
|
4192
|
+
task.reviewSummary && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ResultBlock, { label: `\u6838\u9A8C\u610F\u89C1${reviewer ? ` \xB7 @${reviewer.name}` : ""}`, value: task.reviewSummary }),
|
|
4193
|
+
recentActivities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "dsh-partner-task-activity", children: [
|
|
4194
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: "\u6700\u8FD1\u6D3B\u52A8" }),
|
|
4195
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ol", { children: recentActivities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("li", { children: [
|
|
4196
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: item.message }),
|
|
4197
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("time", { children: new Date(item.at).toLocaleString() })
|
|
4074
4198
|
] }, item.id)) })
|
|
4075
4199
|
] }),
|
|
4076
|
-
rejecting && /* @__PURE__ */ (0,
|
|
4200
|
+
rejecting && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("form", { className: "dsh-partner-task-reject", onSubmit: (event) => {
|
|
4077
4201
|
event.preventDefault();
|
|
4078
4202
|
const reason = rejectReason.trim();
|
|
4079
4203
|
if (!reason) return;
|
|
@@ -4081,52 +4205,52 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
|
|
|
4081
4205
|
setRejecting(false);
|
|
4082
4206
|
setRejectReason("");
|
|
4083
4207
|
}, children: [
|
|
4084
|
-
/* @__PURE__ */ (0,
|
|
4085
|
-
/* @__PURE__ */ (0,
|
|
4086
|
-
/* @__PURE__ */ (0,
|
|
4208
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { children: [
|
|
4209
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u6253\u56DE\u539F\u56E0" }),
|
|
4210
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.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" })
|
|
4087
4211
|
] }),
|
|
4088
|
-
/* @__PURE__ */ (0,
|
|
4089
|
-
/* @__PURE__ */ (0,
|
|
4212
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
|
|
4213
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: () => {
|
|
4090
4214
|
setRejecting(false);
|
|
4091
4215
|
setRejectReason("");
|
|
4092
4216
|
}, children: "\u53D6\u6D88" }),
|
|
4093
|
-
/* @__PURE__ */ (0,
|
|
4217
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !rejectReason.trim(), children: "\u786E\u8BA4\u6253\u56DE" })
|
|
4094
4218
|
] })
|
|
4095
4219
|
] }),
|
|
4096
|
-
confirmingDelete && /* @__PURE__ */ (0,
|
|
4097
|
-
/* @__PURE__ */ (0,
|
|
4098
|
-
/* @__PURE__ */ (0,
|
|
4099
|
-
/* @__PURE__ */ (0,
|
|
4100
|
-
/* @__PURE__ */ (0,
|
|
4220
|
+
confirmingDelete && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsh-partner-task-delete-confirm", role: "alert", children: [
|
|
4221
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u5220\u9664\u540E\uFF0C\u4F9D\u8D56\u5B83\u7684\u4EFB\u52A1\u4F1A\u89E3\u9664\u8FD9\u6761\u524D\u7F6E\u5173\u7CFB\u3002" }),
|
|
4222
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
|
|
4223
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", onClick: () => setConfirmingDelete(false), children: "\u53D6\u6D88" }),
|
|
4224
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
|
|
4101
4225
|
] })
|
|
4102
4226
|
] }),
|
|
4103
|
-
/* @__PURE__ */ (0,
|
|
4104
|
-
/* @__PURE__ */ (0,
|
|
4227
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("footer", { className: "dsh-partner-task-actions", children: [
|
|
4228
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("small", { children: [
|
|
4105
4229
|
"r",
|
|
4106
4230
|
task.revision,
|
|
4107
4231
|
" \xB7 ",
|
|
4108
4232
|
new Date(task.updatedAt).toLocaleString()
|
|
4109
4233
|
] }),
|
|
4110
|
-
/* @__PURE__ */ (0,
|
|
4111
|
-
task.status === "review" ? /* @__PURE__ */ (0,
|
|
4112
|
-
task.reviewerCompanionId && /* @__PURE__ */ (0,
|
|
4113
|
-
/* @__PURE__ */ (0,
|
|
4114
|
-
/* @__PURE__ */ (0,
|
|
4115
|
-
] }) : /* @__PURE__ */ (0,
|
|
4116
|
-
/* @__PURE__ */ (0,
|
|
4234
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
|
|
4235
|
+
task.status === "review" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
4236
|
+
task.reviewerCompanionId && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", disabled: busy, onClick: review, children: busy ? "\u6838\u9A8C\u4E2D\u2026" : `\u4EA4\u7ED9 @${reviewer?.name ?? "\u4F19\u4F34"} \u6838\u9A8C` }),
|
|
4237
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", disabled: busy, onClick: () => setRejecting(true), children: "\u6253\u56DE\u91CD\u505A" }),
|
|
4238
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: accept, children: "\u9A8C\u6536\u901A\u8FC7" })
|
|
4239
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", disabled: busy || !canExecute, title: blockers.length ? "\u524D\u7F6E\u4EFB\u52A1\u5C1A\u672A\u5B8C\u6210" : !task.assigneeCompanionId ? "\u8BF7\u5148\u9009\u62E9\u8D1F\u8D23\u4EBA" : void 0, onClick: delegate, children: busy ? "\u6267\u884C\u4E2D\u2026" : task.status === "doing" ? "\u6B63\u5728\u6267\u884C" : task.status === "done" ? "\u5DF2\u7ECF\u5B8C\u6210" : `\u4EA4\u7ED9 @${assignee?.name ?? "\u4F19\u4F34"}` }),
|
|
4240
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.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_runtime6.jsx)(import_dsh_client_ui_primitives5.IconTrashOutline16, { size: 14 }) })
|
|
4117
4241
|
] })
|
|
4118
4242
|
] })
|
|
4119
4243
|
] });
|
|
4120
4244
|
}
|
|
4121
4245
|
function ResultBlock({ label, value }) {
|
|
4122
|
-
return /* @__PURE__ */ (0,
|
|
4123
|
-
/* @__PURE__ */ (0,
|
|
4124
|
-
/* @__PURE__ */ (0,
|
|
4246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "dsh-partner-task-result", children: [
|
|
4247
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: label }),
|
|
4248
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: value })
|
|
4125
4249
|
] });
|
|
4126
4250
|
}
|
|
4127
4251
|
function TaskForm({ companions, tasks, close, changed }) {
|
|
4128
|
-
const [error, setError] = (0,
|
|
4129
|
-
const [busy, setBusy] = (0,
|
|
4252
|
+
const [error, setError] = (0, import_react7.useState)();
|
|
4253
|
+
const [busy, setBusy] = (0, import_react7.useState)(false);
|
|
4130
4254
|
const dependencyOptions = tasks.filter((item) => item.status !== "done");
|
|
4131
4255
|
const submit = async (event) => {
|
|
4132
4256
|
event.preventDefault();
|
|
@@ -4151,64 +4275,64 @@ function TaskForm({ companions, tasks, close, changed }) {
|
|
|
4151
4275
|
setBusy(false);
|
|
4152
4276
|
}
|
|
4153
4277
|
};
|
|
4154
|
-
return /* @__PURE__ */ (0,
|
|
4278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("form", { className: "dsh-partner-task-form", "aria-busy": busy, onSubmit: (event) => {
|
|
4155
4279
|
void submit(event);
|
|
4156
4280
|
}, children: [
|
|
4157
|
-
/* @__PURE__ */ (0,
|
|
4158
|
-
/* @__PURE__ */ (0,
|
|
4159
|
-
/* @__PURE__ */ (0,
|
|
4281
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { children: [
|
|
4282
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u4EFB\u52A1\u540D\u79F0" }),
|
|
4283
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { name: "title", maxLength: 200, required: true, autoFocus: true, placeholder: "\u4E00\u53E5\u8BDD\u8BF4\u660E\u4EA4\u4ED8\u76EE\u6807" })
|
|
4160
4284
|
] }),
|
|
4161
|
-
/* @__PURE__ */ (0,
|
|
4162
|
-
/* @__PURE__ */ (0,
|
|
4163
|
-
/* @__PURE__ */ (0,
|
|
4164
|
-
/* @__PURE__ */ (0,
|
|
4165
|
-
companions.map((item) => /* @__PURE__ */ (0,
|
|
4285
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { children: [
|
|
4286
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
|
|
4287
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("select", { name: "assignee", defaultValue: "", children: [
|
|
4288
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
|
|
4289
|
+
companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("option", { value: item.id, children: [
|
|
4166
4290
|
"@",
|
|
4167
4291
|
item.name
|
|
4168
4292
|
] }, item.id))
|
|
4169
4293
|
] })
|
|
4170
4294
|
] }),
|
|
4171
|
-
/* @__PURE__ */ (0,
|
|
4172
|
-
/* @__PURE__ */ (0,
|
|
4173
|
-
/* @__PURE__ */ (0,
|
|
4295
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { className: "is-wide", children: [
|
|
4296
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
|
|
4297
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("textarea", { name: "description", maxLength: 8e3, rows: 5, placeholder: "\u8865\u5145\u80CC\u666F\u3001\u4EA4\u4ED8\u7269\u548C\u5B8C\u6210\u6761\u4EF6" })
|
|
4174
4298
|
] }),
|
|
4175
|
-
/* @__PURE__ */ (0,
|
|
4176
|
-
/* @__PURE__ */ (0,
|
|
4177
|
-
/* @__PURE__ */ (0,
|
|
4178
|
-
/* @__PURE__ */ (0,
|
|
4179
|
-
/* @__PURE__ */ (0,
|
|
4180
|
-
/* @__PURE__ */ (0,
|
|
4181
|
-
/* @__PURE__ */ (0,
|
|
4299
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { children: [
|
|
4300
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u4F18\u5148\u7EA7" }),
|
|
4301
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("select", { name: "priority", defaultValue: "normal", children: [
|
|
4302
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "low", children: "\u4F4E" }),
|
|
4303
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "normal", children: "\u666E\u901A" }),
|
|
4304
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "high", children: "\u9AD8" }),
|
|
4305
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "urgent", children: "\u7D27\u6025" })
|
|
4182
4306
|
] })
|
|
4183
4307
|
] }),
|
|
4184
|
-
/* @__PURE__ */ (0,
|
|
4185
|
-
/* @__PURE__ */ (0,
|
|
4186
|
-
/* @__PURE__ */ (0,
|
|
4187
|
-
/* @__PURE__ */ (0,
|
|
4188
|
-
companions.map((item) => /* @__PURE__ */ (0,
|
|
4308
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { children: [
|
|
4309
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
|
|
4310
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("select", { name: "reviewer", defaultValue: "", children: [
|
|
4311
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
|
|
4312
|
+
companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("option", { value: item.id, children: [
|
|
4189
4313
|
"@",
|
|
4190
4314
|
item.name
|
|
4191
4315
|
] }, item.id))
|
|
4192
4316
|
] })
|
|
4193
4317
|
] }),
|
|
4194
|
-
/* @__PURE__ */ (0,
|
|
4195
|
-
/* @__PURE__ */ (0,
|
|
4318
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsh-partner-task-form-dependencies is-wide", children: [
|
|
4319
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
|
|
4196
4320
|
"\u4F9D\u8D56\u4EFB\u52A1 ",
|
|
4197
|
-
/* @__PURE__ */ (0,
|
|
4321
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("small", { children: "\u53EF\u9009" })
|
|
4198
4322
|
] }),
|
|
4199
|
-
dependencyOptions.length > 0 ? /* @__PURE__ */ (0,
|
|
4200
|
-
/* @__PURE__ */ (0,
|
|
4201
|
-
/* @__PURE__ */ (0,
|
|
4202
|
-
/* @__PURE__ */ (0,
|
|
4203
|
-
/* @__PURE__ */ (0,
|
|
4204
|
-
] }, item.id)) }) : /* @__PURE__ */ (0,
|
|
4205
|
-
/* @__PURE__ */ (0,
|
|
4323
|
+
dependencyOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { children: dependencyOptions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { children: [
|
|
4324
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { type: "checkbox", name: "dependencyTaskId", value: item.id }),
|
|
4325
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("i", {}),
|
|
4326
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: item.title }),
|
|
4327
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("small", { children: statusLabel(item.status) })
|
|
4328
|
+
] }, item.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: "\u5F53\u524D\u6CA1\u6709\u53EF\u9009\u7684\u672A\u5B8C\u6210\u4EFB\u52A1" }),
|
|
4329
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.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" })
|
|
4206
4330
|
] }),
|
|
4207
|
-
error && /* @__PURE__ */ (0,
|
|
4208
|
-
/* @__PURE__ */ (0,
|
|
4209
|
-
/* @__PURE__ */ (0,
|
|
4210
|
-
/* @__PURE__ */ (0,
|
|
4211
|
-
/* @__PURE__ */ (0,
|
|
4331
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WorkspaceNotice, { children: error }),
|
|
4332
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("footer", { children: [
|
|
4333
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
4334
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
|
|
4335
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives5.IconPlusOutline16, { size: 14 }),
|
|
4212
4336
|
busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u4EFB\u52A1"
|
|
4213
4337
|
] })
|
|
4214
4338
|
] })
|
|
@@ -4245,17 +4369,17 @@ function delegationState(value) {
|
|
|
4245
4369
|
}
|
|
4246
4370
|
|
|
4247
4371
|
// src/ui/schedule-panel.tsx
|
|
4248
|
-
var
|
|
4249
|
-
var
|
|
4250
|
-
var
|
|
4372
|
+
var import_react8 = require("react");
|
|
4373
|
+
var import_dsh_client_ui_primitives6 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
4374
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
4251
4375
|
function SchedulePanel({ companions }) {
|
|
4252
|
-
const [schedules, setSchedules] = (0,
|
|
4253
|
-
const [runs, setRuns] = (0,
|
|
4254
|
-
const [creating, setCreating] = (0,
|
|
4255
|
-
const [busy, setBusy] = (0,
|
|
4256
|
-
const [loading, setLoading] = (0,
|
|
4257
|
-
const [error, setError] = (0,
|
|
4258
|
-
const load = (0,
|
|
4376
|
+
const [schedules, setSchedules] = (0, import_react8.useState)([]);
|
|
4377
|
+
const [runs, setRuns] = (0, import_react8.useState)([]);
|
|
4378
|
+
const [creating, setCreating] = (0, import_react8.useState)(false);
|
|
4379
|
+
const [busy, setBusy] = (0, import_react8.useState)();
|
|
4380
|
+
const [loading, setLoading] = (0, import_react8.useState)(true);
|
|
4381
|
+
const [error, setError] = (0, import_react8.useState)();
|
|
4382
|
+
const load = (0, import_react8.useCallback)(async () => {
|
|
4259
4383
|
try {
|
|
4260
4384
|
const value = await api("/schedules");
|
|
4261
4385
|
setSchedules(value.schedules);
|
|
@@ -4267,7 +4391,7 @@ function SchedulePanel({ companions }) {
|
|
|
4267
4391
|
setLoading(false);
|
|
4268
4392
|
}
|
|
4269
4393
|
}, []);
|
|
4270
|
-
(0,
|
|
4394
|
+
(0, import_react8.useEffect)(() => {
|
|
4271
4395
|
void load();
|
|
4272
4396
|
}, [load]);
|
|
4273
4397
|
const update = async (entry, value) => {
|
|
@@ -4303,65 +4427,65 @@ function SchedulePanel({ companions }) {
|
|
|
4303
4427
|
setBusy(void 0);
|
|
4304
4428
|
}
|
|
4305
4429
|
};
|
|
4306
|
-
return /* @__PURE__ */ (0,
|
|
4307
|
-
/* @__PURE__ */ (0,
|
|
4308
|
-
/* @__PURE__ */ (0,
|
|
4430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsh-partner-feature-page", children: [
|
|
4431
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.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_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
4432
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", disabled: loading, onClick: () => {
|
|
4309
4433
|
void load();
|
|
4310
4434
|
}, children: [
|
|
4311
|
-
/* @__PURE__ */ (0,
|
|
4435
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives6.IconRefreshOutline16, { size: 15 }),
|
|
4312
4436
|
"\u5237\u65B0"
|
|
4313
4437
|
] }),
|
|
4314
|
-
/* @__PURE__ */ (0,
|
|
4315
|
-
/* @__PURE__ */ (0,
|
|
4438
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
|
|
4439
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives6.IconPlusOutline16, { size: 15 }),
|
|
4316
4440
|
"\u65B0\u8BA1\u5212"
|
|
4317
4441
|
] })
|
|
4318
4442
|
] }) }),
|
|
4319
|
-
error && /* @__PURE__ */ (0,
|
|
4320
|
-
creating && /* @__PURE__ */ (0,
|
|
4321
|
-
/* @__PURE__ */ (0,
|
|
4322
|
-
/* @__PURE__ */ (0,
|
|
4443
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(WorkspaceNotice, { children: error }),
|
|
4444
|
+
creating && /* @__PURE__ */ (0, import_jsx_runtime7.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_runtime7.jsx)(ScheduleForm, { companions, close: () => setCreating(false), changed: load }) }),
|
|
4445
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(WorkspaceBlock, { title: "\u6267\u884C\u8BA1\u5212", detail: `${schedules.filter((item) => item.enabled).length} \u4E2A\u542F\u7528`, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CollectionSkeleton, { rows: 3 }) : schedules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.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_runtime7.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
|
|
4446
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives6.IconPlusOutline16, { size: 14 }),
|
|
4323
4447
|
"\u521B\u5EFA\u7B2C\u4E00\u4E2A\u8BA1\u5212"
|
|
4324
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
4325
|
-
/* @__PURE__ */ (0,
|
|
4326
|
-
/* @__PURE__ */ (0,
|
|
4327
|
-
/* @__PURE__ */ (0,
|
|
4328
|
-
/* @__PURE__ */ (0,
|
|
4329
|
-
/* @__PURE__ */ (0,
|
|
4448
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "dsh-partner-schedule-list", children: schedules.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("article", { children: [
|
|
4449
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
|
|
4450
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("strong", { children: entry.title }),
|
|
4451
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: entry.prompt }),
|
|
4452
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "dsh-partner-schedule-meta", children: [
|
|
4453
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("em", { children: [
|
|
4330
4454
|
"@",
|
|
4331
4455
|
companionName(companions, entry.companionId)
|
|
4332
4456
|
] }),
|
|
4333
|
-
/* @__PURE__ */ (0,
|
|
4334
|
-
/* @__PURE__ */ (0,
|
|
4457
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("em", { children: scheduleLabel(entry) }),
|
|
4458
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("em", { children: [
|
|
4335
4459
|
"\u4E0B\u6B21 ",
|
|
4336
4460
|
new Date(entry.nextRunAt).toLocaleString()
|
|
4337
4461
|
] }),
|
|
4338
|
-
/* @__PURE__ */ (0,
|
|
4462
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("em", { children: entry.destroySessionAfterRun ? "\u6267\u884C\u540E\u9500\u6BC1" : "\u4FDD\u7559\u4F1A\u8BDD" })
|
|
4339
4463
|
] })
|
|
4340
4464
|
] }),
|
|
4341
|
-
/* @__PURE__ */ (0,
|
|
4465
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "dsh-partner-feature-switch", "data-on": entry.enabled, "aria-pressed": entry.enabled, disabled: busy === entry.id, onClick: () => {
|
|
4342
4466
|
void update(entry, { enabled: !entry.enabled });
|
|
4343
|
-
}, children: /* @__PURE__ */ (0,
|
|
4344
|
-
/* @__PURE__ */ (0,
|
|
4467
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("i", {}) }),
|
|
4468
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", disabled: busy === entry.id, onClick: () => {
|
|
4345
4469
|
void run(entry);
|
|
4346
4470
|
}, children: [
|
|
4347
|
-
/* @__PURE__ */ (0,
|
|
4471
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives6.IconPlayOutline16, { size: 14 }),
|
|
4348
4472
|
busy === entry.id ? "\u6267\u884C\u4E2D\u2026" : "\u7ACB\u5373\u6267\u884C"
|
|
4349
4473
|
] }),
|
|
4350
|
-
/* @__PURE__ */ (0,
|
|
4474
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "is-icon", disabled: busy === entry.id, onClick: () => {
|
|
4351
4475
|
void remove(entry);
|
|
4352
|
-
}, "aria-label": `\u5220\u9664 ${entry.title}`, children: /* @__PURE__ */ (0,
|
|
4476
|
+
}, "aria-label": `\u5220\u9664 ${entry.title}`, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives6.IconTrashOutline16, { size: 14 }) })
|
|
4353
4477
|
] }, entry.id)) }) }),
|
|
4354
|
-
/* @__PURE__ */ (0,
|
|
4355
|
-
/* @__PURE__ */ (0,
|
|
4356
|
-
/* @__PURE__ */ (0,
|
|
4357
|
-
/* @__PURE__ */ (0,
|
|
4358
|
-
/* @__PURE__ */ (0,
|
|
4478
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(WorkspaceBlock, { title: "\u6700\u8FD1\u8FD0\u884C", detail: "\u4FDD\u7559\u6700\u8FD1\u7684\u72B6\u6001\u4E0E\u7ED3\u679C\u6458\u8981", children: [
|
|
4479
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "dsh-partner-run-list", children: runs.map((run2) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("article", { "data-status": run2.status, children: [
|
|
4480
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("i", {}),
|
|
4481
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
|
|
4482
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("strong", { children: [
|
|
4359
4483
|
schedules.find((item) => item.id === run2.sourceId)?.title ?? "\u5DF2\u5220\u9664\u8BA1\u5212",
|
|
4360
4484
|
" \xB7 @",
|
|
4361
4485
|
companionName(companions, run2.ownerCompanionId)
|
|
4362
4486
|
] }),
|
|
4363
|
-
/* @__PURE__ */ (0,
|
|
4364
|
-
/* @__PURE__ */ (0,
|
|
4487
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: run2.error || run2.outputSummary || "\u7B49\u5F85\u7ED3\u679C" }),
|
|
4488
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("small", { children: [
|
|
4365
4489
|
new Date(run2.startedAt).toLocaleString(),
|
|
4366
4490
|
" \xB7 ",
|
|
4367
4491
|
run2.status,
|
|
@@ -4370,14 +4494,14 @@ function SchedulePanel({ companions }) {
|
|
|
4370
4494
|
] })
|
|
4371
4495
|
] })
|
|
4372
4496
|
] }, run2.id)) }),
|
|
4373
|
-
!loading && runs.length === 0 && /* @__PURE__ */ (0,
|
|
4497
|
+
!loading && runs.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime7.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" })
|
|
4374
4498
|
] })
|
|
4375
4499
|
] });
|
|
4376
4500
|
}
|
|
4377
4501
|
function ScheduleForm({ companions, close, changed }) {
|
|
4378
|
-
const [kind, setKind] = (0,
|
|
4379
|
-
const [error, setError] = (0,
|
|
4380
|
-
const [busy, setBusy] = (0,
|
|
4502
|
+
const [kind, setKind] = (0, import_react8.useState)("interval");
|
|
4503
|
+
const [error, setError] = (0, import_react8.useState)();
|
|
4504
|
+
const [busy, setBusy] = (0, import_react8.useState)(false);
|
|
4381
4505
|
const submit = async (event) => {
|
|
4382
4506
|
event.preventDefault();
|
|
4383
4507
|
const data = new FormData(event.currentTarget);
|
|
@@ -4394,18 +4518,18 @@ function ScheduleForm({ companions, close, changed }) {
|
|
|
4394
4518
|
setBusy(false);
|
|
4395
4519
|
}
|
|
4396
4520
|
};
|
|
4397
|
-
return /* @__PURE__ */ (0,
|
|
4521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("form", { className: "dsh-partner-schedule-form", "aria-busy": busy, onSubmit: (event) => {
|
|
4398
4522
|
void submit(event);
|
|
4399
4523
|
}, children: [
|
|
4400
|
-
/* @__PURE__ */ (0,
|
|
4401
|
-
/* @__PURE__ */ (0,
|
|
4402
|
-
/* @__PURE__ */ (0,
|
|
4524
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
|
|
4525
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "\u8BA1\u5212\u540D\u79F0" }),
|
|
4526
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { name: "title", required: true, maxLength: 160, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u6BCF\u65E5\u6574\u7406\u9879\u76EE\u53D8\u5316" })
|
|
4403
4527
|
] }),
|
|
4404
|
-
/* @__PURE__ */ (0,
|
|
4405
|
-
/* @__PURE__ */ (0,
|
|
4406
|
-
/* @__PURE__ */ (0,
|
|
4407
|
-
/* @__PURE__ */ (0,
|
|
4408
|
-
companions.map((companion) => /* @__PURE__ */ (0,
|
|
4528
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
|
|
4529
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "\u6267\u884C\u4F19\u4F34" }),
|
|
4530
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("select", { name: "companionId", required: true, defaultValue: companions[0]?.id ?? "", children: [
|
|
4531
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "", disabled: true, children: "\u9009\u62E9\u4F19\u4F34" }),
|
|
4532
|
+
companions.map((companion) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("option", { value: companion.id, children: [
|
|
4409
4533
|
"@",
|
|
4410
4534
|
companion.name,
|
|
4411
4535
|
" \xB7 ",
|
|
@@ -4413,51 +4537,51 @@ function ScheduleForm({ companions, close, changed }) {
|
|
|
4413
4537
|
] }, companion.id))
|
|
4414
4538
|
] })
|
|
4415
4539
|
] }),
|
|
4416
|
-
/* @__PURE__ */ (0,
|
|
4417
|
-
/* @__PURE__ */ (0,
|
|
4418
|
-
/* @__PURE__ */ (0,
|
|
4540
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "is-wide", children: [
|
|
4541
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "\u6267\u884C\u5185\u5BB9" }),
|
|
4542
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.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" })
|
|
4419
4543
|
] }),
|
|
4420
|
-
/* @__PURE__ */ (0,
|
|
4421
|
-
/* @__PURE__ */ (0,
|
|
4422
|
-
/* @__PURE__ */ (0,
|
|
4423
|
-
/* @__PURE__ */ (0,
|
|
4424
|
-
/* @__PURE__ */ (0,
|
|
4544
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
|
|
4545
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "\u9891\u7387" }),
|
|
4546
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("select", { value: kind, onChange: (event) => setKind(event.target.value), children: [
|
|
4547
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "interval", children: "\u6BCF\u9694\u4E00\u6BB5\u65F6\u95F4" }),
|
|
4548
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "daily", children: "\u6BCF\u5929\u56FA\u5B9A\u65F6\u95F4" })
|
|
4425
4549
|
] })
|
|
4426
4550
|
] }),
|
|
4427
|
-
kind === "interval" ? /* @__PURE__ */ (0,
|
|
4428
|
-
/* @__PURE__ */ (0,
|
|
4429
|
-
/* @__PURE__ */ (0,
|
|
4430
|
-
] }) : /* @__PURE__ */ (0,
|
|
4431
|
-
/* @__PURE__ */ (0,
|
|
4432
|
-
/* @__PURE__ */ (0,
|
|
4433
|
-
/* @__PURE__ */ (0,
|
|
4551
|
+
kind === "interval" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
|
|
4552
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "\u95F4\u9694\u5206\u949F" }),
|
|
4553
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { name: "minutes", type: "number", min: 5, max: 43200, defaultValue: 60 })
|
|
4554
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsh-partner-schedule-time", children: [
|
|
4555
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
|
|
4556
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "\u5C0F\u65F6" }),
|
|
4557
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { name: "hour", type: "number", min: 0, max: 23, defaultValue: 9 })
|
|
4434
4558
|
] }),
|
|
4435
|
-
/* @__PURE__ */ (0,
|
|
4436
|
-
/* @__PURE__ */ (0,
|
|
4437
|
-
/* @__PURE__ */ (0,
|
|
4559
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
|
|
4560
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "\u5206\u949F" }),
|
|
4561
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { name: "minute", type: "number", min: 0, max: 59, defaultValue: 0 })
|
|
4438
4562
|
] })
|
|
4439
4563
|
] }),
|
|
4440
|
-
/* @__PURE__ */ (0,
|
|
4441
|
-
/* @__PURE__ */ (0,
|
|
4442
|
-
/* @__PURE__ */ (0,
|
|
4443
|
-
/* @__PURE__ */ (0,
|
|
4444
|
-
/* @__PURE__ */ (0,
|
|
4564
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
|
|
4565
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "\u91CD\u53E0\u7B56\u7565" }),
|
|
4566
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("select", { name: "overlapPolicy", defaultValue: "skip", children: [
|
|
4567
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "skip", children: "\u8DF3\u8FC7\u91CD\u53E0" }),
|
|
4568
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "queue", children: "\u6392\u961F\u6267\u884C" })
|
|
4445
4569
|
] })
|
|
4446
4570
|
] }),
|
|
4447
|
-
/* @__PURE__ */ (0,
|
|
4448
|
-
/* @__PURE__ */ (0,
|
|
4449
|
-
/* @__PURE__ */ (0,
|
|
4571
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
|
|
4572
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "\u8D85\u65F6\u5206\u949F" }),
|
|
4573
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { name: "timeoutMinutes", type: "number", min: 1, max: 120, defaultValue: 10 })
|
|
4450
4574
|
] }),
|
|
4451
|
-
/* @__PURE__ */ (0,
|
|
4452
|
-
/* @__PURE__ */ (0,
|
|
4453
|
-
/* @__PURE__ */ (0,
|
|
4454
|
-
/* @__PURE__ */ (0,
|
|
4575
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "dsh-partner-check is-wide", children: [
|
|
4576
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { name: "retain", type: "checkbox" }),
|
|
4577
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("i", {}),
|
|
4578
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "\u6267\u884C\u540E\u4FDD\u7559\u4E34\u65F6\u4F1A\u8BDD" })
|
|
4455
4579
|
] }),
|
|
4456
|
-
error && /* @__PURE__ */ (0,
|
|
4457
|
-
/* @__PURE__ */ (0,
|
|
4458
|
-
/* @__PURE__ */ (0,
|
|
4459
|
-
/* @__PURE__ */ (0,
|
|
4460
|
-
/* @__PURE__ */ (0,
|
|
4580
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(WorkspaceNotice, { children: error }),
|
|
4581
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("footer", { children: [
|
|
4582
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
4583
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
|
|
4584
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives6.IconPlusOutline16, { size: 14 }),
|
|
4461
4585
|
busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u8BA1\u5212"
|
|
4462
4586
|
] })
|
|
4463
4587
|
] })
|
|
@@ -4471,15 +4595,15 @@ function companionName(companions, id) {
|
|
|
4471
4595
|
}
|
|
4472
4596
|
|
|
4473
4597
|
// src/ui/companion-access-panel.tsx
|
|
4474
|
-
var
|
|
4475
|
-
var
|
|
4476
|
-
var
|
|
4598
|
+
var import_react9 = require("react");
|
|
4599
|
+
var import_dsh_client_ui_primitives7 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
4600
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
4477
4601
|
var CAPABILITY_LABELS = { knowledge: "\u77E5\u8BC6\u5E93", skills: "Skill", ssh: "SSH", git: "Git", companions: "\u521B\u5EFA\u4F19\u4F34", schedules: "\u5B9A\u65F6\u4EFB\u52A1", access: "\u4F19\u4F34\u6388\u6743" };
|
|
4478
4602
|
function CompanionAccessPanel({ companionId }) {
|
|
4479
|
-
const [access, setAccess] = (0,
|
|
4480
|
-
const [busy, setBusy] = (0,
|
|
4481
|
-
const [error, setError] = (0,
|
|
4482
|
-
const load = (0,
|
|
4603
|
+
const [access, setAccess] = (0, import_react9.useState)({ targetIds: [], companions: [] });
|
|
4604
|
+
const [busy, setBusy] = (0, import_react9.useState)();
|
|
4605
|
+
const [error, setError] = (0, import_react9.useState)();
|
|
4606
|
+
const load = (0, import_react9.useCallback)(async () => {
|
|
4483
4607
|
try {
|
|
4484
4608
|
setAccess(await api(`/companions/${encodeURIComponent(companionId)}/access`));
|
|
4485
4609
|
setError(void 0);
|
|
@@ -4487,7 +4611,7 @@ function CompanionAccessPanel({ companionId }) {
|
|
|
4487
4611
|
setError(errorMessage(reason));
|
|
4488
4612
|
}
|
|
4489
4613
|
}, [companionId]);
|
|
4490
|
-
(0,
|
|
4614
|
+
(0, import_react9.useEffect)(() => {
|
|
4491
4615
|
void load();
|
|
4492
4616
|
}, [load]);
|
|
4493
4617
|
const toggle = async (targetId) => {
|
|
@@ -4506,108 +4630,51 @@ function CompanionAccessPanel({ companionId }) {
|
|
|
4506
4630
|
setBusy(void 0);
|
|
4507
4631
|
}
|
|
4508
4632
|
};
|
|
4509
|
-
return /* @__PURE__ */ (0,
|
|
4510
|
-
/* @__PURE__ */ (0,
|
|
4511
|
-
/* @__PURE__ */ (0,
|
|
4512
|
-
/* @__PURE__ */ (0,
|
|
4513
|
-
/* @__PURE__ */ (0,
|
|
4633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("section", { className: "dsh-partner-capability-detail dsh-partner-access", "aria-labelledby": "dsh-partner-access-title", children: [
|
|
4634
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("header", { children: [
|
|
4635
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { children: [
|
|
4636
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { children: "DIRECTED ACCESS" }),
|
|
4637
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("strong", { id: "dsh-partner-access-title", children: "\u53EF\u8BBF\u95EE\u7684\u4F19\u4F34" })
|
|
4514
4638
|
] }),
|
|
4515
|
-
/* @__PURE__ */ (0,
|
|
4639
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("em", { children: [
|
|
4516
4640
|
access.targetIds.length,
|
|
4517
4641
|
" \u4F4D\u5DF2\u6388\u6743"
|
|
4518
4642
|
] })
|
|
4519
4643
|
] }),
|
|
4520
|
-
/* @__PURE__ */ (0,
|
|
4521
|
-
access.companions.length === 0 ? /* @__PURE__ */ (0,
|
|
4644
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.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" }),
|
|
4645
|
+
access.companions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime8.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_runtime8.jsx)("div", { className: "dsh-partner-access-list", children: access.companions.map((companion) => {
|
|
4522
4646
|
const selected = access.targetIds.includes(companion.id);
|
|
4523
4647
|
const abilities = companion.capabilities.map((capability) => CAPABILITY_LABELS[capability] ?? capability);
|
|
4524
|
-
return /* @__PURE__ */ (0,
|
|
4648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: selected ? "is-active" : "", "aria-pressed": selected, disabled: busy === companion.id, onClick: () => {
|
|
4525
4649
|
void toggle(companion.id);
|
|
4526
4650
|
}, children: [
|
|
4527
|
-
/* @__PURE__ */ (0,
|
|
4528
|
-
/* @__PURE__ */ (0,
|
|
4529
|
-
/* @__PURE__ */ (0,
|
|
4651
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "dsh-partner-access-avatar", "aria-hidden": "true", children: initials(companion.name) }),
|
|
4652
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "dsh-partner-access-copy", children: [
|
|
4653
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("strong", { children: [
|
|
4530
4654
|
"@",
|
|
4531
4655
|
companion.name
|
|
4532
4656
|
] }),
|
|
4533
|
-
/* @__PURE__ */ (0,
|
|
4534
|
-
/* @__PURE__ */ (0,
|
|
4535
|
-
/* @__PURE__ */ (0,
|
|
4657
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { children: companion.role }),
|
|
4658
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { children: companion.description || "\u672A\u586B\u5199\u4F19\u4F34\u8BF4\u660E" }),
|
|
4659
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: [...abilities, ...companion.enabledSkills.map((skill) => skill.name)].map((item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("em", { children: item }, item)) })
|
|
4536
4660
|
] }),
|
|
4537
|
-
/* @__PURE__ */ (0,
|
|
4661
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "dsh-partner-access-check", "aria-hidden": "true", children: selected && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_dsh_client_ui_primitives7.IconCheckOutline16, { size: 15 }) })
|
|
4538
4662
|
] }, companion.id);
|
|
4539
4663
|
}) }),
|
|
4540
|
-
error && /* @__PURE__ */ (0,
|
|
4664
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(WorkspaceNotice, { children: error })
|
|
4541
4665
|
] });
|
|
4542
4666
|
}
|
|
4543
4667
|
function initials(name) {
|
|
4544
4668
|
return [...name.trim()].slice(0, 2).join("").toUpperCase() || "AI";
|
|
4545
4669
|
}
|
|
4546
4670
|
|
|
4547
|
-
// src/ui/partner-components.tsx
|
|
4548
|
-
var import_dsh_client_ui_primitives6 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
4549
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
4550
|
-
function ChannelStatus({ channel }) {
|
|
4551
|
-
const status = channel?.runtimeStatus ?? "unbound";
|
|
4552
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: `dsh-partner-status is-${status}`, children: [
|
|
4553
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("i", {}),
|
|
4554
|
-
channel ? channelStatusLabel(channel.runtimeStatus) : "\u672A\u8FDE\u63A5"
|
|
4555
|
-
] });
|
|
4556
|
-
}
|
|
4557
|
-
function Avatar({ name, small = false }) {
|
|
4558
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: `dsh-partner-avatar${small ? " is-small" : ""}`, "aria-hidden": "true", children: [...name][0] ?? "\u4F34" });
|
|
4559
|
-
}
|
|
4560
|
-
function WeixinGlyph({ large = false }) {
|
|
4561
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: `dsh-partner-weixin-glyph${large ? " is-large" : ""}`, "aria-hidden": "true", children: [
|
|
4562
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("i", {}),
|
|
4563
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("b", {})
|
|
4564
|
-
] });
|
|
4565
|
-
}
|
|
4566
|
-
function TabButton({ active, onClick, icon, children }) {
|
|
4567
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: active ? "is-active" : "", "aria-current": active ? "page" : void 0, onClick, children: [
|
|
4568
|
-
icon,
|
|
4569
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children })
|
|
4570
|
-
] });
|
|
4571
|
-
}
|
|
4572
|
-
function FormField({ label, hint, children }) {
|
|
4573
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "dsh-partner-field", children: [
|
|
4574
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
|
|
4575
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("strong", { children: label }),
|
|
4576
|
-
hint && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("small", { children: hint })
|
|
4577
|
-
] }),
|
|
4578
|
-
children
|
|
4579
|
-
] });
|
|
4580
|
-
}
|
|
4581
|
-
function SectionHeading({ eyebrow, title, detail }) {
|
|
4582
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("header", { className: "dsh-partner-section", children: [
|
|
4583
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("small", { children: eyebrow }),
|
|
4584
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { children: title }),
|
|
4585
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: detail })
|
|
4586
|
-
] });
|
|
4587
|
-
}
|
|
4588
|
-
function ContentState({ title, detail, action, compact = false }) {
|
|
4589
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: `dsh-partner-state${compact ? " is-compact" : ""}`, children: [
|
|
4590
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives6.IconAgentPresetOutline16, { size: 20 }),
|
|
4591
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("strong", { children: title }),
|
|
4592
|
-
detail && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: detail }),
|
|
4593
|
-
action
|
|
4594
|
-
] });
|
|
4595
|
-
}
|
|
4596
|
-
function relativeTime(value) {
|
|
4597
|
-
const minutes = Math.floor((Date.now() - value) / 6e4);
|
|
4598
|
-
return minutes < 1 ? "\u521A\u521A" : minutes < 60 ? `${minutes} \u5206\u949F\u524D` : minutes < 1440 ? `${Math.floor(minutes / 60)} \u5C0F\u65F6\u524D` : `${Math.floor(minutes / 1440)} \u5929\u524D`;
|
|
4599
|
-
}
|
|
4600
|
-
function channelStatusLabel(status) {
|
|
4601
|
-
return status === "running" ? "\u5FAE\u4FE1\u5728\u7EBF" : status === "starting" ? "\u8FDE\u63A5\u4E2D" : status === "error" ? "\u8FDE\u63A5\u5F02\u5E38" : "\u5DF2\u505C\u7528";
|
|
4602
|
-
}
|
|
4603
|
-
|
|
4604
4671
|
// src/ui/companion-create.tsx
|
|
4605
|
-
var
|
|
4606
|
-
var
|
|
4607
|
-
var
|
|
4672
|
+
var import_react10 = require("react");
|
|
4673
|
+
var import_dsh_client_ui_primitives8 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
4674
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
4608
4675
|
function CompanionCreateDialog({ close, create }) {
|
|
4609
|
-
const [busy, setBusy] = (0,
|
|
4610
|
-
const [error, setError] = (0,
|
|
4676
|
+
const [busy, setBusy] = (0, import_react10.useState)(false);
|
|
4677
|
+
const [error, setError] = (0, import_react10.useState)();
|
|
4611
4678
|
const submit = async (event) => {
|
|
4612
4679
|
event.preventDefault();
|
|
4613
4680
|
const data = new FormData(event.currentTarget);
|
|
@@ -4626,30 +4693,30 @@ function CompanionCreateDialog({ close, create }) {
|
|
|
4626
4693
|
setBusy(false);
|
|
4627
4694
|
}
|
|
4628
4695
|
};
|
|
4629
|
-
return /* @__PURE__ */ (0,
|
|
4696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.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_runtime9.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-companion-create-form", "aria-busy": busy, onSubmit: (event) => {
|
|
4630
4697
|
void submit(event);
|
|
4631
4698
|
}, children: [
|
|
4632
|
-
/* @__PURE__ */ (0,
|
|
4633
|
-
/* @__PURE__ */ (0,
|
|
4634
|
-
/* @__PURE__ */ (0,
|
|
4699
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { children: [
|
|
4700
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "\u4F19\u4F34\u540D\u5B57" }),
|
|
4701
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("input", { name: "name", required: true, maxLength: 60, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u5C0F\u9ED1" })
|
|
4635
4702
|
] }),
|
|
4636
|
-
/* @__PURE__ */ (0,
|
|
4637
|
-
/* @__PURE__ */ (0,
|
|
4638
|
-
/* @__PURE__ */ (0,
|
|
4703
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { children: [
|
|
4704
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "\u4E3B\u8981\u89D2\u8272" }),
|
|
4705
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("input", { name: "role", required: true, maxLength: 120, placeholder: "\u4F8B\u5982\uFF1A\u4EA7\u54C1\u4E0E\u5DE5\u7A0B\u534F\u4F5C\u4F19\u4F34" })
|
|
4639
4706
|
] }),
|
|
4640
|
-
/* @__PURE__ */ (0,
|
|
4641
|
-
/* @__PURE__ */ (0,
|
|
4642
|
-
/* @__PURE__ */ (0,
|
|
4707
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "is-wide", children: [
|
|
4708
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D" }),
|
|
4709
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("input", { name: "description", maxLength: 500, placeholder: "\u5B83\u4E3B\u8981\u8D1F\u8D23\u4EC0\u4E48\uFF0C\u4EC0\u4E48\u65F6\u5019\u5E94\u8BE5\u627E\u5B83" })
|
|
4643
4710
|
] }),
|
|
4644
|
-
/* @__PURE__ */ (0,
|
|
4645
|
-
/* @__PURE__ */ (0,
|
|
4646
|
-
/* @__PURE__ */ (0,
|
|
4711
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "is-wide", children: [
|
|
4712
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: "\u521D\u59CB\u884C\u4E3A\u51C6\u5219" }),
|
|
4713
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.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" })
|
|
4647
4714
|
] }),
|
|
4648
|
-
error && /* @__PURE__ */ (0,
|
|
4649
|
-
/* @__PURE__ */ (0,
|
|
4650
|
-
/* @__PURE__ */ (0,
|
|
4651
|
-
/* @__PURE__ */ (0,
|
|
4652
|
-
/* @__PURE__ */ (0,
|
|
4715
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(WorkspaceNotice, { children: error }),
|
|
4716
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("footer", { children: [
|
|
4717
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
4718
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
|
|
4719
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_dsh_client_ui_primitives8.IconPlusOutline16, { size: 14 }),
|
|
4653
4720
|
busy ? "\u6B63\u5728\u521B\u5EFA\u2026" : "\u521B\u5EFA\u4F19\u4F34"
|
|
4654
4721
|
] })
|
|
4655
4722
|
] })
|
|
@@ -4736,33 +4803,34 @@ function sessions(ctx) {
|
|
|
4736
4803
|
}
|
|
4737
4804
|
|
|
4738
4805
|
// src/client.tsx
|
|
4739
|
-
var
|
|
4806
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
4740
4807
|
var PLUGIN_ID = "@lemoncat7/dsh-partner";
|
|
4741
4808
|
var STYLE_ID = `${PLUGIN_ID}/client`;
|
|
4742
4809
|
var cssText = `${client_default}
|
|
4743
4810
|
${workspace_ui_default}
|
|
4811
|
+
${companion_picker_default}
|
|
4744
4812
|
${responsive_ui_default}`;
|
|
4745
4813
|
var WORKSPACE_PAGES = /* @__PURE__ */ new Set(["skills", "board", "schedules"]);
|
|
4746
4814
|
var inject = ["slots", "layout", "sessions"];
|
|
4747
4815
|
function apply(ctx) {
|
|
4748
4816
|
ctx.effect(installStyles, "dsh-partner: styles");
|
|
4749
|
-
const controller = createPartnerController(ctx, PLUGIN_ID, (props, current) => /* @__PURE__ */ (0,
|
|
4817
|
+
const controller = createPartnerController(ctx, PLUGIN_ID, (props, current) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PartnerWorkspace, { ...props, controller: current }));
|
|
4750
4818
|
ctx.effect(() => observePluginWorkspace(PLUGIN_ID, controller.close), "dsh-partner: exclusive workspace");
|
|
4751
4819
|
ctx.effect(() => () => controller.close(), "dsh-partner: workspace lifecycle");
|
|
4752
4820
|
ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({
|
|
4753
4821
|
name: "sidebar.footer.action",
|
|
4754
4822
|
id: "partner",
|
|
4755
4823
|
order: -120
|
|
4756
|
-
}, (props) => /* @__PURE__ */ (0,
|
|
4824
|
+
}, (props) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
|
|
4757
4825
|
}
|
|
4758
4826
|
function PartnerSidebar(props) {
|
|
4759
|
-
const ref = (0,
|
|
4827
|
+
const ref = (0, import_react11.useRef)(null);
|
|
4760
4828
|
useWorkspaceTopAnchor(ref);
|
|
4761
|
-
const [open, setOpen] = (0,
|
|
4762
|
-
const [snapshot, setSnapshot] = (0,
|
|
4763
|
-
const [, update] = (0,
|
|
4764
|
-
(0,
|
|
4765
|
-
(0,
|
|
4829
|
+
const [open, setOpen] = (0, import_react11.useState)(true);
|
|
4830
|
+
const [snapshot, setSnapshot] = (0, import_react11.useState)();
|
|
4831
|
+
const [, update] = (0, import_react11.useState)(0);
|
|
4832
|
+
(0, import_react11.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
|
|
4833
|
+
(0, import_react11.useEffect)(() => {
|
|
4766
4834
|
void loadPartner().then(setSnapshot).catch(() => {
|
|
4767
4835
|
});
|
|
4768
4836
|
}, [props.controller.isOpen()]);
|
|
@@ -4770,30 +4838,30 @@ function PartnerSidebar(props) {
|
|
|
4770
4838
|
props.controller.open(id);
|
|
4771
4839
|
if (props.wide && window.matchMedia("(max-width: 820px)").matches) props.collapse();
|
|
4772
4840
|
};
|
|
4773
|
-
if (!props.wide) return /* @__PURE__ */ (0,
|
|
4774
|
-
return /* @__PURE__ */ (0,
|
|
4775
|
-
/* @__PURE__ */ (0,
|
|
4776
|
-
/* @__PURE__ */ (0,
|
|
4841
|
+
if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime10.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_runtime10.jsx)(import_dsh_client_ui_primitives9.IconAgentPresetOutline16, { size: 18 }) }) });
|
|
4842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
|
|
4843
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
|
|
4844
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconChevronDownOutline14, { size: 14 }) }),
|
|
4777
4845
|
"\u4F19\u4F34"
|
|
4778
4846
|
] }) }),
|
|
4779
|
-
/* @__PURE__ */ (0,
|
|
4780
|
-
/* @__PURE__ */ (0,
|
|
4781
|
-
/* @__PURE__ */ (0,
|
|
4782
|
-
/* @__PURE__ */ (0,
|
|
4783
|
-
/* @__PURE__ */ (0,
|
|
4847
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
|
|
4848
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconAgentPresetOutline16, { size: 16 }) }),
|
|
4849
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
4850
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
|
|
4851
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: snapshot ? `${snapshot.companions.length} \u4F4D\u4F19\u4F34 \xB7 ${snapshot.channels.filter((item) => item.runtimeStatus === "running").length} \u4E2A\u5FAE\u4FE1\u5728\u7EBF` : "\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E\u6E20\u9053" })
|
|
4784
4852
|
] }),
|
|
4785
|
-
/* @__PURE__ */ (0,
|
|
4853
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
|
|
4786
4854
|
] }) }) })
|
|
4787
4855
|
] });
|
|
4788
4856
|
}
|
|
4789
4857
|
function PartnerWorkspace({ controller }) {
|
|
4790
|
-
const [snapshot, setSnapshot] = (0,
|
|
4791
|
-
const [selectedId, setSelectedId] = (0,
|
|
4792
|
-
const [view, setView] = (0,
|
|
4793
|
-
const [error, setError] = (0,
|
|
4794
|
-
const [loading, setLoading] = (0,
|
|
4795
|
-
const [creatingCompanion, setCreatingCompanion] = (0,
|
|
4796
|
-
const refresh = (0,
|
|
4858
|
+
const [snapshot, setSnapshot] = (0, import_react11.useState)();
|
|
4859
|
+
const [selectedId, setSelectedId] = (0, import_react11.useState)(controller.selected());
|
|
4860
|
+
const [view, setView] = (0, import_react11.useState)("home");
|
|
4861
|
+
const [error, setError] = (0, import_react11.useState)();
|
|
4862
|
+
const [loading, setLoading] = (0, import_react11.useState)(true);
|
|
4863
|
+
const [creatingCompanion, setCreatingCompanion] = (0, import_react11.useState)(false);
|
|
4864
|
+
const refresh = (0, import_react11.useCallback)(async () => {
|
|
4797
4865
|
try {
|
|
4798
4866
|
const next = await loadPartner();
|
|
4799
4867
|
setSnapshot(next);
|
|
@@ -4805,10 +4873,10 @@ function PartnerWorkspace({ controller }) {
|
|
|
4805
4873
|
setLoading(false);
|
|
4806
4874
|
}
|
|
4807
4875
|
}, []);
|
|
4808
|
-
(0,
|
|
4876
|
+
(0, import_react11.useEffect)(() => {
|
|
4809
4877
|
void refresh();
|
|
4810
4878
|
}, [refresh]);
|
|
4811
|
-
(0,
|
|
4879
|
+
(0, import_react11.useEffect)(() => controller.subscribe(() => {
|
|
4812
4880
|
const next = controller.selected();
|
|
4813
4881
|
if (next) setSelectedId(next);
|
|
4814
4882
|
}), [controller]);
|
|
@@ -4857,18 +4925,18 @@ function PartnerWorkspace({ controller }) {
|
|
|
4857
4925
|
setSelectedId(id);
|
|
4858
4926
|
setView("home");
|
|
4859
4927
|
};
|
|
4860
|
-
return /* @__PURE__ */ (0,
|
|
4861
|
-
creatingCompanion && /* @__PURE__ */ (0,
|
|
4862
|
-
/* @__PURE__ */ (0,
|
|
4863
|
-
/* @__PURE__ */ (0,
|
|
4864
|
-
/* @__PURE__ */ (0,
|
|
4865
|
-
/* @__PURE__ */ (0,
|
|
4866
|
-
/* @__PURE__ */ (0,
|
|
4867
|
-
/* @__PURE__ */ (0,
|
|
4868
|
-
/* @__PURE__ */ (0,
|
|
4928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("main", { className: "dsh-partner-workspace", children: [
|
|
4929
|
+
creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
|
|
4930
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { className: "dsh-partner-topbar", children: [
|
|
4931
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
|
|
4932
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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_runtime10.jsx)(import_dsh_client_ui_primitives9.IconChevronLeftOutline14, { size: 15 }) }),
|
|
4933
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconAgentPresetOutline16, { size: 18 }),
|
|
4934
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
4935
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u4F19\u4F34" }),
|
|
4936
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u5FAE\u4FE1\u6E20\u9053" })
|
|
4869
4937
|
] })
|
|
4870
4938
|
] }),
|
|
4871
|
-
/* @__PURE__ */ (0,
|
|
4939
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4872
4940
|
MobileWorkspaceControls,
|
|
4873
4941
|
{
|
|
4874
4942
|
companions: snapshot?.companions ?? [],
|
|
@@ -4880,114 +4948,104 @@ function PartnerWorkspace({ controller }) {
|
|
|
4880
4948
|
}
|
|
4881
4949
|
)
|
|
4882
4950
|
] }),
|
|
4883
|
-
/* @__PURE__ */ (0,
|
|
4884
|
-
/* @__PURE__ */ (0,
|
|
4885
|
-
/* @__PURE__ */ (0,
|
|
4886
|
-
/* @__PURE__ */ (0,
|
|
4887
|
-
/* @__PURE__ */ (0,
|
|
4888
|
-
/* @__PURE__ */ (0,
|
|
4951
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-grid", children: [
|
|
4952
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("aside", { className: "dsh-partner-roster", children: [
|
|
4953
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-roster-title", children: [
|
|
4954
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
4955
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "COMPANIONS" }),
|
|
4956
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
|
|
4889
4957
|
] }),
|
|
4890
|
-
/* @__PURE__ */ (0,
|
|
4958
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconPlusOutline16, { size: 16 }) })
|
|
4891
4959
|
] }),
|
|
4892
|
-
/* @__PURE__ */ (0,
|
|
4960
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
|
|
4893
4961
|
const channel = snapshot.channels.find((item) => item.companionId === companion.id);
|
|
4894
|
-
return /* @__PURE__ */ (0,
|
|
4895
|
-
/* @__PURE__ */ (0,
|
|
4896
|
-
/* @__PURE__ */ (0,
|
|
4897
|
-
/* @__PURE__ */ (0,
|
|
4898
|
-
/* @__PURE__ */ (0,
|
|
4962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
|
|
4963
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Avatar, { name: companion.name }),
|
|
4964
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
4965
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: companion.name }),
|
|
4966
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: companion.role })
|
|
4899
4967
|
] }),
|
|
4900
|
-
/* @__PURE__ */ (0,
|
|
4968
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
|
|
4901
4969
|
] }, companion.id);
|
|
4902
4970
|
}) }),
|
|
4903
|
-
/* @__PURE__ */ (0,
|
|
4904
|
-
/* @__PURE__ */ (0,
|
|
4905
|
-
/* @__PURE__ */ (0,
|
|
4906
|
-
/* @__PURE__ */ (0,
|
|
4907
|
-
/* @__PURE__ */ (0,
|
|
4971
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: [
|
|
4972
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-current": view === "skills" ? "page" : void 0, onClick: () => setView("skills"), children: [
|
|
4973
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconBrowseOutline16, { size: 16 }) }),
|
|
4974
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "Skill \u5E02\u573A" }),
|
|
4975
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u5B89\u88C5\u4E0E\u7BA1\u7406\u80FD\u529B" })
|
|
4908
4976
|
] }),
|
|
4909
|
-
/* @__PURE__ */ (0,
|
|
4910
|
-
/* @__PURE__ */ (0,
|
|
4911
|
-
/* @__PURE__ */ (0,
|
|
4912
|
-
/* @__PURE__ */ (0,
|
|
4977
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-current": view === "board" ? "page" : void 0, onClick: () => setView("board"), children: [
|
|
4978
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconListPenOutline16, { size: 16 }) }),
|
|
4979
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u4EFB\u52A1\u770B\u677F" }),
|
|
4980
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u534F\u4F5C\u3001\u59D4\u6D3E\u4E0E\u9A8C\u6536" })
|
|
4913
4981
|
] }),
|
|
4914
|
-
/* @__PURE__ */ (0,
|
|
4915
|
-
/* @__PURE__ */ (0,
|
|
4916
|
-
/* @__PURE__ */ (0,
|
|
4917
|
-
/* @__PURE__ */ (0,
|
|
4982
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-current": view === "schedules" ? "page" : void 0, onClick: () => setView("schedules"), children: [
|
|
4983
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconPlayOutline16, { size: 16 }) }),
|
|
4984
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u5B9A\u65F6\u4EFB\u52A1" }),
|
|
4985
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u9009\u62E9\u4F19\u4F34\u5468\u671F\u6267\u884C" })
|
|
4918
4986
|
] })
|
|
4919
4987
|
] }),
|
|
4920
|
-
/* @__PURE__ */ (0,
|
|
4921
|
-
/* @__PURE__ */ (0,
|
|
4922
|
-
/* @__PURE__ */ (0,
|
|
4923
|
-
/* @__PURE__ */ (0,
|
|
4924
|
-
/* @__PURE__ */ (0,
|
|
4988
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-roster-note", children: [
|
|
4989
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconLinkOutline16, { size: 16 }),
|
|
4990
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
4991
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
|
|
4992
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u5FAE\u4FE1\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
|
|
4925
4993
|
] })
|
|
4926
4994
|
] })
|
|
4927
4995
|
] }),
|
|
4928
|
-
/* @__PURE__ */ (0,
|
|
4929
|
-
loading ? /* @__PURE__ */ (0,
|
|
4930
|
-
view === "skills" && /* @__PURE__ */ (0,
|
|
4931
|
-
view === "board" && /* @__PURE__ */ (0,
|
|
4932
|
-
view === "schedules" && /* @__PURE__ */ (0,
|
|
4933
|
-
] }) : selected === void 0 ? /* @__PURE__ */ (0,
|
|
4934
|
-
/* @__PURE__ */ (0,
|
|
4935
|
-
/* @__PURE__ */ (0,
|
|
4936
|
-
/* @__PURE__ */ (0,
|
|
4937
|
-
/* @__PURE__ */ (0,
|
|
4938
|
-
/* @__PURE__ */ (0,
|
|
4939
|
-
/* @__PURE__ */ (0,
|
|
4996
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
|
|
4997
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
|
|
4998
|
+
view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SkillsPanel, {}),
|
|
4999
|
+
view === "board" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TaskBoardPanel, {}),
|
|
5000
|
+
view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] })
|
|
5001
|
+
] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.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_runtime10.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
5002
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-identity", children: [
|
|
5003
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Avatar, { name: selected.name }),
|
|
5004
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
5005
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "ACTIVE COMPANION" }),
|
|
5006
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h1", { children: selected.name }),
|
|
5007
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: selected.description || selected.role })
|
|
4940
5008
|
] }),
|
|
4941
|
-
/* @__PURE__ */ (0,
|
|
5009
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
|
|
4942
5010
|
] }),
|
|
4943
|
-
/* @__PURE__ */ (0,
|
|
4944
|
-
/* @__PURE__ */ (0,
|
|
4945
|
-
/* @__PURE__ */ (0,
|
|
4946
|
-
/* @__PURE__ */ (0,
|
|
4947
|
-
/* @__PURE__ */ (0,
|
|
4948
|
-
/* @__PURE__ */ (0,
|
|
5011
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
|
|
5012
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconAgentPresetOutline16, { size: 16 }), children: "\u603B\u89C8" }),
|
|
5013
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconEditOutline16, { size: 16 }), children: "\u8EAB\u4EFD" }),
|
|
5014
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconAgentPresetOutline16, { size: 16 }), children: "\u80FD\u529B" }),
|
|
5015
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WeixinGlyph, {}), children: "\u5FAE\u4FE1" }),
|
|
5016
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconDataOutline16, { size: 16 }), children: "\u8BB0\u5FC6" })
|
|
4949
5017
|
] }),
|
|
4950
|
-
/* @__PURE__ */ (0,
|
|
4951
|
-
view === "home" && /* @__PURE__ */ (0,
|
|
4952
|
-
view === "identity" && /* @__PURE__ */ (0,
|
|
4953
|
-
view === "capabilities" && /* @__PURE__ */ (0,
|
|
4954
|
-
view === "weixin" && /* @__PURE__ */ (0,
|
|
4955
|
-
view === "memory" && /* @__PURE__ */ (0,
|
|
5018
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
|
|
5019
|
+
view === "home" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession }),
|
|
5020
|
+
view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IdentityEditor, { companion: selected, count: snapshot?.companions.length ?? 1, onChanged: refresh }),
|
|
5021
|
+
view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: refresh }),
|
|
5022
|
+
view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }),
|
|
5023
|
+
view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, startSession, renewSession, onChanged: refresh })
|
|
4956
5024
|
] })
|
|
4957
5025
|
] }),
|
|
4958
|
-
error && /* @__PURE__ */ (0,
|
|
5026
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
|
|
4959
5027
|
] })
|
|
4960
5028
|
] })
|
|
4961
5029
|
] });
|
|
4962
5030
|
}
|
|
4963
5031
|
function MobileWorkspaceControls({ companions, selectedId, view, openCompanion, openPage, createCompanion }) {
|
|
4964
|
-
return /* @__PURE__ */ (0,
|
|
4965
|
-
/* @__PURE__ */ (0,
|
|
4966
|
-
/* @__PURE__ */ (0,
|
|
4967
|
-
|
|
4968
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("select", { value: selectedId ?? "", disabled: companions.length === 0, "aria-label": "\u5207\u6362\u5F53\u524D\u4F19\u4F34", onChange: (event) => openCompanion(event.target.value), children: [
|
|
4969
|
-
companions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "", children: "\u8FD8\u6CA1\u6709\u4F19\u4F34" }),
|
|
4970
|
-
companions.map((companion) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("option", { value: companion.id, children: [
|
|
4971
|
-
companion.name,
|
|
4972
|
-
" \xB7 ",
|
|
4973
|
-
companion.role
|
|
4974
|
-
] }, companion.id))
|
|
4975
|
-
] })
|
|
4976
|
-
] }),
|
|
4977
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_dsh_client_ui_primitives8.IconPlusOutline16, { size: 17 }) })
|
|
5032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
|
|
5033
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
|
|
5034
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
|
|
5035
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconPlusOutline16, { size: 17 }) })
|
|
4978
5036
|
] }),
|
|
4979
|
-
/* @__PURE__ */ (0,
|
|
4980
|
-
/* @__PURE__ */ (0,
|
|
4981
|
-
/* @__PURE__ */ (0,
|
|
4982
|
-
/* @__PURE__ */ (0,
|
|
5037
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: [
|
|
5038
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-pressed": view === "skills", onClick: () => openPage("skills"), children: [
|
|
5039
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconBrowseOutline16, { size: 16 }),
|
|
5040
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Skill" })
|
|
4983
5041
|
] }),
|
|
4984
|
-
/* @__PURE__ */ (0,
|
|
4985
|
-
/* @__PURE__ */ (0,
|
|
4986
|
-
/* @__PURE__ */ (0,
|
|
5042
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-pressed": view === "board", onClick: () => openPage("board"), children: [
|
|
5043
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconListPenOutline16, { size: 16 }),
|
|
5044
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u770B\u677F" })
|
|
4987
5045
|
] }),
|
|
4988
|
-
/* @__PURE__ */ (0,
|
|
4989
|
-
/* @__PURE__ */ (0,
|
|
4990
|
-
/* @__PURE__ */ (0,
|
|
5046
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-pressed": view === "schedules", onClick: () => openPage("schedules"), children: [
|
|
5047
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconPlayOutline16, { size: 16 }),
|
|
5048
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u5B9A\u65F6" })
|
|
4991
5049
|
] })
|
|
4992
5050
|
] })
|
|
4993
5051
|
] });
|
|
@@ -5000,77 +5058,77 @@ function HomePanel({ companion, snapshot, navigate, openSession, startSession, r
|
|
|
5000
5058
|
const approved = channel ? snapshot.pairings.filter((item) => item.channelId === channel.id && item.status === "approved").length : 0;
|
|
5001
5059
|
const capabilities = companion.capabilities.map((item) => ({ knowledge: "\u77E5\u8BC6\u5E93", skills: "Skill", ssh: "SSH", git: "Git", companions: "\u521B\u5EFA\u4F19\u4F34", schedules: "\u5B9A\u65F6\u4EFB\u52A1", access: "\u4F19\u4F34\u6388\u6743" })[item]);
|
|
5002
5060
|
const online = channel?.runtimeStatus === "running";
|
|
5003
|
-
return /* @__PURE__ */ (0,
|
|
5004
|
-
/* @__PURE__ */ (0,
|
|
5005
|
-
/* @__PURE__ */ (0,
|
|
5006
|
-
/* @__PURE__ */ (0,
|
|
5007
|
-
/* @__PURE__ */ (0,
|
|
5061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-home", children: [
|
|
5062
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { className: "dsh-partner-home-heading", children: [
|
|
5063
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
5064
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
|
|
5065
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u5FAE\u4FE1\u5F85\u547D` : `${companion.name} \u5DF2\u51C6\u5907\u5C31\u7EEA` })
|
|
5008
5066
|
] }),
|
|
5009
|
-
/* @__PURE__ */ (0,
|
|
5067
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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" })
|
|
5010
5068
|
] }),
|
|
5011
|
-
/* @__PURE__ */ (0,
|
|
5012
|
-
/* @__PURE__ */ (0,
|
|
5013
|
-
/* @__PURE__ */ (0,
|
|
5014
|
-
/* @__PURE__ */ (0,
|
|
5015
|
-
/* @__PURE__ */ (0,
|
|
5069
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
|
|
5070
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
|
|
5071
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Avatar, { name: companion.name }),
|
|
5072
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}) }),
|
|
5073
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WeixinGlyph, { large: true }) })
|
|
5016
5074
|
] }),
|
|
5017
|
-
/* @__PURE__ */ (0,
|
|
5018
|
-
/* @__PURE__ */ (0,
|
|
5019
|
-
/* @__PURE__ */ (0,
|
|
5075
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
|
|
5076
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
|
|
5077
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}),
|
|
5020
5078
|
"\u4E3B\u8981\u6E20\u9053 \xB7 \u5FAE\u4FE1"
|
|
5021
5079
|
] }),
|
|
5022
|
-
/* @__PURE__ */ (0,
|
|
5023
|
-
/* @__PURE__ */ (0,
|
|
5024
|
-
/* @__PURE__ */ (0,
|
|
5025
|
-
/* @__PURE__ */ (0,
|
|
5026
|
-
/* @__PURE__ */ (0,
|
|
5080
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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" }),
|
|
5081
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: !channel ? "\u901A\u8FC7\u5FAE\u4FE1 iLink Bot \u63A5\u5165\u3002\u51ED\u636E\u53EA\u8FDB\u5165 DSH \u51ED\u636E\u5E93\uFF0C\u8054\u7CFB\u4EBA\u9996\u6B21\u53D1\u6D88\u606F\u4ECD\u9700\u4F60\u7684\u6279\u51C6\u3002" : online ? "\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u62E5\u6709\u72EC\u7ACB DSH \u4F1A\u8BDD\uFF0C\u4F19\u4F34\u8EAB\u4EFD\u4E00\u81F4\uFF0C\u4F46\u4E0A\u4E0B\u6587\u4E0D\u4F1A\u4E92\u76F8\u6DF7\u5408\u3002" : channel.lastError || "\u6E20\u9053\u914D\u7F6E\u4ECD\u7136\u4FDD\u7559\uFF0C\u53EF\u4EE5\u968F\u65F6\u91CD\u65B0\u542F\u7528\u3002" }),
|
|
5082
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
|
|
5083
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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" }),
|
|
5084
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: !channel ? "\u626B\u7801\u5B8C\u6210\uFF0C\u65E0\u9700\u7C98\u8D34 Token" : `${approved} \u4F4D\u8054\u7CFB\u4EBA \xB7 ${sessions2.length} \u4E2A\u72EC\u7ACB\u4F1A\u8BDD` })
|
|
5027
5085
|
] })
|
|
5028
5086
|
] })
|
|
5029
5087
|
] }),
|
|
5030
|
-
/* @__PURE__ */ (0,
|
|
5031
|
-
/* @__PURE__ */ (0,
|
|
5032
|
-
/* @__PURE__ */ (0,
|
|
5033
|
-
/* @__PURE__ */ (0,
|
|
5034
|
-
/* @__PURE__ */ (0,
|
|
5035
|
-
/* @__PURE__ */ (0,
|
|
5036
|
-
/* @__PURE__ */ (0,
|
|
5088
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-home-details", children: [
|
|
5089
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-home-profile", children: [
|
|
5090
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { children: [
|
|
5091
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconUserOutline16, { size: 16 }) }),
|
|
5092
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
5093
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
|
|
5094
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: companion.role })
|
|
5037
5095
|
] }),
|
|
5038
|
-
/* @__PURE__ */ (0,
|
|
5096
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
|
|
5039
5097
|
] }),
|
|
5040
|
-
/* @__PURE__ */ (0,
|
|
5098
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
|
|
5041
5099
|
] }),
|
|
5042
|
-
/* @__PURE__ */ (0,
|
|
5043
|
-
/* @__PURE__ */ (0,
|
|
5044
|
-
/* @__PURE__ */ (0,
|
|
5045
|
-
/* @__PURE__ */ (0,
|
|
5046
|
-
/* @__PURE__ */ (0,
|
|
5047
|
-
/* @__PURE__ */ (0,
|
|
5100
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
|
|
5101
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { children: [
|
|
5102
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconAgentPresetOutline16, { size: 16 }) }),
|
|
5103
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
5104
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
|
|
5105
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
|
|
5048
5106
|
] }),
|
|
5049
|
-
/* @__PURE__ */ (0,
|
|
5107
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
|
|
5050
5108
|
] }),
|
|
5051
|
-
/* @__PURE__ */ (0,
|
|
5109
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
|
|
5052
5110
|
] }),
|
|
5053
|
-
/* @__PURE__ */ (0,
|
|
5054
|
-
/* @__PURE__ */ (0,
|
|
5055
|
-
/* @__PURE__ */ (0,
|
|
5056
|
-
/* @__PURE__ */ (0,
|
|
5057
|
-
/* @__PURE__ */ (0,
|
|
5058
|
-
/* @__PURE__ */ (0,
|
|
5111
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
|
|
5112
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { children: [
|
|
5113
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconDataOutline16, { size: 16 }) }),
|
|
5114
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
5115
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
|
|
5116
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: localSession?.archived ? "\u4F1A\u8BDD\u5DF2\u5F52\u6863" : "\u4F19\u4F34\u4F1A\u8BDD\u5DF2\u5EFA\u7ACB" })
|
|
5059
5117
|
] }),
|
|
5060
|
-
/* @__PURE__ */ (0,
|
|
5118
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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" })
|
|
5061
5119
|
] }),
|
|
5062
|
-
/* @__PURE__ */ (0,
|
|
5120
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: localSession ? `\u6700\u8FD1\u6D3B\u52A8\u4E8E ${relativeTime(localSession.lastMessageAt)}\uFF1B\u53E6\u6709 ${sessions2.filter((item) => item.kind === "channel").length} \u4E2A\u6E20\u9053\u4F1A\u8BDD\u3002` : "\u4F19\u4F34\u4F1A\u8BDD\u6B63\u5728\u521D\u59CB\u5316\uFF0C\u7A0D\u540E\u5373\u53EF\u6253\u5F00\u3002" })
|
|
5063
5121
|
] })
|
|
5064
5122
|
] })
|
|
5065
5123
|
] });
|
|
5066
5124
|
}
|
|
5067
5125
|
function IdentityEditor({ companion, count, onChanged }) {
|
|
5068
|
-
const [form, setForm] = (0,
|
|
5069
|
-
const [saving, setSaving] = (0,
|
|
5070
|
-
const [saved, setSaved] = (0,
|
|
5071
|
-
const [error, setError] = (0,
|
|
5072
|
-
const [confirmingRemove, setConfirmingRemove] = (0,
|
|
5073
|
-
(0,
|
|
5126
|
+
const [form, setForm] = (0, import_react11.useState)(() => companionDraft(companion));
|
|
5127
|
+
const [saving, setSaving] = (0, import_react11.useState)(false);
|
|
5128
|
+
const [saved, setSaved] = (0, import_react11.useState)(false);
|
|
5129
|
+
const [error, setError] = (0, import_react11.useState)();
|
|
5130
|
+
const [confirmingRemove, setConfirmingRemove] = (0, import_react11.useState)(false);
|
|
5131
|
+
(0, import_react11.useEffect)(() => {
|
|
5074
5132
|
setForm(companionDraft(companion));
|
|
5075
5133
|
setSaved(false);
|
|
5076
5134
|
}, [companion.id, companion.updatedAt]);
|
|
@@ -5096,33 +5154,33 @@ function IdentityEditor({ companion, count, onChanged }) {
|
|
|
5096
5154
|
setError(errorMessage(reason));
|
|
5097
5155
|
}
|
|
5098
5156
|
};
|
|
5099
|
-
return /* @__PURE__ */ (0,
|
|
5157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { className: "dsh-partner-form is-identity", onSubmit: (event) => {
|
|
5100
5158
|
void submit(event);
|
|
5101
5159
|
}, children: [
|
|
5102
|
-
/* @__PURE__ */ (0,
|
|
5103
|
-
/* @__PURE__ */ (0,
|
|
5104
|
-
/* @__PURE__ */ (0,
|
|
5105
|
-
/* @__PURE__ */ (0,
|
|
5160
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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" }),
|
|
5161
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-fields two", children: [
|
|
5162
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormField, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
|
|
5163
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormField, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
|
|
5106
5164
|
] }),
|
|
5107
|
-
/* @__PURE__ */ (0,
|
|
5108
|
-
/* @__PURE__ */ (0,
|
|
5109
|
-
error && /* @__PURE__ */ (0,
|
|
5110
|
-
/* @__PURE__ */ (0,
|
|
5111
|
-
/* @__PURE__ */ (0,
|
|
5112
|
-
/* @__PURE__ */ (0,
|
|
5165
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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_runtime10.jsx)("textarea", { rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
|
|
5166
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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_runtime10.jsx)("textarea", { rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
|
|
5167
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
|
|
5168
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-form-actions", children: [
|
|
5169
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: saved && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
5170
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconCheckOutline14, { size: 14 }),
|
|
5113
5171
|
"\u5DF2\u4FDD\u5B58\uFF0C\u540E\u7EED\u5FAE\u4FE1\u6D88\u606F\u5C06\u4F7F\u7528\u65B0\u8EAB\u4EFD"
|
|
5114
5172
|
] }) }),
|
|
5115
|
-
/* @__PURE__ */ (0,
|
|
5173
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { disabled: saving, children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
|
|
5116
5174
|
] }),
|
|
5117
|
-
/* @__PURE__ */ (0,
|
|
5118
|
-
/* @__PURE__ */ (0,
|
|
5119
|
-
/* @__PURE__ */ (0,
|
|
5120
|
-
/* @__PURE__ */ (0,
|
|
5175
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-identity-danger", "data-confirming": confirmingRemove, children: [
|
|
5176
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
5177
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: confirmingRemove ? `\u786E\u8BA4\u5220\u9664\u300C${companion.name}\u300D\uFF1F` : "\u5220\u9664\u4F19\u4F34" }),
|
|
5178
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: confirmingRemove ? "\u8BE5\u4F19\u4F34\u7684\u672C\u5730\u914D\u7F6E\u4F1A\u88AB\u79FB\u9664\uFF1B\u5DF2\u6709\u6E20\u9053\u5FC5\u987B\u5148\u89E3\u7ED1\u3002" : "\u5FC5\u987B\u5148\u79FB\u9664\u5DF2\u7ED1\u5B9A\u5FAE\u4FE1\u6E20\u9053\uFF1B\u4E0D\u4F1A\u81EA\u52A8\u628A\u8054\u7CFB\u4EBA\u8F6C\u4EA4\u7ED9\u5176\u4ED6\u4F19\u4F34\u3002" })
|
|
5121
5179
|
] }),
|
|
5122
|
-
/* @__PURE__ */ (0,
|
|
5123
|
-
confirmingRemove && /* @__PURE__ */ (0,
|
|
5124
|
-
/* @__PURE__ */ (0,
|
|
5125
|
-
/* @__PURE__ */ (0,
|
|
5180
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
5181
|
+
confirmingRemove && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "is-secondary", onClick: () => setConfirmingRemove(false), children: "\u53D6\u6D88" }),
|
|
5182
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: confirmingRemove ? "is-danger" : "", disabled: count <= 1, onClick: () => confirmingRemove ? void remove() : setConfirmingRemove(true), children: [
|
|
5183
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconTrashOutline16, { size: 16 }),
|
|
5126
5184
|
confirmingRemove ? "\u786E\u8BA4\u5220\u9664" : "\u5220\u9664"
|
|
5127
5185
|
] })
|
|
5128
5186
|
] })
|
|
@@ -5130,12 +5188,12 @@ function IdentityEditor({ companion, count, onChanged }) {
|
|
|
5130
5188
|
] });
|
|
5131
5189
|
}
|
|
5132
5190
|
function CapabilityEditor({ companion, presets, onChanged }) {
|
|
5133
|
-
const [form, setForm] = (0,
|
|
5134
|
-
const [modelCatalog, setModelCatalog] = (0,
|
|
5135
|
-
const [saving, setSaving] = (0,
|
|
5136
|
-
const [error, setError] = (0,
|
|
5137
|
-
(0,
|
|
5138
|
-
(0,
|
|
5191
|
+
const [form, setForm] = (0, import_react11.useState)(() => companionDraft(companion));
|
|
5192
|
+
const [modelCatalog, setModelCatalog] = (0, import_react11.useState)();
|
|
5193
|
+
const [saving, setSaving] = (0, import_react11.useState)(false);
|
|
5194
|
+
const [error, setError] = (0, import_react11.useState)();
|
|
5195
|
+
(0, import_react11.useEffect)(() => setForm(companionDraft(companion)), [companion.id, companion.updatedAt]);
|
|
5196
|
+
(0, import_react11.useEffect)(() => {
|
|
5139
5197
|
void api("/models").then(setModelCatalog).catch((reason) => setError(errorMessage(reason)));
|
|
5140
5198
|
}, []);
|
|
5141
5199
|
const toggle = (capability) => setForm((current) => ({ ...current, capabilities: current.capabilities.includes(capability) ? current.capabilities.filter((item) => item !== capability) : [...current.capabilities, capability] }));
|
|
@@ -5167,65 +5225,65 @@ function CapabilityEditor({ companion, presets, onChanged }) {
|
|
|
5167
5225
|
const selectedProvider = form.provider || modelCatalog?.defaultSelection.provider || "";
|
|
5168
5226
|
const modelOptions = modelCatalog?.providers.find((item) => item.id === selectedProvider)?.models ?? [];
|
|
5169
5227
|
const currentModelMissing = Boolean(form.model) && !modelOptions.some((item) => item.id === form.model);
|
|
5170
|
-
return /* @__PURE__ */ (0,
|
|
5171
|
-
/* @__PURE__ */ (0,
|
|
5172
|
-
/* @__PURE__ */ (0,
|
|
5173
|
-
/* @__PURE__ */ (0,
|
|
5174
|
-
/* @__PURE__ */ (0,
|
|
5175
|
-
presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0,
|
|
5228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-form is-capabilities", children: [
|
|
5229
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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" }),
|
|
5230
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-runtime-fields", children: [
|
|
5231
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormField, { label: "Agent Preset", hint: "\u5DE5\u5177\u3001Skill \u4E0E\u7CFB\u7EDF\u63D0\u793A", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { value: form.presetId, onChange: (event) => setForm({ ...form, presetId: event.target.value }), children: [
|
|
5232
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "", children: "\u8DDF\u968F DSH \u9ED8\u8BA4 Preset" }),
|
|
5233
|
+
presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: item.id, children: item.name }, item.id))
|
|
5176
5234
|
] }) }),
|
|
5177
|
-
/* @__PURE__ */ (0,
|
|
5178
|
-
/* @__PURE__ */ (0,
|
|
5235
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormField, { label: "\u6A21\u578B\u63D0\u4F9B\u65B9", hint: "\u6765\u81EA\u5F53\u524D\u5BA2\u6237\u7AEF", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { value: form.provider, onChange: (event) => setForm({ ...form, provider: event.target.value, model: "" }), children: [
|
|
5236
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: "", children: [
|
|
5179
5237
|
"\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
|
|
5180
5238
|
modelCatalog?.defaultSelection.provider || "\u6B63\u5728\u8BFB\u53D6"
|
|
5181
5239
|
] }),
|
|
5182
|
-
modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0,
|
|
5240
|
+
modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
|
|
5183
5241
|
] }) }),
|
|
5184
|
-
/* @__PURE__ */ (0,
|
|
5185
|
-
/* @__PURE__ */ (0,
|
|
5242
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormField, { label: "\u6A21\u578B", hint: "\u968F\u63D0\u4F9B\u65B9\u8054\u52A8", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { value: form.model, onChange: (event) => setForm({ ...form, model: event.target.value }), children: [
|
|
5243
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: "", children: [
|
|
5186
5244
|
"\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
|
|
5187
5245
|
modelCatalog?.defaultSelection.model || "\u6B63\u5728\u8BFB\u53D6"
|
|
5188
5246
|
] }),
|
|
5189
|
-
currentModelMissing && /* @__PURE__ */ (0,
|
|
5247
|
+
currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: form.model, children: [
|
|
5190
5248
|
"\u5F53\u524D\u914D\u7F6E \xB7 ",
|
|
5191
5249
|
form.model
|
|
5192
5250
|
] }),
|
|
5193
|
-
modelOptions.map((model) => /* @__PURE__ */ (0,
|
|
5251
|
+
modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
|
|
5194
5252
|
] }) })
|
|
5195
5253
|
] }),
|
|
5196
|
-
/* @__PURE__ */ (0,
|
|
5254
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-capability-groups", children: groups.map((group) => {
|
|
5197
5255
|
const enabled = group.choices.filter((choice) => form.capabilities.includes(choice.id)).length;
|
|
5198
|
-
return /* @__PURE__ */ (0,
|
|
5199
|
-
/* @__PURE__ */ (0,
|
|
5200
|
-
/* @__PURE__ */ (0,
|
|
5201
|
-
/* @__PURE__ */ (0,
|
|
5202
|
-
/* @__PURE__ */ (0,
|
|
5203
|
-
/* @__PURE__ */ (0,
|
|
5256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-capability-group", "aria-labelledby": `partner-capability-${group.id}`, children: [
|
|
5257
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { children: [
|
|
5258
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
5259
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: group.eyebrow }),
|
|
5260
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { id: `partner-capability-${group.id}`, children: group.title }),
|
|
5261
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: group.detail })
|
|
5204
5262
|
] }),
|
|
5205
|
-
/* @__PURE__ */ (0,
|
|
5263
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("em", { children: [
|
|
5206
5264
|
enabled,
|
|
5207
5265
|
" / ",
|
|
5208
5266
|
group.choices.length,
|
|
5209
5267
|
" \u5DF2\u542F\u7528"
|
|
5210
5268
|
] })
|
|
5211
5269
|
] }),
|
|
5212
|
-
/* @__PURE__ */ (0,
|
|
5270
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-capabilities", children: group.choices.map((choice) => {
|
|
5213
5271
|
const active = form.capabilities.includes(choice.id);
|
|
5214
|
-
return /* @__PURE__ */ (0,
|
|
5215
|
-
/* @__PURE__ */ (0,
|
|
5216
|
-
/* @__PURE__ */ (0,
|
|
5217
|
-
/* @__PURE__ */ (0,
|
|
5272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: active ? "is-active" : "", "aria-pressed": active, onClick: () => toggle(choice.id), children: [
|
|
5273
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: active && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconCheckOutline14, { size: 14 }) }),
|
|
5274
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: choice.title }),
|
|
5275
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: choice.detail })
|
|
5218
5276
|
] }, choice.id);
|
|
5219
5277
|
}) })
|
|
5220
5278
|
] }, group.id);
|
|
5221
5279
|
}) }),
|
|
5222
|
-
form.capabilities.includes("skills") && companion.capabilities.includes("skills") && /* @__PURE__ */ (0,
|
|
5223
|
-
form.capabilities.includes("skills") && !companion.capabilities.includes("skills") && /* @__PURE__ */ (0,
|
|
5224
|
-
/* @__PURE__ */ (0,
|
|
5225
|
-
error && /* @__PURE__ */ (0,
|
|
5226
|
-
/* @__PURE__ */ (0,
|
|
5227
|
-
/* @__PURE__ */ (0,
|
|
5228
|
-
/* @__PURE__ */ (0,
|
|
5280
|
+
form.capabilities.includes("skills") && companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CompanionSkillSettings, { companionId: companion.id }),
|
|
5281
|
+
form.capabilities.includes("skills") && !companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime10.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" }),
|
|
5282
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CompanionAccessPanel, { companionId: companion.id }),
|
|
5283
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
|
|
5284
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-form-actions", children: [
|
|
5285
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", {}),
|
|
5286
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: saving, onClick: () => {
|
|
5229
5287
|
void save();
|
|
5230
5288
|
}, children: saving ? "\u6B63\u5728\u5E94\u7528\u2026" : "\u5E94\u7528\u80FD\u529B\u7EC4\u5408" })
|
|
5231
5289
|
] })
|
|
@@ -5233,10 +5291,10 @@ function CapabilityEditor({ companion, presets, onChanged }) {
|
|
|
5233
5291
|
}
|
|
5234
5292
|
function WeixinPanel({ companion, snapshot, onChanged }) {
|
|
5235
5293
|
const channel = snapshot.channels.find((item) => item.companionId === companion.id);
|
|
5236
|
-
const [login, setLogin] = (0,
|
|
5237
|
-
const [busy, setBusy] = (0,
|
|
5238
|
-
const [error, setError] = (0,
|
|
5239
|
-
(0,
|
|
5294
|
+
const [login, setLogin] = (0, import_react11.useState)();
|
|
5295
|
+
const [busy, setBusy] = (0, import_react11.useState)(false);
|
|
5296
|
+
const [error, setError] = (0, import_react11.useState)();
|
|
5297
|
+
(0, import_react11.useEffect)(() => {
|
|
5240
5298
|
if (!login || login.phase === "confirmed" || login.phase === "expired" || login.phase === "error") return;
|
|
5241
5299
|
const timer = window.setInterval(() => {
|
|
5242
5300
|
void api(`/weixin/login/${login.id}`).then(async (result) => {
|
|
@@ -5282,93 +5340,93 @@ function WeixinPanel({ companion, snapshot, onChanged }) {
|
|
|
5282
5340
|
setError(errorMessage(reason));
|
|
5283
5341
|
}
|
|
5284
5342
|
};
|
|
5285
|
-
return /* @__PURE__ */ (0,
|
|
5286
|
-
/* @__PURE__ */ (0,
|
|
5287
|
-
!channel && !login && /* @__PURE__ */ (0,
|
|
5288
|
-
/* @__PURE__ */ (0,
|
|
5289
|
-
/* @__PURE__ */ (0,
|
|
5290
|
-
/* @__PURE__ */ (0,
|
|
5343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
|
|
5344
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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" }),
|
|
5345
|
+
!channel && !login && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
|
|
5346
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WeixinGlyph, { large: true }) }),
|
|
5347
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
5348
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("strong", { children: [
|
|
5291
5349
|
"\u628A ",
|
|
5292
5350
|
companion.name,
|
|
5293
5351
|
" \u5E26\u5230\u5FAE\u4FE1"
|
|
5294
5352
|
] }),
|
|
5295
|
-
/* @__PURE__ */ (0,
|
|
5296
|
-
/* @__PURE__ */ (0,
|
|
5297
|
-
/* @__PURE__ */ (0,
|
|
5298
|
-
/* @__PURE__ */ (0,
|
|
5299
|
-
/* @__PURE__ */ (0,
|
|
5353
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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" }),
|
|
5354
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("ul", { children: [
|
|
5355
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
|
|
5356
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
|
|
5357
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
|
|
5300
5358
|
] })
|
|
5301
5359
|
] }),
|
|
5302
|
-
/* @__PURE__ */ (0,
|
|
5360
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy, onClick: () => {
|
|
5303
5361
|
void begin();
|
|
5304
5362
|
}, children: busy ? "\u6B63\u5728\u7533\u8BF7\u4E8C\u7EF4\u7801\u2026" : "\u626B\u7801\u8FDE\u63A5\u5FAE\u4FE1" })
|
|
5305
5363
|
] }),
|
|
5306
|
-
login && /* @__PURE__ */ (0,
|
|
5307
|
-
/* @__PURE__ */ (0,
|
|
5308
|
-
/* @__PURE__ */ (0,
|
|
5309
|
-
/* @__PURE__ */ (0,
|
|
5310
|
-
/* @__PURE__ */ (0,
|
|
5311
|
-
/* @__PURE__ */ (0,
|
|
5312
|
-
(login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0,
|
|
5364
|
+
login && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
|
|
5365
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
|
|
5366
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
5367
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "WECHAT ILINK BOT" }),
|
|
5368
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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" }),
|
|
5369
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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") }),
|
|
5370
|
+
(login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", onClick: () => {
|
|
5313
5371
|
setLogin(void 0);
|
|
5314
5372
|
void begin();
|
|
5315
5373
|
}, children: [
|
|
5316
|
-
/* @__PURE__ */ (0,
|
|
5374
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconRefreshOutline16, { size: 16 }),
|
|
5317
5375
|
"\u91CD\u65B0\u751F\u6210"
|
|
5318
5376
|
] })
|
|
5319
5377
|
] })
|
|
5320
5378
|
] }),
|
|
5321
|
-
channel && /* @__PURE__ */ (0,
|
|
5322
|
-
/* @__PURE__ */ (0,
|
|
5323
|
-
/* @__PURE__ */ (0,
|
|
5324
|
-
/* @__PURE__ */ (0,
|
|
5325
|
-
/* @__PURE__ */ (0,
|
|
5326
|
-
/* @__PURE__ */ (0,
|
|
5327
|
-
/* @__PURE__ */ (0,
|
|
5379
|
+
channel && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
5380
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
|
|
5381
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WeixinGlyph, { large: true }) }),
|
|
5382
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
5383
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "WECHAT CHANNEL" }),
|
|
5384
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: channel.name }),
|
|
5385
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: channel.accountId })
|
|
5328
5386
|
] }),
|
|
5329
|
-
/* @__PURE__ */ (0,
|
|
5330
|
-
/* @__PURE__ */ (0,
|
|
5387
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChannelStatus, { channel }),
|
|
5388
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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: () => {
|
|
5331
5389
|
void toggle();
|
|
5332
|
-
}, children: /* @__PURE__ */ (0,
|
|
5390
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}) })
|
|
5333
5391
|
] }),
|
|
5334
|
-
channel.lastError && /* @__PURE__ */ (0,
|
|
5335
|
-
/* @__PURE__ */ (0,
|
|
5336
|
-
/* @__PURE__ */ (0,
|
|
5337
|
-
/* @__PURE__ */ (0,
|
|
5338
|
-
/* @__PURE__ */ (0,
|
|
5392
|
+
channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsh-partner-inline-error", children: channel.lastError }),
|
|
5393
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
|
|
5394
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
5395
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "ACCESS" }),
|
|
5396
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
|
|
5339
5397
|
] }),
|
|
5340
|
-
/* @__PURE__ */ (0,
|
|
5398
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("em", { children: [
|
|
5341
5399
|
pairings.filter((item) => item.status === "pending").length,
|
|
5342
5400
|
" \u4E2A\u5F85\u5904\u7406"
|
|
5343
5401
|
] })
|
|
5344
5402
|
] }),
|
|
5345
|
-
/* @__PURE__ */ (0,
|
|
5346
|
-
/* @__PURE__ */ (0,
|
|
5347
|
-
/* @__PURE__ */ (0,
|
|
5348
|
-
/* @__PURE__ */ (0,
|
|
5349
|
-
/* @__PURE__ */ (0,
|
|
5403
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.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_runtime10.jsxs)("article", { children: [
|
|
5404
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconUserOutline16, { size: 16 }) }),
|
|
5405
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
5406
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: pairing.displayName }),
|
|
5407
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { children: [
|
|
5350
5408
|
pairing.status === "pending" ? "\u7B49\u5F85\u5BA1\u6279" : pairing.status === "approved" ? "\u5DF2\u6388\u6743\u72EC\u7ACB\u4F1A\u8BDD" : "\u5DF2\u963B\u6B62",
|
|
5351
5409
|
" \xB7 ",
|
|
5352
5410
|
new Date(pairing.updatedAt).toLocaleString()
|
|
5353
5411
|
] })
|
|
5354
5412
|
] }),
|
|
5355
|
-
pairing.status === "pending" && /* @__PURE__ */ (0,
|
|
5356
|
-
/* @__PURE__ */ (0,
|
|
5413
|
+
pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
5414
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { onClick: () => {
|
|
5357
5415
|
void actPairing(pairing.id, "blocked");
|
|
5358
5416
|
}, children: "\u62D2\u7EDD" }),
|
|
5359
|
-
/* @__PURE__ */ (0,
|
|
5417
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { className: "is-primary", onClick: () => {
|
|
5360
5418
|
void actPairing(pairing.id, "approved");
|
|
5361
5419
|
}, children: "\u6279\u51C6" })
|
|
5362
5420
|
] }),
|
|
5363
|
-
pairing.status === "approved" && /* @__PURE__ */ (0,
|
|
5421
|
+
pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { onClick: () => {
|
|
5364
5422
|
void actPairing(pairing.id, "blocked");
|
|
5365
5423
|
}, children: "\u64A4\u9500" }),
|
|
5366
|
-
pairing.status === "blocked" && /* @__PURE__ */ (0,
|
|
5424
|
+
pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { onClick: () => {
|
|
5367
5425
|
void actPairing(pairing.id, "approved");
|
|
5368
5426
|
}, children: "\u91CD\u65B0\u6279\u51C6" })
|
|
5369
5427
|
] }, pairing.id)) })
|
|
5370
5428
|
] }),
|
|
5371
|
-
error && /* @__PURE__ */ (0,
|
|
5429
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsh-partner-inline-error", children: error })
|
|
5372
5430
|
] });
|
|
5373
5431
|
}
|
|
5374
5432
|
function MemoryPanel({ companion, snapshot, openSession, startSession, renewSession, onChanged }) {
|
|
@@ -5376,19 +5434,19 @@ function MemoryPanel({ companion, snapshot, openSession, startSession, renewSess
|
|
|
5376
5434
|
const localSession = sessions2.find((item) => item.kind === "local");
|
|
5377
5435
|
const channelSessionCount = sessions2.filter((item) => item.kind === "channel").length;
|
|
5378
5436
|
const heartbeat = snapshot.heartbeatStates.find((item) => item.companionId === companion.id);
|
|
5379
|
-
const [automation, setAutomation] = (0,
|
|
5380
|
-
const [memories, setMemories] = (0,
|
|
5381
|
-
const [reflections, setReflections] = (0,
|
|
5382
|
-
const [profiles, setProfiles] = (0,
|
|
5383
|
-
const [concernActivity, setConcernActivity] = (0,
|
|
5384
|
-
const [newConcern, setNewConcern] = (0,
|
|
5385
|
-
const [memoryRevision, setMemoryRevision] = (0,
|
|
5386
|
-
const [editing, setEditing] = (0,
|
|
5387
|
-
const [busy, setBusy] = (0,
|
|
5388
|
-
const [notice, setNotice] = (0,
|
|
5389
|
-
const [error, setError] = (0,
|
|
5390
|
-
const [modelCatalog, setModelCatalog] = (0,
|
|
5391
|
-
const loadMemory = (0,
|
|
5437
|
+
const [automation, setAutomation] = (0, import_react11.useState)(() => structuredClone(companion.automation));
|
|
5438
|
+
const [memories, setMemories] = (0, import_react11.useState)([]);
|
|
5439
|
+
const [reflections, setReflections] = (0, import_react11.useState)([]);
|
|
5440
|
+
const [profiles, setProfiles] = (0, import_react11.useState)([]);
|
|
5441
|
+
const [concernActivity, setConcernActivity] = (0, import_react11.useState)({ concerns: [], observations: [] });
|
|
5442
|
+
const [newConcern, setNewConcern] = (0, import_react11.useState)("");
|
|
5443
|
+
const [memoryRevision, setMemoryRevision] = (0, import_react11.useState)(0);
|
|
5444
|
+
const [editing, setEditing] = (0, import_react11.useState)();
|
|
5445
|
+
const [busy, setBusy] = (0, import_react11.useState)(false);
|
|
5446
|
+
const [notice, setNotice] = (0, import_react11.useState)();
|
|
5447
|
+
const [error, setError] = (0, import_react11.useState)();
|
|
5448
|
+
const [modelCatalog, setModelCatalog] = (0, import_react11.useState)();
|
|
5449
|
+
const loadMemory = (0, import_react11.useCallback)(async () => {
|
|
5392
5450
|
const [result, activity] = await Promise.all([api(`/companions/${companion.id}/memory`), api(`/companions/${companion.id}/concerns`)]);
|
|
5393
5451
|
setMemories(result.memories);
|
|
5394
5452
|
setReflections(result.reflections);
|
|
@@ -5396,11 +5454,11 @@ function MemoryPanel({ companion, snapshot, openSession, startSession, renewSess
|
|
|
5396
5454
|
setConcernActivity(activity);
|
|
5397
5455
|
setMemoryRevision((value) => value + 1);
|
|
5398
5456
|
}, [companion.id]);
|
|
5399
|
-
(0,
|
|
5457
|
+
(0, import_react11.useEffect)(() => {
|
|
5400
5458
|
setAutomation(structuredClone(companion.automation));
|
|
5401
5459
|
void loadMemory().catch((reason) => setError(errorMessage(reason)));
|
|
5402
5460
|
}, [companion.id, companion.updatedAt, loadMemory]);
|
|
5403
|
-
(0,
|
|
5461
|
+
(0, import_react11.useEffect)(() => {
|
|
5404
5462
|
void api("/models").then(setModelCatalog).catch((reason) => setError(errorMessage(reason)));
|
|
5405
5463
|
}, []);
|
|
5406
5464
|
const inheritedProvider = companion.provider || modelCatalog?.defaultSelection.provider || "";
|
|
@@ -5510,157 +5568,157 @@ function MemoryPanel({ companion, snapshot, openSession, startSession, renewSess
|
|
|
5510
5568
|
setBusy(false);
|
|
5511
5569
|
}
|
|
5512
5570
|
};
|
|
5513
|
-
return /* @__PURE__ */ (0,
|
|
5514
|
-
/* @__PURE__ */ (0,
|
|
5515
|
-
/* @__PURE__ */ (0,
|
|
5516
|
-
/* @__PURE__ */ (0,
|
|
5517
|
-
/* @__PURE__ */ (0,
|
|
5518
|
-
/* @__PURE__ */ (0,
|
|
5519
|
-
/* @__PURE__ */ (0,
|
|
5571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-form is-memory", children: [
|
|
5572
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SectionHeading, { eyebrow: "CONTINUITY", title: "\u4F1A\u8BDD\u8BB0\u5FC6", detail: "\u4F19\u4F34\u53EF\u4EE5\u76F4\u63A5\u5728 DSH \u4E2D\u5EFA\u7ACB\u672C\u5730\u5BF9\u8BDD\uFF1B\u5FAE\u4FE1\u53EA\u662F\u53EF\u9009\u6E20\u9053\u3002\u4E0D\u540C\u8054\u7CFB\u4EBA\u4ECD\u4FDD\u6301\u72EC\u7ACB\u4E0A\u4E0B\u6587\uFF0C\u77E5\u8BC6\u5E93\u7EE7\u7EED\u7531\u77E5\u8BC6\u5E93\u63D2\u4EF6\u7BA1\u7406\u3002" }),
|
|
5573
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-metrics", children: [
|
|
5574
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("article", { children: [
|
|
5575
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u4F19\u4F34\u4F1A\u8BDD" }),
|
|
5576
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: sessions2.length }),
|
|
5577
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: localSession ? `1 \u4E2A\u672C\u5730 \xB7 ${channelSessionCount} \u4E2A\u6E20\u9053` : `${channelSessionCount} \u4E2A\u6E20\u9053` })
|
|
5520
5578
|
] }),
|
|
5521
|
-
/* @__PURE__ */ (0,
|
|
5522
|
-
/* @__PURE__ */ (0,
|
|
5523
|
-
/* @__PURE__ */ (0,
|
|
5524
|
-
/* @__PURE__ */ (0,
|
|
5579
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("article", { children: [
|
|
5580
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u957F\u671F\u8BB0\u5FC6" }),
|
|
5581
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: memories.filter((item) => item.status === "active").length }),
|
|
5582
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { children: [
|
|
5525
5583
|
reflections.length,
|
|
5526
5584
|
" \u7BC7\u6BCF\u65E5\u56DE\u987E"
|
|
5527
5585
|
] })
|
|
5528
5586
|
] }),
|
|
5529
|
-
/* @__PURE__ */ (0,
|
|
5530
|
-
/* @__PURE__ */ (0,
|
|
5531
|
-
/* @__PURE__ */ (0,
|
|
5532
|
-
/* @__PURE__ */ (0,
|
|
5587
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("article", { children: [
|
|
5588
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u6700\u8FD1\u5FC3\u8DF3" }),
|
|
5589
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: heartbeat?.lastCheckedAt ? relativeTime(heartbeat.lastCheckedAt) : "\u5C1A\u672A" }),
|
|
5590
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: heartbeat?.lastError ? "\u4E0A\u6B21\u6267\u884C\u5F02\u5E38" : `\u4ECA\u65E5\u53D1\u9001 ${heartbeat?.sentCount ?? 0} \u6B21` })
|
|
5533
5591
|
] })
|
|
5534
5592
|
] }),
|
|
5535
|
-
/* @__PURE__ */ (0,
|
|
5536
|
-
/* @__PURE__ */ (0,
|
|
5537
|
-
/* @__PURE__ */ (0,
|
|
5538
|
-
/* @__PURE__ */ (0,
|
|
5539
|
-
/* @__PURE__ */ (0,
|
|
5540
|
-
/* @__PURE__ */ (0,
|
|
5593
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-automation-grid", children: [
|
|
5594
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-automation", children: [
|
|
5595
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { children: [
|
|
5596
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
5597
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u5B66\u4E60\u4E0E\u957F\u671F\u8BB0\u5FC6" }),
|
|
5598
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u6309\u8054\u7CFB\u4EBA\u5F52\u6863\u5B8C\u6574\u5BF9\u8BDD\uFF0C\u63D0\u70BC\u6BCF\u65E5\u56DE\u987E\u548C\u7ED3\u6784\u5316\u8BB0\u5FC6\uFF0C\u5E76\u5728\u76F8\u5173\u8BDD\u9898\u51FA\u73B0\u65F6\u53EC\u56DE\u3002" })
|
|
5541
5599
|
] }),
|
|
5542
|
-
/* @__PURE__ */ (0,
|
|
5600
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.memory.enabled, "aria-label": "\u542F\u7528\u4F19\u4F34\u5B66\u4E60", onClick: () => setAutomation((current) => ({ ...current, memory: { ...current.memory, enabled: !current.memory.enabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}) })
|
|
5543
5601
|
] }),
|
|
5544
|
-
/* @__PURE__ */ (0,
|
|
5545
|
-
/* @__PURE__ */ (0,
|
|
5546
|
-
/* @__PURE__ */ (0,
|
|
5547
|
-
/* @__PURE__ */ (0,
|
|
5548
|
-
/* @__PURE__ */ (0,
|
|
5549
|
-
/* @__PURE__ */ (0,
|
|
5550
|
-
/* @__PURE__ */ (0,
|
|
5551
|
-
/* @__PURE__ */ (0,
|
|
5602
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-automation-fields is-memory-model", children: [
|
|
5603
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormField, { label: "\u4FDD\u7559\u671F\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { value: automation.memory.retentionDays, onChange: (event) => setAutomation((current) => ({ ...current, memory: { ...current.memory, retentionDays: Number(event.target.value) } })), children: [
|
|
5604
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 0, children: "\u6C38\u4E45\u4FDD\u7559" }),
|
|
5605
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 30, children: "30 \u5929" }),
|
|
5606
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 90, children: "90 \u5929" }),
|
|
5607
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 180, children: "180 \u5929" }),
|
|
5608
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 365, children: "1 \u5E74" }),
|
|
5609
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 1095, children: "3 \u5E74" })
|
|
5552
5610
|
] }) }),
|
|
5553
|
-
/* @__PURE__ */ (0,
|
|
5554
|
-
/* @__PURE__ */ (0,
|
|
5611
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormField, { label: "\u63D0\u70BC Provider", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { value: automation.memory.provider ?? "", onChange: (event) => setAutomation((current) => ({ ...current, memory: { ...current.memory, provider: event.target.value, model: "" } })), children: [
|
|
5612
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: "", children: [
|
|
5555
5613
|
"\u8DDF\u968F\u4F19\u4F34 \xB7 ",
|
|
5556
5614
|
inheritedProvider || "DSH \u9ED8\u8BA4"
|
|
5557
5615
|
] }),
|
|
5558
|
-
modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0,
|
|
5616
|
+
modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
|
|
5559
5617
|
] }) }),
|
|
5560
|
-
/* @__PURE__ */ (0,
|
|
5561
|
-
/* @__PURE__ */ (0,
|
|
5618
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormField, { label: "\u63D0\u70BC\u6A21\u578B", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { value: automation.memory.model ?? "", onChange: (event) => setAutomation((current) => ({ ...current, memory: { ...current.memory, model: event.target.value } })), children: [
|
|
5619
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: "", children: [
|
|
5562
5620
|
"\u8DDF\u968F\u4F19\u4F34 \xB7 ",
|
|
5563
5621
|
companion.model || modelCatalog?.defaultSelection.model || "DSH \u9ED8\u8BA4"
|
|
5564
5622
|
] }),
|
|
5565
|
-
modelOptions.map((model) => /* @__PURE__ */ (0,
|
|
5623
|
+
modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
|
|
5566
5624
|
] }) })
|
|
5567
5625
|
] }),
|
|
5568
|
-
/* @__PURE__ */ (0,
|
|
5569
|
-
/* @__PURE__ */ (0,
|
|
5570
|
-
/* @__PURE__ */ (0,
|
|
5571
|
-
/* @__PURE__ */ (0,
|
|
5572
|
-
/* @__PURE__ */ (0,
|
|
5626
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-review-policy", children: [
|
|
5627
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.memory.dailyReviewEnabled, "aria-label": "\u542F\u7528\u6BCF\u65E5\u7EC8\u5BA1", onClick: () => setAutomation((current) => ({ ...current, memory: { ...current.memory, dailyReviewEnabled: !current.memory.dailyReviewEnabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}) }),
|
|
5628
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
5629
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u6BCF\u65E5\u7EC8\u5BA1" }),
|
|
5630
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u6B21\u65E5\u81EA\u52A8\u5408\u5E76\u91CD\u590D\u3001\u7EA0\u6B63\u504F\u5DEE\u5E76\u5EFA\u7ACB\u8BB0\u5FC6\u5173\u7CFB" })
|
|
5573
5631
|
] }),
|
|
5574
|
-
/* @__PURE__ */ (0,
|
|
5632
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("select", { "aria-label": "\u6BCF\u65E5\u7EC8\u5BA1\u65F6\u95F4", value: automation.memory.dailyReviewHour, onChange: (event) => setAutomation((current) => ({ ...current, memory: { ...current.memory, dailyReviewHour: Number(event.target.value) } })), children: Array.from({ length: 24 }, (_, hour) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("option", { value: hour, children: [
|
|
5575
5633
|
String(hour).padStart(2, "0"),
|
|
5576
5634
|
":00"
|
|
5577
5635
|
] }, hour)) }) }),
|
|
5578
|
-
/* @__PURE__ */ (0,
|
|
5636
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy || reflections.length === 0, onClick: () => {
|
|
5579
5637
|
void review();
|
|
5580
5638
|
}, children: "\u7ACB\u5373\u7EC8\u5BA1" })
|
|
5581
5639
|
] })
|
|
5582
5640
|
] }),
|
|
5583
|
-
/* @__PURE__ */ (0,
|
|
5584
|
-
/* @__PURE__ */ (0,
|
|
5585
|
-
/* @__PURE__ */ (0,
|
|
5586
|
-
/* @__PURE__ */ (0,
|
|
5587
|
-
/* @__PURE__ */ (0,
|
|
5641
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-automation", children: [
|
|
5642
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { children: [
|
|
5643
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
5644
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u6301\u7EED\u611F\u77E5" }),
|
|
5645
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u4F19\u4F34\u53EA\u89C2\u5BDF\u5C1A\u672A\u95ED\u73AF\u7684\u4E8B\u60C5\u662F\u5426\u51FA\u73B0\u65B0\u53D8\u5316\uFF0C\u5E76\u7531\u514B\u5236\u7684\u6253\u6270\u7B56\u7565\u51B3\u5B9A\u4F55\u65F6\u544A\u8BC9\u4F60\u3002" })
|
|
5588
5646
|
] }),
|
|
5589
|
-
/* @__PURE__ */ (0,
|
|
5647
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.heartbeat.enabled, "aria-label": "\u542F\u7528\u4F19\u4F34\u5FC3\u8DF3", onClick: () => setAutomation((current) => ({ ...current, heartbeat: { ...current.heartbeat, enabled: !current.heartbeat.enabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}) })
|
|
5590
5648
|
] }),
|
|
5591
|
-
/* @__PURE__ */ (0,
|
|
5592
|
-
/* @__PURE__ */ (0,
|
|
5593
|
-
/* @__PURE__ */ (0,
|
|
5594
|
-
/* @__PURE__ */ (0,
|
|
5595
|
-
/* @__PURE__ */ (0,
|
|
5596
|
-
/* @__PURE__ */ (0,
|
|
5597
|
-
/* @__PURE__ */ (0,
|
|
5598
|
-
/* @__PURE__ */ (0,
|
|
5649
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-automation-fields is-heartbeat", children: [
|
|
5650
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormField, { label: "\u68C0\u67E5\u95F4\u9694", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { value: automation.heartbeat.intervalMinutes, onChange: (event) => setAutomation((current) => ({ ...current, heartbeat: { ...current.heartbeat, intervalMinutes: Number(event.target.value) } })), children: [
|
|
5651
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 30, children: "30 \u5206\u949F" }),
|
|
5652
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 60, children: "1 \u5C0F\u65F6" }),
|
|
5653
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 180, children: "3 \u5C0F\u65F6" }),
|
|
5654
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 360, children: "6 \u5C0F\u65F6" }),
|
|
5655
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 720, children: "12 \u5C0F\u65F6" }),
|
|
5656
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 1440, children: "24 \u5C0F\u65F6" })
|
|
5599
5657
|
] }) }),
|
|
5600
|
-
/* @__PURE__ */ (0,
|
|
5601
|
-
/* @__PURE__ */ (0,
|
|
5602
|
-
/* @__PURE__ */ (0,
|
|
5603
|
-
/* @__PURE__ */ (0,
|
|
5604
|
-
/* @__PURE__ */ (0,
|
|
5605
|
-
/* @__PURE__ */ (0,
|
|
5606
|
-
/* @__PURE__ */ (0,
|
|
5607
|
-
/* @__PURE__ */ (0,
|
|
5608
|
-
/* @__PURE__ */ (0,
|
|
5658
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormField, { label: "\u514D\u6253\u6270\u5F00\u59CB", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { type: "number", min: 0, max: 23, value: automation.heartbeat.quietStartHour, onChange: (event) => setAutomation((current) => ({ ...current, heartbeat: { ...current.heartbeat, quietStartHour: Number(event.target.value) } })) }) }),
|
|
5659
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormField, { label: "\u514D\u6253\u6270\u7ED3\u675F", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { type: "number", min: 0, max: 23, value: automation.heartbeat.quietEndHour, onChange: (event) => setAutomation((current) => ({ ...current, heartbeat: { ...current.heartbeat, quietEndHour: Number(event.target.value) } })) }) }),
|
|
5660
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FormField, { label: "\u6BCF\u65E5\u4E0A\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { value: automation.heartbeat.dailyLimit, onChange: (event) => setAutomation((current) => ({ ...current, heartbeat: { ...current.heartbeat, dailyLimit: Number(event.target.value) } })), children: [
|
|
5661
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 0, children: "\u4E0D\u9650" }),
|
|
5662
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 1, children: "1 \u6B21" }),
|
|
5663
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 2, children: "2 \u6B21" }),
|
|
5664
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 3, children: "3 \u6B21" }),
|
|
5665
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 5, children: "5 \u6B21" }),
|
|
5666
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: 8, children: "8 \u6B21" })
|
|
5609
5667
|
] }) })
|
|
5610
5668
|
] }),
|
|
5611
|
-
/* @__PURE__ */ (0,
|
|
5669
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ConcernBoard, { companionId: companion.id, activity: concernActivity, value: newConcern, busy, onValue: setNewConcern, onAdd: () => {
|
|
5612
5670
|
void addConcern();
|
|
5613
5671
|
}, onCheck: (item) => {
|
|
5614
5672
|
void trigger(item.id);
|
|
5615
5673
|
}, onAct: (item, action) => {
|
|
5616
5674
|
void actConcern(item, action);
|
|
5617
5675
|
} }),
|
|
5618
|
-
heartbeat?.lastError && /* @__PURE__ */ (0,
|
|
5619
|
-
/* @__PURE__ */ (0,
|
|
5620
|
-
/* @__PURE__ */ (0,
|
|
5676
|
+
heartbeat?.lastError && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsh-partner-inline-error", children: heartbeat.lastError }),
|
|
5677
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-automation-actions", children: [
|
|
5678
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy || sessions2.length === 0, onClick: () => {
|
|
5621
5679
|
void trigger();
|
|
5622
5680
|
}, children: "\u68C0\u67E5\u5230\u671F\u9879" }),
|
|
5623
|
-
/* @__PURE__ */ (0,
|
|
5681
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => {
|
|
5624
5682
|
void save();
|
|
5625
5683
|
}, children: busy ? "\u6B63\u5728\u5904\u7406\u2026" : "\u4FDD\u5B58\u8BBE\u7F6E" })
|
|
5626
5684
|
] })
|
|
5627
5685
|
] })
|
|
5628
5686
|
] }),
|
|
5629
|
-
notice && /* @__PURE__ */ (0,
|
|
5630
|
-
/* @__PURE__ */ (0,
|
|
5687
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { className: "dsh-partner-inline-notice", children: [
|
|
5688
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconCheckOutline14, { size: 14 }),
|
|
5631
5689
|
notice
|
|
5632
5690
|
] }),
|
|
5633
|
-
error && /* @__PURE__ */ (0,
|
|
5634
|
-
/* @__PURE__ */ (0,
|
|
5691
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
|
|
5692
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MemoryLibrary, { companionId: companion.id, revision: memoryRevision, profiles, memories, reflections, editing, busy, setEditing, save: () => {
|
|
5635
5693
|
void saveMemory();
|
|
5636
5694
|
}, remove: (item) => {
|
|
5637
5695
|
void deleteMemory(item);
|
|
5638
5696
|
} }),
|
|
5639
|
-
/* @__PURE__ */ (0,
|
|
5640
|
-
/* @__PURE__ */ (0,
|
|
5641
|
-
/* @__PURE__ */ (0,
|
|
5642
|
-
/* @__PURE__ */ (0,
|
|
5697
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-section-heading", children: [
|
|
5698
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
5699
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "SESSIONS" }),
|
|
5700
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u4F19\u4F34\u4F1A\u8BDD" })
|
|
5643
5701
|
] }),
|
|
5644
|
-
localSession === void 0 && /* @__PURE__ */ (0,
|
|
5702
|
+
localSession === void 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", onClick: () => {
|
|
5645
5703
|
void startSession(companion.id);
|
|
5646
5704
|
}, children: [
|
|
5647
|
-
/* @__PURE__ */ (0,
|
|
5705
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconPlusOutline16, { size: 14 }),
|
|
5648
5706
|
"\u5F00\u59CB\u672C\u5730\u5BF9\u8BDD"
|
|
5649
5707
|
] })
|
|
5650
5708
|
] }),
|
|
5651
|
-
/* @__PURE__ */ (0,
|
|
5652
|
-
sessions2.map((item) => /* @__PURE__ */ (0,
|
|
5653
|
-
/* @__PURE__ */ (0,
|
|
5654
|
-
/* @__PURE__ */ (0,
|
|
5655
|
-
/* @__PURE__ */ (0,
|
|
5656
|
-
/* @__PURE__ */ (0,
|
|
5709
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-session-list", children: [
|
|
5710
|
+
sessions2.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("article", { "data-archived": item.archived, "data-kind": item.kind, children: [
|
|
5711
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconDataOutline16, { size: 16 }) }),
|
|
5712
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
5713
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: item.kind === "local" ? "\u672C\u5730\u4F19\u4F34\u4F1A\u8BDD" : `\u5FAE\u4FE1\u8054\u7CFB\u4EBA \xB7 ${item.userId.slice(-6)}` }),
|
|
5714
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: item.archived ? "\u5DF2\u5F52\u6863 \xB7 \u957F\u671F\u8BB0\u5FC6\u4FDD\u7559" : `${item.sessionId} \xB7 ${new Date(item.lastMessageAt).toLocaleString()}` })
|
|
5657
5715
|
] }),
|
|
5658
|
-
/* @__PURE__ */ (0,
|
|
5716
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: item.archived ? "is-primary" : void 0, onClick: () => {
|
|
5659
5717
|
if (item.archived) void renewSession(item.id);
|
|
5660
5718
|
else void openSession(item.id, item.sessionId);
|
|
5661
5719
|
}, children: item.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
|
|
5662
5720
|
] }, item.id)),
|
|
5663
|
-
sessions2.length === 0 && /* @__PURE__ */ (0,
|
|
5721
|
+
sessions2.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u4F19\u4F34\u4F1A\u8BDD", detail: "\u65E0\u9700\u8FDE\u63A5\u5FAE\u4FE1\uFF0C\u76F4\u63A5\u5F00\u59CB\u672C\u5730\u5BF9\u8BDD\uFF1B\u4EE5\u540E\u8FDE\u63A5\u7684\u5FAE\u4FE1\u8054\u7CFB\u4EBA\u4F1A\u7EE7\u7EED\u4F7F\u7528\u5404\u81EA\u72EC\u7ACB\u7684\u6E20\u9053\u4F1A\u8BDD\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => {
|
|
5664
5722
|
void startSession(companion.id);
|
|
5665
5723
|
}, children: "\u5F00\u59CB\u5BF9\u8BDD" }), compact: true })
|
|
5666
5724
|
] })
|
|
@@ -5671,19 +5729,19 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
|
|
|
5671
5729
|
const active = visible.filter((item) => item.state !== "resolved");
|
|
5672
5730
|
const resolved = visible.filter((item) => item.state === "resolved");
|
|
5673
5731
|
const latest = new Map([...activity.observations].reverse().map((item) => [item.concernId, item]));
|
|
5674
|
-
const [composing, setComposing] = (0,
|
|
5675
|
-
const [expandedId, setExpandedId] = (0,
|
|
5676
|
-
const [visibleCount, setVisibleCount] = (0,
|
|
5677
|
-
const [mention, setMention] = (0,
|
|
5678
|
-
const [sources, setSources] = (0,
|
|
5679
|
-
const [sourcesLoading, setSourcesLoading] = (0,
|
|
5680
|
-
const [sourceError, setSourceError] = (0,
|
|
5681
|
-
const [activeSource, setActiveSource] = (0,
|
|
5682
|
-
const inputRef = (0,
|
|
5683
|
-
const listboxId = (0,
|
|
5732
|
+
const [composing, setComposing] = (0, import_react11.useState)(false);
|
|
5733
|
+
const [expandedId, setExpandedId] = (0, import_react11.useState)();
|
|
5734
|
+
const [visibleCount, setVisibleCount] = (0, import_react11.useState)(5);
|
|
5735
|
+
const [mention, setMention] = (0, import_react11.useState)();
|
|
5736
|
+
const [sources, setSources] = (0, import_react11.useState)([]);
|
|
5737
|
+
const [sourcesLoading, setSourcesLoading] = (0, import_react11.useState)(false);
|
|
5738
|
+
const [sourceError, setSourceError] = (0, import_react11.useState)();
|
|
5739
|
+
const [activeSource, setActiveSource] = (0, import_react11.useState)(0);
|
|
5740
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
5741
|
+
const listboxId = (0, import_react11.useId)();
|
|
5684
5742
|
const shown = active.slice(0, visibleCount);
|
|
5685
5743
|
const suggestionsOpen = composing && mention !== void 0;
|
|
5686
|
-
(0,
|
|
5744
|
+
(0, import_react11.useEffect)(() => {
|
|
5687
5745
|
if (!suggestionsOpen || mention === void 0) {
|
|
5688
5746
|
setSources([]);
|
|
5689
5747
|
setSourcesLoading(false);
|
|
@@ -5732,25 +5790,25 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
|
|
|
5732
5790
|
inputRef.current?.setSelectionRange(cursor, cursor);
|
|
5733
5791
|
});
|
|
5734
5792
|
};
|
|
5735
|
-
return /* @__PURE__ */ (0,
|
|
5736
|
-
/* @__PURE__ */ (0,
|
|
5737
|
-
/* @__PURE__ */ (0,
|
|
5738
|
-
/* @__PURE__ */ (0,
|
|
5793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-concern-board", "aria-labelledby": "partner-concerns-title", children: [
|
|
5794
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { children: [
|
|
5795
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
5796
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("strong", { id: "partner-concerns-title", children: [
|
|
5739
5797
|
"\u4F19\u4F34\u5728\u610F\u7684\u4E8B ",
|
|
5740
|
-
/* @__PURE__ */ (0,
|
|
5798
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: active.length })
|
|
5741
5799
|
] }),
|
|
5742
|
-
/* @__PURE__ */ (0,
|
|
5800
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: "\u5C1A\u672A\u95ED\u73AF\u3001\u503C\u5F97\u7EE7\u7EED\u7559\u610F\u7684\u4E8B\u60C5" })
|
|
5743
5801
|
] }),
|
|
5744
|
-
/* @__PURE__ */ (0,
|
|
5745
|
-
/* @__PURE__ */ (0,
|
|
5802
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", "aria-expanded": composing, onClick: () => setComposing((current) => !current), children: [
|
|
5803
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconPlusOutline16, { size: 14 }),
|
|
5746
5804
|
"\u4EA4\u4EE3\u4E00\u4EF6\u4E8B"
|
|
5747
5805
|
] })
|
|
5748
5806
|
] }),
|
|
5749
|
-
composing && /* @__PURE__ */ (0,
|
|
5750
|
-
/* @__PURE__ */ (0,
|
|
5751
|
-
/* @__PURE__ */ (0,
|
|
5752
|
-
/* @__PURE__ */ (0,
|
|
5753
|
-
/* @__PURE__ */ (0,
|
|
5807
|
+
composing && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { className: "dsh-partner-concern-compose", onSubmit: submit, children: [
|
|
5808
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
|
|
5809
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u9700\u8981\u7559\u610F\u7684\u4E8B" }),
|
|
5810
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-concern-input-wrap", children: [
|
|
5811
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5754
5812
|
"input",
|
|
5755
5813
|
{
|
|
5756
5814
|
ref: inputRef,
|
|
@@ -5786,10 +5844,10 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
|
|
|
5786
5844
|
}
|
|
5787
5845
|
}
|
|
5788
5846
|
),
|
|
5789
|
-
suggestionsOpen && /* @__PURE__ */ (0,
|
|
5847
|
+
suggestionsOpen && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { id: listboxId, className: "dsh-partner-concern-sources", role: "listbox", "aria-label": "\u53EF\u5F15\u7528\u7684\u6587\u4EF6\u4E0E\u77E5\u8BC6\u6587\u6863", children: sourcesLoading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { role: "status", children: "\u6B63\u5728\u67E5\u627E\u53EF\u5F15\u7528\u5185\u5BB9\u2026" }) : sourceError ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { role: "status", children: [
|
|
5790
5848
|
"\u5019\u9009\u52A0\u8F7D\u5931\u8D25\uFF1A",
|
|
5791
5849
|
sourceError
|
|
5792
|
-
] }) : sources.length === 0 ? /* @__PURE__ */ (0,
|
|
5850
|
+
] }) : sources.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { role: "status", children: "\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u6587\u4EF6\u6216\u5DF2\u6302\u8F7D\u77E5\u8BC6\u6587\u6863" }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: sources.map((source, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
5793
5851
|
"button",
|
|
5794
5852
|
{
|
|
5795
5853
|
type: "button",
|
|
@@ -5801,97 +5859,97 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
|
|
|
5801
5859
|
onMouseEnter: () => setActiveSource(index),
|
|
5802
5860
|
onClick: () => chooseSource(source),
|
|
5803
5861
|
children: [
|
|
5804
|
-
/* @__PURE__ */ (0,
|
|
5805
|
-
/* @__PURE__ */ (0,
|
|
5806
|
-
/* @__PURE__ */ (0,
|
|
5862
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: source.kind === "file" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconDataOutline16, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconLinkOutline16, { size: 15 }) }),
|
|
5863
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: source.label }),
|
|
5864
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: source.detail })
|
|
5807
5865
|
]
|
|
5808
5866
|
},
|
|
5809
5867
|
`${source.kind}:${source.token}`
|
|
5810
5868
|
)) }) })
|
|
5811
5869
|
] }),
|
|
5812
|
-
/* @__PURE__ */ (0,
|
|
5870
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { className: "dsh-partner-concern-compose-hint", children: [
|
|
5813
5871
|
"\u8F93\u5165 ",
|
|
5814
|
-
/* @__PURE__ */ (0,
|
|
5872
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: "@" }),
|
|
5815
5873
|
" \u4F1A\u5217\u51FA\u5F53\u524D\u4F1A\u8BDD\u6587\u4EF6\u548C\u5DF2\u6302\u8F7D\u7684\u77E5\u8BC6\u6587\u6863\uFF0C\u4E5F\u53EF\u4EE5\u7EE7\u7EED\u8F93\u5165\u5173\u952E\u8BCD\u7B5B\u9009\u3002"
|
|
5816
5874
|
] })
|
|
5817
5875
|
] }),
|
|
5818
|
-
/* @__PURE__ */ (0,
|
|
5819
|
-
/* @__PURE__ */ (0,
|
|
5876
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
5877
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => {
|
|
5820
5878
|
setComposing(false);
|
|
5821
5879
|
setMention(void 0);
|
|
5822
5880
|
onValue("");
|
|
5823
5881
|
}, children: "\u53D6\u6D88" }),
|
|
5824
|
-
/* @__PURE__ */ (0,
|
|
5882
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !value.trim(), children: "\u8BA9\u4F19\u4F34\u8BB0\u7740" })
|
|
5825
5883
|
] })
|
|
5826
5884
|
] }),
|
|
5827
|
-
/* @__PURE__ */ (0,
|
|
5885
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-concern-list", role: "list", children: active.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsh-partner-concern-empty", children: "\u6700\u8FD1\u6CA1\u6709\u672A\u95ED\u73AF\u7684\u4E8B\u3002\u4F60\u4E5F\u53EF\u4EE5\u76F4\u63A5\u5BF9\u4F19\u4F34\u8BF4\u201C\u8FD9\u4E2A\u5E2E\u6211\u7559\u610F\u201D\u3002" }) : shown.map((item) => {
|
|
5828
5886
|
const observation = latest.get(item.id);
|
|
5829
5887
|
const expanded = expandedId === item.id;
|
|
5830
5888
|
const status = observation ? concernObservationStatus(observation) : item.state === "active" ? "\u6B63\u5728\u7559\u610F" : "\u6682\u65F6\u8BB0\u7740";
|
|
5831
|
-
return /* @__PURE__ */ (0,
|
|
5832
|
-
/* @__PURE__ */ (0,
|
|
5833
|
-
/* @__PURE__ */ (0,
|
|
5834
|
-
/* @__PURE__ */ (0,
|
|
5889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("article", { role: "listitem", "data-state": item.state, "data-expanded": expanded, children: [
|
|
5890
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "dsh-partner-concern-row", "aria-expanded": expanded, onClick: () => setExpandedId((current) => current === item.id ? void 0 : item.id), children: [
|
|
5891
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "dsh-partner-concern-state", children: [
|
|
5892
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}),
|
|
5835
5893
|
status
|
|
5836
5894
|
] }),
|
|
5837
|
-
/* @__PURE__ */ (0,
|
|
5838
|
-
/* @__PURE__ */ (0,
|
|
5839
|
-
/* @__PURE__ */ (0,
|
|
5895
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "dsh-partner-concern-copy", children: [
|
|
5896
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: item.subject }),
|
|
5897
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: observation ? observation.event : item.reason })
|
|
5840
5898
|
] }),
|
|
5841
|
-
/* @__PURE__ */ (0,
|
|
5842
|
-
/* @__PURE__ */ (0,
|
|
5843
|
-
/* @__PURE__ */ (0,
|
|
5899
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "dsh-partner-concern-time", title: `\u8BA1\u5212\u4E8E ${new Date(item.nextCheckAt).toLocaleString()} \u518D\u6B21\u7559\u610F`, children: [
|
|
5900
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u4E0B\u6B21\u7559\u610F" }),
|
|
5901
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: futureTime(item.nextCheckAt) })
|
|
5844
5902
|
] }),
|
|
5845
|
-
/* @__PURE__ */ (0,
|
|
5903
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconChevronDownOutline14, { size: 14 })
|
|
5846
5904
|
] }),
|
|
5847
|
-
expanded && /* @__PURE__ */ (0,
|
|
5848
|
-
/* @__PURE__ */ (0,
|
|
5849
|
-
observation && /* @__PURE__ */ (0,
|
|
5850
|
-
/* @__PURE__ */ (0,
|
|
5851
|
-
/* @__PURE__ */ (0,
|
|
5852
|
-
/* @__PURE__ */ (0,
|
|
5853
|
-
/* @__PURE__ */ (0,
|
|
5854
|
-
/* @__PURE__ */ (0,
|
|
5905
|
+
expanded && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-concern-detail", children: [
|
|
5906
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: item.reason }),
|
|
5907
|
+
observation && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
5908
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("blockquote", { children: observation.event }),
|
|
5909
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-concern-decision", "data-decision": observation.decision, children: [
|
|
5910
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: concernObservationStatus(observation) }),
|
|
5911
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: observation.decisionReason || concernObservationExplanation(observation) }),
|
|
5912
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { children: [
|
|
5855
5913
|
"\u6253\u6270\u5206\u6570 ",
|
|
5856
5914
|
Math.round(observation.interruptScore * 100),
|
|
5857
5915
|
observation.notificationRuleEffect !== "auto" && observation.notificationRuleReason ? ` \xB7 \u77E5\u8BC6\u89C4\u5219\uFF1A${observation.notificationRuleReason}` : ""
|
|
5858
5916
|
] })
|
|
5859
5917
|
] })
|
|
5860
5918
|
] }),
|
|
5861
|
-
item.resources.length > 0 && /* @__PURE__ */ (0,
|
|
5919
|
+
item.resources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-concern-resources", children: item.resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
5862
5920
|
resource.kind === "file" ? "\u6587\u4EF6" : "\u77E5\u8BC6",
|
|
5863
5921
|
" \xB7 ",
|
|
5864
5922
|
resource.label
|
|
5865
5923
|
] }, `${resource.kind}:${resource.locator}`)) }),
|
|
5866
|
-
/* @__PURE__ */ (0,
|
|
5924
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { children: [
|
|
5867
5925
|
item.origin === "explicit" ? "\u4F60\u660E\u786E\u4EA4\u4EE3" : "\u4F19\u4F34\u4ECE\u5BF9\u8BDD\u4E2D\u6CE8\u610F\u5230",
|
|
5868
5926
|
" \xB7 ",
|
|
5869
5927
|
watchKindLabel(item.watchKind)
|
|
5870
5928
|
] }),
|
|
5871
|
-
/* @__PURE__ */ (0,
|
|
5872
|
-
/* @__PURE__ */ (0,
|
|
5873
|
-
/* @__PURE__ */ (0,
|
|
5874
|
-
/* @__PURE__ */ (0,
|
|
5875
|
-
/* @__PURE__ */ (0,
|
|
5876
|
-
/* @__PURE__ */ (0,
|
|
5929
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-concern-actions", "aria-label": `${item.subject} \u7684\u64CD\u4F5C`, children: [
|
|
5930
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy, onClick: () => onCheck(item), children: "\u7ACB\u5373\u68C0\u67E5\u8FD9\u6761" }),
|
|
5931
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u7EE7\u7EED\u7559\u610F" }),
|
|
5932
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "prioritize"), children: "\u63D0\u9AD8\u5173\u6CE8" }),
|
|
5933
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "resolve"), children: "\u5DF2\u7ECF\u89E3\u51B3" }),
|
|
5934
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: () => onAct(item, "ignore"), children: "\u522B\u7BA1\u8FD9\u4E2A" })
|
|
5877
5935
|
] })
|
|
5878
5936
|
] })
|
|
5879
5937
|
] }, item.id);
|
|
5880
5938
|
}) }),
|
|
5881
|
-
(active.length > shown.length || visibleCount > 5) && /* @__PURE__ */ (0,
|
|
5939
|
+
(active.length > shown.length || visibleCount > 5) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-concern-more", children: active.length > shown.length ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", onClick: () => setVisibleCount((count) => Math.min(active.length, count + 20)), children: [
|
|
5882
5940
|
"\u518D\u663E\u793A ",
|
|
5883
5941
|
Math.min(20, active.length - shown.length),
|
|
5884
5942
|
" \u6761"
|
|
5885
|
-
] }) : /* @__PURE__ */ (0,
|
|
5886
|
-
resolved.length > 0 && /* @__PURE__ */ (0,
|
|
5887
|
-
/* @__PURE__ */ (0,
|
|
5943
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => setVisibleCount(5), children: "\u6536\u8D77\u5217\u8868" }) }),
|
|
5944
|
+
resolved.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "dsh-partner-concern-resolved", children: [
|
|
5945
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("summary", { children: [
|
|
5888
5946
|
"\u5DF2\u7ECF\u89E3\u51B3 ",
|
|
5889
|
-
/* @__PURE__ */ (0,
|
|
5947
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: resolved.length })
|
|
5890
5948
|
] }),
|
|
5891
|
-
/* @__PURE__ */ (0,
|
|
5892
|
-
/* @__PURE__ */ (0,
|
|
5893
|
-
/* @__PURE__ */ (0,
|
|
5894
|
-
/* @__PURE__ */ (0,
|
|
5949
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: resolved.slice(0, 30).map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("article", { children: [
|
|
5950
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconCheckOutline14, { size: 13 }) }),
|
|
5951
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: item.subject }),
|
|
5952
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u91CD\u65B0\u7559\u610F" })
|
|
5895
5953
|
] }, item.id)) })
|
|
5896
5954
|
] })
|
|
5897
5955
|
] });
|
|
@@ -5917,23 +5975,23 @@ function watchKindLabel(value) {
|
|
|
5917
5975
|
}
|
|
5918
5976
|
var MEMORY_KINDS = ["all", "preference", "task", "event", "relationship", "emotion"];
|
|
5919
5977
|
function MemoryLibrary({ companionId, revision, profiles, memories, reflections, editing, busy, setEditing, save, remove }) {
|
|
5920
|
-
const activeMemories = (0,
|
|
5921
|
-
const profileMemories = (0,
|
|
5922
|
-
const [mode, setMode] = (0,
|
|
5923
|
-
const [kind, setKind] = (0,
|
|
5924
|
-
const [query, setQuery] = (0,
|
|
5925
|
-
const [selectedMemoryId, setSelectedMemoryId] = (0,
|
|
5926
|
-
const [selectedDate, setSelectedDate] = (0,
|
|
5927
|
-
const [graph, setGraph] = (0,
|
|
5928
|
-
const [graphLoading, setGraphLoading] = (0,
|
|
5929
|
-
const [graphError, setGraphError] = (0,
|
|
5930
|
-
const [graphRequest, setGraphRequest] = (0,
|
|
5931
|
-
(0,
|
|
5978
|
+
const activeMemories = (0, import_react11.useMemo)(() => memories.filter((item) => item.status === "active" && item.kind !== "profile"), [memories]);
|
|
5979
|
+
const profileMemories = (0, import_react11.useMemo)(() => memories.filter((item) => item.status === "active" && item.kind === "profile"), [memories]);
|
|
5980
|
+
const [mode, setMode] = (0, import_react11.useState)("profile");
|
|
5981
|
+
const [kind, setKind] = (0, import_react11.useState)("all");
|
|
5982
|
+
const [query, setQuery] = (0, import_react11.useState)("");
|
|
5983
|
+
const [selectedMemoryId, setSelectedMemoryId] = (0, import_react11.useState)();
|
|
5984
|
+
const [selectedDate, setSelectedDate] = (0, import_react11.useState)();
|
|
5985
|
+
const [graph, setGraph] = (0, import_react11.useState)();
|
|
5986
|
+
const [graphLoading, setGraphLoading] = (0, import_react11.useState)(false);
|
|
5987
|
+
const [graphError, setGraphError] = (0, import_react11.useState)();
|
|
5988
|
+
const [graphRequest, setGraphRequest] = (0, import_react11.useState)(0);
|
|
5989
|
+
(0, import_react11.useEffect)(() => {
|
|
5932
5990
|
setGraph(void 0);
|
|
5933
5991
|
setGraphError(void 0);
|
|
5934
5992
|
setGraphLoading(false);
|
|
5935
5993
|
}, [companionId, revision]);
|
|
5936
|
-
(0,
|
|
5994
|
+
(0, import_react11.useEffect)(() => {
|
|
5937
5995
|
if (mode !== "graph" || graph !== void 0) return;
|
|
5938
5996
|
const controller = new AbortController();
|
|
5939
5997
|
setGraphLoading(true);
|
|
@@ -5948,75 +6006,75 @@ function MemoryLibrary({ companionId, revision, profiles, memories, reflections,
|
|
|
5948
6006
|
return () => controller.abort();
|
|
5949
6007
|
}, [companionId, graph, graphRequest, mode, revision]);
|
|
5950
6008
|
const normalized = query.trim().toLocaleLowerCase();
|
|
5951
|
-
const filteredMemories = (0,
|
|
6009
|
+
const filteredMemories = (0, import_react11.useMemo)(() => activeMemories.filter(
|
|
5952
6010
|
(item) => (kind === "all" || item.kind === kind) && (!normalized || `${item.subject} ${item.content}`.toLocaleLowerCase().includes(normalized))
|
|
5953
6011
|
), [activeMemories, kind, normalized]);
|
|
5954
|
-
const filteredReflections = (0,
|
|
6012
|
+
const filteredReflections = (0, import_react11.useMemo)(() => reflections.filter(
|
|
5955
6013
|
(item) => !normalized || `${item.date} ${item.summary} ${item.events.join(" ")} ${item.openTasks.join(" ")} ${item.learnings.join(" ")}`.toLocaleLowerCase().includes(normalized)
|
|
5956
6014
|
), [reflections, normalized]);
|
|
5957
6015
|
const selectedMemory = filteredMemories.find((item) => item.id === selectedMemoryId) ?? filteredMemories[0];
|
|
5958
6016
|
const selectedReflection = filteredReflections.find((item) => item.date === selectedDate) ?? filteredReflections[0];
|
|
5959
|
-
return /* @__PURE__ */ (0,
|
|
5960
|
-
/* @__PURE__ */ (0,
|
|
5961
|
-
/* @__PURE__ */ (0,
|
|
5962
|
-
/* @__PURE__ */ (0,
|
|
5963
|
-
/* @__PURE__ */ (0,
|
|
5964
|
-
/* @__PURE__ */ (0,
|
|
6017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsh-partner-memory-library", children: [
|
|
6018
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { className: "dsh-partner-library-header", children: [
|
|
6019
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
6020
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "MEMORY LIBRARY" }),
|
|
6021
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "\u4F19\u4F34\u8BB0\u5FC6\u5E93" }),
|
|
6022
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: "\u67E5\u770B\u4F19\u4F34\u5982\u4F55\u4ECE\u957F\u671F\u5BF9\u8BDD\u4E2D\u8BA4\u8BC6\u4F60\uFF0C\u4EE5\u53CA\u8FD9\u4E9B\u7406\u89E3\u600E\u6837\u968F\u8BC1\u636E\u53D8\u5316\u3002" })
|
|
5965
6023
|
] }),
|
|
5966
|
-
/* @__PURE__ */ (0,
|
|
5967
|
-
/* @__PURE__ */ (0,
|
|
6024
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("nav", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", children: [
|
|
6025
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: mode === "profile" ? "is-active" : "", onClick: () => setMode("profile"), children: [
|
|
5968
6026
|
"\u4EBA\u7269\u753B\u50CF ",
|
|
5969
|
-
/* @__PURE__ */ (0,
|
|
6027
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: profiles.length })
|
|
5970
6028
|
] }),
|
|
5971
|
-
/* @__PURE__ */ (0,
|
|
6029
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: mode === "memory" ? "is-active" : "", onClick: () => setMode("memory"), children: [
|
|
5972
6030
|
"\u8BDD\u9898\u8BB0\u5FC6 ",
|
|
5973
|
-
/* @__PURE__ */ (0,
|
|
6031
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: activeMemories.length })
|
|
5974
6032
|
] }),
|
|
5975
|
-
/* @__PURE__ */ (0,
|
|
6033
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: mode === "reflection" ? "is-active" : "", onClick: () => setMode("reflection"), children: [
|
|
5976
6034
|
"\u6BCF\u65E5\u56DE\u987E ",
|
|
5977
|
-
/* @__PURE__ */ (0,
|
|
6035
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: reflections.length })
|
|
5978
6036
|
] }),
|
|
5979
|
-
/* @__PURE__ */ (0,
|
|
6037
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: mode === "graph" ? "is-active" : "", onClick: () => setMode("graph"), children: [
|
|
5980
6038
|
"\u5173\u7CFB\u56FE\u8C31 ",
|
|
5981
|
-
/* @__PURE__ */ (0,
|
|
6039
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: graph?.relations.length ?? "\u2014" })
|
|
5982
6040
|
] })
|
|
5983
6041
|
] })
|
|
5984
6042
|
] }),
|
|
5985
|
-
mode !== "profile" && /* @__PURE__ */ (0,
|
|
5986
|
-
/* @__PURE__ */ (0,
|
|
5987
|
-
/* @__PURE__ */ (0,
|
|
5988
|
-
/* @__PURE__ */ (0,
|
|
6043
|
+
mode !== "profile" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-library-tools", children: [
|
|
6044
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
|
|
6045
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u8BB0\u5FC6" }),
|
|
6046
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: mode === "memory" ? "\u641C\u7D22\u4E3B\u9898\u6216\u8BB0\u5FC6\u5185\u5BB9" : "\u641C\u7D22\u65E5\u671F\u3001\u603B\u7ED3\u6216\u5F85\u529E" })
|
|
5989
6047
|
] }),
|
|
5990
|
-
mode === "memory" && /* @__PURE__ */ (0,
|
|
6048
|
+
mode === "memory" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-memory-kinds", children: MEMORY_KINDS.map((value) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: kind === value ? "is-active" : "", onClick: () => setKind(value), children: value === "all" ? "\u5168\u90E8" : memoryKind(value) }, value)) })
|
|
5991
6049
|
] }),
|
|
5992
|
-
mode === "profile" ? /* @__PURE__ */ (0,
|
|
5993
|
-
/* @__PURE__ */ (0,
|
|
6050
|
+
mode === "profile" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ProfileLibrary, { profiles, memories: profileMemories, editing, busy, setEditing, save, remove }) : mode === "memory" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-library-browser", children: [
|
|
6051
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-library-list", role: "list", children: filteredMemories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ContentState, { title: activeMemories.length === 0 ? "\u8FD8\u6CA1\u6709\u957F\u671F\u8BB0\u5FC6" : "\u6CA1\u6709\u5339\u914D\u7684\u8BB0\u5FC6", detail: activeMemories.length === 0 ? "\u4F19\u4F34\u5B8C\u6210\u5BF9\u8BDD\u540E\u4F1A\u81EA\u52A8\u63D0\u70BC\u503C\u5F97\u957F\u671F\u4FDD\u7559\u7684\u4FE1\u606F\u3002" : "\u6362\u4E2A\u5173\u952E\u8BCD\u6216\u7C7B\u578B\u8BD5\u8BD5\u3002", compact: true }) : filteredMemories.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", role: "listitem", className: selectedMemory?.id === item.id ? "is-active" : "", onClick: () => {
|
|
5994
6052
|
setSelectedMemoryId(item.id);
|
|
5995
6053
|
setEditing(void 0);
|
|
5996
6054
|
}, children: [
|
|
5997
|
-
/* @__PURE__ */ (0,
|
|
5998
|
-
/* @__PURE__ */ (0,
|
|
5999
|
-
/* @__PURE__ */ (0,
|
|
6000
|
-
/* @__PURE__ */ (0,
|
|
6055
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { "data-kind": item.kind, children: memoryKind(item.kind) }),
|
|
6056
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: item.subject }),
|
|
6057
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: item.content }),
|
|
6058
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: relativeTime(item.updatedAt) })
|
|
6001
6059
|
] }, item.id)) }),
|
|
6002
|
-
/* @__PURE__ */ (0,
|
|
6003
|
-
] }) : mode === "reflection" ? /* @__PURE__ */ (0,
|
|
6004
|
-
/* @__PURE__ */ (0,
|
|
6005
|
-
/* @__PURE__ */ (0,
|
|
6006
|
-
/* @__PURE__ */ (0,
|
|
6060
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-library-detail", children: selectedMemory ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MemoryCard, { item: selectedMemory, editing: editing?.id === selectedMemory.id ? editing : void 0, busy, setEditing, save, remove: () => remove(selectedMemory) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u6761\u8BB0\u5FC6", detail: "\u8BB0\u5FC6\u8BE6\u60C5\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
|
|
6061
|
+
] }) : mode === "reflection" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-library-browser", children: [
|
|
6062
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-library-list is-diary", role: "list", children: filteredReflections.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ContentState, { title: reflections.length === 0 ? "\u8FD8\u6CA1\u6709\u6BCF\u65E5\u56DE\u987E" : "\u6CA1\u6709\u5339\u914D\u7684\u56DE\u987E", detail: reflections.length === 0 ? "\u6BCF\u65E5\u56DE\u987E\u4F1A\u5728\u6BCF\u8F6E\u5B8C\u6574\u5BF9\u8BDD\u540E\u6301\u7EED\u66F4\u65B0\u3002" : "\u6362\u4E2A\u5173\u952E\u8BCD\u6216\u65E5\u671F\u8BD5\u8BD5\u3002", compact: true }) : filteredReflections.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", role: "listitem", className: selectedReflection?.date === entry.date ? "is-active" : "", onClick: () => setSelectedDate(entry.date), children: [
|
|
6063
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("time", { children: entry.date }),
|
|
6064
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("strong", { children: [
|
|
6007
6065
|
entry.turnCount,
|
|
6008
6066
|
" \u8F6E\u4EA4\u6D41"
|
|
6009
6067
|
] }),
|
|
6010
|
-
/* @__PURE__ */ (0,
|
|
6011
|
-
/* @__PURE__ */ (0,
|
|
6068
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: entry.summary }),
|
|
6069
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { children: [
|
|
6012
6070
|
entry.openTasks.length,
|
|
6013
6071
|
" \u9879\u5F85\u8DDF\u8FDB \xB7 ",
|
|
6014
6072
|
entry.learnings.length,
|
|
6015
6073
|
" \u9879\u7406\u89E3"
|
|
6016
6074
|
] })
|
|
6017
6075
|
] }, entry.date)) }),
|
|
6018
|
-
/* @__PURE__ */ (0,
|
|
6019
|
-
] }) : graphError ? /* @__PURE__ */ (0,
|
|
6076
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-library-detail", children: selectedReflection ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DailyReflectionDetail, { entry: selectedReflection }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u5929", detail: "\u5F53\u5929\u7684\u603B\u7ED3\u4E0E\u5F85\u529E\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
|
|
6077
|
+
] }) : graphError ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ContentState, { title: "\u5173\u7CFB\u56FE\u8C31\u52A0\u8F7D\u5931\u8D25", detail: graphError, action: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => setGraphRequest((value) => value + 1), children: "\u91CD\u65B0\u52A0\u8F7D" }) }) : graphLoading || graph === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ContentState, { title: "\u6B63\u5728\u52A0\u8F7D\u5173\u7CFB\u56FE\u8C31", detail: "\u53EA\u5728\u9700\u8981\u67E5\u770B\u5173\u7CFB\u65F6\u8BFB\u53D6\u5BA1\u8BA1\u6570\u636E\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MemoryGraph, { graph, profiles, query: normalized, inspect: (item) => {
|
|
6020
6078
|
setEditing(void 0);
|
|
6021
6079
|
if (item.kind === "profile") setMode("profile");
|
|
6022
6080
|
else {
|
|
@@ -6027,71 +6085,71 @@ function MemoryLibrary({ companionId, revision, profiles, memories, reflections,
|
|
|
6027
6085
|
] });
|
|
6028
6086
|
}
|
|
6029
6087
|
function ProfileLibrary({ profiles, memories, editing, busy, setEditing, save, remove }) {
|
|
6030
|
-
const [selectedScopeId, setSelectedScopeId] = (0,
|
|
6088
|
+
const [selectedScopeId, setSelectedScopeId] = (0, import_react11.useState)();
|
|
6031
6089
|
const selected = profiles.find((item) => item.scopeId === selectedScopeId) ?? profiles[0];
|
|
6032
|
-
if (!selected) return /* @__PURE__ */ (0,
|
|
6090
|
+
if (!selected) return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u8054\u7CFB\u4EBA\u753B\u50CF", detail: "\u8054\u7CFB\u4EBA\u5F00\u59CB\u548C\u4F19\u4F34\u4EA4\u6D41\u540E\uFF0C\u8FD9\u91CC\u4F1A\u9010\u6B65\u5C55\u793A\u4F19\u4F34\u4ECE\u660E\u786E\u5BF9\u8BDD\u4E2D\u5F62\u6210\u7684\u957F\u671F\u7406\u89E3\u3002" });
|
|
6033
6091
|
const activeIds = new Set(selected.entries.map((item) => item.id));
|
|
6034
6092
|
const pending = memories.filter((item) => item.scopeId === selected.scopeId && !activeIds.has(item.id));
|
|
6035
|
-
return /* @__PURE__ */ (0,
|
|
6036
|
-
/* @__PURE__ */ (0,
|
|
6093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-profile-browser", children: [
|
|
6094
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-profile-people", role: "list", "aria-label": "\u8054\u7CFB\u4EBA\u753B\u50CF", children: profiles.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", role: "listitem", className: profile.scopeId === selected.scopeId ? "is-active" : "", onClick: () => {
|
|
6037
6095
|
setSelectedScopeId(profile.scopeId);
|
|
6038
6096
|
setEditing(void 0);
|
|
6039
6097
|
}, children: [
|
|
6040
|
-
/* @__PURE__ */ (0,
|
|
6041
|
-
/* @__PURE__ */ (0,
|
|
6042
|
-
/* @__PURE__ */ (0,
|
|
6043
|
-
/* @__PURE__ */ (0,
|
|
6098
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives9.IconUserOutline16, { size: 16 }) }),
|
|
6099
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
6100
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: profile.label }),
|
|
6101
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: profile.entries.length > 0 ? `${profile.entries.length} \u9879\u7A33\u5B9A\u7406\u89E3` : "\u8FD8\u5728\u8BA4\u8BC6\u4E2D" })
|
|
6044
6102
|
] }),
|
|
6045
|
-
/* @__PURE__ */ (0,
|
|
6103
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", { "aria-hidden": "true" })
|
|
6046
6104
|
] }, profile.scopeId)) }),
|
|
6047
|
-
/* @__PURE__ */ (0,
|
|
6048
|
-
/* @__PURE__ */ (0,
|
|
6049
|
-
/* @__PURE__ */ (0,
|
|
6050
|
-
/* @__PURE__ */ (0,
|
|
6051
|
-
/* @__PURE__ */ (0,
|
|
6105
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-profile-stage", children: [
|
|
6106
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { className: "dsh-partner-profile-heading", children: [
|
|
6107
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
6108
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "PARTNER UNDERSTANDING" }),
|
|
6109
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("strong", { children: [
|
|
6052
6110
|
"\u4F19\u4F34\u773C\u4E2D\u7684 ",
|
|
6053
6111
|
selected.label
|
|
6054
6112
|
] }),
|
|
6055
|
-
/* @__PURE__ */ (0,
|
|
6113
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: "\u8FD9\u4E9B\u5185\u5BB9\u6765\u81EA\u4F60\u5728\u5BF9\u8BDD\u4E2D\u7684\u660E\u786E\u8868\u8FBE\u3002\u4F19\u4F34\u4F1A\u7528\u5B83\u4FDD\u6301\u7406\u89E3\u8FDE\u7EED\uFF0C\u4F46\u4E0D\u4F1A\u628A\u753B\u50CF\u5F53\u6210\u6807\u7B7E\u53CD\u590D\u590D\u8FF0\u3002" })
|
|
6056
6114
|
] }),
|
|
6057
|
-
/* @__PURE__ */ (0,
|
|
6058
|
-
/* @__PURE__ */ (0,
|
|
6115
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { "data-ready": selected.entries.length > 0, children: [
|
|
6116
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}),
|
|
6059
6117
|
selected.entries.length > 0 ? "\u4E0A\u4E0B\u6587\u57FA\u7EBF\u5DF2\u5C31\u7EEA" : "\u7B49\u5F85\u53EF\u9760\u8BC1\u636E"
|
|
6060
6118
|
] })
|
|
6061
6119
|
] }),
|
|
6062
|
-
selected.entries.length > 0 ? /* @__PURE__ */ (0,
|
|
6063
|
-
/* @__PURE__ */ (0,
|
|
6064
|
-
/* @__PURE__ */ (0,
|
|
6065
|
-
/* @__PURE__ */ (0,
|
|
6066
|
-
/* @__PURE__ */ (0,
|
|
6120
|
+
selected.entries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
6121
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-profile-meta", children: [
|
|
6122
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
6123
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u753B\u50CF\u7248\u672C" }),
|
|
6124
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: selected.version })
|
|
6067
6125
|
] }),
|
|
6068
|
-
/* @__PURE__ */ (0,
|
|
6069
|
-
/* @__PURE__ */ (0,
|
|
6070
|
-
/* @__PURE__ */ (0,
|
|
6126
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
6127
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u5BF9\u8BDD\u4F9D\u636E" }),
|
|
6128
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("strong", { children: [
|
|
6071
6129
|
selected.evidenceCount,
|
|
6072
6130
|
" \u5904"
|
|
6073
6131
|
] })
|
|
6074
6132
|
] }),
|
|
6075
|
-
/* @__PURE__ */ (0,
|
|
6076
|
-
/* @__PURE__ */ (0,
|
|
6077
|
-
/* @__PURE__ */ (0,
|
|
6133
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
6134
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u7528\u6237\u786E\u8BA4" }),
|
|
6135
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("strong", { children: [
|
|
6078
6136
|
selected.lockedCount,
|
|
6079
6137
|
" \u9879"
|
|
6080
6138
|
] })
|
|
6081
6139
|
] }),
|
|
6082
|
-
/* @__PURE__ */ (0,
|
|
6083
|
-
/* @__PURE__ */ (0,
|
|
6084
|
-
/* @__PURE__ */ (0,
|
|
6140
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
6141
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u6700\u8FD1\u4F9D\u636E" }),
|
|
6142
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: selected.updatedAt ? relativeTime(selected.updatedAt) : "\u5C1A\u672A" })
|
|
6085
6143
|
] })
|
|
6086
6144
|
] }),
|
|
6087
|
-
/* @__PURE__ */ (0,
|
|
6088
|
-
] }) : /* @__PURE__ */ (0,
|
|
6089
|
-
pending.length > 0 && /* @__PURE__ */ (0,
|
|
6090
|
-
/* @__PURE__ */ (0,
|
|
6145
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-profile-entries", children: selected.entries.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MemoryCard, { item, editing: editing?.id === item.id ? editing : void 0, busy, setEditing, save, remove: () => remove(item) }, item.id)) })
|
|
6146
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ContentState, { title: "\u4F19\u4F34\u8FD8\u5728\u8BA4\u8BC6\u4F60", detail: "\u53EA\u6709\u660E\u786E\u3001\u7A33\u5B9A\u5E76\u8FBE\u5230\u53EF\u9760\u6807\u51C6\u7684\u957F\u671F\u4FE1\u606F\u624D\u4F1A\u8FDB\u5165\u753B\u50CF\uFF1B\u666E\u901A\u504F\u597D\u3001\u4E34\u65F6\u4EFB\u52A1\u548C\u4E00\u6B21\u6027\u60C5\u7EEA\u4E0D\u4F1A\u653E\u5728\u8FD9\u91CC\u3002", compact: true }),
|
|
6147
|
+
pending.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "dsh-partner-profile-pending", children: [
|
|
6148
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("summary", { children: [
|
|
6091
6149
|
"\u5F85\u786E\u8BA4\u7684\u7406\u89E3 ",
|
|
6092
|
-
/* @__PURE__ */ (0,
|
|
6150
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: pending.length })
|
|
6093
6151
|
] }),
|
|
6094
|
-
/* @__PURE__ */ (0,
|
|
6152
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: pending.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MemoryCard, { item, editing: editing?.id === item.id ? editing : void 0, busy, setEditing, save, remove: () => remove(item) }, item.id)) })
|
|
6095
6153
|
] })
|
|
6096
6154
|
] })
|
|
6097
6155
|
] });
|
|
@@ -6100,9 +6158,9 @@ var RELATION_FILTERS = ["all", "conflicts_with", "depends_on", "supports", "foll
|
|
|
6100
6158
|
function MemoryGraph({ graph, profiles, query, inspect }) {
|
|
6101
6159
|
const byId = new Map(graph.memories.map((item) => [item.id, item]));
|
|
6102
6160
|
const scopeIds = [...new Set(graph.relations.map((item) => item.scopeId))];
|
|
6103
|
-
const [requestedScopeId, setRequestedScopeId] = (0,
|
|
6161
|
+
const [requestedScopeId, setRequestedScopeId] = (0, import_react11.useState)();
|
|
6104
6162
|
const scopeId = scopeIds.includes(requestedScopeId ?? "") ? requestedScopeId : scopeIds[0];
|
|
6105
|
-
const [filter, setFilter] = (0,
|
|
6163
|
+
const [filter, setFilter] = (0, import_react11.useState)("all");
|
|
6106
6164
|
const scoped = graph.relations.filter((item) => item.scopeId === scopeId);
|
|
6107
6165
|
const visible = scoped.filter((item) => {
|
|
6108
6166
|
if (filter !== "all" && item.kind !== filter) return false;
|
|
@@ -6110,115 +6168,115 @@ function MemoryGraph({ graph, profiles, query, inspect }) {
|
|
|
6110
6168
|
const target2 = byId.get(item.targetMemoryId);
|
|
6111
6169
|
return !query || `${source2?.subject ?? ""} ${source2?.content ?? ""} ${target2?.subject ?? ""} ${target2?.content ?? ""} ${item.label}`.toLocaleLowerCase().includes(query);
|
|
6112
6170
|
}).sort((left, right) => Number(right.kind === "conflicts_with") - Number(left.kind === "conflicts_with") || right.confidence - left.confidence);
|
|
6113
|
-
const [selectedRelationId, setSelectedRelationId] = (0,
|
|
6171
|
+
const [selectedRelationId, setSelectedRelationId] = (0, import_react11.useState)();
|
|
6114
6172
|
const selected = visible.find((item) => item.id === selectedRelationId) ?? visible[0];
|
|
6115
6173
|
const source = selected ? byId.get(selected.sourceMemoryId) : void 0;
|
|
6116
6174
|
const target = selected ? byId.get(selected.targetMemoryId) : void 0;
|
|
6117
6175
|
const label = profiles.find((item) => item.scopeId === scopeId)?.label ?? (scopeId ? `\u8054\u7CFB\u4EBA ${scopeId.slice(-6)}` : "\u5F53\u524D\u8054\u7CFB\u4EBA");
|
|
6118
6176
|
const conflictCount = scoped.filter((item) => item.kind === "conflicts_with").length;
|
|
6119
|
-
if (graph.relations.length === 0) return /* @__PURE__ */ (0,
|
|
6120
|
-
return /* @__PURE__ */ (0,
|
|
6121
|
-
/* @__PURE__ */ (0,
|
|
6122
|
-
/* @__PURE__ */ (0,
|
|
6123
|
-
/* @__PURE__ */ (0,
|
|
6124
|
-
/* @__PURE__ */ (0,
|
|
6177
|
+
if (graph.relations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ContentState, { title: "\u8FD8\u6CA1\u6709\u53EF\u9760\u5173\u7CFB", detail: "\u6BCF\u65E5\u7EC8\u5BA1\u53EA\u4F1A\u4FDD\u5B58\u6709\u660E\u786E\u8BC1\u636E\u7684\u8BB0\u5FC6\u8054\u7CFB\uFF0C\u4E0D\u4F1A\u4E3A\u4E86\u586B\u6EE1\u56FE\u8C31\u800C\u731C\u6D4B\u3002" });
|
|
6178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-graph-audit", children: [
|
|
6179
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { className: "dsh-partner-graph-toolbar", children: [
|
|
6180
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
|
|
6181
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: "\u5173\u7CFB\u5BA1\u8BA1" }),
|
|
6182
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("strong", { children: [
|
|
6125
6183
|
label,
|
|
6126
6184
|
" \u7684\u7406\u89E3\u5173\u7CFB"
|
|
6127
6185
|
] }),
|
|
6128
|
-
/* @__PURE__ */ (0,
|
|
6186
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { children: [
|
|
6129
6187
|
scoped.length,
|
|
6130
6188
|
" \u6761\u53EF\u9760\u8054\u7CFB",
|
|
6131
6189
|
conflictCount > 0 ? `\uFF0C\u5176\u4E2D ${conflictCount} \u6761\u9700\u8981\u786E\u8BA4` : "\uFF0C\u6682\u65E0\u5F85\u786E\u8BA4\u51B2\u7A81"
|
|
6132
6190
|
] })
|
|
6133
6191
|
] }),
|
|
6134
|
-
scopeIds.length > 1 && /* @__PURE__ */ (0,
|
|
6135
|
-
/* @__PURE__ */ (0,
|
|
6136
|
-
/* @__PURE__ */ (0,
|
|
6192
|
+
scopeIds.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
|
|
6193
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "\u8054\u7CFB\u4EBA" }),
|
|
6194
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("select", { value: scopeId, onChange: (event) => {
|
|
6137
6195
|
setRequestedScopeId(event.target.value);
|
|
6138
6196
|
setSelectedRelationId(void 0);
|
|
6139
|
-
}, children: scopeIds.map((value) => /* @__PURE__ */ (0,
|
|
6197
|
+
}, children: scopeIds.map((value) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value, children: profiles.find((item) => item.scopeId === value)?.label ?? `\u8054\u7CFB\u4EBA ${value.slice(-6)}` }, value)) })
|
|
6140
6198
|
] })
|
|
6141
6199
|
] }),
|
|
6142
|
-
/* @__PURE__ */ (0,
|
|
6200
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("nav", { className: "dsh-partner-graph-filters", "aria-label": "\u5173\u7CFB\u7C7B\u578B", children: RELATION_FILTERS.map((value) => {
|
|
6143
6201
|
const count = value === "all" ? scoped.length : scoped.filter((item) => item.kind === value).length;
|
|
6144
|
-
return /* @__PURE__ */ (0,
|
|
6202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: filter === value ? "is-active" : "", "aria-pressed": filter === value, onClick: () => {
|
|
6145
6203
|
setFilter(value);
|
|
6146
6204
|
setSelectedRelationId(void 0);
|
|
6147
6205
|
}, children: [
|
|
6148
6206
|
value === "all" ? "\u5168\u90E8" : relationLabel(value),
|
|
6149
6207
|
" ",
|
|
6150
|
-
/* @__PURE__ */ (0,
|
|
6208
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: count })
|
|
6151
6209
|
] }, value);
|
|
6152
6210
|
}) }),
|
|
6153
|
-
/* @__PURE__ */ (0,
|
|
6154
|
-
/* @__PURE__ */ (0,
|
|
6211
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-graph-browser", children: [
|
|
6212
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-graph-index", role: "list", children: visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ContentState, { title: "\u6CA1\u6709\u5339\u914D\u7684\u5173\u7CFB", detail: "\u8C03\u6574\u5173\u7CFB\u7C7B\u578B\u6216\u641C\u7D22\u5173\u952E\u8BCD\u540E\u518D\u8BD5\u3002", compact: true }) : visible.map((item) => {
|
|
6155
6213
|
const from = byId.get(item.sourceMemoryId);
|
|
6156
6214
|
const to = byId.get(item.targetMemoryId);
|
|
6157
|
-
return /* @__PURE__ */ (0,
|
|
6158
|
-
/* @__PURE__ */ (0,
|
|
6159
|
-
/* @__PURE__ */ (0,
|
|
6215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", role: "listitem", "data-kind": item.kind, className: selected?.id === item.id ? "is-active" : "", onClick: () => setSelectedRelationId(item.id), children: [
|
|
6216
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: relationLabel(item.kind) }),
|
|
6217
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("strong", { children: [
|
|
6160
6218
|
from?.subject ?? "\u5DF2\u5220\u9664\u8BB0\u5FC6",
|
|
6161
6219
|
" ",
|
|
6162
|
-
/* @__PURE__ */ (0,
|
|
6220
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
|
|
6163
6221
|
" ",
|
|
6164
6222
|
to?.subject ?? "\u5DF2\u5220\u9664\u8BB0\u5FC6"
|
|
6165
6223
|
] }),
|
|
6166
|
-
/* @__PURE__ */ (0,
|
|
6167
|
-
/* @__PURE__ */ (0,
|
|
6224
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: item.label }),
|
|
6225
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { children: [
|
|
6168
6226
|
Math.round(item.confidence * 100),
|
|
6169
6227
|
"% \u53EF\u4FE1"
|
|
6170
6228
|
] })
|
|
6171
6229
|
] }, item.id);
|
|
6172
6230
|
}) }),
|
|
6173
|
-
/* @__PURE__ */ (0,
|
|
6174
|
-
/* @__PURE__ */ (0,
|
|
6175
|
-
/* @__PURE__ */ (0,
|
|
6176
|
-
/* @__PURE__ */ (0,
|
|
6231
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "dsh-partner-graph-stage", children: selected && source && target ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("article", { "data-kind": selected.kind, children: [
|
|
6232
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { children: [
|
|
6233
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: relationLabel(selected.kind) }),
|
|
6234
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("strong", { children: [
|
|
6177
6235
|
source.subject,
|
|
6178
6236
|
" ",
|
|
6179
|
-
/* @__PURE__ */ (0,
|
|
6237
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
|
|
6180
6238
|
" ",
|
|
6181
6239
|
target.subject
|
|
6182
6240
|
] }),
|
|
6183
|
-
/* @__PURE__ */ (0,
|
|
6184
|
-
/* @__PURE__ */ (0,
|
|
6241
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: selected.label }),
|
|
6242
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { children: relationGuidance(selected.kind) })
|
|
6185
6243
|
] }),
|
|
6186
|
-
/* @__PURE__ */ (0,
|
|
6187
|
-
/* @__PURE__ */ (0,
|
|
6188
|
-
/* @__PURE__ */ (0,
|
|
6189
|
-
/* @__PURE__ */ (0,
|
|
6190
|
-
/* @__PURE__ */ (0,
|
|
6191
|
-
/* @__PURE__ */ (0,
|
|
6244
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-graph-pair", children: [
|
|
6245
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GraphMemory, { item: source, side: "\u8D77\u70B9", inspect }),
|
|
6246
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { "aria-hidden": "true", children: [
|
|
6247
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {}),
|
|
6248
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: relationLabel(selected.kind) }),
|
|
6249
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("i", {})
|
|
6192
6250
|
] }),
|
|
6193
|
-
/* @__PURE__ */ (0,
|
|
6251
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GraphMemory, { item: target, side: "\u5173\u8054\u9879", inspect })
|
|
6194
6252
|
] }),
|
|
6195
|
-
/* @__PURE__ */ (0,
|
|
6196
|
-
/* @__PURE__ */ (0,
|
|
6253
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("footer", { children: [
|
|
6254
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { children: [
|
|
6197
6255
|
"\u6700\u8FD1\u7EC8\u5BA1\u4E8E ",
|
|
6198
6256
|
new Date(selected.updatedAt).toLocaleString()
|
|
6199
6257
|
] }),
|
|
6200
|
-
/* @__PURE__ */ (0,
|
|
6258
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("strong", { children: [
|
|
6201
6259
|
"\u5173\u7CFB\u7F6E\u4FE1\u5EA6 ",
|
|
6202
6260
|
Math.round(selected.confidence * 100),
|
|
6203
6261
|
"%"
|
|
6204
6262
|
] })
|
|
6205
6263
|
] })
|
|
6206
|
-
] }) : /* @__PURE__ */ (0,
|
|
6264
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u6761\u5173\u7CFB", detail: "\u5173\u7CFB\u4E24\u7AEF\u7684\u8BB0\u5FC6\u4E0E\u4F7F\u7528\u65B9\u5F0F\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
|
|
6207
6265
|
] })
|
|
6208
6266
|
] });
|
|
6209
6267
|
}
|
|
6210
6268
|
function GraphMemory({ item, side, inspect }) {
|
|
6211
|
-
return /* @__PURE__ */ (0,
|
|
6212
|
-
/* @__PURE__ */ (0,
|
|
6213
|
-
/* @__PURE__ */ (0,
|
|
6269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { children: [
|
|
6270
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { children: [
|
|
6271
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { children: [
|
|
6214
6272
|
side,
|
|
6215
6273
|
" \xB7 ",
|
|
6216
6274
|
memoryKind(item.kind)
|
|
6217
6275
|
] }),
|
|
6218
|
-
/* @__PURE__ */ (0,
|
|
6276
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: item.subject })
|
|
6219
6277
|
] }),
|
|
6220
|
-
/* @__PURE__ */ (0,
|
|
6221
|
-
/* @__PURE__ */ (0,
|
|
6278
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: item.content }),
|
|
6279
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => inspect(item), children: "\u67E5\u770B\u5E76\u4FEE\u6B63" })
|
|
6222
6280
|
] });
|
|
6223
6281
|
}
|
|
6224
6282
|
function relationLabel(kind) {
|
|
@@ -6234,70 +6292,70 @@ function relationGuidance(kind) {
|
|
|
6234
6292
|
}[kind];
|
|
6235
6293
|
}
|
|
6236
6294
|
function DailyReflectionDetail({ entry }) {
|
|
6237
|
-
return /* @__PURE__ */ (0,
|
|
6238
|
-
/* @__PURE__ */ (0,
|
|
6239
|
-
/* @__PURE__ */ (0,
|
|
6240
|
-
/* @__PURE__ */ (0,
|
|
6295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("article", { className: "dsh-partner-diary-detail", children: [
|
|
6296
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { children: [
|
|
6297
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("time", { children: entry.date }),
|
|
6298
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("strong", { children: [
|
|
6241
6299
|
entry.turnCount,
|
|
6242
6300
|
" \u8F6E\u4EA4\u6D41\u540E\u7684\u7406\u89E3"
|
|
6243
6301
|
] }),
|
|
6244
|
-
/* @__PURE__ */ (0,
|
|
6302
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { children: [
|
|
6245
6303
|
"\u66F4\u65B0\u4E8E ",
|
|
6246
6304
|
new Date(entry.updatedAt).toLocaleString()
|
|
6247
6305
|
] })
|
|
6248
6306
|
] }),
|
|
6249
|
-
/* @__PURE__ */ (0,
|
|
6250
|
-
/* @__PURE__ */ (0,
|
|
6251
|
-
/* @__PURE__ */ (0,
|
|
6252
|
-
/* @__PURE__ */ (0,
|
|
6253
|
-
/* @__PURE__ */ (0,
|
|
6307
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: entry.summary }),
|
|
6308
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ReflectionGroup, { title: "\u5F85\u8DDF\u8FDB", items: entry.openTasks }),
|
|
6309
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ReflectionGroup, { title: "\u5F53\u5929\u4E8B\u4EF6", items: entry.events }),
|
|
6310
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ReflectionGroup, { title: "\u65B0\u7406\u89E3", items: entry.learnings }),
|
|
6311
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ReflectionGroup, { title: "\u5DF2\u5B8C\u6210", items: entry.completedTasks })
|
|
6254
6312
|
] });
|
|
6255
6313
|
}
|
|
6256
6314
|
function ReflectionGroup({ title, items }) {
|
|
6257
6315
|
if (items.length === 0) return null;
|
|
6258
|
-
return /* @__PURE__ */ (0,
|
|
6259
|
-
/* @__PURE__ */ (0,
|
|
6260
|
-
/* @__PURE__ */ (0,
|
|
6316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { children: [
|
|
6317
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: title }),
|
|
6318
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: item }, item)) })
|
|
6261
6319
|
] });
|
|
6262
6320
|
}
|
|
6263
6321
|
function MemoryCard({ item, editing, busy, setEditing, save, remove }) {
|
|
6264
|
-
const [confirmingRemove, setConfirmingRemove] = (0,
|
|
6265
|
-
return /* @__PURE__ */ (0,
|
|
6266
|
-
/* @__PURE__ */ (0,
|
|
6267
|
-
/* @__PURE__ */ (0,
|
|
6268
|
-
/* @__PURE__ */ (0,
|
|
6269
|
-
/* @__PURE__ */ (0,
|
|
6270
|
-
/* @__PURE__ */ (0,
|
|
6322
|
+
const [confirmingRemove, setConfirmingRemove] = (0, import_react11.useState)(false);
|
|
6323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("article", { "data-kind": item.kind, children: editing ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsh-partner-memory-editor", children: [
|
|
6324
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { "aria-label": "\u8BB0\u5FC6\u4E3B\u9898", value: editing.subject, onChange: (event) => setEditing({ ...editing, subject: event.target.value }) }),
|
|
6325
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("textarea", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", value: editing.content, onChange: (event) => setEditing({ ...editing, content: event.target.value }) }),
|
|
6326
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("footer", { children: [
|
|
6327
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => setEditing(void 0), children: "\u53D6\u6D88" }),
|
|
6328
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "is-primary", disabled: busy || !editing.subject.trim() || !editing.content.trim(), onClick: save, children: "\u4FDD\u5B58\u4FEE\u6B63" })
|
|
6271
6329
|
] })
|
|
6272
|
-
] }) : /* @__PURE__ */ (0,
|
|
6273
|
-
/* @__PURE__ */ (0,
|
|
6274
|
-
/* @__PURE__ */ (0,
|
|
6275
|
-
/* @__PURE__ */ (0,
|
|
6276
|
-
/* @__PURE__ */ (0,
|
|
6277
|
-
/* @__PURE__ */ (0,
|
|
6278
|
-
] }) : /* @__PURE__ */ (0,
|
|
6279
|
-
/* @__PURE__ */ (0,
|
|
6280
|
-
/* @__PURE__ */ (0,
|
|
6330
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
6331
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { children: [
|
|
6332
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: memoryKind(item.kind) }),
|
|
6333
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: confirmingRemove ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
6334
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => setConfirmingRemove(false), children: "\u53D6\u6D88" }),
|
|
6335
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
|
|
6336
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
6337
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => setEditing({ ...item }), children: "\u7F16\u8F91" }),
|
|
6338
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => setConfirmingRemove(true), children: "\u5220\u9664" })
|
|
6281
6339
|
] }) })
|
|
6282
6340
|
] }),
|
|
6283
|
-
/* @__PURE__ */ (0,
|
|
6284
|
-
/* @__PURE__ */ (0,
|
|
6285
|
-
/* @__PURE__ */ (0,
|
|
6286
|
-
/* @__PURE__ */ (0,
|
|
6287
|
-
/* @__PURE__ */ (0,
|
|
6341
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: item.subject }),
|
|
6342
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: item.content }),
|
|
6343
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("footer", { children: [
|
|
6344
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("progress", { max: 1, value: item.confidence, "aria-label": `\u7F6E\u4FE1\u5EA6 ${Math.round(item.confidence * 100)}%` }),
|
|
6345
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("small", { children: [
|
|
6288
6346
|
item.locked ? "\u624B\u52A8\u786E\u8BA4" : `${Math.round(item.confidence * 100)}% \u53EF\u4FE1`,
|
|
6289
6347
|
" \xB7 ",
|
|
6290
6348
|
relativeTime(item.updatedAt)
|
|
6291
6349
|
] })
|
|
6292
6350
|
] }),
|
|
6293
|
-
item.evidence.length > 0 && /* @__PURE__ */ (0,
|
|
6294
|
-
/* @__PURE__ */ (0,
|
|
6351
|
+
item.evidence.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "dsh-partner-memory-evidence", children: [
|
|
6352
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("summary", { children: [
|
|
6295
6353
|
"\u67E5\u770B\u5BF9\u8BDD\u4F9D\u636E ",
|
|
6296
|
-
/* @__PURE__ */ (0,
|
|
6354
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("b", { children: item.evidence.length })
|
|
6297
6355
|
] }),
|
|
6298
|
-
/* @__PURE__ */ (0,
|
|
6299
|
-
/* @__PURE__ */ (0,
|
|
6300
|
-
/* @__PURE__ */ (0,
|
|
6356
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: [...item.evidence].reverse().map((evidence) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("blockquote", { children: [
|
|
6357
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: evidence.excerpt }),
|
|
6358
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("time", { children: new Date(evidence.at).toLocaleString() })
|
|
6301
6359
|
] }, `${evidence.turnId}:${evidence.at}`)) })
|
|
6302
6360
|
] })
|
|
6303
6361
|
] }) });
|