@autobe/agent 0.25.0 → 0.25.2
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/AutoBeConfigConstant.d.ts +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +13 -13
- package/lib/factory/createAutoBeContext.js +32 -3
- package/lib/factory/createAutoBeContext.js.map +1 -1
- package/lib/index.mjs +2585 -1009
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +8 -8
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +2 -2
- 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 +278 -47
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +96 -70
- 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 +29 -30
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +278 -47
- 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 +88 -42
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js +82 -14
- 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/IAutoBeInterfaceOperationApplication.d.ts +3 -3
- 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 +114 -9
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -1
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js +46 -3
- 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/prisma/orchestratePrismaComponent.js +8 -8
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +20 -20
- package/lib/orchestrate/prisma/orchestratePrismaReview.js +20 -20
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +30 -30
- 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 +79 -45
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +16 -16
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +12 -12
- 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/IAutoBeRealizeAuthorizationApplication.d.ts +21 -13
- 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/AutoBeConfigConstant.ts +1 -1
- package/src/constants/AutoBeSystemPromptConstant.ts +13 -13
- package/src/factory/createAutoBeContext.ts +33 -3
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +2 -2
- 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/IAutoBeInterfaceOperationApplication.ts +4 -5
- 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 +49 -3
- 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 +123 -74
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +33 -6
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +14 -4
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +21 -13
- 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
|
@@ -65,8 +65,8 @@ export namespace IAutoBeTestWriteApplication {
|
|
|
65
65
|
*
|
|
66
66
|
* Contains the iterative improvement workflow that transforms the initial
|
|
67
67
|
* draft into production-ready test code. The review phase identifies issues
|
|
68
|
-
* to fix or code to delete, followed by the final phase that produces
|
|
69
|
-
*
|
|
68
|
+
* to fix or code to delete, followed by the final phase that produces the
|
|
69
|
+
* polished, production-ready test implementation.
|
|
70
70
|
*
|
|
71
71
|
* Workflow: Draft → Review analysis → Final implementation
|
|
72
72
|
*/
|
|
@@ -74,52 +74,6 @@ export namespace IAutoBeTestWriteApplication {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
export interface IReviseProps {
|
|
77
|
-
// /**
|
|
78
|
-
// * Test implementation rules compliance validation.
|
|
79
|
-
// *
|
|
80
|
-
// * This property tracks whether each section of the TEST_WRITE.md guidelines
|
|
81
|
-
// * has been properly followed. Each array element represents a section from
|
|
82
|
-
// * the documentation with its title and compliance status.
|
|
83
|
-
// *
|
|
84
|
-
// * Note: The specific section titles may evolve as documentation updates, so
|
|
85
|
-
// * implementations should be flexible in handling different titles.
|
|
86
|
-
// *
|
|
87
|
-
// * Example:
|
|
88
|
-
// *
|
|
89
|
-
// * ```typescript
|
|
90
|
-
// * rules: [
|
|
91
|
-
// * { title: "1. Role and Responsibility", state: true },
|
|
92
|
-
// * { title: "2. Input Materials Provided", state: true },
|
|
93
|
-
// * { title: "3. Code Generation Requirements", state: false },
|
|
94
|
-
// * // ... other sections
|
|
95
|
-
// * ];
|
|
96
|
-
// * ```
|
|
97
|
-
// */
|
|
98
|
-
// rules: ICheck[] & tags.MinItems<1>;
|
|
99
|
-
|
|
100
|
-
// /**
|
|
101
|
-
// * Final quality checklist validation results.
|
|
102
|
-
// *
|
|
103
|
-
// * This property captures the compliance status for each item in the Final
|
|
104
|
-
// * Checklist (Section 5) from TEST_WRITE.md. Each array element represents a
|
|
105
|
-
// * checklist item with its description and validation result.
|
|
106
|
-
// *
|
|
107
|
-
// * Note: Checklist items may be updated over time, so implementations should
|
|
108
|
-
// * adapt to documentation changes while maintaining the validation purpose.
|
|
109
|
-
// *
|
|
110
|
-
// * Example:
|
|
111
|
-
// *
|
|
112
|
-
// * ```typescript
|
|
113
|
-
// * checkList: [
|
|
114
|
-
// * { title: "NO additional import statements", state: true },
|
|
115
|
-
// * { title: "NO wrong type data in requests", state: true },
|
|
116
|
-
// * { title: "EVERY api.functional.* call has await", state: false },
|
|
117
|
-
// * // ... other checklist items
|
|
118
|
-
// * ];
|
|
119
|
-
// * ```
|
|
120
|
-
// */
|
|
121
|
-
// checkList: ICheck[] & tags.MinItems<1>;
|
|
122
|
-
|
|
123
77
|
/**
|
|
124
78
|
* Step 4: Code review and quality assessment.
|
|
125
79
|
*
|
|
@@ -180,7 +134,9 @@ export namespace IAutoBeTestWriteApplication {
|
|
|
180
134
|
*
|
|
181
135
|
* AI produces the final, polished version of the test code incorporating
|
|
182
136
|
* all review feedback. This code represents the completed test
|
|
183
|
-
* implementation, ready for production deployment.
|
|
137
|
+
* implementation, ready for production deployment. When the draft code is
|
|
138
|
+
* already perfect with no issues found during review, this value can be
|
|
139
|
+
* null, indicating no revisions were necessary.
|
|
184
140
|
*
|
|
185
141
|
* **🚨 CRITICAL: APPLY ALL FIXES AND DELETIONS FROM REVIEW 🚨**
|
|
186
142
|
*
|
|
@@ -188,41 +144,18 @@ export namespace IAutoBeTestWriteApplication {
|
|
|
188
144
|
* - DELETE all prohibited code identified in review
|
|
189
145
|
* - If review found type error tests, they MUST be deleted in final
|
|
190
146
|
* - If review found code to DELETE, final MUST be different from draft
|
|
147
|
+
* - If review finds NO issues requiring changes, set to null
|
|
191
148
|
*
|
|
192
149
|
* All identified issues must be resolved, and the code must meet the
|
|
193
|
-
* highest quality standards.
|
|
150
|
+
* highest quality standards. A null value indicates the draft code already
|
|
151
|
+
* meets all requirements without modification.
|
|
194
152
|
*
|
|
195
153
|
* Workflow: Review feedback → Apply FIXES → Apply DELETIONS →
|
|
196
|
-
* Production-ready implementation
|
|
154
|
+
* Production-ready implementation (or null if no changes needed)
|
|
197
155
|
*
|
|
198
156
|
* This is the ultimate deliverable that will be used in the actual test
|
|
199
|
-
* suite.
|
|
157
|
+
* suite when provided, otherwise the draft is used as-is.
|
|
200
158
|
*/
|
|
201
|
-
final: string;
|
|
159
|
+
final: string | null;
|
|
202
160
|
}
|
|
203
|
-
|
|
204
|
-
// /**
|
|
205
|
-
// * Check validation item structure.
|
|
206
|
-
// *
|
|
207
|
-
// * Represents a validation check with its title and compliance state. Used for
|
|
208
|
-
// * both rules validation and final checklist validation.
|
|
209
|
-
// */
|
|
210
|
-
// export interface ICheck {
|
|
211
|
-
// /**
|
|
212
|
-
// * The title or description of the check.
|
|
213
|
-
// *
|
|
214
|
-
// * For rules: Section identifiers from TEST_WRITE.md (e.g., "1. Role and
|
|
215
|
-
// * Responsibility") For checklist: Checklist item descriptions (e.g., "No
|
|
216
|
-
// * compilation errors")
|
|
217
|
-
// */
|
|
218
|
-
// title: string;
|
|
219
|
-
|
|
220
|
-
// /**
|
|
221
|
-
// * The validation state of this check.
|
|
222
|
-
// *
|
|
223
|
-
// * - True: The requirement has been satisfied
|
|
224
|
-
// * - False: The requirement has been violated or not met
|
|
225
|
-
// */
|
|
226
|
-
// state: boolean;
|
|
227
|
-
// }
|
|
228
161
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
|
+
import { AutoBeOpenApiEndpointComparator } from "@autobe/utils";
|
|
3
|
+
import { HashMap } from "tstl";
|
|
4
|
+
|
|
5
|
+
export const getPrerequisites = (props: {
|
|
6
|
+
document: AutoBeOpenApi.IDocument;
|
|
7
|
+
endpoint: AutoBeOpenApi.IEndpoint;
|
|
8
|
+
}): AutoBeOpenApi.IPrerequisite[] => {
|
|
9
|
+
const visited: Set<string> = new Set<string>();
|
|
10
|
+
const result: HashMap<
|
|
11
|
+
AutoBeOpenApi.IEndpoint,
|
|
12
|
+
AutoBeOpenApi.IPrerequisite[]
|
|
13
|
+
> = new HashMap<AutoBeOpenApi.IEndpoint, AutoBeOpenApi.IPrerequisite[]>(
|
|
14
|
+
AutoBeOpenApiEndpointComparator.hashCode,
|
|
15
|
+
AutoBeOpenApiEndpointComparator.equals,
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const traverse = (endpoint: AutoBeOpenApi.IEndpoint): void => {
|
|
19
|
+
const key = `${endpoint.method}:${endpoint.path}`;
|
|
20
|
+
|
|
21
|
+
// prevent circular structure: skip visited endpoint
|
|
22
|
+
if (visited.has(key)) return;
|
|
23
|
+
visited.add(key);
|
|
24
|
+
|
|
25
|
+
const operation: AutoBeOpenApi.IOperation | undefined =
|
|
26
|
+
props.document.operations.find(
|
|
27
|
+
(op) => op.method === endpoint.method && op.path === endpoint.path,
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
if (operation === undefined) return;
|
|
31
|
+
|
|
32
|
+
// add current operation's prerequisites
|
|
33
|
+
for (const prerequisite of operation.prerequisites) {
|
|
34
|
+
// check if already in result to avoid duplicates
|
|
35
|
+
const exists: boolean = result.has(prerequisite.endpoint);
|
|
36
|
+
|
|
37
|
+
if (!exists) {
|
|
38
|
+
result.set(prerequisite.endpoint, [prerequisite]);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// recursively traverse prerequisite's prerequisites
|
|
42
|
+
traverse(prerequisite.endpoint);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
traverse(props.endpoint);
|
|
47
|
+
return result
|
|
48
|
+
.toJSON()
|
|
49
|
+
.map((it) => it.second)
|
|
50
|
+
.flat();
|
|
51
|
+
};
|
|
@@ -7,7 +7,8 @@ export const getReferenceIds = (props: {
|
|
|
7
7
|
}): string[] => {
|
|
8
8
|
const result: Set<string> = new Set();
|
|
9
9
|
const emplace = (key: string) => {
|
|
10
|
-
if (key.endsWith("_id") || key.endsWith("Id")
|
|
10
|
+
if (key.endsWith("_id") || key.endsWith("Id") || key === "id")
|
|
11
|
+
result.add(key);
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
props.operation.parameters.forEach((p) => emplace(p.name));
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
-
import { AutoBeState } from "../../../context/AutoBeState";
|
|
3
|
-
export declare const transformInterfacePrerequisiteHistories: (state: AutoBeState) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage> | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformInterfacePrerequisiteHistories.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.ts"],"names":[],"mappings":";;;AACA,+BAA0B;AAInB,MAAM,uCAAuC,GAAG,CACrD,KAAkB,EAGX,EAAE;IACT,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;QACxB,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,4CAA4C;oBAC5C,mCAAmC;oBACnC,8CAA8C;iBAC/C,CAAC,IAAI,CAAC,GAAG,CAAC;aACZ;SACF,CAAC;SACC,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI;QAC5B,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,mDAAmD;oBACnD,mCAAmC;oBACnC,qDAAqD;iBACtD,CAAC,IAAI,CAAC,GAAG,CAAC;aACZ;SACF,CAAC;SACC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM,CAAC,IAAI;QAC/C,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,kDAAkD;oBAClD,sCAAsC;oBACtC,mCAAmC;oBACnC,wDAAwD;iBACzD,CAAC,IAAI,CAAC,GAAG,CAAC;aACZ;SACF,CAAC;SACC,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS;QAC/C,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,kDAAkD;oBAClD,sCAAsC;oBACtC,mCAAmC;oBACnC,wDAAwD;iBACzD,CAAC,IAAI,CAAC,GAAG,CAAC;aACZ;SACF,CAAC;IACJ,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AA5DW,QAAA,uCAAuC,2CA4DlD"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
|
-
export declare namespace OpenApiEndpointComparator {
|
|
3
|
-
function hashCode(e: AutoBeOpenApi.IEndpoint): number;
|
|
4
|
-
function equals(x: AutoBeOpenApi.IEndpoint, y: AutoBeOpenApi.IEndpoint): boolean;
|
|
5
|
-
function compare(x: AutoBeOpenApi.IEndpoint, y: AutoBeOpenApi.IEndpoint): number;
|
|
6
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OpenApiEndpointComparator = void 0;
|
|
4
|
-
const tstl_1 = require("tstl");
|
|
5
|
-
var OpenApiEndpointComparator;
|
|
6
|
-
(function (OpenApiEndpointComparator) {
|
|
7
|
-
function hashCode(e) {
|
|
8
|
-
return (0, tstl_1.hash)(e.path, e.method);
|
|
9
|
-
}
|
|
10
|
-
OpenApiEndpointComparator.hashCode = hashCode;
|
|
11
|
-
function equals(x, y) {
|
|
12
|
-
return x.path === y.path && x.method === y.method;
|
|
13
|
-
}
|
|
14
|
-
OpenApiEndpointComparator.equals = equals;
|
|
15
|
-
function compare(x, y) {
|
|
16
|
-
if (x.path !== y.path)
|
|
17
|
-
return x.path.localeCompare(y.path);
|
|
18
|
-
return x.method.localeCompare(y.method);
|
|
19
|
-
}
|
|
20
|
-
OpenApiEndpointComparator.compare = compare;
|
|
21
|
-
})(OpenApiEndpointComparator || (exports.OpenApiEndpointComparator = OpenApiEndpointComparator = {}));
|
|
22
|
-
//# sourceMappingURL=OpenApiEndpointComparator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OpenApiEndpointComparator.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/utils/OpenApiEndpointComparator.ts"],"names":[],"mappings":";;;AACA,+BAA4B;AAE5B,IAAiB,yBAAyB,CAmBzC;AAnBD,WAAiB,yBAAyB;IACxC,SAAgB,QAAQ,CAAC,CAA0B;QACjD,OAAO,IAAA,WAAI,EAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAFe,kCAAQ,WAEvB,CAAA;IAED,SAAgB,MAAM,CACpB,CAA0B,EAC1B,CAA0B;QAE1B,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC;IACpD,CAAC;IALe,gCAAM,SAKrB,CAAA;IAED,SAAgB,OAAO,CACrB,CAA0B,EAC1B,CAA0B;QAE1B,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;YAAE,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC3D,OAAO,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;IANe,iCAAO,UAMtB,CAAA;AACH,CAAC,EAnBgB,yBAAyB,yCAAzB,yBAAyB,QAmBzC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
|
-
import { hash } from "tstl";
|
|
3
|
-
|
|
4
|
-
export namespace OpenApiEndpointComparator {
|
|
5
|
-
export function hashCode(e: AutoBeOpenApi.IEndpoint): number {
|
|
6
|
-
return hash(e.path, e.method);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function equals(
|
|
10
|
-
x: AutoBeOpenApi.IEndpoint,
|
|
11
|
-
y: AutoBeOpenApi.IEndpoint,
|
|
12
|
-
): boolean {
|
|
13
|
-
return x.path === y.path && x.method === y.method;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function compare(
|
|
17
|
-
x: AutoBeOpenApi.IEndpoint,
|
|
18
|
-
y: AutoBeOpenApi.IEndpoint,
|
|
19
|
-
): number {
|
|
20
|
-
if (x.path !== y.path) return x.path.localeCompare(y.path);
|
|
21
|
-
return x.method.localeCompare(y.method);
|
|
22
|
-
}
|
|
23
|
-
}
|