fix: 表达工作流部分保存结果并校验认证重放

Piper 的 chooses 刷新与删除检查业务码,保留空成功响应。主保存成功后刷新失败抛出携带已保存版本的 WorkflowSavePartialError;统一 JSON 错误保留可选 EkbError.details。
workflow save 在部分成功时返回非零与恢复信息,--in-place 仍同步已保存版本;新增带写确认的 refresh-chooses,仅重试元数据刷新,不重发完整快照。主保存失败不改本地版本。
认证重放保留最终鉴权响应检查(含 HTTP 200 的错误头),最多重放一次,其他 HTTP 错误维持 Ky 语义。补充 SDK、CLI、恢复与重放回归,并更新文档。

验证:bun test 922 通过、0 失败;bun run check、git diff --check 通过。所有业务请求均为离线假接口。
This commit is contained in:
gitea committed 2026-10-29 18:21:30 +08:00
1 parent 51fb54dfe8
commit 55d31e27e6
19 files changed
+298 -23

No files matched your search

+4 -2
View File
@@ -1,7 +1,7 @@
import type { CliParsedArgs, CliResult, CliRuntime } from "../../types.js";
import { handleList, handleGet, handleFind } from "./list.js";
import { handleToggle, handlePublish } from "./lifecycle.js";
import { handlePatch, handleSave } from "./draft.js";
import { handlePatch, handleSave, handleRefreshChooses } from "./draft.js";
import { handleHistory, handleLogs } from "./history.js";
import { handleJob } from "./job.js";
import { handleCheck } from "./check.js";
@@ -52,6 +52,8 @@ export async function handleWorkflowCommand(
case "save":
case "update":
return handleSave(parsed, runtime);
case "refresh-chooses":
return handleRefreshChooses(parsed, runtime);
case "patch":
return handlePatch(parsed, runtime);
case "history":
@@ -122,7 +124,7 @@ export async function handleWorkflowCommand(
default:
return {
stdout: "",
stderr: `未知 workflow 子命令: ${action}。支持: list, get, find, analyze, toggle, publish, patch, save, history, logs, job, diff, diff-job, check, test, copy, create, delete, node, tail, lint-script, eval-script, enum, webhook\n`,
stderr: `未知 workflow 子命令: ${action}。支持: list, get, find, analyze, toggle, publish, patch, save, refresh-chooses, history, logs, job, diff, diff-job, check, test, copy, create, delete, node, tail, lint-script, eval-script, enum, webhook\n`,
exitCode: 1,
};
}