@wix/ditto-codegen-public 1.0.228 → 1.0.229
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/out.js +953 -1017
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -34,734 +34,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
34
34
|
));
|
|
35
35
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
36
|
|
|
37
|
-
//
|
|
38
|
-
var
|
|
39
|
-
"
|
|
40
|
-
"use strict";
|
|
41
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
42
|
-
exports2.ErrorType = void 0;
|
|
43
|
-
var ErrorType;
|
|
44
|
-
(function(ErrorType2) {
|
|
45
|
-
ErrorType2["CODE_VALIDATION_ERROR"] = "CODE_VALIDATION_ERROR";
|
|
46
|
-
ErrorType2["UNSUPPORTED_EXTENSION_TYPE"] = "UNSUPPORTED_EXTENSION_TYPE";
|
|
47
|
-
ErrorType2["AI_TOKEN_LIMIT_ERROR"] = "AI_TOKEN_LIMIT_ERROR";
|
|
48
|
-
ErrorType2["AI_RATE_LIMIT_ERROR"] = "AI_RATE_LIMIT_ERROR";
|
|
49
|
-
ErrorType2["AI_NETWORK_ERROR"] = "AI_NETWORK_ERROR";
|
|
50
|
-
ErrorType2["FILE_SYSTEM_ERROR"] = "FILE_SYSTEM_ERROR";
|
|
51
|
-
ErrorType2["TIMEOUT_ERROR"] = "TIMEOUT_ERROR";
|
|
52
|
-
ErrorType2["PROCESS_EXECUTION_ERROR"] = "PROCESS_EXECUTION_ERROR";
|
|
53
|
-
ErrorType2["AGENT_CONFIGURATION_ERROR"] = "AGENT_CONFIGURATION_ERROR";
|
|
54
|
-
ErrorType2["SCAFFOLDING_ERROR"] = "SCAFFOLDING_ERROR";
|
|
55
|
-
ErrorType2["RESOURCE_NOT_FOUND_ERROR"] = "RESOURCE_NOT_FOUND_ERROR";
|
|
56
|
-
ErrorType2["PLANNING_ERROR"] = "PLANNING_ERROR";
|
|
57
|
-
ErrorType2["EXTENSION_GENERATION_ERROR"] = "EXTENSION_GENERATION_ERROR";
|
|
58
|
-
ErrorType2["VALIDATION_CONFIGURATION_ERROR"] = "VALIDATION_CONFIGURATION_ERROR";
|
|
59
|
-
ErrorType2["GENERATE_OBJECT_ERROR"] = "GENERATE_OBJECT_ERROR";
|
|
60
|
-
ErrorType2["AUTO_FIX_ERROR"] = "AUTO_FIX_ERROR";
|
|
61
|
-
ErrorType2["UNEXPECTED_ERROR"] = "UNEXPECTED_ERROR";
|
|
62
|
-
})(ErrorType || (exports2.ErrorType = ErrorType = {}));
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
// ../codegen-types/dist/errors/enums.js
|
|
67
|
-
var require_enums = __commonJS({
|
|
68
|
-
"../codegen-types/dist/errors/enums.js"(exports2) {
|
|
69
|
-
"use strict";
|
|
70
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
71
|
-
exports2.ResourceType = exports2.ErrorOrigin = exports2.ExtensionGenerationOperation = exports2.FileSystemOperation = exports2.ProcessType = exports2.ValidationType = void 0;
|
|
72
|
-
var ValidationType;
|
|
73
|
-
(function(ValidationType2) {
|
|
74
|
-
ValidationType2["TYPESCRIPT"] = "typescript";
|
|
75
|
-
ValidationType2["BUILD"] = "build";
|
|
76
|
-
})(ValidationType || (exports2.ValidationType = ValidationType = {}));
|
|
77
|
-
var ProcessType;
|
|
78
|
-
(function(ProcessType2) {
|
|
79
|
-
ProcessType2["SPAWN"] = "spawn";
|
|
80
|
-
ProcessType2["EXECUTION"] = "execution";
|
|
81
|
-
ProcessType2["INITIALIZATION"] = "initialization";
|
|
82
|
-
})(ProcessType || (exports2.ProcessType = ProcessType = {}));
|
|
83
|
-
var FileSystemOperation;
|
|
84
|
-
(function(FileSystemOperation2) {
|
|
85
|
-
FileSystemOperation2["READ"] = "read";
|
|
86
|
-
FileSystemOperation2["WRITE"] = "write";
|
|
87
|
-
FileSystemOperation2["DELETE"] = "delete";
|
|
88
|
-
FileSystemOperation2["MKDIR"] = "mkdir";
|
|
89
|
-
})(FileSystemOperation || (exports2.FileSystemOperation = FileSystemOperation = {}));
|
|
90
|
-
var ExtensionGenerationOperation;
|
|
91
|
-
(function(ExtensionGenerationOperation2) {
|
|
92
|
-
ExtensionGenerationOperation2["INSERT"] = "insert";
|
|
93
|
-
ExtensionGenerationOperation2["UPDATE"] = "update";
|
|
94
|
-
ExtensionGenerationOperation2["DELETE"] = "delete";
|
|
95
|
-
ExtensionGenerationOperation2["EDIT"] = "edit";
|
|
96
|
-
})(ExtensionGenerationOperation || (exports2.ExtensionGenerationOperation = ExtensionGenerationOperation = {}));
|
|
97
|
-
var ErrorOrigin;
|
|
98
|
-
(function(ErrorOrigin2) {
|
|
99
|
-
ErrorOrigin2["ITERATION"] = "iteration";
|
|
100
|
-
ErrorOrigin2["INITIAL"] = "initial";
|
|
101
|
-
})(ErrorOrigin || (exports2.ErrorOrigin = ErrorOrigin = {}));
|
|
102
|
-
var ResourceType;
|
|
103
|
-
(function(ResourceType2) {
|
|
104
|
-
ResourceType2["COLLECTION"] = "collection";
|
|
105
|
-
ResourceType2["FILE"] = "file";
|
|
106
|
-
ResourceType2["EXTENSION"] = "extension";
|
|
107
|
-
})(ResourceType || (exports2.ResourceType = ResourceType = {}));
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
// ../codegen-types/dist/errors/BaseCodegenError.js
|
|
112
|
-
var require_BaseCodegenError = __commonJS({
|
|
113
|
-
"../codegen-types/dist/errors/BaseCodegenError.js"(exports2) {
|
|
114
|
-
"use strict";
|
|
115
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116
|
-
exports2.BaseCodegenError = void 0;
|
|
117
|
-
var BaseCodegenError = class extends Error {
|
|
118
|
-
constructor(message) {
|
|
119
|
-
super(message);
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Convert error to JSON format for API responses
|
|
123
|
-
*/
|
|
124
|
-
toJSON() {
|
|
125
|
-
const additional = this.getAdditionalProperties();
|
|
126
|
-
return {
|
|
127
|
-
name: this.name,
|
|
128
|
-
message: this.message,
|
|
129
|
-
errorType: this.errorType,
|
|
130
|
-
retryable: this.retryable,
|
|
131
|
-
expected: this.expected,
|
|
132
|
-
...Object.keys(additional).length > 0 ? additional : {}
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Override in subclasses to add additional properties
|
|
137
|
-
*/
|
|
138
|
-
getAdditionalProperties() {
|
|
139
|
-
return {};
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
exports2.BaseCodegenError = BaseCodegenError;
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
// ../codegen-types/dist/errors/CodeValidationError.js
|
|
147
|
-
var require_CodeValidationError = __commonJS({
|
|
148
|
-
"../codegen-types/dist/errors/CodeValidationError.js"(exports2) {
|
|
149
|
-
"use strict";
|
|
150
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
151
|
-
exports2.CodeValidationError = void 0;
|
|
152
|
-
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
153
|
-
var ErrorTypes_1 = require_ErrorTypes();
|
|
154
|
-
var CodeValidationError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
155
|
-
constructor(message, options) {
|
|
156
|
-
super(message);
|
|
157
|
-
this.name = "CodeValidationError";
|
|
158
|
-
this.errorType = ErrorTypes_1.ErrorType.CODE_VALIDATION_ERROR;
|
|
159
|
-
this.expected = true;
|
|
160
|
-
this.retryable = false;
|
|
161
|
-
this.validationType = options.validationType;
|
|
162
|
-
this.errors = options.errors || [];
|
|
163
|
-
}
|
|
164
|
-
getAdditionalProperties() {
|
|
165
|
-
const props = {
|
|
166
|
-
validationType: this.validationType
|
|
167
|
-
};
|
|
168
|
-
if (this.errors && this.errors.length > 0)
|
|
169
|
-
props.errors = this.errors;
|
|
170
|
-
return props;
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
exports2.CodeValidationError = CodeValidationError;
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
// ../codegen-types/dist/errors/UnsupportedExtensionTypeError.js
|
|
178
|
-
var require_UnsupportedExtensionTypeError = __commonJS({
|
|
179
|
-
"../codegen-types/dist/errors/UnsupportedExtensionTypeError.js"(exports2) {
|
|
180
|
-
"use strict";
|
|
181
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
182
|
-
exports2.UnsupportedExtensionTypeError = void 0;
|
|
183
|
-
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
184
|
-
var ErrorTypes_1 = require_ErrorTypes();
|
|
185
|
-
var UnsupportedExtensionTypeError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
186
|
-
constructor(message, options) {
|
|
187
|
-
super(message);
|
|
188
|
-
this.name = "UnsupportedExtensionTypeError";
|
|
189
|
-
this.errorType = ErrorTypes_1.ErrorType.UNSUPPORTED_EXTENSION_TYPE;
|
|
190
|
-
this.expected = true;
|
|
191
|
-
this.retryable = false;
|
|
192
|
-
this.extensionType = options.extensionType;
|
|
193
|
-
this.origin = options.origin;
|
|
194
|
-
}
|
|
195
|
-
getAdditionalProperties() {
|
|
196
|
-
return {
|
|
197
|
-
extensionType: this.extensionType,
|
|
198
|
-
origin: this.origin
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
exports2.UnsupportedExtensionTypeError = UnsupportedExtensionTypeError;
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
// ../codegen-types/dist/errors/AIErrors.js
|
|
207
|
-
var require_AIErrors = __commonJS({
|
|
208
|
-
"../codegen-types/dist/errors/AIErrors.js"(exports2) {
|
|
209
|
-
"use strict";
|
|
210
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
211
|
-
exports2.AINetworkError = exports2.AIRateLimitError = exports2.AITokenLimitError = void 0;
|
|
212
|
-
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
213
|
-
var ErrorTypes_1 = require_ErrorTypes();
|
|
214
|
-
var AITokenLimitError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
215
|
-
constructor(message, options) {
|
|
216
|
-
super(message);
|
|
217
|
-
this.name = "AITokenLimitError";
|
|
218
|
-
this.errorType = ErrorTypes_1.ErrorType.AI_TOKEN_LIMIT_ERROR;
|
|
219
|
-
this.expected = false;
|
|
220
|
-
this.retryable = true;
|
|
221
|
-
this.filePath = options?.filePath;
|
|
222
|
-
this.fileSizeKB = options?.fileSizeKB;
|
|
223
|
-
this.errorCount = options?.errorCount;
|
|
224
|
-
this.aiError = options?.aiError;
|
|
225
|
-
}
|
|
226
|
-
getAdditionalProperties() {
|
|
227
|
-
const props = {};
|
|
228
|
-
if (this.filePath)
|
|
229
|
-
props.filePath = this.filePath;
|
|
230
|
-
if (this.fileSizeKB !== void 0)
|
|
231
|
-
props.fileSizeKB = this.fileSizeKB;
|
|
232
|
-
if (this.errorCount !== void 0)
|
|
233
|
-
props.errorCount = this.errorCount;
|
|
234
|
-
if (this.aiError)
|
|
235
|
-
props.aiError = this.aiError;
|
|
236
|
-
return props;
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
exports2.AITokenLimitError = AITokenLimitError;
|
|
240
|
-
var AIRateLimitError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
241
|
-
constructor(message, options) {
|
|
242
|
-
super(message);
|
|
243
|
-
this.name = "AIRateLimitError";
|
|
244
|
-
this.errorType = ErrorTypes_1.ErrorType.AI_RATE_LIMIT_ERROR;
|
|
245
|
-
this.expected = false;
|
|
246
|
-
this.retryable = true;
|
|
247
|
-
this.aiError = options?.aiError;
|
|
248
|
-
}
|
|
249
|
-
getAdditionalProperties() {
|
|
250
|
-
const props = {};
|
|
251
|
-
if (this.aiError)
|
|
252
|
-
props.aiError = this.aiError;
|
|
253
|
-
return props;
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
exports2.AIRateLimitError = AIRateLimitError;
|
|
257
|
-
var AINetworkError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
258
|
-
constructor(message, options) {
|
|
259
|
-
super(message);
|
|
260
|
-
this.name = "AINetworkError";
|
|
261
|
-
this.errorType = ErrorTypes_1.ErrorType.AI_NETWORK_ERROR;
|
|
262
|
-
this.expected = false;
|
|
263
|
-
this.retryable = true;
|
|
264
|
-
this.aiError = options?.aiError;
|
|
265
|
-
}
|
|
266
|
-
getAdditionalProperties() {
|
|
267
|
-
const props = {};
|
|
268
|
-
if (this.aiError)
|
|
269
|
-
props.aiError = this.aiError;
|
|
270
|
-
return props;
|
|
271
|
-
}
|
|
272
|
-
};
|
|
273
|
-
exports2.AINetworkError = AINetworkError;
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
// ../codegen-types/dist/errors/FileSystemError.js
|
|
278
|
-
var require_FileSystemError = __commonJS({
|
|
279
|
-
"../codegen-types/dist/errors/FileSystemError.js"(exports2) {
|
|
280
|
-
"use strict";
|
|
281
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
282
|
-
exports2.FileSystemError = void 0;
|
|
283
|
-
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
284
|
-
var ErrorTypes_1 = require_ErrorTypes();
|
|
285
|
-
var FileSystemError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
286
|
-
constructor(message, options) {
|
|
287
|
-
super(message);
|
|
288
|
-
this.name = "FileSystemError";
|
|
289
|
-
this.errorType = ErrorTypes_1.ErrorType.FILE_SYSTEM_ERROR;
|
|
290
|
-
this.expected = false;
|
|
291
|
-
this.retryable = true;
|
|
292
|
-
this.filePath = options?.filePath;
|
|
293
|
-
this.operation = options?.operation;
|
|
294
|
-
this.cause = options?.cause;
|
|
295
|
-
}
|
|
296
|
-
getAdditionalProperties() {
|
|
297
|
-
const props = {};
|
|
298
|
-
if (this.filePath)
|
|
299
|
-
props.filePath = this.filePath;
|
|
300
|
-
if (this.operation)
|
|
301
|
-
props.operation = this.operation;
|
|
302
|
-
if (this.cause)
|
|
303
|
-
props.cause = this.cause;
|
|
304
|
-
return props;
|
|
305
|
-
}
|
|
306
|
-
};
|
|
307
|
-
exports2.FileSystemError = FileSystemError;
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
|
|
311
|
-
// ../codegen-types/dist/errors/ProcessExecutionError.js
|
|
312
|
-
var require_ProcessExecutionError = __commonJS({
|
|
313
|
-
"../codegen-types/dist/errors/ProcessExecutionError.js"(exports2) {
|
|
314
|
-
"use strict";
|
|
315
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
316
|
-
exports2.ProcessExecutionError = void 0;
|
|
317
|
-
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
318
|
-
var ErrorTypes_1 = require_ErrorTypes();
|
|
319
|
-
var ProcessExecutionError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
320
|
-
constructor(message, options) {
|
|
321
|
-
super(message);
|
|
322
|
-
this.name = "ProcessExecutionError";
|
|
323
|
-
this.errorType = ErrorTypes_1.ErrorType.PROCESS_EXECUTION_ERROR;
|
|
324
|
-
this.expected = false;
|
|
325
|
-
this.retryable = false;
|
|
326
|
-
this.processType = options?.processType;
|
|
327
|
-
this.exitCode = options?.exitCode;
|
|
328
|
-
this.stderr = options?.stderr;
|
|
329
|
-
this.cause = options?.cause;
|
|
330
|
-
}
|
|
331
|
-
getAdditionalProperties() {
|
|
332
|
-
const props = {};
|
|
333
|
-
if (this.processType)
|
|
334
|
-
props.processType = this.processType;
|
|
335
|
-
if (this.exitCode !== void 0)
|
|
336
|
-
props.exitCode = this.exitCode;
|
|
337
|
-
if (this.stderr)
|
|
338
|
-
props.stderr = this.stderr;
|
|
339
|
-
if (this.cause)
|
|
340
|
-
props.cause = this.cause;
|
|
341
|
-
return props;
|
|
342
|
-
}
|
|
343
|
-
};
|
|
344
|
-
exports2.ProcessExecutionError = ProcessExecutionError;
|
|
345
|
-
}
|
|
346
|
-
});
|
|
347
|
-
|
|
348
|
-
// ../codegen-types/dist/errors/AgentConfigurationError.js
|
|
349
|
-
var require_AgentConfigurationError = __commonJS({
|
|
350
|
-
"../codegen-types/dist/errors/AgentConfigurationError.js"(exports2) {
|
|
351
|
-
"use strict";
|
|
352
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
353
|
-
exports2.AgentConfigurationError = void 0;
|
|
354
|
-
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
355
|
-
var ErrorTypes_1 = require_ErrorTypes();
|
|
356
|
-
var AgentConfigurationError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
357
|
-
constructor(message, options) {
|
|
358
|
-
super(message);
|
|
359
|
-
this.name = "AgentConfigurationError";
|
|
360
|
-
this.errorType = ErrorTypes_1.ErrorType.AGENT_CONFIGURATION_ERROR;
|
|
361
|
-
this.expected = false;
|
|
362
|
-
this.retryable = false;
|
|
363
|
-
this.extensionType = options?.extensionType;
|
|
364
|
-
this.agentType = options?.agentType;
|
|
365
|
-
}
|
|
366
|
-
getAdditionalProperties() {
|
|
367
|
-
const props = {};
|
|
368
|
-
if (this.extensionType)
|
|
369
|
-
props.extensionType = this.extensionType;
|
|
370
|
-
if (this.agentType)
|
|
371
|
-
props.agentType = this.agentType;
|
|
372
|
-
return props;
|
|
373
|
-
}
|
|
374
|
-
};
|
|
375
|
-
exports2.AgentConfigurationError = AgentConfigurationError;
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
|
|
379
|
-
// ../codegen-types/dist/errors/ScaffoldingError.js
|
|
380
|
-
var require_ScaffoldingError = __commonJS({
|
|
381
|
-
"../codegen-types/dist/errors/ScaffoldingError.js"(exports2) {
|
|
382
|
-
"use strict";
|
|
383
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
384
|
-
exports2.ScaffoldingError = void 0;
|
|
385
|
-
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
386
|
-
var ErrorTypes_1 = require_ErrorTypes();
|
|
387
|
-
var ScaffoldingError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
388
|
-
constructor(message, options) {
|
|
389
|
-
super(message);
|
|
390
|
-
this.name = "ScaffoldingError";
|
|
391
|
-
this.errorType = ErrorTypes_1.ErrorType.SCAFFOLDING_ERROR;
|
|
392
|
-
this.expected = false;
|
|
393
|
-
this.retryable = false;
|
|
394
|
-
this.extensionType = options?.extensionType;
|
|
395
|
-
this.scaffoldPath = options?.scaffoldPath;
|
|
396
|
-
this.cause = options?.cause;
|
|
397
|
-
}
|
|
398
|
-
getAdditionalProperties() {
|
|
399
|
-
const props = {};
|
|
400
|
-
if (this.extensionType)
|
|
401
|
-
props.extensionType = this.extensionType;
|
|
402
|
-
if (this.scaffoldPath)
|
|
403
|
-
props.scaffoldPath = this.scaffoldPath;
|
|
404
|
-
if (this.cause)
|
|
405
|
-
props.cause = this.cause;
|
|
406
|
-
return props;
|
|
407
|
-
}
|
|
408
|
-
};
|
|
409
|
-
exports2.ScaffoldingError = ScaffoldingError;
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
|
-
|
|
413
|
-
// ../codegen-types/dist/errors/ResourceNotFoundError.js
|
|
414
|
-
var require_ResourceNotFoundError = __commonJS({
|
|
415
|
-
"../codegen-types/dist/errors/ResourceNotFoundError.js"(exports2) {
|
|
416
|
-
"use strict";
|
|
417
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
418
|
-
exports2.ResourceNotFoundError = void 0;
|
|
419
|
-
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
420
|
-
var ErrorTypes_1 = require_ErrorTypes();
|
|
421
|
-
var ResourceNotFoundError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
422
|
-
constructor(message, options) {
|
|
423
|
-
super(message);
|
|
424
|
-
this.name = "ResourceNotFoundError";
|
|
425
|
-
this.errorType = ErrorTypes_1.ErrorType.RESOURCE_NOT_FOUND_ERROR;
|
|
426
|
-
this.expected = false;
|
|
427
|
-
this.retryable = false;
|
|
428
|
-
this.resourceType = options?.resourceType;
|
|
429
|
-
this.resourceId = options?.resourceId;
|
|
430
|
-
}
|
|
431
|
-
getAdditionalProperties() {
|
|
432
|
-
const props = {};
|
|
433
|
-
if (this.resourceType)
|
|
434
|
-
props.resourceType = this.resourceType;
|
|
435
|
-
if (this.resourceId)
|
|
436
|
-
props.resourceId = this.resourceId;
|
|
437
|
-
return props;
|
|
438
|
-
}
|
|
439
|
-
};
|
|
440
|
-
exports2.ResourceNotFoundError = ResourceNotFoundError;
|
|
441
|
-
}
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
// ../codegen-types/dist/errors/PlanningError.js
|
|
445
|
-
var require_PlanningError = __commonJS({
|
|
446
|
-
"../codegen-types/dist/errors/PlanningError.js"(exports2) {
|
|
447
|
-
"use strict";
|
|
448
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
449
|
-
exports2.PlanningError = void 0;
|
|
450
|
-
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
451
|
-
var ErrorTypes_1 = require_ErrorTypes();
|
|
452
|
-
var PlanningError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
453
|
-
constructor(message, options) {
|
|
454
|
-
super(message);
|
|
455
|
-
this.name = "PlanningError";
|
|
456
|
-
this.errorType = ErrorTypes_1.ErrorType.PLANNING_ERROR;
|
|
457
|
-
this.expected = false;
|
|
458
|
-
this.retryable = false;
|
|
459
|
-
this.attemptCount = options?.attemptCount;
|
|
460
|
-
this.lastError = options?.lastError;
|
|
461
|
-
}
|
|
462
|
-
getAdditionalProperties() {
|
|
463
|
-
const props = {};
|
|
464
|
-
if (this.attemptCount !== void 0)
|
|
465
|
-
props.attemptCount = this.attemptCount;
|
|
466
|
-
if (this.lastError)
|
|
467
|
-
props.lastError = this.lastError;
|
|
468
|
-
return props;
|
|
469
|
-
}
|
|
470
|
-
};
|
|
471
|
-
exports2.PlanningError = PlanningError;
|
|
472
|
-
}
|
|
473
|
-
});
|
|
474
|
-
|
|
475
|
-
// ../codegen-types/dist/errors/ExtensionGenerationError.js
|
|
476
|
-
var require_ExtensionGenerationError = __commonJS({
|
|
477
|
-
"../codegen-types/dist/errors/ExtensionGenerationError.js"(exports2) {
|
|
478
|
-
"use strict";
|
|
479
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
480
|
-
exports2.ExtensionGenerationError = void 0;
|
|
481
|
-
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
482
|
-
var ErrorTypes_1 = require_ErrorTypes();
|
|
483
|
-
var ExtensionGenerationError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
484
|
-
constructor(message, options) {
|
|
485
|
-
super(message);
|
|
486
|
-
this.name = "ExtensionGenerationError";
|
|
487
|
-
this.errorType = ErrorTypes_1.ErrorType.EXTENSION_GENERATION_ERROR;
|
|
488
|
-
this.expected = false;
|
|
489
|
-
this.retryable = false;
|
|
490
|
-
this.extensionName = options?.extensionName;
|
|
491
|
-
this.extensionType = options?.extensionType;
|
|
492
|
-
this.operation = options?.operation;
|
|
493
|
-
this.filePath = options?.filePath;
|
|
494
|
-
}
|
|
495
|
-
getAdditionalProperties() {
|
|
496
|
-
const props = {};
|
|
497
|
-
if (this.extensionName)
|
|
498
|
-
props.extensionName = this.extensionName;
|
|
499
|
-
if (this.extensionType)
|
|
500
|
-
props.extensionType = this.extensionType;
|
|
501
|
-
if (this.operation)
|
|
502
|
-
props.operation = this.operation;
|
|
503
|
-
if (this.filePath)
|
|
504
|
-
props.filePath = this.filePath;
|
|
505
|
-
return props;
|
|
506
|
-
}
|
|
507
|
-
};
|
|
508
|
-
exports2.ExtensionGenerationError = ExtensionGenerationError;
|
|
509
|
-
}
|
|
510
|
-
});
|
|
511
|
-
|
|
512
|
-
// ../codegen-types/dist/errors/ValidationConfigurationError.js
|
|
513
|
-
var require_ValidationConfigurationError = __commonJS({
|
|
514
|
-
"../codegen-types/dist/errors/ValidationConfigurationError.js"(exports2) {
|
|
515
|
-
"use strict";
|
|
516
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
517
|
-
exports2.ValidationConfigurationError = void 0;
|
|
518
|
-
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
519
|
-
var ErrorTypes_1 = require_ErrorTypes();
|
|
520
|
-
var ValidationConfigurationError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
521
|
-
constructor(message, options) {
|
|
522
|
-
super(message);
|
|
523
|
-
this.name = "ValidationConfigurationError";
|
|
524
|
-
this.errorType = ErrorTypes_1.ErrorType.VALIDATION_CONFIGURATION_ERROR;
|
|
525
|
-
this.expected = false;
|
|
526
|
-
this.retryable = false;
|
|
527
|
-
this.validatorType = options?.validatorType;
|
|
528
|
-
this.fixerType = options?.fixerType;
|
|
529
|
-
}
|
|
530
|
-
getAdditionalProperties() {
|
|
531
|
-
const props = {};
|
|
532
|
-
if (this.validatorType)
|
|
533
|
-
props.validatorType = this.validatorType;
|
|
534
|
-
if (this.fixerType)
|
|
535
|
-
props.fixerType = this.fixerType;
|
|
536
|
-
return props;
|
|
537
|
-
}
|
|
538
|
-
};
|
|
539
|
-
exports2.ValidationConfigurationError = ValidationConfigurationError;
|
|
540
|
-
}
|
|
541
|
-
});
|
|
542
|
-
|
|
543
|
-
// ../codegen-types/dist/errors/AutoFixError.js
|
|
544
|
-
var require_AutoFixError = __commonJS({
|
|
545
|
-
"../codegen-types/dist/errors/AutoFixError.js"(exports2) {
|
|
546
|
-
"use strict";
|
|
547
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
548
|
-
exports2.AutoFixError = void 0;
|
|
549
|
-
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
550
|
-
var ErrorTypes_1 = require_ErrorTypes();
|
|
551
|
-
var AutoFixError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
552
|
-
constructor(message, options) {
|
|
553
|
-
super(message);
|
|
554
|
-
this.name = "AutoFixError";
|
|
555
|
-
this.errorType = ErrorTypes_1.ErrorType.AUTO_FIX_ERROR;
|
|
556
|
-
this.expected = false;
|
|
557
|
-
this.retryable = true;
|
|
558
|
-
this.validationType = options?.validationType;
|
|
559
|
-
this.cause = options?.cause;
|
|
560
|
-
}
|
|
561
|
-
getAdditionalProperties() {
|
|
562
|
-
return {
|
|
563
|
-
validationType: this.validationType,
|
|
564
|
-
cause: this.cause
|
|
565
|
-
};
|
|
566
|
-
}
|
|
567
|
-
};
|
|
568
|
-
exports2.AutoFixError = AutoFixError;
|
|
569
|
-
}
|
|
570
|
-
});
|
|
571
|
-
|
|
572
|
-
// ../codegen-types/dist/errors/UnexpectedError.js
|
|
573
|
-
var require_UnexpectedError = __commonJS({
|
|
574
|
-
"../codegen-types/dist/errors/UnexpectedError.js"(exports2) {
|
|
575
|
-
"use strict";
|
|
576
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
577
|
-
exports2.UnexpectedError = void 0;
|
|
578
|
-
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
579
|
-
var ErrorTypes_1 = require_ErrorTypes();
|
|
580
|
-
var UnexpectedError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
581
|
-
constructor(message, options) {
|
|
582
|
-
super(message);
|
|
583
|
-
this.name = "UnexpectedError";
|
|
584
|
-
this.errorType = ErrorTypes_1.ErrorType.UNEXPECTED_ERROR;
|
|
585
|
-
this.expected = false;
|
|
586
|
-
this.retryable = true;
|
|
587
|
-
this.originalError = options?.originalError;
|
|
588
|
-
}
|
|
589
|
-
getAdditionalProperties() {
|
|
590
|
-
const props = {};
|
|
591
|
-
if (this.originalError)
|
|
592
|
-
props.originalError = this.originalError;
|
|
593
|
-
return props;
|
|
594
|
-
}
|
|
595
|
-
};
|
|
596
|
-
exports2.UnexpectedError = UnexpectedError;
|
|
597
|
-
}
|
|
598
|
-
});
|
|
599
|
-
|
|
600
|
-
// ../codegen-types/dist/errors/TimeoutError.js
|
|
601
|
-
var require_TimeoutError = __commonJS({
|
|
602
|
-
"../codegen-types/dist/errors/TimeoutError.js"(exports2) {
|
|
603
|
-
"use strict";
|
|
604
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
605
|
-
exports2.TimeoutError = void 0;
|
|
606
|
-
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
607
|
-
var ErrorTypes_1 = require_ErrorTypes();
|
|
608
|
-
var TimeoutError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
609
|
-
constructor(message) {
|
|
610
|
-
super(message);
|
|
611
|
-
this.name = "TimeoutError";
|
|
612
|
-
this.errorType = ErrorTypes_1.ErrorType.TIMEOUT_ERROR;
|
|
613
|
-
this.expected = false;
|
|
614
|
-
this.retryable = true;
|
|
615
|
-
}
|
|
616
|
-
};
|
|
617
|
-
exports2.TimeoutError = TimeoutError;
|
|
618
|
-
}
|
|
619
|
-
});
|
|
620
|
-
|
|
621
|
-
// ../codegen-types/dist/errors/GenerateCodegenObjectError.js
|
|
622
|
-
var require_GenerateCodegenObjectError = __commonJS({
|
|
623
|
-
"../codegen-types/dist/errors/GenerateCodegenObjectError.js"(exports2) {
|
|
624
|
-
"use strict";
|
|
625
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
626
|
-
exports2.GenerateObjectError = void 0;
|
|
627
|
-
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
628
|
-
var ErrorTypes_1 = require_ErrorTypes();
|
|
629
|
-
var GenerateObjectError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
630
|
-
constructor(message, options) {
|
|
631
|
-
super(message);
|
|
632
|
-
this.name = "generateObjectError";
|
|
633
|
-
this.errorType = ErrorTypes_1.ErrorType.GENERATE_OBJECT_ERROR;
|
|
634
|
-
this.retryable = false;
|
|
635
|
-
this.expected = false;
|
|
636
|
-
this.status = options?.status;
|
|
637
|
-
this.statusText = options?.statusText;
|
|
638
|
-
this.url = options?.url;
|
|
639
|
-
}
|
|
640
|
-
getAdditionalProperties() {
|
|
641
|
-
const props = {};
|
|
642
|
-
if (this.status !== void 0)
|
|
643
|
-
props.status = this.status;
|
|
644
|
-
if (this.statusText !== void 0)
|
|
645
|
-
props.statusText = this.statusText;
|
|
646
|
-
if (this.url !== void 0)
|
|
647
|
-
props.url = this.url;
|
|
648
|
-
return props;
|
|
649
|
-
}
|
|
650
|
-
};
|
|
651
|
-
exports2.GenerateObjectError = GenerateObjectError;
|
|
652
|
-
}
|
|
653
|
-
});
|
|
654
|
-
|
|
655
|
-
// ../codegen-types/dist/errors/helpers.js
|
|
656
|
-
var require_helpers = __commonJS({
|
|
657
|
-
"../codegen-types/dist/errors/helpers.js"(exports2) {
|
|
658
|
-
"use strict";
|
|
659
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
660
|
-
exports2.isCodegenError = isCodegenError;
|
|
661
|
-
exports2.toCodegenError = toCodegenError;
|
|
662
|
-
exports2.getErrorType = getErrorType;
|
|
663
|
-
exports2.isRetryableError = isRetryableError;
|
|
664
|
-
exports2.isExpectedError = isExpectedError;
|
|
665
|
-
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
666
|
-
var UnexpectedError_1 = require_UnexpectedError();
|
|
667
|
-
function isCodegenError(error) {
|
|
668
|
-
if (error instanceof BaseCodegenError_1.BaseCodegenError) {
|
|
669
|
-
return true;
|
|
670
|
-
}
|
|
671
|
-
if (typeof error === "object" && error !== null && "name" in error && "errorType" in error && typeof error.name === "string" && typeof error.errorType === "string") {
|
|
672
|
-
return true;
|
|
673
|
-
}
|
|
674
|
-
return false;
|
|
675
|
-
}
|
|
676
|
-
function toCodegenError(error) {
|
|
677
|
-
if (isCodegenError(error)) {
|
|
678
|
-
return error;
|
|
679
|
-
}
|
|
680
|
-
if (error instanceof Error) {
|
|
681
|
-
return new UnexpectedError_1.UnexpectedError(error.message, {
|
|
682
|
-
originalError: error
|
|
683
|
-
});
|
|
684
|
-
}
|
|
685
|
-
return new UnexpectedError_1.UnexpectedError("An unexpected error occurred", {
|
|
686
|
-
originalError: error
|
|
687
|
-
});
|
|
688
|
-
}
|
|
689
|
-
function getErrorType(error) {
|
|
690
|
-
if (typeof error === "object" && error !== null && "name" in error) {
|
|
691
|
-
return typeof error.name === "string" ? error.name : null;
|
|
692
|
-
}
|
|
693
|
-
return null;
|
|
694
|
-
}
|
|
695
|
-
function isRetryableError(error) {
|
|
696
|
-
if (isCodegenError(error)) {
|
|
697
|
-
if (typeof error === "object" && error !== null && "retryable" in error) {
|
|
698
|
-
return Boolean(error.retryable);
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
return true;
|
|
702
|
-
}
|
|
703
|
-
function isExpectedError(error) {
|
|
704
|
-
if (isCodegenError(error)) {
|
|
705
|
-
if (typeof error === "object" && error !== null && "expected" in error) {
|
|
706
|
-
return Boolean(error.expected);
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
return false;
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
});
|
|
713
|
-
|
|
714
|
-
// ../codegen-types/dist/errors/index.js
|
|
715
|
-
var require_errors = __commonJS({
|
|
716
|
-
"../codegen-types/dist/errors/index.js"(exports2) {
|
|
717
|
-
"use strict";
|
|
718
|
-
var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
719
|
-
if (k2 === void 0) k2 = k;
|
|
720
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
721
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
722
|
-
desc = { enumerable: true, get: function() {
|
|
723
|
-
return m[k];
|
|
724
|
-
} };
|
|
725
|
-
}
|
|
726
|
-
Object.defineProperty(o, k2, desc);
|
|
727
|
-
}) : (function(o, m, k, k2) {
|
|
728
|
-
if (k2 === void 0) k2 = k;
|
|
729
|
-
o[k2] = m[k];
|
|
730
|
-
}));
|
|
731
|
-
var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
|
|
732
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p);
|
|
733
|
-
};
|
|
734
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
735
|
-
__exportStar2(require_ErrorTypes(), exports2);
|
|
736
|
-
__exportStar2(require_enums(), exports2);
|
|
737
|
-
__exportStar2(require_BaseCodegenError(), exports2);
|
|
738
|
-
__exportStar2(require_CodeValidationError(), exports2);
|
|
739
|
-
__exportStar2(require_UnsupportedExtensionTypeError(), exports2);
|
|
740
|
-
__exportStar2(require_AIErrors(), exports2);
|
|
741
|
-
__exportStar2(require_FileSystemError(), exports2);
|
|
742
|
-
__exportStar2(require_ProcessExecutionError(), exports2);
|
|
743
|
-
__exportStar2(require_AgentConfigurationError(), exports2);
|
|
744
|
-
__exportStar2(require_ScaffoldingError(), exports2);
|
|
745
|
-
__exportStar2(require_ResourceNotFoundError(), exports2);
|
|
746
|
-
__exportStar2(require_PlanningError(), exports2);
|
|
747
|
-
__exportStar2(require_ExtensionGenerationError(), exports2);
|
|
748
|
-
__exportStar2(require_ValidationConfigurationError(), exports2);
|
|
749
|
-
__exportStar2(require_AutoFixError(), exports2);
|
|
750
|
-
__exportStar2(require_UnexpectedError(), exports2);
|
|
751
|
-
__exportStar2(require_TimeoutError(), exports2);
|
|
752
|
-
__exportStar2(require_GenerateCodegenObjectError(), exports2);
|
|
753
|
-
__exportStar2(require_helpers(), exports2);
|
|
754
|
-
}
|
|
755
|
-
});
|
|
756
|
-
|
|
757
|
-
// ../codegen-types/dist/types/status.js
|
|
758
|
-
var require_status = __commonJS({
|
|
759
|
-
"../codegen-types/dist/types/status.js"(exports2) {
|
|
37
|
+
// ../../node_modules/@wix/ambassador-ctp-codegen-job-service-v1-job/build/cjs/types.impl.js
|
|
38
|
+
var require_types_impl = __commonJS({
|
|
39
|
+
"../../node_modules/@wix/ambassador-ctp-codegen-job-service-v1-job/build/cjs/types.impl.js"(exports2) {
|
|
760
40
|
"use strict";
|
|
761
41
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
762
|
-
exports2.Status = void 0;
|
|
42
|
+
exports2.Status = exports2.TaskKind = void 0;
|
|
43
|
+
var TaskKind;
|
|
44
|
+
(function(TaskKind2) {
|
|
45
|
+
TaskKind2["UNKNOWN_TASK_KIND"] = "UNKNOWN_TASK_KIND";
|
|
46
|
+
TaskKind2["INIT_CODEGEN"] = "INIT_CODEGEN";
|
|
47
|
+
TaskKind2["ITERATE_CODEGEN"] = "ITERATE_CODEGEN";
|
|
48
|
+
TaskKind2["RUN_AGENT"] = "RUN_AGENT";
|
|
49
|
+
TaskKind2["FIX_CODE"] = "FIX_CODE";
|
|
50
|
+
})(TaskKind || (exports2.TaskKind = TaskKind = {}));
|
|
763
51
|
var Status;
|
|
764
52
|
(function(Status2) {
|
|
53
|
+
Status2["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
|
|
765
54
|
Status2["PENDING"] = "PENDING";
|
|
766
55
|
Status2["RUNNING"] = "RUNNING";
|
|
767
56
|
Status2["COMPLETED"] = "COMPLETED";
|
|
@@ -772,86 +61,6 @@ var require_status = __commonJS({
|
|
|
772
61
|
}
|
|
773
62
|
});
|
|
774
63
|
|
|
775
|
-
// ../codegen-types/dist/types/task.js
|
|
776
|
-
var require_task = __commonJS({
|
|
777
|
-
"../codegen-types/dist/types/task.js"(exports2) {
|
|
778
|
-
"use strict";
|
|
779
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
780
|
-
exports2.TaskKind = void 0;
|
|
781
|
-
var TaskKind;
|
|
782
|
-
(function(TaskKind2) {
|
|
783
|
-
TaskKind2["INIT_CODEGEN"] = "INIT_CODEGEN";
|
|
784
|
-
TaskKind2["ITERATE_CODEGEN"] = "ITERATE_CODEGEN";
|
|
785
|
-
TaskKind2["VALIDATION"] = "VALIDATION";
|
|
786
|
-
TaskKind2["CODEGEN"] = "CODEGEN";
|
|
787
|
-
TaskKind2["FIX_CODE"] = "FIX_CODE";
|
|
788
|
-
TaskKind2["RUN_AGENT"] = "RUN_AGENT";
|
|
789
|
-
})(TaskKind || (exports2.TaskKind = TaskKind = {}));
|
|
790
|
-
}
|
|
791
|
-
});
|
|
792
|
-
|
|
793
|
-
// ../codegen-types/dist/types/generation.js
|
|
794
|
-
var require_generation = __commonJS({
|
|
795
|
-
"../codegen-types/dist/types/generation.js"(exports2) {
|
|
796
|
-
"use strict";
|
|
797
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
798
|
-
exports2.GenerationRequestStatus = void 0;
|
|
799
|
-
var GenerationRequestStatus;
|
|
800
|
-
(function(GenerationRequestStatus2) {
|
|
801
|
-
GenerationRequestStatus2["PENDING"] = "PENDING";
|
|
802
|
-
GenerationRequestStatus2["RUNNING"] = "RUNNING";
|
|
803
|
-
GenerationRequestStatus2["COMPLETED"] = "COMPLETED";
|
|
804
|
-
GenerationRequestStatus2["FAILED"] = "FAILED";
|
|
805
|
-
})(GenerationRequestStatus || (exports2.GenerationRequestStatus = GenerationRequestStatus = {}));
|
|
806
|
-
}
|
|
807
|
-
});
|
|
808
|
-
|
|
809
|
-
// ../codegen-types/dist/ai/index.js
|
|
810
|
-
var require_ai = __commonJS({
|
|
811
|
-
"../codegen-types/dist/ai/index.js"(exports2) {
|
|
812
|
-
"use strict";
|
|
813
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
814
|
-
exports2.withCaching = void 0;
|
|
815
|
-
var withCaching = (ttl = "5m") => {
|
|
816
|
-
return {
|
|
817
|
-
anthropic: {
|
|
818
|
-
cache_control: { type: "ephemeral", ttl }
|
|
819
|
-
}
|
|
820
|
-
};
|
|
821
|
-
};
|
|
822
|
-
exports2.withCaching = withCaching;
|
|
823
|
-
}
|
|
824
|
-
});
|
|
825
|
-
|
|
826
|
-
// ../codegen-types/dist/index.js
|
|
827
|
-
var require_dist = __commonJS({
|
|
828
|
-
"../codegen-types/dist/index.js"(exports2) {
|
|
829
|
-
"use strict";
|
|
830
|
-
var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
831
|
-
if (k2 === void 0) k2 = k;
|
|
832
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
833
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
834
|
-
desc = { enumerable: true, get: function() {
|
|
835
|
-
return m[k];
|
|
836
|
-
} };
|
|
837
|
-
}
|
|
838
|
-
Object.defineProperty(o, k2, desc);
|
|
839
|
-
}) : (function(o, m, k, k2) {
|
|
840
|
-
if (k2 === void 0) k2 = k;
|
|
841
|
-
o[k2] = m[k];
|
|
842
|
-
}));
|
|
843
|
-
var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
|
|
844
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p);
|
|
845
|
-
};
|
|
846
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
847
|
-
__exportStar2(require_errors(), exports2);
|
|
848
|
-
__exportStar2(require_status(), exports2);
|
|
849
|
-
__exportStar2(require_task(), exports2);
|
|
850
|
-
__exportStar2(require_generation(), exports2);
|
|
851
|
-
__exportStar2(require_ai(), exports2);
|
|
852
|
-
}
|
|
853
|
-
});
|
|
854
|
-
|
|
855
64
|
// ../../node_modules/dotenv/package.json
|
|
856
65
|
var require_package = __commonJS({
|
|
857
66
|
"../../node_modules/dotenv/package.json"(exports2, module2) {
|
|
@@ -1258,7 +467,7 @@ var require_context = __commonJS({
|
|
|
1258
467
|
};
|
|
1259
468
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1260
469
|
exports2.initCtx = exports2.ctx = void 0;
|
|
1261
|
-
var
|
|
470
|
+
var types_1 = require_types_impl();
|
|
1262
471
|
var dotenv_1 = __importDefault2(require_main());
|
|
1263
472
|
var path_1 = __importDefault2(require("path"));
|
|
1264
473
|
dotenv_1.default.config({ path: path_1.default.join(__dirname, "../.env"), override: true });
|
|
@@ -1285,7 +494,7 @@ var require_context = __commonJS({
|
|
|
1285
494
|
projectId: process.env.PROJECT_ID || "test",
|
|
1286
495
|
appNamespace: process.env.APP_NAMESPACE,
|
|
1287
496
|
hasActiveJobs: () => {
|
|
1288
|
-
return Object.keys(exports2.ctx.activeJobs).some((jobId) => exports2.ctx.activeJobs[jobId] ===
|
|
497
|
+
return Object.keys(exports2.ctx.activeJobs).some((jobId) => exports2.ctx.activeJobs[jobId] === types_1.Status.RUNNING);
|
|
1289
498
|
},
|
|
1290
499
|
setJobStatus: (jobId, status) => {
|
|
1291
500
|
exports2.ctx.activeJobs[jobId] = status;
|
|
@@ -1304,17 +513,6 @@ var require_context = __commonJS({
|
|
|
1304
513
|
}
|
|
1305
514
|
});
|
|
1306
515
|
|
|
1307
|
-
// dist/job-context-storage.js
|
|
1308
|
-
var require_job_context_storage = __commonJS({
|
|
1309
|
-
"dist/job-context-storage.js"(exports2) {
|
|
1310
|
-
"use strict";
|
|
1311
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1312
|
-
exports2.jobContextStorage = void 0;
|
|
1313
|
-
var async_hooks_1 = require("async_hooks");
|
|
1314
|
-
exports2.jobContextStorage = new async_hooks_1.AsyncLocalStorage();
|
|
1315
|
-
}
|
|
1316
|
-
});
|
|
1317
|
-
|
|
1318
516
|
// ../../node_modules/tslib/tslib.es6.mjs
|
|
1319
517
|
var tslib_es6_exports = {};
|
|
1320
518
|
__export(tslib_es6_exports, {
|
|
@@ -2255,7 +1453,7 @@ var require_domain = __commonJS({
|
|
|
2255
1453
|
});
|
|
2256
1454
|
|
|
2257
1455
|
// ../../node_modules/@wix/headers/dist/cjs/errors.js
|
|
2258
|
-
var
|
|
1456
|
+
var require_errors = __commonJS({
|
|
2259
1457
|
"../../node_modules/@wix/headers/dist/cjs/errors.js"(exports2) {
|
|
2260
1458
|
"use strict";
|
|
2261
1459
|
exports2.__esModule = true;
|
|
@@ -2282,7 +1480,7 @@ var require_assert = __commonJS({
|
|
|
2282
1480
|
exports2.__esModule = true;
|
|
2283
1481
|
exports2.assertBoolean = assertBoolean;
|
|
2284
1482
|
exports2.assertString = assertString;
|
|
2285
|
-
var _errors =
|
|
1483
|
+
var _errors = require_errors();
|
|
2286
1484
|
function assertBoolean(key, value) {
|
|
2287
1485
|
if (typeof value !== "boolean") {
|
|
2288
1486
|
throw new _errors.WixHeadersValidationError("boolean", key, value);
|
|
@@ -4537,7 +3735,7 @@ var require_http = __commonJS({
|
|
|
4537
3735
|
});
|
|
4538
3736
|
|
|
4539
3737
|
// ../../node_modules/agent-base/dist/helpers.js
|
|
4540
|
-
var
|
|
3738
|
+
var require_helpers = __commonJS({
|
|
4541
3739
|
"../../node_modules/agent-base/dist/helpers.js"(exports2) {
|
|
4542
3740
|
"use strict";
|
|
4543
3741
|
var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -4607,7 +3805,7 @@ var require_helpers2 = __commonJS({
|
|
|
4607
3805
|
});
|
|
4608
3806
|
|
|
4609
3807
|
// ../../node_modules/agent-base/dist/index.js
|
|
4610
|
-
var
|
|
3808
|
+
var require_dist = __commonJS({
|
|
4611
3809
|
"../../node_modules/agent-base/dist/index.js"(exports2) {
|
|
4612
3810
|
"use strict";
|
|
4613
3811
|
var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -4645,7 +3843,7 @@ var require_dist2 = __commonJS({
|
|
|
4645
3843
|
var net = __importStar2(require("net"));
|
|
4646
3844
|
var http = __importStar2(require("http"));
|
|
4647
3845
|
var https_1 = require("https");
|
|
4648
|
-
__exportStar2(
|
|
3846
|
+
__exportStar2(require_helpers(), exports2);
|
|
4649
3847
|
var INTERNAL = /* @__PURE__ */ Symbol("AgentBaseInternalState");
|
|
4650
3848
|
var Agent = class extends http.Agent {
|
|
4651
3849
|
constructor(opts) {
|
|
@@ -4763,7 +3961,7 @@ var require_dist2 = __commonJS({
|
|
|
4763
3961
|
});
|
|
4764
3962
|
|
|
4765
3963
|
// ../../node_modules/http-proxy-agent/dist/index.js
|
|
4766
|
-
var
|
|
3964
|
+
var require_dist2 = __commonJS({
|
|
4767
3965
|
"../../node_modules/http-proxy-agent/dist/index.js"(exports2) {
|
|
4768
3966
|
"use strict";
|
|
4769
3967
|
var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -4802,7 +4000,7 @@ var require_dist3 = __commonJS({
|
|
|
4802
4000
|
var tls = __importStar2(require("tls"));
|
|
4803
4001
|
var debug_1 = __importDefault2(require_src());
|
|
4804
4002
|
var events_1 = require("events");
|
|
4805
|
-
var agent_base_1 =
|
|
4003
|
+
var agent_base_1 = require_dist();
|
|
4806
4004
|
var url_1 = require("url");
|
|
4807
4005
|
var debug = (0, debug_1.default)("http-proxy-agent");
|
|
4808
4006
|
var HttpProxyAgent = class extends agent_base_1.Agent {
|
|
@@ -4989,7 +4187,7 @@ var require_parse_proxy_response = __commonJS({
|
|
|
4989
4187
|
});
|
|
4990
4188
|
|
|
4991
4189
|
// ../../node_modules/https-proxy-agent/dist/index.js
|
|
4992
|
-
var
|
|
4190
|
+
var require_dist3 = __commonJS({
|
|
4993
4191
|
"../../node_modules/https-proxy-agent/dist/index.js"(exports2) {
|
|
4994
4192
|
"use strict";
|
|
4995
4193
|
var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -5028,7 +4226,7 @@ var require_dist4 = __commonJS({
|
|
|
5028
4226
|
var tls = __importStar2(require("tls"));
|
|
5029
4227
|
var assert_1 = __importDefault2(require("assert"));
|
|
5030
4228
|
var debug_1 = __importDefault2(require_src());
|
|
5031
|
-
var agent_base_1 =
|
|
4229
|
+
var agent_base_1 = require_dist();
|
|
5032
4230
|
var url_1 = require("url");
|
|
5033
4231
|
var parse_proxy_response_1 = require_parse_proxy_response();
|
|
5034
4232
|
var debug = (0, debug_1.default)("https-proxy-agent");
|
|
@@ -6400,8 +5598,8 @@ var require_http_client_node = __commonJS({
|
|
|
6400
5598
|
exports2.HttpClient = exports2.createHttpClient = void 0;
|
|
6401
5599
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
6402
5600
|
var http_1 = tslib_1.__importDefault(require_http());
|
|
6403
|
-
var http_proxy_agent_1 =
|
|
6404
|
-
var https_proxy_agent_1 =
|
|
5601
|
+
var http_proxy_agent_1 = require_dist2();
|
|
5602
|
+
var https_proxy_agent_1 = require_dist3();
|
|
6405
5603
|
var env_util_1 = require_env_util();
|
|
6406
5604
|
var http_client_1 = require_http_client();
|
|
6407
5605
|
var MAX_NUMBER_OF_REPORTING_PROXY_METRICS_ATTEMPTS = 3;
|
|
@@ -7610,33 +6808,6 @@ var require_http_impl = __commonJS({
|
|
|
7610
6808
|
}
|
|
7611
6809
|
});
|
|
7612
6810
|
|
|
7613
|
-
// ../../node_modules/@wix/ambassador-ctp-codegen-job-service-v1-job/build/cjs/types.impl.js
|
|
7614
|
-
var require_types_impl = __commonJS({
|
|
7615
|
-
"../../node_modules/@wix/ambassador-ctp-codegen-job-service-v1-job/build/cjs/types.impl.js"(exports2) {
|
|
7616
|
-
"use strict";
|
|
7617
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7618
|
-
exports2.Status = exports2.TaskKind = void 0;
|
|
7619
|
-
var TaskKind;
|
|
7620
|
-
(function(TaskKind2) {
|
|
7621
|
-
TaskKind2["UNKNOWN_TASK_KIND"] = "UNKNOWN_TASK_KIND";
|
|
7622
|
-
TaskKind2["INIT_CODEGEN"] = "INIT_CODEGEN";
|
|
7623
|
-
TaskKind2["ITERATE_CODEGEN"] = "ITERATE_CODEGEN";
|
|
7624
|
-
TaskKind2["RUN_AGENT"] = "RUN_AGENT";
|
|
7625
|
-
TaskKind2["FIX_CODE"] = "FIX_CODE";
|
|
7626
|
-
})(TaskKind || (exports2.TaskKind = TaskKind = {}));
|
|
7627
|
-
var Status;
|
|
7628
|
-
(function(Status2) {
|
|
7629
|
-
Status2["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
|
|
7630
|
-
Status2["PENDING"] = "PENDING";
|
|
7631
|
-
Status2["RUNNING"] = "RUNNING";
|
|
7632
|
-
Status2["COMPLETED"] = "COMPLETED";
|
|
7633
|
-
Status2["FAILED"] = "FAILED";
|
|
7634
|
-
Status2["CANCELLED"] = "CANCELLED";
|
|
7635
|
-
Status2["PENDING_CANCEL"] = "PENDING_CANCEL";
|
|
7636
|
-
})(Status || (exports2.Status = Status = {}));
|
|
7637
|
-
}
|
|
7638
|
-
});
|
|
7639
|
-
|
|
7640
6811
|
// dist/services/CodeGenService.js
|
|
7641
6812
|
var require_CodeGenService = __commonJS({
|
|
7642
6813
|
"dist/services/CodeGenService.js"(exports2) {
|
|
@@ -7646,12 +6817,11 @@ var require_CodeGenService = __commonJS({
|
|
|
7646
6817
|
var http_client_1 = require_index_node();
|
|
7647
6818
|
var http_1 = require_http_impl();
|
|
7648
6819
|
var types_1 = require_types_impl();
|
|
7649
|
-
var ditto_codegen_types_12 = require_dist();
|
|
7650
6820
|
Object.defineProperty(exports2, "Status", { enumerable: true, get: function() {
|
|
7651
|
-
return
|
|
6821
|
+
return types_1.Status;
|
|
7652
6822
|
} });
|
|
7653
6823
|
Object.defineProperty(exports2, "TaskKind", { enumerable: true, get: function() {
|
|
7654
|
-
return
|
|
6824
|
+
return types_1.TaskKind;
|
|
7655
6825
|
} });
|
|
7656
6826
|
var CodeGenService = class {
|
|
7657
6827
|
constructor(projectId) {
|
|
@@ -7662,7 +6832,7 @@ var require_CodeGenService = __commonJS({
|
|
|
7662
6832
|
projectId: this.projectId
|
|
7663
6833
|
}));
|
|
7664
6834
|
const jobs = resp.data?.jobs ?? [];
|
|
7665
|
-
return jobs.
|
|
6835
|
+
return jobs.filter((job) => job.status === types_1.Status.PENDING);
|
|
7666
6836
|
};
|
|
7667
6837
|
this.markJobAsCompleted = async (jobId) => {
|
|
7668
6838
|
await this.httpClient.request((0, http_1.updateJob)({
|
|
@@ -7707,15 +6877,14 @@ var require_CodeGenService = __commonJS({
|
|
|
7707
6877
|
this.updateJobStatus = async (jobId, status) => {
|
|
7708
6878
|
console.log("Updating job status", {
|
|
7709
6879
|
jobId,
|
|
7710
|
-
status
|
|
7711
|
-
ambassadorStatus: this.toAmbassadorStatus(status)
|
|
6880
|
+
status
|
|
7712
6881
|
});
|
|
7713
6882
|
await this.httpClient.request((0, http_1.updateJob)({
|
|
7714
6883
|
projectId: this.projectId,
|
|
7715
6884
|
job: {
|
|
7716
6885
|
id: jobId,
|
|
7717
6886
|
projectId: this.projectId,
|
|
7718
|
-
status
|
|
6887
|
+
status
|
|
7719
6888
|
}
|
|
7720
6889
|
}));
|
|
7721
6890
|
};
|
|
@@ -7725,7 +6894,7 @@ var require_CodeGenService = __commonJS({
|
|
|
7725
6894
|
jobId,
|
|
7726
6895
|
task: {
|
|
7727
6896
|
id: taskId,
|
|
7728
|
-
status
|
|
6897
|
+
status,
|
|
7729
6898
|
payload
|
|
7730
6899
|
}
|
|
7731
6900
|
}));
|
|
@@ -7736,9 +6905,9 @@ var require_CodeGenService = __commonJS({
|
|
|
7736
6905
|
jobId,
|
|
7737
6906
|
task: {
|
|
7738
6907
|
id: task.id,
|
|
7739
|
-
kind: task.kind
|
|
6908
|
+
kind: task.kind,
|
|
7740
6909
|
name: task.name,
|
|
7741
|
-
status: task.status
|
|
6910
|
+
status: task.status,
|
|
7742
6911
|
payload: task.payload,
|
|
7743
6912
|
agentName: task.agentName,
|
|
7744
6913
|
description: typeof task?.description === "string" ? task.description : task?.payload ? JSON.stringify(task.payload) : ""
|
|
@@ -7750,7 +6919,7 @@ var require_CodeGenService = __commonJS({
|
|
|
7750
6919
|
projectId: this.projectId,
|
|
7751
6920
|
jobId
|
|
7752
6921
|
}));
|
|
7753
|
-
return resp.data?.job
|
|
6922
|
+
return resp.data?.job ?? null;
|
|
7754
6923
|
};
|
|
7755
6924
|
this.httpClient = (0, http_client_1.createHttpClient)({
|
|
7756
6925
|
baseURL: "https://manage.wix.com",
|
|
@@ -7759,96 +6928,850 @@ var require_CodeGenService = __commonJS({
|
|
|
7759
6928
|
}
|
|
7760
6929
|
});
|
|
7761
6930
|
}
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
7773
|
-
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
|
|
7793
|
-
|
|
7794
|
-
|
|
7795
|
-
|
|
7796
|
-
|
|
6931
|
+
};
|
|
6932
|
+
exports2.CodeGenService = CodeGenService;
|
|
6933
|
+
}
|
|
6934
|
+
});
|
|
6935
|
+
|
|
6936
|
+
// dist/job-context-storage.js
|
|
6937
|
+
var require_job_context_storage = __commonJS({
|
|
6938
|
+
"dist/job-context-storage.js"(exports2) {
|
|
6939
|
+
"use strict";
|
|
6940
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
6941
|
+
exports2.jobContextStorage = void 0;
|
|
6942
|
+
var async_hooks_1 = require("async_hooks");
|
|
6943
|
+
exports2.jobContextStorage = new async_hooks_1.AsyncLocalStorage();
|
|
6944
|
+
}
|
|
6945
|
+
});
|
|
6946
|
+
|
|
6947
|
+
// ../codegen-types/dist/errors/ErrorTypes.js
|
|
6948
|
+
var require_ErrorTypes = __commonJS({
|
|
6949
|
+
"../codegen-types/dist/errors/ErrorTypes.js"(exports2) {
|
|
6950
|
+
"use strict";
|
|
6951
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
6952
|
+
exports2.ErrorType = void 0;
|
|
6953
|
+
var ErrorType;
|
|
6954
|
+
(function(ErrorType2) {
|
|
6955
|
+
ErrorType2["CODE_VALIDATION_ERROR"] = "CODE_VALIDATION_ERROR";
|
|
6956
|
+
ErrorType2["UNSUPPORTED_EXTENSION_TYPE"] = "UNSUPPORTED_EXTENSION_TYPE";
|
|
6957
|
+
ErrorType2["AI_TOKEN_LIMIT_ERROR"] = "AI_TOKEN_LIMIT_ERROR";
|
|
6958
|
+
ErrorType2["AI_RATE_LIMIT_ERROR"] = "AI_RATE_LIMIT_ERROR";
|
|
6959
|
+
ErrorType2["AI_NETWORK_ERROR"] = "AI_NETWORK_ERROR";
|
|
6960
|
+
ErrorType2["FILE_SYSTEM_ERROR"] = "FILE_SYSTEM_ERROR";
|
|
6961
|
+
ErrorType2["TIMEOUT_ERROR"] = "TIMEOUT_ERROR";
|
|
6962
|
+
ErrorType2["PROCESS_EXECUTION_ERROR"] = "PROCESS_EXECUTION_ERROR";
|
|
6963
|
+
ErrorType2["AGENT_CONFIGURATION_ERROR"] = "AGENT_CONFIGURATION_ERROR";
|
|
6964
|
+
ErrorType2["SCAFFOLDING_ERROR"] = "SCAFFOLDING_ERROR";
|
|
6965
|
+
ErrorType2["RESOURCE_NOT_FOUND_ERROR"] = "RESOURCE_NOT_FOUND_ERROR";
|
|
6966
|
+
ErrorType2["PLANNING_ERROR"] = "PLANNING_ERROR";
|
|
6967
|
+
ErrorType2["EXTENSION_GENERATION_ERROR"] = "EXTENSION_GENERATION_ERROR";
|
|
6968
|
+
ErrorType2["VALIDATION_CONFIGURATION_ERROR"] = "VALIDATION_CONFIGURATION_ERROR";
|
|
6969
|
+
ErrorType2["GENERATE_OBJECT_ERROR"] = "GENERATE_OBJECT_ERROR";
|
|
6970
|
+
ErrorType2["AUTO_FIX_ERROR"] = "AUTO_FIX_ERROR";
|
|
6971
|
+
ErrorType2["UNEXPECTED_ERROR"] = "UNEXPECTED_ERROR";
|
|
6972
|
+
ErrorType2["MISSING_JOB_ID_ERROR"] = "MISSING_JOB_ID_ERROR";
|
|
6973
|
+
})(ErrorType || (exports2.ErrorType = ErrorType = {}));
|
|
6974
|
+
}
|
|
6975
|
+
});
|
|
6976
|
+
|
|
6977
|
+
// ../codegen-types/dist/errors/enums.js
|
|
6978
|
+
var require_enums = __commonJS({
|
|
6979
|
+
"../codegen-types/dist/errors/enums.js"(exports2) {
|
|
6980
|
+
"use strict";
|
|
6981
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
6982
|
+
exports2.ResourceType = exports2.ErrorOrigin = exports2.ExtensionGenerationOperation = exports2.FileSystemOperation = exports2.ProcessType = exports2.ValidationType = void 0;
|
|
6983
|
+
var ValidationType;
|
|
6984
|
+
(function(ValidationType2) {
|
|
6985
|
+
ValidationType2["TYPESCRIPT"] = "typescript";
|
|
6986
|
+
ValidationType2["BUILD"] = "build";
|
|
6987
|
+
})(ValidationType || (exports2.ValidationType = ValidationType = {}));
|
|
6988
|
+
var ProcessType;
|
|
6989
|
+
(function(ProcessType2) {
|
|
6990
|
+
ProcessType2["SPAWN"] = "spawn";
|
|
6991
|
+
ProcessType2["EXECUTION"] = "execution";
|
|
6992
|
+
ProcessType2["INITIALIZATION"] = "initialization";
|
|
6993
|
+
})(ProcessType || (exports2.ProcessType = ProcessType = {}));
|
|
6994
|
+
var FileSystemOperation;
|
|
6995
|
+
(function(FileSystemOperation2) {
|
|
6996
|
+
FileSystemOperation2["READ"] = "read";
|
|
6997
|
+
FileSystemOperation2["WRITE"] = "write";
|
|
6998
|
+
FileSystemOperation2["DELETE"] = "delete";
|
|
6999
|
+
FileSystemOperation2["MKDIR"] = "mkdir";
|
|
7000
|
+
})(FileSystemOperation || (exports2.FileSystemOperation = FileSystemOperation = {}));
|
|
7001
|
+
var ExtensionGenerationOperation;
|
|
7002
|
+
(function(ExtensionGenerationOperation2) {
|
|
7003
|
+
ExtensionGenerationOperation2["INSERT"] = "insert";
|
|
7004
|
+
ExtensionGenerationOperation2["UPDATE"] = "update";
|
|
7005
|
+
ExtensionGenerationOperation2["DELETE"] = "delete";
|
|
7006
|
+
ExtensionGenerationOperation2["EDIT"] = "edit";
|
|
7007
|
+
})(ExtensionGenerationOperation || (exports2.ExtensionGenerationOperation = ExtensionGenerationOperation = {}));
|
|
7008
|
+
var ErrorOrigin;
|
|
7009
|
+
(function(ErrorOrigin2) {
|
|
7010
|
+
ErrorOrigin2["ITERATION"] = "iteration";
|
|
7011
|
+
ErrorOrigin2["INITIAL"] = "initial";
|
|
7012
|
+
})(ErrorOrigin || (exports2.ErrorOrigin = ErrorOrigin = {}));
|
|
7013
|
+
var ResourceType;
|
|
7014
|
+
(function(ResourceType2) {
|
|
7015
|
+
ResourceType2["COLLECTION"] = "collection";
|
|
7016
|
+
ResourceType2["FILE"] = "file";
|
|
7017
|
+
ResourceType2["EXTENSION"] = "extension";
|
|
7018
|
+
})(ResourceType || (exports2.ResourceType = ResourceType = {}));
|
|
7019
|
+
}
|
|
7020
|
+
});
|
|
7021
|
+
|
|
7022
|
+
// ../codegen-types/dist/errors/BaseCodegenError.js
|
|
7023
|
+
var require_BaseCodegenError = __commonJS({
|
|
7024
|
+
"../codegen-types/dist/errors/BaseCodegenError.js"(exports2) {
|
|
7025
|
+
"use strict";
|
|
7026
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7027
|
+
exports2.BaseCodegenError = void 0;
|
|
7028
|
+
var BaseCodegenError = class extends Error {
|
|
7029
|
+
constructor(message) {
|
|
7030
|
+
super(message);
|
|
7797
7031
|
}
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
}
|
|
7811
|
-
}
|
|
7812
|
-
toLocalTaskKind(kind) {
|
|
7813
|
-
if (!kind)
|
|
7814
|
-
return ditto_codegen_types_12.TaskKind.CODEGEN;
|
|
7815
|
-
const kindMap = {
|
|
7816
|
-
INIT_CODEGEN: ditto_codegen_types_12.TaskKind.INIT_CODEGEN,
|
|
7817
|
-
ITERATE_CODEGEN: ditto_codegen_types_12.TaskKind.ITERATE_CODEGEN,
|
|
7818
|
-
VALIDATION: ditto_codegen_types_12.TaskKind.VALIDATION,
|
|
7819
|
-
CODEGEN: ditto_codegen_types_12.TaskKind.CODEGEN,
|
|
7820
|
-
FIX_CODE: ditto_codegen_types_12.TaskKind.FIX_CODE,
|
|
7821
|
-
RUN_AGENT: ditto_codegen_types_12.TaskKind.RUN_AGENT
|
|
7032
|
+
/**
|
|
7033
|
+
* Convert error to JSON format for API responses
|
|
7034
|
+
*/
|
|
7035
|
+
toJSON() {
|
|
7036
|
+
const additional = this.getAdditionalProperties();
|
|
7037
|
+
return {
|
|
7038
|
+
name: this.name,
|
|
7039
|
+
message: this.message,
|
|
7040
|
+
errorType: this.errorType,
|
|
7041
|
+
retryable: this.retryable,
|
|
7042
|
+
expected: this.expected,
|
|
7043
|
+
...Object.keys(additional).length > 0 ? additional : {}
|
|
7822
7044
|
};
|
|
7823
|
-
return kindMap[kind] ?? ditto_codegen_types_12.TaskKind.CODEGEN;
|
|
7824
7045
|
}
|
|
7825
|
-
|
|
7046
|
+
/**
|
|
7047
|
+
* Override in subclasses to add additional properties
|
|
7048
|
+
*/
|
|
7049
|
+
getAdditionalProperties() {
|
|
7050
|
+
return {};
|
|
7051
|
+
}
|
|
7052
|
+
};
|
|
7053
|
+
exports2.BaseCodegenError = BaseCodegenError;
|
|
7054
|
+
}
|
|
7055
|
+
});
|
|
7056
|
+
|
|
7057
|
+
// ../codegen-types/dist/errors/CodeValidationError.js
|
|
7058
|
+
var require_CodeValidationError = __commonJS({
|
|
7059
|
+
"../codegen-types/dist/errors/CodeValidationError.js"(exports2) {
|
|
7060
|
+
"use strict";
|
|
7061
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7062
|
+
exports2.CodeValidationError = void 0;
|
|
7063
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7064
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
7065
|
+
var CodeValidationError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7066
|
+
constructor(message, options) {
|
|
7067
|
+
super(message);
|
|
7068
|
+
this.name = "CodeValidationError";
|
|
7069
|
+
this.errorType = ErrorTypes_1.ErrorType.CODE_VALIDATION_ERROR;
|
|
7070
|
+
this.expected = true;
|
|
7071
|
+
this.retryable = false;
|
|
7072
|
+
this.validationType = options.validationType;
|
|
7073
|
+
this.errors = options.errors || [];
|
|
7074
|
+
}
|
|
7075
|
+
getAdditionalProperties() {
|
|
7076
|
+
const props = {
|
|
7077
|
+
validationType: this.validationType
|
|
7078
|
+
};
|
|
7079
|
+
if (this.errors && this.errors.length > 0)
|
|
7080
|
+
props.errors = this.errors;
|
|
7081
|
+
return props;
|
|
7082
|
+
}
|
|
7083
|
+
};
|
|
7084
|
+
exports2.CodeValidationError = CodeValidationError;
|
|
7085
|
+
}
|
|
7086
|
+
});
|
|
7087
|
+
|
|
7088
|
+
// ../codegen-types/dist/errors/UnsupportedExtensionTypeError.js
|
|
7089
|
+
var require_UnsupportedExtensionTypeError = __commonJS({
|
|
7090
|
+
"../codegen-types/dist/errors/UnsupportedExtensionTypeError.js"(exports2) {
|
|
7091
|
+
"use strict";
|
|
7092
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7093
|
+
exports2.UnsupportedExtensionTypeError = void 0;
|
|
7094
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7095
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
7096
|
+
var UnsupportedExtensionTypeError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7097
|
+
constructor(message, options) {
|
|
7098
|
+
super(message);
|
|
7099
|
+
this.name = "UnsupportedExtensionTypeError";
|
|
7100
|
+
this.errorType = ErrorTypes_1.ErrorType.UNSUPPORTED_EXTENSION_TYPE;
|
|
7101
|
+
this.expected = true;
|
|
7102
|
+
this.retryable = false;
|
|
7103
|
+
this.extensionType = options.extensionType;
|
|
7104
|
+
this.origin = options.origin;
|
|
7105
|
+
}
|
|
7106
|
+
getAdditionalProperties() {
|
|
7826
7107
|
return {
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
taskId: task?.id || "",
|
|
7830
|
-
payload: task?.payload || {},
|
|
7831
|
-
createdDate: task?.createdAt ? new Date(task.createdAt).toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
|
|
7832
|
-
updatedDate: task?.updatedAt ? new Date(task.updatedAt).toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
|
|
7833
|
-
name: task?.name || task?.kind || "unknown",
|
|
7834
|
-
status: this.toLocalStatus(task?.status),
|
|
7835
|
-
description: typeof task?.description === "string" ? task.description : task?.payload ? JSON.stringify(task.payload) : "",
|
|
7836
|
-
error: typeof task?.error === "string" ? task.error : void 0,
|
|
7837
|
-
agentName: task?.agentName || void 0
|
|
7108
|
+
extensionType: this.extensionType,
|
|
7109
|
+
origin: this.origin
|
|
7838
7110
|
};
|
|
7839
7111
|
}
|
|
7840
|
-
|
|
7112
|
+
};
|
|
7113
|
+
exports2.UnsupportedExtensionTypeError = UnsupportedExtensionTypeError;
|
|
7114
|
+
}
|
|
7115
|
+
});
|
|
7116
|
+
|
|
7117
|
+
// ../codegen-types/dist/errors/AIErrors.js
|
|
7118
|
+
var require_AIErrors = __commonJS({
|
|
7119
|
+
"../codegen-types/dist/errors/AIErrors.js"(exports2) {
|
|
7120
|
+
"use strict";
|
|
7121
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7122
|
+
exports2.AINetworkError = exports2.AIRateLimitError = exports2.AITokenLimitError = void 0;
|
|
7123
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7124
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
7125
|
+
var AITokenLimitError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7126
|
+
constructor(message, options) {
|
|
7127
|
+
super(message);
|
|
7128
|
+
this.name = "AITokenLimitError";
|
|
7129
|
+
this.errorType = ErrorTypes_1.ErrorType.AI_TOKEN_LIMIT_ERROR;
|
|
7130
|
+
this.expected = false;
|
|
7131
|
+
this.retryable = true;
|
|
7132
|
+
this.filePath = options?.filePath;
|
|
7133
|
+
this.fileSizeKB = options?.fileSizeKB;
|
|
7134
|
+
this.errorCount = options?.errorCount;
|
|
7135
|
+
this.aiError = options?.aiError;
|
|
7136
|
+
}
|
|
7137
|
+
getAdditionalProperties() {
|
|
7138
|
+
const props = {};
|
|
7139
|
+
if (this.filePath)
|
|
7140
|
+
props.filePath = this.filePath;
|
|
7141
|
+
if (this.fileSizeKB !== void 0)
|
|
7142
|
+
props.fileSizeKB = this.fileSizeKB;
|
|
7143
|
+
if (this.errorCount !== void 0)
|
|
7144
|
+
props.errorCount = this.errorCount;
|
|
7145
|
+
if (this.aiError)
|
|
7146
|
+
props.aiError = this.aiError;
|
|
7147
|
+
return props;
|
|
7148
|
+
}
|
|
7149
|
+
};
|
|
7150
|
+
exports2.AITokenLimitError = AITokenLimitError;
|
|
7151
|
+
var AIRateLimitError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7152
|
+
constructor(message, options) {
|
|
7153
|
+
super(message);
|
|
7154
|
+
this.name = "AIRateLimitError";
|
|
7155
|
+
this.errorType = ErrorTypes_1.ErrorType.AI_RATE_LIMIT_ERROR;
|
|
7156
|
+
this.expected = false;
|
|
7157
|
+
this.retryable = true;
|
|
7158
|
+
this.aiError = options?.aiError;
|
|
7159
|
+
}
|
|
7160
|
+
getAdditionalProperties() {
|
|
7161
|
+
const props = {};
|
|
7162
|
+
if (this.aiError)
|
|
7163
|
+
props.aiError = this.aiError;
|
|
7164
|
+
return props;
|
|
7165
|
+
}
|
|
7166
|
+
};
|
|
7167
|
+
exports2.AIRateLimitError = AIRateLimitError;
|
|
7168
|
+
var AINetworkError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7169
|
+
constructor(message, options) {
|
|
7170
|
+
super(message);
|
|
7171
|
+
this.name = "AINetworkError";
|
|
7172
|
+
this.errorType = ErrorTypes_1.ErrorType.AI_NETWORK_ERROR;
|
|
7173
|
+
this.expected = false;
|
|
7174
|
+
this.retryable = true;
|
|
7175
|
+
this.aiError = options?.aiError;
|
|
7176
|
+
}
|
|
7177
|
+
getAdditionalProperties() {
|
|
7178
|
+
const props = {};
|
|
7179
|
+
if (this.aiError)
|
|
7180
|
+
props.aiError = this.aiError;
|
|
7181
|
+
return props;
|
|
7182
|
+
}
|
|
7183
|
+
};
|
|
7184
|
+
exports2.AINetworkError = AINetworkError;
|
|
7185
|
+
}
|
|
7186
|
+
});
|
|
7187
|
+
|
|
7188
|
+
// ../codegen-types/dist/errors/FileSystemError.js
|
|
7189
|
+
var require_FileSystemError = __commonJS({
|
|
7190
|
+
"../codegen-types/dist/errors/FileSystemError.js"(exports2) {
|
|
7191
|
+
"use strict";
|
|
7192
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7193
|
+
exports2.FileSystemError = void 0;
|
|
7194
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7195
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
7196
|
+
var FileSystemError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7197
|
+
constructor(message, options) {
|
|
7198
|
+
super(message);
|
|
7199
|
+
this.name = "FileSystemError";
|
|
7200
|
+
this.errorType = ErrorTypes_1.ErrorType.FILE_SYSTEM_ERROR;
|
|
7201
|
+
this.expected = false;
|
|
7202
|
+
this.retryable = true;
|
|
7203
|
+
this.filePath = options?.filePath;
|
|
7204
|
+
this.operation = options?.operation;
|
|
7205
|
+
this.cause = options?.cause;
|
|
7206
|
+
}
|
|
7207
|
+
getAdditionalProperties() {
|
|
7208
|
+
const props = {};
|
|
7209
|
+
if (this.filePath)
|
|
7210
|
+
props.filePath = this.filePath;
|
|
7211
|
+
if (this.operation)
|
|
7212
|
+
props.operation = this.operation;
|
|
7213
|
+
if (this.cause)
|
|
7214
|
+
props.cause = this.cause;
|
|
7215
|
+
return props;
|
|
7216
|
+
}
|
|
7217
|
+
};
|
|
7218
|
+
exports2.FileSystemError = FileSystemError;
|
|
7219
|
+
}
|
|
7220
|
+
});
|
|
7221
|
+
|
|
7222
|
+
// ../codegen-types/dist/errors/ProcessExecutionError.js
|
|
7223
|
+
var require_ProcessExecutionError = __commonJS({
|
|
7224
|
+
"../codegen-types/dist/errors/ProcessExecutionError.js"(exports2) {
|
|
7225
|
+
"use strict";
|
|
7226
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7227
|
+
exports2.ProcessExecutionError = void 0;
|
|
7228
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7229
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
7230
|
+
var ProcessExecutionError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7231
|
+
constructor(message, options) {
|
|
7232
|
+
super(message);
|
|
7233
|
+
this.name = "ProcessExecutionError";
|
|
7234
|
+
this.errorType = ErrorTypes_1.ErrorType.PROCESS_EXECUTION_ERROR;
|
|
7235
|
+
this.expected = false;
|
|
7236
|
+
this.retryable = false;
|
|
7237
|
+
this.processType = options?.processType;
|
|
7238
|
+
this.exitCode = options?.exitCode;
|
|
7239
|
+
this.stderr = options?.stderr;
|
|
7240
|
+
this.cause = options?.cause;
|
|
7241
|
+
}
|
|
7242
|
+
getAdditionalProperties() {
|
|
7243
|
+
const props = {};
|
|
7244
|
+
if (this.processType)
|
|
7245
|
+
props.processType = this.processType;
|
|
7246
|
+
if (this.exitCode !== void 0)
|
|
7247
|
+
props.exitCode = this.exitCode;
|
|
7248
|
+
if (this.stderr)
|
|
7249
|
+
props.stderr = this.stderr;
|
|
7250
|
+
if (this.cause)
|
|
7251
|
+
props.cause = this.cause;
|
|
7252
|
+
return props;
|
|
7253
|
+
}
|
|
7254
|
+
};
|
|
7255
|
+
exports2.ProcessExecutionError = ProcessExecutionError;
|
|
7256
|
+
}
|
|
7257
|
+
});
|
|
7258
|
+
|
|
7259
|
+
// ../codegen-types/dist/errors/AgentConfigurationError.js
|
|
7260
|
+
var require_AgentConfigurationError = __commonJS({
|
|
7261
|
+
"../codegen-types/dist/errors/AgentConfigurationError.js"(exports2) {
|
|
7262
|
+
"use strict";
|
|
7263
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7264
|
+
exports2.AgentConfigurationError = void 0;
|
|
7265
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7266
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
7267
|
+
var AgentConfigurationError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7268
|
+
constructor(message, options) {
|
|
7269
|
+
super(message);
|
|
7270
|
+
this.name = "AgentConfigurationError";
|
|
7271
|
+
this.errorType = ErrorTypes_1.ErrorType.AGENT_CONFIGURATION_ERROR;
|
|
7272
|
+
this.expected = false;
|
|
7273
|
+
this.retryable = false;
|
|
7274
|
+
this.extensionType = options?.extensionType;
|
|
7275
|
+
this.agentType = options?.agentType;
|
|
7276
|
+
}
|
|
7277
|
+
getAdditionalProperties() {
|
|
7278
|
+
const props = {};
|
|
7279
|
+
if (this.extensionType)
|
|
7280
|
+
props.extensionType = this.extensionType;
|
|
7281
|
+
if (this.agentType)
|
|
7282
|
+
props.agentType = this.agentType;
|
|
7283
|
+
return props;
|
|
7284
|
+
}
|
|
7285
|
+
};
|
|
7286
|
+
exports2.AgentConfigurationError = AgentConfigurationError;
|
|
7287
|
+
}
|
|
7288
|
+
});
|
|
7289
|
+
|
|
7290
|
+
// ../codegen-types/dist/errors/ScaffoldingError.js
|
|
7291
|
+
var require_ScaffoldingError = __commonJS({
|
|
7292
|
+
"../codegen-types/dist/errors/ScaffoldingError.js"(exports2) {
|
|
7293
|
+
"use strict";
|
|
7294
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7295
|
+
exports2.ScaffoldingError = void 0;
|
|
7296
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7297
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
7298
|
+
var ScaffoldingError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7299
|
+
constructor(message, options) {
|
|
7300
|
+
super(message);
|
|
7301
|
+
this.name = "ScaffoldingError";
|
|
7302
|
+
this.errorType = ErrorTypes_1.ErrorType.SCAFFOLDING_ERROR;
|
|
7303
|
+
this.expected = false;
|
|
7304
|
+
this.retryable = false;
|
|
7305
|
+
this.extensionType = options?.extensionType;
|
|
7306
|
+
this.scaffoldPath = options?.scaffoldPath;
|
|
7307
|
+
this.cause = options?.cause;
|
|
7308
|
+
}
|
|
7309
|
+
getAdditionalProperties() {
|
|
7310
|
+
const props = {};
|
|
7311
|
+
if (this.extensionType)
|
|
7312
|
+
props.extensionType = this.extensionType;
|
|
7313
|
+
if (this.scaffoldPath)
|
|
7314
|
+
props.scaffoldPath = this.scaffoldPath;
|
|
7315
|
+
if (this.cause)
|
|
7316
|
+
props.cause = this.cause;
|
|
7317
|
+
return props;
|
|
7318
|
+
}
|
|
7319
|
+
};
|
|
7320
|
+
exports2.ScaffoldingError = ScaffoldingError;
|
|
7321
|
+
}
|
|
7322
|
+
});
|
|
7323
|
+
|
|
7324
|
+
// ../codegen-types/dist/errors/ResourceNotFoundError.js
|
|
7325
|
+
var require_ResourceNotFoundError = __commonJS({
|
|
7326
|
+
"../codegen-types/dist/errors/ResourceNotFoundError.js"(exports2) {
|
|
7327
|
+
"use strict";
|
|
7328
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7329
|
+
exports2.ResourceNotFoundError = void 0;
|
|
7330
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7331
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
7332
|
+
var ResourceNotFoundError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7333
|
+
constructor(message, options) {
|
|
7334
|
+
super(message);
|
|
7335
|
+
this.name = "ResourceNotFoundError";
|
|
7336
|
+
this.errorType = ErrorTypes_1.ErrorType.RESOURCE_NOT_FOUND_ERROR;
|
|
7337
|
+
this.expected = false;
|
|
7338
|
+
this.retryable = false;
|
|
7339
|
+
this.resourceType = options?.resourceType;
|
|
7340
|
+
this.resourceId = options?.resourceId;
|
|
7341
|
+
}
|
|
7342
|
+
getAdditionalProperties() {
|
|
7343
|
+
const props = {};
|
|
7344
|
+
if (this.resourceType)
|
|
7345
|
+
props.resourceType = this.resourceType;
|
|
7346
|
+
if (this.resourceId)
|
|
7347
|
+
props.resourceId = this.resourceId;
|
|
7348
|
+
return props;
|
|
7349
|
+
}
|
|
7350
|
+
};
|
|
7351
|
+
exports2.ResourceNotFoundError = ResourceNotFoundError;
|
|
7352
|
+
}
|
|
7353
|
+
});
|
|
7354
|
+
|
|
7355
|
+
// ../codegen-types/dist/errors/PlanningError.js
|
|
7356
|
+
var require_PlanningError = __commonJS({
|
|
7357
|
+
"../codegen-types/dist/errors/PlanningError.js"(exports2) {
|
|
7358
|
+
"use strict";
|
|
7359
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7360
|
+
exports2.PlanningError = void 0;
|
|
7361
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7362
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
7363
|
+
var PlanningError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7364
|
+
constructor(message, options) {
|
|
7365
|
+
super(message);
|
|
7366
|
+
this.name = "PlanningError";
|
|
7367
|
+
this.errorType = ErrorTypes_1.ErrorType.PLANNING_ERROR;
|
|
7368
|
+
this.expected = false;
|
|
7369
|
+
this.retryable = false;
|
|
7370
|
+
this.attemptCount = options?.attemptCount;
|
|
7371
|
+
this.lastError = options?.lastError;
|
|
7372
|
+
}
|
|
7373
|
+
getAdditionalProperties() {
|
|
7374
|
+
const props = {};
|
|
7375
|
+
if (this.attemptCount !== void 0)
|
|
7376
|
+
props.attemptCount = this.attemptCount;
|
|
7377
|
+
if (this.lastError)
|
|
7378
|
+
props.lastError = this.lastError;
|
|
7379
|
+
return props;
|
|
7380
|
+
}
|
|
7381
|
+
};
|
|
7382
|
+
exports2.PlanningError = PlanningError;
|
|
7383
|
+
}
|
|
7384
|
+
});
|
|
7385
|
+
|
|
7386
|
+
// ../codegen-types/dist/errors/ExtensionGenerationError.js
|
|
7387
|
+
var require_ExtensionGenerationError = __commonJS({
|
|
7388
|
+
"../codegen-types/dist/errors/ExtensionGenerationError.js"(exports2) {
|
|
7389
|
+
"use strict";
|
|
7390
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7391
|
+
exports2.ExtensionGenerationError = void 0;
|
|
7392
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7393
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
7394
|
+
var ExtensionGenerationError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7395
|
+
constructor(message, options) {
|
|
7396
|
+
super(message);
|
|
7397
|
+
this.name = "ExtensionGenerationError";
|
|
7398
|
+
this.errorType = ErrorTypes_1.ErrorType.EXTENSION_GENERATION_ERROR;
|
|
7399
|
+
this.expected = false;
|
|
7400
|
+
this.retryable = false;
|
|
7401
|
+
this.extensionName = options?.extensionName;
|
|
7402
|
+
this.extensionType = options?.extensionType;
|
|
7403
|
+
this.operation = options?.operation;
|
|
7404
|
+
this.filePath = options?.filePath;
|
|
7405
|
+
}
|
|
7406
|
+
getAdditionalProperties() {
|
|
7407
|
+
const props = {};
|
|
7408
|
+
if (this.extensionName)
|
|
7409
|
+
props.extensionName = this.extensionName;
|
|
7410
|
+
if (this.extensionType)
|
|
7411
|
+
props.extensionType = this.extensionType;
|
|
7412
|
+
if (this.operation)
|
|
7413
|
+
props.operation = this.operation;
|
|
7414
|
+
if (this.filePath)
|
|
7415
|
+
props.filePath = this.filePath;
|
|
7416
|
+
return props;
|
|
7417
|
+
}
|
|
7418
|
+
};
|
|
7419
|
+
exports2.ExtensionGenerationError = ExtensionGenerationError;
|
|
7420
|
+
}
|
|
7421
|
+
});
|
|
7422
|
+
|
|
7423
|
+
// ../codegen-types/dist/errors/ValidationConfigurationError.js
|
|
7424
|
+
var require_ValidationConfigurationError = __commonJS({
|
|
7425
|
+
"../codegen-types/dist/errors/ValidationConfigurationError.js"(exports2) {
|
|
7426
|
+
"use strict";
|
|
7427
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7428
|
+
exports2.ValidationConfigurationError = void 0;
|
|
7429
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7430
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
7431
|
+
var ValidationConfigurationError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7432
|
+
constructor(message, options) {
|
|
7433
|
+
super(message);
|
|
7434
|
+
this.name = "ValidationConfigurationError";
|
|
7435
|
+
this.errorType = ErrorTypes_1.ErrorType.VALIDATION_CONFIGURATION_ERROR;
|
|
7436
|
+
this.expected = false;
|
|
7437
|
+
this.retryable = false;
|
|
7438
|
+
this.validatorType = options?.validatorType;
|
|
7439
|
+
this.fixerType = options?.fixerType;
|
|
7440
|
+
}
|
|
7441
|
+
getAdditionalProperties() {
|
|
7442
|
+
const props = {};
|
|
7443
|
+
if (this.validatorType)
|
|
7444
|
+
props.validatorType = this.validatorType;
|
|
7445
|
+
if (this.fixerType)
|
|
7446
|
+
props.fixerType = this.fixerType;
|
|
7447
|
+
return props;
|
|
7448
|
+
}
|
|
7449
|
+
};
|
|
7450
|
+
exports2.ValidationConfigurationError = ValidationConfigurationError;
|
|
7451
|
+
}
|
|
7452
|
+
});
|
|
7453
|
+
|
|
7454
|
+
// ../codegen-types/dist/errors/AutoFixError.js
|
|
7455
|
+
var require_AutoFixError = __commonJS({
|
|
7456
|
+
"../codegen-types/dist/errors/AutoFixError.js"(exports2) {
|
|
7457
|
+
"use strict";
|
|
7458
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7459
|
+
exports2.AutoFixError = void 0;
|
|
7460
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7461
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
7462
|
+
var AutoFixError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7463
|
+
constructor(message, options) {
|
|
7464
|
+
super(message);
|
|
7465
|
+
this.name = "AutoFixError";
|
|
7466
|
+
this.errorType = ErrorTypes_1.ErrorType.AUTO_FIX_ERROR;
|
|
7467
|
+
this.expected = false;
|
|
7468
|
+
this.retryable = true;
|
|
7469
|
+
this.validationType = options?.validationType;
|
|
7470
|
+
this.cause = options?.cause;
|
|
7471
|
+
}
|
|
7472
|
+
getAdditionalProperties() {
|
|
7841
7473
|
return {
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
tasks: Array.isArray(job?.tasks) ? job.tasks.map((t) => this.mapToLocalTask(t)) : [],
|
|
7845
|
-
createdAt: job?.createdAt ? new Date(job.createdAt) : /* @__PURE__ */ new Date(),
|
|
7846
|
-
updatedAt: job?.updatedAt ? new Date(job.updatedAt) : /* @__PURE__ */ new Date(),
|
|
7847
|
-
status: this.toLocalStatus(job?.status)
|
|
7474
|
+
validationType: this.validationType,
|
|
7475
|
+
cause: this.cause
|
|
7848
7476
|
};
|
|
7849
7477
|
}
|
|
7850
7478
|
};
|
|
7851
|
-
exports2.
|
|
7479
|
+
exports2.AutoFixError = AutoFixError;
|
|
7480
|
+
}
|
|
7481
|
+
});
|
|
7482
|
+
|
|
7483
|
+
// ../codegen-types/dist/errors/UnexpectedError.js
|
|
7484
|
+
var require_UnexpectedError = __commonJS({
|
|
7485
|
+
"../codegen-types/dist/errors/UnexpectedError.js"(exports2) {
|
|
7486
|
+
"use strict";
|
|
7487
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7488
|
+
exports2.UnexpectedError = void 0;
|
|
7489
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7490
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
7491
|
+
var UnexpectedError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7492
|
+
constructor(message, options) {
|
|
7493
|
+
super(message);
|
|
7494
|
+
this.name = "UnexpectedError";
|
|
7495
|
+
this.errorType = ErrorTypes_1.ErrorType.UNEXPECTED_ERROR;
|
|
7496
|
+
this.expected = false;
|
|
7497
|
+
this.retryable = true;
|
|
7498
|
+
this.originalError = options?.originalError;
|
|
7499
|
+
}
|
|
7500
|
+
getAdditionalProperties() {
|
|
7501
|
+
const props = {};
|
|
7502
|
+
if (this.originalError)
|
|
7503
|
+
props.originalError = this.originalError;
|
|
7504
|
+
return props;
|
|
7505
|
+
}
|
|
7506
|
+
};
|
|
7507
|
+
exports2.UnexpectedError = UnexpectedError;
|
|
7508
|
+
}
|
|
7509
|
+
});
|
|
7510
|
+
|
|
7511
|
+
// ../codegen-types/dist/errors/TimeoutError.js
|
|
7512
|
+
var require_TimeoutError = __commonJS({
|
|
7513
|
+
"../codegen-types/dist/errors/TimeoutError.js"(exports2) {
|
|
7514
|
+
"use strict";
|
|
7515
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7516
|
+
exports2.TimeoutError = void 0;
|
|
7517
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7518
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
7519
|
+
var TimeoutError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7520
|
+
constructor(message) {
|
|
7521
|
+
super(message);
|
|
7522
|
+
this.name = "TimeoutError";
|
|
7523
|
+
this.errorType = ErrorTypes_1.ErrorType.TIMEOUT_ERROR;
|
|
7524
|
+
this.expected = false;
|
|
7525
|
+
this.retryable = true;
|
|
7526
|
+
}
|
|
7527
|
+
};
|
|
7528
|
+
exports2.TimeoutError = TimeoutError;
|
|
7529
|
+
}
|
|
7530
|
+
});
|
|
7531
|
+
|
|
7532
|
+
// ../codegen-types/dist/errors/GenerateCodegenObjectError.js
|
|
7533
|
+
var require_GenerateCodegenObjectError = __commonJS({
|
|
7534
|
+
"../codegen-types/dist/errors/GenerateCodegenObjectError.js"(exports2) {
|
|
7535
|
+
"use strict";
|
|
7536
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7537
|
+
exports2.GenerateObjectError = void 0;
|
|
7538
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7539
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
7540
|
+
var GenerateObjectError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7541
|
+
constructor(message, options) {
|
|
7542
|
+
super(message);
|
|
7543
|
+
this.name = "generateObjectError";
|
|
7544
|
+
this.errorType = ErrorTypes_1.ErrorType.GENERATE_OBJECT_ERROR;
|
|
7545
|
+
this.retryable = false;
|
|
7546
|
+
this.expected = false;
|
|
7547
|
+
this.status = options?.status;
|
|
7548
|
+
this.statusText = options?.statusText;
|
|
7549
|
+
this.url = options?.url;
|
|
7550
|
+
}
|
|
7551
|
+
getAdditionalProperties() {
|
|
7552
|
+
const props = {};
|
|
7553
|
+
if (this.status !== void 0)
|
|
7554
|
+
props.status = this.status;
|
|
7555
|
+
if (this.statusText !== void 0)
|
|
7556
|
+
props.statusText = this.statusText;
|
|
7557
|
+
if (this.url !== void 0)
|
|
7558
|
+
props.url = this.url;
|
|
7559
|
+
return props;
|
|
7560
|
+
}
|
|
7561
|
+
};
|
|
7562
|
+
exports2.GenerateObjectError = GenerateObjectError;
|
|
7563
|
+
}
|
|
7564
|
+
});
|
|
7565
|
+
|
|
7566
|
+
// ../codegen-types/dist/errors/MissingJobIdError.js
|
|
7567
|
+
var require_MissingJobIdError = __commonJS({
|
|
7568
|
+
"../codegen-types/dist/errors/MissingJobIdError.js"(exports2) {
|
|
7569
|
+
"use strict";
|
|
7570
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7571
|
+
exports2.MissingJobIdError = void 0;
|
|
7572
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7573
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
7574
|
+
var MissingJobIdError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
7575
|
+
constructor(message = "Job ID is required") {
|
|
7576
|
+
super(message);
|
|
7577
|
+
this.name = "MissingJobIdError";
|
|
7578
|
+
this.errorType = ErrorTypes_1.ErrorType.MISSING_JOB_ID_ERROR;
|
|
7579
|
+
this.expected = false;
|
|
7580
|
+
this.retryable = false;
|
|
7581
|
+
}
|
|
7582
|
+
};
|
|
7583
|
+
exports2.MissingJobIdError = MissingJobIdError;
|
|
7584
|
+
}
|
|
7585
|
+
});
|
|
7586
|
+
|
|
7587
|
+
// ../codegen-types/dist/errors/helpers.js
|
|
7588
|
+
var require_helpers2 = __commonJS({
|
|
7589
|
+
"../codegen-types/dist/errors/helpers.js"(exports2) {
|
|
7590
|
+
"use strict";
|
|
7591
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7592
|
+
exports2.isCodegenError = isCodegenError;
|
|
7593
|
+
exports2.toCodegenError = toCodegenError;
|
|
7594
|
+
exports2.getErrorType = getErrorType;
|
|
7595
|
+
exports2.isRetryableError = isRetryableError;
|
|
7596
|
+
exports2.isExpectedError = isExpectedError;
|
|
7597
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
7598
|
+
var UnexpectedError_1 = require_UnexpectedError();
|
|
7599
|
+
function isCodegenError(error) {
|
|
7600
|
+
if (error instanceof BaseCodegenError_1.BaseCodegenError) {
|
|
7601
|
+
return true;
|
|
7602
|
+
}
|
|
7603
|
+
if (typeof error === "object" && error !== null && "name" in error && "errorType" in error && typeof error.name === "string" && typeof error.errorType === "string") {
|
|
7604
|
+
return true;
|
|
7605
|
+
}
|
|
7606
|
+
return false;
|
|
7607
|
+
}
|
|
7608
|
+
function toCodegenError(error) {
|
|
7609
|
+
if (isCodegenError(error)) {
|
|
7610
|
+
return error;
|
|
7611
|
+
}
|
|
7612
|
+
if (error instanceof Error) {
|
|
7613
|
+
return new UnexpectedError_1.UnexpectedError(error.message, {
|
|
7614
|
+
originalError: error
|
|
7615
|
+
});
|
|
7616
|
+
}
|
|
7617
|
+
return new UnexpectedError_1.UnexpectedError("An unexpected error occurred", {
|
|
7618
|
+
originalError: error
|
|
7619
|
+
});
|
|
7620
|
+
}
|
|
7621
|
+
function getErrorType(error) {
|
|
7622
|
+
if (typeof error === "object" && error !== null && "name" in error) {
|
|
7623
|
+
return typeof error.name === "string" ? error.name : null;
|
|
7624
|
+
}
|
|
7625
|
+
return null;
|
|
7626
|
+
}
|
|
7627
|
+
function isRetryableError(error) {
|
|
7628
|
+
if (isCodegenError(error)) {
|
|
7629
|
+
if (typeof error === "object" && error !== null && "retryable" in error) {
|
|
7630
|
+
return Boolean(error.retryable);
|
|
7631
|
+
}
|
|
7632
|
+
}
|
|
7633
|
+
return true;
|
|
7634
|
+
}
|
|
7635
|
+
function isExpectedError(error) {
|
|
7636
|
+
if (isCodegenError(error)) {
|
|
7637
|
+
if (typeof error === "object" && error !== null && "expected" in error) {
|
|
7638
|
+
return Boolean(error.expected);
|
|
7639
|
+
}
|
|
7640
|
+
}
|
|
7641
|
+
return false;
|
|
7642
|
+
}
|
|
7643
|
+
}
|
|
7644
|
+
});
|
|
7645
|
+
|
|
7646
|
+
// ../codegen-types/dist/errors/index.js
|
|
7647
|
+
var require_errors2 = __commonJS({
|
|
7648
|
+
"../codegen-types/dist/errors/index.js"(exports2) {
|
|
7649
|
+
"use strict";
|
|
7650
|
+
var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
7651
|
+
if (k2 === void 0) k2 = k;
|
|
7652
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7653
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7654
|
+
desc = { enumerable: true, get: function() {
|
|
7655
|
+
return m[k];
|
|
7656
|
+
} };
|
|
7657
|
+
}
|
|
7658
|
+
Object.defineProperty(o, k2, desc);
|
|
7659
|
+
}) : (function(o, m, k, k2) {
|
|
7660
|
+
if (k2 === void 0) k2 = k;
|
|
7661
|
+
o[k2] = m[k];
|
|
7662
|
+
}));
|
|
7663
|
+
var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
|
|
7664
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p);
|
|
7665
|
+
};
|
|
7666
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7667
|
+
__exportStar2(require_ErrorTypes(), exports2);
|
|
7668
|
+
__exportStar2(require_enums(), exports2);
|
|
7669
|
+
__exportStar2(require_BaseCodegenError(), exports2);
|
|
7670
|
+
__exportStar2(require_CodeValidationError(), exports2);
|
|
7671
|
+
__exportStar2(require_UnsupportedExtensionTypeError(), exports2);
|
|
7672
|
+
__exportStar2(require_AIErrors(), exports2);
|
|
7673
|
+
__exportStar2(require_FileSystemError(), exports2);
|
|
7674
|
+
__exportStar2(require_ProcessExecutionError(), exports2);
|
|
7675
|
+
__exportStar2(require_AgentConfigurationError(), exports2);
|
|
7676
|
+
__exportStar2(require_ScaffoldingError(), exports2);
|
|
7677
|
+
__exportStar2(require_ResourceNotFoundError(), exports2);
|
|
7678
|
+
__exportStar2(require_PlanningError(), exports2);
|
|
7679
|
+
__exportStar2(require_ExtensionGenerationError(), exports2);
|
|
7680
|
+
__exportStar2(require_ValidationConfigurationError(), exports2);
|
|
7681
|
+
__exportStar2(require_AutoFixError(), exports2);
|
|
7682
|
+
__exportStar2(require_UnexpectedError(), exports2);
|
|
7683
|
+
__exportStar2(require_TimeoutError(), exports2);
|
|
7684
|
+
__exportStar2(require_GenerateCodegenObjectError(), exports2);
|
|
7685
|
+
__exportStar2(require_MissingJobIdError(), exports2);
|
|
7686
|
+
__exportStar2(require_helpers2(), exports2);
|
|
7687
|
+
}
|
|
7688
|
+
});
|
|
7689
|
+
|
|
7690
|
+
// ../codegen-types/dist/types/status.js
|
|
7691
|
+
var require_status = __commonJS({
|
|
7692
|
+
"../codegen-types/dist/types/status.js"(exports2) {
|
|
7693
|
+
"use strict";
|
|
7694
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7695
|
+
exports2.Status = void 0;
|
|
7696
|
+
var types_1 = require_types_impl();
|
|
7697
|
+
Object.defineProperty(exports2, "Status", { enumerable: true, get: function() {
|
|
7698
|
+
return types_1.Status;
|
|
7699
|
+
} });
|
|
7700
|
+
}
|
|
7701
|
+
});
|
|
7702
|
+
|
|
7703
|
+
// ../codegen-types/dist/types/task.js
|
|
7704
|
+
var require_task = __commonJS({
|
|
7705
|
+
"../codegen-types/dist/types/task.js"(exports2) {
|
|
7706
|
+
"use strict";
|
|
7707
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7708
|
+
exports2.TaskKind = void 0;
|
|
7709
|
+
var types_1 = require_types_impl();
|
|
7710
|
+
Object.defineProperty(exports2, "TaskKind", { enumerable: true, get: function() {
|
|
7711
|
+
return types_1.TaskKind;
|
|
7712
|
+
} });
|
|
7713
|
+
}
|
|
7714
|
+
});
|
|
7715
|
+
|
|
7716
|
+
// ../codegen-types/dist/types/generation.js
|
|
7717
|
+
var require_generation = __commonJS({
|
|
7718
|
+
"../codegen-types/dist/types/generation.js"(exports2) {
|
|
7719
|
+
"use strict";
|
|
7720
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7721
|
+
exports2.GenerationRequestStatus = void 0;
|
|
7722
|
+
var GenerationRequestStatus;
|
|
7723
|
+
(function(GenerationRequestStatus2) {
|
|
7724
|
+
GenerationRequestStatus2["PENDING"] = "PENDING";
|
|
7725
|
+
GenerationRequestStatus2["RUNNING"] = "RUNNING";
|
|
7726
|
+
GenerationRequestStatus2["COMPLETED"] = "COMPLETED";
|
|
7727
|
+
GenerationRequestStatus2["FAILED"] = "FAILED";
|
|
7728
|
+
})(GenerationRequestStatus || (exports2.GenerationRequestStatus = GenerationRequestStatus = {}));
|
|
7729
|
+
}
|
|
7730
|
+
});
|
|
7731
|
+
|
|
7732
|
+
// ../codegen-types/dist/ai/index.js
|
|
7733
|
+
var require_ai = __commonJS({
|
|
7734
|
+
"../codegen-types/dist/ai/index.js"(exports2) {
|
|
7735
|
+
"use strict";
|
|
7736
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7737
|
+
exports2.withCaching = void 0;
|
|
7738
|
+
var withCaching = (ttl = "5m") => {
|
|
7739
|
+
return {
|
|
7740
|
+
anthropic: {
|
|
7741
|
+
cache_control: { type: "ephemeral", ttl }
|
|
7742
|
+
}
|
|
7743
|
+
};
|
|
7744
|
+
};
|
|
7745
|
+
exports2.withCaching = withCaching;
|
|
7746
|
+
}
|
|
7747
|
+
});
|
|
7748
|
+
|
|
7749
|
+
// ../codegen-types/dist/index.js
|
|
7750
|
+
var require_dist4 = __commonJS({
|
|
7751
|
+
"../codegen-types/dist/index.js"(exports2) {
|
|
7752
|
+
"use strict";
|
|
7753
|
+
var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
7754
|
+
if (k2 === void 0) k2 = k;
|
|
7755
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7756
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7757
|
+
desc = { enumerable: true, get: function() {
|
|
7758
|
+
return m[k];
|
|
7759
|
+
} };
|
|
7760
|
+
}
|
|
7761
|
+
Object.defineProperty(o, k2, desc);
|
|
7762
|
+
}) : (function(o, m, k, k2) {
|
|
7763
|
+
if (k2 === void 0) k2 = k;
|
|
7764
|
+
o[k2] = m[k];
|
|
7765
|
+
}));
|
|
7766
|
+
var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
|
|
7767
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p);
|
|
7768
|
+
};
|
|
7769
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7770
|
+
__exportStar2(require_errors2(), exports2);
|
|
7771
|
+
__exportStar2(require_status(), exports2);
|
|
7772
|
+
__exportStar2(require_task(), exports2);
|
|
7773
|
+
__exportStar2(require_generation(), exports2);
|
|
7774
|
+
__exportStar2(require_ai(), exports2);
|
|
7852
7775
|
}
|
|
7853
7776
|
});
|
|
7854
7777
|
|
|
@@ -44320,7 +44243,7 @@ var require_CodegenAIProxyService = __commonJS({
|
|
|
44320
44243
|
};
|
|
44321
44244
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
44322
44245
|
exports2.CodegenAIProxyService = void 0;
|
|
44323
|
-
var ditto_codegen_types_12 =
|
|
44246
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
44324
44247
|
var ai_1 = require_dist11();
|
|
44325
44248
|
var customAnthropicProvider_1 = require_customAnthropicProvider();
|
|
44326
44249
|
var async_retry_1 = __importDefault2(require_lib());
|
|
@@ -44441,11 +44364,11 @@ var require_codeGenerationService = __commonJS({
|
|
|
44441
44364
|
"use strict";
|
|
44442
44365
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
44443
44366
|
exports2.codegenAIProxyService = exports2.codeGenerationService = void 0;
|
|
44444
|
-
var
|
|
44367
|
+
var CodeGenService_12 = require_CodeGenService();
|
|
44445
44368
|
var CodegenAIProxyService_1 = require_CodegenAIProxyService();
|
|
44446
44369
|
var context_12 = require_context();
|
|
44447
44370
|
var aiProxyBaseUrl = process.env.CODEGEN_AI_PROXY_BASE_URL || "http://localhost:3001";
|
|
44448
|
-
exports2.codeGenerationService = new
|
|
44371
|
+
exports2.codeGenerationService = new CodeGenService_12.CodeGenService(context_12.ctx.projectId);
|
|
44449
44372
|
exports2.codegenAIProxyService = new CodegenAIProxyService_1.CodegenAIProxyService(aiProxyBaseUrl, context_12.ctx.projectId);
|
|
44450
44373
|
}
|
|
44451
44374
|
});
|
|
@@ -45852,7 +45775,7 @@ var require_generate_text_helpers = __commonJS({
|
|
|
45852
45775
|
exports2.stopOnNoToolCalls = stopOnNoToolCalls;
|
|
45853
45776
|
exports2.generateAgentText = generateAgentText;
|
|
45854
45777
|
var ai_1 = require_dist11();
|
|
45855
|
-
var ditto_codegen_types_12 =
|
|
45778
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
45856
45779
|
function extractToolResult(toolCalls, toolName) {
|
|
45857
45780
|
const call = toolCalls.find((tc) => tc.toolName === toolName);
|
|
45858
45781
|
return call?.input ?? null;
|
|
@@ -46438,7 +46361,7 @@ var require_cms_planner_instructions = __commonJS({
|
|
|
46438
46361
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
46439
46362
|
exports2.cmsPlannerInstructions = void 0;
|
|
46440
46363
|
var types_1 = require_types_impl3();
|
|
46441
|
-
var ditto_codegen_types_12 =
|
|
46364
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
46442
46365
|
var handlingFeesExample = {
|
|
46443
46366
|
operation: ditto_codegen_types_12.ExtensionGenerationOperation.INSERT,
|
|
46444
46367
|
data: {
|
|
@@ -46588,7 +46511,7 @@ var require_embeddedScriptDynamicParameters = __commonJS({
|
|
|
46588
46511
|
"use strict";
|
|
46589
46512
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
46590
46513
|
exports2.embeddedScriptDynamicParametersPrompt = void 0;
|
|
46591
|
-
var ditto_codegen_types_12 =
|
|
46514
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
46592
46515
|
var dynamicParametersExample = {
|
|
46593
46516
|
operation: ditto_codegen_types_12.ExtensionGenerationOperation.INSERT,
|
|
46594
46517
|
data: {
|
|
@@ -47027,7 +46950,7 @@ var require_EmbeddedScriptSchema = __commonJS({
|
|
|
47027
46950
|
"use strict";
|
|
47028
46951
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
47029
46952
|
exports2.EmbeddedScriptParametersOperationSchema = void 0;
|
|
47030
|
-
var ditto_codegen_types_12 =
|
|
46953
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
47031
46954
|
var zod_1 = require_zod();
|
|
47032
46955
|
var ParameterTypeEnum = zod_1.z.enum([
|
|
47033
46956
|
"TEXT",
|
|
@@ -47408,7 +47331,7 @@ var require_PlannerAgentSchema = __commonJS({
|
|
|
47408
47331
|
exports2.createPlannerOutputSchema = exports2.ApiSpecOperationSchema = void 0;
|
|
47409
47332
|
var ApiSpecSchema_1 = require_ApiSpecSchema();
|
|
47410
47333
|
var EmbeddedScriptSchema_1 = require_EmbeddedScriptSchema();
|
|
47411
|
-
var ditto_codegen_types_12 =
|
|
47334
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
47412
47335
|
var wix_data_collections_extension_schema_1 = require_dist13();
|
|
47413
47336
|
var zod_1 = __importDefault2(require_zod());
|
|
47414
47337
|
var CollectionSchema = wix_data_collections_extension_schema_1.DataCollectionsExtensionSchema.shape.collections.element.describe("The collection data");
|
|
@@ -47459,7 +47382,7 @@ var require_forceDataPermissionsToAnyone = __commonJS({
|
|
|
47459
47382
|
"use strict";
|
|
47460
47383
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
47461
47384
|
exports2.forceDataPermissionsToAnyone = forceDataPermissionsToAnyone;
|
|
47462
|
-
var ditto_codegen_types_12 =
|
|
47385
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
47463
47386
|
function forceDataPermissionsToAnyone(plan) {
|
|
47464
47387
|
const dataPermissionsList = plan.collections.flatMap((x) => x.operation === ditto_codegen_types_12.ExtensionGenerationOperation.INSERT || x.operation === ditto_codegen_types_12.ExtensionGenerationOperation.UPDATE ? [x.data.dataPermissions] : []);
|
|
47465
47388
|
dataPermissionsList.forEach((x) => {
|
|
@@ -47525,7 +47448,7 @@ var require_PlannerAgent = __commonJS({
|
|
|
47525
47448
|
exports2.PlannerAgent = void 0;
|
|
47526
47449
|
var types_1 = require_types_impl2();
|
|
47527
47450
|
var planner_prompt_1 = require_planner_prompt();
|
|
47528
|
-
var ditto_codegen_types_12 =
|
|
47451
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
47529
47452
|
var PlannerAgentSchema_1 = require_PlannerAgentSchema();
|
|
47530
47453
|
var forceDataPermissionsToAnyone_1 = require_forceDataPermissionsToAnyone();
|
|
47531
47454
|
var constants_1 = require_constants2();
|
|
@@ -47976,7 +47899,7 @@ var require_apiSpec = __commonJS({
|
|
|
47976
47899
|
"use strict";
|
|
47977
47900
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
47978
47901
|
exports2.apiSpecPrompt = void 0;
|
|
47979
|
-
var ditto_codegen_types_12 =
|
|
47902
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
47980
47903
|
var todoExample = {
|
|
47981
47904
|
operation: ditto_codegen_types_12.ExtensionGenerationOperation.INSERT,
|
|
47982
47905
|
data: {
|
|
@@ -76506,7 +76429,7 @@ var require_prompt_selectors = __commonJS({
|
|
|
76506
76429
|
exports2.hasUnsupportedCollectionTypes = hasUnsupportedCollectionTypes;
|
|
76507
76430
|
exports2.shouldUseDynamicParametersPrompt = shouldUseDynamicParametersPrompt;
|
|
76508
76431
|
var types_1 = require_types_impl3();
|
|
76509
|
-
var ditto_codegen_types_12 =
|
|
76432
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
76510
76433
|
function shouldUseDataPrompt(params) {
|
|
76511
76434
|
const { plan, previousResources } = params;
|
|
76512
76435
|
return Boolean(plan?.collections?.length || previousResources?.collections?.length);
|
|
@@ -91436,7 +91359,7 @@ var require_SDKPickerAgent = __commonJS({
|
|
|
91436
91359
|
"use strict";
|
|
91437
91360
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
91438
91361
|
exports2.SDKPickerAgent = void 0;
|
|
91439
|
-
var ditto_codegen_types_12 =
|
|
91362
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
91440
91363
|
var codegen_common_logic_1 = require_dist12();
|
|
91441
91364
|
var WixMCPClient_1 = require_WixMCPClient();
|
|
91442
91365
|
var tools_1 = require_tools();
|
|
@@ -91671,7 +91594,7 @@ var require_file_operations = __commonJS({
|
|
|
91671
91594
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
91672
91595
|
exports2.FilesSchema = exports2.FileItemSchema = exports2.FileCreateOrUpdateSchema = void 0;
|
|
91673
91596
|
var zod_1 = require_zod();
|
|
91674
|
-
var ditto_codegen_types_12 =
|
|
91597
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
91675
91598
|
exports2.FileCreateOrUpdateSchema = zod_1.z.object({
|
|
91676
91599
|
operation: zod_1.z.union([
|
|
91677
91600
|
zod_1.z.literal(ditto_codegen_types_12.ExtensionGenerationOperation.INSERT),
|
|
@@ -91716,7 +91639,7 @@ var require_userPrompt = __commonJS({
|
|
|
91716
91639
|
exports2.formatExistingCollections = formatExistingCollections;
|
|
91717
91640
|
exports2.formatExistingEmbeddedScriptParameters = formatExistingEmbeddedScriptParameters;
|
|
91718
91641
|
var types_1 = require_types_impl2();
|
|
91719
|
-
var ditto_codegen_types_12 =
|
|
91642
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
91720
91643
|
var buildUserPromptForCodeGenerationAgent = (params, primaryAction) => {
|
|
91721
91644
|
const { extension, blueprint, scaffolds, userRequestSummary, plan, previousResources } = params;
|
|
91722
91645
|
const contextSections = [];
|
|
@@ -101787,7 +101710,7 @@ var require_IterationAgent = __commonJS({
|
|
|
101787
101710
|
var iteration_agent_prompt_1 = require_iteration_agent_prompt();
|
|
101788
101711
|
var AgentsRegistry_1 = require_AgentsRegistry();
|
|
101789
101712
|
var codegen_common_logic_1 = require_dist12();
|
|
101790
|
-
var ditto_codegen_types_12 =
|
|
101713
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
101791
101714
|
var constants_1 = require_constants2();
|
|
101792
101715
|
var contextBuilders_1 = require_contextBuilders();
|
|
101793
101716
|
var customAnthropicProvider_1 = require_customAnthropicProvider();
|
|
@@ -102198,7 +102121,7 @@ var require_AutoPatternsGenerator = __commonJS({
|
|
|
102198
102121
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
102199
102122
|
exports2.AutoPatternsGenerator = void 0;
|
|
102200
102123
|
var ditto_scaffolding_1 = require_dist17();
|
|
102201
|
-
var ditto_codegen_types_12 =
|
|
102124
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
102202
102125
|
var AutoPatternsGenerator = class {
|
|
102203
102126
|
constructor() {
|
|
102204
102127
|
this.name = "AutoPatternsGenerator";
|
|
@@ -102875,7 +102798,7 @@ var require_ExtensionIndexerAgent = __commonJS({
|
|
|
102875
102798
|
};
|
|
102876
102799
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
102877
102800
|
exports2.ExtensionIndexerAgent = void 0;
|
|
102878
|
-
var ditto_codegen_types_12 =
|
|
102801
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
102879
102802
|
var codegen_common_logic_1 = require_dist12();
|
|
102880
102803
|
var constants_1 = require_constants2();
|
|
102881
102804
|
var customAnthropicProvider_1 = require_customAnthropicProvider();
|
|
@@ -103099,7 +103022,7 @@ var require_UpdateExtensionAgent = __commonJS({
|
|
|
103099
103022
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
103100
103023
|
exports2.UpdateExtensionAgent = void 0;
|
|
103101
103024
|
var ai_1 = require_dist11();
|
|
103102
|
-
var ditto_codegen_types_12 =
|
|
103025
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
103103
103026
|
var constants_1 = require_constants2();
|
|
103104
103027
|
var customAnthropicProvider_1 = require_customAnthropicProvider();
|
|
103105
103028
|
var tools_1 = require_tools2();
|
|
@@ -103298,7 +103221,7 @@ var require_AgentsFactory = __commonJS({
|
|
|
103298
103221
|
var DashboardDecisionAgent_1 = require_DashboardDecisionAgent();
|
|
103299
103222
|
var AutoPatternsGenerator_1 = require_AutoPatternsGenerator();
|
|
103300
103223
|
var AgentsRegistry_1 = require_AgentsRegistry();
|
|
103301
|
-
var ditto_codegen_types_12 =
|
|
103224
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
103302
103225
|
var SDKPickerAgent_1 = require_SDKPickerAgent2();
|
|
103303
103226
|
var ExtensionIndexerAgent_1 = require_ExtensionIndexerAgent();
|
|
103304
103227
|
var UpdateExtensionAgent_1 = require_UpdateExtensionAgent();
|
|
@@ -105663,7 +105586,7 @@ var require_utils15 = __commonJS({
|
|
|
105663
105586
|
exports2.serializeError = serializeError;
|
|
105664
105587
|
exports2.mapGroupBy = mapGroupBy;
|
|
105665
105588
|
exports2.updateAllRunningTasks = updateAllRunningTasks;
|
|
105666
|
-
var
|
|
105589
|
+
var types_1 = require_types_impl();
|
|
105667
105590
|
var codeGenerationService_12 = require_codeGenerationService();
|
|
105668
105591
|
function serializeError(error) {
|
|
105669
105592
|
if (error instanceof Error) {
|
|
@@ -105719,8 +105642,10 @@ var require_utils15 = __commonJS({
|
|
|
105719
105642
|
}
|
|
105720
105643
|
async function updateAllRunningTasks(jobId, status, error) {
|
|
105721
105644
|
const job = await codeGenerationService_12.codeGenerationService.getJob(jobId);
|
|
105722
|
-
const tasks = job?.tasks.filter((task) => task.status ===
|
|
105645
|
+
const tasks = (job?.tasks ?? []).filter((task) => task.status === types_1.Status.RUNNING || task.status === types_1.Status.PENDING) || [];
|
|
105723
105646
|
for (const task of tasks) {
|
|
105647
|
+
if (!task.id)
|
|
105648
|
+
continue;
|
|
105724
105649
|
await codeGenerationService_12.codeGenerationService.updateTask(jobId, task.id, status, error ? { error: serializeError(error) } : {});
|
|
105725
105650
|
}
|
|
105726
105651
|
}
|
|
@@ -105889,7 +105814,7 @@ var require_codegen_flow_helpers = __commonJS({
|
|
|
105889
105814
|
exports2.getRequiredPermissions = getRequiredPermissions;
|
|
105890
105815
|
var path_1 = __importDefault2(require("path"));
|
|
105891
105816
|
var codeGenerationService_12 = require_codeGenerationService();
|
|
105892
|
-
var
|
|
105817
|
+
var types_1 = require_types_impl();
|
|
105893
105818
|
var utils_1 = require_utils15();
|
|
105894
105819
|
var http_1 = require_http_impl2();
|
|
105895
105820
|
var http_client_1 = require_index_node();
|
|
@@ -105918,8 +105843,8 @@ var require_codegen_flow_helpers = __commonJS({
|
|
|
105918
105843
|
const taskId = getAgentTaskId(jobContext.taskId, extension);
|
|
105919
105844
|
await codeGenerationService_12.codeGenerationService.addTask(jobContext.jobId, {
|
|
105920
105845
|
id: taskId,
|
|
105921
|
-
kind:
|
|
105922
|
-
status:
|
|
105846
|
+
kind: types_1.TaskKind.RUN_AGENT,
|
|
105847
|
+
status: types_1.Status.RUNNING,
|
|
105923
105848
|
name: "run_agent",
|
|
105924
105849
|
description: `Run agent for ${extension.name}`,
|
|
105925
105850
|
payload: { extension },
|
|
@@ -105934,7 +105859,7 @@ var require_codegen_flow_helpers = __commonJS({
|
|
|
105934
105859
|
}
|
|
105935
105860
|
console.log(`[Agent] done: ${extension.name}`);
|
|
105936
105861
|
const taskId = getAgentTaskId(jobContext.taskId, extension);
|
|
105937
|
-
await codeGenerationService_12.codeGenerationService.updateTask(jobContext.jobId, taskId,
|
|
105862
|
+
await codeGenerationService_12.codeGenerationService.updateTask(jobContext.jobId, taskId, types_1.Status.COMPLETED, { taskOutput: { files } });
|
|
105938
105863
|
}
|
|
105939
105864
|
async function failAgentTask(extension, error) {
|
|
105940
105865
|
const jobContext = getJobContext();
|
|
@@ -105944,7 +105869,7 @@ var require_codegen_flow_helpers = __commonJS({
|
|
|
105944
105869
|
}
|
|
105945
105870
|
console.error(`[Agent] error: ${extension.name}`, error);
|
|
105946
105871
|
const taskId = getAgentTaskId(jobContext.taskId, extension);
|
|
105947
|
-
await codeGenerationService_12.codeGenerationService.updateTask(jobContext.jobId, taskId,
|
|
105872
|
+
await codeGenerationService_12.codeGenerationService.updateTask(jobContext.jobId, taskId, types_1.Status.FAILED, { error: (0, utils_1.serializeError)(error) });
|
|
105948
105873
|
}
|
|
105949
105874
|
async function addUpdateExtensionAgentTask() {
|
|
105950
105875
|
const jobContext = getJobContext();
|
|
@@ -105956,8 +105881,8 @@ var require_codegen_flow_helpers = __commonJS({
|
|
|
105956
105881
|
const taskId = `${jobContext.taskId}-update-extension-agent`;
|
|
105957
105882
|
await codeGenerationService_12.codeGenerationService.addTask(jobContext.jobId, {
|
|
105958
105883
|
id: taskId,
|
|
105959
|
-
kind:
|
|
105960
|
-
status:
|
|
105884
|
+
kind: types_1.TaskKind.RUN_AGENT,
|
|
105885
|
+
status: types_1.Status.RUNNING,
|
|
105961
105886
|
name: "run_agent",
|
|
105962
105887
|
description: "Iterating existing code",
|
|
105963
105888
|
agentName: "UpdateExtensionAgent"
|
|
@@ -105971,7 +105896,7 @@ var require_codegen_flow_helpers = __commonJS({
|
|
|
105971
105896
|
}
|
|
105972
105897
|
console.log(`[Agent] done: iterating existing code`);
|
|
105973
105898
|
const taskId = `${jobContext.taskId}-update-extension-agent`;
|
|
105974
|
-
await codeGenerationService_12.codeGenerationService.updateTask(jobContext.jobId, taskId,
|
|
105899
|
+
await codeGenerationService_12.codeGenerationService.updateTask(jobContext.jobId, taskId, types_1.Status.COMPLETED, { taskOutput: { files } });
|
|
105975
105900
|
}
|
|
105976
105901
|
async function failUpdateExtensionAgentTask(error) {
|
|
105977
105902
|
const jobContext = getJobContext();
|
|
@@ -105981,7 +105906,7 @@ var require_codegen_flow_helpers = __commonJS({
|
|
|
105981
105906
|
}
|
|
105982
105907
|
console.error(`[Agent] error: iterating existing code`, error);
|
|
105983
105908
|
const taskId = `${jobContext.taskId}-update-extension-agent`;
|
|
105984
|
-
await codeGenerationService_12.codeGenerationService.updateTask(jobContext.jobId, taskId,
|
|
105909
|
+
await codeGenerationService_12.codeGenerationService.updateTask(jobContext.jobId, taskId, types_1.Status.FAILED, { error: (0, utils_1.serializeError)(error) });
|
|
105985
105910
|
}
|
|
105986
105911
|
async function updateJobPayload(jobContext, payload) {
|
|
105987
105912
|
await codeGenerationService_12.codeGenerationService.updateJob(jobContext.jobId, payload);
|
|
@@ -106021,7 +105946,7 @@ var require_orchestrator_error_helpers = __commonJS({
|
|
|
106021
105946
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
106022
105947
|
exports2.createExtensionErrorHandler = createExtensionErrorHandler;
|
|
106023
105948
|
exports2.throwIfFailures = throwIfFailures;
|
|
106024
|
-
var ditto_codegen_types_12 =
|
|
105949
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
106025
105950
|
var codegen_flow_helpers_1 = require_codegen_flow_helpers();
|
|
106026
105951
|
function createExtensionErrorHandler(eventEmitter, extension) {
|
|
106027
105952
|
return async (error) => {
|
|
@@ -106064,7 +105989,7 @@ var require_TypescriptValidator = __commonJS({
|
|
|
106064
105989
|
"use strict";
|
|
106065
105990
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
106066
105991
|
var child_process_1 = require("child_process");
|
|
106067
|
-
var ditto_codegen_types_12 =
|
|
105992
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
106068
105993
|
var TypescriptValidator = class {
|
|
106069
105994
|
constructor() {
|
|
106070
105995
|
this.type = ditto_codegen_types_12.ValidationType.TYPESCRIPT;
|
|
@@ -106133,7 +106058,7 @@ var require_ValidatorFactory = __commonJS({
|
|
|
106133
106058
|
};
|
|
106134
106059
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
106135
106060
|
var TypescriptValidator_1 = __importDefault2(require_TypescriptValidator());
|
|
106136
|
-
var ditto_codegen_types_12 =
|
|
106061
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
106137
106062
|
var ValidatorFactory = class {
|
|
106138
106063
|
constructor() {
|
|
106139
106064
|
}
|
|
@@ -106160,7 +106085,7 @@ var require_NaiveFixerAgent = __commonJS({
|
|
|
106160
106085
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
106161
106086
|
exports2.NaiveFixerAgent = void 0;
|
|
106162
106087
|
var zod_1 = require_zod();
|
|
106163
|
-
var ditto_codegen_types_12 =
|
|
106088
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
106164
106089
|
var dedent_1 = __importDefault2(require_dedent());
|
|
106165
106090
|
var codeGenerationService_12 = require_codeGenerationService();
|
|
106166
106091
|
var constants_1 = require_constants2();
|
|
@@ -106256,7 +106181,7 @@ var require_NaiveErrorFixer = __commonJS({
|
|
|
106256
106181
|
var fs_1 = __importDefault2(require("fs"));
|
|
106257
106182
|
var path_1 = __importDefault2(require("path"));
|
|
106258
106183
|
var NaiveFixerAgent_1 = require_NaiveFixerAgent();
|
|
106259
|
-
var ditto_codegen_types_12 =
|
|
106184
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
106260
106185
|
var NaiveErrorFixer = class {
|
|
106261
106186
|
constructor() {
|
|
106262
106187
|
}
|
|
@@ -106315,7 +106240,7 @@ var require_FixerFactory = __commonJS({
|
|
|
106315
106240
|
};
|
|
106316
106241
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
106317
106242
|
var NaiveErrorFixer_1 = __importDefault2(require_NaiveErrorFixer());
|
|
106318
|
-
var ditto_codegen_types_12 =
|
|
106243
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
106319
106244
|
var FixerFactory = class {
|
|
106320
106245
|
constructor() {
|
|
106321
106246
|
}
|
|
@@ -106344,7 +106269,8 @@ var require_fixFlow = __commonJS({
|
|
|
106344
106269
|
var utils_1 = require_utils15();
|
|
106345
106270
|
var ValidatorFactory_1 = __importDefault2(require_ValidatorFactory());
|
|
106346
106271
|
var FixerFactory_1 = __importDefault2(require_FixerFactory());
|
|
106347
|
-
var ditto_codegen_types_12 =
|
|
106272
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
106273
|
+
var types_1 = require_types_impl();
|
|
106348
106274
|
var job_context_storage_12 = require_job_context_storage();
|
|
106349
106275
|
var codeGenerationService_12 = require_codeGenerationService();
|
|
106350
106276
|
var MAX_ERRORS_PER_BATCH = 20;
|
|
@@ -106371,9 +106297,9 @@ var require_fixFlow = __commonJS({
|
|
|
106371
106297
|
};
|
|
106372
106298
|
await codeGenerationService_12.codeGenerationService.addTask(parentContext.jobId, {
|
|
106373
106299
|
id: fixTaskId,
|
|
106374
|
-
kind:
|
|
106300
|
+
kind: types_1.TaskKind.FIX_CODE,
|
|
106375
106301
|
name: "Auto-Fixer",
|
|
106376
|
-
status:
|
|
106302
|
+
status: types_1.Status.RUNNING,
|
|
106377
106303
|
description: "Running automatic code fixes",
|
|
106378
106304
|
agentName: "FixerAgent"
|
|
106379
106305
|
});
|
|
@@ -106435,7 +106361,7 @@ var require_fixFlow = __commonJS({
|
|
|
106435
106361
|
if (validationPassed) {
|
|
106436
106362
|
const fixedErrors = getFixedErrors([]);
|
|
106437
106363
|
console.log(`\u2705 ${validator.type} validation passed`);
|
|
106438
|
-
await updateFixTask(
|
|
106364
|
+
await updateFixTask(types_1.Status.COMPLETED, {
|
|
106439
106365
|
description: `Fixed ${fixedErrors.length} TypeScript errors.`,
|
|
106440
106366
|
fixedErrors: fixedErrors.map(toErrorSummary)
|
|
106441
106367
|
});
|
|
@@ -106446,7 +106372,7 @@ var require_fixFlow = __commonJS({
|
|
|
106446
106372
|
}
|
|
106447
106373
|
if (isLastAttempt) {
|
|
106448
106374
|
const { error, fixedErrors } = buildExhaustedResult(currentValidation, attempt);
|
|
106449
|
-
await updateFixTask(
|
|
106375
|
+
await updateFixTask(types_1.Status.COMPLETED, {
|
|
106450
106376
|
description: `Completed with ${error.errors.length} unresolved errors after ${attempt} attempts`,
|
|
106451
106377
|
warning: error.message,
|
|
106452
106378
|
fixedErrors: fixedErrors.map(toErrorSummary),
|
|
@@ -106467,7 +106393,7 @@ var require_fixFlow = __commonJS({
|
|
|
106467
106393
|
throw error;
|
|
106468
106394
|
}
|
|
106469
106395
|
const codegenError = (0, ditto_codegen_types_12.toCodegenError)(error);
|
|
106470
|
-
await updateFixTask(
|
|
106396
|
+
await updateFixTask(types_1.Status.FAILED, {
|
|
106471
106397
|
error: codegenError.message
|
|
106472
106398
|
});
|
|
106473
106399
|
throw codegenError;
|
|
@@ -106548,7 +106474,7 @@ var require_extensionGenerators = __commonJS({
|
|
|
106548
106474
|
var types_1 = require_types_impl2();
|
|
106549
106475
|
var ditto_scaffolding_2 = require_dist17();
|
|
106550
106476
|
var EmbeddedScriptAgent_1 = require_EmbeddedScriptAgent2();
|
|
106551
|
-
var ditto_codegen_types_12 =
|
|
106477
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
106552
106478
|
var naturalJsonStringify_1 = require_naturalJsonStringify();
|
|
106553
106479
|
var route_1 = require_route();
|
|
106554
106480
|
var ExtensionFactory = class {
|
|
@@ -106833,7 +106759,7 @@ var require_file_collector = __commonJS({
|
|
|
106833
106759
|
exports2.collectAllCreatedFiles = collectAllCreatedFiles;
|
|
106834
106760
|
var fs_1 = __importDefault2(require("fs"));
|
|
106835
106761
|
var path_1 = __importDefault2(require("path"));
|
|
106836
|
-
var ditto_codegen_types_12 =
|
|
106762
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
106837
106763
|
function captureExistingFiles(filePaths, outputPath) {
|
|
106838
106764
|
const existingFiles = /* @__PURE__ */ new Set();
|
|
106839
106765
|
filePaths.forEach((filePath) => {
|
|
@@ -106905,7 +106831,7 @@ var require_write_file = __commonJS({
|
|
|
106905
106831
|
};
|
|
106906
106832
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
106907
106833
|
exports2.writeFile = writeFile;
|
|
106908
|
-
var ditto_codegen_types_12 =
|
|
106834
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
106909
106835
|
var fs_extra_1 = __importDefault2(require_lib2());
|
|
106910
106836
|
var path_1 = __importDefault2(require("path"));
|
|
106911
106837
|
var truncate_1 = require_truncate();
|
|
@@ -107084,7 +107010,7 @@ var require_create_scaffolding = __commonJS({
|
|
|
107084
107010
|
"use strict";
|
|
107085
107011
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
107086
107012
|
exports2.createScaffolding = createScaffolding;
|
|
107087
|
-
var ditto_codegen_types_12 =
|
|
107013
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
107088
107014
|
var ditto_scaffolding_1 = require_dist17();
|
|
107089
107015
|
async function createScaffolding(extension, outputPath, eventEmitter) {
|
|
107090
107016
|
eventEmitter.emitEvent("scaffold:start", { extension });
|
|
@@ -107157,7 +107083,7 @@ var require_dashboardPage = __commonJS({
|
|
|
107157
107083
|
exports2.processDashboardPage = processDashboardPage;
|
|
107158
107084
|
var finalize_extension_generation_1 = require_finalize_extension_generation();
|
|
107159
107085
|
var extensionProcessors_1 = require_extensionProcessors();
|
|
107160
|
-
var ditto_codegen_types_12 =
|
|
107086
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
107161
107087
|
var codegen_flow_helpers_1 = require_codegen_flow_helpers();
|
|
107162
107088
|
async function processDashboardPage(params) {
|
|
107163
107089
|
const { extension, outputPath, plan, agentsFactory, eventEmitter, blueprint, userRequestSummary, previousResources } = params;
|
|
@@ -107232,7 +107158,7 @@ var require_servicePlugin = __commonJS({
|
|
|
107232
107158
|
var orchestrator_error_helpers_1 = require_orchestrator_error_helpers();
|
|
107233
107159
|
var finalize_extension_generation_1 = require_finalize_extension_generation();
|
|
107234
107160
|
var create_scaffolding_1 = require_create_scaffolding();
|
|
107235
|
-
var ditto_codegen_types_12 =
|
|
107161
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
107236
107162
|
var codegen_flow_helpers_1 = require_codegen_flow_helpers();
|
|
107237
107163
|
async function processMultipleServicePluginScaffolds(params) {
|
|
107238
107164
|
const { extension, scaffolds, outputPath, plan, agentsFactory, eventEmitter, blueprint, userRequestSummary, previousResources } = params;
|
|
@@ -107402,7 +107328,7 @@ var require_cms = __commonJS({
|
|
|
107402
107328
|
exports2.applyCollectionOperations = exports2.addAppNamespaceToPreviousResourceCollections = exports2.addAppNamespaceToCollectionId = exports2.getDataExtensionAndCollectionsFiles = exports2.DATA_EXTENSION_PATH = exports2.ASTRO_BUILDERS_IMPORT = exports2.CMS_COMP_NAME = exports2.CMS_COMP_TYPE = exports2.CMS_BUILDER = void 0;
|
|
107403
107329
|
var path_1 = __importDefault2(require("path"));
|
|
107404
107330
|
var crypto_12 = require("crypto");
|
|
107405
|
-
var ditto_codegen_types_12 =
|
|
107331
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
107406
107332
|
var naturalJsonStringify_1 = require_naturalJsonStringify();
|
|
107407
107333
|
exports2.CMS_BUILDER = "genericExtension";
|
|
107408
107334
|
exports2.CMS_COMP_TYPE = "DATA_COMPONENT";
|
|
@@ -107657,9 +107583,9 @@ var require_init_codegen = __commonJS({
|
|
|
107657
107583
|
var context_12 = require_context();
|
|
107658
107584
|
var job_context_storage_12 = require_job_context_storage();
|
|
107659
107585
|
var orchestrator_1 = require_orchestrator();
|
|
107660
|
-
var ditto_codegen_types_12 =
|
|
107586
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
107661
107587
|
var codegen_flow_helpers_1 = require_codegen_flow_helpers();
|
|
107662
|
-
var ditto_codegen_types_2 =
|
|
107588
|
+
var ditto_codegen_types_2 = require_dist4();
|
|
107663
107589
|
var runInitCodegenFlow = async (blueprint, history) => {
|
|
107664
107590
|
const localJobContext = job_context_storage_12.jobContextStorage.getStore();
|
|
107665
107591
|
console.log(`[Init] Starting init codegen task: jobId=${localJobContext?.jobId}, taskId=${localJobContext?.taskId}`);
|
|
@@ -321473,7 +321399,7 @@ var require_IterationOrchestrator = __commonJS({
|
|
|
321473
321399
|
var cms_1 = require_cms();
|
|
321474
321400
|
var write_file_1 = require_write_file();
|
|
321475
321401
|
var projectContext_1 = require_projectContext();
|
|
321476
|
-
var ditto_codegen_types_12 =
|
|
321402
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
321477
321403
|
var codegen_flow_helpers_1 = require_codegen_flow_helpers();
|
|
321478
321404
|
var IterationOrchestrator = class extends DittoEventEmitter_1.DittoEventEmitter {
|
|
321479
321405
|
constructor(agentsFactory) {
|
|
@@ -321729,10 +321655,10 @@ var require_iterate_codegen = __commonJS({
|
|
|
321729
321655
|
var cli_listeners_1 = require_cli_listeners();
|
|
321730
321656
|
var context_12 = require_context();
|
|
321731
321657
|
var job_context_storage_12 = require_job_context_storage();
|
|
321732
|
-
var ditto_codegen_types_12 =
|
|
321658
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
321733
321659
|
var IterationOrchestrator_1 = require_IterationOrchestrator();
|
|
321734
321660
|
var codegen_flow_helpers_1 = require_codegen_flow_helpers();
|
|
321735
|
-
var ditto_codegen_types_2 =
|
|
321661
|
+
var ditto_codegen_types_2 = require_dist4();
|
|
321736
321662
|
var runIterateCodegenFlow = async (chatHistory) => {
|
|
321737
321663
|
const localJobContext = job_context_storage_12.jobContextStorage.getStore();
|
|
321738
321664
|
console.log(`[Iterate] Starting iterate codegen task: jobId=${localJobContext?.jobId}, taskId=${localJobContext?.taskId}`);
|
|
@@ -321789,7 +321715,7 @@ var require_job_cancellation_monitor = __commonJS({
|
|
|
321789
321715
|
"use strict";
|
|
321790
321716
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
321791
321717
|
exports2.JobCancellationMonitor = void 0;
|
|
321792
|
-
var ditto_codegen_types_12 =
|
|
321718
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
321793
321719
|
var utils_1 = require_utils15();
|
|
321794
321720
|
var STATUS_CHECK_INTERVAL_MS = 2e3;
|
|
321795
321721
|
var JobCancellationMonitor = class {
|
|
@@ -321838,7 +321764,7 @@ var require_job_timeout_monitor = __commonJS({
|
|
|
321838
321764
|
"use strict";
|
|
321839
321765
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
321840
321766
|
exports2.JobTimeoutMonitor = exports2.JOB_TIMEOUT_MS = void 0;
|
|
321841
|
-
var ditto_codegen_types_12 =
|
|
321767
|
+
var ditto_codegen_types_12 = require_dist4();
|
|
321842
321768
|
var utils_1 = require_utils15();
|
|
321843
321769
|
exports2.JOB_TIMEOUT_MS = 1e3 * 60 * 10;
|
|
321844
321770
|
var JobTimeoutMonitor = class {
|
|
@@ -321878,7 +321804,7 @@ var require_job_timeout_monitor = __commonJS({
|
|
|
321878
321804
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
321879
321805
|
exports.processJob = processJob;
|
|
321880
321806
|
var context_1 = require_context();
|
|
321881
|
-
var
|
|
321807
|
+
var CodeGenService_1 = require_CodeGenService();
|
|
321882
321808
|
var job_context_storage_1 = require_job_context_storage();
|
|
321883
321809
|
var init_codegen_1 = require_init_codegen();
|
|
321884
321810
|
var iterate_codegen_1 = require_iterate_codegen();
|
|
@@ -321886,6 +321812,7 @@ var job_cancellation_monitor_1 = require_job_cancellation_monitor();
|
|
|
321886
321812
|
var job_timeout_monitor_1 = require_job_timeout_monitor();
|
|
321887
321813
|
var codeGenerationService_1 = require_codeGenerationService();
|
|
321888
321814
|
var crypto_1 = require("crypto");
|
|
321815
|
+
var ditto_codegen_types_1 = require_dist4();
|
|
321889
321816
|
var sessionId = process.env.CODEGEN_SESSION_ID || (0, crypto_1.randomUUID)();
|
|
321890
321817
|
process.env.CODEGEN_SESSION_ID = sessionId;
|
|
321891
321818
|
var jobCancellationMonitor = new job_cancellation_monitor_1.JobCancellationMonitor(codeGenerationService_1.codeGenerationService);
|
|
@@ -321910,11 +321837,16 @@ var alwaysOnLoop = async () => {
|
|
|
321910
321837
|
continue;
|
|
321911
321838
|
}
|
|
321912
321839
|
const job = jobs[0];
|
|
321913
|
-
console.log(
|
|
321914
|
-
|
|
321840
|
+
console.log("Job", JSON.stringify(job, null, 2));
|
|
321841
|
+
if (!job.id) {
|
|
321842
|
+
throw new ditto_codegen_types_1.MissingJobIdError();
|
|
321843
|
+
}
|
|
321844
|
+
const jobId = job.id;
|
|
321845
|
+
console.log(`[Loop] Selected job: jobId=${jobId}`);
|
|
321846
|
+
await codeGenerationService_1.codeGenerationService.markJobAsRuninng(jobId);
|
|
321915
321847
|
await processJob(job);
|
|
321916
|
-
await codeGenerationService_1.codeGenerationService.markJobAsCompleted(
|
|
321917
|
-
console.log(`[Loop] Processed job: jobId=${
|
|
321848
|
+
await codeGenerationService_1.codeGenerationService.markJobAsCompleted(jobId);
|
|
321849
|
+
console.log(`[Loop] Processed job: jobId=${jobId}. Sleeping ${POST_JOB_SLEEP_MS}ms`);
|
|
321918
321850
|
await delay(POST_JOB_SLEEP_MS);
|
|
321919
321851
|
} catch (loopError) {
|
|
321920
321852
|
console.error("Polling loop encountered an error. Will continue after backoff:", loopError instanceof Error ? loopError.message : String(loopError));
|
|
@@ -321928,22 +321860,26 @@ async function main(ctx) {
|
|
|
321928
321860
|
await alwaysOnLoop();
|
|
321929
321861
|
}
|
|
321930
321862
|
var getFirstTask = (job) => {
|
|
321931
|
-
return job.tasks[0];
|
|
321863
|
+
return job.tasks?.[0];
|
|
321932
321864
|
};
|
|
321933
321865
|
async function processJob(job) {
|
|
321866
|
+
if (!job.id) {
|
|
321867
|
+
throw new ditto_codegen_types_1.MissingJobIdError();
|
|
321868
|
+
}
|
|
321934
321869
|
const task = getFirstTask(job);
|
|
321935
|
-
|
|
321936
|
-
|
|
321870
|
+
const jobId = job.id;
|
|
321871
|
+
if (!task || !task.id) {
|
|
321872
|
+
console.warn(`[Job] No initial task found. Skipping jobId=${jobId}`);
|
|
321937
321873
|
return;
|
|
321938
321874
|
}
|
|
321939
|
-
console.log(`[Job] jobId=${
|
|
321940
|
-
context_1.ctx.setJobStatus(
|
|
321941
|
-
console.log(`[Job] Marked job RUNNING: jobId=${
|
|
321942
|
-
jobCancellationMonitor.start(
|
|
321943
|
-
jobTimeoutMonitor.start(
|
|
321875
|
+
console.log(`[Job] jobId=${jobId}, taskKind=${task.kind} - start processing`);
|
|
321876
|
+
context_1.ctx.setJobStatus(jobId, CodeGenService_1.Status.RUNNING);
|
|
321877
|
+
console.log(`[Job] Marked job RUNNING: jobId=${jobId}, initTaskId=${task.id}`);
|
|
321878
|
+
jobCancellationMonitor.start(jobId);
|
|
321879
|
+
jobTimeoutMonitor.start(jobId);
|
|
321944
321880
|
try {
|
|
321945
321881
|
console.log("Task Payload", JSON.stringify(task.payload, null, 2));
|
|
321946
|
-
await job_context_storage_1.jobContextStorage.run({ jobId
|
|
321882
|
+
await job_context_storage_1.jobContextStorage.run({ jobId, taskId: task.id, kind: task.kind }, async () => {
|
|
321947
321883
|
const payload = task?.payload || {};
|
|
321948
321884
|
if (task.kind === "ITERATE_CODEGEN") {
|
|
321949
321885
|
const chatHistory = payload.history ?? [];
|