@autobe/agent 0.25.0 → 0.25.1
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/lib/AutoBeAgent.js +11 -1
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/AutoBeMockAgent.js +1 -0
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +13 -13
- package/lib/factory/createAutoBeContext.js +1 -0
- package/lib/factory/createAutoBeContext.js.map +1 -1
- package/lib/index.mjs +2250 -806
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js +1 -1
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js.map +1 -1
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +36 -23
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.d.ts +22 -42
- package/lib/orchestrate/interface/histories/transformInterfaceCommonPrerequisiteHistories.d.ts +3 -0
- package/lib/orchestrate/interface/histories/{transformInterfacePrerequisiteHistories.js → transformInterfaceCommonPrerequisiteHistories.js} +4 -4
- package/lib/orchestrate/interface/histories/transformInterfaceCommonPrerequisiteHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +3 -3
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.d.ts +3 -0
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.js +102 -0
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterface.js +25 -9
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +260 -29
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +56 -64
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +3 -3
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +4 -5
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +260 -29
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.d.ts +5 -0
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +713 -0
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +47 -35
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js +41 -7
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +0 -38
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +6 -10
- package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.d.ts +52 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +0 -33
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.d.ts +6 -2
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js +105 -5
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -1
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js +20 -1
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js.map +1 -1
- package/lib/orchestrate/interface/utils/OperationValidator.d.ts +3 -4
- package/lib/orchestrate/interface/utils/OperationValidator.js +1 -1
- package/lib/orchestrate/interface/utils/OperationValidator.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js +9 -10
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js +14 -22
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +6 -6
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js +8 -2
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/orchestrate/realize/internal/compileRealizeFiles.js +1 -2
- package/lib/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -1
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.d.ts +2 -1
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js +103 -40
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.js +81 -45
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +117 -87
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +2 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js +117 -54
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +52 -26
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +44 -34
- package/lib/orchestrate/realize/utils/InternalFileSystem.js +1 -1
- package/lib/orchestrate/realize/utils/InternalFileSystem.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.d.ts +8 -3
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js +44 -17
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.d.ts +4 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.js +24 -9
- package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.js.map +1 -1
- package/lib/orchestrate/realize/utils/printErrorHints.d.ts +8 -0
- package/lib/orchestrate/realize/utils/printErrorHints.js +48 -0
- package/lib/orchestrate/realize/utils/printErrorHints.js.map +1 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.d.ts +1 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.js +93 -55
- package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +10 -79
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +15 -65
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js +1 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +32 -17
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +31 -13
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.d.ts +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +5 -5
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js +1 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js +37 -21
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +9 -5
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectInvalidRequestApplication.d.ts +8 -2
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +11 -7
- package/lib/orchestrate/test/utils/getPrerequisites.d.ts +5 -0
- package/lib/orchestrate/test/utils/getPrerequisites.js +36 -0
- package/lib/orchestrate/test/utils/getPrerequisites.js.map +1 -0
- package/lib/orchestrate/test/utils/getReferenceIds.js +1 -1
- package/lib/orchestrate/test/utils/getReferenceIds.js.map +1 -1
- package/package.json +5 -5
- package/src/AutoBeAgent.ts +17 -1
- package/src/AutoBeMockAgent.ts +1 -0
- package/src/constants/AutoBeSystemPromptConstant.ts +13 -13
- package/src/factory/createAutoBeContext.ts +1 -0
- package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +2 -2
- package/src/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.ts +25 -45
- package/src/orchestrate/interface/histories/{transformInterfacePrerequisiteHistories.ts → transformInterfaceCommonPrerequisiteHistories.ts} +1 -1
- package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +4 -2
- package/src/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.ts +118 -0
- package/src/orchestrate/interface/orchestrateInterface.ts +43 -17
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +12 -33
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +5 -5
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +7 -6
- package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +274 -0
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +1 -1
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +1 -1
- package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +0 -39
- package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +6 -10
- package/src/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.ts +58 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +0 -34
- package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +92 -4
- package/src/orchestrate/interface/utils/JsonSchemaValidator.ts +19 -1
- package/src/orchestrate/interface/utils/OperationValidator.ts +9 -7
- package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.ts +9 -10
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +13 -24
- package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +6 -6
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +6 -4
- package/src/orchestrate/realize/internal/compileRealizeFiles.ts +1 -5
- package/src/orchestrate/realize/orchestRateRealizeCorrectCasting.ts +84 -17
- package/src/orchestrate/realize/orchestrateRealize.ts +125 -74
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +33 -6
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +14 -4
- package/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.ts +54 -29
- package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +46 -35
- package/src/orchestrate/realize/utils/InternalFileSystem.ts +1 -1
- package/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.ts +54 -22
- package/src/orchestrate/realize/utils/getRealizeWriteImportStatements.ts +28 -16
- package/src/orchestrate/realize/utils/printErrorHints.ts +55 -0
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +99 -102
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +18 -91
- package/src/orchestrate/test/histories/transformTestScenarioReviewHistories.ts +17 -90
- package/src/orchestrate/test/orchestrateTestCorrect.ts +7 -6
- package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +13 -1
- package/src/orchestrate/test/orchestrateTestScenario.ts +12 -6
- package/src/orchestrate/test/orchestrateTestScenarioReview.ts +3 -3
- package/src/orchestrate/test/orchestrateTestWrite.ts +7 -6
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +9 -228
- package/src/orchestrate/test/structures/IAutoBeTestCorrectInvalidRequestApplication.ts +8 -2
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +11 -78
- package/src/orchestrate/test/utils/getPrerequisites.ts +51 -0
- package/src/orchestrate/test/utils/getReferenceIds.ts +2 -1
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.d.ts +0 -3
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js.map +0 -1
- package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.d.ts +0 -6
- package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.js +0 -22
- package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.js.map +0 -1
- package/src/orchestrate/interface/utils/OpenApiEndpointComparator.ts +0 -23
|
@@ -4,124 +4,121 @@ import { ILlmSchema } from "@samchon/openapi";
|
|
|
4
4
|
import { AutoBeContext } from "../../../context/AutoBeContext";
|
|
5
5
|
import { getRealizeWriteImportStatements } from "./getRealizeWriteImportStatements";
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
function removeAllImports(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
): string {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
7
|
+
// /**
|
|
8
|
+
// * Removes all import statements that LLM might have incorrectly added. This
|
|
9
|
+
// * includes standard library imports, auto-injected imports, and any API
|
|
10
|
+
// * structure imports with wrong paths.
|
|
11
|
+
// *
|
|
12
|
+
// * @param code - The code containing imports to remove
|
|
13
|
+
// * @param typeReferences - List of type names to specifically remove
|
|
14
|
+
// * @param decoratorType - Optional decorator type to remove
|
|
15
|
+
// * @returns Code with all imports removed
|
|
16
|
+
// */
|
|
17
|
+
// function removeAllImports(
|
|
18
|
+
// code: string,
|
|
19
|
+
// typeReferences: string[],
|
|
20
|
+
// decoratorType?: string,
|
|
21
|
+
// ): string {
|
|
22
|
+
// // Remove standard library and auto-injected imports
|
|
23
|
+
// let cleanedCode = code
|
|
24
|
+
// // MyGlobal - often with wrong path
|
|
25
|
+
// .replace(
|
|
26
|
+
// /import\s*{\s*MyGlobal\s*}\s*from\s*["']\.\.\/MyGlobal["']\s*;?\s*/gm,
|
|
27
|
+
// "",
|
|
28
|
+
// )
|
|
29
|
+
// // typia - various import patterns
|
|
30
|
+
// .replace(
|
|
31
|
+
// /import\s+typia\s*,\s*{\s*tags\s*}\s*from\s*["']typia["']\s*;?\s*/gm,
|
|
32
|
+
// "",
|
|
33
|
+
// )
|
|
34
|
+
// .replace(/import\s*{\s*tags\s*}\s*from\s*["']typia["']\s*;?\s*/gm, "")
|
|
35
|
+
// .replace(
|
|
36
|
+
// /import\s*{\s*tags\s*,\s*typia\s*}\s*from\s*["']typia["']\s*;?\s*/gm,
|
|
37
|
+
// "",
|
|
38
|
+
// )
|
|
39
|
+
// .replace(/import\s+typia\s*from\s*["']typia["']\s*;?\s*/gm, "")
|
|
40
|
+
// // Prisma client
|
|
41
|
+
// .replace(
|
|
42
|
+
// /import\s*{\s*Prisma\s*}\s*from\s*["']@prisma\/client["']\s*;?\s*/gm,
|
|
43
|
+
// "",
|
|
44
|
+
// )
|
|
45
|
+
// // uuid
|
|
46
|
+
// .replace(/import\s*{\s*v4\s*}\s*from\s*["']uuid["']\s*;?\s*/gm, "")
|
|
47
|
+
// // toISOStringSafe utility
|
|
48
|
+
// .replace(
|
|
49
|
+
// /import\s*{\s*toISOStringSafe\s*}\s*from\s*["']\.\.\/utils\/toISOStringSafe["']\s*;?\s*/gm,
|
|
50
|
+
// "",
|
|
51
|
+
// )
|
|
52
|
+
// // JWT imports (if LLM adds them)
|
|
53
|
+
// .replace(/import\s+jwt\s+from\s*["']jsonwebtoken["']\s*;?\s*/gm, "")
|
|
54
|
+
// .replace(
|
|
55
|
+
// /import\s*\*\s*as\s+jwt\s+from\s*["']jsonwebtoken["']\s*;?\s*/gm,
|
|
56
|
+
// "",
|
|
57
|
+
// )
|
|
58
|
+
// // NestJS HttpException
|
|
59
|
+
// .replace(
|
|
60
|
+
// /import\s*{\s*HttpException\s*}\s*from\s*["']@nestjs\/common["']\s*;?\s*/gm,
|
|
61
|
+
// "",
|
|
62
|
+
// );
|
|
63
|
+
|
|
64
|
+
// // Remove API structure imports with wrong paths
|
|
65
|
+
// // Pattern 1: ../api/structures path (LLM often uses this wrong path)
|
|
66
|
+
// cleanedCode = cleanedCode.replace(
|
|
67
|
+
// /import\s*(?:type\s*)?{\s*[^}]+\s*}\s*from\s*["']\.\.\/api\/structures\/[^"']+["']\s*;?\s*/gm,
|
|
68
|
+
// "",
|
|
69
|
+
// );
|
|
70
|
+
// // Pattern 2: @ORGANIZATION/PROJECT-api path (correct path but LLM shouldn't write it)
|
|
71
|
+
// cleanedCode = cleanedCode.replace(
|
|
72
|
+
// /import\s*(?:type\s*)?{\s*[^}]+\s*}\s*from\s*["']@ORGANIZATION\/PROJECT-api\/lib\/structures\/[^"']+["']\s*;?\s*/gm,
|
|
73
|
+
// "",
|
|
74
|
+
// );
|
|
75
|
+
|
|
76
|
+
// // Remove specific type imports that match our typeReferences
|
|
77
|
+
// for (const ref of typeReferences) {
|
|
78
|
+
// const typeImportRegex = new RegExp(
|
|
79
|
+
// `import\\s*(?:type\\s*)?{\\s*${ref}\\s*}\\s*from\\s*["'][^"']+["']\\s*;?\\s*`,
|
|
80
|
+
// "gm",
|
|
81
|
+
// );
|
|
82
|
+
// cleanedCode = cleanedCode.replace(typeImportRegex, "");
|
|
83
|
+
// }
|
|
84
|
+
|
|
85
|
+
// // Remove decorator type imports if LLM mistakenly added them
|
|
86
|
+
// if (decoratorType) {
|
|
87
|
+
// const decoratorTypeRegex = new RegExp(
|
|
88
|
+
// `import\\s*(?:type\\s*)?{\\s*${decoratorType}\\s*}\\s*from\\s*["']\\.\\.\/decorators\/payload\/${decoratorType}["']\\s*;?\\s*`,
|
|
89
|
+
// "gm",
|
|
90
|
+
// );
|
|
91
|
+
// cleanedCode = cleanedCode.replace(decoratorTypeRegex, "");
|
|
92
|
+
// }
|
|
93
|
+
|
|
94
|
+
// return cleanedCode;
|
|
95
|
+
// }
|
|
96
96
|
|
|
97
97
|
export async function replaceImportStatements<Model extends ILlmSchema.Model>(
|
|
98
98
|
ctx: AutoBeContext<Model>,
|
|
99
99
|
props: {
|
|
100
100
|
operation: AutoBeOpenApi.IOperation;
|
|
101
|
+
schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
|
|
101
102
|
code: string;
|
|
102
103
|
decoratorType?: string;
|
|
103
104
|
},
|
|
104
|
-
) {
|
|
105
|
-
let {
|
|
106
|
-
|
|
107
|
-
// Extract type references from operation
|
|
108
|
-
const typeReferences: string[] = Array.from(
|
|
109
|
-
new Set(
|
|
110
|
-
[operation.requestBody, operation.responseBody]
|
|
111
|
-
.filter((el) => el !== null)
|
|
112
|
-
.map((el) => el.typeName.split(".")[0]!),
|
|
113
|
-
),
|
|
114
|
-
);
|
|
105
|
+
): Promise<string> {
|
|
106
|
+
let { code, decoratorType } = props;
|
|
115
107
|
|
|
116
108
|
// Beautify code first for consistent formatting
|
|
117
109
|
const compiler: IAutoBeCompiler = await ctx.compiler();
|
|
118
110
|
code = await compiler.typescript.beautify(code);
|
|
119
111
|
|
|
120
112
|
// Remove all LLM-generated imports
|
|
121
|
-
code =
|
|
113
|
+
code = code
|
|
114
|
+
.split("\r\n")
|
|
115
|
+
.join("\n")
|
|
116
|
+
.split("\n")
|
|
117
|
+
.filter((str) => str.trim().startsWith("import") === false)
|
|
118
|
+
.join("\n");
|
|
122
119
|
|
|
123
120
|
// Build the standard imports
|
|
124
|
-
const imports = getRealizeWriteImportStatements(
|
|
121
|
+
const imports = getRealizeWriteImportStatements(props);
|
|
125
122
|
|
|
126
123
|
// Only add decoratorType import if it exists
|
|
127
124
|
if (decoratorType) {
|
|
@@ -6,7 +6,7 @@ import { v7 } from "uuid";
|
|
|
6
6
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
7
7
|
import { AutoBeState } from "../../../context/AutoBeState";
|
|
8
8
|
import { IAutoBeTestScenarioAuthorizationRole } from "../structures/IAutoBeTestScenarioAuthorizationRole";
|
|
9
|
-
import {
|
|
9
|
+
import { getPrerequisites } from "../utils/getPrerequisites";
|
|
10
10
|
|
|
11
11
|
export const transformTestScenarioHistories = (props: {
|
|
12
12
|
state: AutoBeState;
|
|
@@ -17,26 +17,10 @@ export const transformTestScenarioHistories = (props: {
|
|
|
17
17
|
}): Array<
|
|
18
18
|
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
19
19
|
> => {
|
|
20
|
-
interface IRelationship {
|
|
21
|
-
endpoint: AutoBeOpenApi.IEndpoint;
|
|
22
|
-
ids: string[];
|
|
23
|
-
}
|
|
24
20
|
const authorizations: AutoBeInterfaceAuthorization[] =
|
|
25
21
|
props.state.interface?.authorizations ?? [];
|
|
26
22
|
const authorizationRoles: Map<string, IAutoBeTestScenarioAuthorizationRole> =
|
|
27
23
|
new Map();
|
|
28
|
-
const relationships: IRelationship[] = props.document.operations
|
|
29
|
-
.map((operation) => ({
|
|
30
|
-
endpoint: {
|
|
31
|
-
method: operation.method,
|
|
32
|
-
path: operation.path,
|
|
33
|
-
},
|
|
34
|
-
ids: getReferenceIds({
|
|
35
|
-
document: props.document,
|
|
36
|
-
operation,
|
|
37
|
-
}),
|
|
38
|
-
}))
|
|
39
|
-
.filter((v) => v.ids.length !== 0);
|
|
40
24
|
|
|
41
25
|
for (const authorization of authorizations) {
|
|
42
26
|
for (const op of authorization.operations) {
|
|
@@ -92,10 +76,6 @@ export const transformTestScenarioHistories = (props: {
|
|
|
92
76
|
You may write multiple scenarios for a single included endpoint.
|
|
93
77
|
Focus on business-logic-oriented E2E flows rather than trivial CRUD.
|
|
94
78
|
|
|
95
|
-
Please analyze the operations to identify all dependencies required for testing.
|
|
96
|
-
Pay close attention to IDs and related values in the API,
|
|
97
|
-
and ensure you identify all dependencies between endpoints.
|
|
98
|
-
|
|
99
79
|
\`\`\`json
|
|
100
80
|
${JSON.stringify({
|
|
101
81
|
operations: props.document.operations,
|
|
@@ -109,46 +89,20 @@ export const transformTestScenarioHistories = (props: {
|
|
|
109
89
|
When testing endpoints that require authentication, ensure you include the corresponding
|
|
110
90
|
join/login operations in your test scenario to establish proper authentication context.
|
|
111
91
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
(role) => role.name === el.authorizationRole,
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
const requiredIds = getReferenceIds({
|
|
92
|
+
\`\`\`json
|
|
93
|
+
${JSON.stringify(
|
|
94
|
+
props.include.map((el) => ({
|
|
95
|
+
...el,
|
|
96
|
+
prerequisites: getPrerequisites({
|
|
121
97
|
document: props.document,
|
|
122
|
-
|
|
123
|
-
})
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
roles.length > 0
|
|
131
|
-
? roles
|
|
132
|
-
.map((role) => {
|
|
133
|
-
return StringUtil.trim`
|
|
134
|
-
- ${role.join?.method.toUpperCase()}: ${role.join?.path}
|
|
135
|
-
- ${role.login?.method.toUpperCase()}: ${role.login?.path}
|
|
136
|
-
`;
|
|
137
|
-
})
|
|
138
|
-
.join("\n")
|
|
139
|
-
: "- None"
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
Required IDs:
|
|
143
|
-
|
|
144
|
-
- ${
|
|
145
|
-
requiredIds.length > 0
|
|
146
|
-
? requiredIds.map((id) => `\`${id}\``).join(", ")
|
|
147
|
-
: "None"
|
|
148
|
-
}
|
|
149
|
-
`;
|
|
150
|
-
})
|
|
151
|
-
.join("\n")}
|
|
98
|
+
endpoint: el,
|
|
99
|
+
}),
|
|
100
|
+
authorizationRoles: Array.from(authorizationRoles.values()).filter(
|
|
101
|
+
(role) => role.name === el.authorizationRole,
|
|
102
|
+
),
|
|
103
|
+
})),
|
|
104
|
+
)}
|
|
105
|
+
\`\`\`
|
|
152
106
|
|
|
153
107
|
## Excluded from Test Plan
|
|
154
108
|
|
|
@@ -156,37 +110,10 @@ export const transformTestScenarioHistories = (props: {
|
|
|
156
110
|
These endpoints do not need to be tested again.
|
|
157
111
|
However, it is allowed to reference or depend on these endpoints when writing test codes for other purposes.
|
|
158
112
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
## Candidate Dependencies
|
|
164
|
-
|
|
165
|
-
List of candidate dependencies extracted from path parameters and request bodies.
|
|
166
|
-
|
|
167
|
-
Apply dependency resolution to the target endpoint from "Included in Test Plan" and to dependencies found recursively from it.
|
|
168
|
-
For each required ID, locate the operation that creates the resource. Include the creator only if that operation exists in the provided operations list. Do not assume or invent operations. If no creator exists, treat the ID as an external or pre-existing input.
|
|
169
|
-
|
|
170
|
-
Dependency resolution steps:
|
|
171
|
-
1. Starting from the target endpoint, collect required IDs.
|
|
172
|
-
2. For each ID, search for a creator operation (typically POST).
|
|
173
|
-
3. If found, add it to the dependency chain in execution order and repeat for its own required IDs.
|
|
174
|
-
4. Stop when no further creators exist or are needed.
|
|
175
|
-
|
|
176
|
-
For each some_entity_id pattern, use the same approach: include a creator only when it is present in the operations list.
|
|
177
|
-
|
|
178
|
-
Endpoint | Required IDs (MUST be created by other APIs)
|
|
179
|
-
---------|---------------------------------------------------
|
|
180
|
-
${relationships
|
|
181
|
-
.map((r) =>
|
|
182
|
-
[
|
|
183
|
-
`\`${r.endpoint.method} ${r.endpoint.path}\``,
|
|
184
|
-
r.ids.map((id) => `\`${id}\``).join(", "),
|
|
185
|
-
].join(" | "),
|
|
186
|
-
)
|
|
187
|
-
.join("\n")}
|
|
188
|
-
|
|
189
|
-
Example: If an endpoint requires \`articleId\` and \`POST /articles\` exists, include it in dependencies
|
|
113
|
+
\`\`\`json
|
|
114
|
+
${JSON.stringify(props.exclude)}
|
|
115
|
+
\`\`\`
|
|
116
|
+
|
|
190
117
|
`,
|
|
191
118
|
} satisfies IAgenticaHistoryJson.IAssistantMessage,
|
|
192
119
|
];
|
|
@@ -6,7 +6,7 @@ import { v7 } from "uuid";
|
|
|
6
6
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
7
7
|
import { AutoBeState } from "../../../context/AutoBeState";
|
|
8
8
|
import { IAutoBeTestScenarioApplication } from "../structures/IAutoBeTestScenarioApplication";
|
|
9
|
-
import {
|
|
9
|
+
import { getPrerequisites } from "../utils/getPrerequisites";
|
|
10
10
|
|
|
11
11
|
export function transformTestScenarioReviewHistories(props: {
|
|
12
12
|
state: AutoBeState;
|
|
@@ -15,11 +15,6 @@ export function transformTestScenarioReviewHistories(props: {
|
|
|
15
15
|
}): Array<
|
|
16
16
|
IAgenticaHistoryJson.ISystemMessage | IAgenticaHistoryJson.IAssistantMessage
|
|
17
17
|
> {
|
|
18
|
-
interface IRelationship {
|
|
19
|
-
endpoint: AutoBeOpenApi.IEndpoint;
|
|
20
|
-
ids: string[];
|
|
21
|
-
}
|
|
22
|
-
|
|
23
18
|
const document: AutoBeOpenApi.IDocument | undefined =
|
|
24
19
|
props.state.interface?.document;
|
|
25
20
|
if (document === undefined) {
|
|
@@ -28,20 +23,13 @@ export function transformTestScenarioReviewHistories(props: {
|
|
|
28
23
|
);
|
|
29
24
|
}
|
|
30
25
|
|
|
31
|
-
const relationships: IRelationship[] = document.operations
|
|
32
|
-
.map((o) => ({
|
|
33
|
-
endpoint: {
|
|
34
|
-
method: o.method,
|
|
35
|
-
path: o.path,
|
|
36
|
-
},
|
|
37
|
-
ids: getReferenceIds({
|
|
38
|
-
document,
|
|
39
|
-
operation: o,
|
|
40
|
-
}),
|
|
41
|
-
}))
|
|
42
|
-
.filter((v) => v.ids.length !== 0);
|
|
43
|
-
|
|
44
26
|
return [
|
|
27
|
+
{
|
|
28
|
+
id: v7(),
|
|
29
|
+
created_at: new Date().toISOString(),
|
|
30
|
+
type: "systemMessage",
|
|
31
|
+
text: AutoBeSystemPromptConstant.TEST_SCENARIO,
|
|
32
|
+
},
|
|
45
33
|
{
|
|
46
34
|
id: v7(),
|
|
47
35
|
created_at: new Date().toISOString(),
|
|
@@ -74,85 +62,24 @@ export function transformTestScenarioReviewHistories(props: {
|
|
|
74
62
|
Match each operation with its corresponding schema.
|
|
75
63
|
|
|
76
64
|
\`\`\`json
|
|
77
|
-
${JSON.stringify({
|
|
78
|
-
operations: document.operations,
|
|
79
|
-
})}
|
|
65
|
+
${JSON.stringify({ operations: document.operations })}
|
|
80
66
|
\`\`\`
|
|
81
67
|
|
|
82
|
-
## Test Scenario Groups
|
|
68
|
+
## Test Scenario Groups to Review
|
|
83
69
|
|
|
84
|
-
|
|
70
|
+
Each scenario group includes the target endpoint and its prerequisite endpoints.
|
|
85
71
|
|
|
86
72
|
\`\`\`json
|
|
87
73
|
${JSON.stringify(
|
|
88
|
-
props.groups.map((g) => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
document.operations.forEach((op) => {
|
|
96
|
-
if (
|
|
97
|
-
g.endpoint.method === op.method &&
|
|
98
|
-
g.endpoint.path === op.path
|
|
99
|
-
) {
|
|
100
|
-
requiredId.push(
|
|
101
|
-
...getReferenceIds({ document, operation: op }),
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (
|
|
106
|
-
op.method === dep.endpoint.method &&
|
|
107
|
-
op.path === dep.endpoint.path
|
|
108
|
-
) {
|
|
109
|
-
requiredId.push(
|
|
110
|
-
...getReferenceIds({ document, operation: op }),
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
return {
|
|
117
|
-
...s,
|
|
118
|
-
requiredIds:
|
|
119
|
-
requiredId.length > 0
|
|
120
|
-
? Array.from(new Set(requiredId))
|
|
121
|
-
: [],
|
|
122
|
-
};
|
|
123
|
-
}),
|
|
124
|
-
};
|
|
125
|
-
}),
|
|
74
|
+
props.groups.map((g) => ({
|
|
75
|
+
...g,
|
|
76
|
+
prerequisites: getPrerequisites({
|
|
77
|
+
document,
|
|
78
|
+
endpoint: g.endpoint,
|
|
79
|
+
}),
|
|
80
|
+
})),
|
|
126
81
|
)}
|
|
127
82
|
\`\`\`
|
|
128
|
-
|
|
129
|
-
## Candidate Dependencies
|
|
130
|
-
|
|
131
|
-
List of candidate dependencies extracted from path parameters and request bodies.
|
|
132
|
-
|
|
133
|
-
Apply dependency resolution to the target endpoint from "Included in Test Plan" and to dependencies found recursively from it.
|
|
134
|
-
For each required ID, locate the operation that creates the resource. Include the creator only if that operation exists in the provided operations list. Do not assume or invent operations. If no creator exists, treat the ID as an external or pre-existing input.
|
|
135
|
-
|
|
136
|
-
Dependency resolution steps:
|
|
137
|
-
1. Starting from the target endpoint, collect required IDs.
|
|
138
|
-
2. For each ID, search for a creator operation (typically POST).
|
|
139
|
-
3. If found, add it to the dependency chain in execution order and repeat for its own required IDs.
|
|
140
|
-
4. Stop when no further creators exist or are needed.
|
|
141
|
-
|
|
142
|
-
For each some_entity_id pattern, use the same approach: include a creator only when it is present in the operations list.
|
|
143
|
-
|
|
144
|
-
Endpoint | Required IDs (MUST be created by other APIs)
|
|
145
|
-
---------|---------------------------------------------------
|
|
146
|
-
${relationships
|
|
147
|
-
.map((r) =>
|
|
148
|
-
[
|
|
149
|
-
`\`${r.endpoint.method} ${r.endpoint.path}\``,
|
|
150
|
-
r.ids.map((id) => `\`${id}\``).join(", "),
|
|
151
|
-
].join(" | "),
|
|
152
|
-
)
|
|
153
|
-
.join("\n")}
|
|
154
|
-
|
|
155
|
-
Example: If an endpoint requires \`articleId\` and \`POST /articles\` exists, include it in dependencies
|
|
156
83
|
`,
|
|
157
84
|
},
|
|
158
85
|
];
|
|
@@ -179,11 +179,12 @@ const correct = async <Model extends ILlmSchema.Model>(
|
|
|
179
179
|
});
|
|
180
180
|
if (pointer.value === null) throw new Error("Failed to correct test code.");
|
|
181
181
|
|
|
182
|
-
pointer.value.revise.final
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
182
|
+
if (pointer.value.revise.final)
|
|
183
|
+
pointer.value.revise.final = await completeTestCode(
|
|
184
|
+
ctx,
|
|
185
|
+
props.function.artifacts,
|
|
186
|
+
pointer.value.revise.final,
|
|
187
|
+
);
|
|
187
188
|
pointer.value.draft = await completeTestCode(
|
|
188
189
|
ctx,
|
|
189
190
|
props.function.artifacts,
|
|
@@ -201,7 +202,7 @@ const correct = async <Model extends ILlmSchema.Model>(
|
|
|
201
202
|
think: pointer.value.think,
|
|
202
203
|
draft: pointer.value.draft,
|
|
203
204
|
review: pointer.value.revise?.review,
|
|
204
|
-
final: pointer.value.revise?.final,
|
|
205
|
+
final: pointer.value.revise?.final ?? undefined,
|
|
205
206
|
} satisfies AutoBeTestCorrectEvent);
|
|
206
207
|
const newFunction: IAutoBeTestFunction = {
|
|
207
208
|
...props.function,
|
|
@@ -10,6 +10,7 @@ import { v7 } from "uuid";
|
|
|
10
10
|
|
|
11
11
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
12
12
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
13
|
+
import { completeTestCode } from "./compile/completeTestCode";
|
|
13
14
|
import { transformTestCorrectInvalidRequestHistories } from "./histories/transformTestCorrectInvalidRequestHistories";
|
|
14
15
|
import { IAutoBeTestCorrectInvalidRequestApplication } from "./structures/IAutoBeTestCorrectInvalidRequestApplication";
|
|
15
16
|
import { IAutoBeTestFunction } from "./structures/IAutoBeTestFunction";
|
|
@@ -82,6 +83,17 @@ const correct = async <Model extends ILlmSchema.Model>(
|
|
|
82
83
|
if (pointer.value === null) throw new Error("Failed to correct test code.");
|
|
83
84
|
else if (pointer.value === false) return event; // other's responsibility
|
|
84
85
|
|
|
86
|
+
if (pointer.value.revise.final)
|
|
87
|
+
pointer.value.revise.final = await completeTestCode(
|
|
88
|
+
ctx,
|
|
89
|
+
write.artifacts,
|
|
90
|
+
pointer.value.revise.final,
|
|
91
|
+
);
|
|
92
|
+
pointer.value.draft = await completeTestCode(
|
|
93
|
+
ctx,
|
|
94
|
+
write.artifacts,
|
|
95
|
+
pointer.value.draft,
|
|
96
|
+
);
|
|
85
97
|
ctx.dispatch({
|
|
86
98
|
type: "testCorrect",
|
|
87
99
|
id: v7(),
|
|
@@ -97,7 +109,7 @@ const correct = async <Model extends ILlmSchema.Model>(
|
|
|
97
109
|
think: pointer.value.think,
|
|
98
110
|
draft: pointer.value.draft,
|
|
99
111
|
review: pointer.value.revise?.review,
|
|
100
|
-
final: pointer.value.revise?.final,
|
|
112
|
+
final: pointer.value.revise?.final ?? undefined,
|
|
101
113
|
} satisfies AutoBeTestCorrectEvent);
|
|
102
114
|
const newWrite: IAutoBeTestFunction = {
|
|
103
115
|
artifacts: write.artifacts,
|
|
@@ -5,13 +5,18 @@ import {
|
|
|
5
5
|
AutoBeProgressEventBase,
|
|
6
6
|
AutoBeTestScenario,
|
|
7
7
|
} from "@autobe/interface";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
AutoBeOpenApiEndpointComparator,
|
|
10
|
+
MapUtil,
|
|
11
|
+
StringUtil,
|
|
12
|
+
} from "@autobe/utils";
|
|
9
13
|
import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
|
|
10
14
|
import { HashMap, IPointer, Pair } from "tstl";
|
|
11
15
|
import typia from "typia";
|
|
12
16
|
import { NamingConvention } from "typia/lib/utils/NamingConvention";
|
|
13
17
|
import { v7 } from "uuid";
|
|
14
18
|
|
|
19
|
+
import { AutoBeConfigConstant } from "../../constants/AutoBeConfigConstant";
|
|
15
20
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
16
21
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
17
22
|
import { divideArray } from "../../utils/divideArray";
|
|
@@ -24,6 +29,7 @@ import { IAutoBeTestScenarioAuthorizationRole } from "./structures/IAutoBeTestSc
|
|
|
24
29
|
export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
|
|
25
30
|
ctx: AutoBeContext<Model>,
|
|
26
31
|
instruction: string,
|
|
32
|
+
capacity: number = AutoBeConfigConstant.INTERFACE_CAPACITY,
|
|
27
33
|
): Promise<AutoBeTestScenario[]> {
|
|
28
34
|
const document: AutoBeOpenApi.IDocument | undefined =
|
|
29
35
|
ctx.state().interface?.document;
|
|
@@ -45,8 +51,8 @@ export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
|
|
|
45
51
|
op,
|
|
46
52
|
),
|
|
47
53
|
),
|
|
48
|
-
|
|
49
|
-
|
|
54
|
+
AutoBeOpenApiEndpointComparator.hashCode,
|
|
55
|
+
AutoBeOpenApiEndpointComparator.equals,
|
|
50
56
|
);
|
|
51
57
|
|
|
52
58
|
const endpointNotFound: string = [
|
|
@@ -74,7 +80,7 @@ export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
|
|
|
74
80
|
do {
|
|
75
81
|
const matrix: AutoBeOpenApi.IOperation[][] = divideArray({
|
|
76
82
|
array: include,
|
|
77
|
-
capacity:
|
|
83
|
+
capacity: capacity ?? AutoBeConfigConstant.INTERFACE_CAPACITY,
|
|
78
84
|
});
|
|
79
85
|
await executeCachedBatch(
|
|
80
86
|
matrix.map((include) => async (promptCacheKey) => {
|
|
@@ -405,8 +411,8 @@ const uniqueScenarioGroups = (
|
|
|
405
411
|
): IAutoBeTestScenarioApplication.IScenarioGroup[] =>
|
|
406
412
|
new HashMap(
|
|
407
413
|
groups.map((g) => new Pair(g.endpoint, g)),
|
|
408
|
-
|
|
409
|
-
|
|
414
|
+
AutoBeOpenApiEndpointComparator.hashCode,
|
|
415
|
+
AutoBeOpenApiEndpointComparator.equals,
|
|
410
416
|
)
|
|
411
417
|
.toJSON()
|
|
412
418
|
.map((it) => it.second);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IAgenticaController } from "@agentica/core";
|
|
2
2
|
import { AutoBeProgressEventBase, AutoBeTestScenario } from "@autobe/interface";
|
|
3
|
-
import {
|
|
3
|
+
import { AutoBeOpenApiEndpointComparator } from "@autobe/utils";
|
|
4
4
|
import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
|
|
5
5
|
import { HashMap, IPointer, Pair } from "tstl";
|
|
6
6
|
import typia from "typia";
|
|
@@ -172,8 +172,8 @@ const uniqueScenarioGroups = (
|
|
|
172
172
|
): IAutoBeTestScenarioApplication.IScenarioGroup[] =>
|
|
173
173
|
new HashMap(
|
|
174
174
|
groups.map((g) => new Pair(g.endpoint, g)),
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
AutoBeOpenApiEndpointComparator.hashCode,
|
|
176
|
+
AutoBeOpenApiEndpointComparator.equals,
|
|
177
177
|
)
|
|
178
178
|
.toJSON()
|
|
179
179
|
.map((it) => it.second);
|