@xiaoso/dsh-workflow-lite 0.0.0-stage → 0.1.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/LICENSE +24 -0
- package/README.en.md +84 -0
- package/README.md +83 -2
- package/THIRD_PARTY_NOTICES.md +762 -0
- package/assets/icon-full.webp +0 -0
- package/assets/icon.webp +0 -0
- package/assets/wordmark.png +0 -0
- package/cordis.patch.yml +3 -0
- package/lib/client.js +127442 -0
- package/lib/index.mjs +9613 -0
- package/lib/types/client/app/addStep.d.ts +25 -0
- package/lib/types/client/app/desktop.d.ts +52 -0
- package/lib/types/client/app/host.d.ts +29 -0
- package/lib/types/client/app/sessions.d.ts +117 -0
- package/lib/types/client/app/theme.d.ts +27 -0
- package/lib/types/client/app/usePluginConfig.d.ts +59 -0
- package/lib/types/client/app/useRunFile.d.ts +24 -0
- package/lib/types/client/app/useRunGraph.d.ts +51 -0
- package/lib/types/client/app/useRunHistory.d.ts +21 -0
- package/lib/types/client/app/useRuns.d.ts +84 -0
- package/lib/types/client/app/useVersions.d.ts +50 -0
- package/lib/types/client/app/useWorkflow.d.ts +67 -0
- package/lib/types/client/app/viewport.d.ts +14 -0
- package/lib/types/client/i18n.d.ts +930 -0
- package/lib/types/client/index.d.ts +18 -0
- package/lib/types/client/model/connect.d.ts +44 -0
- package/lib/types/client/model/editor.d.ts +252 -0
- package/lib/types/client/model/fileKind.d.ts +15 -0
- package/lib/types/client/model/hostPath.d.ts +15 -0
- package/lib/types/client/model/htmlPreview.d.ts +24 -0
- package/lib/types/client/model/hubRuns.d.ts +45 -0
- package/lib/types/client/model/layout.d.ts +83 -0
- package/lib/types/client/model/library.d.ts +109 -0
- package/lib/types/client/model/nudge.d.ts +43 -0
- package/lib/types/client/model/pathSample.d.ts +26 -0
- package/lib/types/client/model/route.d.ts +121 -0
- package/lib/types/client/model/runDraft.d.ts +68 -0
- package/lib/types/client/model/runGraph.d.ts +15 -0
- package/lib/types/client/model/runHistory.d.ts +40 -0
- package/lib/types/client/model/themes.d.ts +87 -0
- package/lib/types/client/model/time.d.ts +7 -0
- package/lib/types/client/rpc.d.ts +42 -0
- package/lib/types/client/ui/AppearancePicker.d.ts +23 -0
- package/lib/types/client/ui/Canvas.d.ts +76 -0
- package/lib/types/client/ui/Confirm.d.ts +42 -0
- package/lib/types/client/ui/DocViewer.d.ts +67 -0
- package/lib/types/client/ui/Dock.d.ts +13 -0
- package/lib/types/client/ui/FileTag.d.ts +9 -0
- package/lib/types/client/ui/FileViewer.d.ts +30 -0
- package/lib/types/client/ui/FlowStreaks.d.ts +40 -0
- package/lib/types/client/ui/Handoff.d.ts +30 -0
- package/lib/types/client/ui/HostPicker.d.ts +31 -0
- package/lib/types/client/ui/HubDialog.d.ts +38 -0
- package/lib/types/client/ui/HubRunRow.d.ts +22 -0
- package/lib/types/client/ui/HubRuns.d.ts +19 -0
- package/lib/types/client/ui/HubSettings.d.ts +20 -0
- package/lib/types/client/ui/HubStorage.d.ts +18 -0
- package/lib/types/client/ui/HubWorkflowList.d.ts +21 -0
- package/lib/types/client/ui/HubWorkflowRow.d.ts +33 -0
- package/lib/types/client/ui/HubWorkflows.d.ts +26 -0
- package/lib/types/client/ui/HubWorkspacePicker.d.ts +16 -0
- package/lib/types/client/ui/Icon.d.ts +83 -0
- package/lib/types/client/ui/InputPanel.d.ts +37 -0
- package/lib/types/client/ui/InputsDialog.d.ts +22 -0
- package/lib/types/client/ui/Inspector.d.ts +51 -0
- package/lib/types/client/ui/Issues.d.ts +15 -0
- package/lib/types/client/ui/Launch.d.ts +30 -0
- package/lib/types/client/ui/Library.d.ts +23 -0
- package/lib/types/client/ui/LinkRow.d.ts +31 -0
- package/lib/types/client/ui/Markdown.d.ts +21 -0
- package/lib/types/client/ui/NodeHeads.d.ts +47 -0
- package/lib/types/client/ui/NoteDrawer.d.ts +21 -0
- package/lib/types/client/ui/OpenWith.d.ts +21 -0
- package/lib/types/client/ui/Outputs.d.ts +61 -0
- package/lib/types/client/ui/PanelHead.d.ts +21 -0
- package/lib/types/client/ui/PlanDialog.d.ts +18 -0
- package/lib/types/client/ui/PreviewCard.d.ts +38 -0
- package/lib/types/client/ui/QuickAdd.d.ts +30 -0
- package/lib/types/client/ui/ResourceItemDialog.d.ts +33 -0
- package/lib/types/client/ui/ResourceItems.d.ts +30 -0
- package/lib/types/client/ui/ResourcePanel.d.ts +26 -0
- package/lib/types/client/ui/Resources.d.ts +43 -0
- package/lib/types/client/ui/RunDraftBar.d.ts +35 -0
- package/lib/types/client/ui/RunEdge.d.ts +29 -0
- package/lib/types/client/ui/RunFiles.d.ts +24 -0
- package/lib/types/client/ui/RunInput.d.ts +26 -0
- package/lib/types/client/ui/RunItemDialog.d.ts +43 -0
- package/lib/types/client/ui/RunModeSwitch.d.ts +14 -0
- package/lib/types/client/ui/RunNav.d.ts +22 -0
- package/lib/types/client/ui/RunNodeState.d.ts +42 -0
- package/lib/types/client/ui/RunOverview.d.ts +27 -0
- package/lib/types/client/ui/RunPosition.d.ts +24 -0
- package/lib/types/client/ui/RunResource.d.ts +40 -0
- package/lib/types/client/ui/RunStatusMenu.d.ts +28 -0
- package/lib/types/client/ui/RunStep.d.ts +45 -0
- package/lib/types/client/ui/RunTopBar.d.ts +42 -0
- package/lib/types/client/ui/RunView.d.ts +43 -0
- package/lib/types/client/ui/SettingsDialog.d.ts +25 -0
- package/lib/types/client/ui/SettingsFields.d.ts +37 -0
- package/lib/types/client/ui/SkillPicker.d.ts +25 -0
- package/lib/types/client/ui/SkillPreview.d.ts +27 -0
- package/lib/types/client/ui/StepMark.d.ts +16 -0
- package/lib/types/client/ui/StepPanel.d.ts +26 -0
- package/lib/types/client/ui/ThemePicker.d.ts +13 -0
- package/lib/types/client/ui/TipLayer.d.ts +17 -0
- package/lib/types/client/ui/TopBar.d.ts +32 -0
- package/lib/types/client/ui/VersionList.d.ts +19 -0
- package/lib/types/client/ui/VersionRow.d.ts +19 -0
- package/lib/types/client/ui/VersionsDialog.d.ts +18 -0
- package/lib/types/client/ui/WorkflowRow.d.ts +32 -0
- package/lib/types/client/ui/WorkflowSwitcher.d.ts +20 -0
- package/lib/types/client/ui/WorkflowView.d.ts +27 -0
- package/lib/types/client/ui/lines.d.ts +13 -0
- package/lib/types/client/ui/primitives.d.ts +119 -0
- package/lib/types/client/ui/resourceUi.d.ts +49 -0
- package/lib/types/client/ui/stepIcons.d.ts +10 -0
- package/lib/types/host/authoringSkill.d.ts +17 -0
- package/lib/types/host/config.d.ts +54 -0
- package/lib/types/host/hostFs.d.ts +69 -0
- package/lib/types/host/plan.d.ts +68 -0
- package/lib/types/host/pluginConfig.d.ts +57 -0
- package/lib/types/host/rpc.d.ts +45 -0
- package/lib/types/host/runs/files.d.ts +37 -0
- package/lib/types/host/runs/notice.d.ts +21 -0
- package/lib/types/host/runs/service.d.ts +258 -0
- package/lib/types/host/runs/skill.d.ts +16 -0
- package/lib/types/host/runs/storage.d.ts +16 -0
- package/lib/types/host/runs/store.d.ts +56 -0
- package/lib/types/host/skillView.d.ts +22 -0
- package/lib/types/host/store/atomic.d.ts +34 -0
- package/lib/types/host/store/materialize.d.ts +19 -0
- package/lib/types/host/store/merge.d.ts +25 -0
- package/lib/types/host/store/paths.d.ts +86 -0
- package/lib/types/host/store/repository.d.ts +217 -0
- package/lib/types/host/store/versions.d.ts +38 -0
- package/lib/types/host/tool/tool.d.ts +432 -0
- package/lib/types/index.d.ts +35 -0
- package/lib/types/shared/appearance.d.ts +49 -0
- package/lib/types/shared/compile.d.ts +71 -0
- package/lib/types/shared/graph.d.ts +54 -0
- package/lib/types/shared/graphDiff.d.ts +29 -0
- package/lib/types/shared/inputs.d.ts +46 -0
- package/lib/types/shared/limits.d.ts +77 -0
- package/lib/types/shared/model.d.ts +122 -0
- package/lib/types/shared/naming.d.ts +59 -0
- package/lib/types/shared/outputPaths.d.ts +49 -0
- package/lib/types/shared/resources.d.ts +98 -0
- package/lib/types/shared/runCursor.d.ts +54 -0
- package/lib/types/shared/runState.d.ts +221 -0
- package/lib/types/shared/runSync.d.ts +24 -0
- package/lib/types/shared/types.d.ts +488 -0
- package/lib/types/shared/validate.d.ts +54 -0
- package/lib/types/shared/wire.d.ts +600 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +144 -4
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 运行状态:格式、校验、初始状态与派生量。
|
|
3
|
+
*
|
|
4
|
+
* 一个工作流实例一份 YAML 状态文件,执行期间由主 agent 维护。本模块**只处理解析后的普通对象**,不碰 YAML、不碰磁盘:
|
|
5
|
+
* host(建实例、画布显示)、随 skill 分发的校验脚本、单测三边共用同一套规则。
|
|
6
|
+
*
|
|
7
|
+
* 校验结论是给模型看的——每条都写成「路径: 哪里不对(可选值…)」,照着就能改。
|
|
8
|
+
*
|
|
9
|
+
* @module @xiaoso/dsh-workflow-lite/shared/runState
|
|
10
|
+
*/
|
|
11
|
+
import { type ExecutionMode, type InputAnswer, type WorkflowDocument } from './types.ts';
|
|
12
|
+
export declare const RUN_STATE_VERSION = 1;
|
|
13
|
+
/** 整次执行的状态。 */
|
|
14
|
+
export declare const RUN_STATUSES: readonly ["pending", "running", "waiting", "done", "failed", "cancelled"];
|
|
15
|
+
export type RunStatus = (typeof RUN_STATUSES)[number];
|
|
16
|
+
/** 单个步骤的状态。 */
|
|
17
|
+
export declare const NODE_STATUSES: readonly ["pending", "running", "waiting", "done", "failed", "skipped"];
|
|
18
|
+
export type NodeStatus = (typeof NODE_STATUSES)[number];
|
|
19
|
+
/** 流水里的事件。 */
|
|
20
|
+
export declare const LOG_EVENTS: readonly ["start", "done", "failed", "waiting", "skipped", "resume", "transfer", "edit", "next", "note"];
|
|
21
|
+
export type LogEvent = (typeof LOG_EVENTS)[number];
|
|
22
|
+
/** 摘要的长度上限(码位)。建议一两句、200 字以内;超过这个数就是贴原文了。 */
|
|
23
|
+
export declare const SUMMARY_MAX = 500;
|
|
24
|
+
export interface NodeRunState {
|
|
25
|
+
status: NodeStatus;
|
|
26
|
+
/** 第几轮,从 1 起;开始过就必填。 */
|
|
27
|
+
round?: number;
|
|
28
|
+
startedAt?: string;
|
|
29
|
+
finishedAt?: string;
|
|
30
|
+
/** 谁做的:`self` / `subagent` / 队员名。 */
|
|
31
|
+
by?: string;
|
|
32
|
+
/** 这一轮的判定:必须是它出边 `when` 的值之一。 */
|
|
33
|
+
verdict?: string;
|
|
34
|
+
summary?: string;
|
|
35
|
+
outputs?: string[];
|
|
36
|
+
error?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface RunLogEntry {
|
|
39
|
+
at: string;
|
|
40
|
+
/** 省略 = 整次执行的事件。 */
|
|
41
|
+
node?: string;
|
|
42
|
+
event: LogEvent;
|
|
43
|
+
round?: number;
|
|
44
|
+
verdict?: string;
|
|
45
|
+
detail?: string;
|
|
46
|
+
/** `user` = 用户在画布上改的(插件写入);省略 = 主 agent。 */
|
|
47
|
+
by?: 'user';
|
|
48
|
+
}
|
|
49
|
+
export interface RunState {
|
|
50
|
+
version: typeof RUN_STATE_VERSION;
|
|
51
|
+
instance: string;
|
|
52
|
+
workflow: string;
|
|
53
|
+
plan: string;
|
|
54
|
+
/** 图快照的绝对路径。 */
|
|
55
|
+
graph: string;
|
|
56
|
+
mode: ExecutionMode;
|
|
57
|
+
goal?: string;
|
|
58
|
+
status: RunStatus;
|
|
59
|
+
updatedAt: string;
|
|
60
|
+
note?: string;
|
|
61
|
+
/**
|
|
62
|
+
* 用户指定的下一步(步骤 id):有它时「接下来」就是这几步,不再按流转推。
|
|
63
|
+
* 只有用户在画布上改;模型开始做其中一步时插件把它划掉,划完删掉这个字段。
|
|
64
|
+
*/
|
|
65
|
+
next?: string[];
|
|
66
|
+
/** 每个步骤一项(文件节点不在这里),键是步骤 id。 */
|
|
67
|
+
nodes: Record<string, NodeRunState>;
|
|
68
|
+
log: RunLogEntry[];
|
|
69
|
+
}
|
|
70
|
+
/** 身份字段:插件写,模型不改。 */
|
|
71
|
+
export declare const IDENTITY_KEYS: readonly ["version", "instance", "workflow", "plan", "graph", "mode"];
|
|
72
|
+
/** 校验要对照的图事实:有哪些步骤、各步骤的判定能取哪些值。 */
|
|
73
|
+
export interface RunGraphFacts {
|
|
74
|
+
/** 步骤 id,按图里的顺序。 */
|
|
75
|
+
steps: string[];
|
|
76
|
+
/** 步骤 id → 它出边(到步骤的)`when` 的取值;没有条件出边的不在表里。 */
|
|
77
|
+
verdicts: Record<string, string[]>;
|
|
78
|
+
}
|
|
79
|
+
export declare function graphFacts(document: WorkflowDocument): RunGraphFacts;
|
|
80
|
+
export interface RunStateIssue {
|
|
81
|
+
/** 出问题的位置,例如 `nodes.review.status`;整份文件的问题是空串。 */
|
|
82
|
+
path: string;
|
|
83
|
+
message: string;
|
|
84
|
+
}
|
|
85
|
+
/** 身份字段要对得上的值(host 知道它建的是哪个实例)。 */
|
|
86
|
+
export interface RunStateExpect {
|
|
87
|
+
instance?: string;
|
|
88
|
+
workflow?: string;
|
|
89
|
+
plan?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface RunStateCheck {
|
|
92
|
+
/** 没有问题时是规整后的状态;有问题时为 `null`。 */
|
|
93
|
+
state: RunState | null;
|
|
94
|
+
issues: RunStateIssue[];
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* 校验一份解析后的状态。`facts` 给了就对照图快照(步骤齐不齐、判定取值对不对);
|
|
98
|
+
* `expect` 给了就核对身份字段。
|
|
99
|
+
*/
|
|
100
|
+
export declare function validateRunState(value: unknown, facts?: RunGraphFacts, expect?: RunStateExpect): RunStateCheck;
|
|
101
|
+
export interface InitialRunInput {
|
|
102
|
+
instance: string;
|
|
103
|
+
workflow: string;
|
|
104
|
+
plan: string;
|
|
105
|
+
graph: string;
|
|
106
|
+
mode: ExecutionMode;
|
|
107
|
+
goal?: string;
|
|
108
|
+
/** 建立时刻(ISO 8601,带时区)。 */
|
|
109
|
+
now: string;
|
|
110
|
+
steps: readonly string[];
|
|
111
|
+
}
|
|
112
|
+
/** 插件建实例时写下的初始状态:整体 `pending`,每个步骤 `pending`,流水为空。 */
|
|
113
|
+
export declare function initialRunState(input: InitialRunInput): RunState;
|
|
114
|
+
/**
|
|
115
|
+
* 本地时间的 ISO 8601(带时区偏移,不用 `Z`:人读状态文件时一眼就是本地钟点),**精确到毫秒**。
|
|
116
|
+
*
|
|
117
|
+
* 为什么要毫秒:「同一次调用写下的几步一起算」是靠流水里 `at` 相同认出来的,只精确到秒会把落到
|
|
118
|
+
* 同一秒里的**两次**调用认成一次(连着改两下、模型连着写两次状态都会这样)。见 `shared/runCursor.ts`。
|
|
119
|
+
*/
|
|
120
|
+
export declare function isoNow(date?: Date): string;
|
|
121
|
+
export interface RunProgress {
|
|
122
|
+
done: number;
|
|
123
|
+
total: number;
|
|
124
|
+
running: string[];
|
|
125
|
+
failed: string[];
|
|
126
|
+
waiting: string[];
|
|
127
|
+
}
|
|
128
|
+
export declare function progressOf(state: RunState): RunProgress;
|
|
129
|
+
/**
|
|
130
|
+
* 走过的线:不要求模型记边,按状态推。
|
|
131
|
+
* - 步骤 → 步骤:源做过、目标开始过;条件边还要求源在某一轮给过这个判定
|
|
132
|
+
* (流水里该步骤 `done` 的判定 + 当前的判定,所以循环里先 fail 后 pass 两条都算)。
|
|
133
|
+
* - 步骤 ↔ 文件:步骤开始过就算。
|
|
134
|
+
*/
|
|
135
|
+
export declare function takenEdges(document: WorkflowDocument, state: RunState): Set<string>;
|
|
136
|
+
/** 实例索引 `instances.json` 里的一条(只有插件写)。 */
|
|
137
|
+
export interface InstanceRecord {
|
|
138
|
+
id: string;
|
|
139
|
+
workflow: string;
|
|
140
|
+
planId: string;
|
|
141
|
+
mode: ExecutionMode;
|
|
142
|
+
goal?: string;
|
|
143
|
+
/** 建立时的会话工作区。 */
|
|
144
|
+
cwd?: string;
|
|
145
|
+
/**
|
|
146
|
+
* 状态文件的绝对路径。没有 = 这个实例**不记运行状态**:工作流没开「记录运行状态」时,
|
|
147
|
+
* 画布上点「执行」照样建实例(图的快照 + 归属会话),只是没有状态文件。
|
|
148
|
+
*/
|
|
149
|
+
statePath?: string;
|
|
150
|
+
/** 它所属的会话(只有一个);没有会话的调用建出来的实例没有归属。 */
|
|
151
|
+
session?: string;
|
|
152
|
+
/** 建立时刻(epoch 毫秒)。 */
|
|
153
|
+
createdAt: number;
|
|
154
|
+
/** 用户改了状态、但当时没能通知到模型时暂存的通知正文;交付后删掉。 */
|
|
155
|
+
pendingNotice?: string;
|
|
156
|
+
}
|
|
157
|
+
/** 列表里的一项:索引记录 + 现读的状态摘要。 */
|
|
158
|
+
export interface InstanceSummary {
|
|
159
|
+
id: string;
|
|
160
|
+
workflow: string;
|
|
161
|
+
planId: string;
|
|
162
|
+
mode: ExecutionMode;
|
|
163
|
+
goal?: string;
|
|
164
|
+
cwd?: string;
|
|
165
|
+
/** 没有 = 不记运行状态(见 `InstanceRecord.statePath`)。 */
|
|
166
|
+
statePath?: string;
|
|
167
|
+
session?: string;
|
|
168
|
+
createdAt: number;
|
|
169
|
+
/** 是不是请求方会话的当前实例。 */
|
|
170
|
+
current: boolean;
|
|
171
|
+
status?: RunStatus;
|
|
172
|
+
done?: number;
|
|
173
|
+
total?: number;
|
|
174
|
+
updatedAt?: string;
|
|
175
|
+
/** 状态文件读不出来:不见了,或格式不对。 */
|
|
176
|
+
stateProblem?: 'missing' | 'invalid';
|
|
177
|
+
/** 格式不对时具体哪里不对(最多 {@link SUMMARY_ISSUES_MAX} 条,列表里给人看原因)。 */
|
|
178
|
+
stateIssues?: RunStateIssue[];
|
|
179
|
+
}
|
|
180
|
+
/** 实例列表里每个实例最多带几条状态文件的问题。 */
|
|
181
|
+
export declare const SUMMARY_ISSUES_MAX = 5;
|
|
182
|
+
/** 画布读一个实例:快照 + 解析后的状态 + 校验结论。 */
|
|
183
|
+
export interface InstanceView {
|
|
184
|
+
summary: InstanceSummary;
|
|
185
|
+
document: WorkflowDocument;
|
|
186
|
+
/** 合法时的状态;不合法或文件不在时为 `null`(画布保留上一次合法的样子)。 */
|
|
187
|
+
state: RunState | null;
|
|
188
|
+
issues: RunStateIssue[];
|
|
189
|
+
/** 状态文件的修改时间(epoch 毫秒);文件不在时为 0。 */
|
|
190
|
+
mtime: number;
|
|
191
|
+
/**
|
|
192
|
+
* 快照里每个资源的文件与文件夹在不在(资源 id → 按项的顺序:在 / 不在;网址、Skill、自定义是 `null`)。
|
|
193
|
+
*/
|
|
194
|
+
files: Record<string, (boolean | null)[]>;
|
|
195
|
+
/** 用户执行前对输入节点的回答(已补上默认值;输入 id → 回答)。 */
|
|
196
|
+
answers: Record<string, InputAnswer>;
|
|
197
|
+
}
|
|
198
|
+
/** 用户在画布上的一处改动。`null` = 删掉这个字段。 */
|
|
199
|
+
export type EditValue = string | number | string[] | null;
|
|
200
|
+
export interface StateEdit {
|
|
201
|
+
/** 字段路径:`['status']`、`['note']`、`['next']`、`['nodes', '<步骤 id>', '<字段>']`。 */
|
|
202
|
+
path: string[];
|
|
203
|
+
/** 改之前的值(缺省 / 没有 = `null`):插件写之前核对文件里还是它,对不上就是冲突。 */
|
|
204
|
+
from: EditValue;
|
|
205
|
+
to: EditValue;
|
|
206
|
+
}
|
|
207
|
+
/** 用户能改的字段。 */
|
|
208
|
+
export declare const EDITABLE_TOP: readonly ["status", "note", "next"];
|
|
209
|
+
export declare const EDITABLE_NODE: readonly ["status", "round", "startedAt", "finishedAt", "verdict", "summary", "error"];
|
|
210
|
+
/** 一处改动的路径是不是用户能改的。 */
|
|
211
|
+
export declare function editablePath(path: readonly string[]): boolean;
|
|
212
|
+
/**
|
|
213
|
+
* 用户把一个步骤改成某个状态时,连带要改的字段——让改完的状态照样合法、也合乎语义:
|
|
214
|
+
* - `running`:从 `done` / `failed` / `pending` 进来算新的一轮(`round` +1),写开始时间;
|
|
215
|
+
* - `done`:补上轮次与结束时间;
|
|
216
|
+
* - `failed`:补上轮次、结束时间和失败原因(没有就写"用户标记为失败");
|
|
217
|
+
* - `pending`(重跑):清掉这一轮的结束时间与判定;
|
|
218
|
+
* - `waiting` / `skipped`:只改状态(`waiting` 没轮次时补成 1)。
|
|
219
|
+
* 返回的是字段 → 新值(`null` = 删掉)。
|
|
220
|
+
*/
|
|
221
|
+
export declare function statusFields(node: NodeRunState, to: NodeStatus, now: string): Partial<Record<(typeof EDITABLE_NODE)[number], EditValue>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dsh-workflow-lite — 实例的图改了以后,运行状态跟着对齐的几处。
|
|
3
|
+
*
|
|
4
|
+
* - 新加的步骤补一项 `pending`;删掉的步骤(只能是没执行过的)去掉;
|
|
5
|
+
* - 用户指定的下一步里去掉图里没有了的;
|
|
6
|
+
* - 不再有条件出边的步骤去掉判定(还有条件出边、只是取值变了的不动,留给校验指出来,让用户重新选);
|
|
7
|
+
* - 身份字段 `plan` 换成新图的 planId。
|
|
8
|
+
*
|
|
9
|
+
* 插件保存时把这些落到 YAML 上(保留注释),画布拿它预览改完的样子、提前挑出保存不了的问题。
|
|
10
|
+
*
|
|
11
|
+
* @module @xiaoso/dsh-workflow-lite/shared/runSync
|
|
12
|
+
*/
|
|
13
|
+
import type { RunGraphFacts, RunState } from './runState.ts';
|
|
14
|
+
/** 一处对齐:`to` 为 `null` = 删掉这个字段。 */
|
|
15
|
+
export interface SyncOp {
|
|
16
|
+
path: string[];
|
|
17
|
+
to: unknown;
|
|
18
|
+
}
|
|
19
|
+
/** 步骤执行过没有(状态不是 pending,或流水里有它):执行过的不能从图里删。 */
|
|
20
|
+
export declare function hasHistory(state: RunState, id: string): boolean;
|
|
21
|
+
/** 状态要怎么改才和新图对得上。`plan` 给了就连身份字段一起换。 */
|
|
22
|
+
export declare function syncOps(state: RunState, facts: RunGraphFacts, plan?: string): SyncOp[];
|
|
23
|
+
/** 把对齐叠到状态上(画布预览用;不改入参)。 */
|
|
24
|
+
export declare function applySync(state: RunState, ops: readonly SyncOp[]): RunState;
|