@wix/ditto-codegen-public 1.0.90 → 1.0.91
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 +895 -105
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -116427,6 +116427,703 @@ ${hasEmbeddedScriptExtensions ? (0, embeddedScriptDynamicParameters_1.embeddedSc
|
|
|
116427
116427
|
}
|
|
116428
116428
|
});
|
|
116429
116429
|
|
|
116430
|
+
// ../codegen-types/dist/errors/ErrorTypes.js
|
|
116431
|
+
var require_ErrorTypes = __commonJS({
|
|
116432
|
+
"../codegen-types/dist/errors/ErrorTypes.js"(exports2) {
|
|
116433
|
+
"use strict";
|
|
116434
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116435
|
+
exports2.ErrorType = void 0;
|
|
116436
|
+
var ErrorType;
|
|
116437
|
+
(function(ErrorType2) {
|
|
116438
|
+
ErrorType2["CODE_VALIDATION_ERROR"] = "CODE_VALIDATION_ERROR";
|
|
116439
|
+
ErrorType2["UNSUPPORTED_EXTENSION_TYPE"] = "UNSUPPORTED_EXTENSION_TYPE";
|
|
116440
|
+
ErrorType2["AI_TOKEN_LIMIT_ERROR"] = "AI_TOKEN_LIMIT_ERROR";
|
|
116441
|
+
ErrorType2["AI_RATE_LIMIT_ERROR"] = "AI_RATE_LIMIT_ERROR";
|
|
116442
|
+
ErrorType2["AI_NETWORK_ERROR"] = "AI_NETWORK_ERROR";
|
|
116443
|
+
ErrorType2["FILE_SYSTEM_ERROR"] = "FILE_SYSTEM_ERROR";
|
|
116444
|
+
ErrorType2["MISSING_SLUG_ERROR"] = "MISSING_SLUG_ERROR";
|
|
116445
|
+
ErrorType2["PROCESS_EXECUTION_ERROR"] = "PROCESS_EXECUTION_ERROR";
|
|
116446
|
+
ErrorType2["AGENT_CONFIGURATION_ERROR"] = "AGENT_CONFIGURATION_ERROR";
|
|
116447
|
+
ErrorType2["SCAFFOLDING_ERROR"] = "SCAFFOLDING_ERROR";
|
|
116448
|
+
ErrorType2["RESOURCE_NOT_FOUND_ERROR"] = "RESOURCE_NOT_FOUND_ERROR";
|
|
116449
|
+
ErrorType2["PLANNING_ERROR"] = "PLANNING_ERROR";
|
|
116450
|
+
ErrorType2["EXTENSION_GENERATION_ERROR"] = "EXTENSION_GENERATION_ERROR";
|
|
116451
|
+
ErrorType2["VALIDATION_CONFIGURATION_ERROR"] = "VALIDATION_CONFIGURATION_ERROR";
|
|
116452
|
+
ErrorType2["UNEXPECTED_ERROR"] = "UNEXPECTED_ERROR";
|
|
116453
|
+
})(ErrorType || (exports2.ErrorType = ErrorType = {}));
|
|
116454
|
+
}
|
|
116455
|
+
});
|
|
116456
|
+
|
|
116457
|
+
// ../codegen-types/dist/errors/enums.js
|
|
116458
|
+
var require_enums2 = __commonJS({
|
|
116459
|
+
"../codegen-types/dist/errors/enums.js"(exports2) {
|
|
116460
|
+
"use strict";
|
|
116461
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116462
|
+
exports2.ResourceType = exports2.ErrorOrigin = exports2.ExtensionGenerationOperation = exports2.FileSystemOperation = exports2.ProcessType = exports2.ValidationType = void 0;
|
|
116463
|
+
var ValidationType;
|
|
116464
|
+
(function(ValidationType2) {
|
|
116465
|
+
ValidationType2["TYPESCRIPT"] = "typescript";
|
|
116466
|
+
ValidationType2["JAVASCRIPT"] = "javascript";
|
|
116467
|
+
ValidationType2["JSON"] = "json";
|
|
116468
|
+
})(ValidationType || (exports2.ValidationType = ValidationType = {}));
|
|
116469
|
+
var ProcessType;
|
|
116470
|
+
(function(ProcessType2) {
|
|
116471
|
+
ProcessType2["SPAWN"] = "spawn";
|
|
116472
|
+
ProcessType2["EXECUTION"] = "execution";
|
|
116473
|
+
ProcessType2["INITIALIZATION"] = "initialization";
|
|
116474
|
+
})(ProcessType || (exports2.ProcessType = ProcessType = {}));
|
|
116475
|
+
var FileSystemOperation;
|
|
116476
|
+
(function(FileSystemOperation2) {
|
|
116477
|
+
FileSystemOperation2["READ"] = "read";
|
|
116478
|
+
FileSystemOperation2["WRITE"] = "write";
|
|
116479
|
+
FileSystemOperation2["DELETE"] = "delete";
|
|
116480
|
+
FileSystemOperation2["MKDIR"] = "mkdir";
|
|
116481
|
+
})(FileSystemOperation || (exports2.FileSystemOperation = FileSystemOperation = {}));
|
|
116482
|
+
var ExtensionGenerationOperation;
|
|
116483
|
+
(function(ExtensionGenerationOperation2) {
|
|
116484
|
+
ExtensionGenerationOperation2["INSERT"] = "insert";
|
|
116485
|
+
ExtensionGenerationOperation2["UPDATE"] = "update";
|
|
116486
|
+
ExtensionGenerationOperation2["DELETE"] = "delete";
|
|
116487
|
+
})(ExtensionGenerationOperation || (exports2.ExtensionGenerationOperation = ExtensionGenerationOperation = {}));
|
|
116488
|
+
var ErrorOrigin;
|
|
116489
|
+
(function(ErrorOrigin2) {
|
|
116490
|
+
ErrorOrigin2["ITERATION"] = "iteration";
|
|
116491
|
+
ErrorOrigin2["INITIAL"] = "initial";
|
|
116492
|
+
})(ErrorOrigin || (exports2.ErrorOrigin = ErrorOrigin = {}));
|
|
116493
|
+
var ResourceType;
|
|
116494
|
+
(function(ResourceType2) {
|
|
116495
|
+
ResourceType2["COLLECTION"] = "collection";
|
|
116496
|
+
ResourceType2["FILE"] = "file";
|
|
116497
|
+
ResourceType2["EXTENSION"] = "extension";
|
|
116498
|
+
})(ResourceType || (exports2.ResourceType = ResourceType = {}));
|
|
116499
|
+
}
|
|
116500
|
+
});
|
|
116501
|
+
|
|
116502
|
+
// ../codegen-types/dist/errors/BaseCodegenError.js
|
|
116503
|
+
var require_BaseCodegenError = __commonJS({
|
|
116504
|
+
"../codegen-types/dist/errors/BaseCodegenError.js"(exports2) {
|
|
116505
|
+
"use strict";
|
|
116506
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116507
|
+
exports2.BaseCodegenError = void 0;
|
|
116508
|
+
var BaseCodegenError = class extends Error {
|
|
116509
|
+
constructor(message) {
|
|
116510
|
+
super(message);
|
|
116511
|
+
}
|
|
116512
|
+
/**
|
|
116513
|
+
* Convert error to JSON format for API responses
|
|
116514
|
+
*/
|
|
116515
|
+
toJSON() {
|
|
116516
|
+
const additional = this.getAdditionalProperties();
|
|
116517
|
+
return {
|
|
116518
|
+
name: this.name,
|
|
116519
|
+
message: this.message,
|
|
116520
|
+
errorType: this.errorType,
|
|
116521
|
+
retryable: this.retryable,
|
|
116522
|
+
expected: this.expected,
|
|
116523
|
+
...Object.keys(additional).length > 0 ? additional : {}
|
|
116524
|
+
};
|
|
116525
|
+
}
|
|
116526
|
+
/**
|
|
116527
|
+
* Override in subclasses to add additional properties
|
|
116528
|
+
*/
|
|
116529
|
+
getAdditionalProperties() {
|
|
116530
|
+
return {};
|
|
116531
|
+
}
|
|
116532
|
+
};
|
|
116533
|
+
exports2.BaseCodegenError = BaseCodegenError;
|
|
116534
|
+
}
|
|
116535
|
+
});
|
|
116536
|
+
|
|
116537
|
+
// ../codegen-types/dist/errors/CodeValidationError.js
|
|
116538
|
+
var require_CodeValidationError = __commonJS({
|
|
116539
|
+
"../codegen-types/dist/errors/CodeValidationError.js"(exports2) {
|
|
116540
|
+
"use strict";
|
|
116541
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116542
|
+
exports2.CodeValidationError = void 0;
|
|
116543
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
116544
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
116545
|
+
var CodeValidationError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
116546
|
+
constructor(message, options) {
|
|
116547
|
+
super(message);
|
|
116548
|
+
this.name = "CodeValidationError";
|
|
116549
|
+
this.errorType = ErrorTypes_1.ErrorType.CODE_VALIDATION_ERROR;
|
|
116550
|
+
this.expected = true;
|
|
116551
|
+
this.retryable = false;
|
|
116552
|
+
this.validationType = options.validationType;
|
|
116553
|
+
this.file = options.file;
|
|
116554
|
+
this.line = options.line;
|
|
116555
|
+
this.column = options.column;
|
|
116556
|
+
this.errorCode = options.errorCode;
|
|
116557
|
+
this.errorMessage = options.errorMessage;
|
|
116558
|
+
}
|
|
116559
|
+
getAdditionalProperties() {
|
|
116560
|
+
const props = {
|
|
116561
|
+
validationType: this.validationType
|
|
116562
|
+
};
|
|
116563
|
+
if (this.file)
|
|
116564
|
+
props.file = this.file;
|
|
116565
|
+
if (this.line !== void 0)
|
|
116566
|
+
props.line = this.line;
|
|
116567
|
+
if (this.column !== void 0)
|
|
116568
|
+
props.column = this.column;
|
|
116569
|
+
if (this.errorCode)
|
|
116570
|
+
props.errorCode = this.errorCode;
|
|
116571
|
+
if (this.errorMessage)
|
|
116572
|
+
props.errorMessage = this.errorMessage;
|
|
116573
|
+
return props;
|
|
116574
|
+
}
|
|
116575
|
+
};
|
|
116576
|
+
exports2.CodeValidationError = CodeValidationError;
|
|
116577
|
+
}
|
|
116578
|
+
});
|
|
116579
|
+
|
|
116580
|
+
// ../codegen-types/dist/errors/UnsupportedExtensionTypeError.js
|
|
116581
|
+
var require_UnsupportedExtensionTypeError = __commonJS({
|
|
116582
|
+
"../codegen-types/dist/errors/UnsupportedExtensionTypeError.js"(exports2) {
|
|
116583
|
+
"use strict";
|
|
116584
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116585
|
+
exports2.UnsupportedExtensionTypeError = void 0;
|
|
116586
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
116587
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
116588
|
+
var UnsupportedExtensionTypeError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
116589
|
+
constructor(message, options) {
|
|
116590
|
+
super(message);
|
|
116591
|
+
this.name = "UnsupportedExtensionTypeError";
|
|
116592
|
+
this.errorType = ErrorTypes_1.ErrorType.UNSUPPORTED_EXTENSION_TYPE;
|
|
116593
|
+
this.expected = true;
|
|
116594
|
+
this.retryable = false;
|
|
116595
|
+
this.extensionType = options.extensionType;
|
|
116596
|
+
this.origin = options.origin;
|
|
116597
|
+
}
|
|
116598
|
+
getAdditionalProperties() {
|
|
116599
|
+
return {
|
|
116600
|
+
extensionType: this.extensionType,
|
|
116601
|
+
origin: this.origin
|
|
116602
|
+
};
|
|
116603
|
+
}
|
|
116604
|
+
};
|
|
116605
|
+
exports2.UnsupportedExtensionTypeError = UnsupportedExtensionTypeError;
|
|
116606
|
+
}
|
|
116607
|
+
});
|
|
116608
|
+
|
|
116609
|
+
// ../codegen-types/dist/errors/AIErrors.js
|
|
116610
|
+
var require_AIErrors = __commonJS({
|
|
116611
|
+
"../codegen-types/dist/errors/AIErrors.js"(exports2) {
|
|
116612
|
+
"use strict";
|
|
116613
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116614
|
+
exports2.AINetworkError = exports2.AIRateLimitError = exports2.AITokenLimitError = void 0;
|
|
116615
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
116616
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
116617
|
+
var AITokenLimitError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
116618
|
+
constructor(message, options) {
|
|
116619
|
+
super(message);
|
|
116620
|
+
this.name = "AITokenLimitError";
|
|
116621
|
+
this.errorType = ErrorTypes_1.ErrorType.AI_TOKEN_LIMIT_ERROR;
|
|
116622
|
+
this.expected = false;
|
|
116623
|
+
this.retryable = true;
|
|
116624
|
+
this.filePath = options?.filePath;
|
|
116625
|
+
this.fileSizeKB = options?.fileSizeKB;
|
|
116626
|
+
this.errorCount = options?.errorCount;
|
|
116627
|
+
this.aiError = options?.aiError;
|
|
116628
|
+
}
|
|
116629
|
+
getAdditionalProperties() {
|
|
116630
|
+
const props = {};
|
|
116631
|
+
if (this.filePath)
|
|
116632
|
+
props.filePath = this.filePath;
|
|
116633
|
+
if (this.fileSizeKB !== void 0)
|
|
116634
|
+
props.fileSizeKB = this.fileSizeKB;
|
|
116635
|
+
if (this.errorCount !== void 0)
|
|
116636
|
+
props.errorCount = this.errorCount;
|
|
116637
|
+
if (this.aiError)
|
|
116638
|
+
props.aiError = this.aiError;
|
|
116639
|
+
return props;
|
|
116640
|
+
}
|
|
116641
|
+
};
|
|
116642
|
+
exports2.AITokenLimitError = AITokenLimitError;
|
|
116643
|
+
var AIRateLimitError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
116644
|
+
constructor(message, options) {
|
|
116645
|
+
super(message);
|
|
116646
|
+
this.name = "AIRateLimitError";
|
|
116647
|
+
this.errorType = ErrorTypes_1.ErrorType.AI_RATE_LIMIT_ERROR;
|
|
116648
|
+
this.expected = false;
|
|
116649
|
+
this.retryable = true;
|
|
116650
|
+
this.aiError = options?.aiError;
|
|
116651
|
+
}
|
|
116652
|
+
getAdditionalProperties() {
|
|
116653
|
+
const props = {};
|
|
116654
|
+
if (this.aiError)
|
|
116655
|
+
props.aiError = this.aiError;
|
|
116656
|
+
return props;
|
|
116657
|
+
}
|
|
116658
|
+
};
|
|
116659
|
+
exports2.AIRateLimitError = AIRateLimitError;
|
|
116660
|
+
var AINetworkError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
116661
|
+
constructor(message, options) {
|
|
116662
|
+
super(message);
|
|
116663
|
+
this.name = "AINetworkError";
|
|
116664
|
+
this.errorType = ErrorTypes_1.ErrorType.AI_NETWORK_ERROR;
|
|
116665
|
+
this.expected = false;
|
|
116666
|
+
this.retryable = true;
|
|
116667
|
+
this.aiError = options?.aiError;
|
|
116668
|
+
}
|
|
116669
|
+
getAdditionalProperties() {
|
|
116670
|
+
const props = {};
|
|
116671
|
+
if (this.aiError)
|
|
116672
|
+
props.aiError = this.aiError;
|
|
116673
|
+
return props;
|
|
116674
|
+
}
|
|
116675
|
+
};
|
|
116676
|
+
exports2.AINetworkError = AINetworkError;
|
|
116677
|
+
}
|
|
116678
|
+
});
|
|
116679
|
+
|
|
116680
|
+
// ../codegen-types/dist/errors/FileSystemError.js
|
|
116681
|
+
var require_FileSystemError = __commonJS({
|
|
116682
|
+
"../codegen-types/dist/errors/FileSystemError.js"(exports2) {
|
|
116683
|
+
"use strict";
|
|
116684
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116685
|
+
exports2.FileSystemError = void 0;
|
|
116686
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
116687
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
116688
|
+
var FileSystemError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
116689
|
+
constructor(message, options) {
|
|
116690
|
+
super(message);
|
|
116691
|
+
this.name = "FileSystemError";
|
|
116692
|
+
this.errorType = ErrorTypes_1.ErrorType.FILE_SYSTEM_ERROR;
|
|
116693
|
+
this.expected = false;
|
|
116694
|
+
this.retryable = true;
|
|
116695
|
+
this.filePath = options?.filePath;
|
|
116696
|
+
this.operation = options?.operation;
|
|
116697
|
+
this.cause = options?.cause;
|
|
116698
|
+
}
|
|
116699
|
+
getAdditionalProperties() {
|
|
116700
|
+
const props = {};
|
|
116701
|
+
if (this.filePath)
|
|
116702
|
+
props.filePath = this.filePath;
|
|
116703
|
+
if (this.operation)
|
|
116704
|
+
props.operation = this.operation;
|
|
116705
|
+
if (this.cause)
|
|
116706
|
+
props.cause = this.cause;
|
|
116707
|
+
return props;
|
|
116708
|
+
}
|
|
116709
|
+
};
|
|
116710
|
+
exports2.FileSystemError = FileSystemError;
|
|
116711
|
+
}
|
|
116712
|
+
});
|
|
116713
|
+
|
|
116714
|
+
// ../codegen-types/dist/errors/MissingSlugError.js
|
|
116715
|
+
var require_MissingSlugError = __commonJS({
|
|
116716
|
+
"../codegen-types/dist/errors/MissingSlugError.js"(exports2) {
|
|
116717
|
+
"use strict";
|
|
116718
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116719
|
+
exports2.MissingSlugError = void 0;
|
|
116720
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
116721
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
116722
|
+
var MissingSlugError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
116723
|
+
constructor(message, options) {
|
|
116724
|
+
super(message);
|
|
116725
|
+
this.name = "MissingSlugError";
|
|
116726
|
+
this.errorType = ErrorTypes_1.ErrorType.MISSING_SLUG_ERROR;
|
|
116727
|
+
this.expected = false;
|
|
116728
|
+
this.retryable = false;
|
|
116729
|
+
this.cause = options?.cause;
|
|
116730
|
+
}
|
|
116731
|
+
getAdditionalProperties() {
|
|
116732
|
+
const props = {};
|
|
116733
|
+
if (this.cause)
|
|
116734
|
+
props.cause = this.cause;
|
|
116735
|
+
return props;
|
|
116736
|
+
}
|
|
116737
|
+
};
|
|
116738
|
+
exports2.MissingSlugError = MissingSlugError;
|
|
116739
|
+
}
|
|
116740
|
+
});
|
|
116741
|
+
|
|
116742
|
+
// ../codegen-types/dist/errors/ProcessExecutionError.js
|
|
116743
|
+
var require_ProcessExecutionError = __commonJS({
|
|
116744
|
+
"../codegen-types/dist/errors/ProcessExecutionError.js"(exports2) {
|
|
116745
|
+
"use strict";
|
|
116746
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116747
|
+
exports2.ProcessExecutionError = void 0;
|
|
116748
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
116749
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
116750
|
+
var ProcessExecutionError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
116751
|
+
constructor(message, options) {
|
|
116752
|
+
super(message);
|
|
116753
|
+
this.name = "ProcessExecutionError";
|
|
116754
|
+
this.errorType = ErrorTypes_1.ErrorType.PROCESS_EXECUTION_ERROR;
|
|
116755
|
+
this.expected = false;
|
|
116756
|
+
this.retryable = false;
|
|
116757
|
+
this.processType = options?.processType;
|
|
116758
|
+
this.exitCode = options?.exitCode;
|
|
116759
|
+
this.stderr = options?.stderr;
|
|
116760
|
+
this.cause = options?.cause;
|
|
116761
|
+
}
|
|
116762
|
+
getAdditionalProperties() {
|
|
116763
|
+
const props = {};
|
|
116764
|
+
if (this.processType)
|
|
116765
|
+
props.processType = this.processType;
|
|
116766
|
+
if (this.exitCode !== void 0)
|
|
116767
|
+
props.exitCode = this.exitCode;
|
|
116768
|
+
if (this.stderr)
|
|
116769
|
+
props.stderr = this.stderr;
|
|
116770
|
+
if (this.cause)
|
|
116771
|
+
props.cause = this.cause;
|
|
116772
|
+
return props;
|
|
116773
|
+
}
|
|
116774
|
+
};
|
|
116775
|
+
exports2.ProcessExecutionError = ProcessExecutionError;
|
|
116776
|
+
}
|
|
116777
|
+
});
|
|
116778
|
+
|
|
116779
|
+
// ../codegen-types/dist/errors/AgentConfigurationError.js
|
|
116780
|
+
var require_AgentConfigurationError = __commonJS({
|
|
116781
|
+
"../codegen-types/dist/errors/AgentConfigurationError.js"(exports2) {
|
|
116782
|
+
"use strict";
|
|
116783
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116784
|
+
exports2.AgentConfigurationError = void 0;
|
|
116785
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
116786
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
116787
|
+
var AgentConfigurationError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
116788
|
+
constructor(message, options) {
|
|
116789
|
+
super(message);
|
|
116790
|
+
this.name = "AgentConfigurationError";
|
|
116791
|
+
this.errorType = ErrorTypes_1.ErrorType.AGENT_CONFIGURATION_ERROR;
|
|
116792
|
+
this.expected = false;
|
|
116793
|
+
this.retryable = false;
|
|
116794
|
+
this.extensionType = options?.extensionType;
|
|
116795
|
+
this.agentType = options?.agentType;
|
|
116796
|
+
}
|
|
116797
|
+
getAdditionalProperties() {
|
|
116798
|
+
const props = {};
|
|
116799
|
+
if (this.extensionType)
|
|
116800
|
+
props.extensionType = this.extensionType;
|
|
116801
|
+
if (this.agentType)
|
|
116802
|
+
props.agentType = this.agentType;
|
|
116803
|
+
return props;
|
|
116804
|
+
}
|
|
116805
|
+
};
|
|
116806
|
+
exports2.AgentConfigurationError = AgentConfigurationError;
|
|
116807
|
+
}
|
|
116808
|
+
});
|
|
116809
|
+
|
|
116810
|
+
// ../codegen-types/dist/errors/ScaffoldingError.js
|
|
116811
|
+
var require_ScaffoldingError = __commonJS({
|
|
116812
|
+
"../codegen-types/dist/errors/ScaffoldingError.js"(exports2) {
|
|
116813
|
+
"use strict";
|
|
116814
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116815
|
+
exports2.ScaffoldingError = void 0;
|
|
116816
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
116817
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
116818
|
+
var ScaffoldingError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
116819
|
+
constructor(message, options) {
|
|
116820
|
+
super(message);
|
|
116821
|
+
this.name = "ScaffoldingError";
|
|
116822
|
+
this.errorType = ErrorTypes_1.ErrorType.SCAFFOLDING_ERROR;
|
|
116823
|
+
this.expected = false;
|
|
116824
|
+
this.retryable = false;
|
|
116825
|
+
this.extensionType = options?.extensionType;
|
|
116826
|
+
this.scaffoldPath = options?.scaffoldPath;
|
|
116827
|
+
this.cause = options?.cause;
|
|
116828
|
+
}
|
|
116829
|
+
getAdditionalProperties() {
|
|
116830
|
+
const props = {};
|
|
116831
|
+
if (this.extensionType)
|
|
116832
|
+
props.extensionType = this.extensionType;
|
|
116833
|
+
if (this.scaffoldPath)
|
|
116834
|
+
props.scaffoldPath = this.scaffoldPath;
|
|
116835
|
+
if (this.cause)
|
|
116836
|
+
props.cause = this.cause;
|
|
116837
|
+
return props;
|
|
116838
|
+
}
|
|
116839
|
+
};
|
|
116840
|
+
exports2.ScaffoldingError = ScaffoldingError;
|
|
116841
|
+
}
|
|
116842
|
+
});
|
|
116843
|
+
|
|
116844
|
+
// ../codegen-types/dist/errors/ResourceNotFoundError.js
|
|
116845
|
+
var require_ResourceNotFoundError = __commonJS({
|
|
116846
|
+
"../codegen-types/dist/errors/ResourceNotFoundError.js"(exports2) {
|
|
116847
|
+
"use strict";
|
|
116848
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116849
|
+
exports2.ResourceNotFoundError = void 0;
|
|
116850
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
116851
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
116852
|
+
var ResourceNotFoundError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
116853
|
+
constructor(message, options) {
|
|
116854
|
+
super(message);
|
|
116855
|
+
this.name = "ResourceNotFoundError";
|
|
116856
|
+
this.errorType = ErrorTypes_1.ErrorType.RESOURCE_NOT_FOUND_ERROR;
|
|
116857
|
+
this.expected = false;
|
|
116858
|
+
this.retryable = false;
|
|
116859
|
+
this.resourceType = options?.resourceType;
|
|
116860
|
+
this.resourceId = options?.resourceId;
|
|
116861
|
+
}
|
|
116862
|
+
getAdditionalProperties() {
|
|
116863
|
+
const props = {};
|
|
116864
|
+
if (this.resourceType)
|
|
116865
|
+
props.resourceType = this.resourceType;
|
|
116866
|
+
if (this.resourceId)
|
|
116867
|
+
props.resourceId = this.resourceId;
|
|
116868
|
+
return props;
|
|
116869
|
+
}
|
|
116870
|
+
};
|
|
116871
|
+
exports2.ResourceNotFoundError = ResourceNotFoundError;
|
|
116872
|
+
}
|
|
116873
|
+
});
|
|
116874
|
+
|
|
116875
|
+
// ../codegen-types/dist/errors/PlanningError.js
|
|
116876
|
+
var require_PlanningError = __commonJS({
|
|
116877
|
+
"../codegen-types/dist/errors/PlanningError.js"(exports2) {
|
|
116878
|
+
"use strict";
|
|
116879
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116880
|
+
exports2.PlanningError = void 0;
|
|
116881
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
116882
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
116883
|
+
var PlanningError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
116884
|
+
constructor(message, options) {
|
|
116885
|
+
super(message);
|
|
116886
|
+
this.name = "PlanningError";
|
|
116887
|
+
this.errorType = ErrorTypes_1.ErrorType.PLANNING_ERROR;
|
|
116888
|
+
this.expected = false;
|
|
116889
|
+
this.retryable = false;
|
|
116890
|
+
this.attemptCount = options?.attemptCount;
|
|
116891
|
+
this.lastError = options?.lastError;
|
|
116892
|
+
}
|
|
116893
|
+
getAdditionalProperties() {
|
|
116894
|
+
const props = {};
|
|
116895
|
+
if (this.attemptCount !== void 0)
|
|
116896
|
+
props.attemptCount = this.attemptCount;
|
|
116897
|
+
if (this.lastError)
|
|
116898
|
+
props.lastError = this.lastError;
|
|
116899
|
+
return props;
|
|
116900
|
+
}
|
|
116901
|
+
};
|
|
116902
|
+
exports2.PlanningError = PlanningError;
|
|
116903
|
+
}
|
|
116904
|
+
});
|
|
116905
|
+
|
|
116906
|
+
// ../codegen-types/dist/errors/ExtensionGenerationError.js
|
|
116907
|
+
var require_ExtensionGenerationError = __commonJS({
|
|
116908
|
+
"../codegen-types/dist/errors/ExtensionGenerationError.js"(exports2) {
|
|
116909
|
+
"use strict";
|
|
116910
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116911
|
+
exports2.ExtensionGenerationError = void 0;
|
|
116912
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
116913
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
116914
|
+
var ExtensionGenerationError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
116915
|
+
constructor(message, options) {
|
|
116916
|
+
super(message);
|
|
116917
|
+
this.name = "ExtensionGenerationError";
|
|
116918
|
+
this.errorType = ErrorTypes_1.ErrorType.EXTENSION_GENERATION_ERROR;
|
|
116919
|
+
this.expected = false;
|
|
116920
|
+
this.retryable = false;
|
|
116921
|
+
this.extensionName = options?.extensionName;
|
|
116922
|
+
this.extensionType = options?.extensionType;
|
|
116923
|
+
this.operation = options?.operation;
|
|
116924
|
+
this.filePath = options?.filePath;
|
|
116925
|
+
}
|
|
116926
|
+
getAdditionalProperties() {
|
|
116927
|
+
const props = {};
|
|
116928
|
+
if (this.extensionName)
|
|
116929
|
+
props.extensionName = this.extensionName;
|
|
116930
|
+
if (this.extensionType)
|
|
116931
|
+
props.extensionType = this.extensionType;
|
|
116932
|
+
if (this.operation)
|
|
116933
|
+
props.operation = this.operation;
|
|
116934
|
+
if (this.filePath)
|
|
116935
|
+
props.filePath = this.filePath;
|
|
116936
|
+
return props;
|
|
116937
|
+
}
|
|
116938
|
+
};
|
|
116939
|
+
exports2.ExtensionGenerationError = ExtensionGenerationError;
|
|
116940
|
+
}
|
|
116941
|
+
});
|
|
116942
|
+
|
|
116943
|
+
// ../codegen-types/dist/errors/ValidationConfigurationError.js
|
|
116944
|
+
var require_ValidationConfigurationError = __commonJS({
|
|
116945
|
+
"../codegen-types/dist/errors/ValidationConfigurationError.js"(exports2) {
|
|
116946
|
+
"use strict";
|
|
116947
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116948
|
+
exports2.ValidationConfigurationError = void 0;
|
|
116949
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
116950
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
116951
|
+
var ValidationConfigurationError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
116952
|
+
constructor(message, options) {
|
|
116953
|
+
super(message);
|
|
116954
|
+
this.name = "ValidationConfigurationError";
|
|
116955
|
+
this.errorType = ErrorTypes_1.ErrorType.VALIDATION_CONFIGURATION_ERROR;
|
|
116956
|
+
this.expected = false;
|
|
116957
|
+
this.retryable = false;
|
|
116958
|
+
this.validatorType = options?.validatorType;
|
|
116959
|
+
this.fixerType = options?.fixerType;
|
|
116960
|
+
}
|
|
116961
|
+
getAdditionalProperties() {
|
|
116962
|
+
const props = {};
|
|
116963
|
+
if (this.validatorType)
|
|
116964
|
+
props.validatorType = this.validatorType;
|
|
116965
|
+
if (this.fixerType)
|
|
116966
|
+
props.fixerType = this.fixerType;
|
|
116967
|
+
return props;
|
|
116968
|
+
}
|
|
116969
|
+
};
|
|
116970
|
+
exports2.ValidationConfigurationError = ValidationConfigurationError;
|
|
116971
|
+
}
|
|
116972
|
+
});
|
|
116973
|
+
|
|
116974
|
+
// ../codegen-types/dist/errors/UnexpectedError.js
|
|
116975
|
+
var require_UnexpectedError = __commonJS({
|
|
116976
|
+
"../codegen-types/dist/errors/UnexpectedError.js"(exports2) {
|
|
116977
|
+
"use strict";
|
|
116978
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116979
|
+
exports2.UnexpectedError = void 0;
|
|
116980
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
116981
|
+
var ErrorTypes_1 = require_ErrorTypes();
|
|
116982
|
+
var UnexpectedError = class extends BaseCodegenError_1.BaseCodegenError {
|
|
116983
|
+
constructor(message, options) {
|
|
116984
|
+
super(message);
|
|
116985
|
+
this.name = "UnexpectedError";
|
|
116986
|
+
this.errorType = ErrorTypes_1.ErrorType.UNEXPECTED_ERROR;
|
|
116987
|
+
this.expected = false;
|
|
116988
|
+
this.retryable = true;
|
|
116989
|
+
this.originalError = options?.originalError;
|
|
116990
|
+
}
|
|
116991
|
+
getAdditionalProperties() {
|
|
116992
|
+
const props = {};
|
|
116993
|
+
if (this.originalError)
|
|
116994
|
+
props.originalError = this.originalError;
|
|
116995
|
+
return props;
|
|
116996
|
+
}
|
|
116997
|
+
};
|
|
116998
|
+
exports2.UnexpectedError = UnexpectedError;
|
|
116999
|
+
}
|
|
117000
|
+
});
|
|
117001
|
+
|
|
117002
|
+
// ../codegen-types/dist/errors/helpers.js
|
|
117003
|
+
var require_helpers = __commonJS({
|
|
117004
|
+
"../codegen-types/dist/errors/helpers.js"(exports2) {
|
|
117005
|
+
"use strict";
|
|
117006
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
117007
|
+
exports2.isCodegenError = isCodegenError;
|
|
117008
|
+
exports2.toCodegenError = toCodegenError;
|
|
117009
|
+
exports2.getErrorType = getErrorType;
|
|
117010
|
+
exports2.isRetryableError = isRetryableError;
|
|
117011
|
+
exports2.isExpectedError = isExpectedError;
|
|
117012
|
+
var BaseCodegenError_1 = require_BaseCodegenError();
|
|
117013
|
+
var UnexpectedError_1 = require_UnexpectedError();
|
|
117014
|
+
function isCodegenError(error) {
|
|
117015
|
+
if (error instanceof BaseCodegenError_1.BaseCodegenError) {
|
|
117016
|
+
return true;
|
|
117017
|
+
}
|
|
117018
|
+
if (typeof error === "object" && error !== null && "name" in error && "errorType" in error && typeof error.name === "string" && typeof error.errorType === "string") {
|
|
117019
|
+
return true;
|
|
117020
|
+
}
|
|
117021
|
+
return false;
|
|
117022
|
+
}
|
|
117023
|
+
function toCodegenError(error) {
|
|
117024
|
+
if (isCodegenError(error)) {
|
|
117025
|
+
return error;
|
|
117026
|
+
}
|
|
117027
|
+
if (error instanceof Error) {
|
|
117028
|
+
return new UnexpectedError_1.UnexpectedError(error.message, {
|
|
117029
|
+
originalError: error
|
|
117030
|
+
});
|
|
117031
|
+
}
|
|
117032
|
+
return new UnexpectedError_1.UnexpectedError("An unexpected error occurred", {
|
|
117033
|
+
originalError: error
|
|
117034
|
+
});
|
|
117035
|
+
}
|
|
117036
|
+
function getErrorType(error) {
|
|
117037
|
+
if (typeof error === "object" && error !== null && "name" in error) {
|
|
117038
|
+
return typeof error.name === "string" ? error.name : null;
|
|
117039
|
+
}
|
|
117040
|
+
return null;
|
|
117041
|
+
}
|
|
117042
|
+
function isRetryableError(error) {
|
|
117043
|
+
if (isCodegenError(error)) {
|
|
117044
|
+
if (typeof error === "object" && error !== null && "retryable" in error) {
|
|
117045
|
+
return Boolean(error.retryable);
|
|
117046
|
+
}
|
|
117047
|
+
}
|
|
117048
|
+
return true;
|
|
117049
|
+
}
|
|
117050
|
+
function isExpectedError(error) {
|
|
117051
|
+
if (isCodegenError(error)) {
|
|
117052
|
+
if (typeof error === "object" && error !== null && "expected" in error) {
|
|
117053
|
+
return Boolean(error.expected);
|
|
117054
|
+
}
|
|
117055
|
+
}
|
|
117056
|
+
return false;
|
|
117057
|
+
}
|
|
117058
|
+
}
|
|
117059
|
+
});
|
|
117060
|
+
|
|
117061
|
+
// ../codegen-types/dist/errors/index.js
|
|
117062
|
+
var require_errors4 = __commonJS({
|
|
117063
|
+
"../codegen-types/dist/errors/index.js"(exports2) {
|
|
117064
|
+
"use strict";
|
|
117065
|
+
var __createBinding3 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
117066
|
+
if (k2 === void 0) k2 = k;
|
|
117067
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
117068
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
117069
|
+
desc = { enumerable: true, get: function() {
|
|
117070
|
+
return m[k];
|
|
117071
|
+
} };
|
|
117072
|
+
}
|
|
117073
|
+
Object.defineProperty(o, k2, desc);
|
|
117074
|
+
}) : (function(o, m, k, k2) {
|
|
117075
|
+
if (k2 === void 0) k2 = k;
|
|
117076
|
+
o[k2] = m[k];
|
|
117077
|
+
}));
|
|
117078
|
+
var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
|
|
117079
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding3(exports3, m, p);
|
|
117080
|
+
};
|
|
117081
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
117082
|
+
__exportStar2(require_ErrorTypes(), exports2);
|
|
117083
|
+
__exportStar2(require_enums2(), exports2);
|
|
117084
|
+
__exportStar2(require_BaseCodegenError(), exports2);
|
|
117085
|
+
__exportStar2(require_CodeValidationError(), exports2);
|
|
117086
|
+
__exportStar2(require_UnsupportedExtensionTypeError(), exports2);
|
|
117087
|
+
__exportStar2(require_AIErrors(), exports2);
|
|
117088
|
+
__exportStar2(require_FileSystemError(), exports2);
|
|
117089
|
+
__exportStar2(require_MissingSlugError(), exports2);
|
|
117090
|
+
__exportStar2(require_ProcessExecutionError(), exports2);
|
|
117091
|
+
__exportStar2(require_AgentConfigurationError(), exports2);
|
|
117092
|
+
__exportStar2(require_ScaffoldingError(), exports2);
|
|
117093
|
+
__exportStar2(require_ResourceNotFoundError(), exports2);
|
|
117094
|
+
__exportStar2(require_PlanningError(), exports2);
|
|
117095
|
+
__exportStar2(require_ExtensionGenerationError(), exports2);
|
|
117096
|
+
__exportStar2(require_ValidationConfigurationError(), exports2);
|
|
117097
|
+
__exportStar2(require_UnexpectedError(), exports2);
|
|
117098
|
+
__exportStar2(require_helpers(), exports2);
|
|
117099
|
+
}
|
|
117100
|
+
});
|
|
117101
|
+
|
|
117102
|
+
// ../codegen-types/dist/index.js
|
|
117103
|
+
var require_dist10 = __commonJS({
|
|
117104
|
+
"../codegen-types/dist/index.js"(exports2) {
|
|
117105
|
+
"use strict";
|
|
117106
|
+
var __createBinding3 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
117107
|
+
if (k2 === void 0) k2 = k;
|
|
117108
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
117109
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
117110
|
+
desc = { enumerable: true, get: function() {
|
|
117111
|
+
return m[k];
|
|
117112
|
+
} };
|
|
117113
|
+
}
|
|
117114
|
+
Object.defineProperty(o, k2, desc);
|
|
117115
|
+
}) : (function(o, m, k, k2) {
|
|
117116
|
+
if (k2 === void 0) k2 = k;
|
|
117117
|
+
o[k2] = m[k];
|
|
117118
|
+
}));
|
|
117119
|
+
var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) {
|
|
117120
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding3(exports3, m, p);
|
|
117121
|
+
};
|
|
117122
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
117123
|
+
__exportStar2(require_errors4(), exports2);
|
|
117124
|
+
}
|
|
117125
|
+
});
|
|
117126
|
+
|
|
116430
117127
|
// dist/agents/utils.js
|
|
116431
117128
|
var require_utils11 = __commonJS({
|
|
116432
117129
|
"dist/agents/utils.js"(exports2) {
|
|
@@ -116435,17 +117132,18 @@ var require_utils11 = __commonJS({
|
|
|
116435
117132
|
return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
|
|
116436
117133
|
};
|
|
116437
117134
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
116438
|
-
exports2.extractApiNames = exports2.getErrorMessage = exports2.buildUserPromptForCodeGenerationAgent = exports2.withCaching = exports2.
|
|
117135
|
+
exports2.extractApiNames = exports2.getErrorMessage = exports2.buildUserPromptForCodeGenerationAgent = exports2.withCaching = exports2.FilesSchema = exports2.FileItemSchema = void 0;
|
|
116439
117136
|
exports2.loadRelevantFilesAsString = loadRelevantFilesAsString;
|
|
116440
117137
|
var zod_1 = require_zod();
|
|
116441
117138
|
var fs_1 = __importDefault2(require("fs"));
|
|
116442
117139
|
var path_1 = __importDefault2(require("path"));
|
|
117140
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
116443
117141
|
exports2.FileItemSchema = zod_1.z.object({
|
|
116444
|
-
operation: zod_1.z.enum(
|
|
117142
|
+
operation: zod_1.z.enum(ditto_codegen_types_1.ExtensionGenerationOperation).describe("File operation: insert (new file), update (modify existing), delete (remove file)").default(ditto_codegen_types_1.ExtensionGenerationOperation.INSERT),
|
|
116445
117143
|
path: zod_1.z.string().describe("Relative file path from project root").optional(),
|
|
116446
117144
|
content: zod_1.z.string().describe("Complete file content as a string (for JSON files, stringify the object). Required for insert and update operations.").optional()
|
|
116447
117145
|
});
|
|
116448
|
-
exports2.
|
|
117146
|
+
exports2.FilesSchema = zod_1.z.object({
|
|
116449
117147
|
files: zod_1.z.array(exports2.FileItemSchema).default([]).describe("An array of files")
|
|
116450
117148
|
});
|
|
116451
117149
|
var withCaching = (ttl = "5m") => {
|
|
@@ -116691,6 +117389,7 @@ var require_PlannerAgent = __commonJS({
|
|
|
116691
117389
|
var utils_1 = require_utils11();
|
|
116692
117390
|
var ApiSpecSchema_1 = require_ApiSpecSchema();
|
|
116693
117391
|
var EmbeddedScriptSchema_1 = require_EmbeddedScriptSchema();
|
|
117392
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
116694
117393
|
var OperationEnum = zod_1.z.enum(["insert", "update", "delete"]).describe("Operation: insert (create new), update (modify existing), delete (remove existing)").default("insert");
|
|
116695
117394
|
exports2.CollectionOperationSchema = zod_1.z.object({
|
|
116696
117395
|
operation: OperationEnum,
|
|
@@ -116782,7 +117481,7 @@ ${error}` : ""}
|
|
|
116782
117481
|
continue;
|
|
116783
117482
|
}
|
|
116784
117483
|
}
|
|
116785
|
-
throw new
|
|
117484
|
+
throw new ditto_codegen_types_1.PlanningError(`Failed to generate plan after 3 attempts: ${lastError}`, { attemptCount: 3, lastError });
|
|
116786
117485
|
}
|
|
116787
117486
|
};
|
|
116788
117487
|
exports2.PlannerAgent = PlannerAgent;
|
|
@@ -119084,7 +119783,7 @@ var require_DashboardModals = __commonJS({
|
|
|
119084
119783
|
});
|
|
119085
119784
|
|
|
119086
119785
|
// ../codegen-common-logic/dist/index.js
|
|
119087
|
-
var
|
|
119786
|
+
var require_dist11 = __commonJS({
|
|
119088
119787
|
"../codegen-common-logic/dist/index.js"(exports2) {
|
|
119089
119788
|
"use strict";
|
|
119090
119789
|
var __createBinding3 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -119129,7 +119828,7 @@ var require_DashboardPageAgent2 = __commonJS({
|
|
|
119129
119828
|
var ai_1 = require_dist9();
|
|
119130
119829
|
var utils_1 = require_utils11();
|
|
119131
119830
|
var load_examples_1 = require_load_examples();
|
|
119132
|
-
var codegen_common_logic_1 =
|
|
119831
|
+
var codegen_common_logic_1 = require_dist11();
|
|
119133
119832
|
var DashboardPageAgent = class {
|
|
119134
119833
|
constructor(apiKey, useIteration = false) {
|
|
119135
119834
|
this.apiKey = apiKey;
|
|
@@ -119159,7 +119858,7 @@ ${examples}
|
|
|
119159
119858
|
const model = (0, anthropic_1.createAnthropic)({ apiKey: this.apiKey })("claude-sonnet-4-5-20250929");
|
|
119160
119859
|
const result = await (0, ai_1.generateObject)({
|
|
119161
119860
|
model,
|
|
119162
|
-
schema: utils_1.
|
|
119861
|
+
schema: utils_1.FilesSchema,
|
|
119163
119862
|
messages: [
|
|
119164
119863
|
{
|
|
119165
119864
|
role: "system",
|
|
@@ -119250,7 +119949,7 @@ var require_SiteComponentAgent2 = __commonJS({
|
|
|
119250
119949
|
var ai_1 = require_dist9();
|
|
119251
119950
|
var utils_1 = require_utils11();
|
|
119252
119951
|
var siteComponentPrompt_1 = require_siteComponentPrompt();
|
|
119253
|
-
var codegen_common_logic_1 =
|
|
119952
|
+
var codegen_common_logic_1 = require_dist11();
|
|
119254
119953
|
var SiteComponentAgent = class {
|
|
119255
119954
|
constructor(apiKey) {
|
|
119256
119955
|
this.apiKey = apiKey;
|
|
@@ -119271,7 +119970,7 @@ var require_SiteComponentAgent2 = __commonJS({
|
|
|
119271
119970
|
const model = (0, anthropic_1.createAnthropic)({ apiKey: this.apiKey })("claude-sonnet-4-5-20250929");
|
|
119272
119971
|
const result = await (0, ai_1.generateObject)({
|
|
119273
119972
|
model,
|
|
119274
|
-
schema: utils_1.
|
|
119973
|
+
schema: utils_1.FilesSchema,
|
|
119275
119974
|
messages: [
|
|
119276
119975
|
{
|
|
119277
119976
|
role: "system",
|
|
@@ -119400,7 +120099,7 @@ var require_CustomElementAgent2 = __commonJS({
|
|
|
119400
120099
|
var utils_1 = require_utils11();
|
|
119401
120100
|
var customElementPrompt_1 = require_customElementPrompt();
|
|
119402
120101
|
var load_examples_1 = __importStar3(require_load_examples());
|
|
119403
|
-
var codegen_common_logic_1 =
|
|
120102
|
+
var codegen_common_logic_1 = require_dist11();
|
|
119404
120103
|
var CustomElementAgent = class {
|
|
119405
120104
|
constructor(apiKey) {
|
|
119406
120105
|
this.apiKey = apiKey;
|
|
@@ -119424,7 +120123,7 @@ var require_CustomElementAgent2 = __commonJS({
|
|
|
119424
120123
|
const model = (0, anthropic_1.createAnthropic)({ apiKey: this.apiKey })("claude-sonnet-4-5-20250929");
|
|
119425
120124
|
const result = await (0, ai_1.generateObject)({
|
|
119426
120125
|
model,
|
|
119427
|
-
schema: utils_1.
|
|
120126
|
+
schema: utils_1.FilesSchema,
|
|
119428
120127
|
messages: [
|
|
119429
120128
|
{
|
|
119430
120129
|
role: "system",
|
|
@@ -119670,7 +120369,7 @@ var require_SPIAgent2 = __commonJS({
|
|
|
119670
120369
|
var ai_1 = require_dist9();
|
|
119671
120370
|
var utils_1 = require_utils11();
|
|
119672
120371
|
var load_examples_1 = require_load_examples();
|
|
119673
|
-
var codegen_common_logic_1 =
|
|
120372
|
+
var codegen_common_logic_1 = require_dist11();
|
|
119674
120373
|
var SPIAgent = class {
|
|
119675
120374
|
constructor(apiKey, useIteration = false) {
|
|
119676
120375
|
this.apiKey = apiKey;
|
|
@@ -119701,7 +120400,7 @@ ${examples}
|
|
|
119701
120400
|
})("claude-sonnet-4-5-20250929");
|
|
119702
120401
|
const result = await (0, ai_1.generateObject)({
|
|
119703
120402
|
model,
|
|
119704
|
-
schema: utils_1.
|
|
120403
|
+
schema: utils_1.FilesSchema,
|
|
119705
120404
|
messages: [
|
|
119706
120405
|
{
|
|
119707
120406
|
role: "system",
|
|
@@ -119831,7 +120530,7 @@ var require_BackendEventAgent2 = __commonJS({
|
|
|
119831
120530
|
var utils_1 = require_utils11();
|
|
119832
120531
|
var backendEventPrompt_1 = require_backendEventPrompt();
|
|
119833
120532
|
var load_examples_1 = __importStar3(require_load_examples());
|
|
119834
|
-
var codegen_common_logic_1 =
|
|
120533
|
+
var codegen_common_logic_1 = require_dist11();
|
|
119835
120534
|
var BackendEventAgent = class {
|
|
119836
120535
|
constructor(apiKey, useIteration = false) {
|
|
119837
120536
|
this.apiKey = apiKey;
|
|
@@ -119858,7 +120557,7 @@ ${examples}
|
|
|
119858
120557
|
const model = (0, anthropic_1.createAnthropic)({ apiKey: this.apiKey })("claude-sonnet-4-5-20250929");
|
|
119859
120558
|
const result = await (0, ai_1.generateObject)({
|
|
119860
120559
|
model,
|
|
119861
|
-
schema: utils_1.
|
|
120560
|
+
schema: utils_1.FilesSchema,
|
|
119862
120561
|
messages: [
|
|
119863
120562
|
{
|
|
119864
120563
|
role: "system",
|
|
@@ -119989,7 +120688,7 @@ var require_BackendApiAgent2 = __commonJS({
|
|
|
119989
120688
|
var backendApi_1 = require_backendApi();
|
|
119990
120689
|
var utils_1 = require_utils11();
|
|
119991
120690
|
var ai_1 = require_dist9();
|
|
119992
|
-
var codegen_common_logic_1 =
|
|
120691
|
+
var codegen_common_logic_1 = require_dist11();
|
|
119993
120692
|
var BackendApiAgent = class {
|
|
119994
120693
|
constructor(apiKey) {
|
|
119995
120694
|
this.apiKey = apiKey;
|
|
@@ -120009,7 +120708,7 @@ var require_BackendApiAgent2 = __commonJS({
|
|
|
120009
120708
|
const model = (0, anthropic_1.createAnthropic)({ apiKey: this.apiKey })("claude-sonnet-4-5-20250929");
|
|
120010
120709
|
const result = await (0, ai_1.generateObject)({
|
|
120011
120710
|
model,
|
|
120012
|
-
schema: utils_1.
|
|
120711
|
+
schema: utils_1.FilesSchema,
|
|
120013
120712
|
messages: [
|
|
120014
120713
|
{
|
|
120015
120714
|
role: "system",
|
|
@@ -120279,7 +120978,7 @@ var require_EmbeddedScriptAgent2 = __commonJS({
|
|
|
120279
120978
|
var load_examples_1 = require_load_examples();
|
|
120280
120979
|
var zod_1 = __importDefault2(require_zod());
|
|
120281
120980
|
var embededScript_1 = require_embededScript();
|
|
120282
|
-
var codegen_common_logic_1 =
|
|
120981
|
+
var codegen_common_logic_1 = require_dist11();
|
|
120283
120982
|
var EmbeddedScriptPlacement;
|
|
120284
120983
|
(function(EmbeddedScriptPlacement2) {
|
|
120285
120984
|
EmbeddedScriptPlacement2["HEAD"] = "HEAD";
|
|
@@ -120518,6 +121217,7 @@ var require_IterationAgent = __commonJS({
|
|
|
120518
121217
|
var types_1 = require_types_impl();
|
|
120519
121218
|
var iterationAgentPrompt_1 = require_iterationAgentPrompt();
|
|
120520
121219
|
var AgentsRegistry_1 = require_AgentsRegistry();
|
|
121220
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
120521
121221
|
var supportedExtensionTypes = (0, AgentsRegistry_1.getSupportedExtensionTypes)();
|
|
120522
121222
|
var CurrentExtensionSchema = zod_1.z.object({
|
|
120523
121223
|
extensionType: zod_1.z.enum(types_1.ExtensionType).describe("The extension kind to trigger"),
|
|
@@ -120549,7 +121249,10 @@ var require_IterationAgent = __commonJS({
|
|
|
120549
121249
|
if (supportedExtensionTypes.includes(extensionType)) {
|
|
120550
121250
|
return extensionType;
|
|
120551
121251
|
}
|
|
120552
|
-
throw new
|
|
121252
|
+
throw new ditto_codegen_types_1.UnsupportedExtensionTypeError(`Unsupported extension type: ${extensionType}. Supported types: ${supportedExtensionTypes.join(", ")}`, {
|
|
121253
|
+
extensionType: extensionType || "UNKNOWN",
|
|
121254
|
+
origin: ditto_codegen_types_1.ErrorOrigin.ITERATION
|
|
121255
|
+
});
|
|
120553
121256
|
}
|
|
120554
121257
|
generateExtensionObject(extensionType, name, relevantUserRequest, relatedSpis) {
|
|
120555
121258
|
return {
|
|
@@ -121127,7 +121830,7 @@ var require_scaffolding = __commonJS({
|
|
|
121127
121830
|
});
|
|
121128
121831
|
|
|
121129
121832
|
// ../scaffolding/dist/index.js
|
|
121130
|
-
var
|
|
121833
|
+
var require_dist12 = __commonJS({
|
|
121131
121834
|
"../scaffolding/dist/index.js"(exports2) {
|
|
121132
121835
|
"use strict";
|
|
121133
121836
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -121159,7 +121862,8 @@ var require_AutoPatternsGenerator = __commonJS({
|
|
|
121159
121862
|
"use strict";
|
|
121160
121863
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
121161
121864
|
exports2.AutoPatternsGenerator = void 0;
|
|
121162
|
-
var ditto_scaffolding_1 =
|
|
121865
|
+
var ditto_scaffolding_1 = require_dist12();
|
|
121866
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
121163
121867
|
var AutoPatternsGenerator = class {
|
|
121164
121868
|
constructor() {
|
|
121165
121869
|
this.name = "AutoPatternsGenerator";
|
|
@@ -121172,12 +121876,12 @@ var require_AutoPatternsGenerator = __commonJS({
|
|
|
121172
121876
|
return [
|
|
121173
121877
|
{
|
|
121174
121878
|
path: `${path2}/patterns.json`,
|
|
121175
|
-
operation:
|
|
121879
|
+
operation: ditto_codegen_types_1.ExtensionGenerationOperation.INSERT,
|
|
121176
121880
|
content: JSON.stringify(patternsConfig, null, 2)
|
|
121177
121881
|
},
|
|
121178
121882
|
{
|
|
121179
121883
|
path: `${path2}/page.tsx`,
|
|
121180
|
-
operation:
|
|
121884
|
+
operation: ditto_codegen_types_1.ExtensionGenerationOperation.INSERT,
|
|
121181
121885
|
content: pageTsx
|
|
121182
121886
|
}
|
|
121183
121887
|
];
|
|
@@ -121507,6 +122211,7 @@ var require_AgentsFactory = __commonJS({
|
|
|
121507
122211
|
var DashboardDecisionAgent_1 = require_DashboardDecisionAgent();
|
|
121508
122212
|
var AutoPatternsGenerator_1 = require_AutoPatternsGenerator();
|
|
121509
122213
|
var AgentsRegistry_1 = require_AgentsRegistry();
|
|
122214
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
121510
122215
|
var AgentsFactory = class {
|
|
121511
122216
|
constructor(apiKey, useIteration = false) {
|
|
121512
122217
|
this.apiKey = apiKey;
|
|
@@ -121515,7 +122220,7 @@ var require_AgentsFactory = __commonJS({
|
|
|
121515
122220
|
getCodeGenerationAgent(extensionType) {
|
|
121516
122221
|
const entry = AgentsRegistry_1.CODE_GENERATION_AGENTS_REGISTRY.find((e) => e.extensionType === extensionType);
|
|
121517
122222
|
if (!entry) {
|
|
121518
|
-
throw new
|
|
122223
|
+
throw new ditto_codegen_types_1.AgentConfigurationError(`No agent registered for extension type: ${extensionType}`, { extensionType });
|
|
121519
122224
|
}
|
|
121520
122225
|
return new entry.agentClass(this.apiKey, this.useIteration);
|
|
121521
122226
|
}
|
|
@@ -121538,7 +122243,7 @@ var require_AgentsFactory = __commonJS({
|
|
|
121538
122243
|
case "AUTO_PATTERNS_GENERATOR":
|
|
121539
122244
|
return new AutoPatternsGenerator_1.AutoPatternsGenerator();
|
|
121540
122245
|
default:
|
|
121541
|
-
throw new
|
|
122246
|
+
throw new ditto_codegen_types_1.AgentConfigurationError(`Unsupported extension type for AI customization: ${extension.type}`, { extensionType: extension.type });
|
|
121542
122247
|
}
|
|
121543
122248
|
}
|
|
121544
122249
|
};
|
|
@@ -128202,18 +128907,19 @@ var require_orchestrator_error_helpers = __commonJS({
|
|
|
128202
128907
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
128203
128908
|
exports2.createExtensionErrorHandler = createExtensionErrorHandler;
|
|
128204
128909
|
exports2.throwIfFailures = throwIfFailures;
|
|
128910
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
128205
128911
|
function createExtensionErrorHandler(eventEmitter, extension) {
|
|
128206
128912
|
return (error) => {
|
|
128207
|
-
const
|
|
128913
|
+
const codegenError = (0, ditto_codegen_types_1.toCodegenError)(error);
|
|
128208
128914
|
eventEmitter.emitEvent("agent:error", {
|
|
128209
128915
|
extension,
|
|
128210
|
-
error:
|
|
128916
|
+
error: codegenError
|
|
128211
128917
|
});
|
|
128212
128918
|
console.error(`\u274C Failed to process extension ${extension.name}:`, error);
|
|
128213
|
-
throw
|
|
128919
|
+
throw codegenError;
|
|
128214
128920
|
};
|
|
128215
128921
|
}
|
|
128216
|
-
function throwIfFailures(results
|
|
128922
|
+
function throwIfFailures(results) {
|
|
128217
128923
|
const failures = results.map((result, index) => {
|
|
128218
128924
|
if (result.status === "rejected") {
|
|
128219
128925
|
return {
|
|
@@ -128224,15 +128930,13 @@ var require_orchestrator_error_helpers = __commonJS({
|
|
|
128224
128930
|
return null;
|
|
128225
128931
|
}).filter((f) => f !== null);
|
|
128226
128932
|
if (failures.length > 0) {
|
|
128227
|
-
const errorMessages = failures.map((f) =>
|
|
128228
|
-
|
|
128229
|
-
|
|
128933
|
+
const errorMessages = failures.map((f) => {
|
|
128934
|
+
const codegenError = (0, ditto_codegen_types_1.toCodegenError)(f.error);
|
|
128935
|
+
return `Task ${f.index} failed: ${codegenError.message}`;
|
|
128936
|
+
});
|
|
128937
|
+
const message = `Failed to process ${failures.length} of ${results.length} parallel tasks:
|
|
128230
128938
|
${errorMessages.join("\n")}`;
|
|
128231
|
-
|
|
128232
|
-
if (failures[0]?.error instanceof Error) {
|
|
128233
|
-
aggregatedError.stack = failures[0].error.stack;
|
|
128234
|
-
}
|
|
128235
|
-
throw aggregatedError;
|
|
128939
|
+
throw (0, ditto_codegen_types_1.toCodegenError)(new Error(message));
|
|
128236
128940
|
}
|
|
128237
128941
|
}
|
|
128238
128942
|
}
|
|
@@ -128373,6 +129077,7 @@ var require_ValidatorFactory = __commonJS({
|
|
|
128373
129077
|
};
|
|
128374
129078
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
128375
129079
|
var TypescriptValidator_1 = __importDefault2(require_TypescriptValidator());
|
|
129080
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
128376
129081
|
var ValidatorFactory = class {
|
|
128377
129082
|
constructor() {
|
|
128378
129083
|
}
|
|
@@ -128380,7 +129085,9 @@ var require_ValidatorFactory = __commonJS({
|
|
|
128380
129085
|
if (type === "typescript") {
|
|
128381
129086
|
return new TypescriptValidator_1.default();
|
|
128382
129087
|
}
|
|
128383
|
-
throw new
|
|
129088
|
+
throw new ditto_codegen_types_1.ValidationConfigurationError(`Invalid validator type: ${type}`, {
|
|
129089
|
+
validatorType: type
|
|
129090
|
+
});
|
|
128384
129091
|
}
|
|
128385
129092
|
};
|
|
128386
129093
|
exports2.default = ValidatorFactory;
|
|
@@ -128395,6 +129102,7 @@ var require_NaiveFixerAgent = __commonJS({
|
|
|
128395
129102
|
var zod_1 = require_zod();
|
|
128396
129103
|
var ai_1 = require_dist9();
|
|
128397
129104
|
var anthropic_1 = require_dist5();
|
|
129105
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
128398
129106
|
var BatchFixSchema = zod_1.z.object({
|
|
128399
129107
|
fixedContent: zod_1.z.string().describe("The complete fixed file content with all errors resolved"),
|
|
128400
129108
|
summary: zod_1.z.string().describe("Brief summary of what was fixed in the file")
|
|
@@ -128454,13 +129162,14 @@ Please provide the complete fixed file content that resolves ALL the errors list
|
|
|
128454
129162
|
if (isTokenLimitError) {
|
|
128455
129163
|
const fileSize = Math.round(input.content.length / 1024);
|
|
128456
129164
|
const errorCount = input.errors.length;
|
|
128457
|
-
throw new
|
|
128458
|
-
|
|
128459
|
-
|
|
128460
|
-
|
|
128461
|
-
|
|
129165
|
+
throw new ditto_codegen_types_1.AITokenLimitError(`AI token limit exceeded for file ${input.filePath}. The file is too large for the AI to fix in one attempt. Please fix the errors manually using your code editor.`, {
|
|
129166
|
+
filePath: input.filePath,
|
|
129167
|
+
fileSizeKB: fileSize,
|
|
129168
|
+
errorCount,
|
|
129169
|
+
aiError: error
|
|
129170
|
+
});
|
|
128462
129171
|
}
|
|
128463
|
-
throw error;
|
|
129172
|
+
throw (0, ditto_codegen_types_1.toCodegenError)(error);
|
|
128464
129173
|
}
|
|
128465
129174
|
}
|
|
128466
129175
|
};
|
|
@@ -128479,6 +129188,7 @@ var require_NaiveErrorFixer = __commonJS({
|
|
|
128479
129188
|
var fs_1 = __importDefault2(require("fs"));
|
|
128480
129189
|
var path_1 = __importDefault2(require("path"));
|
|
128481
129190
|
var NaiveFixerAgent_1 = __importDefault2(require_NaiveFixerAgent());
|
|
129191
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
128482
129192
|
var NaiveErrorFixer = class {
|
|
128483
129193
|
constructor(apiKey) {
|
|
128484
129194
|
this.apiKey = apiKey;
|
|
@@ -128516,7 +129226,7 @@ var require_NaiveErrorFixer = __commonJS({
|
|
|
128516
129226
|
}
|
|
128517
129227
|
} catch (error) {
|
|
128518
129228
|
console.error(`\u274C Batch fix failed for ${filePath}:`, error);
|
|
128519
|
-
throw error;
|
|
129229
|
+
throw (0, ditto_codegen_types_1.toCodegenError)(error);
|
|
128520
129230
|
}
|
|
128521
129231
|
}
|
|
128522
129232
|
};
|
|
@@ -128533,6 +129243,7 @@ var require_FixerFactory = __commonJS({
|
|
|
128533
129243
|
};
|
|
128534
129244
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
128535
129245
|
var NaiveErrorFixer_1 = __importDefault2(require_NaiveErrorFixer());
|
|
129246
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
128536
129247
|
var FixerFactory = class {
|
|
128537
129248
|
constructor(apiKey) {
|
|
128538
129249
|
this.apiKey = apiKey;
|
|
@@ -128541,7 +129252,9 @@ var require_FixerFactory = __commonJS({
|
|
|
128541
129252
|
if (fixerType === "naive") {
|
|
128542
129253
|
return new NaiveErrorFixer_1.default(this.apiKey);
|
|
128543
129254
|
}
|
|
128544
|
-
throw new
|
|
129255
|
+
throw new ditto_codegen_types_1.ValidationConfigurationError(`Invalid fixer type: ${fixerType}`, {
|
|
129256
|
+
fixerType
|
|
129257
|
+
});
|
|
128545
129258
|
}
|
|
128546
129259
|
};
|
|
128547
129260
|
exports2.default = FixerFactory;
|
|
@@ -128560,6 +129273,7 @@ var require_fixFlow = __commonJS({
|
|
|
128560
129273
|
var utils_1 = require_utils16();
|
|
128561
129274
|
var ValidatorFactory_1 = __importDefault2(require_ValidatorFactory());
|
|
128562
129275
|
var FixerFactory_1 = __importDefault2(require_FixerFactory());
|
|
129276
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
128563
129277
|
var MAX_ERRORS_PER_BATCH = 20;
|
|
128564
129278
|
async function startFixFlow(request, eventEmitter) {
|
|
128565
129279
|
const { projectDir, apiKey } = request;
|
|
@@ -128581,14 +129295,15 @@ var require_fixFlow = __commonJS({
|
|
|
128581
129295
|
if (!initialValidation.parsedValidationErrors || initialValidation.parsedValidationErrors.length === 0) {
|
|
128582
129296
|
const errorMessage2 = `Validation failed but no parsed errors available. Raw errors: ${initialValidation.validationErrors}`;
|
|
128583
129297
|
console.warn(`\u26A0\uFE0F ${errorMessage2}`);
|
|
129298
|
+
const error2 = new ditto_codegen_types_1.ValidationConfigurationError(errorMessage2);
|
|
128584
129299
|
eventEmitter.emitEvent("validation:error", {
|
|
128585
|
-
error:
|
|
129300
|
+
error: error2
|
|
128586
129301
|
});
|
|
128587
|
-
throw
|
|
129302
|
+
throw error2;
|
|
128588
129303
|
}
|
|
128589
129304
|
const totalErrors = initialValidation.parsedValidationErrors.length;
|
|
128590
129305
|
console.log(`\u{1F4DD} Found ${totalErrors} errors to fix`);
|
|
128591
|
-
const errorsByFile = (0, utils_1.mapGroupBy)(initialValidation.parsedValidationErrors, (
|
|
129306
|
+
const errorsByFile = (0, utils_1.mapGroupBy)(initialValidation.parsedValidationErrors, (error2) => error2.filePath);
|
|
128592
129307
|
console.log(`\u{1F4C1} Errors span ${errorsByFile.size} files`);
|
|
128593
129308
|
let totalFixesApplied = 0;
|
|
128594
129309
|
const fixer = fixerFactory.getFixer();
|
|
@@ -128620,10 +129335,13 @@ var require_fixFlow = __commonJS({
|
|
|
128620
129335
|
console.log(`\u{1F4CB} ${remainingErrors} errors remaining after fixes`);
|
|
128621
129336
|
const errorMessage = `Validation failed after batch fix attempt. Fixed ${totalFixesApplied} errors, but ${remainingErrors} remain:
|
|
128622
129337
|
${unfixedValidationErrors}`;
|
|
129338
|
+
const error = new ditto_codegen_types_1.CodeValidationError(errorMessage, {
|
|
129339
|
+
validationType: ditto_codegen_types_1.ValidationType.TYPESCRIPT
|
|
129340
|
+
});
|
|
128623
129341
|
eventEmitter.emitEvent("validation:error", {
|
|
128624
|
-
error
|
|
129342
|
+
error
|
|
128625
129343
|
});
|
|
128626
|
-
throw
|
|
129344
|
+
throw error;
|
|
128627
129345
|
}
|
|
128628
129346
|
}
|
|
128629
129347
|
});
|
|
@@ -130814,10 +131532,11 @@ var require_extensionGenerators = __commonJS({
|
|
|
130814
131532
|
var path_1 = __importDefault2(require("path"));
|
|
130815
131533
|
var fs_extra_1 = __importDefault2(require_lib());
|
|
130816
131534
|
var crypto_1 = require("crypto");
|
|
130817
|
-
var ditto_scaffolding_1 =
|
|
131535
|
+
var ditto_scaffolding_1 = require_dist12();
|
|
130818
131536
|
var types_1 = require_types_impl();
|
|
130819
|
-
var ditto_scaffolding_2 =
|
|
131537
|
+
var ditto_scaffolding_2 = require_dist12();
|
|
130820
131538
|
var EmbeddedScriptAgent_1 = require_EmbeddedScriptAgent2();
|
|
131539
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
130821
131540
|
var ExtensionFactory = class {
|
|
130822
131541
|
static generateExtension({ extension, outputPath, scaffoldPath, generatedConfig }) {
|
|
130823
131542
|
const scaffoldDir = path_1.default.dirname(scaffoldPath);
|
|
@@ -130919,7 +131638,10 @@ var require_extensionGenerators = __commonJS({
|
|
|
130919
131638
|
}
|
|
130920
131639
|
static getSlugFromBlueprint(relatedApis) {
|
|
130921
131640
|
if (!Array.isArray(relatedApis) || relatedApis.length === 0) {
|
|
130922
|
-
throw new
|
|
131641
|
+
throw new ditto_codegen_types_1.UnsupportedExtensionTypeError("Backend event extension must have at least one related API", {
|
|
131642
|
+
extensionType: types_1.ExtensionType.BACKEND_EVENT,
|
|
131643
|
+
origin: ditto_codegen_types_1.ErrorOrigin.INITIAL
|
|
131644
|
+
});
|
|
130923
131645
|
}
|
|
130924
131646
|
for (const api of relatedApis) {
|
|
130925
131647
|
const apiName = api?.name;
|
|
@@ -130929,17 +131651,23 @@ var require_extensionGenerators = __commonJS({
|
|
|
130929
131651
|
if (slug)
|
|
130930
131652
|
return slug;
|
|
130931
131653
|
}
|
|
130932
|
-
throw new
|
|
131654
|
+
throw new ditto_codegen_types_1.MissingSlugError("No valid slug found for backend event");
|
|
130933
131655
|
}
|
|
130934
131656
|
static getServicePluginType(ext) {
|
|
130935
131657
|
if (!ext.relatedSpis || ext.relatedSpis.length !== 1) {
|
|
130936
|
-
throw new
|
|
131658
|
+
throw new ditto_codegen_types_1.UnsupportedExtensionTypeError("Service plugin extension must have only one related SPI", {
|
|
131659
|
+
extensionType: ext.type || types_1.ExtensionType.SERVICE_PLUGIN,
|
|
131660
|
+
origin: ditto_codegen_types_1.ErrorOrigin.INITIAL
|
|
131661
|
+
});
|
|
130937
131662
|
}
|
|
130938
131663
|
const relatedSpi = ext.relatedSpis[0];
|
|
130939
131664
|
if (relatedSpi?.name && ditto_scaffolding_1.spiToSubPath[relatedSpi.name]) {
|
|
130940
131665
|
return ditto_scaffolding_1.spiToSubPath[relatedSpi.name];
|
|
130941
131666
|
}
|
|
130942
|
-
throw new
|
|
131667
|
+
throw new ditto_codegen_types_1.UnsupportedExtensionTypeError("No valid service plugin type found for service plugin", {
|
|
131668
|
+
extensionType: ext.type || types_1.ExtensionType.SERVICE_PLUGIN,
|
|
131669
|
+
origin: ditto_codegen_types_1.ErrorOrigin.INITIAL
|
|
131670
|
+
});
|
|
130943
131671
|
}
|
|
130944
131672
|
static createServicePluginData(name, scaffoldDir, id, servicePluginType) {
|
|
130945
131673
|
const source = getScaffoldPath(scaffoldDir, "plugin.ts");
|
|
@@ -130961,7 +131689,10 @@ var require_extensionGenerators = __commonJS({
|
|
|
130961
131689
|
case "ecom-payment-settings":
|
|
130962
131690
|
return { id, source };
|
|
130963
131691
|
default:
|
|
130964
|
-
throw new
|
|
131692
|
+
throw new ditto_codegen_types_1.UnsupportedExtensionTypeError(`Unsupported service plugin type ${servicePluginType}`, {
|
|
131693
|
+
extensionType: types_1.ExtensionType.SERVICE_PLUGIN,
|
|
131694
|
+
origin: ditto_codegen_types_1.ErrorOrigin.INITIAL
|
|
131695
|
+
});
|
|
130965
131696
|
}
|
|
130966
131697
|
}
|
|
130967
131698
|
static createDashboardPageData(id, name, scaffoldDir) {
|
|
@@ -131040,7 +131771,9 @@ var require_extensionGenerators = __commonJS({
|
|
|
131040
131771
|
function writeExtensionFile({ outputPath, name, builderMethodName, extensionConfig, extensionType, scaffoldDir }) {
|
|
131041
131772
|
const sanitizedName = name.replace(/[^a-zA-Z0-9\s-_]/g, "").trim();
|
|
131042
131773
|
if (!sanitizedName) {
|
|
131043
|
-
throw new
|
|
131774
|
+
throw new ditto_codegen_types_1.ExtensionGenerationError(`Invalid extension name: "${name}"`, {
|
|
131775
|
+
extensionName: name
|
|
131776
|
+
});
|
|
131044
131777
|
}
|
|
131045
131778
|
const absoluteScaffoldPath = path_1.default.isAbsolute(scaffoldDir) ? scaffoldDir : path_1.default.resolve(outputPath, scaffoldDir);
|
|
131046
131779
|
const filePath = path_1.default.join(absoluteScaffoldPath, "extensions.ts");
|
|
@@ -131048,7 +131781,7 @@ var require_extensionGenerators = __commonJS({
|
|
|
131048
131781
|
const normalizedFilePath = path_1.default.resolve(filePath);
|
|
131049
131782
|
const normalizedOutputPath = path_1.default.resolve(outputPath);
|
|
131050
131783
|
if (!normalizedFilePath.startsWith(normalizedOutputPath)) {
|
|
131051
|
-
throw new
|
|
131784
|
+
throw new ditto_codegen_types_1.ExtensionGenerationError(`Attempted to write extension file outside output path: ${filePath}`, { filePath });
|
|
131052
131785
|
}
|
|
131053
131786
|
const tsContent = generateExtensionTsContent(builderMethodName, extensionConfig, extensionType, name);
|
|
131054
131787
|
fs_extra_1.default.outputFileSync(filePath, tsContent);
|
|
@@ -131097,6 +131830,7 @@ var require_file_collector = __commonJS({
|
|
|
131097
131830
|
exports2.collectAllCreatedFiles = collectAllCreatedFiles;
|
|
131098
131831
|
var fs_1 = __importDefault2(require("fs"));
|
|
131099
131832
|
var path_1 = __importDefault2(require("path"));
|
|
131833
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
131100
131834
|
function captureExistingFiles(filePaths, outputPath) {
|
|
131101
131835
|
const existingFiles = /* @__PURE__ */ new Set();
|
|
131102
131836
|
filePaths.forEach((filePath) => {
|
|
@@ -131109,7 +131843,7 @@ var require_file_collector = __commonJS({
|
|
|
131109
131843
|
}
|
|
131110
131844
|
function determineFileOperation(filePath, outputPath, existingFiles) {
|
|
131111
131845
|
const fullPath = path_1.default.join(outputPath, filePath);
|
|
131112
|
-
return existingFiles.has(fullPath) ?
|
|
131846
|
+
return existingFiles.has(fullPath) ? ditto_codegen_types_1.ExtensionGenerationOperation.UPDATE : ditto_codegen_types_1.ExtensionGenerationOperation.INSERT;
|
|
131113
131847
|
}
|
|
131114
131848
|
function collectAllCreatedFiles(options) {
|
|
131115
131849
|
const { scaffolds = [], agentFiles, extensionFilePath, outputPath, existingFiles } = options;
|
|
@@ -131117,7 +131851,7 @@ var require_file_collector = __commonJS({
|
|
|
131117
131851
|
scaffolds.forEach((s) => {
|
|
131118
131852
|
allCreatedFiles.push({
|
|
131119
131853
|
path: s.path,
|
|
131120
|
-
operation:
|
|
131854
|
+
operation: ditto_codegen_types_1.ExtensionGenerationOperation.INSERT,
|
|
131121
131855
|
// Scaffolds are always new files
|
|
131122
131856
|
content: s.content
|
|
131123
131857
|
});
|
|
@@ -131126,7 +131860,7 @@ var require_file_collector = __commonJS({
|
|
|
131126
131860
|
const hasScaffold = scaffolds.some((s) => s.path === file.path);
|
|
131127
131861
|
allCreatedFiles.push({
|
|
131128
131862
|
...file,
|
|
131129
|
-
operation: hasScaffold ?
|
|
131863
|
+
operation: hasScaffold ? ditto_codegen_types_1.ExtensionGenerationOperation.INSERT : determineFileOperation(file.path || "", outputPath, existingFiles)
|
|
131130
131864
|
});
|
|
131131
131865
|
});
|
|
131132
131866
|
if (extensionFilePath) {
|
|
@@ -131158,7 +131892,8 @@ var require_extensionHelpers = __commonJS({
|
|
|
131158
131892
|
var extensionGenerators_1 = require_extensionGenerators();
|
|
131159
131893
|
var file_collector_1 = require_file_collector();
|
|
131160
131894
|
var orchestrator_error_helpers_1 = require_orchestrator_error_helpers();
|
|
131161
|
-
var ditto_scaffolding_1 =
|
|
131895
|
+
var ditto_scaffolding_1 = require_dist12();
|
|
131896
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
131162
131897
|
function finalizeExtensionGeneration(options, eventEmitter) {
|
|
131163
131898
|
const { extension, agentName, agentFiles, scaffolds = [], scaffoldPath, outputPath, generatedConfig } = options;
|
|
131164
131899
|
try {
|
|
@@ -131200,20 +131935,28 @@ var require_extensionHelpers = __commonJS({
|
|
|
131200
131935
|
}
|
|
131201
131936
|
const fullPath = path_1.default.join(outputPath, file.path);
|
|
131202
131937
|
switch (file.operation) {
|
|
131203
|
-
case
|
|
131938
|
+
case ditto_codegen_types_1.ExtensionGenerationOperation.INSERT: {
|
|
131204
131939
|
if (!file.content) {
|
|
131205
131940
|
console.warn(`\u26A0\uFE0F Skipping insert operation for ${file.path}: no content provided`);
|
|
131206
131941
|
continue;
|
|
131207
131942
|
}
|
|
131208
|
-
|
|
131209
|
-
|
|
131210
|
-
fs_1.default.
|
|
131943
|
+
try {
|
|
131944
|
+
const dir = path_1.default.dirname(fullPath);
|
|
131945
|
+
if (!fs_1.default.existsSync(dir)) {
|
|
131946
|
+
fs_1.default.mkdirSync(dir, { recursive: true });
|
|
131947
|
+
}
|
|
131948
|
+
fs_1.default.writeFileSync(fullPath, file.content.trim());
|
|
131949
|
+
console.log(`\u{1F4DD} Inserted: ${file.path}`);
|
|
131950
|
+
} catch (error) {
|
|
131951
|
+
throw new ditto_codegen_types_1.FileSystemError(`Failed to write file: ${file.path}`, {
|
|
131952
|
+
filePath: fullPath,
|
|
131953
|
+
operation: ditto_codegen_types_1.FileSystemOperation.WRITE,
|
|
131954
|
+
cause: error
|
|
131955
|
+
});
|
|
131211
131956
|
}
|
|
131212
|
-
fs_1.default.writeFileSync(fullPath, file.content.trim());
|
|
131213
|
-
console.log(`\u{1F4DD} Inserted: ${file.path}`);
|
|
131214
131957
|
break;
|
|
131215
131958
|
}
|
|
131216
|
-
case
|
|
131959
|
+
case ditto_codegen_types_1.ExtensionGenerationOperation.UPDATE:
|
|
131217
131960
|
if (!file.content) {
|
|
131218
131961
|
console.warn(`\u26A0\uFE0F Skipping update operation for ${file.path}: no content provided`);
|
|
131219
131962
|
continue;
|
|
@@ -131222,33 +131965,62 @@ var require_extensionHelpers = __commonJS({
|
|
|
131222
131965
|
console.warn(`\u26A0\uFE0F Skipping update operation for ${file.path}: file does not exist`);
|
|
131223
131966
|
continue;
|
|
131224
131967
|
}
|
|
131225
|
-
|
|
131226
|
-
|
|
131968
|
+
try {
|
|
131969
|
+
fs_1.default.writeFileSync(fullPath, file.content.trim());
|
|
131970
|
+
console.log(`\u{1F4DD} Updated: ${file.path}`);
|
|
131971
|
+
} catch (error) {
|
|
131972
|
+
throw new ditto_codegen_types_1.FileSystemError(`Failed to update file: ${file.path}`, {
|
|
131973
|
+
filePath: fullPath,
|
|
131974
|
+
operation: ditto_codegen_types_1.FileSystemOperation.WRITE,
|
|
131975
|
+
cause: error
|
|
131976
|
+
});
|
|
131977
|
+
}
|
|
131227
131978
|
break;
|
|
131228
|
-
case
|
|
131979
|
+
case ditto_codegen_types_1.ExtensionGenerationOperation.DELETE:
|
|
131229
131980
|
if (fs_1.default.existsSync(fullPath)) {
|
|
131230
|
-
|
|
131231
|
-
|
|
131981
|
+
try {
|
|
131982
|
+
fs_1.default.unlinkSync(fullPath);
|
|
131983
|
+
console.log(`\u{1F5D1}\uFE0F Deleted: ${file.path}`);
|
|
131984
|
+
} catch (error) {
|
|
131985
|
+
throw new ditto_codegen_types_1.FileSystemError(`Failed to delete file: ${file.path}`, {
|
|
131986
|
+
filePath: fullPath,
|
|
131987
|
+
operation: ditto_codegen_types_1.FileSystemOperation.DELETE,
|
|
131988
|
+
cause: error
|
|
131989
|
+
});
|
|
131990
|
+
}
|
|
131232
131991
|
} else {
|
|
131233
131992
|
console.warn(`\u26A0\uFE0F Skipping delete operation for ${file.path}: file does not exist`);
|
|
131234
131993
|
}
|
|
131235
131994
|
break;
|
|
131236
|
-
default:
|
|
131237
|
-
throw new
|
|
131995
|
+
default: {
|
|
131996
|
+
throw new ditto_codegen_types_1.ExtensionGenerationError(`Unknown operation "${file.operation}" for file ${file.path}`, {
|
|
131997
|
+
operation: file.operation,
|
|
131998
|
+
filePath: file.path
|
|
131999
|
+
});
|
|
132000
|
+
}
|
|
131238
132001
|
}
|
|
131239
132002
|
}
|
|
131240
132003
|
}
|
|
131241
132004
|
async function createScaffolding(extension, outputPath, eventEmitter) {
|
|
131242
132005
|
eventEmitter.emitEvent("scaffold:start", { extension });
|
|
131243
|
-
|
|
131244
|
-
|
|
131245
|
-
|
|
132006
|
+
try {
|
|
132007
|
+
const scaffolds = await (0, ditto_scaffolding_1.copyScaffoldingTemplate)(extension, outputPath);
|
|
132008
|
+
if (!scaffolds || scaffolds.length === 0) {
|
|
132009
|
+
throw new ditto_codegen_types_1.ScaffoldingError(`Failed to scaffold ${extension.type}`, {
|
|
132010
|
+
extensionType: extension.type
|
|
132011
|
+
});
|
|
132012
|
+
}
|
|
132013
|
+
eventEmitter.emitEvent("scaffold:done", {
|
|
132014
|
+
extension,
|
|
132015
|
+
scaffoldPath: scaffolds.map((s) => s.path).join(", ")
|
|
132016
|
+
});
|
|
132017
|
+
return scaffolds;
|
|
132018
|
+
} catch (error) {
|
|
132019
|
+
if (error instanceof ditto_codegen_types_1.FileSystemError || error instanceof ditto_codegen_types_1.ScaffoldingError) {
|
|
132020
|
+
throw error;
|
|
132021
|
+
}
|
|
132022
|
+
throw (0, ditto_codegen_types_1.toCodegenError)(error);
|
|
131246
132023
|
}
|
|
131247
|
-
eventEmitter.emitEvent("scaffold:done", {
|
|
131248
|
-
extension,
|
|
131249
|
-
scaffoldPath: scaffolds.map((s) => s.path).join(", ")
|
|
131250
|
-
});
|
|
131251
|
-
return scaffolds;
|
|
131252
132024
|
}
|
|
131253
132025
|
}
|
|
131254
132026
|
});
|
|
@@ -131334,6 +132106,7 @@ var require_dashboardPage = __commonJS({
|
|
|
131334
132106
|
exports2.processDashboardPage = processDashboardPage;
|
|
131335
132107
|
var extensionHelpers_1 = require_extensionHelpers();
|
|
131336
132108
|
var extensionProcessors_1 = require_extensionProcessors();
|
|
132109
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
131337
132110
|
async function processDashboardPage(params) {
|
|
131338
132111
|
const { extension, outputPath, plan, agentsFactory, eventEmitter, blueprint, userRequestSummary } = params;
|
|
131339
132112
|
const decisionAgent = agentsFactory.getAgent({
|
|
@@ -131363,7 +132136,10 @@ var require_dashboardPage = __commonJS({
|
|
|
131363
132136
|
console.log("\u{1F3AF} Using auto-patterns for dashboard generation");
|
|
131364
132137
|
const relevantCollection = plan?.collections?.map((op) => op.data).find((c) => c.id === decision.relevantCollectionId);
|
|
131365
132138
|
if (!relevantCollection) {
|
|
131366
|
-
throw new
|
|
132139
|
+
throw new ditto_codegen_types_1.ResourceNotFoundError(`Collection with ID ${decision.relevantCollectionId} not found in created collections`, {
|
|
132140
|
+
resourceType: ditto_codegen_types_1.ResourceType.COLLECTION,
|
|
132141
|
+
resourceId: decision.relevantCollectionId
|
|
132142
|
+
});
|
|
131367
132143
|
}
|
|
131368
132144
|
const autoPatternsGenerator = agentsFactory.getAgent({
|
|
131369
132145
|
type: "AUTO_PATTERNS_GENERATOR"
|
|
@@ -131395,17 +132171,24 @@ var require_servicePlugin = __commonJS({
|
|
|
131395
132171
|
"use strict";
|
|
131396
132172
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
131397
132173
|
exports2.processServicePluginExtension = processServicePluginExtension;
|
|
132174
|
+
var types_1 = require_types_impl();
|
|
131398
132175
|
var orchestrator_error_helpers_1 = require_orchestrator_error_helpers();
|
|
131399
132176
|
var extensionHelpers_1 = require_extensionHelpers();
|
|
132177
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
131400
132178
|
async function processMultipleServicePluginScaffolds(params) {
|
|
131401
132179
|
const { extension, scaffolds, outputPath, plan, agentsFactory, eventEmitter, blueprint, userRequestSummary } = params;
|
|
131402
132180
|
if (!extension.relatedSpis || extension.relatedSpis.length === 0) {
|
|
131403
|
-
throw new
|
|
132181
|
+
throw new ditto_codegen_types_1.UnsupportedExtensionTypeError("Service plugin extension must have related SPIs", {
|
|
132182
|
+
extensionType: extension.type || types_1.ExtensionType.SERVICE_PLUGIN,
|
|
132183
|
+
origin: ditto_codegen_types_1.ErrorOrigin.INITIAL
|
|
132184
|
+
});
|
|
131404
132185
|
}
|
|
131405
132186
|
const parallelTasks = extension.relatedSpis.map(async (spi, i) => {
|
|
131406
132187
|
const scaffold = scaffolds[i];
|
|
131407
132188
|
if (!scaffold) {
|
|
131408
|
-
throw new
|
|
132189
|
+
throw new ditto_codegen_types_1.ScaffoldingError("No scaffold generated for extension", {
|
|
132190
|
+
extensionType: extension.type
|
|
132191
|
+
});
|
|
131409
132192
|
}
|
|
131410
132193
|
const spiExtension = {
|
|
131411
132194
|
...extension,
|
|
@@ -131516,6 +132299,7 @@ var require_cms = __commonJS({
|
|
|
131516
132299
|
exports2.addAppNamespaceToCollectionId = exports2.getDataExtensionAndCollectionsFiles = void 0;
|
|
131517
132300
|
var path_1 = __importDefault2(require("path"));
|
|
131518
132301
|
var crypto_1 = require("crypto");
|
|
132302
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
131519
132303
|
var getDataExtensionAndCollectionsFiles = ({ plan }) => {
|
|
131520
132304
|
if (!plan.collections?.length) {
|
|
131521
132305
|
return [];
|
|
@@ -131545,7 +132329,7 @@ export const dataExtension = genericExtension(${JSON.stringify({
|
|
|
131545
132329
|
}, null, 2)});
|
|
131546
132330
|
`;
|
|
131547
132331
|
files.push({
|
|
131548
|
-
operation:
|
|
132332
|
+
operation: ditto_codegen_types_1.ExtensionGenerationOperation.INSERT,
|
|
131549
132333
|
path: path_1.default.join("src", "data", "extensions.ts"),
|
|
131550
132334
|
content: generatedCode
|
|
131551
132335
|
});
|
|
@@ -133543,7 +134327,7 @@ var require_domain2 = __commonJS({
|
|
|
133543
134327
|
});
|
|
133544
134328
|
|
|
133545
134329
|
// ../../node_modules/@wix/headers/dist/cjs/errors.js
|
|
133546
|
-
var
|
|
134330
|
+
var require_errors5 = __commonJS({
|
|
133547
134331
|
"../../node_modules/@wix/headers/dist/cjs/errors.js"(exports2) {
|
|
133548
134332
|
"use strict";
|
|
133549
134333
|
exports2.__esModule = true;
|
|
@@ -133570,7 +134354,7 @@ var require_assert = __commonJS({
|
|
|
133570
134354
|
exports2.__esModule = true;
|
|
133571
134355
|
exports2.assertBoolean = assertBoolean;
|
|
133572
134356
|
exports2.assertString = assertString;
|
|
133573
|
-
var _errors =
|
|
134357
|
+
var _errors = require_errors5();
|
|
133574
134358
|
function assertBoolean(key, value) {
|
|
133575
134359
|
if (typeof value !== "boolean") {
|
|
133576
134360
|
throw new _errors.WixHeadersValidationError("boolean", key, value);
|
|
@@ -135062,7 +135846,7 @@ var require_http = __commonJS({
|
|
|
135062
135846
|
});
|
|
135063
135847
|
|
|
135064
135848
|
// ../../node_modules/agent-base/dist/helpers.js
|
|
135065
|
-
var
|
|
135849
|
+
var require_helpers2 = __commonJS({
|
|
135066
135850
|
"../../node_modules/agent-base/dist/helpers.js"(exports2) {
|
|
135067
135851
|
"use strict";
|
|
135068
135852
|
var __createBinding3 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -135132,7 +135916,7 @@ var require_helpers = __commonJS({
|
|
|
135132
135916
|
});
|
|
135133
135917
|
|
|
135134
135918
|
// ../../node_modules/agent-base/dist/index.js
|
|
135135
|
-
var
|
|
135919
|
+
var require_dist13 = __commonJS({
|
|
135136
135920
|
"../../node_modules/agent-base/dist/index.js"(exports2) {
|
|
135137
135921
|
"use strict";
|
|
135138
135922
|
var __createBinding3 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -135170,7 +135954,7 @@ var require_dist12 = __commonJS({
|
|
|
135170
135954
|
var net = __importStar3(require("net"));
|
|
135171
135955
|
var http = __importStar3(require("http"));
|
|
135172
135956
|
var https_1 = require("https");
|
|
135173
|
-
__exportStar2(
|
|
135957
|
+
__exportStar2(require_helpers2(), exports2);
|
|
135174
135958
|
var INTERNAL = Symbol("AgentBaseInternalState");
|
|
135175
135959
|
var Agent = class extends http.Agent {
|
|
135176
135960
|
constructor(opts) {
|
|
@@ -135288,7 +136072,7 @@ var require_dist12 = __commonJS({
|
|
|
135288
136072
|
});
|
|
135289
136073
|
|
|
135290
136074
|
// ../../node_modules/http-proxy-agent/dist/index.js
|
|
135291
|
-
var
|
|
136075
|
+
var require_dist14 = __commonJS({
|
|
135292
136076
|
"../../node_modules/http-proxy-agent/dist/index.js"(exports2) {
|
|
135293
136077
|
"use strict";
|
|
135294
136078
|
var __createBinding3 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -135327,7 +136111,7 @@ var require_dist13 = __commonJS({
|
|
|
135327
136111
|
var tls = __importStar3(require("tls"));
|
|
135328
136112
|
var debug_1 = __importDefault2(require_src9());
|
|
135329
136113
|
var events_1 = require("events");
|
|
135330
|
-
var agent_base_1 =
|
|
136114
|
+
var agent_base_1 = require_dist13();
|
|
135331
136115
|
var url_1 = require("url");
|
|
135332
136116
|
var debug = (0, debug_1.default)("http-proxy-agent");
|
|
135333
136117
|
var HttpProxyAgent = class extends agent_base_1.Agent {
|
|
@@ -135514,7 +136298,7 @@ var require_parse_proxy_response = __commonJS({
|
|
|
135514
136298
|
});
|
|
135515
136299
|
|
|
135516
136300
|
// ../../node_modules/@wix/http-client/node_modules/https-proxy-agent/dist/index.js
|
|
135517
|
-
var
|
|
136301
|
+
var require_dist15 = __commonJS({
|
|
135518
136302
|
"../../node_modules/@wix/http-client/node_modules/https-proxy-agent/dist/index.js"(exports2) {
|
|
135519
136303
|
"use strict";
|
|
135520
136304
|
var __createBinding3 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -135553,7 +136337,7 @@ var require_dist14 = __commonJS({
|
|
|
135553
136337
|
var tls = __importStar3(require("tls"));
|
|
135554
136338
|
var assert_1 = __importDefault2(require("assert"));
|
|
135555
136339
|
var debug_1 = __importDefault2(require_src9());
|
|
135556
|
-
var agent_base_1 =
|
|
136340
|
+
var agent_base_1 = require_dist13();
|
|
135557
136341
|
var url_1 = require("url");
|
|
135558
136342
|
var parse_proxy_response_1 = require_parse_proxy_response();
|
|
135559
136343
|
var debug = (0, debug_1.default)("https-proxy-agent");
|
|
@@ -136925,8 +137709,8 @@ var require_http_client_node = __commonJS({
|
|
|
136925
137709
|
exports2.HttpClient = exports2.createHttpClient = void 0;
|
|
136926
137710
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
136927
137711
|
var http_1 = tslib_1.__importDefault(require_http());
|
|
136928
|
-
var http_proxy_agent_1 =
|
|
136929
|
-
var https_proxy_agent_1 =
|
|
137712
|
+
var http_proxy_agent_1 = require_dist14();
|
|
137713
|
+
var https_proxy_agent_1 = require_dist15();
|
|
136930
137714
|
var env_util_1 = require_env_util();
|
|
136931
137715
|
var http_client_1 = require_http_client();
|
|
136932
137716
|
var MAX_NUMBER_OF_REPORTING_PROXY_METRICS_ATTEMPTS = 3;
|
|
@@ -137134,6 +137918,7 @@ var require_init_codegen = __commonJS({
|
|
|
137134
137918
|
var orchestrator_1 = require_orchestrator();
|
|
137135
137919
|
var CodeGenService_12 = require_CodeGenService();
|
|
137136
137920
|
var codegen_flow_helpers_1 = require_codegen_flow_helpers();
|
|
137921
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
137137
137922
|
var runInitCodegenFlow = async (blueprint) => {
|
|
137138
137923
|
const localJobContext = job_context_storage_12.jobContextStorage.getStore();
|
|
137139
137924
|
console.log(`[Init] Starting init codegen task: jobId=${localJobContext?.jobId}, taskId=${localJobContext?.taskId}`);
|
|
@@ -137158,16 +137943,18 @@ var require_init_codegen = __commonJS({
|
|
|
137158
137943
|
requiredPermissions: requiredPermissionsResponse?.data?.requiredPermissions ?? []
|
|
137159
137944
|
});
|
|
137160
137945
|
} catch (error) {
|
|
137946
|
+
const codegenError = (0, ditto_codegen_types_1.toCodegenError)(error);
|
|
137161
137947
|
console.error(`\u274C [Init] Failed to get required permissions: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`, error);
|
|
137162
137948
|
await (0, codegen_flow_helpers_1.updateJobPayload)(localJobContext, {
|
|
137163
137949
|
requiredPermissions: [],
|
|
137164
|
-
requiredPermissionsErrors:
|
|
137950
|
+
requiredPermissionsErrors: codegenError
|
|
137165
137951
|
});
|
|
137166
137952
|
}
|
|
137167
137953
|
await (0, codegen_flow_helpers_1.updateParentTaskStatus)(localJobContext, CodeGenService_12.Status.COMPLETED);
|
|
137168
137954
|
console.log(`[Init] Completed init codegen task: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`);
|
|
137169
137955
|
} catch (error) {
|
|
137170
|
-
|
|
137956
|
+
const codegenError = (0, ditto_codegen_types_1.toCodegenError)(error);
|
|
137957
|
+
await (0, codegen_flow_helpers_1.updateParentTaskStatus)(localJobContext, CodeGenService_12.Status.FAILED, codegenError);
|
|
137171
137958
|
console.error(`\u274C [Init] Failed init codegen task: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`, error);
|
|
137172
137959
|
}
|
|
137173
137960
|
};
|
|
@@ -137407,6 +138194,7 @@ var require_iterate_codegen = __commonJS({
|
|
|
137407
138194
|
var CodeGenService_12 = require_CodeGenService();
|
|
137408
138195
|
var IterationOrchestrator_1 = require_IterationOrchestrator();
|
|
137409
138196
|
var codegen_flow_helpers_1 = require_codegen_flow_helpers();
|
|
138197
|
+
var ditto_codegen_types_1 = require_dist10();
|
|
137410
138198
|
var runIterateCodegenFlow = async (chatHistory) => {
|
|
137411
138199
|
const localJobContext = job_context_storage_12.jobContextStorage.getStore();
|
|
137412
138200
|
console.log(`[Iterate] Starting iterate codegen task: jobId=${localJobContext?.jobId}, taskId=${localJobContext?.taskId}`);
|
|
@@ -137434,16 +138222,18 @@ var require_iterate_codegen = __commonJS({
|
|
|
137434
138222
|
requiredPermissions: requiredPermissionsResponse?.data?.requiredPermissions ?? []
|
|
137435
138223
|
});
|
|
137436
138224
|
} catch (error) {
|
|
138225
|
+
const codegenError = (0, ditto_codegen_types_1.toCodegenError)(error);
|
|
137437
138226
|
console.error(`\u274C [Iterate] Failed to get required permissions: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`, error);
|
|
137438
138227
|
await (0, codegen_flow_helpers_1.updateJobPayload)(localJobContext, {
|
|
137439
138228
|
requiredPermissions: [],
|
|
137440
|
-
requiredPermissionsErrors:
|
|
138229
|
+
requiredPermissionsErrors: codegenError
|
|
137441
138230
|
});
|
|
137442
138231
|
}
|
|
137443
138232
|
await (0, codegen_flow_helpers_1.updateParentTaskStatus)(localJobContext, CodeGenService_12.Status.COMPLETED);
|
|
137444
138233
|
console.log(`[Init] Completed iterate codegen task: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`);
|
|
137445
138234
|
} catch (error) {
|
|
137446
|
-
|
|
138235
|
+
const codegenError = (0, ditto_codegen_types_1.toCodegenError)(error);
|
|
138236
|
+
await (0, codegen_flow_helpers_1.updateParentTaskStatus)(localJobContext, CodeGenService_12.Status.FAILED, codegenError);
|
|
137447
138237
|
console.error(`\u274C [Iterate] Failed iterate codegen task: jobId=${localJobContext.jobId}, taskId=${localJobContext.taskId}`, error);
|
|
137448
138238
|
}
|
|
137449
138239
|
};
|