@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
@@ -107,7 +107,7 @@ function process(ctx, props) {
107
107
  properties: {
108
108
  thinking: {
109
109
  type: "string",
110
- 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 collector 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 collector 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."
110
+ 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."
111
111
  },
112
112
  request: {
113
113
  oneOf: [
@@ -125,7 +125,7 @@ function process(ctx, props) {
125
125
  complete: "#/components/schemas/IAutoBeRealizeCollectorWriteApplication.IComplete"
126
126
  }
127
127
  },
128
- 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 collector implementation\n\nAll necessary DTO type information is obtained transitively from the DTO\ntype names provided in the plan (AutoBeRealizeCollectorPlan). 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."
128
+ description: "Action to perform. Exhausted preliminary types are removed from the\nunion, physically preventing repeated calls."
129
129
  }
130
130
  },
131
131
  required: [
@@ -138,7 +138,7 @@ function process(ctx, props) {
138
138
  properties: {
139
139
  type: {
140
140
  "const": "getDatabaseSchemas",
141
- 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."
141
+ description: "Type discriminator."
142
142
  },
143
143
  schemaNames: {
144
144
  type: "array",
@@ -146,14 +146,14 @@ function process(ctx, props) {
146
146
  type: "string"
147
147
  },
148
148
  minItems: 1,
149
- 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."
149
+ description: "Database table names to retrieve. DO NOT request same names already\nrequested in previous calls."
150
150
  }
151
151
  },
152
152
  required: [
153
153
  "type",
154
154
  "schemaNames"
155
155
  ],
156
- 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."
156
+ description: "Request to retrieve database schema definitions for context."
157
157
  },
158
158
  "IAutoBeRealizeCollectorWriteApplication.IComplete": {
159
159
  type: "object",
@@ -164,22 +164,22 @@ function process(ctx, props) {
164
164
  },
165
165
  plan: {
166
166
  type: "string",
167
- description: "Collector 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 mapping table for every field\n4. Edge Cases and Special Handling - Nullable, arrays, conditionals\n\nThis forces you to READ the actual schema (not imagine it) and creates an\nexplicit specification that the draft must implement."
167
+ description: "Collector 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 mapping for every field\n4. Edge Cases and Special Handling \u2014 nullable, arrays, conditionals\n\nThis forces you to READ the actual schema (not imagine it) and creates an\nexplicit specification that the draft must implement."
168
168
  },
169
169
  mappings: {
170
170
  type: "array",
171
171
  items: {
172
172
  $ref: "#/components/schemas/AutoBeRealizeCollectorMapping"
173
173
  },
174
- description: "Field-by-field mapping table for complete database coverage.\n\nMUST include EVERY field and relation from the database schema - no\nexceptions. Each mapping specifies:\n\n- `member`: Exact field/relation name from database schema\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`: How to obtain/generate the value for that field\n\nThe `kind` property forces explicit classification of each member BEFORE\ndeciding how to handle it, preventing common errors like treating\nbelongsTo relations as scalar fields.\n\nThe `nullable` property forces explicit identification of nullability\nconstraints BEFORE deciding handling strategy, preventing errors like\nassigning null to non-nullable fields or using null instead of undefined\nfor optional relations.\n\nMissing even a single field will cause validation failure and trigger\nregeneration.\n\nThis structured approach:\n\n- Prevents field omissions through systematic coverage\n- Forces explicit decision-making for each field (kind + nullable + how)\n- Prevents confusion between scalar fields and relations\n- Prevents null assignment errors through explicit nullability tracking\n- Enables validation before code generation\n- Creates clear documentation of field handling strategy\n\nThe validator will cross-check this list against the actual database\nschema and reject incomplete mappings."
174
+ description: "Field-by-field mapping for complete database coverage.\n\nMUST include EVERY field and relation from the database schema \u2014 no\nexceptions. Each mapping specifies:\n\n- `member`: Exact Prisma field/relation name \u2014 read from schema, NOT from\n DTO property names or FK column names\n- `kind`: scalar, belongsTo, hasOne, or hasMany\n- `nullable`: true/false for scalar/belongsTo, null for hasMany/hasOne\n- `how`: How to obtain/generate the value for that field\n\nThe `kind` property forces explicit classification BEFORE deciding how to\nhandle it, preventing errors like treating belongsTo as scalar.\n\nMissing even a single field will cause validation failure."
175
175
  },
176
176
  draft: {
177
177
  type: "string",
178
- description: "Initial collector implementation draft.\n\nComplete implementation that strictly follows the plan's mapping table.\nEVERY field in the plan's Section 3 mapping strategy MUST appear in this\ndraft. Implement:\n\n- Namespace with collect() function\n- All field mappings from plan (direct, connect, nested create)\n- Neighbor collector reuse (NEVER inline when collector exists)\n- UUID generation with v4(), proper Prisma CreateInput types"
178
+ description: "Complete implementation following plan's mapping table. EVERY field from\nplan Section 3 MUST appear. Implement:\n\n- Namespace with collect() function\n- All field mappings (direct, connect, nested create)\n- Neighbor collector reuse (NEVER inline when collector exists)\n- UUID generation with v4(), proper Prisma CreateInput types"
179
179
  },
180
180
  revise: {
181
181
  $ref: "#/components/schemas/IAutoBeRealizeCollectorWriteApplication.IReviseProps",
182
- description: "Revision and finalization phase.\n\nReviews the draft implementation and produces the final code with all\nimprovements and corrections applied."
182
+ description: "Reviews draft and produces final code."
183
183
  }
184
184
  },
185
185
  required: [
@@ -189,14 +189,14 @@ function process(ctx, props) {
189
189
  "draft",
190
190
  "revise"
191
191
  ],
192
- description: "Request to generate collector module implementation.\n\nExecutes three-phase generation to create complete collector with:\n\n- Collect() function: Converts DTO to database input\n- Proper handling of nested relationships\n- UUID generation for new records\n- Type-safe Prisma create/connect syntax\n\nFollows plan \u2192 draft \u2192 revise pattern to ensure type safety and correct\nrelationship handling."
192
+ description: "Generate collector module via plan/draft/revise."
193
193
  },
194
194
  AutoBeRealizeCollectorMapping: {
195
195
  type: "object",
196
196
  properties: {
197
197
  member: {
198
198
  type: "string",
199
- description: "Exact field or relation name from Prisma schema.\n\nMUST match the schema exactly (case-sensitive). Examples:\n\n- Scalar fields: \"id\", \"email\", \"created_at\"\n- BelongsTo relations: \"customer\", \"article\"\n- HasMany relations: \"comments\", \"shopping_sale_tags\"\n\nDO NOT use database column names (e.g., \"customer_id\" is WRONG - use\n\"customer\").\n\nInclude ALL fields from the schema, even if they are optional or not used\nin this particular collector."
199
+ description: "Exact field or relation name from Prisma schema (case-sensitive).\n\n**Examples**:\n\n```typescript\n// Scalar fields\n{ member: \"id\", kind: \"scalar\", nullable: false, how: \"Generate with v4()\" }\n{ member: \"email\", kind: \"scalar\", nullable: false, how: \"From props.body.email\" }\n{ member: \"created_at\", kind: \"scalar\", nullable: false, how: \"Default to new Date()\" }\n{ member: \"description\", kind: \"scalar\", nullable: true, how: \"From props.body.description ?? null\" }\n\n// BelongsTo relations \u2014 use Prisma RELATION name, NOT FK column name\n{ member: \"customer\", kind: \"belongsTo\", nullable: false, how: \"Connect using props.customer.id\" }\n{ member: \"parent\", kind: \"belongsTo\", nullable: true, how: \"Undefined (nullable FK)\" }\n\n// HasMany relations\n{ member: \"tags\", kind: \"hasMany\", nullable: null, how: \"Nested create with TagCollector\" }\n{ member: \"comments\", kind: \"hasMany\", nullable: null, how: \"Not needed (optional has-many)\" }\n```\n\nDO NOT use FK column names (e.g., \"customer_id\" is WRONG \u2014 use \"customer\").\nInclude ALL members even if unused in this collector."
200
200
  },
201
201
  kind: {
202
202
  oneOf: [
@@ -213,7 +213,7 @@ function process(ctx, props) {
213
213
  "const": "hasMany"
214
214
  }
215
215
  ],
216
- description: "The kind of Prisma schema member.\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\nhow to handle it, preventing common mistakes like treating belongsTo\nrelations as scalar fields.\n\n**Possible values**:\n\n- `\"scalar\"`: Regular database column (id, email, created_at, total_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**:\n\n- **Prevents confusion**: AI must consciously identify if \"customer\" is a\n relation (needs `{ connect: { id: ... } }`) or a scalar field\n- **Forces correct syntax**: belongsTo requires `connect`, hasMany requires\n `create`, scalar requires direct value assignment\n- **Enables Chain-of-Thought**: AI explicitly thinks about the kind before\n deciding the handling strategy in the `how` field\n- **Catches common errors**: Prevents treating FK relations as scalar IDs\n\n**Examples by kind**:\n\n```typescript\n// Scalar fields\n{ member: \"id\", kind: \"scalar\", nullable: false, how: \"Generate with v4()\" }\n{ member: \"email\", kind: \"scalar\", nullable: false, how: \"From props.body.email\" }\n{ member: \"created_at\", kind: \"scalar\", nullable: false, how: \"Default to new Date()\" }\n{ member: \"description\", kind: \"scalar\", nullable: true, how: \"From props.body.description ?? null\" }\n\n// BelongsTo relations (FK pointing to parent)\n{ member: \"customer\", kind: \"belongsTo\", nullable: false, how: \"Connect using props.customer.id\" }\n{ member: \"article\", kind: \"belongsTo\", nullable: false, how: \"Connect using props.article.id\" }\n{ member: \"parent\", kind: \"belongsTo\", nullable: true, how: \"Undefined (nullable FK)\" }\n\n// HasMany relations (reverse side of FK)\n{ member: \"comments\", kind: \"hasMany\", nullable: null, how: \"Not needed (optional has-many)\" }\n{ member: \"tags\", kind: \"hasMany\", nullable: null, how: \"Nested create with TagCollector\" }\n{ member: \"reviews\", kind: \"hasMany\", nullable: null, how: \"Not applicable for this collector\" }\n```\n\nThe `kind` field works together with `nullable` and `how`: kind identifies\nWHAT it is, nullable identifies IF it's optional, how explains HOW to\nhandle it."
216
+ description: "Kind of Prisma schema member.\n\n- `\"scalar\"`: Regular column \u2192 direct value assignment\n- `\"belongsTo\"`: FK relation \u2192 `{ connect: { id } }`\n- `\"hasOne\"`: 1:1 relation this side owns\n- `\"hasMany\"`: 1:N or M:N \u2192 `{ create: [...] }` or omit\n\nThe kind forces explicit classification BEFORE deciding how to handle it,\npreventing confusion like treating belongsTo relations as scalar fields."
217
217
  },
218
218
  nullable: {
219
219
  oneOf: [
@@ -224,11 +224,11 @@ function process(ctx, props) {
224
224
  type: "boolean"
225
225
  }
226
226
  ],
227
- description: "Whether this member is nullable in the Prisma schema.\n\nThis property explicitly documents whether a field/relation can be null,\nforcing the AI to understand nullability constraints before deciding how to\nhandle the member. This prevents errors like assigning null to non-nullable\nfields or forgetting to handle optional relations properly.\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 - Must always have a value\n - Cannot use `null` or `undefined`\n - Example: `email: props.body.email` (required)\n - `true`: Nullable column (e.g., `description String?`, `deleted_at\n DateTime?`)\n\n - Can be null\n - Use `?? null` pattern for optional DTO values\n - Example: `description: props.body.description ?? null`\n- **For belongsTo relations** (`kind: \"belongsTo\"`):\n\n - `false`: Required foreign key (e.g., `customer_id String`)\n\n - Must always connect to parent entity\n - Cannot use `undefined`\n - Example: `customer: { connect: { id: props.customer.id } }`\n - `true`: Optional foreign key (e.g., `parent_id String?`, `category_id\n String?`)\n\n - Can be omitted\n - Use `undefined` (NOT `null`) when not provided\n - Example: `parent: props.body.parentId ? { connect: { id:\n props.body.parentId } } : undefined`\n- **For hasMany/hasOne relations** (`kind: \"hasMany\"` or `kind: \"hasOne\"`):\n\n - Always `null`: Nullability concept doesn't apply to relation arrays/objects\n\n - HasMany: Always optional (empty array or nested creates)\n - HasOne: Handled differently (create or omit)\n - The `nullable` property has no semantic meaning for these kinds\n\n**Why this matters**:\n\n- **Prevents null assignment errors**: Can't assign null to non-nullable\n fields\n- **Forces correct optional handling**: nullable: true \u2192 use `?? null` or\n `undefined`\n- **Catches required field omissions**: nullable: false \u2192 must provide value\n- **Enables proper FK handling**: nullable belongsTo \u2192 use `undefined` not\n `null`\n- **Supports Chain-of-Thought**: AI must think about nullability BEFORE\n deciding handling strategy\n\n**Examples**:\n\n```typescript\n// Non-nullable scalar (nullable: false)\n{ member: \"id\", kind: \"scalar\", nullable: false, how: \"Generate with v4()\" }\n{ member: \"email\", kind: \"scalar\", nullable: false, how: \"From props.body.email\" }\n{ member: \"created_at\", kind: \"scalar\", nullable: false, how: \"Default to new Date()\" }\n\n// Nullable scalar (nullable: true)\n{ member: \"description\", kind: \"scalar\", nullable: true, how: \"From props.body.description ?? null\" }\n{ member: \"deleted_at\", kind: \"scalar\", nullable: true, how: \"Default to null\" }\n{ member: \"completed_at\", kind: \"scalar\", nullable: true, how: \"From props.body.completedAt ?? null\" }\n\n// Required belongsTo (nullable: false)\n{ member: \"customer\", kind: \"belongsTo\", nullable: false, how: \"Connect using props.customer.id\" }\n{ member: \"article\", kind: \"belongsTo\", nullable: false, how: \"Connect using props.article.id\" }\n\n// Optional belongsTo (nullable: true)\n{ member: \"parent\", kind: \"belongsTo\", nullable: true, how: \"Undefined (nullable FK)\" }\n{ member: \"category\", kind: \"belongsTo\", nullable: true, how: \"Connect using props.body.categoryId or undefined\" }\n\n// HasMany relations (nullable: null - not applicable)\n{ member: \"comments\", kind: \"hasMany\", nullable: null, how: \"Not needed (optional has-many)\" }\n{ member: \"tags\", kind: \"hasMany\", nullable: null, how: \"Nested create with TagCollector\" }\n{ member: \"reviews\", kind: \"hasMany\", nullable: null, how: \"Not applicable for this collector\" }\n```\n\nThe `nullable` property works with `kind` to determine the correct Prisma\nsyntax: kind identifies WHAT it is, nullable identifies IF it's optional,\nhow explains HOW to handle it."
227
+ description: "Whether nullable in Prisma schema.\n\n- `false`: Non-nullable \u2014 must provide value\n- `true`: Nullable \u2014 use `?? null` for scalar, `undefined` for belongsTo\n- `null`: Not applicable (hasMany/hasOne)"
228
228
  },
229
229
  how: {
230
230
  type: "string",
231
- description: "Brief one-line explanation of how to obtain this field's value.\n\nKeep it concise and clear.\n\n**For Write Phase** (planning field generation):\n\n- \"Generate with v4()\"\n- \"From props.body.email\"\n- \"Connect using props.references.customer_id\"\n- \"Nested create with ShoppingSaleTagCollector\"\n- \"Query comment to get article_id\"\n- \"Default to new Date()\"\n- \"Undefined (nullable FK)\"\n- \"Not applicable for this collector\"\n- \"Not needed (optional has-many)\"\n\n**For Correct Phase** (documenting current state and fixes):\n\n- \"No change needed - correct\"\n- \"Already correct\"\n- \"Fix: Wrong name 'user_email' \u2192 'email'\"\n- \"Fix: Missing field - add with props.body.email\"\n- \"Fix: Wrong type - change to connect syntax\"\n- \"Fix: Should use CustomerCollector instead of inline\"\n- \"Fix: Using null instead of undefined\"\n- \"Fix: Fabricated field - remove it\"\n\nEven if a field is correct or not used, you MUST include it in the mapping\nand explain why. This ensures complete schema coverage.\n\nThis is NOT code - just a simple description of the strategy."
231
+ description: "Brief strategy for obtaining this field's value (NOT code).\n\nWrite phase: \"Generate with v4()\", \"From props.body.email\", \"Connect using\nprops.customer.id\", \"Nested create with TagCollector\".\n\nCorrect phase: \"No change needed\", \"Fix: Wrong name 'x' \u2192 'y'\".\n\nEven if correct or unused, you MUST include it. This ensures complete\nschema coverage."
232
232
  }
233
233
  },
234
234
  required: [
@@ -237,14 +237,14 @@ function process(ctx, props) {
237
237
  "nullable",
238
238
  "how"
239
239
  ],
240
- description: "Single field/relation mapping strategy for Prisma CreateInput generation.\n\nDocuments the handling strategy for one specific field or relation in the\nPrisma CreateInput. This structured approach ensures complete schema coverage\nby requiring explicit documentation for EVERY field - including those not\nused or not applicable.\n\n**Purpose**:\n\n- Prevents field omissions through systematic coverage verification\n- Forces explicit decision-making for each Prisma schema member\n- Enables validation before code generation (Write) or correction (Correct)\n- Creates clear documentation of field handling strategy\n\n**Usage Contexts**:\n\n- **Write Phase**: Plan how to generate each field from DTO \u2192 Prisma\n- **Correct Phase**: Document current state and correction plan for each field\n\nThe validator cross-checks mappings against the Prisma schema to ensure\nnothing is overlooked, rejecting incomplete mappings."
240
+ description: "Field/relation mapping for Prisma CreateInput generation.\n\nDocuments handling strategy for ONE Prisma schema member. EVERY field and\nrelation must be listed \u2014 the validator rejects incomplete mappings."
241
241
  },
242
242
  "IAutoBeRealizeCollectorWriteApplication.IReviseProps": {
243
243
  type: "object",
244
244
  properties: {
245
245
  review: {
246
246
  type: "string",
247
- 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 plan Section 3 is implemented\n3. System Rules - Mandatory neighbor reuse, props structure, satisfies type\n4. Type Safety - Compilation check, nullable handling, async/await\n\nIdentify specific issues with line numbers and provide clear reasoning.\nThis catches hallucinated fields, missing mappings, and rule violations."
247
+ 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 is implemented\n3. System Rules \u2014 neighbor reuse, props structure, satisfies type\n4. Type Safety \u2014 compilation check, nullable handling, async/await\n\nIdentify issues with line numbers. This catches hallucinated fields,\nmissing mappings, and rule violations."
248
248
  },
249
249
  final: {
250
250
  oneOf: [
@@ -255,7 +255,7 @@ function process(ctx, props) {
255
255
  type: "string"
256
256
  }
257
257
  ],
258
- description: "Final collector 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."
258
+ description: "Final collector code with all review improvements applied, or null if\ndraft needs no changes."
259
259
  }
260
260
  },
261
261
  required: [
@@ -279,7 +279,7 @@ function process(ctx, props) {
279
279
  }
280
280
  }
281
281
  ],
282
- description: "Process collector generation task or preliminary data requests.\n\nGenerates complete collector module through three-phase workflow (plan \u2192\ndraft \u2192 revise). Ensures type safety, proper database input types, and\ncorrect relationship handling."
282
+ description: "Process collector generation task or preliminary data requests."
283
283
  }
284
284
  ]
285
285
  },
@@ -507,11 +507,11 @@ function createController(ctx, props) {
507
507
  type: "object",
508
508
  properties: {
509
509
  thinking: {
510
- 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 collector 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 collector 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.",
510
+ 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.",
511
511
  type: "string"
512
512
  },
513
513
  request: {
514
- 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 collector implementation\n\nAll necessary DTO type information is obtained transitively from the DTO\ntype names provided in the plan (AutoBeRealizeCollectorPlan). 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.",
514
+ description: "Action to perform. Exhausted preliminary types are removed from the\nunion, physically preventing repeated calls.",
515
515
  anyOf: [
516
516
  {
517
517
  $ref: "#/$defs/IAutoBePreliminaryGetDatabaseSchemas"
@@ -536,18 +536,18 @@ function createController(ctx, props) {
536
536
  additionalProperties: false,
537
537
  $defs: {
538
538
  IAutoBePreliminaryGetDatabaseSchemas: {
539
- 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.",
539
+ description: "Request to retrieve database schema definitions for context.",
540
540
  type: "object",
541
541
  properties: {
542
542
  type: {
543
- 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.",
543
+ description: "Type discriminator.",
544
544
  type: "string",
545
545
  "enum": [
546
546
  "getDatabaseSchemas"
547
547
  ]
548
548
  },
549
549
  schemaNames: {
550
- 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.",
550
+ description: "Database table names to retrieve. DO NOT request same names already\nrequested in previous calls.",
551
551
  type: "array",
552
552
  items: {
553
553
  type: "string"
@@ -561,7 +561,7 @@ function createController(ctx, props) {
561
561
  ]
562
562
  },
563
563
  "IAutoBeRealizeCollectorWriteApplication.IComplete": {
564
- description: "Request to generate collector module implementation.\n\nExecutes three-phase generation to create complete collector with:\n\n- Collect() function: Converts DTO to database input\n- Proper handling of nested relationships\n- UUID generation for new records\n- Type-safe Prisma create/connect syntax\n\nFollows plan \u2192 draft \u2192 revise pattern to ensure type safety and correct\nrelationship handling.",
564
+ description: "Generate collector module via plan/draft/revise.",
565
565
  type: "object",
566
566
  properties: {
567
567
  type: {
@@ -572,22 +572,22 @@ function createController(ctx, props) {
572
572
  ]
573
573
  },
574
574
  plan: {
575
- description: "Collector 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 mapping table for every field\n4. Edge Cases and Special Handling - Nullable, arrays, conditionals\n\nThis forces you to READ the actual schema (not imagine it) and creates an\nexplicit specification that the draft must implement.",
575
+ description: "Collector 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 mapping for every field\n4. Edge Cases and Special Handling \u2014 nullable, arrays, conditionals\n\nThis forces you to READ the actual schema (not imagine it) and creates an\nexplicit specification that the draft must implement.",
576
576
  type: "string"
577
577
  },
578
578
  mappings: {
579
- description: "Field-by-field mapping table for complete database coverage.\n\nMUST include EVERY field and relation from the database schema - no\nexceptions. Each mapping specifies:\n\n- `member`: Exact field/relation name from database schema\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`: How to obtain/generate the value for that field\n\nThe `kind` property forces explicit classification of each member BEFORE\ndeciding how to handle it, preventing common errors like treating\nbelongsTo relations as scalar fields.\n\nThe `nullable` property forces explicit identification of nullability\nconstraints BEFORE deciding handling strategy, preventing errors like\nassigning null to non-nullable fields or using null instead of undefined\nfor optional relations.\n\nMissing even a single field will cause validation failure and trigger\nregeneration.\n\nThis structured approach:\n\n- Prevents field omissions through systematic coverage\n- Forces explicit decision-making for each field (kind + nullable + how)\n- Prevents confusion between scalar fields and relations\n- Prevents null assignment errors through explicit nullability tracking\n- Enables validation before code generation\n- Creates clear documentation of field handling strategy\n\nThe validator will cross-check this list against the actual database\nschema and reject incomplete mappings.",
579
+ description: "Field-by-field mapping for complete database coverage.\n\nMUST include EVERY field and relation from the database schema \u2014 no\nexceptions. Each mapping specifies:\n\n- `member`: Exact Prisma field/relation name \u2014 read from schema, NOT from\n DTO property names or FK column names\n- `kind`: scalar, belongsTo, hasOne, or hasMany\n- `nullable`: true/false for scalar/belongsTo, null for hasMany/hasOne\n- `how`: How to obtain/generate the value for that field\n\nThe `kind` property forces explicit classification BEFORE deciding how to\nhandle it, preventing errors like treating belongsTo as scalar.\n\nMissing even a single field will cause validation failure.",
580
580
  type: "array",
581
581
  items: {
582
582
  $ref: "#/$defs/AutoBeRealizeCollectorMapping"
583
583
  }
584
584
  },
585
585
  draft: {
586
- description: "Initial collector implementation draft.\n\nComplete implementation that strictly follows the plan's mapping table.\nEVERY field in the plan's Section 3 mapping strategy MUST appear in this\ndraft. Implement:\n\n- Namespace with collect() function\n- All field mappings from plan (direct, connect, nested create)\n- Neighbor collector reuse (NEVER inline when collector exists)\n- UUID generation with v4(), proper Prisma CreateInput types",
586
+ description: "Complete implementation following plan's mapping table. EVERY field from\nplan Section 3 MUST appear. Implement:\n\n- Namespace with collect() function\n- All field mappings (direct, connect, nested create)\n- Neighbor collector reuse (NEVER inline when collector exists)\n- UUID generation with v4(), proper Prisma CreateInput types",
587
587
  type: "string"
588
588
  },
589
589
  revise: {
590
- description: "Revision and finalization phase.\n\nReviews the draft implementation and produces the final code with all\nimprovements and corrections applied.",
590
+ description: "Reviews draft and produces final code.",
591
591
  $ref: "#/$defs/IAutoBeRealizeCollectorWriteApplication.IReviseProps"
592
592
  }
593
593
  },
@@ -600,15 +600,15 @@ function createController(ctx, props) {
600
600
  ]
601
601
  },
602
602
  AutoBeRealizeCollectorMapping: {
603
- description: "Single field/relation mapping strategy for Prisma CreateInput generation.\n\nDocuments the handling strategy for one specific field or relation in the\nPrisma CreateInput. This structured approach ensures complete schema coverage\nby requiring explicit documentation for EVERY field - including those not\nused or not applicable.\n\n**Purpose**:\n\n- Prevents field omissions through systematic coverage verification\n- Forces explicit decision-making for each Prisma schema member\n- Enables validation before code generation (Write) or correction (Correct)\n- Creates clear documentation of field handling strategy\n\n**Usage Contexts**:\n\n- **Write Phase**: Plan how to generate each field from DTO \u2192 Prisma\n- **Correct Phase**: Document current state and correction plan for each field\n\nThe validator cross-checks mappings against the Prisma schema to ensure\nnothing is overlooked, rejecting incomplete mappings.",
603
+ description: "Field/relation mapping for Prisma CreateInput generation.\n\nDocuments handling strategy for ONE Prisma schema member. EVERY field and\nrelation must be listed \u2014 the validator rejects incomplete mappings.",
604
604
  type: "object",
605
605
  properties: {
606
606
  member: {
607
- description: "Exact field or relation name from Prisma schema.\n\nMUST match the schema exactly (case-sensitive). Examples:\n\n- Scalar fields: \"id\", \"email\", \"created_at\"\n- BelongsTo relations: \"customer\", \"article\"\n- HasMany relations: \"comments\", \"shopping_sale_tags\"\n\nDO NOT use database column names (e.g., \"customer_id\" is WRONG - use\n\"customer\").\n\nInclude ALL fields from the schema, even if they are optional or not used\nin this particular collector.",
607
+ description: "Exact field or relation name from Prisma schema (case-sensitive).\n\n**Examples**:\n\n```typescript\n// Scalar fields\n{ member: \"id\", kind: \"scalar\", nullable: false, how: \"Generate with v4()\" }\n{ member: \"email\", kind: \"scalar\", nullable: false, how: \"From props.body.email\" }\n{ member: \"created_at\", kind: \"scalar\", nullable: false, how: \"Default to new Date()\" }\n{ member: \"description\", kind: \"scalar\", nullable: true, how: \"From props.body.description ?? null\" }\n\n// BelongsTo relations \u2014 use Prisma RELATION name, NOT FK column name\n{ member: \"customer\", kind: \"belongsTo\", nullable: false, how: \"Connect using props.customer.id\" }\n{ member: \"parent\", kind: \"belongsTo\", nullable: true, how: \"Undefined (nullable FK)\" }\n\n// HasMany relations\n{ member: \"tags\", kind: \"hasMany\", nullable: null, how: \"Nested create with TagCollector\" }\n{ member: \"comments\", kind: \"hasMany\", nullable: null, how: \"Not needed (optional has-many)\" }\n```\n\nDO NOT use FK column names (e.g., \"customer_id\" is WRONG \u2014 use \"customer\").\nInclude ALL members even if unused in this collector.",
608
608
  type: "string"
609
609
  },
610
610
  kind: {
611
- description: "The kind of Prisma schema member.\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\nhow to handle it, preventing common mistakes like treating belongsTo\nrelations as scalar fields.\n\n**Possible values**:\n\n- `\"scalar\"`: Regular database column (id, email, created_at, total_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**:\n\n- **Prevents confusion**: AI must consciously identify if \"customer\" is a\n relation (needs `{ connect: { id: ... } }`) or a scalar field\n- **Forces correct syntax**: belongsTo requires `connect`, hasMany requires\n `create`, scalar requires direct value assignment\n- **Enables Chain-of-Thought**: AI explicitly thinks about the kind before\n deciding the handling strategy in the `how` field\n- **Catches common errors**: Prevents treating FK relations as scalar IDs\n\n**Examples by kind**:\n\n```typescript\n// Scalar fields\n{ member: \"id\", kind: \"scalar\", nullable: false, how: \"Generate with v4()\" }\n{ member: \"email\", kind: \"scalar\", nullable: false, how: \"From props.body.email\" }\n{ member: \"created_at\", kind: \"scalar\", nullable: false, how: \"Default to new Date()\" }\n{ member: \"description\", kind: \"scalar\", nullable: true, how: \"From props.body.description ?? null\" }\n\n// BelongsTo relations (FK pointing to parent)\n{ member: \"customer\", kind: \"belongsTo\", nullable: false, how: \"Connect using props.customer.id\" }\n{ member: \"article\", kind: \"belongsTo\", nullable: false, how: \"Connect using props.article.id\" }\n{ member: \"parent\", kind: \"belongsTo\", nullable: true, how: \"Undefined (nullable FK)\" }\n\n// HasMany relations (reverse side of FK)\n{ member: \"comments\", kind: \"hasMany\", nullable: null, how: \"Not needed (optional has-many)\" }\n{ member: \"tags\", kind: \"hasMany\", nullable: null, how: \"Nested create with TagCollector\" }\n{ member: \"reviews\", kind: \"hasMany\", nullable: null, how: \"Not applicable for this collector\" }\n```\n\nThe `kind` field works together with `nullable` and `how`: kind identifies\nWHAT it is, nullable identifies IF it's optional, how explains HOW to\nhandle it.",
611
+ description: "Kind of Prisma schema member.\n\n- `\"scalar\"`: Regular column \u2192 direct value assignment\n- `\"belongsTo\"`: FK relation \u2192 `{ connect: { id } }`\n- `\"hasOne\"`: 1:1 relation this side owns\n- `\"hasMany\"`: 1:N or M:N \u2192 `{ create: [...] }` or omit\n\nThe kind forces explicit classification BEFORE deciding how to handle it,\npreventing confusion like treating belongsTo relations as scalar fields.",
612
612
  type: "string",
613
613
  "enum": [
614
614
  "scalar",
@@ -618,7 +618,7 @@ function createController(ctx, props) {
618
618
  ]
619
619
  },
620
620
  nullable: {
621
- description: "Whether this member is nullable in the Prisma schema.\n\nThis property explicitly documents whether a field/relation can be null,\nforcing the AI to understand nullability constraints before deciding how to\nhandle the member. This prevents errors like assigning null to non-nullable\nfields or forgetting to handle optional relations properly.\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 - Must always have a value\n - Cannot use `null` or `undefined`\n - Example: `email: props.body.email` (required)\n - `true`: Nullable column (e.g., `description String?`, `deleted_at\n DateTime?`)\n\n - Can be null\n - Use `?? null` pattern for optional DTO values\n - Example: `description: props.body.description ?? null`\n- **For belongsTo relations** (`kind: \"belongsTo\"`):\n\n - `false`: Required foreign key (e.g., `customer_id String`)\n\n - Must always connect to parent entity\n - Cannot use `undefined`\n - Example: `customer: { connect: { id: props.customer.id } }`\n - `true`: Optional foreign key (e.g., `parent_id String?`, `category_id\n String?`)\n\n - Can be omitted\n - Use `undefined` (NOT `null`) when not provided\n - Example: `parent: props.body.parentId ? { connect: { id:\n props.body.parentId } } : undefined`\n- **For hasMany/hasOne relations** (`kind: \"hasMany\"` or `kind: \"hasOne\"`):\n\n - Always `null`: Nullability concept doesn't apply to relation arrays/objects\n\n - HasMany: Always optional (empty array or nested creates)\n - HasOne: Handled differently (create or omit)\n - The `nullable` property has no semantic meaning for these kinds\n\n**Why this matters**:\n\n- **Prevents null assignment errors**: Can't assign null to non-nullable\n fields\n- **Forces correct optional handling**: nullable: true \u2192 use `?? null` or\n `undefined`\n- **Catches required field omissions**: nullable: false \u2192 must provide value\n- **Enables proper FK handling**: nullable belongsTo \u2192 use `undefined` not\n `null`\n- **Supports Chain-of-Thought**: AI must think about nullability BEFORE\n deciding handling strategy\n\n**Examples**:\n\n```typescript\n// Non-nullable scalar (nullable: false)\n{ member: \"id\", kind: \"scalar\", nullable: false, how: \"Generate with v4()\" }\n{ member: \"email\", kind: \"scalar\", nullable: false, how: \"From props.body.email\" }\n{ member: \"created_at\", kind: \"scalar\", nullable: false, how: \"Default to new Date()\" }\n\n// Nullable scalar (nullable: true)\n{ member: \"description\", kind: \"scalar\", nullable: true, how: \"From props.body.description ?? null\" }\n{ member: \"deleted_at\", kind: \"scalar\", nullable: true, how: \"Default to null\" }\n{ member: \"completed_at\", kind: \"scalar\", nullable: true, how: \"From props.body.completedAt ?? null\" }\n\n// Required belongsTo (nullable: false)\n{ member: \"customer\", kind: \"belongsTo\", nullable: false, how: \"Connect using props.customer.id\" }\n{ member: \"article\", kind: \"belongsTo\", nullable: false, how: \"Connect using props.article.id\" }\n\n// Optional belongsTo (nullable: true)\n{ member: \"parent\", kind: \"belongsTo\", nullable: true, how: \"Undefined (nullable FK)\" }\n{ member: \"category\", kind: \"belongsTo\", nullable: true, how: \"Connect using props.body.categoryId or undefined\" }\n\n// HasMany relations (nullable: null - not applicable)\n{ member: \"comments\", kind: \"hasMany\", nullable: null, how: \"Not needed (optional has-many)\" }\n{ member: \"tags\", kind: \"hasMany\", nullable: null, how: \"Nested create with TagCollector\" }\n{ member: \"reviews\", kind: \"hasMany\", nullable: null, how: \"Not applicable for this collector\" }\n```\n\nThe `nullable` property works with `kind` to determine the correct Prisma\nsyntax: kind identifies WHAT it is, nullable identifies IF it's optional,\nhow explains HOW to handle it.",
621
+ description: "Whether nullable in Prisma schema.\n\n- `false`: Non-nullable \u2014 must provide value\n- `true`: Nullable \u2014 use `?? null` for scalar, `undefined` for belongsTo\n- `null`: Not applicable (hasMany/hasOne)",
622
622
  anyOf: [
623
623
  {
624
624
  type: "null"
@@ -629,7 +629,7 @@ function createController(ctx, props) {
629
629
  ]
630
630
  },
631
631
  how: {
632
- description: "Brief one-line explanation of how to obtain this field's value.\n\nKeep it concise and clear.\n\n**For Write Phase** (planning field generation):\n\n- \"Generate with v4()\"\n- \"From props.body.email\"\n- \"Connect using props.references.customer_id\"\n- \"Nested create with ShoppingSaleTagCollector\"\n- \"Query comment to get article_id\"\n- \"Default to new Date()\"\n- \"Undefined (nullable FK)\"\n- \"Not applicable for this collector\"\n- \"Not needed (optional has-many)\"\n\n**For Correct Phase** (documenting current state and fixes):\n\n- \"No change needed - correct\"\n- \"Already correct\"\n- \"Fix: Wrong name 'user_email' \u2192 'email'\"\n- \"Fix: Missing field - add with props.body.email\"\n- \"Fix: Wrong type - change to connect syntax\"\n- \"Fix: Should use CustomerCollector instead of inline\"\n- \"Fix: Using null instead of undefined\"\n- \"Fix: Fabricated field - remove it\"\n\nEven if a field is correct or not used, you MUST include it in the mapping\nand explain why. This ensures complete schema coverage.\n\nThis is NOT code - just a simple description of the strategy.",
632
+ description: "Brief strategy for obtaining this field's value (NOT code).\n\nWrite phase: \"Generate with v4()\", \"From props.body.email\", \"Connect using\nprops.customer.id\", \"Nested create with TagCollector\".\n\nCorrect phase: \"No change needed\", \"Fix: Wrong name 'x' \u2192 'y'\".\n\nEven if correct or unused, you MUST include it. This ensures complete\nschema coverage.",
633
633
  type: "string"
634
634
  }
635
635
  },
@@ -644,11 +644,11 @@ function createController(ctx, props) {
644
644
  type: "object",
645
645
  properties: {
646
646
  review: {
647
- 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 plan Section 3 is implemented\n3. System Rules - Mandatory neighbor reuse, props structure, satisfies type\n4. Type Safety - Compilation check, nullable handling, async/await\n\nIdentify specific issues with line numbers and provide clear reasoning.\nThis catches hallucinated fields, missing mappings, and rule violations.",
647
+ 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 is implemented\n3. System Rules \u2014 neighbor reuse, props structure, satisfies type\n4. Type Safety \u2014 compilation check, nullable handling, async/await\n\nIdentify issues with line numbers. This catches hallucinated fields,\nmissing mappings, and rule violations.",
648
648
  type: "string"
649
649
  },
650
650
  final: {
651
- description: "Final collector 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.",
651
+ description: "Final collector code with all review improvements applied, or null if\ndraft needs no changes.",
652
652
  anyOf: [
653
653
  {
654
654
  type: "null"
@@ -666,7 +666,7 @@ function createController(ctx, props) {
666
666
  }
667
667
  }
668
668
  },
669
- description: "Process collector generation task or preliminary data requests.\n\nGenerates complete collector module through three-phase workflow (plan \u2192\ndraft \u2192 revise). Ensures type safety, proper database input types, and\ncorrect relationship handling.",
669
+ description: "Process collector generation task or preliminary data requests.",
670
670
  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.mappings) && input.mappings.every(elem => "object" === typeof elem && null !== elem && _io3(elem))) && "string" === typeof input.draft && ("object" === typeof input.revise && null !== input.revise && _io4(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.review && (null === input.final || "string" === typeof input.final); const _iu0 = input => (() => {
671
671
  if ("getDatabaseSchemas" === input.type)
672
672
  return _io1(input);