feat: 完善工作流工具链与大结果保护

- 工作流节点描述增加服务端托管黑名单,仅代码节点保留自定义 desc
- 工作流保存新增 --in-place,并改进版本冲突提示
- platform records 新增 --page 分页,--all 强制走 ndjson 文件流
- platform schema 展示 ownerId/submitterId 等系统字段
- 更新 Agent Skill 的代码节点 agent use 标记规范
- 补充对应测试与文档
This commit is contained in:
gitea committed 2026-10-28 13:01:11 +08:00
1 parent 37643da254
commit 7423e166a1
10 files changed
+123 -20

No files matched your search

+13 -6
View File
@@ -14,12 +14,13 @@ import {
GRAY_NODES_CATALOG,
findGrayNode,
} from "../../../domains/platform/workflow/nodes/gray-nodes-catalog.js";
import { isServerManagedDescType } from "../../../domains/platform/workflow/nodes/mutations.js";
import { stringOption } from "../../parser.js";
import { printJson, printTable, printKeyValue } from "../../printer.js";
import { isDryRun, mutationPreview, requireMutationConfirmation } from "../../mutation.js";
import type { CliParsedArgs, CliResult, CliRuntime } from "../../types.js";
import { createPiperClientForCorp } from "../../helpers.js";
import { createWorkflowDetailClient } from "./shared.js";
import { createWorkflowDetailClient, formatWorkflowVersion } from "./shared.js";
const SUB_ACTIONS = new Set(["list", "ls", "get", "show", "info", "add", "append", "insert", "edit", "update", "set", "map", "rm", "remove", "delete", "del"]);
const CORP_LEVEL_ACTIONS = new Set(["available", "list-available", "catalog", "probe", "grant", "open"]);
@@ -334,6 +335,7 @@ async function handleAddNode(
"节点显示名 (displayName)": newTask.displayName || "-",
"所属位置": parent ? `容器 [${parent}] 内部` : after ? `节点 [${after}] 之后` : "工作流顶级末尾",
"节点总数": String(saveResult.tasks?.length || updatedWorkflow.tasks?.length || 0),
"工作流版本": formatWorkflowVersion(saveResult),
}),
].join("\n");
@@ -420,6 +422,7 @@ async function handleEditNode(
code,
set: Object.keys(customSet).length > 0 ? customSet : undefined,
});
const descManaged = desc !== undefined && isServerManagedDescType(editedTask.type);
if (isDryRun(parsed, runtime)) {
return mutationPreview(parsed, runtime, "修改工作流节点", `${pipelineId}:${editedTask.name}`, {
@@ -429,7 +432,8 @@ async function handleEditNode(
updatedFields: {
...(label ? { label } : {}),
...(displayName !== undefined ? { displayName } : {}),
...(desc ? { desc } : {}),
...(desc && !descManaged ? { desc } : {}),
...(descManaged ? { desc: "服务端托管,已跳过" } : {}),
...(code !== undefined ? { code: `${code.length} 字符${!codeFile && code.length > 300 ? " [TIP: 建议使用 --code-file=<path> 从本地文件载入以规避转义错误并节省 Token]" : ""}` } : {}),
...customSet,
},
@@ -440,7 +444,7 @@ async function handleEditNode(
if (runtime.jsonMode) {
return {
stdout: printJson({ success: true, pipelineId, editedTask, workflow: saveResult }, runtime.outputOptions),
stdout: printJson({ success: true, pipelineId, editedTask, workflow: saveResult, descIgnored: descManaged }, runtime.outputOptions),
stderr: "",
exitCode: 0,
};
@@ -453,9 +457,12 @@ async function handleEditNode(
const labelTip = label
? "\n💡 提示: --label 是节点类型标题,服务端保存时可能重新生成;要修改设计器标题请使用 --display-name。\n"
: "";
const descTip = descManaged
? "\n💡 提示: 该节点描述由服务端按配置自动生成,--desc 已忽略;如需稳定说明,请使用代码节点或在创建节点上写业务说明。\n"
: "";
return {
stdout: `✅ 节点 [${editedTask.name}] (${editedTask.displayName || editedTask.label}) 修改已保存至工作流 [${pipelineId}]。\n${codeTip}${labelTip}`,
stdout: `✅ 节点 [${editedTask.name}] (${editedTask.displayName || editedTask.label}) 修改已保存至工作流 [${pipelineId}]。\n📌 ${formatWorkflowVersion(saveResult)}\n${codeTip}${labelTip}${descTip}`,
stderr: "",
exitCode: 0,
};
@@ -545,7 +552,7 @@ async function handleMapNode(
}
return {
stdout: `✅ 节点 [${editedTask.name}] (${editedTask.label}) 已批量应用映射: ${changedKeys.join(", ")},并已保存至工作流 [${pipelineId}]。\n`,
stdout: `✅ 节点 [${editedTask.name}] (${editedTask.label}) 已批量应用映射: ${changedKeys.join(", ")},并已保存至工作流 [${pipelineId}]。\n📌 ${formatWorkflowVersion(saveResult)}\n`,
stderr: "",
exitCode: 0,
};
@@ -598,7 +605,7 @@ async function handleRemoveNode(
}
return {
stdout: `🗑️ 节点 [${removedTask.name}] (${removedTask.label || removedTask.type}) 已从工作流 [${pipelineId}] 中安全移除。\n`,
stdout: `🗑️ 节点 [${removedTask.name}] (${removedTask.label || removedTask.type}) 已从工作流 [${pipelineId}] 中安全移除。\n📌 ${formatWorkflowVersion(saveResult)}\n`,
stderr: "",
exitCode: 0,
};