@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.
Files changed (210) hide show
  1. package/lib/constants/AutoBeSystemPromptConstant.d.ts +5 -4
  2. package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
  3. package/lib/describe/image/orchestrateImageDescribeDraft.js +6 -6
  4. package/lib/describe/image/structures/IAutoBeImageDescribeDraftApplication.d.ts +12 -63
  5. package/lib/index.mjs +2918 -2842
  6. package/lib/index.mjs.map +1 -1
  7. package/lib/orchestrate/analyze/orchestrateAnalyzeExtractDecisions.js +8 -8
  8. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +36 -37
  9. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  10. package/lib/orchestrate/analyze/orchestrateAnalyzeScenarioReview.js +7 -7
  11. package/lib/orchestrate/analyze/orchestrateAnalyzeSectionCrossFileReview.js +55 -42
  12. package/lib/orchestrate/analyze/orchestrateAnalyzeSectionCrossFileReview.js.map +1 -1
  13. package/lib/orchestrate/analyze/orchestrateAnalyzeSectionReview.js +67 -54
  14. package/lib/orchestrate/analyze/orchestrateAnalyzeSectionReview.js.map +1 -1
  15. package/lib/orchestrate/analyze/orchestrateAnalyzeWriteSection.js +24 -25
  16. package/lib/orchestrate/analyze/orchestrateAnalyzeWriteSection.js.map +1 -1
  17. package/lib/orchestrate/analyze/orchestrateAnalyzeWriteSectionPatch.js +24 -25
  18. package/lib/orchestrate/analyze/orchestrateAnalyzeWriteSectionPatch.js.map +1 -1
  19. package/lib/orchestrate/analyze/orchestrateAnalyzeWriteUnit.js +30 -31
  20. package/lib/orchestrate/analyze/orchestrateAnalyzeWriteUnit.js.map +1 -1
  21. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeExtractDecisionsApplication.d.ts +14 -52
  22. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +23 -96
  23. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioReviewApplication.d.ts +12 -40
  24. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeSectionCrossFileReviewApplication.d.ts +30 -88
  25. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeSectionReviewApplication.d.ts +35 -94
  26. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteSectionApplication.d.ts +23 -93
  27. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteUnitApplication.d.ts +15 -88
  28. package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistory.js +76 -31
  29. package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistory.js.map +1 -1
  30. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +7 -7
  31. package/lib/orchestrate/common/structures/IAnalysisSectionEntry.d.ts +2 -8
  32. package/lib/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.d.ts +8 -50
  33. package/lib/orchestrate/common/structures/IAutoBePreliminaryCollection.d.ts +1 -9
  34. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetAnalysisSections.d.ts +4 -23
  35. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetDatabaseSchemas.d.ts +3 -21
  36. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.d.ts +4 -22
  37. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.d.ts +4 -22
  38. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPreviousAnalysisSections.d.ts +5 -17
  39. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPreviousDatabaseSchemas.d.ts +7 -76
  40. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPreviousInterfaceOperations.d.ts +6 -89
  41. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPreviousInterfaceSchemas.d.ts +7 -93
  42. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetRealizeCollectors.d.ts +3 -22
  43. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetRealizeTransformers.d.ts +3 -22
  44. package/lib/orchestrate/interface/orchestrateInterfaceAuthorization.js +114 -139
  45. package/lib/orchestrate/interface/orchestrateInterfaceAuthorization.js.map +1 -1
  46. package/lib/orchestrate/interface/orchestrateInterfaceEndpointReview.js +90 -91
  47. package/lib/orchestrate/interface/orchestrateInterfaceEndpointReview.js.map +1 -1
  48. package/lib/orchestrate/interface/orchestrateInterfaceEndpointWrite.js +58 -59
  49. package/lib/orchestrate/interface/orchestrateInterfaceEndpointWrite.js.map +1 -1
  50. package/lib/orchestrate/interface/orchestrateInterfaceGroup.js +58 -59
  51. package/lib/orchestrate/interface/orchestrateInterfaceGroup.js.map +1 -1
  52. package/lib/orchestrate/interface/orchestrateInterfaceOperation.js +108 -132
  53. package/lib/orchestrate/interface/orchestrateInterfaceOperation.js.map +1 -1
  54. package/lib/orchestrate/interface/orchestrateInterfaceOperationReview.js +72 -72
  55. package/lib/orchestrate/interface/orchestrateInterfacePrerequisite.js +76 -77
  56. package/lib/orchestrate/interface/orchestrateInterfacePrerequisite.js.map +1 -1
  57. package/lib/orchestrate/interface/orchestrateInterfaceSchemaCasting.js +130 -159
  58. package/lib/orchestrate/interface/orchestrateInterfaceSchemaCasting.js.map +1 -1
  59. package/lib/orchestrate/interface/orchestrateInterfaceSchemaComplement.js +126 -155
  60. package/lib/orchestrate/interface/orchestrateInterfaceSchemaComplement.js.map +1 -1
  61. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRefine.js +114 -142
  62. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRefine.js.map +1 -1
  63. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +5 -5
  64. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js +100 -129
  65. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -1
  66. package/lib/orchestrate/interface/orchestrateInterfaceSchemaWrite.js +120 -149
  67. package/lib/orchestrate/interface/orchestrateInterfaceSchemaWrite.js.map +1 -1
  68. package/lib/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationApplication.d.ts +10 -97
  69. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.d.ts +14 -83
  70. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointWriteApplication.d.ts +12 -90
  71. package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +12 -80
  72. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +21 -116
  73. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationReviewApplication.d.ts +24 -112
  74. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.d.ts +11 -83
  75. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +11 -76
  76. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaCastingApplication.d.ts +18 -96
  77. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaComplementApplication.d.ts +11 -76
  78. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRefineApplication.d.ts +25 -107
  79. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.d.ts +5 -31
  80. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaReviewApplication.d.ts +6 -42
  81. package/lib/orchestrate/prisma/orchestratePrismaAuthorization.js +41 -41
  82. package/lib/orchestrate/prisma/orchestratePrismaAuthorizationReview.js +62 -63
  83. package/lib/orchestrate/prisma/orchestratePrismaAuthorizationReview.js.map +1 -1
  84. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +40 -41
  85. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  86. package/lib/orchestrate/prisma/orchestratePrismaComponentReview.js +60 -61
  87. package/lib/orchestrate/prisma/orchestratePrismaComponentReview.js.map +1 -1
  88. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +112 -116
  89. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  90. package/lib/orchestrate/prisma/orchestratePrismaGroup.js +48 -49
  91. package/lib/orchestrate/prisma/orchestratePrismaGroup.js.map +1 -1
  92. package/lib/orchestrate/prisma/orchestratePrismaGroupReview.js +70 -71
  93. package/lib/orchestrate/prisma/orchestratePrismaGroupReview.js.map +1 -1
  94. package/lib/orchestrate/prisma/orchestratePrismaSchema.js +118 -122
  95. package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -1
  96. package/lib/orchestrate/prisma/orchestratePrismaSchemaReview.js +126 -131
  97. package/lib/orchestrate/prisma/orchestratePrismaSchemaReview.js.map +1 -1
  98. package/lib/orchestrate/prisma/structures/IAutoBeDatabaseAuthorizationApplication.d.ts +22 -99
  99. package/lib/orchestrate/prisma/structures/IAutoBeDatabaseAuthorizationReviewApplication.d.ts +12 -109
  100. package/lib/orchestrate/prisma/structures/IAutoBeDatabaseComponentApplication.d.ts +14 -100
  101. package/lib/orchestrate/prisma/structures/IAutoBeDatabaseComponentReviewApplication.d.ts +15 -108
  102. package/lib/orchestrate/prisma/structures/IAutoBeDatabaseCorrectApplication.d.ts +24 -106
  103. package/lib/orchestrate/prisma/structures/IAutoBeDatabaseGroupApplication.d.ts +13 -76
  104. package/lib/orchestrate/prisma/structures/IAutoBeDatabaseGroupReviewApplication.d.ts +13 -111
  105. package/lib/orchestrate/prisma/structures/IAutoBeDatabaseSchemaApplication.d.ts +26 -97
  106. package/lib/orchestrate/prisma/structures/IAutoBeDatabaseSchemaReviewApplication.d.ts +16 -93
  107. package/lib/orchestrate/realize/histories/transformRealizeOperationCorrectHistory.js +1 -1
  108. package/lib/orchestrate/realize/histories/transformRealizeOperationCorrectHistory.js.map +1 -1
  109. package/lib/orchestrate/realize/histories/transformRealizeOperationWriteHistory.js +1 -1
  110. package/lib/orchestrate/realize/histories/transformRealizeOperationWriteHistory.js.map +1 -1
  111. package/lib/orchestrate/realize/histories/transformRealizeTransformerCorrectHistory.js +20 -2
  112. package/lib/orchestrate/realize/histories/transformRealizeTransformerCorrectHistory.js.map +1 -1
  113. package/lib/orchestrate/realize/histories/transformRealizeTransformerWriteHistory.js +22 -2
  114. package/lib/orchestrate/realize/histories/transformRealizeTransformerWriteHistory.js.map +1 -1
  115. package/lib/orchestrate/realize/internal/orchestrateRealizeCorrectCasting.js +7 -7
  116. package/lib/orchestrate/realize/internal/orchestrateRealizeCorrectOverall.js +86 -6
  117. package/lib/orchestrate/realize/internal/orchestrateRealizeCorrectOverall.js.map +1 -1
  118. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +38 -38
  119. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationWrite.js +34 -34
  120. package/lib/orchestrate/realize/orchestrateRealizeCollectorCorrectOverall.js +38 -38
  121. package/lib/orchestrate/realize/orchestrateRealizeCollectorPlan.js +54 -54
  122. package/lib/orchestrate/realize/orchestrateRealizeCollectorWrite.js +36 -36
  123. package/lib/orchestrate/realize/orchestrateRealizeOperationCorrectOverall.js +44 -44
  124. package/lib/orchestrate/realize/orchestrateRealizeOperationWrite.js +42 -42
  125. package/lib/orchestrate/realize/orchestrateRealizeTransformerCorrectCasting.js +1 -0
  126. package/lib/orchestrate/realize/orchestrateRealizeTransformerCorrectCasting.js.map +1 -1
  127. package/lib/orchestrate/realize/orchestrateRealizeTransformerCorrectOverall.js +46 -46
  128. package/lib/orchestrate/realize/orchestrateRealizeTransformerPlan.js +36 -36
  129. package/lib/orchestrate/realize/orchestrateRealizeTransformerWrite.js +44 -44
  130. package/lib/orchestrate/realize/programmers/AutoBeRealizeTransformerProgrammer.d.ts +18 -0
  131. package/lib/orchestrate/realize/programmers/AutoBeRealizeTransformerProgrammer.js +167 -8
  132. package/lib/orchestrate/realize/programmers/AutoBeRealizeTransformerProgrammer.js.map +1 -1
  133. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +17 -71
  134. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationWriteApplication.d.ts +32 -92
  135. package/lib/orchestrate/realize/structures/IAutoBeRealizeCollectorCorrectApplication.d.ts +32 -114
  136. package/lib/orchestrate/realize/structures/IAutoBeRealizeCollectorPlanApplication.d.ts +29 -106
  137. package/lib/orchestrate/realize/structures/IAutoBeRealizeCollectorWriteApplication.d.ts +38 -131
  138. package/lib/orchestrate/realize/structures/IAutoBeRealizeOperationCorrectApplication.d.ts +16 -71
  139. package/lib/orchestrate/realize/structures/IAutoBeRealizeOperationWriteApplication.d.ts +16 -73
  140. package/lib/orchestrate/realize/structures/IAutoBeRealizeTransformerCorrectApplication.d.ts +37 -155
  141. package/lib/orchestrate/realize/structures/IAutoBeRealizeTransformerPlanApplication.d.ts +25 -88
  142. package/lib/orchestrate/realize/structures/IAutoBeRealizeTransformerWriteApplication.d.ts +48 -181
  143. package/lib/orchestrate/realize/utils/generateTS2339Hints.d.ts +5 -3
  144. package/lib/orchestrate/realize/utils/generateTS2339Hints.js +37 -19
  145. package/lib/orchestrate/realize/utils/generateTS2339Hints.js.map +1 -1
  146. package/lib/orchestrate/test/histories/transformTestOperationWriteHistory.js +2 -2
  147. package/lib/orchestrate/test/orchestrateTestScenario.js +22 -22
  148. package/lib/orchestrate/test/orchestrateTestScenarioReview.js +22 -22
  149. package/package.json +5 -5
  150. package/src/constants/AutoBeSystemPromptConstant.ts +5 -4
  151. package/src/describe/image/structures/IAutoBeImageDescribeDraftApplication.ts +12 -63
  152. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeExtractDecisionsApplication.ts +14 -52
  153. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +23 -96
  154. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioReviewApplication.ts +12 -40
  155. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeSectionCrossFileReviewApplication.ts +30 -88
  156. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeSectionReviewApplication.ts +35 -94
  157. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteSectionApplication.ts +23 -93
  158. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteUnitApplication.ts +15 -88
  159. package/src/orchestrate/common/histories/transformPreviousAndLatestCorrectHistory.ts +92 -31
  160. package/src/orchestrate/common/structures/IAnalysisSectionEntry.ts +2 -8
  161. package/src/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.ts +8 -50
  162. package/src/orchestrate/common/structures/IAutoBePreliminaryCollection.ts +1 -9
  163. package/src/orchestrate/common/structures/IAutoBePreliminaryGetAnalysisSections.ts +4 -23
  164. package/src/orchestrate/common/structures/IAutoBePreliminaryGetDatabaseSchemas.ts +3 -21
  165. package/src/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.ts +4 -22
  166. package/src/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.ts +4 -22
  167. package/src/orchestrate/common/structures/IAutoBePreliminaryGetPreviousAnalysisSections.ts +5 -17
  168. package/src/orchestrate/common/structures/IAutoBePreliminaryGetPreviousDatabaseSchemas.ts +7 -76
  169. package/src/orchestrate/common/structures/IAutoBePreliminaryGetPreviousInterfaceOperations.ts +6 -89
  170. package/src/orchestrate/common/structures/IAutoBePreliminaryGetPreviousInterfaceSchemas.ts +7 -93
  171. package/src/orchestrate/common/structures/IAutoBePreliminaryGetRealizeCollectors.ts +3 -22
  172. package/src/orchestrate/common/structures/IAutoBePreliminaryGetRealizeTransformers.ts +3 -22
  173. package/src/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationApplication.ts +10 -97
  174. package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.ts +14 -83
  175. package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointWriteApplication.ts +12 -90
  176. package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +12 -80
  177. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +21 -116
  178. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationReviewApplication.ts +24 -112
  179. package/src/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.ts +11 -83
  180. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +11 -76
  181. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaCastingApplication.ts +18 -96
  182. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaComplementApplication.ts +11 -76
  183. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRefineApplication.ts +25 -107
  184. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.ts +5 -31
  185. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaReviewApplication.ts +6 -42
  186. package/src/orchestrate/prisma/structures/IAutoBeDatabaseAuthorizationApplication.ts +22 -99
  187. package/src/orchestrate/prisma/structures/IAutoBeDatabaseAuthorizationReviewApplication.ts +12 -109
  188. package/src/orchestrate/prisma/structures/IAutoBeDatabaseComponentApplication.ts +14 -100
  189. package/src/orchestrate/prisma/structures/IAutoBeDatabaseComponentReviewApplication.ts +15 -108
  190. package/src/orchestrate/prisma/structures/IAutoBeDatabaseCorrectApplication.ts +24 -106
  191. package/src/orchestrate/prisma/structures/IAutoBeDatabaseGroupApplication.ts +13 -76
  192. package/src/orchestrate/prisma/structures/IAutoBeDatabaseGroupReviewApplication.ts +13 -111
  193. package/src/orchestrate/prisma/structures/IAutoBeDatabaseSchemaApplication.ts +26 -97
  194. package/src/orchestrate/prisma/structures/IAutoBeDatabaseSchemaReviewApplication.ts +16 -93
  195. package/src/orchestrate/realize/histories/transformRealizeTransformerCorrectHistory.ts +21 -1
  196. package/src/orchestrate/realize/histories/transformRealizeTransformerWriteHistory.ts +26 -4
  197. package/src/orchestrate/realize/internal/orchestrateRealizeCorrectOverall.ts +125 -9
  198. package/src/orchestrate/realize/orchestrateRealizeTransformerCorrectCasting.ts +1 -0
  199. package/src/orchestrate/realize/programmers/AutoBeRealizeTransformerProgrammer.ts +210 -7
  200. package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +17 -71
  201. package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationWriteApplication.ts +32 -92
  202. package/src/orchestrate/realize/structures/IAutoBeRealizeCollectorCorrectApplication.ts +32 -114
  203. package/src/orchestrate/realize/structures/IAutoBeRealizeCollectorPlanApplication.ts +29 -106
  204. package/src/orchestrate/realize/structures/IAutoBeRealizeCollectorWriteApplication.ts +38 -131
  205. package/src/orchestrate/realize/structures/IAutoBeRealizeOperationCorrectApplication.ts +16 -71
  206. package/src/orchestrate/realize/structures/IAutoBeRealizeOperationWriteApplication.ts +16 -73
  207. package/src/orchestrate/realize/structures/IAutoBeRealizeTransformerCorrectApplication.ts +37 -155
  208. package/src/orchestrate/realize/structures/IAutoBeRealizeTransformerPlanApplication.ts +25 -88
  209. package/src/orchestrate/realize/structures/IAutoBeRealizeTransformerWriteApplication.ts +48 -181
  210. package/src/orchestrate/realize/utils/generateTS2339Hints.ts +39 -19
@@ -105,7 +105,7 @@ function process(ctx, props) {
105
105
  properties: {
106
106
  thinking: {
107
107
  type: "string",
108
- description: "Think before you act.\n\nBefore requesting preliminary data or completing your task, reflect on\nyour current state and explain your reasoning:\n\nFor preliminary requests:\n\n- What database schemas are missing that you need?\n- Why do you need them for transformer generation?\n- Be brief - state the gap, don't list everything you have.\n\nFor completion:\n\n- What schemas did you acquire?\n- What transformer patterns did you implement?\n- Why is it sufficient to complete?\n- Summarize - don't enumerate every field mapping.\n\nNote: All necessary DTO type information is available transitively from\nthe DTO type names in the plan. You only need to request database\nschemas.\n\nThis reflection helps you avoid duplicate requests and premature\ncompletion."
108
+ description: "Think before you act.\n\nFor preliminary requests: what database schemas are missing and why?\n\nFor completion: what schemas did you acquire, what patterns did you\nimplement, and why is it sufficient? Summarize \u2014 don't enumerate every\nfield.\n\nNote: All DTO type information is available transitively from the plan's\nDTO type names. You only need to request database schemas."
109
109
  },
110
110
  request: {
111
111
  oneOf: [
@@ -123,7 +123,7 @@ function process(ctx, props) {
123
123
  complete: "#/components/schemas/IAutoBeRealizeTransformerWriteApplication.IComplete"
124
124
  }
125
125
  },
126
- description: "Type discriminator for the request.\n\nDetermines which action to perform:\n\n- \"getDatabaseSchemas\": Retrieve database table schemas for DB structure\n- \"complete\": Generate final transformer implementation\n\nAll necessary DTO type information is obtained transitively from the DTO\ntype names provided in the plan (AutoBeRealizeTransformerPlan). Each DTO\ntype name allows the system to recursively fetch all referenced types,\nproviding complete type information without requiring explicit schema\nrequests.\n\nThe preliminary types are removed from the union after their respective\ndata has been provided, physically preventing repeated calls."
126
+ description: "Action to perform. Exhausted preliminary types are removed from the\nunion, physically preventing repeated calls."
127
127
  }
128
128
  },
129
129
  required: [
@@ -136,7 +136,7 @@ function process(ctx, props) {
136
136
  properties: {
137
137
  type: {
138
138
  "const": "getDatabaseSchemas",
139
- description: "Type discriminator for the request.\n\nDetermines which action to perform: preliminary data retrieval or actual\ntask execution. Value \"getDatabaseSchemas\" indicates this is a preliminary\ndata request for database schemas."
139
+ description: "Type discriminator."
140
140
  },
141
141
  schemaNames: {
142
142
  type: "array",
@@ -144,14 +144,14 @@ function process(ctx, props) {
144
144
  type: "string"
145
145
  },
146
146
  minItems: 1,
147
- description: "List of database table names to retrieve.\n\nTable names from the database schema representing database entities (e.g.,\n\"user\", \"post\", \"comment\").\n\nCRITICAL: DO NOT request the same schema names that you have already\nrequested in previous calls."
147
+ description: "Database table names to retrieve. DO NOT request same names already\nrequested in previous calls."
148
148
  }
149
149
  },
150
150
  required: [
151
151
  "type",
152
152
  "schemaNames"
153
153
  ],
154
- description: "Request to retrieve database schema definitions for context.\n\nThis type is used in the preliminary phase to request specific database table\nschemas needed for generating type-safe API operations."
154
+ description: "Request to retrieve database schema definitions for context."
155
155
  },
156
156
  "IAutoBeRealizeTransformerWriteApplication.IComplete": {
157
157
  type: "object",
@@ -162,29 +162,29 @@ function process(ctx, props) {
162
162
  },
163
163
  plan: {
164
164
  type: "string",
165
- description: "Transformer implementation plan and strategy.\n\nMUST contain thorough analysis with these four mandatory sections:\n\n1. Database Schema Field Inventory - List ALL fields with exact names from\n schema\n2. DTO Property Inventory - List ALL properties with types\n3. Field-by-Field Mapping Strategy - Explicit table for BOTH select() and\n transform()\n4. Edge Cases and Special Handling - Type casts (Decimal, DateTime),\n nullables\n\nThis forces you to READ the actual schema (not imagine it) and creates an\nexplicit specification for both select() and transform() functions."
165
+ description: "Transformer implementation plan. MUST contain four sections:\n\n1. Database Schema Field Inventory \u2014 ALL fields with exact names from schema\n2. DTO Property Inventory \u2014 ALL properties with types\n3. Field-by-Field Mapping Strategy \u2014 explicit table for BOTH select() and\n transform()\n4. Edge Cases and Special Handling \u2014 type casts (Decimal, DateTime),\n nullables\n\nThis forces you to READ the actual schema (not imagine it) and creates an\nexplicit specification for both select() and transform() functions."
166
166
  },
167
167
  selectMappings: {
168
168
  type: "array",
169
169
  items: {
170
170
  $ref: "#/components/schemas/AutoBeRealizeTransformerSelectMapping"
171
171
  },
172
- description: "Database field-by-field selection mapping for the select() function.\n\nDocuments which database fields/relations must be selected from the\ndatabase to enable the transform() function. This ensures no required\ndata is missing from the query.\n\nMUST include EVERY database field needed by transform() - no exceptions.\nEach mapping specifies:\n\n- `member`: Exact database field/relation name (snake_case)\n- `kind`: Whether it's a scalar field, belongsTo, hasOne, or hasMany\n relation\n- `nullable`: Whether the field/relation is nullable (true/false for\n scalar/belongsTo, null for hasMany/hasOne)\n- `how`: Why this field is being selected (which DTO property needs it)\n\nThe `kind` property forces explicit classification of each member BEFORE\ndeciding what to select, preventing confusion between scalars and\nrelations, and ensuring correct select syntax.\n\nThe `nullable` property documents schema constraints that affect how\ntransform() will handle the data, enabling proper null handling in\ntransformations.\n\nMissing even a single required field will cause validation failure and\ntrigger regeneration.\n\nThis structured approach:\n\n- Prevents missing field selections through systematic coverage\n- Forces explicit decision-making for each database field (kind + nullable\n\n - How)\n- Ensures select() and transform() are perfectly aligned\n- Documents what data to load from database\n- Prevents confusion between scalar fields and relations\n- Documents nullability constraints for transform() planning\n- Enables validation before code generation\n\n**Common selection patterns by kind**:\n\n- **Scalar fields (nullable: true/false)**: For direct mapping or type\n conversion\n- **Computation sources (nullable: true/false)**: Fields needed for\n computed DTO properties\n- **Aggregations (nullable: false)**: _count, _sum, _avg for DTO statistics\n- **BelongsTo relations (nullable: true/false)**: For nested object\n transformers\n- **HasMany relations (nullable: null)**: For array transformers\n\nThe validator will cross-check this list against the database schema and\nDTO requirements to ensure complete coverage."
172
+ description: "Database field-by-field selection mapping for select().\n\nMUST include EVERY database field needed by transform() \u2014 no exceptions.\nEach mapping specifies:\n\n- `member`: Exact Prisma field/relation name (snake_case) \u2014 read from the\n Relation Mapping Table and member list, NOT from DTO property names\n- `kind`: scalar, belongsTo, hasOne, or hasMany\n- `nullable`: true/false for scalar/belongsTo, null for hasMany/hasOne\n- `how`: Which DTO property needs it\n\nThe `kind` property forces explicit classification of each member BEFORE\ndeciding select syntax, preventing confusion between scalars and\nrelations.\n\nMissing even a single required field will cause validation failure."
173
173
  },
174
174
  transformMappings: {
175
175
  type: "array",
176
176
  items: {
177
177
  $ref: "#/components/schemas/AutoBeRealizeTransformerTransformMapping"
178
178
  },
179
- description: "DTO property-by-property transformation mapping for the transform()\nfunction.\n\nDocuments how to transform database payload data into each DTO property.\nThis ensures complete DTO coverage and correct transformation logic.\n\nMUST include EVERY property from the DTO type definition - no exceptions.\nEach mapping specifies:\n\n- `property`: Exact DTO property name (camelCase)\n- `how`: How to obtain this property value from Prisma payload\n\nMissing even a single property will cause validation failure and trigger\nregeneration.\n\nThis structured approach:\n\n- Prevents property omissions through systematic coverage\n- Forces explicit decision-making for each property transformation\n- Documents transformation logic (direct mapping, type conversion,\n computation, nested transformation)\n- Ensures select() and transform() are aligned\n- Enables validation before code generation\n\n**Common transformation patterns**:\n\n- **Direct mapping**: Simple field renaming (snake_case \u2192 camelCase)\n- **Type conversion**: Decimal \u2192 Number, DateTime \u2192 ISO string\n- **Nullable handling**: DateTime? \u2192 string | null\n- **Computed properties**: Calculate from multiple database fields\n- **Aggregation**: Use _count, _sum, _avg from database\n- **Nested objects**: Reuse neighbor transformers\n- **Arrays**: Map with ArrayUtil.asyncMap + neighbor transformer\n\nThe validator will cross-check this list against the actual DTO type\ndefinition and reject incomplete mappings."
179
+ description: "DTO property-by-property transformation mapping for transform().\n\nMUST include EVERY property from the DTO type definition \u2014 no exceptions.\nEach mapping specifies:\n\n- `property`: Exact DTO property name (camelCase)\n- `how`: How to obtain from Prisma payload\n\n**Common transformation patterns**:\n\n- Direct mapping: snake_case \u2192 camelCase\n- Type conversion: Decimal \u2192 Number, DateTime \u2192 ISO string\n- Nullable: DateTime? \u2192 string | null\n- Nested objects: Reuse neighbor transformers\n- Arrays: ArrayUtil.asyncMap + neighbor transformer\n\nMissing even a single property will cause validation failure."
180
180
  },
181
181
  draft: {
182
182
  type: "string",
183
- description: "Initial transformer implementation draft.\n\nComplete implementation that strictly follows the plan's mapping table.\nEVERY field in the plan's Section 3 MUST appear in BOTH select() and\ntransform(). Implement:\n\n- Transform() first, select() second, Payload last (correct order)\n- All field mappings from plan with correct transformations\n- Neighbor transformer reuse (NEVER inline when transformer exists)\n- ALWAYS use `select`, NEVER use `include`"
183
+ description: "Complete implementation following plan's mapping table. EVERY field from\nplan Section 3 MUST appear in BOTH select() and transform(). Implement:\n\n- Transform() first, select() second, Payload last (correct order)\n- All field mappings from plan with correct transformations\n- Neighbor transformer reuse (NEVER inline when transformer exists)\n- ALWAYS use `select`, NEVER use `include`"
184
184
  },
185
185
  revise: {
186
186
  $ref: "#/components/schemas/IAutoBeRealizeTransformerWriteApplication.IReviseProps",
187
- description: "Revision and finalization phase.\n\nReviews the draft implementation and produces the final code with all\nimprovements and corrections applied."
187
+ description: "Reviews draft and produces final code."
188
188
  }
189
189
  },
190
190
  required: [
@@ -195,14 +195,14 @@ function process(ctx, props) {
195
195
  "draft",
196
196
  "revise"
197
197
  ],
198
- description: "Request to generate transformer module implementation.\n\nExecutes three-phase generation to create complete transformer with:\n\n- `select()` function: Returns Prisma include/select specification\n- `transform()` function: Converts Prisma payload to DTO\n\nFollows plan \u2192 draft \u2192 revise pattern to ensure type safety and correct\nfield mappings.\n\nNote: The database schema name is provided as input from the planning\nphase, so it doesn't need to be returned in the response."
198
+ description: "Generate transformer module (select + transform functions) via\nplan/draft/revise."
199
199
  },
200
200
  AutoBeRealizeTransformerSelectMapping: {
201
201
  type: "object",
202
202
  properties: {
203
203
  member: {
204
204
  type: "string",
205
- description: "Exact Prisma field or relation name from the Prisma schema.\n\nMUST match the Prisma schema exactly (case-sensitive). Use snake_case as\nPrisma follows database conventions.\n\n**Field Types**:\n\n- **Scalar fields**: Database columns (id, email, created_at, unit_price,\n etc.)\n- **BelongsTo relations**: Foreign key relations (customer, article,\n category, etc.)\n- **HasMany relations**: One-to-many arrays (tags, comments, reviews, etc.)\n- **Aggregations**: Prisma computed fields (_count, _sum, _avg, etc.)\n\n**Examples**:\n\n```typescript\n// Scalar fields for direct mapping or conversion\n{ member: \"id\", kind: \"scalar\", nullable: false, how: \"For DTO.id\" }\n{ member: \"email\", kind: \"scalar\", nullable: false, how: \"For DTO.email\" }\n{ member: \"created_at\", kind: \"scalar\", nullable: false, how: \"For DTO.createdAt (needs .toISOString())\" }\n{ member: \"unit_price\", kind: \"scalar\", nullable: false, how: \"For DTO.price (Decimal \u2192 Number)\" }\n{ member: \"deleted_at\", kind: \"scalar\", nullable: true, how: \"For DTO.deletedAt (nullable DateTime)\" }\n\n// Scalar fields for computation\n{ member: \"quantity\", kind: \"scalar\", nullable: false, how: \"For DTO.totalPrice computation\" }\n{ member: \"expiry_date\", kind: \"scalar\", nullable: false, how: \"For DTO.isExpired computation\" }\n\n// Aggregations (special scalar type)\n{ member: \"_count\", kind: \"scalar\", nullable: false, how: \"For DTO.reviewCount\" }\n\n// BelongsTo relations (nested objects)\n{ member: \"customer\", kind: \"belongsTo\", nullable: false, how: \"For DTO.customer (nested transformer)\" }\n{ member: \"article\", kind: \"belongsTo\", nullable: false, how: \"For DTO.article (nested transformer)\" }\n{ member: \"parent\", kind: \"belongsTo\", nullable: true, how: \"For DTO.parent (optional nested)\" }\n\n// HasMany relations (arrays)\n{ member: \"tags\", kind: \"hasMany\", nullable: null, how: \"For DTO.tags (array transformer)\" }\n{ member: \"comments\", kind: \"hasMany\", nullable: null, how: \"For DTO.comments (array transformer)\" }\n```\n\nDO NOT use DTO property names here - this is about Prisma schema members,\nnot DTO properties."
205
+ description: "Exact Prisma field or relation name from the Prisma schema.\n\nMUST match the Prisma schema exactly (case-sensitive, snake_case).\n\n**Field Types**:\n\n- **Scalar fields**: Database columns (id, email, created_at, unit_price)\n- **BelongsTo relations**: FK relations (customer, article, category)\n- **HasMany relations**: 1:N arrays (tags, comments, reviews)\n- **Aggregations**: Prisma computed fields (_count, _sum, _avg)\n\n**Examples**:\n\n```typescript\n// Scalar fields\n{ member: \"id\", kind: \"scalar\", nullable: false, how: \"For DTO.id\" }\n{ member: \"created_at\", kind: \"scalar\", nullable: false, how: \"For DTO.createdAt (needs .toISOString())\" }\n{ member: \"unit_price\", kind: \"scalar\", nullable: false, how: \"For DTO.price (Decimal \u2192 Number)\" }\n{ member: \"deleted_at\", kind: \"scalar\", nullable: true, how: \"For DTO.deletedAt (nullable DateTime)\" }\n\n// BelongsTo relations \u2014 member is ALWAYS the Prisma relation name,\n// which may differ from the DTO property name\n{ member: \"customer\", kind: \"belongsTo\", nullable: false, how: \"For DTO.buyer (nested transformer)\" }\n{ member: \"user\", kind: \"belongsTo\", nullable: true, how: \"For DTO.voter (optional nested)\" }\n\n// HasMany relations\n{ member: \"tags\", kind: \"hasMany\", nullable: null, how: \"For DTO.tags (array transformer)\" }\n```\n\nDO NOT use DTO property names \u2014 this is about Prisma schema members. Read\nthe Relation Mapping Table and member list to find correct names."
206
206
  },
207
207
  kind: {
208
208
  oneOf: [
@@ -219,7 +219,7 @@ function process(ctx, props) {
219
219
  "const": "hasMany"
220
220
  }
221
221
  ],
222
- description: "The kind of Prisma schema member being selected.\n\nExplicitly identifies whether this member is a scalar field or a relation,\nand if it's a relation, what type of relation it is. This classification\nforces the AI to think through the nature of each member before planning\nwhat to select, preventing common mistakes in the select() function.\n\n**Possible values**:\n\n- `\"scalar\"`: Regular database column (id, email, created_at, unit_price,\n etc.)\n- `\"belongsTo\"`: Foreign key relation pointing to parent entity (customer,\n article, category, etc.)\n- `\"hasOne\"`: One-to-one relation where this side owns the relationship\n- `\"hasMany\"`: One-to-many or many-to-many relation (comments, tags, reviews,\n etc.)\n\n**Why this matters for select()**:\n\n- **Prevents confusion**: AI must consciously identify if \"customer\" is a\n scalar or belongsTo relation\n- **Forces correct select syntax**: belongsTo/hasMany require nested select\n objects, scalar requires `true`\n- **Enables Chain-of-Thought**: AI explicitly thinks about the kind before\n deciding selection strategy\n- **Supports proper data loading**: Different kinds require different\n selection approaches\n\n**Examples by kind**:\n\n```typescript\n// Scalar fields - simple selection\n{ member: \"id\", kind: \"scalar\", nullable: false, how: \"For DTO.id\" }\n{ member: \"email\", kind: \"scalar\", nullable: false, how: \"For DTO.email\" }\n{ member: \"created_at\", kind: \"scalar\", nullable: false, how: \"For DTO.createdAt\" }\n{ member: \"deleted_at\", kind: \"scalar\", nullable: true, how: \"For DTO.deletedAt\" }\n\n// BelongsTo relations - nested selection with transformer\n{ member: \"customer\", kind: \"belongsTo\", nullable: false, how: \"For DTO.customer (nested)\" }\n{ member: \"article\", kind: \"belongsTo\", nullable: false, how: \"For DTO.article (nested)\" }\n{ member: \"parent\", kind: \"belongsTo\", nullable: true, how: \"For DTO.parent (optional)\" }\n\n// HasMany relations - nested selection with array transformer\n{ member: \"tags\", kind: \"hasMany\", nullable: null, how: \"For DTO.tags (array)\" }\n{ member: \"comments\", kind: \"hasMany\", nullable: null, how: \"For DTO.comments (array)\" }\n```\n\nThe `kind` field works together with `nullable` and `how`: kind identifies\nWHAT it is, nullable identifies IF it's optional, how explains WHY we're\nselecting it."
222
+ description: "Kind of Prisma schema member.\n\n- `\"scalar\"`: Regular column \u2192 `{ field: true }`\n- `\"belongsTo\"`: FK relation \u2192 `{ relation: { select: ... } }`\n- `\"hasOne\"`: 1:1 relation \u2192 nested select\n- `\"hasMany\"`: 1:N relation \u2192 `{ relation: { select: ... } }`\n\nThe kind forces explicit classification of each member BEFORE deciding\nselect syntax, preventing confusion between scalars and relations."
223
223
  },
224
224
  nullable: {
225
225
  oneOf: [
@@ -230,11 +230,11 @@ function process(ctx, props) {
230
230
  type: "boolean"
231
231
  }
232
232
  ],
233
- description: "Whether this Prisma member is nullable in the schema.\n\nThis property explicitly documents whether a field/relation can be null,\nforcing the AI to understand nullability constraints before deciding\nselection strategy. This affects how the transform() function will handle\nthe data.\n\n**Value semantics by kind**:\n\n- **For scalar fields** (`kind: \"scalar\"`):\n\n - `false`: Non-nullable column (e.g., `email String`, `id String`)\n\n - Will always have a value in the selected data\n - Transform() can safely access without null checks\n - Example: `created_at DateTime` \u2192 `nullable: false`\n - `true`: Nullable column (e.g., `deleted_at DateTime?`)\n\n - Might be null in the selected data\n - Transform() must handle null case (e.g., `?? null`)\n - Example: `deleted_at DateTime?` \u2192 `nullable: true`\n- **For belongsTo relations** (`kind: \"belongsTo\"`):\n\n - `false`: Required foreign key (e.g., `customer_id String`)\n\n - Relation will always exist in the selected data\n - Transform() can safely use the nested transformer\n - Example: `customer` relation \u2192 `nullable: false`\n - `true`: Optional foreign key (e.g., `parent_id String?`)\n\n - Relation might not exist in the selected data\n - Transform() must handle null case\n - Example: `parent` relation \u2192 `nullable: true`\n- **For hasMany/hasOne relations** (`kind: \"hasMany\"` or `kind: \"hasOne\"`):\n\n - Always `null`: Nullability concept doesn't apply to these relations\n\n - HasMany: Always returns array (empty or populated)\n - HasOne: Handled differently in Prisma\n - The `nullable` property has no semantic meaning\n\n**Why this matters for select()**:\n\n- **Informs transform() handling**: Knowing nullability helps plan correct\n transformation\n- **Validates selection strategy**: Nullable fields need different handling\n in transform()\n- **Supports Chain-of-Thought**: AI must think about nullability BEFORE\n deciding selection\n- **Documents schema constraints**: Makes nullability explicit for validation\n\n**Examples**:\n\n```typescript\n// Non-nullable scalar (nullable: false)\n{ member: \"id\", kind: \"scalar\", nullable: false, how: \"For DTO.id\" }\n{ member: \"email\", kind: \"scalar\", nullable: false, how: \"For DTO.email\" }\n{ member: \"created_at\", kind: \"scalar\", nullable: false, how: \"For DTO.createdAt\" }\n\n// Nullable scalar (nullable: true)\n{ member: \"deleted_at\", kind: \"scalar\", nullable: true, how: \"For DTO.deletedAt (nullable)\" }\n{ member: \"description\", kind: \"scalar\", nullable: true, how: \"For DTO.description (optional)\" }\n\n// Required belongsTo (nullable: false)\n{ member: \"customer\", kind: \"belongsTo\", nullable: false, how: \"For DTO.customer (nested)\" }\n{ member: \"article\", kind: \"belongsTo\", nullable: false, how: \"For DTO.article (nested)\" }\n\n// Optional belongsTo (nullable: true)\n{ member: \"parent\", kind: \"belongsTo\", nullable: true, how: \"For DTO.parent (optional)\" }\n{ member: \"category\", kind: \"belongsTo\", nullable: true, how: \"For DTO.category (optional)\" }\n\n// HasMany relations (nullable: null - not applicable)\n{ member: \"comments\", kind: \"hasMany\", nullable: null, how: \"For DTO.comments (array)\" }\n{ member: \"tags\", kind: \"hasMany\", nullable: null, how: \"For DTO.tags (array)\" }\n```\n\nThe `nullable` property works with `kind` and `how`: kind identifies WHAT\nit is, nullable identifies IF it's optional, how explains WHY we're\nselecting it."
233
+ description: "Whether nullable in Prisma schema.\n\n- `false`: Always present \u2014 transform() can safely access\n- `true`: May be null \u2014 transform() must handle null case\n- `null`: Not applicable (hasMany/hasOne)"
234
234
  },
235
235
  how: {
236
236
  type: "string",
237
- description: "Brief one-line explanation of why this Prisma field is being selected.\n\nKeep it concise and clear. Focus on which DTO property(ies) need this data.\n\n**For Write Phase** (planning field selection):\n\n- \"For DTO.id\"\n- \"For DTO.email\"\n- \"For DTO.createdAt (needs .toISOString())\"\n- \"For DTO.deletedAt (nullable DateTime)\"\n- \"For DTO.price (Decimal \u2192 Number conversion)\"\n- \"For DTO.totalPrice computation (with quantity)\"\n- \"For DTO.reviewCount aggregation\"\n- \"For DTO.isExpired computation\"\n- \"For DTO.customer (nested CustomerTransformer)\"\n- \"For DTO.tags (array TagTransformer)\"\n- \"For nested transformer's select() requirements\"\n\n**For Correct Phase** (documenting current state and fixes):\n\n- \"No change needed - correct\"\n- \"Already correct\"\n- \"Fix: Wrong field name 'user_email' \u2192 'email'\"\n- \"Fix: Missing field - add for DTO.totalPrice\"\n- \"Fix: Should use select, not include\"\n- \"Fix: Missing aggregation - add _count\"\n- \"Fix: Fabricated field - remove it\"\n- \"Fix: Selecting unused field - remove it\"\n\nEven if a selection is correct, you MUST include it in the mapping and\nexplain why. This ensures complete coverage and alignment with\ntransform().\n\nThis is NOT code - just a simple description of the selection purpose."
237
+ description: "Brief reason for selecting this field (NOT code).\n\nWrite phase: \"For DTO.id\", \"For DTO.createdAt (needs .toISOString())\", \"For\nDTO.customer (nested transformer)\".\n\nCorrect phase: \"No change needed\", \"Fix: Missing field \u2014 add for\nDTO.totalPrice\".\n\nEven if correct, you MUST include it in the mapping. This ensures complete\ncoverage and alignment with transform()."
238
238
  }
239
239
  },
240
240
  required: [
@@ -243,32 +243,32 @@ function process(ctx, props) {
243
243
  "nullable",
244
244
  "how"
245
245
  ],
246
- description: "Single Prisma field selection mapping for the select() function.\n\nDocuments which Prisma fields/relations must be selected from the database to\nenable the transform() function to build the DTO. This structured approach\nensures no required data is missing from the query, preventing runtime\nerrors.\n\n**Purpose**:\n\n- Prevents missing field selections through systematic coverage verification\n- Forces explicit decision-making for each Prisma field selection\n- Ensures select() and transform() are perfectly aligned\n- Creates clear documentation of what data to load from database\n\n**Usage Contexts**:\n\n- **Write Phase**: Plan which Prisma fields to select for each DTO property\n- **Correct Phase**: Document current state and correction plan for each\n selection\n\nThe validator cross-checks mappings against the Prisma schema and DTO\nrequirements to ensure nothing is overlooked, rejecting incomplete\nselections.\n\n**Critical Principle**:\n\nEvery DTO property in the transform() function requires corresponding Prisma\ndata. This mapping documents what must be selected to satisfy those\nrequirements. If transform() needs `prisma.created_at`, select() MUST include\n`created_at: true`."
246
+ description: "Prisma field selection mapping for the select() function.\n\nDocuments which Prisma fields/relations must be selected to enable\ntransform() to build the DTO. EVERY required field must be listed \u2014 the\nvalidator rejects incomplete selections."
247
247
  },
248
248
  AutoBeRealizeTransformerTransformMapping: {
249
249
  type: "object",
250
250
  properties: {
251
251
  property: {
252
252
  type: "string",
253
- description: "Exact DTO property name from the DTO type definition.\n\nMUST match the DTO interface exactly (case-sensitive). Examples:\n\n- Scalar properties: \"id\", \"email\", \"createdAt\"\n- Computed properties: \"totalPrice\", \"reviewCount\", \"isExpired\"\n- Nested objects: \"customer\", \"article\"\n- Arrays: \"tags\", \"comments\"\n\nUse camelCase as DTOs follow TypeScript conventions (unlike Prisma's\nsnake_case).\n\nInclude ALL properties from the DTO, even if they require complex\ntransformations or are computed from multiple Prisma fields.\n\n**Examples**:\n\n```typescript\n// Direct scalar mappings\n{ property: \"id\", how: \"From prisma.id\" }\n{ property: \"email\", how: \"From prisma.email\" }\n{ property: \"createdAt\", how: \"From prisma.created_at.toISOString()\" }\n\n// Type conversions\n{ property: \"price\", how: \"From prisma.unit_price (Decimal \u2192 Number)\" }\n{ property: \"deletedAt\", how: \"From prisma.deleted_at?.toISOString() ?? null\" }\n\n// Computed properties\n{ property: \"totalPrice\", how: \"Compute: prisma.unit_price * prisma.quantity\" }\n{ property: \"reviewCount\", how: \"From prisma._count.reviews\" }\n{ property: \"isExpired\", how: \"Compute: prisma.expiry_date < new Date()\" }\n\n// Nested transformations\n{ property: \"customer\", how: \"Transform with CustomerTransformer\" }\n{ property: \"tags\", how: \"Array map with TagTransformer\" }\n```"
253
+ description: "Exact DTO property name (case-sensitive, camelCase).\n\nInclude ALL properties: direct mappings, type conversions, computed values,\nand nested transformations.\n\n**Examples**:\n\n```typescript\n// Direct scalar mappings\n{ property: \"id\", how: \"From prisma.id\" }\n{ property: \"createdAt\", how: \"From prisma.created_at.toISOString()\" }\n\n// Type conversions\n{ property: \"price\", how: \"From prisma.unit_price (Decimal \u2192 Number)\" }\n{ property: \"deletedAt\", how: \"From prisma.deleted_at?.toISOString() ?? null\" }\n\n// Computed properties\n{ property: \"totalPrice\", how: \"Compute: prisma.unit_price * prisma.quantity\" }\n{ property: \"reviewCount\", how: \"From prisma._count.reviews\" }\n\n// Nested transformations (reuse neighbor transformers)\n{ property: \"customer\", how: \"Transform with CustomerTransformer\" }\n{ property: \"tags\", how: \"Array map with TagTransformer\" }\n```"
254
254
  },
255
255
  how: {
256
256
  type: "string",
257
- description: "Brief one-line explanation of how to obtain this property's value from\nPrisma.\n\nKeep it concise and clear.\n\n**For Write Phase** (planning transformation strategy):\n\n- \"From prisma.email\"\n- \"From prisma.created_at.toISOString()\"\n- \"From prisma.unit_price (Decimal \u2192 Number)\"\n- \"From prisma.deleted_at?.toISOString() ?? null\"\n- \"Compute: prisma.unit_price * prisma.quantity\"\n- \"From prisma._count.reviews\"\n- \"Compute: prisma.expiry_date < new Date()\"\n- \"Transform with CustomerTransformer\"\n- \"Array map with TagTransformer\"\n- \"From prisma.customer.name (nested field)\"\n\n**For Correct Phase** (documenting current state and fixes):\n\n- \"No change needed - correct\"\n- \"Already correct\"\n- \"Fix: Wrong property name 'userEmail' \u2192 'email'\"\n- \"Fix: Missing property - add from prisma.total_price\"\n- \"Fix: Wrong transformation - should use .toISOString()\"\n- \"Fix: Should use TagTransformer instead of inline\"\n- \"Fix: Missing Decimal conversion\"\n- \"Fix: Fabricated property - remove it\"\n\nEven if a property is correct, you MUST include it in the mapping and\nexplain why. This ensures complete DTO coverage.\n\nThis is NOT code - just a simple description of the transformation\nstrategy."
257
+ description: "Brief strategy for obtaining this property's value (NOT code).\n\nWrite phase: \"From prisma.email\", \"From prisma.created_at.toISOString()\",\n\"From prisma.deleted_at?.toISOString() ?? null\", \"From prisma.unit_price\n(Decimal \u2192 Number)\", \"Transform with CustomerTransformer\", \"Array map with\nTagTransformer\", \"Compute: prisma.unit_price * prisma.quantity\".\n\nCorrect phase: \"No change needed\", \"Fix: Missing Decimal conversion\", \"Fix:\nShould use TagTransformer instead of inline\".\n\nEven if correct, you MUST include it. This ensures complete DTO coverage."
258
258
  }
259
259
  },
260
260
  required: [
261
261
  "property",
262
262
  "how"
263
263
  ],
264
- description: "Single DTO property transformation mapping for the transform() function.\n\nDocuments how to transform Prisma payload data into each specific DTO\nproperty in the transform() function. This structured approach ensures\ncomplete DTO coverage by requiring explicit documentation for EVERY property\n\n- Including those requiring special transformations or computed from multiple\n Prisma fields.\n\n**Purpose**:\n\n- Prevents property omissions through systematic coverage verification\n- Forces explicit decision-making for each DTO property transformation\n- Enables validation before code generation (Write) or correction (Correct)\n- Creates clear documentation of transformation logic\n\n**Usage Contexts**:\n\n- **Write Phase**: Plan how to transform each Prisma field \u2192 DTO property in\n transform()\n- **Correct Phase**: Document current state and correction plan for each\n property in transform()\n\nThe validator cross-checks mappings against the DTO type definition to ensure\nnothing is overlooked, rejecting incomplete mappings.\n\n**Critical Principle**:\n\nThis mapping is ONLY for the transform() function - it documents how to build\nthe DTO return object. The corresponding select() function requirements are\ndocumented separately in AutoBeRealizeTransformerSelectMapping."
264
+ description: "DTO property transformation mapping for the transform() function.\n\nDocuments how to transform Prisma payload data into each DTO property. EVERY\nDTO property must be listed \u2014 the validator rejects incomplete mappings."
265
265
  },
266
266
  "IAutoBeRealizeTransformerWriteApplication.IReviseProps": {
267
267
  type: "object",
268
268
  properties: {
269
269
  review: {
270
270
  type: "string",
271
- description: "Critical review and improvement analysis.\n\nMUST systematically verify using four checklists:\n\n1. Schema Fidelity - Cross-check EVERY field name against plan Section 1\n inventory\n2. Plan Adherence - Verify EVERY mapping from Section 3 in BOTH select() and\n transform()\n3. System Rules - Mandatory neighbor reuse, function order, select (not\n include)\n4. Type Safety - Type casts (Decimal\u2192Number, DateTime\u2192ISO), nullable\n handling\n\nIdentify specific issues with line numbers and provide clear reasoning.\nThis catches hallucinated fields, missing transformations, and rule\nviolations."
271
+ description: "MUST systematically verify four checklists:\n\n1. Schema Fidelity \u2014 cross-check EVERY field name against plan Section 1\n2. Plan Adherence \u2014 verify EVERY mapping from Section 3 in BOTH select() and\n transform()\n3. System Rules \u2014 neighbor reuse, function order, select (not include)\n4. Type Safety \u2014 Decimal\u2192Number, DateTime\u2192ISO, nullable handling\n\nIdentify issues with line numbers. This catches hallucinated fields,\nmissing transformations, and rule violations."
272
272
  },
273
273
  final: {
274
274
  oneOf: [
@@ -279,7 +279,7 @@ function process(ctx, props) {
279
279
  type: "string"
280
280
  }
281
281
  ],
282
- description: "Final transformer code with all review improvements applied.\n\nApply ALL fixes identified in the review to produce production-ready\ncode. If review found issues, this MUST contain the corrected\nimplementation.\n\nReturn `null` ONLY if the draft is already perfect and review found zero\nissues."
282
+ description: "Final transformer code with all review improvements applied, or null if\ndraft needs no changes."
283
283
  }
284
284
  },
285
285
  required: [
@@ -303,7 +303,7 @@ function process(ctx, props) {
303
303
  }
304
304
  }
305
305
  ],
306
- description: "Process transformer generation task or preliminary data requests.\n\nGenerates complete transformer module through three-phase workflow (plan \u2192\ndraft \u2192 revise). Ensures type safety, proper Prisma payload types, and\ncorrect DTO mapping."
306
+ description: "Process transformer generation task or preliminary data requests."
307
307
  }
308
308
  ]
309
309
  },
@@ -559,11 +559,11 @@ function createController(props) {
559
559
  type: "object",
560
560
  properties: {
561
561
  thinking: {
562
- description: "Think before you act.\n\nBefore requesting preliminary data or completing your task, reflect on\nyour current state and explain your reasoning:\n\nFor preliminary requests:\n\n- What database schemas are missing that you need?\n- Why do you need them for transformer generation?\n- Be brief - state the gap, don't list everything you have.\n\nFor completion:\n\n- What schemas did you acquire?\n- What transformer patterns did you implement?\n- Why is it sufficient to complete?\n- Summarize - don't enumerate every field mapping.\n\nNote: All necessary DTO type information is available transitively from\nthe DTO type names in the plan. You only need to request database\nschemas.\n\nThis reflection helps you avoid duplicate requests and premature\ncompletion.",
562
+ description: "Think before you act.\n\nFor preliminary requests: what database schemas are missing and why?\n\nFor completion: what schemas did you acquire, what patterns did you\nimplement, and why is it sufficient? Summarize \u2014 don't enumerate every\nfield.\n\nNote: All DTO type information is available transitively from the plan's\nDTO type names. You only need to request database schemas.",
563
563
  type: "string"
564
564
  },
565
565
  request: {
566
- description: "Type discriminator for the request.\n\nDetermines which action to perform:\n\n- \"getDatabaseSchemas\": Retrieve database table schemas for DB structure\n- \"complete\": Generate final transformer implementation\n\nAll necessary DTO type information is obtained transitively from the DTO\ntype names provided in the plan (AutoBeRealizeTransformerPlan). Each DTO\ntype name allows the system to recursively fetch all referenced types,\nproviding complete type information without requiring explicit schema\nrequests.\n\nThe preliminary types are removed from the union after their respective\ndata has been provided, physically preventing repeated calls.",
566
+ description: "Action to perform. Exhausted preliminary types are removed from the\nunion, physically preventing repeated calls.",
567
567
  anyOf: [
568
568
  {
569
569
  $ref: "#/$defs/IAutoBePreliminaryGetDatabaseSchemas"
@@ -588,18 +588,18 @@ function createController(props) {
588
588
  additionalProperties: false,
589
589
  $defs: {
590
590
  IAutoBePreliminaryGetDatabaseSchemas: {
591
- description: "Request to retrieve database schema definitions for context.\n\nThis type is used in the preliminary phase to request specific database table\nschemas needed for generating type-safe API operations.",
591
+ description: "Request to retrieve database schema definitions for context.",
592
592
  type: "object",
593
593
  properties: {
594
594
  type: {
595
- description: "Type discriminator for the request.\n\nDetermines which action to perform: preliminary data retrieval or actual\ntask execution. Value \"getDatabaseSchemas\" indicates this is a preliminary\ndata request for database schemas.",
595
+ description: "Type discriminator.",
596
596
  type: "string",
597
597
  "enum": [
598
598
  "getDatabaseSchemas"
599
599
  ]
600
600
  },
601
601
  schemaNames: {
602
- description: "List of database table names to retrieve.\n\nTable names from the database schema representing database entities (e.g.,\n\"user\", \"post\", \"comment\").\n\nCRITICAL: DO NOT request the same schema names that you have already\nrequested in previous calls.",
602
+ description: "Database table names to retrieve. DO NOT request same names already\nrequested in previous calls.",
603
603
  type: "array",
604
604
  items: {
605
605
  type: "string"
@@ -613,7 +613,7 @@ function createController(props) {
613
613
  ]
614
614
  },
615
615
  "IAutoBeRealizeTransformerWriteApplication.IComplete": {
616
- description: "Request to generate transformer module implementation.\n\nExecutes three-phase generation to create complete transformer with:\n\n- `select()` function: Returns Prisma include/select specification\n- `transform()` function: Converts Prisma payload to DTO\n\nFollows plan \u2192 draft \u2192 revise pattern to ensure type safety and correct\nfield mappings.\n\nNote: The database schema name is provided as input from the planning\nphase, so it doesn't need to be returned in the response.",
616
+ description: "Generate transformer module (select + transform functions) via\nplan/draft/revise.",
617
617
  type: "object",
618
618
  properties: {
619
619
  type: {
@@ -624,29 +624,29 @@ function createController(props) {
624
624
  ]
625
625
  },
626
626
  plan: {
627
- description: "Transformer implementation plan and strategy.\n\nMUST contain thorough analysis with these four mandatory sections:\n\n1. Database Schema Field Inventory - List ALL fields with exact names from\n schema\n2. DTO Property Inventory - List ALL properties with types\n3. Field-by-Field Mapping Strategy - Explicit table for BOTH select() and\n transform()\n4. Edge Cases and Special Handling - Type casts (Decimal, DateTime),\n nullables\n\nThis forces you to READ the actual schema (not imagine it) and creates an\nexplicit specification for both select() and transform() functions.",
627
+ description: "Transformer implementation plan. MUST contain four sections:\n\n1. Database Schema Field Inventory \u2014 ALL fields with exact names from schema\n2. DTO Property Inventory \u2014 ALL properties with types\n3. Field-by-Field Mapping Strategy \u2014 explicit table for BOTH select() and\n transform()\n4. Edge Cases and Special Handling \u2014 type casts (Decimal, DateTime),\n nullables\n\nThis forces you to READ the actual schema (not imagine it) and creates an\nexplicit specification for both select() and transform() functions.",
628
628
  type: "string"
629
629
  },
630
630
  selectMappings: {
631
- description: "Database field-by-field selection mapping for the select() function.\n\nDocuments which database fields/relations must be selected from the\ndatabase to enable the transform() function. This ensures no required\ndata is missing from the query.\n\nMUST include EVERY database field needed by transform() - no exceptions.\nEach mapping specifies:\n\n- `member`: Exact database field/relation name (snake_case)\n- `kind`: Whether it's a scalar field, belongsTo, hasOne, or hasMany\n relation\n- `nullable`: Whether the field/relation is nullable (true/false for\n scalar/belongsTo, null for hasMany/hasOne)\n- `how`: Why this field is being selected (which DTO property needs it)\n\nThe `kind` property forces explicit classification of each member BEFORE\ndeciding what to select, preventing confusion between scalars and\nrelations, and ensuring correct select syntax.\n\nThe `nullable` property documents schema constraints that affect how\ntransform() will handle the data, enabling proper null handling in\ntransformations.\n\nMissing even a single required field will cause validation failure and\ntrigger regeneration.\n\nThis structured approach:\n\n- Prevents missing field selections through systematic coverage\n- Forces explicit decision-making for each database field (kind + nullable\n\n - How)\n- Ensures select() and transform() are perfectly aligned\n- Documents what data to load from database\n- Prevents confusion between scalar fields and relations\n- Documents nullability constraints for transform() planning\n- Enables validation before code generation\n\n**Common selection patterns by kind**:\n\n- **Scalar fields (nullable: true/false)**: For direct mapping or type\n conversion\n- **Computation sources (nullable: true/false)**: Fields needed for\n computed DTO properties\n- **Aggregations (nullable: false)**: _count, _sum, _avg for DTO statistics\n- **BelongsTo relations (nullable: true/false)**: For nested object\n transformers\n- **HasMany relations (nullable: null)**: For array transformers\n\nThe validator will cross-check this list against the database schema and\nDTO requirements to ensure complete coverage.",
631
+ description: "Database field-by-field selection mapping for select().\n\nMUST include EVERY database field needed by transform() \u2014 no exceptions.\nEach mapping specifies:\n\n- `member`: Exact Prisma field/relation name (snake_case) \u2014 read from the\n Relation Mapping Table and member list, NOT from DTO property names\n- `kind`: scalar, belongsTo, hasOne, or hasMany\n- `nullable`: true/false for scalar/belongsTo, null for hasMany/hasOne\n- `how`: Which DTO property needs it\n\nThe `kind` property forces explicit classification of each member BEFORE\ndeciding select syntax, preventing confusion between scalars and\nrelations.\n\nMissing even a single required field will cause validation failure.",
632
632
  type: "array",
633
633
  items: {
634
634
  $ref: "#/$defs/AutoBeRealizeTransformerSelectMapping"
635
635
  }
636
636
  },
637
637
  transformMappings: {
638
- description: "DTO property-by-property transformation mapping for the transform()\nfunction.\n\nDocuments how to transform database payload data into each DTO property.\nThis ensures complete DTO coverage and correct transformation logic.\n\nMUST include EVERY property from the DTO type definition - no exceptions.\nEach mapping specifies:\n\n- `property`: Exact DTO property name (camelCase)\n- `how`: How to obtain this property value from Prisma payload\n\nMissing even a single property will cause validation failure and trigger\nregeneration.\n\nThis structured approach:\n\n- Prevents property omissions through systematic coverage\n- Forces explicit decision-making for each property transformation\n- Documents transformation logic (direct mapping, type conversion,\n computation, nested transformation)\n- Ensures select() and transform() are aligned\n- Enables validation before code generation\n\n**Common transformation patterns**:\n\n- **Direct mapping**: Simple field renaming (snake_case \u2192 camelCase)\n- **Type conversion**: Decimal \u2192 Number, DateTime \u2192 ISO string\n- **Nullable handling**: DateTime? \u2192 string | null\n- **Computed properties**: Calculate from multiple database fields\n- **Aggregation**: Use _count, _sum, _avg from database\n- **Nested objects**: Reuse neighbor transformers\n- **Arrays**: Map with ArrayUtil.asyncMap + neighbor transformer\n\nThe validator will cross-check this list against the actual DTO type\ndefinition and reject incomplete mappings.",
638
+ description: "DTO property-by-property transformation mapping for transform().\n\nMUST include EVERY property from the DTO type definition \u2014 no exceptions.\nEach mapping specifies:\n\n- `property`: Exact DTO property name (camelCase)\n- `how`: How to obtain from Prisma payload\n\n**Common transformation patterns**:\n\n- Direct mapping: snake_case \u2192 camelCase\n- Type conversion: Decimal \u2192 Number, DateTime \u2192 ISO string\n- Nullable: DateTime? \u2192 string | null\n- Nested objects: Reuse neighbor transformers\n- Arrays: ArrayUtil.asyncMap + neighbor transformer\n\nMissing even a single property will cause validation failure.",
639
639
  type: "array",
640
640
  items: {
641
641
  $ref: "#/$defs/AutoBeRealizeTransformerTransformMapping"
642
642
  }
643
643
  },
644
644
  draft: {
645
- description: "Initial transformer implementation draft.\n\nComplete implementation that strictly follows the plan's mapping table.\nEVERY field in the plan's Section 3 MUST appear in BOTH select() and\ntransform(). Implement:\n\n- Transform() first, select() second, Payload last (correct order)\n- All field mappings from plan with correct transformations\n- Neighbor transformer reuse (NEVER inline when transformer exists)\n- ALWAYS use `select`, NEVER use `include`",
645
+ description: "Complete implementation following plan's mapping table. EVERY field from\nplan Section 3 MUST appear in BOTH select() and transform(). Implement:\n\n- Transform() first, select() second, Payload last (correct order)\n- All field mappings from plan with correct transformations\n- Neighbor transformer reuse (NEVER inline when transformer exists)\n- ALWAYS use `select`, NEVER use `include`",
646
646
  type: "string"
647
647
  },
648
648
  revise: {
649
- description: "Revision and finalization phase.\n\nReviews the draft implementation and produces the final code with all\nimprovements and corrections applied.",
649
+ description: "Reviews draft and produces final code.",
650
650
  $ref: "#/$defs/IAutoBeRealizeTransformerWriteApplication.IReviseProps"
651
651
  }
652
652
  },
@@ -660,15 +660,15 @@ function createController(props) {
660
660
  ]
661
661
  },
662
662
  AutoBeRealizeTransformerSelectMapping: {
663
- description: "Single Prisma field selection mapping for the select() function.\n\nDocuments which Prisma fields/relations must be selected from the database to\nenable the transform() function to build the DTO. This structured approach\nensures no required data is missing from the query, preventing runtime\nerrors.\n\n**Purpose**:\n\n- Prevents missing field selections through systematic coverage verification\n- Forces explicit decision-making for each Prisma field selection\n- Ensures select() and transform() are perfectly aligned\n- Creates clear documentation of what data to load from database\n\n**Usage Contexts**:\n\n- **Write Phase**: Plan which Prisma fields to select for each DTO property\n- **Correct Phase**: Document current state and correction plan for each\n selection\n\nThe validator cross-checks mappings against the Prisma schema and DTO\nrequirements to ensure nothing is overlooked, rejecting incomplete\nselections.\n\n**Critical Principle**:\n\nEvery DTO property in the transform() function requires corresponding Prisma\ndata. This mapping documents what must be selected to satisfy those\nrequirements. If transform() needs `prisma.created_at`, select() MUST include\n`created_at: true`.",
663
+ description: "Prisma field selection mapping for the select() function.\n\nDocuments which Prisma fields/relations must be selected to enable\ntransform() to build the DTO. EVERY required field must be listed \u2014 the\nvalidator rejects incomplete selections.",
664
664
  type: "object",
665
665
  properties: {
666
666
  member: {
667
- description: "Exact Prisma field or relation name from the Prisma schema.\n\nMUST match the Prisma schema exactly (case-sensitive). Use snake_case as\nPrisma follows database conventions.\n\n**Field Types**:\n\n- **Scalar fields**: Database columns (id, email, created_at, unit_price,\n etc.)\n- **BelongsTo relations**: Foreign key relations (customer, article,\n category, etc.)\n- **HasMany relations**: One-to-many arrays (tags, comments, reviews, etc.)\n- **Aggregations**: Prisma computed fields (_count, _sum, _avg, etc.)\n\n**Examples**:\n\n```typescript\n// Scalar fields for direct mapping or conversion\n{ member: \"id\", kind: \"scalar\", nullable: false, how: \"For DTO.id\" }\n{ member: \"email\", kind: \"scalar\", nullable: false, how: \"For DTO.email\" }\n{ member: \"created_at\", kind: \"scalar\", nullable: false, how: \"For DTO.createdAt (needs .toISOString())\" }\n{ member: \"unit_price\", kind: \"scalar\", nullable: false, how: \"For DTO.price (Decimal \u2192 Number)\" }\n{ member: \"deleted_at\", kind: \"scalar\", nullable: true, how: \"For DTO.deletedAt (nullable DateTime)\" }\n\n// Scalar fields for computation\n{ member: \"quantity\", kind: \"scalar\", nullable: false, how: \"For DTO.totalPrice computation\" }\n{ member: \"expiry_date\", kind: \"scalar\", nullable: false, how: \"For DTO.isExpired computation\" }\n\n// Aggregations (special scalar type)\n{ member: \"_count\", kind: \"scalar\", nullable: false, how: \"For DTO.reviewCount\" }\n\n// BelongsTo relations (nested objects)\n{ member: \"customer\", kind: \"belongsTo\", nullable: false, how: \"For DTO.customer (nested transformer)\" }\n{ member: \"article\", kind: \"belongsTo\", nullable: false, how: \"For DTO.article (nested transformer)\" }\n{ member: \"parent\", kind: \"belongsTo\", nullable: true, how: \"For DTO.parent (optional nested)\" }\n\n// HasMany relations (arrays)\n{ member: \"tags\", kind: \"hasMany\", nullable: null, how: \"For DTO.tags (array transformer)\" }\n{ member: \"comments\", kind: \"hasMany\", nullable: null, how: \"For DTO.comments (array transformer)\" }\n```\n\nDO NOT use DTO property names here - this is about Prisma schema members,\nnot DTO properties.",
667
+ description: "Exact Prisma field or relation name from the Prisma schema.\n\nMUST match the Prisma schema exactly (case-sensitive, snake_case).\n\n**Field Types**:\n\n- **Scalar fields**: Database columns (id, email, created_at, unit_price)\n- **BelongsTo relations**: FK relations (customer, article, category)\n- **HasMany relations**: 1:N arrays (tags, comments, reviews)\n- **Aggregations**: Prisma computed fields (_count, _sum, _avg)\n\n**Examples**:\n\n```typescript\n// Scalar fields\n{ member: \"id\", kind: \"scalar\", nullable: false, how: \"For DTO.id\" }\n{ member: \"created_at\", kind: \"scalar\", nullable: false, how: \"For DTO.createdAt (needs .toISOString())\" }\n{ member: \"unit_price\", kind: \"scalar\", nullable: false, how: \"For DTO.price (Decimal \u2192 Number)\" }\n{ member: \"deleted_at\", kind: \"scalar\", nullable: true, how: \"For DTO.deletedAt (nullable DateTime)\" }\n\n// BelongsTo relations \u2014 member is ALWAYS the Prisma relation name,\n// which may differ from the DTO property name\n{ member: \"customer\", kind: \"belongsTo\", nullable: false, how: \"For DTO.buyer (nested transformer)\" }\n{ member: \"user\", kind: \"belongsTo\", nullable: true, how: \"For DTO.voter (optional nested)\" }\n\n// HasMany relations\n{ member: \"tags\", kind: \"hasMany\", nullable: null, how: \"For DTO.tags (array transformer)\" }\n```\n\nDO NOT use DTO property names \u2014 this is about Prisma schema members. Read\nthe Relation Mapping Table and member list to find correct names.",
668
668
  type: "string"
669
669
  },
670
670
  kind: {
671
- description: "The kind of Prisma schema member being selected.\n\nExplicitly identifies whether this member is a scalar field or a relation,\nand if it's a relation, what type of relation it is. This classification\nforces the AI to think through the nature of each member before planning\nwhat to select, preventing common mistakes in the select() function.\n\n**Possible values**:\n\n- `\"scalar\"`: Regular database column (id, email, created_at, unit_price,\n etc.)\n- `\"belongsTo\"`: Foreign key relation pointing to parent entity (customer,\n article, category, etc.)\n- `\"hasOne\"`: One-to-one relation where this side owns the relationship\n- `\"hasMany\"`: One-to-many or many-to-many relation (comments, tags, reviews,\n etc.)\n\n**Why this matters for select()**:\n\n- **Prevents confusion**: AI must consciously identify if \"customer\" is a\n scalar or belongsTo relation\n- **Forces correct select syntax**: belongsTo/hasMany require nested select\n objects, scalar requires `true`\n- **Enables Chain-of-Thought**: AI explicitly thinks about the kind before\n deciding selection strategy\n- **Supports proper data loading**: Different kinds require different\n selection approaches\n\n**Examples by kind**:\n\n```typescript\n// Scalar fields - simple selection\n{ member: \"id\", kind: \"scalar\", nullable: false, how: \"For DTO.id\" }\n{ member: \"email\", kind: \"scalar\", nullable: false, how: \"For DTO.email\" }\n{ member: \"created_at\", kind: \"scalar\", nullable: false, how: \"For DTO.createdAt\" }\n{ member: \"deleted_at\", kind: \"scalar\", nullable: true, how: \"For DTO.deletedAt\" }\n\n// BelongsTo relations - nested selection with transformer\n{ member: \"customer\", kind: \"belongsTo\", nullable: false, how: \"For DTO.customer (nested)\" }\n{ member: \"article\", kind: \"belongsTo\", nullable: false, how: \"For DTO.article (nested)\" }\n{ member: \"parent\", kind: \"belongsTo\", nullable: true, how: \"For DTO.parent (optional)\" }\n\n// HasMany relations - nested selection with array transformer\n{ member: \"tags\", kind: \"hasMany\", nullable: null, how: \"For DTO.tags (array)\" }\n{ member: \"comments\", kind: \"hasMany\", nullable: null, how: \"For DTO.comments (array)\" }\n```\n\nThe `kind` field works together with `nullable` and `how`: kind identifies\nWHAT it is, nullable identifies IF it's optional, how explains WHY we're\nselecting it.",
671
+ description: "Kind of Prisma schema member.\n\n- `\"scalar\"`: Regular column \u2192 `{ field: true }`\n- `\"belongsTo\"`: FK relation \u2192 `{ relation: { select: ... } }`\n- `\"hasOne\"`: 1:1 relation \u2192 nested select\n- `\"hasMany\"`: 1:N relation \u2192 `{ relation: { select: ... } }`\n\nThe kind forces explicit classification of each member BEFORE deciding\nselect syntax, preventing confusion between scalars and relations.",
672
672
  type: "string",
673
673
  "enum": [
674
674
  "scalar",
@@ -678,7 +678,7 @@ function createController(props) {
678
678
  ]
679
679
  },
680
680
  nullable: {
681
- description: "Whether this Prisma member is nullable in the schema.\n\nThis property explicitly documents whether a field/relation can be null,\nforcing the AI to understand nullability constraints before deciding\nselection strategy. This affects how the transform() function will handle\nthe data.\n\n**Value semantics by kind**:\n\n- **For scalar fields** (`kind: \"scalar\"`):\n\n - `false`: Non-nullable column (e.g., `email String`, `id String`)\n\n - Will always have a value in the selected data\n - Transform() can safely access without null checks\n - Example: `created_at DateTime` \u2192 `nullable: false`\n - `true`: Nullable column (e.g., `deleted_at DateTime?`)\n\n - Might be null in the selected data\n - Transform() must handle null case (e.g., `?? null`)\n - Example: `deleted_at DateTime?` \u2192 `nullable: true`\n- **For belongsTo relations** (`kind: \"belongsTo\"`):\n\n - `false`: Required foreign key (e.g., `customer_id String`)\n\n - Relation will always exist in the selected data\n - Transform() can safely use the nested transformer\n - Example: `customer` relation \u2192 `nullable: false`\n - `true`: Optional foreign key (e.g., `parent_id String?`)\n\n - Relation might not exist in the selected data\n - Transform() must handle null case\n - Example: `parent` relation \u2192 `nullable: true`\n- **For hasMany/hasOne relations** (`kind: \"hasMany\"` or `kind: \"hasOne\"`):\n\n - Always `null`: Nullability concept doesn't apply to these relations\n\n - HasMany: Always returns array (empty or populated)\n - HasOne: Handled differently in Prisma\n - The `nullable` property has no semantic meaning\n\n**Why this matters for select()**:\n\n- **Informs transform() handling**: Knowing nullability helps plan correct\n transformation\n- **Validates selection strategy**: Nullable fields need different handling\n in transform()\n- **Supports Chain-of-Thought**: AI must think about nullability BEFORE\n deciding selection\n- **Documents schema constraints**: Makes nullability explicit for validation\n\n**Examples**:\n\n```typescript\n// Non-nullable scalar (nullable: false)\n{ member: \"id\", kind: \"scalar\", nullable: false, how: \"For DTO.id\" }\n{ member: \"email\", kind: \"scalar\", nullable: false, how: \"For DTO.email\" }\n{ member: \"created_at\", kind: \"scalar\", nullable: false, how: \"For DTO.createdAt\" }\n\n// Nullable scalar (nullable: true)\n{ member: \"deleted_at\", kind: \"scalar\", nullable: true, how: \"For DTO.deletedAt (nullable)\" }\n{ member: \"description\", kind: \"scalar\", nullable: true, how: \"For DTO.description (optional)\" }\n\n// Required belongsTo (nullable: false)\n{ member: \"customer\", kind: \"belongsTo\", nullable: false, how: \"For DTO.customer (nested)\" }\n{ member: \"article\", kind: \"belongsTo\", nullable: false, how: \"For DTO.article (nested)\" }\n\n// Optional belongsTo (nullable: true)\n{ member: \"parent\", kind: \"belongsTo\", nullable: true, how: \"For DTO.parent (optional)\" }\n{ member: \"category\", kind: \"belongsTo\", nullable: true, how: \"For DTO.category (optional)\" }\n\n// HasMany relations (nullable: null - not applicable)\n{ member: \"comments\", kind: \"hasMany\", nullable: null, how: \"For DTO.comments (array)\" }\n{ member: \"tags\", kind: \"hasMany\", nullable: null, how: \"For DTO.tags (array)\" }\n```\n\nThe `nullable` property works with `kind` and `how`: kind identifies WHAT\nit is, nullable identifies IF it's optional, how explains WHY we're\nselecting it.",
681
+ description: "Whether nullable in Prisma schema.\n\n- `false`: Always present \u2014 transform() can safely access\n- `true`: May be null \u2014 transform() must handle null case\n- `null`: Not applicable (hasMany/hasOne)",
682
682
  anyOf: [
683
683
  {
684
684
  type: "null"
@@ -689,7 +689,7 @@ function createController(props) {
689
689
  ]
690
690
  },
691
691
  how: {
692
- description: "Brief one-line explanation of why this Prisma field is being selected.\n\nKeep it concise and clear. Focus on which DTO property(ies) need this data.\n\n**For Write Phase** (planning field selection):\n\n- \"For DTO.id\"\n- \"For DTO.email\"\n- \"For DTO.createdAt (needs .toISOString())\"\n- \"For DTO.deletedAt (nullable DateTime)\"\n- \"For DTO.price (Decimal \u2192 Number conversion)\"\n- \"For DTO.totalPrice computation (with quantity)\"\n- \"For DTO.reviewCount aggregation\"\n- \"For DTO.isExpired computation\"\n- \"For DTO.customer (nested CustomerTransformer)\"\n- \"For DTO.tags (array TagTransformer)\"\n- \"For nested transformer's select() requirements\"\n\n**For Correct Phase** (documenting current state and fixes):\n\n- \"No change needed - correct\"\n- \"Already correct\"\n- \"Fix: Wrong field name 'user_email' \u2192 'email'\"\n- \"Fix: Missing field - add for DTO.totalPrice\"\n- \"Fix: Should use select, not include\"\n- \"Fix: Missing aggregation - add _count\"\n- \"Fix: Fabricated field - remove it\"\n- \"Fix: Selecting unused field - remove it\"\n\nEven if a selection is correct, you MUST include it in the mapping and\nexplain why. This ensures complete coverage and alignment with\ntransform().\n\nThis is NOT code - just a simple description of the selection purpose.",
692
+ description: "Brief reason for selecting this field (NOT code).\n\nWrite phase: \"For DTO.id\", \"For DTO.createdAt (needs .toISOString())\", \"For\nDTO.customer (nested transformer)\".\n\nCorrect phase: \"No change needed\", \"Fix: Missing field \u2014 add for\nDTO.totalPrice\".\n\nEven if correct, you MUST include it in the mapping. This ensures complete\ncoverage and alignment with transform().",
693
693
  type: "string"
694
694
  }
695
695
  },
@@ -701,15 +701,15 @@ function createController(props) {
701
701
  ]
702
702
  },
703
703
  AutoBeRealizeTransformerTransformMapping: {
704
- description: "Single DTO property transformation mapping for the transform() function.\n\nDocuments how to transform Prisma payload data into each specific DTO\nproperty in the transform() function. This structured approach ensures\ncomplete DTO coverage by requiring explicit documentation for EVERY property\n\n- Including those requiring special transformations or computed from multiple\n Prisma fields.\n\n**Purpose**:\n\n- Prevents property omissions through systematic coverage verification\n- Forces explicit decision-making for each DTO property transformation\n- Enables validation before code generation (Write) or correction (Correct)\n- Creates clear documentation of transformation logic\n\n**Usage Contexts**:\n\n- **Write Phase**: Plan how to transform each Prisma field \u2192 DTO property in\n transform()\n- **Correct Phase**: Document current state and correction plan for each\n property in transform()\n\nThe validator cross-checks mappings against the DTO type definition to ensure\nnothing is overlooked, rejecting incomplete mappings.\n\n**Critical Principle**:\n\nThis mapping is ONLY for the transform() function - it documents how to build\nthe DTO return object. The corresponding select() function requirements are\ndocumented separately in AutoBeRealizeTransformerSelectMapping.",
704
+ description: "DTO property transformation mapping for the transform() function.\n\nDocuments how to transform Prisma payload data into each DTO property. EVERY\nDTO property must be listed \u2014 the validator rejects incomplete mappings.",
705
705
  type: "object",
706
706
  properties: {
707
707
  property: {
708
- description: "Exact DTO property name from the DTO type definition.\n\nMUST match the DTO interface exactly (case-sensitive). Examples:\n\n- Scalar properties: \"id\", \"email\", \"createdAt\"\n- Computed properties: \"totalPrice\", \"reviewCount\", \"isExpired\"\n- Nested objects: \"customer\", \"article\"\n- Arrays: \"tags\", \"comments\"\n\nUse camelCase as DTOs follow TypeScript conventions (unlike Prisma's\nsnake_case).\n\nInclude ALL properties from the DTO, even if they require complex\ntransformations or are computed from multiple Prisma fields.\n\n**Examples**:\n\n```typescript\n// Direct scalar mappings\n{ property: \"id\", how: \"From prisma.id\" }\n{ property: \"email\", how: \"From prisma.email\" }\n{ property: \"createdAt\", how: \"From prisma.created_at.toISOString()\" }\n\n// Type conversions\n{ property: \"price\", how: \"From prisma.unit_price (Decimal \u2192 Number)\" }\n{ property: \"deletedAt\", how: \"From prisma.deleted_at?.toISOString() ?? null\" }\n\n// Computed properties\n{ property: \"totalPrice\", how: \"Compute: prisma.unit_price * prisma.quantity\" }\n{ property: \"reviewCount\", how: \"From prisma._count.reviews\" }\n{ property: \"isExpired\", how: \"Compute: prisma.expiry_date < new Date()\" }\n\n// Nested transformations\n{ property: \"customer\", how: \"Transform with CustomerTransformer\" }\n{ property: \"tags\", how: \"Array map with TagTransformer\" }\n```",
708
+ description: "Exact DTO property name (case-sensitive, camelCase).\n\nInclude ALL properties: direct mappings, type conversions, computed values,\nand nested transformations.\n\n**Examples**:\n\n```typescript\n// Direct scalar mappings\n{ property: \"id\", how: \"From prisma.id\" }\n{ property: \"createdAt\", how: \"From prisma.created_at.toISOString()\" }\n\n// Type conversions\n{ property: \"price\", how: \"From prisma.unit_price (Decimal \u2192 Number)\" }\n{ property: \"deletedAt\", how: \"From prisma.deleted_at?.toISOString() ?? null\" }\n\n// Computed properties\n{ property: \"totalPrice\", how: \"Compute: prisma.unit_price * prisma.quantity\" }\n{ property: \"reviewCount\", how: \"From prisma._count.reviews\" }\n\n// Nested transformations (reuse neighbor transformers)\n{ property: \"customer\", how: \"Transform with CustomerTransformer\" }\n{ property: \"tags\", how: \"Array map with TagTransformer\" }\n```",
709
709
  type: "string"
710
710
  },
711
711
  how: {
712
- description: "Brief one-line explanation of how to obtain this property's value from\nPrisma.\n\nKeep it concise and clear.\n\n**For Write Phase** (planning transformation strategy):\n\n- \"From prisma.email\"\n- \"From prisma.created_at.toISOString()\"\n- \"From prisma.unit_price (Decimal \u2192 Number)\"\n- \"From prisma.deleted_at?.toISOString() ?? null\"\n- \"Compute: prisma.unit_price * prisma.quantity\"\n- \"From prisma._count.reviews\"\n- \"Compute: prisma.expiry_date < new Date()\"\n- \"Transform with CustomerTransformer\"\n- \"Array map with TagTransformer\"\n- \"From prisma.customer.name (nested field)\"\n\n**For Correct Phase** (documenting current state and fixes):\n\n- \"No change needed - correct\"\n- \"Already correct\"\n- \"Fix: Wrong property name 'userEmail' \u2192 'email'\"\n- \"Fix: Missing property - add from prisma.total_price\"\n- \"Fix: Wrong transformation - should use .toISOString()\"\n- \"Fix: Should use TagTransformer instead of inline\"\n- \"Fix: Missing Decimal conversion\"\n- \"Fix: Fabricated property - remove it\"\n\nEven if a property is correct, you MUST include it in the mapping and\nexplain why. This ensures complete DTO coverage.\n\nThis is NOT code - just a simple description of the transformation\nstrategy.",
712
+ description: "Brief strategy for obtaining this property's value (NOT code).\n\nWrite phase: \"From prisma.email\", \"From prisma.created_at.toISOString()\",\n\"From prisma.deleted_at?.toISOString() ?? null\", \"From prisma.unit_price\n(Decimal \u2192 Number)\", \"Transform with CustomerTransformer\", \"Array map with\nTagTransformer\", \"Compute: prisma.unit_price * prisma.quantity\".\n\nCorrect phase: \"No change needed\", \"Fix: Missing Decimal conversion\", \"Fix:\nShould use TagTransformer instead of inline\".\n\nEven if correct, you MUST include it. This ensures complete DTO coverage.",
713
713
  type: "string"
714
714
  }
715
715
  },
@@ -722,11 +722,11 @@ function createController(props) {
722
722
  type: "object",
723
723
  properties: {
724
724
  review: {
725
- description: "Critical review and improvement analysis.\n\nMUST systematically verify using four checklists:\n\n1. Schema Fidelity - Cross-check EVERY field name against plan Section 1\n inventory\n2. Plan Adherence - Verify EVERY mapping from Section 3 in BOTH select() and\n transform()\n3. System Rules - Mandatory neighbor reuse, function order, select (not\n include)\n4. Type Safety - Type casts (Decimal\u2192Number, DateTime\u2192ISO), nullable\n handling\n\nIdentify specific issues with line numbers and provide clear reasoning.\nThis catches hallucinated fields, missing transformations, and rule\nviolations.",
725
+ description: "MUST systematically verify four checklists:\n\n1. Schema Fidelity \u2014 cross-check EVERY field name against plan Section 1\n2. Plan Adherence \u2014 verify EVERY mapping from Section 3 in BOTH select() and\n transform()\n3. System Rules \u2014 neighbor reuse, function order, select (not include)\n4. Type Safety \u2014 Decimal\u2192Number, DateTime\u2192ISO, nullable handling\n\nIdentify issues with line numbers. This catches hallucinated fields,\nmissing transformations, and rule violations.",
726
726
  type: "string"
727
727
  },
728
728
  final: {
729
- description: "Final transformer code with all review improvements applied.\n\nApply ALL fixes identified in the review to produce production-ready\ncode. If review found issues, this MUST contain the corrected\nimplementation.\n\nReturn `null` ONLY if the draft is already perfect and review found zero\nissues.",
729
+ description: "Final transformer code with all review improvements applied, or null if\ndraft needs no changes.",
730
730
  anyOf: [
731
731
  {
732
732
  type: "null"
@@ -744,7 +744,7 @@ function createController(props) {
744
744
  }
745
745
  }
746
746
  },
747
- description: "Process transformer generation task or preliminary data requests.\n\nGenerates complete transformer module through three-phase workflow (plan \u2192\ndraft \u2192 revise). Ensures type safety, proper Prisma payload types, and\ncorrect DTO mapping.",
747
+ description: "Process transformer generation task or preliminary data requests.",
748
748
  validate: (() => { const _io0 = input => "string" === typeof input.thinking && ("object" === typeof input.request && null !== input.request && _iu0(input.request)); const _io1 = input => "getDatabaseSchemas" === input.type && (Array.isArray(input.schemaNames) && (1 <= input.schemaNames.length && input.schemaNames.every(elem => "string" === typeof elem))); const _io2 = input => "complete" === input.type && "string" === typeof input.plan && (Array.isArray(input.selectMappings) && input.selectMappings.every(elem => "object" === typeof elem && null !== elem && _io3(elem))) && (Array.isArray(input.transformMappings) && input.transformMappings.every(elem => "object" === typeof elem && null !== elem && _io4(elem))) && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io5(input.revise)); const _io3 = input => "string" === typeof input.member && ("scalar" === input.kind || "belongsTo" === input.kind || "hasOne" === input.kind || "hasMany" === input.kind) && (null === input.nullable || "boolean" === typeof input.nullable) && "string" === typeof input.how; const _io4 = input => "string" === typeof input.property && "string" === typeof input.how; const _io5 = input => "string" === typeof input.review && (null === input.final || "string" === typeof input.final); const _iu0 = input => (() => {
749
749
  if ("getDatabaseSchemas" === input.type)
750
750
  return _io1(input);
@@ -8,6 +8,19 @@ export declare namespace AutoBeRealizeTransformerProgrammer {
8
8
  }): boolean;
9
9
  function getName(dtoTypeName: string): string;
10
10
  function getNeighbors(code: string): string[];
11
+ function getRelationMappingTable(props: {
12
+ application: AutoBeDatabase.IApplication;
13
+ model: AutoBeDatabase.IModel;
14
+ }): Array<{
15
+ propertyKey: string;
16
+ targetModel: string;
17
+ relationType: string;
18
+ fkColumns: string;
19
+ }>;
20
+ function formatRelationMappingTable(props: {
21
+ application: AutoBeDatabase.IApplication;
22
+ model: AutoBeDatabase.IModel;
23
+ }): string;
11
24
  function getSelectMappingMetadata(props: {
12
25
  application: AutoBeDatabase.IApplication;
13
26
  model: AutoBeDatabase.IModel;
@@ -19,6 +32,7 @@ export declare namespace AutoBeRealizeTransformerProgrammer {
19
32
  function writeTemplate(props: {
20
33
  plan: AutoBeRealizeTransformerPlan;
21
34
  schema: AutoBeOpenApi.IJsonSchemaDescriptive.IObject;
35
+ schemas: Record<string, AutoBeOpenApi.IJsonSchema>;
22
36
  }): string;
23
37
  function writeStructures(ctx: AutoBeContext, dtoTypeName: string): Promise<Record<string, string>>;
24
38
  function replaceImportStatements(ctx: AutoBeContext, props: {
@@ -39,6 +53,10 @@ export declare namespace AutoBeRealizeTransformerProgrammer {
39
53
  final: string | null;
40
54
  };
41
55
  }): IValidation.IError[];
56
+ function getRecursiveProperty(props: {
57
+ schemas: Record<string, AutoBeOpenApi.IJsonSchema>;
58
+ typeName: string;
59
+ }): string | null;
42
60
  const fixApplication: (props: {
43
61
  definition: ILlmApplication;
44
62
  application: AutoBeDatabase.IApplication;