@emmvish/stable-request 1.5.3 → 1.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 +1296 -204
- package/dist/core/stable-workflow.d.ts.map +1 -1
- package/dist/core/stable-workflow.js +95 -3
- package/dist/core/stable-workflow.js.map +1 -1
- package/dist/enums/index.d.ts +7 -0
- package/dist/enums/index.d.ts.map +1 -1
- package/dist/enums/index.js +8 -0
- package/dist/enums/index.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +126 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utilities/execute-branch-workflow.d.ts +3 -0
- package/dist/utilities/execute-branch-workflow.d.ts.map +1 -0
- package/dist/utilities/execute-branch-workflow.js +276 -0
- package/dist/utilities/execute-branch-workflow.js.map +1 -0
- package/dist/utilities/execute-non-linear-workflow.d.ts +3 -0
- package/dist/utilities/execute-non-linear-workflow.d.ts.map +1 -0
- package/dist/utilities/execute-non-linear-workflow.js +399 -0
- package/dist/utilities/execute-non-linear-workflow.js.map +1 -0
- package/dist/utilities/execute-phase.d.ts +2 -12
- package/dist/utilities/execute-phase.d.ts.map +1 -1
- package/dist/utilities/execute-phase.js.map +1 -1
- package/dist/utilities/index.d.ts +2 -0
- package/dist/utilities/index.d.ts.map +1 -1
- package/dist/utilities/index.js +2 -0
- package/dist/utilities/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { executeNonLinearWorkflow } from './execute-non-linear-workflow.js';
|
|
2
|
+
import { safelyExecuteUnknownFunction } from './safely-execute-unknown-function.js';
|
|
3
|
+
import { PHASE_DECISION_ACTIONS } from '../enums/index.js';
|
|
4
|
+
export async function executeBranchWorkflow(context) {
|
|
5
|
+
const { branches, workflowId, commonGatewayOptions, requestGroups, logPhaseResults, handlePhaseCompletion, handlePhaseError = () => { }, handleBranchCompletion, maxSerializableChars, workflowHookParams, sharedBuffer, stopOnFirstPhaseError, maxWorkflowIterations } = context;
|
|
6
|
+
const branchResults = [];
|
|
7
|
+
const allPhaseResults = [];
|
|
8
|
+
const executionHistory = [];
|
|
9
|
+
let totalRequests = 0;
|
|
10
|
+
let successfulRequests = 0;
|
|
11
|
+
let failedRequests = 0;
|
|
12
|
+
let terminatedEarly = false;
|
|
13
|
+
let terminationReason;
|
|
14
|
+
const parallelBranches = [];
|
|
15
|
+
const serialBranches = [];
|
|
16
|
+
branches.forEach(branch => {
|
|
17
|
+
if (branch.executeInParallel) {
|
|
18
|
+
parallelBranches.push(branch);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
serialBranches.push(branch);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
if (parallelBranches.length > 0) {
|
|
25
|
+
if (logPhaseResults) {
|
|
26
|
+
console.info(`\nstable-request: [Workflow: ${workflowId}] Executing ${parallelBranches.length} branches in parallel: [${parallelBranches.map(b => b.id).join(', ')}]`);
|
|
27
|
+
}
|
|
28
|
+
const parallelPromises = parallelBranches.map(async (branch) => {
|
|
29
|
+
const branchStartTime = Date.now();
|
|
30
|
+
try {
|
|
31
|
+
const result = await executeNonLinearWorkflow({
|
|
32
|
+
phases: branch.phases,
|
|
33
|
+
workflowId: `${workflowId}-branch-${branch.id}`,
|
|
34
|
+
commonGatewayOptions,
|
|
35
|
+
requestGroups,
|
|
36
|
+
logPhaseResults,
|
|
37
|
+
handlePhaseCompletion,
|
|
38
|
+
handlePhaseError,
|
|
39
|
+
handlePhaseDecision: workflowHookParams?.handlePhaseDecision,
|
|
40
|
+
maxSerializableChars,
|
|
41
|
+
workflowHookParams,
|
|
42
|
+
sharedBuffer,
|
|
43
|
+
stopOnFirstPhaseError,
|
|
44
|
+
maxWorkflowIterations
|
|
45
|
+
});
|
|
46
|
+
const branchExecutionTime = Date.now() - branchStartTime;
|
|
47
|
+
const branchResult = {
|
|
48
|
+
branchId: branch.id,
|
|
49
|
+
success: result.failedRequests === 0,
|
|
50
|
+
executionTime: branchExecutionTime,
|
|
51
|
+
completedPhases: result.phaseResults.length,
|
|
52
|
+
phaseResults: result.phaseResults
|
|
53
|
+
};
|
|
54
|
+
if (branch.branchDecisionHook) {
|
|
55
|
+
try {
|
|
56
|
+
const decision = await safelyExecuteUnknownFunction(branch.branchDecisionHook, {
|
|
57
|
+
workflowId,
|
|
58
|
+
branchResults: result.phaseResults,
|
|
59
|
+
branchId: branch.id,
|
|
60
|
+
executionHistory: result.executionHistory,
|
|
61
|
+
sharedBuffer,
|
|
62
|
+
params: workflowHookParams?.handleBranchDecisionParams
|
|
63
|
+
});
|
|
64
|
+
branchResult.decision = decision;
|
|
65
|
+
if (decision.action === PHASE_DECISION_ACTIONS.TERMINATE) {
|
|
66
|
+
terminatedEarly = true;
|
|
67
|
+
terminationReason = decision.metadata?.reason || `Branch ${branch.id} terminated workflow`;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch (decisionError) {
|
|
71
|
+
console.error(`stable-request: [Workflow: ${workflowId}] Error in branch decision hook for ${branch.id}:`, decisionError);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
branchResult,
|
|
76
|
+
phaseResults: result.phaseResults,
|
|
77
|
+
executionHistory: result.executionHistory,
|
|
78
|
+
totalRequests: result.totalRequests,
|
|
79
|
+
successfulRequests: result.successfulRequests,
|
|
80
|
+
failedRequests: result.failedRequests
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
console.error(`stable-request: [Workflow: ${workflowId}] Branch ${branch.id} failed:`, error);
|
|
85
|
+
return {
|
|
86
|
+
branchResult: {
|
|
87
|
+
branchId: branch.id,
|
|
88
|
+
success: false,
|
|
89
|
+
executionTime: Date.now() - branchStartTime,
|
|
90
|
+
completedPhases: 0,
|
|
91
|
+
phaseResults: []
|
|
92
|
+
},
|
|
93
|
+
phaseResults: [],
|
|
94
|
+
executionHistory: [],
|
|
95
|
+
totalRequests: 0,
|
|
96
|
+
successfulRequests: 0,
|
|
97
|
+
failedRequests: 1
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
const parallelResults = await Promise.all(parallelPromises);
|
|
102
|
+
for (const result of parallelResults) {
|
|
103
|
+
branchResults.push(result.branchResult);
|
|
104
|
+
allPhaseResults.push(...result.phaseResults);
|
|
105
|
+
executionHistory.push(...result.executionHistory);
|
|
106
|
+
totalRequests += result.totalRequests;
|
|
107
|
+
successfulRequests += result.successfulRequests;
|
|
108
|
+
failedRequests += result.failedRequests;
|
|
109
|
+
if (handleBranchCompletion) {
|
|
110
|
+
try {
|
|
111
|
+
await safelyExecuteUnknownFunction(handleBranchCompletion, {
|
|
112
|
+
branchId: result.branchResult.branchId,
|
|
113
|
+
branchResults: result.branchResult.phaseResults,
|
|
114
|
+
success: result.branchResult.success
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
catch (hookError) {
|
|
118
|
+
console.error(`stable-request: [Workflow: ${workflowId}] Error in handleBranchCompletion hook:`, hookError);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (terminatedEarly) {
|
|
123
|
+
return {
|
|
124
|
+
branchResults,
|
|
125
|
+
allPhaseResults,
|
|
126
|
+
executionHistory,
|
|
127
|
+
totalRequests,
|
|
128
|
+
successfulRequests,
|
|
129
|
+
failedRequests,
|
|
130
|
+
terminatedEarly,
|
|
131
|
+
terminationReason
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
let branchIndex = 0;
|
|
136
|
+
while (branchIndex < serialBranches.length) {
|
|
137
|
+
const branch = serialBranches[branchIndex];
|
|
138
|
+
if (logPhaseResults) {
|
|
139
|
+
console.info(`\nstable-request: [Workflow: ${workflowId}] Executing branch: ${branch.id}`);
|
|
140
|
+
}
|
|
141
|
+
const branchStartTime = Date.now();
|
|
142
|
+
try {
|
|
143
|
+
const result = await executeNonLinearWorkflow({
|
|
144
|
+
phases: branch.phases,
|
|
145
|
+
workflowId: `${workflowId}-branch-${branch.id}`,
|
|
146
|
+
commonGatewayOptions,
|
|
147
|
+
requestGroups,
|
|
148
|
+
logPhaseResults,
|
|
149
|
+
handlePhaseCompletion,
|
|
150
|
+
handlePhaseError,
|
|
151
|
+
handlePhaseDecision: workflowHookParams?.handlePhaseDecision,
|
|
152
|
+
maxSerializableChars,
|
|
153
|
+
workflowHookParams,
|
|
154
|
+
sharedBuffer,
|
|
155
|
+
stopOnFirstPhaseError,
|
|
156
|
+
maxWorkflowIterations
|
|
157
|
+
});
|
|
158
|
+
const branchExecutionTime = Date.now() - branchStartTime;
|
|
159
|
+
const branchResult = {
|
|
160
|
+
branchId: branch.id,
|
|
161
|
+
success: result.failedRequests === 0,
|
|
162
|
+
executionTime: branchExecutionTime,
|
|
163
|
+
completedPhases: result.phaseResults.length,
|
|
164
|
+
phaseResults: result.phaseResults
|
|
165
|
+
};
|
|
166
|
+
let shouldJump = false;
|
|
167
|
+
let jumpTargetIndex = -1;
|
|
168
|
+
if (branch.branchDecisionHook) {
|
|
169
|
+
try {
|
|
170
|
+
const decision = await safelyExecuteUnknownFunction(branch.branchDecisionHook, {
|
|
171
|
+
workflowId,
|
|
172
|
+
branchResults: result.phaseResults,
|
|
173
|
+
branchId: branch.id,
|
|
174
|
+
executionHistory: result.executionHistory,
|
|
175
|
+
sharedBuffer,
|
|
176
|
+
params: workflowHookParams?.handleBranchDecisionParams,
|
|
177
|
+
parallelBranchResults: branchResults
|
|
178
|
+
.filter(br => parallelBranches.some(pb => pb.id === br.branchId))
|
|
179
|
+
.map(br => br.phaseResults)
|
|
180
|
+
});
|
|
181
|
+
branchResult.decision = decision;
|
|
182
|
+
if (decision.action === PHASE_DECISION_ACTIONS.TERMINATE) {
|
|
183
|
+
terminatedEarly = true;
|
|
184
|
+
terminationReason = decision.metadata?.reason || `Branch ${branch.id} terminated workflow`;
|
|
185
|
+
branchResults.push(branchResult);
|
|
186
|
+
allPhaseResults.push(...result.phaseResults);
|
|
187
|
+
executionHistory.push(...result.executionHistory);
|
|
188
|
+
totalRequests += result.totalRequests;
|
|
189
|
+
successfulRequests += result.successfulRequests;
|
|
190
|
+
failedRequests += result.failedRequests;
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
if (decision.action === PHASE_DECISION_ACTIONS.JUMP && decision.targetBranchId) {
|
|
194
|
+
const targetBranchIndex = serialBranches.findIndex(b => b.id === decision.targetBranchId);
|
|
195
|
+
if (targetBranchIndex !== -1 && targetBranchIndex > branchIndex) {
|
|
196
|
+
if (logPhaseResults) {
|
|
197
|
+
console.info(`stable-request: [Workflow: ${workflowId}] Jumping from branch ${branch.id} to ${decision.targetBranchId}`);
|
|
198
|
+
}
|
|
199
|
+
shouldJump = true;
|
|
200
|
+
jumpTargetIndex = targetBranchIndex;
|
|
201
|
+
}
|
|
202
|
+
else if (targetBranchIndex === -1) {
|
|
203
|
+
console.warn(`stable-request: [Workflow: ${workflowId}] Target branch ${decision.targetBranchId} not found`);
|
|
204
|
+
}
|
|
205
|
+
else if (targetBranchIndex <= branchIndex) {
|
|
206
|
+
console.warn(`stable-request: [Workflow: ${workflowId}] Cannot jump backwards to ${decision.targetBranchId}`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
catch (decisionError) {
|
|
211
|
+
console.error(`stable-request: [Workflow: ${workflowId}] Error in branch decision hook for ${branch.id}:`, decisionError);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
branchResults.push(branchResult);
|
|
215
|
+
allPhaseResults.push(...result.phaseResults);
|
|
216
|
+
executionHistory.push(...result.executionHistory);
|
|
217
|
+
totalRequests += result.totalRequests;
|
|
218
|
+
successfulRequests += result.successfulRequests;
|
|
219
|
+
failedRequests += result.failedRequests;
|
|
220
|
+
if (handleBranchCompletion) {
|
|
221
|
+
try {
|
|
222
|
+
await safelyExecuteUnknownFunction(handleBranchCompletion, {
|
|
223
|
+
branchId: branchResult.branchId,
|
|
224
|
+
branchResults: branchResult.phaseResults,
|
|
225
|
+
success: branchResult.success
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
catch (hookError) {
|
|
229
|
+
console.error(`stable-request: [Workflow: ${workflowId}] Error in handleBranchCompletion hook:`, hookError);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (shouldJump) {
|
|
233
|
+
// Jump to target branch (skip intermediate branches)
|
|
234
|
+
branchIndex = jumpTargetIndex;
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
if (stopOnFirstPhaseError && result.failedRequests > 0) {
|
|
238
|
+
if (logPhaseResults) {
|
|
239
|
+
console.error(`stable-request: [Workflow: ${workflowId}] Branch ${branch.id} has failures. Stopping workflow.`);
|
|
240
|
+
}
|
|
241
|
+
terminatedEarly = true;
|
|
242
|
+
terminationReason = `Branch ${branch.id} failed`;
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
console.error(`stable-request: [Workflow: ${workflowId}] Branch ${branch.id} failed:`, error);
|
|
248
|
+
const branchResult = {
|
|
249
|
+
branchId: branch.id,
|
|
250
|
+
success: false,
|
|
251
|
+
executionTime: Date.now() - branchStartTime,
|
|
252
|
+
completedPhases: 0,
|
|
253
|
+
phaseResults: []
|
|
254
|
+
};
|
|
255
|
+
branchResults.push(branchResult);
|
|
256
|
+
failedRequests += 1;
|
|
257
|
+
if (stopOnFirstPhaseError) {
|
|
258
|
+
terminatedEarly = true;
|
|
259
|
+
terminationReason = `Branch ${branch.id} failed with error`;
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
branchIndex++;
|
|
264
|
+
}
|
|
265
|
+
return {
|
|
266
|
+
branchResults,
|
|
267
|
+
allPhaseResults,
|
|
268
|
+
executionHistory,
|
|
269
|
+
totalRequests,
|
|
270
|
+
successfulRequests,
|
|
271
|
+
failedRequests,
|
|
272
|
+
terminatedEarly,
|
|
273
|
+
terminationReason
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
//# sourceMappingURL=execute-branch-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-branch-workflow.js","sourceRoot":"","sources":["../../src/utilities/execute-branch-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAW3D,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,OAAiE;IAEjE,MAAM,EACJ,QAAQ,EACR,UAAU,EACV,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,gBAAgB,GAAG,GAAG,EAAE,GAAE,CAAC,EAC3B,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACtB,GAAG,OAAO,CAAC;IAEZ,MAAM,aAAa,GAA8C,EAAE,CAAC;IACpE,MAAM,eAAe,GAAqD,EAAE,CAAC;IAC7E,MAAM,gBAAgB,GAA2B,EAAE,CAAC;IAEpD,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,IAAI,kBAAkB,GAAG,CAAC,CAAC;IAC3B,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,IAAI,eAAe,GAAG,KAAK,CAAC;IAC5B,IAAI,iBAAqC,CAAC;IAE1C,MAAM,gBAAgB,GAAgE,EAAE,CAAC;IACzF,MAAM,cAAc,GAAgE,EAAE,CAAC;IAEvF,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACxB,IAAI,MAAM,CAAC,iBAAiB,EAAE,CAAC;YAC7B,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAA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AAY,CAAC,CAAC;YACjC,cAAc,IAAI,CAAC,CAAC;YAEpB,IAAI,qBAAqB,EAAE,CAAC;gBAC1B,eAAe,GAAG,IAAI,CAAC;gBACvB,iBAAiB,GAAG,UAAU,MAAM,CAAC,EAAE,oBAAoB,CAAC;gBAC5D,MAAM;YACR,CAAC;QACH,CAAC;QAED,WAAW,EAAE,CAAC;IAChB,CAAC;IAED,OAAO;QACL,aAAa;QACb,eAAe;QACf,gBAAgB;QAChB,aAAa;QACb,kBAAkB;QAClB,cAAc;QACd,eAAe;QACf,iBAAiB;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { EXECUTE_NON_LINEAR_WORKFLOW_RESPONSE, NonLinearWorkflowContext } from '../types/index.js';
|
|
2
|
+
export declare function executeNonLinearWorkflow<RequestDataType = any, ResponseDataType = any>(context: NonLinearWorkflowContext<RequestDataType, ResponseDataType>): Promise<EXECUTE_NON_LINEAR_WORKFLOW_RESPONSE<ResponseDataType>>;
|
|
3
|
+
//# sourceMappingURL=execute-non-linear-workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-non-linear-workflow.d.ts","sourceRoot":"","sources":["../../src/utilities/execute-non-linear-workflow.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oCAAoC,EACpC,wBAAwB,EAKzB,MAAM,mBAAmB,CAAC;AAE3B,wBAAsB,wBAAwB,CAAC,eAAe,GAAG,GAAG,EAAE,gBAAgB,GAAG,GAAG,EAC1F,OAAO,EAAE,wBAAwB,CAAC,eAAe,EAAE,gBAAgB,CAAC,GACnE,OAAO,CAAC,oCAAoC,CAAC,gBAAgB,CAAC,CAAC,CA6hBjE"}
|