@autobe/agent 0.30.4 → 0.30.5
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/constants/AutoBeSystemPromptConstant.d.ts +5 -4
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/describe/image/orchestrateImageDescribeDraft.js +6 -6
- package/lib/describe/image/structures/IAutoBeImageDescribeDraftApplication.d.ts +12 -63
- package/lib/index.mjs +2918 -2842
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeExtractDecisions.js +8 -8
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +36 -37
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenarioReview.js +7 -7
- package/lib/orchestrate/analyze/orchestrateAnalyzeSectionCrossFileReview.js +55 -42
- package/lib/orchestrate/analyze/orchestrateAnalyzeSectionCrossFileReview.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeSectionReview.js +67 -54
- package/lib/orchestrate/analyze/orchestrateAnalyzeSectionReview.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWriteSection.js +24 -25
- package/lib/orchestrate/analyze/orchestrateAnalyzeWriteSection.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWriteSectionPatch.js +24 -25
- package/lib/orchestrate/analyze/orchestrateAnalyzeWriteSectionPatch.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWriteUnit.js +30 -31
- package/lib/orchestrate/analyze/orchestrateAnalyzeWriteUnit.js.map +1 -1
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeExtractDecisionsApplication.d.ts +14 -52
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +23 -96
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioReviewApplication.d.ts +12 -40
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeSectionCrossFileReviewApplication.d.ts +30 -88
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeSectionReviewApplication.d.ts +35 -94
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteSectionApplication.d.ts +23 -93
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteUnitApplication.d.ts +15 -88
- package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistory.js +76 -31
- package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistory.js.map +1 -1
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +7 -7
- package/lib/orchestrate/common/structures/IAnalysisSectionEntry.d.ts +2 -8
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.d.ts +8 -50
- package/lib/orchestrate/common/structures/IAutoBePreliminaryCollection.d.ts +1 -9
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetAnalysisSections.d.ts +4 -23
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetDatabaseSchemas.d.ts +3 -21
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.d.ts +4 -22
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.d.ts +4 -22
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPreviousAnalysisSections.d.ts +5 -17
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPreviousDatabaseSchemas.d.ts +7 -76
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPreviousInterfaceOperations.d.ts +6 -89
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPreviousInterfaceSchemas.d.ts +7 -93
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetRealizeCollectors.d.ts +3 -22
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetRealizeTransformers.d.ts +3 -22
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorization.js +114 -139
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorization.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointReview.js +90 -91
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointWrite.js +58 -59
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointWrite.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroup.js +58 -59
- package/lib/orchestrate/interface/orchestrateInterfaceGroup.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperation.js +108 -132
- package/lib/orchestrate/interface/orchestrateInterfaceOperation.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperationReview.js +72 -72
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisite.js +76 -77
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisite.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaCasting.js +130 -159
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaCasting.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaComplement.js +126 -155
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRefine.js +114 -142
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRefine.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +5 -5
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js +100 -129
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaWrite.js +120 -149
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaWrite.js.map +1 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationApplication.d.ts +10 -97
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.d.ts +14 -83
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointWriteApplication.d.ts +12 -90
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +12 -80
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +21 -116
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationReviewApplication.d.ts +24 -112
- package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.d.ts +11 -83
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +11 -76
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaCastingApplication.d.ts +18 -96
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaComplementApplication.d.ts +11 -76
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRefineApplication.d.ts +25 -107
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.d.ts +5 -31
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaReviewApplication.d.ts +6 -42
- package/lib/orchestrate/prisma/orchestratePrismaAuthorization.js +41 -41
- package/lib/orchestrate/prisma/orchestratePrismaAuthorizationReview.js +62 -63
- package/lib/orchestrate/prisma/orchestratePrismaAuthorizationReview.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +40 -41
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponentReview.js +60 -61
- package/lib/orchestrate/prisma/orchestratePrismaComponentReview.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +112 -116
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaGroup.js +48 -49
- package/lib/orchestrate/prisma/orchestratePrismaGroup.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaGroupReview.js +70 -71
- package/lib/orchestrate/prisma/orchestratePrismaGroupReview.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js +118 -122
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemaReview.js +126 -131
- package/lib/orchestrate/prisma/orchestratePrismaSchemaReview.js.map +1 -1
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseAuthorizationApplication.d.ts +22 -99
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseAuthorizationReviewApplication.d.ts +12 -109
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseComponentApplication.d.ts +14 -100
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseComponentReviewApplication.d.ts +15 -108
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseCorrectApplication.d.ts +24 -106
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseGroupApplication.d.ts +13 -76
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseGroupReviewApplication.d.ts +13 -111
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseSchemaApplication.d.ts +26 -97
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseSchemaReviewApplication.d.ts +16 -93
- package/lib/orchestrate/realize/histories/transformRealizeOperationCorrectHistory.js +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeOperationCorrectHistory.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeOperationWriteHistory.js +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeOperationWriteHistory.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeTransformerCorrectHistory.js +20 -2
- package/lib/orchestrate/realize/histories/transformRealizeTransformerCorrectHistory.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeTransformerWriteHistory.js +22 -2
- package/lib/orchestrate/realize/histories/transformRealizeTransformerWriteHistory.js.map +1 -1
- package/lib/orchestrate/realize/internal/orchestrateRealizeCorrectCasting.js +7 -7
- package/lib/orchestrate/realize/internal/orchestrateRealizeCorrectOverall.js +86 -6
- package/lib/orchestrate/realize/internal/orchestrateRealizeCorrectOverall.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +38 -38
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationWrite.js +34 -34
- package/lib/orchestrate/realize/orchestrateRealizeCollectorCorrectOverall.js +38 -38
- package/lib/orchestrate/realize/orchestrateRealizeCollectorPlan.js +54 -54
- package/lib/orchestrate/realize/orchestrateRealizeCollectorWrite.js +36 -36
- package/lib/orchestrate/realize/orchestrateRealizeOperationCorrectOverall.js +44 -44
- package/lib/orchestrate/realize/orchestrateRealizeOperationWrite.js +42 -42
- package/lib/orchestrate/realize/orchestrateRealizeTransformerCorrectCasting.js +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeTransformerCorrectCasting.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeTransformerCorrectOverall.js +46 -46
- package/lib/orchestrate/realize/orchestrateRealizeTransformerPlan.js +36 -36
- package/lib/orchestrate/realize/orchestrateRealizeTransformerWrite.js +44 -44
- package/lib/orchestrate/realize/programmers/AutoBeRealizeTransformerProgrammer.d.ts +18 -0
- package/lib/orchestrate/realize/programmers/AutoBeRealizeTransformerProgrammer.js +167 -8
- package/lib/orchestrate/realize/programmers/AutoBeRealizeTransformerProgrammer.js.map +1 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +17 -71
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationWriteApplication.d.ts +32 -92
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCollectorCorrectApplication.d.ts +32 -114
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCollectorPlanApplication.d.ts +29 -106
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCollectorWriteApplication.d.ts +38 -131
- package/lib/orchestrate/realize/structures/IAutoBeRealizeOperationCorrectApplication.d.ts +16 -71
- package/lib/orchestrate/realize/structures/IAutoBeRealizeOperationWriteApplication.d.ts +16 -73
- package/lib/orchestrate/realize/structures/IAutoBeRealizeTransformerCorrectApplication.d.ts +37 -155
- package/lib/orchestrate/realize/structures/IAutoBeRealizeTransformerPlanApplication.d.ts +25 -88
- package/lib/orchestrate/realize/structures/IAutoBeRealizeTransformerWriteApplication.d.ts +48 -181
- package/lib/orchestrate/realize/utils/generateTS2339Hints.d.ts +5 -3
- package/lib/orchestrate/realize/utils/generateTS2339Hints.js +37 -19
- package/lib/orchestrate/realize/utils/generateTS2339Hints.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestOperationWriteHistory.js +2 -2
- package/lib/orchestrate/test/orchestrateTestScenario.js +22 -22
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js +22 -22
- package/package.json +5 -5
- package/src/constants/AutoBeSystemPromptConstant.ts +5 -4
- package/src/describe/image/structures/IAutoBeImageDescribeDraftApplication.ts +12 -63
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeExtractDecisionsApplication.ts +14 -52
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +23 -96
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioReviewApplication.ts +12 -40
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeSectionCrossFileReviewApplication.ts +30 -88
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeSectionReviewApplication.ts +35 -94
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteSectionApplication.ts +23 -93
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteUnitApplication.ts +15 -88
- package/src/orchestrate/common/histories/transformPreviousAndLatestCorrectHistory.ts +92 -31
- package/src/orchestrate/common/structures/IAnalysisSectionEntry.ts +2 -8
- package/src/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.ts +8 -50
- package/src/orchestrate/common/structures/IAutoBePreliminaryCollection.ts +1 -9
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetAnalysisSections.ts +4 -23
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetDatabaseSchemas.ts +3 -21
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.ts +4 -22
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.ts +4 -22
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetPreviousAnalysisSections.ts +5 -17
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetPreviousDatabaseSchemas.ts +7 -76
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetPreviousInterfaceOperations.ts +6 -89
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetPreviousInterfaceSchemas.ts +7 -93
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetRealizeCollectors.ts +3 -22
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetRealizeTransformers.ts +3 -22
- package/src/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationApplication.ts +10 -97
- package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.ts +14 -83
- package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointWriteApplication.ts +12 -90
- package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +12 -80
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +21 -116
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationReviewApplication.ts +24 -112
- package/src/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.ts +11 -83
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +11 -76
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaCastingApplication.ts +18 -96
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaComplementApplication.ts +11 -76
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRefineApplication.ts +25 -107
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.ts +5 -31
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaReviewApplication.ts +6 -42
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseAuthorizationApplication.ts +22 -99
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseAuthorizationReviewApplication.ts +12 -109
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseComponentApplication.ts +14 -100
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseComponentReviewApplication.ts +15 -108
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseCorrectApplication.ts +24 -106
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseGroupApplication.ts +13 -76
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseGroupReviewApplication.ts +13 -111
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseSchemaApplication.ts +26 -97
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseSchemaReviewApplication.ts +16 -93
- package/src/orchestrate/realize/histories/transformRealizeTransformerCorrectHistory.ts +21 -1
- package/src/orchestrate/realize/histories/transformRealizeTransformerWriteHistory.ts +26 -4
- package/src/orchestrate/realize/internal/orchestrateRealizeCorrectOverall.ts +125 -9
- package/src/orchestrate/realize/orchestrateRealizeTransformerCorrectCasting.ts +1 -0
- package/src/orchestrate/realize/programmers/AutoBeRealizeTransformerProgrammer.ts +210 -7
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +17 -71
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationWriteApplication.ts +32 -92
- package/src/orchestrate/realize/structures/IAutoBeRealizeCollectorCorrectApplication.ts +32 -114
- package/src/orchestrate/realize/structures/IAutoBeRealizeCollectorPlanApplication.ts +29 -106
- package/src/orchestrate/realize/structures/IAutoBeRealizeCollectorWriteApplication.ts +38 -131
- package/src/orchestrate/realize/structures/IAutoBeRealizeOperationCorrectApplication.ts +16 -71
- package/src/orchestrate/realize/structures/IAutoBeRealizeOperationWriteApplication.ts +16 -73
- package/src/orchestrate/realize/structures/IAutoBeRealizeTransformerCorrectApplication.ts +37 -155
- package/src/orchestrate/realize/structures/IAutoBeRealizeTransformerPlanApplication.ts +25 -88
- package/src/orchestrate/realize/structures/IAutoBeRealizeTransformerWriteApplication.ts +48 -181
- package/src/orchestrate/realize/utils/generateTS2339Hints.ts +39 -19
|
@@ -4,10 +4,6 @@ export interface IAutoBeRealizeCollectorCorrectApplication {
|
|
|
4
4
|
/**
|
|
5
5
|
* Process collector correction task or preliminary data requests.
|
|
6
6
|
*
|
|
7
|
-
* Systematically analyzes and corrects TypeScript compilation errors in
|
|
8
|
-
* collector functions through three-phase workflow (think → draft → revise).
|
|
9
|
-
* Maintains business logic integrity while resolving all compilation issues.
|
|
10
|
-
*
|
|
11
7
|
* @param props Request containing either preliminary data request or complete
|
|
12
8
|
* task
|
|
13
9
|
*/
|
|
@@ -18,162 +14,84 @@ export declare namespace IAutoBeRealizeCollectorCorrectApplication {
|
|
|
18
14
|
/**
|
|
19
15
|
* Think before you act.
|
|
20
16
|
*
|
|
21
|
-
*
|
|
22
|
-
* your current state and explain your reasoning:
|
|
23
|
-
*
|
|
24
|
-
* For preliminary requests (getDatabaseSchemas):
|
|
25
|
-
*
|
|
26
|
-
* - What critical information is missing that you don't already have?
|
|
27
|
-
* - Why do you need it specifically right now?
|
|
28
|
-
* - Be brief - state the gap, don't list everything you have.
|
|
29
|
-
*
|
|
30
|
-
* For completion (complete):
|
|
17
|
+
* For preliminary requests: what critical information is missing?
|
|
31
18
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* - Why is it sufficient to complete?
|
|
35
|
-
* - Summarize - don't enumerate every single item.
|
|
36
|
-
*
|
|
37
|
-
* This reflection helps you avoid duplicate requests and premature
|
|
38
|
-
* completion.
|
|
19
|
+
* For completion: what did you acquire, what did you accomplish, why is it
|
|
20
|
+
* sufficient? Summarize — don't enumerate every single item.
|
|
39
21
|
*/
|
|
40
22
|
thinking: string;
|
|
41
23
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* Determines which action to perform: preliminary data retrieval
|
|
45
|
-
* (getDatabaseSchemas) or final error correction (complete). When
|
|
46
|
-
* preliminary returns empty array, that type is removed from the union,
|
|
47
|
-
* physically preventing repeated calls.
|
|
24
|
+
* Action to perform. Exhausted preliminary types are removed from the
|
|
25
|
+
* union, physically preventing repeated calls.
|
|
48
26
|
*/
|
|
49
27
|
request: IComplete | IAutoBePreliminaryGetDatabaseSchemas;
|
|
50
28
|
}
|
|
51
|
-
/**
|
|
52
|
-
* Request to correct collector implementation errors.
|
|
53
|
-
*
|
|
54
|
-
* Executes three-phase error correction to resolve TypeScript compilation
|
|
55
|
-
* issues in collector functions. Applies systematic fixes following think →
|
|
56
|
-
* draft → revise pattern to ensure error-free production code.
|
|
57
|
-
*/
|
|
29
|
+
/** Correct collector compilation errors via think/draft/revise. */
|
|
58
30
|
interface IComplete {
|
|
59
|
-
/**
|
|
60
|
-
* Type discriminator for the request.
|
|
61
|
-
*
|
|
62
|
-
* Determines which action to perform: preliminary data retrieval or actual
|
|
63
|
-
* task execution. Value "complete" indicates this is the final task
|
|
64
|
-
* execution request.
|
|
65
|
-
*/
|
|
31
|
+
/** Type discriminator for completion request. */
|
|
66
32
|
type: "complete";
|
|
67
33
|
/**
|
|
68
|
-
* Systematic error analysis
|
|
69
|
-
*
|
|
70
|
-
* MUST contain thorough analysis with these four mandatory sections:
|
|
34
|
+
* Systematic error analysis. MUST contain four sections:
|
|
71
35
|
*
|
|
72
|
-
* 1. Error Inventory
|
|
73
|
-
* 2. Root Cause Analysis
|
|
36
|
+
* 1. Error Inventory — categorize ALL compilation errors by root cause
|
|
37
|
+
* 2. Root Cause Analysis — identify WHY each error occurs (wrong field, type
|
|
74
38
|
* mismatch, etc.)
|
|
75
|
-
* 3. Schema Verification
|
|
39
|
+
* 3. Schema Verification — cross-check error-related fields against actual
|
|
76
40
|
* database schema
|
|
77
|
-
* 4. Correction Strategy
|
|
41
|
+
* 4. Correction Strategy — specific fix for each error (not workarounds)
|
|
78
42
|
*
|
|
79
43
|
* This forces you to understand the REAL problem (not guess) and plan
|
|
80
44
|
* surgical fixes that address root causes, not symptoms.
|
|
81
45
|
*/
|
|
82
46
|
think: string;
|
|
83
47
|
/**
|
|
84
|
-
* Field-by-field mapping verification
|
|
48
|
+
* Field-by-field mapping verification. For each database schema member:
|
|
85
49
|
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* For each database schema member, document:
|
|
91
|
-
*
|
|
92
|
-
* - `member`: Exact field/relation name from database schema
|
|
93
|
-
* - `kind`: Whether it's a scalar field, belongsTo, hasOne, or hasMany
|
|
94
|
-
* relation
|
|
95
|
-
* - `nullable`: Whether the field/relation is nullable (true/false for
|
|
96
|
-
* scalar/belongsTo, null for hasMany/hasOne)
|
|
50
|
+
* - `member`: Exact Prisma field/relation name — verify against schema
|
|
51
|
+
* - `kind`: scalar, belongsTo, hasOne, or hasMany
|
|
52
|
+
* - `nullable`: true/false for scalar/belongsTo, null for hasMany/hasOne
|
|
97
53
|
* - `how`: Current state + correction plan ("No change needed", "Fix:
|
|
98
|
-
* [problem] → [solution]"
|
|
99
|
-
*
|
|
100
|
-
* The `kind` property forces you to consciously identify whether each
|
|
101
|
-
* member is a scalar or relation BEFORE deciding how to fix it. This
|
|
102
|
-
* prevents common correction errors like treating belongsTo relations as
|
|
103
|
-
* scalar fields.
|
|
104
|
-
*
|
|
105
|
-
* The `nullable` property forces you to explicitly identify nullability
|
|
106
|
-
* constraints BEFORE deciding correction strategy. This prevents errors
|
|
107
|
-
* like assigning null to non-nullable fields or using null instead of
|
|
108
|
-
* undefined for optional belongsTo relations.
|
|
54
|
+
* [problem] → [solution]")
|
|
109
55
|
*
|
|
110
|
-
* Even fields without errors
|
|
111
|
-
* ensure complete review.
|
|
56
|
+
* Even fields without errors must be included with "No change needed" to
|
|
57
|
+
* ensure complete review. MUST include EVERY field/relation from the
|
|
58
|
+
* database schema.
|
|
112
59
|
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
* - Catches silent errors compiler didn't report
|
|
116
|
-
* - Ensures no fields accidentally omitted
|
|
117
|
-
* - Forces explicit classification (kind + nullable) before correction (how)
|
|
118
|
-
* - Prevents confusion between scalar fields and relations
|
|
119
|
-
* - Prevents null assignment errors through explicit nullability tracking
|
|
120
|
-
* - Documents correction decisions explicitly
|
|
121
|
-
* - Prevents regression in working fields
|
|
122
|
-
*
|
|
123
|
-
* The validator will cross-check this against the database schema to ensure
|
|
124
|
-
* nothing was overlooked.
|
|
60
|
+
* Missing even a single field will cause validation failure.
|
|
125
61
|
*/
|
|
126
62
|
mappings: AutoBeRealizeCollectorMapping[];
|
|
127
63
|
/**
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
* Complete corrected code that applies ALL fixes from the think phase
|
|
131
|
-
* strategy. EVERY error in think Section 1 inventory MUST be addressed.
|
|
132
|
-
* Implement:
|
|
64
|
+
* Complete corrected code. EVERY error from think Section 1 MUST be
|
|
65
|
+
* addressed. Implement:
|
|
133
66
|
*
|
|
134
67
|
* - Field name corrections (exact names from database schema)
|
|
135
68
|
* - Type fixes (proper CreateInput types, nullable handling)
|
|
136
69
|
* - Neighbor collector reuse (replace inline logic if collector exists)
|
|
137
70
|
* - Relationship fixes (connect/create syntax)
|
|
138
71
|
*
|
|
139
|
-
* Apply fixes surgically
|
|
72
|
+
* Apply fixes surgically — change ONLY what's broken, preserve working
|
|
140
73
|
* logic.
|
|
141
74
|
*/
|
|
142
75
|
draft: string;
|
|
143
|
-
/**
|
|
144
|
-
* Revision and finalization phase.
|
|
145
|
-
*
|
|
146
|
-
* Reviews the draft corrections and produces the final, error-free code
|
|
147
|
-
* that maintains all business requirements.
|
|
148
|
-
*/
|
|
76
|
+
/** Reviews draft corrections and produces final error-free code. */
|
|
149
77
|
revise: IReviseProps;
|
|
150
78
|
}
|
|
151
79
|
interface IReviseProps {
|
|
152
80
|
/**
|
|
153
|
-
*
|
|
81
|
+
* MUST systematically verify four checklists:
|
|
154
82
|
*
|
|
155
|
-
*
|
|
83
|
+
* 1. Error Resolution — confirm EVERY error from think Section 1 is fixed
|
|
84
|
+
* 2. Root Cause Fix — verify fixes address root causes (not workarounds/hacks)
|
|
85
|
+
* 3. System Rules — neighbor reuse, proper types, no fabricated fields
|
|
86
|
+
* 4. No Regression — confirm no NEW errors, business logic intact
|
|
156
87
|
*
|
|
157
|
-
* 1. Error Resolution - Confirm EVERY error from think Section 1 is fixed
|
|
158
|
-
* 2. Root Cause Fix - Verify fixes address root causes (not workarounds/hacks)
|
|
159
|
-
* 3. System Rules - Mandatory neighbor reuse, proper types, no fabricated
|
|
160
|
-
* fields
|
|
161
|
-
* 4. No Regression - Confirm no NEW errors introduced, business logic intact
|
|
162
|
-
*
|
|
163
|
-
* Identify any remaining issues with line numbers and root cause analysis.
|
|
164
88
|
* Catch Band-Aid fixes (type assertions, any casts) that hide real
|
|
165
89
|
* problems.
|
|
166
90
|
*/
|
|
167
91
|
review: string;
|
|
168
92
|
/**
|
|
169
|
-
* Final error-free
|
|
170
|
-
*
|
|
171
|
-
* Apply ALL remaining fixes identified in the review to produce
|
|
172
|
-
* compilation-ready code. If review found issues (workarounds, new errors),
|
|
173
|
-
* this MUST contain proper fixes.
|
|
174
|
-
*
|
|
175
|
-
* Return `null` ONLY if draft is already perfect and review found zero
|
|
176
|
-
* issues.
|
|
93
|
+
* Final error-free code with all corrections applied, or null if draft
|
|
94
|
+
* needs no changes.
|
|
177
95
|
*/
|
|
178
96
|
final: string | null;
|
|
179
97
|
}
|
|
@@ -4,27 +4,17 @@ import { IAutoBePreliminaryGetDatabaseSchemas } from "../../common/structures/IA
|
|
|
4
4
|
import { IAutoBePreliminaryGetInterfaceOperations } from "../../common/structures/IAutoBePreliminaryGetInterfaceOperations";
|
|
5
5
|
import { IAutoBePreliminaryGetInterfaceSchemas } from "../../common/structures/IAutoBePreliminaryGetInterfaceSchemas";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Plans whether a single DTO needs a collector. Sets databaseSchemaName to null
|
|
8
|
+
* for non-collectable DTOs.
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* The planning follows a structured RAG workflow: preliminary context gathering
|
|
14
|
-
* (database schemas, DTO schemas, Operations) → eligibility analysis → plan
|
|
15
|
-
* generation.
|
|
16
|
-
*
|
|
17
|
-
* **Key Decisions**: Not all DTOs require collectors. The agent must
|
|
18
|
-
* distinguish collectable DTOs (Create DTO + DB-backed + Direct mapping) from
|
|
19
|
-
* non-collectable DTOs (read-only DTOs, computed types) and set
|
|
20
|
-
* databaseSchemaName to null for non-collectable ones.
|
|
10
|
+
* **Key Decisions**: Not all DTOs require collectors. Distinguish collectable
|
|
11
|
+
* DTOs (Create DTO + DB-backed + direct mapping) from non-collectable DTOs
|
|
12
|
+
* (read-only DTOs, computed types).
|
|
21
13
|
*/
|
|
22
14
|
export interface IAutoBeRealizeCollectorPlanApplication {
|
|
23
15
|
/**
|
|
24
|
-
* Process collector planning task or preliminary data requests.
|
|
25
|
-
*
|
|
26
16
|
* Analyzes the given DTO type and generates a plan entry determining whether
|
|
27
|
-
* a collector is needed. Returns exactly ONE plan entry
|
|
17
|
+
* a collector is needed. Returns exactly ONE plan entry.
|
|
28
18
|
*
|
|
29
19
|
* @param props Request containing either preliminary data request or complete
|
|
30
20
|
* plan
|
|
@@ -36,127 +26,60 @@ export declare namespace IAutoBeRealizeCollectorPlanApplication {
|
|
|
36
26
|
/**
|
|
37
27
|
* Think before you act.
|
|
38
28
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* For preliminary requests:
|
|
29
|
+
* For preliminary requests: what schemas (database, DTO, operations) are
|
|
30
|
+
* missing?
|
|
43
31
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* - Be brief - state the gap, don't list everything you have.
|
|
47
|
-
*
|
|
48
|
-
* For completion:
|
|
49
|
-
*
|
|
50
|
-
* - Is this DTO collectable or non-collectable?
|
|
51
|
-
* - What database table does it map to (if collectable)?
|
|
52
|
-
* - Why is it non-collectable (if applicable)?
|
|
53
|
-
*
|
|
54
|
-
* This reflection helps you avoid duplicate requests and premature
|
|
55
|
-
* completion.
|
|
32
|
+
* For completion: is this DTO collectable or non-collectable? What database
|
|
33
|
+
* table does it map to (if collectable)?
|
|
56
34
|
*/
|
|
57
35
|
thinking: string;
|
|
58
36
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* Determines which action to perform:
|
|
62
|
-
*
|
|
63
|
-
* - "getDatabaseSchemas": Retrieve database table schemas for DB structure
|
|
64
|
-
* - "getAnalysisSections": Retrieve analysis sections for context
|
|
65
|
-
* - "getInterfaceOperations": Retrieve operation specifications
|
|
66
|
-
* - "getInterfaceSchemas": Retrieve DTO type definitions for API contracts
|
|
67
|
-
* - "complete": Generate final collector plan
|
|
68
|
-
*
|
|
69
|
-
* The preliminary types are removed from the union after their respective
|
|
70
|
-
* data has been provided, physically preventing repeated calls.
|
|
37
|
+
* Action to perform. Exhausted preliminary types are removed from the
|
|
38
|
+
* union, physically preventing repeated calls.
|
|
71
39
|
*/
|
|
72
40
|
request: IComplete | IAutoBePreliminaryGetDatabaseSchemas | IAutoBePreliminaryGetAnalysisSections | IAutoBePreliminaryGetInterfaceOperations | IAutoBePreliminaryGetInterfaceSchemas;
|
|
73
41
|
}
|
|
74
42
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* Generates a plan with exactly ONE entry for the given DTO, indicating
|
|
78
|
-
* whether it is collectable (has database schema name) or non-collectable
|
|
79
|
-
* (null).
|
|
43
|
+
* Generates exactly ONE plan entry indicating collectable (has DB schema
|
|
44
|
+
* name) or not (null).
|
|
80
45
|
*/
|
|
81
46
|
interface IComplete {
|
|
82
47
|
/** Type discriminator for completion request. */
|
|
83
48
|
type: "complete";
|
|
84
49
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* Must contain exactly ONE entry with:
|
|
88
|
-
*
|
|
89
|
-
* - DTO type name matching the given DTO
|
|
90
|
-
* - Chain of thought explaining the analysis
|
|
91
|
-
* - Database schema name if collectable, or null if not
|
|
92
|
-
*
|
|
93
|
-
* Use databaseSchemaName to distinguish:
|
|
94
|
-
*
|
|
95
|
-
* - Non-null: Collectable DTO, collector will be generated
|
|
96
|
-
* - Null: Non-collectable DTO, no collector needed
|
|
50
|
+
* Exactly ONE entry. databaseSchemaName non-null = collectable, null = no
|
|
51
|
+
* collector needed.
|
|
97
52
|
*/
|
|
98
53
|
plans: IPlan[];
|
|
99
54
|
}
|
|
100
|
-
/**
|
|
101
|
-
* Plan for a single DTO analysis result.
|
|
102
|
-
*
|
|
103
|
-
* Records the planning decision for one DTO from the operation request.
|
|
104
|
-
*/
|
|
55
|
+
/** Planning decision for one DTO. */
|
|
105
56
|
interface IPlan {
|
|
106
57
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* The TypeScript interface type from the operation request body.
|
|
110
|
-
*
|
|
111
|
-
* Example: "IShoppingSale.ICreate", "IShoppingCategory.ICreate"
|
|
58
|
+
* TypeScript interface type from the operation request body (e.g.,
|
|
59
|
+
* "IShoppingSale.ICreate").
|
|
112
60
|
*/
|
|
113
61
|
dtoTypeName: string;
|
|
114
62
|
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* Explains the agent's reasoning:
|
|
118
|
-
*
|
|
119
|
-
* - For collectable DTOs: Why a collector is needed, which database table it
|
|
120
|
-
* maps to
|
|
121
|
-
* - For non-collectable DTOs: Why no collector is needed (read-only DTO,
|
|
122
|
-
* computed type, etc.)
|
|
63
|
+
* Reasoning for this DTO's planning decision.
|
|
123
64
|
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
65
|
+
* Collectable: "Collects IShoppingSale.ICreate to shopping_sales with
|
|
66
|
+
* nested category".
|
|
126
67
|
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
68
|
+
* Non-collectable: "IShoppingSale is read-only response DTO, not for
|
|
69
|
+
* creation".
|
|
129
70
|
*/
|
|
130
71
|
thinking: string;
|
|
131
72
|
/**
|
|
132
|
-
* Database
|
|
133
|
-
*
|
|
134
|
-
* - **Non-null**: The database table name this DTO maps to. A collector will
|
|
135
|
-
* be generated for this DTO.
|
|
136
|
-
* - **Null**: This DTO is non-collectable (read-only DTO, computed type). No
|
|
137
|
-
* collector will be generated.
|
|
138
|
-
*
|
|
139
|
-
* Examples:
|
|
140
|
-
*
|
|
141
|
-
* - (collectable): "shopping_sales", "shopping_categories"
|
|
142
|
-
* - (non-collectable): null
|
|
73
|
+
* Database table name if collectable (e.g., "shopping_sales"), null if
|
|
74
|
+
* non-collectable (read-only DTO, computed type).
|
|
143
75
|
*/
|
|
144
76
|
databaseSchemaName: string | null;
|
|
145
77
|
/**
|
|
146
78
|
* Referenced entities from path parameters or auth context.
|
|
147
79
|
*
|
|
148
|
-
* Each reference contains
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* - `source`: Origin of reference
|
|
152
|
-
*
|
|
153
|
-
* - "from path parameter {paramName}"
|
|
154
|
-
* - "from authorized actor"
|
|
155
|
-
* - "from authorized session"
|
|
156
|
-
*
|
|
157
|
-
* See `AutoBeRealizeCollectorReference` for details.
|
|
158
|
-
*
|
|
159
|
-
* Empty array means the Create DTO contains all necessary references.
|
|
80
|
+
* Each reference contains `databaseSchemaName` and `source` (e.g., "from
|
|
81
|
+
* path parameter {id}", "from authorized actor"). Empty array means the
|
|
82
|
+
* Create DTO contains all necessary references.
|
|
160
83
|
*/
|
|
161
84
|
references: AutoBeRealizeCollectorReference[];
|
|
162
85
|
}
|
|
@@ -1,27 +1,13 @@
|
|
|
1
1
|
import { AutoBeRealizeCollectorMapping } from "@autobe/interface";
|
|
2
2
|
import { IAutoBePreliminaryGetDatabaseSchemas } from "../../common/structures/IAutoBePreliminaryGetDatabaseSchemas";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Guides the AI agent through creating reusable collector modules that prepare
|
|
7
|
-
* database input data from API request DTOs (API → DB). Each collector handles
|
|
8
|
-
* complex nested relationships, UUID generation, and proper Prisma
|
|
9
|
-
* connect/create syntax.
|
|
10
|
-
*
|
|
11
|
-
* The generation follows a structured RAG workflow: preliminary context
|
|
12
|
-
* gathering (database schemas only) → implementation planning → code generation
|
|
13
|
-
* → review and refinement. All necessary DTO type information is obtained
|
|
14
|
-
* transitively from the DTO type names provided in the plan
|
|
15
|
-
* (AutoBeRealizeCollectorPlan).
|
|
4
|
+
* Generates collector functions that convert API request DTOs to Prisma
|
|
5
|
+
* database inputs (API → DB) via plan/draft/revise workflow.
|
|
16
6
|
*/
|
|
17
7
|
export interface IAutoBeRealizeCollectorWriteApplication {
|
|
18
8
|
/**
|
|
19
9
|
* Process collector generation task or preliminary data requests.
|
|
20
10
|
*
|
|
21
|
-
* Generates complete collector module through three-phase workflow (plan →
|
|
22
|
-
* draft → revise). Ensures type safety, proper database input types, and
|
|
23
|
-
* correct relationship handling.
|
|
24
|
-
*
|
|
25
11
|
* @param props Request containing either preliminary data request or complete
|
|
26
12
|
* task
|
|
27
13
|
*/
|
|
@@ -32,164 +18,85 @@ export declare namespace IAutoBeRealizeCollectorWriteApplication {
|
|
|
32
18
|
/**
|
|
33
19
|
* Think before you act.
|
|
34
20
|
*
|
|
35
|
-
*
|
|
36
|
-
* your current state and explain your reasoning:
|
|
37
|
-
*
|
|
38
|
-
* For preliminary requests:
|
|
39
|
-
*
|
|
40
|
-
* - What database schemas are missing that you need?
|
|
41
|
-
* - Why do you need them for collector generation?
|
|
42
|
-
* - Be brief - state the gap, don't list everything you have.
|
|
43
|
-
*
|
|
44
|
-
* For completion:
|
|
21
|
+
* For preliminary requests: what database schemas are missing and why?
|
|
45
22
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* - Summarize - don't enumerate every field mapping.
|
|
23
|
+
* For completion: what schemas did you acquire, what patterns did you
|
|
24
|
+
* implement, and why is it sufficient? Summarize — don't enumerate every
|
|
25
|
+
* field.
|
|
50
26
|
*
|
|
51
|
-
* Note: All
|
|
52
|
-
*
|
|
53
|
-
* schemas.
|
|
54
|
-
*
|
|
55
|
-
* This reflection helps you avoid duplicate requests and premature
|
|
56
|
-
* completion.
|
|
27
|
+
* Note: All DTO type information is available transitively from the plan's
|
|
28
|
+
* DTO type names. You only need to request database schemas.
|
|
57
29
|
*/
|
|
58
30
|
thinking: string;
|
|
59
31
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* Determines which action to perform:
|
|
63
|
-
*
|
|
64
|
-
* - "getDatabaseSchemas": Retrieve database table schemas for DB structure
|
|
65
|
-
* - "complete": Generate final collector implementation
|
|
66
|
-
*
|
|
67
|
-
* All necessary DTO type information is obtained transitively from the DTO
|
|
68
|
-
* type names provided in the plan (AutoBeRealizeCollectorPlan). Each DTO
|
|
69
|
-
* type name allows the system to recursively fetch all referenced types,
|
|
70
|
-
* providing complete type information without requiring explicit schema
|
|
71
|
-
* requests.
|
|
72
|
-
*
|
|
73
|
-
* The preliminary types are removed from the union after their respective
|
|
74
|
-
* data has been provided, physically preventing repeated calls.
|
|
32
|
+
* Action to perform. Exhausted preliminary types are removed from the
|
|
33
|
+
* union, physically preventing repeated calls.
|
|
75
34
|
*/
|
|
76
35
|
request: IComplete | IAutoBePreliminaryGetDatabaseSchemas;
|
|
77
36
|
}
|
|
78
|
-
/**
|
|
79
|
-
* Request to generate collector module implementation.
|
|
80
|
-
*
|
|
81
|
-
* Executes three-phase generation to create complete collector with:
|
|
82
|
-
*
|
|
83
|
-
* - Collect() function: Converts DTO to database input
|
|
84
|
-
* - Proper handling of nested relationships
|
|
85
|
-
* - UUID generation for new records
|
|
86
|
-
* - Type-safe Prisma create/connect syntax
|
|
87
|
-
*
|
|
88
|
-
* Follows plan → draft → revise pattern to ensure type safety and correct
|
|
89
|
-
* relationship handling.
|
|
90
|
-
*/
|
|
37
|
+
/** Generate collector module via plan/draft/revise. */
|
|
91
38
|
interface IComplete {
|
|
92
39
|
/** Type discriminator for completion request. */
|
|
93
40
|
type: "complete";
|
|
94
41
|
/**
|
|
95
|
-
* Collector implementation plan
|
|
96
|
-
*
|
|
97
|
-
* MUST contain thorough analysis with these four mandatory sections:
|
|
42
|
+
* Collector implementation plan. MUST contain four sections:
|
|
98
43
|
*
|
|
99
|
-
* 1. Database Schema Field Inventory
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* 4. Edge Cases and Special Handling - Nullable, arrays, conditionals
|
|
44
|
+
* 1. Database Schema Field Inventory — ALL fields with exact names from schema
|
|
45
|
+
* 2. DTO Property Inventory — ALL properties with types
|
|
46
|
+
* 3. Field-by-Field Mapping Strategy — explicit mapping for every field
|
|
47
|
+
* 4. Edge Cases and Special Handling — nullable, arrays, conditionals
|
|
104
48
|
*
|
|
105
49
|
* This forces you to READ the actual schema (not imagine it) and creates an
|
|
106
50
|
* explicit specification that the draft must implement.
|
|
107
51
|
*/
|
|
108
52
|
plan: string;
|
|
109
53
|
/**
|
|
110
|
-
* Field-by-field mapping
|
|
54
|
+
* Field-by-field mapping for complete database coverage.
|
|
111
55
|
*
|
|
112
|
-
* MUST include EVERY field and relation from the database schema
|
|
56
|
+
* MUST include EVERY field and relation from the database schema — no
|
|
113
57
|
* exceptions. Each mapping specifies:
|
|
114
58
|
*
|
|
115
|
-
* - `member`: Exact field/relation name from
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
* - `nullable`:
|
|
119
|
-
* scalar/belongsTo, null for hasMany/hasOne)
|
|
59
|
+
* - `member`: Exact Prisma field/relation name — read from schema, NOT from
|
|
60
|
+
* DTO property names or FK column names
|
|
61
|
+
* - `kind`: scalar, belongsTo, hasOne, or hasMany
|
|
62
|
+
* - `nullable`: true/false for scalar/belongsTo, null for hasMany/hasOne
|
|
120
63
|
* - `how`: How to obtain/generate the value for that field
|
|
121
64
|
*
|
|
122
|
-
* The `kind` property forces explicit classification
|
|
123
|
-
*
|
|
124
|
-
* belongsTo relations as scalar fields.
|
|
125
|
-
*
|
|
126
|
-
* The `nullable` property forces explicit identification of nullability
|
|
127
|
-
* constraints BEFORE deciding handling strategy, preventing errors like
|
|
128
|
-
* assigning null to non-nullable fields or using null instead of undefined
|
|
129
|
-
* for optional relations.
|
|
130
|
-
*
|
|
131
|
-
* Missing even a single field will cause validation failure and trigger
|
|
132
|
-
* regeneration.
|
|
65
|
+
* The `kind` property forces explicit classification BEFORE deciding how to
|
|
66
|
+
* handle it, preventing errors like treating belongsTo as scalar.
|
|
133
67
|
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* - Prevents field omissions through systematic coverage
|
|
137
|
-
* - Forces explicit decision-making for each field (kind + nullable + how)
|
|
138
|
-
* - Prevents confusion between scalar fields and relations
|
|
139
|
-
* - Prevents null assignment errors through explicit nullability tracking
|
|
140
|
-
* - Enables validation before code generation
|
|
141
|
-
* - Creates clear documentation of field handling strategy
|
|
142
|
-
*
|
|
143
|
-
* The validator will cross-check this list against the actual database
|
|
144
|
-
* schema and reject incomplete mappings.
|
|
68
|
+
* Missing even a single field will cause validation failure.
|
|
145
69
|
*/
|
|
146
70
|
mappings: AutoBeRealizeCollectorMapping[];
|
|
147
71
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* Complete implementation that strictly follows the plan's mapping table.
|
|
151
|
-
* EVERY field in the plan's Section 3 mapping strategy MUST appear in this
|
|
152
|
-
* draft. Implement:
|
|
72
|
+
* Complete implementation following plan's mapping table. EVERY field from
|
|
73
|
+
* plan Section 3 MUST appear. Implement:
|
|
153
74
|
*
|
|
154
75
|
* - Namespace with collect() function
|
|
155
|
-
* - All field mappings
|
|
76
|
+
* - All field mappings (direct, connect, nested create)
|
|
156
77
|
* - Neighbor collector reuse (NEVER inline when collector exists)
|
|
157
78
|
* - UUID generation with v4(), proper Prisma CreateInput types
|
|
158
79
|
*/
|
|
159
80
|
draft: string;
|
|
160
|
-
/**
|
|
161
|
-
* Revision and finalization phase.
|
|
162
|
-
*
|
|
163
|
-
* Reviews the draft implementation and produces the final code with all
|
|
164
|
-
* improvements and corrections applied.
|
|
165
|
-
*/
|
|
81
|
+
/** Reviews draft and produces final code. */
|
|
166
82
|
revise: IReviseProps;
|
|
167
83
|
}
|
|
168
84
|
interface IReviseProps {
|
|
169
85
|
/**
|
|
170
|
-
*
|
|
86
|
+
* MUST systematically verify four checklists:
|
|
171
87
|
*
|
|
172
|
-
*
|
|
88
|
+
* 1. Schema Fidelity — cross-check EVERY field name against plan Section 1
|
|
89
|
+
* 2. Plan Adherence — verify EVERY mapping from Section 3 is implemented
|
|
90
|
+
* 3. System Rules — neighbor reuse, props structure, satisfies type
|
|
91
|
+
* 4. Type Safety — compilation check, nullable handling, async/await
|
|
173
92
|
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* 2. Plan Adherence - Verify EVERY mapping from plan Section 3 is implemented
|
|
177
|
-
* 3. System Rules - Mandatory neighbor reuse, props structure, satisfies type
|
|
178
|
-
* 4. Type Safety - Compilation check, nullable handling, async/await
|
|
179
|
-
*
|
|
180
|
-
* Identify specific issues with line numbers and provide clear reasoning.
|
|
181
|
-
* This catches hallucinated fields, missing mappings, and rule violations.
|
|
93
|
+
* Identify issues with line numbers. This catches hallucinated fields,
|
|
94
|
+
* missing mappings, and rule violations.
|
|
182
95
|
*/
|
|
183
96
|
review: string;
|
|
184
97
|
/**
|
|
185
|
-
* Final collector code with all review improvements applied
|
|
186
|
-
*
|
|
187
|
-
* Apply ALL fixes identified in the review to produce production-ready
|
|
188
|
-
* code. If review found issues, this MUST contain the corrected
|
|
189
|
-
* implementation.
|
|
190
|
-
*
|
|
191
|
-
* Return `null` ONLY if the draft is already perfect and review found zero
|
|
192
|
-
* issues.
|
|
98
|
+
* Final collector code with all review improvements applied, or null if
|
|
99
|
+
* draft needs no changes.
|
|
193
100
|
*/
|
|
194
101
|
final: string | null;
|
|
195
102
|
}
|