@godv61/dsh-task-engine 0.23.7 → 0.23.9
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/.preset-test.mjs +2 -2
- package/README.md +6 -5
- package/docs/CHANGELOG.md +29 -3
- package/docs/README.md +41 -29
- package/docs/configuration.md +1 -1
- package/docs/development.md +3 -3
- package/docs/faq.md +8 -8
- package/docs/getting-started.md +3 -1
- package/docs/listing/godv61__dsh-task-engine.yml +6 -6
- package/docs/listing/submission.md +84 -9
- package/docs/manual.html +2 -2
- package/docs/{release-0.23.0.md → releases/0.23.0.md} +3 -3
- package/docs/{release-0.23.1.md → releases/0.23.1.md} +2 -2
- package/docs/{release-0.23.2.md → releases/0.23.2.md} +3 -3
- package/docs/roadmap.md +34 -33
- package/docs/testing/0.23.0//346/265/213/350/257/225/346/212/245/345/221/212.md +1 -1
- package/docs/testing/0.23.1//346/265/213/350/257/225/346/212/245/345/221/212.md +1 -1
- package/docs/testing/0.23.2//346/265/213/350/257/225/346/212/245/345/221/212.md +1 -1
- package/lib/client.js +352 -301
- package/lib/client.js.map +3 -4
- package/lib/seed-preset.d.ts +5 -5
- package/lib/seed-preset.js +5 -5
- package/package.json +1 -1
- package/scripts/verify-package.mjs +2 -2
package/lib/client.js
CHANGED
|
@@ -4536,7 +4536,7 @@ var TYPERT_REMOTE = {
|
|
|
4536
4536
|
var remote_default = TYPERT_REMOTE;
|
|
4537
4537
|
|
|
4538
4538
|
// src/client/Workbench.tsx
|
|
4539
|
-
var
|
|
4539
|
+
var import_react9 = require("react");
|
|
4540
4540
|
var import_dsh_client_ui_primitives6 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
4541
4541
|
|
|
4542
4542
|
// src/client/workbench-theme.ts
|
|
@@ -4547,6 +4547,27 @@ var workbenchTheme = `
|
|
|
4547
4547
|
.te-workbench button:focus-visible,.te-modal button:focus-visible,.te-input:focus-visible { outline:2px solid var(--dsw-alias-state-business-primary); outline-offset:3px; }
|
|
4548
4548
|
.te-workbench h2 { margin:0 0 6px; font-size:24px; letter-spacing:-.5px; }
|
|
4549
4549
|
.te-workbench h3,.te-modal h3 { margin:0; font-size:16px; overflow-wrap:anywhere; }
|
|
4550
|
+
.te-workbench .te-disclosure-title { font-size:16px; font-weight:700; color:var(--dsw-alias-label-primary); }
|
|
4551
|
+
.te-binding-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); gap:14px; align-items:start; }
|
|
4552
|
+
.te-binding-picker { min-width:0; display:flex; flex-direction:column; gap:10px; border:1px solid var(--dsw-alias-border-l2); border-radius:12px; padding:14px; background:var(--dsw-alias-bg-layer-1); }
|
|
4553
|
+
.te-binding-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
|
|
4554
|
+
.te-binding-heading h4 { margin:0; font-size:14px; font-weight:650; }
|
|
4555
|
+
.te-binding-count,.te-binding-meta { color:var(--dsw-alias-label-secondary); font-size:12px; }
|
|
4556
|
+
.te-binding-tools { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
|
|
4557
|
+
.te-binding-tools .te-input { flex:1; width:100%; min-width:120px; padding:8px 10px; font-size:13px; }
|
|
4558
|
+
.te-binding-filter { display:flex; align-items:center; gap:5px; font-size:12px; white-space:nowrap; cursor:pointer; }
|
|
4559
|
+
.te-binding-list { max-height:280px; overflow-y:auto; overscroll-behavior:contain; display:flex; flex-direction:column; gap:4px; scrollbar-gutter:stable; }
|
|
4560
|
+
.te-binding-option { display:flex; gap:9px; align-items:flex-start; padding:9px; border:1px solid transparent; border-radius:8px; cursor:pointer; }
|
|
4561
|
+
.te-binding-option:hover { background:var(--dsw-alias-bg-layer-2); }
|
|
4562
|
+
.te-binding-option.is-selected { background:var(--dsw-alias-bg-layer-2); border-color:var(--dsw-alias-border-l2); }
|
|
4563
|
+
.te-binding-option.is-fixed { cursor:default; }
|
|
4564
|
+
.te-binding-option input { flex:none; margin:3px 0 0; }
|
|
4565
|
+
.te-binding-picker input { accent-color:var(--dsw-alias-state-business-primary); }
|
|
4566
|
+
.te-binding-picker :focus-visible { outline:2px solid var(--dsw-alias-state-business-primary); outline-offset:2px; }
|
|
4567
|
+
.te-binding-detail { min-width:0; display:flex; flex-direction:column; gap:3px; }
|
|
4568
|
+
.te-binding-name { font-size:13px; font-weight:600; overflow-wrap:anywhere; }
|
|
4569
|
+
.te-binding-description { color:var(--dsw-alias-label-secondary); font-size:12px; line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
|
|
4570
|
+
.te-binding-empty { margin:0; padding:18px 8px; font-size:13px; }
|
|
4550
4571
|
.te-workbench p,.te-modal p { color:var(--dsw-alias-label-secondary); line-height:1.65; }
|
|
4551
4572
|
.te-content { max-width:1120px; margin:auto; width:100%; }
|
|
4552
4573
|
.te-resource { display:flex; flex-direction:column; gap:20px; }
|
|
@@ -4613,7 +4634,7 @@ var styles = {
|
|
|
4613
4634
|
section: { display: "flex", flexDirection: "column", gap: 12 },
|
|
4614
4635
|
cardBody: { padding: "4px 0 8px", display: "flex", flexDirection: "column", gap: 12 },
|
|
4615
4636
|
row: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" },
|
|
4616
|
-
field: { display: "flex", flexDirection: "column", gap:
|
|
4637
|
+
field: { display: "flex", flexDirection: "column", gap: 6, minWidth: 0 },
|
|
4617
4638
|
fieldLabel: { color: textSecondary, fontSize: 13 },
|
|
4618
4639
|
hint: { color: textTertiary, fontSize: 12, margin: 0, lineHeight: 1.4 },
|
|
4619
4640
|
chips: { display: "flex", flexWrap: "wrap", gap: 6, alignItems: "center" },
|
|
@@ -4715,7 +4736,7 @@ var styles = {
|
|
|
4715
4736
|
};
|
|
4716
4737
|
|
|
4717
4738
|
// src/client/TaskEngineSection.tsx
|
|
4718
|
-
var
|
|
4739
|
+
var import_react2 = require("react");
|
|
4719
4740
|
var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
4720
4741
|
|
|
4721
4742
|
// src/engine.ts
|
|
@@ -4961,34 +4982,89 @@ function describeError(error) {
|
|
|
4961
4982
|
return "\u672A\u77E5\u9519\u8BEF";
|
|
4962
4983
|
}
|
|
4963
4984
|
|
|
4964
|
-
// src/client/
|
|
4985
|
+
// src/client/BindingPicker.tsx
|
|
4986
|
+
var import_react = require("react");
|
|
4965
4987
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
4988
|
+
function BindingPicker({ title, resources, selected, defaults, onToggle }) {
|
|
4989
|
+
const [query, setQuery] = (0, import_react.useState)("");
|
|
4990
|
+
const [selectedOnly, setSelectedOnly] = (0, import_react.useState)(false);
|
|
4991
|
+
const chosen = (0, import_react.useMemo)(() => /* @__PURE__ */ new Set([...defaults, ...selected]), [defaults, selected]);
|
|
4992
|
+
const catalog = (0, import_react.useMemo)(() => {
|
|
4993
|
+
const entries = /* @__PURE__ */ new Map();
|
|
4994
|
+
for (const resource of resources) {
|
|
4995
|
+
if (!entries.has(resource.name)) entries.set(resource.name, resource);
|
|
4996
|
+
}
|
|
4997
|
+
for (const name of chosen) {
|
|
4998
|
+
if (!entries.has(name)) entries.set(name, { name, source: "missing" });
|
|
4999
|
+
}
|
|
5000
|
+
return [...entries.values()];
|
|
5001
|
+
}, [resources, chosen]);
|
|
5002
|
+
const search = query.trim().toLocaleLowerCase();
|
|
5003
|
+
const visible = catalog.filter((resource) => (!selectedOnly || chosen.has(resource.name)) && `${resource.name} ${resource.description ?? ""}`.toLocaleLowerCase().includes(search));
|
|
5004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "te-binding-picker", "aria-label": `${title}\u7ED1\u5B9A`, children: [
|
|
5005
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "te-binding-heading", children: [
|
|
5006
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h4", { children: title }),
|
|
5007
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "te-binding-count", children: [
|
|
5008
|
+
"\u5DF2\u9009 ",
|
|
5009
|
+
chosen.size,
|
|
5010
|
+
" / ",
|
|
5011
|
+
catalog.length
|
|
5012
|
+
] })
|
|
5013
|
+
] }),
|
|
5014
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "te-binding-tools", children: [
|
|
5015
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "search", className: "te-input", "aria-label": `\u641C\u7D22${title}`, placeholder: `\u641C\u7D22${title}\u540D\u79F0${title === "\u6280\u80FD" ? "\u6216\u63CF\u8FF0" : ""}`, value: query, onChange: (event) => setQuery(event.target.value) }),
|
|
5016
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: "te-binding-filter", children: [
|
|
5017
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "checkbox", checked: selectedOnly, onChange: (event) => setSelectedOnly(event.target.checked) }),
|
|
5018
|
+
"\u4EC5\u770B\u5DF2\u9009"
|
|
5019
|
+
] })
|
|
5020
|
+
] }),
|
|
5021
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "te-binding-list", role: "group", "aria-label": `${title}\u5217\u8868`, tabIndex: 0, children: [
|
|
5022
|
+
visible.map((resource) => {
|
|
5023
|
+
const fixed = defaults.includes(resource.name);
|
|
5024
|
+
const checked = chosen.has(resource.name);
|
|
5025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: `te-binding-option${checked ? " is-selected" : ""}${fixed ? " is-fixed" : ""}`, children: [
|
|
5026
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "checkbox", "aria-label": resource.name, checked, disabled: fixed, onChange: () => onToggle(resource.name) }),
|
|
5027
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "te-binding-detail", children: [
|
|
5028
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "te-binding-name", children: resource.name }),
|
|
5029
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "te-binding-meta", children: [
|
|
5030
|
+
resource.source === "missing" ? "\u8D44\u6E90\u672A\u627E\u5230" : sourceLabel(resource.source),
|
|
5031
|
+
fixed ? " \xB7 \u9884\u8BBE\u9ED8\u8BA4" : ""
|
|
5032
|
+
] }),
|
|
5033
|
+
resource.description ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "te-binding-description", title: resource.description, children: resource.description }) : null
|
|
5034
|
+
] })
|
|
5035
|
+
] }, resource.name);
|
|
5036
|
+
}),
|
|
5037
|
+
visible.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "te-binding-empty", children: catalog.length === 0 ? `\u6682\u65E0${title}\uFF0C\u8BF7\u5728\u4E0A\u65B9\u201C${title}\u201D\u9875\u6DFB\u52A0\u3002` : search ? "\u6CA1\u6709\u5339\u914D\u9879\uFF0C\u8BF7\u5C1D\u8BD5\u5176\u4ED6\u5173\u952E\u8BCD\u3002" : "\u5F53\u524D\u8282\u70B9\u5C1A\u672A\u9009\u62E9\u9644\u52A0\u9879\u3002" }) : null
|
|
5038
|
+
] }),
|
|
5039
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "te-binding-count", role: "status", children: [
|
|
5040
|
+
"\u663E\u793A ",
|
|
5041
|
+
visible.length,
|
|
5042
|
+
" \u9879",
|
|
5043
|
+
search || selectedOnly ? "\uFF08\u5DF2\u7B5B\u9009\uFF09" : ""
|
|
5044
|
+
] })
|
|
5045
|
+
] });
|
|
5046
|
+
}
|
|
5047
|
+
|
|
5048
|
+
// src/client/TaskEngineSection.tsx
|
|
5049
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
4966
5050
|
function resolvedConfig(flow, stageBindings) {
|
|
4967
5051
|
const resolved = resolveFlow(flow, { stage_bindings: stageBindings });
|
|
4968
5052
|
return resolved.ok ? resolved.config : FLOW_PRESETS.standard.config;
|
|
4969
5053
|
}
|
|
4970
|
-
var cardV = {
|
|
4971
|
-
display: "flex",
|
|
4972
|
-
flexDirection: "column",
|
|
4973
|
-
gap: 8,
|
|
4974
|
-
border: `1px solid ${border}`,
|
|
4975
|
-
borderRadius: 8,
|
|
4976
|
-
padding: "10px 12px"
|
|
4977
|
-
};
|
|
4978
5054
|
function TaskEngineSection(props) {
|
|
4979
5055
|
const { remote, workspace } = props;
|
|
4980
|
-
const [flow, setFlow] = (0,
|
|
4981
|
-
const [stageBindings, setStageBindings] = (0,
|
|
4982
|
-
const [source, setSource] = (0,
|
|
4983
|
-
const [savedAt, setSavedAt] = (0,
|
|
4984
|
-
const [loadError, setLoadError] = (0,
|
|
4985
|
-
const [saving, setSaving] = (0,
|
|
4986
|
-
const [loading, setLoading] = (0,
|
|
4987
|
-
const [loadAttempt, setLoadAttempt] = (0,
|
|
4988
|
-
const [configProblems, setConfigProblems] = (0,
|
|
4989
|
-
const [skills, setSkills] = (0,
|
|
4990
|
-
const [rules, setRules] = (0,
|
|
4991
|
-
(0,
|
|
5056
|
+
const [flow, setFlow] = (0, import_react2.useState)("standard");
|
|
5057
|
+
const [stageBindings, setStageBindings] = (0, import_react2.useState)({});
|
|
5058
|
+
const [source, setSource] = (0, import_react2.useState)("default");
|
|
5059
|
+
const [savedAt, setSavedAt] = (0, import_react2.useState)("");
|
|
5060
|
+
const [loadError, setLoadError] = (0, import_react2.useState)("");
|
|
5061
|
+
const [saving, setSaving] = (0, import_react2.useState)(false);
|
|
5062
|
+
const [loading, setLoading] = (0, import_react2.useState)(true);
|
|
5063
|
+
const [loadAttempt, setLoadAttempt] = (0, import_react2.useState)(0);
|
|
5064
|
+
const [configProblems, setConfigProblems] = (0, import_react2.useState)([]);
|
|
5065
|
+
const [skills, setSkills] = (0, import_react2.useState)([]);
|
|
5066
|
+
const [rules, setRules] = (0, import_react2.useState)([]);
|
|
5067
|
+
(0, import_react2.useEffect)(() => {
|
|
4992
5068
|
if (workspace === "") return;
|
|
4993
5069
|
let alive = true;
|
|
4994
5070
|
setLoadError("");
|
|
@@ -5015,7 +5091,7 @@ function TaskEngineSection(props) {
|
|
|
5015
5091
|
alive = false;
|
|
5016
5092
|
};
|
|
5017
5093
|
}, [remote, workspace, loadAttempt]);
|
|
5018
|
-
const refreshCatalogs = (0,
|
|
5094
|
+
const refreshCatalogs = (0, import_react2.useCallback)(() => {
|
|
5019
5095
|
if (workspace === "") return;
|
|
5020
5096
|
void remote.listSkills(workspace).then((result) => {
|
|
5021
5097
|
if (result.ok) setSkills(result.value.skills);
|
|
@@ -5026,11 +5102,11 @@ function TaskEngineSection(props) {
|
|
|
5026
5102
|
}, () => {
|
|
5027
5103
|
});
|
|
5028
5104
|
}, [remote, workspace]);
|
|
5029
|
-
(0,
|
|
5105
|
+
(0, import_react2.useEffect)(() => {
|
|
5030
5106
|
refreshCatalogs();
|
|
5031
5107
|
}, [refreshCatalogs]);
|
|
5032
|
-
const stages = (0,
|
|
5033
|
-
const problems = (0,
|
|
5108
|
+
const stages = (0, import_react2.useMemo)(() => (FLOW_PRESETS[flow] ?? FLOW_PRESETS.standard).config.stages, [flow]);
|
|
5109
|
+
const problems = (0, import_react2.useMemo)(
|
|
5034
5110
|
() => validateWorkflow(resolvedConfig(flow, stageBindings)),
|
|
5035
5111
|
[flow, stageBindings]
|
|
5036
5112
|
);
|
|
@@ -5039,38 +5115,38 @@ function TaskEngineSection(props) {
|
|
|
5039
5115
|
setStageBindings({ ...FLOW_PRESETS[id]?.config.stage_bindings ?? {} });
|
|
5040
5116
|
};
|
|
5041
5117
|
if (loadError !== "") {
|
|
5042
|
-
return /* @__PURE__ */ (0,
|
|
5043
|
-
/* @__PURE__ */ (0,
|
|
5044
|
-
/* @__PURE__ */ (0,
|
|
5045
|
-
/* @__PURE__ */ (0,
|
|
5046
|
-
/* @__PURE__ */ (0,
|
|
5118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: styles.wrap, children: [
|
|
5119
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { style: styles.title, children: "\u5DE5\u7A0B\u6D41\u7A0B\u914D\u7F6E" }),
|
|
5120
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: styles.problems, children: [
|
|
5121
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { style: styles.problemsTitle, children: [
|
|
5122
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.StateDot, { state: "error" }),
|
|
5047
5123
|
"\u8BFB\u53D6\u5931\u8D25"
|
|
5048
5124
|
] }),
|
|
5049
|
-
/* @__PURE__ */ (0,
|
|
5050
|
-
/* @__PURE__ */ (0,
|
|
5125
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { style: styles.muted, children: loadError }),
|
|
5126
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.Button, { onClick: () => setLoadAttempt((n) => n + 1), children: "\u91CD\u8BD5" })
|
|
5051
5127
|
] })
|
|
5052
5128
|
] });
|
|
5053
5129
|
}
|
|
5054
|
-
if (loading) return /* @__PURE__ */ (0,
|
|
5055
|
-
return /* @__PURE__ */ (0,
|
|
5056
|
-
configProblems.length > 0 && /* @__PURE__ */ (0,
|
|
5130
|
+
if (loading) return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { role: "status", children: "\u6B63\u5728\u8BFB\u53D6\u6D41\u7A0B\u914D\u7F6E\u2026" });
|
|
5131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: styles.wrap, children: [
|
|
5132
|
+
configProblems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("p", { role: "alert", style: styles.problems, children: [
|
|
5057
5133
|
"\u539F\u914D\u7F6E\u6709\u95EE\u9898\uFF1A",
|
|
5058
5134
|
configProblems.join("\uFF1B"),
|
|
5059
5135
|
"\u3002\u8BF7\u9009\u62E9\u6709\u6548\u9884\u8BBE\u5E76\u4FDD\u5B58\u4FEE\u590D\u3002"
|
|
5060
5136
|
] }),
|
|
5061
|
-
/* @__PURE__ */ (0,
|
|
5062
|
-
/* @__PURE__ */ (0,
|
|
5063
|
-
/* @__PURE__ */ (0,
|
|
5137
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: styles.head, children: [
|
|
5138
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { style: styles.title, children: "\u5DE5\u7A0B\u6D41\u7A0B\u914D\u7F6E" }),
|
|
5139
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { style: styles.muted, children: "\u9009\u4E00\u5957\u6D41\u7A0B\uFF0C\u518D\u7ED9\u6BCF\u4E2A\u8282\u70B9\u6302\u4E0A skill / rule\u3002\u9636\u6BB5\u6D41\u8F6C\u3001\u5B88\u536B\u3001\u63D0\u4EA4\u89C4\u5219\u90FD\u7531\u6D41\u7A0B\u9884\u8BBE\u56FA\u5316\uFF0C\u65E0\u9700\u624B\u5DE5\u914D\u7F6E\u3002" })
|
|
5064
5140
|
] }),
|
|
5065
|
-
/* @__PURE__ */ (0,
|
|
5066
|
-
/* @__PURE__ */ (0,
|
|
5067
|
-
/* @__PURE__ */ (0,
|
|
5141
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: styles.sourceRow, children: [
|
|
5142
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.StateDot, { state: source === "project" ? "done" : source === "invalid" ? "warning" : "ongoing" }),
|
|
5143
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: styles.sourceText, children: sourceText(source) })
|
|
5068
5144
|
] }),
|
|
5069
|
-
/* @__PURE__ */ (0,
|
|
5070
|
-
/* @__PURE__ */ (0,
|
|
5071
|
-
/* @__PURE__ */ (0,
|
|
5145
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: styles.field, children: [
|
|
5146
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h3", { children: "\u6D41\u7A0B\u9884\u8BBE" }),
|
|
5147
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: styles.flowGrid, children: FLOW_OPTIONS.map((option) => {
|
|
5072
5148
|
const active = flow === option.id;
|
|
5073
|
-
return /* @__PURE__ */ (0,
|
|
5149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
5074
5150
|
"button",
|
|
5075
5151
|
{
|
|
5076
5152
|
type: "button",
|
|
@@ -5080,39 +5156,37 @@ function TaskEngineSection(props) {
|
|
|
5080
5156
|
},
|
|
5081
5157
|
style: { ...styles.flowOption, ...active ? styles.flowOptionActive : {} },
|
|
5082
5158
|
children: [
|
|
5083
|
-
/* @__PURE__ */ (0,
|
|
5084
|
-
/* @__PURE__ */ (0,
|
|
5159
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { style: styles.flowOptionTitle, children: [
|
|
5160
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.StateDot, { state: active ? "done" : "ongoing", size: 8 }),
|
|
5085
5161
|
option.label
|
|
5086
5162
|
] }),
|
|
5087
|
-
/* @__PURE__ */ (0,
|
|
5163
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { style: styles.flowOptionDesc, children: option.description })
|
|
5088
5164
|
]
|
|
5089
5165
|
},
|
|
5090
5166
|
option.id
|
|
5091
5167
|
);
|
|
5092
|
-
}) })
|
|
5093
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: styles.hint, children: FLOW_OPTIONS.find((option) => option.id === flow)?.description })
|
|
5168
|
+
}) })
|
|
5094
5169
|
] }),
|
|
5095
|
-
/* @__PURE__ */ (0,
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.StateDot, { state: "error" }),
|
|
5170
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SectionCard, { icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconSettingsOutline16, { size: 16 }), title: "\u9636\u6BB5\u6280\u80FD / \u89C4\u5219", hint: "\u9009\u62E9\u8282\u70B9\uFF0C\u518D\u52FE\u9009\u9644\u52A0\u6280\u80FD\u4E0E\u89C4\u5219\u3002\u9884\u8BBE\u9ED8\u8BA4\u7ED1\u5B9A\u56FA\u5B9A\u4FDD\u7559\uFF1B\u65B0\u5EFA\u6216\u7F16\u8F91\u5185\u5BB9\u8BF7\u524D\u5F80\u4E0A\u65B9\u201C\u6280\u80FD\u201D\u6216\u201C\u89C4\u5219\u201D\u9875\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BindingEditor, { stages, defaults: (FLOW_PRESETS[flow] ?? FLOW_PRESETS.standard).config.stage_bindings ?? {}, stageBindings, setStageBindings, skills, rules }) }),
|
|
5171
|
+
problems.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: styles.problems, children: [
|
|
5172
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { style: styles.problemsTitle, children: [
|
|
5173
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.StateDot, { state: "error" }),
|
|
5100
5174
|
"\u6709 ",
|
|
5101
5175
|
problems.length,
|
|
5102
5176
|
" \u4E2A\u95EE\u9898\uFF08\u4FDD\u5B58\u4F1A\u88AB\u62D2\u7EDD\uFF09"
|
|
5103
5177
|
] }),
|
|
5104
|
-
/* @__PURE__ */ (0,
|
|
5105
|
-
] }) : /* @__PURE__ */ (0,
|
|
5106
|
-
/* @__PURE__ */ (0,
|
|
5178
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { style: styles.problemsList, children: problems.map((p) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("li", { children: p }, p)) })
|
|
5179
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { style: styles.okText, children: [
|
|
5180
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.StateDot, { state: "done" }),
|
|
5107
5181
|
source === "project" ? "\u914D\u7F6E\u6709\u6548" : "\u4F7F\u7528\u6D41\u7A0B\u9884\u8BBE\u9ED8\u8BA4\u7ED1\u5B9A\uFF08\u5C1A\u672A\u4FDD\u5B58\uFF09"
|
|
5108
5182
|
] }),
|
|
5109
|
-
/* @__PURE__ */ (0,
|
|
5110
|
-
/* @__PURE__ */ (0,
|
|
5183
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: styles.actions, children: [
|
|
5184
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
5111
5185
|
import_dsh_client_ui_primitives.Button,
|
|
5112
5186
|
{
|
|
5113
5187
|
variant: "primary",
|
|
5114
5188
|
size: "md",
|
|
5115
|
-
icon: /* @__PURE__ */ (0,
|
|
5189
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconCheckOutline16, { size: 16 }),
|
|
5116
5190
|
disabled: problems.length > 0 || saving,
|
|
5117
5191
|
onClick: () => {
|
|
5118
5192
|
setSaving(true);
|
|
@@ -5123,8 +5197,8 @@ function TaskEngineSection(props) {
|
|
|
5123
5197
|
children: saving ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u5230 .dsh/eng.json"
|
|
5124
5198
|
}
|
|
5125
5199
|
),
|
|
5126
|
-
savedAt !== "" ? /* @__PURE__ */ (0,
|
|
5127
|
-
/* @__PURE__ */ (0,
|
|
5200
|
+
savedAt !== "" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { style: styles.okText, children: [
|
|
5201
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.StateDot, { state: savedAt.startsWith("\u5DF2") ? "done" : "error" }),
|
|
5128
5202
|
savedAt
|
|
5129
5203
|
] }) : null
|
|
5130
5204
|
] })
|
|
@@ -5141,27 +5215,29 @@ function sourceText(source) {
|
|
|
5141
5215
|
}
|
|
5142
5216
|
}
|
|
5143
5217
|
function SectionCard({ icon, title, hint, children }) {
|
|
5144
|
-
const [open, setOpen] = (0,
|
|
5145
|
-
return /* @__PURE__ */ (0,
|
|
5218
|
+
const [open, setOpen] = (0, import_react2.useState)(true);
|
|
5219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: styles.section, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
5146
5220
|
import_dsh_client_ui_primitives.DisclosureRow,
|
|
5147
5221
|
{
|
|
5148
5222
|
icon,
|
|
5149
5223
|
title,
|
|
5224
|
+
titleClassName: "te-disclosure-title",
|
|
5150
5225
|
open,
|
|
5151
5226
|
expandable: true,
|
|
5227
|
+
expandOnRowClick: true,
|
|
5152
5228
|
onToggle: () => {
|
|
5153
5229
|
setOpen(!open);
|
|
5154
5230
|
},
|
|
5155
5231
|
keepContentWhenOpen: true,
|
|
5156
|
-
children: /* @__PURE__ */ (0,
|
|
5157
|
-
hint !== void 0 ? /* @__PURE__ */ (0,
|
|
5232
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: styles.cardBody, children: [
|
|
5233
|
+
hint !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { style: styles.muted, children: hint }) : null,
|
|
5158
5234
|
children
|
|
5159
5235
|
] })
|
|
5160
5236
|
}
|
|
5161
5237
|
) });
|
|
5162
5238
|
}
|
|
5163
|
-
function BindingEditor({ stages, stageBindings, setStageBindings, skills, rules }) {
|
|
5164
|
-
const [stage, setStage] = (0,
|
|
5239
|
+
function BindingEditor({ stages, defaults, stageBindings, setStageBindings, skills, rules }) {
|
|
5240
|
+
const [stage, setStage] = (0, import_react2.useState)(stages[0] ?? "");
|
|
5165
5241
|
const currentStage = stages.includes(stage) ? stage : stages[0] ?? "";
|
|
5166
5242
|
const toggleSkill = (skill) => {
|
|
5167
5243
|
if (currentStage === "") return;
|
|
@@ -5176,47 +5252,22 @@ function BindingEditor({ stages, stageBindings, setStageBindings, skills, rules
|
|
|
5176
5252
|
setStageBindings({ ...stageBindings, [currentStage]: { ...stageBindings[currentStage] ?? {}, rules: next } });
|
|
5177
5253
|
};
|
|
5178
5254
|
if (currentStage === "") {
|
|
5179
|
-
return /* @__PURE__ */ (0,
|
|
5255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { style: styles.muted, children: "\u5F53\u524D\u6D41\u7A0B\u6CA1\u6709\u8282\u70B9\u3002" });
|
|
5180
5256
|
}
|
|
5181
5257
|
const boundSkills = stageBindings[currentStage]?.skills ?? [];
|
|
5182
5258
|
const boundRules = stageBindings[currentStage]?.rules ?? [];
|
|
5183
|
-
return /* @__PURE__ */ (0,
|
|
5184
|
-
/* @__PURE__ */ (0,
|
|
5185
|
-
/* @__PURE__ */ (0,
|
|
5186
|
-
/* @__PURE__ */ (0,
|
|
5187
|
-
/* @__PURE__ */ (0,
|
|
5259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: styles.section, children: [
|
|
5260
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { style: styles.hint, children: "\u7ED1\u5B9A\u6309\u540D\u79F0\u751F\u6548\uFF1B\u540C\u540D\u8D44\u6E90\u53EF\u5728\u8D44\u6E90\u7BA1\u7406\u4E2D\u6309\u9879\u76EE\uFF0F\u4E2A\u4EBA\u5206\u522B\u67E5\u770B\u3002\u5B8C\u6210\u8282\u70B9\u7684\u6280\u80FD\u5FC5\u987B\u5728\u8FDB\u5165\u5B8C\u6210\u524D\u6267\u884C\uFF0C\u6D4B\u8BD5\u6280\u80FD\u5EFA\u8BAE\u653E\u5728\u4EA4\u4ED8\u8282\u70B9\u3002" }),
|
|
5261
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: styles.field, children: [
|
|
5262
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: styles.bindingLabel, children: "\u9009\u62E9\u8282\u70B9" }),
|
|
5263
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { style: styles.chips, children: stages.map((s) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.Pill, { active: s === currentStage, onClick: () => {
|
|
5188
5264
|
setStage(s);
|
|
5189
5265
|
}, children: s }, s)) })
|
|
5190
5266
|
] }),
|
|
5191
|
-
/* @__PURE__ */ (0,
|
|
5192
|
-
/* @__PURE__ */ (0,
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
toggleSkill(sk.name);
|
|
5196
|
-
}, title: `${sk.description}\uFF08${sourceLabel(sk.source)}\uFF09`, children: [
|
|
5197
|
-
sk.name,
|
|
5198
|
-
sk.source !== "bundled" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { style: styles.sourceBadge, children: [
|
|
5199
|
-
"\uFF08",
|
|
5200
|
-
sourceLabel(sk.source),
|
|
5201
|
-
"\uFF09"
|
|
5202
|
-
] }) : null
|
|
5203
|
-
] }, sk.name)) })
|
|
5204
|
-
] }),
|
|
5205
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: styles.bindingStage, children: [
|
|
5206
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: styles.fieldLabel, children: "rule\uFF08\u8FD9\u4E2A\u8282\u70B9\u5B88\u4EC0\u4E48\uFF09" }),
|
|
5207
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: styles.chips, children: rules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: styles.sourceBadge, children: "\u6682\u65E0\u53EF\u7528 rule \u2014\u2014 \u5207\u5230\u4E0A\u65B9\u300C\u89C4\u5219\u300D\u6807\u7B7E\u9875\u65B0\u5EFA" }) : rules.filter((rule, index, all) => all.findIndex((other) => other.name === rule.name) === index).map((rule) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dsh_client_ui_primitives.Pill, { active: boundRules.includes(rule.name), onClick: () => {
|
|
5208
|
-
toggleRule(rule.name);
|
|
5209
|
-
}, title: `\u6765\u6E90\uFF1A${sourceLabel(rule.source)}`, children: [
|
|
5210
|
-
rule.name,
|
|
5211
|
-
rule.source !== "bundled" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { style: styles.sourceBadge, children: [
|
|
5212
|
-
"\uFF08",
|
|
5213
|
-
sourceLabel(rule.source),
|
|
5214
|
-
"\uFF09"
|
|
5215
|
-
] }) : null
|
|
5216
|
-
] }, rule.name)) })
|
|
5217
|
-
] }),
|
|
5218
|
-
boundSkills.length === 0 && boundRules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: styles.hint, children: "\u8FD9\u4E2A\u8282\u70B9\u8FD8\u6CA1\u6302\u4EFB\u4F55 skill / rule \u2014\u2014 \u70B9\u4E0A\u9762\u7684\u540D\u79F0\u52FE\u9009\u3002" }) : null
|
|
5219
|
-
] })
|
|
5267
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "te-binding-grid", children: [
|
|
5268
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BindingPicker, { title: "\u6280\u80FD", resources: skills, selected: boundSkills, defaults: defaults[currentStage]?.skills ?? [], onToggle: toggleSkill }),
|
|
5269
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BindingPicker, { title: "\u89C4\u5219", resources: rules, selected: boundRules, defaults: defaults[currentStage]?.rules ?? [], onToggle: toggleRule })
|
|
5270
|
+
] }, currentStage)
|
|
5220
5271
|
] });
|
|
5221
5272
|
}
|
|
5222
5273
|
async function save(remote, flow, stageBindings, workspace, setSavedAt, setSource) {
|
|
@@ -5240,7 +5291,7 @@ async function save(remote, flow, stageBindings, workspace, setSavedAt, setSourc
|
|
|
5240
5291
|
}
|
|
5241
5292
|
|
|
5242
5293
|
// src/client/InitPanel.tsx
|
|
5243
|
-
var
|
|
5294
|
+
var import_react3 = require("react");
|
|
5244
5295
|
var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5245
5296
|
var MD_LABELS = { code: { copyLabel: "\u590D\u5236", copiedLabel: "\u5DF2\u590D\u5236" }, footnotes: "\u811A\u6CE8" };
|
|
5246
5297
|
var INIT_TIMEOUT_S = 150;
|
|
@@ -5253,14 +5304,14 @@ var card = {
|
|
|
5253
5304
|
padding: "12px 14px"
|
|
5254
5305
|
};
|
|
5255
5306
|
function InitPanel({ workspace, remote }) {
|
|
5256
|
-
const [view, setView] = (0,
|
|
5257
|
-
const [generating, setGenerating] = (0,
|
|
5258
|
-
const [elapsed, setElapsed] = (0,
|
|
5259
|
-
const [draft, setDraft] = (0,
|
|
5260
|
-
const [editing, setEditing] = (0,
|
|
5261
|
-
const [body2, setBody] = (0,
|
|
5262
|
-
const [msg, setMsg] = (0,
|
|
5263
|
-
(0,
|
|
5307
|
+
const [view, setView] = (0, import_react3.useState)(null);
|
|
5308
|
+
const [generating, setGenerating] = (0, import_react3.useState)(false);
|
|
5309
|
+
const [elapsed, setElapsed] = (0, import_react3.useState)(0);
|
|
5310
|
+
const [draft, setDraft] = (0, import_react3.useState)(null);
|
|
5311
|
+
const [editing, setEditing] = (0, import_react3.useState)(false);
|
|
5312
|
+
const [body2, setBody] = (0, import_react3.useState)("");
|
|
5313
|
+
const [msg, setMsg] = (0, import_react3.useState)("");
|
|
5314
|
+
(0, import_react3.useEffect)(() => {
|
|
5264
5315
|
if (!generating) {
|
|
5265
5316
|
setElapsed(0);
|
|
5266
5317
|
return;
|
|
@@ -5274,13 +5325,13 @@ function InitPanel({ workspace, remote }) {
|
|
|
5274
5325
|
clearInterval(timer);
|
|
5275
5326
|
};
|
|
5276
5327
|
}, [generating]);
|
|
5277
|
-
const refresh = (0,
|
|
5328
|
+
const refresh = (0, import_react3.useCallback)(() => {
|
|
5278
5329
|
void remote.readInit(workspace).then((r) => {
|
|
5279
5330
|
if (r.ok) setView(r.value);
|
|
5280
5331
|
}, () => {
|
|
5281
5332
|
});
|
|
5282
5333
|
}, [remote, workspace]);
|
|
5283
|
-
(0,
|
|
5334
|
+
(0, import_react3.useEffect)(() => {
|
|
5284
5335
|
refresh();
|
|
5285
5336
|
}, [refresh]);
|
|
5286
5337
|
const generate = async () => {
|
|
@@ -5323,45 +5374,45 @@ function InitPanel({ workspace, remote }) {
|
|
|
5323
5374
|
setMsg("");
|
|
5324
5375
|
};
|
|
5325
5376
|
const exists = view?.exists === true;
|
|
5326
|
-
return (0,
|
|
5377
|
+
return (0, import_react3.createElement)(
|
|
5327
5378
|
"div",
|
|
5328
5379
|
{ style: styles.section },
|
|
5329
|
-
(0,
|
|
5380
|
+
(0, import_react3.createElement)(
|
|
5330
5381
|
"div",
|
|
5331
5382
|
{ style: card },
|
|
5332
|
-
(0,
|
|
5383
|
+
(0, import_react3.createElement)(
|
|
5333
5384
|
"div",
|
|
5334
5385
|
{ style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" } },
|
|
5335
|
-
(0,
|
|
5336
|
-
(0,
|
|
5337
|
-
view?.path !== void 0 ? (0,
|
|
5386
|
+
(0, import_react3.createElement)(import_dsh_client_ui_primitives2.StateDot, { state: exists ? "done" : "ongoing" }),
|
|
5387
|
+
(0, import_react3.createElement)("span", { style: styles.bindingLabel }, exists ? `\u5DF2\u521D\u59CB\u5316 \xB7 ${view.lines} \u884C\uFF08\u4E0A\u9650 200\uFF09` : "\u672A\u521D\u59CB\u5316"),
|
|
5388
|
+
view?.path !== void 0 ? (0, import_react3.createElement)("span", { style: styles.sourceBadge }, `\u5DF2\u5B9A\u4F4D\u5230 ${view.path}`) : null
|
|
5338
5389
|
),
|
|
5339
|
-
(0,
|
|
5390
|
+
(0, import_react3.createElement)(
|
|
5340
5391
|
"p",
|
|
5341
5392
|
{ style: styles.muted },
|
|
5342
5393
|
"\u9879\u76EE\u6839 AGENTS.md \u4F1A\u88AB DSH \u81EA\u52A8\u6CE8\u5165\u5230\u6BCF\u4E2A\u4F1A\u8BDD\u3002\u521D\u59CB\u5316\u4E00\u6B21\uFF0C\u4E4B\u540E\u6BCF\u6B21\u4EFB\u52A1\u5F00\u5DE5 AI \u90FD\u81EA\u5E26\u8FD9\u4EFD\u9879\u76EE\u8BA4\u77E5\uFF08\u9879\u76EE\u662F\u4EC0\u4E48 \u2192 \u600E\u4E48\u8DD1 \u2192 \u7ED3\u6784 \u2192 \u7EA6\u5B9A \u2192 \u5751\uFF09\u3002"
|
|
5343
5394
|
),
|
|
5344
|
-
exists && !editing && draft === null ? (0,
|
|
5395
|
+
exists && !editing && draft === null ? (0, import_react3.createElement)(
|
|
5345
5396
|
"div",
|
|
5346
5397
|
{ style: styles.mdPreview },
|
|
5347
|
-
(0,
|
|
5398
|
+
(0, import_react3.createElement)(import_dsh_client_ui_primitives2.MarkdownText, { text: view.content, labels: MD_LABELS })
|
|
5348
5399
|
) : null,
|
|
5349
|
-
draft !== null ? (0,
|
|
5400
|
+
draft !== null ? (0, import_react3.createElement)(
|
|
5350
5401
|
"div",
|
|
5351
5402
|
{ style: styles.section },
|
|
5352
|
-
(0,
|
|
5403
|
+
(0, import_react3.createElement)(
|
|
5353
5404
|
"div",
|
|
5354
5405
|
{ style: styles.sourceRow },
|
|
5355
|
-
(0,
|
|
5356
|
-
(0,
|
|
5406
|
+
(0, import_react3.createElement)(import_dsh_client_ui_primitives2.StateDot, { state: "ongoing", size: 8 }),
|
|
5407
|
+
(0, import_react3.createElement)("span", { style: styles.sourceBadge }, `AI \u8349\u7A3F \xB7 ${draft.lines} \u884C \xB7 \u5C1A\u672A\u5199\u5165`)
|
|
5357
5408
|
),
|
|
5358
|
-
(0,
|
|
5409
|
+
(0, import_react3.createElement)(
|
|
5359
5410
|
"div",
|
|
5360
5411
|
{ style: styles.mdPreview },
|
|
5361
|
-
(0,
|
|
5412
|
+
(0, import_react3.createElement)(import_dsh_client_ui_primitives2.MarkdownText, { text: draft.content, labels: MD_LABELS })
|
|
5362
5413
|
)
|
|
5363
5414
|
) : null,
|
|
5364
|
-
editing ? (0,
|
|
5415
|
+
editing ? (0, import_react3.createElement)("textarea", {
|
|
5365
5416
|
style: { ...styles.textarea, minHeight: 300 },
|
|
5366
5417
|
placeholder: "AGENTS.md \u6B63\u6587\uFF08Markdown\uFF0C\u2264200 \u884C\uFF09",
|
|
5367
5418
|
value: body2,
|
|
@@ -5369,16 +5420,16 @@ function InitPanel({ workspace, remote }) {
|
|
|
5369
5420
|
setBody(ev.target.value);
|
|
5370
5421
|
}
|
|
5371
5422
|
}) : null,
|
|
5372
|
-
generating ? (0,
|
|
5423
|
+
generating ? (0, import_react3.createElement)(
|
|
5373
5424
|
"p",
|
|
5374
5425
|
{ style: styles.status },
|
|
5375
5426
|
`AI \u6B63\u5728\u626B\u63CF\u9879\u76EE\u5E76\u751F\u6210\u8349\u7A3F\u2026 \u5DF2\u8017\u65F6 ${elapsed} \u79D2\uFF08\u6700\u957F ${INIT_TIMEOUT_S} \u79D2\uFF09\uFF0C\u8BF7\u7A0D\u5019`
|
|
5376
5427
|
) : null,
|
|
5377
|
-
msg !== "" ? (0,
|
|
5378
|
-
draft !== null ? (0,
|
|
5428
|
+
msg !== "" ? (0, import_react3.createElement)("p", { style: styles.status }, msg) : null,
|
|
5429
|
+
draft !== null ? (0, import_react3.createElement)(
|
|
5379
5430
|
"div",
|
|
5380
5431
|
{ style: styles.row },
|
|
5381
|
-
(0,
|
|
5432
|
+
(0, import_react3.createElement)(import_dsh_client_ui_primitives2.Button, {
|
|
5382
5433
|
variant: "primary",
|
|
5383
5434
|
size: "md",
|
|
5384
5435
|
disabled: draft.lines > 200,
|
|
@@ -5387,14 +5438,14 @@ function InitPanel({ workspace, remote }) {
|
|
|
5387
5438
|
void write(draft.content, exists);
|
|
5388
5439
|
}
|
|
5389
5440
|
}, exists ? "\u4FDD\u5B58\u5E76\u8986\u76D6" : "\u4FDD\u5B58"),
|
|
5390
|
-
draft.lines > 200 ? (0,
|
|
5391
|
-
(0,
|
|
5441
|
+
draft.lines > 200 ? (0, import_react3.createElement)("span", { style: styles.sourceBadge }, `\u8349\u7A3F ${draft.lines} \u884C\u8D85\u9650\uFF0C\u8BF7\u70B9\u300C\u653E\u5F03\u300D\u540E\u91CD\u8BD5`) : null,
|
|
5442
|
+
(0, import_react3.createElement)(import_dsh_client_ui_primitives2.Button, { variant: "ghost", size: "md", onClick: () => {
|
|
5392
5443
|
setDraft(null);
|
|
5393
5444
|
} }, "\u653E\u5F03")
|
|
5394
|
-
) : editing ? (0,
|
|
5445
|
+
) : editing ? (0, import_react3.createElement)(
|
|
5395
5446
|
"div",
|
|
5396
5447
|
{ style: styles.row },
|
|
5397
|
-
(0,
|
|
5448
|
+
(0, import_react3.createElement)(import_dsh_client_ui_primitives2.Button, {
|
|
5398
5449
|
variant: "primary",
|
|
5399
5450
|
size: "md",
|
|
5400
5451
|
disabled: body2.trim() === "",
|
|
@@ -5403,13 +5454,13 @@ function InitPanel({ workspace, remote }) {
|
|
|
5403
5454
|
void write(body2, exists);
|
|
5404
5455
|
}
|
|
5405
5456
|
}, exists ? "\u4FDD\u5B58\u5E76\u8986\u76D6" : "\u4FDD\u5B58"),
|
|
5406
|
-
(0,
|
|
5457
|
+
(0, import_react3.createElement)(import_dsh_client_ui_primitives2.Button, { variant: "ghost", size: "md", onClick: () => {
|
|
5407
5458
|
setEditing(false);
|
|
5408
5459
|
} }, "\u53D6\u6D88")
|
|
5409
|
-
) : (0,
|
|
5460
|
+
) : (0, import_react3.createElement)(
|
|
5410
5461
|
"div",
|
|
5411
5462
|
{ style: styles.row },
|
|
5412
|
-
(0,
|
|
5463
|
+
(0, import_react3.createElement)(import_dsh_client_ui_primitives2.Button, {
|
|
5413
5464
|
variant: "primary",
|
|
5414
5465
|
size: "md",
|
|
5415
5466
|
disabled: generating,
|
|
@@ -5418,21 +5469,21 @@ function InitPanel({ workspace, remote }) {
|
|
|
5418
5469
|
void generate();
|
|
5419
5470
|
}
|
|
5420
5471
|
}, exists ? "\u91CD\u65B0\u521D\u59CB\u5316\uFF08AI \u626B\u63CF\u8986\u76D6\uFF09" : "\u8BA9 AI \u521D\u59CB\u5316"),
|
|
5421
|
-
exists ? (0,
|
|
5472
|
+
exists ? (0, import_react3.createElement)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "md", onClick: startEdit }, "\u624B\u52A8\u7F16\u8F91") : null
|
|
5422
5473
|
)
|
|
5423
5474
|
)
|
|
5424
5475
|
);
|
|
5425
5476
|
}
|
|
5426
5477
|
|
|
5427
5478
|
// src/client/SkillManager.tsx
|
|
5428
|
-
var
|
|
5479
|
+
var import_react6 = require("react");
|
|
5429
5480
|
|
|
5430
5481
|
// src/client/ResourceManager.tsx
|
|
5431
|
-
var
|
|
5482
|
+
var import_react5 = require("react");
|
|
5432
5483
|
var import_dsh_client_ui_primitives4 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5433
5484
|
|
|
5434
5485
|
// src/client/ResourceModal.tsx
|
|
5435
|
-
var
|
|
5486
|
+
var import_react4 = require("react");
|
|
5436
5487
|
var import_react_dom = require("react-dom");
|
|
5437
5488
|
var import_dsh_client_ui_primitives3 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5438
5489
|
var rootStyle = {
|
|
@@ -5516,10 +5567,10 @@ var footerStyle = {
|
|
|
5516
5567
|
flex: "none"
|
|
5517
5568
|
};
|
|
5518
5569
|
function ResourceModal({ title, description, onClose, footer, children }) {
|
|
5519
|
-
const dialog = (0,
|
|
5520
|
-
const closer = (0,
|
|
5570
|
+
const dialog = (0, import_react4.useRef)(null);
|
|
5571
|
+
const closer = (0, import_react4.useRef)(onClose);
|
|
5521
5572
|
closer.current = onClose;
|
|
5522
|
-
(0,
|
|
5573
|
+
(0, import_react4.useEffect)(() => {
|
|
5523
5574
|
const previous = document.activeElement;
|
|
5524
5575
|
dialog.current?.focus();
|
|
5525
5576
|
const onKey = (e) => {
|
|
@@ -5552,26 +5603,26 @@ function ResourceModal({ title, description, onClose, footer, children }) {
|
|
|
5552
5603
|
};
|
|
5553
5604
|
}, []);
|
|
5554
5605
|
return (0, import_react_dom.createPortal)(
|
|
5555
|
-
(0,
|
|
5606
|
+
(0, import_react4.createElement)(
|
|
5556
5607
|
"div",
|
|
5557
5608
|
{ style: rootStyle, className: "te-modal", role: "presentation" },
|
|
5558
|
-
(0,
|
|
5559
|
-
(0,
|
|
5609
|
+
(0, import_react4.createElement)("div", { style: maskStyle, "aria-hidden": true, onClick: onClose }),
|
|
5610
|
+
(0, import_react4.createElement)(
|
|
5560
5611
|
"div",
|
|
5561
5612
|
{ style: dialogStyle, ref: dialog, tabIndex: -1, role: "dialog", "aria-modal": true, "aria-label": title },
|
|
5562
|
-
(0,
|
|
5613
|
+
(0, import_react4.createElement)(
|
|
5563
5614
|
"div",
|
|
5564
5615
|
{ style: headerStyle },
|
|
5565
|
-
(0,
|
|
5566
|
-
(0,
|
|
5616
|
+
(0, import_react4.createElement)("h2", { style: titleStyle }, title),
|
|
5617
|
+
(0, import_react4.createElement)(
|
|
5567
5618
|
"button",
|
|
5568
5619
|
{ type: "button", style: closeBtnStyle, "aria-label": "\u5173\u95ED", onClick: onClose },
|
|
5569
|
-
(0,
|
|
5620
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives3.IconCloseOutline16, { size: 14 })
|
|
5570
5621
|
)
|
|
5571
5622
|
),
|
|
5572
|
-
description !== void 0 && description !== "" ? (0,
|
|
5573
|
-
(0,
|
|
5574
|
-
footer !== void 0 ? (0,
|
|
5623
|
+
description !== void 0 && description !== "" ? (0, import_react4.createElement)("p", { style: descStyle }, description) : null,
|
|
5624
|
+
(0, import_react4.createElement)("div", { style: bodyStyle }, children),
|
|
5625
|
+
footer !== void 0 ? (0, import_react4.createElement)("div", { style: footerStyle }, footer) : null
|
|
5575
5626
|
)
|
|
5576
5627
|
),
|
|
5577
5628
|
document.body
|
|
@@ -5586,35 +5637,35 @@ var sizeText = (bytes) => bytes < 1024 ? `${bytes} B` : bytes < 1024 * 1024 ? `$
|
|
|
5586
5637
|
var fail = (r) => describeError(r.error ?? "\u64CD\u4F5C\u5931\u8D25");
|
|
5587
5638
|
function ResourceManager({ workspace, remote, kind }) {
|
|
5588
5639
|
const noun = kind === "skill" ? "\u6280\u80FD" : "\u89C4\u5219";
|
|
5589
|
-
const [rows, setRows] = (0,
|
|
5590
|
-
const [query, setQuery] = (0,
|
|
5591
|
-
const [filter, setFilter] = (0,
|
|
5592
|
-
const [notice, setNotice] = (0,
|
|
5593
|
-
const [error, setError] = (0,
|
|
5594
|
-
const [loading, setLoading] = (0,
|
|
5595
|
-
const [revision, refresh] = (0,
|
|
5596
|
-
const [busy, setBusy] = (0,
|
|
5597
|
-
const [roots, setRoots] = (0,
|
|
5598
|
-
const [importing, setImporting] = (0,
|
|
5599
|
-
const [request, setRequest] = (0,
|
|
5600
|
-
const [preview, setPreview] = (0,
|
|
5601
|
-
const [level, setLevel] = (0,
|
|
5602
|
-
const [manual, setManual] = (0,
|
|
5603
|
-
const [sourceDir, setSourceDir] = (0,
|
|
5604
|
-
const [dirs, setDirs] = (0,
|
|
5605
|
-
const [browsePath, setBrowsePath] = (0,
|
|
5606
|
-
const [editing, setEditing] = (0,
|
|
5607
|
-
const [viewing, setViewing] = (0,
|
|
5608
|
-
const [name, setName] = (0,
|
|
5609
|
-
const [description, setDescription] = (0,
|
|
5610
|
-
const [whenToUse, setWhenToUse] = (0,
|
|
5611
|
-
const [body2, setBody] = (0,
|
|
5612
|
-
const [deleting, setDeleting] = (0,
|
|
5613
|
-
const input = (0,
|
|
5614
|
-
const fileEpoch = (0,
|
|
5615
|
-
const browseEpoch = (0,
|
|
5640
|
+
const [rows, setRows] = (0, import_react5.useState)([]);
|
|
5641
|
+
const [query, setQuery] = (0, import_react5.useState)("");
|
|
5642
|
+
const [filter, setFilter] = (0, import_react5.useState)("all");
|
|
5643
|
+
const [notice, setNotice] = (0, import_react5.useState)("");
|
|
5644
|
+
const [error, setError] = (0, import_react5.useState)("");
|
|
5645
|
+
const [loading, setLoading] = (0, import_react5.useState)(true);
|
|
5646
|
+
const [revision, refresh] = (0, import_react5.useState)(0);
|
|
5647
|
+
const [busy, setBusy] = (0, import_react5.useState)(false);
|
|
5648
|
+
const [roots, setRoots] = (0, import_react5.useState)(null);
|
|
5649
|
+
const [importing, setImporting] = (0, import_react5.useState)(false);
|
|
5650
|
+
const [request, setRequest] = (0, import_react5.useState)(null);
|
|
5651
|
+
const [preview, setPreview] = (0, import_react5.useState)(null);
|
|
5652
|
+
const [level, setLevel] = (0, import_react5.useState)("project");
|
|
5653
|
+
const [manual, setManual] = (0, import_react5.useState)(false);
|
|
5654
|
+
const [sourceDir, setSourceDir] = (0, import_react5.useState)("");
|
|
5655
|
+
const [dirs, setDirs] = (0, import_react5.useState)([]);
|
|
5656
|
+
const [browsePath, setBrowsePath] = (0, import_react5.useState)("");
|
|
5657
|
+
const [editing, setEditing] = (0, import_react5.useState)(null);
|
|
5658
|
+
const [viewing, setViewing] = (0, import_react5.useState)(false);
|
|
5659
|
+
const [name, setName] = (0, import_react5.useState)("");
|
|
5660
|
+
const [description, setDescription] = (0, import_react5.useState)("");
|
|
5661
|
+
const [whenToUse, setWhenToUse] = (0, import_react5.useState)("");
|
|
5662
|
+
const [body2, setBody] = (0, import_react5.useState)("");
|
|
5663
|
+
const [deleting, setDeleting] = (0, import_react5.useState)(null);
|
|
5664
|
+
const input = (0, import_react5.useRef)(null);
|
|
5665
|
+
const fileEpoch = (0, import_react5.useRef)(0);
|
|
5666
|
+
const browseEpoch = (0, import_react5.useRef)(0);
|
|
5616
5667
|
const readonly = editing !== null && editing !== "new" && levelOf(editing) === "bundled";
|
|
5617
|
-
(0,
|
|
5668
|
+
(0, import_react5.useEffect)(() => {
|
|
5618
5669
|
let active = true;
|
|
5619
5670
|
setLoading(true);
|
|
5620
5671
|
setRows([]);
|
|
@@ -5641,7 +5692,7 @@ function ResourceManager({ workspace, remote, kind }) {
|
|
|
5641
5692
|
fileEpoch.current++;
|
|
5642
5693
|
};
|
|
5643
5694
|
}, [workspace, remote, kind, revision]);
|
|
5644
|
-
(0,
|
|
5695
|
+
(0, import_react5.useEffect)(() => {
|
|
5645
5696
|
let active = true;
|
|
5646
5697
|
setPreview(null);
|
|
5647
5698
|
if (!request) return;
|
|
@@ -5805,104 +5856,104 @@ function ResourceManager({ workspace, remote, kind }) {
|
|
|
5805
5856
|
setBusy(false);
|
|
5806
5857
|
}
|
|
5807
5858
|
};
|
|
5808
|
-
const status = () => error ? (0,
|
|
5809
|
-
const targets = () => (0,
|
|
5859
|
+
const status = () => error ? (0, import_react5.createElement)("div", { className: "te-alert", role: "alert" }, error) : null;
|
|
5860
|
+
const targets = () => (0, import_react5.createElement)(
|
|
5810
5861
|
"div",
|
|
5811
5862
|
{ className: "te-targets" },
|
|
5812
|
-
...["project", "user"].map((lvl) => (0,
|
|
5863
|
+
...["project", "user"].map((lvl) => (0, import_react5.createElement)(
|
|
5813
5864
|
"button",
|
|
5814
5865
|
{ type: "button", key: lvl, className: `te-target ${level === lvl ? "selected" : ""}`, "aria-pressed": level === lvl, disabled: busy || editing !== null && editing !== "new", onClick: () => {
|
|
5815
5866
|
setPreview(null);
|
|
5816
5867
|
setLevel(lvl);
|
|
5817
5868
|
} },
|
|
5818
|
-
(0,
|
|
5819
|
-
(0,
|
|
5869
|
+
(0, import_react5.createElement)("strong", null, lvl === "project" ? "\u9879\u76EE\u5171\u4EAB" : "\u4E2A\u4EBA\u5168\u5C40"),
|
|
5870
|
+
(0, import_react5.createElement)("small", null, lvl === "project" ? "\u4EC5\u5F53\u524D\u5DE5\u4F5C\u533A\u4F7F\u7528" : "\u6B64\u4E3B\u673A\u4E0A\u7684\u6240\u6709\u9879\u76EE\u53EF\u7528")
|
|
5820
5871
|
)),
|
|
5821
|
-
(0,
|
|
5872
|
+
(0, import_react5.createElement)("code", { className: "te-path" }, roots?.[level] ?? (level === "project" ? `${workspace}/.dsh/${kind}s` : `DSH_HOME/${kind}s`))
|
|
5822
5873
|
);
|
|
5823
5874
|
const visible = rows.filter((r) => `${r.name} ${r.description ?? ""}`.toLowerCase().includes(query.toLowerCase()) && (filter === "all" || levelOf(r) === filter));
|
|
5824
|
-
return (0,
|
|
5875
|
+
return (0, import_react5.createElement)(
|
|
5825
5876
|
"section",
|
|
5826
5877
|
{ className: "te-resource" },
|
|
5827
|
-
(0,
|
|
5878
|
+
(0, import_react5.createElement)("input", { type: "file", ref: input, hidden: true, "aria-label": kind === "skill" ? "\u9009\u62E9\u6280\u80FD\u6587\u4EF6\u5939" : "\u9009\u62E9\u89C4\u5219\u6587\u4EF6", ...kind === "skill" ? { webkitdirectory: "", multiple: true } : { accept: ".md,text/markdown" }, onChange: (e) => {
|
|
5828
5879
|
void selected(Array.from(e.target.files ?? []));
|
|
5829
5880
|
} }),
|
|
5830
|
-
(0,
|
|
5881
|
+
(0, import_react5.createElement)("div", { className: "te-section-heading" }, (0, import_react5.createElement)("div", null, (0, import_react5.createElement)("h2", null, `${noun}\u5E93`), (0, import_react5.createElement)("p", null, kind === "skill" ? "\u628A\u53EF\u590D\u7528\u7684\u5DE5\u4F5C\u65B9\u6CD5\u5E26\u5165\u9879\u76EE\u3002" : "\u4E3A\u9879\u76EE\u660E\u786E\u7EA6\u5B9A\uFF0C\u8BA9\u6BCF\u6B21\u4EA4\u4ED8\u4FDD\u6301\u4E00\u81F4\u3002")), (0, import_react5.createElement)("div", { className: "te-actions" }, (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "outline", onClick: () => {
|
|
5831
5882
|
void edit("new");
|
|
5832
|
-
} }, `\u65B0\u5EFA${noun}`), (0,
|
|
5833
|
-
(0,
|
|
5834
|
-
notice ? (0,
|
|
5883
|
+
} }, `\u65B0\u5EFA${noun}`), (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "primary", onClick: choose }, `\u5B89\u88C5${noun}`))),
|
|
5884
|
+
(0, import_react5.createElement)("div", { className: "te-toolbar" }, (0, import_react5.createElement)("input", { className: "te-input", placeholder: `\u641C\u7D22${noun}\u540D\u79F0${kind === "skill" ? "\u6216\u63CF\u8FF0" : ""}`, value: query, onChange: (e) => setQuery(e.target.value) }), (0, import_react5.createElement)("select", { className: "te-input", "aria-label": "\u7B5B\u9009\u6765\u6E90", value: filter, onChange: (e) => setFilter(e.target.value) }, (0, import_react5.createElement)("option", { value: "all" }, `\u5168\u90E8\u6765\u6E90 \xB7 ${rows.length}`), (0, import_react5.createElement)("option", { value: "bundled" }, "\u5185\u7F6E"), (0, import_react5.createElement)("option", { value: "project" }, "\u9879\u76EE"), (0, import_react5.createElement)("option", { value: "user" }, "\u4E2A\u4EBA")), (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "ghost", onClick: () => refresh((n) => n + 1), disabled: loading }, "\u5237\u65B0")),
|
|
5885
|
+
notice ? (0, import_react5.createElement)("div", { className: "te-success", role: "status" }, notice) : null,
|
|
5835
5886
|
!importing && !editing && !deleting ? status() : null,
|
|
5836
|
-
loading ? (0,
|
|
5887
|
+
loading ? (0, import_react5.createElement)("div", { className: "te-empty", role: "status" }, "\u6B63\u5728\u52A0\u8F7D\u2026") : visible.length === 0 ? (0, import_react5.createElement)("div", { className: "te-empty" }, (0, import_react5.createElement)("h3", null, query || filter !== "all" ? "\u6CA1\u6709\u5339\u914D\u7684\u7ED3\u679C" : `\u8FD8\u6CA1\u6709${noun}`), (0, import_react5.createElement)("p", null, "\u8C03\u6574\u7B5B\u9009\uFF0C\u6216\u4F7F\u7528\u53F3\u4E0A\u89D2\u6309\u94AE\u6DFB\u52A0\u3002")) : (0, import_react5.createElement)("div", { className: "te-resource-grid" }, ...visible.map((row) => (0, import_react5.createElement)(
|
|
5837
5888
|
"article",
|
|
5838
5889
|
{ className: "te-resource-card", key: row.source + "/" + row.name },
|
|
5839
|
-
(0,
|
|
5840
|
-
(0,
|
|
5841
|
-
(0,
|
|
5842
|
-
(0,
|
|
5890
|
+
(0, import_react5.createElement)("div", { className: "te-card-top" }, (0, import_react5.createElement)("span", { className: "te-resource-icon", "aria-hidden": true }, kind === "skill" ? "\u25C7" : "\u2261"), (0, import_react5.createElement)("span", { className: "te-badge" }, sourceText2(row.source))),
|
|
5891
|
+
(0, import_react5.createElement)("h3", null, row.name),
|
|
5892
|
+
(0, import_react5.createElement)("p", null, row.description || "\u9879\u76EE\u7EA6\u5B9A\u4E0E\u6267\u884C\u89C4\u5219"),
|
|
5893
|
+
(0, import_react5.createElement)("div", { className: "te-actions" }, (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "outline", size: "sm", onClick: () => {
|
|
5843
5894
|
void edit(row, true);
|
|
5844
|
-
} }, "\u67E5\u770B"), levelOf(row) !== "bundled" ? (0,
|
|
5895
|
+
} }, "\u67E5\u770B"), levelOf(row) !== "bundled" ? (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "ghost", size: "sm", onClick: () => {
|
|
5845
5896
|
void edit(row);
|
|
5846
|
-
} }, "\u7F16\u8F91") : null, levelOf(row) !== "bundled" ? (0,
|
|
5897
|
+
} }, "\u7F16\u8F91") : null, levelOf(row) !== "bundled" ? (0, import_react5.createElement)("button", { className: "te-delete", onClick: () => {
|
|
5847
5898
|
setDeleting(row);
|
|
5848
5899
|
setError("");
|
|
5849
5900
|
} }, "\u5220\u9664") : null)
|
|
5850
5901
|
))),
|
|
5851
|
-
kind === "skill" ? (0,
|
|
5902
|
+
kind === "skill" ? (0, import_react5.createElement)("button", { className: "te-link", onClick: () => {
|
|
5852
5903
|
setImporting(true);
|
|
5853
5904
|
setManual(true);
|
|
5854
5905
|
setError("");
|
|
5855
5906
|
} }, "\u9AD8\u7EA7\uFF1A\u4ECE Harness \u4E3B\u673A\u8DEF\u5F84\u5B89\u88C5") : null,
|
|
5856
|
-
importing ? (0,
|
|
5907
|
+
importing ? (0, import_react5.createElement)(
|
|
5857
5908
|
ResourceModal,
|
|
5858
|
-
{ title: `\u5B89\u88C5${noun}`, description: "\u5148\u68C0\u67E5\u5185\u5BB9\u548C\u5B89\u88C5\u4F4D\u7F6E\uFF0C\u786E\u8BA4\u540E\u624D\u4F1A\u5199\u5165\u3002", onClose: close, footer: (0,
|
|
5909
|
+
{ title: `\u5B89\u88C5${noun}`, description: "\u5148\u68C0\u67E5\u5185\u5BB9\u548C\u5B89\u88C5\u4F4D\u7F6E\uFF0C\u786E\u8BA4\u540E\u624D\u4F1A\u5199\u5165\u3002", onClose: close, footer: (0, import_react5.createElement)("div", { className: "te-actions" }, (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "ghost", disabled: busy, onClick: close }, "\u53D6\u6D88"), (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "primary", disabled: busy || !preview || preview.conflict, onClick: () => {
|
|
5859
5910
|
void install();
|
|
5860
5911
|
} }, busy ? "\u5904\u7406\u4E2D\u2026" : "\u786E\u8BA4\u5B89\u88C5")) },
|
|
5861
5912
|
targets(),
|
|
5862
|
-
(0,
|
|
5863
|
-
manual ? (0,
|
|
5913
|
+
(0, import_react5.createElement)("div", { className: "te-actions" }, (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "outline", disabled: busy, onClick: choose }, "\u91CD\u65B0\u9009\u62E9"), kind === "skill" ? (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "ghost", disabled: busy, onClick: () => setManual(!manual) }, manual ? "\u6536\u8D77\u9AD8\u7EA7\u65B9\u5F0F" : "\u4E3B\u673A\u8DEF\u5F84") : null),
|
|
5914
|
+
manual ? (0, import_react5.createElement)("div", { className: "te-advanced" }, (0, import_react5.createElement)("p", null, "\u6B64\u8DEF\u5F84\u4F4D\u4E8E Harness \u4E3B\u673A\uFF1B\u6D4F\u89C8\u5668\u9009\u62E9\u5668\u8BFB\u53D6\u7684\u662F\u4F60\u5F53\u524D\u7535\u8111\u3002"), (0, import_react5.createElement)("div", { className: "te-toolbar" }, (0, import_react5.createElement)("input", { className: "te-input", "aria-label": "\u4E3B\u673A\u6280\u80FD\u76EE\u5F55", value: sourceDir, onChange: (e) => {
|
|
5864
5915
|
setSourceDir(e.target.value);
|
|
5865
5916
|
setRequest(null);
|
|
5866
|
-
} }), (0,
|
|
5917
|
+
} }), (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "outline", onClick: () => {
|
|
5867
5918
|
void browse(sourceDir);
|
|
5868
|
-
} }, "\u6D4F\u89C8"), (0,
|
|
5919
|
+
} }, "\u6D4F\u89C8"), (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "outline", disabled: busy || !sourceDir.trim(), onClick: () => setRequest({ kind, level, path: workspace, files: [], sourceDir }) }, "\u9884\u89C8\u76EE\u5F55")), (0, import_react5.createElement)("div", { className: "te-dir-list" }, browsePath ? (0, import_react5.createElement)("button", { onClick: () => {
|
|
5869
5920
|
void browse(browsePath.replace(/[\\/][^\\/]+[\\/]?$/u, "") || "/");
|
|
5870
|
-
} }, "\u2191 \u4E0A\u7EA7\u76EE\u5F55") : null, ...dirs.map((d) => (0,
|
|
5921
|
+
} }, "\u2191 \u4E0A\u7EA7\u76EE\u5F55") : null, ...dirs.map((d) => (0, import_react5.createElement)("button", { key: d.name, onClick: () => {
|
|
5871
5922
|
setRequest(null);
|
|
5872
5923
|
void browse(browsePath.replace(/[\\/]+$/u, "") + "/" + d.name);
|
|
5873
5924
|
} }, d.name + (d.hasSkill ? " \xB7 SKILL.md" : ""))))) : null,
|
|
5874
|
-
busy ? (0,
|
|
5925
|
+
busy ? (0, import_react5.createElement)("p", { role: "status" }, "\u6B63\u5728\u6821\u9A8C\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u5019\u2026") : null,
|
|
5875
5926
|
status(),
|
|
5876
|
-
preview ? (0,
|
|
5927
|
+
preview ? (0, import_react5.createElement)("div", { className: "te-preview" }, (0, import_react5.createElement)("h3", null, preview.name), (0, import_react5.createElement)("p", null, preview.description), (0, import_react5.createElement)("div", { className: "te-actions" }, (0, import_react5.createElement)("span", { className: "te-badge" }, `${preview.files} \u4E2A\u6587\u4EF6`), (0, import_react5.createElement)("span", { className: "te-badge" }, sizeText(preview.bytes))), (0, import_react5.createElement)("code", { className: "te-path" }, preview.target), preview.conflict ? (0, import_react5.createElement)("div", { className: "te-alert", role: "alert" }, "\u5DF2\u6709\u540C\u540D\u8D44\u6E90\u3002\u8BF7\u53D6\u6D88\u5E76\u68C0\u67E5\u73B0\u6709\u5185\u5BB9\uFF0C\u5B89\u88C5\u4E0D\u4F1A\u8986\u76D6\u5B83\u3002") : null, (0, import_react5.createElement)("div", { className: "te-markdown" }, (0, import_react5.createElement)(import_dsh_client_ui_primitives4.MarkdownText, { text: preview.content, labels }))) : null
|
|
5877
5928
|
) : null,
|
|
5878
|
-
editing ? (0,
|
|
5929
|
+
editing ? (0, import_react5.createElement)(
|
|
5879
5930
|
ResourceModal,
|
|
5880
|
-
{ title: editing === "new" ? `\u65B0\u5EFA${noun}` : `${viewing ? "\u67E5\u770B" : "\u7F16\u8F91"}${noun} \xB7 ${name}`, onClose: close, footer: (0,
|
|
5931
|
+
{ title: editing === "new" ? `\u65B0\u5EFA${noun}` : `${viewing ? "\u67E5\u770B" : "\u7F16\u8F91"}${noun} \xB7 ${name}`, onClose: close, footer: (0, import_react5.createElement)("div", { className: "te-actions" }, (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "ghost", disabled: busy, onClick: close }, "\u5173\u95ED"), !readonly ? (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "outline", disabled: busy, onClick: () => setViewing(!viewing) }, viewing ? "\u7F16\u8F91\u5185\u5BB9" : "\u9884\u89C8") : null, !readonly ? (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "primary", disabled: busy || !name.trim() || !body2.trim() || kind === "skill" && !description.trim(), onClick: () => {
|
|
5881
5932
|
void save2();
|
|
5882
5933
|
} }, busy ? "\u5904\u7406\u4E2D\u2026" : "\u4FDD\u5B58") : null) },
|
|
5883
|
-
!readonly ? targets() : (0,
|
|
5934
|
+
!readonly ? targets() : (0, import_react5.createElement)("p", { className: "te-badge" }, "\u5185\u7F6E\u8D44\u6E90 \xB7 \u53EA\u8BFB"),
|
|
5884
5935
|
status(),
|
|
5885
|
-
viewing ? (0,
|
|
5936
|
+
viewing ? (0, import_react5.createElement)("div", { className: "te-markdown" }, (0, import_react5.createElement)(import_dsh_client_ui_primitives4.MarkdownText, { text: body2, labels })) : (0, import_react5.createElement)("div", { className: "te-form" }, (0, import_react5.createElement)("label", null, "\u540D\u79F0", (0, import_react5.createElement)("input", { className: "te-input", value: name, disabled: editing !== "new" || busy, onChange: (e) => setName(e.target.value), placeholder: "\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u8FDE\u5B57\u7B26" })), kind === "skill" ? (0, import_react5.createElement)("label", null, "\u63CF\u8FF0", (0, import_react5.createElement)("input", { className: "te-input", value: description, disabled: busy, onChange: (e) => setDescription(e.target.value) })) : null, kind === "skill" ? (0, import_react5.createElement)("label", null, "\u4F7F\u7528\u65F6\u673A\uFF08\u53EF\u9009\uFF09", (0, import_react5.createElement)("input", { className: "te-input", value: whenToUse, disabled: busy, onChange: (e) => setWhenToUse(e.target.value) })) : null, (0, import_react5.createElement)("label", null, "Markdown \u6B63\u6587", (0, import_react5.createElement)("textarea", { className: "te-input te-editor", value: body2, disabled: busy, onChange: (e) => setBody(e.target.value) })))
|
|
5886
5937
|
) : null,
|
|
5887
|
-
deleting ? (0,
|
|
5938
|
+
deleting ? (0, import_react5.createElement)(ResourceModal, { title: `\u5220\u9664${noun}\u300C${deleting.name}\u300D\uFF1F`, description: levelOf(deleting) === "user" ? "\u8FD9\u662F\u4E2A\u4EBA\u5168\u5C40\u8D44\u6E90\uFF0C\u5220\u9664\u4F1A\u5F71\u54CD\u6B64\u4E3B\u673A\u4E0A\u7684\u6240\u6709\u9879\u76EE\u3002" : "\u5220\u9664\u5C06\u5F71\u54CD\u5F53\u524D\u9879\u76EE\u3002", onClose: close, footer: (0, import_react5.createElement)("div", { className: "te-actions" }, (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "outline", disabled: busy, onClick: close }, "\u4FDD\u7559"), (0, import_react5.createElement)("button", { className: "te-danger-button", disabled: busy, onClick: () => {
|
|
5888
5939
|
void remove();
|
|
5889
|
-
} }, busy ? "\u5220\u9664\u4E2D\u2026" : "\u786E\u8BA4\u6C38\u4E45\u5220\u9664")) }, (0,
|
|
5940
|
+
} }, busy ? "\u5220\u9664\u4E2D\u2026" : "\u786E\u8BA4\u6C38\u4E45\u5220\u9664")) }, (0, import_react5.createElement)("code", { className: "te-path" }, `${roots?.[levelOf(deleting) === "user" ? "user" : "project"] ?? "\u8D44\u6E90\u76EE\u5F55"}/${deleting.name}${kind === "rule" ? ".md" : ""}`), (0, import_react5.createElement)("p", null, "\u6B64\u64CD\u4F5C\u4E0D\u4F1A\u8FDB\u5165\u56DE\u6536\u7AD9\uFF0C\u8BF7\u786E\u8BA4\u5DF2\u6709\u5907\u4EFD\u3002"), status()) : null
|
|
5890
5941
|
);
|
|
5891
5942
|
}
|
|
5892
5943
|
|
|
5893
5944
|
// src/client/SkillManager.tsx
|
|
5894
5945
|
function SkillManager(props) {
|
|
5895
|
-
return (0,
|
|
5946
|
+
return (0, import_react6.createElement)(ResourceManager, { ...props, key: props.workspace, kind: "skill" });
|
|
5896
5947
|
}
|
|
5897
5948
|
|
|
5898
5949
|
// src/client/RuleManager.tsx
|
|
5899
|
-
var
|
|
5950
|
+
var import_react7 = require("react");
|
|
5900
5951
|
function RuleManager(props) {
|
|
5901
|
-
return (0,
|
|
5952
|
+
return (0, import_react7.createElement)(ResourceManager, { ...props, key: props.workspace, kind: "rule" });
|
|
5902
5953
|
}
|
|
5903
5954
|
|
|
5904
5955
|
// src/client/TaskLedger.tsx
|
|
5905
|
-
var
|
|
5956
|
+
var import_react8 = require("react");
|
|
5906
5957
|
var import_dsh_client_ui_primitives5 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5907
5958
|
var card2 = {
|
|
5908
5959
|
display: "flex",
|
|
@@ -5941,10 +5992,10 @@ var badge = {
|
|
|
5941
5992
|
color: "var(--dsw-alias-label-secondary)"
|
|
5942
5993
|
};
|
|
5943
5994
|
function verdictDot(outcome) {
|
|
5944
|
-
return (0,
|
|
5995
|
+
return (0, import_react8.createElement)(import_dsh_client_ui_primitives5.StateDot, { state: outcome === "pass" ? "done" : "error" });
|
|
5945
5996
|
}
|
|
5946
5997
|
function itemStatusDot(status) {
|
|
5947
|
-
return (0,
|
|
5998
|
+
return (0, import_react8.createElement)(import_dsh_client_ui_primitives5.StateDot, { state: status === "done" ? "done" : "ongoing" });
|
|
5948
5999
|
}
|
|
5949
6000
|
function timeText(at) {
|
|
5950
6001
|
return at.slice(0, 19).replace("T", " ");
|
|
@@ -5952,48 +6003,48 @@ function timeText(at) {
|
|
|
5952
6003
|
function itemAudit(item) {
|
|
5953
6004
|
const lines = [];
|
|
5954
6005
|
if (item.dispatch !== void 0) {
|
|
5955
|
-
lines.push((0,
|
|
6006
|
+
lines.push((0, import_react8.createElement)(
|
|
5956
6007
|
"div",
|
|
5957
6008
|
{ key: "dispatch", style: metaLine },
|
|
5958
|
-
(0,
|
|
5959
|
-
(0,
|
|
5960
|
-
(0,
|
|
6009
|
+
(0, import_react8.createElement)("span", { style: badge }, "\u5DF2\u6D3E\u53D1"),
|
|
6010
|
+
(0, import_react8.createElement)("span", null, item.dispatch.description === "" ? "\uFF08\u65E0\u63CF\u8FF0\uFF09" : item.dispatch.description),
|
|
6011
|
+
(0, import_react8.createElement)("span", { style: badge }, timeText(item.dispatch.at))
|
|
5961
6012
|
));
|
|
5962
6013
|
}
|
|
5963
6014
|
if (item.review !== void 0) {
|
|
5964
6015
|
const spec = item.review.spec;
|
|
5965
6016
|
const quality = item.review.quality;
|
|
5966
|
-
lines.push((0,
|
|
6017
|
+
lines.push((0, import_react8.createElement)(
|
|
5967
6018
|
"div",
|
|
5968
6019
|
{ key: "review", style: metaLine },
|
|
5969
6020
|
verdictDot(spec.outcome),
|
|
5970
|
-
(0,
|
|
5971
|
-
(0,
|
|
6021
|
+
(0, import_react8.createElement)("span", null, `\u89C4\u683C\u7B26\u5408 ${spec.outcome === "pass" ? "\u901A\u8FC7" : "\u4E0D\u901A\u8FC7"}`),
|
|
6022
|
+
(0, import_react8.createElement)("span", null, "\xB7"),
|
|
5972
6023
|
verdictDot(quality.outcome),
|
|
5973
|
-
(0,
|
|
6024
|
+
(0, import_react8.createElement)("span", null, `\u4EE3\u7801\u8D28\u91CF ${quality.outcome === "pass" ? "\u901A\u8FC7" : "\u4E0D\u901A\u8FC7"}`)
|
|
5974
6025
|
));
|
|
5975
6026
|
const failNotes = [spec, quality].flatMap((stage) => stage.outcome === "fail" ? stage.notes ?? [] : []);
|
|
5976
6027
|
if (failNotes.length > 0) {
|
|
5977
|
-
lines.push((0,
|
|
6028
|
+
lines.push((0, import_react8.createElement)(
|
|
5978
6029
|
"div",
|
|
5979
6030
|
{ key: "notes", style: metaLine },
|
|
5980
|
-
...failNotes.map((note) => (0,
|
|
6031
|
+
...failNotes.map((note) => (0, import_react8.createElement)("span", { key: note, style: badge }, note))
|
|
5981
6032
|
));
|
|
5982
6033
|
}
|
|
5983
6034
|
}
|
|
5984
6035
|
if (lines.length === 0) {
|
|
5985
|
-
lines.push((0,
|
|
6036
|
+
lines.push((0, import_react8.createElement)("div", { key: "none", style: metaLine }, (0, import_react8.createElement)("span", { style: badge }, "\u672A\u6D3E\u53D1 / \u672A\u5BA1\u67E5")));
|
|
5986
6037
|
}
|
|
5987
|
-
return (0,
|
|
6038
|
+
return (0, import_react8.createElement)("div", { style: { display: "flex", flexDirection: "column", gap: 4 } }, ...lines);
|
|
5988
6039
|
}
|
|
5989
6040
|
function TaskLedger({ workspace, remote }) {
|
|
5990
|
-
const [tasks, setTasks] = (0,
|
|
5991
|
-
const [error, setError] = (0,
|
|
5992
|
-
const [loading, setLoading] = (0,
|
|
5993
|
-
const [query, setQuery] = (0,
|
|
5994
|
-
const [risk, setRisk] = (0,
|
|
5995
|
-
const [stage, setStage] = (0,
|
|
5996
|
-
const refresh = (0,
|
|
6041
|
+
const [tasks, setTasks] = (0, import_react8.useState)([]);
|
|
6042
|
+
const [error, setError] = (0, import_react8.useState)("");
|
|
6043
|
+
const [loading, setLoading] = (0, import_react8.useState)(true);
|
|
6044
|
+
const [query, setQuery] = (0, import_react8.useState)("");
|
|
6045
|
+
const [risk, setRisk] = (0, import_react8.useState)("all");
|
|
6046
|
+
const [stage, setStage] = (0, import_react8.useState)("all");
|
|
6047
|
+
const refresh = (0, import_react8.useCallback)(() => {
|
|
5997
6048
|
if (workspace === "") return;
|
|
5998
6049
|
setError("");
|
|
5999
6050
|
setLoading(true);
|
|
@@ -6006,57 +6057,57 @@ function TaskLedger({ workspace, remote }) {
|
|
|
6006
6057
|
setError("\u8BFB\u53D6\u53F0\u8D26\u5931\u8D25\uFF1A" + describeError(reason));
|
|
6007
6058
|
});
|
|
6008
6059
|
}, [remote, workspace]);
|
|
6009
|
-
(0,
|
|
6060
|
+
(0, import_react8.useEffect)(() => {
|
|
6010
6061
|
refresh();
|
|
6011
6062
|
}, [refresh]);
|
|
6012
6063
|
const visible = tasks.filter((task) => `${task.task_id} ${task.title} ${task.branch}`.toLowerCase().includes(query.toLowerCase()) && (risk === "all" || task.risk_level === risk) && (stage === "all" || task.stage === stage));
|
|
6013
|
-
return (0,
|
|
6064
|
+
return (0, import_react8.createElement)(
|
|
6014
6065
|
"div",
|
|
6015
6066
|
{ style: styles.section },
|
|
6016
|
-
(0,
|
|
6067
|
+
(0, import_react8.createElement)(
|
|
6017
6068
|
"div",
|
|
6018
6069
|
{ className: "te-toolbar" },
|
|
6019
|
-
(0,
|
|
6020
|
-
(0,
|
|
6021
|
-
(0,
|
|
6070
|
+
(0, import_react8.createElement)("input", { className: "te-input", placeholder: "\u641C\u7D22\u4EFB\u52A1\u3001\u6807\u9898\u6216\u5206\u652F", value: query, onChange: (e) => setQuery(e.target.value) }),
|
|
6071
|
+
(0, import_react8.createElement)("select", { className: "te-input", "aria-label": "\u98CE\u9669\u7B5B\u9009", value: risk, onChange: (e) => setRisk(e.target.value) }, (0, import_react8.createElement)("option", { value: "all" }, "\u5168\u90E8\u98CE\u9669"), (0, import_react8.createElement)("option", { value: "standard" }, "\u6807\u51C6"), (0, import_react8.createElement)("option", { value: "high_risk" }, "\u9AD8\u98CE\u9669")),
|
|
6072
|
+
(0, import_react8.createElement)("select", { className: "te-input", "aria-label": "\u9636\u6BB5\u7B5B\u9009", value: stage, onChange: (e) => setStage(e.target.value) }, (0, import_react8.createElement)("option", { value: "all" }, "\u5168\u90E8\u9636\u6BB5"), ...Array.from(new Set(tasks.map((t) => t.stage))).map((value) => (0, import_react8.createElement)("option", { key: value, value }, value)))
|
|
6022
6073
|
),
|
|
6023
|
-
(0,
|
|
6074
|
+
(0, import_react8.createElement)(
|
|
6024
6075
|
"div",
|
|
6025
6076
|
{ style: headerRow },
|
|
6026
|
-
(0,
|
|
6027
|
-
(0,
|
|
6028
|
-
(0,
|
|
6077
|
+
(0, import_react8.createElement)("span", { style: styles.bindingLabel }, "\u4EFB\u52A1\u53F0\u8D26"),
|
|
6078
|
+
(0, import_react8.createElement)("span", { style: styles.sourceBadge }, "\u53EA\u8BFB \xB7 \u6765\u81EA .dsh/task-*.json"),
|
|
6079
|
+
(0, import_react8.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", size: "sm", disabled: loading, onClick: refresh }, loading ? "\u8BFB\u53D6\u4E2D\u2026" : "\u5237\u65B0")
|
|
6029
6080
|
),
|
|
6030
|
-
loading ? (0,
|
|
6081
|
+
loading ? (0, import_react8.createElement)("p", { role: "status" }, "\u6B63\u5728\u8BFB\u53D6\u4EFB\u52A1\u2026") : error !== "" ? (0, import_react8.createElement)("p", { style: styles.status }, error) : tasks.length === 0 ? (0, import_react8.createElement)("p", { style: styles.muted }, "\u5F53\u524D\u5DE5\u4F5C\u533A\u8FD8\u6CA1\u6709\u4EFB\u52A1\uFF1A\u5F00\u5DE5\u540E\uFF08dev_task create\uFF09\u4F1A\u5728\u8FD9\u91CC\u5217\u51FA\u6D3E\u53D1\u4E0E\u5BA1\u67E5\u7559\u75D5\u3002") : visible.length === 0 ? (0, import_react8.createElement)("div", { className: "te-empty" }, "\u6CA1\u6709\u5339\u914D\u7684\u4EFB\u52A1\uFF0C\u8BF7\u8C03\u6574\u7B5B\u9009\u3002") : (0, import_react8.createElement)(
|
|
6031
6082
|
"div",
|
|
6032
6083
|
{ style: { display: "flex", flexDirection: "column", gap: 12 } },
|
|
6033
|
-
...visible.map((task) => (0,
|
|
6084
|
+
...visible.map((task) => (0, import_react8.createElement)(
|
|
6034
6085
|
"div",
|
|
6035
6086
|
{ key: task.task_id, style: card2 },
|
|
6036
|
-
(0,
|
|
6087
|
+
(0, import_react8.createElement)(
|
|
6037
6088
|
"div",
|
|
6038
6089
|
{ style: headerRow },
|
|
6039
|
-
(0,
|
|
6040
|
-
(0,
|
|
6041
|
-
(0,
|
|
6042
|
-
(0,
|
|
6043
|
-
(0,
|
|
6044
|
-
(0,
|
|
6045
|
-
(0,
|
|
6046
|
-
task.updated_at ? (0,
|
|
6090
|
+
(0, import_react8.createElement)("span", { style: { fontSize: 14, fontWeight: 600, color: "var(--dsw-alias-label-primary)" } }, task.task_id),
|
|
6091
|
+
(0, import_react8.createElement)("span", { style: { fontSize: 13, color: "var(--dsw-alias-label-primary)" } }, task.title),
|
|
6092
|
+
(0, import_react8.createElement)("span", { style: badge }, task.stage),
|
|
6093
|
+
(0, import_react8.createElement)("span", { style: badge }, task.branch),
|
|
6094
|
+
(0, import_react8.createElement)("span", { className: "te-badge", style: task.risk_level === "high_risk" ? { color: "var(--dsw-alias-state-error-primary)" } : {} }, task.risk_level === "high_risk" ? "\u9AD8\u98CE\u9669" : "\u6807\u51C6"),
|
|
6095
|
+
(0, import_react8.createElement)("span", { className: "te-badge" }, task.verification_passed ? "\u9A8C\u8BC1\u901A\u8FC7" : "\u5F85\u9A8C\u8BC1"),
|
|
6096
|
+
(0, import_react8.createElement)("span", { className: "te-badge" }, `\u5BA1\u6838\uFF1A${task.review_outcome ?? "pending"}`),
|
|
6097
|
+
task.updated_at ? (0, import_react8.createElement)("span", { style: metaLine }, "\u66F4\u65B0\u4E8E " + timeText(task.updated_at)) : null
|
|
6047
6098
|
),
|
|
6048
|
-
(0,
|
|
6099
|
+
(0, import_react8.createElement)(
|
|
6049
6100
|
"div",
|
|
6050
6101
|
{ style: { display: "flex", flexDirection: "column" } },
|
|
6051
|
-
...task.items.map((item) => (0,
|
|
6102
|
+
...task.items.map((item) => (0, import_react8.createElement)(
|
|
6052
6103
|
"div",
|
|
6053
6104
|
{ key: item.id, style: itemRow },
|
|
6054
|
-
(0,
|
|
6105
|
+
(0, import_react8.createElement)(
|
|
6055
6106
|
"div",
|
|
6056
6107
|
{ style: headerRow },
|
|
6057
6108
|
itemStatusDot(item.status),
|
|
6058
|
-
(0,
|
|
6059
|
-
(0,
|
|
6109
|
+
(0, import_react8.createElement)("span", { style: { fontSize: 13, color: "var(--dsw-alias-label-primary)" } }, item.id),
|
|
6110
|
+
(0, import_react8.createElement)("span", { style: { fontSize: 12, color: "var(--dsw-alias-label-secondary)" } }, item.title)
|
|
6060
6111
|
),
|
|
6061
6112
|
itemAudit(item)
|
|
6062
6113
|
))
|
|
@@ -6130,29 +6181,29 @@ var TABS = [
|
|
|
6130
6181
|
function Workbench({ useStore, actions, useWorkspaces, remote }) {
|
|
6131
6182
|
const open = useStore((s) => s.open);
|
|
6132
6183
|
const workspaces = useWorkspaces((s) => s.items);
|
|
6133
|
-
const [tab, setTab] = (0,
|
|
6134
|
-
const [workspace, setWorkspace] = (0,
|
|
6184
|
+
const [tab, setTab] = (0, import_react9.useState)("init");
|
|
6185
|
+
const [workspace, setWorkspace] = (0, import_react9.useState)("");
|
|
6135
6186
|
if (!open) return null;
|
|
6136
6187
|
const current = workspaces.some((w) => w.path === workspace) ? workspace : workspaces[0]?.path ?? "";
|
|
6137
|
-
return (0,
|
|
6188
|
+
return (0, import_react9.createElement)(
|
|
6138
6189
|
"div",
|
|
6139
6190
|
{ style: overlay, className: "te-workbench" },
|
|
6140
|
-
(0,
|
|
6141
|
-
(0,
|
|
6191
|
+
(0, import_react9.createElement)("style", null, workbenchTheme),
|
|
6192
|
+
(0, import_react9.createElement)(
|
|
6142
6193
|
"div",
|
|
6143
6194
|
{ style: header },
|
|
6144
|
-
(0,
|
|
6195
|
+
(0, import_react9.createElement)(
|
|
6145
6196
|
"div",
|
|
6146
6197
|
{ style: headerBrand },
|
|
6147
|
-
(0,
|
|
6148
|
-
(0,
|
|
6198
|
+
(0, import_react9.createElement)(import_dsh_client_ui_primitives6.IconSettingsOutline16, { size: 18 }),
|
|
6199
|
+
(0, import_react9.createElement)(
|
|
6149
6200
|
"div",
|
|
6150
6201
|
{ style: headerText },
|
|
6151
|
-
(0,
|
|
6152
|
-
(0,
|
|
6202
|
+
(0, import_react9.createElement)("span", { style: headerTitle }, "\u5DE5\u7A0B\u6D41\u7A0B"),
|
|
6203
|
+
(0, import_react9.createElement)("p", { style: headerSub }, "\u5DE5\u7A0B\u5316\u4EA4\u4ED8\u5DE5\u4F5C\u53F0 \xB7 \u9700\u6C42\u8BC4\u5BA1 \u2192 \u8BBE\u8BA1 \u2192 \u5F00\u53D1 \u2192 \u4EA4\u4ED8 \u2192 \u4EE3\u7801\u5BA1\u6838")
|
|
6153
6204
|
)
|
|
6154
6205
|
),
|
|
6155
|
-
(0,
|
|
6206
|
+
(0, import_react9.createElement)(
|
|
6156
6207
|
"button",
|
|
6157
6208
|
{
|
|
6158
6209
|
type: "button",
|
|
@@ -6168,44 +6219,44 @@ function Workbench({ useStore, actions, useWorkspaces, remote }) {
|
|
|
6168
6219
|
event.currentTarget.style.background = "transparent";
|
|
6169
6220
|
}
|
|
6170
6221
|
},
|
|
6171
|
-
(0,
|
|
6222
|
+
(0, import_react9.createElement)(import_dsh_client_ui_primitives6.IconCloseOutline16, { size: 16 })
|
|
6172
6223
|
)
|
|
6173
6224
|
),
|
|
6174
|
-
(0,
|
|
6225
|
+
(0, import_react9.createElement)(
|
|
6175
6226
|
"div",
|
|
6176
6227
|
{ style: tabbar },
|
|
6177
|
-
...TABS.map((t) => (0,
|
|
6228
|
+
...TABS.map((t) => (0, import_react9.createElement)(import_dsh_client_ui_primitives6.Pill, { key: t.id, active: tab === t.id, onClick: () => {
|
|
6178
6229
|
setTab(t.id);
|
|
6179
6230
|
} }, t.label)),
|
|
6180
|
-
workspaces.length > 0 ? (0,
|
|
6231
|
+
workspaces.length > 0 ? (0, import_react9.createElement)("select", {
|
|
6181
6232
|
style: selectStyle,
|
|
6182
6233
|
"aria-label": "\u5F53\u524D\u5DE5\u4F5C\u533A",
|
|
6183
6234
|
value: current,
|
|
6184
6235
|
onChange: (ev) => {
|
|
6185
6236
|
setWorkspace(ev.target.value);
|
|
6186
6237
|
}
|
|
6187
|
-
}, ...workspaces.map((w) => (0,
|
|
6238
|
+
}, ...workspaces.map((w) => (0, import_react9.createElement)("option", { key: w.path, value: w.path }, w.title || w.path))) : null
|
|
6188
6239
|
),
|
|
6189
|
-
(0,
|
|
6240
|
+
(0, import_react9.createElement)(
|
|
6190
6241
|
"div",
|
|
6191
6242
|
{ style: body },
|
|
6192
|
-
(0,
|
|
6243
|
+
(0, import_react9.createElement)(
|
|
6193
6244
|
"div",
|
|
6194
6245
|
{ className: "te-content", key: current },
|
|
6195
|
-
(0,
|
|
6196
|
-
current === "" ? (0,
|
|
6246
|
+
(0, import_react9.createElement)("p", { style: { ...styles.hint, marginBottom: 20 }, title: current }, "\u5DE5\u4F5C\u533A \xB7 " + current),
|
|
6247
|
+
current === "" ? (0, import_react9.createElement)("p", { style: styles.muted }, "\u5F53\u524D\u6CA1\u6709\u5DE5\u4F5C\u533A\uFF1A\u8BF7\u5148\u5728\u4FA7\u680F\u521B\u5EFA\u4E00\u4E2A\u5DE5\u4F5C\u533A\uFF0C\u518D\u56DE\u6765\u914D\u7F6E\u6D41\u7A0B\u3002") : tab === "init" ? (0, import_react9.createElement)(InitPanel, { workspace: current, remote }) : tab === "flow" ? (0, import_react9.createElement)(TaskEngineSection, { workspace: current, remote }) : tab === "tasks" ? (0, import_react9.createElement)(TaskLedger, { workspace: current, remote }) : tab === "skills" ? (0, import_react9.createElement)(SkillManager, { workspace: current, remote }) : (0, import_react9.createElement)(RuleManager, { workspace: current, remote })
|
|
6197
6248
|
)
|
|
6198
6249
|
)
|
|
6199
6250
|
);
|
|
6200
6251
|
}
|
|
6201
6252
|
|
|
6202
6253
|
// src/client/TriggerButton.tsx
|
|
6203
|
-
var
|
|
6254
|
+
var import_react10 = require("react");
|
|
6204
6255
|
var import_dsh_client_ui_primitives7 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6205
6256
|
var hover = "var(--dsw-alias-bg-layer-2)";
|
|
6206
6257
|
var label = "var(--dsw-alias-label-primary)";
|
|
6207
6258
|
function TriggerButton({ wide, actions }) {
|
|
6208
|
-
return (0,
|
|
6259
|
+
return (0, import_react10.createElement)(
|
|
6209
6260
|
"button",
|
|
6210
6261
|
{
|
|
6211
6262
|
type: "button",
|
|
@@ -6245,8 +6296,8 @@ function TriggerButton({ wide, actions }) {
|
|
|
6245
6296
|
transition: "background 120ms ease"
|
|
6246
6297
|
}
|
|
6247
6298
|
},
|
|
6248
|
-
(0,
|
|
6249
|
-
wide ? (0,
|
|
6299
|
+
(0, import_react10.createElement)(import_dsh_client_ui_primitives7.IconSettingsOutline16, { size: wide ? 16 : 18 }),
|
|
6300
|
+
wide ? (0, import_react10.createElement)("span", { style: { fontSize: 14, lineHeight: "22px" } }, "\u5DE5\u7A0B\u6D41\u7A0B") : null
|
|
6250
6301
|
);
|
|
6251
6302
|
}
|
|
6252
6303
|
|