@orbytautomation/engine 0.1.2 → 0.2.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/dist/core/EngineConfig.d.ts +5 -0
- package/dist/core/EngineConfig.d.ts.map +1 -1
- package/dist/core/EngineConfig.js +4 -0
- package/dist/core/EngineConfig.js.map +1 -1
- package/dist/core/OrbytEngine.d.ts +207 -76
- package/dist/core/OrbytEngine.d.ts.map +1 -1
- package/dist/core/OrbytEngine.js +395 -63
- package/dist/core/OrbytEngine.js.map +1 -1
- package/dist/errors/SecurityErrors.d.ts +75 -0
- package/dist/errors/SecurityErrors.d.ts.map +1 -0
- package/dist/errors/SecurityErrors.js +145 -0
- package/dist/errors/SecurityErrors.js.map +1 -0
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +1 -0
- package/dist/errors/index.js.map +1 -1
- package/dist/execution/ExecutionLimits.d.ts +116 -0
- package/dist/execution/ExecutionLimits.d.ts.map +1 -0
- package/dist/execution/ExecutionLimits.js +280 -0
- package/dist/execution/ExecutionLimits.js.map +1 -0
- package/dist/execution/ExecutionStrategyResolver.d.ts +140 -0
- package/dist/execution/ExecutionStrategyResolver.d.ts.map +1 -0
- package/dist/execution/ExecutionStrategyResolver.js +332 -0
- package/dist/execution/ExecutionStrategyResolver.js.map +1 -0
- package/dist/execution/IntentAnalyzer.d.ts +101 -0
- package/dist/execution/IntentAnalyzer.d.ts.map +1 -0
- package/dist/execution/IntentAnalyzer.js +348 -0
- package/dist/execution/IntentAnalyzer.js.map +1 -0
- package/dist/execution/InternalExecutionContext.d.ts +255 -0
- package/dist/execution/InternalExecutionContext.d.ts.map +1 -0
- package/dist/execution/InternalExecutionContext.js +175 -0
- package/dist/execution/InternalExecutionContext.js.map +1 -0
- package/dist/execution/index.d.ts +5 -0
- package/dist/execution/index.d.ts.map +1 -1
- package/dist/execution/index.js +6 -0
- package/dist/execution/index.js.map +1 -1
- package/dist/index.d.ts +5 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/loader/WorkflowLoader.d.ts +154 -0
- package/dist/loader/WorkflowLoader.d.ts.map +1 -0
- package/dist/loader/WorkflowLoader.js +239 -0
- package/dist/loader/WorkflowLoader.js.map +1 -0
- package/dist/loader/index.d.ts +10 -0
- package/dist/loader/index.d.ts.map +1 -0
- package/dist/loader/index.js +10 -0
- package/dist/loader/index.js.map +1 -0
- package/dist/parser/SchemaValidator.d.ts.map +1 -1
- package/dist/parser/SchemaValidator.js +14 -2
- package/dist/parser/SchemaValidator.js.map +1 -1
- package/dist/parser/WorkflowParser.d.ts +8 -0
- package/dist/parser/WorkflowParser.d.ts.map +1 -1
- package/dist/parser/WorkflowParser.js +6 -0
- package/dist/parser/WorkflowParser.js.map +1 -1
- package/dist/security/ReservedFields.d.ts +64 -0
- package/dist/security/ReservedFields.d.ts.map +1 -0
- package/dist/security/ReservedFields.js +253 -0
- package/dist/security/ReservedFields.js.map +1 -0
- package/dist/security/index.d.ts +1 -0
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +1 -0
- package/dist/security/index.js.map +1 -1
- package/dist/types/core-types.d.ts +59 -0
- package/dist/types/core-types.d.ts.map +1 -0
- package/dist/types/core-types.js +2 -0
- package/dist/types/core-types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExecutionLimits.js","sourceRoot":"","sources":["../../src/execution/ExecutionLimits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAoDH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAe;IAC1C,gBAAgB,EAAE,CAAC;IACnB,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,YAAY;IAC3C,kBAAkB,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,aAAa;IACjD,cAAc,EAAE,CA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AAC;IAED,kBAAkB;IAClB,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;QAClC,oBAAoB;QACpB,IAAI,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;YAChE,QAAQ,CAAC,IAAI,CACX,SAAS,IAAI,CAAC,EAAE,cAAc,IAAI,CAAC,KAAK,CAAC,GAAG,gCAAgC,MAAM,CAAC,gBAAgB,EAAE,CACtG,CAAC;QACJ,CAAC;QAED,gBAAgB;QAChB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAChD,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC;gBACtC,QAAQ,CAAC,IAAI,CACX,SAAS,IAAI,CAAC,EAAE,gCAAgC,MAAM,CAAC,cAAc,IAAI,CAC1E,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;QAC1B,MAAM;QACN,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execution Strategy Resolver
|
|
3
|
+
*
|
|
4
|
+
* Intelligence layer that decides HOW to run workflows safely.
|
|
5
|
+
*
|
|
6
|
+
* This layer can adjust execution strategy based on:
|
|
7
|
+
* - System load
|
|
8
|
+
* - Resource availability
|
|
9
|
+
* - Workflow intent
|
|
10
|
+
* - Adapter capabilities
|
|
11
|
+
* - Past execution patterns
|
|
12
|
+
*
|
|
13
|
+
* Foundation: Currently returns default strategy.
|
|
14
|
+
* Future: Can implement load-aware, intent-aware execution.
|
|
15
|
+
*/
|
|
16
|
+
import type { ParsedWorkflow } from '../parser/WorkflowParser.js';
|
|
17
|
+
/**
|
|
18
|
+
* Execution strategy types
|
|
19
|
+
*/
|
|
20
|
+
export type ExecutionStrategy = 'default' | 'sequential' | 'aggressive' | 'conservative' | 'fast-fail' | 'resilient';
|
|
21
|
+
/**
|
|
22
|
+
* Execution context for strategy resolution
|
|
23
|
+
*/
|
|
24
|
+
export interface ExecutionStrategyContext {
|
|
25
|
+
/** Parsed workflow */
|
|
26
|
+
workflow: ParsedWorkflow;
|
|
27
|
+
/** System metrics (future) */
|
|
28
|
+
systemLoad?: {
|
|
29
|
+
cpu: number;
|
|
30
|
+
memory: number;
|
|
31
|
+
activeWorkflows: number;
|
|
32
|
+
};
|
|
33
|
+
/** Workflow intent (from annotations) */
|
|
34
|
+
intent?: string;
|
|
35
|
+
/** Resource limits */
|
|
36
|
+
resourceLimits?: {
|
|
37
|
+
maxConcurrentSteps: number;
|
|
38
|
+
maxMemory: number;
|
|
39
|
+
timeout: number;
|
|
40
|
+
};
|
|
41
|
+
/** Historical data (future) */
|
|
42
|
+
history?: {
|
|
43
|
+
previousExecutions: number;
|
|
44
|
+
averageSuccessRate: number;
|
|
45
|
+
commonFailures: string[];
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Strategy resolution result
|
|
50
|
+
*/
|
|
51
|
+
export interface ResolvedExecutionStrategy {
|
|
52
|
+
/** Selected strategy */
|
|
53
|
+
strategy: ExecutionStrategy;
|
|
54
|
+
/** Strategy-specific adjustments */
|
|
55
|
+
adjustments: {
|
|
56
|
+
/** Concurrency limit */
|
|
57
|
+
maxConcurrentSteps?: number;
|
|
58
|
+
/** Timeout multiplier */
|
|
59
|
+
timeoutMultiplier?: number;
|
|
60
|
+
/** Retry strategy override */
|
|
61
|
+
retryStrategy?: 'exponential' | 'linear' | 'constant';
|
|
62
|
+
/** Max retry attempts */
|
|
63
|
+
maxRetries?: number;
|
|
64
|
+
/** Enable caching */
|
|
65
|
+
enableCaching?: boolean;
|
|
66
|
+
};
|
|
67
|
+
/** Reason for strategy selection (for observability) */
|
|
68
|
+
reason: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Execution Strategy Resolver
|
|
72
|
+
*
|
|
73
|
+
* Hook point for intelligent execution decisions.
|
|
74
|
+
* Currently returns default strategy - foundation for future intelligence.
|
|
75
|
+
*/
|
|
76
|
+
export declare class ExecutionStrategyResolver {
|
|
77
|
+
/**
|
|
78
|
+
* Resolve execution strategy for a workflow
|
|
79
|
+
*
|
|
80
|
+
* Foundation implementation: Returns default strategy with basic intelligence
|
|
81
|
+
* Future: Can analyze context and make advanced intelligent decisions
|
|
82
|
+
*/
|
|
83
|
+
static resolve(context: ExecutionStrategyContext): ResolvedExecutionStrategy;
|
|
84
|
+
/**
|
|
85
|
+
* Resolve strategy for high system load
|
|
86
|
+
* Analyzes system load and workflow complexity to determine safe execution strategy
|
|
87
|
+
*/
|
|
88
|
+
private static resolveForHighLoad;
|
|
89
|
+
/**
|
|
90
|
+
* Resolve strategy for data pipeline intent
|
|
91
|
+
* Optimizes for data reliability and throughput
|
|
92
|
+
*/
|
|
93
|
+
private static resolveForDataPipeline;
|
|
94
|
+
/**
|
|
95
|
+
* Resolve strategy for unreliable workflows
|
|
96
|
+
* Analyzes historical failures to maximize success rate
|
|
97
|
+
*/
|
|
98
|
+
private static resolveForUnreliableWorkflow;
|
|
99
|
+
/**
|
|
100
|
+
* Check if workflow should run in safe mode
|
|
101
|
+
* Foundation: Detects basic risky patterns
|
|
102
|
+
* Future: Can analyze workflow for more complex risky patterns
|
|
103
|
+
*/
|
|
104
|
+
static requiresSafeMode(workflow: ParsedWorkflow): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Estimate workflow resource requirements
|
|
107
|
+
* Foundation: Basic analysis based on step types and count
|
|
108
|
+
* Future: Can help with scheduling and resource allocation
|
|
109
|
+
*/
|
|
110
|
+
static estimateResourceRequirements(workflow: ParsedWorkflow): {
|
|
111
|
+
cpu: 'low' | 'medium' | 'high';
|
|
112
|
+
memory: 'low' | 'medium' | 'high';
|
|
113
|
+
network: 'low' | 'medium' | 'high';
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Execution Strategy Guard
|
|
118
|
+
*
|
|
119
|
+
* Safety checks before execution starts.
|
|
120
|
+
* Can prevent execution if conditions are unsafe.
|
|
121
|
+
*/
|
|
122
|
+
export declare class ExecutionStrategyGuard {
|
|
123
|
+
/**
|
|
124
|
+
* Check if it's safe to execute workflow
|
|
125
|
+
*
|
|
126
|
+
* Foundation: Basic safety checks
|
|
127
|
+
* Future: Can check resource availability, system health, etc.
|
|
128
|
+
*/
|
|
129
|
+
static isSafeToExecute(context: ExecutionStrategyContext): {
|
|
130
|
+
safe: boolean;
|
|
131
|
+
reason?: string;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Recommend delay before execution
|
|
135
|
+
* Foundation: Basic delay based on system load
|
|
136
|
+
* Future: Can suggest waiting during high load
|
|
137
|
+
*/
|
|
138
|
+
static recommendedDelay(context: ExecutionStrategyContext): number;
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=ExecutionStrategyResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExecutionStrategyResolver.d.ts","sourceRoot":"","sources":["../../src/execution/ExecutionStrategyResolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACvB,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,cAAc,GACd,WAAW,GACX,WAAW,CAAC;AAElB;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,sBAAsB;IACtB,QAAQ,EAAE,cAAc,CAAC;IAEzB,8BAA8B;IAC9B,UAAU,CAAC,EAAE;QACT,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,eAAe,EAAE,MAA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AM,CAAC,4BAA4B,CAAC,QAAQ,EAAE,cAAc,GAAG;QAC3D,GAAG,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;QAC/B,MAAM,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;QAClC,OAAO,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;KACtC;CAuCJ;AAED;;;;;GAKG;AACH,qBAAa,sBAAsB;IAC/B;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,wBAAwB,GAAG;QACvD,IAAI,EAAE,OAAO,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;KACnB;IA6CD;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,wBAAwB,GAAG,MAAM;CAoBrE"}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execution Strategy Resolver
|
|
3
|
+
*
|
|
4
|
+
* Intelligence layer that decides HOW to run workflows safely.
|
|
5
|
+
*
|
|
6
|
+
* This layer can adjust execution strategy based on:
|
|
7
|
+
* - System load
|
|
8
|
+
* - Resource availability
|
|
9
|
+
* - Workflow intent
|
|
10
|
+
* - Adapter capabilities
|
|
11
|
+
* - Past execution patterns
|
|
12
|
+
*
|
|
13
|
+
* Foundation: Currently returns default strategy.
|
|
14
|
+
* Future: Can implement load-aware, intent-aware execution.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Execution Strategy Resolver
|
|
18
|
+
*
|
|
19
|
+
* Hook point for intelligent execution decisions.
|
|
20
|
+
* Currently returns default strategy - foundation for future intelligence.
|
|
21
|
+
*/
|
|
22
|
+
export class ExecutionStrategyResolver {
|
|
23
|
+
/**
|
|
24
|
+
* Resolve execution strategy for a workflow
|
|
25
|
+
*
|
|
26
|
+
* Foundation implementation: Returns default strategy with basic intelligence
|
|
27
|
+
* Future: Can analyze context and make advanced intelligent decisions
|
|
28
|
+
*/
|
|
29
|
+
static resolve(context) {
|
|
30
|
+
// 1. Check system load (if provided)
|
|
31
|
+
if (context.systemLoad?.cpu && context.systemLoad.cpu > 0.8) {
|
|
32
|
+
return this.resolveForHighLoad(context);
|
|
33
|
+
}
|
|
34
|
+
// 2. Check workflow intent
|
|
35
|
+
if (context.intent === 'data-pipeline') {
|
|
36
|
+
return this.resolveForDataPipeline(context);
|
|
37
|
+
}
|
|
38
|
+
// 3. Check historical patterns (if provided)
|
|
39
|
+
if (context.history?.averageSuccessRate && context.history.averageSuccessRate < 0.5) {
|
|
40
|
+
return this.resolveForUnreliableWorkflow(context);
|
|
41
|
+
}
|
|
42
|
+
// 4. Check resource limits
|
|
43
|
+
if (context.resourceLimits?.maxConcurrentSteps === 1) {
|
|
44
|
+
return {
|
|
45
|
+
strategy: 'sequential',
|
|
46
|
+
adjustments: {
|
|
47
|
+
maxConcurrentSteps: 1,
|
|
48
|
+
},
|
|
49
|
+
reason: 'Sequential execution enforced by resource limits',
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
// 5. Check if workflow requires safe mode
|
|
53
|
+
if (this.requiresSafeMode(context.workflow)) {
|
|
54
|
+
return {
|
|
55
|
+
strategy: 'conservative',
|
|
56
|
+
adjustments: {
|
|
57
|
+
maxRetries: 3,
|
|
58
|
+
retryStrategy: 'exponential',
|
|
59
|
+
timeoutMultiplier: 1.5,
|
|
60
|
+
},
|
|
61
|
+
reason: 'Safe mode recommended for workflow pattern',
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
// Default: Normal execution strategy
|
|
65
|
+
return {
|
|
66
|
+
strategy: 'default',
|
|
67
|
+
adjustments: {},
|
|
68
|
+
reason: 'Default execution strategy (no special conditions detected)',
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Resolve strategy for high system load
|
|
73
|
+
* Analyzes system load and workflow complexity to determine safe execution strategy
|
|
74
|
+
*/
|
|
75
|
+
static resolveForHighLoad(context) {
|
|
76
|
+
const load = context.systemLoad;
|
|
77
|
+
const stepCount = context.workflow.steps.length;
|
|
78
|
+
// Determine concurrency based on CPU load
|
|
79
|
+
let maxConcurrentSteps = 2;
|
|
80
|
+
if (load.cpu > 0.9) {
|
|
81
|
+
maxConcurrentSteps = 1; // Force sequential for very high load
|
|
82
|
+
}
|
|
83
|
+
else if (load.cpu > 0.85) {
|
|
84
|
+
maxConcurrentSteps = 2;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
maxConcurrentSteps = 3;
|
|
88
|
+
}
|
|
89
|
+
// Adjust timeout based on load and workflow size
|
|
90
|
+
let timeoutMultiplier = 1.5;
|
|
91
|
+
if (load.memory > 0.85 || stepCount > 20) {
|
|
92
|
+
timeoutMultiplier = 2.0; // More generous timeout under stress
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
strategy: load.cpu > 0.9 ? 'sequential' : 'conservative',
|
|
96
|
+
adjustments: {
|
|
97
|
+
maxConcurrentSteps,
|
|
98
|
+
timeoutMultiplier,
|
|
99
|
+
retryStrategy: 'exponential',
|
|
100
|
+
maxRetries: 2, // Fewer retries under high load
|
|
101
|
+
},
|
|
102
|
+
reason: `High system load detected (CPU: ${Math.round(load.cpu * 100)}%, Memory: ${Math.round(load.memory * 100)}%, Active: ${load.activeWorkflows})`,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Resolve strategy for data pipeline intent
|
|
107
|
+
* Optimizes for data reliability and throughput
|
|
108
|
+
*/
|
|
109
|
+
static resolveForDataPipeline(context) {
|
|
110
|
+
const stepCount = context.workflow.steps.length;
|
|
111
|
+
const resourceLimits = context.resourceLimits;
|
|
112
|
+
// Data pipelines benefit from retries and caching
|
|
113
|
+
let maxRetries = 5;
|
|
114
|
+
let maxConcurrentSteps;
|
|
115
|
+
// For large pipelines, limit concurrency to avoid overwhelming sources
|
|
116
|
+
if (stepCount > 30) {
|
|
117
|
+
maxConcurrentSteps = resourceLimits?.maxConcurrentSteps
|
|
118
|
+
? Math.min(resourceLimits.maxConcurrentSteps, 5)
|
|
119
|
+
: 5;
|
|
120
|
+
}
|
|
121
|
+
else if (stepCount > 15) {
|
|
122
|
+
maxConcurrentSteps = resourceLimits?.maxConcurrentSteps
|
|
123
|
+
? Math.min(resourceLimits.maxConcurrentSteps, 10)
|
|
124
|
+
: 10;
|
|
125
|
+
}
|
|
126
|
+
// If historical data shows reliability issues, increase retries
|
|
127
|
+
if (context.history?.averageSuccessRate && context.history.averageSuccessRate < 0.8) {
|
|
128
|
+
maxRetries = 7;
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
strategy: 'resilient',
|
|
132
|
+
adjustments: {
|
|
133
|
+
maxRetries,
|
|
134
|
+
retryStrategy: 'exponential',
|
|
135
|
+
enableCaching: true,
|
|
136
|
+
maxConcurrentSteps,
|
|
137
|
+
timeoutMultiplier: 1.5, // Data operations may take longer
|
|
138
|
+
},
|
|
139
|
+
reason: `Data pipeline optimization (${stepCount} steps, resilient execution)`,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Resolve strategy for unreliable workflows
|
|
144
|
+
* Analyzes historical failures to maximize success rate
|
|
145
|
+
*/
|
|
146
|
+
static resolveForUnreliableWorkflow(context) {
|
|
147
|
+
const history = context.history;
|
|
148
|
+
const successRate = history.averageSuccessRate;
|
|
149
|
+
// Adjust retries based on historical success rate
|
|
150
|
+
let maxRetries = 3;
|
|
151
|
+
let timeoutMultiplier = 2.0;
|
|
152
|
+
if (successRate < 0.3) {
|
|
153
|
+
// Very unreliable - maximum safety measures
|
|
154
|
+
maxRetries = 5;
|
|
155
|
+
timeoutMultiplier = 3.0;
|
|
156
|
+
}
|
|
157
|
+
else if (successRate < 0.5) {
|
|
158
|
+
// Moderately unreliable - increased retries
|
|
159
|
+
maxRetries = 4;
|
|
160
|
+
timeoutMultiplier = 2.5;
|
|
161
|
+
}
|
|
162
|
+
// Reduce concurrency for unreliable workflows to avoid cascading failures
|
|
163
|
+
let maxConcurrentSteps = 3;
|
|
164
|
+
if (successRate < 0.4) {
|
|
165
|
+
maxConcurrentSteps = 1; // Sequential for very unreliable
|
|
166
|
+
}
|
|
167
|
+
else if (successRate < 0.6) {
|
|
168
|
+
maxConcurrentSteps = 2;
|
|
169
|
+
}
|
|
170
|
+
// Analyze common failures to provide specific recommendations
|
|
171
|
+
const failureDetails = history.commonFailures?.length > 0
|
|
172
|
+
? ` (common failures: ${history.commonFailures.slice(0, 2).join(', ')})`
|
|
173
|
+
: '';
|
|
174
|
+
return {
|
|
175
|
+
strategy: successRate < 0.4 ? 'sequential' : 'conservative',
|
|
176
|
+
adjustments: {
|
|
177
|
+
maxRetries,
|
|
178
|
+
timeoutMultiplier,
|
|
179
|
+
retryStrategy: 'exponential',
|
|
180
|
+
maxConcurrentSteps,
|
|
181
|
+
},
|
|
182
|
+
reason: `Low historical success rate (${Math.round(successRate * 100)}% over ${history.previousExecutions} runs)${failureDetails}`,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Check if workflow should run in safe mode
|
|
187
|
+
* Foundation: Detects basic risky patterns
|
|
188
|
+
* Future: Can analyze workflow for more complex risky patterns
|
|
189
|
+
*/
|
|
190
|
+
static requiresSafeMode(workflow) {
|
|
191
|
+
// Check for high step count (complex workflows are riskier)
|
|
192
|
+
if (workflow.steps.length > 20) {
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
// Check if workflow has no retry configured at all
|
|
196
|
+
const hasRetryConfig = workflow.steps.some(step => step.retry !== undefined);
|
|
197
|
+
const hasDefaultRetry = workflow.defaults?.retry !== undefined;
|
|
198
|
+
if (!hasRetryConfig && !hasDefaultRetry && workflow.steps.length > 5) {
|
|
199
|
+
// Complex workflow without retry - recommend safe mode
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
// Check for multiple external dependencies (network operations)
|
|
203
|
+
const externalAdapters = ['http', 'webhook', 'api', 'rest'];
|
|
204
|
+
const externalStepCount = workflow.steps.filter(step => externalAdapters.includes(step.adapter)).length;
|
|
205
|
+
if (externalStepCount > 5) {
|
|
206
|
+
// Many external dependencies - recommend safe mode
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Estimate workflow resource requirements
|
|
213
|
+
* Foundation: Basic analysis based on step types and count
|
|
214
|
+
* Future: Can help with scheduling and resource allocation
|
|
215
|
+
*/
|
|
216
|
+
static estimateResourceRequirements(workflow) {
|
|
217
|
+
const stepCount = workflow.steps.length;
|
|
218
|
+
// Analyze adapter types
|
|
219
|
+
const adapters = workflow.steps.map(s => s.adapter);
|
|
220
|
+
const cpuIntensiveAdapters = ['cli', 'shell', 'exec', 'script'];
|
|
221
|
+
const networkAdapters = ['http', 'webhook', 'api', 'rest', 'graphql'];
|
|
222
|
+
const memoryIntensiveAdapters = ['fs', 'file', 'data', 'transform'];
|
|
223
|
+
const cpuIntensiveCount = adapters.filter(a => cpuIntensiveAdapters.includes(a)).length;
|
|
224
|
+
const networkCount = adapters.filter(a => networkAdapters.includes(a)).length;
|
|
225
|
+
const memoryIntensiveCount = adapters.filter(a => memoryIntensiveAdapters.includes(a)).length;
|
|
226
|
+
// Estimate CPU usage
|
|
227
|
+
let cpu = 'low';
|
|
228
|
+
if (cpuIntensiveCount > 5 || stepCount > 30) {
|
|
229
|
+
cpu = 'high';
|
|
230
|
+
}
|
|
231
|
+
else if (cpuIntensiveCount > 2 || stepCount > 10) {
|
|
232
|
+
cpu = 'medium';
|
|
233
|
+
}
|
|
234
|
+
// Estimate memory usage
|
|
235
|
+
let memory = 'low';
|
|
236
|
+
if (memoryIntensiveCount > 5 || stepCount > 30) {
|
|
237
|
+
memory = 'high';
|
|
238
|
+
}
|
|
239
|
+
else if (memoryIntensiveCount > 2 || stepCount > 10) {
|
|
240
|
+
memory = 'medium';
|
|
241
|
+
}
|
|
242
|
+
// Estimate network usage
|
|
243
|
+
let network = 'low';
|
|
244
|
+
if (networkCount > 10) {
|
|
245
|
+
network = 'high';
|
|
246
|
+
}
|
|
247
|
+
else if (networkCount > 3) {
|
|
248
|
+
network = 'medium';
|
|
249
|
+
}
|
|
250
|
+
return { cpu, memory, network };
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Execution Strategy Guard
|
|
255
|
+
*
|
|
256
|
+
* Safety checks before execution starts.
|
|
257
|
+
* Can prevent execution if conditions are unsafe.
|
|
258
|
+
*/
|
|
259
|
+
export class ExecutionStrategyGuard {
|
|
260
|
+
/**
|
|
261
|
+
* Check if it's safe to execute workflow
|
|
262
|
+
*
|
|
263
|
+
* Foundation: Basic safety checks
|
|
264
|
+
* Future: Can check resource availability, system health, etc.
|
|
265
|
+
*/
|
|
266
|
+
static isSafeToExecute(context) {
|
|
267
|
+
// Check if system load is too high
|
|
268
|
+
if (context.systemLoad) {
|
|
269
|
+
if (context.systemLoad.cpu > 0.95) {
|
|
270
|
+
return {
|
|
271
|
+
safe: false,
|
|
272
|
+
reason: 'System CPU usage is critically high (>95%)',
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
if (context.systemLoad.memory > 0.95) {
|
|
276
|
+
return {
|
|
277
|
+
safe: false,
|
|
278
|
+
reason: 'System memory usage is critically high (>95%)',
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
if (context.systemLoad.activeWorkflows > 100) {
|
|
282
|
+
return {
|
|
283
|
+
safe: false,
|
|
284
|
+
reason: 'Too many active workflows (>100)',
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
// Check resource requirements vs limits
|
|
289
|
+
const requirements = ExecutionStrategyResolver.estimateResourceRequirements(context.workflow);
|
|
290
|
+
if (requirements.cpu === 'high' && context.systemLoad?.cpu && context.systemLoad.cpu > 0.7) {
|
|
291
|
+
return {
|
|
292
|
+
safe: false,
|
|
293
|
+
reason: 'High CPU requirement with current system load',
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
// Check workflow complexity
|
|
297
|
+
if (context.workflow.steps.length > 100) {
|
|
298
|
+
return {
|
|
299
|
+
safe: false,
|
|
300
|
+
reason: 'Workflow exceeds maximum recommended step count (100)',
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
return {
|
|
304
|
+
safe: true,
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Recommend delay before execution
|
|
309
|
+
* Foundation: Basic delay based on system load
|
|
310
|
+
* Future: Can suggest waiting during high load
|
|
311
|
+
*/
|
|
312
|
+
static recommendedDelay(context) {
|
|
313
|
+
// Check system load and recommend delay if high
|
|
314
|
+
if (context.systemLoad) {
|
|
315
|
+
// If CPU is high but not critical, suggest short delay
|
|
316
|
+
if (context.systemLoad.cpu > 0.8 && context.systemLoad.cpu <= 0.95) {
|
|
317
|
+
return 5000; // 5 second delay
|
|
318
|
+
}
|
|
319
|
+
// If memory is high, suggest delay
|
|
320
|
+
if (context.systemLoad.memory > 0.8 && context.systemLoad.memory <= 0.95) {
|
|
321
|
+
return 3000; // 3 second delay
|
|
322
|
+
}
|
|
323
|
+
// If many active workflows, suggest delay
|
|
324
|
+
if (context.systemLoad.activeWorkflows > 50) {
|
|
325
|
+
return 2000; // 2 second delay
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
// No delay needed
|
|
329
|
+
return 0;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
//# sourceMappingURL=ExecutionStrategyResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExecutionStrategyResolver.js","sourceRoot":"","sources":["../../src/execution/ExecutionStrategyResolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA4EH;;;;;GAKG;AACH,MAAM,OAAO,yBAAyB;IAClC;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CAAC,OAAiC;QAC5C,qCAAqC;QACrC,IA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DAAgD;QAChD,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACrB,uDAAuD;YACvD,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;gBACjE,OAAO,IAAI,CAAC,CAAC,iBAAiB;YAClC,CAAC;YACD,mCAAmC;YACnC,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;gBACvE,OAAO,IAAI,CAAC,CAAC,iBAAiB;YAClC,CAAC;YACD,0CAA0C;YAC1C,IAAI,OAAO,CAAC,UAAU,CAAC,eAAe,GAAG,EAAE,EAAE,CAAC;gBAC1C,OAAO,IAAI,CAAC,CAAC,iBAAiB;YAClC,CAAC;QACL,CAAC;QAED,kBAAkB;QAClB,OAAO,CAAC,CAAC;IACb,CAAC;CACJ"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intent Layer
|
|
3
|
+
*
|
|
4
|
+
* Intelligence layer that understands WHAT the workflow is trying to do.
|
|
5
|
+
*
|
|
6
|
+
* This layer analyzes workflow structure, metadata, and annotations to:
|
|
7
|
+
* - Classify workflow intent
|
|
8
|
+
* - Provide better errors
|
|
9
|
+
* - Enable optimization
|
|
10
|
+
* - Generate smart explanations
|
|
11
|
+
*
|
|
12
|
+
* Foundation: Basic intent detection from annotations.
|
|
13
|
+
* Future: Pattern recognition, ML-based classification.
|
|
14
|
+
*/
|
|
15
|
+
import type { ParsedWorkflow } from '../parser/WorkflowParser.js';
|
|
16
|
+
/**
|
|
17
|
+
* Known workflow intents
|
|
18
|
+
*/
|
|
19
|
+
export type WorkflowIntent = 'data-pipeline' | 'deployment' | 'testing' | 'monitoring' | 'notification' | 'integration' | 'automation' | 'orchestration' | 'unknown';
|
|
20
|
+
/**
|
|
21
|
+
* Intent classification confidence
|
|
22
|
+
*/
|
|
23
|
+
export type IntentConfidence = 'high' | 'medium' | 'low';
|
|
24
|
+
/**
|
|
25
|
+
* Intent classification result
|
|
26
|
+
*/
|
|
27
|
+
export interface ClassifiedIntent {
|
|
28
|
+
/** Primary intent */
|
|
29
|
+
intent: WorkflowIntent;
|
|
30
|
+
/** Classification confidence */
|
|
31
|
+
confidence: IntentConfidence;
|
|
32
|
+
/** Secondary intents (if any) */
|
|
33
|
+
secondaryIntents?: WorkflowIntent[];
|
|
34
|
+
/** Reasoning (for debugging) */
|
|
35
|
+
reasoning: string;
|
|
36
|
+
/** Detected patterns */
|
|
37
|
+
patterns: string[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Intent-based recommendations
|
|
41
|
+
*/
|
|
42
|
+
export interface IntentRecommendations {
|
|
43
|
+
/** Suggested adapters */
|
|
44
|
+
suggestedAdapters?: string[];
|
|
45
|
+
/** Optimization hints */
|
|
46
|
+
optimizations?: string[];
|
|
47
|
+
/** Common pitfalls to avoid */
|
|
48
|
+
warnings?: string[];
|
|
49
|
+
/** Best practices */
|
|
50
|
+
bestPractices?: string[];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Intent Layer Analyzer
|
|
54
|
+
*
|
|
55
|
+
* Understands what workflows are trying to do.
|
|
56
|
+
* Foundation for intelligent behavior.
|
|
57
|
+
*/
|
|
58
|
+
export declare class IntentAnalyzer {
|
|
59
|
+
/**
|
|
60
|
+
* Classify workflow intent
|
|
61
|
+
*
|
|
62
|
+
* Foundation: Checks annotations and basic patterns
|
|
63
|
+
* Future: ML-based classification, pattern recognition
|
|
64
|
+
*/
|
|
65
|
+
static classify(workflow: ParsedWorkflow): ClassifiedIntent;
|
|
66
|
+
/**
|
|
67
|
+
* Check for explicit intent annotation
|
|
68
|
+
*/
|
|
69
|
+
private static checkExplicitIntent;
|
|
70
|
+
/**
|
|
71
|
+
* Analyze workflow structure for intent
|
|
72
|
+
*/
|
|
73
|
+
private static analyzeStructure;
|
|
74
|
+
/**
|
|
75
|
+
* Analyze step patterns for intent
|
|
76
|
+
*/
|
|
77
|
+
private static analyzeStepPatterns;
|
|
78
|
+
/**
|
|
79
|
+
* Get recommendations based on intent
|
|
80
|
+
*/
|
|
81
|
+
static getRecommendations(intent: WorkflowIntent): IntentRecommendations;
|
|
82
|
+
/**
|
|
83
|
+
* Generate human-friendly explanation of workflow
|
|
84
|
+
*/
|
|
85
|
+
static explain(workflow: ParsedWorkflow): string;
|
|
86
|
+
private static isKnownIntent;
|
|
87
|
+
private static containsKeywords;
|
|
88
|
+
private static hasPattern;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Intent-based error messages
|
|
92
|
+
*
|
|
93
|
+
* Provides context-aware error messages based on workflow intent
|
|
94
|
+
*/
|
|
95
|
+
export declare class IntentAwareErrors {
|
|
96
|
+
/**
|
|
97
|
+
* Get intent-aware error message
|
|
98
|
+
*/
|
|
99
|
+
static getMessage(intent: WorkflowIntent, error: string, context?: Record<string, any>): string;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=IntentAnalyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntentAnalyzer.d.ts","sourceRoot":"","sources":["../../src/execution/IntentAnalyzer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,cAAc,GACpB,eAAe,GACf,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,cAAc,GACd,aAAa,GACb,YAAY,GACZ,eAAe,GACf,SAAS,CAAC;AAEhB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,qBAAqB;IACrB,MAAM,EAAE,cAAc,CAAC;IAEvB,gCAAgC;IAChC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