@godv61/dsh-task-engine 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/lib/client.js +59 -49
- package/lib/client.js.map +2 -2
- package/lib/controller.d.ts +6 -3
- package/lib/controller.js +15 -18
- package/lib/controller.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -120,4 +120,5 @@ dsh plugin --profile <name> add .
|
|
|
120
120
|
- **脚本级已验证**:strict `tsc` typecheck/build 零错误;`dsh plugin add` 装进独立实例、`--dump-config` 确认 `task-engine` 进组合树;`validateWorkflow`(配置校验)、`artifacts_present`(产物门)、`file_scope`(文件范围门)、`hooks/commit-msg`(机械门禁)单测/冒烟全过——非法配置逐条报错、产物没填全挡流转、范围外文件挡提交、钩子该放放该拦拦。
|
|
121
121
|
- **真实模型端到端(0.4.1)**:headless + NewAPI DeepSeek 下让真模型走 `dev_task` 全流程,抓到并修掉一个真实 bug——`readText`/`writeText` 调 `fs.resolve()` 漏了 `await`,把 `Promise<FsTarget>` 当 `target` 传给了读写方法,导致 create/record/advance/commit 全部写不了任务文件、读永远返回 undefined。0.4.1 修复(`await fs.resolve(relPath)`),并把 `task_id` 在 create 也必填的说明补进工具 schema 与技能。修复后走真实 `ctx.fs` 路径冒烟全绿。
|
|
122
122
|
- **网页图形化配置界面(0.5.0)**:新增 `src/client/` 设置页「工程流程配置」+ Host 端 `task-engine` Remote 控制器;`@godv61/dsh-task-engine` 升级为双端包(`dsh.client` manifest + `./client` 出品,`exports` 暴露)。已实机验证:`dsh web` 起服务后 boot 数据里 `@godv61/dsh-task-engine` 以 `inject:["@deepseek-ai/dsh-api-gateway"]` 进入 application batch、`/plugins/…/client.js` 正常服务;headless 冒烟确认 boot + `dev_task` 未被新控制器破坏。浏览器点击级 e2e 留到发布后用真浏览器收尾。
|
|
123
|
-
- **skill/rule 挂载与渐进披露(0.6.0)**:`WorkflowConfig` 新增 `stage_bindings`(每阶段挂 skills/rules,可选字段),`dev_task` 的 `status`/`advance` 按当前阶段披露挂载的 skill 名 + rule 正文;内置 6 技能 + 3 规则库;Host 控制器新增 `listSkills`/`listRules`/`writeSkill`/`writeRule`;设置页新增「节点挂载」和「新建 skill / rule」两块,同时补上 `dev_task` 缺失的 `items` 操作(更新实施项状态)。引擎层 `stage_bindings` 校验(未知阶段/空名)与合并已单测通过。
|
|
123
|
+
- **skill/rule 挂载与渐进披露(0.6.0)**:`WorkflowConfig` 新增 `stage_bindings`(每阶段挂 skills/rules,可选字段),`dev_task` 的 `status`/`advance` 按当前阶段披露挂载的 skill 名 + rule 正文;内置 6 技能 + 3 规则库;Host 控制器新增 `listSkills`/`listRules`/`writeSkill`/`writeRule`;设置页新增「节点挂载」和「新建 skill / rule」两块,同时补上 `dev_task` 缺失的 `items` 操作(更新实施项状态)。引擎层 `stage_bindings` 校验(未知阶段/空名)与合并已单测通过。
|
|
124
|
+
- **配置页精简 + 自建 skill 可观测(0.6.1)**:设置页的流转/产物/提交规则/新建默认折叠,「节点挂载」从六阶段全平铺改成「选一个阶段再看它挂了什么」;新建成功提示带回显路径(`.dsh/skills/<name>/SKILL.md` 或 `$DSH_HOME/…`),挂载清单给非内置的 skill/rule 标「(项目)/(用户)」来源。修复 `listSkills` 依赖 host skill registry 导致项目 `.dsh/skills` 自建技能不显示的问题——改为与 `listRules` 一致,直接扫「内置 + 项目 + 用户」三层目录。浏览器 e2e 全绿。
|
package/lib/client.js
CHANGED
|
@@ -4857,11 +4857,11 @@ function TaskEngineSection(props) {
|
|
|
4857
4857
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TemplatePicker, { config, setConfig }),
|
|
4858
4858
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: styles.flowCard, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FlowDiagram, { config, onAddTransition: addTransition, onRemoveTransition: removeTransition }) }),
|
|
4859
4859
|
/* @__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", hint: "\u6D41\u7A0B\u7531\u8FD9\u4E9B\u9636\u6BB5\u6309\u987A\u5E8F\u7EC4\u6210\u3002\u70B9\u4E00\u4E2A\u6807\u7B7E\u53EF\u5220\u9664\u5B83\uFF08\u8D77\u59CB\u9636\u6BB5\u9664\u5916\uFF09\uFF1B\u7528\u4E2D\u6587\u540D\u66F4\u6613\u61C2\uFF0C\u4F8B\u5982\u300C\u9700\u6C42\u8BC4\u5BA1\u300D\u300C\u5F00\u53D1\u300D\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StageEditor, { config, setConfig }) }),
|
|
4860
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionCard, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconBranchOutline16, { size: 16 }), title: "\u6D41\u8F6C\uFF08\u9636\u6BB5 \u2192 \u9636\u6BB5\uFF0C\u53EF\u5E26\u5B88\u536B\uFF09", hint: "\u6BCF\u6761\u6D41\u8F6C = \u4ECE\u300C\u4E0A\u4E00\u6B65\u300D\u5230\u300C\u4E0B\u4E00\u6B65\u300D\u5141\u8BB8\u8D70\u7684\u8DEF\uFF1B\u53EF\u9644\u52A0\u5B88\u536B\uFF0C\u6EE1\u8DB3\u5B88\u536B\u624D\u653E\u884C\u3002\u4E5F\u53EF\u5728\u6D41\u7A0B\u56FE\u91CC\u76F4\u63A5\u8FDE\u7EBF/\u70B9\u7BAD\u5934\u5220\u9664\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TransitionEditor, { config, setConfig }) }),
|
|
4861
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionCard, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconCheckOutline16, { size: 16 }), title: "\u4EA7\u7269\uFF08\u6BCF\u4E2A\u9636\u6BB5\u8981\u586B\u7684\u5B57\u6BB5\uFF09", hint: "\u7ED9\u67D0\u9636\u6BB5\u58F0\u660E\u8981\u4EA4\u7684\u4EA7\u7269\u548C\u5FC5\u586B\u5B57\u6BB5\uFF1B\u914D\u5408\u6D41\u8F6C\u91CC\u7684\u300C\u4EA7\u7269\u9F50\u5168\u300D\u5B88\u536B\uFF0C\u5B57\u6BB5\u6CA1\u586B\u5168\u5C31\u8FC7\u4E0D\u53BB\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArtifactEditor, { config, setConfig }) }),
|
|
4862
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionCard, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconEditOutline16, { size: 16 }), title: "\u63D0\u4EA4\u89C4\u5219", hint: "\u63D0\u4EA4\u7B56\u7565\u3001\u6D88\u606F\u683C\u5F0F\u3001\u63D0\u4EA4\u68C0\u67E5\u70B9\u3001\u6587\u4EF6\u8303\u56F4\uFF0C\u4EE5\u53CA\u9AD8\u98CE\u9669\u662F\u5426\u5FC5\u987B\u9644\u9A8C\u8BC1\u8BC1\u636E\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommitEditor, { config, setConfig }) }),
|
|
4860
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionCard, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconBranchOutline16, { size: 16 }), title: "\u6D41\u8F6C\uFF08\u9636\u6BB5 \u2192 \u9636\u6BB5\uFF0C\u53EF\u5E26\u5B88\u536B\uFF09", defaultOpen: false, hint: "\u6BCF\u6761\u6D41\u8F6C = \u4ECE\u300C\u4E0A\u4E00\u6B65\u300D\u5230\u300C\u4E0B\u4E00\u6B65\u300D\u5141\u8BB8\u8D70\u7684\u8DEF\uFF1B\u53EF\u9644\u52A0\u5B88\u536B\uFF0C\u6EE1\u8DB3\u5B88\u536B\u624D\u653E\u884C\u3002\u4E5F\u53EF\u5728\u6D41\u7A0B\u56FE\u91CC\u76F4\u63A5\u8FDE\u7EBF/\u70B9\u7BAD\u5934\u5220\u9664\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TransitionEditor, { config, setConfig }) }),
|
|
4861
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionCard, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconCheckOutline16, { size: 16 }), title: "\u4EA7\u7269\uFF08\u6BCF\u4E2A\u9636\u6BB5\u8981\u586B\u7684\u5B57\u6BB5\uFF09", defaultOpen: false, hint: "\u7ED9\u67D0\u9636\u6BB5\u58F0\u660E\u8981\u4EA4\u7684\u4EA7\u7269\u548C\u5FC5\u586B\u5B57\u6BB5\uFF1B\u914D\u5408\u6D41\u8F6C\u91CC\u7684\u300C\u4EA7\u7269\u9F50\u5168\u300D\u5B88\u536B\uFF0C\u5B57\u6BB5\u6CA1\u586B\u5168\u5C31\u8FC7\u4E0D\u53BB\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArtifactEditor, { config, setConfig }) }),
|
|
4862
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionCard, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconEditOutline16, { size: 16 }), title: "\u63D0\u4EA4\u89C4\u5219", defaultOpen: false, hint: "\u63D0\u4EA4\u7B56\u7565\u3001\u6D88\u606F\u683C\u5F0F\u3001\u63D0\u4EA4\u68C0\u67E5\u70B9\u3001\u6587\u4EF6\u8303\u56F4\uFF0C\u4EE5\u53CA\u9AD8\u98CE\u9669\u662F\u5426\u5FC5\u987B\u9644\u9A8C\u8BC1\u8BC1\u636E\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommitEditor, { config, setConfig }) }),
|
|
4863
4863
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionCard, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconBranchOutline16, { size: 16 }), title: "\u8282\u70B9\u6302\u8F7D\uFF08skill / rule\uFF09", hint: "\u7ED9\u6BCF\u4E2A\u9636\u6BB5\u6302\u300C\u8FD9\u4E2A\u9636\u6BB5\u7528\u4EC0\u4E48 skill\u300D\u548C\u300C\u5B88\u54EA\u6761 rule\u300D\u3002\u5927\u6A21\u578B\u8D70\u5230\u8BE5\u9636\u6BB5\u65F6\uFF0Cdev_task \u53EA\u62AB\u9732\u8FD9\u9636\u6BB5\u6302\u8F7D\u7684\u5185\u5BB9\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BindingEditor, { config, setConfig, skills, rules }) }),
|
|
4864
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionCard, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconPlusOutline16, { size: 16 }), title: "\u65B0\u5EFA skill / rule", hint: "\u6E05\u5355\u91CC\u6CA1\u6709\u5408\u9002\u7684\u5C31\u5F53\u573A\u65B0\u5EFA\uFF0C\u5199\u5230\u9879\u76EE .dsh/ \u6216\u7528\u6237 $DSH_HOME\uFF1B\u5199\u597D\u540E\u81EA\u52A8\u51FA\u73B0\u5728\u4E0A\u9762\u7684\u6302\u8F7D\u6E05\u5355\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ResourceCreator, { remote, workspace, onCreated: refreshCatalogs }) }),
|
|
4864
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SectionCard, { icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconPlusOutline16, { size: 16 }), title: "\u65B0\u5EFA skill / rule", defaultOpen: false, hint: "\u6E05\u5355\u91CC\u6CA1\u6709\u5408\u9002\u7684\u5C31\u5F53\u573A\u65B0\u5EFA\uFF0C\u5199\u5230\u9879\u76EE .dsh/ \u6216\u7528\u6237 $DSH_HOME\uFF1B\u5199\u597D\u540E\u81EA\u52A8\u51FA\u73B0\u5728\u4E0A\u9762\u7684\u6302\u8F7D\u6E05\u5355\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ResourceCreator, { remote, workspace, onCreated: refreshCatalogs }) }),
|
|
4865
4865
|
problems.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: styles.problems, children: [
|
|
4866
4866
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { style: styles.problemsTitle, children: [
|
|
4867
4867
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.StateDot, { state: "error" }),
|
|
@@ -4912,8 +4912,8 @@ function sourceText(source) {
|
|
|
4912
4912
|
return "\u5185\u7F6E\u9ED8\u8BA4\u914D\u7F6E\uFF08\u5DE5\u4F5C\u533A\u5C1A\u65E0 .dsh/eng.json\uFF09";
|
|
4913
4913
|
}
|
|
4914
4914
|
}
|
|
4915
|
-
function SectionCard({ icon, title, hint, children }) {
|
|
4916
|
-
const [open, setOpen] = (0, import_react2.useState)(
|
|
4915
|
+
function SectionCard({ icon, title, hint, defaultOpen = true, children }) {
|
|
4916
|
+
const [open, setOpen] = (0, import_react2.useState)(defaultOpen);
|
|
4917
4917
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: styles.section, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
4918
4918
|
import_dsh_client_ui_primitives.DisclosureRow,
|
|
4919
4919
|
{
|
|
@@ -5192,60 +5192,68 @@ function CommitEditor({ config, setConfig }) {
|
|
|
5192
5192
|
] });
|
|
5193
5193
|
}
|
|
5194
5194
|
function BindingEditor({ config, setConfig, skills, rules }) {
|
|
5195
|
-
const
|
|
5195
|
+
const [stage, setStage] = (0, import_react2.useState)(config.stages[0] ?? "");
|
|
5196
|
+
const currentStage = config.stages.includes(stage) ? stage : config.stages[0] ?? "";
|
|
5197
|
+
const toggleSkill = (skill) => {
|
|
5198
|
+
if (currentStage === "") return;
|
|
5196
5199
|
update(config, setConfig, (c) => {
|
|
5197
5200
|
const bindings = c.stage_bindings ?? {};
|
|
5198
|
-
const current = bindings[
|
|
5201
|
+
const current = bindings[currentStage]?.skills ?? [];
|
|
5199
5202
|
const next = current.includes(skill) ? current.filter((s) => s !== skill) : [...current, skill].sort();
|
|
5200
|
-
return { ...c, stage_bindings: { ...bindings, [
|
|
5203
|
+
return { ...c, stage_bindings: { ...bindings, [currentStage]: { ...bindings[currentStage] ?? {}, skills: next } } };
|
|
5201
5204
|
});
|
|
5202
5205
|
};
|
|
5203
|
-
const toggleRule = (
|
|
5206
|
+
const toggleRule = (rule) => {
|
|
5207
|
+
if (currentStage === "") return;
|
|
5204
5208
|
update(config, setConfig, (c) => {
|
|
5205
5209
|
const bindings = c.stage_bindings ?? {};
|
|
5206
|
-
const current = bindings[
|
|
5210
|
+
const current = bindings[currentStage]?.rules ?? [];
|
|
5207
5211
|
const next = current.includes(rule) ? current.filter((s) => s !== rule) : [...current, rule].sort();
|
|
5208
|
-
return { ...c, stage_bindings: { ...bindings, [
|
|
5212
|
+
return { ...c, stage_bindings: { ...bindings, [currentStage]: { ...bindings[currentStage] ?? {}, rules: next } } };
|
|
5209
5213
|
});
|
|
5210
5214
|
};
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5215
|
+
if (currentStage === "") {
|
|
5216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: styles.muted, children: "\u5148\u5728\u300C\u9636\u6BB5\u300D\u91CC\u52A0\u4E00\u4E2A\u9636\u6BB5\uFF0C\u518D\u56DE\u6765\u6302 skill / rule\u3002" });
|
|
5217
|
+
}
|
|
5218
|
+
const boundSkills = config.stage_bindings?.[currentStage]?.skills ?? [];
|
|
5219
|
+
const boundRules = config.stage_bindings?.[currentStage]?.rules ?? [];
|
|
5220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: styles.section, children: [
|
|
5221
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: styles.field, children: [
|
|
5222
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: styles.fieldLabel, children: "\u9009\u62E9\u9636\u6BB5\uFF08\u6539\u54EA\u4E2A\u9636\u6BB5\u7684\u6302\u8F7D\uFF09" }),
|
|
5223
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: styles.chips, children: config.stages.map((s) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Pill, { active: s === currentStage, onClick: () => {
|
|
5224
|
+
setStage(s);
|
|
5225
|
+
}, children: s }, s)) })
|
|
5226
|
+
] }),
|
|
5227
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: cardV, children: [
|
|
5217
5228
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: styles.bindingStage, children: [
|
|
5218
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: styles.fieldLabel, children: "skill\uFF08\u505A\u4EC0\u4E48\uFF09" }),
|
|
5219
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: styles.chips, children: skills.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: styles.sourceBadge, children: "\u6682\u65E0\u53EF\u7528 skill\uFF0C\u53EF\u5728\
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
sk.name
|
|
5230
|
-
)) })
|
|
5229
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: styles.fieldLabel, children: "skill\uFF08\u8FD9\u4E2A\u9636\u6BB5\u505A\u4EC0\u4E48\uFF09" }),
|
|
5230
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: styles.chips, children: skills.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: styles.sourceBadge, children: "\u6682\u65E0\u53EF\u7528 skill\uFF0C\u53EF\u5728\u300C\u65B0\u5EFA skill / rule\u300D\u91CC\u5EFA" }) : skills.map((sk) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dsh_client_ui_primitives.Pill, { active: boundSkills.includes(sk.name), onClick: () => {
|
|
5231
|
+
toggleSkill(sk.name);
|
|
5232
|
+
}, title: `${sk.description}\uFF08${sourceLabel(sk.source)}\uFF09`, children: [
|
|
5233
|
+
sk.name,
|
|
5234
|
+
sk.source !== "bundled" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { style: styles.sourceBadge, children: [
|
|
5235
|
+
"\uFF08",
|
|
5236
|
+
sourceLabel(sk.source),
|
|
5237
|
+
"\uFF09"
|
|
5238
|
+
] }) : null
|
|
5239
|
+
] }, sk.name)) })
|
|
5231
5240
|
] }),
|
|
5232
5241
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: styles.bindingStage, children: [
|
|
5233
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: styles.fieldLabel, children: "rule\uFF08\u5B88\u4EC0\u4E48\uFF09" }),
|
|
5234
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: styles.chips, children: rules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: styles.sourceBadge, children: "\u6682\u65E0\u53EF\u7528 rule\uFF0C\u53EF\u5728\
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
}) });
|
|
5242
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: styles.fieldLabel, children: "rule\uFF08\u8FD9\u4E2A\u9636\u6BB5\u5B88\u4EC0\u4E48\uFF09" }),
|
|
5243
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: styles.chips, children: rules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: styles.sourceBadge, children: "\u6682\u65E0\u53EF\u7528 rule\uFF0C\u53EF\u5728\u300C\u65B0\u5EFA skill / rule\u300D\u91CC\u5EFA" }) : rules.map((rule) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dsh_client_ui_primitives.Pill, { active: boundRules.includes(rule.name), onClick: () => {
|
|
5244
|
+
toggleRule(rule.name);
|
|
5245
|
+
}, title: `\u6765\u6E90\uFF1A${sourceLabel(rule.source)}`, children: [
|
|
5246
|
+
rule.name,
|
|
5247
|
+
rule.source !== "bundled" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { style: styles.sourceBadge, children: [
|
|
5248
|
+
"\uFF08",
|
|
5249
|
+
sourceLabel(rule.source),
|
|
5250
|
+
"\uFF09"
|
|
5251
|
+
] }) : null
|
|
5252
|
+
] }, rule.name)) })
|
|
5253
|
+
] }),
|
|
5254
|
+
boundSkills.length === 0 && boundRules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: styles.hint, children: "\u8FD9\u4E2A\u9636\u6BB5\u8FD8\u6CA1\u6302\u4EFB\u4F55 skill / rule \u2014\u2014 \u70B9\u4E0A\u9762\u7684\u540D\u79F0\u52FE\u9009\u3002" }) : null
|
|
5255
|
+
] })
|
|
5256
|
+
] });
|
|
5249
5257
|
}
|
|
5250
5258
|
function ResourceCreator({ remote, workspace, onCreated }) {
|
|
5251
5259
|
const [skillName, setSkillName] = (0, import_react2.useState)("");
|
|
@@ -5274,7 +5282,8 @@ function ResourceCreator({ remote, workspace, onCreated }) {
|
|
|
5274
5282
|
setMsg("\u65B0\u5EFA skill \u5931\u8D25\uFF1A" + (result.value.error ?? "\u672A\u77E5\u9519\u8BEF"));
|
|
5275
5283
|
return;
|
|
5276
5284
|
}
|
|
5277
|
-
|
|
5285
|
+
const loc = level === "project" ? `.dsh/skills/${result.value.name}/SKILL.md` : `$DSH_HOME/skills/${result.value.name}/SKILL.md`;
|
|
5286
|
+
setMsg(`\u5DF2\u65B0\u5EFA skill\u300C${result.value.name}\u300D\u2192 \u5199\u5165 ${loc}\uFF08\u5DF2\u51FA\u73B0\u5728\u4E0A\u65B9\u6302\u8F7D\u6E05\u5355\uFF09`);
|
|
5278
5287
|
setSkillName("");
|
|
5279
5288
|
setSkillDesc("");
|
|
5280
5289
|
setSkillWhen("");
|
|
@@ -5292,7 +5301,8 @@ function ResourceCreator({ remote, workspace, onCreated }) {
|
|
|
5292
5301
|
setMsg("\u65B0\u5EFA rule \u5931\u8D25\uFF1A" + (result.value.error ?? "\u672A\u77E5\u9519\u8BEF"));
|
|
5293
5302
|
return;
|
|
5294
5303
|
}
|
|
5295
|
-
|
|
5304
|
+
const loc = level === "project" ? `.dsh/rules/${result.value.name}.md` : `$DSH_HOME/rules/${result.value.name}.md`;
|
|
5305
|
+
setMsg(`\u5DF2\u65B0\u5EFA rule\u300C${result.value.name}\u300D\u2192 \u5199\u5165 ${loc}\uFF08\u5DF2\u51FA\u73B0\u5728\u4E0A\u65B9\u6302\u8F7D\u6E05\u5355\uFF09`);
|
|
5296
5306
|
setRuleName("");
|
|
5297
5307
|
setRuleBody("");
|
|
5298
5308
|
onCreated();
|