@godv61/dsh-task-engine 0.18.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 +4 -1
- package/lib/client.js +409 -166
- package/lib/client.js.map +4 -4
- package/lib/controller.d.ts +55 -0
- package/lib/controller.js +226 -0
- package/lib/controller.js.map +1 -1
- package/lib/dev-task.js +39 -31
- package/lib/dev-task.js.map +1 -1
- package/package.json +5 -2
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)";
|
|
@@ -4938,14 +5010,184 @@ async function save(remote, flow, stageBindings, workspace, setSavedAt, setSourc
|
|
|
4938
5010
|
setSavedAt(result.value.ok ? "\u5DF2\u4FDD\u5B58" : "");
|
|
4939
5011
|
}
|
|
4940
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
|
+
|
|
4941
5183
|
// src/client/SkillManager.tsx
|
|
4942
|
-
var
|
|
4943
|
-
var
|
|
5184
|
+
var import_react4 = require("react");
|
|
5185
|
+
var import_dsh_client_ui_primitives4 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
4944
5186
|
|
|
4945
5187
|
// src/client/ResourceModal.tsx
|
|
4946
|
-
var
|
|
5188
|
+
var import_react3 = require("react");
|
|
4947
5189
|
var import_react_dom = require("react-dom");
|
|
4948
|
-
var
|
|
5190
|
+
var import_dsh_client_ui_primitives3 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
4949
5191
|
var rootStyle = {
|
|
4950
5192
|
position: "fixed",
|
|
4951
5193
|
inset: 0,
|
|
@@ -5027,7 +5269,7 @@ var footerStyle = {
|
|
|
5027
5269
|
flex: "none"
|
|
5028
5270
|
};
|
|
5029
5271
|
function ResourceModal({ title, description, onClose, footer, children }) {
|
|
5030
|
-
(0,
|
|
5272
|
+
(0, import_react3.useEffect)(() => {
|
|
5031
5273
|
const onKey = (e) => {
|
|
5032
5274
|
if (e.key === "Escape") onClose();
|
|
5033
5275
|
};
|
|
@@ -5037,26 +5279,26 @@ function ResourceModal({ title, description, onClose, footer, children }) {
|
|
|
5037
5279
|
};
|
|
5038
5280
|
}, [onClose]);
|
|
5039
5281
|
return (0, import_react_dom.createPortal)(
|
|
5040
|
-
(0,
|
|
5282
|
+
(0, import_react3.createElement)(
|
|
5041
5283
|
"div",
|
|
5042
5284
|
{ style: rootStyle, role: "presentation" },
|
|
5043
|
-
(0,
|
|
5044
|
-
(0,
|
|
5285
|
+
(0, import_react3.createElement)("div", { style: maskStyle, "aria-hidden": true, onClick: onClose }),
|
|
5286
|
+
(0, import_react3.createElement)(
|
|
5045
5287
|
"div",
|
|
5046
5288
|
{ style: dialogStyle, role: "dialog", "aria-modal": true, "aria-label": title },
|
|
5047
|
-
(0,
|
|
5289
|
+
(0, import_react3.createElement)(
|
|
5048
5290
|
"div",
|
|
5049
5291
|
{ style: headerStyle },
|
|
5050
|
-
(0,
|
|
5051
|
-
(0,
|
|
5292
|
+
(0, import_react3.createElement)("h2", { style: titleStyle }, title),
|
|
5293
|
+
(0, import_react3.createElement)(
|
|
5052
5294
|
"button",
|
|
5053
5295
|
{ type: "button", style: closeBtnStyle, "aria-label": "\u5173\u95ED", onClick: onClose },
|
|
5054
|
-
(0,
|
|
5296
|
+
(0, import_react3.createElement)(import_dsh_client_ui_primitives3.IconCloseOutline16, { size: 14 })
|
|
5055
5297
|
)
|
|
5056
5298
|
),
|
|
5057
|
-
description !== void 0 && description !== "" ? (0,
|
|
5058
|
-
(0,
|
|
5059
|
-
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
|
|
5060
5302
|
)
|
|
5061
5303
|
),
|
|
5062
5304
|
document.body
|
|
@@ -5064,7 +5306,7 @@ function ResourceModal({ title, description, onClose, footer, children }) {
|
|
|
5064
5306
|
}
|
|
5065
5307
|
|
|
5066
5308
|
// src/client/SkillManager.tsx
|
|
5067
|
-
var
|
|
5309
|
+
var MD_LABELS2 = { code: { copyLabel: "\u590D\u5236", copiedLabel: "\u5DF2\u590D\u5236" }, footnotes: "\u811A\u6CE8" };
|
|
5068
5310
|
var control = {
|
|
5069
5311
|
background: "var(--dsw-alias-bg-layer-1)",
|
|
5070
5312
|
border: "1px solid var(--dsw-alias-border-l2)",
|
|
@@ -5074,7 +5316,7 @@ var control = {
|
|
|
5074
5316
|
fontSize: 13,
|
|
5075
5317
|
minWidth: 0
|
|
5076
5318
|
};
|
|
5077
|
-
var
|
|
5319
|
+
var card2 = {
|
|
5078
5320
|
display: "flex",
|
|
5079
5321
|
flexDirection: "column",
|
|
5080
5322
|
gap: 8,
|
|
@@ -5087,24 +5329,24 @@ function levelOf(source) {
|
|
|
5087
5329
|
return source.startsWith("user") ? "user" : "project";
|
|
5088
5330
|
}
|
|
5089
5331
|
function SkillManager({ workspace, remote }) {
|
|
5090
|
-
const [skills, setSkills] = (0,
|
|
5091
|
-
const [level, setLevel] = (0,
|
|
5092
|
-
const [editing, setEditing] = (0,
|
|
5093
|
-
const [creating, setCreating] = (0,
|
|
5094
|
-
const [viewing, setViewing] = (0,
|
|
5095
|
-
const [confirming, setConfirming] = (0,
|
|
5096
|
-
const [name, setName] = (0,
|
|
5097
|
-
const [description, setDescription] = (0,
|
|
5098
|
-
const [whenToUse, setWhenToUse] = (0,
|
|
5099
|
-
const [body2, setBody] = (0,
|
|
5100
|
-
const [msg, setMsg] = (0,
|
|
5101
|
-
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)(() => {
|
|
5102
5344
|
void remote.listSkills(workspace).then((r) => {
|
|
5103
5345
|
if (r.ok) setSkills(r.value.skills);
|
|
5104
5346
|
}, () => {
|
|
5105
5347
|
});
|
|
5106
5348
|
}, [remote, workspace]);
|
|
5107
|
-
(0,
|
|
5349
|
+
(0, import_react4.useEffect)(() => {
|
|
5108
5350
|
refresh();
|
|
5109
5351
|
}, [refresh]);
|
|
5110
5352
|
const closeForm = () => {
|
|
@@ -5200,60 +5442,60 @@ function SkillManager({ workspace, remote }) {
|
|
|
5200
5442
|
refresh();
|
|
5201
5443
|
};
|
|
5202
5444
|
const formOpen = editing !== null || creating;
|
|
5203
|
-
const renderRow = (sk) => (0,
|
|
5445
|
+
const renderRow = (sk) => (0, import_react4.createElement)(
|
|
5204
5446
|
"div",
|
|
5205
5447
|
{
|
|
5206
5448
|
key: sk.name,
|
|
5207
5449
|
style: { display: "flex", alignItems: "center", gap: 8, justifyContent: "space-between", padding: "6px 0", borderBottom: "1px solid var(--dsw-alias-border-l2)" }
|
|
5208
5450
|
},
|
|
5209
|
-
(0,
|
|
5451
|
+
(0, import_react4.createElement)(
|
|
5210
5452
|
"div",
|
|
5211
5453
|
{ style: { display: "flex", flexDirection: "column", gap: 2, minWidth: 0 } },
|
|
5212
|
-
(0,
|
|
5454
|
+
(0, import_react4.createElement)(
|
|
5213
5455
|
"span",
|
|
5214
5456
|
{ style: { fontSize: 13, color: "var(--dsw-alias-label-primary)" } },
|
|
5215
5457
|
sk.name,
|
|
5216
|
-
sk.source !== "bundled" ? (0,
|
|
5458
|
+
sk.source !== "bundled" ? (0, import_react4.createElement)("span", { style: styles.sourceBadge }, `\uFF08${sourceLabel(sk.source)}\uFF09`) : null
|
|
5217
5459
|
),
|
|
5218
|
-
(0,
|
|
5460
|
+
(0, import_react4.createElement)("span", { style: styles.sourceBadge }, sk.description)
|
|
5219
5461
|
),
|
|
5220
|
-
sk.source === "bundled" ? (0,
|
|
5462
|
+
sk.source === "bundled" ? (0, import_react4.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "outline", size: "sm", onClick: () => {
|
|
5221
5463
|
startView(sk);
|
|
5222
|
-
} }, "\u67E5\u770B") : (0,
|
|
5464
|
+
} }, "\u67E5\u770B") : (0, import_react4.createElement)(
|
|
5223
5465
|
"div",
|
|
5224
5466
|
{ style: { display: "flex", gap: 6 } },
|
|
5225
|
-
(0,
|
|
5467
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "outline", size: "sm", onClick: () => {
|
|
5226
5468
|
startEdit(sk);
|
|
5227
5469
|
} }, "\u7F16\u8F91"),
|
|
5228
|
-
confirming === sk.name ? (0,
|
|
5470
|
+
confirming === sk.name ? (0, import_react4.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "primary", size: "sm", onClick: () => {
|
|
5229
5471
|
void remove(sk);
|
|
5230
|
-
} }, "\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: () => {
|
|
5231
5473
|
setConfirming(sk.name);
|
|
5232
5474
|
} }, "\u5220\u9664")
|
|
5233
5475
|
)
|
|
5234
5476
|
);
|
|
5235
5477
|
const renderForm = () => {
|
|
5236
5478
|
if (viewing) {
|
|
5237
|
-
return (0,
|
|
5479
|
+
return (0, import_react4.createElement)(
|
|
5238
5480
|
ResourceModal,
|
|
5239
5481
|
{
|
|
5240
5482
|
title: `\u67E5\u770B skill\u300C${editing ?? ""}\u300D`,
|
|
5241
5483
|
description: "\u5185\u7F6E \xB7 \u53EA\u8BFB" + (whenToUse !== "" && whenToUse !== void 0 ? ` \xB7 \u4F7F\u7528\u65F6\u673A\uFF1A${whenToUse}` : ""),
|
|
5242
5484
|
onClose: closeForm,
|
|
5243
|
-
footer: (0,
|
|
5485
|
+
footer: (0, import_react4.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "ghost", size: "sm", onClick: closeForm }, "\u5173\u95ED")
|
|
5244
5486
|
},
|
|
5245
|
-
(0,
|
|
5487
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives4.MarkdownText, { text: body2, labels: MD_LABELS2 })
|
|
5246
5488
|
);
|
|
5247
5489
|
}
|
|
5248
|
-
return (0,
|
|
5490
|
+
return (0, import_react4.createElement)(
|
|
5249
5491
|
ResourceModal,
|
|
5250
5492
|
{
|
|
5251
5493
|
title: editing === null ? "\u65B0\u5EFA skill" : `\u7F16\u8F91 skill\u300C${editing ?? ""}\u300D`,
|
|
5252
5494
|
onClose: closeForm,
|
|
5253
|
-
footer: (0,
|
|
5495
|
+
footer: (0, import_react4.createElement)(
|
|
5254
5496
|
"div",
|
|
5255
5497
|
{ style: styles.row },
|
|
5256
|
-
(0,
|
|
5498
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives4.Button, {
|
|
5257
5499
|
variant: "primary",
|
|
5258
5500
|
size: "sm",
|
|
5259
5501
|
disabled: editing === null && name.trim() === "" || description.trim() === "" || body2.trim() === "",
|
|
@@ -5261,60 +5503,60 @@ function SkillManager({ workspace, remote }) {
|
|
|
5261
5503
|
void submit();
|
|
5262
5504
|
}
|
|
5263
5505
|
}, "\u4FDD\u5B58"),
|
|
5264
|
-
(0,
|
|
5506
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "ghost", size: "sm", onClick: closeForm }, "\u53D6\u6D88")
|
|
5265
5507
|
)
|
|
5266
5508
|
},
|
|
5267
|
-
(0,
|
|
5509
|
+
(0, import_react4.createElement)(
|
|
5268
5510
|
"div",
|
|
5269
5511
|
{ style: styles.chips },
|
|
5270
|
-
(0,
|
|
5512
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives4.Pill, { active: level === "project", onClick: () => {
|
|
5271
5513
|
setLevel("project");
|
|
5272
5514
|
}, title: "\u5199\u5230\u5DE5\u4F5C\u533A .dsh/skills\uFF0C\u56E2\u961F\u5171\u4EAB" }, "\u9879\u76EE\u7EA7"),
|
|
5273
|
-
(0,
|
|
5515
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives4.Pill, { active: level === "user", onClick: () => {
|
|
5274
5516
|
setLevel("user");
|
|
5275
5517
|
}, title: "\u5199\u5230 $DSH_HOME/skills\uFF0C\u4E2A\u4EBA\u6240\u6709\u9879\u76EE\u53EF\u7528" }, "\u7528\u6237\u7EA7")
|
|
5276
5518
|
),
|
|
5277
|
-
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) => {
|
|
5278
5520
|
setName(ev.target.value);
|
|
5279
|
-
} }) : (0,
|
|
5280
|
-
(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) => {
|
|
5281
5523
|
setDescription(ev.target.value);
|
|
5282
5524
|
} }),
|
|
5283
|
-
(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) => {
|
|
5284
5526
|
setWhenToUse(ev.target.value);
|
|
5285
5527
|
} }),
|
|
5286
|
-
(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) => {
|
|
5287
5529
|
setBody(ev.target.value);
|
|
5288
5530
|
} }),
|
|
5289
|
-
msg !== "" ? (0,
|
|
5531
|
+
msg !== "" ? (0, import_react4.createElement)("p", { style: styles.status }, msg) : null
|
|
5290
5532
|
);
|
|
5291
5533
|
};
|
|
5292
|
-
return (0,
|
|
5534
|
+
return (0, import_react4.createElement)(
|
|
5293
5535
|
"div",
|
|
5294
5536
|
{ style: styles.section },
|
|
5295
|
-
(0,
|
|
5537
|
+
(0, import_react4.createElement)(
|
|
5296
5538
|
"div",
|
|
5297
|
-
{ style:
|
|
5298
|
-
(0,
|
|
5539
|
+
{ style: card2 },
|
|
5540
|
+
(0, import_react4.createElement)(
|
|
5299
5541
|
"div",
|
|
5300
5542
|
{ style: styles.bindingStage },
|
|
5301
|
-
(0,
|
|
5302
|
-
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)(
|
|
5303
5545
|
"div",
|
|
5304
5546
|
{ style: styles.section },
|
|
5305
5547
|
...skills.map(renderRow)
|
|
5306
5548
|
)
|
|
5307
5549
|
),
|
|
5308
|
-
(0,
|
|
5550
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "outline", size: "md", onClick: startCreate }, "\u65B0\u5EFA skill")
|
|
5309
5551
|
),
|
|
5310
5552
|
formOpen ? renderForm() : null
|
|
5311
5553
|
);
|
|
5312
5554
|
}
|
|
5313
5555
|
|
|
5314
5556
|
// src/client/RuleManager.tsx
|
|
5315
|
-
var
|
|
5316
|
-
var
|
|
5317
|
-
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" };
|
|
5318
5560
|
var control2 = {
|
|
5319
5561
|
background: "var(--dsw-alias-bg-layer-1)",
|
|
5320
5562
|
border: "1px solid var(--dsw-alias-border-l2)",
|
|
@@ -5324,7 +5566,7 @@ var control2 = {
|
|
|
5324
5566
|
fontSize: 13,
|
|
5325
5567
|
minWidth: 0
|
|
5326
5568
|
};
|
|
5327
|
-
var
|
|
5569
|
+
var card3 = {
|
|
5328
5570
|
display: "flex",
|
|
5329
5571
|
flexDirection: "column",
|
|
5330
5572
|
gap: 8,
|
|
@@ -5337,22 +5579,22 @@ function levelOf2(source) {
|
|
|
5337
5579
|
return source.startsWith("user") ? "user" : "project";
|
|
5338
5580
|
}
|
|
5339
5581
|
function RuleManager({ workspace, remote }) {
|
|
5340
|
-
const [rules, setRules] = (0,
|
|
5341
|
-
const [level, setLevel] = (0,
|
|
5342
|
-
const [editing, setEditing] = (0,
|
|
5343
|
-
const [creating, setCreating] = (0,
|
|
5344
|
-
const [viewing, setViewing] = (0,
|
|
5345
|
-
const [confirming, setConfirming] = (0,
|
|
5346
|
-
const [name, setName] = (0,
|
|
5347
|
-
const [body2, setBody] = (0,
|
|
5348
|
-
const [msg, setMsg] = (0,
|
|
5349
|
-
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)(() => {
|
|
5350
5592
|
void remote.listRules(workspace).then((r) => {
|
|
5351
5593
|
if (r.ok) setRules(r.value.rules);
|
|
5352
5594
|
}, () => {
|
|
5353
5595
|
});
|
|
5354
5596
|
}, [remote, workspace]);
|
|
5355
|
-
(0,
|
|
5597
|
+
(0, import_react5.useEffect)(() => {
|
|
5356
5598
|
refresh();
|
|
5357
5599
|
}, [refresh]);
|
|
5358
5600
|
const closeForm = () => {
|
|
@@ -5439,55 +5681,55 @@ function RuleManager({ workspace, remote }) {
|
|
|
5439
5681
|
refresh();
|
|
5440
5682
|
};
|
|
5441
5683
|
const formOpen = editing !== null || creating;
|
|
5442
|
-
const renderRow = (rule) => (0,
|
|
5684
|
+
const renderRow = (rule) => (0, import_react5.createElement)(
|
|
5443
5685
|
"div",
|
|
5444
5686
|
{
|
|
5445
5687
|
key: rule.name,
|
|
5446
5688
|
style: { display: "flex", alignItems: "center", gap: 8, justifyContent: "space-between", padding: "6px 0", borderBottom: "1px solid var(--dsw-alias-border-l2)" }
|
|
5447
5689
|
},
|
|
5448
|
-
(0,
|
|
5690
|
+
(0, import_react5.createElement)(
|
|
5449
5691
|
"span",
|
|
5450
5692
|
{ style: { fontSize: 13, color: "var(--dsw-alias-label-primary)" } },
|
|
5451
5693
|
rule.name,
|
|
5452
|
-
rule.source !== "bundled" ? (0,
|
|
5694
|
+
rule.source !== "bundled" ? (0, import_react5.createElement)("span", { style: styles.sourceBadge }, `\uFF08${sourceLabel(rule.source)}\uFF09`) : null
|
|
5453
5695
|
),
|
|
5454
|
-
rule.source === "bundled" ? (0,
|
|
5696
|
+
rule.source === "bundled" ? (0, import_react5.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", size: "sm", onClick: () => {
|
|
5455
5697
|
startView(rule);
|
|
5456
|
-
} }, "\u67E5\u770B") : (0,
|
|
5698
|
+
} }, "\u67E5\u770B") : (0, import_react5.createElement)(
|
|
5457
5699
|
"div",
|
|
5458
5700
|
{ style: { display: "flex", gap: 6 } },
|
|
5459
|
-
(0,
|
|
5701
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", size: "sm", onClick: () => {
|
|
5460
5702
|
startEdit(rule);
|
|
5461
5703
|
} }, "\u7F16\u8F91"),
|
|
5462
|
-
confirming === rule.name ? (0,
|
|
5704
|
+
confirming === rule.name ? (0, import_react5.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "primary", size: "sm", onClick: () => {
|
|
5463
5705
|
void remove(rule);
|
|
5464
|
-
} }, "\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: () => {
|
|
5465
5707
|
setConfirming(rule.name);
|
|
5466
5708
|
} }, "\u5220\u9664")
|
|
5467
5709
|
)
|
|
5468
5710
|
);
|
|
5469
5711
|
const renderForm = () => {
|
|
5470
5712
|
if (viewing) {
|
|
5471
|
-
return (0,
|
|
5713
|
+
return (0, import_react5.createElement)(
|
|
5472
5714
|
ResourceModal,
|
|
5473
5715
|
{
|
|
5474
5716
|
title: `\u67E5\u770B rule\u300C${editing ?? ""}\u300D`,
|
|
5475
5717
|
description: "\u5185\u7F6E \xB7 \u53EA\u8BFB",
|
|
5476
5718
|
onClose: closeForm,
|
|
5477
|
-
footer: (0,
|
|
5719
|
+
footer: (0, import_react5.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "ghost", size: "sm", onClick: closeForm }, "\u5173\u95ED")
|
|
5478
5720
|
},
|
|
5479
|
-
(0,
|
|
5721
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives5.MarkdownText, { text: body2, labels: MD_LABELS3 })
|
|
5480
5722
|
);
|
|
5481
5723
|
}
|
|
5482
|
-
return (0,
|
|
5724
|
+
return (0, import_react5.createElement)(
|
|
5483
5725
|
ResourceModal,
|
|
5484
5726
|
{
|
|
5485
5727
|
title: editing === null ? "\u65B0\u5EFA rule" : `\u7F16\u8F91 rule\u300C${editing ?? ""}\u300D`,
|
|
5486
5728
|
onClose: closeForm,
|
|
5487
|
-
footer: (0,
|
|
5729
|
+
footer: (0, import_react5.createElement)(
|
|
5488
5730
|
"div",
|
|
5489
5731
|
{ style: styles.row },
|
|
5490
|
-
(0,
|
|
5732
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives5.Button, {
|
|
5491
5733
|
variant: "primary",
|
|
5492
5734
|
size: "sm",
|
|
5493
5735
|
disabled: editing === null && name.trim() === "" || body2.trim() === "",
|
|
@@ -5495,54 +5737,54 @@ function RuleManager({ workspace, remote }) {
|
|
|
5495
5737
|
void submit();
|
|
5496
5738
|
}
|
|
5497
5739
|
}, "\u4FDD\u5B58"),
|
|
5498
|
-
(0,
|
|
5740
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "ghost", size: "sm", onClick: closeForm }, "\u53D6\u6D88")
|
|
5499
5741
|
)
|
|
5500
5742
|
},
|
|
5501
|
-
(0,
|
|
5743
|
+
(0, import_react5.createElement)(
|
|
5502
5744
|
"div",
|
|
5503
5745
|
{ style: styles.chips },
|
|
5504
|
-
(0,
|
|
5746
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives5.Pill, { active: level === "project", onClick: () => {
|
|
5505
5747
|
setLevel("project");
|
|
5506
5748
|
}, title: "\u5199\u5230\u5DE5\u4F5C\u533A .dsh/rules\uFF0C\u56E2\u961F\u5171\u4EAB" }, "\u9879\u76EE\u7EA7"),
|
|
5507
|
-
(0,
|
|
5749
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives5.Pill, { active: level === "user", onClick: () => {
|
|
5508
5750
|
setLevel("user");
|
|
5509
5751
|
}, title: "\u5199\u5230 $DSH_HOME/rules\uFF0C\u4E2A\u4EBA\u6240\u6709\u9879\u76EE\u53EF\u7528" }, "\u7528\u6237\u7EA7")
|
|
5510
5752
|
),
|
|
5511
|
-
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) => {
|
|
5512
5754
|
setName(ev.target.value);
|
|
5513
|
-
} }) : (0,
|
|
5514
|
-
(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) => {
|
|
5515
5757
|
setBody(ev.target.value);
|
|
5516
5758
|
} }),
|
|
5517
|
-
msg !== "" ? (0,
|
|
5759
|
+
msg !== "" ? (0, import_react5.createElement)("p", { style: styles.status }, msg) : null
|
|
5518
5760
|
);
|
|
5519
5761
|
};
|
|
5520
|
-
return (0,
|
|
5762
|
+
return (0, import_react5.createElement)(
|
|
5521
5763
|
"div",
|
|
5522
5764
|
{ style: styles.section },
|
|
5523
|
-
(0,
|
|
5765
|
+
(0, import_react5.createElement)(
|
|
5524
5766
|
"div",
|
|
5525
|
-
{ style:
|
|
5526
|
-
(0,
|
|
5767
|
+
{ style: card3 },
|
|
5768
|
+
(0, import_react5.createElement)(
|
|
5527
5769
|
"div",
|
|
5528
5770
|
{ style: styles.bindingStage },
|
|
5529
|
-
(0,
|
|
5530
|
-
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)(
|
|
5531
5773
|
"div",
|
|
5532
5774
|
{ style: styles.section },
|
|
5533
5775
|
...rules.map(renderRow)
|
|
5534
5776
|
)
|
|
5535
5777
|
),
|
|
5536
|
-
(0,
|
|
5778
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", size: "md", onClick: startCreate }, "\u65B0\u5EFA rule")
|
|
5537
5779
|
),
|
|
5538
5780
|
formOpen ? renderForm() : null
|
|
5539
5781
|
);
|
|
5540
5782
|
}
|
|
5541
5783
|
|
|
5542
5784
|
// src/client/TaskLedger.tsx
|
|
5543
|
-
var
|
|
5544
|
-
var
|
|
5545
|
-
var
|
|
5785
|
+
var import_react6 = require("react");
|
|
5786
|
+
var import_dsh_client_ui_primitives6 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5787
|
+
var card4 = {
|
|
5546
5788
|
display: "flex",
|
|
5547
5789
|
flexDirection: "column",
|
|
5548
5790
|
gap: 10,
|
|
@@ -5579,10 +5821,10 @@ var badge = {
|
|
|
5579
5821
|
color: "var(--dsw-alias-label-secondary)"
|
|
5580
5822
|
};
|
|
5581
5823
|
function verdictDot(outcome) {
|
|
5582
|
-
return (0,
|
|
5824
|
+
return (0, import_react6.createElement)(import_dsh_client_ui_primitives6.StateDot, { state: outcome === "pass" ? "done" : "error" });
|
|
5583
5825
|
}
|
|
5584
5826
|
function itemStatusDot(status) {
|
|
5585
|
-
return (0,
|
|
5827
|
+
return (0, import_react6.createElement)(import_dsh_client_ui_primitives6.StateDot, { state: status === "done" ? "done" : "ongoing" });
|
|
5586
5828
|
}
|
|
5587
5829
|
function timeText(at) {
|
|
5588
5830
|
return at.slice(0, 19).replace("T", " ");
|
|
@@ -5590,44 +5832,44 @@ function timeText(at) {
|
|
|
5590
5832
|
function itemAudit(item) {
|
|
5591
5833
|
const lines = [];
|
|
5592
5834
|
if (item.dispatch !== void 0) {
|
|
5593
|
-
lines.push((0,
|
|
5835
|
+
lines.push((0, import_react6.createElement)(
|
|
5594
5836
|
"div",
|
|
5595
5837
|
{ key: "dispatch", style: metaLine },
|
|
5596
|
-
(0,
|
|
5597
|
-
(0,
|
|
5598
|
-
(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))
|
|
5599
5841
|
));
|
|
5600
5842
|
}
|
|
5601
5843
|
if (item.review !== void 0) {
|
|
5602
5844
|
const spec = item.review.spec;
|
|
5603
5845
|
const quality = item.review.quality;
|
|
5604
|
-
lines.push((0,
|
|
5846
|
+
lines.push((0, import_react6.createElement)(
|
|
5605
5847
|
"div",
|
|
5606
5848
|
{ key: "review", style: metaLine },
|
|
5607
5849
|
verdictDot(spec.outcome),
|
|
5608
|
-
(0,
|
|
5609
|
-
(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"),
|
|
5610
5852
|
verdictDot(quality.outcome),
|
|
5611
|
-
(0,
|
|
5853
|
+
(0, import_react6.createElement)("span", null, `\u4EE3\u7801\u8D28\u91CF ${quality.outcome === "pass" ? "\u901A\u8FC7" : "\u4E0D\u901A\u8FC7"}`)
|
|
5612
5854
|
));
|
|
5613
5855
|
const failNotes = [spec, quality].flatMap((stage) => stage.outcome === "fail" ? stage.notes ?? [] : []);
|
|
5614
5856
|
if (failNotes.length > 0) {
|
|
5615
|
-
lines.push((0,
|
|
5857
|
+
lines.push((0, import_react6.createElement)(
|
|
5616
5858
|
"div",
|
|
5617
5859
|
{ key: "notes", style: metaLine },
|
|
5618
|
-
...failNotes.map((note) => (0,
|
|
5860
|
+
...failNotes.map((note) => (0, import_react6.createElement)("span", { key: note, style: badge }, note))
|
|
5619
5861
|
));
|
|
5620
5862
|
}
|
|
5621
5863
|
}
|
|
5622
5864
|
if (lines.length === 0) {
|
|
5623
|
-
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")));
|
|
5624
5866
|
}
|
|
5625
|
-
return (0,
|
|
5867
|
+
return (0, import_react6.createElement)("div", { style: { display: "flex", flexDirection: "column", gap: 4 } }, ...lines);
|
|
5626
5868
|
}
|
|
5627
5869
|
function TaskLedger({ workspace, remote }) {
|
|
5628
|
-
const [tasks, setTasks] = (0,
|
|
5629
|
-
const [error, setError] = (0,
|
|
5630
|
-
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)(() => {
|
|
5631
5873
|
if (workspace === "") return;
|
|
5632
5874
|
setError("");
|
|
5633
5875
|
void remote.readTasks(workspace).then((result) => {
|
|
@@ -5637,45 +5879,45 @@ function TaskLedger({ workspace, remote }) {
|
|
|
5637
5879
|
setError("\u8BFB\u53D6\u53F0\u8D26\u5931\u8D25\uFF1A" + describeError(reason));
|
|
5638
5880
|
});
|
|
5639
5881
|
}, [remote, workspace]);
|
|
5640
|
-
(0,
|
|
5882
|
+
(0, import_react6.useEffect)(() => {
|
|
5641
5883
|
refresh();
|
|
5642
5884
|
}, [refresh]);
|
|
5643
|
-
return (0,
|
|
5885
|
+
return (0, import_react6.createElement)(
|
|
5644
5886
|
"div",
|
|
5645
5887
|
{ style: styles.section },
|
|
5646
|
-
(0,
|
|
5888
|
+
(0, import_react6.createElement)(
|
|
5647
5889
|
"div",
|
|
5648
5890
|
{ style: headerRow },
|
|
5649
|
-
(0,
|
|
5650
|
-
(0,
|
|
5651
|
-
(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")
|
|
5652
5894
|
),
|
|
5653
|
-
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)(
|
|
5654
5896
|
"div",
|
|
5655
5897
|
{ style: { display: "flex", flexDirection: "column", gap: 12 } },
|
|
5656
|
-
...tasks.map((task) => (0,
|
|
5898
|
+
...tasks.map((task) => (0, import_react6.createElement)(
|
|
5657
5899
|
"div",
|
|
5658
|
-
{ key: task.task_id, style:
|
|
5659
|
-
(0,
|
|
5900
|
+
{ key: task.task_id, style: card4 },
|
|
5901
|
+
(0, import_react6.createElement)(
|
|
5660
5902
|
"div",
|
|
5661
5903
|
{ style: headerRow },
|
|
5662
|
-
(0,
|
|
5663
|
-
(0,
|
|
5664
|
-
(0,
|
|
5665
|
-
(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)
|
|
5666
5908
|
),
|
|
5667
|
-
(0,
|
|
5909
|
+
(0, import_react6.createElement)(
|
|
5668
5910
|
"div",
|
|
5669
5911
|
{ style: { display: "flex", flexDirection: "column" } },
|
|
5670
|
-
...task.items.map((item) => (0,
|
|
5912
|
+
...task.items.map((item) => (0, import_react6.createElement)(
|
|
5671
5913
|
"div",
|
|
5672
5914
|
{ key: item.id, style: itemRow },
|
|
5673
|
-
(0,
|
|
5915
|
+
(0, import_react6.createElement)(
|
|
5674
5916
|
"div",
|
|
5675
5917
|
{ style: headerRow },
|
|
5676
5918
|
itemStatusDot(item.status),
|
|
5677
|
-
(0,
|
|
5678
|
-
(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)
|
|
5679
5921
|
),
|
|
5680
5922
|
itemAudit(item)
|
|
5681
5923
|
))
|
|
@@ -5735,6 +5977,7 @@ var closeStyle = {
|
|
|
5735
5977
|
color: "var(--dsw-alias-label-secondary)"
|
|
5736
5978
|
};
|
|
5737
5979
|
var TABS = [
|
|
5980
|
+
{ id: "init", label: "\u9879\u76EE\u521D\u59CB\u5316" },
|
|
5738
5981
|
{ id: "flow", label: "\u6D41\u7A0B\u914D\u7F6E" },
|
|
5739
5982
|
{ id: "tasks", label: "\u4EFB\u52A1\u53F0\u8D26" },
|
|
5740
5983
|
{ id: "skills", label: "\u6280\u80FD skill" },
|
|
@@ -5743,52 +5986,52 @@ var TABS = [
|
|
|
5743
5986
|
function Workbench({ useStore, actions, useWorkspaces, remote }) {
|
|
5744
5987
|
const open = useStore((s) => s.open);
|
|
5745
5988
|
const workspaces = useWorkspaces((s) => s.items);
|
|
5746
|
-
const [tab, setTab] = (0,
|
|
5747
|
-
const [workspace, setWorkspace] = (0,
|
|
5989
|
+
const [tab, setTab] = (0, import_react7.useState)("init");
|
|
5990
|
+
const [workspace, setWorkspace] = (0, import_react7.useState)("");
|
|
5748
5991
|
if (!open) return null;
|
|
5749
5992
|
const current = workspaces.some((w) => w.path === workspace) ? workspace : workspaces[0]?.path ?? "";
|
|
5750
|
-
return (0,
|
|
5993
|
+
return (0, import_react7.createElement)(
|
|
5751
5994
|
"div",
|
|
5752
5995
|
{ style: overlay },
|
|
5753
|
-
(0,
|
|
5996
|
+
(0, import_react7.createElement)(
|
|
5754
5997
|
"div",
|
|
5755
5998
|
{ style: header },
|
|
5756
|
-
(0,
|
|
5757
|
-
(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)(
|
|
5758
6001
|
"button",
|
|
5759
6002
|
{ type: "button", title: "\u5173\u95ED", onClick: () => {
|
|
5760
6003
|
actions.close();
|
|
5761
6004
|
}, style: closeStyle },
|
|
5762
|
-
(0,
|
|
6005
|
+
(0, import_react7.createElement)(import_dsh_client_ui_primitives7.IconCloseOutline16, { size: 16 })
|
|
5763
6006
|
)
|
|
5764
6007
|
),
|
|
5765
|
-
(0,
|
|
6008
|
+
(0, import_react7.createElement)(
|
|
5766
6009
|
"div",
|
|
5767
6010
|
{ style: tabbar },
|
|
5768
|
-
...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: () => {
|
|
5769
6012
|
setTab(t.id);
|
|
5770
6013
|
} }, t.label)),
|
|
5771
|
-
workspaces.length > 0 ? (0,
|
|
6014
|
+
workspaces.length > 0 ? (0, import_react7.createElement)("select", {
|
|
5772
6015
|
style: selectStyle,
|
|
5773
6016
|
value: current,
|
|
5774
6017
|
onChange: (ev) => {
|
|
5775
6018
|
setWorkspace(ev.target.value);
|
|
5776
6019
|
}
|
|
5777
|
-
}, ...workspaces.map((w) => (0,
|
|
6020
|
+
}, ...workspaces.map((w) => (0, import_react7.createElement)("option", { key: w.path, value: w.path }, w.title || w.path))) : null
|
|
5778
6021
|
),
|
|
5779
|
-
(0,
|
|
6022
|
+
(0, import_react7.createElement)(
|
|
5780
6023
|
"div",
|
|
5781
6024
|
{ style: body },
|
|
5782
|
-
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 })
|
|
5783
6026
|
)
|
|
5784
6027
|
);
|
|
5785
6028
|
}
|
|
5786
6029
|
|
|
5787
6030
|
// src/client/TriggerButton.tsx
|
|
5788
|
-
var
|
|
5789
|
-
var
|
|
6031
|
+
var import_react8 = require("react");
|
|
6032
|
+
var import_dsh_client_ui_primitives8 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5790
6033
|
function TriggerButton({ wide, actions }) {
|
|
5791
|
-
return (0,
|
|
6034
|
+
return (0, import_react8.createElement)(
|
|
5792
6035
|
"button",
|
|
5793
6036
|
{
|
|
5794
6037
|
type: "button",
|
|
@@ -5813,8 +6056,8 @@ function TriggerButton({ wide, actions }) {
|
|
|
5813
6056
|
boxSizing: "border-box"
|
|
5814
6057
|
}
|
|
5815
6058
|
},
|
|
5816
|
-
(0,
|
|
5817
|
-
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
|
|
5818
6061
|
);
|
|
5819
6062
|
}
|
|
5820
6063
|
|