@crewx/workflow 0.3.22-rc.15 → 0.3.22-rc.150
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/SKILL.md +40 -4
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +268 -86
- package/dist/cli.js.map +1 -1
- package/dist/src/card-state.d.ts +20 -0
- package/dist/src/card-state.d.ts.map +1 -0
- package/dist/src/card-state.js +121 -0
- package/dist/src/card-state.js.map +1 -0
- package/dist/src/engine.d.ts +9 -2
- package/dist/src/engine.d.ts.map +1 -1
- package/dist/src/engine.js +70 -22
- package/dist/src/engine.js.map +1 -1
- package/dist/src/failure.d.ts +41 -0
- package/dist/src/failure.d.ts.map +1 -0
- package/dist/src/failure.js +122 -0
- package/dist/src/failure.js.map +1 -0
- package/dist/src/list-view.d.ts +22 -0
- package/dist/src/list-view.d.ts.map +1 -0
- package/dist/src/list-view.js +188 -0
- package/dist/src/list-view.js.map +1 -0
- package/dist/src/mermaid.d.ts.map +1 -1
- package/dist/src/mermaid.js +7 -4
- package/dist/src/mermaid.js.map +1 -1
- package/dist/src/parent-task-sync.d.ts +120 -0
- package/dist/src/parent-task-sync.d.ts.map +1 -0
- package/dist/src/parent-task-sync.js +307 -0
- package/dist/src/parent-task-sync.js.map +1 -0
- package/dist/src/retry-policy.d.ts +38 -0
- package/dist/src/retry-policy.d.ts.map +1 -0
- package/dist/src/retry-policy.js +140 -0
- package/dist/src/retry-policy.js.map +1 -0
- package/dist/src/run-manager.d.ts +35 -2
- package/dist/src/run-manager.d.ts.map +1 -1
- package/dist/src/run-manager.js +1189 -235
- package/dist/src/run-manager.js.map +1 -1
- package/dist/src/types.d.ts +39 -4
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/output-format.d.ts +12 -0
- package/dist/src/utils/output-format.d.ts.map +1 -1
- package/dist/src/utils/output-format.js +103 -5
- package/dist/src/utils/output-format.js.map +1 -1
- package/dist/src/workflow-persistence.d.ts +48 -0
- package/dist/src/workflow-persistence.d.ts.map +1 -0
- package/dist/src/workflow-persistence.js +224 -0
- package/dist/src/workflow-persistence.js.map +1 -0
- package/dist/workflow-schema.json +34 -5
- package/package.json +23 -4
- package/workflow-schema.json +34 -5
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { JsonObject, UiAuditSnapshotInput, UiInstance } from '@crewx/sdk';
|
|
2
|
+
import { type WorkflowApprovalState } from './card-state.js';
|
|
3
|
+
import { type WorkflowParentLifecycleChange, type WorkflowParentPersistTaskRepository, type WorkflowParentTaskKind } from './parent-task-sync.js';
|
|
4
|
+
import type { RunExecution, WorkflowSpec } from './types.js';
|
|
5
|
+
export interface WorkflowAuditSnapshotStore {
|
|
6
|
+
get(instanceId: string): UiInstance | null;
|
|
7
|
+
updateAuditSnapshot(input: UiAuditSnapshotInput): UiInstance | null;
|
|
8
|
+
}
|
|
9
|
+
export interface WorkflowPersistenceProjectionResult {
|
|
10
|
+
runId: string;
|
|
11
|
+
changedParentTaskIds: string[];
|
|
12
|
+
projectedAuditInstanceIds: string[];
|
|
13
|
+
errors: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface WorkflowAuditSnapshotChange {
|
|
16
|
+
instanceId: string;
|
|
17
|
+
before: JsonObject;
|
|
18
|
+
after: WorkflowApprovalState;
|
|
19
|
+
}
|
|
20
|
+
export interface WorkflowPersistenceProjectionPreview {
|
|
21
|
+
runId: string;
|
|
22
|
+
runStatus: NonNullable<RunExecution['status']>;
|
|
23
|
+
parentChanges: WorkflowParentLifecycleChange[];
|
|
24
|
+
auditSnapshotChanges: WorkflowAuditSnapshotChange[];
|
|
25
|
+
errors: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface WorkflowPersistenceProjectionPreviewOptions {
|
|
28
|
+
taskRepo: Pick<WorkflowParentPersistTaskRepository, 'findWorkflowParentTask'>;
|
|
29
|
+
workspaceId: string;
|
|
30
|
+
resolveWorkflowSpec: (run: RunExecution) => WorkflowSpec | null | undefined;
|
|
31
|
+
uiInstanceStore?: Pick<WorkflowAuditSnapshotStore, 'get'>;
|
|
32
|
+
getUiInstanceStore?: () => Pick<WorkflowAuditSnapshotStore, 'get'>;
|
|
33
|
+
parentKinds?: readonly WorkflowParentTaskKind[];
|
|
34
|
+
}
|
|
35
|
+
export interface WorkflowPersistenceProjectionOptions {
|
|
36
|
+
taskRepo: WorkflowParentPersistTaskRepository;
|
|
37
|
+
workspaceId: string;
|
|
38
|
+
resolveWorkflowSpec: (run: RunExecution) => WorkflowSpec | null | undefined;
|
|
39
|
+
uiInstanceStore?: WorkflowAuditSnapshotStore;
|
|
40
|
+
getUiInstanceStore?: () => WorkflowAuditSnapshotStore;
|
|
41
|
+
parentKinds?: readonly WorkflowParentTaskKind[];
|
|
42
|
+
onChanged?: (result: WorkflowPersistenceProjectionResult) => void;
|
|
43
|
+
warn?: (message: string) => void;
|
|
44
|
+
}
|
|
45
|
+
export type WorkflowPersistenceProjection = (run: RunExecution) => WorkflowPersistenceProjectionResult;
|
|
46
|
+
export declare function createWorkflowPersistenceProjection(options: WorkflowPersistenceProjectionOptions): WorkflowPersistenceProjection;
|
|
47
|
+
export declare function previewWorkflowPersistenceProjection(options: WorkflowPersistenceProjectionPreviewOptions, run: RunExecution): WorkflowPersistenceProjectionPreview;
|
|
48
|
+
//# sourceMappingURL=workflow-persistence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-persistence.d.ts","sourceRoot":"","sources":["../../src/workflow-persistence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,oBAAoB,EACpB,UAAU,EACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAA8B,KAAK,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAGL,KAAK,6BAA6B,EAGlC,KAAK,mCAAmC,EACxC,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAC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D,QAAQ,EAAE,mCAAmC,CAAC;IAC9C,WAAW,EAAE,MAAM,CAAC;IAEpB,mBAAmB,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC;IAE5E,eAAe,CAAC,EAAE,0BAA0B,CAAC;IAE7C,kBAAkB,CAAC,EAAE,MAAM,0BAA0B,CAAC;IACtD,WAAW,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAEhD,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,mCAAmC,KAAK,IAAI,CAAC;IAElE,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAED,MAAM,MAAM,6BAA6B,GACvC,CAAC,GAAG,EAAE,YAAY,KAAK,mCAAmC,CAAC;AA2D7D,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,oCAAoC,GAC5C,6BAA6B,CA4G/B;AAOD,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,2CAA2C,EACpD,GAAG,EAAE,YAAY,GAChB,oCAAoC,CA+EtC"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createWorkflowPersistenceProjection = createWorkflowPersistenceProjection;
|
|
4
|
+
exports.previewWorkflowPersistenceProjection = previewWorkflowPersistenceProjection;
|
|
5
|
+
const card_state_js_1 = require("./card-state.js");
|
|
6
|
+
const parent_task_sync_js_1 = require("./parent-task-sync.js");
|
|
7
|
+
function errorMessage(error) {
|
|
8
|
+
return error instanceof Error ? error.message : String(error);
|
|
9
|
+
}
|
|
10
|
+
function asJsonObject(state) {
|
|
11
|
+
return state;
|
|
12
|
+
}
|
|
13
|
+
function canonicalJson(value) {
|
|
14
|
+
if (Array.isArray(value))
|
|
15
|
+
return `[${value.map((item) => canonicalJson(item)).join(',')}]`;
|
|
16
|
+
if (value !== null && typeof value === 'object') {
|
|
17
|
+
const record = value;
|
|
18
|
+
return `{${Object.keys(record).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson(record[key])}`).join(',')}}`;
|
|
19
|
+
}
|
|
20
|
+
return JSON.stringify(value) ?? 'null';
|
|
21
|
+
}
|
|
22
|
+
function sameJson(left, right) {
|
|
23
|
+
return canonicalJson(left) === canonicalJson(right);
|
|
24
|
+
}
|
|
25
|
+
function buildResult(runId, parent) {
|
|
26
|
+
return {
|
|
27
|
+
runId,
|
|
28
|
+
changedParentTaskIds: [...parent.changedParentTaskIds],
|
|
29
|
+
projectedAuditInstanceIds: [],
|
|
30
|
+
errors: [],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function createWorkflowPersistenceProjection(options) {
|
|
34
|
+
const parentSinkOptions = {
|
|
35
|
+
taskRepo: options.taskRepo,
|
|
36
|
+
workspaceId: options.workspaceId,
|
|
37
|
+
...(options.parentKinds ? { parentKinds: options.parentKinds } : {}),
|
|
38
|
+
};
|
|
39
|
+
const parentSink = (0, parent_task_sync_js_1.createWorkflowParentPersistSink)(parentSinkOptions);
|
|
40
|
+
const warn = options.warn ?? ((message) => console.warn(message));
|
|
41
|
+
return (run) => {
|
|
42
|
+
let parent;
|
|
43
|
+
try {
|
|
44
|
+
parent = parentSink(run);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
const message = `workflow persistence parent projection failed for ${run.id}: ${errorMessage(error)}`;
|
|
48
|
+
warn(message);
|
|
49
|
+
return {
|
|
50
|
+
runId: run.id,
|
|
51
|
+
changedParentTaskIds: [],
|
|
52
|
+
projectedAuditInstanceIds: [],
|
|
53
|
+
errors: [message],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const result = buildResult(run.id, parent);
|
|
57
|
+
const addError = (stage, error) => {
|
|
58
|
+
const message = `workflow persistence ${stage} failed for ${run.id}: ${errorMessage(error)}`;
|
|
59
|
+
result.errors.push(message);
|
|
60
|
+
warn(message);
|
|
61
|
+
};
|
|
62
|
+
const instanceIds = [...new Set(parent.linkedAuditInstanceIds)];
|
|
63
|
+
if (instanceIds.length > 0) {
|
|
64
|
+
let spec;
|
|
65
|
+
try {
|
|
66
|
+
spec = options.resolveWorkflowSpec(run);
|
|
67
|
+
if (!spec)
|
|
68
|
+
throw new Error(`workflow spec not found for ${run.workflow_id}`);
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
addError('spec resolution', error);
|
|
72
|
+
}
|
|
73
|
+
if (spec) {
|
|
74
|
+
let state = null;
|
|
75
|
+
try {
|
|
76
|
+
state = (0, card_state_js_1.buildWorkflowApprovalState)(run, spec);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
addError('audit state build', error);
|
|
80
|
+
}
|
|
81
|
+
if (state) {
|
|
82
|
+
const updatedAt = Date.parse(run.updated_at);
|
|
83
|
+
if (!Number.isSafeInteger(updatedAt) || updatedAt < 0) {
|
|
84
|
+
addError('audit snapshot', new Error(`invalid run updated_at: ${run.updated_at}`));
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
let store = options.uiInstanceStore;
|
|
88
|
+
if (!store && options.getUiInstanceStore) {
|
|
89
|
+
try {
|
|
90
|
+
store = options.getUiInstanceStore();
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
addError('audit store creation', error);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (!store) {
|
|
97
|
+
addError('audit snapshot', new Error('no UiInstanceStore was provided'));
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
for (const instanceId of instanceIds) {
|
|
101
|
+
try {
|
|
102
|
+
const instance = store.get(instanceId);
|
|
103
|
+
const domainRunId = instance?.domainRef?.workflowRunId;
|
|
104
|
+
if (!instance
|
|
105
|
+
|| instance.workspaceId !== options.workspaceId
|
|
106
|
+
|| domainRunId !== run.id) {
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
const beforeState = canonicalJson(instance.state);
|
|
110
|
+
const beforeUpdatedAt = instance.updatedAt;
|
|
111
|
+
const updatedInstance = store.updateAuditSnapshot({
|
|
112
|
+
instanceId,
|
|
113
|
+
workspaceId: options.workspaceId,
|
|
114
|
+
updatedAt,
|
|
115
|
+
state: asJsonObject(state),
|
|
116
|
+
});
|
|
117
|
+
if (updatedInstance
|
|
118
|
+
&& (canonicalJson(updatedInstance.state) !== beforeState
|
|
119
|
+
|| updatedInstance.updatedAt !== beforeUpdatedAt)) {
|
|
120
|
+
result.projectedAuditInstanceIds.push(instanceId);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
addError(`audit snapshot ${instanceId}`, error);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if ((result.changedParentTaskIds.length > 0 || result.projectedAuditInstanceIds.length > 0)
|
|
133
|
+
&& options.onChanged) {
|
|
134
|
+
try {
|
|
135
|
+
options.onChanged(result);
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
addError('change callback', error);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return result;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function previewWorkflowPersistenceProjection(options, run) {
|
|
145
|
+
const parent = (0, parent_task_sync_js_1.previewWorkflowParentRepair)({
|
|
146
|
+
taskRepo: options.taskRepo,
|
|
147
|
+
run,
|
|
148
|
+
workspaceId: options.workspaceId,
|
|
149
|
+
...(options.parentKinds ? { parentKinds: options.parentKinds } : {}),
|
|
150
|
+
});
|
|
151
|
+
const result = {
|
|
152
|
+
runId: run.id,
|
|
153
|
+
runStatus: parent.runStatus,
|
|
154
|
+
parentChanges: [...parent.changes],
|
|
155
|
+
auditSnapshotChanges: [],
|
|
156
|
+
errors: [],
|
|
157
|
+
};
|
|
158
|
+
const addError = (stage, error) => {
|
|
159
|
+
result.errors.push(`workflow persistence preview ${stage} failed for ${run.id}: ${errorMessage(error)}`);
|
|
160
|
+
};
|
|
161
|
+
const instanceIds = [...new Set(parent.linkedAuditInstanceIds)];
|
|
162
|
+
if (instanceIds.length === 0)
|
|
163
|
+
return result;
|
|
164
|
+
let spec;
|
|
165
|
+
try {
|
|
166
|
+
spec = options.resolveWorkflowSpec(run);
|
|
167
|
+
if (!spec)
|
|
168
|
+
throw new Error(`workflow spec not found for ${run.workflow_id}`);
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
addError('spec resolution', error);
|
|
172
|
+
}
|
|
173
|
+
if (!spec)
|
|
174
|
+
return result;
|
|
175
|
+
let state;
|
|
176
|
+
try {
|
|
177
|
+
state = (0, card_state_js_1.buildWorkflowApprovalState)(run, spec);
|
|
178
|
+
}
|
|
179
|
+
catch (error) {
|
|
180
|
+
addError('audit state build', error);
|
|
181
|
+
return result;
|
|
182
|
+
}
|
|
183
|
+
const updatedAt = Date.parse(run.updated_at);
|
|
184
|
+
if (!Number.isSafeInteger(updatedAt) || updatedAt < 0) {
|
|
185
|
+
addError('audit snapshot', new Error(`invalid run updated_at: ${run.updated_at}`));
|
|
186
|
+
return result;
|
|
187
|
+
}
|
|
188
|
+
let store = options.uiInstanceStore;
|
|
189
|
+
if (!store && options.getUiInstanceStore) {
|
|
190
|
+
try {
|
|
191
|
+
store = options.getUiInstanceStore();
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
addError('audit store creation', error);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (!store) {
|
|
198
|
+
addError('audit snapshot', new Error('no UiInstanceStore was provided'));
|
|
199
|
+
return result;
|
|
200
|
+
}
|
|
201
|
+
for (const instanceId of instanceIds) {
|
|
202
|
+
try {
|
|
203
|
+
const instance = store.get(instanceId);
|
|
204
|
+
if (!instance
|
|
205
|
+
|| instance.workspaceId !== options.workspaceId
|
|
206
|
+
|| instance.domainRef.workflowRunId !== run.id) {
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
if (!sameJson(instance.state, state)) {
|
|
210
|
+
result.auditSnapshotChanges.push({
|
|
211
|
+
instanceId,
|
|
212
|
+
before: instance.state,
|
|
213
|
+
after: state,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
addError(`audit snapshot ${instanceId}`, error);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
void updatedAt;
|
|
222
|
+
return result;
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=workflow-persistence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-persistence.js","sourceRoot":"","sources":["../../src/workflow-persistence.ts"],"names":[],"mappings":";;AAoIA,kFA8GC;AAOD,oFAkFC;AAtUD,mDAAyF;AACzF,+DAQ+B;AA6D/B,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,YAAY,CAAC,KAA4B;IAChD,OAAO,KAA8B,CAAC;AACxC,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IAC3F,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,KAAgC,CAAC;QAChD,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,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QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;gBACrC,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC;oBAC/B,UAAU;oBACV,MAAM,EAAE,QAAQ,CAAC,KAAK;oBACtB,KAAK,EAAE,KAAK;iBACb,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,QAAQ,CAAC,kBAAkB,UAAU,EAAE,EAAE,KAAK,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IAED,KAAK,SAAS,CAAC;IACf,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"properties": {
|
|
57
57
|
"type": {
|
|
58
58
|
"type": "string",
|
|
59
|
-
"enum": ["agent_task", "skill_task", "shell_task", "parallel", "join", "branch", "approval", "expression", "end"]
|
|
59
|
+
"enum": ["agent_task", "skill_task", "shell_task", "parallel", "join", "branch", "approval", "expression", "end", "error"]
|
|
60
60
|
},
|
|
61
61
|
"agent": {
|
|
62
62
|
"type": "string"
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
},
|
|
82
82
|
"cwd": {
|
|
83
83
|
"type": "string",
|
|
84
|
-
"description": "skill_task/shell_task: working directory, normalized and constrained under the project root."
|
|
84
|
+
"description": "agent_task/skill_task/shell_task: working directory, normalized and constrained under the project root."
|
|
85
85
|
},
|
|
86
86
|
"env": {
|
|
87
87
|
"type": "object",
|
|
@@ -90,6 +90,10 @@
|
|
|
90
90
|
},
|
|
91
91
|
"description": "shell_task: explicit env pass-through. Dangerous keys (LD_PRELOAD, etc.) are rejected."
|
|
92
92
|
},
|
|
93
|
+
"stdin": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"description": "skill_task/shell_task: optional stdin payload. Supports {{template}} interpolation."
|
|
96
|
+
},
|
|
93
97
|
"mode": {
|
|
94
98
|
"type": "string",
|
|
95
99
|
"enum": ["query", "execute"]
|
|
@@ -109,6 +113,10 @@
|
|
|
109
113
|
"retry": {
|
|
110
114
|
"$ref": "#/definitions/RetryConfig"
|
|
111
115
|
},
|
|
116
|
+
"fail_when": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"description": "Task nodes: semantic failure judgment. Safe expression evaluated against state after the node's output is stored (e.g. 'state.verify_result.status !== \"pass\"'). Truthy → node fails and the run halts."
|
|
119
|
+
},
|
|
112
120
|
"condition": {
|
|
113
121
|
"type": "string"
|
|
114
122
|
},
|
|
@@ -158,6 +166,10 @@
|
|
|
158
166
|
"comment": {
|
|
159
167
|
"type": "string"
|
|
160
168
|
},
|
|
169
|
+
"message": {
|
|
170
|
+
"type": "string",
|
|
171
|
+
"description": "error: failure message recorded in run.error. Supports {{template}} interpolation."
|
|
172
|
+
},
|
|
161
173
|
"on_approve": {
|
|
162
174
|
"type": "string"
|
|
163
175
|
},
|
|
@@ -210,19 +222,36 @@
|
|
|
210
222
|
"required": ["max", "delay"],
|
|
211
223
|
"properties": {
|
|
212
224
|
"max": {
|
|
213
|
-
"type": "
|
|
225
|
+
"type": "integer",
|
|
226
|
+
"minimum": 0,
|
|
227
|
+
"maximum": 10,
|
|
228
|
+
"description": "Number of additional retries after the first attempt (0 disables retry)."
|
|
214
229
|
},
|
|
215
230
|
"delay": {
|
|
216
231
|
"type": "string",
|
|
217
232
|
"enum": ["exponential", "fixed"]
|
|
218
233
|
},
|
|
219
234
|
"max_delay": {
|
|
220
|
-
"type": "
|
|
235
|
+
"type": "integer",
|
|
236
|
+
"minimum": 0,
|
|
237
|
+
"description": "Maximum retry delay in milliseconds; runtime hard-caps this at 60000."
|
|
221
238
|
},
|
|
222
239
|
"on": {
|
|
223
240
|
"type": "array",
|
|
224
241
|
"items": {
|
|
225
|
-
"type": "string"
|
|
242
|
+
"type": "string",
|
|
243
|
+
"enum": [
|
|
244
|
+
"CLI_UNRESOLVABLE",
|
|
245
|
+
"SPAWN_FAILED",
|
|
246
|
+
"NODE_TIMEOUT",
|
|
247
|
+
"NODE_EXIT_NONZERO",
|
|
248
|
+
"OUTPUT_INVALID",
|
|
249
|
+
"RATE_LIMITED",
|
|
250
|
+
"CONFIG_INVALID",
|
|
251
|
+
"INTERRUPTED",
|
|
252
|
+
"CANCELLED",
|
|
253
|
+
"UNKNOWN"
|
|
254
|
+
]
|
|
226
255
|
}
|
|
227
256
|
}
|
|
228
257
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crewx/workflow",
|
|
3
|
-
"version": "0.3.22-rc.
|
|
3
|
+
"version": "0.3.22-rc.150",
|
|
4
4
|
"description": "Workflow engine for CrewX - list, show, validate workflows with Mermaid visualization",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/src/engine.js",
|
|
7
7
|
"types": "dist/src/engine.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
"*": {
|
|
10
|
+
"run-manager": [
|
|
11
|
+
"dist/src/run-manager.d.ts"
|
|
12
|
+
],
|
|
13
|
+
"types": [
|
|
14
|
+
"dist/src/types.d.ts"
|
|
15
|
+
],
|
|
16
|
+
"list": [
|
|
17
|
+
"dist/src/list-view.d.ts"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
8
21
|
"exports": {
|
|
9
22
|
".": {
|
|
10
23
|
"types": "./dist/src/engine.d.ts",
|
|
@@ -28,6 +41,12 @@
|
|
|
28
41
|
"import": "./dist/cli.js",
|
|
29
42
|
"require": "./dist/cli.js",
|
|
30
43
|
"default": "./dist/cli.js"
|
|
44
|
+
},
|
|
45
|
+
"./list": {
|
|
46
|
+
"types": "./dist/src/list-view.d.ts",
|
|
47
|
+
"import": "./dist/src/list-view.js",
|
|
48
|
+
"require": "./dist/src/list-view.js",
|
|
49
|
+
"default": "./dist/src/list-view.js"
|
|
31
50
|
}
|
|
32
51
|
},
|
|
33
52
|
"bin": {
|
|
@@ -48,9 +67,9 @@
|
|
|
48
67
|
"dependencies": {
|
|
49
68
|
"@hyperjump/json-schema": "^1.9.4",
|
|
50
69
|
"js-yaml": "^4.1.0",
|
|
51
|
-
"@crewx/knowledge-core": "0.1.17",
|
|
52
|
-
"@crewx/
|
|
53
|
-
"@crewx/
|
|
70
|
+
"@crewx/knowledge-core": "0.1.17-rc.114",
|
|
71
|
+
"@crewx/sdk": "0.9.0-rc.104",
|
|
72
|
+
"@crewx/shared": "0.0.6"
|
|
54
73
|
},
|
|
55
74
|
"devDependencies": {
|
|
56
75
|
"@types/js-yaml": "^4.0.9",
|
package/workflow-schema.json
CHANGED
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"properties": {
|
|
57
57
|
"type": {
|
|
58
58
|
"type": "string",
|
|
59
|
-
"enum": ["agent_task", "skill_task", "shell_task", "parallel", "join", "branch", "approval", "expression", "end"]
|
|
59
|
+
"enum": ["agent_task", "skill_task", "shell_task", "parallel", "join", "branch", "approval", "expression", "end", "error"]
|
|
60
60
|
},
|
|
61
61
|
"agent": {
|
|
62
62
|
"type": "string"
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
},
|
|
82
82
|
"cwd": {
|
|
83
83
|
"type": "string",
|
|
84
|
-
"description": "skill_task/shell_task: working directory, normalized and constrained under the project root."
|
|
84
|
+
"description": "agent_task/skill_task/shell_task: working directory, normalized and constrained under the project root."
|
|
85
85
|
},
|
|
86
86
|
"env": {
|
|
87
87
|
"type": "object",
|
|
@@ -90,6 +90,10 @@
|
|
|
90
90
|
},
|
|
91
91
|
"description": "shell_task: explicit env pass-through. Dangerous keys (LD_PRELOAD, etc.) are rejected."
|
|
92
92
|
},
|
|
93
|
+
"stdin": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"description": "skill_task/shell_task: optional stdin payload. Supports {{template}} interpolation."
|
|
96
|
+
},
|
|
93
97
|
"mode": {
|
|
94
98
|
"type": "string",
|
|
95
99
|
"enum": ["query", "execute"]
|
|
@@ -109,6 +113,10 @@
|
|
|
109
113
|
"retry": {
|
|
110
114
|
"$ref": "#/definitions/RetryConfig"
|
|
111
115
|
},
|
|
116
|
+
"fail_when": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"description": "Task nodes: semantic failure judgment. Safe expression evaluated against state after the node's output is stored (e.g. 'state.verify_result.status !== \"pass\"'). Truthy → node fails and the run halts."
|
|
119
|
+
},
|
|
112
120
|
"condition": {
|
|
113
121
|
"type": "string"
|
|
114
122
|
},
|
|
@@ -158,6 +166,10 @@
|
|
|
158
166
|
"comment": {
|
|
159
167
|
"type": "string"
|
|
160
168
|
},
|
|
169
|
+
"message": {
|
|
170
|
+
"type": "string",
|
|
171
|
+
"description": "error: failure message recorded in run.error. Supports {{template}} interpolation."
|
|
172
|
+
},
|
|
161
173
|
"on_approve": {
|
|
162
174
|
"type": "string"
|
|
163
175
|
},
|
|
@@ -210,19 +222,36 @@
|
|
|
210
222
|
"required": ["max", "delay"],
|
|
211
223
|
"properties": {
|
|
212
224
|
"max": {
|
|
213
|
-
"type": "
|
|
225
|
+
"type": "integer",
|
|
226
|
+
"minimum": 0,
|
|
227
|
+
"maximum": 10,
|
|
228
|
+
"description": "Number of additional retries after the first attempt (0 disables retry)."
|
|
214
229
|
},
|
|
215
230
|
"delay": {
|
|
216
231
|
"type": "string",
|
|
217
232
|
"enum": ["exponential", "fixed"]
|
|
218
233
|
},
|
|
219
234
|
"max_delay": {
|
|
220
|
-
"type": "
|
|
235
|
+
"type": "integer",
|
|
236
|
+
"minimum": 0,
|
|
237
|
+
"description": "Maximum retry delay in milliseconds; runtime hard-caps this at 60000."
|
|
221
238
|
},
|
|
222
239
|
"on": {
|
|
223
240
|
"type": "array",
|
|
224
241
|
"items": {
|
|
225
|
-
"type": "string"
|
|
242
|
+
"type": "string",
|
|
243
|
+
"enum": [
|
|
244
|
+
"CLI_UNRESOLVABLE",
|
|
245
|
+
"SPAWN_FAILED",
|
|
246
|
+
"NODE_TIMEOUT",
|
|
247
|
+
"NODE_EXIT_NONZERO",
|
|
248
|
+
"OUTPUT_INVALID",
|
|
249
|
+
"RATE_LIMITED",
|
|
250
|
+
"CONFIG_INVALID",
|
|
251
|
+
"INTERRUPTED",
|
|
252
|
+
"CANCELLED",
|
|
253
|
+
"UNKNOWN"
|
|
254
|
+
]
|
|
226
255
|
}
|
|
227
256
|
}
|
|
228
257
|
}
|