@marktoflow/cli 2.0.0-alpha.3
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/commands/debug.d.ts +75 -0
- package/dist/commands/debug.d.ts.map +1 -0
- package/dist/commands/debug.js +375 -0
- package/dist/commands/debug.js.map +1 -0
- package/dist/commands/dry-run.d.ts +40 -0
- package/dist/commands/dry-run.d.ts.map +1 -0
- package/dist/commands/dry-run.js +360 -0
- package/dist/commands/dry-run.js.map +1 -0
- package/dist/commands/new.d.ts +14 -0
- package/dist/commands/new.d.ts.map +1 -0
- package/dist/commands/new.js +483 -0
- package/dist/commands/new.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +726 -0
- package/dist/index.js.map +1 -0
- package/dist/oauth.d.ts +48 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +314 -0
- package/dist/oauth.js.map +1 -0
- package/dist/trigger.d.ts +3 -0
- package/dist/trigger.d.ts.map +1 -0
- package/dist/trigger.js +58 -0
- package/dist/trigger.js.map +1 -0
- package/dist/worker.d.ts +3 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +69 -0
- package/dist/worker.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive debugging command for marktoflow workflows
|
|
3
|
+
*
|
|
4
|
+
* Features:
|
|
5
|
+
* - Breakpoints on specific steps
|
|
6
|
+
* - Step-through execution (next, continue, skip)
|
|
7
|
+
* - Variable inspection and modification
|
|
8
|
+
* - Replay failed steps
|
|
9
|
+
*/
|
|
10
|
+
import { Workflow, WorkflowStep, ExecutionContext, StepResult } from '@marktoflow/core';
|
|
11
|
+
export interface SDKRegistryLike {
|
|
12
|
+
load(sdkName: string): Promise<unknown>;
|
|
13
|
+
has(sdkName: string): boolean;
|
|
14
|
+
}
|
|
15
|
+
export type DebugAction = 'next' | 'continue' | 'skip' | 'inspect' | 'modify' | 'breakpoint' | 'quit';
|
|
16
|
+
export interface DebuggerState {
|
|
17
|
+
currentStepIndex: number;
|
|
18
|
+
breakpoints: Set<string>;
|
|
19
|
+
isPaused: boolean;
|
|
20
|
+
stepResults: StepResult[];
|
|
21
|
+
context: ExecutionContext;
|
|
22
|
+
}
|
|
23
|
+
export interface DebugOptions {
|
|
24
|
+
breakpoints?: string[];
|
|
25
|
+
verbose?: boolean;
|
|
26
|
+
autoStart?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare class WorkflowDebugger {
|
|
29
|
+
private state;
|
|
30
|
+
private workflow;
|
|
31
|
+
private sdkRegistry;
|
|
32
|
+
private stepExecutor;
|
|
33
|
+
constructor(workflow: Workflow, inputs: Record<string, unknown>, sdkRegistry: SDKRegistryLike, stepExecutor: (step: WorkflowStep, context: ExecutionContext, registry: SDKRegistryLike) => Promise<unknown>, options?: DebugOptions);
|
|
34
|
+
/**
|
|
35
|
+
* Start interactive debugging session
|
|
36
|
+
*/
|
|
37
|
+
debug(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Execute a single step
|
|
40
|
+
*/
|
|
41
|
+
private executeStep;
|
|
42
|
+
/**
|
|
43
|
+
* Prompt user for next action
|
|
44
|
+
*/
|
|
45
|
+
private promptAction;
|
|
46
|
+
/**
|
|
47
|
+
* Display current debugger state
|
|
48
|
+
*/
|
|
49
|
+
private displayState;
|
|
50
|
+
/**
|
|
51
|
+
* Display current step details
|
|
52
|
+
*/
|
|
53
|
+
private displayStep;
|
|
54
|
+
/**
|
|
55
|
+
* Inspect current variables
|
|
56
|
+
*/
|
|
57
|
+
private inspectVariables;
|
|
58
|
+
/**
|
|
59
|
+
* Modify input variables
|
|
60
|
+
*/
|
|
61
|
+
private modifyVariables;
|
|
62
|
+
/**
|
|
63
|
+
* Manage breakpoints
|
|
64
|
+
*/
|
|
65
|
+
private manageBreakpoints;
|
|
66
|
+
/**
|
|
67
|
+
* Display final summary
|
|
68
|
+
*/
|
|
69
|
+
private displaySummary;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Parse breakpoint specification
|
|
73
|
+
*/
|
|
74
|
+
export declare function parseBreakpoints(breakpointSpec: string[]): string[];
|
|
75
|
+
//# sourceMappingURL=debug.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/commands/debug.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,UAAU,EAKX,MAAM,kBAAkB,CAAC;AAG1B,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B;AAMD,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,UAAU,GACV,MAAM,GACN,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,MAAM,CAAC;AAEX,MAAM,WAAW,aAAa;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAMD,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,YAAY,CAIE;gBAGpB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,WAAW,EAAE,eAAe,EAC5B,YAAY,EAAE,CACZ,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,eAAe,KACtB,OAAO,CAAC,OAAO,CAAC,EACrB,OAAO,GAAE,YAAiB;IAe5B;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAmF5B;;OAEG;YACW,WAAW;IA+EzB;;OAEG;YACW,YAAY;IAiB1B;;OAEG;IACH,OAAO,CAAC,YAAY;IAYpB;;OAEG;IACH,OAAO,CAAC,WAAW;IAkBnB;;OAEG;YACW,gBAAgB;IAyC9B;;OAEG;YACW,eAAe;IA8C7B;;OAEG;YACW,iBAAiB;IAuD/B;;OAEG;IACH,OAAO,CAAC,cAAc;CAoBvB;AAMD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAKnE"}
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive debugging command for marktoflow workflows
|
|
3
|
+
*
|
|
4
|
+
* Features:
|
|
5
|
+
* - Breakpoints on specific steps
|
|
6
|
+
* - Step-through execution (next, continue, skip)
|
|
7
|
+
* - Variable inspection and modification
|
|
8
|
+
* - Replay failed steps
|
|
9
|
+
*/
|
|
10
|
+
import { input, select } from '@inquirer/prompts';
|
|
11
|
+
import chalk from 'chalk';
|
|
12
|
+
import { StepStatus, WorkflowStatus, createExecutionContext, createStepResult, } from '@marktoflow/core';
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// Debugger Class
|
|
15
|
+
// ============================================================================
|
|
16
|
+
export class WorkflowDebugger {
|
|
17
|
+
state;
|
|
18
|
+
workflow;
|
|
19
|
+
sdkRegistry;
|
|
20
|
+
stepExecutor;
|
|
21
|
+
constructor(workflow, inputs, sdkRegistry, stepExecutor, options = {}) {
|
|
22
|
+
this.workflow = workflow;
|
|
23
|
+
this.sdkRegistry = sdkRegistry;
|
|
24
|
+
this.stepExecutor = stepExecutor;
|
|
25
|
+
this.state = {
|
|
26
|
+
currentStepIndex: 0,
|
|
27
|
+
breakpoints: new Set(options.breakpoints ?? []),
|
|
28
|
+
isPaused: true,
|
|
29
|
+
stepResults: [],
|
|
30
|
+
context: createExecutionContext(workflow, inputs),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Start interactive debugging session
|
|
35
|
+
*/
|
|
36
|
+
async debug() {
|
|
37
|
+
console.log(chalk.bold.cyan('\n🐛 Debug Mode\n'));
|
|
38
|
+
console.log(`Workflow: ${chalk.cyan(this.workflow.metadata.name)}`);
|
|
39
|
+
console.log(`Steps: ${this.workflow.steps.length}`);
|
|
40
|
+
console.log(`Breakpoints: ${this.state.breakpoints.size ? Array.from(this.state.breakpoints).join(', ') : 'none'}\n`);
|
|
41
|
+
// Show initial state
|
|
42
|
+
this.displayState();
|
|
43
|
+
while (this.state.currentStepIndex < this.workflow.steps.length) {
|
|
44
|
+
const currentStep = this.workflow.steps[this.state.currentStepIndex];
|
|
45
|
+
// Check if we should pause (breakpoint or manual pause)
|
|
46
|
+
const shouldPause = this.state.isPaused || this.state.breakpoints.has(currentStep.id);
|
|
47
|
+
if (shouldPause) {
|
|
48
|
+
console.log(chalk.yellow(`\n⏸ Paused at step ${this.state.currentStepIndex + 1}/${this.workflow.steps.length}`));
|
|
49
|
+
this.displayStep(currentStep);
|
|
50
|
+
// Get user action
|
|
51
|
+
const action = await this.promptAction();
|
|
52
|
+
switch (action) {
|
|
53
|
+
case 'next':
|
|
54
|
+
await this.executeStep(currentStep);
|
|
55
|
+
this.state.currentStepIndex++;
|
|
56
|
+
break;
|
|
57
|
+
case 'continue':
|
|
58
|
+
this.state.isPaused = false;
|
|
59
|
+
await this.executeStep(currentStep);
|
|
60
|
+
this.state.currentStepIndex++;
|
|
61
|
+
break;
|
|
62
|
+
case 'skip':
|
|
63
|
+
console.log(chalk.dim(`Skipped: ${currentStep.id}`));
|
|
64
|
+
const skipResult = createStepResult(currentStep.id, StepStatus.SKIPPED, undefined, new Date(), 0);
|
|
65
|
+
this.state.stepResults.push(skipResult);
|
|
66
|
+
this.state.currentStepIndex++;
|
|
67
|
+
break;
|
|
68
|
+
case 'inspect':
|
|
69
|
+
await this.inspectVariables();
|
|
70
|
+
// Don't advance step
|
|
71
|
+
break;
|
|
72
|
+
case 'modify':
|
|
73
|
+
await this.modifyVariables();
|
|
74
|
+
// Don't advance step
|
|
75
|
+
break;
|
|
76
|
+
case 'breakpoint':
|
|
77
|
+
await this.manageBreakpoints();
|
|
78
|
+
// Don't advance step
|
|
79
|
+
break;
|
|
80
|
+
case 'quit':
|
|
81
|
+
console.log(chalk.yellow('\n🛑 Debug session terminated by user'));
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
// Continue mode - execute without pausing
|
|
87
|
+
await this.executeStep(currentStep);
|
|
88
|
+
this.state.currentStepIndex++;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// Debug session complete
|
|
92
|
+
this.displaySummary();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Execute a single step
|
|
96
|
+
*/
|
|
97
|
+
async executeStep(step) {
|
|
98
|
+
const startTime = Date.now();
|
|
99
|
+
console.log(chalk.cyan(`\n▶ Executing: ${step.id}`));
|
|
100
|
+
try {
|
|
101
|
+
// Update context
|
|
102
|
+
this.state.context.currentStepIndex = this.state.currentStepIndex;
|
|
103
|
+
this.state.context.status = WorkflowStatus.RUNNING;
|
|
104
|
+
// Execute step
|
|
105
|
+
const output = await this.stepExecutor(step, this.state.context, this.sdkRegistry);
|
|
106
|
+
// Update variables
|
|
107
|
+
if (step.outputVariable) {
|
|
108
|
+
this.state.context.variables[step.outputVariable] = output;
|
|
109
|
+
}
|
|
110
|
+
// Create result
|
|
111
|
+
const stepStartedAt = new Date(startTime);
|
|
112
|
+
const result = createStepResult(step.id, StepStatus.COMPLETED, output, stepStartedAt, 0);
|
|
113
|
+
result.completedAt = new Date();
|
|
114
|
+
result.duration = Date.now() - startTime;
|
|
115
|
+
this.state.stepResults.push(result);
|
|
116
|
+
// Update step metadata
|
|
117
|
+
this.state.context.stepMetadata[step.id] = {
|
|
118
|
+
status: StepStatus.COMPLETED,
|
|
119
|
+
retryCount: 0,
|
|
120
|
+
};
|
|
121
|
+
console.log(chalk.green(`✓ ${step.id} completed in ${result.duration}ms`));
|
|
122
|
+
if (step.outputVariable) {
|
|
123
|
+
console.log(chalk.dim(` → ${step.outputVariable} = ${JSON.stringify(output, null, 2)}`));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
128
|
+
console.log(chalk.red(`✗ ${step.id} failed: ${errorMsg}`));
|
|
129
|
+
const failedStepStartedAt = new Date(startTime);
|
|
130
|
+
const result = createStepResult(step.id, StepStatus.FAILED, undefined, failedStepStartedAt, 0, errorMsg);
|
|
131
|
+
result.completedAt = new Date();
|
|
132
|
+
result.duration = Date.now() - startTime;
|
|
133
|
+
this.state.stepResults.push(result);
|
|
134
|
+
// Update step metadata
|
|
135
|
+
this.state.context.stepMetadata[step.id] = {
|
|
136
|
+
status: StepStatus.FAILED,
|
|
137
|
+
error: errorMsg,
|
|
138
|
+
retryCount: 0,
|
|
139
|
+
};
|
|
140
|
+
// Ask if user wants to retry, skip, or abort
|
|
141
|
+
const retryAction = await select({
|
|
142
|
+
message: 'Step failed. What would you like to do?',
|
|
143
|
+
choices: [
|
|
144
|
+
{ name: 'Retry this step', value: 'retry' },
|
|
145
|
+
{ name: 'Skip and continue', value: 'skip' },
|
|
146
|
+
{ name: 'Abort debugging', value: 'abort' },
|
|
147
|
+
],
|
|
148
|
+
});
|
|
149
|
+
if (retryAction === 'retry') {
|
|
150
|
+
// Retry - don't advance step index
|
|
151
|
+
this.state.currentStepIndex--;
|
|
152
|
+
}
|
|
153
|
+
else if (retryAction === 'abort') {
|
|
154
|
+
throw new Error('Debug session aborted due to step failure');
|
|
155
|
+
}
|
|
156
|
+
// Skip - step index will advance naturally
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Prompt user for next action
|
|
161
|
+
*/
|
|
162
|
+
async promptAction() {
|
|
163
|
+
const action = await select({
|
|
164
|
+
message: 'Debug action:',
|
|
165
|
+
choices: [
|
|
166
|
+
{ name: 'Next - Execute current step', value: 'next' },
|
|
167
|
+
{ name: 'Continue - Run until next breakpoint', value: 'continue' },
|
|
168
|
+
{ name: 'Skip - Skip current step', value: 'skip' },
|
|
169
|
+
{ name: 'Inspect - View variables', value: 'inspect' },
|
|
170
|
+
{ name: 'Modify - Change input variables', value: 'modify' },
|
|
171
|
+
{ name: 'Breakpoint - Manage breakpoints', value: 'breakpoint' },
|
|
172
|
+
{ name: 'Quit - Stop debugging', value: 'quit' },
|
|
173
|
+
],
|
|
174
|
+
});
|
|
175
|
+
return action;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Display current debugger state
|
|
179
|
+
*/
|
|
180
|
+
displayState() {
|
|
181
|
+
console.log(chalk.bold('Current State:'));
|
|
182
|
+
console.log(` Step: ${this.state.currentStepIndex + 1}/${this.workflow.steps.length}`);
|
|
183
|
+
console.log(` Variables: ${Object.keys(this.state.context.variables).length}`);
|
|
184
|
+
console.log(` Completed: ${this.state.stepResults.filter((r) => r.status === StepStatus.COMPLETED).length}`);
|
|
185
|
+
console.log(` Failed: ${this.state.stepResults.filter((r) => r.status === StepStatus.FAILED).length}`);
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Display current step details
|
|
189
|
+
*/
|
|
190
|
+
displayStep(step) {
|
|
191
|
+
console.log(chalk.bold('\nCurrent Step:'));
|
|
192
|
+
console.log(` ID: ${chalk.cyan(step.id)}`);
|
|
193
|
+
console.log(` Action: ${chalk.cyan(step.action)}`);
|
|
194
|
+
if (step.name) {
|
|
195
|
+
console.log(` Name: ${step.name}`);
|
|
196
|
+
}
|
|
197
|
+
if (Object.keys(step.inputs).length > 0) {
|
|
198
|
+
console.log(` Inputs: ${JSON.stringify(step.inputs, null, 2)}`);
|
|
199
|
+
}
|
|
200
|
+
if (step.outputVariable) {
|
|
201
|
+
console.log(` Output Variable: ${chalk.cyan(step.outputVariable)}`);
|
|
202
|
+
}
|
|
203
|
+
if (step.conditions && step.conditions.length > 0) {
|
|
204
|
+
console.log(` Conditions: ${step.conditions.join(' && ')}`);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Inspect current variables
|
|
209
|
+
*/
|
|
210
|
+
async inspectVariables() {
|
|
211
|
+
console.log(chalk.bold('\n📊 Variables:\n'));
|
|
212
|
+
console.log(chalk.bold('Inputs:'));
|
|
213
|
+
if (Object.keys(this.state.context.inputs).length === 0) {
|
|
214
|
+
console.log(chalk.dim(' (none)'));
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
for (const [key, value] of Object.entries(this.state.context.inputs)) {
|
|
218
|
+
console.log(` ${chalk.cyan(key)}: ${JSON.stringify(value, null, 2)}`);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
console.log(chalk.bold('\nVariables:'));
|
|
222
|
+
if (Object.keys(this.state.context.variables).length === 0) {
|
|
223
|
+
console.log(chalk.dim(' (none)'));
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
for (const [key, value] of Object.entries(this.state.context.variables)) {
|
|
227
|
+
console.log(` ${chalk.cyan(key)}: ${JSON.stringify(value, null, 2)}`);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
console.log(chalk.bold('\nStep Metadata:'));
|
|
231
|
+
if (Object.keys(this.state.context.stepMetadata).length === 0) {
|
|
232
|
+
console.log(chalk.dim(' (none)'));
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
for (const [stepId, metadata] of Object.entries(this.state.context.stepMetadata)) {
|
|
236
|
+
const statusColor = metadata.status === StepStatus.COMPLETED
|
|
237
|
+
? chalk.green
|
|
238
|
+
: metadata.status === StepStatus.FAILED
|
|
239
|
+
? chalk.red
|
|
240
|
+
: chalk.yellow;
|
|
241
|
+
console.log(` ${chalk.cyan(stepId)}: ${statusColor(metadata.status)}${metadata.error ? ` - ${metadata.error}` : ''}`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
await input({ message: '\nPress Enter to continue...' });
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Modify input variables
|
|
248
|
+
*/
|
|
249
|
+
async modifyVariables() {
|
|
250
|
+
console.log(chalk.bold('\n✏️ Modify Variables\n'));
|
|
251
|
+
const variableType = await select({
|
|
252
|
+
message: 'Which variable type to modify?',
|
|
253
|
+
choices: [
|
|
254
|
+
{ name: 'Input variables', value: 'inputs' },
|
|
255
|
+
{ name: 'Workflow variables', value: 'variables' },
|
|
256
|
+
{ name: 'Cancel', value: 'cancel' },
|
|
257
|
+
],
|
|
258
|
+
});
|
|
259
|
+
if (variableType === 'cancel')
|
|
260
|
+
return;
|
|
261
|
+
const targetObject = variableType === 'inputs' ? this.state.context.inputs : this.state.context.variables;
|
|
262
|
+
const keys = Object.keys(targetObject);
|
|
263
|
+
if (keys.length === 0) {
|
|
264
|
+
console.log(chalk.yellow('No variables to modify'));
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
const key = await select({
|
|
268
|
+
message: 'Select variable to modify:',
|
|
269
|
+
choices: keys.map((k) => ({
|
|
270
|
+
name: `${k} = ${JSON.stringify(targetObject[k])}`,
|
|
271
|
+
value: k,
|
|
272
|
+
})),
|
|
273
|
+
});
|
|
274
|
+
const currentValue = targetObject[key];
|
|
275
|
+
const newValue = await input({
|
|
276
|
+
message: `New value for ${key}:`,
|
|
277
|
+
default: JSON.stringify(currentValue),
|
|
278
|
+
});
|
|
279
|
+
try {
|
|
280
|
+
targetObject[key] = JSON.parse(newValue);
|
|
281
|
+
console.log(chalk.green(`✓ Updated ${key}`));
|
|
282
|
+
}
|
|
283
|
+
catch (error) {
|
|
284
|
+
console.log(chalk.red('Invalid JSON. Treating as string.'));
|
|
285
|
+
targetObject[key] = newValue;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Manage breakpoints
|
|
290
|
+
*/
|
|
291
|
+
async manageBreakpoints() {
|
|
292
|
+
console.log(chalk.bold('\n🔴 Manage Breakpoints\n'));
|
|
293
|
+
const action = await select({
|
|
294
|
+
message: 'Breakpoint action:',
|
|
295
|
+
choices: [
|
|
296
|
+
{ name: 'Add breakpoint', value: 'add' },
|
|
297
|
+
{ name: 'Remove breakpoint', value: 'remove' },
|
|
298
|
+
{ name: 'List breakpoints', value: 'list' },
|
|
299
|
+
{ name: 'Cancel', value: 'cancel' },
|
|
300
|
+
],
|
|
301
|
+
});
|
|
302
|
+
if (action === 'cancel')
|
|
303
|
+
return;
|
|
304
|
+
if (action === 'list') {
|
|
305
|
+
if (this.state.breakpoints.size === 0) {
|
|
306
|
+
console.log(chalk.yellow('No breakpoints set'));
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
console.log(chalk.bold('Breakpoints:'));
|
|
310
|
+
for (const bp of this.state.breakpoints) {
|
|
311
|
+
console.log(` • ${chalk.cyan(bp)}`);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
await input({ message: '\nPress Enter to continue...' });
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
if (action === 'add') {
|
|
318
|
+
const stepId = await select({
|
|
319
|
+
message: 'Add breakpoint at step:',
|
|
320
|
+
choices: this.workflow.steps.map((s) => ({
|
|
321
|
+
name: `${s.id} (${s.action})`,
|
|
322
|
+
value: s.id,
|
|
323
|
+
})),
|
|
324
|
+
});
|
|
325
|
+
this.state.breakpoints.add(stepId);
|
|
326
|
+
console.log(chalk.green(`✓ Breakpoint added at ${stepId}`));
|
|
327
|
+
}
|
|
328
|
+
else if (action === 'remove') {
|
|
329
|
+
if (this.state.breakpoints.size === 0) {
|
|
330
|
+
console.log(chalk.yellow('No breakpoints to remove'));
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
const stepId = await select({
|
|
334
|
+
message: 'Remove breakpoint:',
|
|
335
|
+
choices: Array.from(this.state.breakpoints).map((bp) => ({
|
|
336
|
+
name: bp,
|
|
337
|
+
value: bp,
|
|
338
|
+
})),
|
|
339
|
+
});
|
|
340
|
+
this.state.breakpoints.delete(stepId);
|
|
341
|
+
console.log(chalk.green(`✓ Breakpoint removed from ${stepId}`));
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Display final summary
|
|
346
|
+
*/
|
|
347
|
+
displaySummary() {
|
|
348
|
+
console.log(chalk.bold.green('\n✓ Debug session complete\n'));
|
|
349
|
+
const completed = this.state.stepResults.filter((r) => r.status === StepStatus.COMPLETED).length;
|
|
350
|
+
const failed = this.state.stepResults.filter((r) => r.status === StepStatus.FAILED).length;
|
|
351
|
+
const skipped = this.state.stepResults.filter((r) => r.status === StepStatus.SKIPPED).length;
|
|
352
|
+
console.log(chalk.bold('Summary:'));
|
|
353
|
+
console.log(` Total steps: ${this.workflow.steps.length}`);
|
|
354
|
+
console.log(` ${chalk.green('✓')} Completed: ${completed}`);
|
|
355
|
+
console.log(` ${chalk.red('✗')} Failed: ${failed}`);
|
|
356
|
+
console.log(` ${chalk.yellow('⊘')} Skipped: ${skipped}`);
|
|
357
|
+
console.log(chalk.bold('\nFinal Variables:'));
|
|
358
|
+
for (const [key, value] of Object.entries(this.state.context.variables)) {
|
|
359
|
+
console.log(` ${chalk.cyan(key)}: ${JSON.stringify(value)}`);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
// ============================================================================
|
|
364
|
+
// Helper Functions
|
|
365
|
+
// ============================================================================
|
|
366
|
+
/**
|
|
367
|
+
* Parse breakpoint specification
|
|
368
|
+
*/
|
|
369
|
+
export function parseBreakpoints(breakpointSpec) {
|
|
370
|
+
return breakpointSpec.flatMap((spec) => {
|
|
371
|
+
// Support comma-separated lists
|
|
372
|
+
return spec.split(',').map((s) => s.trim());
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
//# sourceMappingURL=debug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../src/commands/debug.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAKL,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAmC1B,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E,MAAM,OAAO,gBAAgB;IACnB,KAAK,CAAgB;IACrB,QAAQ,CAAW;IACnB,WAAW,CAAkB;IAC7B,YAAY,CAIE;IAEtB,YACE,QAAkB,EAClB,MAA+B,EAC/B,WAA4B,EAC5B,YAIqB,EACrB,UAAwB,EAAE;QAE1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QAEjC,IAAI,CAAC,KAAK,GAAG;YACX,gBAAgB,EAAE,CAAC;YACnB,WAAW,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC;YAC/C,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,EAAE;YACf,OAAO,EAAE,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC;SAClD,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI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,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;YACxE,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;CACF;AAED,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,cAAwB;IACvD,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrC,gCAAgC;QAChC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dry-run mode for workflows
|
|
3
|
+
*
|
|
4
|
+
* Simulates workflow execution without actually calling external services.
|
|
5
|
+
* Useful for testing workflow logic, validating steps, and debugging.
|
|
6
|
+
*/
|
|
7
|
+
import type { Workflow } from '@marktoflow/core';
|
|
8
|
+
/**
|
|
9
|
+
* Generate mock responses based on action type
|
|
10
|
+
*/
|
|
11
|
+
export declare function generateMockResponse(action: string, inputs: Record<string, unknown>): unknown;
|
|
12
|
+
export interface DryRunOptions {
|
|
13
|
+
verbose?: boolean;
|
|
14
|
+
showMockData?: boolean;
|
|
15
|
+
showVariables?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface DryRunStepResult {
|
|
18
|
+
stepId: string;
|
|
19
|
+
action: string;
|
|
20
|
+
status: 'completed' | 'skipped' | 'would-fail';
|
|
21
|
+
mockOutput: unknown;
|
|
22
|
+
resolvedInputs: Record<string, unknown>;
|
|
23
|
+
duration: number;
|
|
24
|
+
}
|
|
25
|
+
export interface DryRunResult {
|
|
26
|
+
workflowId: string;
|
|
27
|
+
status: 'completed' | 'would-fail';
|
|
28
|
+
steps: DryRunStepResult[];
|
|
29
|
+
variables: Record<string, unknown>;
|
|
30
|
+
duration: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Simulate workflow execution with mock data
|
|
34
|
+
*/
|
|
35
|
+
export declare function executeDryRun(workflow: Workflow, inputs: Record<string, unknown>, options?: DryRunOptions): Promise<DryRunResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Display final summary
|
|
38
|
+
*/
|
|
39
|
+
export declare function displayDryRunSummary(result: DryRunResult, options: DryRunOptions): void;
|
|
40
|
+
//# sourceMappingURL=dry-run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dry-run.d.ts","sourceRoot":"","sources":["../../src/commands/dry-run.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,kBAAkB,CAAC;AAOnE;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAyB7F;AAgLD,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,YAAY,CAAC;IAC/C,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,MA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