@autobe/agent 0.30.2 → 0.30.3
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/AutoBeMockAgent.js +0 -2
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/constants/AutoBeConfigConstant.d.ts +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +12 -11
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/index.mjs +498 -55
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeExtractDecisionsHistory.d.ts +18 -0
- package/lib/orchestrate/analyze/histories/transformAnalyzeExtractDecisionsHistory.js +51 -0
- package/lib/orchestrate/analyze/histories/transformAnalyzeExtractDecisionsHistory.js.map +1 -0
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistory.js +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistory.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioReviewHistory.js +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioReviewHistory.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeSectionCrossFileReviewHistory.d.ts +1 -0
- package/lib/orchestrate/analyze/histories/transformAnalyzeSectionCrossFileReviewHistory.js +15 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeSectionCrossFileReviewHistory.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeSectionReviewHistory.js +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeSectionReviewHistory.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +48 -13
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeExtractDecisions.d.ts +17 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeExtractDecisions.js +345 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeExtractDecisions.js.map +1 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +2 -2
- package/lib/orchestrate/analyze/orchestrateAnalyzeSectionCrossFileReview.d.ts +1 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeSectionCrossFileReview.js +1 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeSectionCrossFileReview.js.map +1 -1
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeExtractDecisionsApplication.d.ts +91 -0
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeExtractDecisionsApplication.js +3 -0
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeExtractDecisionsApplication.js.map +1 -0
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +15 -5
- package/lib/orchestrate/analyze/utils/buildErrorCodeRegistry.d.ts +0 -9
- package/lib/orchestrate/analyze/utils/buildErrorCodeRegistry.js +1 -13
- package/lib/orchestrate/analyze/utils/buildErrorCodeRegistry.js.map +1 -1
- package/lib/orchestrate/analyze/utils/detectDecisionConflicts.d.ts +63 -0
- package/lib/orchestrate/analyze/utils/detectDecisionConflicts.js +105 -0
- package/lib/orchestrate/analyze/utils/detectDecisionConflicts.js.map +1 -0
- package/lib/orchestrate/common/histories/transformPreliminaryHistory.js +1 -1
- package/lib/orchestrate/common/histories/transformPreliminaryHistory.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceActionEndpointReviewHistory.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceActionEndpointReviewHistory.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceBaseEndpointReviewHistory.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceBaseEndpointReviewHistory.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaRefineHistory.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaRefineHistory.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRefine.js +1 -2
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRefine.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js +1 -2
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -1
- package/lib/orchestrate/interface/utils/AutoBeJsonSchemaValidator.js +36 -0
- package/lib/orchestrate/interface/utils/AutoBeJsonSchemaValidator.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaComponentReviewHistory.js +2 -2
- package/lib/orchestrate/prisma/histories/transformPrismaComponentReviewHistory.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistory.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistory.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaGroupHistory.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaGroupHistory.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaGroupReviewHistory.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaGroupReviewHistory.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistory.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistory.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaReviewHistory.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaReviewHistory.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +1 -1
- package/package.json +5 -5
- package/src/AutoBeMockAgent.ts +0 -2
- package/src/constants/AutoBeConfigConstant.ts +1 -1
- package/src/constants/AutoBeSystemPromptConstant.ts +12 -11
- package/src/orchestrate/analyze/histories/transformAnalyzeExtractDecisionsHistory.ts +69 -0
- package/src/orchestrate/analyze/histories/transformAnalyzeSectionCrossFileReviewHistory.ts +20 -0
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +58 -1
- package/src/orchestrate/analyze/orchestrateAnalyzeExtractDecisions.ts +97 -0
- package/src/orchestrate/analyze/orchestrateAnalyzeSectionCrossFileReview.ts +2 -0
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeExtractDecisionsApplication.ts +99 -0
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +15 -5
- package/src/orchestrate/analyze/utils/buildErrorCodeRegistry.ts +0 -20
- package/src/orchestrate/analyze/utils/detectDecisionConflicts.ts +172 -0
- package/src/orchestrate/interface/orchestrateInterfaceSchemaRefine.ts +1 -2
- package/src/orchestrate/interface/orchestrateInterfaceSchemaReview.ts +1 -2
- package/src/orchestrate/interface/utils/AutoBeJsonSchemaValidator.ts +38 -0
|
@@ -42,8 +42,7 @@ export async function orchestrateInterfaceSchemaReview(
|
|
|
42
42
|
.filter(
|
|
43
43
|
([k, v]) =>
|
|
44
44
|
AutoBeJsonSchemaValidator.isPreset(k) === false &&
|
|
45
|
-
AutoBeOpenApiTypeChecker.isObject(v)
|
|
46
|
-
Object.keys(v.properties).length !== 0,
|
|
45
|
+
AutoBeOpenApiTypeChecker.isObject(v),
|
|
47
46
|
)
|
|
48
47
|
.map(([k]) => k);
|
|
49
48
|
const x: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> = {};
|
|
@@ -52,6 +52,7 @@ export namespace AutoBeJsonSchemaValidator {
|
|
|
52
52
|
validateReferenceId(props);
|
|
53
53
|
validatePropertyNames(props);
|
|
54
54
|
validateNumericRanges(props);
|
|
55
|
+
validateEmptyProperties(props);
|
|
55
56
|
|
|
56
57
|
vo(props.typeName, props.schema);
|
|
57
58
|
AutoBeOpenApiTypeChecker.skim({
|
|
@@ -722,4 +723,41 @@ export namespace AutoBeJsonSchemaValidator {
|
|
|
722
723
|
},
|
|
723
724
|
});
|
|
724
725
|
};
|
|
726
|
+
|
|
727
|
+
const validateEmptyProperties = (props: IProps): void => {
|
|
728
|
+
if (AutoBeOpenApiTypeChecker.isObject(props.schema) === false) return;
|
|
729
|
+
if (Object.keys(props.schema.properties).length !== 0) return;
|
|
730
|
+
if (
|
|
731
|
+
isObjectType({
|
|
732
|
+
operations: props.operations,
|
|
733
|
+
typeName: props.typeName,
|
|
734
|
+
}) === false
|
|
735
|
+
)
|
|
736
|
+
return;
|
|
737
|
+
|
|
738
|
+
props.errors.push({
|
|
739
|
+
path: props.path,
|
|
740
|
+
expected: "At least 1 property in properties",
|
|
741
|
+
value: props.schema,
|
|
742
|
+
description: StringUtil.trim`
|
|
743
|
+
Schema ${JSON.stringify(props.typeName)} has zero properties but is used
|
|
744
|
+
as a request body or response body in API operations.
|
|
745
|
+
|
|
746
|
+
Empty properties will cause TypeScript compilation errors (TS2339) in the
|
|
747
|
+
downstream Realize stage because implementation code will try to access
|
|
748
|
+
properties that don't exist on the type.
|
|
749
|
+
|
|
750
|
+
You MUST define at least one property in the schema. Load the database
|
|
751
|
+
schema and add the appropriate properties based on the DTO type:
|
|
752
|
+
- ICreate: User-provided business fields (exclude id, timestamps, actor FKs)
|
|
753
|
+
- IUpdate: All mutable business fields (all optional)
|
|
754
|
+
- ISummary: Essential display fields for list views
|
|
755
|
+
- IEntity (root): All public fields including relations
|
|
756
|
+
- IRequest: Pagination and filter parameters
|
|
757
|
+
- IJoin/ILogin: Credentials and session context fields
|
|
758
|
+
|
|
759
|
+
Note that, this is not a recommendation, but an instruction you must follow.
|
|
760
|
+
`,
|
|
761
|
+
});
|
|
762
|
+
};
|
|
725
763
|
}
|