@lemoncat7/dsh-partner 1.10.6 → 1.11.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 +41 -0
- package/docs/architecture.md +14 -0
- package/lib/api/features/workspace-api.js +2 -2
- package/lib/api/features/workspace-api.js.map +1 -1
- package/lib/client-api.d.ts +8 -0
- package/lib/client-api.d.ts.map +1 -1
- package/lib/client-api.js.map +1 -1
- package/lib/client.js +1103 -917
- package/lib/client.js.map +4 -4
- package/lib/collaboration/composition.d.ts.map +1 -1
- package/lib/collaboration/composition.js +5 -3
- package/lib/collaboration/composition.js.map +1 -1
- package/lib/collaboration/domain.d.ts +2 -0
- package/lib/collaboration/domain.d.ts.map +1 -1
- package/lib/collaboration/domain.js.map +1 -1
- package/lib/collaboration/service.d.ts +1 -0
- package/lib/collaboration/service.d.ts.map +1 -1
- package/lib/collaboration/service.js +15 -4
- package/lib/collaboration/service.js.map +1 -1
- package/lib/domain.d.ts +1 -0
- package/lib/domain.d.ts.map +1 -1
- package/lib/domain.js.map +1 -1
- package/lib/pendant/card-image.d.ts +1 -1
- package/lib/pendant/card-image.d.ts.map +1 -1
- package/lib/pendant/card-image.js +16 -6
- package/lib/pendant/card-image.js.map +1 -1
- package/lib/pendant/physics.d.ts +1 -0
- package/lib/pendant/physics.d.ts.map +1 -1
- package/lib/pendant/physics.js +24 -2
- package/lib/pendant/physics.js.map +1 -1
- package/lib/pendant/renderer.d.ts.map +1 -1
- package/lib/pendant/renderer.js +21 -4
- package/lib/pendant/renderer.js.map +1 -1
- package/lib/pendant/settings-panel.d.ts.map +1 -1
- package/lib/pendant/settings-panel.js +5 -4
- package/lib/pendant/settings-panel.js.map +1 -1
- package/lib/pendant/settings.d.ts +5 -0
- package/lib/pendant/settings.d.ts.map +1 -1
- package/lib/pendant/settings.js +9 -3
- package/lib/pendant/settings.js.map +1 -1
- package/lib/pendant/strap-preview.d.ts +3 -1
- package/lib/pendant/strap-preview.d.ts.map +1 -1
- package/lib/pendant/strap-preview.js +6 -3
- package/lib/pendant/strap-preview.js.map +1 -1
- package/lib/pendant/strap-texture.d.ts +5 -0
- package/lib/pendant/strap-texture.d.ts.map +1 -0
- package/lib/pendant/strap-texture.js +9 -0
- package/lib/pendant/strap-texture.js.map +1 -0
- package/lib/pendant/strap.d.ts.map +1 -1
- package/lib/pendant/strap.js +39 -2
- package/lib/pendant/strap.js.map +1 -1
- package/lib/pendant-renderer.js +174 -174
- package/lib/requirements/draft.d.ts +3 -0
- package/lib/requirements/draft.d.ts.map +1 -0
- package/lib/requirements/draft.js +7 -0
- package/lib/requirements/draft.js.map +1 -0
- package/lib/requirements/plan-schema.d.ts +93 -0
- package/lib/requirements/plan-schema.d.ts.map +1 -0
- package/lib/requirements/plan-schema.js +16 -0
- package/lib/requirements/plan-schema.js.map +1 -0
- package/lib/requirements/plan.d.ts +30 -0
- package/lib/requirements/plan.d.ts.map +1 -0
- package/lib/requirements/plan.js +134 -0
- package/lib/requirements/plan.js.map +1 -0
- package/lib/requirements/service.d.ts +2 -1
- package/lib/requirements/service.d.ts.map +1 -1
- package/lib/requirements/service.js +4 -6
- package/lib/requirements/service.js.map +1 -1
- package/lib/requirements/tool.d.ts +1 -1
- package/lib/requirements/tool.d.ts.map +1 -1
- package/lib/requirements/tool.js +24 -3
- package/lib/requirements/tool.js.map +1 -1
- package/lib/skills/task-planning.d.ts +2 -2
- package/lib/skills/task-planning.d.ts.map +1 -1
- package/lib/skills/task-planning.js +10 -1
- package/lib/skills/task-planning.js.map +1 -1
- package/lib/store.js +2 -0
- package/lib/store.js.map +1 -1
- package/lib/tasks/context.d.ts.map +1 -1
- package/lib/tasks/context.js +9 -1
- package/lib/tasks/context.js.map +1 -1
- package/lib/tasks/contract.d.ts +63 -0
- package/lib/tasks/contract.d.ts.map +1 -0
- package/lib/tasks/contract.js +55 -0
- package/lib/tasks/contract.js.map +1 -0
- package/lib/tasks/domain.d.ts +6 -0
- package/lib/tasks/domain.d.ts.map +1 -1
- package/lib/tasks/draft.d.ts +7 -0
- package/lib/tasks/draft.d.ts.map +1 -0
- package/lib/tasks/draft.js +54 -0
- package/lib/tasks/draft.js.map +1 -0
- package/lib/tasks/result.d.ts +2 -0
- package/lib/tasks/result.d.ts.map +1 -1
- package/lib/tasks/result.js +17 -3
- package/lib/tasks/result.js.map +1 -1
- package/lib/tasks/scheduling.d.ts +15 -0
- package/lib/tasks/scheduling.d.ts.map +1 -0
- package/lib/tasks/scheduling.js +46 -0
- package/lib/tasks/scheduling.js.map +1 -0
- package/lib/tasks/service.d.ts +46 -3
- package/lib/tasks/service.d.ts.map +1 -1
- package/lib/tasks/service.js +55 -58
- package/lib/tasks/service.js.map +1 -1
- package/lib/ui/requirement-tasks-panel.d.ts.map +1 -1
- package/lib/ui/requirement-tasks-panel.js +18 -9
- package/lib/ui/requirement-tasks-panel.js.map +1 -1
- package/lib/ui/task-contract-panel.d.ts +10 -0
- package/lib/ui/task-contract-panel.d.ts.map +1 -0
- package/lib/ui/task-contract-panel.js +16 -0
- package/lib/ui/task-contract-panel.js.map +1 -0
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -1533,6 +1533,18 @@ body[data-ds-dark-theme] :is(.dsh-partner-sidebar, .dsh-partner-workspace, .dsh-
|
|
|
1533
1533
|
.dsh-partner-task-description strong { font-size: var(--partner-font-body); font-weight: 620; }
|
|
1534
1534
|
.dsh-partner-task-description p { margin: 0; color: var(--partner-text-secondary); font-size: var(--partner-font-body); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
1535
1535
|
.dsh-partner-task-fields { display: grid; gap: 7px; }
|
|
1536
|
+
.dsh-partner-task-contract { display: grid; gap: 12px; min-width: 0; color: var(--partner-text); font: var(--partner-font-body)/1.6 var(--partner-font-family); }
|
|
1537
|
+
.dsh-partner-task-contract header, .dsh-partner-task-contract li, .dsh-partner-task-contract li > div { display: grid; gap: 6px; min-width: 0; }
|
|
1538
|
+
.dsh-partner-task-contract ol { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: criterion; }
|
|
1539
|
+
.dsh-partner-task-contract li { counter-increment: criterion; border-top: 1px solid var(--partner-border); padding-top: 10px; }
|
|
1540
|
+
.dsh-partner-task-contract li > p { margin: 0; overflow-wrap: anywhere; }
|
|
1541
|
+
.dsh-partner-task-contract li > p::before { content: counter(criterion) '. '; color: var(--partner-text-tertiary); }
|
|
1542
|
+
.dsh-partner-task-contract small { font-size: var(--partner-font-caption); color: var(--partner-text-secondary); overflow-wrap: anywhere; }
|
|
1543
|
+
.dsh-partner-task-contract code { display: block; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--partner-font-caption); }
|
|
1544
|
+
.dsh-partner-task-contract .dsh-partner-task-fields label { grid-template-columns: minmax(0, 1fr); gap: 5px; }
|
|
1545
|
+
.dsh-partner-task-contract :is(select, textarea) { box-sizing: border-box; width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid var(--partner-border); border-radius: 10px; color: var(--partner-text); background: var(--partner-control); font: var(--partner-font-label)/1.5 var(--partner-font-family); }
|
|
1546
|
+
.dsh-partner-task-contract textarea { resize: vertical; }
|
|
1547
|
+
.dsh-partner-task-contract :is(select, textarea):focus-visible { outline: 2px solid var(--partner-focus-ring); outline-offset: 2px; }
|
|
1536
1548
|
.dsh-partner-task-fields label { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 8px; color: var(--partner-text-tertiary); font-size: var(--partner-font-caption); }
|
|
1537
1549
|
.dsh-partner-task-detail select { width: 100%; height: 34px; padding: 0 28px 0 9px; border: 1px solid var(--partner-border); border-radius: 8px; color: var(--partner-text-secondary); background-color: var(--partner-control); font: var(--partner-font-body)/1 var(--partner-font-family); }
|
|
1538
1550
|
.dsh-partner-task-detail select:focus { border-color: var(--partner-focus-ring); background-color: var(--partner-raised); box-shadow: 0 0 0 3px color-mix(in srgb, var(--partner-focus-ring) 14%, transparent); }
|
|
@@ -2944,6 +2956,15 @@ body[data-ds-dark-theme] .dsh-partner-pendant section#dsh-partner-pendant-inbox.
|
|
|
2944
2956
|
// src/pendant/settings-panel.css
|
|
2945
2957
|
var settings_panel_default = `.dsh-partner-pendant-settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
|
|
2946
2958
|
.dsh-partner-pendant-settings-fields { display: grid; min-width: 0; gap: 16px; }
|
|
2959
|
+
.dsh-partner-pendant-length { display: grid; gap: 8px; color: var(--partner-text); font: inherit; }
|
|
2960
|
+
.dsh-partner-pendant-length > span { display: flex; justify-content: space-between; }
|
|
2961
|
+
.dsh-partner-pendant-length small { color: var(--partner-text-secondary); font-size: 12px; }
|
|
2962
|
+
.dsh-partner-pendant-length input[type="range"] { appearance: none; -webkit-appearance: none; width: 100%; min-height: 44px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; cursor: pointer; }
|
|
2963
|
+
.dsh-partner-pendant-length input::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: var(--partner-border); }
|
|
2964
|
+
.dsh-partner-pendant-length input::-moz-range-track { height: 4px; border-radius: 4px; background: var(--partner-border); }
|
|
2965
|
+
.dsh-partner-pendant-length input::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border: 2px solid var(--partner-control); border-radius: 50%; background: var(--partner-text-secondary); }
|
|
2966
|
+
.dsh-partner-pendant-length input::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid var(--partner-control); border-radius: 50%; background: var(--partner-text-secondary); }
|
|
2967
|
+
.dsh-partner-pendant-length input:focus-visible { outline: 2px solid var(--partner-accent); outline-offset: 3px; }
|
|
2947
2968
|
.dsh-partner-pendant-fps-row { display: grid; gap: 8px; font-size: 13px; }
|
|
2948
2969
|
.dsh-partner-pendant-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid var(--partner-border); border-radius: 12px; background: var(--partner-control); }
|
|
2949
2970
|
.dsh-partner-pendant-options[data-columns="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
@@ -3101,10 +3122,19 @@ function errorMessage(value) {
|
|
|
3101
3122
|
|
|
3102
3123
|
// src/pendant/settings.ts
|
|
3103
3124
|
var PENDANT_SETTINGS_KEY = "dsh-partner:pendant-settings:v1";
|
|
3104
|
-
var DEFAULT_PENDANT_SETTINGS = Object.freeze({ enabled: true, fps: 30, material: "woven", color: "#617e73", image: "", imageFit: "contain" });
|
|
3125
|
+
var DEFAULT_PENDANT_SETTINGS = Object.freeze({ enabled: true, fps: 30, material: "woven", color: "#617e73", image: "", imageFit: "contain", strapLength: 100, strapImage: "", quality: 100 });
|
|
3105
3126
|
var MAX_CARD_IMAGE_LENGTH = 7e5;
|
|
3106
3127
|
function samePendantSettings(a, b) {
|
|
3107
|
-
return a.enabled === b.enabled && a.fps === b.fps && a.material === b.material && a.color === b.color && a.image === b.image && a.imageFit === b.imageFit;
|
|
3128
|
+
return a.enabled === b.enabled && a.fps === b.fps && a.material === b.material && a.color === b.color && a.image === b.image && a.imageFit === b.imageFit && a.strapLength === b.strapLength && a.strapImage === b.strapImage && a.quality === b.quality;
|
|
3129
|
+
}
|
|
3130
|
+
function normalizeStrapLength(value) {
|
|
3131
|
+
return typeof value === "number" && Number.isFinite(value) ? Math.max(60, Math.min(160, Math.round(value))) : 100;
|
|
3132
|
+
}
|
|
3133
|
+
function normalizeCardQuality(value) {
|
|
3134
|
+
return value === "standard" ? 0 : typeof value === "number" && Number.isFinite(value) ? Math.max(0, Math.min(100, Math.round(value))) : 100;
|
|
3135
|
+
}
|
|
3136
|
+
function safeImage(value) {
|
|
3137
|
+
return typeof value === "string" && value.length <= MAX_CARD_IMAGE_LENGTH && /^data:image\/(jpeg|png|webp);base64,[a-z0-9+/]+={0,2}$/i.test(value) ? value : "";
|
|
3108
3138
|
}
|
|
3109
3139
|
function normalizePendantFps(value) {
|
|
3110
3140
|
return value === 24 || value === 60 ? value : 30;
|
|
@@ -3114,10 +3144,13 @@ function normalizePendantSettings(value) {
|
|
|
3114
3144
|
return {
|
|
3115
3145
|
enabled: typeof input.enabled === "boolean" ? input.enabled : true,
|
|
3116
3146
|
fps: normalizePendantFps(input.fps),
|
|
3147
|
+
strapLength: normalizeStrapLength(input.strapLength),
|
|
3148
|
+
strapImage: safeImage(input.strapImage),
|
|
3149
|
+
quality: normalizeCardQuality(input.quality),
|
|
3117
3150
|
imageFit: input.imageFit === "cover" ? "cover" : "contain",
|
|
3118
3151
|
material: input.material === "braided" || input.material === "leather" ? input.material : "woven",
|
|
3119
3152
|
color: typeof input.color === "string" && /^#[0-9a-f]{6}$/i.test(input.color) ? input.color.toLowerCase() : DEFAULT_PENDANT_SETTINGS.color,
|
|
3120
|
-
image:
|
|
3153
|
+
image: safeImage(input.image)
|
|
3121
3154
|
};
|
|
3122
3155
|
}
|
|
3123
3156
|
|
|
@@ -3181,25 +3214,30 @@ function loadCardImage(source) {
|
|
|
3181
3214
|
image.src = source;
|
|
3182
3215
|
});
|
|
3183
3216
|
}
|
|
3184
|
-
async function prepareCardImage(file) {
|
|
3217
|
+
async function prepareCardImage(file, maxDimension = 1536) {
|
|
3185
3218
|
if (!["image/png", "image/jpeg", "image/webp"].includes(file.type)) throw new Error("\u8BF7\u9009\u62E9 PNG\u3001JPEG \u6216 WebP \u56FE\u7247\u3002");
|
|
3186
3219
|
if (file.size > 5 * 1024 * 1024) throw new Error("\u56FE\u7247\u4E0D\u80FD\u8D85\u8FC7 5 MB\u3002");
|
|
3187
3220
|
const url = URL.createObjectURL(file);
|
|
3188
3221
|
try {
|
|
3189
3222
|
const image = await loadCardImage(url);
|
|
3190
3223
|
if (!image.naturalWidth || !image.naturalHeight || image.naturalWidth * image.naturalHeight > 25e6) throw new Error("\u56FE\u7247\u5206\u8FA8\u7387\u8FC7\u5927\uFF0C\u8BF7\u7F29\u5C0F\u81F3 2500 \u4E07\u50CF\u7D20\u4EE5\u5185\u3002");
|
|
3191
|
-
const scale = Math.min(1,
|
|
3224
|
+
const scale = Math.min(1, maxDimension / Math.max(image.naturalWidth, image.naturalHeight));
|
|
3192
3225
|
const canvas = document.createElement("canvas");
|
|
3193
3226
|
canvas.width = Math.max(1, Math.round(image.naturalWidth * scale));
|
|
3194
3227
|
canvas.height = Math.max(1, Math.round(image.naturalHeight * scale));
|
|
3195
3228
|
const context = canvas.getContext("2d");
|
|
3196
3229
|
if (!context) throw new Error("\u5F53\u524D\u6D4F\u89C8\u5668\u65E0\u6CD5\u5904\u7406\u56FE\u7247\u3002");
|
|
3230
|
+
context.imageSmoothingQuality = "high";
|
|
3197
3231
|
context.fillStyle = CARD_IMAGE_BACKGROUND;
|
|
3198
3232
|
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
3199
3233
|
context.drawImage(image, 0, 0, canvas.width, canvas.height);
|
|
3200
|
-
const
|
|
3201
|
-
if (
|
|
3202
|
-
|
|
3234
|
+
const png = canvas.toDataURL("image/png");
|
|
3235
|
+
if (png.length <= MAX_CARD_IMAGE_LENGTH) return png;
|
|
3236
|
+
for (const quality of [0.94, 0.88, 0.8]) {
|
|
3237
|
+
const result = canvas.toDataURL("image/webp", quality);
|
|
3238
|
+
if (result.length <= MAX_CARD_IMAGE_LENGTH) return result;
|
|
3239
|
+
}
|
|
3240
|
+
throw new Error("\u56FE\u7247\u538B\u7F29\u540E\u4ECD\u7136\u8FC7\u5927\uFF0C\u8BF7\u7F29\u5C0F\u56FE\u7247\u6216\u4F7F\u7528\u66F4\u7B80\u6D01\u7684\u56FE\u6848\u3002");
|
|
3203
3241
|
} finally {
|
|
3204
3242
|
URL.revokeObjectURL(url);
|
|
3205
3243
|
}
|
|
@@ -3286,12 +3324,27 @@ function strapGeometry(points, settings, scale) {
|
|
|
3286
3324
|
return layers;
|
|
3287
3325
|
}
|
|
3288
3326
|
|
|
3327
|
+
// src/pendant/strap-texture.ts
|
|
3328
|
+
var STRAP_TEXTURE_SEGMENTS = 48;
|
|
3329
|
+
function strapTextureTransform(a, b, width, index) {
|
|
3330
|
+
const dx = b.x - a.x, dy = b.y - a.y, distance = Math.hypot(dx, dy);
|
|
3331
|
+
const nx = distance > 1e-4 ? -dy / distance * width : width;
|
|
3332
|
+
const ny = distance > 1e-4 ? dx / distance * width : 0;
|
|
3333
|
+
return `matrix(${nx} ${ny} ${dx} ${dy} ${a.x - nx / 2 - dx * index} ${a.y - ny / 2 - dy * index})`;
|
|
3334
|
+
}
|
|
3335
|
+
|
|
3289
3336
|
// src/pendant/strap-preview.tsx
|
|
3290
3337
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
3291
|
-
function StrapPreview({ material, color, swatch = false }) {
|
|
3338
|
+
function StrapPreview({ material, color, swatch = false, image = "", length = 100 }) {
|
|
3339
|
+
const id = (0, import_react4.useId)().replace(/:/g, "");
|
|
3340
|
+
const points = (0, import_react4.useMemo)(() => Array.from({ length: STRAP_TEXTURE_SEGMENTS + 1 }, (_, i) => swatch ? { x: 8 + 104 * i / STRAP_TEXTURE_SEGMENTS, y: 20 } : { x: 50, y: 6 + 121 * i / STRAP_TEXTURE_SEGMENTS }), [swatch]);
|
|
3292
3341
|
const layers = (0, import_react4.useMemo)(() => strapGeometry(swatch ? [{ x: 8, y: 20 }, { x: 112, y: 20 }] : [{ x: 50, y: 6 }, { x: 50, y: 127 }], { material, color }, swatch ? 100 : 72), [material, color, swatch]);
|
|
3293
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { className: swatch ? "dsh-partner-strap-swatch" : void 0, viewBox: swatch ? "0 0 120 40" : "0 0 100 130", "aria-hidden": "true", children: [
|
|
3294
|
-
|
|
3342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { className: swatch ? "dsh-partner-strap-swatch" : void 0, style: swatch ? void 0 : { height: `${130 * length / 100}px` }, viewBox: swatch ? "0 0 120 40" : "0 0 100 130", preserveAspectRatio: "none", "aria-hidden": "true", children: [
|
|
3343
|
+
image && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("pattern", { id, patternUnits: "userSpaceOnUse", width: "1", height: "4", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("image", { href: image, width: "1", height: "4", preserveAspectRatio: "none" }) }) }),
|
|
3344
|
+
layers.map((layer) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react4.Fragment, { children: [
|
|
3345
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: layer.d, fill: "none", stroke: layer.stroke, strokeWidth: layer.width, opacity: layer.opacity, strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
3346
|
+
image && layer.id === "surface" && points.slice(0, -1).map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "0", y: i - 5e-3, width: "1", height: "1.01", fill: `url(#${id})`, transform: strapTextureTransform(p, points[i + 1], layer.width, i) }, i))
|
|
3347
|
+
] }, layer.id)),
|
|
3295
3348
|
!swatch && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "42", y: "3", width: "16", height: "6", rx: "3", fill: "#c3ced0" })
|
|
3296
3349
|
] });
|
|
3297
3350
|
}
|
|
@@ -3310,6 +3363,7 @@ function PendantSettingsPanel() {
|
|
|
3310
3363
|
const settings = usePendantSettings(), [draft, setDraft] = (0, import_react5.useState)(() => ({ ...settings }));
|
|
3311
3364
|
const [error, setError] = (0, import_react5.useState)(""), [saved, setSaved] = (0, import_react5.useState)(false), [processing, setProcessing] = (0, import_react5.useState)(false);
|
|
3312
3365
|
const file = (0, import_react5.useRef)(null), epoch = (0, import_react5.useRef)(0);
|
|
3366
|
+
const strapFile = (0, import_react5.useRef)(null);
|
|
3313
3367
|
const previous = (0, import_react5.useRef)(settings);
|
|
3314
3368
|
(0, import_react5.useEffect)(() => {
|
|
3315
3369
|
const before = previous.current;
|
|
@@ -3327,7 +3381,7 @@ function PendantSettingsPanel() {
|
|
|
3327
3381
|
const validColor = /^#[0-9a-f]{6}$/i.test(draft.color);
|
|
3328
3382
|
const previewColor = validColor ? draft.color : DEFAULT_PENDANT_SETTINGS.color;
|
|
3329
3383
|
const dirty = !samePendantSettings(draft, settings);
|
|
3330
|
-
const upload = async (event) => {
|
|
3384
|
+
const upload = async (event, target = "image") => {
|
|
3331
3385
|
const selected = event.currentTarget.files?.[0];
|
|
3332
3386
|
event.currentTarget.value = "";
|
|
3333
3387
|
if (!selected) return;
|
|
@@ -3336,8 +3390,8 @@ function PendantSettingsPanel() {
|
|
|
3336
3390
|
setError("");
|
|
3337
3391
|
setSaved(false);
|
|
3338
3392
|
try {
|
|
3339
|
-
const image = await prepareCardImage(selected);
|
|
3340
|
-
if (request === epoch.current) update({ image });
|
|
3393
|
+
const image = await prepareCardImage(selected, target === "strapImage" ? 256 : 1536);
|
|
3394
|
+
if (request === epoch.current) update({ [target]: image });
|
|
3341
3395
|
} catch (reason) {
|
|
3342
3396
|
if (request === epoch.current) setError(errorMessage(reason));
|
|
3343
3397
|
} finally {
|
|
@@ -3382,6 +3436,17 @@ function PendantSettingsPanel() {
|
|
|
3382
3436
|
] })
|
|
3383
3437
|
] }),
|
|
3384
3438
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(WorkspaceBlock, { title: "\u7EF3\u5B50\u5916\u89C2", detail: "\u6750\u8D28\u53EA\u6539\u53D8\u5916\u89C2\uFF0C\u4FDD\u7559\u5F53\u524D\u7684\u62C9\u4F38\u4E0E\u56DE\u5F39\u624B\u611F\u3002", children: [
|
|
3439
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "dsh-partner-pendant-length", children: [
|
|
3440
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
|
|
3441
|
+
"\u7EF3\u5B50\u957F\u5EA6 ",
|
|
3442
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("output", { children: [
|
|
3443
|
+
draft.strapLength,
|
|
3444
|
+
"%"
|
|
3445
|
+
] })
|
|
3446
|
+
] }),
|
|
3447
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("input", { type: "range", min: "60", max: "160", step: "5", "aria-label": "\u7EF3\u5B50\u957F\u5EA6", value: draft.strapLength, onChange: (event) => update({ strapLength: Number(event.target.value) }) }),
|
|
3448
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("small", { children: "60% \u77ED\u7EF3 \u2014 100% \u9ED8\u8BA4 \u2014 160% \u957F\u7EF3\uFF1B\u4FDD\u5B58\u540E\u8C03\u6574\u5B9E\u9645\u60AC\u6302\u957F\u5EA6\u3002" })
|
|
3449
|
+
] }),
|
|
3385
3450
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dsh-partner-pendant-materials", role: "group", "aria-label": "\u7EF3\u5B50\u6750\u8D28", children: MATERIALS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("button", { type: "button", "aria-pressed": draft.material === item.id, onClick: () => update({ material: item.id }), children: [
|
|
3386
3451
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StrapPreview, { material: item.id, color: previewColor, swatch: true }),
|
|
3387
3452
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: item.name }),
|
|
@@ -3399,7 +3464,18 @@ function PendantSettingsPanel() {
|
|
|
3399
3464
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("input", { "aria-label": "\u81EA\u5B9A\u4E49\u7EF3\u5B50\u989C\u8272", "aria-invalid": !validColor, value: draft.color, maxLength: 7, spellCheck: false, onChange: (event) => update({ color: event.target.value }) })
|
|
3400
3465
|
] })
|
|
3401
3466
|
] }),
|
|
3402
|
-
!validColor && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "dsh-partner-pendant-color-error", children: "\u8BF7\u8F93\u5165 # \u5F00\u5934\u7684\u516D\u4F4D\u989C\u8272\u503C\u3002" })
|
|
3467
|
+
!validColor && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "dsh-partner-pendant-color-error", children: "\u8BF7\u8F93\u5165 # \u5F00\u5934\u7684\u516D\u4F4D\u989C\u8272\u503C\u3002" }),
|
|
3468
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("input", { ref: strapFile, type: "file", accept: "image/png,image/jpeg,image/webp", hidden: true, "aria-label": "\u4E0A\u4F20\u7EF3\u5B50\u7EB9\u7406", onChange: (event) => {
|
|
3469
|
+
void upload(event, "strapImage");
|
|
3470
|
+
} }),
|
|
3471
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsh-partner-pendant-image-actions", children: [
|
|
3472
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("button", { type: "button", disabled: processing, onClick: () => strapFile.current?.click(), children: [
|
|
3473
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dsh_client_ui_primitives2.IconPlusOutline16, { size: 15 }),
|
|
3474
|
+
draft.strapImage ? "\u66F4\u6362\u7EF3\u5B50\u7EB9\u7406" : "\u81EA\u5B9A\u4E49\u7EF3\u5B50\u7EB9\u7406"
|
|
3475
|
+
] }),
|
|
3476
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", disabled: processing || !draft.strapImage, onClick: () => update({ strapImage: "" }), children: "\u79FB\u9664\u7EB9\u7406" })
|
|
3477
|
+
] }),
|
|
3478
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "dsh-partner-pendant-setting-hint", children: "\u7EB9\u7406\u6CBF\u7EF3\u5B50\u91CD\u590D\u8D34\u5408\uFF0C\u8DDF\u968F\u79FB\u52A8\u3001\u5F2F\u66F2\u548C\u62C9\u4F38\uFF1B\u5EFA\u8BAE\u4F7F\u7528\u65E0\u7F1D\u56FE\u6848\uFF0C\u4FDD\u7559\u6240\u9009\u6750\u8D28\u7684\u8FB9\u7F18\u548C\u7F16\u7EC7\u7EC6\u8282\u3002" })
|
|
3403
3479
|
] }),
|
|
3404
3480
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(WorkspaceBlock, { title: "\u6B63\u9762\u56FE\u6848", detail: "\u652F\u6301 PNG\u3001JPEG\u3001WebP\uFF0C\u6700\u5927 5 MB\u3002\u4FDD\u7559\u56FE\u7247\u6BD4\u4F8B\uFF0C\u53EA\u5728\u672C\u673A\u5904\u7406\u3002", children: [
|
|
3405
3481
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("input", { ref: file, type: "file", accept: "image/png,image/jpeg,image/webp", hidden: true, "aria-label": "\u4E0A\u4F20\u5361\u7247\u56FE\u7247", onChange: (event) => {
|
|
@@ -3419,7 +3495,19 @@ function PendantSettingsPanel() {
|
|
|
3419
3495
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: item.label }),
|
|
3420
3496
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("small", { children: item.detail })
|
|
3421
3497
|
] }, item.fit)) }),
|
|
3422
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "dsh-partner-pendant-setting-hint", children: "\u5B8C\u6574\u663E\u793A\u4F1A\u6309\u6BD4\u4F8B\u7F29\u653E\uFF0C\u7A7A\u4F59\u90E8\u5206\u4F7F\u7528\u5361\u9762\u5E95\u8272\uFF1B\u94FA\u6EE1\u4F1A\u88C1\u5207\u8FB9\u7F18\uFF0C\u4E0D\u62C9\u4F38\u56FE\u7247\u3002\u65E7\u7248\u5DF2\u88C1\u5207\u7684\u56FE\u7247\u9700\u91CD\u65B0\u4E0A\u4F20\u624D\u80FD\u6062\u590D\u5B8C\u6574\u5185\u5BB9\u3002" })
|
|
3498
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "dsh-partner-pendant-setting-hint", children: "\u5B8C\u6574\u663E\u793A\u4F1A\u6309\u6BD4\u4F8B\u7F29\u653E\uFF0C\u7A7A\u4F59\u90E8\u5206\u4F7F\u7528\u5361\u9762\u5E95\u8272\uFF1B\u94FA\u6EE1\u4F1A\u88C1\u5207\u8FB9\u7F18\uFF0C\u4E0D\u62C9\u4F38\u56FE\u7247\u3002\u65E7\u7248\u5DF2\u88C1\u5207\u7684\u56FE\u7247\u9700\u91CD\u65B0\u4E0A\u4F20\u624D\u80FD\u6062\u590D\u5B8C\u6574\u5185\u5BB9\u3002" }),
|
|
3499
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { className: "dsh-partner-pendant-length", children: [
|
|
3500
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
|
|
3501
|
+
"\u5361\u7247\u6E05\u6670\u5EA6 ",
|
|
3502
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("output", { children: [
|
|
3503
|
+
draft.quality,
|
|
3504
|
+
"%"
|
|
3505
|
+
] })
|
|
3506
|
+
] }),
|
|
3507
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("input", { type: "range", min: "0", max: "100", step: "5", value: draft.quality, "aria-label": "\u5361\u7247\u6E05\u6670\u5EA6", onChange: (event) => update({ quality: Number(event.target.value) }) }),
|
|
3508
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("small", { children: "0% \u6807\u51C6\u3001\u7701\u8D44\u6E90 \u2014 100% \u9AD8\u6E05\uFF1B\u4FDD\u5B58\u540E\u751F\u6548\uFF0C\u4E0D\u6539\u53D8\u5E27\u7387\u4E0A\u9650\u3002" })
|
|
3509
|
+
] }),
|
|
3510
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "dsh-partner-pendant-setting-hint", children: "\u56FE\u6848\u4F18\u5148\u65E0\u635F\u4FDD\u5B58\uFF0C\u6700\u957F\u8FB9\u4FDD\u7559\u81F3 1536 \u50CF\u7D20\u3002\u5DF2\u538B\u7F29\u7684\u65E7\u56FE\u7247\u5EFA\u8BAE\u91CD\u65B0\u4E0A\u4F20\uFF1B\u9AD8\u6E05\u65E0\u6CD5\u6062\u590D\u539F\u56FE\u7F3A\u5931\u7684\u7EC6\u8282\u3002" })
|
|
3423
3511
|
] }),
|
|
3424
3512
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsh-partner-pendant-settings-footer", children: [
|
|
3425
3513
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", disabled: processing, onClick: () => update({ ...DEFAULT_PENDANT_SETTINGS }), children: "\u91CD\u7F6E\u4E3A\u9ED8\u8BA4" }),
|
|
@@ -3432,7 +3520,7 @@ function PendantSettingsPanel() {
|
|
|
3432
3520
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("small", { children: draft.enabled ? "\u4FDD\u5B58\u540E\u5E94\u7528\u5230\u4E3B\u754C\u9762" : "\u6302\u9970\u5C06\u9690\u85CF\uFF0C\u8BBE\u7F6E\u4ECD\u4F1A\u4FDD\u7559" })
|
|
3433
3521
|
] }),
|
|
3434
3522
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsh-partner-pendant-preview-stage", children: [
|
|
3435
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StrapPreview, { material: draft.material, color: previewColor }),
|
|
3523
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StrapPreview, { material: draft.material, color: previewColor, image: draft.strapImage, length: draft.strapLength }),
|
|
3436
3524
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dsh-partner-pendant-preview-card", children: draft.image ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("img", { src: draft.image, style: { objectFit: draft.imageFit }, alt: "\u81EA\u5B9A\u4E49\u5361\u7247\u6B63\u9762\u9884\u89C8" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { children: [
|
|
3437
3525
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_dsh_client_ui_primitives2.IconAgentPresetOutline16, { size: 38 }),
|
|
3438
3526
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: "WITH YOU" }),
|
|
@@ -4992,8 +5080,79 @@ function TaskBoardStage({ id, label, tasks, focused, filtered, renderTask }) {
|
|
|
4992
5080
|
] });
|
|
4993
5081
|
}
|
|
4994
5082
|
|
|
4995
|
-
// src/ui/
|
|
5083
|
+
// src/ui/task-contract-panel.tsx
|
|
4996
5084
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
5085
|
+
function TaskContractPanel({ task, checks, setChecks, busy }) {
|
|
5086
|
+
if (!task.acceptanceCriteria?.length && !task.resourceKeys?.length) return null;
|
|
5087
|
+
const editing = task.status === "review";
|
|
5088
|
+
const change = (criterion, patch) => setChecks((task.acceptanceCriteria ?? []).map((_, i) => ({ criterion: i + 1, verdict: "unverified", ...checks.find((c) => c.criterion === i + 1), ...criterion === i + 1 ? patch : {} })));
|
|
5089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: "dsh-partner-task-contract", children: [
|
|
5090
|
+
Boolean(task.acceptanceCriteria?.length) && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("header", { children: [
|
|
5091
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("strong", { children: [
|
|
5092
|
+
"\u9A8C\u6536\u6E05\u5355 \xB7 ",
|
|
5093
|
+
task.acceptanceCriteria?.length
|
|
5094
|
+
] }),
|
|
5095
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "\u4F19\u4F34 / \u4EBA\u5DE5\u6838\u9A8C\uFF0C\u4E0D\u7B49\u4E8E\u7A0B\u5E8F\u9A8C\u8BC1" })
|
|
5096
|
+
] }),
|
|
5097
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ol", { children: task.acceptanceCriteria?.map((text, i) => {
|
|
5098
|
+
const criterion = i + 1, check = checks.find((c) => c.criterion === criterion);
|
|
5099
|
+
const saved = task.reviewChecks?.find((c) => c.criterion === criterion);
|
|
5100
|
+
const previous = task.previousAttempt?.reviewChecks?.find((c) => c.criterion === criterion);
|
|
5101
|
+
const evidence = (task.evidence ?? []).filter((e) => e.criterion === criterion);
|
|
5102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("li", { children: [
|
|
5103
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: text }),
|
|
5104
|
+
evidence.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
|
|
5105
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("summary", { children: [
|
|
5106
|
+
"\u6267\u884C\u8BC1\u636E \xB7 ",
|
|
5107
|
+
evidence.length,
|
|
5108
|
+
" \xB7 \u5C1A\u9700\u6838\u9A8C"
|
|
5109
|
+
] }),
|
|
5110
|
+
evidence.map((e, j) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
5111
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("code", { children: e.reference }),
|
|
5112
|
+
e.note && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: e.note })
|
|
5113
|
+
] }, j))
|
|
5114
|
+
] }),
|
|
5115
|
+
previous?.reason && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("small", { children: [
|
|
5116
|
+
"\u4E0A\u6B21\u6838\u9A8C\uFF1A",
|
|
5117
|
+
previous.reason
|
|
5118
|
+
] }),
|
|
5119
|
+
editing ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-partner-task-fields", children: [
|
|
5120
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
|
|
5121
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
|
|
5122
|
+
"\u7B2C ",
|
|
5123
|
+
criterion,
|
|
5124
|
+
" \u9879\u7ED3\u8BBA"
|
|
5125
|
+
] }),
|
|
5126
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("select", { disabled: busy, value: check?.verdict ?? "unverified", onChange: (e) => change(criterion, { verdict: e.target.value }), children: [
|
|
5127
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "unverified", children: "\u672A\u9A8C\u8BC1" }),
|
|
5128
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "passed", children: "\u5DF2\u6838\u9A8C\u901A\u8FC7" }),
|
|
5129
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "failed", children: "\u672A\u901A\u8FC7" })
|
|
5130
|
+
] })
|
|
5131
|
+
] }),
|
|
5132
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { children: [
|
|
5133
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: check?.verdict === "passed" ? "\u5B9E\u9645\u6838\u9A8C\u8BC1\u636E" : "\u7F3A\u9879 / \u65E0\u6CD5\u6838\u9A8C\u7684\u539F\u56E0" }),
|
|
5134
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("textarea", { rows: 2, maxLength: 1e3, disabled: busy, value: (check?.verdict === "passed" ? check.evidence : check?.reason) ?? "", onChange: (e) => change(criterion, check?.verdict === "passed" ? { evidence: e.target.value } : { reason: e.target.value }) })
|
|
5135
|
+
] })
|
|
5136
|
+
] }) : saved && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("small", { children: [
|
|
5137
|
+
saved.verdict === "passed" ? "\u6838\u9A8C\u901A\u8FC7" : saved.verdict === "failed" ? "\u672A\u901A\u8FC7" : "\u672A\u9A8C\u8BC1",
|
|
5138
|
+
" \xB7 ",
|
|
5139
|
+
saved.evidence ?? saved.reason
|
|
5140
|
+
] })
|
|
5141
|
+
] }, criterion);
|
|
5142
|
+
}) }),
|
|
5143
|
+
task.resourceKeys?.length ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("details", { className: "dsh-partner-requirement-disclosure", children: [
|
|
5144
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("summary", { children: [
|
|
5145
|
+
"\u72EC\u5360\u8D44\u6E90\u58F0\u660E \xB7 ",
|
|
5146
|
+
task.resourceKeys.length
|
|
5147
|
+
] }),
|
|
5148
|
+
task.resourceKeys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("code", { children: key }, key)),
|
|
5149
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "\u4EC5\u7EA6\u675F\u770B\u677F\u5185\u76F8\u540C\u58F0\u660E\uFF0C\u4E0D\u662F\u64CD\u4F5C\u7CFB\u7EDF\u9501\u3002" })
|
|
5150
|
+
] }) : null
|
|
5151
|
+
] });
|
|
5152
|
+
}
|
|
5153
|
+
|
|
5154
|
+
// src/ui/requirement-tasks-panel.tsx
|
|
5155
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
4997
5156
|
var COLUMNS = [
|
|
4998
5157
|
{ id: "backlog", label: "\u6536\u96C6\u7BB1" },
|
|
4999
5158
|
{ id: "ready", label: "\u5F85\u5F00\u59CB" },
|
|
@@ -5113,11 +5272,11 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
|
|
|
5113
5272
|
setBusy(void 0);
|
|
5114
5273
|
}
|
|
5115
5274
|
};
|
|
5116
|
-
const accept = async (task) => {
|
|
5275
|
+
const accept = async (task, checks) => {
|
|
5117
5276
|
setBusy(task.id);
|
|
5118
5277
|
setError(void 0);
|
|
5119
5278
|
try {
|
|
5120
|
-
await api(`/tasks/${task.id}/accept`, { method: "POST", body: JSON.stringify({ expectedRevision: task.revision }) });
|
|
5279
|
+
await api(`/tasks/${task.id}/accept`, { method: "POST", body: JSON.stringify({ expectedRevision: task.revision, checks }) });
|
|
5121
5280
|
await load2();
|
|
5122
5281
|
} catch (reason) {
|
|
5123
5282
|
setError(errorMessage(reason));
|
|
@@ -5125,12 +5284,12 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
|
|
|
5125
5284
|
setBusy(void 0);
|
|
5126
5285
|
}
|
|
5127
5286
|
};
|
|
5128
|
-
const reject = async (task, reason) => {
|
|
5287
|
+
const reject = async (task, reason, checks) => {
|
|
5129
5288
|
if (!reason) return;
|
|
5130
5289
|
setBusy(task.id);
|
|
5131
5290
|
setError(void 0);
|
|
5132
5291
|
try {
|
|
5133
|
-
await api(`/tasks/${task.id}/reject`, { method: "POST", body: JSON.stringify({ reason, expectedRevision: task.revision }) });
|
|
5292
|
+
await api(`/tasks/${task.id}/reject`, { method: "POST", body: JSON.stringify({ reason, expectedRevision: task.revision, checks }) });
|
|
5134
5293
|
await load2();
|
|
5135
5294
|
} catch (cause) {
|
|
5136
5295
|
setError(errorMessage(cause));
|
|
@@ -5151,30 +5310,30 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
|
|
|
5151
5310
|
setBusy(void 0);
|
|
5152
5311
|
}
|
|
5153
5312
|
};
|
|
5154
|
-
return /* @__PURE__ */ (0,
|
|
5155
|
-
!detailOnly && /* @__PURE__ */ (0,
|
|
5156
|
-
back && /* @__PURE__ */ (0,
|
|
5157
|
-
/* @__PURE__ */ (0,
|
|
5158
|
-
/* @__PURE__ */ (0,
|
|
5159
|
-
/* @__PURE__ */ (0,
|
|
5313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-partner-feature-page is-board", children: [
|
|
5314
|
+
!detailOnly && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
5315
|
+
back && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("nav", { className: "dsh-partner-requirement-breadcrumb", children: [
|
|
5316
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: back, children: "\u9700\u6C42\u770B\u677F" }),
|
|
5317
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives9.IconChevronRightOutline14, { size: 14 }),
|
|
5318
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: requirement?.title ?? "\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1" })
|
|
5160
5319
|
] }),
|
|
5161
|
-
/* @__PURE__ */ (0,
|
|
5162
|
-
/* @__PURE__ */ (0,
|
|
5163
|
-
/* @__PURE__ */ (0,
|
|
5320
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WorkspaceHero, { eyebrow: requirement ? requirementStatus(requirement) : "\u65E7\u4EFB\u52A1", title: requirement?.title ?? "\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1", detail: requirement?.description || "\u4EFB\u52A1\u6309\u9636\u6BB5\u5C55\u793A\uFF0C\u70B9\u51FB\u67E5\u770B\u4EA4\u4ED8\u3001\u4F9D\u8D56\u548C\u6267\u884C\u72B6\u6001\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
5321
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "dsh-partner-board-live", title: syncedAt ? `\u6700\u8FD1\u540C\u6B65 ${new Date(syncedAt).toLocaleTimeString()}` : "\u6B63\u5728\u8FDE\u63A5", children: [
|
|
5322
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", {}),
|
|
5164
5323
|
"\u5B9E\u65F6\u540C\u6B65"
|
|
5165
5324
|
] }),
|
|
5166
|
-
requirement && /* @__PURE__ */ (0,
|
|
5167
|
-
requirement?.status === "planning" && /* @__PURE__ */ (0,
|
|
5168
|
-
/* @__PURE__ */ (0,
|
|
5325
|
+
requirement && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: () => setRequirementDetail(true), children: "\u9700\u6C42\u8BE6\u60C5" }),
|
|
5326
|
+
requirement?.status === "planning" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", onClick: () => setCreating(true), children: [
|
|
5327
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives9.IconPlusOutline16, { size: 15 }),
|
|
5169
5328
|
"\u65B0\u4EFB\u52A1"
|
|
5170
5329
|
] })
|
|
5171
5330
|
] }) })
|
|
5172
5331
|
] }),
|
|
5173
|
-
error && /* @__PURE__ */ (0,
|
|
5174
|
-
requirementDetail && requirement && /* @__PURE__ */ (0,
|
|
5175
|
-
creating && requirement && /* @__PURE__ */ (0,
|
|
5176
|
-
selectedTask && /* @__PURE__ */ (0,
|
|
5177
|
-
/* @__PURE__ */ (0,
|
|
5332
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WorkspaceNotice, { children: error }),
|
|
5333
|
+
requirementDetail && requirement && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WorkspaceDialog, { eyebrow: "\u9700\u6C42\u8BE6\u60C5", title: requirement.title, detail: requirementStatus(requirement), close: () => setRequirementDetail(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RequirementDetail, { item: requirement, tasks: requirementTasks, directory, changed: load2, close: () => setRequirementDetail(false) }, requirement.id) }),
|
|
5334
|
+
creating && requirement && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u5B50\u4EFB\u52A1", detail: `\u6240\u5C5E\u9700\u6C42\uFF1A${requirement.title}`, close: () => setCreating(false), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TaskForm, { requirementId: requirement.id, companions: directory, tasks: requirementTasks, close: () => setCreating(false), changed: load2 }) }),
|
|
5335
|
+
selectedTask && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(WorkspaceDialog, { eyebrow: "TASK DETAIL", title: selectedTask.title, detail: taskDialogSummary(selectedTask, directory), close: () => setSelectedTaskId(void 0), width: "wide", children: [
|
|
5336
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5178
5337
|
TaskDetail,
|
|
5179
5338
|
{
|
|
5180
5339
|
task: selectedTask,
|
|
@@ -5192,11 +5351,11 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
|
|
|
5192
5351
|
review: () => {
|
|
5193
5352
|
void review(selectedTask);
|
|
5194
5353
|
},
|
|
5195
|
-
accept: () => {
|
|
5196
|
-
void accept(selectedTask);
|
|
5354
|
+
accept: (checks) => {
|
|
5355
|
+
void accept(selectedTask, checks);
|
|
5197
5356
|
},
|
|
5198
|
-
reject: (reason) => {
|
|
5199
|
-
void reject(selectedTask, reason);
|
|
5357
|
+
reject: (reason, checks) => {
|
|
5358
|
+
void reject(selectedTask, reason, checks);
|
|
5200
5359
|
},
|
|
5201
5360
|
remove: () => {
|
|
5202
5361
|
void remove(selectedTask);
|
|
@@ -5204,61 +5363,61 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
|
|
|
5204
5363
|
},
|
|
5205
5364
|
selectedTask.id
|
|
5206
5365
|
),
|
|
5207
|
-
error && /* @__PURE__ */ (0,
|
|
5366
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WorkspaceNotice, { children: error })
|
|
5208
5367
|
] }),
|
|
5209
|
-
!detailOnly && (loading ? /* @__PURE__ */ (0,
|
|
5210
|
-
/* @__PURE__ */ (0,
|
|
5211
|
-
/* @__PURE__ */ (0,
|
|
5212
|
-
/* @__PURE__ */ (0,
|
|
5213
|
-
/* @__PURE__ */ (0,
|
|
5214
|
-
/* @__PURE__ */ (0,
|
|
5215
|
-
query && /* @__PURE__ */ (0,
|
|
5368
|
+
!detailOnly && (loading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CollectionSkeleton, { rows: 6 }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
5369
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-partner-board-tools", children: [
|
|
5370
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "dsh-partner-board-search", children: [
|
|
5371
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u4EFB\u52A1" }),
|
|
5372
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives9.IconSearchOutline16, { size: 16 }) }),
|
|
5373
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { value: query, onChange: (event) => setQuery(event.target.value), placeholder: "\u641C\u7D22\u4EFB\u52A1\u3001\u8D1F\u8D23\u4EBA\u6216\u524D\u7F6E\u4EFB\u52A1" }),
|
|
5374
|
+
query && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: () => setQuery(""), "aria-label": "\u6E05\u9664\u4EFB\u52A1\u641C\u7D22", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives9.IconCloseOutline16, { size: 14 }) })
|
|
5216
5375
|
] }),
|
|
5217
|
-
/* @__PURE__ */ (0,
|
|
5218
|
-
/* @__PURE__ */ (0,
|
|
5219
|
-
/* @__PURE__ */ (0,
|
|
5220
|
-
/* @__PURE__ */ (0,
|
|
5221
|
-
/* @__PURE__ */ (0,
|
|
5222
|
-
directory.map((item) => /* @__PURE__ */ (0,
|
|
5376
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "dsh-partner-board-assignee", children: [
|
|
5377
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: "\u6309\u8D1F\u8D23\u4EBA\u7B5B\u9009" }),
|
|
5378
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("select", { value: assigneeFilter, onChange: (event) => setAssigneeFilter(event.target.value), children: [
|
|
5379
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "all", children: "\u5168\u90E8\u4F19\u4F34" }),
|
|
5380
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "unassigned", children: "\u672A\u6307\u6D3E" }),
|
|
5381
|
+
directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("option", { value: item.id, children: [
|
|
5223
5382
|
"@",
|
|
5224
5383
|
item.name
|
|
5225
5384
|
] }, item.id))
|
|
5226
5385
|
] })
|
|
5227
5386
|
] }),
|
|
5228
|
-
/* @__PURE__ */ (0,
|
|
5229
|
-
/* @__PURE__ */ (0,
|
|
5230
|
-
/* @__PURE__ */ (0,
|
|
5231
|
-
/* @__PURE__ */ (0,
|
|
5387
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "dsh-partner-board-assignee is-mobile-stage", children: [
|
|
5388
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: "\u6309\u4EFB\u52A1\u9636\u6BB5\u7B5B\u9009" }),
|
|
5389
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("select", { value: statusFilter, onChange: (event) => setStatusFilter(event.target.value), children: [
|
|
5390
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("option", { value: "all", children: [
|
|
5232
5391
|
"\u5168\u90E8\u9636\u6BB5 \xB7 ",
|
|
5233
5392
|
scopedTasks.length
|
|
5234
5393
|
] }),
|
|
5235
|
-
COLUMNS.map((column) => /* @__PURE__ */ (0,
|
|
5394
|
+
COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("option", { value: column.id, children: [
|
|
5236
5395
|
column.label,
|
|
5237
5396
|
" \xB7 ",
|
|
5238
5397
|
statusCounts.get(column.id) ?? 0
|
|
5239
5398
|
] }, column.id))
|
|
5240
5399
|
] })
|
|
5241
5400
|
] }),
|
|
5242
|
-
/* @__PURE__ */ (0,
|
|
5401
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("small", { "aria-live": "polite", children: [
|
|
5243
5402
|
"\u663E\u793A ",
|
|
5244
5403
|
visibleTaskCount,
|
|
5245
5404
|
" / ",
|
|
5246
5405
|
board.tasks.length
|
|
5247
5406
|
] })
|
|
5248
5407
|
] }),
|
|
5249
|
-
/* @__PURE__ */ (0,
|
|
5250
|
-
/* @__PURE__ */ (0,
|
|
5251
|
-
/* @__PURE__ */ (0,
|
|
5252
|
-
/* @__PURE__ */ (0,
|
|
5408
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("nav", { className: "dsh-partner-board-statuses", "aria-label": "\u6309\u4EFB\u52A1\u72B6\u6001\u7B5B\u9009", children: [
|
|
5409
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", className: statusFilter === "all" ? "is-active" : "", "aria-pressed": statusFilter === "all", onClick: () => setStatusFilter("all"), children: [
|
|
5410
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u5168\u90E8" }),
|
|
5411
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: scopedTasks.length })
|
|
5253
5412
|
] }),
|
|
5254
|
-
COLUMNS.map((column) => /* @__PURE__ */ (0,
|
|
5255
|
-
/* @__PURE__ */ (0,
|
|
5256
|
-
/* @__PURE__ */ (0,
|
|
5413
|
+
COLUMNS.map((column) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", className: statusFilter === column.id ? "is-active" : "", "aria-pressed": statusFilter === column.id, onClick: () => setStatusFilter(column.id), children: [
|
|
5414
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: column.label }),
|
|
5415
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: statusCounts.get(column.id) ?? 0 })
|
|
5257
5416
|
] }, column.id))
|
|
5258
5417
|
] }),
|
|
5259
|
-
/* @__PURE__ */ (0,
|
|
5418
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsh-partner-board", "data-focused": statusFilter !== "all", "aria-label": "\u4EFB\u52A1\u770B\u677F", children: visibleColumns.map((column) => {
|
|
5260
5419
|
const tasks = tasksByStatus.get(column.id) ?? [];
|
|
5261
|
-
return /* @__PURE__ */ (0,
|
|
5420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TaskBoardStage, { id: column.id, label: column.label, tasks, focused: statusFilter !== "all", filtered: Boolean(query || assigneeFilter !== "all"), renderTask: (task) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5262
5421
|
TaskCard,
|
|
5263
5422
|
{
|
|
5264
5423
|
task,
|
|
@@ -5271,9 +5430,9 @@ function RequirementTasksPanel({ initialTaskId, openRequest, requirementId, back
|
|
|
5271
5430
|
task.id
|
|
5272
5431
|
) }, column.id);
|
|
5273
5432
|
}) }),
|
|
5274
|
-
!scopedTasks.length && /* @__PURE__ */ (0,
|
|
5275
|
-
/* @__PURE__ */ (0,
|
|
5276
|
-
/* @__PURE__ */ (0,
|
|
5433
|
+
!scopedTasks.length && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-partner-collection-empty", children: [
|
|
5434
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: query || assigneeFilter !== "all" ? "\u6CA1\u6709\u5339\u914D\u7684\u4EFB\u52A1" : "\u8FD8\u6CA1\u6709\u5B50\u4EFB\u52A1" }),
|
|
5435
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: requirement?.status === "planning" ? "\u6DFB\u52A0\u5B50\u4EFB\u52A1\u5E76\u5B89\u6392\u8D1F\u8D23\u4EBA\uFF0C\u5B8C\u6210\u5206\u5DE5\u540E\u5728\u9700\u6C42\u8BE6\u60C5\u4E2D\u63D0\u4EA4\u89C4\u5212\u3002" : "\u53EF\u8FD4\u56DE\u9700\u6C42\u770B\u677F\u67E5\u770B\u5176\u4ED6\u9700\u6C42\u3002" })
|
|
5277
5436
|
] })
|
|
5278
5437
|
] }))
|
|
5279
5438
|
] });
|
|
@@ -5283,37 +5442,47 @@ function TaskCard({ task, tasksById, directoryById, dependentCount, execution, o
|
|
|
5283
5442
|
const blockers = dependencies.filter((item) => item.status !== "done");
|
|
5284
5443
|
const completedDependencies = dependencies.length - blockers.length;
|
|
5285
5444
|
const assignee = directoryById.get(task.assigneeCompanionId ?? "");
|
|
5286
|
-
const executionState = execution ? delegationState(execution, blockers.length) : task.autoRun && task.status === "ready" ? { label: blockers.length ? "\u7B49\u5F85\u524D\u7F6E\u5B8C\u6210" : "\u7B49\u5F85\u8C03\u5EA6" } : void 0;
|
|
5287
|
-
return /* @__PURE__ */ (0,
|
|
5288
|
-
/* @__PURE__ */ (0,
|
|
5289
|
-
/* @__PURE__ */ (0,
|
|
5290
|
-
/* @__PURE__ */ (0,
|
|
5291
|
-
/* @__PURE__ */ (0,
|
|
5445
|
+
const executionState = task.scheduling ? { label: task.scheduling.message } : execution ? delegationState(execution, blockers.length) : task.autoRun && task.status === "ready" ? { label: blockers.length ? "\u7B49\u5F85\u524D\u7F6E\u5B8C\u6210" : "\u7B49\u5F85\u8C03\u5EA6" } : void 0;
|
|
5446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("article", { className: "dsh-partner-task-card", "data-blocked": blockers.length > 0, "data-priority": task.priority, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", className: "dsh-partner-task-summary", "aria-haspopup": "dialog", onClick: open, children: [
|
|
5447
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
|
|
5448
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "dsh-partner-task-card-title", children: [
|
|
5449
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { title: task.title, children: task.title }),
|
|
5450
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("em", { children: priorityLabel(task.priority) })
|
|
5292
5451
|
] }),
|
|
5293
|
-
/* @__PURE__ */ (0,
|
|
5452
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("small", { className: "dsh-partner-task-card-owner", children: [
|
|
5294
5453
|
assignee ? `@${assignee.name}` : "\u672A\u6307\u6D3E",
|
|
5295
5454
|
task.resultSummary ? " \xB7 \u5DF2\u6709\u7ED3\u679C" : "",
|
|
5296
5455
|
executionState ? ` \xB7 ${executionState.label}` : ""
|
|
5297
5456
|
] }),
|
|
5298
|
-
(dependencies.length > 0 || dependentCount > 0) && /* @__PURE__ */ (0,
|
|
5299
|
-
dependencies.length > 0 && /* @__PURE__ */ (0,
|
|
5457
|
+
(dependencies.length > 0 || dependentCount > 0) && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "dsh-partner-task-relations", children: [
|
|
5458
|
+
dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("small", { "data-blocked": blockers.length > 0, children: [
|
|
5300
5459
|
"\u524D\u7F6E ",
|
|
5301
5460
|
completedDependencies,
|
|
5302
5461
|
"/",
|
|
5303
5462
|
dependencies.length
|
|
5304
5463
|
] }),
|
|
5305
|
-
dependentCount > 0 && /* @__PURE__ */ (0,
|
|
5464
|
+
dependentCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("small", { children: [
|
|
5306
5465
|
"\u5B8C\u6210\u540E\u89E3\u9501 ",
|
|
5307
5466
|
dependentCount
|
|
5308
5467
|
] })
|
|
5309
5468
|
] })
|
|
5310
5469
|
] }),
|
|
5311
|
-
/* @__PURE__ */ (0,
|
|
5470
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives9.IconChevronRightOutline14, { size: 14 })
|
|
5312
5471
|
] }) });
|
|
5313
5472
|
}
|
|
5314
5473
|
function TaskDetail({ task, tasks, activities, directory, execution, busy, update, delegate, review, accept, reject, remove }) {
|
|
5315
5474
|
const [rejecting, setRejecting] = (0, import_react17.useState)(false);
|
|
5475
|
+
const [checks, setChecks] = (0, import_react17.useState)([]);
|
|
5476
|
+
(0, import_react17.useEffect)(() => {
|
|
5477
|
+
setChecks([]);
|
|
5478
|
+
}, [task.id, task.revision]);
|
|
5316
5479
|
const [rejectReason, setRejectReason] = (0, import_react17.useState)("");
|
|
5480
|
+
(0, import_react17.useEffect)(() => {
|
|
5481
|
+
if (task.status !== "review") {
|
|
5482
|
+
setRejecting(false);
|
|
5483
|
+
setRejectReason("");
|
|
5484
|
+
}
|
|
5485
|
+
}, [task.status]);
|
|
5317
5486
|
const [confirmingDelete, setConfirmingDelete] = (0, import_react17.useState)(false);
|
|
5318
5487
|
const byId = (0, import_react17.useMemo)(() => new Map(tasks.map((item) => [item.id, item])), [tasks]);
|
|
5319
5488
|
const dependencies = task.dependencyTaskIds.map((id) => byId.get(id)).filter((item) => item !== void 0);
|
|
@@ -5324,21 +5493,30 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
|
|
|
5324
5493
|
const canExecute = Boolean(task.assigneeCompanionId) && !execution && !["doing", "review", "done"].includes(task.status);
|
|
5325
5494
|
const recentActivities = [...activities].sort((left, right) => right.at - left.at).slice(0, 6);
|
|
5326
5495
|
const executionState = execution ? delegationState(execution, blockers.length) : void 0;
|
|
5327
|
-
return /* @__PURE__ */ (0,
|
|
5328
|
-
/* @__PURE__ */ (0,
|
|
5329
|
-
/* @__PURE__ */ (0,
|
|
5330
|
-
/* @__PURE__ */ (0,
|
|
5496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-partner-task-detail", children: [
|
|
5497
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: "dsh-partner-task-description", children: [
|
|
5498
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
|
|
5499
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: task.description || "\u6CA1\u6709\u8865\u5145\u8BF4\u660E" })
|
|
5331
5500
|
] }),
|
|
5332
|
-
/* @__PURE__ */ (0,
|
|
5333
|
-
/* @__PURE__ */ (0,
|
|
5334
|
-
|
|
5335
|
-
|
|
5501
|
+
task.scheduling && task.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: "dsh-partner-task-description", children: [
|
|
5502
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: task.scheduling.message }),
|
|
5503
|
+
task.scheduling.taskIds?.length ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: task.scheduling.taskIds.map((id) => byId.get(id)?.title ?? "\u5DF2\u5220\u9664\u4EFB\u52A1").join("\u3001") }) : null,
|
|
5504
|
+
task.scheduling.retryAt ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("small", { children: [
|
|
5505
|
+
"\u4E0B\u6B21\u91CD\u8BD5\uFF1A",
|
|
5506
|
+
new Date(task.scheduling.retryAt).toLocaleString()
|
|
5507
|
+
] }) : null
|
|
5508
|
+
] }),
|
|
5509
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TaskContractPanel, { task, checks, setChecks, busy }),
|
|
5510
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-partner-task-fields", children: [
|
|
5511
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
|
|
5512
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u72B6\u6001" }),
|
|
5513
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("select", { value: task.status, disabled: busy, onChange: (event) => update({ status: event.target.value, ...event.target.value === "done" ? { checks } : {} }), children: COLUMNS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.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)) })
|
|
5336
5514
|
] }),
|
|
5337
|
-
/* @__PURE__ */ (0,
|
|
5338
|
-
/* @__PURE__ */ (0,
|
|
5339
|
-
/* @__PURE__ */ (0,
|
|
5340
|
-
/* @__PURE__ */ (0,
|
|
5341
|
-
directory.map((item) => /* @__PURE__ */ (0,
|
|
5515
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
|
|
5516
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
|
|
5517
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("select", { value: task.assigneeCompanionId ?? "", disabled: busy || task.status === "doing", onChange: (event) => update({ assigneeCompanionId: event.target.value }), children: [
|
|
5518
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
|
|
5519
|
+
directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("option", { value: item.id, children: [
|
|
5342
5520
|
"@",
|
|
5343
5521
|
item.name,
|
|
5344
5522
|
" \xB7 ",
|
|
@@ -5346,43 +5524,43 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
|
|
|
5346
5524
|
] }, item.id))
|
|
5347
5525
|
] })
|
|
5348
5526
|
] }),
|
|
5349
|
-
/* @__PURE__ */ (0,
|
|
5350
|
-
/* @__PURE__ */ (0,
|
|
5351
|
-
/* @__PURE__ */ (0,
|
|
5352
|
-
/* @__PURE__ */ (0,
|
|
5353
|
-
directory.map((item) => /* @__PURE__ */ (0,
|
|
5527
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
|
|
5528
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
|
|
5529
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("select", { value: task.reviewerCompanionId ?? "", disabled: busy, onChange: (event) => update({ reviewerCompanionId: event.target.value }), children: [
|
|
5530
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
|
|
5531
|
+
directory.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("option", { value: item.id, children: [
|
|
5354
5532
|
"@",
|
|
5355
5533
|
item.name
|
|
5356
5534
|
] }, item.id))
|
|
5357
5535
|
] })
|
|
5358
5536
|
] })
|
|
5359
5537
|
] }),
|
|
5360
|
-
executionState && /* @__PURE__ */ (0,
|
|
5361
|
-
/* @__PURE__ */ (0,
|
|
5362
|
-
/* @__PURE__ */ (0,
|
|
5363
|
-
/* @__PURE__ */ (0,
|
|
5364
|
-
/* @__PURE__ */ (0,
|
|
5538
|
+
executionState && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: "dsh-partner-task-execution", "data-state": execution?.status, children: [
|
|
5539
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", {}),
|
|
5540
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
|
|
5541
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: executionState.title }),
|
|
5542
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: executionState.detail })
|
|
5365
5543
|
] })
|
|
5366
5544
|
] }),
|
|
5367
|
-
/* @__PURE__ */ (0,
|
|
5368
|
-
/* @__PURE__ */ (0,
|
|
5369
|
-
/* @__PURE__ */ (0,
|
|
5370
|
-
/* @__PURE__ */ (0,
|
|
5545
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: "dsh-partner-task-dependency", children: [
|
|
5546
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("header", { children: [
|
|
5547
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: "\u524D\u7F6E\u4EFB\u52A1" }),
|
|
5548
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.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" })
|
|
5371
5549
|
] }),
|
|
5372
|
-
dependencies.length > 0 && /* @__PURE__ */ (0,
|
|
5373
|
-
/* @__PURE__ */ (0,
|
|
5374
|
-
/* @__PURE__ */ (0,
|
|
5375
|
-
/* @__PURE__ */ (0,
|
|
5550
|
+
dependencies.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: dependencies.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { "data-done": item.status === "done", children: [
|
|
5551
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", { children: item.status === "done" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives9.IconCheckOutline16, { size: 12 }) : "" }),
|
|
5552
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: item.title }),
|
|
5553
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.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" })
|
|
5376
5554
|
] }, item.id)) }),
|
|
5377
|
-
dependencyCandidates.length > 0 && /* @__PURE__ */ (0,
|
|
5378
|
-
/* @__PURE__ */ (0,
|
|
5379
|
-
/* @__PURE__ */ (0,
|
|
5555
|
+
dependencyCandidates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
|
|
5556
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1" }),
|
|
5557
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("select", { defaultValue: "", disabled: busy || ["doing", "review", "done"].includes(task.status), onChange: (event) => {
|
|
5380
5558
|
const id = event.currentTarget.value;
|
|
5381
5559
|
if (id) update({ dependencyTaskIds: [...task.dependencyTaskIds, id] });
|
|
5382
5560
|
event.currentTarget.value = "";
|
|
5383
5561
|
}, children: [
|
|
5384
|
-
/* @__PURE__ */ (0,
|
|
5385
|
-
dependencyCandidates.map((item) => /* @__PURE__ */ (0,
|
|
5562
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "", children: "\u589E\u52A0\u524D\u7F6E\u4EFB\u52A1\u2026" }),
|
|
5563
|
+
dependencyCandidates.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("option", { value: item.id, children: [
|
|
5386
5564
|
item.title,
|
|
5387
5565
|
" \xB7 ",
|
|
5388
5566
|
statusLabel(item.status)
|
|
@@ -5390,67 +5568,65 @@ function TaskDetail({ task, tasks, activities, directory, execution, busy, updat
|
|
|
5390
5568
|
] })
|
|
5391
5569
|
] })
|
|
5392
5570
|
] }),
|
|
5393
|
-
task.resultSummary && /* @__PURE__ */ (0,
|
|
5394
|
-
task.reviewSummary && /* @__PURE__ */ (0,
|
|
5395
|
-
recentActivities.length > 0 && /* @__PURE__ */ (0,
|
|
5396
|
-
/* @__PURE__ */ (0,
|
|
5571
|
+
task.resultSummary && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ResultBlock, { label: "\u6267\u884C\u7ED3\u679C", value: task.resultSummary }),
|
|
5572
|
+
task.reviewSummary && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ResultBlock, { label: `\u6838\u9A8C\u610F\u89C1${reviewer ? ` \xB7 @${reviewer.name}` : ""}`, value: task.reviewSummary }),
|
|
5573
|
+
recentActivities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("details", { className: "dsh-partner-task-activity dsh-partner-requirement-disclosure", children: [
|
|
5574
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("summary", { children: [
|
|
5397
5575
|
"\u6700\u8FD1\u6D3B\u52A8 \xB7 ",
|
|
5398
5576
|
recentActivities.length
|
|
5399
5577
|
] }),
|
|
5400
|
-
/* @__PURE__ */ (0,
|
|
5401
|
-
/* @__PURE__ */ (0,
|
|
5402
|
-
/* @__PURE__ */ (0,
|
|
5578
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ol", { children: recentActivities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("li", { children: [
|
|
5579
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: item.message }),
|
|
5580
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("time", { children: new Date(item.at).toLocaleString() })
|
|
5403
5581
|
] }, item.id)) })
|
|
5404
5582
|
] }),
|
|
5405
|
-
rejecting && /* @__PURE__ */ (0,
|
|
5583
|
+
rejecting && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("form", { className: "dsh-partner-task-reject", onSubmit: (event) => {
|
|
5406
5584
|
event.preventDefault();
|
|
5407
5585
|
const reason = rejectReason.trim();
|
|
5408
5586
|
if (!reason) return;
|
|
5409
|
-
reject(reason);
|
|
5410
|
-
setRejecting(false);
|
|
5411
|
-
setRejectReason("");
|
|
5587
|
+
reject(reason, checks);
|
|
5412
5588
|
}, children: [
|
|
5413
|
-
/* @__PURE__ */ (0,
|
|
5414
|
-
/* @__PURE__ */ (0,
|
|
5415
|
-
/* @__PURE__ */ (0,
|
|
5589
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
|
|
5590
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u6253\u56DE\u539F\u56E0" }),
|
|
5591
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.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" })
|
|
5416
5592
|
] }),
|
|
5417
|
-
/* @__PURE__ */ (0,
|
|
5418
|
-
/* @__PURE__ */ (0,
|
|
5593
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
5594
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: () => {
|
|
5419
5595
|
setRejecting(false);
|
|
5420
5596
|
setRejectReason("");
|
|
5421
5597
|
}, children: "\u53D6\u6D88" }),
|
|
5422
|
-
/* @__PURE__ */ (0,
|
|
5598
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !rejectReason.trim(), children: "\u786E\u8BA4\u6253\u56DE" })
|
|
5423
5599
|
] })
|
|
5424
5600
|
] }),
|
|
5425
|
-
confirmingDelete && /* @__PURE__ */ (0,
|
|
5426
|
-
/* @__PURE__ */ (0,
|
|
5427
|
-
/* @__PURE__ */ (0,
|
|
5428
|
-
/* @__PURE__ */ (0,
|
|
5429
|
-
/* @__PURE__ */ (0,
|
|
5601
|
+
confirmingDelete && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-partner-task-delete-confirm", role: "alert", children: [
|
|
5602
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u5220\u9664\u4F1A\u53D6\u6D88\u5173\u8054\u6267\u884C\uFF0C\u4F9D\u8D56\u5B83\u7684\u672A\u5B8C\u6210\u4EFB\u52A1\u5C06\u6682\u505C\u3002\u9700\u6C42\u9700\u91CD\u65B0\u786E\u8BA4\u8303\u56F4\uFF1B\u4E0D\u80FD\u64A4\u9500\u3002" }),
|
|
5603
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
5604
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", onClick: () => setConfirmingDelete(false), children: "\u4FDD\u7559\u4EFB\u52A1" }),
|
|
5605
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
|
|
5430
5606
|
] })
|
|
5431
5607
|
] }),
|
|
5432
|
-
/* @__PURE__ */ (0,
|
|
5433
|
-
/* @__PURE__ */ (0,
|
|
5608
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("footer", { className: "dsh-partner-task-actions", children: [
|
|
5609
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("small", { children: [
|
|
5434
5610
|
"r",
|
|
5435
5611
|
task.revision,
|
|
5436
5612
|
" \xB7 ",
|
|
5437
5613
|
new Date(task.updatedAt).toLocaleString()
|
|
5438
5614
|
] }),
|
|
5439
|
-
/* @__PURE__ */ (0,
|
|
5440
|
-
task.status === "review" ? /* @__PURE__ */ (0,
|
|
5441
|
-
task.reviewerCompanionId && /* @__PURE__ */ (0,
|
|
5442
|
-
/* @__PURE__ */ (0,
|
|
5443
|
-
/* @__PURE__ */ (0,
|
|
5444
|
-
] }) : /* @__PURE__ */ (0,
|
|
5445
|
-
/* @__PURE__ */ (0,
|
|
5615
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
|
|
5616
|
+
task.status === "review" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
5617
|
+
task.reviewerCompanionId && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", disabled: busy, onClick: review, children: busy ? "\u6838\u9A8C\u4E2D\u2026" : `\u4EA4\u7ED9 @${reviewer?.name ?? "\u4F19\u4F34"} \u6838\u9A8C` }),
|
|
5618
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", disabled: busy, onClick: () => setRejecting(true), children: "\u6253\u56DE\u91CD\u505A" }),
|
|
5619
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: "is-primary", disabled: busy || Boolean(task.acceptanceCriteria?.length && (checks.length !== task.acceptanceCriteria.length || checks.some((c) => c.verdict !== "passed" || !c.evidence?.trim()))), onClick: () => accept(checks), children: "\u9A8C\u6536\u901A\u8FC7" })
|
|
5620
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", disabled: busy || !canExecute, title: blockers.length ? "\u53EF\u63D0\u524D\u6392\u961F\uFF0C\u4F9D\u8D56\u901A\u8FC7\u9A8C\u6536\u540E\u81EA\u52A8\u6267\u884C" : !task.assigneeCompanionId ? "\u8BF7\u5148\u9009\u62E9\u8D1F\u8D23\u4EBA" : void 0, onClick: delegate, children: busy ? "\u6267\u884C\u4E2D\u2026" : execution?.status === "queued" ? "\u5DF2\u63D0\u4EA4\uFF0C\u7B49\u5F85\u6267\u884C" : task.status === "doing" ? "\u6B63\u5728\u6267\u884C" : task.status === "done" ? "\u5DF2\u7ECF\u5B8C\u6210" : `\u4EA4\u7ED9 @${assignee?.name ?? "\u4F19\u4F34"}` }),
|
|
5621
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.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_runtime13.jsx)(import_dsh_client_ui_primitives9.IconTrashOutline16, { size: 14 }) })
|
|
5446
5622
|
] })
|
|
5447
5623
|
] })
|
|
5448
5624
|
] });
|
|
5449
5625
|
}
|
|
5450
5626
|
function ResultBlock({ label, value }) {
|
|
5451
|
-
return /* @__PURE__ */ (0,
|
|
5452
|
-
/* @__PURE__ */ (0,
|
|
5453
|
-
/* @__PURE__ */ (0,
|
|
5627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: "dsh-partner-task-result", children: [
|
|
5628
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: label }),
|
|
5629
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: value })
|
|
5454
5630
|
] });
|
|
5455
5631
|
}
|
|
5456
5632
|
function TaskForm({ requirementId, companions, tasks, close, changed: changed2 }) {
|
|
@@ -5471,7 +5647,9 @@ function TaskForm({ requirementId, companions, tasks, close, changed: changed2 }
|
|
|
5471
5647
|
autoRun: data.get("submission") === "run" && Boolean(data.get("assignee")),
|
|
5472
5648
|
assigneeCompanionId: data.get("assignee") || void 0,
|
|
5473
5649
|
reviewerCompanionId: data.get("reviewer") || void 0,
|
|
5474
|
-
dependencyTaskIds: data.getAll("dependencyTaskId")
|
|
5650
|
+
dependencyTaskIds: data.getAll("dependencyTaskId"),
|
|
5651
|
+
acceptanceCriteria: String(data.get("acceptanceCriteria") ?? "").split("\n").map((s) => s.trim()).filter(Boolean),
|
|
5652
|
+
resourceKeys: String(data.get("resourceKeys") ?? "").split("\n").map((s) => s.trim()).filter(Boolean)
|
|
5475
5653
|
}) });
|
|
5476
5654
|
await changed2();
|
|
5477
5655
|
close();
|
|
@@ -5481,71 +5659,79 @@ function TaskForm({ requirementId, companions, tasks, close, changed: changed2 }
|
|
|
5481
5659
|
setBusy(false);
|
|
5482
5660
|
}
|
|
5483
5661
|
};
|
|
5484
|
-
return /* @__PURE__ */ (0,
|
|
5662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("form", { className: "dsh-partner-task-form", "aria-busy": busy, onSubmit: (event) => {
|
|
5485
5663
|
void submit(event);
|
|
5486
5664
|
}, children: [
|
|
5487
|
-
/* @__PURE__ */ (0,
|
|
5488
|
-
/* @__PURE__ */ (0,
|
|
5489
|
-
/* @__PURE__ */ (0,
|
|
5665
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
|
|
5666
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u4EFB\u52A1\u540D\u79F0" }),
|
|
5667
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { name: "title", maxLength: 200, required: true, autoFocus: true, placeholder: "\u4E00\u53E5\u8BDD\u8BF4\u660E\u4EA4\u4ED8\u76EE\u6807" })
|
|
5490
5668
|
] }),
|
|
5491
|
-
/* @__PURE__ */ (0,
|
|
5492
|
-
/* @__PURE__ */ (0,
|
|
5493
|
-
/* @__PURE__ */ (0,
|
|
5494
|
-
/* @__PURE__ */ (0,
|
|
5495
|
-
companions.map((item) => /* @__PURE__ */ (0,
|
|
5669
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
|
|
5670
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u8D1F\u8D23\u4EBA" }),
|
|
5671
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("select", { name: "assignee", defaultValue: "", children: [
|
|
5672
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "", children: "\u672A\u6307\u6D3E" }),
|
|
5673
|
+
companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("option", { value: item.id, children: [
|
|
5496
5674
|
"@",
|
|
5497
5675
|
item.name
|
|
5498
5676
|
] }, item.id))
|
|
5499
5677
|
] })
|
|
5500
5678
|
] }),
|
|
5501
|
-
/* @__PURE__ */ (0,
|
|
5502
|
-
/* @__PURE__ */ (0,
|
|
5503
|
-
/* @__PURE__ */ (0,
|
|
5679
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "is-wide", children: [
|
|
5680
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u4EFB\u52A1\u8BF4\u660E" }),
|
|
5681
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("textarea", { name: "description", maxLength: 8e3, rows: 5, placeholder: "\u8865\u5145\u80CC\u666F\u3001\u4EA4\u4ED8\u7269\u548C\u5B8C\u6210\u6761\u4EF6" })
|
|
5682
|
+
] }),
|
|
5683
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "is-wide", children: [
|
|
5684
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u9A8C\u6536\u6E05\u5355 \xB7 \u53EF\u9009" }),
|
|
5685
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("textarea", { name: "acceptanceCriteria", rows: 3, maxLength: 1e4, placeholder: "\u6BCF\u884C\u4E00\u9879\u53EF\u6838\u9A8C\u4EA4\u4ED8\uFF0C\u6700\u591A 20 \u9879" })
|
|
5504
5686
|
] }),
|
|
5505
|
-
/* @__PURE__ */ (0,
|
|
5506
|
-
/* @__PURE__ */ (0,
|
|
5507
|
-
/* @__PURE__ */ (0,
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5687
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "is-wide", children: [
|
|
5688
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u72EC\u5360\u8D44\u6E90 \xB7 \u53EF\u9009" }),
|
|
5689
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("textarea", { name: "resourceKeys", rows: 2, maxLength: 2400, placeholder: "\u6BCF\u884C\u4E00\u4E2A\u4E00\u81F4\u7684\u8D44\u6E90\u6807\u8BC6\uFF0C\u4F8B\u5982 repo:team/api\uFF1B\u76F8\u540C\u8D44\u6E90\u4E0D\u4F1A\u540C\u65F6\u6267\u884C" })
|
|
5690
|
+
] }),
|
|
5691
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
|
|
5692
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u4F18\u5148\u7EA7" }),
|
|
5693
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("select", { name: "priority", defaultValue: "normal", children: [
|
|
5694
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "low", children: "\u4F4E" }),
|
|
5695
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "normal", children: "\u666E\u901A" }),
|
|
5696
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "high", children: "\u9AD8" }),
|
|
5697
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "urgent", children: "\u7D27\u6025" })
|
|
5512
5698
|
] })
|
|
5513
5699
|
] }),
|
|
5514
|
-
/* @__PURE__ */ (0,
|
|
5515
|
-
/* @__PURE__ */ (0,
|
|
5516
|
-
/* @__PURE__ */ (0,
|
|
5517
|
-
/* @__PURE__ */ (0,
|
|
5518
|
-
companions.map((item) => /* @__PURE__ */ (0,
|
|
5700
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
|
|
5701
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u9A8C\u6536\u4F19\u4F34" }),
|
|
5702
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("select", { name: "reviewer", defaultValue: "", children: [
|
|
5703
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "", children: "\u7559\u7A7A \xB7 \u4EBA\u5DE5\u9A8C\u6536" }),
|
|
5704
|
+
companions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("option", { value: item.id, children: [
|
|
5519
5705
|
"@",
|
|
5520
5706
|
item.name
|
|
5521
5707
|
] }, item.id))
|
|
5522
5708
|
] })
|
|
5523
5709
|
] }),
|
|
5524
|
-
/* @__PURE__ */ (0,
|
|
5525
|
-
/* @__PURE__ */ (0,
|
|
5710
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsh-partner-task-form-dependencies is-wide", children: [
|
|
5711
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
|
|
5526
5712
|
"\u4F9D\u8D56\u4EFB\u52A1 ",
|
|
5527
|
-
/* @__PURE__ */ (0,
|
|
5713
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: "\u53EF\u9009" })
|
|
5528
5714
|
] }),
|
|
5529
|
-
dependencyOptions.length > 0 ? /* @__PURE__ */ (0,
|
|
5530
|
-
/* @__PURE__ */ (0,
|
|
5531
|
-
/* @__PURE__ */ (0,
|
|
5532
|
-
/* @__PURE__ */ (0,
|
|
5533
|
-
/* @__PURE__ */ (0,
|
|
5534
|
-
] }, item.id)) }) : /* @__PURE__ */ (0,
|
|
5535
|
-
/* @__PURE__ */ (0,
|
|
5715
|
+
dependencyOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: dependencyOptions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
|
|
5716
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { type: "checkbox", name: "dependencyTaskId", value: item.id }),
|
|
5717
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", {}),
|
|
5718
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: item.title }),
|
|
5719
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: statusLabel(item.status) })
|
|
5720
|
+
] }, item.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: "\u5F53\u524D\u6CA1\u6709\u53EF\u9009\u7684\u672A\u5B8C\u6210\u4EFB\u52A1" }),
|
|
5721
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.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" })
|
|
5536
5722
|
] }),
|
|
5537
|
-
/* @__PURE__ */ (0,
|
|
5538
|
-
/* @__PURE__ */ (0,
|
|
5539
|
-
/* @__PURE__ */ (0,
|
|
5540
|
-
/* @__PURE__ */ (0,
|
|
5541
|
-
/* @__PURE__ */ (0,
|
|
5723
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { className: "is-wide", children: [
|
|
5724
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u521B\u5EFA\u540E\u6267\u884C" }),
|
|
5725
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("select", { name: "submission", defaultValue: "run", children: [
|
|
5726
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "run", children: "\u5DF2\u6307\u5B9A\u8D1F\u8D23\u4EBA\u5219\u81EA\u52A8\u6392\u961F\uFF0C\u7B49\u5F85\u4F9D\u8D56\u5B8C\u6210\u540E\u6267\u884C" }),
|
|
5727
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "plan", children: "\u4EC5\u89C4\u5212\uFF0C\u7A0D\u540E\u624B\u52A8\u63D0\u4EA4" })
|
|
5542
5728
|
] })
|
|
5543
5729
|
] }),
|
|
5544
|
-
error && /* @__PURE__ */ (0,
|
|
5545
|
-
/* @__PURE__ */ (0,
|
|
5546
|
-
/* @__PURE__ */ (0,
|
|
5547
|
-
/* @__PURE__ */ (0,
|
|
5548
|
-
/* @__PURE__ */ (0,
|
|
5730
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WorkspaceNotice, { children: error }),
|
|
5731
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("footer", { children: [
|
|
5732
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
5733
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
|
|
5734
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives9.IconPlusOutline16, { size: 14 }),
|
|
5549
5735
|
busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u4EFB\u52A1"
|
|
5550
5736
|
] })
|
|
5551
5737
|
] })
|
|
@@ -5583,7 +5769,7 @@ function delegationState(value, blockers = 0) {
|
|
|
5583
5769
|
}
|
|
5584
5770
|
|
|
5585
5771
|
// src/ui/requirement-board.tsx
|
|
5586
|
-
var
|
|
5772
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
5587
5773
|
function RequirementBoard({ initialTaskId, openRequest } = {}) {
|
|
5588
5774
|
const [board, setBoard] = (0, import_react18.useState)({ tasks: [], activities: [], requirements: [] });
|
|
5589
5775
|
const [directory, setDirectory] = (0, import_react18.useState)([]);
|
|
@@ -5624,102 +5810,102 @@ function RequirementBoard({ initialTaskId, openRequest } = {}) {
|
|
|
5624
5810
|
}, [board.tasks]);
|
|
5625
5811
|
const visible = requirements.filter((r) => r.status === "done" === archived && [r.title, r.description, directory.find((c) => c.id === r.ownerCompanionId)?.name].some((v) => v?.toLocaleLowerCase().includes(query.trim().toLocaleLowerCase()))).sort((a, b) => b.updatedAt - a.updatedAt);
|
|
5626
5812
|
const detail = requirements.find((r) => r.id === detailId);
|
|
5627
|
-
if (selected) return /* @__PURE__ */ (0,
|
|
5813
|
+
if (selected) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RequirementTasksPanel, { requirementId: selected, back: () => {
|
|
5628
5814
|
setSelected(void 0);
|
|
5629
5815
|
void load2();
|
|
5630
5816
|
} }, selected);
|
|
5631
|
-
return /* @__PURE__ */ (0,
|
|
5632
|
-
/* @__PURE__ */ (0,
|
|
5633
|
-
/* @__PURE__ */ (0,
|
|
5817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-feature-page is-board", children: [
|
|
5818
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WorkspaceHero, { eyebrow: "Shared workspace", title: "\u9700\u6C42\u770B\u677F", detail: "\u6309\u9700\u6C42\u7EC4\u7EC7\u5DE5\u4F5C\uFF0C\u5B50\u4EFB\u52A1\u72EC\u7ACB\u63A8\u8FDB\uFF0C\u6574\u4F53\u5B8C\u6210\u540E\u7EDF\u4E00\u6C47\u603B\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", onClick: () => setCreating(true), children: [
|
|
5819
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives10.IconPlusOutline16, { size: 15 }),
|
|
5634
5820
|
"\u65B0\u9700\u6C42"
|
|
5635
5821
|
] }) }),
|
|
5636
|
-
error && /* @__PURE__ */ (0,
|
|
5822
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(WorkspaceNotice, { children: [
|
|
5637
5823
|
error,
|
|
5638
|
-
/* @__PURE__ */ (0,
|
|
5824
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => {
|
|
5639
5825
|
void load2();
|
|
5640
5826
|
}, children: "\u91CD\u8BD5" })
|
|
5641
5827
|
] }),
|
|
5642
|
-
/* @__PURE__ */ (0,
|
|
5643
|
-
/* @__PURE__ */ (0,
|
|
5828
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-requirement-toolbar", children: [
|
|
5829
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("nav", { className: "dsh-partner-board-statuses", "aria-label": "\u9700\u6C42\u8303\u56F4", children: [false, true].map((value) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", "aria-pressed": archived === value, className: archived === value ? "is-active" : "", onClick: () => {
|
|
5644
5830
|
setArchived(value);
|
|
5645
5831
|
setLimit(24);
|
|
5646
5832
|
}, children: [
|
|
5647
5833
|
value ? "\u5DF2\u5F52\u6863" : "\u8FDB\u884C\u4E2D",
|
|
5648
|
-
/* @__PURE__ */ (0,
|
|
5834
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: requirements.filter((r) => r.status === "done" === value).length })
|
|
5649
5835
|
] }, String(value))) }),
|
|
5650
|
-
/* @__PURE__ */ (0,
|
|
5651
|
-
/* @__PURE__ */ (0,
|
|
5652
|
-
/* @__PURE__ */ (0,
|
|
5653
|
-
/* @__PURE__ */ (0,
|
|
5836
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "dsh-partner-board-search", children: [
|
|
5837
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u9700\u6C42" }),
|
|
5838
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives10.IconSearchOutline16, { size: 16 }) }),
|
|
5839
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { placeholder: "\u641C\u7D22\u9700\u6C42\u6216\u8D1F\u8D23\u4EBA", value: query, onChange: (event) => {
|
|
5654
5840
|
setQuery(event.target.value);
|
|
5655
5841
|
setLimit(24);
|
|
5656
5842
|
} })
|
|
5657
5843
|
] })
|
|
5658
5844
|
] }),
|
|
5659
|
-
loading ? /* @__PURE__ */ (0,
|
|
5660
|
-
/* @__PURE__ */ (0,
|
|
5845
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CollectionSkeleton, { rows: 4 }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
5846
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsh-partner-requirement-grid", children: visible.slice(0, limit).map((item) => {
|
|
5661
5847
|
const tasks = groups.get(item.id) ?? [], total = item.status === "done" ? item.results?.length ?? tasks.length : tasks.length;
|
|
5662
5848
|
const done = item.status === "done" ? total : tasks.filter((t) => t.status === "done").length;
|
|
5663
5849
|
const blocked = tasks.filter((t) => t.status === "blocked").length;
|
|
5664
|
-
return /* @__PURE__ */ (0,
|
|
5665
|
-
/* @__PURE__ */ (0,
|
|
5666
|
-
/* @__PURE__ */ (0,
|
|
5667
|
-
/* @__PURE__ */ (0,
|
|
5668
|
-
/* @__PURE__ */ (0,
|
|
5850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { className: "dsh-partner-requirement-card", children: [
|
|
5851
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "dsh-partner-requirement-open", onClick: () => item.status === "done" ? setDetailId(item.id) : setSelected(item.id), children: [
|
|
5852
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "dsh-partner-requirement-meta", children: [
|
|
5853
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: requirementStatus(item) }),
|
|
5854
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: directory.find((c) => c.id === item.ownerCompanionId)?.name ?? "\u4EBA\u5DE5\u6536\u5C3E" })
|
|
5669
5855
|
] }),
|
|
5670
|
-
/* @__PURE__ */ (0,
|
|
5671
|
-
/* @__PURE__ */ (0,
|
|
5672
|
-
/* @__PURE__ */ (0,
|
|
5673
|
-
/* @__PURE__ */ (0,
|
|
5674
|
-
/* @__PURE__ */ (0,
|
|
5856
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { title: item.title, children: item.title }),
|
|
5857
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: item.summary || item.description || "\u5C1A\u672A\u8865\u5145\u9700\u6C42\u8BF4\u660E" }),
|
|
5858
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "dsh-partner-requirement-progress", role: "progressbar", "aria-label": "\u5B50\u4EFB\u52A1\u9A8C\u6536\u8FDB\u5EA6", "aria-valuemin": 0, "aria-valuemax": Math.max(total, 1), "aria-valuenow": done, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("i", { style: { width: `${total ? done / total * 100 : 0}%` } }) }),
|
|
5859
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "dsh-partner-requirement-meta", children: [
|
|
5860
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
|
|
5675
5861
|
done,
|
|
5676
5862
|
" / ",
|
|
5677
5863
|
total,
|
|
5678
5864
|
" \u5DF2\u9A8C\u6536",
|
|
5679
5865
|
blocked ? ` \xB7 ${blocked} \u53D7\u963B` : ""
|
|
5680
5866
|
] }),
|
|
5681
|
-
/* @__PURE__ */ (0,
|
|
5867
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives10.IconChevronRightOutline14, { size: 14 })
|
|
5682
5868
|
] })
|
|
5683
5869
|
] }),
|
|
5684
|
-
/* @__PURE__ */ (0,
|
|
5685
|
-
/* @__PURE__ */ (0,
|
|
5870
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("footer", { children: [
|
|
5871
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
|
|
5686
5872
|
new Date(item.updatedAt).toLocaleDateString(),
|
|
5687
5873
|
" \u66F4\u65B0"
|
|
5688
5874
|
] }),
|
|
5689
|
-
/* @__PURE__ */ (0,
|
|
5875
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: () => setDetailId(item.id), "aria-haspopup": "dialog", children: item.lastError ? "\u67E5\u770B\u5F02\u5E38" : "\u9700\u6C42\u8BE6\u60C5" })
|
|
5690
5876
|
] })
|
|
5691
5877
|
] }, item.id);
|
|
5692
5878
|
}) }),
|
|
5693
|
-
!visible.length && /* @__PURE__ */ (0,
|
|
5694
|
-
/* @__PURE__ */ (0,
|
|
5695
|
-
/* @__PURE__ */ (0,
|
|
5879
|
+
!visible.length && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-collection-empty", children: [
|
|
5880
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: query ? "\u6CA1\u6709\u5339\u914D\u7684\u9700\u6C42" : archived ? "\u8FD8\u6CA1\u6709\u5F52\u6863\u9700\u6C42" : "\u4ECE\u4E00\u4E2A\u9700\u6C42\u5F00\u59CB" }),
|
|
5881
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: archived ? "\u5B50\u4EFB\u52A1\u5168\u90E8\u9A8C\u6536\u901A\u8FC7\u3001\u5B8C\u6210\u603B\u7ED3\u540E\uFF0C\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\u3002" : "\u5148\u5199\u6E05\u4EA4\u4ED8\u76EE\u6807\uFF0C\u518D\u5B89\u6392\u8D1F\u8D23\u4EBA\u548C\u5B50\u4EFB\u52A1\u3002" })
|
|
5696
5882
|
] }),
|
|
5697
|
-
visible.length > limit && /* @__PURE__ */ (0,
|
|
5883
|
+
visible.length > limit && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", onClick: () => setLimit((n) => n + 24), children: [
|
|
5698
5884
|
"\u663E\u793A\u66F4\u591A\u9700\u6C42 \xB7 \u8FD8\u6709 ",
|
|
5699
5885
|
visible.length - limit,
|
|
5700
5886
|
" \u9879"
|
|
5701
5887
|
] }),
|
|
5702
|
-
!archived && Boolean(groups.get("legacy")?.length) && /* @__PURE__ */ (0,
|
|
5888
|
+
!archived && Boolean(groups.get("legacy")?.length) && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "dsh-partner-requirement-legacy", onClick: () => setSelected("legacy"), children: [
|
|
5703
5889
|
"\u672A\u5F52\u7C7B\u65E7\u4EFB\u52A1 ",
|
|
5704
|
-
/* @__PURE__ */ (0,
|
|
5705
|
-
/* @__PURE__ */ (0,
|
|
5706
|
-
/* @__PURE__ */ (0,
|
|
5890
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: groups.get("legacy").length }),
|
|
5891
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u4FDD\u7559\u539F\u8BB0\u5F55\uFF0C\u4E0D\u81EA\u52A8\u5408\u5E76" }),
|
|
5892
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives10.IconChevronRightOutline14, { size: 14 })
|
|
5707
5893
|
] })
|
|
5708
5894
|
] }),
|
|
5709
|
-
creating && /* @__PURE__ */ (0,
|
|
5895
|
+
creating && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u9700\u6C42", detail: "\u4E00\u4E2A\u9700\u6C42\u5BF9\u5E94\u4E00\u4EFD\u6700\u7EC8\u4EA4\u4ED8\uFF0C\u7531\u8D1F\u8D23\u4EBA\u7EDF\u4E00\u6536\u5C3E\u3002", close: () => setCreating(false), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RequirementForm, { directory, close: () => setCreating(false), created: async (item) => {
|
|
5710
5896
|
setCreating(false);
|
|
5711
5897
|
await load2();
|
|
5712
5898
|
setSelected(item.id);
|
|
5713
5899
|
} }) }),
|
|
5714
|
-
detail && /* @__PURE__ */ (0,
|
|
5715
|
-
initialTaskId && /* @__PURE__ */ (0,
|
|
5900
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(WorkspaceDialog, { title: detail.title, eyebrow: "\u9700\u6C42\u8BE6\u60C5", detail: requirementStatus(detail), close: () => setDetailId(void 0), width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RequirementDetail, { item: detail, tasks: groups.get(detail.id) ?? [], directory, changed: load2, close: () => setDetailId(void 0) }, detail.id) }),
|
|
5901
|
+
initialTaskId && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RequirementTasksPanel, { initialTaskId, openRequest, detailOnly: true })
|
|
5716
5902
|
] });
|
|
5717
5903
|
}
|
|
5718
5904
|
|
|
5719
5905
|
// src/ui/schedule-panel.tsx
|
|
5720
5906
|
var import_react19 = require("react");
|
|
5721
5907
|
var import_dsh_client_ui_primitives11 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5722
|
-
var
|
|
5908
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
5723
5909
|
function SchedulePanel({ companions }) {
|
|
5724
5910
|
const [schedules, setSchedules] = (0, import_react19.useState)([]);
|
|
5725
5911
|
const [runs, setRuns] = (0, import_react19.useState)([]);
|
|
@@ -5775,65 +5961,65 @@ function SchedulePanel({ companions }) {
|
|
|
5775
5961
|
setBusy(void 0);
|
|
5776
5962
|
}
|
|
5777
5963
|
};
|
|
5778
|
-
return /* @__PURE__ */ (0,
|
|
5779
|
-
/* @__PURE__ */ (0,
|
|
5780
|
-
/* @__PURE__ */ (0,
|
|
5964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-feature-page", children: [
|
|
5965
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.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_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
5966
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", disabled: loading, onClick: () => {
|
|
5781
5967
|
void load2();
|
|
5782
5968
|
}, children: [
|
|
5783
|
-
/* @__PURE__ */ (0,
|
|
5969
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives11.IconRefreshOutline16, { size: 15 }),
|
|
5784
5970
|
"\u5237\u65B0"
|
|
5785
5971
|
] }),
|
|
5786
|
-
/* @__PURE__ */ (0,
|
|
5787
|
-
/* @__PURE__ */ (0,
|
|
5972
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
|
|
5973
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives11.IconPlusOutline16, { size: 15 }),
|
|
5788
5974
|
"\u65B0\u8BA1\u5212"
|
|
5789
5975
|
] })
|
|
5790
5976
|
] }) }),
|
|
5791
|
-
error && /* @__PURE__ */ (0,
|
|
5792
|
-
creating && /* @__PURE__ */ (0,
|
|
5793
|
-
/* @__PURE__ */ (0,
|
|
5794
|
-
/* @__PURE__ */ (0,
|
|
5977
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WorkspaceNotice, { children: error }),
|
|
5978
|
+
creating && /* @__PURE__ */ (0, import_jsx_runtime15.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_runtime15.jsx)(ScheduleForm, { companions, close: () => setCreating(false), changed: load2 }) }),
|
|
5979
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WorkspaceBlock, { title: "\u6267\u884C\u8BA1\u5212", detail: `${schedules.filter((item) => item.enabled).length} \u4E2A\u542F\u7528`, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CollectionSkeleton, { rows: 3 }) : schedules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.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_runtime15.jsxs)("button", { type: "button", disabled: companions.length === 0, onClick: () => setCreating(true), children: [
|
|
5980
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives11.IconPlusOutline16, { size: 14 }),
|
|
5795
5981
|
"\u521B\u5EFA\u7B2C\u4E00\u4E2A\u8BA1\u5212"
|
|
5796
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
5797
|
-
/* @__PURE__ */ (0,
|
|
5798
|
-
/* @__PURE__ */ (0,
|
|
5799
|
-
/* @__PURE__ */ (0,
|
|
5800
|
-
/* @__PURE__ */ (0,
|
|
5801
|
-
/* @__PURE__ */ (0,
|
|
5982
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-schedule-list", children: schedules.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { children: [
|
|
5983
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
|
|
5984
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: entry.title }),
|
|
5985
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: entry.prompt }),
|
|
5986
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { className: "dsh-partner-schedule-meta", children: [
|
|
5987
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("em", { children: [
|
|
5802
5988
|
"@",
|
|
5803
5989
|
companionName(companions, entry.companionId)
|
|
5804
5990
|
] }),
|
|
5805
|
-
/* @__PURE__ */ (0,
|
|
5806
|
-
/* @__PURE__ */ (0,
|
|
5991
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("em", { children: scheduleLabel(entry) }),
|
|
5992
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("em", { children: [
|
|
5807
5993
|
"\u4E0B\u6B21 ",
|
|
5808
5994
|
new Date(entry.nextRunAt).toLocaleString()
|
|
5809
5995
|
] }),
|
|
5810
|
-
/* @__PURE__ */ (0,
|
|
5996
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("em", { children: entry.destroySessionAfterRun ? "\u6267\u884C\u540E\u9500\u6BC1" : "\u4FDD\u7559\u4F1A\u8BDD" })
|
|
5811
5997
|
] })
|
|
5812
5998
|
] }),
|
|
5813
|
-
/* @__PURE__ */ (0,
|
|
5999
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "dsh-partner-feature-switch", "data-on": entry.enabled, "aria-pressed": entry.enabled, disabled: busy === entry.id, onClick: () => {
|
|
5814
6000
|
void update(entry, { enabled: !entry.enabled });
|
|
5815
|
-
}, children: /* @__PURE__ */ (0,
|
|
5816
|
-
/* @__PURE__ */ (0,
|
|
6001
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}) }),
|
|
6002
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "button", disabled: busy === entry.id, onClick: () => {
|
|
5817
6003
|
void run(entry);
|
|
5818
6004
|
}, children: [
|
|
5819
|
-
/* @__PURE__ */ (0,
|
|
6005
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives11.IconPlayOutline16, { size: 14 }),
|
|
5820
6006
|
busy === entry.id ? "\u6267\u884C\u4E2D\u2026" : "\u7ACB\u5373\u6267\u884C"
|
|
5821
6007
|
] }),
|
|
5822
|
-
/* @__PURE__ */ (0,
|
|
6008
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", className: "is-icon", disabled: busy === entry.id, onClick: () => {
|
|
5823
6009
|
void remove(entry);
|
|
5824
|
-
}, "aria-label": `\u5220\u9664 ${entry.title}`, children: /* @__PURE__ */ (0,
|
|
6010
|
+
}, "aria-label": `\u5220\u9664 ${entry.title}`, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives11.IconTrashOutline16, { size: 14 }) })
|
|
5825
6011
|
] }, entry.id)) }) }),
|
|
5826
|
-
/* @__PURE__ */ (0,
|
|
5827
|
-
/* @__PURE__ */ (0,
|
|
5828
|
-
/* @__PURE__ */ (0,
|
|
5829
|
-
/* @__PURE__ */ (0,
|
|
5830
|
-
/* @__PURE__ */ (0,
|
|
6012
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(WorkspaceBlock, { title: "\u6700\u8FD1\u8FD0\u884C", detail: "\u4FDD\u7559\u6700\u8FD1\u7684\u72B6\u6001\u4E0E\u7ED3\u679C\u6458\u8981", children: [
|
|
6013
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "dsh-partner-run-list", children: runs.map((run2) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("article", { "data-status": run2.status, children: [
|
|
6014
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
|
|
6015
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
|
|
6016
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("strong", { children: [
|
|
5831
6017
|
schedules.find((item) => item.id === run2.sourceId)?.title ?? "\u5DF2\u5220\u9664\u8BA1\u5212",
|
|
5832
6018
|
" \xB7 @",
|
|
5833
6019
|
companionName(companions, run2.ownerCompanionId)
|
|
5834
6020
|
] }),
|
|
5835
|
-
/* @__PURE__ */ (0,
|
|
5836
|
-
/* @__PURE__ */ (0,
|
|
6021
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: run2.error || run2.outputSummary || "\u7B49\u5F85\u7ED3\u679C" }),
|
|
6022
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("small", { children: [
|
|
5837
6023
|
new Date(run2.startedAt).toLocaleString(),
|
|
5838
6024
|
" \xB7 ",
|
|
5839
6025
|
run2.status,
|
|
@@ -5842,7 +6028,7 @@ function SchedulePanel({ companions }) {
|
|
|
5842
6028
|
] })
|
|
5843
6029
|
] })
|
|
5844
6030
|
] }, run2.id)) }),
|
|
5845
|
-
!loading && runs.length === 0 && /* @__PURE__ */ (0,
|
|
6031
|
+
!loading && runs.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime15.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" })
|
|
5846
6032
|
] })
|
|
5847
6033
|
] });
|
|
5848
6034
|
}
|
|
@@ -5866,18 +6052,18 @@ function ScheduleForm({ companions, close, changed: changed2 }) {
|
|
|
5866
6052
|
setBusy(false);
|
|
5867
6053
|
}
|
|
5868
6054
|
};
|
|
5869
|
-
return /* @__PURE__ */ (0,
|
|
6055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("form", { className: "dsh-partner-schedule-form", "aria-busy": busy, onSubmit: (event) => {
|
|
5870
6056
|
void submit(event);
|
|
5871
6057
|
}, children: [
|
|
5872
|
-
/* @__PURE__ */ (0,
|
|
5873
|
-
/* @__PURE__ */ (0,
|
|
5874
|
-
/* @__PURE__ */ (0,
|
|
6058
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { children: [
|
|
6059
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u8BA1\u5212\u540D\u79F0" }),
|
|
6060
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { name: "title", required: true, maxLength: 160, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u6BCF\u65E5\u6574\u7406\u9879\u76EE\u53D8\u5316" })
|
|
5875
6061
|
] }),
|
|
5876
|
-
/* @__PURE__ */ (0,
|
|
5877
|
-
/* @__PURE__ */ (0,
|
|
5878
|
-
/* @__PURE__ */ (0,
|
|
5879
|
-
/* @__PURE__ */ (0,
|
|
5880
|
-
companions.map((companion) => /* @__PURE__ */ (0,
|
|
6062
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { children: [
|
|
6063
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u6267\u884C\u4F19\u4F34" }),
|
|
6064
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { name: "companionId", required: true, defaultValue: companions[0]?.id ?? "", children: [
|
|
6065
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "", disabled: true, children: "\u9009\u62E9\u4F19\u4F34" }),
|
|
6066
|
+
companions.map((companion) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("option", { value: companion.id, children: [
|
|
5881
6067
|
"@",
|
|
5882
6068
|
companion.name,
|
|
5883
6069
|
" \xB7 ",
|
|
@@ -5885,51 +6071,51 @@ function ScheduleForm({ companions, close, changed: changed2 }) {
|
|
|
5885
6071
|
] }, companion.id))
|
|
5886
6072
|
] })
|
|
5887
6073
|
] }),
|
|
5888
|
-
/* @__PURE__ */ (0,
|
|
5889
|
-
/* @__PURE__ */ (0,
|
|
5890
|
-
/* @__PURE__ */ (0,
|
|
6074
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "is-wide", children: [
|
|
6075
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u6267\u884C\u5185\u5BB9" }),
|
|
6076
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.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" })
|
|
5891
6077
|
] }),
|
|
5892
|
-
/* @__PURE__ */ (0,
|
|
5893
|
-
/* @__PURE__ */ (0,
|
|
5894
|
-
/* @__PURE__ */ (0,
|
|
5895
|
-
/* @__PURE__ */ (0,
|
|
5896
|
-
/* @__PURE__ */ (0,
|
|
6078
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { children: [
|
|
6079
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u9891\u7387" }),
|
|
6080
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { value: kind, onChange: (event) => setKind(event.target.value), children: [
|
|
6081
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "interval", children: "\u6BCF\u9694\u4E00\u6BB5\u65F6\u95F4" }),
|
|
6082
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "daily", children: "\u6BCF\u5929\u56FA\u5B9A\u65F6\u95F4" })
|
|
5897
6083
|
] })
|
|
5898
6084
|
] }),
|
|
5899
|
-
kind === "interval" ? /* @__PURE__ */ (0,
|
|
5900
|
-
/* @__PURE__ */ (0,
|
|
5901
|
-
/* @__PURE__ */ (0,
|
|
5902
|
-
] }) : /* @__PURE__ */ (0,
|
|
5903
|
-
/* @__PURE__ */ (0,
|
|
5904
|
-
/* @__PURE__ */ (0,
|
|
5905
|
-
/* @__PURE__ */ (0,
|
|
6085
|
+
kind === "interval" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { children: [
|
|
6086
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u95F4\u9694\u5206\u949F" }),
|
|
6087
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { name: "minutes", type: "number", min: 5, max: 43200, defaultValue: 60 })
|
|
6088
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "dsh-partner-schedule-time", children: [
|
|
6089
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { children: [
|
|
6090
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u5C0F\u65F6" }),
|
|
6091
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { name: "hour", type: "number", min: 0, max: 23, defaultValue: 9 })
|
|
5906
6092
|
] }),
|
|
5907
|
-
/* @__PURE__ */ (0,
|
|
5908
|
-
/* @__PURE__ */ (0,
|
|
5909
|
-
/* @__PURE__ */ (0,
|
|
6093
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { children: [
|
|
6094
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u5206\u949F" }),
|
|
6095
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { name: "minute", type: "number", min: 0, max: 59, defaultValue: 0 })
|
|
5910
6096
|
] })
|
|
5911
6097
|
] }),
|
|
5912
|
-
/* @__PURE__ */ (0,
|
|
5913
|
-
/* @__PURE__ */ (0,
|
|
5914
|
-
/* @__PURE__ */ (0,
|
|
5915
|
-
/* @__PURE__ */ (0,
|
|
5916
|
-
/* @__PURE__ */ (0,
|
|
6098
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { children: [
|
|
6099
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u91CD\u53E0\u7B56\u7565" }),
|
|
6100
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("select", { name: "overlapPolicy", defaultValue: "skip", children: [
|
|
6101
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "skip", children: "\u8DF3\u8FC7\u91CD\u53E0" }),
|
|
6102
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: "queue", children: "\u6392\u961F\u6267\u884C" })
|
|
5917
6103
|
] })
|
|
5918
6104
|
] }),
|
|
5919
|
-
/* @__PURE__ */ (0,
|
|
5920
|
-
/* @__PURE__ */ (0,
|
|
5921
|
-
/* @__PURE__ */ (0,
|
|
6105
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { children: [
|
|
6106
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u8D85\u65F6\u5206\u949F" }),
|
|
6107
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { name: "timeoutMinutes", type: "number", min: 1, max: 120, defaultValue: 10 })
|
|
5922
6108
|
] }),
|
|
5923
|
-
/* @__PURE__ */ (0,
|
|
5924
|
-
/* @__PURE__ */ (0,
|
|
5925
|
-
/* @__PURE__ */ (0,
|
|
5926
|
-
/* @__PURE__ */ (0,
|
|
6109
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("label", { className: "dsh-partner-check is-wide", children: [
|
|
6110
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("input", { name: "retain", type: "checkbox" }),
|
|
6111
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
|
|
6112
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u6267\u884C\u540E\u4FDD\u7559\u4E34\u65F6\u4F1A\u8BDD" })
|
|
5927
6113
|
] }),
|
|
5928
|
-
error && /* @__PURE__ */ (0,
|
|
5929
|
-
/* @__PURE__ */ (0,
|
|
5930
|
-
/* @__PURE__ */ (0,
|
|
5931
|
-
/* @__PURE__ */ (0,
|
|
5932
|
-
/* @__PURE__ */ (0,
|
|
6114
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(WorkspaceNotice, { children: error }),
|
|
6115
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("footer", { children: [
|
|
6116
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
6117
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
|
|
6118
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_dsh_client_ui_primitives11.IconPlusOutline16, { size: 14 }),
|
|
5933
6119
|
busy ? "\u521B\u5EFA\u4E2D\u2026" : "\u521B\u5EFA\u8BA1\u5212"
|
|
5934
6120
|
] })
|
|
5935
6121
|
] })
|
|
@@ -5965,7 +6151,7 @@ function isCompanionCapability(value) {
|
|
|
5965
6151
|
// src/ui/companion-access-panel.tsx
|
|
5966
6152
|
var import_react20 = require("react");
|
|
5967
6153
|
var import_dsh_client_ui_primitives12 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5968
|
-
var
|
|
6154
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
5969
6155
|
function CompanionAccessPanel({ companionId }) {
|
|
5970
6156
|
const [access, setAccess] = (0, import_react20.useState)({ targetIds: [], companions: [] });
|
|
5971
6157
|
const [busy, setBusy] = (0, import_react20.useState)();
|
|
@@ -5997,38 +6183,38 @@ function CompanionAccessPanel({ companionId }) {
|
|
|
5997
6183
|
setBusy(void 0);
|
|
5998
6184
|
}
|
|
5999
6185
|
};
|
|
6000
|
-
return /* @__PURE__ */ (0,
|
|
6001
|
-
/* @__PURE__ */ (0,
|
|
6002
|
-
/* @__PURE__ */ (0,
|
|
6003
|
-
/* @__PURE__ */ (0,
|
|
6004
|
-
/* @__PURE__ */ (0,
|
|
6186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("section", { className: "dsh-partner-capability-detail dsh-partner-access", "aria-labelledby": "dsh-partner-access-title", children: [
|
|
6187
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("header", { children: [
|
|
6188
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { children: [
|
|
6189
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: "DIRECTED ACCESS" }),
|
|
6190
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("strong", { id: "dsh-partner-access-title", children: "\u53EF\u8BBF\u95EE\u7684\u4F19\u4F34" })
|
|
6005
6191
|
] }),
|
|
6006
|
-
/* @__PURE__ */ (0,
|
|
6192
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("em", { children: [
|
|
6007
6193
|
access.targetIds.length,
|
|
6008
6194
|
" \u4F4D\u5DF2\u6388\u6743"
|
|
6009
6195
|
] })
|
|
6010
6196
|
] }),
|
|
6011
|
-
/* @__PURE__ */ (0,
|
|
6012
|
-
access.companions.length === 0 ? /* @__PURE__ */ (0,
|
|
6197
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.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" }),
|
|
6198
|
+
access.companions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.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_runtime16.jsx)("div", { className: "dsh-partner-access-list", children: access.companions.map((companion) => {
|
|
6013
6199
|
const selected = access.targetIds.includes(companion.id);
|
|
6014
6200
|
const abilities = companion.capabilities.map((capability) => isCompanionCapability(capability) ? CAPABILITY_LABELS[capability] : capability);
|
|
6015
|
-
return /* @__PURE__ */ (0,
|
|
6201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("button", { type: "button", className: selected ? "is-active" : "", "aria-pressed": selected, disabled: busy === companion.id, onClick: () => {
|
|
6016
6202
|
void toggle(companion.id);
|
|
6017
6203
|
}, children: [
|
|
6018
|
-
/* @__PURE__ */ (0,
|
|
6019
|
-
/* @__PURE__ */ (0,
|
|
6020
|
-
/* @__PURE__ */ (0,
|
|
6204
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "dsh-partner-access-avatar", "aria-hidden": "true", children: initials(companion.name) }),
|
|
6205
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "dsh-partner-access-copy", children: [
|
|
6206
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("strong", { children: [
|
|
6021
6207
|
"@",
|
|
6022
6208
|
companion.name
|
|
6023
6209
|
] }),
|
|
6024
|
-
/* @__PURE__ */ (0,
|
|
6025
|
-
/* @__PURE__ */ (0,
|
|
6026
|
-
/* @__PURE__ */ (0,
|
|
6210
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: companion.role }),
|
|
6211
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { children: companion.description || "\u672A\u586B\u5199\u4F19\u4F34\u8BF4\u660E" }),
|
|
6212
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: [...abilities, ...companion.enabledSkills.map((skill) => skill.name)].map((item) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("em", { children: item }, item)) })
|
|
6027
6213
|
] }),
|
|
6028
|
-
/* @__PURE__ */ (0,
|
|
6214
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "dsh-partner-access-check", "aria-hidden": "true", children: selected && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_dsh_client_ui_primitives12.IconCheckOutline16, { size: 15 }) })
|
|
6029
6215
|
] }, companion.id);
|
|
6030
6216
|
}) }),
|
|
6031
|
-
error && /* @__PURE__ */ (0,
|
|
6217
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(WorkspaceNotice, { children: error })
|
|
6032
6218
|
] });
|
|
6033
6219
|
}
|
|
6034
6220
|
function initials(name) {
|
|
@@ -6041,7 +6227,7 @@ function companionDraft(companion) {
|
|
|
6041
6227
|
}
|
|
6042
6228
|
|
|
6043
6229
|
// src/ui/capability-editor.tsx
|
|
6044
|
-
var
|
|
6230
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
6045
6231
|
function CapabilityEditor({ companion, presets, onChanged }) {
|
|
6046
6232
|
const [form, setForm] = (0, import_react21.useState)(() => companionDraft(companion));
|
|
6047
6233
|
const [modelCatalog, setModelCatalog] = (0, import_react21.useState)();
|
|
@@ -6114,69 +6300,69 @@ function CapabilityEditor({ companion, presets, onChanged }) {
|
|
|
6114
6300
|
const selectedProvider = form.provider || modelCatalog?.defaultSelection.provider || "";
|
|
6115
6301
|
const modelOptions = modelCatalog?.providers.find((item) => item.id === selectedProvider)?.models ?? [];
|
|
6116
6302
|
const currentModelMissing = Boolean(form.model) && !modelOptions.some((item) => item.id === form.model);
|
|
6117
|
-
return /* @__PURE__ */ (0,
|
|
6118
|
-
/* @__PURE__ */ (0,
|
|
6119
|
-
/* @__PURE__ */ (0,
|
|
6120
|
-
/* @__PURE__ */ (0,
|
|
6121
|
-
/* @__PURE__ */ (0,
|
|
6122
|
-
presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0,
|
|
6303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-form is-capabilities", children: [
|
|
6304
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.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" }),
|
|
6305
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-runtime-fields", children: [
|
|
6306
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormField, { label: "Agent Preset", hint: "\u5DE5\u5177\u3001Skill \u4E0E\u7CFB\u7EDF\u63D0\u793A", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("select", { disabled: saving, value: form.presetId, onChange: (event) => edit({ ...form, presetId: event.target.value }), children: [
|
|
6307
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: "", children: "\u8DDF\u968F DSH \u9ED8\u8BA4 Preset" }),
|
|
6308
|
+
presets.filter((item) => !item.broken).map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: item.id, children: item.name }, item.id))
|
|
6123
6309
|
] }) }),
|
|
6124
|
-
/* @__PURE__ */ (0,
|
|
6125
|
-
/* @__PURE__ */ (0,
|
|
6310
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormField, { label: "\u6A21\u578B\u63D0\u4F9B\u65B9", hint: "\u6765\u81EA\u5F53\u524D\u5BA2\u6237\u7AEF", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("select", { disabled: saving, value: form.provider, onChange: (event) => edit({ ...form, provider: event.target.value, model: "" }), children: [
|
|
6311
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("option", { value: "", children: [
|
|
6126
6312
|
"\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
|
|
6127
6313
|
modelCatalog?.defaultSelection.provider || "\u6B63\u5728\u8BFB\u53D6"
|
|
6128
6314
|
] }),
|
|
6129
|
-
modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0,
|
|
6315
|
+
modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
|
|
6130
6316
|
] }) }),
|
|
6131
|
-
/* @__PURE__ */ (0,
|
|
6132
|
-
/* @__PURE__ */ (0,
|
|
6317
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FormField, { label: "\u6A21\u578B", hint: "\u968F\u63D0\u4F9B\u65B9\u8054\u52A8", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("select", { disabled: saving, value: form.model, onChange: (event) => edit({ ...form, model: event.target.value }), children: [
|
|
6318
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("option", { value: "", children: [
|
|
6133
6319
|
"\u8DDF\u968F DSH \u9ED8\u8BA4 \xB7 ",
|
|
6134
6320
|
modelCatalog?.defaultSelection.model || "\u6B63\u5728\u8BFB\u53D6"
|
|
6135
6321
|
] }),
|
|
6136
|
-
currentModelMissing && /* @__PURE__ */ (0,
|
|
6322
|
+
currentModelMissing && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("option", { value: form.model, children: [
|
|
6137
6323
|
"\u5F53\u524D\u914D\u7F6E \xB7 ",
|
|
6138
6324
|
form.model
|
|
6139
6325
|
] }),
|
|
6140
|
-
modelOptions.map((model) => /* @__PURE__ */ (0,
|
|
6326
|
+
modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
|
|
6141
6327
|
] }) })
|
|
6142
6328
|
] }),
|
|
6143
|
-
/* @__PURE__ */ (0,
|
|
6144
|
-
/* @__PURE__ */ (0,
|
|
6329
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "dsh-partner-inline-note", children: "\u8EAB\u4EFD\u4E0E\u80FD\u529B\u5728\u4E0B\u4E00\u8F6E\u6267\u884C\u524D\u66F4\u65B0\uFF1BPreset \u4E0E\u6A21\u578B\u4F5C\u4E3A\u4F1A\u8BDD\u9ED8\u8BA4\u914D\u7F6E\uFF0C\u4E0D\u8986\u76D6\u5DF2\u6709\u4F1A\u8BDD\u7684\u9009\u62E9\u3002" }),
|
|
6330
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-capability-groups", children: groups.map((group) => {
|
|
6145
6331
|
const enabled = group.choices.filter((choice) => form.capabilities.includes(choice.id)).length;
|
|
6146
|
-
return /* @__PURE__ */ (0,
|
|
6147
|
-
/* @__PURE__ */ (0,
|
|
6148
|
-
/* @__PURE__ */ (0,
|
|
6149
|
-
/* @__PURE__ */ (0,
|
|
6150
|
-
/* @__PURE__ */ (0,
|
|
6151
|
-
/* @__PURE__ */ (0,
|
|
6332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: "dsh-partner-capability-group", "aria-labelledby": `partner-capability-${group.id}`, children: [
|
|
6333
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("header", { children: [
|
|
6334
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { children: [
|
|
6335
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: group.eyebrow }),
|
|
6336
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { id: `partner-capability-${group.id}`, children: group.title }),
|
|
6337
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: group.detail })
|
|
6152
6338
|
] }),
|
|
6153
|
-
/* @__PURE__ */ (0,
|
|
6339
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("em", { children: [
|
|
6154
6340
|
enabled,
|
|
6155
6341
|
" / ",
|
|
6156
6342
|
group.choices.length,
|
|
6157
6343
|
" \u5DF2\u542F\u7528"
|
|
6158
6344
|
] })
|
|
6159
6345
|
] }),
|
|
6160
|
-
/* @__PURE__ */ (0,
|
|
6346
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "dsh-partner-capabilities", children: group.choices.map((choice) => {
|
|
6161
6347
|
const active = form.capabilities.includes(choice.id);
|
|
6162
|
-
return /* @__PURE__ */ (0,
|
|
6163
|
-
/* @__PURE__ */ (0,
|
|
6164
|
-
/* @__PURE__ */ (0,
|
|
6165
|
-
/* @__PURE__ */ (0,
|
|
6348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", disabled: saving, className: active ? "is-active" : "", "aria-pressed": active, onClick: () => toggle(choice.id), children: [
|
|
6349
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: active && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives13.IconCheckOutline14, { size: 14 }) }),
|
|
6350
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: choice.title }),
|
|
6351
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: choice.detail })
|
|
6166
6352
|
] }, choice.id);
|
|
6167
6353
|
}) })
|
|
6168
6354
|
] }, group.id);
|
|
6169
6355
|
}) }),
|
|
6170
|
-
form.capabilities.includes("skills") && companion.capabilities.includes("skills") && /* @__PURE__ */ (0,
|
|
6171
|
-
form.capabilities.includes("skills") && !companion.capabilities.includes("skills") && /* @__PURE__ */ (0,
|
|
6172
|
-
/* @__PURE__ */ (0,
|
|
6173
|
-
error && /* @__PURE__ */ (0,
|
|
6174
|
-
/* @__PURE__ */ (0,
|
|
6175
|
-
/* @__PURE__ */ (0,
|
|
6176
|
-
/* @__PURE__ */ (0,
|
|
6177
|
-
/* @__PURE__ */ (0,
|
|
6356
|
+
form.capabilities.includes("skills") && companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CompanionSkillSettings, { companionId: companion.id }),
|
|
6357
|
+
form.capabilities.includes("skills") && !companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime17.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" }),
|
|
6358
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CompanionAccessPanel, { companionId: companion.id }),
|
|
6359
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
|
|
6360
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "dsh-partner-form-actions is-capability-save", children: [
|
|
6361
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { role: "status", "aria-live": "polite", "aria-atomic": "true", children: saved && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
6362
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_dsh_client_ui_primitives13.IconCheckOutline14, { size: 14 }),
|
|
6363
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u751F\u6548" })
|
|
6178
6364
|
] }) }),
|
|
6179
|
-
/* @__PURE__ */ (0,
|
|
6365
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", disabled: saving, "aria-busy": saving, onClick: () => {
|
|
6180
6366
|
void save();
|
|
6181
6367
|
}, children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u5E94\u7528\u80FD\u529B\u7EC4\u5408" })
|
|
6182
6368
|
] })
|
|
@@ -6186,9 +6372,9 @@ function CapabilityEditor({ companion, presets, onChanged }) {
|
|
|
6186
6372
|
// src/ui/identity-editor.tsx
|
|
6187
6373
|
var import_react22 = require("react");
|
|
6188
6374
|
var import_dsh_client_ui_primitives14 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6189
|
-
var
|
|
6375
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
6190
6376
|
function IdentityEditor(props) {
|
|
6191
|
-
return /* @__PURE__ */ (0,
|
|
6377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IdentityEditorForm, { ...props }, props.companion.id);
|
|
6192
6378
|
}
|
|
6193
6379
|
function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
|
|
6194
6380
|
const [form, setForm] = (0, import_react22.useState)(() => companionDraft(companion));
|
|
@@ -6252,33 +6438,33 @@ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
|
|
|
6252
6438
|
if (alive.current) setOperation(void 0);
|
|
6253
6439
|
}
|
|
6254
6440
|
};
|
|
6255
|
-
return /* @__PURE__ */ (0,
|
|
6441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("form", { className: "dsh-partner-form is-identity", "aria-busy": operation !== void 0, onSubmit: (event) => {
|
|
6256
6442
|
void submit(event);
|
|
6257
6443
|
}, children: [
|
|
6258
|
-
/* @__PURE__ */ (0,
|
|
6259
|
-
/* @__PURE__ */ (0,
|
|
6260
|
-
/* @__PURE__ */ (0,
|
|
6261
|
-
/* @__PURE__ */ (0,
|
|
6444
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.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" }),
|
|
6445
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "dsh-partner-fields two", children: [
|
|
6446
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FormField, { label: "\u540D\u5B57", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("input", { disabled: busy, required: true, maxLength: 60, value: form.name, onChange: (event) => setForm({ ...form, name: event.target.value }) }) }),
|
|
6447
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FormField, { label: "\u89D2\u8272", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("input", { disabled: busy, required: true, maxLength: 120, value: form.role, onChange: (event) => setForm({ ...form, role: event.target.value }) }) })
|
|
6262
6448
|
] }),
|
|
6263
|
-
/* @__PURE__ */ (0,
|
|
6264
|
-
/* @__PURE__ */ (0,
|
|
6265
|
-
error && /* @__PURE__ */ (0,
|
|
6266
|
-
/* @__PURE__ */ (0,
|
|
6267
|
-
/* @__PURE__ */ (0,
|
|
6268
|
-
/* @__PURE__ */ (0,
|
|
6449
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.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_runtime18.jsx)("textarea", { disabled: busy, rows: 2, maxLength: 500, value: form.description, onChange: (event) => setForm({ ...form, description: event.target.value }) }) }),
|
|
6450
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.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_runtime18.jsx)("textarea", { disabled: busy, rows: 9, maxLength: 12e3, value: form.instructions, onChange: (event) => setForm({ ...form, instructions: event.target.value }) }) }),
|
|
6451
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
|
|
6452
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "dsh-partner-form-actions", children: [
|
|
6453
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { role: "status", children: saved && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
6454
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives14.IconCheckOutline14, { size: 14 }),
|
|
6269
6455
|
"\u5DF2\u4FDD\u5B58\uFF0C\u4E0B\u4E00\u8F6E\u5C06\u4F7F\u7528\u65B0\u8EAB\u4EFD"
|
|
6270
6456
|
] }) }),
|
|
6271
|
-
/* @__PURE__ */ (0,
|
|
6457
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { disabled: busy, children: operation === "save" ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
|
|
6272
6458
|
] }),
|
|
6273
|
-
/* @__PURE__ */ (0,
|
|
6274
|
-
/* @__PURE__ */ (0,
|
|
6275
|
-
/* @__PURE__ */ (0,
|
|
6276
|
-
/* @__PURE__ */ (0,
|
|
6459
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "dsh-partner-identity-danger", "data-confirming": confirming, children: [
|
|
6460
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { children: [
|
|
6461
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("strong", { children: removed ? "\u4F19\u4F34\u5DF2\u5220\u9664" : confirming ? `\u786E\u8BA4\u5220\u9664\u300C${companion.name}\u300D\uFF1F` : "\u5220\u9664\u4F19\u4F34" }),
|
|
6462
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: confirming ? "\u5C06\u5220\u9664\u8BE5\u4F19\u4F34\u7684\u914D\u7F6E\u3001\u8BB0\u5FC6\u3001\u6302\u5FF5\u3001\u4E13\u5C5E\u76EE\u5F55\u53CA\u5176\u4E2D\u5168\u90E8\u6587\u4EF6\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002\u5171\u4EAB\u6216\u5F02\u5E38\u76EE\u5F55\u4F1A\u62E6\u622A\uFF1BDSH \u539F\u4F1A\u8BDD\u65E5\u5FD7\u4ECD\u7531\u5BBF\u4E3B\u7BA1\u7406\uFF0C\u4E0D\u5728\u6B64\u6B21\u6E05\u7406\u8303\u56F4\u5185\u3002" : "\u5FC5\u987B\u5148\u89E3\u7ED1\u5FAE\u4FE1\u5E76\u7ED3\u675F\u8FD0\u884C\u4E2D\u7684\u4EFB\u52A1\u3002\u5220\u9664\u53EA\u9488\u5BF9\u672C\u6B21\u786E\u8BA4\u7684\u4F19\u4F34\uFF0C\u4E0D\u4F1A\u8F6C\u4EA4\u8054\u7CFB\u4EBA\u3002" })
|
|
6277
6463
|
] }),
|
|
6278
|
-
/* @__PURE__ */ (0,
|
|
6279
|
-
confirming && /* @__PURE__ */ (0,
|
|
6280
|
-
/* @__PURE__ */ (0,
|
|
6281
|
-
/* @__PURE__ */ (0,
|
|
6464
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
|
|
6465
|
+
confirming && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", disabled: busy, className: "is-secondary", onClick: () => setConfirmationId(void 0), children: "\u53D6\u6D88" }),
|
|
6466
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: confirming ? "is-danger" : "", disabled: busy || count <= 1, onClick: () => confirming ? void remove() : setConfirmationId(companion.id), children: [
|
|
6467
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_dsh_client_ui_primitives14.IconTrashOutline16, { size: 16 }),
|
|
6282
6468
|
operation === "remove" ? "\u6B63\u5728\u5220\u9664\u2026" : removed ? "\u5DF2\u5220\u9664" : confirming ? "\u786E\u8BA4\u5220\u9664" : "\u5220\u9664"
|
|
6283
6469
|
] })
|
|
6284
6470
|
] })
|
|
@@ -6289,7 +6475,7 @@ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
|
|
|
6289
6475
|
// src/ui/companion-create.tsx
|
|
6290
6476
|
var import_react23 = require("react");
|
|
6291
6477
|
var import_dsh_client_ui_primitives15 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6292
|
-
var
|
|
6478
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
6293
6479
|
function CompanionCreateDialog({ close, create }) {
|
|
6294
6480
|
const [busy, setBusy] = (0, import_react23.useState)(false);
|
|
6295
6481
|
const [error, setError] = (0, import_react23.useState)();
|
|
@@ -6311,30 +6497,30 @@ function CompanionCreateDialog({ close, create }) {
|
|
|
6311
6497
|
setBusy(false);
|
|
6312
6498
|
}
|
|
6313
6499
|
};
|
|
6314
|
-
return /* @__PURE__ */ (0,
|
|
6500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.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_runtime19.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-companion-create-form", "aria-busy": busy, onSubmit: (event) => {
|
|
6315
6501
|
void submit(event);
|
|
6316
6502
|
}, children: [
|
|
6317
|
-
/* @__PURE__ */ (0,
|
|
6318
|
-
/* @__PURE__ */ (0,
|
|
6319
|
-
/* @__PURE__ */ (0,
|
|
6503
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { children: [
|
|
6504
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: "\u4F19\u4F34\u540D\u5B57" }),
|
|
6505
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", { name: "name", required: true, maxLength: 60, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u5C0F\u9ED1" })
|
|
6320
6506
|
] }),
|
|
6321
|
-
/* @__PURE__ */ (0,
|
|
6322
|
-
/* @__PURE__ */ (0,
|
|
6323
|
-
/* @__PURE__ */ (0,
|
|
6507
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { children: [
|
|
6508
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: "\u4E3B\u8981\u89D2\u8272" }),
|
|
6509
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", { name: "role", required: true, maxLength: 120, placeholder: "\u4F8B\u5982\uFF1A\u4EA7\u54C1\u4E0E\u5DE5\u7A0B\u534F\u4F5C\u4F19\u4F34" })
|
|
6324
6510
|
] }),
|
|
6325
|
-
/* @__PURE__ */ (0,
|
|
6326
|
-
/* @__PURE__ */ (0,
|
|
6327
|
-
/* @__PURE__ */ (0,
|
|
6511
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { className: "is-wide", children: [
|
|
6512
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D" }),
|
|
6513
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", { name: "description", maxLength: 500, placeholder: "\u5B83\u4E3B\u8981\u8D1F\u8D23\u4EC0\u4E48\uFF0C\u4EC0\u4E48\u65F6\u5019\u5E94\u8BE5\u627E\u5B83" })
|
|
6328
6514
|
] }),
|
|
6329
|
-
/* @__PURE__ */ (0,
|
|
6330
|
-
/* @__PURE__ */ (0,
|
|
6331
|
-
/* @__PURE__ */ (0,
|
|
6515
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { className: "is-wide", children: [
|
|
6516
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: "\u521D\u59CB\u884C\u4E3A\u51C6\u5219" }),
|
|
6517
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.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" })
|
|
6332
6518
|
] }),
|
|
6333
|
-
error && /* @__PURE__ */ (0,
|
|
6334
|
-
/* @__PURE__ */ (0,
|
|
6335
|
-
/* @__PURE__ */ (0,
|
|
6336
|
-
/* @__PURE__ */ (0,
|
|
6337
|
-
/* @__PURE__ */ (0,
|
|
6519
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(WorkspaceNotice, { children: error }),
|
|
6520
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("footer", { children: [
|
|
6521
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
6522
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
|
|
6523
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_dsh_client_ui_primitives15.IconPlusOutline16, { size: 14 }),
|
|
6338
6524
|
busy ? "\u6B63\u5728\u521B\u5EFA\u2026" : "\u521B\u5EFA\u4F19\u4F34"
|
|
6339
6525
|
] })
|
|
6340
6526
|
] })
|
|
@@ -6424,7 +6610,7 @@ function sessions(ctx) {
|
|
|
6424
6610
|
}
|
|
6425
6611
|
|
|
6426
6612
|
// src/client.tsx
|
|
6427
|
-
var
|
|
6613
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
6428
6614
|
var PLUGIN_ID = "@lemoncat7/dsh-partner";
|
|
6429
6615
|
var STYLE_ID = `${PLUGIN_ID}/client`;
|
|
6430
6616
|
var cssText = `${client_default}
|
|
@@ -6438,15 +6624,15 @@ var WORKSPACE_PAGES = /* @__PURE__ */ new Set(["skills", "board", "schedules", "
|
|
|
6438
6624
|
var inject = ["slots", "layout", "sessions"];
|
|
6439
6625
|
function apply(ctx) {
|
|
6440
6626
|
ctx.effect(installStyles, "dsh-partner: styles");
|
|
6441
|
-
const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0,
|
|
6442
|
-
ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0,
|
|
6627
|
+
const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(PartnerWorkspace, { ...props, controller: current2 }));
|
|
6628
|
+
ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(PartnerPendant, { controller })));
|
|
6443
6629
|
ctx.effect(() => observePluginWorkspace(PLUGIN_ID, controller.close), "dsh-partner: exclusive workspace");
|
|
6444
6630
|
ctx.effect(() => () => controller.close(), "dsh-partner: workspace lifecycle");
|
|
6445
6631
|
ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({
|
|
6446
6632
|
name: "sidebar.footer.action",
|
|
6447
6633
|
id: "partner",
|
|
6448
6634
|
order: -120
|
|
6449
|
-
}, (props) => /* @__PURE__ */ (0,
|
|
6635
|
+
}, (props) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
|
|
6450
6636
|
}
|
|
6451
6637
|
function PartnerSidebar(props) {
|
|
6452
6638
|
const ref = (0, import_react24.useRef)(null);
|
|
@@ -6463,19 +6649,19 @@ function PartnerSidebar(props) {
|
|
|
6463
6649
|
props.controller.open(id);
|
|
6464
6650
|
if (props.wide && window.matchMedia("(max-width: 820px)").matches) props.collapse();
|
|
6465
6651
|
};
|
|
6466
|
-
if (!props.wide) return /* @__PURE__ */ (0,
|
|
6467
|
-
return /* @__PURE__ */ (0,
|
|
6468
|
-
/* @__PURE__ */ (0,
|
|
6469
|
-
/* @__PURE__ */ (0,
|
|
6652
|
+
if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime20.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_runtime20.jsx)(import_dsh_client_ui_primitives16.IconAgentPresetOutline16, { size: 18 }) }) });
|
|
6653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
|
|
6654
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
|
|
6655
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconChevronDownOutline14, { size: 14 }) }),
|
|
6470
6656
|
"\u4F19\u4F34"
|
|
6471
6657
|
] }) }),
|
|
6472
|
-
/* @__PURE__ */ (0,
|
|
6473
|
-
/* @__PURE__ */ (0,
|
|
6474
|
-
/* @__PURE__ */ (0,
|
|
6475
|
-
/* @__PURE__ */ (0,
|
|
6476
|
-
/* @__PURE__ */ (0,
|
|
6658
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
|
|
6659
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconAgentPresetOutline16, { size: 16 }) }),
|
|
6660
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
6661
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
|
|
6662
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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" })
|
|
6477
6663
|
] }),
|
|
6478
|
-
/* @__PURE__ */ (0,
|
|
6664
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
|
|
6479
6665
|
] }) }) })
|
|
6480
6666
|
] });
|
|
6481
6667
|
}
|
|
@@ -6575,18 +6761,18 @@ function PartnerWorkspace({ controller }) {
|
|
|
6575
6761
|
setSelectedId(id);
|
|
6576
6762
|
setView("home");
|
|
6577
6763
|
};
|
|
6578
|
-
return /* @__PURE__ */ (0,
|
|
6579
|
-
creatingCompanion && /* @__PURE__ */ (0,
|
|
6580
|
-
/* @__PURE__ */ (0,
|
|
6581
|
-
/* @__PURE__ */ (0,
|
|
6582
|
-
/* @__PURE__ */ (0,
|
|
6583
|
-
/* @__PURE__ */ (0,
|
|
6584
|
-
/* @__PURE__ */ (0,
|
|
6585
|
-
/* @__PURE__ */ (0,
|
|
6586
|
-
/* @__PURE__ */ (0,
|
|
6764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("main", { className: "dsh-partner-workspace", children: [
|
|
6765
|
+
creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
|
|
6766
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { className: "dsh-partner-topbar", children: [
|
|
6767
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
|
|
6768
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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_runtime20.jsx)(import_dsh_client_ui_primitives16.IconChevronLeftOutline14, { size: 15 }) }),
|
|
6769
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconAgentPresetOutline16, { size: 18 }),
|
|
6770
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
6771
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "\u4F19\u4F34" }),
|
|
6772
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u5FAE\u4FE1\u6E20\u9053" })
|
|
6587
6773
|
] })
|
|
6588
6774
|
] }),
|
|
6589
|
-
/* @__PURE__ */ (0,
|
|
6775
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
6590
6776
|
MobileWorkspaceControls,
|
|
6591
6777
|
{
|
|
6592
6778
|
companions: snapshot?.companions ?? [],
|
|
@@ -6598,115 +6784,115 @@ function PartnerWorkspace({ controller }) {
|
|
|
6598
6784
|
}
|
|
6599
6785
|
)
|
|
6600
6786
|
] }),
|
|
6601
|
-
/* @__PURE__ */ (0,
|
|
6602
|
-
/* @__PURE__ */ (0,
|
|
6603
|
-
/* @__PURE__ */ (0,
|
|
6604
|
-
/* @__PURE__ */ (0,
|
|
6605
|
-
/* @__PURE__ */ (0,
|
|
6606
|
-
/* @__PURE__ */ (0,
|
|
6787
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-grid", children: [
|
|
6788
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("aside", { className: "dsh-partner-roster", children: [
|
|
6789
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-roster-title", children: [
|
|
6790
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
6791
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "COMPANIONS" }),
|
|
6792
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
|
|
6607
6793
|
] }),
|
|
6608
|
-
/* @__PURE__ */ (0,
|
|
6794
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconPlusOutline16, { size: 16 }) })
|
|
6609
6795
|
] }),
|
|
6610
|
-
/* @__PURE__ */ (0,
|
|
6796
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
|
|
6611
6797
|
const channel = snapshot.channels.find((item) => item.companionId === companion.id);
|
|
6612
|
-
return /* @__PURE__ */ (0,
|
|
6613
|
-
/* @__PURE__ */ (0,
|
|
6614
|
-
/* @__PURE__ */ (0,
|
|
6615
|
-
/* @__PURE__ */ (0,
|
|
6616
|
-
/* @__PURE__ */ (0,
|
|
6798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
|
|
6799
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Avatar, { name: companion.name }),
|
|
6800
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
6801
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: companion.name }),
|
|
6802
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: companion.role })
|
|
6617
6803
|
] }),
|
|
6618
|
-
/* @__PURE__ */ (0,
|
|
6804
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
|
|
6619
6805
|
] }, companion.id);
|
|
6620
6806
|
}) }),
|
|
6621
|
-
/* @__PURE__ */ (0,
|
|
6622
|
-
/* @__PURE__ */ (0,
|
|
6623
|
-
/* @__PURE__ */ (0,
|
|
6624
|
-
/* @__PURE__ */ (0,
|
|
6625
|
-
/* @__PURE__ */ (0,
|
|
6807
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: [
|
|
6808
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-current": view === "skills" ? "page" : void 0, onClick: () => setView("skills"), children: [
|
|
6809
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconBrowseOutline16, { size: 16 }) }),
|
|
6810
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "Skill \u5E02\u573A" }),
|
|
6811
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u5B89\u88C5\u4E0E\u7BA1\u7406\u80FD\u529B" })
|
|
6626
6812
|
] }),
|
|
6627
|
-
/* @__PURE__ */ (0,
|
|
6628
|
-
/* @__PURE__ */ (0,
|
|
6629
|
-
/* @__PURE__ */ (0,
|
|
6630
|
-
/* @__PURE__ */ (0,
|
|
6813
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-current": view === "board" ? "page" : void 0, onClick: () => setView("board"), children: [
|
|
6814
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconListPenOutline16, { size: 16 }) }),
|
|
6815
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "\u4EFB\u52A1\u770B\u677F" }),
|
|
6816
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u534F\u4F5C\u3001\u59D4\u6D3E\u4E0E\u9A8C\u6536" })
|
|
6631
6817
|
] }),
|
|
6632
|
-
/* @__PURE__ */ (0,
|
|
6633
|
-
/* @__PURE__ */ (0,
|
|
6634
|
-
/* @__PURE__ */ (0,
|
|
6635
|
-
/* @__PURE__ */ (0,
|
|
6818
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-current": view === "schedules" ? "page" : void 0, onClick: () => setView("schedules"), children: [
|
|
6819
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconPlayOutline16, { size: 16 }) }),
|
|
6820
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "\u5B9A\u65F6\u4EFB\u52A1" }),
|
|
6821
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u9009\u62E9\u4F19\u4F34\u5468\u671F\u6267\u884C" })
|
|
6636
6822
|
] }),
|
|
6637
|
-
/* @__PURE__ */ (0,
|
|
6638
|
-
/* @__PURE__ */ (0,
|
|
6639
|
-
/* @__PURE__ */ (0,
|
|
6640
|
-
/* @__PURE__ */ (0,
|
|
6823
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-current": view === "pendant" ? "page" : void 0, onClick: () => setView("pendant"), children: [
|
|
6824
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconEditOutline16, { size: 16 }) }),
|
|
6825
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "\u5361\u7247\u8BBE\u7F6E" }),
|
|
6826
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u6302\u9970\u3001\u7EF3\u5B50\u4E0E\u56FE\u6848" })
|
|
6641
6827
|
] })
|
|
6642
6828
|
] }),
|
|
6643
|
-
/* @__PURE__ */ (0,
|
|
6644
|
-
/* @__PURE__ */ (0,
|
|
6645
|
-
/* @__PURE__ */ (0,
|
|
6646
|
-
/* @__PURE__ */ (0,
|
|
6647
|
-
/* @__PURE__ */ (0,
|
|
6829
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-roster-note", children: [
|
|
6830
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconLinkOutline16, { size: 16 }),
|
|
6831
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
6832
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
|
|
6833
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u5FAE\u4FE1\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
|
|
6648
6834
|
] })
|
|
6649
6835
|
] })
|
|
6650
6836
|
] }),
|
|
6651
|
-
/* @__PURE__ */ (0,
|
|
6652
|
-
loading ? /* @__PURE__ */ (0,
|
|
6653
|
-
view === "skills" && /* @__PURE__ */ (0,
|
|
6654
|
-
view === "board" && /* @__PURE__ */ (0,
|
|
6655
|
-
view === "schedules" && /* @__PURE__ */ (0,
|
|
6656
|
-
view === "pendant" && /* @__PURE__ */ (0,
|
|
6657
|
-
] }) : selected === void 0 ? /* @__PURE__ */ (0,
|
|
6658
|
-
/* @__PURE__ */ (0,
|
|
6659
|
-
/* @__PURE__ */ (0,
|
|
6660
|
-
/* @__PURE__ */ (0,
|
|
6661
|
-
/* @__PURE__ */ (0,
|
|
6662
|
-
/* @__PURE__ */ (0,
|
|
6663
|
-
/* @__PURE__ */ (0,
|
|
6837
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
|
|
6838
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
|
|
6839
|
+
view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SkillsPanel, {}),
|
|
6840
|
+
view === "board" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(RequirementBoard, { initialTaskId: requestedDestination?.taskId, openRequest: requestedDestination }),
|
|
6841
|
+
view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] }),
|
|
6842
|
+
view === "pendant" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(PendantSettingsPanel, {})
|
|
6843
|
+
] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.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_runtime20.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
6844
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-identity", children: [
|
|
6845
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Avatar, { name: selected.name }),
|
|
6846
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
6847
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "ACTIVE COMPANION" }),
|
|
6848
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { children: selected.name }),
|
|
6849
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: selected.description || selected.role })
|
|
6664
6850
|
] }),
|
|
6665
|
-
/* @__PURE__ */ (0,
|
|
6851
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
|
|
6666
6852
|
] }),
|
|
6667
|
-
/* @__PURE__ */ (0,
|
|
6668
|
-
/* @__PURE__ */ (0,
|
|
6669
|
-
/* @__PURE__ */ (0,
|
|
6670
|
-
/* @__PURE__ */ (0,
|
|
6671
|
-
/* @__PURE__ */ (0,
|
|
6672
|
-
/* @__PURE__ */ (0,
|
|
6853
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
|
|
6854
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconAgentPresetOutline16, { size: 16 }), children: "\u603B\u89C8" }),
|
|
6855
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconEditOutline16, { size: 16 }), children: "\u8EAB\u4EFD" }),
|
|
6856
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconAgentPresetOutline16, { size: 16 }), children: "\u80FD\u529B" }),
|
|
6857
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WeixinGlyph, {}), children: "\u5FAE\u4FE1" }),
|
|
6858
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconDataOutline16, { size: 16 }), children: "\u8BB0\u5FC6" })
|
|
6673
6859
|
] }),
|
|
6674
|
-
/* @__PURE__ */ (0,
|
|
6675
|
-
notice && /* @__PURE__ */ (0,
|
|
6676
|
-
view === "home" && /* @__PURE__ */ (0,
|
|
6677
|
-
view === "identity" && /* @__PURE__ */ (0,
|
|
6678
|
-
view === "capabilities" && /* @__PURE__ */ (0,
|
|
6679
|
-
view === "weixin" && /* @__PURE__ */ (0,
|
|
6680
|
-
view === "memory" && /* @__PURE__ */ (0,
|
|
6860
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
|
|
6861
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "dsh-partner-inline-notice", role: "status", children: notice }),
|
|
6862
|
+
view === "home" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession }),
|
|
6863
|
+
view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(IdentityEditor, { companion: selected, count: snapshot?.companions.length ?? 1, onChanged: () => refresh(true), onRemoved: companionRemoved }),
|
|
6864
|
+
view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: () => refresh(true) }, selected.id),
|
|
6865
|
+
view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }),
|
|
6866
|
+
view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, startSession, renewSession, onChanged: refresh })
|
|
6681
6867
|
] })
|
|
6682
6868
|
] }),
|
|
6683
|
-
error && /* @__PURE__ */ (0,
|
|
6869
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
|
|
6684
6870
|
] })
|
|
6685
6871
|
] })
|
|
6686
6872
|
] });
|
|
6687
6873
|
}
|
|
6688
6874
|
function MobileWorkspaceControls({ companions, selectedId, view, openCompanion, openPage, createCompanion }) {
|
|
6689
|
-
return /* @__PURE__ */ (0,
|
|
6690
|
-
/* @__PURE__ */ (0,
|
|
6691
|
-
/* @__PURE__ */ (0,
|
|
6692
|
-
/* @__PURE__ */ (0,
|
|
6875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
|
|
6876
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
|
|
6877
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
|
|
6878
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconPlusOutline16, { size: 17 }) })
|
|
6693
6879
|
] }),
|
|
6694
|
-
/* @__PURE__ */ (0,
|
|
6695
|
-
/* @__PURE__ */ (0,
|
|
6696
|
-
/* @__PURE__ */ (0,
|
|
6697
|
-
/* @__PURE__ */ (0,
|
|
6880
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: [
|
|
6881
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: view === "skills" ? "is-active" : "", "aria-pressed": view === "skills", onClick: () => openPage("skills"), children: [
|
|
6882
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconBrowseOutline16, { size: 16 }),
|
|
6883
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "Skill" })
|
|
6698
6884
|
] }),
|
|
6699
|
-
/* @__PURE__ */ (0,
|
|
6700
|
-
/* @__PURE__ */ (0,
|
|
6701
|
-
/* @__PURE__ */ (0,
|
|
6885
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: view === "board" ? "is-active" : "", "aria-pressed": view === "board", onClick: () => openPage("board"), children: [
|
|
6886
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconListPenOutline16, { size: 16 }),
|
|
6887
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "\u770B\u677F" })
|
|
6702
6888
|
] }),
|
|
6703
|
-
/* @__PURE__ */ (0,
|
|
6704
|
-
/* @__PURE__ */ (0,
|
|
6705
|
-
/* @__PURE__ */ (0,
|
|
6889
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: view === "schedules" ? "is-active" : "", "aria-pressed": view === "schedules", onClick: () => openPage("schedules"), children: [
|
|
6890
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconPlayOutline16, { size: 16 }),
|
|
6891
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "\u5B9A\u65F6" })
|
|
6706
6892
|
] }),
|
|
6707
|
-
/* @__PURE__ */ (0,
|
|
6708
|
-
/* @__PURE__ */ (0,
|
|
6709
|
-
/* @__PURE__ */ (0,
|
|
6893
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: view === "pendant" ? "is-active" : "", "aria-pressed": view === "pendant", onClick: () => openPage("pendant"), children: [
|
|
6894
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconEditOutline16, { size: 16 }),
|
|
6895
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "\u5361\u7247" })
|
|
6710
6896
|
] })
|
|
6711
6897
|
] })
|
|
6712
6898
|
] });
|
|
@@ -6719,66 +6905,66 @@ function HomePanel({ companion, snapshot, navigate, openSession, startSession, r
|
|
|
6719
6905
|
const approved = channel ? snapshot.pairings.filter((item) => item.channelId === channel.id && item.status === "approved").length : 0;
|
|
6720
6906
|
const capabilities = companion.capabilities.map((item) => CAPABILITY_LABELS[item]);
|
|
6721
6907
|
const online = channel?.runtimeStatus === "running";
|
|
6722
|
-
return /* @__PURE__ */ (0,
|
|
6723
|
-
/* @__PURE__ */ (0,
|
|
6724
|
-
/* @__PURE__ */ (0,
|
|
6725
|
-
/* @__PURE__ */ (0,
|
|
6726
|
-
/* @__PURE__ */ (0,
|
|
6908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-home", children: [
|
|
6909
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { className: "dsh-partner-home-heading", children: [
|
|
6910
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
6911
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
|
|
6912
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u5FAE\u4FE1\u5F85\u547D` : `${companion.name} \u5DF2\u51C6\u5907\u5C31\u7EEA` })
|
|
6727
6913
|
] }),
|
|
6728
|
-
/* @__PURE__ */ (0,
|
|
6914
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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" })
|
|
6729
6915
|
] }),
|
|
6730
|
-
/* @__PURE__ */ (0,
|
|
6731
|
-
/* @__PURE__ */ (0,
|
|
6732
|
-
/* @__PURE__ */ (0,
|
|
6733
|
-
/* @__PURE__ */ (0,
|
|
6734
|
-
/* @__PURE__ */ (0,
|
|
6916
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
|
|
6917
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
|
|
6918
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Avatar, { name: companion.name }),
|
|
6919
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", {}) }),
|
|
6920
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WeixinGlyph, { large: true }) })
|
|
6735
6921
|
] }),
|
|
6736
|
-
/* @__PURE__ */ (0,
|
|
6737
|
-
/* @__PURE__ */ (0,
|
|
6738
|
-
/* @__PURE__ */ (0,
|
|
6922
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
|
|
6923
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
|
|
6924
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", {}),
|
|
6739
6925
|
"\u4E3B\u8981\u6E20\u9053 \xB7 \u5FAE\u4FE1"
|
|
6740
6926
|
] }),
|
|
6741
|
-
/* @__PURE__ */ (0,
|
|
6742
|
-
/* @__PURE__ */ (0,
|
|
6743
|
-
/* @__PURE__ */ (0,
|
|
6744
|
-
/* @__PURE__ */ (0,
|
|
6745
|
-
/* @__PURE__ */ (0,
|
|
6927
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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" }),
|
|
6928
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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" }),
|
|
6929
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
|
|
6930
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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" }),
|
|
6931
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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` })
|
|
6746
6932
|
] })
|
|
6747
6933
|
] })
|
|
6748
6934
|
] }),
|
|
6749
|
-
/* @__PURE__ */ (0,
|
|
6750
|
-
/* @__PURE__ */ (0,
|
|
6751
|
-
/* @__PURE__ */ (0,
|
|
6752
|
-
/* @__PURE__ */ (0,
|
|
6753
|
-
/* @__PURE__ */ (0,
|
|
6754
|
-
/* @__PURE__ */ (0,
|
|
6755
|
-
/* @__PURE__ */ (0,
|
|
6935
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-home-details", children: [
|
|
6936
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { className: "dsh-partner-home-profile", children: [
|
|
6937
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { children: [
|
|
6938
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconUserOutline16, { size: 16 }) }),
|
|
6939
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
6940
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
|
|
6941
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: companion.role })
|
|
6756
6942
|
] }),
|
|
6757
|
-
/* @__PURE__ */ (0,
|
|
6943
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
|
|
6758
6944
|
] }),
|
|
6759
|
-
/* @__PURE__ */ (0,
|
|
6945
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
|
|
6760
6946
|
] }),
|
|
6761
|
-
/* @__PURE__ */ (0,
|
|
6762
|
-
/* @__PURE__ */ (0,
|
|
6763
|
-
/* @__PURE__ */ (0,
|
|
6764
|
-
/* @__PURE__ */ (0,
|
|
6765
|
-
/* @__PURE__ */ (0,
|
|
6766
|
-
/* @__PURE__ */ (0,
|
|
6947
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
|
|
6948
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { children: [
|
|
6949
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconAgentPresetOutline16, { size: 16 }) }),
|
|
6950
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
6951
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
|
|
6952
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
|
|
6767
6953
|
] }),
|
|
6768
|
-
/* @__PURE__ */ (0,
|
|
6954
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
|
|
6769
6955
|
] }),
|
|
6770
|
-
/* @__PURE__ */ (0,
|
|
6956
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
|
|
6771
6957
|
] }),
|
|
6772
|
-
/* @__PURE__ */ (0,
|
|
6773
|
-
/* @__PURE__ */ (0,
|
|
6774
|
-
/* @__PURE__ */ (0,
|
|
6775
|
-
/* @__PURE__ */ (0,
|
|
6776
|
-
/* @__PURE__ */ (0,
|
|
6777
|
-
/* @__PURE__ */ (0,
|
|
6958
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
|
|
6959
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { children: [
|
|
6960
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconDataOutline16, { size: 16 }) }),
|
|
6961
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
6962
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
|
|
6963
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: localSession?.archived ? "\u4F1A\u8BDD\u5DF2\u5F52\u6863" : "\u4F19\u4F34\u4F1A\u8BDD\u5DF2\u5EFA\u7ACB" })
|
|
6778
6964
|
] }),
|
|
6779
|
-
/* @__PURE__ */ (0,
|
|
6965
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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" })
|
|
6780
6966
|
] }),
|
|
6781
|
-
/* @__PURE__ */ (0,
|
|
6967
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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" })
|
|
6782
6968
|
] })
|
|
6783
6969
|
] })
|
|
6784
6970
|
] });
|
|
@@ -6834,93 +7020,93 @@ function WeixinPanel({ companion, snapshot, onChanged }) {
|
|
|
6834
7020
|
setError(errorMessage(reason));
|
|
6835
7021
|
}
|
|
6836
7022
|
};
|
|
6837
|
-
return /* @__PURE__ */ (0,
|
|
6838
|
-
/* @__PURE__ */ (0,
|
|
6839
|
-
!channel && !login && /* @__PURE__ */ (0,
|
|
6840
|
-
/* @__PURE__ */ (0,
|
|
6841
|
-
/* @__PURE__ */ (0,
|
|
6842
|
-
/* @__PURE__ */ (0,
|
|
7023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
|
|
7024
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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" }),
|
|
7025
|
+
!channel && !login && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
|
|
7026
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WeixinGlyph, { large: true }) }),
|
|
7027
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7028
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("strong", { children: [
|
|
6843
7029
|
"\u628A ",
|
|
6844
7030
|
companion.name,
|
|
6845
7031
|
" \u5E26\u5230\u5FAE\u4FE1"
|
|
6846
7032
|
] }),
|
|
6847
|
-
/* @__PURE__ */ (0,
|
|
6848
|
-
/* @__PURE__ */ (0,
|
|
6849
|
-
/* @__PURE__ */ (0,
|
|
6850
|
-
/* @__PURE__ */ (0,
|
|
6851
|
-
/* @__PURE__ */ (0,
|
|
7033
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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" }),
|
|
7034
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("ul", { children: [
|
|
7035
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
|
|
7036
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
|
|
7037
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
|
|
6852
7038
|
] })
|
|
6853
7039
|
] }),
|
|
6854
|
-
/* @__PURE__ */ (0,
|
|
7040
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", disabled: busy, onClick: () => {
|
|
6855
7041
|
void begin();
|
|
6856
7042
|
}, children: busy ? "\u6B63\u5728\u7533\u8BF7\u4E8C\u7EF4\u7801\u2026" : "\u626B\u7801\u8FDE\u63A5\u5FAE\u4FE1" })
|
|
6857
7043
|
] }),
|
|
6858
|
-
login && /* @__PURE__ */ (0,
|
|
6859
|
-
/* @__PURE__ */ (0,
|
|
6860
|
-
/* @__PURE__ */ (0,
|
|
6861
|
-
/* @__PURE__ */ (0,
|
|
6862
|
-
/* @__PURE__ */ (0,
|
|
6863
|
-
/* @__PURE__ */ (0,
|
|
6864
|
-
(login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0,
|
|
7044
|
+
login && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
|
|
7045
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
|
|
7046
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7047
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "WECHAT ILINK BOT" }),
|
|
7048
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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" }),
|
|
7049
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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") }),
|
|
7050
|
+
(login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", onClick: () => {
|
|
6865
7051
|
setLogin(void 0);
|
|
6866
7052
|
void begin();
|
|
6867
7053
|
}, children: [
|
|
6868
|
-
/* @__PURE__ */ (0,
|
|
7054
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconRefreshOutline16, { size: 16 }),
|
|
6869
7055
|
"\u91CD\u65B0\u751F\u6210"
|
|
6870
7056
|
] })
|
|
6871
7057
|
] })
|
|
6872
7058
|
] }),
|
|
6873
|
-
channel && /* @__PURE__ */ (0,
|
|
6874
|
-
/* @__PURE__ */ (0,
|
|
6875
|
-
/* @__PURE__ */ (0,
|
|
6876
|
-
/* @__PURE__ */ (0,
|
|
6877
|
-
/* @__PURE__ */ (0,
|
|
6878
|
-
/* @__PURE__ */ (0,
|
|
6879
|
-
/* @__PURE__ */ (0,
|
|
7059
|
+
channel && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
7060
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
|
|
7061
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WeixinGlyph, { large: true }) }),
|
|
7062
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7063
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "WECHAT CHANNEL" }),
|
|
7064
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: channel.name }),
|
|
7065
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: channel.accountId })
|
|
6880
7066
|
] }),
|
|
6881
|
-
/* @__PURE__ */ (0,
|
|
6882
|
-
/* @__PURE__ */ (0,
|
|
7067
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ChannelStatus, { channel }),
|
|
7068
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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: () => {
|
|
6883
7069
|
void toggle();
|
|
6884
|
-
}, children: /* @__PURE__ */ (0,
|
|
7070
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", {}) })
|
|
6885
7071
|
] }),
|
|
6886
|
-
channel.lastError && /* @__PURE__ */ (0,
|
|
6887
|
-
/* @__PURE__ */ (0,
|
|
6888
|
-
/* @__PURE__ */ (0,
|
|
6889
|
-
/* @__PURE__ */ (0,
|
|
6890
|
-
/* @__PURE__ */ (0,
|
|
7072
|
+
channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "dsh-partner-inline-error", children: channel.lastError }),
|
|
7073
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
|
|
7074
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7075
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "ACCESS" }),
|
|
7076
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
|
|
6891
7077
|
] }),
|
|
6892
|
-
/* @__PURE__ */ (0,
|
|
7078
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("em", { children: [
|
|
6893
7079
|
pairings.filter((item) => item.status === "pending").length,
|
|
6894
7080
|
" \u4E2A\u5F85\u5904\u7406"
|
|
6895
7081
|
] })
|
|
6896
7082
|
] }),
|
|
6897
|
-
/* @__PURE__ */ (0,
|
|
6898
|
-
/* @__PURE__ */ (0,
|
|
6899
|
-
/* @__PURE__ */ (0,
|
|
6900
|
-
/* @__PURE__ */ (0,
|
|
6901
|
-
/* @__PURE__ */ (0,
|
|
7083
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.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_runtime20.jsxs)("article", { children: [
|
|
7084
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconUserOutline16, { size: 16 }) }),
|
|
7085
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
7086
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: pairing.displayName }),
|
|
7087
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("small", { children: [
|
|
6902
7088
|
pairing.status === "pending" ? "\u7B49\u5F85\u5BA1\u6279" : pairing.status === "approved" ? "\u5DF2\u6388\u6743\u72EC\u7ACB\u4F1A\u8BDD" : "\u5DF2\u963B\u6B62",
|
|
6903
7089
|
" \xB7 ",
|
|
6904
7090
|
new Date(pairing.updatedAt).toLocaleString()
|
|
6905
7091
|
] })
|
|
6906
7092
|
] }),
|
|
6907
|
-
pairing.status === "pending" && /* @__PURE__ */ (0,
|
|
6908
|
-
/* @__PURE__ */ (0,
|
|
7093
|
+
pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
7094
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { onClick: () => {
|
|
6909
7095
|
void actPairing(pairing.id, "blocked");
|
|
6910
7096
|
}, children: "\u62D2\u7EDD" }),
|
|
6911
|
-
/* @__PURE__ */ (0,
|
|
7097
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { className: "is-primary", onClick: () => {
|
|
6912
7098
|
void actPairing(pairing.id, "approved");
|
|
6913
7099
|
}, children: "\u6279\u51C6" })
|
|
6914
7100
|
] }),
|
|
6915
|
-
pairing.status === "approved" && /* @__PURE__ */ (0,
|
|
7101
|
+
pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { onClick: () => {
|
|
6916
7102
|
void actPairing(pairing.id, "blocked");
|
|
6917
7103
|
}, children: "\u64A4\u9500" }),
|
|
6918
|
-
pairing.status === "blocked" && /* @__PURE__ */ (0,
|
|
7104
|
+
pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { onClick: () => {
|
|
6919
7105
|
void actPairing(pairing.id, "approved");
|
|
6920
7106
|
}, children: "\u91CD\u65B0\u6279\u51C6" })
|
|
6921
7107
|
] }, pairing.id)) })
|
|
6922
7108
|
] }),
|
|
6923
|
-
error && /* @__PURE__ */ (0,
|
|
7109
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "dsh-partner-inline-error", children: error })
|
|
6924
7110
|
] });
|
|
6925
7111
|
}
|
|
6926
7112
|
function MemoryPanel({ companion, snapshot, openSession, startSession, renewSession, onChanged }) {
|
|
@@ -7062,157 +7248,157 @@ function MemoryPanel({ companion, snapshot, openSession, startSession, renewSess
|
|
|
7062
7248
|
setBusy(false);
|
|
7063
7249
|
}
|
|
7064
7250
|
};
|
|
7065
|
-
return /* @__PURE__ */ (0,
|
|
7066
|
-
/* @__PURE__ */ (0,
|
|
7067
|
-
/* @__PURE__ */ (0,
|
|
7068
|
-
/* @__PURE__ */ (0,
|
|
7069
|
-
/* @__PURE__ */ (0,
|
|
7070
|
-
/* @__PURE__ */ (0,
|
|
7071
|
-
/* @__PURE__ */ (0,
|
|
7251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-form is-memory", children: [
|
|
7252
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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" }),
|
|
7253
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-metrics", children: [
|
|
7254
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("article", { children: [
|
|
7255
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u4F19\u4F34\u4F1A\u8BDD" }),
|
|
7256
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: sessions2.length }),
|
|
7257
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: localSession ? `1 \u4E2A\u672C\u5730 \xB7 ${channelSessionCount} \u4E2A\u6E20\u9053` : `${channelSessionCount} \u4E2A\u6E20\u9053` })
|
|
7072
7258
|
] }),
|
|
7073
|
-
/* @__PURE__ */ (0,
|
|
7074
|
-
/* @__PURE__ */ (0,
|
|
7075
|
-
/* @__PURE__ */ (0,
|
|
7076
|
-
/* @__PURE__ */ (0,
|
|
7259
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("article", { children: [
|
|
7260
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u957F\u671F\u8BB0\u5FC6" }),
|
|
7261
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: memories.filter((item) => item.status === "active").length }),
|
|
7262
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { children: [
|
|
7077
7263
|
reflections.length,
|
|
7078
7264
|
" \u7BC7\u6BCF\u65E5\u56DE\u987E"
|
|
7079
7265
|
] })
|
|
7080
7266
|
] }),
|
|
7081
|
-
/* @__PURE__ */ (0,
|
|
7082
|
-
/* @__PURE__ */ (0,
|
|
7083
|
-
/* @__PURE__ */ (0,
|
|
7084
|
-
/* @__PURE__ */ (0,
|
|
7267
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("article", { children: [
|
|
7268
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u6700\u8FD1\u5FC3\u8DF3" }),
|
|
7269
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: heartbeat?.lastCheckedAt ? relativeTime(heartbeat.lastCheckedAt) : "\u5C1A\u672A" }),
|
|
7270
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: heartbeat?.lastError ? "\u4E0A\u6B21\u6267\u884C\u5F02\u5E38" : `\u4ECA\u65E5\u53D1\u9001 ${heartbeat?.sentCount ?? 0} \u6B21` })
|
|
7085
7271
|
] })
|
|
7086
7272
|
] }),
|
|
7087
|
-
/* @__PURE__ */ (0,
|
|
7088
|
-
/* @__PURE__ */ (0,
|
|
7089
|
-
/* @__PURE__ */ (0,
|
|
7090
|
-
/* @__PURE__ */ (0,
|
|
7091
|
-
/* @__PURE__ */ (0,
|
|
7092
|
-
/* @__PURE__ */ (0,
|
|
7273
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-automation-grid", children: [
|
|
7274
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { className: "dsh-partner-automation", children: [
|
|
7275
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { children: [
|
|
7276
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7277
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "\u5B66\u4E60\u4E0E\u957F\u671F\u8BB0\u5FC6" }),
|
|
7278
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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" })
|
|
7093
7279
|
] }),
|
|
7094
|
-
/* @__PURE__ */ (0,
|
|
7280
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.memory.enabled, "aria-label": "\u542F\u7528\u4F19\u4F34\u5B66\u4E60", onClick: () => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, enabled: !current2.memory.enabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", {}) })
|
|
7095
7281
|
] }),
|
|
7096
|
-
/* @__PURE__ */ (0,
|
|
7097
|
-
/* @__PURE__ */ (0,
|
|
7098
|
-
/* @__PURE__ */ (0,
|
|
7099
|
-
/* @__PURE__ */ (0,
|
|
7100
|
-
/* @__PURE__ */ (0,
|
|
7101
|
-
/* @__PURE__ */ (0,
|
|
7102
|
-
/* @__PURE__ */ (0,
|
|
7103
|
-
/* @__PURE__ */ (0,
|
|
7282
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-automation-fields is-memory-model", children: [
|
|
7283
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FormField, { label: "\u4FDD\u7559\u671F\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("select", { value: automation.memory.retentionDays, onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, retentionDays: Number(event.target.value) } })), children: [
|
|
7284
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 0, children: "\u6C38\u4E45\u4FDD\u7559" }),
|
|
7285
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 30, children: "30 \u5929" }),
|
|
7286
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 90, children: "90 \u5929" }),
|
|
7287
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 180, children: "180 \u5929" }),
|
|
7288
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 365, children: "1 \u5E74" }),
|
|
7289
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 1095, children: "3 \u5E74" })
|
|
7104
7290
|
] }) }),
|
|
7105
|
-
/* @__PURE__ */ (0,
|
|
7106
|
-
/* @__PURE__ */ (0,
|
|
7291
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FormField, { label: "\u63D0\u70BC Provider", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("select", { value: automation.memory.provider ?? "", onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, provider: event.target.value, model: "" } })), children: [
|
|
7292
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("option", { value: "", children: [
|
|
7107
7293
|
"\u8DDF\u968F\u4F19\u4F34 \xB7 ",
|
|
7108
7294
|
inheritedProvider || "DSH \u9ED8\u8BA4"
|
|
7109
7295
|
] }),
|
|
7110
|
-
modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0,
|
|
7296
|
+
modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: provider.id, children: provider.name || provider.id }, provider.id))
|
|
7111
7297
|
] }) }),
|
|
7112
|
-
/* @__PURE__ */ (0,
|
|
7113
|
-
/* @__PURE__ */ (0,
|
|
7298
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FormField, { label: "\u63D0\u70BC\u6A21\u578B", hint: "\u9ED8\u8BA4\u7EE7\u627F\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("select", { value: automation.memory.model ?? "", onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, model: event.target.value } })), children: [
|
|
7299
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("option", { value: "", children: [
|
|
7114
7300
|
"\u8DDF\u968F\u4F19\u4F34 \xB7 ",
|
|
7115
7301
|
companion.model || modelCatalog?.defaultSelection.model || "DSH \u9ED8\u8BA4"
|
|
7116
7302
|
] }),
|
|
7117
|
-
modelOptions.map((model) => /* @__PURE__ */ (0,
|
|
7303
|
+
modelOptions.map((model) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: model.id, children: model.name || model.id }, model.id))
|
|
7118
7304
|
] }) })
|
|
7119
7305
|
] }),
|
|
7120
|
-
/* @__PURE__ */ (0,
|
|
7121
|
-
/* @__PURE__ */ (0,
|
|
7122
|
-
/* @__PURE__ */ (0,
|
|
7123
|
-
/* @__PURE__ */ (0,
|
|
7124
|
-
/* @__PURE__ */ (0,
|
|
7306
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-review-policy", children: [
|
|
7307
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.memory.dailyReviewEnabled, "aria-label": "\u542F\u7528\u6BCF\u65E5\u7EC8\u5BA1", onClick: () => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, dailyReviewEnabled: !current2.memory.dailyReviewEnabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", {}) }),
|
|
7308
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7309
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "\u6BCF\u65E5\u7EC8\u5BA1" }),
|
|
7310
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u6B21\u65E5\u81EA\u52A8\u5408\u5E76\u91CD\u590D\u3001\u7EA0\u6B63\u504F\u5DEE\u5E76\u5EFA\u7ACB\u8BB0\u5FC6\u5173\u7CFB" })
|
|
7125
7311
|
] }),
|
|
7126
|
-
/* @__PURE__ */ (0,
|
|
7312
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("label", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("select", { "aria-label": "\u6BCF\u65E5\u7EC8\u5BA1\u65F6\u95F4", value: automation.memory.dailyReviewHour, onChange: (event) => setAutomation((current2) => ({ ...current2, memory: { ...current2.memory, dailyReviewHour: Number(event.target.value) } })), children: Array.from({ length: 24 }, (_, hour) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("option", { value: hour, children: [
|
|
7127
7313
|
String(hour).padStart(2, "0"),
|
|
7128
7314
|
":00"
|
|
7129
7315
|
] }, hour)) }) }),
|
|
7130
|
-
/* @__PURE__ */ (0,
|
|
7316
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", disabled: busy || reflections.length === 0, onClick: () => {
|
|
7131
7317
|
void review();
|
|
7132
7318
|
}, children: "\u7ACB\u5373\u7EC8\u5BA1" })
|
|
7133
7319
|
] })
|
|
7134
7320
|
] }),
|
|
7135
|
-
/* @__PURE__ */ (0,
|
|
7136
|
-
/* @__PURE__ */ (0,
|
|
7137
|
-
/* @__PURE__ */ (0,
|
|
7138
|
-
/* @__PURE__ */ (0,
|
|
7139
|
-
/* @__PURE__ */ (0,
|
|
7321
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { className: "dsh-partner-automation", children: [
|
|
7322
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { children: [
|
|
7323
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7324
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "\u6301\u7EED\u611F\u77E5" }),
|
|
7325
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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" })
|
|
7140
7326
|
] }),
|
|
7141
|
-
/* @__PURE__ */ (0,
|
|
7327
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": automation.heartbeat.enabled, "aria-label": "\u542F\u7528\u4F19\u4F34\u5FC3\u8DF3", onClick: () => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, enabled: !current2.heartbeat.enabled } })), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", {}) })
|
|
7142
7328
|
] }),
|
|
7143
|
-
/* @__PURE__ */ (0,
|
|
7144
|
-
/* @__PURE__ */ (0,
|
|
7145
|
-
/* @__PURE__ */ (0,
|
|
7146
|
-
/* @__PURE__ */ (0,
|
|
7147
|
-
/* @__PURE__ */ (0,
|
|
7148
|
-
/* @__PURE__ */ (0,
|
|
7149
|
-
/* @__PURE__ */ (0,
|
|
7150
|
-
/* @__PURE__ */ (0,
|
|
7329
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-automation-fields is-heartbeat", children: [
|
|
7330
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FormField, { label: "\u68C0\u67E5\u95F4\u9694", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("select", { value: automation.heartbeat.intervalMinutes, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, intervalMinutes: Number(event.target.value) } })), children: [
|
|
7331
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 30, children: "30 \u5206\u949F" }),
|
|
7332
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 60, children: "1 \u5C0F\u65F6" }),
|
|
7333
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 180, children: "3 \u5C0F\u65F6" }),
|
|
7334
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 360, children: "6 \u5C0F\u65F6" }),
|
|
7335
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 720, children: "12 \u5C0F\u65F6" }),
|
|
7336
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 1440, children: "24 \u5C0F\u65F6" })
|
|
7151
7337
|
] }) }),
|
|
7152
|
-
/* @__PURE__ */ (0,
|
|
7153
|
-
/* @__PURE__ */ (0,
|
|
7154
|
-
/* @__PURE__ */ (0,
|
|
7155
|
-
/* @__PURE__ */ (0,
|
|
7156
|
-
/* @__PURE__ */ (0,
|
|
7157
|
-
/* @__PURE__ */ (0,
|
|
7158
|
-
/* @__PURE__ */ (0,
|
|
7159
|
-
/* @__PURE__ */ (0,
|
|
7160
|
-
/* @__PURE__ */ (0,
|
|
7338
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FormField, { label: "\u514D\u6253\u6270\u5F00\u59CB", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { type: "number", min: 0, max: 23, value: automation.heartbeat.quietStartHour, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, quietStartHour: Number(event.target.value) } })) }) }),
|
|
7339
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FormField, { label: "\u514D\u6253\u6270\u7ED3\u675F", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { type: "number", min: 0, max: 23, value: automation.heartbeat.quietEndHour, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, quietEndHour: Number(event.target.value) } })) }) }),
|
|
7340
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FormField, { label: "\u6BCF\u65E5\u4E0A\u9650", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("select", { value: automation.heartbeat.dailyLimit, onChange: (event) => setAutomation((current2) => ({ ...current2, heartbeat: { ...current2.heartbeat, dailyLimit: Number(event.target.value) } })), children: [
|
|
7341
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 0, children: "\u4E0D\u9650" }),
|
|
7342
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 1, children: "1 \u6B21" }),
|
|
7343
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 2, children: "2 \u6B21" }),
|
|
7344
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 3, children: "3 \u6B21" }),
|
|
7345
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 5, children: "5 \u6B21" }),
|
|
7346
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value: 8, children: "8 \u6B21" })
|
|
7161
7347
|
] }) })
|
|
7162
7348
|
] }),
|
|
7163
|
-
/* @__PURE__ */ (0,
|
|
7349
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ConcernBoard, { companionId: companion.id, activity: concernActivity, value: newConcern, busy, onValue: setNewConcern, onAdd: () => {
|
|
7164
7350
|
void addConcern();
|
|
7165
7351
|
}, onCheck: (item) => {
|
|
7166
7352
|
void trigger(item.id);
|
|
7167
7353
|
}, onAct: (item, action) => {
|
|
7168
7354
|
void actConcern(item, action);
|
|
7169
7355
|
} }),
|
|
7170
|
-
heartbeat?.lastError && /* @__PURE__ */ (0,
|
|
7171
|
-
/* @__PURE__ */ (0,
|
|
7172
|
-
/* @__PURE__ */ (0,
|
|
7356
|
+
heartbeat?.lastError && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "dsh-partner-inline-error", children: heartbeat.lastError }),
|
|
7357
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-automation-actions", children: [
|
|
7358
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", disabled: busy || sessions2.length === 0, onClick: () => {
|
|
7173
7359
|
void trigger();
|
|
7174
7360
|
}, children: "\u68C0\u67E5\u5230\u671F\u9879" }),
|
|
7175
|
-
/* @__PURE__ */ (0,
|
|
7361
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => {
|
|
7176
7362
|
void save();
|
|
7177
7363
|
}, children: busy ? "\u6B63\u5728\u5904\u7406\u2026" : "\u4FDD\u5B58\u8BBE\u7F6E" })
|
|
7178
7364
|
] })
|
|
7179
7365
|
] })
|
|
7180
7366
|
] }),
|
|
7181
|
-
notice && /* @__PURE__ */ (0,
|
|
7182
|
-
/* @__PURE__ */ (0,
|
|
7367
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { className: "dsh-partner-inline-notice", children: [
|
|
7368
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconCheckOutline14, { size: 14 }),
|
|
7183
7369
|
notice
|
|
7184
7370
|
] }),
|
|
7185
|
-
error && /* @__PURE__ */ (0,
|
|
7186
|
-
/* @__PURE__ */ (0,
|
|
7371
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
|
|
7372
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MemoryLibrary, { companionId: companion.id, revision: memoryRevision, profiles, memories, reflections, editing, busy, setEditing, save: () => {
|
|
7187
7373
|
void saveMemory();
|
|
7188
7374
|
}, remove: (item) => {
|
|
7189
7375
|
void deleteMemory(item);
|
|
7190
7376
|
} }),
|
|
7191
|
-
/* @__PURE__ */ (0,
|
|
7192
|
-
/* @__PURE__ */ (0,
|
|
7193
|
-
/* @__PURE__ */ (0,
|
|
7194
|
-
/* @__PURE__ */ (0,
|
|
7377
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-section-heading", children: [
|
|
7378
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7379
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "SESSIONS" }),
|
|
7380
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "\u4F19\u4F34\u4F1A\u8BDD" })
|
|
7195
7381
|
] }),
|
|
7196
|
-
localSession === void 0 && /* @__PURE__ */ (0,
|
|
7382
|
+
localSession === void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", onClick: () => {
|
|
7197
7383
|
void startSession(companion.id);
|
|
7198
7384
|
}, children: [
|
|
7199
|
-
/* @__PURE__ */ (0,
|
|
7385
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconPlusOutline16, { size: 14 }),
|
|
7200
7386
|
"\u5F00\u59CB\u672C\u5730\u5BF9\u8BDD"
|
|
7201
7387
|
] })
|
|
7202
7388
|
] }),
|
|
7203
|
-
/* @__PURE__ */ (0,
|
|
7204
|
-
sessions2.map((item) => /* @__PURE__ */ (0,
|
|
7205
|
-
/* @__PURE__ */ (0,
|
|
7206
|
-
/* @__PURE__ */ (0,
|
|
7207
|
-
/* @__PURE__ */ (0,
|
|
7208
|
-
/* @__PURE__ */ (0,
|
|
7389
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-session-list", children: [
|
|
7390
|
+
sessions2.map((item) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("article", { "data-archived": item.archived, "data-kind": item.kind, children: [
|
|
7391
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconDataOutline16, { size: 16 }) }),
|
|
7392
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
7393
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: item.kind === "local" ? "\u672C\u5730\u4F19\u4F34\u4F1A\u8BDD" : `\u5FAE\u4FE1\u8054\u7CFB\u4EBA \xB7 ${item.userId.slice(-6)}` }),
|
|
7394
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: item.archived ? "\u5DF2\u5F52\u6863 \xB7 \u957F\u671F\u8BB0\u5FC6\u4FDD\u7559" : `${item.sessionId} \xB7 ${new Date(item.lastMessageAt).toLocaleString()}` })
|
|
7209
7395
|
] }),
|
|
7210
|
-
/* @__PURE__ */ (0,
|
|
7396
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: item.archived ? "is-primary" : void 0, onClick: () => {
|
|
7211
7397
|
if (item.archived) void renewSession(item.id);
|
|
7212
7398
|
else void openSession(item.id, item.sessionId);
|
|
7213
7399
|
}, children: item.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
|
|
7214
7400
|
] }, item.id)),
|
|
7215
|
-
sessions2.length === 0 && /* @__PURE__ */ (0,
|
|
7401
|
+
sessions2.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime20.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_runtime20.jsx)("button", { type: "button", onClick: () => {
|
|
7216
7402
|
void startSession(companion.id);
|
|
7217
7403
|
}, children: "\u5F00\u59CB\u5BF9\u8BDD" }), compact: true })
|
|
7218
7404
|
] })
|
|
@@ -7284,25 +7470,25 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
|
|
|
7284
7470
|
inputRef.current?.setSelectionRange(cursor, cursor);
|
|
7285
7471
|
});
|
|
7286
7472
|
};
|
|
7287
|
-
return /* @__PURE__ */ (0,
|
|
7288
|
-
/* @__PURE__ */ (0,
|
|
7289
|
-
/* @__PURE__ */ (0,
|
|
7290
|
-
/* @__PURE__ */ (0,
|
|
7473
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { className: "dsh-partner-concern-board", "aria-labelledby": "partner-concerns-title", children: [
|
|
7474
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { children: [
|
|
7475
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7476
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("strong", { id: "partner-concerns-title", children: [
|
|
7291
7477
|
"\u4F19\u4F34\u5728\u610F\u7684\u4E8B ",
|
|
7292
|
-
/* @__PURE__ */ (0,
|
|
7478
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("b", { children: active.length })
|
|
7293
7479
|
] }),
|
|
7294
|
-
/* @__PURE__ */ (0,
|
|
7480
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: "\u5C1A\u672A\u95ED\u73AF\u3001\u503C\u5F97\u7EE7\u7EED\u7559\u610F\u7684\u4E8B\u60C5" })
|
|
7295
7481
|
] }),
|
|
7296
|
-
/* @__PURE__ */ (0,
|
|
7297
|
-
/* @__PURE__ */ (0,
|
|
7482
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", "aria-expanded": composing, onClick: () => setComposing((current2) => !current2), children: [
|
|
7483
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconPlusOutline16, { size: 14 }),
|
|
7298
7484
|
"\u4EA4\u4EE3\u4E00\u4EF6\u4E8B"
|
|
7299
7485
|
] })
|
|
7300
7486
|
] }),
|
|
7301
|
-
composing && /* @__PURE__ */ (0,
|
|
7302
|
-
/* @__PURE__ */ (0,
|
|
7303
|
-
/* @__PURE__ */ (0,
|
|
7304
|
-
/* @__PURE__ */ (0,
|
|
7305
|
-
/* @__PURE__ */ (0,
|
|
7487
|
+
composing && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("form", { className: "dsh-partner-concern-compose", onSubmit: submit, children: [
|
|
7488
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { children: [
|
|
7489
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "\u9700\u8981\u7559\u610F\u7684\u4E8B" }),
|
|
7490
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-concern-input-wrap", children: [
|
|
7491
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
7306
7492
|
"input",
|
|
7307
7493
|
{
|
|
7308
7494
|
ref: inputRef,
|
|
@@ -7338,10 +7524,10 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
|
|
|
7338
7524
|
}
|
|
7339
7525
|
}
|
|
7340
7526
|
),
|
|
7341
|
-
suggestionsOpen && /* @__PURE__ */ (0,
|
|
7527
|
+
suggestionsOpen && /* @__PURE__ */ (0, import_jsx_runtime20.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_runtime20.jsx)("p", { role: "status", children: "\u6B63\u5728\u67E5\u627E\u53EF\u5F15\u7528\u5185\u5BB9\u2026" }) : sourceError ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { role: "status", children: [
|
|
7342
7528
|
"\u5019\u9009\u52A0\u8F7D\u5931\u8D25\uFF1A",
|
|
7343
7529
|
sourceError
|
|
7344
|
-
] }) : sources.length === 0 ? /* @__PURE__ */ (0,
|
|
7530
|
+
] }) : sources.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.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_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: sources.map((source, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
7345
7531
|
"button",
|
|
7346
7532
|
{
|
|
7347
7533
|
type: "button",
|
|
@@ -7353,97 +7539,97 @@ function ConcernBoard({ companionId, activity, value, busy, onValue, onAdd, onCh
|
|
|
7353
7539
|
onMouseEnter: () => setActiveSource(index),
|
|
7354
7540
|
onClick: () => chooseSource(source),
|
|
7355
7541
|
children: [
|
|
7356
|
-
/* @__PURE__ */ (0,
|
|
7357
|
-
/* @__PURE__ */ (0,
|
|
7358
|
-
/* @__PURE__ */ (0,
|
|
7542
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: source.kind === "file" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconDataOutline16, { size: 15 }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconLinkOutline16, { size: 15 }) }),
|
|
7543
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: source.label }),
|
|
7544
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: source.detail })
|
|
7359
7545
|
]
|
|
7360
7546
|
},
|
|
7361
7547
|
`${source.kind}:${source.token}`
|
|
7362
7548
|
)) }) })
|
|
7363
7549
|
] }),
|
|
7364
|
-
/* @__PURE__ */ (0,
|
|
7550
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("small", { className: "dsh-partner-concern-compose-hint", children: [
|
|
7365
7551
|
"\u8F93\u5165 ",
|
|
7366
|
-
/* @__PURE__ */ (0,
|
|
7552
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("b", { children: "@" }),
|
|
7367
7553
|
" \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"
|
|
7368
7554
|
] })
|
|
7369
7555
|
] }),
|
|
7370
|
-
/* @__PURE__ */ (0,
|
|
7371
|
-
/* @__PURE__ */ (0,
|
|
7556
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
7557
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: () => {
|
|
7372
7558
|
setComposing(false);
|
|
7373
7559
|
setMention(void 0);
|
|
7374
7560
|
onValue("");
|
|
7375
7561
|
}, children: "\u53D6\u6D88" }),
|
|
7376
|
-
/* @__PURE__ */ (0,
|
|
7562
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "submit", className: "is-primary", disabled: busy || !value.trim(), children: "\u8BA9\u4F19\u4F34\u8BB0\u7740" })
|
|
7377
7563
|
] })
|
|
7378
7564
|
] }),
|
|
7379
|
-
/* @__PURE__ */ (0,
|
|
7565
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-concern-list", role: "list", children: active.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.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) => {
|
|
7380
7566
|
const observation = latest.get(item.id);
|
|
7381
7567
|
const expanded = expandedId === item.id;
|
|
7382
7568
|
const status = observation ? concernObservationStatus(observation) : item.state === "active" ? "\u6B63\u5728\u7559\u610F" : "\u6682\u65F6\u8BB0\u7740";
|
|
7383
|
-
return /* @__PURE__ */ (0,
|
|
7384
|
-
/* @__PURE__ */ (0,
|
|
7385
|
-
/* @__PURE__ */ (0,
|
|
7386
|
-
/* @__PURE__ */ (0,
|
|
7569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("article", { role: "listitem", "data-state": item.state, "data-expanded": expanded, children: [
|
|
7570
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: "dsh-partner-concern-row", "aria-expanded": expanded, onClick: () => setExpandedId((current2) => current2 === item.id ? void 0 : item.id), children: [
|
|
7571
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "dsh-partner-concern-state", children: [
|
|
7572
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", {}),
|
|
7387
7573
|
status
|
|
7388
7574
|
] }),
|
|
7389
|
-
/* @__PURE__ */ (0,
|
|
7390
|
-
/* @__PURE__ */ (0,
|
|
7391
|
-
/* @__PURE__ */ (0,
|
|
7575
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "dsh-partner-concern-copy", children: [
|
|
7576
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: item.subject }),
|
|
7577
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: observation ? observation.event : item.reason })
|
|
7392
7578
|
] }),
|
|
7393
|
-
/* @__PURE__ */ (0,
|
|
7394
|
-
/* @__PURE__ */ (0,
|
|
7395
|
-
/* @__PURE__ */ (0,
|
|
7579
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "dsh-partner-concern-time", title: `\u8BA1\u5212\u4E8E ${new Date(item.nextCheckAt).toLocaleString()} \u518D\u6B21\u7559\u610F`, children: [
|
|
7580
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u4E0B\u6B21\u7559\u610F" }),
|
|
7581
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: futureTime(item.nextCheckAt) })
|
|
7396
7582
|
] }),
|
|
7397
|
-
/* @__PURE__ */ (0,
|
|
7583
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconChevronDownOutline14, { size: 14 })
|
|
7398
7584
|
] }),
|
|
7399
|
-
expanded && /* @__PURE__ */ (0,
|
|
7400
|
-
/* @__PURE__ */ (0,
|
|
7401
|
-
observation && /* @__PURE__ */ (0,
|
|
7402
|
-
/* @__PURE__ */ (0,
|
|
7403
|
-
/* @__PURE__ */ (0,
|
|
7404
|
-
/* @__PURE__ */ (0,
|
|
7405
|
-
/* @__PURE__ */ (0,
|
|
7406
|
-
/* @__PURE__ */ (0,
|
|
7585
|
+
expanded && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-concern-detail", children: [
|
|
7586
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: item.reason }),
|
|
7587
|
+
observation && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
7588
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("blockquote", { children: observation.event }),
|
|
7589
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-concern-decision", "data-decision": observation.decision, children: [
|
|
7590
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: concernObservationStatus(observation) }),
|
|
7591
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: observation.decisionReason || concernObservationExplanation(observation) }),
|
|
7592
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("small", { children: [
|
|
7407
7593
|
"\u6253\u6270\u5206\u6570 ",
|
|
7408
7594
|
Math.round(observation.interruptScore * 100),
|
|
7409
7595
|
observation.notificationRuleEffect !== "auto" && observation.notificationRuleReason ? ` \xB7 \u77E5\u8BC6\u89C4\u5219\uFF1A${observation.notificationRuleReason}` : ""
|
|
7410
7596
|
] })
|
|
7411
7597
|
] })
|
|
7412
7598
|
] }),
|
|
7413
|
-
item.resources.length > 0 && /* @__PURE__ */ (0,
|
|
7599
|
+
item.resources.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-concern-resources", children: item.resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7414
7600
|
resource.kind === "file" ? "\u6587\u4EF6" : "\u77E5\u8BC6",
|
|
7415
7601
|
" \xB7 ",
|
|
7416
7602
|
resource.label
|
|
7417
7603
|
] }, `${resource.kind}:${resource.locator}`)) }),
|
|
7418
|
-
/* @__PURE__ */ (0,
|
|
7604
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("small", { children: [
|
|
7419
7605
|
item.origin === "explicit" ? "\u4F60\u660E\u786E\u4EA4\u4EE3" : "\u4F19\u4F34\u4ECE\u5BF9\u8BDD\u4E2D\u6CE8\u610F\u5230",
|
|
7420
7606
|
" \xB7 ",
|
|
7421
7607
|
watchKindLabel(item.watchKind)
|
|
7422
7608
|
] }),
|
|
7423
|
-
/* @__PURE__ */ (0,
|
|
7424
|
-
/* @__PURE__ */ (0,
|
|
7425
|
-
/* @__PURE__ */ (0,
|
|
7426
|
-
/* @__PURE__ */ (0,
|
|
7427
|
-
/* @__PURE__ */ (0,
|
|
7428
|
-
/* @__PURE__ */ (0,
|
|
7609
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-concern-actions", "aria-label": `${item.subject} \u7684\u64CD\u4F5C`, children: [
|
|
7610
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", disabled: busy, onClick: () => onCheck(item), children: "\u7ACB\u5373\u68C0\u67E5\u8FD9\u6761" }),
|
|
7611
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u7EE7\u7EED\u7559\u610F" }),
|
|
7612
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "prioritize"), children: "\u63D0\u9AD8\u5173\u6CE8" }),
|
|
7613
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "resolve"), children: "\u5DF2\u7ECF\u89E3\u51B3" }),
|
|
7614
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: () => onAct(item, "ignore"), children: "\u522B\u7BA1\u8FD9\u4E2A" })
|
|
7429
7615
|
] })
|
|
7430
7616
|
] })
|
|
7431
7617
|
] }, item.id);
|
|
7432
7618
|
}) }),
|
|
7433
|
-
(active.length > shown.length || visibleCount > 5) && /* @__PURE__ */ (0,
|
|
7619
|
+
(active.length > shown.length || visibleCount > 5) && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-concern-more", children: active.length > shown.length ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", onClick: () => setVisibleCount((count) => Math.min(active.length, count + 20)), children: [
|
|
7434
7620
|
"\u518D\u663E\u793A ",
|
|
7435
7621
|
Math.min(20, active.length - shown.length),
|
|
7436
7622
|
" \u6761"
|
|
7437
|
-
] }) : /* @__PURE__ */ (0,
|
|
7438
|
-
resolved.length > 0 && /* @__PURE__ */ (0,
|
|
7439
|
-
/* @__PURE__ */ (0,
|
|
7623
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: () => setVisibleCount(5), children: "\u6536\u8D77\u5217\u8868" }) }),
|
|
7624
|
+
resolved.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("details", { className: "dsh-partner-concern-resolved", children: [
|
|
7625
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("summary", { children: [
|
|
7440
7626
|
"\u5DF2\u7ECF\u89E3\u51B3 ",
|
|
7441
|
-
/* @__PURE__ */ (0,
|
|
7627
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("b", { children: resolved.length })
|
|
7442
7628
|
] }),
|
|
7443
|
-
/* @__PURE__ */ (0,
|
|
7444
|
-
/* @__PURE__ */ (0,
|
|
7445
|
-
/* @__PURE__ */ (0,
|
|
7446
|
-
/* @__PURE__ */ (0,
|
|
7629
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: resolved.slice(0, 30).map((item) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("article", { children: [
|
|
7630
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconCheckOutline14, { size: 13 }) }),
|
|
7631
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: item.subject }),
|
|
7632
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", disabled: busy, onClick: () => onAct(item, "watch"), children: "\u91CD\u65B0\u7559\u610F" })
|
|
7447
7633
|
] }, item.id)) })
|
|
7448
7634
|
] })
|
|
7449
7635
|
] });
|
|
@@ -7508,67 +7694,67 @@ function MemoryLibrary({ companionId, revision, profiles, memories, reflections,
|
|
|
7508
7694
|
), [reflections, normalized]);
|
|
7509
7695
|
const selectedMemory = filteredMemories.find((item) => item.id === selectedMemoryId) ?? filteredMemories[0];
|
|
7510
7696
|
const selectedReflection = filteredReflections.find((item) => item.date === selectedDate) ?? filteredReflections[0];
|
|
7511
|
-
return /* @__PURE__ */ (0,
|
|
7512
|
-
/* @__PURE__ */ (0,
|
|
7513
|
-
/* @__PURE__ */ (0,
|
|
7514
|
-
/* @__PURE__ */ (0,
|
|
7515
|
-
/* @__PURE__ */ (0,
|
|
7516
|
-
/* @__PURE__ */ (0,
|
|
7697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { className: "dsh-partner-memory-library", children: [
|
|
7698
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { className: "dsh-partner-library-header", children: [
|
|
7699
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7700
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "MEMORY LIBRARY" }),
|
|
7701
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: "\u4F19\u4F34\u8BB0\u5FC6\u5E93" }),
|
|
7702
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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" })
|
|
7517
7703
|
] }),
|
|
7518
|
-
/* @__PURE__ */ (0,
|
|
7519
|
-
/* @__PURE__ */ (0,
|
|
7704
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("nav", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", children: [
|
|
7705
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: mode === "profile" ? "is-active" : "", onClick: () => setMode("profile"), children: [
|
|
7520
7706
|
"\u4EBA\u7269\u753B\u50CF ",
|
|
7521
|
-
/* @__PURE__ */ (0,
|
|
7707
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("b", { children: profiles.length })
|
|
7522
7708
|
] }),
|
|
7523
|
-
/* @__PURE__ */ (0,
|
|
7709
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: mode === "memory" ? "is-active" : "", onClick: () => setMode("memory"), children: [
|
|
7524
7710
|
"\u8BDD\u9898\u8BB0\u5FC6 ",
|
|
7525
|
-
/* @__PURE__ */ (0,
|
|
7711
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("b", { children: activeMemories.length })
|
|
7526
7712
|
] }),
|
|
7527
|
-
/* @__PURE__ */ (0,
|
|
7713
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: mode === "reflection" ? "is-active" : "", onClick: () => setMode("reflection"), children: [
|
|
7528
7714
|
"\u6BCF\u65E5\u56DE\u987E ",
|
|
7529
|
-
/* @__PURE__ */ (0,
|
|
7715
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("b", { children: reflections.length })
|
|
7530
7716
|
] }),
|
|
7531
|
-
/* @__PURE__ */ (0,
|
|
7717
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: mode === "graph" ? "is-active" : "", onClick: () => setMode("graph"), children: [
|
|
7532
7718
|
"\u5173\u7CFB\u56FE\u8C31 ",
|
|
7533
|
-
/* @__PURE__ */ (0,
|
|
7719
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("b", { children: graph?.relations.length ?? "\u2014" })
|
|
7534
7720
|
] })
|
|
7535
7721
|
] })
|
|
7536
7722
|
] }),
|
|
7537
|
-
mode !== "profile" && /* @__PURE__ */ (0,
|
|
7538
|
-
/* @__PURE__ */ (0,
|
|
7539
|
-
/* @__PURE__ */ (0,
|
|
7540
|
-
/* @__PURE__ */ (0,
|
|
7723
|
+
mode !== "profile" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-library-tools", children: [
|
|
7724
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { children: [
|
|
7725
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "sr-only", children: "\u641C\u7D22\u8BB0\u5FC6" }),
|
|
7726
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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" })
|
|
7541
7727
|
] }),
|
|
7542
|
-
mode === "memory" && /* @__PURE__ */ (0,
|
|
7728
|
+
mode === "memory" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-memory-kinds", children: MEMORY_KINDS.map((value) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: kind === value ? "is-active" : "", onClick: () => setKind(value), children: value === "all" ? "\u5168\u90E8" : memoryKind(value) }, value)) })
|
|
7543
7729
|
] }),
|
|
7544
|
-
mode === "profile" ? /* @__PURE__ */ (0,
|
|
7545
|
-
/* @__PURE__ */ (0,
|
|
7730
|
+
mode === "profile" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ProfileLibrary, { profiles, memories: profileMemories, editing, busy, setEditing, save, remove }) : mode === "memory" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-library-browser", children: [
|
|
7731
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-library-list", role: "list", children: filteredMemories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.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_runtime20.jsxs)("button", { type: "button", role: "listitem", className: selectedMemory?.id === item.id ? "is-active" : "", onClick: () => {
|
|
7546
7732
|
setSelectedMemoryId(item.id);
|
|
7547
7733
|
setEditing(void 0);
|
|
7548
7734
|
}, children: [
|
|
7549
|
-
/* @__PURE__ */ (0,
|
|
7550
|
-
/* @__PURE__ */ (0,
|
|
7551
|
-
/* @__PURE__ */ (0,
|
|
7552
|
-
/* @__PURE__ */ (0,
|
|
7735
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { "data-kind": item.kind, children: memoryKind(item.kind) }),
|
|
7736
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: item.subject }),
|
|
7737
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: item.content }),
|
|
7738
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: relativeTime(item.updatedAt) })
|
|
7553
7739
|
] }, item.id)) }),
|
|
7554
|
-
/* @__PURE__ */ (0,
|
|
7555
|
-
] }) : mode === "reflection" ? /* @__PURE__ */ (0,
|
|
7556
|
-
/* @__PURE__ */ (0,
|
|
7557
|
-
/* @__PURE__ */ (0,
|
|
7558
|
-
/* @__PURE__ */ (0,
|
|
7740
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-library-detail", children: selectedMemory ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MemoryCard, { item: selectedMemory, editing: editing?.id === selectedMemory.id ? editing : void 0, busy, setEditing, save, remove: () => remove(selectedMemory) }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ContentState, { title: "\u9009\u62E9\u4E00\u6761\u8BB0\u5FC6", detail: "\u8BB0\u5FC6\u8BE6\u60C5\u4F1A\u663E\u793A\u5728\u8FD9\u91CC\u3002", compact: true }) })
|
|
7741
|
+
] }) : mode === "reflection" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-library-browser", children: [
|
|
7742
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-library-list is-diary", role: "list", children: filteredReflections.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.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_runtime20.jsxs)("button", { type: "button", role: "listitem", className: selectedReflection?.date === entry.date ? "is-active" : "", onClick: () => setSelectedDate(entry.date), children: [
|
|
7743
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("time", { children: entry.date }),
|
|
7744
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("strong", { children: [
|
|
7559
7745
|
entry.turnCount,
|
|
7560
7746
|
" \u8F6E\u4EA4\u6D41"
|
|
7561
7747
|
] }),
|
|
7562
|
-
/* @__PURE__ */ (0,
|
|
7563
|
-
/* @__PURE__ */ (0,
|
|
7748
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: entry.summary }),
|
|
7749
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("small", { children: [
|
|
7564
7750
|
entry.openTasks.length,
|
|
7565
7751
|
" \u9879\u5F85\u8DDF\u8FDB \xB7 ",
|
|
7566
7752
|
entry.learnings.length,
|
|
7567
7753
|
" \u9879\u7406\u89E3"
|
|
7568
7754
|
] })
|
|
7569
7755
|
] }, entry.date)) }),
|
|
7570
|
-
/* @__PURE__ */ (0,
|
|
7571
|
-
] }) : graphError ? /* @__PURE__ */ (0,
|
|
7756
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-library-detail", children: selectedReflection ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DailyReflectionDetail, { entry: selectedReflection }) : /* @__PURE__ */ (0, import_jsx_runtime20.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 }) })
|
|
7757
|
+
] }) : graphError ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ContentState, { title: "\u5173\u7CFB\u56FE\u8C31\u52A0\u8F7D\u5931\u8D25", detail: graphError, action: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: () => setGraphRequest((value) => value + 1), children: "\u91CD\u65B0\u52A0\u8F7D" }) }) : graphLoading || graph === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.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_runtime20.jsx)(MemoryGraph, { graph, profiles, query: normalized, inspect: (item) => {
|
|
7572
7758
|
setEditing(void 0);
|
|
7573
7759
|
if (item.kind === "profile") setMode("profile");
|
|
7574
7760
|
else {
|
|
@@ -7581,69 +7767,69 @@ function MemoryLibrary({ companionId, revision, profiles, memories, reflections,
|
|
|
7581
7767
|
function ProfileLibrary({ profiles, memories, editing, busy, setEditing, save, remove }) {
|
|
7582
7768
|
const [selectedScopeId, setSelectedScopeId] = (0, import_react24.useState)();
|
|
7583
7769
|
const selected = profiles.find((item) => item.scopeId === selectedScopeId) ?? profiles[0];
|
|
7584
|
-
if (!selected) return /* @__PURE__ */ (0,
|
|
7770
|
+
if (!selected) return /* @__PURE__ */ (0, import_jsx_runtime20.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" });
|
|
7585
7771
|
const activeIds = new Set(selected.entries.map((item) => item.id));
|
|
7586
7772
|
const pending = memories.filter((item) => item.scopeId === selected.scopeId && !activeIds.has(item.id));
|
|
7587
|
-
return /* @__PURE__ */ (0,
|
|
7588
|
-
/* @__PURE__ */ (0,
|
|
7773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-profile-browser", children: [
|
|
7774
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-profile-people", role: "list", "aria-label": "\u8054\u7CFB\u4EBA\u753B\u50CF", children: profiles.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", role: "listitem", className: profile.scopeId === selected.scopeId ? "is-active" : "", onClick: () => {
|
|
7589
7775
|
setSelectedScopeId(profile.scopeId);
|
|
7590
7776
|
setEditing(void 0);
|
|
7591
7777
|
}, children: [
|
|
7592
|
-
/* @__PURE__ */ (0,
|
|
7593
|
-
/* @__PURE__ */ (0,
|
|
7594
|
-
/* @__PURE__ */ (0,
|
|
7595
|
-
/* @__PURE__ */ (0,
|
|
7778
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_dsh_client_ui_primitives16.IconUserOutline16, { size: 16 }) }),
|
|
7779
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
7780
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: profile.label }),
|
|
7781
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: profile.entries.length > 0 ? `${profile.entries.length} \u9879\u7A33\u5B9A\u7406\u89E3` : "\u8FD8\u5728\u8BA4\u8BC6\u4E2D" })
|
|
7596
7782
|
] }),
|
|
7597
|
-
/* @__PURE__ */ (0,
|
|
7783
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", { "aria-hidden": "true" })
|
|
7598
7784
|
] }, profile.scopeId)) }),
|
|
7599
|
-
/* @__PURE__ */ (0,
|
|
7600
|
-
/* @__PURE__ */ (0,
|
|
7601
|
-
/* @__PURE__ */ (0,
|
|
7602
|
-
/* @__PURE__ */ (0,
|
|
7603
|
-
/* @__PURE__ */ (0,
|
|
7785
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-profile-stage", children: [
|
|
7786
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { className: "dsh-partner-profile-heading", children: [
|
|
7787
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7788
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "PARTNER UNDERSTANDING" }),
|
|
7789
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("strong", { children: [
|
|
7604
7790
|
"\u4F19\u4F34\u773C\u4E2D\u7684 ",
|
|
7605
7791
|
selected.label
|
|
7606
7792
|
] }),
|
|
7607
|
-
/* @__PURE__ */ (0,
|
|
7793
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.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" })
|
|
7608
7794
|
] }),
|
|
7609
|
-
/* @__PURE__ */ (0,
|
|
7610
|
-
/* @__PURE__ */ (0,
|
|
7795
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { "data-ready": selected.entries.length > 0, children: [
|
|
7796
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", {}),
|
|
7611
7797
|
selected.entries.length > 0 ? "\u4E0A\u4E0B\u6587\u57FA\u7EBF\u5DF2\u5C31\u7EEA" : "\u7B49\u5F85\u53EF\u9760\u8BC1\u636E"
|
|
7612
7798
|
] })
|
|
7613
7799
|
] }),
|
|
7614
|
-
selected.entries.length > 0 ? /* @__PURE__ */ (0,
|
|
7615
|
-
/* @__PURE__ */ (0,
|
|
7616
|
-
/* @__PURE__ */ (0,
|
|
7617
|
-
/* @__PURE__ */ (0,
|
|
7618
|
-
/* @__PURE__ */ (0,
|
|
7800
|
+
selected.entries.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
7801
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-profile-meta", children: [
|
|
7802
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7803
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u753B\u50CF\u7248\u672C" }),
|
|
7804
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: selected.version })
|
|
7619
7805
|
] }),
|
|
7620
|
-
/* @__PURE__ */ (0,
|
|
7621
|
-
/* @__PURE__ */ (0,
|
|
7622
|
-
/* @__PURE__ */ (0,
|
|
7806
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7807
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u5BF9\u8BDD\u4F9D\u636E" }),
|
|
7808
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("strong", { children: [
|
|
7623
7809
|
selected.evidenceCount,
|
|
7624
7810
|
" \u5904"
|
|
7625
7811
|
] })
|
|
7626
7812
|
] }),
|
|
7627
|
-
/* @__PURE__ */ (0,
|
|
7628
|
-
/* @__PURE__ */ (0,
|
|
7629
|
-
/* @__PURE__ */ (0,
|
|
7813
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7814
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u7528\u6237\u786E\u8BA4" }),
|
|
7815
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("strong", { children: [
|
|
7630
7816
|
selected.lockedCount,
|
|
7631
7817
|
" \u9879"
|
|
7632
7818
|
] })
|
|
7633
7819
|
] }),
|
|
7634
|
-
/* @__PURE__ */ (0,
|
|
7635
|
-
/* @__PURE__ */ (0,
|
|
7636
|
-
/* @__PURE__ */ (0,
|
|
7820
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7821
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u6700\u8FD1\u4F9D\u636E" }),
|
|
7822
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: selected.updatedAt ? relativeTime(selected.updatedAt) : "\u5C1A\u672A" })
|
|
7637
7823
|
] })
|
|
7638
7824
|
] }),
|
|
7639
|
-
/* @__PURE__ */ (0,
|
|
7640
|
-
] }) : /* @__PURE__ */ (0,
|
|
7641
|
-
pending.length > 0 && /* @__PURE__ */ (0,
|
|
7642
|
-
/* @__PURE__ */ (0,
|
|
7825
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-profile-entries", children: selected.entries.map((item) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MemoryCard, { item, editing: editing?.id === item.id ? editing : void 0, busy, setEditing, save, remove: () => remove(item) }, item.id)) })
|
|
7826
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.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 }),
|
|
7827
|
+
pending.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("details", { className: "dsh-partner-profile-pending", children: [
|
|
7828
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("summary", { children: [
|
|
7643
7829
|
"\u5F85\u786E\u8BA4\u7684\u7406\u89E3 ",
|
|
7644
|
-
/* @__PURE__ */ (0,
|
|
7830
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("b", { children: pending.length })
|
|
7645
7831
|
] }),
|
|
7646
|
-
/* @__PURE__ */ (0,
|
|
7832
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: pending.map((item) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MemoryCard, { item, editing: editing?.id === item.id ? editing : void 0, busy, setEditing, save, remove: () => remove(item) }, item.id)) })
|
|
7647
7833
|
] })
|
|
7648
7834
|
] })
|
|
7649
7835
|
] });
|
|
@@ -7668,109 +7854,109 @@ function MemoryGraph({ graph, profiles, query, inspect }) {
|
|
|
7668
7854
|
const target = selected ? byId.get(selected.targetMemoryId) : void 0;
|
|
7669
7855
|
const label = profiles.find((item) => item.scopeId === scopeId)?.label ?? (scopeId ? `\u8054\u7CFB\u4EBA ${scopeId.slice(-6)}` : "\u5F53\u524D\u8054\u7CFB\u4EBA");
|
|
7670
7856
|
const conflictCount = scoped.filter((item) => item.kind === "conflicts_with").length;
|
|
7671
|
-
if (graph.relations.length === 0) return /* @__PURE__ */ (0,
|
|
7672
|
-
return /* @__PURE__ */ (0,
|
|
7673
|
-
/* @__PURE__ */ (0,
|
|
7674
|
-
/* @__PURE__ */ (0,
|
|
7675
|
-
/* @__PURE__ */ (0,
|
|
7676
|
-
/* @__PURE__ */ (0,
|
|
7857
|
+
if (graph.relations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime20.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" });
|
|
7858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-graph-audit", children: [
|
|
7859
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { className: "dsh-partner-graph-toolbar", children: [
|
|
7860
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
7861
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: "\u5173\u7CFB\u5BA1\u8BA1" }),
|
|
7862
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("strong", { children: [
|
|
7677
7863
|
label,
|
|
7678
7864
|
" \u7684\u7406\u89E3\u5173\u7CFB"
|
|
7679
7865
|
] }),
|
|
7680
|
-
/* @__PURE__ */ (0,
|
|
7866
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { children: [
|
|
7681
7867
|
scoped.length,
|
|
7682
7868
|
" \u6761\u53EF\u9760\u8054\u7CFB",
|
|
7683
7869
|
conflictCount > 0 ? `\uFF0C\u5176\u4E2D ${conflictCount} \u6761\u9700\u8981\u786E\u8BA4` : "\uFF0C\u6682\u65E0\u5F85\u786E\u8BA4\u51B2\u7A81"
|
|
7684
7870
|
] })
|
|
7685
7871
|
] }),
|
|
7686
|
-
scopeIds.length > 1 && /* @__PURE__ */ (0,
|
|
7687
|
-
/* @__PURE__ */ (0,
|
|
7688
|
-
/* @__PURE__ */ (0,
|
|
7872
|
+
scopeIds.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { children: [
|
|
7873
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "\u8054\u7CFB\u4EBA" }),
|
|
7874
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("select", { value: scopeId, onChange: (event) => {
|
|
7689
7875
|
setRequestedScopeId(event.target.value);
|
|
7690
7876
|
setSelectedRelationId(void 0);
|
|
7691
|
-
}, children: scopeIds.map((value) => /* @__PURE__ */ (0,
|
|
7877
|
+
}, children: scopeIds.map((value) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("option", { value, children: profiles.find((item) => item.scopeId === value)?.label ?? `\u8054\u7CFB\u4EBA ${value.slice(-6)}` }, value)) })
|
|
7692
7878
|
] })
|
|
7693
7879
|
] }),
|
|
7694
|
-
/* @__PURE__ */ (0,
|
|
7880
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("nav", { className: "dsh-partner-graph-filters", "aria-label": "\u5173\u7CFB\u7C7B\u578B", children: RELATION_FILTERS.map((value) => {
|
|
7695
7881
|
const count = value === "all" ? scoped.length : scoped.filter((item) => item.kind === value).length;
|
|
7696
|
-
return /* @__PURE__ */ (0,
|
|
7882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: filter === value ? "is-active" : "", "aria-pressed": filter === value, onClick: () => {
|
|
7697
7883
|
setFilter(value);
|
|
7698
7884
|
setSelectedRelationId(void 0);
|
|
7699
7885
|
}, children: [
|
|
7700
7886
|
value === "all" ? "\u5168\u90E8" : relationLabel(value),
|
|
7701
7887
|
" ",
|
|
7702
|
-
/* @__PURE__ */ (0,
|
|
7888
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("b", { children: count })
|
|
7703
7889
|
] }, value);
|
|
7704
7890
|
}) }),
|
|
7705
|
-
/* @__PURE__ */ (0,
|
|
7706
|
-
/* @__PURE__ */ (0,
|
|
7891
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-graph-browser", children: [
|
|
7892
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-graph-index", role: "list", children: visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.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) => {
|
|
7707
7893
|
const from = byId.get(item.sourceMemoryId);
|
|
7708
7894
|
const to = byId.get(item.targetMemoryId);
|
|
7709
|
-
return /* @__PURE__ */ (0,
|
|
7710
|
-
/* @__PURE__ */ (0,
|
|
7711
|
-
/* @__PURE__ */ (0,
|
|
7895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", role: "listitem", "data-kind": item.kind, className: selected?.id === item.id ? "is-active" : "", onClick: () => setSelectedRelationId(item.id), children: [
|
|
7896
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: relationLabel(item.kind) }),
|
|
7897
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("strong", { children: [
|
|
7712
7898
|
from?.subject ?? "\u5DF2\u5220\u9664\u8BB0\u5FC6",
|
|
7713
7899
|
" ",
|
|
7714
|
-
/* @__PURE__ */ (0,
|
|
7900
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
|
|
7715
7901
|
" ",
|
|
7716
7902
|
to?.subject ?? "\u5DF2\u5220\u9664\u8BB0\u5FC6"
|
|
7717
7903
|
] }),
|
|
7718
|
-
/* @__PURE__ */ (0,
|
|
7719
|
-
/* @__PURE__ */ (0,
|
|
7904
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: item.label }),
|
|
7905
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("small", { children: [
|
|
7720
7906
|
Math.round(item.confidence * 100),
|
|
7721
7907
|
"% \u53EF\u4FE1"
|
|
7722
7908
|
] })
|
|
7723
7909
|
] }, item.id);
|
|
7724
7910
|
}) }),
|
|
7725
|
-
/* @__PURE__ */ (0,
|
|
7726
|
-
/* @__PURE__ */ (0,
|
|
7727
|
-
/* @__PURE__ */ (0,
|
|
7728
|
-
/* @__PURE__ */ (0,
|
|
7911
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "dsh-partner-graph-stage", children: selected && source && target ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("article", { "data-kind": selected.kind, children: [
|
|
7912
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { children: [
|
|
7913
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: relationLabel(selected.kind) }),
|
|
7914
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("strong", { children: [
|
|
7729
7915
|
source.subject,
|
|
7730
7916
|
" ",
|
|
7731
|
-
/* @__PURE__ */ (0,
|
|
7917
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", { "aria-hidden": "true", children: "\u2192" }),
|
|
7732
7918
|
" ",
|
|
7733
7919
|
target.subject
|
|
7734
7920
|
] }),
|
|
7735
|
-
/* @__PURE__ */ (0,
|
|
7736
|
-
/* @__PURE__ */ (0,
|
|
7921
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: selected.label }),
|
|
7922
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { children: relationGuidance(selected.kind) })
|
|
7737
7923
|
] }),
|
|
7738
|
-
/* @__PURE__ */ (0,
|
|
7739
|
-
/* @__PURE__ */ (0,
|
|
7740
|
-
/* @__PURE__ */ (0,
|
|
7741
|
-
/* @__PURE__ */ (0,
|
|
7742
|
-
/* @__PURE__ */ (0,
|
|
7743
|
-
/* @__PURE__ */ (0,
|
|
7924
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-graph-pair", children: [
|
|
7925
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(GraphMemory, { item: source, side: "\u8D77\u70B9", inspect }),
|
|
7926
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { "aria-hidden": "true", children: [
|
|
7927
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", {}),
|
|
7928
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: relationLabel(selected.kind) }),
|
|
7929
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("i", {})
|
|
7744
7930
|
] }),
|
|
7745
|
-
/* @__PURE__ */ (0,
|
|
7931
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(GraphMemory, { item: target, side: "\u5173\u8054\u9879", inspect })
|
|
7746
7932
|
] }),
|
|
7747
|
-
/* @__PURE__ */ (0,
|
|
7748
|
-
/* @__PURE__ */ (0,
|
|
7933
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("footer", { children: [
|
|
7934
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("small", { children: [
|
|
7749
7935
|
"\u6700\u8FD1\u7EC8\u5BA1\u4E8E ",
|
|
7750
7936
|
new Date(selected.updatedAt).toLocaleString()
|
|
7751
7937
|
] }),
|
|
7752
|
-
/* @__PURE__ */ (0,
|
|
7938
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("strong", { children: [
|
|
7753
7939
|
"\u5173\u7CFB\u7F6E\u4FE1\u5EA6 ",
|
|
7754
7940
|
Math.round(selected.confidence * 100),
|
|
7755
7941
|
"%"
|
|
7756
7942
|
] })
|
|
7757
7943
|
] })
|
|
7758
|
-
] }) : /* @__PURE__ */ (0,
|
|
7944
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.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 }) })
|
|
7759
7945
|
] })
|
|
7760
7946
|
] });
|
|
7761
7947
|
}
|
|
7762
7948
|
function GraphMemory({ item, side, inspect }) {
|
|
7763
|
-
return /* @__PURE__ */ (0,
|
|
7764
|
-
/* @__PURE__ */ (0,
|
|
7765
|
-
/* @__PURE__ */ (0,
|
|
7949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { children: [
|
|
7950
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { children: [
|
|
7951
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("small", { children: [
|
|
7766
7952
|
side,
|
|
7767
7953
|
" \xB7 ",
|
|
7768
7954
|
memoryKind(item.kind)
|
|
7769
7955
|
] }),
|
|
7770
|
-
/* @__PURE__ */ (0,
|
|
7956
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: item.subject })
|
|
7771
7957
|
] }),
|
|
7772
|
-
/* @__PURE__ */ (0,
|
|
7773
|
-
/* @__PURE__ */ (0,
|
|
7958
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: item.content }),
|
|
7959
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: () => inspect(item), children: "\u67E5\u770B\u5E76\u4FEE\u6B63" })
|
|
7774
7960
|
] });
|
|
7775
7961
|
}
|
|
7776
7962
|
function relationLabel(kind) {
|
|
@@ -7786,70 +7972,70 @@ function relationGuidance(kind) {
|
|
|
7786
7972
|
}[kind];
|
|
7787
7973
|
}
|
|
7788
7974
|
function DailyReflectionDetail({ entry }) {
|
|
7789
|
-
return /* @__PURE__ */ (0,
|
|
7790
|
-
/* @__PURE__ */ (0,
|
|
7791
|
-
/* @__PURE__ */ (0,
|
|
7792
|
-
/* @__PURE__ */ (0,
|
|
7975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("article", { className: "dsh-partner-diary-detail", children: [
|
|
7976
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { children: [
|
|
7977
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("time", { children: entry.date }),
|
|
7978
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("strong", { children: [
|
|
7793
7979
|
entry.turnCount,
|
|
7794
7980
|
" \u8F6E\u4EA4\u6D41\u540E\u7684\u7406\u89E3"
|
|
7795
7981
|
] }),
|
|
7796
|
-
/* @__PURE__ */ (0,
|
|
7982
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("small", { children: [
|
|
7797
7983
|
"\u66F4\u65B0\u4E8E ",
|
|
7798
7984
|
new Date(entry.updatedAt).toLocaleString()
|
|
7799
7985
|
] })
|
|
7800
7986
|
] }),
|
|
7801
|
-
/* @__PURE__ */ (0,
|
|
7802
|
-
/* @__PURE__ */ (0,
|
|
7803
|
-
/* @__PURE__ */ (0,
|
|
7804
|
-
/* @__PURE__ */ (0,
|
|
7805
|
-
/* @__PURE__ */ (0,
|
|
7987
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: entry.summary }),
|
|
7988
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ReflectionGroup, { title: "\u5F85\u8DDF\u8FDB", items: entry.openTasks }),
|
|
7989
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ReflectionGroup, { title: "\u5F53\u5929\u4E8B\u4EF6", items: entry.events }),
|
|
7990
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ReflectionGroup, { title: "\u65B0\u7406\u89E3", items: entry.learnings }),
|
|
7991
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ReflectionGroup, { title: "\u5DF2\u5B8C\u6210", items: entry.completedTasks })
|
|
7806
7992
|
] });
|
|
7807
7993
|
}
|
|
7808
7994
|
function ReflectionGroup({ title, items }) {
|
|
7809
7995
|
if (items.length === 0) return null;
|
|
7810
|
-
return /* @__PURE__ */ (0,
|
|
7811
|
-
/* @__PURE__ */ (0,
|
|
7812
|
-
/* @__PURE__ */ (0,
|
|
7996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("section", { children: [
|
|
7997
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: title }),
|
|
7998
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("ul", { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("li", { children: item }, item)) })
|
|
7813
7999
|
] });
|
|
7814
8000
|
}
|
|
7815
8001
|
function MemoryCard({ item, editing, busy, setEditing, save, remove }) {
|
|
7816
8002
|
const [confirmingRemove, setConfirmingRemove] = (0, import_react24.useState)(false);
|
|
7817
|
-
return /* @__PURE__ */ (0,
|
|
7818
|
-
/* @__PURE__ */ (0,
|
|
7819
|
-
/* @__PURE__ */ (0,
|
|
7820
|
-
/* @__PURE__ */ (0,
|
|
7821
|
-
/* @__PURE__ */ (0,
|
|
7822
|
-
/* @__PURE__ */ (0,
|
|
8003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("article", { "data-kind": item.kind, children: editing ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "dsh-partner-memory-editor", children: [
|
|
8004
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { "aria-label": "\u8BB0\u5FC6\u4E3B\u9898", value: editing.subject, onChange: (event) => setEditing({ ...editing, subject: event.target.value }) }),
|
|
8005
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("textarea", { "aria-label": "\u8BB0\u5FC6\u5185\u5BB9", value: editing.content, onChange: (event) => setEditing({ ...editing, content: event.target.value }) }),
|
|
8006
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("footer", { children: [
|
|
8007
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: () => setEditing(void 0), children: "\u53D6\u6D88" }),
|
|
8008
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "is-primary", disabled: busy || !editing.subject.trim() || !editing.content.trim(), onClick: save, children: "\u4FDD\u5B58\u4FEE\u6B63" })
|
|
7823
8009
|
] })
|
|
7824
|
-
] }) : /* @__PURE__ */ (0,
|
|
7825
|
-
/* @__PURE__ */ (0,
|
|
7826
|
-
/* @__PURE__ */ (0,
|
|
7827
|
-
/* @__PURE__ */ (0,
|
|
7828
|
-
/* @__PURE__ */ (0,
|
|
7829
|
-
/* @__PURE__ */ (0,
|
|
7830
|
-
] }) : /* @__PURE__ */ (0,
|
|
7831
|
-
/* @__PURE__ */ (0,
|
|
7832
|
-
/* @__PURE__ */ (0,
|
|
8010
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
8011
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { children: [
|
|
8012
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: memoryKind(item.kind) }),
|
|
8013
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: confirmingRemove ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
8014
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: () => setConfirmingRemove(false), children: "\u53D6\u6D88" }),
|
|
8015
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: remove, children: "\u786E\u8BA4\u5220\u9664" })
|
|
8016
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
8017
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: () => setEditing({ ...item }), children: "\u7F16\u8F91" }),
|
|
8018
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", onClick: () => setConfirmingRemove(true), children: "\u5220\u9664" })
|
|
7833
8019
|
] }) })
|
|
7834
8020
|
] }),
|
|
7835
|
-
/* @__PURE__ */ (0,
|
|
7836
|
-
/* @__PURE__ */ (0,
|
|
7837
|
-
/* @__PURE__ */ (0,
|
|
7838
|
-
/* @__PURE__ */ (0,
|
|
7839
|
-
/* @__PURE__ */ (0,
|
|
8021
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { children: item.subject }),
|
|
8022
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: item.content }),
|
|
8023
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("footer", { children: [
|
|
8024
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("progress", { max: 1, value: item.confidence, "aria-label": `\u7F6E\u4FE1\u5EA6 ${Math.round(item.confidence * 100)}%` }),
|
|
8025
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("small", { children: [
|
|
7840
8026
|
item.locked ? "\u624B\u52A8\u786E\u8BA4" : `${Math.round(item.confidence * 100)}% \u53EF\u4FE1`,
|
|
7841
8027
|
" \xB7 ",
|
|
7842
8028
|
relativeTime(item.updatedAt)
|
|
7843
8029
|
] })
|
|
7844
8030
|
] }),
|
|
7845
|
-
item.evidence.length > 0 && /* @__PURE__ */ (0,
|
|
7846
|
-
/* @__PURE__ */ (0,
|
|
8031
|
+
item.evidence.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("details", { className: "dsh-partner-memory-evidence", children: [
|
|
8032
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("summary", { children: [
|
|
7847
8033
|
"\u67E5\u770B\u5BF9\u8BDD\u4F9D\u636E ",
|
|
7848
|
-
/* @__PURE__ */ (0,
|
|
8034
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("b", { children: item.evidence.length })
|
|
7849
8035
|
] }),
|
|
7850
|
-
/* @__PURE__ */ (0,
|
|
7851
|
-
/* @__PURE__ */ (0,
|
|
7852
|
-
/* @__PURE__ */ (0,
|
|
8036
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: [...item.evidence].reverse().map((evidence) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("blockquote", { children: [
|
|
8037
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: evidence.excerpt }),
|
|
8038
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("time", { children: new Date(evidence.at).toLocaleString() })
|
|
7853
8039
|
] }, `${evidence.turnId}:${evidence.at}`)) })
|
|
7854
8040
|
] })
|
|
7855
8041
|
] }) });
|