@workglow/tasks 0.0.52

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.
@@ -0,0 +1,92 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { CreateWorkflow, Task, TaskConfig } from "@workglow/task-graph";
7
+ import { FromSchema } from "@workglow/util";
8
+ declare const inputSchema: {
9
+ readonly type: "object";
10
+ readonly properties: {
11
+ readonly console: {
12
+ readonly title: "Message";
13
+ readonly description: "The message to log";
14
+ };
15
+ readonly log_level: {
16
+ readonly type: "string";
17
+ readonly enum: readonly ["dir", "log", "debug", "info", "warn", "error"];
18
+ readonly title: "Log Level";
19
+ readonly description: "The log level to use";
20
+ readonly default: "log";
21
+ };
22
+ };
23
+ readonly additionalProperties: false;
24
+ };
25
+ declare const outputSchema: {
26
+ readonly type: "object";
27
+ readonly properties: {
28
+ readonly console: {
29
+ readonly title: "Messages";
30
+ readonly description: "The messages logged by the task";
31
+ };
32
+ };
33
+ readonly additionalProperties: false;
34
+ };
35
+ export type DebugLogTaskInput = FromSchema<typeof inputSchema>;
36
+ export type DebugLogTaskOutput = FromSchema<typeof outputSchema>;
37
+ /**
38
+ * DebugLogTask provides console logging functionality as a task within the system.
39
+ *
40
+ * Features:
41
+ * - Supports multiple log levels (info, warn, error, dir)
42
+ * - Passes through the logged message as output
43
+ * - Configurable logging format and depth
44
+ *
45
+ * This task is particularly useful for debugging task graphs and monitoring
46
+ * data flow between tasks during development and testing.
47
+ */
48
+ export declare class DebugLogTask<Input extends DebugLogTaskInput = DebugLogTaskInput, Output extends DebugLogTaskOutput = DebugLogTaskOutput, Config extends TaskConfig = TaskConfig> extends Task<Input, Output, Config> {
49
+ static type: string;
50
+ static category: string;
51
+ static title: string;
52
+ static description: string;
53
+ static readonly cacheable = false;
54
+ static inputSchema(): {
55
+ readonly type: "object";
56
+ readonly properties: {
57
+ readonly console: {
58
+ readonly title: "Message";
59
+ readonly description: "The message to log";
60
+ };
61
+ readonly log_level: {
62
+ readonly type: "string";
63
+ readonly enum: readonly ["dir", "log", "debug", "info", "warn", "error"];
64
+ readonly title: "Log Level";
65
+ readonly description: "The log level to use";
66
+ readonly default: "log";
67
+ };
68
+ };
69
+ readonly additionalProperties: false;
70
+ };
71
+ static outputSchema(): {
72
+ readonly type: "object";
73
+ readonly properties: {
74
+ readonly console: {
75
+ readonly title: "Messages";
76
+ readonly description: "The messages logged by the task";
77
+ };
78
+ };
79
+ readonly additionalProperties: false;
80
+ };
81
+ executeReactive(input: Input, output: Output): Promise<Output>;
82
+ }
83
+ export declare const DebugLog: (input: DebugLogTaskInput, config?: TaskConfig) => Promise<{
84
+ console?: unknown;
85
+ }>;
86
+ declare module "@workglow/task-graph" {
87
+ interface Workflow {
88
+ DebugLog: CreateWorkflow<DebugLogTaskInput, DebugLogTaskOutput, TaskConfig>;
89
+ }
90
+ }
91
+ export {};
92
+ //# sourceMappingURL=DebugLogTask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DebugLogTask.d.ts","sourceRoot":"","sources":["../../src/task/DebugLogTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,UAAU,EAA0B,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAkB,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAM5D,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;CAgBkB,CAAC;AAEpC,QAAA,MAAM,YAAY;;;;;;;;;CASiB,CAAC;AAEpC,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAC/D,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAEjE;;;;;;;;;;GAUG;AACH,qBAAa,YAAY,CACvB,KAAK,SAAS,iBAAiB,GAAG,iBAAiB,EACnD,MAAM,SAAS,kBAAkB,GAAG,kBAAkB,EACtD,MAAM,SAAS,UAAU,GAAG,UAAU,CACtC,SAAQ,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;IACnC,OAAc,IAAI,SAAkB;IACpC,OAAc,QAAQ,SAAa;IACnC,OAAc,KAAK,SAAe;IAClC,OAAc,WAAW,SAC+D;IACxF,MAAM,CAAC,QAAQ,CAAC,SAAS,SAAS;WAEpB,WAAW;;;;;;;;;;;;;;;;;WAIX,YAAY;;;;;;;;;;IAIpB,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM;CAUnD;AAID,eAAO,MAAM,QAAQ,GAAI,OAAO,iBAAiB,EAAE,SAAQ,UAAe;;EAGzE,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,QAAQ,EAAE,cAAc,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,UAAU,CAAC,CAAC;KAC7E;CACF"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { CreateWorkflow, IExecuteContext, Task, TaskConfig } from "@workglow/task-graph";
7
+ import { FromSchema } from "@workglow/util";
8
+ declare const inputSchema: {
9
+ readonly type: "object";
10
+ readonly properties: {
11
+ readonly delay: {
12
+ readonly type: "number";
13
+ readonly title: "Delay (ms)";
14
+ readonly default: 1;
15
+ };
16
+ readonly pass_through: {
17
+ readonly title: "Pass Through";
18
+ readonly description: "Pass through data to the output";
19
+ };
20
+ };
21
+ readonly additionalProperties: false;
22
+ };
23
+ declare const outputSchema: {
24
+ readonly type: "object";
25
+ readonly properties: {};
26
+ readonly additionalProperties: true;
27
+ };
28
+ export type DelayTaskInput = FromSchema<typeof inputSchema>;
29
+ export type DelayTaskOutput = FromSchema<typeof outputSchema>;
30
+ export declare class DelayTask<Input extends DelayTaskInput = DelayTaskInput, Output extends DelayTaskOutput = DelayTaskOutput, Config extends TaskConfig = TaskConfig> extends Task<Input, Output, Config> {
31
+ static readonly type = "DelayTask";
32
+ static readonly category = "Utility";
33
+ static title: string;
34
+ static description: string;
35
+ static inputSchema(): {
36
+ readonly type: "object";
37
+ readonly properties: {
38
+ readonly delay: {
39
+ readonly type: "number";
40
+ readonly title: "Delay (ms)";
41
+ readonly default: 1;
42
+ };
43
+ readonly pass_through: {
44
+ readonly title: "Pass Through";
45
+ readonly description: "Pass through data to the output";
46
+ };
47
+ };
48
+ readonly additionalProperties: false;
49
+ };
50
+ static outputSchema(): {
51
+ readonly type: "object";
52
+ readonly properties: {};
53
+ readonly additionalProperties: true;
54
+ };
55
+ execute(input: Input, executeContext: IExecuteContext): Promise<Output>;
56
+ }
57
+ /**
58
+ * DelayTask
59
+ *
60
+ * Delays the execution of a task for a specified amount of time
61
+ *
62
+ * @param {delay} - The delay in milliseconds
63
+ */
64
+ export declare const Delay: (input: DelayTaskInput, config?: TaskConfig) => Promise<{
65
+ [x: string]: unknown;
66
+ }>;
67
+ declare module "@workglow/task-graph" {
68
+ interface Workflow {
69
+ Delay: CreateWorkflow<DelayTaskInput, DelayTaskOutput, TaskConfig>;
70
+ }
71
+ }
72
+ export {};
73
+ //# sourceMappingURL=DelayTask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DelayTask.d.ts","sourceRoot":"","sources":["../../src/task/DelayTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACH,cAAc,EACd,eAAe,EACf,IAAI,EAEJ,UAAU,EAGb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAkB,UAAU,EAAS,MAAM,gBAAgB,CAAC;AAEnE,QAAA,MAAM,WAAW;;;;;;;;;;;;;;CAckB,CAAC;AAEpC,QAAA,MAAM,YAAY;;;;CAIiB,CAAC;AAEpC,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAC5D,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAE9D,qBAAa,SAAS,CACpB,KAAK,SAAS,cAAc,GAAG,cAAc,EAC7C,MAAM,SAAS,eAAe,GAAG,eAAe,EAChD,MAAM,SAAS,UAAU,GAAG,UAAU,CACtC,SAAQ,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;IACnC,MAAM,CAAC,QAAQ,CAAC,IAAI,eAAe;IACnC,MAAM,CAAC,QAAQ,CAAC,QAAQ,aAAa;IACrC,OAAc,KAAK,SAAW;IAC9B,OAAc,WAAW,SAAsE;IAE/F,MAAM,CAAC,WAAW;;;;;;;;;;;;;;;IAIlB,MAAM,CAAC,YAAY;;;;;IAIb,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;CAiB9E;AAKD;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,cAAc,EAAE,SAAQ,UAAe;;EAGnE,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,KAAK,EAAE,cAAc,CAAC,cAAc,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;KACpE;CACF"}
@@ -0,0 +1,194 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { IJobExecuteContext, Job } from "@workglow/job-queue";
7
+ import { CreateWorkflow, JobQueueTask, JobQueueTaskConfig } from "@workglow/task-graph";
8
+ import { FromSchema } from "@workglow/util";
9
+ declare const inputSchema: {
10
+ readonly type: "object";
11
+ readonly properties: {
12
+ readonly url: {
13
+ readonly type: "string";
14
+ readonly title: "URL";
15
+ readonly description: "The URL to fetch from";
16
+ readonly format: "uri";
17
+ };
18
+ readonly method: {
19
+ readonly enum: readonly ["GET", "POST", "PUT", "DELETE", "PATCH"];
20
+ readonly title: "Method";
21
+ readonly description: "The HTTP method to use";
22
+ readonly default: "GET";
23
+ };
24
+ readonly headers: {
25
+ readonly type: "object";
26
+ readonly additionalProperties: {
27
+ readonly type: "string";
28
+ };
29
+ readonly title: "Headers";
30
+ readonly description: "The headers to send with the request";
31
+ };
32
+ readonly body: {
33
+ readonly type: "string";
34
+ readonly title: "Body";
35
+ readonly description: "The body of the request";
36
+ };
37
+ readonly response_type: {
38
+ readonly enum: readonly ["json", "text", "blob", "arraybuffer"];
39
+ readonly title: "Response Type";
40
+ readonly default: "json";
41
+ };
42
+ readonly timeout: {
43
+ readonly type: "number";
44
+ readonly title: "Timeout";
45
+ readonly description: "Request timeout in milliseconds";
46
+ };
47
+ readonly queue: {
48
+ readonly oneOf: readonly [{
49
+ readonly type: "boolean";
50
+ }, {
51
+ readonly type: "string";
52
+ }];
53
+ readonly description: "Queue handling: false=run inline, true=use default, string=explicit queue name";
54
+ readonly default: true;
55
+ readonly "x-ui-hidden": true;
56
+ };
57
+ };
58
+ readonly required: readonly ["url"];
59
+ readonly additionalProperties: false;
60
+ };
61
+ declare const outputSchema: {
62
+ readonly type: "object";
63
+ readonly properties: {
64
+ readonly json: {
65
+ readonly title: "JSON";
66
+ readonly description: "The JSON response";
67
+ };
68
+ readonly text: {
69
+ readonly type: "string";
70
+ readonly title: "Text";
71
+ readonly description: "The text response";
72
+ };
73
+ readonly blob: {
74
+ readonly title: "Blob";
75
+ readonly description: "The blob response";
76
+ };
77
+ readonly arraybuffer: {
78
+ readonly title: "ArrayBuffer";
79
+ readonly description: "The arraybuffer response";
80
+ };
81
+ };
82
+ readonly additionalProperties: false;
83
+ };
84
+ export type FetchTaskInput = FromSchema<typeof inputSchema>;
85
+ export type FetchTaskOutput = FromSchema<typeof outputSchema>;
86
+ export type FetchTaskConfig = JobQueueTaskConfig;
87
+ /**
88
+ * Extends the base Job class to provide custom execution functionality
89
+ * through a provided function.
90
+ */
91
+ export declare class FetchJob<Input extends FetchTaskInput = FetchTaskInput, Output = FetchTaskOutput> extends Job<Input, Output> {
92
+ constructor(config?: JobQueueTaskConfig & {
93
+ input: Input;
94
+ });
95
+ static readonly type: string;
96
+ /**
97
+ * Executes the job using the provided function.
98
+ */
99
+ execute(input: Input, context: IJobExecuteContext): Promise<Output>;
100
+ }
101
+ /**
102
+ * FetchTask provides a task for fetching data from a URL.
103
+ */
104
+ export declare class FetchTask<Input extends FetchTaskInput = FetchTaskInput, Output extends FetchTaskOutput = FetchTaskOutput, Config extends FetchTaskConfig = FetchTaskConfig> extends JobQueueTask<Input, Output, Config> {
105
+ static type: string;
106
+ static category: string;
107
+ static title: string;
108
+ static description: string;
109
+ static inputSchema(): {
110
+ readonly type: "object";
111
+ readonly properties: {
112
+ readonly url: {
113
+ readonly type: "string";
114
+ readonly title: "URL";
115
+ readonly description: "The URL to fetch from";
116
+ readonly format: "uri";
117
+ };
118
+ readonly method: {
119
+ readonly enum: readonly ["GET", "POST", "PUT", "DELETE", "PATCH"];
120
+ readonly title: "Method";
121
+ readonly description: "The HTTP method to use";
122
+ readonly default: "GET";
123
+ };
124
+ readonly headers: {
125
+ readonly type: "object";
126
+ readonly additionalProperties: {
127
+ readonly type: "string";
128
+ };
129
+ readonly title: "Headers";
130
+ readonly description: "The headers to send with the request";
131
+ };
132
+ readonly body: {
133
+ readonly type: "string";
134
+ readonly title: "Body";
135
+ readonly description: "The body of the request";
136
+ };
137
+ readonly response_type: {
138
+ readonly enum: readonly ["json", "text", "blob", "arraybuffer"];
139
+ readonly title: "Response Type";
140
+ readonly default: "json";
141
+ };
142
+ readonly timeout: {
143
+ readonly type: "number";
144
+ readonly title: "Timeout";
145
+ readonly description: "Request timeout in milliseconds";
146
+ };
147
+ readonly queue: {
148
+ readonly oneOf: readonly [{
149
+ readonly type: "boolean";
150
+ }, {
151
+ readonly type: "string";
152
+ }];
153
+ readonly description: "Queue handling: false=run inline, true=use default, string=explicit queue name";
154
+ readonly default: true;
155
+ readonly "x-ui-hidden": true;
156
+ };
157
+ };
158
+ readonly required: readonly ["url"];
159
+ readonly additionalProperties: false;
160
+ };
161
+ static outputSchema(): {
162
+ readonly type: "object";
163
+ readonly properties: {
164
+ readonly json: {
165
+ readonly title: "JSON";
166
+ readonly description: "The JSON response";
167
+ };
168
+ readonly text: {
169
+ readonly type: "string";
170
+ readonly title: "Text";
171
+ readonly description: "The text response";
172
+ };
173
+ readonly blob: {
174
+ readonly title: "Blob";
175
+ readonly description: "The blob response";
176
+ };
177
+ readonly arraybuffer: {
178
+ readonly title: "ArrayBuffer";
179
+ readonly description: "The arraybuffer response";
180
+ };
181
+ };
182
+ readonly additionalProperties: false;
183
+ };
184
+ constructor(input?: Input, config?: Config);
185
+ protected getDefaultQueueName(input: Input): Promise<string | undefined>;
186
+ }
187
+ export declare const Fetch: (input: FetchTaskInput, config?: FetchTaskConfig) => Promise<FetchTaskOutput>;
188
+ declare module "@workglow/task-graph" {
189
+ interface Workflow {
190
+ Fetch: CreateWorkflow<FetchTaskInput, FetchTaskOutput, FetchTaskConfig>;
191
+ }
192
+ }
193
+ export {};
194
+ //# sourceMappingURL=FetchTask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FetchTask.d.ts","sourceRoot":"","sources":["../../src/task/FetchTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEH,kBAAkB,EAClB,GAAG,EAGN,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACH,cAAc,EACd,YAAY,EACZ,kBAAkB,EAKrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAkB,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5D,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CkB,CAAC;AAEpC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;CAsBiB,CAAC;AAEpC,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,WA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K,EAAE,cAAc,CAAC,cAAc,EAAE,eAAe,EAAE,eAAe,CAAC,CAAC;KACzE;CACF"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { CreateWorkflow, Task, TaskConfig } from "@workglow/task-graph";
7
+ import { FromSchema } from "@workglow/util";
8
+ declare const inputSchema: {
9
+ readonly type: "object";
10
+ readonly properties: {
11
+ readonly code: {
12
+ readonly type: "string";
13
+ readonly title: "Code";
14
+ readonly description: "JavaScript code to execute";
15
+ };
16
+ readonly input: {
17
+ readonly title: "Input";
18
+ readonly description: "Input data to pass to the JavaScript code";
19
+ };
20
+ };
21
+ readonly required: readonly ["code"];
22
+ readonly additionalProperties: false;
23
+ };
24
+ declare const outputSchema: {
25
+ readonly type: "object";
26
+ readonly properties: {
27
+ readonly output: {
28
+ readonly title: "Output";
29
+ readonly description: "The output of the JavaScript code";
30
+ };
31
+ };
32
+ readonly required: readonly ["output"];
33
+ readonly additionalProperties: false;
34
+ };
35
+ export type JavaScriptTaskInput = FromSchema<typeof inputSchema>;
36
+ export type JavaScriptTaskOutput = FromSchema<typeof outputSchema>;
37
+ export declare class JavaScriptTask extends Task<JavaScriptTaskInput, JavaScriptTaskOutput> {
38
+ static type: string;
39
+ static category: string;
40
+ static title: string;
41
+ static description: string;
42
+ static inputSchema(): {
43
+ readonly type: "object";
44
+ readonly properties: {
45
+ readonly code: {
46
+ readonly type: "string";
47
+ readonly title: "Code";
48
+ readonly description: "JavaScript code to execute";
49
+ };
50
+ readonly input: {
51
+ readonly title: "Input";
52
+ readonly description: "Input data to pass to the JavaScript code";
53
+ };
54
+ };
55
+ readonly required: readonly ["code"];
56
+ readonly additionalProperties: false;
57
+ };
58
+ static outputSchema(): {
59
+ readonly type: "object";
60
+ readonly properties: {
61
+ readonly output: {
62
+ readonly title: "Output";
63
+ readonly description: "The output of the JavaScript code";
64
+ };
65
+ };
66
+ readonly required: readonly ["output"];
67
+ readonly additionalProperties: false;
68
+ };
69
+ executeReactive(input: JavaScriptTaskInput, output: JavaScriptTaskOutput): Promise<{
70
+ output: unknown;
71
+ }>;
72
+ }
73
+ export declare const JavaScript: (input: JavaScriptTaskInput, config?: TaskConfig) => Promise<{
74
+ output: unknown;
75
+ }>;
76
+ declare module "@workglow/task-graph" {
77
+ interface Workflow {
78
+ JavaScript: CreateWorkflow<JavaScriptTaskInput, JavaScriptTaskOutput, TaskConfig>;
79
+ }
80
+ }
81
+ export {};
82
+ //# sourceMappingURL=JavaScriptTask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JavaScriptTask.d.ts","sourceRoot":"","sources":["../../src/task/JavaScriptTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,UAAU,EAA0B,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAkB,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5D,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;CAekB,CAAC;AAEpC,QAAA,MAAM,YAAY;;;;;;;;;;CAUiB,CAAC;AAEpC,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AACjE,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAEnE,qBAAa,cAAe,SAAQ,IAAI,CAAC,mBAAmB,EAAE,oBAAoB,CAAC;IACjF,OAAc,IAAI,SAAoB;IACtC,OAAc,QAAQ,SAAa;IACnC,OAAc,KAAK,SAA4B;IAC/C,OAAc,WAAW,SAAqE;WAEhF,WAAW;;;;;;;;;;;;;;;;WAIX,YAAY;;;;;;;;;;;IAIpB,eAAe,CAAC,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,oBAAoB;;;CAc/E;AAID,eAAO,MAAM,UAAU,GAAI,OAAO,mBAAmB,EAAE,SAAQ,UAAe;;EAE7E,CAAC;AAEF,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,UAAU,EAAE,cAAc,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,UAAU,CAAC,CAAC;KACnF;CACF"}
@@ -0,0 +1,72 @@
1
+ import { CreateWorkflow, GraphAsTask, TaskConfig } from "@workglow/task-graph";
2
+ import { FromSchema } from "@workglow/util";
3
+ declare const inputSchema: {
4
+ readonly type: "object";
5
+ readonly properties: {
6
+ readonly json: {
7
+ readonly type: "string";
8
+ readonly title: "JSON";
9
+ readonly description: "The JSON to parse";
10
+ };
11
+ };
12
+ readonly additionalProperties: false;
13
+ };
14
+ export type JsonTaskInput = FromSchema<typeof inputSchema>;
15
+ declare const outputSchema: {
16
+ readonly type: "object";
17
+ readonly properties: {
18
+ readonly output: {
19
+ readonly title: "Output";
20
+ readonly description: "Output depends on the generated task graph";
21
+ };
22
+ };
23
+ readonly additionalProperties: false;
24
+ };
25
+ export type JsonTaskOutput = FromSchema<typeof outputSchema>;
26
+ /**
27
+ * JsonTask is a specialized task that creates and manages task graphs from JSON configurations.
28
+ * It allows dynamic creation of task networks by parsing JSON definitions of tasks and their relationships.
29
+ */
30
+ export declare class JsonTask<Input extends JsonTaskInput = JsonTaskInput, Output extends JsonTaskOutput = JsonTaskOutput, Config extends TaskConfig = TaskConfig> extends GraphAsTask<Input, Output, Config> {
31
+ static type: string;
32
+ static category: string;
33
+ static inputSchema(): {
34
+ readonly type: "object";
35
+ readonly properties: {
36
+ readonly json: {
37
+ readonly type: "string";
38
+ readonly title: "JSON";
39
+ readonly description: "The JSON to parse";
40
+ };
41
+ };
42
+ readonly additionalProperties: false;
43
+ };
44
+ static outputSchema(): {
45
+ readonly type: "object";
46
+ readonly properties: {
47
+ readonly output: {
48
+ readonly title: "Output";
49
+ readonly description: "Output depends on the generated task graph";
50
+ };
51
+ };
52
+ readonly additionalProperties: false;
53
+ };
54
+ /**
55
+ * Regenerates the entire task graph based on the current JSON input
56
+ * Creates task nodes and establishes data flow connections between them
57
+ */
58
+ regenerateGraph(): void;
59
+ }
60
+ /**
61
+ * Convenience function to create and run a JsonTask
62
+ */
63
+ export declare const Json: (input: JsonTaskInput, config?: TaskConfig) => Promise<{
64
+ output?: unknown;
65
+ }>;
66
+ declare module "@workglow/task-graph" {
67
+ interface Workflow {
68
+ Json: CreateWorkflow<JsonTaskInput, JsonTaskOutput, TaskConfig>;
69
+ }
70
+ }
71
+ export {};
72
+ //# sourceMappingURL=JsonTask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonTask.d.ts","sourceRoot":"","sources":["../../src/task/JsonTask.ts"],"names":[],"mappings":"AAOA,OAAO,EAEH,cAAc,EAEd,WAAW,EAEX,UAAU,EAIb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAkB,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5D,QAAA,MAAM,WAAW;;;;;;;;;;CAUkB,CAAC;AAEpC,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAE3D,QAAA,MAAM,YAAY;;;;;;;;;CASiB,CAAC;AAEpC,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAE7D;;;GAGG;AACH,qBAAa,QAAQ,CACnB,KAAK,SAAS,aAAa,GAAG,aAAa,EAC3C,MAAM,SAAS,cAAc,GAAG,cAAc,EAC9C,MAAM,SAAS,UAAU,GAAG,UAAU,CACtC,SAAQ,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;IAC1C,OAAc,IAAI,SAAc;IAChC,OAAc,QAAQ,SAAY;WAEpB,WAAW;;;;;;;;;;;WAIX,YAAY;;;;;;;;;;IAI1B;;;OAGG;IACI,eAAe;CA0BvB;AAKD;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,OAAO,aAAa,EAAE,SAAQ,UAAe;;EAEjE,CAAC;AAGF,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,IAAI,EAAE,cAAc,CAAC,aAAa,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;KACjE;CACF"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { IExecuteContext, IExecuteReactiveContext, Task, TaskConfig, TaskInput, TaskOutput } from "@workglow/task-graph";
7
+ import { FromSchema } from "@workglow/util";
8
+ interface LambdaTaskConfig<Input extends TaskInput = TaskInput, Output extends TaskOutput = TaskOutput> extends TaskConfig {
9
+ execute?: (input: Input, context: IExecuteContext) => Promise<Output>;
10
+ executeReactive?: (input: Input, output: Output, context: IExecuteReactiveContext) => Promise<Output>;
11
+ }
12
+ declare const inputSchema: {
13
+ readonly type: "object";
14
+ readonly properties: {
15
+ readonly "*": {
16
+ readonly title: "Input";
17
+ readonly description: "Input data to pass to the function";
18
+ };
19
+ };
20
+ readonly additionalProperties: true;
21
+ };
22
+ declare const outputSchema: {
23
+ readonly type: "object";
24
+ readonly properties: {
25
+ readonly "*": {
26
+ readonly title: "Output";
27
+ readonly description: "The output from the execute function";
28
+ };
29
+ };
30
+ readonly additionalProperties: true;
31
+ };
32
+ export type LambdaTaskInput = FromSchema<typeof inputSchema>;
33
+ export type LambdaTaskOutput = FromSchema<typeof outputSchema>;
34
+ /**
35
+ * LambdaTask provides a way to execute arbitrary functions within the task framework
36
+ * It wraps a provided function and its input into a task that can be integrated
37
+ * into task graphs and workflows
38
+ */
39
+ export declare class LambdaTask<Input extends TaskInput = TaskInput, Output extends TaskOutput = TaskOutput, Config extends LambdaTaskConfig<Input, Output> = LambdaTaskConfig<Input, Output>> extends Task<Input, Output, Config> {
40
+ static type: string;
41
+ static category: string;
42
+ static cacheable: boolean;
43
+ static inputSchema(): {
44
+ readonly type: "object";
45
+ readonly properties: {
46
+ readonly "*": {
47
+ readonly title: "Input";
48
+ readonly description: "Input data to pass to the function";
49
+ };
50
+ };
51
+ readonly additionalProperties: true;
52
+ };
53
+ static outputSchema(): {
54
+ readonly type: "object";
55
+ readonly properties: {
56
+ readonly "*": {
57
+ readonly title: "Output";
58
+ readonly description: "The output from the execute function";
59
+ };
60
+ };
61
+ readonly additionalProperties: true;
62
+ };
63
+ constructor(input?: Partial<Input>, config?: Partial<Config>);
64
+ execute(input: Input, context: IExecuteContext): Promise<Output>;
65
+ /**
66
+ * Executes the provided function with the given input
67
+ * Throws an error if no function is provided or if the provided value is not callable
68
+ */
69
+ executeReactive(input: Input, output: Output, context: IExecuteReactiveContext): Promise<Output>;
70
+ }
71
+ export declare function process(value: string): string;
72
+ export declare function process(value: number): number;
73
+ export declare function process(value: boolean): string;
74
+ /**
75
+ * Convenience function to create and run a LambdaTask
76
+ */
77
+ export declare function Lambda<I extends TaskInput, O extends TaskOutput>(fn: (input: I, context: IExecuteContext) => Promise<O>): Promise<TaskOutput>;
78
+ export declare function Lambda<I extends TaskInput, O extends TaskOutput>(input: I, config?: LambdaTaskConfig<I, O>): Promise<TaskOutput>;
79
+ declare module "@workglow/task-graph" {
80
+ interface Workflow {
81
+ Lambda: <I extends TaskInput, O extends TaskOutput>(input: Partial<I>, config: LambdaTaskConfig<I, O>) => Workflow;
82
+ }
83
+ }
84
+ export {};
85
+ //# sourceMappingURL=LambdaTask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LambdaTask.d.ts","sourceRoot":"","sources":["../../src/task/LambdaTask.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGH,eAAe,EACf,uBAAuB,EACvB,IAAI,EACJ,UAAU,EAEV,SAAS,EACT,UAAU,EAGb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAkB,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5D,UAAU,gBAAgB,CACxB,KAAK,SAAS,SAAS,GAAG,SAAS,EACnC,MAAM,SAAS,UAAU,GAAG,UAAU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AC;AAC/C,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;AAC/C,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;AAQhD;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,UAAU,EAC9D,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,GACrD,OAAO,CAAC,UAAU,CAAC,CAAC;AACvB,wBAAgB,MAAM,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,UAAU,EAC9D,KAAK,EAAE,CAAC,EACR,MAAM,CAAC,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC9B,OAAO,CAAC,UAAU,CAAC,CAAC;AAkBvB,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,MAAM,EAAE,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,UAAU,EAChD,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EACjB,MAAM,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,KAC3B,QAAQ,CAAC;KACf;CACF"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export * from "./index";
7
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,SAAS,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2012 Marijn Haverbeke
4
+ * SPDX-License-Identifier: MIT
5
+ */
6
+ export var version: string;
7
+ /**
8
+ * @param {string} inpt
9
+ * @param {Object=} opts
10
+ * @returns
11
+ */
12
+ export function parse(inpt: string, opts?: Object | undefined): node_t;
13
+ /**
14
+ * @constructor
15
+ */
16
+ declare function node_t(): void;
17
+ declare class node_t {
18
+ type: any;
19
+ start: number;
20
+ end: any;
21
+ }
22
+ export {};
23
+ //# sourceMappingURL=acorn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorn.d.ts","sourceRoot":"","sources":["../../src/util/acorn.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAwBH,2BAAsB;AA8BtB;;;;GAIG;AACH,4BAJW,MAAM,SACN,MAAM,YAAC,UASjB;AA6wCD;;GAEG;AACH,gCAIC;;IAHC,UAAgB;IAChB,cAAqB;IACrB,SAAe"}