@godv61/dsh-task-engine 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -5
- package/docs/manual.html +5 -4
- package/lib/client.js +459 -180
- package/lib/client.js.map +4 -4
- package/lib/controller.d.ts +56 -1
- package/lib/controller.js +288 -21
- package/lib/controller.js.map +1 -1
- package/lib/dev-task.js +161 -66
- package/lib/dev-task.js.map +1 -1
- package/lib/engine.d.ts +17 -2
- package/lib/engine.js +4 -3
- package/lib/engine.js.map +1 -1
- package/lib/workflows.d.ts +47 -12
- package/lib/workflows.js +89 -19
- package/lib/workflows.js.map +1 -1
- package/package.json +6 -2
- package/skills/eng-delivery/SKILL.md +1 -1
package/lib/client.js
CHANGED
|
@@ -4199,6 +4199,30 @@ var taskLedgerViewSchema = external_exports.object({
|
|
|
4199
4199
|
items: external_exports.array(taskLedgerItemSchema)
|
|
4200
4200
|
}))
|
|
4201
4201
|
});
|
|
4202
|
+
var initViewSchema = external_exports.object({
|
|
4203
|
+
exists: external_exports.boolean(),
|
|
4204
|
+
content: external_exports.string(),
|
|
4205
|
+
lines: external_exports.number(),
|
|
4206
|
+
path: external_exports.string().optional()
|
|
4207
|
+
});
|
|
4208
|
+
var initWriteRequestSchema = external_exports.object({
|
|
4209
|
+
path: external_exports.string(),
|
|
4210
|
+
content: external_exports.string()
|
|
4211
|
+
});
|
|
4212
|
+
var initWriteResultSchema = external_exports.object({
|
|
4213
|
+
ok: external_exports.boolean(),
|
|
4214
|
+
lines: external_exports.number(),
|
|
4215
|
+
error: external_exports.string().optional()
|
|
4216
|
+
});
|
|
4217
|
+
var initGenerateRequestSchema = external_exports.object({
|
|
4218
|
+
path: external_exports.string()
|
|
4219
|
+
});
|
|
4220
|
+
var initDraftSchema = external_exports.object({
|
|
4221
|
+
ok: external_exports.boolean(),
|
|
4222
|
+
content: external_exports.string(),
|
|
4223
|
+
lines: external_exports.number(),
|
|
4224
|
+
error: external_exports.string().optional()
|
|
4225
|
+
});
|
|
4202
4226
|
var PACKAGE = "@godv61/dsh-task-engine";
|
|
4203
4227
|
var TYPERT_REMOTE = {
|
|
4204
4228
|
package: PACKAGE,
|
|
@@ -4378,14 +4402,62 @@ var TYPERT_REMOTE = {
|
|
|
4378
4402
|
}
|
|
4379
4403
|
],
|
|
4380
4404
|
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#TaskLedgerView`, schema: taskLedgerViewSchema }
|
|
4405
|
+
},
|
|
4406
|
+
{
|
|
4407
|
+
id: `${PACKAGE}#task-engine/readInit`,
|
|
4408
|
+
service: "taskEngineController",
|
|
4409
|
+
namespace: "task-engine",
|
|
4410
|
+
method: "readInit",
|
|
4411
|
+
invocation: { kind: "direct" },
|
|
4412
|
+
parameters: [
|
|
4413
|
+
{
|
|
4414
|
+
name: "path",
|
|
4415
|
+
wire: "path",
|
|
4416
|
+
source: "json",
|
|
4417
|
+
codec: { mode: "strict", typeSymbol: "string", schema: external_exports.string() }
|
|
4418
|
+
}
|
|
4419
|
+
],
|
|
4420
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#InitView`, schema: initViewSchema }
|
|
4421
|
+
},
|
|
4422
|
+
{
|
|
4423
|
+
id: `${PACKAGE}#task-engine/writeInit`,
|
|
4424
|
+
service: "taskEngineController",
|
|
4425
|
+
namespace: "task-engine",
|
|
4426
|
+
method: "writeInit",
|
|
4427
|
+
invocation: { kind: "direct" },
|
|
4428
|
+
parameters: [
|
|
4429
|
+
{
|
|
4430
|
+
name: "request",
|
|
4431
|
+
wire: "request",
|
|
4432
|
+
source: "json",
|
|
4433
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#InitWriteRequest`, schema: initWriteRequestSchema }
|
|
4434
|
+
}
|
|
4435
|
+
],
|
|
4436
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#InitWriteResult`, schema: initWriteResultSchema }
|
|
4437
|
+
},
|
|
4438
|
+
{
|
|
4439
|
+
id: `${PACKAGE}#task-engine/generateInit`,
|
|
4440
|
+
service: "taskEngineController",
|
|
4441
|
+
namespace: "task-engine",
|
|
4442
|
+
method: "generateInit",
|
|
4443
|
+
invocation: { kind: "direct" },
|
|
4444
|
+
parameters: [
|
|
4445
|
+
{
|
|
4446
|
+
name: "request",
|
|
4447
|
+
wire: "request",
|
|
4448
|
+
source: "json",
|
|
4449
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#InitGenerateRequest`, schema: initGenerateRequestSchema }
|
|
4450
|
+
}
|
|
4451
|
+
],
|
|
4452
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#InitDraft`, schema: initDraftSchema }
|
|
4381
4453
|
}
|
|
4382
4454
|
]
|
|
4383
4455
|
};
|
|
4384
4456
|
var remote_default = TYPERT_REMOTE;
|
|
4385
4457
|
|
|
4386
4458
|
// src/client/Workbench.tsx
|
|
4387
|
-
var
|
|
4388
|
-
var
|
|
4459
|
+
var import_react7 = require("react");
|
|
4460
|
+
var import_dsh_client_ui_primitives7 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
4389
4461
|
|
|
4390
4462
|
// src/client/styles.ts
|
|
4391
4463
|
var text = "var(--dsw-alias-label-primary)";
|
|
@@ -4640,17 +4712,49 @@ var MINIMAL = {
|
|
|
4640
4712
|
"\u4EA4\u4ED8": { skills: ["code-commit"], rules: ["commit-conventions"] }
|
|
4641
4713
|
}
|
|
4642
4714
|
};
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4715
|
+
function deriveCapabilities(config) {
|
|
4716
|
+
const caps = [];
|
|
4717
|
+
const guards = new Set(config.transitions.flatMap((t) => t.requires ?? []));
|
|
4718
|
+
if (guards.has("verified")) caps.push("verification_gate");
|
|
4719
|
+
if (guards.has("review_passed")) caps.push("review_gate");
|
|
4720
|
+
if (guards.has("artifacts_present")) caps.push("artifact_gate");
|
|
4721
|
+
if (config.commit.file_scope) caps.push("file_scope");
|
|
4722
|
+
return caps;
|
|
4723
|
+
}
|
|
4724
|
+
function preset(id, version, label, description, config) {
|
|
4725
|
+
return { id, version, label, description, capabilities: deriveCapabilities(config), config };
|
|
4726
|
+
}
|
|
4727
|
+
var FLOW_PRESETS = {
|
|
4728
|
+
standard: preset("standard", 1, "\u6807\u51C6\u7814\u53D1", "\u9700\u6C42\u8BC4\u5BA1 \u2192 \u8BBE\u8BA1 \u2192 \u5F00\u53D1 \u2192 \u4EA4\u4ED8 \u2192 \u4EE3\u7801\u5BA1\u6838\uFF0C\u542B\u4EA7\u7269\u95E8 + \u786E\u8BA4\u95E8", STANDARD),
|
|
4729
|
+
agile: preset("agile", 1, "\u654F\u6377\u8F7B\u91CF", "\u9700\u6C42 \u2192 \u5F00\u53D1 \u2192 \u4EA4\u4ED8 \u2192 \u5BA1\u67E5\uFF0C\u56DB\u9636\u6BB5\u3001\u5C11\u4EA7\u7269", AGILE),
|
|
4730
|
+
minimal: preset("minimal", 1, "\u7EAF\u4EE3\u7801", "\u5F00\u53D1 \u2192 \u4EA4\u4ED8\uFF0C\u4E24\u9636\u6BB5\uFF0C\u53EA\u7559\u63D0\u4EA4\u95E8\u7981", MINIMAL)
|
|
4647
4731
|
};
|
|
4648
|
-
function
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4732
|
+
function dedupe(names) {
|
|
4733
|
+
return [...new Set(names)];
|
|
4734
|
+
}
|
|
4735
|
+
function mergeBindings(base, override) {
|
|
4736
|
+
if (override === void 0) return base;
|
|
4737
|
+
let changed = false;
|
|
4738
|
+
const merged = { ...base.stage_bindings };
|
|
4739
|
+
for (const [stage, addition] of Object.entries(override)) {
|
|
4740
|
+
const existing = merged[stage];
|
|
4741
|
+
const skills = dedupe([...existing?.skills ?? [], ...addition.skills ?? []]);
|
|
4742
|
+
const rules = dedupe([...existing?.rules ?? [], ...addition.rules ?? []]);
|
|
4743
|
+
const binding = {};
|
|
4744
|
+
if (skills.length > 0) binding.skills = skills;
|
|
4745
|
+
if (rules.length > 0) binding.rules = rules;
|
|
4746
|
+
merged[stage] = binding;
|
|
4747
|
+
changed = true;
|
|
4748
|
+
}
|
|
4749
|
+
if (!changed) return base;
|
|
4750
|
+
return { ...base, stage_bindings: merged };
|
|
4751
|
+
}
|
|
4752
|
+
function resolveFlow(flow, override) {
|
|
4753
|
+
const preset2 = FLOW_PRESETS[flow];
|
|
4754
|
+
if (preset2 === void 0) {
|
|
4755
|
+
return { ok: false, code: "UNKNOWN_FLOW", flow, knownFlows: Object.keys(FLOW_PRESETS) };
|
|
4652
4756
|
}
|
|
4653
|
-
return
|
|
4757
|
+
return { ok: true, config: mergeBindings(preset2.config, override?.stage_bindings), preset: preset2 };
|
|
4654
4758
|
}
|
|
4655
4759
|
|
|
4656
4760
|
// src/client/shared.ts
|
|
@@ -4680,6 +4784,10 @@ function describeError(error) {
|
|
|
4680
4784
|
|
|
4681
4785
|
// src/client/TaskEngineSection.tsx
|
|
4682
4786
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
4787
|
+
function resolvedConfig(flow, stageBindings) {
|
|
4788
|
+
const resolved = resolveFlow(flow, { stage_bindings: stageBindings });
|
|
4789
|
+
return resolved.ok ? resolved.config : FLOW_PRESETS.standard.config;
|
|
4790
|
+
}
|
|
4683
4791
|
var cardV = {
|
|
4684
4792
|
display: "flex",
|
|
4685
4793
|
flexDirection: "column",
|
|
@@ -4732,14 +4840,14 @@ function TaskEngineSection(props) {
|
|
|
4732
4840
|
(0, import_react.useEffect)(() => {
|
|
4733
4841
|
refreshCatalogs();
|
|
4734
4842
|
}, [refreshCatalogs]);
|
|
4735
|
-
const stages = (0, import_react.useMemo)(() => (
|
|
4843
|
+
const stages = (0, import_react.useMemo)(() => (FLOW_PRESETS[flow] ?? FLOW_PRESETS.standard).config.stages, [flow]);
|
|
4736
4844
|
const problems = (0, import_react.useMemo)(
|
|
4737
|
-
() => validateWorkflow(
|
|
4845
|
+
() => validateWorkflow(resolvedConfig(flow, stageBindings)),
|
|
4738
4846
|
[flow, stageBindings]
|
|
4739
4847
|
);
|
|
4740
4848
|
const selectFlow = (id) => {
|
|
4741
4849
|
setFlow(id);
|
|
4742
|
-
setStageBindings({ ...
|
|
4850
|
+
setStageBindings({ ...FLOW_PRESETS[id]?.config.stage_bindings ?? {} });
|
|
4743
4851
|
};
|
|
4744
4852
|
if (loadError !== "") {
|
|
4745
4853
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: styles.wrap, children: [
|
|
@@ -4769,8 +4877,8 @@ function TaskEngineSection(props) {
|
|
|
4769
4877
|
}, title: option.description, children: option.label }, option.id)) }),
|
|
4770
4878
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: styles.hint, children: FLOW_OPTIONS.find((option) => option.id === flow)?.description })
|
|
4771
4879
|
] }),
|
|
4772
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionCard, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconBranchOutline16, { size: 16 }), title: "\u6D41\u7A0B\u8282\u70B9", hint: "\u8BE5\u6D41\u7A0B\u9884\u8BBE\u56FA\u5B9A\u7684\u9636\u6BB5\u987A\u5E8F\uFF1B\u6539\u53D8\u6D41\u7A0B\u8BF7\u5207\u6362\u4E0A\u9762\u7684\u9884\u8BBE\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: styles.chips, children: stages.map((stage) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Pill, { active: stage === (
|
|
4773
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionCard, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconSettingsOutline16, { size: 16 }), title: "\u9636\u6BB5\u6280\u80FD / \u89C4\u5219", hint: "\u9009\u4E00\u4E2A\u8282\u70B9\uFF0C\u52FE\u9009\u5B83\u300C\u7528\u4EC0\u4E48 skill\uFF08\u6280\u80FD\uFF09\u300D\u548C\u300C\u5B88\u54EA\u6761 rule\uFF08\u89C4\u5219\uFF09\u300D\u3002\
|
|
4880
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionCard, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconBranchOutline16, { size: 16 }), title: "\u6D41\u7A0B\u8282\u70B9", hint: "\u8BE5\u6D41\u7A0B\u9884\u8BBE\u56FA\u5B9A\u7684\u9636\u6BB5\u987A\u5E8F\uFF1B\u6539\u53D8\u6D41\u7A0B\u8BF7\u5207\u6362\u4E0A\u9762\u7684\u9884\u8BBE\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: styles.chips, children: stages.map((stage) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Pill, { active: stage === (FLOW_PRESETS[flow]?.config.start_stage ?? ""), title: stage === FLOW_PRESETS[flow]?.config.start_stage ? "\u8D77\u59CB\u9636\u6BB5" : void 0, children: stage }, stage)) }) }),
|
|
4881
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionCard, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconSettingsOutline16, { size: 16 }), title: "\u9636\u6BB5\u6280\u80FD / \u89C4\u5219", hint: "\u9009\u4E00\u4E2A\u8282\u70B9\uFF0C\u52FE\u9009\u5B83\u300C\u7528\u4EC0\u4E48 skill\uFF08\u6280\u80FD\uFF09\u300D\u548C\u300C\u5B88\u54EA\u6761 rule\uFF08\u89C4\u5219\uFF09\u300D\u3002\u6D41\u7A0B\u81EA\u5E26\u7684\u9ED8\u8BA4\u7ED1\u5B9A\u4E0D\u4F1A\u56E0\u53D6\u6D88\u52FE\u9009\u800C\u79FB\u9664\uFF08\u53EA\u4F1A\u4FDD\u7559\u5E76\u8FFD\u52A0\u4F60\u65B0\u52FE\u9009\u7684\uFF09\uFF1B\u8981\u65B0\u5EFA\u6216\u6539\u6B63\u6587\uFF0C\u5207\u5230\u4E0A\u65B9\u7684\u300C\u6280\u80FD\u300D/\u300C\u89C4\u5219\u300D\u6807\u7B7E\u9875\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BindingEditor, { stages, stageBindings, setStageBindings, skills, rules }) }),
|
|
4774
4882
|
problems.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: styles.problems, children: [
|
|
4775
4883
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { style: styles.problemsTitle, children: [
|
|
4776
4884
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.StateDot, { state: "error" }),
|
|
@@ -4902,14 +5010,184 @@ async function save(remote, flow, stageBindings, workspace, setSavedAt, setSourc
|
|
|
4902
5010
|
setSavedAt(result.value.ok ? "\u5DF2\u4FDD\u5B58" : "");
|
|
4903
5011
|
}
|
|
4904
5012
|
|
|
5013
|
+
// src/client/InitPanel.tsx
|
|
5014
|
+
var import_react2 = require("react");
|
|
5015
|
+
var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5016
|
+
var MD_LABELS = { code: { copyLabel: "\u590D\u5236", copiedLabel: "\u5DF2\u590D\u5236" }, footnotes: "\u811A\u6CE8" };
|
|
5017
|
+
var INIT_TIMEOUT_S = 150;
|
|
5018
|
+
var card = {
|
|
5019
|
+
display: "flex",
|
|
5020
|
+
flexDirection: "column",
|
|
5021
|
+
gap: 12,
|
|
5022
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
5023
|
+
borderRadius: 8,
|
|
5024
|
+
padding: "12px 14px"
|
|
5025
|
+
};
|
|
5026
|
+
function InitPanel({ workspace, remote }) {
|
|
5027
|
+
const [view, setView] = (0, import_react2.useState)(null);
|
|
5028
|
+
const [generating, setGenerating] = (0, import_react2.useState)(false);
|
|
5029
|
+
const [elapsed, setElapsed] = (0, import_react2.useState)(0);
|
|
5030
|
+
const [draft, setDraft] = (0, import_react2.useState)(null);
|
|
5031
|
+
const [editing, setEditing] = (0, import_react2.useState)(false);
|
|
5032
|
+
const [body2, setBody] = (0, import_react2.useState)("");
|
|
5033
|
+
const [msg, setMsg] = (0, import_react2.useState)("");
|
|
5034
|
+
(0, import_react2.useEffect)(() => {
|
|
5035
|
+
if (!generating) {
|
|
5036
|
+
setElapsed(0);
|
|
5037
|
+
return;
|
|
5038
|
+
}
|
|
5039
|
+
const started = Date.now();
|
|
5040
|
+
setElapsed(0);
|
|
5041
|
+
const timer = setInterval(() => {
|
|
5042
|
+
setElapsed(Math.round((Date.now() - started) / 1e3));
|
|
5043
|
+
}, 1e3);
|
|
5044
|
+
return () => {
|
|
5045
|
+
clearInterval(timer);
|
|
5046
|
+
};
|
|
5047
|
+
}, [generating]);
|
|
5048
|
+
const refresh = (0, import_react2.useCallback)(() => {
|
|
5049
|
+
void remote.readInit(workspace).then((r) => {
|
|
5050
|
+
if (r.ok) setView(r.value);
|
|
5051
|
+
}, () => {
|
|
5052
|
+
});
|
|
5053
|
+
}, [remote, workspace]);
|
|
5054
|
+
(0, import_react2.useEffect)(() => {
|
|
5055
|
+
refresh();
|
|
5056
|
+
}, [refresh]);
|
|
5057
|
+
const generate = async () => {
|
|
5058
|
+
setMsg("");
|
|
5059
|
+
setGenerating(true);
|
|
5060
|
+
setDraft(null);
|
|
5061
|
+
setEditing(false);
|
|
5062
|
+
const r = await remote.generateInit({ path: workspace });
|
|
5063
|
+
setGenerating(false);
|
|
5064
|
+
if (!r.ok) {
|
|
5065
|
+
setMsg("\u751F\u6210\u5931\u8D25\uFF1A" + describeError(r.error));
|
|
5066
|
+
return;
|
|
5067
|
+
}
|
|
5068
|
+
if (!r.value.ok) {
|
|
5069
|
+
setMsg("\u751F\u6210\u5931\u8D25\uFF1A" + (r.value.error ?? "\u672A\u77E5\u9519\u8BEF"));
|
|
5070
|
+
return;
|
|
5071
|
+
}
|
|
5072
|
+
setDraft(r.value);
|
|
5073
|
+
};
|
|
5074
|
+
const write = async (content) => {
|
|
5075
|
+
setMsg("");
|
|
5076
|
+
const r = await remote.writeInit({ path: workspace, content });
|
|
5077
|
+
if (!r.ok) {
|
|
5078
|
+
setMsg("\u4FDD\u5B58\u5931\u8D25\uFF1A" + describeError(r.error));
|
|
5079
|
+
return;
|
|
5080
|
+
}
|
|
5081
|
+
if (!r.value.ok) {
|
|
5082
|
+
setMsg("\u4FDD\u5B58\u5931\u8D25\uFF1A" + (r.value.error ?? "\u672A\u77E5\u9519\u8BEF"));
|
|
5083
|
+
return;
|
|
5084
|
+
}
|
|
5085
|
+
setDraft(null);
|
|
5086
|
+
setEditing(false);
|
|
5087
|
+
setMsg(`\u5DF2\u5199\u5165 AGENTS.md\uFF08${r.value.lines} \u884C\uFF09`);
|
|
5088
|
+
refresh();
|
|
5089
|
+
};
|
|
5090
|
+
const startEdit = () => {
|
|
5091
|
+
setEditing(true);
|
|
5092
|
+
setDraft(null);
|
|
5093
|
+
setBody(view?.content ?? "");
|
|
5094
|
+
setMsg("");
|
|
5095
|
+
};
|
|
5096
|
+
const exists = view?.exists === true;
|
|
5097
|
+
return (0, import_react2.createElement)(
|
|
5098
|
+
"div",
|
|
5099
|
+
{ style: styles.section },
|
|
5100
|
+
(0, import_react2.createElement)(
|
|
5101
|
+
"div",
|
|
5102
|
+
{ style: card },
|
|
5103
|
+
(0, import_react2.createElement)(
|
|
5104
|
+
"div",
|
|
5105
|
+
{ style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" } },
|
|
5106
|
+
(0, import_react2.createElement)(import_dsh_client_ui_primitives2.StateDot, { state: exists ? "done" : "ongoing" }),
|
|
5107
|
+
(0, import_react2.createElement)("span", { style: styles.bindingLabel }, exists ? `\u5DF2\u521D\u59CB\u5316 \xB7 ${view.lines} \u884C\uFF08\u4E0A\u9650 200\uFF09` : "\u672A\u521D\u59CB\u5316"),
|
|
5108
|
+
view?.path !== void 0 ? (0, import_react2.createElement)("span", { style: styles.sourceBadge }, `\u5DF2\u5B9A\u4F4D\u5230 ${view.path}`) : null
|
|
5109
|
+
),
|
|
5110
|
+
(0, import_react2.createElement)(
|
|
5111
|
+
"p",
|
|
5112
|
+
{ style: styles.muted },
|
|
5113
|
+
"\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"
|
|
5114
|
+
),
|
|
5115
|
+
exists && !editing && draft === null ? (0, import_react2.createElement)(import_dsh_client_ui_primitives2.MarkdownText, { text: view.content, labels: MD_LABELS }) : null,
|
|
5116
|
+
draft !== null ? (0, import_react2.createElement)(
|
|
5117
|
+
"div",
|
|
5118
|
+
{ style: styles.section },
|
|
5119
|
+
(0, import_react2.createElement)("span", { style: styles.sourceBadge }, `AI \u8349\u7A3F \xB7 ${draft.lines} \u884C \xB7 \u5C1A\u672A\u5199\u5165`),
|
|
5120
|
+
(0, import_react2.createElement)(import_dsh_client_ui_primitives2.MarkdownText, { text: draft.content, labels: MD_LABELS })
|
|
5121
|
+
) : null,
|
|
5122
|
+
editing ? (0, import_react2.createElement)("textarea", {
|
|
5123
|
+
style: { ...styles.textarea, minHeight: 300 },
|
|
5124
|
+
placeholder: "AGENTS.md \u6B63\u6587\uFF08Markdown\uFF0C\u2264200 \u884C\uFF09",
|
|
5125
|
+
value: body2,
|
|
5126
|
+
onChange: (ev) => {
|
|
5127
|
+
setBody(ev.target.value);
|
|
5128
|
+
}
|
|
5129
|
+
}) : null,
|
|
5130
|
+
generating ? (0, import_react2.createElement)(
|
|
5131
|
+
"p",
|
|
5132
|
+
{ style: styles.status },
|
|
5133
|
+
`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`
|
|
5134
|
+
) : null,
|
|
5135
|
+
msg !== "" ? (0, import_react2.createElement)("p", { style: styles.status }, msg) : null,
|
|
5136
|
+
draft !== null ? (0, import_react2.createElement)(
|
|
5137
|
+
"div",
|
|
5138
|
+
{ style: styles.row },
|
|
5139
|
+
(0, import_react2.createElement)(import_dsh_client_ui_primitives2.Button, {
|
|
5140
|
+
variant: "primary",
|
|
5141
|
+
size: "md",
|
|
5142
|
+
disabled: draft.lines > 200,
|
|
5143
|
+
onClick: () => {
|
|
5144
|
+
void write(draft.content);
|
|
5145
|
+
}
|
|
5146
|
+
}, exists ? "\u4FDD\u5B58\u5E76\u8986\u76D6" : "\u4FDD\u5B58"),
|
|
5147
|
+
draft.lines > 200 ? (0, import_react2.createElement)("span", { style: styles.sourceBadge }, `\u8349\u7A3F ${draft.lines} \u884C\u8D85\u9650\uFF0C\u8BF7\u70B9\u300C\u653E\u5F03\u300D\u540E\u91CD\u8BD5`) : null,
|
|
5148
|
+
(0, import_react2.createElement)(import_dsh_client_ui_primitives2.Button, { variant: "ghost", size: "md", onClick: () => {
|
|
5149
|
+
setDraft(null);
|
|
5150
|
+
} }, "\u653E\u5F03")
|
|
5151
|
+
) : editing ? (0, import_react2.createElement)(
|
|
5152
|
+
"div",
|
|
5153
|
+
{ style: styles.row },
|
|
5154
|
+
(0, import_react2.createElement)(import_dsh_client_ui_primitives2.Button, {
|
|
5155
|
+
variant: "primary",
|
|
5156
|
+
size: "md",
|
|
5157
|
+
disabled: body2.trim() === "",
|
|
5158
|
+
onClick: () => {
|
|
5159
|
+
void write(body2);
|
|
5160
|
+
}
|
|
5161
|
+
}, exists ? "\u4FDD\u5B58\u5E76\u8986\u76D6" : "\u4FDD\u5B58"),
|
|
5162
|
+
(0, import_react2.createElement)(import_dsh_client_ui_primitives2.Button, { variant: "ghost", size: "md", onClick: () => {
|
|
5163
|
+
setEditing(false);
|
|
5164
|
+
} }, "\u53D6\u6D88")
|
|
5165
|
+
) : (0, import_react2.createElement)(
|
|
5166
|
+
"div",
|
|
5167
|
+
{ style: styles.row },
|
|
5168
|
+
(0, import_react2.createElement)(import_dsh_client_ui_primitives2.Button, {
|
|
5169
|
+
variant: "primary",
|
|
5170
|
+
size: "md",
|
|
5171
|
+
disabled: generating,
|
|
5172
|
+
title: exists ? "\u7528 AI \u91CD\u65B0\u626B\u63CF\u9879\u76EE\u5E76\u8986\u76D6\u73B0\u6709 AGENTS.md" : "\u7528 AI \u626B\u63CF\u9879\u76EE\u5E76\u751F\u6210 AGENTS.md",
|
|
5173
|
+
onClick: () => {
|
|
5174
|
+
void generate();
|
|
5175
|
+
}
|
|
5176
|
+
}, exists ? "\u91CD\u65B0\u521D\u59CB\u5316\uFF08AI \u626B\u63CF\u8986\u76D6\uFF09" : "\u8BA9 AI \u521D\u59CB\u5316"),
|
|
5177
|
+
exists ? (0, import_react2.createElement)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "md", onClick: startEdit }, "\u624B\u52A8\u7F16\u8F91") : null
|
|
5178
|
+
)
|
|
5179
|
+
)
|
|
5180
|
+
);
|
|
5181
|
+
}
|
|
5182
|
+
|
|
4905
5183
|
// src/client/SkillManager.tsx
|
|
4906
|
-
var
|
|
4907
|
-
var
|
|
5184
|
+
var import_react4 = require("react");
|
|
5185
|
+
var import_dsh_client_ui_primitives4 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
4908
5186
|
|
|
4909
5187
|
// src/client/ResourceModal.tsx
|
|
4910
|
-
var
|
|
5188
|
+
var import_react3 = require("react");
|
|
4911
5189
|
var import_react_dom = require("react-dom");
|
|
4912
|
-
var
|
|
5190
|
+
var import_dsh_client_ui_primitives3 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
4913
5191
|
var rootStyle = {
|
|
4914
5192
|
position: "fixed",
|
|
4915
5193
|
inset: 0,
|
|
@@ -4991,7 +5269,7 @@ var footerStyle = {
|
|
|
4991
5269
|
flex: "none"
|
|
4992
5270
|
};
|
|
4993
5271
|
function ResourceModal({ title, description, onClose, footer, children }) {
|
|
4994
|
-
(0,
|
|
5272
|
+
(0, import_react3.useEffect)(() => {
|
|
4995
5273
|
const onKey = (e) => {
|
|
4996
5274
|
if (e.key === "Escape") onClose();
|
|
4997
5275
|
};
|
|
@@ -5001,26 +5279,26 @@ function ResourceModal({ title, description, onClose, footer, children }) {
|
|
|
5001
5279
|
};
|
|
5002
5280
|
}, [onClose]);
|
|
5003
5281
|
return (0, import_react_dom.createPortal)(
|
|
5004
|
-
(0,
|
|
5282
|
+
(0, import_react3.createElement)(
|
|
5005
5283
|
"div",
|
|
5006
5284
|
{ style: rootStyle, role: "presentation" },
|
|
5007
|
-
(0,
|
|
5008
|
-
(0,
|
|
5285
|
+
(0, import_react3.createElement)("div", { style: maskStyle, "aria-hidden": true, onClick: onClose }),
|
|
5286
|
+
(0, import_react3.createElement)(
|
|
5009
5287
|
"div",
|
|
5010
5288
|
{ style: dialogStyle, role: "dialog", "aria-modal": true, "aria-label": title },
|
|
5011
|
-
(0,
|
|
5289
|
+
(0, import_react3.createElement)(
|
|
5012
5290
|
"div",
|
|
5013
5291
|
{ style: headerStyle },
|
|
5014
|
-
(0,
|
|
5015
|
-
(0,
|
|
5292
|
+
(0, import_react3.createElement)("h2", { style: titleStyle }, title),
|
|
5293
|
+
(0, import_react3.createElement)(
|
|
5016
5294
|
"button",
|
|
5017
5295
|
{ type: "button", style: closeBtnStyle, "aria-label": "\u5173\u95ED", onClick: onClose },
|
|
5018
|
-
(0,
|
|
5296
|
+
(0, import_react3.createElement)(import_dsh_client_ui_primitives3.IconCloseOutline16, { size: 14 })
|
|
5019
5297
|
)
|
|
5020
5298
|
),
|
|
5021
|
-
description !== void 0 && description !== "" ? (0,
|
|
5022
|
-
(0,
|
|
5023
|
-
footer !== void 0 ? (0,
|
|
5299
|
+
description !== void 0 && description !== "" ? (0, import_react3.createElement)("p", { style: descStyle }, description) : null,
|
|
5300
|
+
(0, import_react3.createElement)("div", { style: bodyStyle }, children),
|
|
5301
|
+
footer !== void 0 ? (0, import_react3.createElement)("div", { style: footerStyle }, footer) : null
|
|
5024
5302
|
)
|
|
5025
5303
|
),
|
|
5026
5304
|
document.body
|
|
@@ -5028,7 +5306,7 @@ function ResourceModal({ title, description, onClose, footer, children }) {
|
|
|
5028
5306
|
}
|
|
5029
5307
|
|
|
5030
5308
|
// src/client/SkillManager.tsx
|
|
5031
|
-
var
|
|
5309
|
+
var MD_LABELS2 = { code: { copyLabel: "\u590D\u5236", copiedLabel: "\u5DF2\u590D\u5236" }, footnotes: "\u811A\u6CE8" };
|
|
5032
5310
|
var control = {
|
|
5033
5311
|
background: "var(--dsw-alias-bg-layer-1)",
|
|
5034
5312
|
border: "1px solid var(--dsw-alias-border-l2)",
|
|
@@ -5038,7 +5316,7 @@ var control = {
|
|
|
5038
5316
|
fontSize: 13,
|
|
5039
5317
|
minWidth: 0
|
|
5040
5318
|
};
|
|
5041
|
-
var
|
|
5319
|
+
var card2 = {
|
|
5042
5320
|
display: "flex",
|
|
5043
5321
|
flexDirection: "column",
|
|
5044
5322
|
gap: 8,
|
|
@@ -5051,24 +5329,24 @@ function levelOf(source) {
|
|
|
5051
5329
|
return source.startsWith("user") ? "user" : "project";
|
|
5052
5330
|
}
|
|
5053
5331
|
function SkillManager({ workspace, remote }) {
|
|
5054
|
-
const [skills, setSkills] = (0,
|
|
5055
|
-
const [level, setLevel] = (0,
|
|
5056
|
-
const [editing, setEditing] = (0,
|
|
5057
|
-
const [creating, setCreating] = (0,
|
|
5058
|
-
const [viewing, setViewing] = (0,
|
|
5059
|
-
const [confirming, setConfirming] = (0,
|
|
5060
|
-
const [name, setName] = (0,
|
|
5061
|
-
const [description, setDescription] = (0,
|
|
5062
|
-
const [whenToUse, setWhenToUse] = (0,
|
|
5063
|
-
const [body2, setBody] = (0,
|
|
5064
|
-
const [msg, setMsg] = (0,
|
|
5065
|
-
const refresh = (0,
|
|
5332
|
+
const [skills, setSkills] = (0, import_react4.useState)([]);
|
|
5333
|
+
const [level, setLevel] = (0, import_react4.useState)("project");
|
|
5334
|
+
const [editing, setEditing] = (0, import_react4.useState)(null);
|
|
5335
|
+
const [creating, setCreating] = (0, import_react4.useState)(false);
|
|
5336
|
+
const [viewing, setViewing] = (0, import_react4.useState)(false);
|
|
5337
|
+
const [confirming, setConfirming] = (0, import_react4.useState)(null);
|
|
5338
|
+
const [name, setName] = (0, import_react4.useState)("");
|
|
5339
|
+
const [description, setDescription] = (0, import_react4.useState)("");
|
|
5340
|
+
const [whenToUse, setWhenToUse] = (0, import_react4.useState)("");
|
|
5341
|
+
const [body2, setBody] = (0, import_react4.useState)("");
|
|
5342
|
+
const [msg, setMsg] = (0, import_react4.useState)("");
|
|
5343
|
+
const refresh = (0, import_react4.useCallback)(() => {
|
|
5066
5344
|
void remote.listSkills(workspace).then((r) => {
|
|
5067
5345
|
if (r.ok) setSkills(r.value.skills);
|
|
5068
5346
|
}, () => {
|
|
5069
5347
|
});
|
|
5070
5348
|
}, [remote, workspace]);
|
|
5071
|
-
(0,
|
|
5349
|
+
(0, import_react4.useEffect)(() => {
|
|
5072
5350
|
refresh();
|
|
5073
5351
|
}, [refresh]);
|
|
5074
5352
|
const closeForm = () => {
|
|
@@ -5164,60 +5442,60 @@ function SkillManager({ workspace, remote }) {
|
|
|
5164
5442
|
refresh();
|
|
5165
5443
|
};
|
|
5166
5444
|
const formOpen = editing !== null || creating;
|
|
5167
|
-
const renderRow = (sk) => (0,
|
|
5445
|
+
const renderRow = (sk) => (0, import_react4.createElement)(
|
|
5168
5446
|
"div",
|
|
5169
5447
|
{
|
|
5170
5448
|
key: sk.name,
|
|
5171
5449
|
style: { display: "flex", alignItems: "center", gap: 8, justifyContent: "space-between", padding: "6px 0", borderBottom: "1px solid var(--dsw-alias-border-l2)" }
|
|
5172
5450
|
},
|
|
5173
|
-
(0,
|
|
5451
|
+
(0, import_react4.createElement)(
|
|
5174
5452
|
"div",
|
|
5175
5453
|
{ style: { display: "flex", flexDirection: "column", gap: 2, minWidth: 0 } },
|
|
5176
|
-
(0,
|
|
5454
|
+
(0, import_react4.createElement)(
|
|
5177
5455
|
"span",
|
|
5178
5456
|
{ style: { fontSize: 13, color: "var(--dsw-alias-label-primary)" } },
|
|
5179
5457
|
sk.name,
|
|
5180
|
-
sk.source !== "bundled" ? (0,
|
|
5458
|
+
sk.source !== "bundled" ? (0, import_react4.createElement)("span", { style: styles.sourceBadge }, `\uFF08${sourceLabel(sk.source)}\uFF09`) : null
|
|
5181
5459
|
),
|
|
5182
|
-
(0,
|
|
5460
|
+
(0, import_react4.createElement)("span", { style: styles.sourceBadge }, sk.description)
|
|
5183
5461
|
),
|
|
5184
|
-
sk.source === "bundled" ? (0,
|
|
5462
|
+
sk.source === "bundled" ? (0, import_react4.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "outline", size: "sm", onClick: () => {
|
|
5185
5463
|
startView(sk);
|
|
5186
|
-
} }, "\u67E5\u770B") : (0,
|
|
5464
|
+
} }, "\u67E5\u770B") : (0, import_react4.createElement)(
|
|
5187
5465
|
"div",
|
|
5188
5466
|
{ style: { display: "flex", gap: 6 } },
|
|
5189
|
-
(0,
|
|
5467
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "outline", size: "sm", onClick: () => {
|
|
5190
5468
|
startEdit(sk);
|
|
5191
5469
|
} }, "\u7F16\u8F91"),
|
|
5192
|
-
confirming === sk.name ? (0,
|
|
5470
|
+
confirming === sk.name ? (0, import_react4.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "primary", size: "sm", onClick: () => {
|
|
5193
5471
|
void remove(sk);
|
|
5194
|
-
} }, "\u786E\u8BA4\u5220\u9664") : (0,
|
|
5472
|
+
} }, "\u786E\u8BA4\u5220\u9664") : (0, import_react4.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "ghost", size: "sm", onClick: () => {
|
|
5195
5473
|
setConfirming(sk.name);
|
|
5196
5474
|
} }, "\u5220\u9664")
|
|
5197
5475
|
)
|
|
5198
5476
|
);
|
|
5199
5477
|
const renderForm = () => {
|
|
5200
5478
|
if (viewing) {
|
|
5201
|
-
return (0,
|
|
5479
|
+
return (0, import_react4.createElement)(
|
|
5202
5480
|
ResourceModal,
|
|
5203
5481
|
{
|
|
5204
5482
|
title: `\u67E5\u770B skill\u300C${editing ?? ""}\u300D`,
|
|
5205
5483
|
description: "\u5185\u7F6E \xB7 \u53EA\u8BFB" + (whenToUse !== "" && whenToUse !== void 0 ? ` \xB7 \u4F7F\u7528\u65F6\u673A\uFF1A${whenToUse}` : ""),
|
|
5206
5484
|
onClose: closeForm,
|
|
5207
|
-
footer: (0,
|
|
5485
|
+
footer: (0, import_react4.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "ghost", size: "sm", onClick: closeForm }, "\u5173\u95ED")
|
|
5208
5486
|
},
|
|
5209
|
-
(0,
|
|
5487
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives4.MarkdownText, { text: body2, labels: MD_LABELS2 })
|
|
5210
5488
|
);
|
|
5211
5489
|
}
|
|
5212
|
-
return (0,
|
|
5490
|
+
return (0, import_react4.createElement)(
|
|
5213
5491
|
ResourceModal,
|
|
5214
5492
|
{
|
|
5215
5493
|
title: editing === null ? "\u65B0\u5EFA skill" : `\u7F16\u8F91 skill\u300C${editing ?? ""}\u300D`,
|
|
5216
5494
|
onClose: closeForm,
|
|
5217
|
-
footer: (0,
|
|
5495
|
+
footer: (0, import_react4.createElement)(
|
|
5218
5496
|
"div",
|
|
5219
5497
|
{ style: styles.row },
|
|
5220
|
-
(0,
|
|
5498
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives4.Button, {
|
|
5221
5499
|
variant: "primary",
|
|
5222
5500
|
size: "sm",
|
|
5223
5501
|
disabled: editing === null && name.trim() === "" || description.trim() === "" || body2.trim() === "",
|
|
@@ -5225,60 +5503,60 @@ function SkillManager({ workspace, remote }) {
|
|
|
5225
5503
|
void submit();
|
|
5226
5504
|
}
|
|
5227
5505
|
}, "\u4FDD\u5B58"),
|
|
5228
|
-
(0,
|
|
5506
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "ghost", size: "sm", onClick: closeForm }, "\u53D6\u6D88")
|
|
5229
5507
|
)
|
|
5230
5508
|
},
|
|
5231
|
-
(0,
|
|
5509
|
+
(0, import_react4.createElement)(
|
|
5232
5510
|
"div",
|
|
5233
5511
|
{ style: styles.chips },
|
|
5234
|
-
(0,
|
|
5512
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives4.Pill, { active: level === "project", onClick: () => {
|
|
5235
5513
|
setLevel("project");
|
|
5236
5514
|
}, title: "\u5199\u5230\u5DE5\u4F5C\u533A .dsh/skills\uFF0C\u56E2\u961F\u5171\u4EAB" }, "\u9879\u76EE\u7EA7"),
|
|
5237
|
-
(0,
|
|
5515
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives4.Pill, { active: level === "user", onClick: () => {
|
|
5238
5516
|
setLevel("user");
|
|
5239
5517
|
}, title: "\u5199\u5230 $DSH_HOME/skills\uFF0C\u4E2A\u4EBA\u6240\u6709\u9879\u76EE\u53EF\u7528" }, "\u7528\u6237\u7EA7")
|
|
5240
5518
|
),
|
|
5241
|
-
editing === null ? (0,
|
|
5519
|
+
editing === null ? (0, import_react4.createElement)("input", { style: control, placeholder: "name\uFF08\u5982 my-skill\uFF0C\u53EA\u542B\u5C0F\u5199\u5B57\u6BCD\u6570\u5B57\u548C -\uFF09", value: name, onChange: (ev) => {
|
|
5242
5520
|
setName(ev.target.value);
|
|
5243
|
-
} }) : (0,
|
|
5244
|
-
(0,
|
|
5521
|
+
} }) : (0, import_react4.createElement)("span", { style: styles.sourceBadge }, `name \u56FA\u5B9A\u4E3A ${name}\uFF08\u6539\u540D\u8BF7\u5220\u9664\u540E\u91CD\u5EFA\uFF09`),
|
|
5522
|
+
(0, import_react4.createElement)("input", { style: control, placeholder: "description\uFF08\u4E00\u53E5\u8BDD\u8BF4\u660E\u5B83\u505A\u4EC0\u4E48\uFF09", value: description, onChange: (ev) => {
|
|
5245
5523
|
setDescription(ev.target.value);
|
|
5246
5524
|
} }),
|
|
5247
|
-
(0,
|
|
5525
|
+
(0, import_react4.createElement)("input", { style: control, placeholder: "whenToUse\uFF08\u53EF\u9009\uFF1A\u4EC0\u4E48\u60C5\u51B5\u8BE5\u7528\uFF09", value: whenToUse, onChange: (ev) => {
|
|
5248
5526
|
setWhenToUse(ev.target.value);
|
|
5249
5527
|
} }),
|
|
5250
|
-
(0,
|
|
5528
|
+
(0, import_react4.createElement)("textarea", { style: { ...styles.textarea, minHeight: 300 }, placeholder: "\u6B63\u6587\uFF08\u544A\u8BC9\u5927\u6A21\u578B\u8FD9\u4E2A\u9636\u6BB5\u600E\u4E48\u5E72\uFF09", value: body2, onChange: (ev) => {
|
|
5251
5529
|
setBody(ev.target.value);
|
|
5252
5530
|
} }),
|
|
5253
|
-
msg !== "" ? (0,
|
|
5531
|
+
msg !== "" ? (0, import_react4.createElement)("p", { style: styles.status }, msg) : null
|
|
5254
5532
|
);
|
|
5255
5533
|
};
|
|
5256
|
-
return (0,
|
|
5534
|
+
return (0, import_react4.createElement)(
|
|
5257
5535
|
"div",
|
|
5258
5536
|
{ style: styles.section },
|
|
5259
|
-
(0,
|
|
5537
|
+
(0, import_react4.createElement)(
|
|
5260
5538
|
"div",
|
|
5261
|
-
{ style:
|
|
5262
|
-
(0,
|
|
5539
|
+
{ style: card2 },
|
|
5540
|
+
(0, import_react4.createElement)(
|
|
5263
5541
|
"div",
|
|
5264
5542
|
{ style: styles.bindingStage },
|
|
5265
|
-
(0,
|
|
5266
|
-
skills.length === 0 ? (0,
|
|
5543
|
+
(0, import_react4.createElement)("span", { style: styles.bindingLabel }, "\u5DF2\u5B89\u88C5\u7684 skill"),
|
|
5544
|
+
skills.length === 0 ? (0, import_react4.createElement)("p", { style: styles.muted }, "\u6682\u65E0 skill\uFF0C\u70B9\u4E0B\u65B9\u300C\u65B0\u5EFA skill\u300D\u521B\u5EFA\u4E00\u4E2A\u3002") : (0, import_react4.createElement)(
|
|
5267
5545
|
"div",
|
|
5268
5546
|
{ style: styles.section },
|
|
5269
5547
|
...skills.map(renderRow)
|
|
5270
5548
|
)
|
|
5271
5549
|
),
|
|
5272
|
-
(0,
|
|
5550
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "outline", size: "md", onClick: startCreate }, "\u65B0\u5EFA skill")
|
|
5273
5551
|
),
|
|
5274
5552
|
formOpen ? renderForm() : null
|
|
5275
5553
|
);
|
|
5276
5554
|
}
|
|
5277
5555
|
|
|
5278
5556
|
// src/client/RuleManager.tsx
|
|
5279
|
-
var
|
|
5280
|
-
var
|
|
5281
|
-
var
|
|
5557
|
+
var import_react5 = require("react");
|
|
5558
|
+
var import_dsh_client_ui_primitives5 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5559
|
+
var MD_LABELS3 = { code: { copyLabel: "\u590D\u5236", copiedLabel: "\u5DF2\u590D\u5236" }, footnotes: "\u811A\u6CE8" };
|
|
5282
5560
|
var control2 = {
|
|
5283
5561
|
background: "var(--dsw-alias-bg-layer-1)",
|
|
5284
5562
|
border: "1px solid var(--dsw-alias-border-l2)",
|
|
@@ -5288,7 +5566,7 @@ var control2 = {
|
|
|
5288
5566
|
fontSize: 13,
|
|
5289
5567
|
minWidth: 0
|
|
5290
5568
|
};
|
|
5291
|
-
var
|
|
5569
|
+
var card3 = {
|
|
5292
5570
|
display: "flex",
|
|
5293
5571
|
flexDirection: "column",
|
|
5294
5572
|
gap: 8,
|
|
@@ -5301,22 +5579,22 @@ function levelOf2(source) {
|
|
|
5301
5579
|
return source.startsWith("user") ? "user" : "project";
|
|
5302
5580
|
}
|
|
5303
5581
|
function RuleManager({ workspace, remote }) {
|
|
5304
|
-
const [rules, setRules] = (0,
|
|
5305
|
-
const [level, setLevel] = (0,
|
|
5306
|
-
const [editing, setEditing] = (0,
|
|
5307
|
-
const [creating, setCreating] = (0,
|
|
5308
|
-
const [viewing, setViewing] = (0,
|
|
5309
|
-
const [confirming, setConfirming] = (0,
|
|
5310
|
-
const [name, setName] = (0,
|
|
5311
|
-
const [body2, setBody] = (0,
|
|
5312
|
-
const [msg, setMsg] = (0,
|
|
5313
|
-
const refresh = (0,
|
|
5582
|
+
const [rules, setRules] = (0, import_react5.useState)([]);
|
|
5583
|
+
const [level, setLevel] = (0, import_react5.useState)("project");
|
|
5584
|
+
const [editing, setEditing] = (0, import_react5.useState)(null);
|
|
5585
|
+
const [creating, setCreating] = (0, import_react5.useState)(false);
|
|
5586
|
+
const [viewing, setViewing] = (0, import_react5.useState)(false);
|
|
5587
|
+
const [confirming, setConfirming] = (0, import_react5.useState)(null);
|
|
5588
|
+
const [name, setName] = (0, import_react5.useState)("");
|
|
5589
|
+
const [body2, setBody] = (0, import_react5.useState)("");
|
|
5590
|
+
const [msg, setMsg] = (0, import_react5.useState)("");
|
|
5591
|
+
const refresh = (0, import_react5.useCallback)(() => {
|
|
5314
5592
|
void remote.listRules(workspace).then((r) => {
|
|
5315
5593
|
if (r.ok) setRules(r.value.rules);
|
|
5316
5594
|
}, () => {
|
|
5317
5595
|
});
|
|
5318
5596
|
}, [remote, workspace]);
|
|
5319
|
-
(0,
|
|
5597
|
+
(0, import_react5.useEffect)(() => {
|
|
5320
5598
|
refresh();
|
|
5321
5599
|
}, [refresh]);
|
|
5322
5600
|
const closeForm = () => {
|
|
@@ -5403,55 +5681,55 @@ function RuleManager({ workspace, remote }) {
|
|
|
5403
5681
|
refresh();
|
|
5404
5682
|
};
|
|
5405
5683
|
const formOpen = editing !== null || creating;
|
|
5406
|
-
const renderRow = (rule) => (0,
|
|
5684
|
+
const renderRow = (rule) => (0, import_react5.createElement)(
|
|
5407
5685
|
"div",
|
|
5408
5686
|
{
|
|
5409
5687
|
key: rule.name,
|
|
5410
5688
|
style: { display: "flex", alignItems: "center", gap: 8, justifyContent: "space-between", padding: "6px 0", borderBottom: "1px solid var(--dsw-alias-border-l2)" }
|
|
5411
5689
|
},
|
|
5412
|
-
(0,
|
|
5690
|
+
(0, import_react5.createElement)(
|
|
5413
5691
|
"span",
|
|
5414
5692
|
{ style: { fontSize: 13, color: "var(--dsw-alias-label-primary)" } },
|
|
5415
5693
|
rule.name,
|
|
5416
|
-
rule.source !== "bundled" ? (0,
|
|
5694
|
+
rule.source !== "bundled" ? (0, import_react5.createElement)("span", { style: styles.sourceBadge }, `\uFF08${sourceLabel(rule.source)}\uFF09`) : null
|
|
5417
5695
|
),
|
|
5418
|
-
rule.source === "bundled" ? (0,
|
|
5696
|
+
rule.source === "bundled" ? (0, import_react5.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", size: "sm", onClick: () => {
|
|
5419
5697
|
startView(rule);
|
|
5420
|
-
} }, "\u67E5\u770B") : (0,
|
|
5698
|
+
} }, "\u67E5\u770B") : (0, import_react5.createElement)(
|
|
5421
5699
|
"div",
|
|
5422
5700
|
{ style: { display: "flex", gap: 6 } },
|
|
5423
|
-
(0,
|
|
5701
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", size: "sm", onClick: () => {
|
|
5424
5702
|
startEdit(rule);
|
|
5425
5703
|
} }, "\u7F16\u8F91"),
|
|
5426
|
-
confirming === rule.name ? (0,
|
|
5704
|
+
confirming === rule.name ? (0, import_react5.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "primary", size: "sm", onClick: () => {
|
|
5427
5705
|
void remove(rule);
|
|
5428
|
-
} }, "\u786E\u8BA4\u5220\u9664") : (0,
|
|
5706
|
+
} }, "\u786E\u8BA4\u5220\u9664") : (0, import_react5.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "ghost", size: "sm", onClick: () => {
|
|
5429
5707
|
setConfirming(rule.name);
|
|
5430
5708
|
} }, "\u5220\u9664")
|
|
5431
5709
|
)
|
|
5432
5710
|
);
|
|
5433
5711
|
const renderForm = () => {
|
|
5434
5712
|
if (viewing) {
|
|
5435
|
-
return (0,
|
|
5713
|
+
return (0, import_react5.createElement)(
|
|
5436
5714
|
ResourceModal,
|
|
5437
5715
|
{
|
|
5438
5716
|
title: `\u67E5\u770B rule\u300C${editing ?? ""}\u300D`,
|
|
5439
5717
|
description: "\u5185\u7F6E \xB7 \u53EA\u8BFB",
|
|
5440
5718
|
onClose: closeForm,
|
|
5441
|
-
footer: (0,
|
|
5719
|
+
footer: (0, import_react5.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "ghost", size: "sm", onClick: closeForm }, "\u5173\u95ED")
|
|
5442
5720
|
},
|
|
5443
|
-
(0,
|
|
5721
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives5.MarkdownText, { text: body2, labels: MD_LABELS3 })
|
|
5444
5722
|
);
|
|
5445
5723
|
}
|
|
5446
|
-
return (0,
|
|
5724
|
+
return (0, import_react5.createElement)(
|
|
5447
5725
|
ResourceModal,
|
|
5448
5726
|
{
|
|
5449
5727
|
title: editing === null ? "\u65B0\u5EFA rule" : `\u7F16\u8F91 rule\u300C${editing ?? ""}\u300D`,
|
|
5450
5728
|
onClose: closeForm,
|
|
5451
|
-
footer: (0,
|
|
5729
|
+
footer: (0, import_react5.createElement)(
|
|
5452
5730
|
"div",
|
|
5453
5731
|
{ style: styles.row },
|
|
5454
|
-
(0,
|
|
5732
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives5.Button, {
|
|
5455
5733
|
variant: "primary",
|
|
5456
5734
|
size: "sm",
|
|
5457
5735
|
disabled: editing === null && name.trim() === "" || body2.trim() === "",
|
|
@@ -5459,54 +5737,54 @@ function RuleManager({ workspace, remote }) {
|
|
|
5459
5737
|
void submit();
|
|
5460
5738
|
}
|
|
5461
5739
|
}, "\u4FDD\u5B58"),
|
|
5462
|
-
(0,
|
|
5740
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "ghost", size: "sm", onClick: closeForm }, "\u53D6\u6D88")
|
|
5463
5741
|
)
|
|
5464
5742
|
},
|
|
5465
|
-
(0,
|
|
5743
|
+
(0, import_react5.createElement)(
|
|
5466
5744
|
"div",
|
|
5467
5745
|
{ style: styles.chips },
|
|
5468
|
-
(0,
|
|
5746
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives5.Pill, { active: level === "project", onClick: () => {
|
|
5469
5747
|
setLevel("project");
|
|
5470
5748
|
}, title: "\u5199\u5230\u5DE5\u4F5C\u533A .dsh/rules\uFF0C\u56E2\u961F\u5171\u4EAB" }, "\u9879\u76EE\u7EA7"),
|
|
5471
|
-
(0,
|
|
5749
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives5.Pill, { active: level === "user", onClick: () => {
|
|
5472
5750
|
setLevel("user");
|
|
5473
5751
|
}, title: "\u5199\u5230 $DSH_HOME/rules\uFF0C\u4E2A\u4EBA\u6240\u6709\u9879\u76EE\u53EF\u7528" }, "\u7528\u6237\u7EA7")
|
|
5474
5752
|
),
|
|
5475
|
-
editing === null ? (0,
|
|
5753
|
+
editing === null ? (0, import_react5.createElement)("input", { style: control2, placeholder: "name\uFF08\u5982 my-redlines\uFF0C\u53EA\u542B\u5C0F\u5199\u5B57\u6BCD\u6570\u5B57\u548C -\uFF09", value: name, onChange: (ev) => {
|
|
5476
5754
|
setName(ev.target.value);
|
|
5477
|
-
} }) : (0,
|
|
5478
|
-
(0,
|
|
5755
|
+
} }) : (0, import_react5.createElement)("span", { style: styles.sourceBadge }, `name \u56FA\u5B9A\u4E3A ${name}\uFF08\u6539\u540D\u8BF7\u5220\u9664\u540E\u91CD\u5EFA\uFF09`),
|
|
5756
|
+
(0, import_react5.createElement)("textarea", { style: { ...styles.textarea, minHeight: 260 }, placeholder: "\u6B63\u6587\uFF08\u8FD9\u6761\u89C4\u5219\u7EA6\u675F\u5927\u6A21\u578B\u9075\u5B88\u4EC0\u4E48\uFF09", value: body2, onChange: (ev) => {
|
|
5479
5757
|
setBody(ev.target.value);
|
|
5480
5758
|
} }),
|
|
5481
|
-
msg !== "" ? (0,
|
|
5759
|
+
msg !== "" ? (0, import_react5.createElement)("p", { style: styles.status }, msg) : null
|
|
5482
5760
|
);
|
|
5483
5761
|
};
|
|
5484
|
-
return (0,
|
|
5762
|
+
return (0, import_react5.createElement)(
|
|
5485
5763
|
"div",
|
|
5486
5764
|
{ style: styles.section },
|
|
5487
|
-
(0,
|
|
5765
|
+
(0, import_react5.createElement)(
|
|
5488
5766
|
"div",
|
|
5489
|
-
{ style:
|
|
5490
|
-
(0,
|
|
5767
|
+
{ style: card3 },
|
|
5768
|
+
(0, import_react5.createElement)(
|
|
5491
5769
|
"div",
|
|
5492
5770
|
{ style: styles.bindingStage },
|
|
5493
|
-
(0,
|
|
5494
|
-
rules.length === 0 ? (0,
|
|
5771
|
+
(0, import_react5.createElement)("span", { style: styles.bindingLabel }, "\u5DF2\u5B89\u88C5\u7684 rule"),
|
|
5772
|
+
rules.length === 0 ? (0, import_react5.createElement)("p", { style: styles.muted }, "\u6682\u65E0 rule\uFF0C\u70B9\u4E0B\u65B9\u300C\u65B0\u5EFA rule\u300D\u521B\u5EFA\u4E00\u4E2A\u3002") : (0, import_react5.createElement)(
|
|
5495
5773
|
"div",
|
|
5496
5774
|
{ style: styles.section },
|
|
5497
5775
|
...rules.map(renderRow)
|
|
5498
5776
|
)
|
|
5499
5777
|
),
|
|
5500
|
-
(0,
|
|
5778
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", size: "md", onClick: startCreate }, "\u65B0\u5EFA rule")
|
|
5501
5779
|
),
|
|
5502
5780
|
formOpen ? renderForm() : null
|
|
5503
5781
|
);
|
|
5504
5782
|
}
|
|
5505
5783
|
|
|
5506
5784
|
// src/client/TaskLedger.tsx
|
|
5507
|
-
var
|
|
5508
|
-
var
|
|
5509
|
-
var
|
|
5785
|
+
var import_react6 = require("react");
|
|
5786
|
+
var import_dsh_client_ui_primitives6 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5787
|
+
var card4 = {
|
|
5510
5788
|
display: "flex",
|
|
5511
5789
|
flexDirection: "column",
|
|
5512
5790
|
gap: 10,
|
|
@@ -5543,10 +5821,10 @@ var badge = {
|
|
|
5543
5821
|
color: "var(--dsw-alias-label-secondary)"
|
|
5544
5822
|
};
|
|
5545
5823
|
function verdictDot(outcome) {
|
|
5546
|
-
return (0,
|
|
5824
|
+
return (0, import_react6.createElement)(import_dsh_client_ui_primitives6.StateDot, { state: outcome === "pass" ? "done" : "error" });
|
|
5547
5825
|
}
|
|
5548
5826
|
function itemStatusDot(status) {
|
|
5549
|
-
return (0,
|
|
5827
|
+
return (0, import_react6.createElement)(import_dsh_client_ui_primitives6.StateDot, { state: status === "done" ? "done" : "ongoing" });
|
|
5550
5828
|
}
|
|
5551
5829
|
function timeText(at) {
|
|
5552
5830
|
return at.slice(0, 19).replace("T", " ");
|
|
@@ -5554,44 +5832,44 @@ function timeText(at) {
|
|
|
5554
5832
|
function itemAudit(item) {
|
|
5555
5833
|
const lines = [];
|
|
5556
5834
|
if (item.dispatch !== void 0) {
|
|
5557
|
-
lines.push((0,
|
|
5835
|
+
lines.push((0, import_react6.createElement)(
|
|
5558
5836
|
"div",
|
|
5559
5837
|
{ key: "dispatch", style: metaLine },
|
|
5560
|
-
(0,
|
|
5561
|
-
(0,
|
|
5562
|
-
(0,
|
|
5838
|
+
(0, import_react6.createElement)("span", { style: badge }, "\u5DF2\u6D3E\u53D1"),
|
|
5839
|
+
(0, import_react6.createElement)("span", null, item.dispatch.description === "" ? "\uFF08\u65E0\u63CF\u8FF0\uFF09" : item.dispatch.description),
|
|
5840
|
+
(0, import_react6.createElement)("span", { style: badge }, timeText(item.dispatch.at))
|
|
5563
5841
|
));
|
|
5564
5842
|
}
|
|
5565
5843
|
if (item.review !== void 0) {
|
|
5566
5844
|
const spec = item.review.spec;
|
|
5567
5845
|
const quality = item.review.quality;
|
|
5568
|
-
lines.push((0,
|
|
5846
|
+
lines.push((0, import_react6.createElement)(
|
|
5569
5847
|
"div",
|
|
5570
5848
|
{ key: "review", style: metaLine },
|
|
5571
5849
|
verdictDot(spec.outcome),
|
|
5572
|
-
(0,
|
|
5573
|
-
(0,
|
|
5850
|
+
(0, import_react6.createElement)("span", null, `\u89C4\u683C\u7B26\u5408 ${spec.outcome === "pass" ? "\u901A\u8FC7" : "\u4E0D\u901A\u8FC7"}`),
|
|
5851
|
+
(0, import_react6.createElement)("span", null, "\xB7"),
|
|
5574
5852
|
verdictDot(quality.outcome),
|
|
5575
|
-
(0,
|
|
5853
|
+
(0, import_react6.createElement)("span", null, `\u4EE3\u7801\u8D28\u91CF ${quality.outcome === "pass" ? "\u901A\u8FC7" : "\u4E0D\u901A\u8FC7"}`)
|
|
5576
5854
|
));
|
|
5577
5855
|
const failNotes = [spec, quality].flatMap((stage) => stage.outcome === "fail" ? stage.notes ?? [] : []);
|
|
5578
5856
|
if (failNotes.length > 0) {
|
|
5579
|
-
lines.push((0,
|
|
5857
|
+
lines.push((0, import_react6.createElement)(
|
|
5580
5858
|
"div",
|
|
5581
5859
|
{ key: "notes", style: metaLine },
|
|
5582
|
-
...failNotes.map((note) => (0,
|
|
5860
|
+
...failNotes.map((note) => (0, import_react6.createElement)("span", { key: note, style: badge }, note))
|
|
5583
5861
|
));
|
|
5584
5862
|
}
|
|
5585
5863
|
}
|
|
5586
5864
|
if (lines.length === 0) {
|
|
5587
|
-
lines.push((0,
|
|
5865
|
+
lines.push((0, import_react6.createElement)("div", { key: "none", style: metaLine }, (0, import_react6.createElement)("span", { style: badge }, "\u672A\u6D3E\u53D1 / \u672A\u5BA1\u67E5")));
|
|
5588
5866
|
}
|
|
5589
|
-
return (0,
|
|
5867
|
+
return (0, import_react6.createElement)("div", { style: { display: "flex", flexDirection: "column", gap: 4 } }, ...lines);
|
|
5590
5868
|
}
|
|
5591
5869
|
function TaskLedger({ workspace, remote }) {
|
|
5592
|
-
const [tasks, setTasks] = (0,
|
|
5593
|
-
const [error, setError] = (0,
|
|
5594
|
-
const refresh = (0,
|
|
5870
|
+
const [tasks, setTasks] = (0, import_react6.useState)([]);
|
|
5871
|
+
const [error, setError] = (0, import_react6.useState)("");
|
|
5872
|
+
const refresh = (0, import_react6.useCallback)(() => {
|
|
5595
5873
|
if (workspace === "") return;
|
|
5596
5874
|
setError("");
|
|
5597
5875
|
void remote.readTasks(workspace).then((result) => {
|
|
@@ -5601,45 +5879,45 @@ function TaskLedger({ workspace, remote }) {
|
|
|
5601
5879
|
setError("\u8BFB\u53D6\u53F0\u8D26\u5931\u8D25\uFF1A" + describeError(reason));
|
|
5602
5880
|
});
|
|
5603
5881
|
}, [remote, workspace]);
|
|
5604
|
-
(0,
|
|
5882
|
+
(0, import_react6.useEffect)(() => {
|
|
5605
5883
|
refresh();
|
|
5606
5884
|
}, [refresh]);
|
|
5607
|
-
return (0,
|
|
5885
|
+
return (0, import_react6.createElement)(
|
|
5608
5886
|
"div",
|
|
5609
5887
|
{ style: styles.section },
|
|
5610
|
-
(0,
|
|
5888
|
+
(0, import_react6.createElement)(
|
|
5611
5889
|
"div",
|
|
5612
5890
|
{ style: headerRow },
|
|
5613
|
-
(0,
|
|
5614
|
-
(0,
|
|
5615
|
-
(0,
|
|
5891
|
+
(0, import_react6.createElement)("span", { style: styles.bindingLabel }, "\u4EFB\u52A1\u53F0\u8D26"),
|
|
5892
|
+
(0, import_react6.createElement)("span", { style: styles.sourceBadge }, "\u53EA\u8BFB \xB7 \u6765\u81EA .dsh/task-*.json"),
|
|
5893
|
+
(0, import_react6.createElement)(import_dsh_client_ui_primitives6.Button, { variant: "outline", size: "sm", onClick: refresh }, "\u5237\u65B0")
|
|
5616
5894
|
),
|
|
5617
|
-
error !== "" ? (0,
|
|
5895
|
+
error !== "" ? (0, import_react6.createElement)("p", { style: styles.status }, error) : tasks.length === 0 ? (0, import_react6.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") : (0, import_react6.createElement)(
|
|
5618
5896
|
"div",
|
|
5619
5897
|
{ style: { display: "flex", flexDirection: "column", gap: 12 } },
|
|
5620
|
-
...tasks.map((task) => (0,
|
|
5898
|
+
...tasks.map((task) => (0, import_react6.createElement)(
|
|
5621
5899
|
"div",
|
|
5622
|
-
{ key: task.task_id, style:
|
|
5623
|
-
(0,
|
|
5900
|
+
{ key: task.task_id, style: card4 },
|
|
5901
|
+
(0, import_react6.createElement)(
|
|
5624
5902
|
"div",
|
|
5625
5903
|
{ style: headerRow },
|
|
5626
|
-
(0,
|
|
5627
|
-
(0,
|
|
5628
|
-
(0,
|
|
5629
|
-
(0,
|
|
5904
|
+
(0, import_react6.createElement)("span", { style: { fontSize: 14, fontWeight: 600, color: "var(--dsw-alias-label-primary)" } }, task.task_id),
|
|
5905
|
+
(0, import_react6.createElement)("span", { style: { fontSize: 13, color: "var(--dsw-alias-label-primary)" } }, task.title),
|
|
5906
|
+
(0, import_react6.createElement)("span", { style: badge }, task.stage),
|
|
5907
|
+
(0, import_react6.createElement)("span", { style: badge }, task.branch)
|
|
5630
5908
|
),
|
|
5631
|
-
(0,
|
|
5909
|
+
(0, import_react6.createElement)(
|
|
5632
5910
|
"div",
|
|
5633
5911
|
{ style: { display: "flex", flexDirection: "column" } },
|
|
5634
|
-
...task.items.map((item) => (0,
|
|
5912
|
+
...task.items.map((item) => (0, import_react6.createElement)(
|
|
5635
5913
|
"div",
|
|
5636
5914
|
{ key: item.id, style: itemRow },
|
|
5637
|
-
(0,
|
|
5915
|
+
(0, import_react6.createElement)(
|
|
5638
5916
|
"div",
|
|
5639
5917
|
{ style: headerRow },
|
|
5640
5918
|
itemStatusDot(item.status),
|
|
5641
|
-
(0,
|
|
5642
|
-
(0,
|
|
5919
|
+
(0, import_react6.createElement)("span", { style: { fontSize: 13, color: "var(--dsw-alias-label-primary)" } }, item.id),
|
|
5920
|
+
(0, import_react6.createElement)("span", { style: { fontSize: 12, color: "var(--dsw-alias-label-secondary)" } }, item.title)
|
|
5643
5921
|
),
|
|
5644
5922
|
itemAudit(item)
|
|
5645
5923
|
))
|
|
@@ -5699,6 +5977,7 @@ var closeStyle = {
|
|
|
5699
5977
|
color: "var(--dsw-alias-label-secondary)"
|
|
5700
5978
|
};
|
|
5701
5979
|
var TABS = [
|
|
5980
|
+
{ id: "init", label: "\u9879\u76EE\u521D\u59CB\u5316" },
|
|
5702
5981
|
{ id: "flow", label: "\u6D41\u7A0B\u914D\u7F6E" },
|
|
5703
5982
|
{ id: "tasks", label: "\u4EFB\u52A1\u53F0\u8D26" },
|
|
5704
5983
|
{ id: "skills", label: "\u6280\u80FD skill" },
|
|
@@ -5707,52 +5986,52 @@ var TABS = [
|
|
|
5707
5986
|
function Workbench({ useStore, actions, useWorkspaces, remote }) {
|
|
5708
5987
|
const open = useStore((s) => s.open);
|
|
5709
5988
|
const workspaces = useWorkspaces((s) => s.items);
|
|
5710
|
-
const [tab, setTab] = (0,
|
|
5711
|
-
const [workspace, setWorkspace] = (0,
|
|
5989
|
+
const [tab, setTab] = (0, import_react7.useState)("init");
|
|
5990
|
+
const [workspace, setWorkspace] = (0, import_react7.useState)("");
|
|
5712
5991
|
if (!open) return null;
|
|
5713
5992
|
const current = workspaces.some((w) => w.path === workspace) ? workspace : workspaces[0]?.path ?? "";
|
|
5714
|
-
return (0,
|
|
5993
|
+
return (0, import_react7.createElement)(
|
|
5715
5994
|
"div",
|
|
5716
5995
|
{ style: overlay },
|
|
5717
|
-
(0,
|
|
5996
|
+
(0, import_react7.createElement)(
|
|
5718
5997
|
"div",
|
|
5719
5998
|
{ style: header },
|
|
5720
|
-
(0,
|
|
5721
|
-
(0,
|
|
5999
|
+
(0, import_react7.createElement)("span", { style: { fontSize: 15, fontWeight: 600, color: "var(--dsw-alias-label-primary)" } }, "\u5DE5\u7A0B\u6D41\u7A0B"),
|
|
6000
|
+
(0, import_react7.createElement)(
|
|
5722
6001
|
"button",
|
|
5723
6002
|
{ type: "button", title: "\u5173\u95ED", onClick: () => {
|
|
5724
6003
|
actions.close();
|
|
5725
6004
|
}, style: closeStyle },
|
|
5726
|
-
(0,
|
|
6005
|
+
(0, import_react7.createElement)(import_dsh_client_ui_primitives7.IconCloseOutline16, { size: 16 })
|
|
5727
6006
|
)
|
|
5728
6007
|
),
|
|
5729
|
-
(0,
|
|
6008
|
+
(0, import_react7.createElement)(
|
|
5730
6009
|
"div",
|
|
5731
6010
|
{ style: tabbar },
|
|
5732
|
-
...TABS.map((t) => (0,
|
|
6011
|
+
...TABS.map((t) => (0, import_react7.createElement)(import_dsh_client_ui_primitives7.Pill, { key: t.id, active: tab === t.id, onClick: () => {
|
|
5733
6012
|
setTab(t.id);
|
|
5734
6013
|
} }, t.label)),
|
|
5735
|
-
workspaces.length > 0 ? (0,
|
|
6014
|
+
workspaces.length > 0 ? (0, import_react7.createElement)("select", {
|
|
5736
6015
|
style: selectStyle,
|
|
5737
6016
|
value: current,
|
|
5738
6017
|
onChange: (ev) => {
|
|
5739
6018
|
setWorkspace(ev.target.value);
|
|
5740
6019
|
}
|
|
5741
|
-
}, ...workspaces.map((w) => (0,
|
|
6020
|
+
}, ...workspaces.map((w) => (0, import_react7.createElement)("option", { key: w.path, value: w.path }, w.title || w.path))) : null
|
|
5742
6021
|
),
|
|
5743
|
-
(0,
|
|
6022
|
+
(0, import_react7.createElement)(
|
|
5744
6023
|
"div",
|
|
5745
6024
|
{ style: body },
|
|
5746
|
-
current === "" ? (0,
|
|
6025
|
+
current === "" ? (0, import_react7.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_react7.createElement)(InitPanel, { workspace: current, remote }) : tab === "flow" ? (0, import_react7.createElement)(TaskEngineSection, { workspace: current, remote }) : tab === "tasks" ? (0, import_react7.createElement)(TaskLedger, { workspace: current, remote }) : tab === "skills" ? (0, import_react7.createElement)(SkillManager, { workspace: current, remote }) : (0, import_react7.createElement)(RuleManager, { workspace: current, remote })
|
|
5747
6026
|
)
|
|
5748
6027
|
);
|
|
5749
6028
|
}
|
|
5750
6029
|
|
|
5751
6030
|
// src/client/TriggerButton.tsx
|
|
5752
|
-
var
|
|
5753
|
-
var
|
|
6031
|
+
var import_react8 = require("react");
|
|
6032
|
+
var import_dsh_client_ui_primitives8 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5754
6033
|
function TriggerButton({ wide, actions }) {
|
|
5755
|
-
return (0,
|
|
6034
|
+
return (0, import_react8.createElement)(
|
|
5756
6035
|
"button",
|
|
5757
6036
|
{
|
|
5758
6037
|
type: "button",
|
|
@@ -5777,8 +6056,8 @@ function TriggerButton({ wide, actions }) {
|
|
|
5777
6056
|
boxSizing: "border-box"
|
|
5778
6057
|
}
|
|
5779
6058
|
},
|
|
5780
|
-
(0,
|
|
5781
|
-
wide ? (0,
|
|
6059
|
+
(0, import_react8.createElement)(import_dsh_client_ui_primitives8.IconSettingsOutline16, { size: wide ? 16 : 18 }),
|
|
6060
|
+
wide ? (0, import_react8.createElement)("span", { style: { fontSize: 13 } }, "\u5DE5\u7A0B\u6D41\u7A0B") : null
|
|
5782
6061
|
);
|
|
5783
6062
|
}
|
|
5784
6063
|
|