@ugm/desiagent 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +251 -0
- package/dist/__tests__/test-utils.d.ts +24 -0
- package/dist/__tests__/test-utils.d.ts.map +1 -0
- package/dist/__tests__/test-utils.js +32 -0
- package/dist/__tests__/test-utils.js.map +1 -0
- package/dist/core/execution/agents.d.ts +60 -0
- package/dist/core/execution/agents.d.ts.map +1 -0
- package/dist/core/execution/agents.js +249 -0
- package/dist/core/execution/agents.js.map +1 -0
- package/dist/core/execution/artifacts.d.ts +27 -0
- package/dist/core/execution/artifacts.d.ts.map +1 -0
- package/dist/core/execution/artifacts.js +93 -0
- package/dist/core/execution/artifacts.js.map +1 -0
- package/dist/core/execution/costs.d.ts +160 -0
- package/dist/core/execution/costs.d.ts.map +1 -0
- package/dist/core/execution/costs.js +196 -0
- package/dist/core/execution/costs.js.map +1 -0
- package/dist/core/execution/dagExecutor.d.ts +112 -0
- package/dist/core/execution/dagExecutor.d.ts.map +1 -0
- package/dist/core/execution/dagExecutor.js +647 -0
- package/dist/core/execution/dagExecutor.js.map +1 -0
- package/dist/core/execution/dags.d.ts +167 -0
- package/dist/core/execution/dags.d.ts.map +1 -0
- package/dist/core/execution/dags.js +713 -0
- package/dist/core/execution/dags.js.map +1 -0
- package/dist/core/execution/executions.d.ts +158 -0
- package/dist/core/execution/executions.d.ts.map +1 -0
- package/dist/core/execution/executions.js +258 -0
- package/dist/core/execution/executions.js.map +1 -0
- package/dist/core/execution/goals.d.ts +62 -0
- package/dist/core/execution/goals.d.ts.map +1 -0
- package/dist/core/execution/goals.js +245 -0
- package/dist/core/execution/goals.js.map +1 -0
- package/dist/core/execution/runs.d.ts +65 -0
- package/dist/core/execution/runs.d.ts.map +1 -0
- package/dist/core/execution/runs.js +219 -0
- package/dist/core/execution/runs.js.map +1 -0
- package/dist/core/execution/tools.d.ts +24 -0
- package/dist/core/execution/tools.d.ts.map +1 -0
- package/dist/core/execution/tools.js +33 -0
- package/dist/core/execution/tools.js.map +1 -0
- package/dist/core/orchestration/index.d.ts +7 -0
- package/dist/core/orchestration/index.d.ts.map +1 -0
- package/dist/core/orchestration/index.js +7 -0
- package/dist/core/orchestration/index.js.map +1 -0
- package/dist/core/orchestration/orchestrator.d.ts +39 -0
- package/dist/core/orchestration/orchestrator.d.ts.map +1 -0
- package/dist/core/orchestration/orchestrator.js +141 -0
- package/dist/core/orchestration/orchestrator.js.map +1 -0
- package/dist/core/orchestration/planner.d.ts +63 -0
- package/dist/core/orchestration/planner.d.ts.map +1 -0
- package/dist/core/orchestration/planner.js +99 -0
- package/dist/core/orchestration/planner.js.map +1 -0
- package/dist/core/providers/factory.d.ts +25 -0
- package/dist/core/providers/factory.d.ts.map +1 -0
- package/dist/core/providers/factory.js +86 -0
- package/dist/core/providers/factory.js.map +1 -0
- package/dist/core/providers/index.d.ts +11 -0
- package/dist/core/providers/index.d.ts.map +1 -0
- package/dist/core/providers/index.js +10 -0
- package/dist/core/providers/index.js.map +1 -0
- package/dist/core/providers/ollama.d.ts +36 -0
- package/dist/core/providers/ollama.d.ts.map +1 -0
- package/dist/core/providers/ollama.js +123 -0
- package/dist/core/providers/ollama.js.map +1 -0
- package/dist/core/providers/openai.d.ts +33 -0
- package/dist/core/providers/openai.d.ts.map +1 -0
- package/dist/core/providers/openai.js +114 -0
- package/dist/core/providers/openai.js.map +1 -0
- package/dist/core/providers/openrouter.d.ts +38 -0
- package/dist/core/providers/openrouter.d.ts.map +1 -0
- package/dist/core/providers/openrouter.js +269 -0
- package/dist/core/providers/openrouter.js.map +1 -0
- package/dist/core/providers/types.d.ts +101 -0
- package/dist/core/providers/types.d.ts.map +1 -0
- package/dist/core/providers/types.js +7 -0
- package/dist/core/providers/types.js.map +1 -0
- package/dist/core/tools/base.d.ts +56 -0
- package/dist/core/tools/base.d.ts.map +1 -0
- package/dist/core/tools/base.js +60 -0
- package/dist/core/tools/base.js.map +1 -0
- package/dist/core/tools/bash.d.ts +50 -0
- package/dist/core/tools/bash.d.ts.map +1 -0
- package/dist/core/tools/bash.js +179 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/edit.d.ts +39 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +67 -0
- package/dist/core/tools/edit.js.map +1 -0
- package/dist/core/tools/executor.d.ts +33 -0
- package/dist/core/tools/executor.d.ts.map +1 -0
- package/dist/core/tools/executor.js +105 -0
- package/dist/core/tools/executor.js.map +1 -0
- package/dist/core/tools/fetchPage.d.ts +46 -0
- package/dist/core/tools/fetchPage.d.ts.map +1 -0
- package/dist/core/tools/fetchPage.js +87 -0
- package/dist/core/tools/fetchPage.js.map +1 -0
- package/dist/core/tools/fetchURLs.d.ts +39 -0
- package/dist/core/tools/fetchURLs.d.ts.map +1 -0
- package/dist/core/tools/fetchURLs.js +67 -0
- package/dist/core/tools/fetchURLs.js.map +1 -0
- package/dist/core/tools/glob.d.ts +36 -0
- package/dist/core/tools/glob.d.ts.map +1 -0
- package/dist/core/tools/glob.js +78 -0
- package/dist/core/tools/glob.js.map +1 -0
- package/dist/core/tools/grep.d.ts +51 -0
- package/dist/core/tools/grep.d.ts.map +1 -0
- package/dist/core/tools/grep.js +152 -0
- package/dist/core/tools/grep.js.map +1 -0
- package/dist/core/tools/index.d.ts +22 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +22 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/llmExecute.d.ts +153 -0
- package/dist/core/tools/llmExecute.d.ts.map +1 -0
- package/dist/core/tools/llmExecute.js +105 -0
- package/dist/core/tools/llmExecute.js.map +1 -0
- package/dist/core/tools/readEmail.d.ts +68 -0
- package/dist/core/tools/readEmail.d.ts.map +1 -0
- package/dist/core/tools/readEmail.js +182 -0
- package/dist/core/tools/readEmail.js.map +1 -0
- package/dist/core/tools/readFile.d.ts +42 -0
- package/dist/core/tools/readFile.d.ts.map +1 -0
- package/dist/core/tools/readFile.js +79 -0
- package/dist/core/tools/readFile.js.map +1 -0
- package/dist/core/tools/registry.d.ts +53 -0
- package/dist/core/tools/registry.d.ts.map +1 -0
- package/dist/core/tools/registry.js +112 -0
- package/dist/core/tools/registry.js.map +1 -0
- package/dist/core/tools/sendEmail.d.ts +83 -0
- package/dist/core/tools/sendEmail.d.ts.map +1 -0
- package/dist/core/tools/sendEmail.js +132 -0
- package/dist/core/tools/sendEmail.js.map +1 -0
- package/dist/core/tools/sendWebhook.d.ts +48 -0
- package/dist/core/tools/sendWebhook.d.ts.map +1 -0
- package/dist/core/tools/sendWebhook.js +61 -0
- package/dist/core/tools/sendWebhook.js.map +1 -0
- package/dist/core/tools/webSearch.d.ts +34 -0
- package/dist/core/tools/webSearch.d.ts.map +1 -0
- package/dist/core/tools/webSearch.js +104 -0
- package/dist/core/tools/webSearch.js.map +1 -0
- package/dist/core/tools/writeFile.d.ts +49 -0
- package/dist/core/tools/writeFile.d.ts.map +1 -0
- package/dist/core/tools/writeFile.js +120 -0
- package/dist/core/tools/writeFile.js.map +1 -0
- package/dist/db/client.d.ts +22 -0
- package/dist/db/client.d.ts.map +1 -0
- package/dist/db/client.js +178 -0
- package/dist/db/client.js.map +1 -0
- package/dist/db/schema.d.ts +1846 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +175 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/errors/index.d.ts +80 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +135 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +172 -0
- package/dist/index.js.map +1 -0
- package/dist/services/initDB.d.ts +17 -0
- package/dist/services/initDB.d.ts.map +1 -0
- package/dist/services/initDB.js +212 -0
- package/dist/services/initDB.js.map +1 -0
- package/dist/types/agent.d.ts +354 -0
- package/dist/types/agent.d.ts.map +1 -0
- package/dist/types/agent.js +63 -0
- package/dist/types/agent.js.map +1 -0
- package/dist/types/client.d.ts +309 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/client.js +2 -0
- package/dist/types/client.js.map +1 -0
- package/dist/types/config.d.ts +96 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +33 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/dag.d.ts +253 -0
- package/dist/types/dag.d.ts.map +1 -0
- package/dist/types/dag.js +46 -0
- package/dist/types/dag.js.map +1 -0
- package/dist/types/execution.d.ts +171 -0
- package/dist/types/execution.d.ts.map +1 -0
- package/dist/types/execution.js +41 -0
- package/dist/types/execution.js.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +11 -0
- package/dist/types/index.js.map +1 -0
- package/dist/util/cron-validator.d.ts +16 -0
- package/dist/util/cron-validator.d.ts.map +1 -0
- package/dist/util/cron-validator.js +31 -0
- package/dist/util/cron-validator.js.map +1 -0
- package/dist/util/dag-utils.d.ts +54 -0
- package/dist/util/dag-utils.d.ts.map +1 -0
- package/dist/util/dag-utils.js +167 -0
- package/dist/util/dag-utils.js.map +1 -0
- package/dist/util/logger.d.ts +21 -0
- package/dist/util/logger.d.ts.map +1 -0
- package/dist/util/logger.js +87 -0
- package/dist/util/logger.js.map +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DAG-specific type definitions for decomposed tasks
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export declare const SubTaskSchema: z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
description: z.ZodString;
|
|
8
|
+
thought: z.ZodString;
|
|
9
|
+
action_type: z.ZodEnum<["tool", "inference"]>;
|
|
10
|
+
tool_or_prompt: z.ZodObject<{
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
name: string;
|
|
15
|
+
params?: Record<string, any> | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
name: string;
|
|
18
|
+
params?: Record<string, any> | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
expected_output: z.ZodString;
|
|
21
|
+
dependencies: z.ZodArray<z.ZodString, "many">;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
thought: string;
|
|
24
|
+
id: string;
|
|
25
|
+
description: string;
|
|
26
|
+
action_type: "tool" | "inference";
|
|
27
|
+
dependencies: string[];
|
|
28
|
+
tool_or_prompt: {
|
|
29
|
+
name: string;
|
|
30
|
+
params?: Record<string, any> | undefined;
|
|
31
|
+
};
|
|
32
|
+
expected_output: string;
|
|
33
|
+
}, {
|
|
34
|
+
thought: string;
|
|
35
|
+
id: string;
|
|
36
|
+
description: string;
|
|
37
|
+
action_type: "tool" | "inference";
|
|
38
|
+
dependencies: string[];
|
|
39
|
+
tool_or_prompt: {
|
|
40
|
+
name: string;
|
|
41
|
+
params?: Record<string, any> | undefined;
|
|
42
|
+
};
|
|
43
|
+
expected_output: string;
|
|
44
|
+
}>;
|
|
45
|
+
export declare const DecomposerJobSchema: z.ZodEffects<z.ZodObject<{
|
|
46
|
+
original_request: z.ZodString;
|
|
47
|
+
intent: z.ZodObject<{
|
|
48
|
+
primary: z.ZodString;
|
|
49
|
+
sub_intents: z.ZodArray<z.ZodString, "many">;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
primary: string;
|
|
52
|
+
sub_intents: string[];
|
|
53
|
+
}, {
|
|
54
|
+
primary: string;
|
|
55
|
+
sub_intents: string[];
|
|
56
|
+
}>;
|
|
57
|
+
entities: z.ZodArray<z.ZodObject<{
|
|
58
|
+
entity: z.ZodString;
|
|
59
|
+
type: z.ZodString;
|
|
60
|
+
grounded_value: z.ZodString;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
type: string;
|
|
63
|
+
entity: string;
|
|
64
|
+
grounded_value: string;
|
|
65
|
+
}, {
|
|
66
|
+
type: string;
|
|
67
|
+
entity: string;
|
|
68
|
+
grounded_value: string;
|
|
69
|
+
}>, "many">;
|
|
70
|
+
sub_tasks: z.ZodArray<z.ZodObject<{
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
description: z.ZodString;
|
|
73
|
+
thought: z.ZodString;
|
|
74
|
+
action_type: z.ZodEnum<["tool", "inference"]>;
|
|
75
|
+
tool_or_prompt: z.ZodObject<{
|
|
76
|
+
name: z.ZodString;
|
|
77
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
name: string;
|
|
80
|
+
params?: Record<string, any> | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
name: string;
|
|
83
|
+
params?: Record<string, any> | undefined;
|
|
84
|
+
}>;
|
|
85
|
+
expected_output: z.ZodString;
|
|
86
|
+
dependencies: z.ZodArray<z.ZodString, "many">;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
thought: string;
|
|
89
|
+
id: string;
|
|
90
|
+
description: string;
|
|
91
|
+
action_type: "tool" | "inference";
|
|
92
|
+
dependencies: string[];
|
|
93
|
+
tool_or_prompt: {
|
|
94
|
+
name: string;
|
|
95
|
+
params?: Record<string, any> | undefined;
|
|
96
|
+
};
|
|
97
|
+
expected_output: string;
|
|
98
|
+
}, {
|
|
99
|
+
thought: string;
|
|
100
|
+
id: string;
|
|
101
|
+
description: string;
|
|
102
|
+
action_type: "tool" | "inference";
|
|
103
|
+
dependencies: string[];
|
|
104
|
+
tool_or_prompt: {
|
|
105
|
+
name: string;
|
|
106
|
+
params?: Record<string, any> | undefined;
|
|
107
|
+
};
|
|
108
|
+
expected_output: string;
|
|
109
|
+
}>, "many">;
|
|
110
|
+
synthesis_plan: z.ZodString;
|
|
111
|
+
validation: z.ZodObject<{
|
|
112
|
+
coverage: z.ZodString;
|
|
113
|
+
gaps: z.ZodArray<z.ZodString, "many">;
|
|
114
|
+
iteration_triggers: z.ZodArray<z.ZodString, "many">;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
coverage: string;
|
|
117
|
+
gaps: string[];
|
|
118
|
+
iteration_triggers: string[];
|
|
119
|
+
}, {
|
|
120
|
+
coverage: string;
|
|
121
|
+
gaps: string[];
|
|
122
|
+
iteration_triggers: string[];
|
|
123
|
+
}>;
|
|
124
|
+
clarification_needed: z.ZodBoolean;
|
|
125
|
+
clarification_query: z.ZodOptional<z.ZodString>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
validation: {
|
|
128
|
+
coverage: string;
|
|
129
|
+
gaps: string[];
|
|
130
|
+
iteration_triggers: string[];
|
|
131
|
+
};
|
|
132
|
+
original_request: string;
|
|
133
|
+
intent: {
|
|
134
|
+
primary: string;
|
|
135
|
+
sub_intents: string[];
|
|
136
|
+
};
|
|
137
|
+
entities: {
|
|
138
|
+
type: string;
|
|
139
|
+
entity: string;
|
|
140
|
+
grounded_value: string;
|
|
141
|
+
}[];
|
|
142
|
+
sub_tasks: {
|
|
143
|
+
thought: string;
|
|
144
|
+
id: string;
|
|
145
|
+
description: string;
|
|
146
|
+
action_type: "tool" | "inference";
|
|
147
|
+
dependencies: string[];
|
|
148
|
+
tool_or_prompt: {
|
|
149
|
+
name: string;
|
|
150
|
+
params?: Record<string, any> | undefined;
|
|
151
|
+
};
|
|
152
|
+
expected_output: string;
|
|
153
|
+
}[];
|
|
154
|
+
synthesis_plan: string;
|
|
155
|
+
clarification_needed: boolean;
|
|
156
|
+
clarification_query?: string | undefined;
|
|
157
|
+
}, {
|
|
158
|
+
validation: {
|
|
159
|
+
coverage: string;
|
|
160
|
+
gaps: string[];
|
|
161
|
+
iteration_triggers: string[];
|
|
162
|
+
};
|
|
163
|
+
original_request: string;
|
|
164
|
+
intent: {
|
|
165
|
+
primary: string;
|
|
166
|
+
sub_intents: string[];
|
|
167
|
+
};
|
|
168
|
+
entities: {
|
|
169
|
+
type: string;
|
|
170
|
+
entity: string;
|
|
171
|
+
grounded_value: string;
|
|
172
|
+
}[];
|
|
173
|
+
sub_tasks: {
|
|
174
|
+
thought: string;
|
|
175
|
+
id: string;
|
|
176
|
+
description: string;
|
|
177
|
+
action_type: "tool" | "inference";
|
|
178
|
+
dependencies: string[];
|
|
179
|
+
tool_or_prompt: {
|
|
180
|
+
name: string;
|
|
181
|
+
params?: Record<string, any> | undefined;
|
|
182
|
+
};
|
|
183
|
+
expected_output: string;
|
|
184
|
+
}[];
|
|
185
|
+
synthesis_plan: string;
|
|
186
|
+
clarification_needed: boolean;
|
|
187
|
+
clarification_query?: string | undefined;
|
|
188
|
+
}>, {
|
|
189
|
+
validation: {
|
|
190
|
+
coverage: string;
|
|
191
|
+
gaps: string[];
|
|
192
|
+
iteration_triggers: string[];
|
|
193
|
+
};
|
|
194
|
+
original_request: string;
|
|
195
|
+
intent: {
|
|
196
|
+
primary: string;
|
|
197
|
+
sub_intents: string[];
|
|
198
|
+
};
|
|
199
|
+
entities: {
|
|
200
|
+
type: string;
|
|
201
|
+
entity: string;
|
|
202
|
+
grounded_value: string;
|
|
203
|
+
}[];
|
|
204
|
+
sub_tasks: {
|
|
205
|
+
thought: string;
|
|
206
|
+
id: string;
|
|
207
|
+
description: string;
|
|
208
|
+
action_type: "tool" | "inference";
|
|
209
|
+
dependencies: string[];
|
|
210
|
+
tool_or_prompt: {
|
|
211
|
+
name: string;
|
|
212
|
+
params?: Record<string, any> | undefined;
|
|
213
|
+
};
|
|
214
|
+
expected_output: string;
|
|
215
|
+
}[];
|
|
216
|
+
synthesis_plan: string;
|
|
217
|
+
clarification_needed: boolean;
|
|
218
|
+
clarification_query?: string | undefined;
|
|
219
|
+
}, {
|
|
220
|
+
validation: {
|
|
221
|
+
coverage: string;
|
|
222
|
+
gaps: string[];
|
|
223
|
+
iteration_triggers: string[];
|
|
224
|
+
};
|
|
225
|
+
original_request: string;
|
|
226
|
+
intent: {
|
|
227
|
+
primary: string;
|
|
228
|
+
sub_intents: string[];
|
|
229
|
+
};
|
|
230
|
+
entities: {
|
|
231
|
+
type: string;
|
|
232
|
+
entity: string;
|
|
233
|
+
grounded_value: string;
|
|
234
|
+
}[];
|
|
235
|
+
sub_tasks: {
|
|
236
|
+
thought: string;
|
|
237
|
+
id: string;
|
|
238
|
+
description: string;
|
|
239
|
+
action_type: "tool" | "inference";
|
|
240
|
+
dependencies: string[];
|
|
241
|
+
tool_or_prompt: {
|
|
242
|
+
name: string;
|
|
243
|
+
params?: Record<string, any> | undefined;
|
|
244
|
+
};
|
|
245
|
+
expected_output: string;
|
|
246
|
+
}[];
|
|
247
|
+
synthesis_plan: string;
|
|
248
|
+
clarification_needed: boolean;
|
|
249
|
+
clarification_query?: string | undefined;
|
|
250
|
+
}>;
|
|
251
|
+
export type SubTask = z.infer<typeof SubTaskSchema>;
|
|
252
|
+
export type DecomposerJob = z.infer<typeof DecomposerJobSchema>;
|
|
253
|
+
//# sourceMappingURL=dag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dag.d.ts","sourceRoot":"","sources":["../../src/types/dag.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWxB,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+B/B,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DAG-specific type definitions for decomposed tasks
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export const SubTaskSchema = z.object({
|
|
6
|
+
id: z.string(),
|
|
7
|
+
description: z.string(),
|
|
8
|
+
thought: z.string(),
|
|
9
|
+
action_type: z.enum(['tool', 'inference']),
|
|
10
|
+
tool_or_prompt: z.object({
|
|
11
|
+
name: z.string(),
|
|
12
|
+
params: z.record(z.any()).optional(),
|
|
13
|
+
}),
|
|
14
|
+
expected_output: z.string(),
|
|
15
|
+
dependencies: z.array(z.string()),
|
|
16
|
+
});
|
|
17
|
+
export const DecomposerJobSchema = z.object({
|
|
18
|
+
original_request: z.string(),
|
|
19
|
+
intent: z.object({
|
|
20
|
+
primary: z.string(),
|
|
21
|
+
sub_intents: z.array(z.string()),
|
|
22
|
+
}),
|
|
23
|
+
entities: z.array(z.object({
|
|
24
|
+
entity: z.string(),
|
|
25
|
+
type: z.string(),
|
|
26
|
+
grounded_value: z.string(),
|
|
27
|
+
})),
|
|
28
|
+
sub_tasks: z.array(SubTaskSchema),
|
|
29
|
+
synthesis_plan: z.string(),
|
|
30
|
+
validation: z.object({
|
|
31
|
+
coverage: z.string(),
|
|
32
|
+
gaps: z.array(z.string()),
|
|
33
|
+
iteration_triggers: z.array(z.string()),
|
|
34
|
+
}),
|
|
35
|
+
clarification_needed: z.boolean(),
|
|
36
|
+
clarification_query: z.string().optional(),
|
|
37
|
+
}).refine((data) => {
|
|
38
|
+
if (data.clarification_needed) {
|
|
39
|
+
return typeof data.clarification_query === 'string' && data.clarification_query.length > 0;
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
}, {
|
|
43
|
+
message: 'clarification_query is required when clarification_needed is true',
|
|
44
|
+
path: ['clarification_query'],
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=dag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dag.js","sourceRoot":"","sources":["../../src/types/dag.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC1C,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC;QACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;KACrC,CAAC;IACF,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAClC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KACjC,CAAC;IACF,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACzB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;KAC3B,CAAC,CAAC;IACH,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC;IACjC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;QACnB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QACzB,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KACxC,CAAC;IACF,oBAAoB,EAAE,CAAC,CAAC,OAAO,EAAE;IACjC,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC,MAAM,CACP,CAAC,IAAI,EAAE,EAAE;IACP,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC9B,OAAO,OAAO,IAAI,CAAC,mBAAmB,KAAK,QAAQ,IAAI,IAAI,CAAC,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,EACD;IACE,OAAO,EAAE,mEAAmE;IAC5E,IAAI,EAAE,CAAC,qBAAqB,CAAC;CAC9B,CACF,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Status states for DAG executions
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ExecutionStatus {
|
|
6
|
+
Pending = "pending",
|
|
7
|
+
Active = "active",
|
|
8
|
+
Paused = "paused",
|
|
9
|
+
Completed = "completed",
|
|
10
|
+
Failed = "failed",
|
|
11
|
+
Cancelled = "cancelled"
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* DAG (Directed Acyclic Graph) represents a decomposed workflow
|
|
15
|
+
*/
|
|
16
|
+
export interface DAG {
|
|
17
|
+
id: string;
|
|
18
|
+
objective: string;
|
|
19
|
+
nodes: DAGNode[];
|
|
20
|
+
edges: DAGEdge[];
|
|
21
|
+
status: ExecutionStatus;
|
|
22
|
+
createdAt: Date;
|
|
23
|
+
updatedAt: Date;
|
|
24
|
+
metadata?: Record<string, any>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Node in a DAG
|
|
28
|
+
*/
|
|
29
|
+
export interface DAGNode {
|
|
30
|
+
id: string;
|
|
31
|
+
label: string;
|
|
32
|
+
description: string;
|
|
33
|
+
agentId?: string;
|
|
34
|
+
type: 'task' | 'decision' | 'parallel' | 'sequential';
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Edge connecting nodes in a DAG
|
|
38
|
+
*/
|
|
39
|
+
export interface DAGEdge {
|
|
40
|
+
from: string;
|
|
41
|
+
to: string;
|
|
42
|
+
condition?: string;
|
|
43
|
+
metadata?: Record<string, any>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* DAG execution status enum
|
|
47
|
+
*/
|
|
48
|
+
export type DAGExecutionStatus = 'pending' | 'running' | 'waiting' | 'completed' | 'failed' | 'partial' | 'suspended';
|
|
49
|
+
/**
|
|
50
|
+
* SubStep status enum
|
|
51
|
+
*/
|
|
52
|
+
export type SubStepStatus = 'pending' | 'running' | 'waiting' | 'completed' | 'failed';
|
|
53
|
+
/**
|
|
54
|
+
* Execution of a DAG
|
|
55
|
+
*/
|
|
56
|
+
export interface DAGExecution {
|
|
57
|
+
id: string;
|
|
58
|
+
dagId: string | null;
|
|
59
|
+
originalRequest: string;
|
|
60
|
+
primaryIntent: string;
|
|
61
|
+
status: DAGExecutionStatus;
|
|
62
|
+
startedAt: Date | null;
|
|
63
|
+
completedAt: Date | null;
|
|
64
|
+
durationMs: number | null;
|
|
65
|
+
totalTasks: number;
|
|
66
|
+
completedTasks: number;
|
|
67
|
+
failedTasks: number;
|
|
68
|
+
waitingTasks: number;
|
|
69
|
+
finalResult: string | null;
|
|
70
|
+
synthesisResult: string | null;
|
|
71
|
+
suspendedReason: string | null;
|
|
72
|
+
suspendedAt: Date | null;
|
|
73
|
+
retryCount: number;
|
|
74
|
+
lastRetryAt: Date | null;
|
|
75
|
+
totalUsage: {
|
|
76
|
+
promptTokens: number;
|
|
77
|
+
completionTokens: number;
|
|
78
|
+
totalTokens: number;
|
|
79
|
+
} | null;
|
|
80
|
+
totalCostUsd: string | null;
|
|
81
|
+
createdAt: Date;
|
|
82
|
+
updatedAt: Date;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* DAGExecution with included subSteps
|
|
86
|
+
*/
|
|
87
|
+
export interface DAGExecutionWithSteps extends DAGExecution {
|
|
88
|
+
subSteps: SubStep[];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Result from listForDag method
|
|
92
|
+
*/
|
|
93
|
+
export interface DagExecutionListResult {
|
|
94
|
+
executions: DAGExecution[];
|
|
95
|
+
total: number;
|
|
96
|
+
limit: number;
|
|
97
|
+
offset: number;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Sub-step within a DAG execution
|
|
101
|
+
*/
|
|
102
|
+
export interface SubStep {
|
|
103
|
+
id: string;
|
|
104
|
+
executionId: string;
|
|
105
|
+
taskId: string;
|
|
106
|
+
description: string;
|
|
107
|
+
thought: string;
|
|
108
|
+
actionType: 'tool' | 'inference';
|
|
109
|
+
toolOrPromptName: string;
|
|
110
|
+
toolOrPromptParams: Record<string, any> | null;
|
|
111
|
+
dependencies: string[];
|
|
112
|
+
status: SubStepStatus;
|
|
113
|
+
startedAt: Date | null;
|
|
114
|
+
completedAt: Date | null;
|
|
115
|
+
durationMs: number | null;
|
|
116
|
+
result: any | null;
|
|
117
|
+
error: string | null;
|
|
118
|
+
usage: {
|
|
119
|
+
promptTokens?: number;
|
|
120
|
+
completionTokens?: number;
|
|
121
|
+
totalTokens?: number;
|
|
122
|
+
} | null;
|
|
123
|
+
costUsd: string | null;
|
|
124
|
+
generationStats: Record<string, any> | null;
|
|
125
|
+
createdAt: Date;
|
|
126
|
+
updatedAt: Date;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Execution event for streaming
|
|
130
|
+
*/
|
|
131
|
+
export declare enum ExecutionEventType {
|
|
132
|
+
Started = "execution:started",
|
|
133
|
+
StepCompleted = "execution:step_completed",
|
|
134
|
+
StepFailed = "execution:step_failed",
|
|
135
|
+
ToolCalled = "execution:tool_called",
|
|
136
|
+
ToolCompleted = "execution:tool_completed",
|
|
137
|
+
ToolFailed = "execution:tool_failed",
|
|
138
|
+
Completed = "execution:completed",
|
|
139
|
+
Failed = "execution:failed",
|
|
140
|
+
Paused = "execution:paused",
|
|
141
|
+
Resumed = "execution:resumed"
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Stream-friendly execution event
|
|
145
|
+
*/
|
|
146
|
+
export interface ExecutionEvent {
|
|
147
|
+
type: ExecutionEventType;
|
|
148
|
+
executionId: string;
|
|
149
|
+
timestamp: Date;
|
|
150
|
+
stepIndex?: number;
|
|
151
|
+
data?: Record<string, any>;
|
|
152
|
+
error?: {
|
|
153
|
+
message: string;
|
|
154
|
+
code?: string;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Filter options for querying DAGs
|
|
159
|
+
*/
|
|
160
|
+
export interface DAGFilter {
|
|
161
|
+
status?: ExecutionStatus;
|
|
162
|
+
createdAfter?: Date;
|
|
163
|
+
createdBefore?: Date;
|
|
164
|
+
limit?: number;
|
|
165
|
+
offset?: number;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Zod schema for validation
|
|
169
|
+
*/
|
|
170
|
+
export declare const ExecutionStatusSchema: z.ZodEnum<["pending", "active", "paused", "completed", "failed", "cancelled"]>;
|
|
171
|
+
//# sourceMappingURL=execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/types/execution.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Status states for DAG executions
|
|
4
|
+
*/
|
|
5
|
+
export var ExecutionStatus;
|
|
6
|
+
(function (ExecutionStatus) {
|
|
7
|
+
ExecutionStatus["Pending"] = "pending";
|
|
8
|
+
ExecutionStatus["Active"] = "active";
|
|
9
|
+
ExecutionStatus["Paused"] = "paused";
|
|
10
|
+
ExecutionStatus["Completed"] = "completed";
|
|
11
|
+
ExecutionStatus["Failed"] = "failed";
|
|
12
|
+
ExecutionStatus["Cancelled"] = "cancelled";
|
|
13
|
+
})(ExecutionStatus || (ExecutionStatus = {}));
|
|
14
|
+
/**
|
|
15
|
+
* Execution event for streaming
|
|
16
|
+
*/
|
|
17
|
+
export var ExecutionEventType;
|
|
18
|
+
(function (ExecutionEventType) {
|
|
19
|
+
ExecutionEventType["Started"] = "execution:started";
|
|
20
|
+
ExecutionEventType["StepCompleted"] = "execution:step_completed";
|
|
21
|
+
ExecutionEventType["StepFailed"] = "execution:step_failed";
|
|
22
|
+
ExecutionEventType["ToolCalled"] = "execution:tool_called";
|
|
23
|
+
ExecutionEventType["ToolCompleted"] = "execution:tool_completed";
|
|
24
|
+
ExecutionEventType["ToolFailed"] = "execution:tool_failed";
|
|
25
|
+
ExecutionEventType["Completed"] = "execution:completed";
|
|
26
|
+
ExecutionEventType["Failed"] = "execution:failed";
|
|
27
|
+
ExecutionEventType["Paused"] = "execution:paused";
|
|
28
|
+
ExecutionEventType["Resumed"] = "execution:resumed";
|
|
29
|
+
})(ExecutionEventType || (ExecutionEventType = {}));
|
|
30
|
+
/**
|
|
31
|
+
* Zod schema for validation
|
|
32
|
+
*/
|
|
33
|
+
export const ExecutionStatusSchema = z.enum([
|
|
34
|
+
'pending',
|
|
35
|
+
'active',
|
|
36
|
+
'paused',
|
|
37
|
+
'completed',
|
|
38
|
+
'failed',
|
|
39
|
+
'cancelled',
|
|
40
|
+
]);
|
|
41
|
+
//# sourceMappingURL=execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../src/types/execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAN,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,0CAAuB,CAAA;IACvB,oCAAiB,CAAA;IACjB,0CAAuB,CAAA;AACzB,CAAC,EAPW,eAAe,KAAf,eAAe,QAO1B;AA0ID;;GAEG;AACH,MAAM,CAAN,IAAY,kBAWX;AAXD,WAAY,kBAAkB;IAC5B,mDAA6B,CAAA;IAC7B,gEAA0C,CAAA;IAC1C,0DAAoC,CAAA;IACpC,0DAAoC,CAAA;IACpC,gEAA0C,CAAA;IAC1C,0DAAoC,CAAA;IACpC,uDAAiC,CAAA;IACjC,iDAA2B,CAAA;IAC3B,iDAA2B,CAAA;IAC3B,mDAA6B,CAAA;AAC/B,CAAC,EAXW,kBAAkB,KAAlB,kBAAkB,QAW7B;AA4BD;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC1C,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,WAAW;CACZ,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* desiAgent Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* This module exports all public type definitions for the desiAgent library.
|
|
5
|
+
*/
|
|
6
|
+
export type { DesiAgentConfig, ProcessedDesiAgentConfig } from './config.js';
|
|
7
|
+
export { DesiAgentConfigSchema, type LLMProvider, type LogLevel } from './config.js';
|
|
8
|
+
export { ExecutionStatus, ExecutionEventType, type DAG, type DAGNode, type DAGEdge, type DAGExecution, type DAGExecutionWithSteps, type DagExecutionListResult, type DAGExecutionStatus, type SubStep, type SubStepStatus, type ExecutionEvent, type DAGFilter, ExecutionStatusSchema, } from './execution.js';
|
|
9
|
+
export { type ExecutionConfig } from '../core/execution/dagExecutor.js';
|
|
10
|
+
export { type Agent, type AgentConstraints, type Tool, type ToolDefinition, type ToolParameter, type ToolCall, type ToolResult, type AgentDefinition, AgentConstraintsSchema, ToolParameterSchema, ToolSchema, ToolCallSchema, ToolResultSchema, AgentSchema, } from './agent.js';
|
|
11
|
+
export type { DesiAgentClient } from './client.js';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGrF,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,KAAK,GAAG,EACR,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGxE,OAAO,EACL,KAAK,KAAK,EACV,KAAK,gBAAgB,EACrB,KAAK,IAAI,EACT,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,WAAW,GACZ,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* desiAgent Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* This module exports all public type definitions for the desiAgent library.
|
|
5
|
+
*/
|
|
6
|
+
export { DesiAgentConfigSchema } from './config.js';
|
|
7
|
+
// Execution types
|
|
8
|
+
export { ExecutionStatus, ExecutionEventType, ExecutionStatusSchema, } from './execution.js';
|
|
9
|
+
// Agent types
|
|
10
|
+
export { AgentConstraintsSchema, ToolParameterSchema, ToolSchema, ToolCallSchema, ToolResultSchema, AgentSchema, } from './agent.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,qBAAqB,EAAmC,MAAM,aAAa,CAAC;AAErF,kBAAkB;AAClB,OAAO,EACL,eAAe,EACf,kBAAkB,EAYlB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAKxB,cAAc;AACd,OAAO,EASL,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,WAAW,GACZ,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cron expression validation utilities
|
|
3
|
+
*/
|
|
4
|
+
export interface CronValidationResult {
|
|
5
|
+
valid: boolean;
|
|
6
|
+
error?: string;
|
|
7
|
+
nextRuns?: Date[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Validates a cron expression and optionally returns the next scheduled runs.
|
|
11
|
+
* @param cronExpr - The cron expression to validate (e.g., "0 0 * * *")
|
|
12
|
+
* @param numNextRuns - Number of next run times to calculate (default: 3)
|
|
13
|
+
* @returns Validation result with optional next run times
|
|
14
|
+
*/
|
|
15
|
+
export declare function validateCronExpression(cronExpr: string, numNextRuns?: number): CronValidationResult;
|
|
16
|
+
//# sourceMappingURL=cron-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cron-validator.d.ts","sourceRoot":"","sources":["../../src/util/cron-validator.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,WAAW,SAAI,GACd,oBAAoB,CAoBtB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cron expression validation utilities
|
|
3
|
+
*/
|
|
4
|
+
import { CronExpressionParser } from 'cron-parser';
|
|
5
|
+
/**
|
|
6
|
+
* Validates a cron expression and optionally returns the next scheduled runs.
|
|
7
|
+
* @param cronExpr - The cron expression to validate (e.g., "0 0 * * *")
|
|
8
|
+
* @param numNextRuns - Number of next run times to calculate (default: 3)
|
|
9
|
+
* @returns Validation result with optional next run times
|
|
10
|
+
*/
|
|
11
|
+
export function validateCronExpression(cronExpr, numNextRuns = 3) {
|
|
12
|
+
try {
|
|
13
|
+
const expression = CronExpressionParser.parse(cronExpr);
|
|
14
|
+
const nextRuns = [];
|
|
15
|
+
for (let i = 0; i < numNextRuns; i++) {
|
|
16
|
+
nextRuns.push(expression.next().toDate());
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
valid: true,
|
|
20
|
+
nextRuns,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
const error = err;
|
|
25
|
+
return {
|
|
26
|
+
valid: false,
|
|
27
|
+
error: error.message,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=cron-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cron-validator.js","sourceRoot":"","sources":["../../src/util/cron-validator.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAQnD;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CACpC,QAAgB,EAChB,WAAW,GAAG,CAAC;IAEf,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACxD,MAAM,QAAQ,GAAW,EAAE,CAAC;QAE5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,CAAC,EAAE,EAAE,CAAC;YACrC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO;YACL,KAAK,EAAE,IAAI;YACX,QAAQ;SACT,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,KAAK,GAAG,GAAY,CAAC;QAC3B,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,KAAK,CAAC,OAAO;SACrB,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for DAG operations
|
|
3
|
+
*/
|
|
4
|
+
import type { DecomposerJob } from '../types/dag.js';
|
|
5
|
+
/**
|
|
6
|
+
* Extracts and parses JSON content from a markdown code block.
|
|
7
|
+
* @param response - The markdown string containing a JSON code block
|
|
8
|
+
* @returns The parsed JSON object
|
|
9
|
+
* @throws Error if no JSON code block is found or parsing fails
|
|
10
|
+
*/
|
|
11
|
+
export declare function extractJsonCodeBlock(response: string): unknown;
|
|
12
|
+
/**
|
|
13
|
+
* Extracts and parses JSON content from a markdown code block with detailed diagnostics.
|
|
14
|
+
* Provides specific error locations and context for large JSON objects.
|
|
15
|
+
* @param response - The markdown string containing a JSON code block
|
|
16
|
+
* @returns The parsed JSON object
|
|
17
|
+
* @throws Error with detailed diagnostics if extraction or parsing fails
|
|
18
|
+
*/
|
|
19
|
+
export declare function extractCodeBlock(response: string): unknown;
|
|
20
|
+
/**
|
|
21
|
+
* Truncates a string to a specified length.
|
|
22
|
+
* @param str - The string to truncate
|
|
23
|
+
* @param numChars - Maximum number of characters (default: 2000)
|
|
24
|
+
* @returns The truncated string
|
|
25
|
+
*/
|
|
26
|
+
export declare function truncate(str: string, numChars?: number): string;
|
|
27
|
+
/**
|
|
28
|
+
* Truncates goal text for logging purposes.
|
|
29
|
+
* @param goalText - The goal text to truncate
|
|
30
|
+
* @returns Truncated text with ellipsis if needed
|
|
31
|
+
*/
|
|
32
|
+
export declare function truncateForLog(goalText: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Parses a date string or relative date expression.
|
|
35
|
+
* @param dateStr - Date string (ISO format or relative like "7d", "2w", "1m")
|
|
36
|
+
* @param defaultDate - Default date to use if dateStr is undefined
|
|
37
|
+
* @returns Parsed Date object
|
|
38
|
+
*/
|
|
39
|
+
export declare function parseDate(dateStr: string | undefined, defaultDate: Date): Date;
|
|
40
|
+
/**
|
|
41
|
+
* Formats a date according to the specified grouping.
|
|
42
|
+
* @param date - The date to format
|
|
43
|
+
* @param groupBy - Grouping type ('day', 'week', 'month')
|
|
44
|
+
* @returns Formatted date string
|
|
45
|
+
*/
|
|
46
|
+
export declare function formatDateByGroup(date: Date, groupBy: 'day' | 'week' | 'month'): string;
|
|
47
|
+
/**
|
|
48
|
+
* Renumbers sub_tasks IDs to sequential "001", "002", etc. format
|
|
49
|
+
* and updates all dependency references accordingly.
|
|
50
|
+
* @param data - The decomposer job containing sub_tasks
|
|
51
|
+
* @returns The same decomposer job with renumbered task IDs
|
|
52
|
+
*/
|
|
53
|
+
export declare function renumberSubTasks(data: DecomposerJob): DecomposerJob;
|
|
54
|
+
//# sourceMappingURL=dag-utils.d.ts.map
|