task-pipeliner 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.ko.md +1034 -0
- package/README.md +1031 -0
- package/dist/cli/index.d.ts +19 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +147 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/prompts.d.ts +48 -0
- package/dist/cli/prompts.d.ts.map +1 -0
- package/dist/cli/prompts.js +75 -0
- package/dist/cli/prompts.js.map +1 -0
- package/dist/cli/ui.d.ts +39 -0
- package/dist/cli/ui.d.ts.map +1 -0
- package/dist/cli/ui.js +84 -0
- package/dist/cli/ui.js.map +1 -0
- package/dist/core/__tests__/actual-execution.test.d.ts +2 -0
- package/dist/core/__tests__/actual-execution.test.d.ts.map +1 -0
- package/dist/core/__tests__/actual-execution.test.js +140 -0
- package/dist/core/__tests__/actual-execution.test.js.map +1 -0
- package/dist/core/__tests__/base-dir.test.d.ts +2 -0
- package/dist/core/__tests__/base-dir.test.d.ts.map +1 -0
- package/dist/core/__tests__/base-dir.test.js +146 -0
- package/dist/core/__tests__/base-dir.test.js.map +1 -0
- package/dist/core/__tests__/built-code-execution.test.d.ts +2 -0
- package/dist/core/__tests__/built-code-execution.test.d.ts.map +1 -0
- package/dist/core/__tests__/built-code-execution.test.js +48 -0
- package/dist/core/__tests__/built-code-execution.test.js.map +1 -0
- package/dist/core/__tests__/choose-as-var-condition.test.d.ts +2 -0
- package/dist/core/__tests__/choose-as-var-condition.test.d.ts.map +1 -0
- package/dist/core/__tests__/choose-as-var-condition.test.js +308 -0
- package/dist/core/__tests__/choose-as-var-condition.test.js.map +1 -0
- package/dist/core/__tests__/cli-integration.test.d.ts +2 -0
- package/dist/core/__tests__/cli-integration.test.d.ts.map +1 -0
- package/dist/core/__tests__/cli-integration.test.js +83 -0
- package/dist/core/__tests__/cli-integration.test.js.map +1 -0
- package/dist/core/__tests__/comprehensive-basic-yaml.test.d.ts +2 -0
- package/dist/core/__tests__/comprehensive-basic-yaml.test.d.ts.map +1 -0
- package/dist/core/__tests__/comprehensive-basic-yaml.test.js +111 -0
- package/dist/core/__tests__/comprehensive-basic-yaml.test.js.map +1 -0
- package/dist/core/__tests__/condition-evaluator.test.d.ts +2 -0
- package/dist/core/__tests__/condition-evaluator.test.d.ts.map +1 -0
- package/dist/core/__tests__/condition-evaluator.test.js +170 -0
- package/dist/core/__tests__/condition-evaluator.test.js.map +1 -0
- package/dist/core/__tests__/debug-basic-yaml.test.d.ts +2 -0
- package/dist/core/__tests__/debug-basic-yaml.test.d.ts.map +1 -0
- package/dist/core/__tests__/debug-basic-yaml.test.js +128 -0
- package/dist/core/__tests__/debug-basic-yaml.test.js.map +1 -0
- package/dist/core/__tests__/example-files.test.d.ts +2 -0
- package/dist/core/__tests__/example-files.test.d.ts.map +1 -0
- package/dist/core/__tests__/example-files.test.js +200 -0
- package/dist/core/__tests__/example-files.test.js.map +1 -0
- package/dist/core/__tests__/executor-choice-integration.test.d.ts +2 -0
- package/dist/core/__tests__/executor-choice-integration.test.d.ts.map +1 -0
- package/dist/core/__tests__/executor-choice-integration.test.js +171 -0
- package/dist/core/__tests__/executor-choice-integration.test.js.map +1 -0
- package/dist/core/__tests__/executor-choice.test.d.ts +2 -0
- package/dist/core/__tests__/executor-choice.test.d.ts.map +1 -0
- package/dist/core/__tests__/executor-choice.test.js +174 -0
- package/dist/core/__tests__/executor-choice.test.js.map +1 -0
- package/dist/core/__tests__/executor-parallel.test.d.ts +2 -0
- package/dist/core/__tests__/executor-parallel.test.d.ts.map +1 -0
- package/dist/core/__tests__/executor-parallel.test.js +136 -0
- package/dist/core/__tests__/executor-parallel.test.js.map +1 -0
- package/dist/core/__tests__/executor-prompt.test.d.ts +2 -0
- package/dist/core/__tests__/executor-prompt.test.d.ts.map +1 -0
- package/dist/core/__tests__/executor-prompt.test.js +149 -0
- package/dist/core/__tests__/executor-prompt.test.js.map +1 -0
- package/dist/core/__tests__/executor-real-scenario.test.d.ts +2 -0
- package/dist/core/__tests__/executor-real-scenario.test.d.ts.map +1 -0
- package/dist/core/__tests__/executor-real-scenario.test.js +169 -0
- package/dist/core/__tests__/executor-real-scenario.test.js.map +1 -0
- package/dist/core/__tests__/file-condition.test.d.ts +2 -0
- package/dist/core/__tests__/file-condition.test.d.ts.map +1 -0
- package/dist/core/__tests__/file-condition.test.js +182 -0
- package/dist/core/__tests__/file-condition.test.js.map +1 -0
- package/dist/core/__tests__/final-verification.test.d.ts +2 -0
- package/dist/core/__tests__/final-verification.test.d.ts.map +1 -0
- package/dist/core/__tests__/final-verification.test.js +59 -0
- package/dist/core/__tests__/final-verification.test.js.map +1 -0
- package/dist/core/__tests__/parallel-when-condition.test.d.ts +2 -0
- package/dist/core/__tests__/parallel-when-condition.test.d.ts.map +1 -0
- package/dist/core/__tests__/parallel-when-condition.test.js +155 -0
- package/dist/core/__tests__/parallel-when-condition.test.js.map +1 -0
- package/dist/core/__tests__/parser.test.d.ts +2 -0
- package/dist/core/__tests__/parser.test.d.ts.map +1 -0
- package/dist/core/__tests__/parser.test.js +94 -0
- package/dist/core/__tests__/parser.test.js.map +1 -0
- package/dist/core/__tests__/real-inquirer-test.test.d.ts +2 -0
- package/dist/core/__tests__/real-inquirer-test.test.d.ts.map +1 -0
- package/dist/core/__tests__/real-inquirer-test.test.js +20 -0
- package/dist/core/__tests__/real-inquirer-test.test.js.map +1 -0
- package/dist/core/__tests__/reproduce-bug.test.d.ts +2 -0
- package/dist/core/__tests__/reproduce-bug.test.d.ts.map +1 -0
- package/dist/core/__tests__/reproduce-bug.test.js +84 -0
- package/dist/core/__tests__/reproduce-bug.test.js.map +1 -0
- package/dist/core/__tests__/timeout-retry.test.d.ts +2 -0
- package/dist/core/__tests__/timeout-retry.test.d.ts.map +1 -0
- package/dist/core/__tests__/timeout-retry.test.js +184 -0
- package/dist/core/__tests__/timeout-retry.test.js.map +1 -0
- package/dist/core/__tests__/workflow-validation.test.d.ts +2 -0
- package/dist/core/__tests__/workflow-validation.test.d.ts.map +1 -0
- package/dist/core/__tests__/workflow-validation.test.js +120 -0
- package/dist/core/__tests__/workflow-validation.test.js.map +1 -0
- package/dist/core/__tests__/workspace.test.d.ts +2 -0
- package/dist/core/__tests__/workspace.test.d.ts.map +1 -0
- package/dist/core/__tests__/workspace.test.js +29 -0
- package/dist/core/__tests__/workspace.test.js.map +1 -0
- package/dist/core/__tests__/yaml-integration.test.d.ts +2 -0
- package/dist/core/__tests__/yaml-integration.test.d.ts.map +1 -0
- package/dist/core/__tests__/yaml-integration.test.js +114 -0
- package/dist/core/__tests__/yaml-integration.test.js.map +1 -0
- package/dist/core/__tests__/yaml-scenarios.test.d.ts +2 -0
- package/dist/core/__tests__/yaml-scenarios.test.d.ts.map +1 -0
- package/dist/core/__tests__/yaml-scenarios.test.js +199 -0
- package/dist/core/__tests__/yaml-scenarios.test.js.map +1 -0
- package/dist/core/condition-evaluator.d.ts +44 -0
- package/dist/core/condition-evaluator.d.ts.map +1 -0
- package/dist/core/condition-evaluator.js +121 -0
- package/dist/core/condition-evaluator.js.map +1 -0
- package/dist/core/executor.d.ts +172 -0
- package/dist/core/executor.d.ts.map +1 -0
- package/dist/core/executor.js +579 -0
- package/dist/core/executor.js.map +1 -0
- package/dist/core/parser.d.ts +41 -0
- package/dist/core/parser.d.ts.map +1 -0
- package/dist/core/parser.js +202 -0
- package/dist/core/parser.js.map +1 -0
- package/dist/core/rust-task-runner.d.ts +14 -0
- package/dist/core/rust-task-runner.d.ts.map +1 -0
- package/dist/core/rust-task-runner.js +34 -0
- package/dist/core/rust-task-runner.js.map +1 -0
- package/dist/core/task-runner.d.ts +63 -0
- package/dist/core/task-runner.d.ts.map +1 -0
- package/dist/core/task-runner.js +252 -0
- package/dist/core/task-runner.js.map +1 -0
- package/dist/core/template.d.ts +11 -0
- package/dist/core/template.d.ts.map +1 -0
- package/dist/core/template.js +36 -0
- package/dist/core/template.js.map +1 -0
- package/dist/core/workflow-schema.d.ts +31 -0
- package/dist/core/workflow-schema.d.ts.map +1 -0
- package/dist/core/workflow-schema.js +125 -0
- package/dist/core/workflow-schema.js.map +1 -0
- package/dist/core/workspace.d.ts +90 -0
- package/dist/core/workspace.d.ts.map +1 -0
- package/dist/core/workspace.js +143 -0
- package/dist/core/workspace.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/task-pipeliner-rs.node +0 -0
- package/dist/types/condition.d.ts +62 -0
- package/dist/types/condition.d.ts.map +1 -0
- package/dist/types/condition.js +6 -0
- package/dist/types/condition.js.map +1 -0
- package/dist/types/workflow.d.ts +69 -0
- package/dist/types/workflow.d.ts.map +1 -0
- package/dist/types/workflow.js +2 -0
- package/dist/types/workflow.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/core/template.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,SAAS,iBAAiB,CAAC,YAAoB,EAAE,SAAoB,EAAE,YAAoB;IACzF,yBAAyB;IACzB,IAAI,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,EAAE,CAAC;QACxC,OAAO,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC;IAC7D,CAAC;IAED,sBAAsB;IACtB,IAAI,SAAS,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACpC,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAClD,OAAO,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACvE,CAAC;IAED,uBAAuB;IACvB,IAAI,SAAS,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC;QACtC,OAAO,SAAS,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC;IAC3D,CAAC;IAED,kDAAkD;IAClD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAgB,EAChB,SAAoB;IAEpB,MAAM,eAAe,GAAG,gBAAgB,CAAC;IAEzC,OAAO,QAAQ,CAAC,OAAO,CAAC,eAAe,EAAE,CAAC,aAAa,EAAE,YAAY,EAAE,EAAE;QACvE,OAAO,iBAAiB,CAAC,YAAY,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod Schema for Workflow Validation
|
|
3
|
+
*
|
|
4
|
+
* Validates parsed workflow files against the Workflow type definition
|
|
5
|
+
* to ensure type safety at runtime.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
/**
|
|
9
|
+
* Workflow schema
|
|
10
|
+
* Note: Internal fields (_lineNumbers, _fileName, _filePath) are not validated
|
|
11
|
+
* as they are added by the parser, not from the source file
|
|
12
|
+
*/
|
|
13
|
+
export declare const WorkflowSchema: z.ZodObject<{
|
|
14
|
+
name: z.ZodOptional<z.ZodString>;
|
|
15
|
+
baseDir: z.ZodOptional<z.ZodString>;
|
|
16
|
+
steps: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
/**
|
|
19
|
+
* Validate and parse workflow
|
|
20
|
+
* @throws {z.ZodError} if validation fails
|
|
21
|
+
*/
|
|
22
|
+
export declare function validateWorkflow(data: unknown): z.infer<typeof WorkflowSchema>;
|
|
23
|
+
/**
|
|
24
|
+
* Safe validate workflow (returns result instead of throwing)
|
|
25
|
+
*/
|
|
26
|
+
export declare function safeValidateWorkflow(data: unknown): {
|
|
27
|
+
success: boolean;
|
|
28
|
+
data?: z.infer<typeof WorkflowSchema>;
|
|
29
|
+
error?: z.ZodError;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=workflow-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-schema.d.ts","sourceRoot":"","sources":["../../src/core/workflow-schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyGxB;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;iBAIzB,CAAC;AAEH;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAE9E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;CACpB,CAMA"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod Schema for Workflow Validation
|
|
3
|
+
*
|
|
4
|
+
* Validates parsed workflow files against the Workflow type definition
|
|
5
|
+
* to ensure type safety at runtime.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
/**
|
|
9
|
+
* Condition schemas
|
|
10
|
+
*/
|
|
11
|
+
const FileExistsConditionSchema = z.object({
|
|
12
|
+
file: z.string(),
|
|
13
|
+
});
|
|
14
|
+
const VarExistsConditionSchema = z.object({
|
|
15
|
+
var: z.union([z.string(), z.record(z.string(), z.string())]).optional(),
|
|
16
|
+
has: z.string().optional(),
|
|
17
|
+
});
|
|
18
|
+
const StatusConditionSchema = z.object({
|
|
19
|
+
status: z.object({
|
|
20
|
+
fact: z.string(),
|
|
21
|
+
is: z.enum(['ready', 'failed', 'pending']),
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
const StepConditionSchema = z.object({
|
|
25
|
+
step: z.object({
|
|
26
|
+
success: z.boolean(),
|
|
27
|
+
}).optional(),
|
|
28
|
+
last_step: z.enum(['success', 'failure']).optional(),
|
|
29
|
+
});
|
|
30
|
+
const ChoiceConditionSchema = z.object({
|
|
31
|
+
choice: z.string(),
|
|
32
|
+
});
|
|
33
|
+
// Recursive condition schema
|
|
34
|
+
const ConditionPrimitiveSchema = z.union([
|
|
35
|
+
FileExistsConditionSchema,
|
|
36
|
+
ChoiceConditionSchema,
|
|
37
|
+
VarExistsConditionSchema,
|
|
38
|
+
StatusConditionSchema,
|
|
39
|
+
StepConditionSchema,
|
|
40
|
+
]);
|
|
41
|
+
const ConditionSchema = z.lazy(() => z.union([
|
|
42
|
+
ConditionPrimitiveSchema,
|
|
43
|
+
z.object({
|
|
44
|
+
all: z.array(ConditionSchema),
|
|
45
|
+
}),
|
|
46
|
+
z.object({
|
|
47
|
+
any: z.array(ConditionSchema),
|
|
48
|
+
}),
|
|
49
|
+
z.object({
|
|
50
|
+
not: ConditionSchema,
|
|
51
|
+
}),
|
|
52
|
+
]));
|
|
53
|
+
/**
|
|
54
|
+
* Step schemas
|
|
55
|
+
*/
|
|
56
|
+
const RunStepSchema = z.object({
|
|
57
|
+
run: z.string(),
|
|
58
|
+
when: ConditionSchema.optional(),
|
|
59
|
+
timeout: z.number().optional(),
|
|
60
|
+
retry: z.number().optional(),
|
|
61
|
+
});
|
|
62
|
+
const ChooseStepSchema = z.object({
|
|
63
|
+
choose: z.object({
|
|
64
|
+
message: z.string(),
|
|
65
|
+
options: z.array(z.object({
|
|
66
|
+
id: z.string(),
|
|
67
|
+
label: z.string(),
|
|
68
|
+
})),
|
|
69
|
+
as: z.string().optional(),
|
|
70
|
+
}),
|
|
71
|
+
when: ConditionSchema.optional(),
|
|
72
|
+
});
|
|
73
|
+
const PromptStepSchema = z.object({
|
|
74
|
+
prompt: z.object({
|
|
75
|
+
message: z.string(),
|
|
76
|
+
as: z.string(),
|
|
77
|
+
default: z.string().optional(),
|
|
78
|
+
validate: z.string().optional(),
|
|
79
|
+
}),
|
|
80
|
+
when: ConditionSchema.optional(),
|
|
81
|
+
});
|
|
82
|
+
// Recursive step schema for parallel steps
|
|
83
|
+
const StepSchema = z.lazy(() => z.union([
|
|
84
|
+
RunStepSchema,
|
|
85
|
+
ChooseStepSchema,
|
|
86
|
+
PromptStepSchema,
|
|
87
|
+
z.object({
|
|
88
|
+
parallel: z.array(StepSchema),
|
|
89
|
+
when: ConditionSchema.optional(),
|
|
90
|
+
}),
|
|
91
|
+
z.object({
|
|
92
|
+
fail: z.object({
|
|
93
|
+
message: z.string(),
|
|
94
|
+
}),
|
|
95
|
+
when: ConditionSchema.optional(),
|
|
96
|
+
}),
|
|
97
|
+
]));
|
|
98
|
+
/**
|
|
99
|
+
* Workflow schema
|
|
100
|
+
* Note: Internal fields (_lineNumbers, _fileName, _filePath) are not validated
|
|
101
|
+
* as they are added by the parser, not from the source file
|
|
102
|
+
*/
|
|
103
|
+
export const WorkflowSchema = z.object({
|
|
104
|
+
name: z.string().optional(),
|
|
105
|
+
baseDir: z.string().optional(),
|
|
106
|
+
steps: z.array(StepSchema).min(1, 'Workflow must have at least one step'),
|
|
107
|
+
});
|
|
108
|
+
/**
|
|
109
|
+
* Validate and parse workflow
|
|
110
|
+
* @throws {z.ZodError} if validation fails
|
|
111
|
+
*/
|
|
112
|
+
export function validateWorkflow(data) {
|
|
113
|
+
return WorkflowSchema.parse(data);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Safe validate workflow (returns result instead of throwing)
|
|
117
|
+
*/
|
|
118
|
+
export function safeValidateWorkflow(data) {
|
|
119
|
+
const result = WorkflowSchema.safeParse(data);
|
|
120
|
+
if (result.success) {
|
|
121
|
+
return { success: true, data: result.data };
|
|
122
|
+
}
|
|
123
|
+
return { success: false, error: result.error };
|
|
124
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G,CAAC,CAAC,EAAE,sCAAsC,CAAC;CAC1E,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAa;IAC5C,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAa;IAKhD,MAAM,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9C,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IAC9C,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace State Management
|
|
3
|
+
* Manages facts, choices, and step results
|
|
4
|
+
*/
|
|
5
|
+
export interface WorkspaceState {
|
|
6
|
+
facts: Map<string, boolean | string>;
|
|
7
|
+
choices: Map<string, string>;
|
|
8
|
+
variables: Map<string, string>;
|
|
9
|
+
stepResults: Map<number, {
|
|
10
|
+
success: boolean;
|
|
11
|
+
exitCode?: number;
|
|
12
|
+
}>;
|
|
13
|
+
lastStepIndex: number;
|
|
14
|
+
}
|
|
15
|
+
export declare class Workspace {
|
|
16
|
+
private state;
|
|
17
|
+
constructor();
|
|
18
|
+
/**
|
|
19
|
+
* Check if a fact exists
|
|
20
|
+
*/
|
|
21
|
+
hasFact(name: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Get a fact value
|
|
24
|
+
*/
|
|
25
|
+
getFact(name: string): boolean | string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Set a fact value
|
|
28
|
+
*/
|
|
29
|
+
setFact(name: string, value: boolean | string): void;
|
|
30
|
+
/**
|
|
31
|
+
* Get fact status: ready, failed, or pending
|
|
32
|
+
*/
|
|
33
|
+
getFactStatus(name: string): 'ready' | 'failed' | 'pending';
|
|
34
|
+
/**
|
|
35
|
+
* Get all facts (used for merging after parallel execution)
|
|
36
|
+
*/
|
|
37
|
+
getAllFacts(): Map<string, boolean | string>;
|
|
38
|
+
/**
|
|
39
|
+
* Check if a choice exists
|
|
40
|
+
*/
|
|
41
|
+
hasChoice(id: string): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Get a choice value
|
|
44
|
+
*/
|
|
45
|
+
getChoice(id: string): string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Set a choice value
|
|
48
|
+
*/
|
|
49
|
+
setChoice(id: string, value: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* Check if a variable exists
|
|
52
|
+
*/
|
|
53
|
+
hasVariable(name: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Get a variable value
|
|
56
|
+
*/
|
|
57
|
+
getVariable(name: string): string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Set a variable value
|
|
60
|
+
*/
|
|
61
|
+
setVariable(name: string, value: string): void;
|
|
62
|
+
/**
|
|
63
|
+
* Get all variables (used for merging after parallel execution)
|
|
64
|
+
*/
|
|
65
|
+
getAllVariables(): Map<string, string>;
|
|
66
|
+
/**
|
|
67
|
+
* Set step execution result
|
|
68
|
+
*/
|
|
69
|
+
setStepResult(index: number, success: boolean, exitCode?: number): void;
|
|
70
|
+
/**
|
|
71
|
+
* Get step execution result by index
|
|
72
|
+
*/
|
|
73
|
+
getStepResult(index: number): {
|
|
74
|
+
success: boolean;
|
|
75
|
+
exitCode?: number;
|
|
76
|
+
} | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Get the last executed step result
|
|
79
|
+
*/
|
|
80
|
+
getLastStepResult(): {
|
|
81
|
+
success: boolean;
|
|
82
|
+
exitCode?: number;
|
|
83
|
+
} | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Clone workspace state (used for parallel execution)
|
|
86
|
+
* Each parallel branch gets its own workspace copy
|
|
87
|
+
*/
|
|
88
|
+
clone(): Workspace;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/core/workspace.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;IACrC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClE,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,KAAK,CAAiB;;IAgB9B;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI9B;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS;IAInD;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI;IAIpD;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS;IAQ3D;;OAEG;IACH,WAAW,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;IAQ5C;;OAEG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAI9B;;OAEG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIzC;;OAEG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAQ1C;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIlC;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI7C;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAI9C;;OAEG;IACH,eAAe,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAQtC;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IAKvE;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;IAIjF;;OAEG;IACH,iBAAiB,IAAI;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;IAWxE;;;OAGG;IACH,KAAK,IAAI,SAAS;CASnB"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace State Management
|
|
3
|
+
* Manages facts, choices, and step results
|
|
4
|
+
*/
|
|
5
|
+
export class Workspace {
|
|
6
|
+
state;
|
|
7
|
+
constructor() {
|
|
8
|
+
this.state = {
|
|
9
|
+
facts: new Map(),
|
|
10
|
+
choices: new Map(),
|
|
11
|
+
variables: new Map(),
|
|
12
|
+
stepResults: new Map(),
|
|
13
|
+
lastStepIndex: -1,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
// ============================================
|
|
17
|
+
// Facts Management
|
|
18
|
+
// ============================================
|
|
19
|
+
/**
|
|
20
|
+
* Check if a fact exists
|
|
21
|
+
*/
|
|
22
|
+
hasFact(name) {
|
|
23
|
+
return this.state.facts.has(name);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get a fact value
|
|
27
|
+
*/
|
|
28
|
+
getFact(name) {
|
|
29
|
+
return this.state.facts.get(name);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Set a fact value
|
|
33
|
+
*/
|
|
34
|
+
setFact(name, value) {
|
|
35
|
+
this.state.facts.set(name, value);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get fact status: ready, failed, or pending
|
|
39
|
+
*/
|
|
40
|
+
getFactStatus(name) {
|
|
41
|
+
if (!this.hasFact(name)) {
|
|
42
|
+
return 'pending';
|
|
43
|
+
}
|
|
44
|
+
const value = this.getFact(name);
|
|
45
|
+
return (value === false || value === 'failed') ? 'failed' : 'ready';
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get all facts (used for merging after parallel execution)
|
|
49
|
+
*/
|
|
50
|
+
getAllFacts() {
|
|
51
|
+
return new Map(this.state.facts);
|
|
52
|
+
}
|
|
53
|
+
// ============================================
|
|
54
|
+
// Choices Management
|
|
55
|
+
// ============================================
|
|
56
|
+
/**
|
|
57
|
+
* Check if a choice exists
|
|
58
|
+
*/
|
|
59
|
+
hasChoice(id) {
|
|
60
|
+
return this.state.choices.has(id);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get a choice value
|
|
64
|
+
*/
|
|
65
|
+
getChoice(id) {
|
|
66
|
+
return this.state.choices.get(id);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Set a choice value
|
|
70
|
+
*/
|
|
71
|
+
setChoice(id, value) {
|
|
72
|
+
this.state.choices.set(id, value);
|
|
73
|
+
}
|
|
74
|
+
// ============================================
|
|
75
|
+
// Variables Management
|
|
76
|
+
// ============================================
|
|
77
|
+
/**
|
|
78
|
+
* Check if a variable exists
|
|
79
|
+
*/
|
|
80
|
+
hasVariable(name) {
|
|
81
|
+
return this.state.variables.has(name);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Get a variable value
|
|
85
|
+
*/
|
|
86
|
+
getVariable(name) {
|
|
87
|
+
return this.state.variables.get(name);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Set a variable value
|
|
91
|
+
*/
|
|
92
|
+
setVariable(name, value) {
|
|
93
|
+
this.state.variables.set(name, value);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Get all variables (used for merging after parallel execution)
|
|
97
|
+
*/
|
|
98
|
+
getAllVariables() {
|
|
99
|
+
return new Map(this.state.variables);
|
|
100
|
+
}
|
|
101
|
+
// ============================================
|
|
102
|
+
// Step Results Management
|
|
103
|
+
// ============================================
|
|
104
|
+
/**
|
|
105
|
+
* Set step execution result
|
|
106
|
+
*/
|
|
107
|
+
setStepResult(index, success, exitCode) {
|
|
108
|
+
this.state.stepResults.set(index, { success, exitCode });
|
|
109
|
+
this.state.lastStepIndex = index;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Get step execution result by index
|
|
113
|
+
*/
|
|
114
|
+
getStepResult(index) {
|
|
115
|
+
return this.state.stepResults.get(index);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Get the last executed step result
|
|
119
|
+
*/
|
|
120
|
+
getLastStepResult() {
|
|
121
|
+
if (this.state.lastStepIndex === -1) {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
return this.state.stepResults.get(this.state.lastStepIndex);
|
|
125
|
+
}
|
|
126
|
+
// ============================================
|
|
127
|
+
// Utility Methods
|
|
128
|
+
// ============================================
|
|
129
|
+
/**
|
|
130
|
+
* Clone workspace state (used for parallel execution)
|
|
131
|
+
* Each parallel branch gets its own workspace copy
|
|
132
|
+
*/
|
|
133
|
+
clone() {
|
|
134
|
+
const cloned = new Workspace();
|
|
135
|
+
cloned.state.facts = new Map(this.state.facts);
|
|
136
|
+
cloned.state.choices = new Map(this.state.choices);
|
|
137
|
+
cloned.state.variables = new Map(this.state.variables);
|
|
138
|
+
cloned.state.stepResults = new Map(this.state.stepResults);
|
|
139
|
+
cloned.state.lastStepIndex = this.state.lastStepIndex;
|
|
140
|
+
return cloned;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/core/workspace.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,MAAM,OAAO,SAAS;IACZ,KAAK,CAAiB;IAE9B;QACE,IAAI,CAAC,KAAK,GAAG;YACX,KAAK,EAAE,IAAI,GAAG,EAAE;YAChB,OAAO,EAAE,IAAI,GAAG,EAAE;YAClB,SAAS,EAAE,IAAI,GAAG,EAAE;YACpB,WAAW,EAAE,IAAI,GAAG,EAAE;YACtB,aAAa,EAAE,CAAC,CAAC;SAClB,CAAC;IACJ,CAAC;IAED,+CAA+C;IAC/C,mBAAmB;IACnB,+CAA+C;IAE/C;;OAEG;IACH,OAAO,CAAC,IAAY;QAClB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,IAAY;QAClB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,IAAY,EAAE,KAAuB;QAC3C,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,IAAY;QACxB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CA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aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;QACtD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* task-pipeliner
|
|
3
|
+
* Main entry point
|
|
4
|
+
*/
|
|
5
|
+
export * from './types/condition.js';
|
|
6
|
+
export * from './types/workflow.js';
|
|
7
|
+
export * from './core/workspace.js';
|
|
8
|
+
export * from './core/condition-evaluator.js';
|
|
9
|
+
export * from './core/executor.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* task-pipeliner
|
|
3
|
+
* Main entry point
|
|
4
|
+
*/
|
|
5
|
+
export * from './types/condition.js';
|
|
6
|
+
export * from './types/workflow.js';
|
|
7
|
+
export * from './core/workspace.js';
|
|
8
|
+
export * from './core/condition-evaluator.js';
|
|
9
|
+
export * from './core/executor.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC"}
|
|
Binary file
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Condition Primitives
|
|
3
|
+
* Conditions ask questions about the workspace, not inspect values
|
|
4
|
+
*/
|
|
5
|
+
export type ConditionPrimitive = FileExistsCondition | ChoiceCondition | VarExistsCondition;
|
|
6
|
+
export type Condition = ConditionPrimitive | AllCondition | AnyCondition | NotCondition;
|
|
7
|
+
/**
|
|
8
|
+
* 1. File/Directory existence check
|
|
9
|
+
*/
|
|
10
|
+
export interface FileExistsCondition {
|
|
11
|
+
file: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 2. Variable/Fact existence check or value comparison
|
|
15
|
+
*/
|
|
16
|
+
export interface VarExistsCondition {
|
|
17
|
+
var?: string | Record<string, string>;
|
|
18
|
+
has?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 2. Fact status check
|
|
22
|
+
*/
|
|
23
|
+
export interface StatusCondition {
|
|
24
|
+
status: {
|
|
25
|
+
fact: string;
|
|
26
|
+
is: 'ready' | 'failed' | 'pending';
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 3. Previous step result check
|
|
31
|
+
*/
|
|
32
|
+
export interface StepCondition {
|
|
33
|
+
step?: {
|
|
34
|
+
success: boolean;
|
|
35
|
+
};
|
|
36
|
+
last_step?: 'success' | 'failure';
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 4. User choice check
|
|
40
|
+
*/
|
|
41
|
+
export interface ChoiceCondition {
|
|
42
|
+
choice: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* AND combination - all conditions must be true
|
|
46
|
+
*/
|
|
47
|
+
export interface AllCondition {
|
|
48
|
+
all: Condition[];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* OR combination - any condition can be true
|
|
52
|
+
*/
|
|
53
|
+
export interface AnyCondition {
|
|
54
|
+
any: Condition[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* NOT condition - negate a condition
|
|
58
|
+
*/
|
|
59
|
+
export interface NotCondition {
|
|
60
|
+
not: Condition;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=condition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../../src/types/condition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,kBAAkB,GAC1B,mBAAmB,GACnB,eAAe,GACf,kBAAkB,CAAC;AAEvB,MAAM,MAAM,SAAS,GACjB,kBAAkB,GAClB,YAAY,GACZ,YAAY,GACZ,YAAY,CAAC;AAEjB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;KACpC,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE;QACL,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IACF,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,SAAS,EAAE,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,SAAS,EAAE,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,SAAS,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"condition.js","sourceRoot":"","sources":["../../src/types/condition.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Condition } from './condition.js';
|
|
2
|
+
/**
|
|
3
|
+
* Workflow Step Types
|
|
4
|
+
*/
|
|
5
|
+
export type Step = RunStep | ChooseStep | PromptStep | ParallelStep | FailStep;
|
|
6
|
+
/**
|
|
7
|
+
* Basic execution step
|
|
8
|
+
* Workflow stops on failure
|
|
9
|
+
*/
|
|
10
|
+
export interface RunStep {
|
|
11
|
+
run: string;
|
|
12
|
+
when?: Condition;
|
|
13
|
+
timeout?: number;
|
|
14
|
+
retry?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* User choice step
|
|
18
|
+
*/
|
|
19
|
+
export interface ChooseStep {
|
|
20
|
+
choose: {
|
|
21
|
+
message: string;
|
|
22
|
+
options: Array<{
|
|
23
|
+
id: string;
|
|
24
|
+
label: string;
|
|
25
|
+
}>;
|
|
26
|
+
as?: string;
|
|
27
|
+
};
|
|
28
|
+
when?: Condition;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* User input step (prompt)
|
|
32
|
+
*/
|
|
33
|
+
export interface PromptStep {
|
|
34
|
+
prompt: {
|
|
35
|
+
message: string;
|
|
36
|
+
as: string;
|
|
37
|
+
default?: string;
|
|
38
|
+
validate?: string;
|
|
39
|
+
};
|
|
40
|
+
when?: Condition;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Parallel execution step
|
|
44
|
+
*/
|
|
45
|
+
export interface ParallelStep {
|
|
46
|
+
parallel: Step[];
|
|
47
|
+
when?: Condition;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Fail step
|
|
51
|
+
*/
|
|
52
|
+
export interface FailStep {
|
|
53
|
+
fail: {
|
|
54
|
+
message: string;
|
|
55
|
+
};
|
|
56
|
+
when?: Condition;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Complete workflow
|
|
60
|
+
*/
|
|
61
|
+
export interface Workflow {
|
|
62
|
+
name?: string;
|
|
63
|
+
baseDir?: string;
|
|
64
|
+
steps: Step[];
|
|
65
|
+
_lineNumbers?: Map<number, number>;
|
|
66
|
+
_fileName?: string;
|
|
67
|
+
_filePath?: string;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/types/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,IAAI,GACZ,OAAO,GACP,UAAU,GACV,UAAU,GACV,YAAY,GACZ,QAAQ,CAAC;AAEb;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,KAAK,CAAC;YACb,EAAE,EAAE,MAAM,CAAC;YACX,KAAK,EAAE,MAAM,CAAC;SACf,CAAC,CAAC;QACH,EAAE,CAAC,EAAE,MAAM,CAAC;KACb,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,CAAC;CACl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