@autobe/agent 0.22.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutoBeAgent.d.ts +2 -1
- package/lib/{agent/src/AutoBeAgent.js → AutoBeAgent.js} +17 -3
- package/lib/AutoBeAgent.js.map +1 -0
- package/lib/AutoBeAgentBase.js.map +1 -0
- package/lib/{agent/src/AutoBeMockAgent.js → AutoBeMockAgent.js} +16 -0
- package/lib/AutoBeMockAgent.js.map +1 -0
- package/lib/constants/AutoBeConfigConstant.d.ts +3 -1
- package/lib/constants/AutoBeConfigConstant.js.map +1 -0
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +17 -15
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -0
- package/lib/context/AutoBeContext.js.map +1 -0
- package/lib/context/AutoBeState.js.map +1 -0
- package/lib/context/AutoBeTokenUsage.d.ts +1 -0
- package/lib/{agent/src/context → context}/AutoBeTokenUsage.js +8 -0
- package/lib/context/AutoBeTokenUsage.js.map +1 -0
- package/lib/context/AutoBeTokenUsageComponent.d.ts +1 -0
- package/lib/{agent/src/context → context}/AutoBeTokenUsageComponent.js +8 -0
- package/lib/context/AutoBeTokenUsageComponent.js.map +1 -0
- package/lib/context/IAutoBeApplication.js.map +1 -0
- package/lib/context/IAutoBeApplicationProps.js.map +1 -0
- package/lib/context/IAutoBeApplicationResult.js.map +1 -0
- package/lib/context/assertSchemaModel.js.map +1 -0
- package/lib/{agent/src/factory → factory}/consentFunctionCall.js +1 -1
- package/lib/factory/consentFunctionCall.js.map +1 -0
- package/lib/factory/createAgenticaHistory.js.map +1 -0
- package/lib/factory/createAutoBeApplication.js.map +1 -0
- package/lib/{agent/src/factory → factory}/createAutoBeContext.js +66 -20
- package/lib/factory/createAutoBeContext.js.map +1 -0
- package/lib/factory/createAutoBeState.js.map +1 -0
- package/lib/factory/getAutoBeGenerated.js.map +1 -0
- package/lib/factory/getAutoBeRealizeGenerated.js.map +1 -0
- package/lib/factory/getCriticalCompiler.d.ts +3 -0
- package/lib/factory/getCriticalCompiler.js +55 -0
- package/lib/factory/getCriticalCompiler.js.map +1 -0
- package/lib/factory/index.js.map +1 -0
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +4827 -3025
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -0
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -0
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -0
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -0
- package/lib/{agent/src/orchestrate → orchestrate}/analyze/orchestrateAnalyzeWrite.js +2 -4
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -0
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.js.map +1 -0
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.js.map +1 -0
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.js.map +1 -0
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.d.ts +8 -0
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js +31 -0
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js.map +1 -0
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.d.ts +18 -0
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +411 -0
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -0
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.d.ts +122 -0
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.js +3 -0
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.js.map +1 -0
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -0
- package/lib/orchestrate/index.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -0
- package/lib/{agent/src/orchestrate → orchestrate}/interface/histories/transformInterfaceAuthorizationsHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +63 -0
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -0
- package/lib/{agent/src/orchestrate → orchestrate}/interface/histories/transformInterfaceEndpointsReviewHistories.js +4 -4
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +52 -0
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +36 -0
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +29 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +60 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -0
- package/lib/{agent/src/orchestrate → orchestrate}/interface/orchestrateInterfaceComplement.js +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -0
- package/lib/{agent/src/orchestrate → orchestrate}/interface/orchestrateInterfaceOperations.js +193 -274
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +1747 -0
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -0
- package/lib/{agent/src/orchestrate → orchestrate}/interface/orchestrateInterfaceSchemas.js +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +1 -1
- package/lib/{agent/src/orchestrate → orchestrate}/interface/orchestrateInterfaceSchemasReview.js +5 -7
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationsApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +247 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.js.map +1 -0
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -0
- package/lib/orchestrate/interface/utils/JsonSchemaNamingConvention.js.map +1 -0
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.d.ts +6 -1
- package/lib/{agent/src/orchestrate → orchestrate}/interface/utils/JsonSchemaValidator.js +26 -24
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js.map +1 -0
- package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.js.map +1 -0
- package/lib/{agent/src/orchestrate/interface/utils/JsonSchemaValidator.d.ts → orchestrate/interface/utils/OperationValidator.d.ts} +2 -2
- package/lib/orchestrate/interface/utils/OperationValidator.js +114 -0
- package/lib/orchestrate/interface/utils/OperationValidator.js.map +1 -0
- package/lib/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.js.map +1 -0
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -0
- package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -0
- package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -0
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -0
- package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -0
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -0
- package/lib/{agent/src/orchestrate → orchestrate}/prisma/orchestratePrismaCorrect.js +2 -2
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -0
- package/lib/orchestrate/prisma/orchestratePrismaReview.js.map +1 -0
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -0
- package/lib/orchestrate/prisma/structures/IAutoBePrismaComponentApplication.js.map +1 -0
- package/lib/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.js.map +1 -0
- package/lib/orchestrate/prisma/structures/IAutoBePrismaReviewApplication.js.map +1 -0
- package/lib/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.js.map +1 -0
- package/lib/orchestrate/realize/ProviderCodeComparator.js.map +1 -0
- package/lib/{agent/src/orchestrate → orchestrate}/realize/histories/transformRealizeAuthorization.js +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -0
- package/lib/{agent/src/orchestrate → orchestrate}/realize/histories/transformRealizeAuthorizationCorrectHistories.js +2 -2
- package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -0
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js +57 -0
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -0
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -0
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js +141 -0
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -0
- package/lib/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -0
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.d.ts +4 -0
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js +505 -0
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +1 -0
- package/lib/{agent/src/orchestrate → orchestrate}/realize/orchestrateRealize.js +18 -8
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -0
- package/lib/{agent/src/orchestrate → orchestrate}/realize/orchestrateRealizeAuthorizationCorrect.js +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +2 -15
- package/lib/{agent/src/orchestrate → orchestrate}/realize/orchestrateRealizeCorrect.js +48 -43
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.js.map +1 -0
- package/lib/orchestrate/realize/utils/AuthorizationFileSystem.js.map +1 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.js.map +1 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js.map +1 -0
- package/lib/orchestrate/realize/utils/InternalFileSystem.js.map +1 -0
- package/lib/orchestrate/realize/utils/ProviderFileSystem.js.map +1 -0
- package/lib/orchestrate/realize/utils/generateRealizeScenario.d.ts +25 -0
- package/lib/orchestrate/realize/utils/generateRealizeScenario.js +85 -0
- package/lib/orchestrate/realize/utils/generateRealizeScenario.js.map +1 -0
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +1 -0
- package/lib/orchestrate/realize/utils/getRealizeWriteDto.js.map +1 -0
- package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.js.map +1 -0
- package/lib/orchestrate/realize/utils/getRealizeWriteInputType.js.map +1 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.js +98 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -0
- package/lib/orchestrate/test/compile/completeTestCode.js.map +1 -0
- package/lib/orchestrate/test/compile/filterTestFileName.js.map +1 -0
- package/lib/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -0
- package/lib/orchestrate/test/compile/getTestImportStatements.js.map +1 -0
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -0
- package/lib/orchestrate/test/compile/getTestTemplateCode.js.map +1 -0
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +51 -0
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -0
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.d.ts +4 -0
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js +33 -0
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js.map +1 -0
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +159 -0
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -0
- package/lib/orchestrate/test/histories/transformTestValidateEvent.d.ts +4 -0
- package/lib/orchestrate/test/histories/transformTestValidateEvent.js +11 -0
- package/lib/orchestrate/test/histories/transformTestValidateEvent.js.map +1 -0
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js +220 -0
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -0
- package/lib/{agent/src/orchestrate → orchestrate}/test/orchestrateTest.js +13 -7
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -0
- package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +2 -2
- package/lib/orchestrate/test/orchestrateTestCorrect.js +513 -0
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -0
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.d.ts +7 -0
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +425 -0
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -0
- package/lib/{agent/src/orchestrate → orchestrate}/test/orchestrateTestScenario.js +32 -36
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -0
- package/lib/{agent/src/orchestrate → orchestrate}/test/orchestrateTestWrite.js +23 -35
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectInvalidRequestApplication.d.ts +140 -0
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectInvalidRequestApplication.js +3 -0
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectInvalidRequestApplication.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestFunction.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestFunctionFailure.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +2 -2
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +38 -15
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.js.map +1 -0
- package/lib/{agent/src/orchestrate → orchestrate}/test/utils/getReferenceIds.js +1 -1
- package/lib/orchestrate/test/utils/getReferenceIds.js.map +1 -0
- package/lib/structures/IAutoBeConfig.d.ts +1 -0
- package/lib/structures/IAutoBeConfig.js.map +1 -0
- package/lib/structures/IAutoBeProps.js.map +1 -0
- package/lib/structures/IAutoBeVendor.js.map +1 -0
- package/lib/utils/AutoBeTimeoutError.d.ts +4 -0
- package/lib/utils/AutoBeTimeoutError.js +18 -0
- package/lib/utils/AutoBeTimeoutError.js.map +1 -0
- package/lib/utils/TimeoutConversation.d.ts +24 -0
- package/lib/utils/TimeoutConversation.js +65 -0
- package/lib/utils/TimeoutConversation.js.map +1 -0
- package/lib/utils/arrayToRecord.js.map +1 -0
- package/lib/utils/backoffRetry.js.map +1 -0
- package/lib/utils/divideArray.js.map +1 -0
- package/lib/utils/emplaceMap.js.map +1 -0
- package/lib/utils/executeCachedBatch.js.map +1 -0
- package/lib/utils/predicateStateMessage.js.map +1 -0
- package/package.json +6 -6
- package/src/AutoBeAgent.ts +16 -1
- package/src/AutoBeMockAgent.ts +13 -3
- package/src/constants/AutoBeConfigConstant.ts +3 -1
- package/src/constants/AutoBeSystemPromptConstant.ts +17 -15
- package/src/context/AutoBeTokenUsage.ts +9 -0
- package/src/context/AutoBeTokenUsageComponent.ts +9 -0
- package/src/factory/consentFunctionCall.ts +1 -1
- package/src/factory/createAutoBeContext.ts +68 -20
- package/src/factory/getCriticalCompiler.ts +47 -0
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +2 -4
- package/src/orchestrate/common/histories/transformCommonCorrectCastingHistories.ts +43 -0
- package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +170 -0
- package/src/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.ts +127 -0
- package/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.ts +4 -4
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +2 -2
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +10 -94
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +49 -13
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +3 -2
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +5 -5
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +254 -4
- package/src/orchestrate/interface/utils/JsonSchemaValidator.ts +31 -26
- package/src/orchestrate/interface/utils/OperationValidator.ts +127 -0
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +2 -2
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +6 -0
- package/src/orchestrate/realize/orchestRateRealizeCorrectCasting.ts +317 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +29 -14
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +1 -1
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +79 -67
- package/src/orchestrate/realize/utils/generateRealizeScenario.ts +104 -0
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +60 -32
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +4 -3
- package/src/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.ts +39 -0
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +75 -17
- package/src/orchestrate/test/histories/transformTestValidateEvent.ts +14 -0
- package/src/orchestrate/test/orchestrateTest.ts +11 -7
- package/src/orchestrate/test/orchestrateTestCorrect.ts +111 -33
- package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +145 -0
- package/src/orchestrate/test/orchestrateTestScenario.ts +29 -13
- package/src/orchestrate/test/orchestrateTestWrite.ts +3 -1
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +233 -0
- package/src/orchestrate/test/structures/IAutoBeTestCorrectInvalidRequestApplication.ts +146 -0
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +2 -2
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +110 -15
- package/src/orchestrate/test/utils/getReferenceIds.ts +1 -1
- package/src/structures/IAutoBeConfig.ts +2 -0
- package/src/utils/AutoBeTimeoutError.ts +13 -0
- package/src/utils/TimeoutConversation.ts +82 -0
- package/lib/agent/src/AutoBeAgent.d.ts +0 -52
- package/lib/agent/src/AutoBeAgent.js.map +0 -1
- package/lib/agent/src/AutoBeAgentBase.d.ts +0 -18
- package/lib/agent/src/AutoBeAgentBase.js.map +0 -1
- package/lib/agent/src/AutoBeMockAgent.d.ts +0 -7
- package/lib/agent/src/AutoBeMockAgent.js.map +0 -1
- package/lib/agent/src/constants/AutoBeConfigConstant.d.ts +0 -3
- package/lib/agent/src/constants/AutoBeConfigConstant.js.map +0 -1
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +0 -29
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +0 -1
- package/lib/agent/src/context/AutoBeContext.d.ts +0 -43
- package/lib/agent/src/context/AutoBeContext.js.map +0 -1
- package/lib/agent/src/context/AutoBeState.d.ts +0 -8
- package/lib/agent/src/context/AutoBeState.js.map +0 -1
- package/lib/agent/src/context/AutoBeTokenUsage.d.ts +0 -173
- package/lib/agent/src/context/AutoBeTokenUsage.js.map +0 -1
- package/lib/agent/src/context/AutoBeTokenUsageComponent.d.ts +0 -117
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js.map +0 -1
- package/lib/agent/src/context/IAutoBeApplication.d.ts +0 -107
- package/lib/agent/src/context/IAutoBeApplication.js.map +0 -1
- package/lib/agent/src/context/IAutoBeApplicationProps.d.ts +0 -4
- package/lib/agent/src/context/IAutoBeApplicationProps.js.map +0 -1
- package/lib/agent/src/context/IAutoBeApplicationResult.d.ts +0 -4
- package/lib/agent/src/context/IAutoBeApplicationResult.js.map +0 -1
- package/lib/agent/src/context/assertSchemaModel.d.ts +0 -2
- package/lib/agent/src/context/assertSchemaModel.js.map +0 -1
- package/lib/agent/src/factory/consentFunctionCall.d.ts +0 -10
- package/lib/agent/src/factory/consentFunctionCall.js.map +0 -1
- package/lib/agent/src/factory/createAgenticaHistory.d.ts +0 -7
- package/lib/agent/src/factory/createAgenticaHistory.js.map +0 -1
- package/lib/agent/src/factory/createAutoBeApplication.d.ts +0 -7
- package/lib/agent/src/factory/createAutoBeApplication.js.map +0 -1
- package/lib/agent/src/factory/createAutoBeContext.d.ts +0 -19
- package/lib/agent/src/factory/createAutoBeContext.js.map +0 -1
- package/lib/agent/src/factory/createAutoBeState.d.ts +0 -3
- package/lib/agent/src/factory/createAutoBeState.js.map +0 -1
- package/lib/agent/src/factory/getAutoBeGenerated.d.ts +0 -4
- package/lib/agent/src/factory/getAutoBeGenerated.js.map +0 -1
- package/lib/agent/src/factory/getAutoBeRealizeGenerated.d.ts +0 -7
- package/lib/agent/src/factory/getAutoBeRealizeGenerated.js.map +0 -1
- package/lib/agent/src/factory/index.d.ts +0 -1
- package/lib/agent/src/factory/index.js.map +0 -1
- package/lib/agent/src/index.d.ts +0 -6
- package/lib/agent/src/index.js.map +0 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +0 -6
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.d.ts +0 -4
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +0 -6
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.d.ts +0 -5
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js.map +0 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +0 -11
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js.map +0 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.d.ts +0 -4
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +0 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +0 -10
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +0 -1
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +0 -111
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +0 -78
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +0 -74
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.d.ts +0 -2
- package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js.map +0 -1
- package/lib/agent/src/orchestrate/index.d.ts +0 -5
- package/lib/agent/src/orchestrate/index.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.d.ts +0 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +0 -4
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.d.ts +0 -4
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +0 -63
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.d.ts +0 -5
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.d.ts +0 -4
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.d.ts +0 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.d.ts +0 -4
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +0 -52
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.d.ts +0 -5
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +0 -36
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.d.ts +0 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +0 -4
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +0 -29
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +0 -4
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +0 -60
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.d.ts +0 -5
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +0 -4
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.d.ts +0 -4
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.d.ts +0 -5
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +0 -10
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.d.ts +0 -4
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.d.ts +0 -4
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +0 -4
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +0 -1416
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.d.ts +0 -4
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +0 -9
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationsApplication.d.ts +0 -47
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationsApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +0 -93
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.d.ts +0 -24
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.d.ts +0 -60
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +0 -108
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +0 -171
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +0 -117
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +0 -107
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +0 -91
- package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.d.ts +0 -9
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.d.ts +0 -5
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaValidator.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/utils/OpenApiEndpointComparator.d.ts +0 -6
- package/lib/agent/src/orchestrate/interface/utils/OpenApiEndpointComparator.js.map +0 -1
- package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.d.ts +0 -2
- package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.js.map +0 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.d.ts +0 -3
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.d.ts +0 -3
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.d.ts +0 -8
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.d.ts +0 -3
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.d.ts +0 -5
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js.map +0 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.d.ts +0 -4
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +0 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.d.ts +0 -4
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +0 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.d.ts +0 -5
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js.map +0 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.d.ts +0 -5
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js.map +0 -1
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaComponentApplication.d.ts +0 -121
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaComponentApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.d.ts +0 -142
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaReviewApplication.d.ts +0 -105
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaReviewApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.d.ts +0 -99
- package/lib/agent/src/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/ProviderCodeComparator.d.ts +0 -5
- package/lib/agent/src/orchestrate/realize/ProviderCodeComparator.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.d.ts +0 -5
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.d.ts +0 -5
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +0 -14
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +0 -51
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +0 -3
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +0 -11
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +0 -141
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.d.ts +0 -7
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.d.ts +0 -5
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.d.ts +0 -10
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.d.ts +0 -4
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +0 -19
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.d.ts +0 -25
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js +0 -44
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +0 -11
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +0 -109
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +0 -47
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +0 -39
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.d.ts +0 -5
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.d.ts +0 -36
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +0 -295
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/utils/AuthorizationFileSystem.d.ts +0 -5
- package/lib/agent/src/orchestrate/realize/utils/AuthorizationFileSystem.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.d.ts +0 -5
- package/lib/agent/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.d.ts +0 -4
- package/lib/agent/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/utils/InternalFileSystem.d.ts +0 -8
- package/lib/agent/src/orchestrate/realize/utils/InternalFileSystem.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/utils/ProviderFileSystem.d.ts +0 -3
- package/lib/agent/src/orchestrate/realize/utils/ProviderFileSystem.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.d.ts +0 -31
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.d.ts +0 -4
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.d.ts +0 -2
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.d.ts +0 -30
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.d.ts +0 -8
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js +0 -77
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js.map +0 -1
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.d.ts +0 -4
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js.map +0 -1
- package/lib/agent/src/orchestrate/test/compile/filterTestFileName.d.ts +0 -1
- package/lib/agent/src/orchestrate/test/compile/filterTestFileName.js.map +0 -1
- package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.d.ts +0 -3
- package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js.map +0 -1
- package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.d.ts +0 -2
- package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.js.map +0 -1
- package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +0 -5
- package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.js.map +0 -1
- package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.d.ts +0 -2
- package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.js.map +0 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.d.ts +0 -6
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +0 -50
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.d.ts +0 -4
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +0 -105
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.d.ts +0 -10
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +0 -220
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/test/orchestrateTest.d.ts +0 -5
- package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +0 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.d.ts +0 -5
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +0 -405
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +0 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.d.ts +0 -4
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +0 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.d.ts +0 -5
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +0 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +0 -125
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunction.d.ts +0 -8
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunction.js.map +0 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.d.ts +0 -6
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.js.map +0 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +0 -161
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +0 -8
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.js.map +0 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.d.ts +0 -6
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.js.map +0 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +0 -126
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteApplication.js.map +0 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteResult.d.ts +0 -7
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteResult.js.map +0 -1
- package/lib/agent/src/orchestrate/test/utils/getReferenceIds.d.ts +0 -5
- package/lib/agent/src/orchestrate/test/utils/getReferenceIds.js.map +0 -1
- package/lib/agent/src/structures/IAutoBeConfig.d.ts +0 -75
- package/lib/agent/src/structures/IAutoBeConfig.js.map +0 -1
- package/lib/agent/src/structures/IAutoBeProps.d.ts +0 -109
- package/lib/agent/src/structures/IAutoBeProps.js.map +0 -1
- package/lib/agent/src/structures/IAutoBeVendor.d.ts +0 -87
- package/lib/agent/src/structures/IAutoBeVendor.js.map +0 -1
- package/lib/agent/src/utils/arrayToRecord.d.ts +0 -17
- package/lib/agent/src/utils/arrayToRecord.js.map +0 -1
- package/lib/agent/src/utils/backoffRetry.d.ts +0 -22
- package/lib/agent/src/utils/backoffRetry.js.map +0 -1
- package/lib/agent/src/utils/divideArray.d.ts +0 -4
- package/lib/agent/src/utils/divideArray.js.map +0 -1
- package/lib/agent/src/utils/emplaceMap.d.ts +0 -1
- package/lib/agent/src/utils/emplaceMap.js.map +0 -1
- package/lib/agent/src/utils/executeCachedBatch.d.ts +0 -1
- package/lib/agent/src/utils/executeCachedBatch.js.map +0 -1
- package/lib/agent/src/utils/predicateStateMessage.d.ts +0 -4
- package/lib/agent/src/utils/predicateStateMessage.js.map +0 -1
- package/lib/interface/src/histories/contents/AutoBeAnalyzeFile.d.ts +0 -153
- package/lib/interface/src/histories/contents/AutoBeAnalyzeFile.js +0 -3
- package/lib/interface/src/histories/contents/AutoBeAnalyzeFile.js.map +0 -1
- package/lib/orchestrate/realize/orchestrateRealizeScenario.d.ts +0 -25
- package/src/orchestrate/realize/orchestrateRealizeScenario.ts +0 -57
- /package/lib/{agent/src/AutoBeAgentBase.js → AutoBeAgentBase.js} +0 -0
- /package/lib/{agent/src/constants → constants}/AutoBeConfigConstant.js +0 -0
- /package/lib/{agent/src/constants → constants}/AutoBeSystemPromptConstant.js +0 -0
- /package/lib/{agent/src/context → context}/AutoBeContext.js +0 -0
- /package/lib/{agent/src/context → context}/AutoBeState.js +0 -0
- /package/lib/{agent/src/context → context}/IAutoBeApplication.js +0 -0
- /package/lib/{agent/src/context → context}/IAutoBeApplicationProps.js +0 -0
- /package/lib/{agent/src/context → context}/IAutoBeApplicationResult.js +0 -0
- /package/lib/{agent/src/context → context}/assertSchemaModel.js +0 -0
- /package/lib/{agent/src/factory → factory}/createAgenticaHistory.js +0 -0
- /package/lib/{agent/src/factory → factory}/createAutoBeApplication.js +0 -0
- /package/lib/{agent/src/factory → factory}/createAutoBeState.js +0 -0
- /package/lib/{agent/src/factory → factory}/getAutoBeGenerated.js +0 -0
- /package/lib/{agent/src/factory → factory}/getAutoBeRealizeGenerated.js +0 -0
- /package/lib/{agent/src/factory → factory}/index.js +0 -0
- /package/lib/{agent/src/index.js → index.js} +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/analyze/histories/transformAnalyzeReviewHistories.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/analyze/histories/transformAnalyzeScenarioHistories.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/analyze/histories/transformAnalyzeWriteHistories.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/analyze/orchestrateAnalyze.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/analyze/orchestrateAnalyzeReview.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/analyze/orchestrateAnalyzeScenario.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/analyze/structures/IAutoBeAnalyzeReviewApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/analyze/structures/IAutoBeAnalyzeScenarioApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/analyze/structures/IAutoBeAnalyzeWriteApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/facade/transformFacadeStateMessage.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/index.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/histories/transformInterfaceAssetHistories.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/histories/transformInterfaceEndpointHistories.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/histories/transformInterfaceGroupHistories.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/histories/transformInterfacePrerequisiteHistories.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/orchestrateInterface.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/orchestrateInterfaceAuthorizations.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/orchestrateInterfaceEndpoints.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/orchestrateInterfaceEndpointsReview.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/orchestrateInterfaceGroups.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/structures/IAutoBeInterfaceAuthorizationsApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/structures/IAutoBeInterfaceComplementApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/structures/IAutoBeInterfaceEndpointApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/structures/IAutoBeInterfaceGroupApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/structures/IAutoBeInterfaceOperationApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/structures/IAutoBeInterfaceOperationsReviewApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/structures/IAutoBeInterfaceSchemaApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/structures/IAutobeInterfaceSchemasReviewApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/utils/JsonSchemaFactory.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/utils/JsonSchemaNamingConvention.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/utils/OpenApiEndpointComparator.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/interface/utils/fulfillJsonSchemaErrorMessages.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/prisma/histories/transformPrismaComponentsHistories.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/prisma/histories/transformPrismaCorrectHistories.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/prisma/histories/transformPrismaReviewHistories.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/prisma/histories/transformPrismaSchemaHistories.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/prisma/orchestratePrisma.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/prisma/orchestratePrismaComponent.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/prisma/orchestratePrismaReview.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/prisma/orchestratePrismaSchemas.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/prisma/structures/IAutoBePrismaComponentApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/prisma/structures/IAutoBePrismaCorrectApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/prisma/structures/IAutoBePrismaReviewApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/prisma/structures/IAutoBePrismaSchemaApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/ProviderCodeComparator.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/histories/transformRealizeWriteAuthorizationsHistories.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/internal/compileRealizeFiles.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/orchestrateRealizeAuthorization.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/orchestrateRealizeWrite.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/structures/IAutoBeRealizeAuthorizationApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/structures/IAutoBeRealizeCorrectApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/structures/IAutoBeRealizeFunctionFailure.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/structures/IAutoBeRealizeScenarioResult.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/structures/IAutoBeRealizeWriteApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/utils/AuthorizationFileSystem.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/utils/AutoBeRealizeAuthorizationFileSystem.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/utils/InternalFileSystem.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/utils/ProviderFileSystem.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/utils/getRealizeWriteCodeTemplate.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/utils/getRealizeWriteDto.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/utils/getRealizeWriteImportStatements.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/realize/utils/getRealizeWriteInputType.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/test/compile/completeTestCode.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/test/compile/filterTestFileName.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/test/compile/getTestExternalDeclarations.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/test/compile/getTestImportStatements.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/test/compile/getTestScenarioArtifacts.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/test/compile/getTestTemplateCode.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/test/structures/IAutoBeTestCorrectApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/test/structures/IAutoBeTestFunction.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/test/structures/IAutoBeTestFunctionFailure.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/test/structures/IAutoBeTestScenarioApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/test/structures/IAutoBeTestScenarioArtifacts.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/test/structures/IAutoBeTestScenarioAuthorizationRole.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/test/structures/IAutoBeTestWriteApplication.js +0 -0
- /package/lib/{agent/src/orchestrate → orchestrate}/test/structures/IAutoBeTestWriteResult.js +0 -0
- /package/lib/{agent/src/structures → structures}/IAutoBeConfig.js +0 -0
- /package/lib/{agent/src/structures → structures}/IAutoBeProps.js +0 -0
- /package/lib/{agent/src/structures → structures}/IAutoBeVendor.js +0 -0
- /package/lib/{agent/src/utils → utils}/arrayToRecord.js +0 -0
- /package/lib/{agent/src/utils → utils}/backoffRetry.js +0 -0
- /package/lib/{agent/src/utils → utils}/divideArray.js +0 -0
- /package/lib/{agent/src/utils → utils}/emplaceMap.js +0 -0
- /package/lib/{agent/src/utils → utils}/executeCachedBatch.js +0 -0
- /package/lib/{agent/src/utils → utils}/predicateStateMessage.js +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformRealizeCorrectHistories = transformRealizeCorrectHistories;
|
|
4
|
+
const utils_1 = require("@autobe/utils");
|
|
5
|
+
const uuid_1 = require("uuid");
|
|
6
|
+
const transformRealizeWriteHistories_1 = require("./transformRealizeWriteHistories");
|
|
7
|
+
function transformRealizeCorrectHistories(props) {
|
|
8
|
+
return [
|
|
9
|
+
...(0, transformRealizeWriteHistories_1.transformRealizeWriteHistories)(props),
|
|
10
|
+
{
|
|
11
|
+
id: (0, uuid_1.v7)(),
|
|
12
|
+
created_at: new Date().toISOString(),
|
|
13
|
+
type: "systemMessage",
|
|
14
|
+
text: "<!--\nfilename: COMMON_CORRECT_CASTING.md\n -->\n# TypeScript Type Casting Error Fix System Prompt\n\n## 1. Role and Responsibility\n\nYou are an AI assistant specialized in analyzing and correcting TypeScript type casting and type assignment errors. Your focus is on resolving type incompatibilities that arise from various TypeScript type system constraints.\n\nYour purpose is to identify and fix TypeScript compilation errors related to type casting and assignment, including:\n\n- **Typia tag type incompatibilities**\n- **Date to string conversions**\n- **Nullable and undefined type assignments**\n- **String to literal type assignments**\n- **Optional chaining with union types**\n- **Type narrowing \"no overlap\" errors**\n\nOther compilation errors (such as missing imports, syntax errors, or undefined variables) are **NOT your responsibility** and will be handled by subsequent agents.\n\nThis agent achieves its goal through function calling. **Function calling is MANDATORY** - you MUST call the provided function immediately without asking for confirmation or permission.\n\n**REQUIRED ACTIONS:**\n- \u2705 Execute the function immediately\n- \u2705 Fix only type casting and assignment related compilation errors\n- \u2705 Leave all other errors untouched for subsequent agents\n\n**ABSOLUTE PROHIBITIONS:**\n- \u274C NEVER ask for user permission to execute the function\n- \u274C NEVER fix non-type-casting-related errors\n- \u274C NEVER modify working code that doesn't have type casting errors\n- \u274C NEVER say \"I will now call the function...\" or similar announcements\n- \u274C NEVER request confirmation before executing\n\n**IMPORTANT: All Required Information is Already Provided**\n- Every parameter needed for the function call is ALREADY included in this prompt\n- You have been given COMPLETE information - there is nothing missing\n- Do NOT hesitate or second-guess - all necessary data is present\n- Execute the function IMMEDIATELY with the provided parameters\n- If you think something is missing, you are mistaken - review the prompt again\n\n### 1.1. Function Calling Workflow\n\nThis agent operates through a specific function calling workflow to correct compilation errors:\n\n1. **Decision Point**: Analyze the compilation error\n - If error is related to type casting or assignment issues \u2192 Call `rewrite()`\n - If error is unrelated to type casting (e.g., missing imports, undefined variables) \u2192 Call `reject()`\n\n2. **For `rewrite()` function**:\n ```typescript\n rewrite({\n think: string, // Analysis of the type casting issue\n draft: string, // Initial code with tag fixes applied\n revise: {\n review: string, // Review of tag conversion patterns used\n final: string // Final corrected code\n }\n })\n ```\n\n3. **For `reject()` function**:\n ```typescript\n reject() // No parameters needed - error is unrelated to type casting\n ```\n\n**Execution Rules:**\n- You MUST call one of these functions immediately upon analyzing the input\n- You CANNOT skip function calling or provide text responses instead\n- You MUST complete all required parameters in a single function call\n- You CANNOT ask for clarification or additional information\n\n## 2. Input Materials\n\nYou will receive TypeScript test code along with its compilation failure history. The input follows this structure:\n\n```\n## TypeScript Code\n[Current TypeScript test code]\n\n## Compile Errors\nFix the compilation error in the provided code.\n[JSON array of diagnostic errors]\n```\n\nThis format may repeat multiple times if there were previous correction attempts that still resulted in compilation failures.\n\n### 2.1. TypeScript Test Code\n\nThe TypeScript code section contains TypeScript code that failed compilation. Your task is to:\n\n- Analyze the code in conjunction with the compilation errors\n- Look for type casting and assignment error patterns\n- Identify the specific type incompatibility issue\n- Fix ONLY the errors that fall within your responsibility\n\n### 2.2. Compilation Diagnostics\n\nThe compilation errors are provided as a JSON array of diagnostic objects. Each diagnostic contains:\n\n```typescript\ninterface IDiagnostic {\n file: string | null; // Source file with the error\n category: DiagnosticCategory; // \"error\", \"warning\", etc.\n code: number | string; // TypeScript error code\n start: number | undefined; // Character position where error starts\n length: number | undefined; // Length of the error span\n messageText: string; // The actual error message\n}\n```\n\n**Your responsibility is to:**\n- Parse the `messageText` field to identify type casting error patterns\n- Analyze the code context to determine the appropriate fix\n- Apply the correct type casting solution based on the error type\n- If the error is related to type casting/assignment, call `rewrite()` with the fix\n- If the error is unrelated to type casting, call `reject()` to pass to the next agent\n\n**CRITICAL**: You handle type casting and assignment errors. All other errors (imports, syntax, etc.) MUST be passed to subsequent agents via `reject()`.\n\n```typescript\n/**\n * Result of TypeScript compilation and validation operations.\n *\n * This union type represents all possible outcomes when the TypeScript compiler\n * processes generated code from the Test and Realize agents. The compilation\n * results enable AI self-correction through detailed feedback mechanisms while\n * ensuring that all generated code meets production standards and integrates\n * seamlessly with the TypeScript ecosystem.\n *\n * The compilation process validates framework integration, type system\n * integrity, dependency resolution, and build compatibility. Success results\n * indicate production-ready code, while failure results provide detailed\n * diagnostics for iterative refinement through the AI feedback loop.\n *\n * @author Samchon\n */\nexport type IAutoBeTypeScriptCompileResult =\n | IAutoBeTypeScriptCompileResult.ISuccess\n | IAutoBeTypeScriptCompileResult.IFailure\n | IAutoBeTypeScriptCompileResult.IException;\n\nexport namespace IAutoBeTypeScriptCompileResult {\n /**\n * Successful compilation result with generated JavaScript output.\n *\n * Represents the ideal outcome where TypeScript compilation completed without\n * errors and produced clean JavaScript code ready for execution. This result\n * indicates that the generated TypeScript code meets all production\n * standards, integrates correctly with frameworks and dependencies, and\n * maintains complete type safety throughout the application stack.\n */\n export interface ISuccess {\n /** Discriminator indicating successful compilation. */\n type: \"success\";\n }\n\n /**\n * Compilation failure with detailed diagnostic information and partial\n * output.\n *\n * Represents cases where TypeScript compilation encountered errors or\n * warnings that prevent successful code generation. This result provides\n * comprehensive diagnostic information to enable AI agents to understand\n * specific issues and implement targeted corrections through the iterative\n * refinement process.\n */\n export interface IFailure {\n /** Discriminator indicating compilation failure. */\n type: \"failure\";\n\n /**\n * Detailed compilation diagnostics for error analysis and correction.\n *\n * Contains comprehensive information about compilation errors, warnings,\n * and suggestions that occurred during the TypeScript compilation process.\n * Each diagnostic includes file location, error category, diagnostic codes,\n * and detailed messages that enable AI agents to understand and resolve\n * specific compilation issues.\n */\n diagnostics: IDiagnostic[];\n }\n\n /**\n * Unexpected exception during the compilation process.\n *\n * Represents cases where the TypeScript compilation process encountered an\n * unexpected runtime error or system exception that prevented normal\n * compilation operation. These cases indicate potential issues with the\n * compilation environment or unexpected edge cases that should be\n * investigated.\n */\n export interface IException {\n /** Discriminator indicating compilation exception. */\n type: \"exception\";\n\n /**\n * The raw error or exception that occurred during compilation.\n *\n * Contains the original error object or exception details for debugging\n * purposes. This information helps developers identify the root cause of\n * unexpected compilation failures and improve system reliability while\n * maintaining the robustness of the automated development pipeline.\n */\n error: unknown;\n }\n\n /**\n * Detailed diagnostic information for compilation issues.\n *\n * Provides comprehensive details about specific compilation problems\n * including file locations, error categories, diagnostic codes, and\n * descriptive messages. This information is essential for AI agents to\n * understand compilation failures and implement precise corrections during\n * the iterative development process.\n *\n * @author Samchon\n */\n export interface IDiagnostic {\n /**\n * Source file where the diagnostic was generated.\n *\n * Specifies the TypeScript source file that contains the issue, or null if\n * the diagnostic applies to the overall compilation process rather than a\n * specific file. This information helps AI agents target corrections to the\n * appropriate source files during the refinement process.\n */\n file: string | null;\n\n /**\n * Category of the diagnostic message.\n *\n * Indicates the severity and type of the compilation issue, enabling AI\n * agents to prioritize fixes and understand the impact of each diagnostic.\n * Errors must be resolved for successful compilation, while warnings and\n * suggestions can guide code quality improvements.\n */\n category: DiagnosticCategory;\n\n /**\n * TypeScript diagnostic code for the specific issue.\n *\n * Provides the official TypeScript diagnostic code that identifies the\n * specific type of compilation issue. This code can be used to look up\n * detailed explanations and resolution strategies in TypeScript\n * documentation or automated correction systems.\n */\n code: number | string;\n\n /**\n * Character position where the diagnostic begins in the source file.\n *\n * Specifies the exact location in the source file where the issue starts,\n * or undefined if the diagnostic doesn't apply to a specific location. This\n * precision enables AI agents to make targeted corrections without\n * affecting unrelated code sections.\n */\n start: number | undefined;\n\n /**\n * Length of the text span covered by this diagnostic.\n *\n * Indicates how many characters from the start position are affected by\n * this diagnostic, or undefined if the diagnostic doesn't apply to a\n * specific text span. This information helps AI agents understand the scope\n * of corrections needed for each issue.\n */\n length: number | undefined;\n\n /**\n * Human-readable description of the compilation issue.\n *\n * Provides a detailed explanation of the compilation problem in natural\n * language that AI agents can analyze to understand the issue and formulate\n * appropriate corrections. The message text includes context and\n * suggestions for resolving the identified problem.\n */\n messageText: string;\n }\n\n /**\n * Categories of TypeScript diagnostic messages.\n *\n * Defines the severity levels and types of compilation diagnostics that can\n * be generated during TypeScript compilation. These categories help AI agents\n * prioritize fixes and understand the impact of each compilation issue on the\n * overall code quality and functionality.\n *\n * @author Samchon\n */\n export type DiagnosticCategory =\n | \"warning\" // Issues that don't prevent compilation but indicate potential problems\n | \"error\" // Critical issues that prevent successful compilation and must be fixed\n | \"suggestion\" // Recommendations for code improvements that enhance quality\n | \"message\"; // Informational messages about the compilation process\n}\n```\n\n### 2.3. Example Input Format\n\nHere's an example of what you might receive:\n\n#### 2.3.1. TypeScript Code\n\n```typescript\nimport typia, { tags } from \"typia\";\nimport { TestValidator } from \"@autobe/utils\";\nimport { api } from \"./api\";\nimport { connection } from \"./connection\";\n\nexport const test_api_user_create = async (): Promise<void> => {\n const date: Date = new Date();\n const user = await api.functional.users.create(connection, {\n body: {\n name: \"John Doe\",\n birthDate: date, // Error: Date to string conversion needed\n email: \"john@example.com\"\n }\n });\n \n const userId: string & tags.Format<\"uuid\"> = \"123\"; // Error: tag mismatch\n TestValidator.equals(\"user.id\", user.id, userId);\n};\n```\n\n#### 2.3.2. Compile Errors\nFix the compilation error in the provided code.\n\n```json\n[\n {\n \"file\": \"test_api_user_create.ts\",\n \"category\": \"error\",\n \"code\": 2322,\n \"start\": 245,\n \"length\": 4,\n \"messageText\": \"Type 'Date' is not assignable to type 'string & Format<\\\"date-time\\\">'.\\n Type 'Date' is not assignable to type 'string'.\"\n },\n {\n \"file\": \"test_api_user_create.ts\", \n \"category\": \"error\",\n \"code\": 2322,\n \"start\": 412,\n \"length\": 6,\n \"messageText\": \"Type 'string' is not assignable to type 'string & Format<\\\"uuid\\\">'.\\n Type 'string' is not assignable to type 'Format<\\\"uuid\\\">'.\\n Types of property '\\\"typia.tag\\\"' are incompatible.\"\n }\n]\n```\n\nIn this example, you would call `rewrite()` because both errors fall within your responsibility:\n1. Date to string conversion error\n2. Typia tag incompatibility error\n\n### 2.4. Multiple Correction Attempts\n\nIf previous correction attempts failed, you may receive multiple sections showing the progression:\n\n```json\n\n## TypeScript Code\n[First attempt code]\n\n## Compile Errors\n[First attempt errors]\n\n## TypeScript Code \n[Second attempt code]\n\n## Compile Errors\n[Second attempt errors]\n```\n\nThis history helps you understand what corrections were already tried and avoid repeating unsuccessful approaches.\n\n## 3. Type Casting Error Patterns and Solutions\n\nThis section provides comprehensive guidance on identifying and fixing type casting and assignment compilation errors in TypeScript.\n\n### 3.1. Typia Tag Type Incompatibility\n\n**Error Pattern**: `\"Types of property '\\\"typia.tag\\\"' are incompatible\"`\n\n**What causes this error:**\nTypia uses intersection types with special \"tag\" properties to enforce runtime validation constraints at the type level. When you try to assign a value with one set of tags to a variable expecting different tags, TypeScript's structural type system detects the incompatibility through the internal `\"typia.tag\"` property.\n\n**Common scenarios where this occurs:**\n- Assigning a basic typed value to a variable with additional constraints (e.g., `number & Type<\"int32\">` to `number & Type<\"int32\"> & Minimum<0>`)\n- Mixing different format tags (e.g., `Format<\"uuid\">` vs `Pattern<\"[0-9a-f-]+\"`)\n- Converting between nullable and non-nullable tagged types\n- Using comparison functions with values having different tag constraints\n- **Nullish coalescing (`??`) with tagged types** - When default values have stricter type constraints\n\n**Why normal type assertions don't work:**\nRegular TypeScript type assertions like `as` cannot reconcile the incompatible tag properties. The solution requires stripping the tags while preserving the base type, which is achieved through the `satisfies` operator pattern.\n\n**\u26A0\uFE0F THE FOUR-STEP FIX**\n\n1. **See tag mismatch error?** \u2192 Identify the type mismatch (look for `\"typia.tag\"` in error message)\n2. **Check if nullable** \u2192 Look for `| null | undefined`\n3. **Apply the pattern:**\n - **Non-nullable:** `value satisfies BaseType as BaseType`\n - **Nullable:** `value satisfies BaseType | null | undefined as BaseType | null | undefined`\n - **Nullable \u2192 Non-nullable:** `typia.assert((value satisfies BaseType | null | undefined as BaseType | null | undefined)!)`\n - **Nullish coalescing:** `(value ?? default) satisfies BaseType as BaseType` (ALWAYS use parentheses)\n4. **Don't know how to?** \u2192 Use `typia.assert<T>(value)` for simplicity\n\n### 3.2. Variable Assignment Type Mismatches\n\n**Common Problem Patterns:**\n```typescript\n//----\n// Problem 1: Basic type mismatch\n//----\nconst page: number & tags.Type<\"int32\"> = getValue();\nconst pageWithMinimum: number & tags.Type<\"int32\"> & tags.Minimum<0> = page;\n // Type 'number & Type<\"int32\">' is not assignable to type 'number & Type<\"int32\"> & Minimum<0>'.\n // Type 'number & Type<\"int32\">' is not assignable to type 'Minimum<0>'.\n // Types of property '\"typia.tag\"' are incompatible.\n\n//----\n// Problem 2: Nullable type mismatch\n//----\nconst userIdOptional: (string & tags.Format<\"uuid\">) | null | undefined =\n getNullableUserId();\nconst userIdOptionalByOtherWay:\n | (string & tags.Pattern<\"<SOME-UUID-PATTERN>\">)\n | null\n | undefined = userIdOptional;\n // Type 'string & Format<\"uuid\">' is not assignable to type '(string & Pattern<\"<SOME-UUID-PATTERN>\">) | null | undefined'.\n // Type 'string & Format<\"uuid\">' is not assignable to type 'string & Pattern<\"<SOME-UUID-PATTERN>\">'.\n // Type 'string & Format<\"uuid\">' is not assignable to type 'Pattern<\"<SOME-UUID-PATTERN>\">'.\n // Types of property '\"typia.tag\"' are incompatible.\n\n//----\n// Problem 3: Nullable to Non-nullable conversion\n//----\nconst uuidOptional: (string & tags.Format<\"uuid\">) | null | undefined =\n getNullableUserId();\nconst uuidRequired: string & tags.Pattern<\"<SOME-UUID-PATTERN>\"> = uuidOptional;\n // Type 'string & Format<\"uuid\">' is not assignable to type 'string & Pattern<\"<SOME-UUID-PATTERN>\">'.\n // Type 'string & Format<\"uuid\">' is not assignable to type 'Pattern<\"<SOME-UUID-PATTERN>\">'.\n // Types of property '\"typia.tag\"' are incompatible.\n\n//----\n// Problem 4: Nullish coalescing with tagged types\n//----\nconst x: (number & tags.Type<\"int32\">) | null | undefined = getValue();\nconst y: number & tags.Type<\"int32\"> & tags.Minimum<0> = x ?? 0;\n // Type 'number & Type<\"int32\">' is not assignable to type 'number & Type<\"int32\"> & Minimum<0>'.\n // Type 'number & Type<\"int32\">' is not assignable to type 'Minimum<0>'.\n // Types of property '\"typia.tag\"' are incompatible.\n```\n\n**Solutions:**\n```typescript\n//----\n// Solution 1: Basic type\n//----\nconst page: number & tags.Type<\"int32\"> = getValue();\nconst pageWithMinimum: number & tags.Type<\"int32\"> & tags.Minimum<0> =\n page satisfies number as number;\n\n//----\n// Solution 2: Nullable type\n//----\nconst userIdOptional: (string & tags.Format<\"uuid\">) | null | undefined =\n getNullableUserId();\nconst userIdOptionalByOtherWay:\n | (string & tags.Pattern<\"<SOME-UUID-PATTERN>\">)\n | null\n | undefined = userIdOptional satisfies string | null | undefined as\n | string\n | null\n | undefined;\n\n//----\n// Solution 3: Nullable to Non-nullable\n//----\nconst uuidOptional: (string & tags.Format<\"uuid\">) | null | undefined =\n getNullableUserId();\nconst uuidRequired: string & tags.Pattern<\"<SOME-UUID-PATTERN>\"> = typia.assert(\n (uuidOptional satisfies string | null | undefined as\n | string\n | null\n | undefined)!,\n);\n\n//----\n// Solution 4: Nullish coalescing - wrap with parentheses and use satisfies\n//----\nconst x: (number & tags.Type<\"int32\">) | null | undefined = getValue();\nconst y: number & tags.Type<\"int32\"> & tags.Minimum<0> = (x ?? 0) satisfies number as number;\n\n//----\n// Don't know how to solve or your previous trial has failed?\n// \n// Just use `typia.assert<T>(value)` function for simplicity\n//----\nconst simple: number & tags.Type<\"int32\"> & tags.Minimum<0> = typia.assert<\n number & tags.Type<\"int32\"> & tags.Minimum<0>\n>(someValue);\n```\n\n### 3.3. TestValidator.equals Type Mismatches\n\nWhen using TestValidator.equals with different tagged types, apply the same pattern:\n\n**Common Problem Patterns:**\n```typescript\n//----\n// Problem 1: Basic type with TestValidator.equals\n//----\nconst page: number & tags.Type<\"int32\"> = getValue();\nconst pageWithMinimum: number & tags.Type<\"int32\"> & tags.Minimum<0> =\n getValue();\nTestValidator.equals(\"page\", pageWithMinimum, page);\n // Type 'number & Type<\"int32\">' is not assignable to type 'number & Type<\"int32\"> & Minimum<0>'.\n // Type 'number & Type<\"int32\">' is not assignable to type 'Minimum<0>'.\n // Types of property '\"typia.tag\"' are incompatible.\n\n//----\n// Problem 2: Nullable type mismatch in TestValidator.equals\n//----\nconst userIdOptional: (string & tags.Format<\"uuid\">) | null | undefined =\n getNullableUserId();\nconst userIdOptionalByOtherWay:\n | (string & tags.Pattern<\"<SOME-UUID-PATTERN>\">)\n | null\n | undefined = getNullableUserId();\nTestValidator.equals(\"id\", userIdOptionalByOtherWay, userIdOptional);\n // Type 'string & Format<\"uuid\">' is not assignable to type '(string & Pattern<\"<SOME-UUID-PATTERN>\">) | null | undefined'.\n // Type 'string & Format<\"uuid\">' is not assignable to type 'string & Pattern<\"<SOME-UUID-PATTERN>\">'.\n // Type 'string & Format<\"uuid\">' is not assignable to type 'Pattern<\"<SOME-UUID-PATTERN>\">'.\n // Types of property '\"typia.tag\"' are incompatible.\n\n//----\n// Problem 3: Nullable to non-nullable with TestValidator.equals\n//----\nconst uuidOptional: (string & tags.Format<\"uuid\">) | null | undefined =\n getNullableUserId();\nconst uuidRequired: string & tags.Pattern<\"<SOME-UUID-PATTERN>\"> = typia.assert(\n (uuidOptional satisfies string | null | undefined as\n | string\n | null\n | undefined)!,\n);\nTestValidator.equals(\"uuid-nullable-to-non-nullable\", uuidRequired, uuidOptional!);\n // Type 'string & Format<\"uuid\">' is not assignable to type 'string & Pattern<\"<SOME-UUID-PATTERN>\">'.\n // Type 'string & Format<\"uuid\">' is not assignable to type 'Pattern<\"<SOME-UUID-PATTERN>\">'.\n // Types of property '\"typia.tag\"' are incompatible.\n\n//----\n// Problem 4: Nullish coalescing with TestValidator.equals\n//----\nconst x: (number & tags.Type<\"int32\">) | null | undefined = getValue();\nconst y: number & tags.Type<\"int32\"> & tags.Minimum<0> = x ?? 0;\nTestValidator.equals(\"value check\", y, x ?? 0);\n // Type 'number & Type<\"int32\">' is not assignable to type 'number & Type<\"int32\"> & Minimum<0>'.\n // Type 'number & Type<\"int32\">' is not assignable to type 'Minimum<0>'.\n // Types of property '\"typia.tag\"' are incompatible.\n```\n\n**Solutions:**\n```typescript\n//----\n// Solution 1: Basic type\n//----\nconst page: number & tags.Type<\"int32\"> = getValue();\nconst pageWithMinimum: number & tags.Type<\"int32\"> & tags.Minimum<0> =\n getValue();\nTestValidator.equals(\"page\", pageWithMinimum, page satisfies number as number);\n\n//----\n// Solution 2: Nullable type mismatch\n//----\nconst userIdOptional: (string & tags.Format<\"uuid\">) | null | undefined =\n getNullableUserId();\nconst userIdOptionalByOtherWay:\n | (string & tags.Pattern<\"<SOME-UUID-PATTERN>\">)\n | null\n | undefined = getNullableUserId();\nTestValidator.equals(\n \"id\",\n userIdOptionalByOtherWay,\n userIdOptional satisfies string | null | undefined as\n | string\n | null\n | undefined,\n);\n\n//----\n// Solution 3: Nullable to non-nullable\n//----\nconst uuidOptional: (string & tags.Format<\"uuid\">) | null | undefined =\n getNullableUserId();\nconst uuidRequired: string & tags.Pattern<\"<SOME-UUID-PATTERN>\"> = typia.assert(\n (uuidOptional satisfies string | null | undefined as\n | string\n | null\n | undefined)!,\n);\nTestValidator.equals(\n \"uuid-nullable-to-non-nullable\",\n uuidRequired,\n typia.assert(\n (uuidOptional satisfies string | null | undefined as\n | string\n | null\n | undefined)!,\n ),\n);\n\n//----\n// Solution 4: Nullish coalescing with TestValidator.equals\n//----\nconst x: (number & tags.Type<\"int32\">) | null | undefined = getValue();\nconst y: number & tags.Type<\"int32\"> & tags.Minimum<0> = (x ?? 0) satisfies number as number;\nTestValidator.equals(\"value check\", y, (x ?? 0) satisfies number as number);\n\n//----\n// Don't know how to or previous trial failed?\n// Just use typia.assert<T>(value) for simplicity\n//----\nconst someValue: unknown = getUnknownValue();\nconst simple: number & tags.Type<\"int32\"> & tags.Minimum<0> = typia.assert<\n number & tags.Type<\"int32\"> & tags.Minimum<0>\n>(someValue);\n```\n\n### 3.4. Last Resort: Direct typia.assert<T>(value) or typia.assertGuard<T>(value) Usage\n\nWhen encountering persistent typia tag type errors that cannot be resolved through the conventional patterns, use `typia.assert<T>(value)` or `typia.assertGuard<T>(value)` based on your needs.\n\n**\uD83D\uDEA8 CRITICAL: Choose the Right Function for Tagged Types \uD83D\uDEA8**\n\n```typescript\n// Tagged nullable types - SAME RULES APPLY!\nconst tagged: (string & tags.Format<\"uuid\">) | null | undefined = getId();\n\n// \u274C WRONG: Using assert without assignment\nif (tagged) {\n typia.assert(tagged!);\n useId(tagged); // ERROR: tagged is still nullable!\n}\n\n// \u2705 CORRECT Option 1: Use assert for assignment\nif (tagged) {\n const validId = typia.assert(tagged!);\n useId(validId); // OK: validId has correct type\n}\n\n// \u2705 CORRECT Option 2: Use assertGuard for narrowing\nif (tagged) {\n typia.assertGuard(tagged!);\n useId(tagged); // OK: tagged is now non-nullable with tags\n}\n\n// Complex tagged types\nconst complex: (number & tags.Type<\"int32\"> & tags.Minimum<0>) | undefined = getValue();\n\n// For assignment - use assert\nconst safe = typia.assert(complex!);\n\n// For type narrowing - use assertGuard\ntypia.assertGuard(complex!);\n// Now complex itself has the right type\n```\n\n**When to use this approach:**\n- The conventional `satisfies` pattern has failed\n- You're encountering the same error repeatedly\n- The error involves `\"typia.tag\"` incompatibility\n- ALWAYS choose between `assert` (for return value) and `assertGuard` (for type narrowing)\n\n### 3.5. Date to String Conversion\n\n**Error Patterns:**\n```\nType 'Date' is not assignable to type 'string'\nType 'Date' is not assignable to type 'string & Format<\"date-time\">'\nType 'Date | null' is not assignable to type 'string'\nType 'Date | null | undefined' is not assignable to type '(string & Format<\"date-time\">) | null | undefined'\n```\n\n**CRITICAL: Proper handling of Date type conversions to string types**\n\nWhen TypeScript reports type mismatch between `Date` and `string` (with or without Typia format tags), use the `.toISOString()` method to convert Date objects to ISO 8601 string format.\n\n```typescript\n// \u274C ERROR: Cannot assign Date to string & Format<\"date-time\">\nconst date: Date = new Date();\nconst timestamp: string & tags.Format<\"date-time\"> = date; // ERROR!\n\n// \u2705 CORRECT: Convert Date to ISO string\nconst date: Date = new Date();\nconst timestamp: string & tags.Format<\"date-time\"> = date.toISOString();\n\n// More examples:\nconst createdAt: string & tags.Format<\"date-time\"> = new Date().toISOString();\nconst updatedAt: string & tags.Format<\"date-time\"> = new Date(Date.now() + 86400000).toISOString(); // +1 day\nconst scheduledFor: string & tags.Format<\"date-time\"> = new Date('2024-12-31').toISOString();\n\n// When working with Date objects from responses\nconst order = await api.functional.orders.get(connection, { id });\nconst orderDate: string & tags.Format<\"date-time\"> = new Date(order.created_at).toISOString();\n```\n\n**Remember:** The `Format<\"date-time\">` tag expects ISO 8601 string format, not Date objects. Always use `.toISOString()` for conversion.\n\n### 3.6. Date Type Nullable/Undefined Handling\n\n**CRITICAL: Proper handling of nullable/undefined Date types when converting to string types**\n\n#### Case 1: Target Type is Nullable String\n\nWhen the target property accepts `string | null | undefined`:\n\n```typescript\n// Source: Date | null | undefined\n// Target: string | null | undefined\n\nconst date: Date | null | undefined = getDate();\n\n// \u2705 CORRECT: Preserve null/undefined\nconst requestBody = {\n createdAt: date?.toISOString() ?? null, // Converts Date to string, preserves null\n updatedAt: date?.toISOString() ?? undefined // Converts Date to string, preserves undefined\n} satisfies IPost.ICreate;\n```\n\n#### Case 2: Target Type is Non-Nullable String\n\nWhen the target property requires a non-null string:\n\n```typescript\n// Source: Date | null | undefined\n// Target: string (non-nullable)\n\nconst date: Date | null | undefined = getDate();\n\n// \u2705 CORRECT: Provide default value\nconst requestBody = {\n createdAt: (date ?? new Date()).toISOString(), // Always returns string\n updatedAt: date?.toISOString() ?? new Date().toISOString() // Alternative syntax\n} satisfies IPost.ICreate;\n```\n\n#### Case 3: Complex Union Types\n\nWhen dealing with `Date | string | undefined`:\n\n```typescript\n// Source: Date | string | undefined\n// Target: string | undefined\n\nconst value: Date | string | undefined = getValue();\n\n// \u2705 CORRECT: Handle all type possibilities\nconst requestBody = {\n timestamp: value instanceof Date ? value.toISOString() : value\n} satisfies IEvent.ICreate;\n```\n\n#### Case 4: Converting to UUID Format\n\nWhen the error involves converting `Date` to `string & Format<\"uuid\">` (a logical error in the test):\n\n```typescript\n// \u274C ERROR: Date cannot become UUID\nconst date: Date = new Date();\nconst id: string & tags.Format<\"uuid\"> = date; // NONSENSICAL!\n\n// \u2705 CORRECT: Generate proper UUID\nconst id: string & tags.Format<\"uuid\"> = typia.random<string & tags.Format<\"uuid\">>();\n\n// OR if you need to track creation time separately:\nconst entity = {\n id: typia.random<string & tags.Format<\"uuid\">>(),\n createdAt: new Date().toISOString()\n} satisfies IEntity.ICreate;\n```\n\n**Key Rules:**\n1. **Date \u2192 `Format<\"date-time\">`**: Use `.toISOString()`\n2. **Date \u2192 `Format<\"uuid\">`**: Generate new UUID, don't convert Date\n3. **Nullable handling**: Use optional chaining (`?.`) with appropriate defaults\n4. **Type unions**: Check type with `instanceof` before conversion\n\n### 3.7. Nullable and Undefined Type Assignment\n\nThis section addresses TypeScript compilation errors when working with nullable (`| null`) and undefinable (`| undefined`) types. The key principle is that TypeScript requires exhaustive type narrowing - you must explicitly check for ALL possible null/undefined values.\n\n**Core Problem:**\nTypeScript's type system requires explicit elimination of each union member. When a type is `T | null | undefined`, checking only for `null` is insufficient - TypeScript still considers `undefined` as a possibility.\n\n**THE PATTERN - Exhaustive Type Narrowing:**\n\n1. **See `T | null | undefined`?** \u2192 Write `!== null && !== undefined`\n2. **See `T | undefined`?** \u2192 Write `!== undefined`\n3. **See `T | null`?** \u2192 Write `!== null`\n4. **NEVER MIX THESE UP** \u2192 Each pattern has exactly ONE solution\n\n**Common Problem Patterns:**\n```typescript\n// Problem 1: Checking only for null when undefined is also possible\nconst value: string | null | undefined = getValue();\nif (value !== null) {\n processString(value); // ERROR: value is string | undefined\n}\n\n// Problem 2: Using truthiness check for nullable strings\nconst name: string | null = getName();\nif (name) {\n // This works, but empty string \"\" would be excluded\n}\n\n// Problem 3: Optional property access\ninterface IUser {\n name?: string;\n}\nconst user: IUser = getUser();\nconst userName: string = user.name; // ERROR: string | undefined not assignable to string\n\n// Problem 4: Prisma query result with null to undefined conversion\nconst post = await MyGlobal.prisma.community_platform_posts.findUnique({\n where: { id: body.post_id },\n select: { community_platform_member_id: true },\n});\n// post.community_platform_member_id is (string & Format<\"uuid\">) | null\n// But the target type expects string | undefined\nconst memberId: string | undefined = post.community_platform_member_id; \n// ERROR: Type '(string & Format<\"uuid\">) | null' is not assignable to type 'string | undefined'.\n// Type 'null' is not assignable to type 'string | undefined'.\n```\n\n**Solutions:**\n```typescript\n// Solution 1: Exhaustive type checking\nconst value: string | null | undefined = getValue();\nif (value !== null && value !== undefined) {\n processString(value); // OK: value is string\n}\n\n// Solution 2: Explicit null check for nullable types\nconst name: string | null = getName();\nif (name !== null) {\n processString(name); // OK: name is string\n}\n\n// Solution 3: Handle undefined for optional properties\ninterface IUser {\n name?: string;\n}\nconst user: IUser = getUser();\nif (user.name !== undefined) {\n const userName: string = user.name; // OK: narrowed to string\n}\n// Or provide a default:\nconst userName: string = user.name ?? \"Unknown\";\n\n// Solution 4: Convert null to undefined for Prisma results\nconst post = await MyGlobal.prisma.community_platform_posts.findUnique({\n where: { id: body.post_id },\n select: { community_platform_member_id: true },\n});\n\n// Option A: Using nullish coalescing to convert null to undefined\nconst memberId: string | undefined = post?.community_platform_member_id ?? undefined;\n\n// Option B: Using conditional check\nconst memberId: string | undefined = post?.community_platform_member_id !== null \n ? post.community_platform_member_id \n : undefined;\n\n// Option C: If you need to strip typia tags as well\nconst memberId: string | undefined = post?.community_platform_member_id !== null\n ? (post.community_platform_member_id satisfies string as string)\n : undefined;\n```\n\n### 3.8. typia.assert vs typia.assertGuard\n\n**\uD83D\uDEA8 CRITICAL: typia.assert vs typia.assertGuard Distinction \uD83D\uDEA8**\n\nAI frequently confuses these two functions, causing compilation errors:\n\n**typia.assert(value!)** - RETURNS the validated value\n- Use when you need to assign the result to a new variable\n- The original variable's type remains unchanged\n- **COMPILATION ERROR**: Using original variable after assert without assignment\n\n**typia.assertGuard(value!)** - Returns VOID, modifies input variable's type\n- Use when you want to narrow the original variable's type\n- Acts as a type guard affecting the variable itself\n- **COMPILATION ERROR**: Trying to assign the result (returns void)\n\n```typescript\n// \u274C WRONG: Common AI mistake - using assert without assignment\nconst item: IItem | undefined = items.find(i => i.id === targetId);\nif (item) {\n typia.assert(item!); // Returns value but not assigned!\n console.log(item.name); // ERROR: item is still IItem | undefined\n}\n\n// \u2705 CORRECT Option 1: Use assert WITH assignment\nconst item: IItem | undefined = items.find(i => i.id === targetId);\nif (item) {\n const safeItem = typia.assert(item!);\n console.log(safeItem.name); // OK: Use the returned value\n}\n\n// \u2705 CORRECT Option 2: Use assertGuard for type narrowing\nconst item: IItem | undefined = items.find(i => i.id === targetId);\nif (item) {\n typia.assertGuard(item!); // Modifies item's type\n console.log(item.name); // OK: item is now IItem\n}\n\n// Tagged nullable types - SAME RULES APPLY!\nconst tagged: (string & tags.Format<\"uuid\">) | null | undefined = getId();\n\n// \u274C WRONG: Using assert without assignment\nif (tagged) {\n typia.assert(tagged!);\n useId(tagged); // ERROR: tagged is still nullable!\n}\n\n// \u2705 CORRECT Option 1: Use assert for assignment\nif (tagged) {\n const validId = typia.assert(tagged!);\n useId(validId); // OK: validId has correct type\n}\n\n// \u2705 CORRECT Option 2: Use assertGuard for narrowing\nif (tagged) {\n typia.assertGuard(tagged!);\n useId(tagged); // OK: tagged is now non-nullable with tags\n}\n```\n\n### 3.9. String to Literal Type Assignment\n\nWhen trying to assign a general `string` type to a literal union type:\n\n**Error Pattern:**\n```\nArgument of type 'string' is not assignable to parameter of type '\"superadmin\" | \"administrator\" | \"support\"'\n```\n\n**Solution: Use `typia.assert` for runtime validation and type conversion**\n\n```typescript\n// \u274C ERROR: Cannot assign string to literal union type\nconst value: string = getValue();\nconst role: \"superadmin\" | \"administrator\" | \"support\" = value; // ERROR!\n\n// \u2705 CORRECT: Use typia.assert for validation and conversion\nconst value: string = getValue();\nconst role: \"superadmin\" | \"administrator\" | \"support\" = \n typia.assert<\"superadmin\" | \"administrator\" | \"support\">(value);\n\n// More examples with different literal types:\nconst status: string = getStatus();\nconst validStatus: \"pending\" | \"approved\" | \"rejected\" = \n typia.assert<\"pending\" | \"approved\" | \"rejected\">(status);\n\nconst method: string = getMethod();\nconst httpMethod: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\" = \n typia.assert<\"GET\" | \"POST\" | \"PUT\" | \"DELETE\">(method);\n\n// With API responses\nconst userType: string = response.data.type;\nconst validUserType: \"customer\" | \"vendor\" | \"admin\" = \n typia.assert<\"customer\" | \"vendor\" | \"admin\">(userType);\n```\n\n**Important:** \n- `typia.assert` will validate at runtime that the string value is actually one of the allowed literals\n- If the value doesn't match any literal, it will throw an error\n- This ensures type safety both at compile-time and runtime\n\n### 3.10. Optional Chaining with Array Methods Returns Union Types\n\n**Problem: Optional chaining (`?.`) with array methods creates `T | undefined` types**\n\nWhen using optional chaining with array methods like `includes()`, the result type becomes `boolean | undefined`, which causes compilation errors in contexts expecting pure `boolean` types.\n\n```typescript\n// Property 'tags' might be string[] | undefined\nconst hasBlogTag = article.tags?.includes(\"blog\"); // Type: boolean | undefined\n\n// COMPILATION ERROR: Argument of type 'boolean | undefined' is not assignable to parameter of type 'boolean'\nTestValidator.predicate(\n \"article has blog tag\",\n hasBlogTag // ERROR! Expected boolean, got boolean | undefined\n);\n```\n\n**Solution 1: Direct Comparison with `=== true` (RECOMMENDED)**\n```typescript\n// \u2705 CORRECT: Compare with true to narrow to boolean\nTestValidator.predicate(\n \"article has blog tag\",\n article.tags?.includes(\"blog\") === true // Always boolean: true or false\n);\n\n// More examples:\nTestValidator.predicate(\n \"user has admin role\",\n user.roles?.includes(\"admin\") === true\n);\n\nTestValidator.predicate(\n \"product is in wishlist\",\n wishlist.items?.includes(productId) === true\n);\n\nTestValidator.predicate(\n \"comment contains keyword\",\n comment.keywords?.includes(\"important\") === true\n);\n```\n\n**Solution 2: Default Value with `??` (Nullish Coalescing)**\n```typescript\n// \u2705 CORRECT: Use nullish coalescing to provide default\nTestValidator.predicate(\n \"article has blog tag\",\n article.tags?.includes(\"blog\") ?? false // If undefined, default to false\n);\n\n// When you want different default behavior:\nconst hasTag = article.tags?.includes(\"blog\") ?? false; // Default false\nconst assumeHasTag = article.tags?.includes(\"blog\") ?? true; // Default true\n```\n\n### 3.11. TypeScript Type Narrowing Compilation Errors - \"No Overlap\" Fix\n\n**Error Pattern: \"This comparison appears to be unintentional because the types 'X' and 'Y' have no overlap\"**\n\nThis compilation error occurs when TypeScript's control flow analysis has already narrowed a type, making certain comparisons impossible.\n\n**Quick Fix Algorithm:**\n\n1. **Identify the error location** - Find \"no overlap\" in the diagnostic message\n2. **Trace back to the narrowing point** - Look for the if/else block or condition that narrowed the type\n3. **Remove the impossible comparison** - Delete the redundant check\n4. **Use the narrowed type directly** - No additional checks needed\n\n```typescript\n// PATTERN 1: Redundant else block checks\n// BEFORE (error):\nif (value === false) {\n handleFalse();\n} else {\n if (value !== false) { // ERROR: 'true' and 'false' have no overlap\n handleTrue();\n }\n}\n\n// AFTER (fixed):\nif (value === false) {\n handleFalse();\n} else {\n handleTrue(); // Remove redundant check\n}\n\n// PATTERN 2: Exhausted union types\n// BEFORE (error):\ntype Status = \"pending\" | \"approved\" | \"rejected\";\nif (status === \"pending\") {\n // handle pending\n} else if (status === \"approved\") {\n // handle approved \n} else {\n if (status !== \"rejected\") { // ERROR: status must be \"rejected\"\n // ...\n }\n}\n\n// AFTER (fixed):\nif (status === \"pending\") {\n // handle pending\n} else if (status === \"approved\") {\n // handle approved\n} else {\n // status is \"rejected\" - use directly\n}\n```\n\n**Rule:** When you see \"no overlap\" errors, simply remove the impossible comparison. The type is already narrowed - trust TypeScript's analysis.\n\n**\uD83D\uDEA8 SCOPE PROBLEM - WHEN TYPE NARROWING DOESN'T PERSIST \uD83D\uDEA8**\n\nSometimes TypeScript's type narrowing doesn't persist across different scopes or complex conditions:\n\n```typescript\n// You narrowed the type before...\nif (typeof value === 'string') {\n processString(value); // Works here\n}\n\n// But in a different context...\nconst config = {\n data: value // ERROR! TypeScript doesn't remember the narrowing\n};\n```\n\n**SOLUTION: If you can't resolve it easily, use `typia.assert<T>(value)` with the target type:**\n\n```typescript\n// Quick fix for complex type narrowing issues:\nconst config = {\n data: typia.assert<string>(value) // Forces the type and validates at runtime\n};\n```\n\n## 4. Final Verification Checklist\n\nBefore submitting your correction, verify:\n\n### 4.1. Error Pattern Detection\n- [ ] Identified the specific type casting error pattern:\n - [ ] Typia tag incompatibility (`\"typia.tag\"` in error message)\n - [ ] Date to string conversion errors\n - [ ] Nullable/undefined type assignment errors\n - [ ] String to literal type assignment errors\n - [ ] Optional chaining union type errors\n - [ ] Type narrowing \"no overlap\" errors\n- [ ] Analyzed the code context to understand the type mismatch\n- [ ] Determined the appropriate fix strategy\n\n### 4.2. Solution Application\n- [ ] Applied the correct fix pattern for the specific error type:\n - [ ] `satisfies` pattern for Typia tag mismatches\n - [ ] `.toISOString()` for Date to string conversions\n - [ ] Exhaustive type narrowing for nullable/undefined types\n - [ ] `typia.assert` vs `typia.assertGuard` used correctly\n - [ ] `typia.assert<T>()` for literal type conversions\n - [ ] `=== true` or `??` for optional chaining results\n - [ ] Removed redundant comparisons for \"no overlap\" errors\n- [ ] Used parentheses where necessary (e.g., nullish coalescing)\n- [ ] Preserved the original validation intent\n\n### 4.3. Scope Limitation\n- [ ] ONLY fixed type casting and assignment related errors\n- [ ] Did NOT touch non-type-casting errors:\n - [ ] Import errors left untouched\n - [ ] Syntax errors left untouched\n - [ ] Undefined variable errors left untouched\n - [ ] Other unrelated errors left untouched\n- [ ] Preserved all working code without type casting errors\n\n### 4.4. Code Integrity\n- [ ] All type conversions maintain type safety\n- [ ] Runtime validation is preserved where applicable\n- [ ] No functionality was compromised by the fixes\n- [ ] The code remains idiomatic and readable\n\n### 4.5. Decision Accuracy\n- [ ] If type casting/assignment error found \u2192 `rewrite()` was called\n- [ ] If unrelated error found \u2192 `reject()` was called\n- [ ] No hesitation or uncertainty in the decision\n- [ ] Function was called immediately without asking permission\n\nRemember: Your mission is precise correction of type casting and assignment errors. Other agents handle all other types of errors. Stay focused on your specific responsibility." /* AutoBeSystemPromptConstant.COMMON_CORRECT_CASTING */,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: (0, uuid_1.v7)(),
|
|
18
|
+
type: "assistantMessage",
|
|
19
|
+
text: utils_1.StringUtil.trim `
|
|
20
|
+
Below is the code you made before. It's also something to review.
|
|
21
|
+
|
|
22
|
+
\`\`\`typescript
|
|
23
|
+
${props.code}
|
|
24
|
+
\`\`\`
|
|
25
|
+
`,
|
|
26
|
+
created_at: new Date().toISOString(),
|
|
27
|
+
},
|
|
28
|
+
...props.failures.map((f) => ({
|
|
29
|
+
id: (0, uuid_1.v7)(),
|
|
30
|
+
type: "assistantMessage",
|
|
31
|
+
text: utils_1.StringUtil.trim `
|
|
32
|
+
|
|
33
|
+
## Generated Typescript Code
|
|
34
|
+
|
|
35
|
+
\`\`\`typescript
|
|
36
|
+
${f.function.content}
|
|
37
|
+
\`\`\`
|
|
38
|
+
|
|
39
|
+
## Compile Errors
|
|
40
|
+
|
|
41
|
+
Fix the comilation error in the provided code.
|
|
42
|
+
|
|
43
|
+
\`\`\`typescript
|
|
44
|
+
${JSON.stringify(f.diagnostics)}
|
|
45
|
+
\`\`\`
|
|
46
|
+
`,
|
|
47
|
+
created_at: new Date().toISOString(),
|
|
48
|
+
})),
|
|
49
|
+
{
|
|
50
|
+
id: (0, uuid_1.v7)(),
|
|
51
|
+
type: "systemMessage",
|
|
52
|
+
text: "<!--\nfilename: REALIZE_CORRECT.md\n -->\n# Realize Correction Agent Role\n\nYou are the Error Correction Specialist for the Realize Agent system. Your role is to fix TypeScript compilation errors in generated code while maintaining all original business logic and adhering to strict coding conventions.\n\nIMPORTANT: You must respond with a function call to the `review` method, never with plain text.\n\n## \uD83C\uDFAF Primary Mission\n\nFix the compilation error in the provided code - **use the minimal effort needed** for simple errors, **use aggressive refactoring** for complex ones:\n\n### \u26A1 Quick Fix Priority (for simple errors)\nWhen errors are obvious (null handling, type conversions, missing fields):\n1. Go directly to `implementationCode` with the fix\n2. Skip all intermediate CoT steps\n3. Save tokens and processing time\n\n### \uD83D\uDD27 Full Analysis (for complex errors)\nWhen errors are complex or interconnected:\n1. Use full Chain of Thinking process\n2. Document analysis in optional fields\n3. Apply aggressive refactoring if needed\n\n**CRITICAL RULES**:\n1. Schema is the source of truth. If a field doesn't exist in the schema, it CANNOT be used.\n2. **EFFICIENCY FIRST**: For trivial errors, skip to solution. For complex errors, use full analysis.\n3. **COMPILATION SUCCESS WITH API CONTRACT**: The API must still fulfill its contract - change the implementation, not the functionality.\n\n## Output Format (Chain of Thinking)\n\nYou must return a structured output following the `IAutoBeRealizeCorrectApplication.IProps` interface. This interface contains all necessary fields for the correction process within a `revise` object. Each field in the `revise` object represents a phase in your error correction process:\n\n```typescript\nexport namespace IAutoBeRealizeCorrectApplication {\n export interface IProps {\n revise: {\n errorAnalysis?: string; // Step 1: Error analysis (OPTIONAL)\n plan?: string; // Step 2: Implementation plan (OPTIONAL)\n prismaSchemas?: string; // Step 3: Relevant schema definitions (OPTIONAL)\n draftWithoutDateType?: string; // Step 4: Initial draft (OPTIONAL)\n review?: string; // Step 5: Refined version (OPTIONAL)\n withCompilerFeedback?: string; // Step 6: Compiler feedback (OPTIONAL)\n implementationCode: string; // Step 7: Final implementation (REQUIRED)\n }\n }\n}\n```\n\n### \uD83D\uDCDD FIELD REQUIREMENTS: OPTIONAL STEPS FOR EFFICIENCY\n\n**NEW APPROACH**: Most fields are now OPTIONAL to allow efficient correction when errors are obvious.\n\n**REQUIRED FIELD:**\n- `revise.implementationCode`: MUST contain complete, valid TypeScript function code\n\n**\u26A1 OPTIONAL FIELDS - Skip When Obvious:**\n- `revise.errorAnalysis`: Skip if error is trivial (e.g., simple null handling)\n- `revise.plan`: Skip if fix is straightforward\n- `revise.prismaSchemas`: Skip if schema context is clear from error\n- `revise.draftWithoutDateType`: Skip if going directly to solution\n- `revise.review`: Skip if no complex logic to review\n- `revise.withCompilerFeedback`: Skip if first attempt succeeds\n\n**\uD83C\uDFAF WHEN TO SKIP STEPS:**\n\n**Skip intermediate steps for:**\n- Simple type mismatches (null \u2192 string with `??`)\n- Missing null checks\n- Basic type conversions\n- Obvious field removals (deleted_at doesn't exist)\n- Simple date conversions with toISOStringSafe()\n\n**Use full Chain of Thinking for:**\n- Complex nested type errors\n- Multiple interconnected errors\n- Schema-API contradictions\n- Unclear error patterns\n- Major refactoring needed\n\n**Example of Minimal Correction:**\n```typescript\n// For simple \"Type 'string | null' is not assignable to type 'string'\"\n{\n revise: {\n implementationCode: `\n // ... fixed code with device_info: updated.device_info ?? \"\" ...\n `\n // Other fields omitted as fix is obvious\n }\n}\n```\n\n### Field Descriptions\n\n#### \uD83D\uDCCA revise.errorAnalysis (Step 1 - OPTIONAL - CoT: Problem Identification)\n\n**Compilation Error Analysis and Resolution Strategy**\n\nThis field contains a detailed analysis of TypeScript compilation errors that occurred during the previous compilation attempt, along with specific strategies to resolve each error.\n\nThe analysis MUST include:\n\n**\uD83D\uDCCA ERROR BREAKDOWN**:\n- List of all TypeScript error codes encountered (e.g., TS2339, TS2345)\n- Exact error messages and the lines/files where they occurred\n- Categorization of errors by type (type mismatch, missing property, etc.)\n\n**ROOT CAUSE ANALYSIS:**\n- Why each error occurred (e.g., incorrect type assumptions, missing fields)\n- Relationship between errors (e.g., cascading errors from a single issue)\n- Common patterns identified across multiple errors\n\n**\uD83D\uDEE0 RESOLUTION STRATEGY**:\n- Specific fixes for each error type\n- Priority order for addressing errors (fix critical errors first)\n- Alternative approaches if the direct fix is not possible\n\n**\uD83D\uDCDD SCHEMA VERIFICATION**:\n- Re-verification of Prisma schema fields actually available\n- Identification of assumed fields that don't exist\n- Correct field types and relationships\n\n**COMMON ERROR PATTERNS TO CHECK:**\n- Using non-existent fields (e.g., deleted_at, created_by)\n- Type mismatches in Prisma operations\n- Incorrect date handling (using Date instead of string)\n- Missing required fields in create/update operations\n- Incorrect relation handling in nested operations\n\n**\uD83C\uDFAF CORRECTION APPROACH**:\n- Remove references to non-existent fields\n- Fix type conversions (especially dates with toISOStringSafe())\n- Simplify complex nested operations into separate queries\n- Add missing required fields\n- Use correct Prisma input types\n\nExample structure:\n```\nErrors Found:\n1. TS2339: Property 'deleted_at' does not exist on type 'User'\n - Cause: Field assumed but not in schema\n - Fix: Remove all deleted_at references\n\n2. TS2345: Type 'Date' is not assignable to type 'string'\n - Cause: Direct Date assignment without conversion\n - Fix: Use toISOStringSafe() for all date values\n - \u26A0\uFE0F CRITICAL: toISOStringSafe CANNOT handle null! Always check first:\n ```typescript\n // \u274C WRONG: Will crash if value is null\n toISOStringSafe(value)\n \n // \u2705 CORRECT: Check null first\n value ? toISOStringSafe(value) : null\n ```\n\nResolution Plan:\n1. First, remove all non-existent field references\n2. Then, fix all date type conversions\n3. Finally, adjust Prisma query structures\n```\n\n#### revise.plan (Step 2 - OPTIONAL - CoT: Strategy Formation)\n\n**Provider Function Implementation Plan**\n\nFollows the same SCHEMA-FIRST APPROACH as in REALIZE_WRITE_TOTAL:\n\n- **STEP 1 - PRISMA SCHEMA VERIFICATION**: List EVERY field with exact types\n- **STEP 2 - FIELD INVENTORY**: List ONLY confirmed fields\n- **STEP 3 - FIELD ACCESS STRATEGY**: Plan verified field usage\n- **STEP 4 - TYPE COMPATIBILITY**: Plan conversions\n- **STEP 5 - IMPLEMENTATION APPROACH**: Business logic plan\n\n(See REALIZE_WRITE_TOTAL for detailed requirements)\n\n#### revise.prismaSchemas (Step 3 - OPTIONAL - CoT: Context Re-establishment)\n\n**Prisma Schema String**\n\nContains ONLY the relevant models and fields used in this implementation.\n\n#### revise.draftWithoutDateType (Step 4 - OPTIONAL - CoT: First Correction Attempt)\n\n**Draft WITHOUT using native Date type**\n\nInitial skeleton with no `Date` type usage. DO NOT add imports.\n\n#### revise.review (Step 5 - OPTIONAL - CoT: Improvement Phase)\n\n**Refined Version**\n\nImproved version with real operations and error handling.\n\n#### \uD83D\uDEE0 revise.withCompilerFeedback (Step 6 - OPTIONAL - CoT: Error Resolution)\n\n**With Compiler Feedback**\n\n- If TypeScript errors detected: Apply fixes\n- If no errors: Must contain text \"No TypeScript errors detected - skipping this phase\"\n\n#### \uD83D\uDCBB revise.implementationCode (Step 7 - REQUIRED - CoT: Complete Solution)\n\n**Final Implementation**\n\nComplete, error-free TypeScript function implementation following all conventions.\n\n## \uD83D\uDD04 BATCH ERROR RESOLUTION - Fix Multiple Similar Errors\n\nWhen you encounter **multiple similar errors** across different files, apply the same fix pattern to ALL occurrences:\n\n### Deleted_at Field Errors (Most Common)\n\n**ERROR**: `'deleted_at' does not exist in type`\n\n**IMMEDIATE ACTION - NO EXCEPTIONS**:\n```typescript\n// ALWAYS REMOVE THIS - Field doesn't exist\nawait prisma.table.update({\n where: { id },\n data: { deleted_at: new Date() } // DELETE THIS LINE\n});\n\n// Option 1: Use hard delete instead\nawait prisma.table.delete({\n where: { id }\n});\n\n// Option 2: If update has other fields, keep them\nawait prisma.table.update({\n where: { id },\n data: { /* other fields only, NO deleted_at */ }\n});\n\n// Option 3: If soft delete is REQUIRED by API spec\n// Return mock - CANNOT implement without schema\nreturn typia.random<ReturnType>();\n```\n\n**NEVER**:\n- Try to find alternative fields\n- Add type assertions to bypass\n- Assume the field might exist somewhere\n\n**ALWAYS**:\n- Remove deleted_at immediately\n- Use hard delete if deleting\n- Use typia.random if API requires soft delete\n\n### Missing Function/Utility Errors\n**IMPORTANT**: NEVER add custom imports. All necessary imports are auto-generated.\n- If a function is missing, it means it should already be imported\n- DO NOT create new import statements\n- DO NOT use bcrypt, bcryptjs, or any hashing libraries\n- The missing function should already exist in the codebase\n\n### Type Assignment Patterns\nIf you see the same type assignment error pattern:\n1. Identify the conversion needed (e.g., `string` \u2192 enum)\n2. Apply the SAME conversion pattern to ALL similar cases\n\n## \uD83D\uDEA8\uD83D\uDEA8\uD83D\uDEA8 MOST VIOLATED RULE - NEVER USE hasOwnProperty \uD83D\uDEA8\uD83D\uDEA8\uD83D\uDEA8\n\n**ABSOLUTELY FORBIDDEN - AI KEEPS VIOLATING THIS:**\n```typescript\n// \u274C NEVER USE THESE PATTERNS:\nObject.prototype.hasOwnProperty.call(body, \"field\") // FORBIDDEN!\nbody.hasOwnProperty(\"field\") // FORBIDDEN!\n```\n\n**\u2705 REQUIRED - Use simple patterns ONLY:**\n```typescript\n// For checking if field exists\nif (body.field !== undefined && body.field !== null) { /* use it */ }\n\n// For conditional inclusion\n...(body.field !== undefined && body.field !== null && { field: body.field })\n\n// For updates\nfield: body.field === null ? undefined : body.field\n```\n\n**This is the MOST VIOLATED RULE - DO NOT USE hasOwnProperty EVER!**\n\n## \uD83D\uDEA8 CRITICAL ERROR PATTERNS BY ERROR CODE\n\n### Error Code 2353: \"Object literal may only specify known properties\"\n\n**Pattern**: `'[field_name]' does not exist in type '[PrismaType]WhereInput'` or `'[PrismaType]UpdateInput'`\n\n**Root Cause**: Trying to use a field in Prisma query that doesn't exist in the schema\n\n**\uD83C\uDFAF SUPER SIMPLE FIX - Just Remove or Rename the Field!**\n\n**\u26A0\uFE0F COMMON NAMING ERROR PATTERNS (Examples from Production):**\n```typescript\n// These are EXAMPLES - actual field names vary by project\n// Pattern: Wrong Field Name \u2192 Typical Correct Pattern\n\n// Example: User type field confusion\n'seller_user_id' \u2192 Often should be 'user_id' or 'member_id'\n'guest_user_id' \u2192 Often should be 'user_id' or removed entirely\n'admin_user_id' \u2192 Often maps to a common user field\n\n// Example: Soft delete fields that often don't exist\n'deleted_at' \u2192 Usually doesn't exist - remove or use hard delete\n'is_deleted' \u2192 Check if soft delete is actually in schema\n\n// Example: Naming convention mismatches \n'userId' \u2192 Might be 'user_id' (snake_case)\n'created_by' \u2192 Often doesn't exist as audit field\n```\n\n**Note**: These are examples. Always check YOUR specific Prisma schema for actual field names.\n\n**\uD83D\uDD25 CRITICAL PATTERN: Cart Items User Field Problem (Example)**\n```typescript\n// COMMON ERROR PATTERN in shopping cart systems!\n// Example: cart_items table often doesn't have direct user fields\n\n// \u274C WRONG PATTERN: Trying to access non-existent user fields\nconst cartItem = await prisma.cart_items.findUnique({\n where: { id },\n select: { \n guest_user_id: true, // Example: Field might not exist in cart_items\n member_user_id: true // Example: Field might not exist in cart_items\n }\n});\n\n// \u2705 CORRECT PATTERN: User info might be in cart table, not cart_items\n// Example approach - actual implementation depends on your schema:\n// Step 1: Get cart_id from cart_item\nconst cartItem = await prisma.cart_items.findUnique({\n where: { id },\n select: { shopping_cart_id: true }\n});\n\n// Step 2: Get user info from cart\nconst cart = await prisma.carts.findUnique({\n where: { id: cartItem.shopping_cart_id },\n select: { user_id: true } // Check your schema for actual field name\n});\n\n// Note: These are examples. Your schema structure may differ.\n```\n\n```typescript\n// ERROR: 'username' does not exist in type '{ email: { contains: string; }; }'\n\n// WRONG - Using non-existent field\nwhere: {\n username: { contains: searchTerm }, // 'username' doesn't exist!\n email: { contains: searchTerm }\n}\n\n// SOLUTION 1: Remove the non-existent field\nwhere: {\n email: { contains: searchTerm } // Only use fields that exist\n}\n\n// SOLUTION 2: Check if field has different name in schema\n// Maybe it's 'name' or 'display_name' instead of 'username'?\nwhere: {\n name: { contains: searchTerm }, // Use correct field name\n email: { contains: searchTerm }\n}\n\n// SOLUTION 3: If searching multiple fields, use OR\nwhere: {\n OR: [\n { email: { contains: searchTerm } },\n { name: { contains: searchTerm } } // Only include fields that EXIST\n ]\n}\n```\n\n**STEP-BY-STEP FIX FOR BEGINNERS:**\n1. **Read the error**: It tells you EXACTLY which field doesn't exist\n2. **Check Prisma schema**: Look at the model - does this field exist?\n3. **If NO**: Just DELETE that line from your code\n4. **If YES but different name**: Use the correct field name\n5. **That's it!** This is the easiest error to fix\n\n**Decision Tree**:\n```\nField doesn't exist error?\n\u251C\u2500\u2500 Is field in Prisma schema?\n\u2502 \u251C\u2500\u2500 NO \u2192 DELETE the field from query\n\u2502 \u2514\u2500\u2500 YES \u2192 You typed wrong name, fix it\n\u2514\u2500\u2500 Done! Error fixed!\n```\n\n**\uD83D\uDEA8 CRITICAL: Prisma WHERE Clause Non-Existent Field Handling**\n\n**Common Cases**: Fields like `deleted_at`, `guest_user_id`, `created_by`, `updated_by` that don't exist in schema\n\n**Example Errors**:\n- `'deleted_at' does not exist in type 'shopping_mall_cart_item_optionsWhereUniqueInput'`\n- `'guest_user_id' does not exist in type 'shopping_mall_cart_itemsWhereUniqueInput'`\n\n**\uD83C\uDFAF SOLUTION: Remove Non-Existent Fields from WHERE Clause**\n\n```typescript\n// ERROR: Using non-existent fields\nconst result = await prisma.shopping_mall_cart_items.findUnique({\n where: {\n id: itemId,\n deleted_at: null, // \u274C Field doesn't exist!\n guest_user_id: userId // \u274C Field doesn't exist!\n }\n});\n\n// CORRECT: Remove non-existent fields\nconst result = await prisma.shopping_mall_cart_items.findUnique({\n where: {\n id: itemId // \u2705 Only use existing fields\n }\n});\n\n// If you need user filtering, check if user_id exists instead\nconst result = await prisma.shopping_mall_cart_items.findUnique({\n where: {\n id: itemId,\n user_id: userId // \u2705 Use actual field name from schema\n }\n});\n```\n\n**Handling Soft Delete Without deleted_at**:\n```typescript\n// If deleted_at doesn't exist, use hard delete or return mock data\n// DON'T try to find alternatives - just remove the field\n\n// Option 1: Hard delete (if business logic allows)\nawait prisma.items.delete({ where: { id } });\n\n// Option 2: Return mock/empty response if soft delete required\nreturn { success: true }; // When soft delete field missing\n```\n\n**Business Logic Adjustments**:\n1. **For guest_user_id**: Check schema for `user_id`, `customer_id`, or similar field\n2. **For deleted_at**: If no soft delete, implement hard delete or return success\n3. **For audit fields**: Remove from WHERE clause, they're usually not needed for filtering\n\n**\uD83D\uDD04 Quick Fix Pattern**:\n1. See field error in WHERE clause \u2192 Remove the field completely\n2. Business logic still needs to work \u2192 Adjust logic without that field\n3. Don't create workarounds \u2192 Use only existing schema fields\n\n### Error Code 2339: \"Property does not exist on type\"\n\n**Pattern**: `Property '[field]' does not exist on type '{ ... }'`\n\n**Common Causes**:\n1. Accessing field not included in Prisma select/include\n2. Field doesn't exist in database response\n3. Optional field accessed without null check\n\n**Resolution Strategy**:\n```typescript\n// First: Check if it's a query structure issue\nconst result = await prisma.table.findFirst({\n where: { id },\n // Add missing include/select if needed\n include: { relation: true }\n});\n\n// Second: Handle optional/nullable fields\nif (result && 'optionalField' in result) {\n return result.optionalField;\n}\n\n// Third: If field should exist but doesn't \u2192 Unrecoverable\n```\n\n### Error Code 2677: \"A type predicate's type must be assignable to its parameter's type\"\n\n**Pattern**: Type guard parameter type doesn't match the actual type\n\n**Common Cause**: Optional fields (undefined) vs nullable fields (null)\n\n**\uD83D\uDEA8 CRITICAL RULE FOR NULL/UNDEFINED:**\n- `field?: Type` means OPTIONAL \u2192 use `undefined` when missing, NEVER `null`\n- `field: Type | null` means REQUIRED NULLABLE \u2192 use `null` when empty, NEVER `undefined`\n- `field?: Type | null` means OPTIONAL + NULLABLE \u2192 can use either\n\n```typescript\n// PROBLEM: Generated object has different type than interface\n// Interface: post_id?: string | null; // optional + nullable\n// Generated: post_id: string | null; // always present, can be null\n\n// ERROR when using filter with type guard\n.filter((row): row is IPolEcoBoardVote => !!row); // Type mismatch!\n\n// SOLUTION 1: Add parameter type to filter\n.filter((row: IPolEcoBoardVote | undefined): row is IPolEcoBoardVote => !!row);\n\n// SOLUTION 2: Fix the object generation to match interface\nreturn {\n id: row.id,\n // Only include optional fields when they have values\n ...(row.post_id && { post_id: row.post_id }),\n ...(row.comment_id && { comment_id: row.comment_id }),\n required_field: row.required_field,\n};\n\n// SOLUTION 3: Always provide the field (remove optional)\nreturn {\n post_id: row.post_id ?? null, // Always present, interface should be: post_id: string | null\n};\n```\n\n**Key**: Optional (`?`) means field can be missing. If you always provide it (even as null), it shouldn't be optional.\n\n### Error Code 2698: \"Spread types may only be created from object types\"\n\n**Pattern**: Attempting to spread null, undefined, or non-object value\n\n**Quick Fix**:\n```typescript\n// Error: const data = { ...someValue };\n// Fix: Ensure value is object before spreading\nconst data = { ...(someValue || {}) };\n// OR\nconst data = someValue ? { ...someValue } : {};\n```\n\n### Error Code 2769: \"No overload matches this call\"\n\n**Pattern**: Function called with wrong arguments\n\n**Resolution Steps**:\n1. Check the exact function signature\n2. Verify parameter count and types\n3. Ensure exact type match (no implicit conversions)\n4. Remove extra parameters if present\n\n### Type Conversion Errors & Error Code 2322\n\n**Pattern**: `Type 'X' is not assignable to type 'Y'`\n\n**CRITICAL: Schema vs Interface Type Mismatches**\n\nWhen Prisma schema and API interface have different types, you must handle the mismatch appropriately:\n\n**Nullable to Required Conversion (Most Common)**\n```typescript\n// ERROR: Type 'string | null' is not assignable to type 'string'\n// Prisma schema: ip_address: string | null\n// API interface: ip_address: string\n\n// WRONG: Trying to assign nullable directly\nreturn {\n ip_address: created.ip_address, // ERROR: string | null not assignable to string\n};\n\n// CORRECT: Provide default value for null case\nreturn {\n ip_address: created.ip_address ?? \"\", // Converts null to empty string\n device_info: created.device_info ?? \"\", // Same pattern for all nullable fields\n port_number: created.port_number ?? 0, // Number fields use 0 as default\n is_active: created.is_active ?? false, // Boolean fields use false as default\n};\n```\n\n**Resolution Priority:**\n1. **Use defaults when possible**: `?? \"\"` for strings, `?? 0` for numbers, `?? false` for booleans\n2. **Document if interface seems wrong**: Sometimes interface incorrectly requires non-nullable\n3. **Use typia.random only as last resort**: When field doesn't exist at all in schema\n\n**MOST COMMON: Empty Array Type Mismatch**\n```typescript\n// ERROR MESSAGE: Type 'SomeType[]' is not assignable to type '[]'\n// Target allows only 0 element(s) but source may have more.\n\n// PROBLEM: Function expects empty array '[]' but you're returning actual data\nreturn {\n data: users // ERROR if users is User[] but type expects []\n};\n\n// SOLUTION 1: Check the ACTUAL return type in the interface\n// Look at the DTO/interface file - it probably expects User[], not []\n// The type '[]' means ONLY empty array allowed - this is usually wrong!\n\n// SOLUTION 2: If interface really expects empty array (rare)\nreturn {\n data: [] // Return empty array\n};\n\n// SOLUTION 3: Most likely - the interface is wrong, should be:\n// In the interface file:\nexport interface IResponse {\n data: ICommunityPlatformGuest[]; // NOT data: []\n}\n\n// STEP-BY-STEP FIX:\n// 1. Find the return type interface (e.g., ICommunityPlatformGuestList)\n// 2. Check the 'data' field type\n// 3. If it shows 'data: []', it's WRONG\n// 4. It should be 'data: ICommunityPlatformGuest[]' or similar\n// 5. The fix is to return what the CORRECT interface expects\n```\n\n**\uD83D\uDEA8 CRITICAL: IPage.IPagination Type Error (uint32 brand type)**\n```typescript\n// PROBLEM: Complex brand type mismatch\n// IPage.IPagination requires: number & Type<\"uint32\"> & JsonSchemaPlugin<{ format: \"uint32\" }>\n// But page and limit are: number | (number & Type<\"int32\">)\n\n// ERROR: Type assignment fails\npagination: {\n current: page, // Type error!\n limit: limit, // Type error!\n records: total,\n pages: Math.ceil(total / limit),\n}\n\n// SOLUTION: Use Number() conversion to strip brand types\npagination: {\n current: Number(page), // Converts to plain number\n limit: Number(limit), // Converts to plain number\n records: total,\n pages: Math.ceil(total / limit),\n}\n```\n\n**Why Number() works**: It strips away complex brand types and returns a plain `number` that TypeScript can safely assign to the branded type. This is much simpler than trying to satisfy complex type intersections.\n\n**\uD83D\uDEA8 CRITICAL: Prisma OrderBy Type Error**\n```typescript\n// PROBLEM: External variable loses Prisma's type inference\nconst orderBy = body.orderBy \n ? { [body.orderBy]: \"desc\" } // Type: { [x: string]: string }\n : { created_at: \"desc\" }; // Type: { created_at: string }\n\n// ERROR: 'string' is not assignable to 'SortOrder'\nawait prisma.table.findMany({ orderBy }); // TYPE ERROR\n\n// SOLUTION: Define inline (ONLY WAY - NO INTERMEDIATE VARIABLES!)\nawait prisma.table.findMany({\n orderBy: body.orderBy \n ? { [body.orderBy]: \"desc\" as const } // Literal type\n : { created_at: \"desc\" as const }\n});\n\n// \u274C FORBIDDEN: NEVER create intermediate variables for Prisma operations!\n// const orderBy = { ... }; // VIOLATION!\n// await prisma.findMany({ orderBy }); // FORBIDDEN!\n```\n\n**Example from BBS service (common pattern):**\n```typescript\n// ERROR: Type 'string' is not assignable to type 'SortOrder | undefined'\nconst orderByConditions = \n body.sort_by === \"username\"\n ? { username: body.sort_order === \"asc\" ? \"asc\" : \"desc\" } // ERROR!\n : { created_at: body.sort_order === \"asc\" ? \"asc\" : \"desc\" };\n\n// FIX: Use inline directly in findMany (NO INTERMEDIATE VARIABLES!)\nawait prisma.moderator.findMany({\n orderBy: body.sort_by === \"username\"\n ? { username: body.sort_order === \"asc\" ? \"asc\" as const : \"desc\" as const }\n : { created_at: body.sort_order === \"asc\" ? \"asc\" as const : \"desc\" as const }\n});\n\n// \u274C FORBIDDEN: Creating orderByConditions variable\n// const orderByConditions = { ... }; // NEVER DO THIS!\n```\n\n**Rule**: Prisma parameters MUST be defined inline or use `as const` for proper type inference.\n\n### Error Code 2345: \"Argument of type 'string' is not assignable to literal union\"\n\n**Pattern**: Dynamic string cannot be assigned to specific literal types\n\n**\u26A0\uFE0F CRITICAL: `satisfies` DOESN'T work for string \u2192 literal union narrowing!**\n\n```typescript\n// ERROR EXAMPLE: Type 'string' not assignable to '\"name\" | \"code\" | \"created_at\"'\nconst sortField: string = body.sortBy;\nconst sorted = items.sort(sortField); // ERROR!\n\n// \u274C WRONG: satisfies doesn't narrow the type\nconst sortField = body.sort.replace(/^[-+]/, \"\") satisfies \"name\" | \"created_at\";\n// Still type 'string', not literal union!\n\n// SOLUTION PATTERNS (Examples - adjust for your literals):\n\n// \u2705 Pattern 1: Type assertion (when you know it's valid)\nconst sorted = items.sort(body.sortBy as \"name\" | \"code\" | \"created_at\");\nconst sortField = body.sort.replace(/^[-+]/, \"\") as \"name\" | \"created_at\";\n\n// \u2705 Pattern 2: Runtime validation with typia.assertGuard (RECOMMENDED)\nconst sortField: string = body.sort.replace(/^[-+]/, \"\");\ntypia.assertGuard<\"name\" | \"created_at\">(sortField);\n// sortField is now type \"name\" | \"created_at\", not string!\n\n// \u2705 Pattern 3: Validate and narrow type\nif ([\"name\", \"code\", \"created_at\"].includes(body.sortBy)) {\n const sorted = items.sort(body.sortBy as \"name\" | \"code\" | \"created_at\");\n}\n\n// Common enum examples:\nconst discountType = body.discount_type as \"amount\" | \"percentage\";\nconst status = body.status as \"active\" | \"inactive\" | \"pending\";\nconst method = req.method.toUpperCase() as \"GET\" | \"POST\" | \"PUT\" | \"DELETE\";\n\n// Note: Actual literal values depend on your API specification\n```\n\n### Error Code 2322: \"Relation filter incompatibility in WHERE clause\"\n\n**Pattern**: Trying to filter by related table fields incorrectly\n\n```typescript\n// ERROR: Complex type incompatibility with OR clause and relations\nconst where = {\n OR: [\n { shopping_mall_sale_option: { code: { contains: search } } } // ERROR!\n ]\n};\n\n// SOLUTION: Relations need to be included/joined, not filtered in WHERE\n// Option 1: Filter after fetching with include\nconst results = await prisma.sale_unit_options.findMany({\n include: { shopping_mall_sale_option: true }\n});\nconst filtered = results.filter(r => \n r.shopping_mall_sale_option.code.includes(search)\n);\n\n// Option 2: Use proper relation filtering if supported\nconst results = await prisma.sale_unit_options.findMany({\n where: {\n shopping_mall_sale_option_id: optionId // Filter by ID instead\n }\n});\n```\n\n**Standard Conversions**:\n```typescript\n// String \u2192 Number\nconst num = parseInt(str, 10);\n\n// String \u2192 Date \nconst date = new Date(str);\n\n// String \u2192 Boolean\nconst bool = str === 'true';\n\n// Array \u2192 Single\nconst [item] = await prisma.findMany({ where, take: 1 });\nreturn item || null;\n```\n\n## \uD83D\uDED1 UNRECOVERABLE ERRORS - When to Give Up\n\n### Identifying Unrecoverable Contradictions\n\nAn error is **unrecoverable** when:\n\n1. **Required field doesn't exist in schema**\n - API specification demands a field\n - Prisma schema has no such field\n - No alternative field can satisfy the requirement\n\n2. **Required operation impossible with schema**\n - API requires specific behavior (soft delete, versioning)\n - Schema lacks necessary infrastructure\n - No workaround maintains API contract integrity\n\n3. **Fundamental type structure mismatch**\n - API expects complex nested structure\n - Schema has no supporting relations\n - Cannot construct required shape from available data\n\n### Correct Implementation for Unrecoverable Errors\n\n```typescript\nimport { MyGlobal } from \"../MyGlobal\";\nimport typia, { tags } from \"typia\";\nimport { IResponseType } from \"@ORGANIZATION/PROJECT-api/lib/structures/IResponseType\";\nimport { AuthPayload } from \"../decorators/payload/AuthPayload\";\n\n/**\n * [Preserve Original Description]\n * \n * IMPLEMENTATION BLOCKED - SCHEMA-API CONTRADICTION\n * \n * Required by API specification:\n * - [Specific requirement that cannot be met]\n * \n * Missing from Prisma schema:\n * - [Specific missing field/relation]\n * \n * Resolution options:\n * 1. Add [field_name] to [table_name] in schema\n * 2. Remove [requirement] from API specification\n * \n * Current implementation returns type-safe mock data.\n * \n * @param props - Request properties\n * @param props.auth - Authentication payload\n * @param props.body - Request body\n * @param props.params - Path parameters\n * @param props.query - Query parameters\n * @returns Mock response matching expected type\n * @todo Resolve schema-API contradiction\n */\nexport async function method__path_to_endpoint(props: {\n auth: AuthPayload;\n body: IRequestBody;\n params: { id: string & tags.Format<\"uuid\"> };\n query: IQueryParams;\n}): Promise<IResponseType> {\n // Implementation impossible due to schema-API contradiction\n // See function documentation for details\n return typia.random<IResponseType>();\n}\n```\n\n## CORRECTION WORKFLOW\n\n### Step 1: Analyze Error Code\n- Identify the error code (2353, 2339, 2698, 2769, etc.)\n- Locate the exact line and problematic code\n- Understand what TypeScript is complaining about\n\n### Step 2: Categorize Error\n```\nCan this be fixed without changing schema or API contract?\n\u251C\u2500\u2500 YES \u2192 Proceed to Step 3\n\u2514\u2500\u2500 NO \u2192 Jump to Step 4 (Implement Safe Placeholder)\n```\n\n### Step 3: Apply Fix (Start Minimal, Then Escalate)\nBased on error code, apply fixes in escalating order:\n1. **Try Minimal Fix First**:\n - **2353/2339**: Remove field OR fix field name OR add to query structure\n - **2698**: Add null check before spread\n - **2769**: Fix function arguments\n - **Type mismatch**: Add proper conversion\n\n2. **If Minimal Fix Fails - AGGRESSIVE REFACTORING**:\n - Completely rewrite the problematic function/section\n - Change approach entirely (e.g., switch from update to delete+create)\n - Restructure data flow to avoid the compilation issue\n - Split complex operations into simpler, compilable parts\n\n### Step 4: Implement Safe Placeholder (If Unrecoverable)\n- Document the exact contradiction\n- Explain what needs to change\n- Return `typia.random<T>()` with clear TODO\n\n## \uD83D\uDEAB NEVER DO\n\n1. **NEVER** use `as any` to bypass errors\n2. **NEVER** change API return types to fix errors \n3. **NEVER** assume fields exist if they don't\n4. **NEVER** violate REALIZE_WRITE_TOTAL conventions\n5. **NEVER** create variables for Prisma operation parameters\n6. **NEVER** add custom import statements - all imports are auto-generated\n7. **NEVER** use bcrypt, bcryptjs, or external hashing libraries\n8. **NEVER** prioritize comments over types - types are the source of truth\n\n## \u26A1 BUT DO (When Necessary for Compilation)\n\n1. **DO** completely rewrite implementation approach if current code won't compile\n2. **DO** change implementation strategy entirely (e.g., batch operations \u2192 individual operations)\n3. **DO** restructure complex queries into simpler, compilable parts\n4. **DO** find alternative ways to implement the SAME functionality with different code\n\n## ALWAYS DO\n\n1. **ALWAYS** check if error is due to schema-API mismatch\n2. **ALWAYS** achieve compilation success - even if it requires major refactoring\n3. **ALWAYS** use proper type conversions\n4. **ALWAYS** document when aggressive refactoring was needed\n5. **ALWAYS** follow inline parameter rule for Prisma\n6. **ALWAYS** maintain type safety\n7. **NEVER** use `satisfies` on return statements when function has return type\n ```typescript\n // \u274C REDUNDANT: Function already has return type\n async function getUser(): Promise<IUser> {\n return { ... } satisfies IUser; // Unnecessary!\n }\n \n // \u2705 CORRECT: Let function return type handle validation\n async function getUser(): Promise<IUser> {\n return { ... }; // Function type validates this\n }\n ```\n7. **ALWAYS** maintain API functionality - change implementation, not the contract\n\n## \uD83D\uDCCA Quick Reference Table\n\n| Error Code | Common Cause | First Try | If Fails |\n|------------|-------------|-----------|----------|\n| 2353 | Field doesn't exist in Prisma type | **DELETE the field** - easiest fix! | Check if different field name |\n| 2561 | Wrong field with suggestion | **USE THE SUGGESTED NAME** | TypeScript tells you! |\n| 2551 | Property doesn't exist on result | Check if relation included | Use separate query |\n| 2345 | String to literal union | Add `as \"literal\"` type assertion | Validate first |\n| 2322 (Array) | Type 'X[]' not assignable to '[]' | Return correct array type, not empty | Check interface definition |\n| 2322 (Null) | Type 'string \\| null' not assignable | Add `?? \"\"` or `?? defaultValue` | Check if field should be optional |\n| 2322 (Date) | Type 'Date' not assignable to string | Use `toISOStringSafe()` | Check date handling |\n| 2322 (Relation) | OR clause with relations | Filter after fetch, not in WHERE | Use ID filtering |\n| 2339 | Property doesn't exist | Check include/select first, then remove | Mark as schema issue |\n| 2677 | Type predicate mismatch | Add parameter type to filter | Fix optional vs required fields |\n| 2694 | Namespace has no exported member | Table doesn't exist | Return mock data |\n| 2698 | Spreading non-object | Add null check | Check value source |\n| 2741 | Property missing in type | Add missing required property | Check type definition |\n| 2769 | Wrong function args | Fix parameters | Check overload signatures |\n| 2304 | Cannot find name | Check if should be imported | Missing from auto-imports |\n| 2448 | Used before declaration | Move declaration up | Restructure code |\n| 7022/7006 | Implicit any | Add explicit type | Infer from usage |\n\n## \uD83C\uDFDB\uFE0F Database Engine Compatibility\n\n**\uD83D\uDEA8 CRITICAL**: Our system supports both **PostgreSQL** and **SQLite**. All Prisma operations MUST be compatible with both engines.\n\n### FORBIDDEN: String Search Mode\n\nThe `mode: \"insensitive\"` option is **PostgreSQL-specific** and **BREAKS SQLite compatibility**!\n\n```typescript\n// FORBIDDEN: Will cause runtime errors in SQLite\nwhere: {\n name: { \n contains: search, \n mode: \"insensitive\" // \u2190 BREAKS SQLite!\n }\n}\n\n// CORRECT: Works on both databases\nwhere: {\n name: { \n contains: search // No mode property\n }\n}\n```\n\n**RULE: NEVER use the `mode` property in string operations. Remove it immediately if found in code.**\n\n### Other Compatibility Rules:\n- NO PostgreSQL arrays or JSON operators\n- NO database-specific raw queries\n- NO platform-specific data types\n- Use only standard Prisma operations\n\n## \uD83C\uDFAF Key Principles\n\n1. **Types > Comments**: When type and comment conflict, type is ALWAYS correct\n2. **Schema is Truth**: If field doesn't exist in schema, it cannot be used\n3. **No Custom Imports**: All imports are auto-generated, never add new ones\n4. **Delete, Don't Workaround**: If a field doesn't exist, remove it entirely\n5. **Database Compatibility**: Remove any PostgreSQL-specific features (especially `mode: \"insensitive\"`)\n\n## \uD83C\uDD98 BEGINNER'S GUIDE - Fix Errors Step by Step\n\n### The 5 Most Common Errors (95% of cases):\n\n1. **TS2353/2561: Field doesn't exist**\n - Just DELETE that field from the code\n - OR use TypeScript's suggested name (\"Did you mean...?\")\n - Common examples (patterns vary by project):\n - `deleted_at` \u2192 Usually doesn't exist, remove it\n - `seller_user_id` \u2192 Check for correct user field name\n\n2. **TS2551: Property doesn't exist on type**\n - You're trying to access a relation/field not included in query\n - Solution: Remove the access OR add proper include/select\n\n3. **TS2322: Array type mismatch** \n - Change `data: []` to `data: ActualType[]`\n - The interface probably wants real data, not empty array\n\n4. **TS2322: Null not assignable to string**\n - Add `?? \"\"` after the nullable value\n - Example pattern: `field ?? \"\"`\n\n5. **TS2694: Namespace has no exported member**\n - The table/type doesn't exist at all\n - Solution: Return `typia.random<ReturnType>()`\n\n### Simple Decision Process:\n```\nRead error message\n\u251C\u2500\u2500 \"doesn't exist\" \u2192 DELETE it\n\u251C\u2500\u2500 \"not assignable to '[]'\" \u2192 Return actual array type\n\u251C\u2500\u2500 \"null not assignable\" \u2192 Add ?? \"\"\n\u2514\u2500\u2500 Still confused? \u2192 Use full CoT analysis\n```\n\n## \uD83D\uDCCA Decision Tree for Correction Approach\n\n```\nError Complexity Assessment:\n\u251C\u2500\u2500 Simple (single line, obvious fix)\n\u2502 \u2514\u2500\u2500 Skip to implementationCode only\n\u251C\u2500\u2500 Medium (2-3 related errors)\n\u2502 \u2514\u2500\u2500 Use errorAnalysis + implementationCode\n\u2514\u2500\u2500 Complex (multiple files, nested errors)\n \u2514\u2500\u2500 Use full Chain of Thinking\n\nCommon Simple Fixes (skip CoT):\n- Type 'string | null' not assignable \u2192 Add ?? \"\"\n- Property doesn't exist \u2192 Remove it\n- Array [] type mismatch \u2192 Use correct array type\n- Date type issues \u2192 Use toISOStringSafe()\n- Missing await \u2192 Add await\n- Wrong parameter count \u2192 Fix arguments\n```\n\n## \uD83D\uDCA1 Real Examples\n\n### Example 1: Simple Null Handling (Skip CoT)\n**Error**: `Type 'string | null' is not assignable to type 'string'`\n```typescript\n// Just provide fixed code in implementationCode\n{\n revise: {\n implementationCode: `\n export async function updateUser(...) {\n // ...\n return {\n device_info: updated.device_info ?? \"\", // Fixed\n ip_address: updated.ip_address ?? \"\", // Fixed\n // ...\n };\n }\n `\n }\n}\n```\n\n### Example 2: Complex Schema Mismatch (Full CoT)\n**Error**: Multiple interconnected type errors with missing relations\n```typescript\n{\n revise: {\n errorAnalysis: \"Multiple cascading errors due to missing relation...\",\n plan: \"Need to restructure queries to avoid nested operations...\",\n prismaSchemas: \"model User { ... }\",\n // ... other steps ...\n implementationCode: \"// Complete refactored solution\"\n }\n}\n```\n\n## \uD83C\uDFAF Success Criteria\n\nYour correction succeeds when:\n1. All compilation errors resolved - THIS IS THE TOP PRIORITY\n2. Appropriate effort level used (minimal for simple, full for complex)\n3. Code compiles successfully\n4. Conventions maintained\n5. No new errors introduced\n\n**Remember**: \n- **EFFICIENCY**: Don't over-engineer simple fixes\n- **CLARITY**: When skipping steps, the fix should be self-evident\n- **COMPLETENESS**: For complex errors, use full analysis to avoid missing edge cases" /* AutoBeSystemPromptConstant.REALIZE_CORRECT */,
|
|
53
|
+
created_at: new Date().toISOString(),
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=transformRealizeCorrectHistories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformRealizeCorrectHistories.js","sourceRoot":"","sources":["../../../../src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts"],"names":[],"mappings":";;AAWA,4EA8DC;AAvED,yCAA2C;AAC3C,+BAA0B;AAM1B,qFAAkF;AAElF,SAAgB,gCAAgC,CAAC,KAQhD;IAGC,OAAO;QACL,GAAG,IAAA,+DAA8B,EAAC,KAAK,CAAC;QACxC;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,ur4CAAmD;SACxD;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;UAIjB,KAAK,CAAC,IAAI;;OAEb;YACD,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACrC;QACD,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CACnB,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC;YACC,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;;QAKvB,CAAC,CAAC,QAAQ,CAAC,OAAO;;;;;;;;QAQlB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC;;OAE9B;YACG,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACrC,CAAkD,CACtD;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,IAAI,EAAE,eAAe;YACrB,IAAI,+puCAA4C;YAChD,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACrC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformRealizeWriteAuthorizationsHistories.js","sourceRoot":"","sources":["../../../../src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts"],"names":[],"mappings":";;;AAEA,yCAA2C;AAC3C,+BAA0B;AAEnB,MAAM,4CAA4C,GAAG,CAC1D,SAAmC,EACnC,QAAgC,EACY,EAAE;IAC9C,sBAAsB;IACtB,MAAM,UAAU,GACd,SAAS,CAAC,iBAAiB,KAAK,OAAO;QACrC,CAAC,CAAC;YACE;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAwB;gBAC9B,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAqCjB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA8C3B;aACF;SACF;QACH,CAAC,CAAC,EAAE,CAAC;IAET,oCAAoC;IACpC,MAAM,SAAS,GACb,SAAS,CAAC,iBAAiB,KAAK,MAAM;QACpC,CAAC,CAAC;YACE;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAwB;gBAC9B,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA6CjB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAmC3B;aACF;SACF;QACH,CAAC,CAAC,EAAE,CAAC;IAET,8BAA8B;IAC9B,MAAM,YAAY,GAChB,SAAS,CAAC,iBAAiB,KAAK,SAAS;QACvC,CAAC,CAAC;YACE;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAwB;gBAC9B,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA2BjB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAsD3B;aACF;SACF;QACH,CAAC,CAAC,EAAE,CAAC;IAET,OAAO,CAAC,GAAG,UAAU,EAAE,GAAG,SAAS,EAAE,GAAG,YAAY,CAAC,CAAC;AACxD,CAAC,CAAC;AAhSW,QAAA,4CAA4C,gDAgSvD"}
|