@bluelibs/runner-dev 4.1.0 → 4.2.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.
Files changed (154) hide show
  1. package/AI.md +40 -43
  2. package/README.md +70 -0
  3. package/dist/architect/core/errors.d.ts +39 -0
  4. package/dist/architect/core/errors.js +143 -0
  5. package/dist/architect/core/errors.js.map +1 -0
  6. package/dist/architect/core/index.d.ts +3 -0
  7. package/dist/architect/core/index.js +21 -0
  8. package/dist/architect/core/index.js.map +1 -0
  9. package/dist/architect/core/interfaces.d.ts +158 -0
  10. package/dist/architect/core/interfaces.js +3 -0
  11. package/dist/architect/core/interfaces.js.map +1 -0
  12. package/dist/architect/core/types.d.ts +544 -0
  13. package/dist/architect/core/types.js +49 -0
  14. package/dist/architect/core/types.js.map +1 -0
  15. package/dist/architect/execution/executor.d.ts +23 -0
  16. package/dist/architect/execution/executor.js +476 -0
  17. package/dist/architect/execution/executor.js.map +1 -0
  18. package/dist/architect/execution/index.d.ts +1 -0
  19. package/dist/architect/execution/index.js +19 -0
  20. package/dist/architect/execution/index.js.map +1 -0
  21. package/dist/architect/executor.d.ts +7 -0
  22. package/dist/architect/executor.js +150 -0
  23. package/dist/architect/executor.js.map +1 -0
  24. package/dist/architect/index.d.ts +45 -0
  25. package/dist/architect/index.js +76 -0
  26. package/dist/architect/index.js.map +1 -0
  27. package/dist/architect/llmClient.d.ts +10 -0
  28. package/dist/architect/llmClient.js +33 -0
  29. package/dist/architect/llmClient.js.map +1 -0
  30. package/dist/architect/models/base.d.ts +16 -0
  31. package/dist/architect/models/base.js +68 -0
  32. package/dist/architect/models/base.js.map +1 -0
  33. package/dist/architect/models/factory.d.ts +16 -0
  34. package/dist/architect/models/factory.js +73 -0
  35. package/dist/architect/models/factory.js.map +1 -0
  36. package/dist/architect/models/index.d.ts +3 -0
  37. package/dist/architect/models/index.js +21 -0
  38. package/dist/architect/models/index.js.map +1 -0
  39. package/dist/architect/models/openai.d.ts +7 -0
  40. package/dist/architect/models/openai.js +71 -0
  41. package/dist/architect/models/openai.js.map +1 -0
  42. package/dist/architect/planner.d.ts +9 -0
  43. package/dist/architect/planner.js +42 -0
  44. package/dist/architect/planner.js.map +1 -0
  45. package/dist/architect/planning/index.d.ts +4 -0
  46. package/dist/architect/planning/index.js +22 -0
  47. package/dist/architect/planning/index.js.map +1 -0
  48. package/dist/architect/planning/optimizer.d.ts +14 -0
  49. package/dist/architect/planning/optimizer.js +275 -0
  50. package/dist/architect/planning/optimizer.js.map +1 -0
  51. package/dist/architect/planning/planner.d.ts +15 -0
  52. package/dist/architect/planning/planner.js +124 -0
  53. package/dist/architect/planning/planner.js.map +1 -0
  54. package/dist/architect/planning/prompts.d.ts +6 -0
  55. package/dist/architect/planning/prompts.js +111 -0
  56. package/dist/architect/planning/prompts.js.map +1 -0
  57. package/dist/architect/planning/validator.d.ts +16 -0
  58. package/dist/architect/planning/validator.js +331 -0
  59. package/dist/architect/planning/validator.js.map +1 -0
  60. package/dist/architect/prompt.d.ts +1 -0
  61. package/dist/architect/prompt.js +13 -0
  62. package/dist/architect/prompt.js.map +1 -0
  63. package/dist/architect/types.d.ts +4 -0
  64. package/dist/architect/types.js +24 -0
  65. package/dist/architect/types.js.map +1 -0
  66. package/dist/cli/format.d.ts +19 -0
  67. package/dist/cli/format.js +62 -0
  68. package/dist/cli/format.js.map +1 -0
  69. package/dist/cli/init.d.ts +1 -0
  70. package/dist/cli/init.js +279 -0
  71. package/dist/cli/init.js.map +1 -0
  72. package/dist/cli/query.js +69 -0
  73. package/dist/cli/query.js.map +1 -1
  74. package/dist/cli.js +48 -21
  75. package/dist/cli.js.map +1 -1
  76. package/dist/code.d.ts +50 -0
  77. package/dist/code.js +357 -0
  78. package/dist/code.js.map +1 -0
  79. package/dist/generated/resolvers-types.d.ts +150 -29
  80. package/dist/index.d.ts +6 -0
  81. package/dist/index.js +2 -0
  82. package/dist/index.js.map +1 -1
  83. package/dist/resources/cli.config.resource.d.ts +7 -0
  84. package/dist/resources/cli.config.resource.js +11 -0
  85. package/dist/resources/cli.config.resource.js.map +1 -0
  86. package/dist/resources/coverage.resource.d.ts +19 -0
  87. package/dist/resources/coverage.resource.js +213 -0
  88. package/dist/resources/coverage.resource.js.map +1 -0
  89. package/dist/resources/dev.resource.js +0 -2
  90. package/dist/resources/dev.resource.js.map +1 -1
  91. package/dist/resources/graphql.cli.resource.d.ts +4 -0
  92. package/dist/resources/graphql.cli.resource.js +27 -0
  93. package/dist/resources/graphql.cli.resource.js.map +1 -0
  94. package/dist/resources/graphql.query.cli.task.d.ts +47 -0
  95. package/dist/resources/graphql.query.cli.task.js +54 -0
  96. package/dist/resources/graphql.query.cli.task.js.map +1 -0
  97. package/dist/resources/introspector.cli.resource.d.ts +6 -0
  98. package/dist/resources/introspector.cli.resource.js +17 -0
  99. package/dist/resources/introspector.cli.resource.js.map +1 -0
  100. package/dist/resources/live.resource.d.ts +2 -1
  101. package/dist/resources/live.resource.js +4 -2
  102. package/dist/resources/live.resource.js.map +1 -1
  103. package/dist/resources/models/Introspector.d.ts +1 -1
  104. package/dist/resources/models/Introspector.js +5 -34
  105. package/dist/resources/models/Introspector.js.map +1 -1
  106. package/dist/resources/models/initializeFromStore.js +26 -34
  107. package/dist/resources/models/initializeFromStore.js.map +1 -1
  108. package/dist/resources/models/initializeFromStore.utils.js +25 -6
  109. package/dist/resources/models/initializeFromStore.utils.js.map +1 -1
  110. package/dist/resources/models/introspector.tools.js +2 -2
  111. package/dist/resources/models/introspector.tools.js.map +1 -1
  112. package/dist/resources/routeHandlers/getDocsData.d.ts +6 -0
  113. package/dist/resources/routeHandlers/getDocsData.js +106 -0
  114. package/dist/resources/routeHandlers/getDocsData.js.map +1 -1
  115. package/dist/resources/routeHandlers/registerHttpRoutes.hook.d.ts +4 -0
  116. package/dist/resources/routeHandlers/registerHttpRoutes.hook.js +9 -7
  117. package/dist/resources/routeHandlers/registerHttpRoutes.hook.js.map +1 -1
  118. package/dist/resources/server.resource.d.ts +3 -0
  119. package/dist/resources/server.resource.js +8 -1
  120. package/dist/resources/server.resource.js.map +1 -1
  121. package/dist/resources/swap.cli.resource.d.ts +11 -0
  122. package/dist/resources/swap.cli.resource.js +54 -0
  123. package/dist/resources/swap.cli.resource.js.map +1 -0
  124. package/dist/schema/context.d.ts +2 -0
  125. package/dist/schema/model.d.ts +4 -1
  126. package/dist/schema/model.js.map +1 -1
  127. package/dist/schema/mutation.js +38 -0
  128. package/dist/schema/mutation.js.map +1 -1
  129. package/dist/schema/query.js +22 -18
  130. package/dist/schema/query.js.map +1 -1
  131. package/dist/schema/types/BaseElementCommon.d.ts +2 -4
  132. package/dist/schema/types/BaseElementCommon.js +28 -0
  133. package/dist/schema/types/BaseElementCommon.js.map +1 -1
  134. package/dist/schema/types/CoverageType.d.ts +7 -0
  135. package/dist/schema/types/CoverageType.js +54 -0
  136. package/dist/schema/types/CoverageType.js.map +1 -0
  137. package/dist/schema/types/LiveType.js +4 -0
  138. package/dist/schema/types/LiveType.js.map +1 -1
  139. package/dist/schema/types/ResourceType.js +6 -0
  140. package/dist/schema/types/ResourceType.js.map +1 -1
  141. package/dist/schema/types/TagType.js +4 -3
  142. package/dist/schema/types/TagType.js.map +1 -1
  143. package/dist/schema/types/index.d.ts +1 -0
  144. package/dist/schema/types/index.js +3 -1
  145. package/dist/schema/types/index.js.map +1 -1
  146. package/dist/ui/.vite/manifest.json +2 -2
  147. package/dist/ui/assets/docs-DR80KoAA.js +416 -0
  148. package/dist/ui/assets/docs-DR80KoAA.js.map +1 -0
  149. package/dist/ui/assets/docs-WKK9Zcu5.css +1 -0
  150. package/dist/utils/path.js +10 -0
  151. package/dist/utils/path.js.map +1 -1
  152. package/package.json +12 -8
  153. package/dist/ui/assets/docs-DVEzFAJo.css +0 -1
  154. package/dist/ui/assets/docs-l9XdmrRL.js +0 -174
@@ -0,0 +1,544 @@
1
+ import { z } from "zod";
2
+ export interface AIModelConfig {
3
+ apiKey: string;
4
+ baseUrl?: string;
5
+ model: string;
6
+ temperature?: number;
7
+ maxTokens?: number;
8
+ timeout?: number;
9
+ }
10
+ export interface ChatMessage {
11
+ role: "system" | "user" | "assistant" | "tool";
12
+ content: string;
13
+ name?: string;
14
+ tool_call_id?: string;
15
+ }
16
+ export interface ChatCompletionRequest {
17
+ model: string;
18
+ messages: ChatMessage[];
19
+ temperature?: number;
20
+ max_tokens?: number;
21
+ tools?: ToolDefinition[];
22
+ tool_choice?: "none" | "auto" | {
23
+ type: "function";
24
+ function: {
25
+ name: string;
26
+ };
27
+ };
28
+ }
29
+ export interface ChatCompletionResponse {
30
+ id: string;
31
+ object: string;
32
+ created: number;
33
+ model: string;
34
+ choices: {
35
+ index: number;
36
+ message: {
37
+ role: string;
38
+ content: string | null;
39
+ tool_calls?: ToolCall[];
40
+ };
41
+ finish_reason: string;
42
+ }[];
43
+ usage?: {
44
+ prompt_tokens: number;
45
+ completion_tokens: number;
46
+ total_tokens: number;
47
+ };
48
+ }
49
+ export interface ToolDefinition {
50
+ type: "function";
51
+ function: {
52
+ name: string;
53
+ description: string;
54
+ parameters: Record<string, any>;
55
+ };
56
+ }
57
+ export interface ToolCall {
58
+ id: string;
59
+ type: "function";
60
+ function: {
61
+ name: string;
62
+ arguments: string;
63
+ };
64
+ }
65
+ export type ArchitectAction = {
66
+ type: "createFile";
67
+ path: string;
68
+ content: string;
69
+ } | {
70
+ type: "updateFile";
71
+ path: string;
72
+ content: string;
73
+ strategy?: "replace" | "merge";
74
+ } | {
75
+ type: "deleteFile";
76
+ path: string;
77
+ } | {
78
+ type: "createDirectory";
79
+ path: string;
80
+ } | {
81
+ type: "moveFile";
82
+ from: string;
83
+ to: string;
84
+ } | {
85
+ type: "copyFile";
86
+ from: string;
87
+ to: string;
88
+ } | {
89
+ type: "registerTask";
90
+ taskId: string;
91
+ file: string;
92
+ } | {
93
+ type: "registerTest";
94
+ testId: string;
95
+ file: string;
96
+ } | {
97
+ type: "runCommand";
98
+ command: string;
99
+ args?: string[];
100
+ } | {
101
+ type: "installPackage";
102
+ name: string;
103
+ version?: string;
104
+ dev?: boolean;
105
+ } | {
106
+ type: "log";
107
+ level: "info" | "warn" | "error";
108
+ message: string;
109
+ };
110
+ export interface ArchitectPlan {
111
+ id: string;
112
+ description: string;
113
+ actions: ArchitectAction[];
114
+ dependencies?: string[];
115
+ metadata?: {
116
+ requestId?: string;
117
+ timestamp?: number;
118
+ estimatedDuration?: number;
119
+ complexity?: "low" | "medium" | "high";
120
+ };
121
+ }
122
+ export interface ArchitectResult {
123
+ planId: string;
124
+ success: boolean;
125
+ executionTime: number;
126
+ actionsPerformed: number;
127
+ actionsSkipped: number;
128
+ logs: ExecutionLog[];
129
+ errors?: ExecutionError[];
130
+ createdFiles?: string[];
131
+ modifiedFiles?: string[];
132
+ deletedFiles?: string[];
133
+ }
134
+ export interface ExecutionLog {
135
+ timestamp: number;
136
+ level: "info" | "warn" | "error";
137
+ message: string;
138
+ actionIndex?: number;
139
+ context?: Record<string, any>;
140
+ }
141
+ export interface ExecutionError {
142
+ actionIndex: number;
143
+ action: ArchitectAction;
144
+ error: string;
145
+ stack?: string;
146
+ recoverable: boolean;
147
+ }
148
+ export declare const architectActionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
149
+ type: z.ZodLiteral<"createFile">;
150
+ path: z.ZodString;
151
+ content: z.ZodString;
152
+ }, "strip", z.ZodTypeAny, {
153
+ type: "createFile";
154
+ content: string;
155
+ path: string;
156
+ }, {
157
+ type: "createFile";
158
+ content: string;
159
+ path: string;
160
+ }>, z.ZodObject<{
161
+ type: z.ZodLiteral<"updateFile">;
162
+ path: z.ZodString;
163
+ content: z.ZodString;
164
+ strategy: z.ZodOptional<z.ZodEnum<["replace", "merge"]>>;
165
+ }, "strip", z.ZodTypeAny, {
166
+ type: "updateFile";
167
+ content: string;
168
+ path: string;
169
+ strategy?: "replace" | "merge" | undefined;
170
+ }, {
171
+ type: "updateFile";
172
+ content: string;
173
+ path: string;
174
+ strategy?: "replace" | "merge" | undefined;
175
+ }>, z.ZodObject<{
176
+ type: z.ZodLiteral<"deleteFile">;
177
+ path: z.ZodString;
178
+ }, "strip", z.ZodTypeAny, {
179
+ type: "deleteFile";
180
+ path: string;
181
+ }, {
182
+ type: "deleteFile";
183
+ path: string;
184
+ }>, z.ZodObject<{
185
+ type: z.ZodLiteral<"createDirectory">;
186
+ path: z.ZodString;
187
+ }, "strip", z.ZodTypeAny, {
188
+ type: "createDirectory";
189
+ path: string;
190
+ }, {
191
+ type: "createDirectory";
192
+ path: string;
193
+ }>, z.ZodObject<{
194
+ type: z.ZodLiteral<"moveFile">;
195
+ from: z.ZodString;
196
+ to: z.ZodString;
197
+ }, "strip", z.ZodTypeAny, {
198
+ type: "moveFile";
199
+ from: string;
200
+ to: string;
201
+ }, {
202
+ type: "moveFile";
203
+ from: string;
204
+ to: string;
205
+ }>, z.ZodObject<{
206
+ type: z.ZodLiteral<"copyFile">;
207
+ from: z.ZodString;
208
+ to: z.ZodString;
209
+ }, "strip", z.ZodTypeAny, {
210
+ type: "copyFile";
211
+ from: string;
212
+ to: string;
213
+ }, {
214
+ type: "copyFile";
215
+ from: string;
216
+ to: string;
217
+ }>, z.ZodObject<{
218
+ type: z.ZodLiteral<"registerTask">;
219
+ taskId: z.ZodString;
220
+ file: z.ZodString;
221
+ }, "strip", z.ZodTypeAny, {
222
+ type: "registerTask";
223
+ file: string;
224
+ taskId: string;
225
+ }, {
226
+ type: "registerTask";
227
+ file: string;
228
+ taskId: string;
229
+ }>, z.ZodObject<{
230
+ type: z.ZodLiteral<"registerTest">;
231
+ testId: z.ZodString;
232
+ file: z.ZodString;
233
+ }, "strip", z.ZodTypeAny, {
234
+ type: "registerTest";
235
+ file: string;
236
+ testId: string;
237
+ }, {
238
+ type: "registerTest";
239
+ file: string;
240
+ testId: string;
241
+ }>, z.ZodObject<{
242
+ type: z.ZodLiteral<"runCommand">;
243
+ command: z.ZodString;
244
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
245
+ }, "strip", z.ZodTypeAny, {
246
+ type: "runCommand";
247
+ command: string;
248
+ args?: string[] | undefined;
249
+ }, {
250
+ type: "runCommand";
251
+ command: string;
252
+ args?: string[] | undefined;
253
+ }>, z.ZodObject<{
254
+ type: z.ZodLiteral<"installPackage">;
255
+ name: z.ZodString;
256
+ version: z.ZodOptional<z.ZodString>;
257
+ dev: z.ZodOptional<z.ZodBoolean>;
258
+ }, "strip", z.ZodTypeAny, {
259
+ name: string;
260
+ type: "installPackage";
261
+ version?: string | undefined;
262
+ dev?: boolean | undefined;
263
+ }, {
264
+ name: string;
265
+ type: "installPackage";
266
+ version?: string | undefined;
267
+ dev?: boolean | undefined;
268
+ }>, z.ZodObject<{
269
+ type: z.ZodLiteral<"log">;
270
+ level: z.ZodEnum<["info", "warn", "error"]>;
271
+ message: z.ZodString;
272
+ }, "strip", z.ZodTypeAny, {
273
+ type: "log";
274
+ message: string;
275
+ level: "error" | "info" | "warn";
276
+ }, {
277
+ type: "log";
278
+ message: string;
279
+ level: "error" | "info" | "warn";
280
+ }>]>;
281
+ export declare const architectPlanSchema: z.ZodObject<{
282
+ id: z.ZodString;
283
+ description: z.ZodString;
284
+ actions: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
285
+ type: z.ZodLiteral<"createFile">;
286
+ path: z.ZodString;
287
+ content: z.ZodString;
288
+ }, "strip", z.ZodTypeAny, {
289
+ type: "createFile";
290
+ content: string;
291
+ path: string;
292
+ }, {
293
+ type: "createFile";
294
+ content: string;
295
+ path: string;
296
+ }>, z.ZodObject<{
297
+ type: z.ZodLiteral<"updateFile">;
298
+ path: z.ZodString;
299
+ content: z.ZodString;
300
+ strategy: z.ZodOptional<z.ZodEnum<["replace", "merge"]>>;
301
+ }, "strip", z.ZodTypeAny, {
302
+ type: "updateFile";
303
+ content: string;
304
+ path: string;
305
+ strategy?: "replace" | "merge" | undefined;
306
+ }, {
307
+ type: "updateFile";
308
+ content: string;
309
+ path: string;
310
+ strategy?: "replace" | "merge" | undefined;
311
+ }>, z.ZodObject<{
312
+ type: z.ZodLiteral<"deleteFile">;
313
+ path: z.ZodString;
314
+ }, "strip", z.ZodTypeAny, {
315
+ type: "deleteFile";
316
+ path: string;
317
+ }, {
318
+ type: "deleteFile";
319
+ path: string;
320
+ }>, z.ZodObject<{
321
+ type: z.ZodLiteral<"createDirectory">;
322
+ path: z.ZodString;
323
+ }, "strip", z.ZodTypeAny, {
324
+ type: "createDirectory";
325
+ path: string;
326
+ }, {
327
+ type: "createDirectory";
328
+ path: string;
329
+ }>, z.ZodObject<{
330
+ type: z.ZodLiteral<"moveFile">;
331
+ from: z.ZodString;
332
+ to: z.ZodString;
333
+ }, "strip", z.ZodTypeAny, {
334
+ type: "moveFile";
335
+ from: string;
336
+ to: string;
337
+ }, {
338
+ type: "moveFile";
339
+ from: string;
340
+ to: string;
341
+ }>, z.ZodObject<{
342
+ type: z.ZodLiteral<"copyFile">;
343
+ from: z.ZodString;
344
+ to: z.ZodString;
345
+ }, "strip", z.ZodTypeAny, {
346
+ type: "copyFile";
347
+ from: string;
348
+ to: string;
349
+ }, {
350
+ type: "copyFile";
351
+ from: string;
352
+ to: string;
353
+ }>, z.ZodObject<{
354
+ type: z.ZodLiteral<"registerTask">;
355
+ taskId: z.ZodString;
356
+ file: z.ZodString;
357
+ }, "strip", z.ZodTypeAny, {
358
+ type: "registerTask";
359
+ file: string;
360
+ taskId: string;
361
+ }, {
362
+ type: "registerTask";
363
+ file: string;
364
+ taskId: string;
365
+ }>, z.ZodObject<{
366
+ type: z.ZodLiteral<"registerTest">;
367
+ testId: z.ZodString;
368
+ file: z.ZodString;
369
+ }, "strip", z.ZodTypeAny, {
370
+ type: "registerTest";
371
+ file: string;
372
+ testId: string;
373
+ }, {
374
+ type: "registerTest";
375
+ file: string;
376
+ testId: string;
377
+ }>, z.ZodObject<{
378
+ type: z.ZodLiteral<"runCommand">;
379
+ command: z.ZodString;
380
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
381
+ }, "strip", z.ZodTypeAny, {
382
+ type: "runCommand";
383
+ command: string;
384
+ args?: string[] | undefined;
385
+ }, {
386
+ type: "runCommand";
387
+ command: string;
388
+ args?: string[] | undefined;
389
+ }>, z.ZodObject<{
390
+ type: z.ZodLiteral<"installPackage">;
391
+ name: z.ZodString;
392
+ version: z.ZodOptional<z.ZodString>;
393
+ dev: z.ZodOptional<z.ZodBoolean>;
394
+ }, "strip", z.ZodTypeAny, {
395
+ name: string;
396
+ type: "installPackage";
397
+ version?: string | undefined;
398
+ dev?: boolean | undefined;
399
+ }, {
400
+ name: string;
401
+ type: "installPackage";
402
+ version?: string | undefined;
403
+ dev?: boolean | undefined;
404
+ }>, z.ZodObject<{
405
+ type: z.ZodLiteral<"log">;
406
+ level: z.ZodEnum<["info", "warn", "error"]>;
407
+ message: z.ZodString;
408
+ }, "strip", z.ZodTypeAny, {
409
+ type: "log";
410
+ message: string;
411
+ level: "error" | "info" | "warn";
412
+ }, {
413
+ type: "log";
414
+ message: string;
415
+ level: "error" | "info" | "warn";
416
+ }>]>, "many">;
417
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
418
+ metadata: z.ZodOptional<z.ZodObject<{
419
+ requestId: z.ZodOptional<z.ZodString>;
420
+ timestamp: z.ZodOptional<z.ZodNumber>;
421
+ estimatedDuration: z.ZodOptional<z.ZodNumber>;
422
+ complexity: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
423
+ }, "strip", z.ZodTypeAny, {
424
+ requestId?: string | undefined;
425
+ timestamp?: number | undefined;
426
+ estimatedDuration?: number | undefined;
427
+ complexity?: "high" | "low" | "medium" | undefined;
428
+ }, {
429
+ requestId?: string | undefined;
430
+ timestamp?: number | undefined;
431
+ estimatedDuration?: number | undefined;
432
+ complexity?: "high" | "low" | "medium" | undefined;
433
+ }>>;
434
+ }, "strip", z.ZodTypeAny, {
435
+ id: string;
436
+ description: string;
437
+ actions: ({
438
+ type: "createFile";
439
+ content: string;
440
+ path: string;
441
+ } | {
442
+ type: "updateFile";
443
+ content: string;
444
+ path: string;
445
+ strategy?: "replace" | "merge" | undefined;
446
+ } | {
447
+ type: "deleteFile";
448
+ path: string;
449
+ } | {
450
+ type: "createDirectory";
451
+ path: string;
452
+ } | {
453
+ type: "moveFile";
454
+ from: string;
455
+ to: string;
456
+ } | {
457
+ type: "copyFile";
458
+ from: string;
459
+ to: string;
460
+ } | {
461
+ type: "registerTask";
462
+ file: string;
463
+ taskId: string;
464
+ } | {
465
+ type: "registerTest";
466
+ file: string;
467
+ testId: string;
468
+ } | {
469
+ type: "runCommand";
470
+ command: string;
471
+ args?: string[] | undefined;
472
+ } | {
473
+ name: string;
474
+ type: "installPackage";
475
+ version?: string | undefined;
476
+ dev?: boolean | undefined;
477
+ } | {
478
+ type: "log";
479
+ message: string;
480
+ level: "error" | "info" | "warn";
481
+ })[];
482
+ metadata?: {
483
+ requestId?: string | undefined;
484
+ timestamp?: number | undefined;
485
+ estimatedDuration?: number | undefined;
486
+ complexity?: "high" | "low" | "medium" | undefined;
487
+ } | undefined;
488
+ dependencies?: string[] | undefined;
489
+ }, {
490
+ id: string;
491
+ description: string;
492
+ actions: ({
493
+ type: "createFile";
494
+ content: string;
495
+ path: string;
496
+ } | {
497
+ type: "updateFile";
498
+ content: string;
499
+ path: string;
500
+ strategy?: "replace" | "merge" | undefined;
501
+ } | {
502
+ type: "deleteFile";
503
+ path: string;
504
+ } | {
505
+ type: "createDirectory";
506
+ path: string;
507
+ } | {
508
+ type: "moveFile";
509
+ from: string;
510
+ to: string;
511
+ } | {
512
+ type: "copyFile";
513
+ from: string;
514
+ to: string;
515
+ } | {
516
+ type: "registerTask";
517
+ file: string;
518
+ taskId: string;
519
+ } | {
520
+ type: "registerTest";
521
+ file: string;
522
+ testId: string;
523
+ } | {
524
+ type: "runCommand";
525
+ command: string;
526
+ args?: string[] | undefined;
527
+ } | {
528
+ name: string;
529
+ type: "installPackage";
530
+ version?: string | undefined;
531
+ dev?: boolean | undefined;
532
+ } | {
533
+ type: "log";
534
+ message: string;
535
+ level: "error" | "info" | "warn";
536
+ })[];
537
+ metadata?: {
538
+ requestId?: string | undefined;
539
+ timestamp?: number | undefined;
540
+ estimatedDuration?: number | undefined;
541
+ complexity?: "high" | "low" | "medium" | undefined;
542
+ } | undefined;
543
+ dependencies?: string[] | undefined;
544
+ }>;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.architectPlanSchema = exports.architectActionSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ // Validation Schemas
6
+ exports.architectActionSchema = zod_1.z.discriminatedUnion("type", [
7
+ zod_1.z.object({ type: zod_1.z.literal("createFile"), path: zod_1.z.string(), content: zod_1.z.string() }),
8
+ zod_1.z.object({
9
+ type: zod_1.z.literal("updateFile"),
10
+ path: zod_1.z.string(),
11
+ content: zod_1.z.string(),
12
+ strategy: zod_1.z.enum(["replace", "merge"]).optional()
13
+ }),
14
+ zod_1.z.object({ type: zod_1.z.literal("deleteFile"), path: zod_1.z.string() }),
15
+ zod_1.z.object({ type: zod_1.z.literal("createDirectory"), path: zod_1.z.string() }),
16
+ zod_1.z.object({ type: zod_1.z.literal("moveFile"), from: zod_1.z.string(), to: zod_1.z.string() }),
17
+ zod_1.z.object({ type: zod_1.z.literal("copyFile"), from: zod_1.z.string(), to: zod_1.z.string() }),
18
+ zod_1.z.object({ type: zod_1.z.literal("registerTask"), taskId: zod_1.z.string(), file: zod_1.z.string() }),
19
+ zod_1.z.object({ type: zod_1.z.literal("registerTest"), testId: zod_1.z.string(), file: zod_1.z.string() }),
20
+ zod_1.z.object({
21
+ type: zod_1.z.literal("runCommand"),
22
+ command: zod_1.z.string(),
23
+ args: zod_1.z.array(zod_1.z.string()).optional()
24
+ }),
25
+ zod_1.z.object({
26
+ type: zod_1.z.literal("installPackage"),
27
+ name: zod_1.z.string(),
28
+ version: zod_1.z.string().optional(),
29
+ dev: zod_1.z.boolean().optional()
30
+ }),
31
+ zod_1.z.object({
32
+ type: zod_1.z.literal("log"),
33
+ level: zod_1.z.enum(["info", "warn", "error"]),
34
+ message: zod_1.z.string()
35
+ })
36
+ ]);
37
+ exports.architectPlanSchema = zod_1.z.object({
38
+ id: zod_1.z.string(),
39
+ description: zod_1.z.string(),
40
+ actions: zod_1.z.array(exports.architectActionSchema),
41
+ dependencies: zod_1.z.array(zod_1.z.string()).optional(),
42
+ metadata: zod_1.z.object({
43
+ requestId: zod_1.z.string().optional(),
44
+ timestamp: zod_1.z.number().optional(),
45
+ estimatedDuration: zod_1.z.number().optional(),
46
+ complexity: zod_1.z.enum(["low", "medium", "high"]).optional()
47
+ }).optional()
48
+ });
49
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/architect/core/types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,23 @@
1
+ import { IArchitectExecutor, IArchitectLogger, ArchitectPlan, ArchitectResult, ArchitectAction, ActionResult, ExecutionOptions, ExecutionContext, RollbackResult } from '../core';
2
+ export declare class ArchitectExecutor implements IArchitectExecutor {
3
+ private logger;
4
+ private defaultOptions;
5
+ private executionHistory;
6
+ constructor(logger: IArchitectLogger, defaultOptions?: Partial<ExecutionOptions>);
7
+ execute(plan: ArchitectPlan, options?: ExecutionOptions): Promise<ArchitectResult>;
8
+ executeAction(action: ArchitectAction, context?: ExecutionContext): Promise<ActionResult>;
9
+ canExecute(action: ArchitectAction): Promise<boolean>;
10
+ rollback(result: ArchitectResult): Promise<RollbackResult>;
11
+ private executeActionWithErrorHandling;
12
+ private executeFileAction;
13
+ private executeDeleteAction;
14
+ private executeDirectoryAction;
15
+ private executeFileOperationAction;
16
+ private executeCommandAction;
17
+ private executePackageAction;
18
+ private executeRegistrationAction;
19
+ private executeLogAction;
20
+ private rollbackSideEffect;
21
+ private isRecoverableError;
22
+ private addLog;
23
+ }