@autobe/agent 0.5.2 → 0.7.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.
Files changed (119) hide show
  1. package/lib/AutoBeAgent.js +4 -4
  2. package/lib/AutoBeAgent.js.map +1 -1
  3. package/lib/constants/AutoBeSystemPromptConstant.d.ts +5 -2
  4. package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
  5. package/lib/context/AutoBeContext.d.ts +2 -2
  6. package/lib/context/IAutoBeApplicationProps.d.ts +6 -0
  7. package/lib/factory/createAgenticaHistory.js +1 -0
  8. package/lib/factory/createAgenticaHistory.js.map +1 -1
  9. package/lib/factory/createAutoBeApplication.js +17 -17
  10. package/lib/factory/createAutoBeApplication.js.map +1 -1
  11. package/lib/index.mjs +6228 -4563
  12. package/lib/index.mjs.map +1 -1
  13. package/lib/{analyze → orchestrate/analyze}/AutoBeAnalyzeAgent.d.ts +4 -8
  14. package/lib/{analyze → orchestrate/analyze}/AutoBeAnalyzeAgent.js +25 -20
  15. package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +1 -0
  16. package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.js.map +1 -0
  17. package/lib/orchestrate/analyze/AutoBeAnalyzePointer.d.ts +9 -0
  18. package/lib/orchestrate/analyze/AutoBeAnalyzePointer.js +3 -0
  19. package/lib/orchestrate/analyze/AutoBeAnalyzePointer.js.map +1 -0
  20. package/lib/{analyze → orchestrate/analyze}/AutoBeAnalyzeReviewer.d.ts +1 -1
  21. package/lib/{analyze → orchestrate/analyze}/AutoBeAnalyzeReviewer.js +8 -5
  22. package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js.map +1 -0
  23. package/lib/orchestrate/analyze/orchestrateAnalyze.d.ts +31 -0
  24. package/lib/orchestrate/{orchestrateAnalyze.js → analyze/orchestrateAnalyze.js} +200 -59
  25. package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -0
  26. package/lib/orchestrate/facade/transformFacadeStateMessage.js +1 -1
  27. package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
  28. package/lib/orchestrate/index.d.ts +3 -3
  29. package/lib/orchestrate/index.js +6 -6
  30. package/lib/orchestrate/index.js.map +1 -1
  31. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +8 -1
  32. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  33. package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +6 -1
  34. package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -1
  35. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +3 -1
  36. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  37. package/lib/orchestrate/interface/transformInterfaceHistories.js +41 -0
  38. package/lib/orchestrate/interface/transformInterfaceHistories.js.map +1 -1
  39. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +6 -5
  40. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  41. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.d.ts +1 -1
  42. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +28 -1
  43. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -1
  44. package/lib/orchestrate/prisma/transformPrismaCorrectHistories.js +9 -0
  45. package/lib/orchestrate/prisma/transformPrismaCorrectHistories.js.map +1 -1
  46. package/lib/orchestrate/prisma/transformPrismaHistories.js +9 -0
  47. package/lib/orchestrate/prisma/transformPrismaHistories.js.map +1 -1
  48. package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js +7 -0
  49. package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js.map +1 -1
  50. package/lib/orchestrate/{orchestrateTest.d.ts → test/orchestrateTest.d.ts} +2 -2
  51. package/lib/orchestrate/test/orchestrateTest.js +70 -0
  52. package/lib/orchestrate/test/orchestrateTest.js.map +1 -0
  53. package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +4 -0
  54. package/lib/orchestrate/test/orchestrateTestCorrect.js +543 -0
  55. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -0
  56. package/lib/orchestrate/test/orchestrateTestProgress.d.ts +4 -0
  57. package/lib/orchestrate/test/orchestrateTestProgress.js +403 -0
  58. package/lib/orchestrate/test/orchestrateTestProgress.js.map +1 -0
  59. package/lib/orchestrate/test/orchestrateTestScenario.d.ts +4 -0
  60. package/lib/orchestrate/test/orchestrateTestScenario.js +700 -0
  61. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -0
  62. package/lib/orchestrate/test/transformTestCorrectHistories.d.ts +2 -0
  63. package/lib/orchestrate/test/transformTestCorrectHistories.js +47 -0
  64. package/lib/orchestrate/test/transformTestCorrectHistories.js.map +1 -0
  65. package/lib/orchestrate/test/transformTestHistories.d.ts +3 -0
  66. package/lib/orchestrate/test/transformTestHistories.js +74 -0
  67. package/lib/orchestrate/test/transformTestHistories.js.map +1 -0
  68. package/lib/orchestrate/test/transformTestProgressHistories.d.ts +2 -0
  69. package/lib/orchestrate/test/transformTestProgressHistories.js +47 -0
  70. package/lib/orchestrate/test/transformTestProgressHistories.js.map +1 -0
  71. package/lib/orchestrate/test/transformTestScenarioHistories.d.ts +4 -0
  72. package/lib/orchestrate/test/transformTestScenarioHistories.js +176 -0
  73. package/lib/orchestrate/test/transformTestScenarioHistories.js.map +1 -0
  74. package/lib/structures/IAutoBeVendor.d.ts +45 -2
  75. package/package.json +6 -6
  76. package/src/AutoBeAgent.ts +5 -3
  77. package/src/constants/AutoBeSystemPromptConstant.ts +5 -2
  78. package/src/context/AutoBeContext.ts +2 -2
  79. package/src/context/IAutoBeApplicationProps.ts +6 -0
  80. package/src/factory/createAgenticaHistory.ts +1 -0
  81. package/src/factory/createAutoBeApplication.ts +2 -2
  82. package/src/{analyze → orchestrate/analyze}/AutoBeAnalyzeAgent.ts +38 -36
  83. package/src/orchestrate/analyze/AutoBeAnalyzePointer.ts +10 -0
  84. package/src/{analyze → orchestrate/analyze}/AutoBeAnalyzeReviewer.ts +9 -6
  85. package/src/orchestrate/{orchestrateAnalyze.ts → analyze/orchestrateAnalyze.ts} +91 -39
  86. package/src/orchestrate/index.ts +3 -3
  87. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +8 -1
  88. package/src/orchestrate/interface/orchestrateInterfaceComponents.ts +6 -1
  89. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +3 -1
  90. package/src/orchestrate/interface/transformInterfaceHistories.ts +40 -0
  91. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +4 -1
  92. package/src/orchestrate/prisma/transformPrismaComponentsHistories.ts +28 -0
  93. package/src/orchestrate/prisma/transformPrismaCorrectHistories.ts +9 -0
  94. package/src/orchestrate/prisma/transformPrismaHistories.ts +9 -0
  95. package/src/orchestrate/prisma/transformPrismaSchemaHistories.ts +7 -0
  96. package/src/orchestrate/test/orchestrateTest.ts +86 -0
  97. package/src/orchestrate/test/orchestrateTestCorrect.ts +368 -0
  98. package/src/orchestrate/test/orchestrateTestProgress.ts +264 -0
  99. package/src/orchestrate/test/orchestrateTestScenario.ts +178 -0
  100. package/src/orchestrate/test/transformTestCorrectHistories.ts +51 -0
  101. package/src/orchestrate/test/transformTestHistories.ts +77 -0
  102. package/src/orchestrate/test/transformTestProgressHistories.ts +51 -0
  103. package/src/orchestrate/test/transformTestScenarioHistories.ts +184 -0
  104. package/src/structures/IAutoBeVendor.ts +48 -2
  105. package/lib/analyze/AnalyzeAgent.d.ts +0 -24
  106. package/lib/analyze/AnalyzeAgent.js +0 -942
  107. package/lib/analyze/AnalyzeAgent.js.map +0 -1
  108. package/lib/analyze/AutoBeAnalyzeAgent.js.map +0 -1
  109. package/lib/analyze/AutoBeAnalyzeFileSystem.js.map +0 -1
  110. package/lib/analyze/AutoBeAnalyzeReviewer.js.map +0 -1
  111. package/lib/orchestrate/orchestrateAnalyze.d.ts +0 -6
  112. package/lib/orchestrate/orchestrateAnalyze.js.map +0 -1
  113. package/lib/orchestrate/orchestrateTest.js +0 -19
  114. package/lib/orchestrate/orchestrateTest.js.map +0 -1
  115. package/src/analyze/AnalyzeAgent.ts +0 -183
  116. package/src/orchestrate/orchestrateTest.ts +0 -18
  117. /package/lib/{analyze → orchestrate/analyze}/AutoBeAnalyzeFileSystem.d.ts +0 -0
  118. /package/lib/{analyze → orchestrate/analyze}/AutoBeAnalyzeFileSystem.js +0 -0
  119. /package/src/{analyze → orchestrate/analyze}/AutoBeAnalyzeFileSystem.ts +0 -0
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.realize = exports.test = exports.prisma = exports.interface = exports.analyze = void 0;
4
- var orchestrateAnalyze_1 = require("./orchestrateAnalyze");
3
+ exports.prisma = exports.test = exports.realize = exports.interface = exports.analyze = void 0;
4
+ var orchestrateAnalyze_1 = require("./analyze/orchestrateAnalyze");
5
5
  Object.defineProperty(exports, "analyze", { enumerable: true, get: function () { return orchestrateAnalyze_1.orchestrateAnalyze; } });
6
6
  var orchestrateInterface_1 = require("./interface/orchestrateInterface");
7
7
  Object.defineProperty(exports, "interface", { enumerable: true, get: function () { return orchestrateInterface_1.orchestrateInterface; } });
8
- var orchestratePrisma_1 = require("./prisma/orchestratePrisma");
9
- Object.defineProperty(exports, "prisma", { enumerable: true, get: function () { return orchestratePrisma_1.orchestratePrisma; } });
10
- var orchestrateTest_1 = require("./orchestrateTest");
11
- Object.defineProperty(exports, "test", { enumerable: true, get: function () { return orchestrateTest_1.orchestrateTest; } });
12
8
  var orchestrateRealize_1 = require("./orchestrateRealize");
13
9
  Object.defineProperty(exports, "realize", { enumerable: true, get: function () { return orchestrateRealize_1.orchestrateRealize; } });
10
+ var orchestrateTest_1 = require("./test/orchestrateTest");
11
+ Object.defineProperty(exports, "test", { enumerable: true, get: function () { return orchestrateTest_1.orchestrateTest; } });
12
+ var orchestratePrisma_1 = require("./prisma/orchestratePrisma");
13
+ Object.defineProperty(exports, "prisma", { enumerable: true, get: function () { return orchestratePrisma_1.orchestratePrisma; } });
14
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/orchestrate/index.ts"],"names":[],"mappings":";;;AAAA,2DAAqE;AAA5D,6GAAA,kBAAkB,OAAW;AACtC,yEAAqF;AAA5E,iHAAA,oBAAoB,OAAa;AAC1C,gEAAyE;AAAhE,2GAAA,iBAAiB,OAAU;AACpC,qDAA4D;AAAnD,uGAAA,eAAe,OAAQ;AAChC,2DAAqE;AAA5D,6GAAA,kBAAkB,OAAW"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/orchestrate/index.ts"],"names":[],"mappings":";;;AAAA,mEAA6E;AAApE,6GAAA,kBAAkB,OAAW;AACtC,yEAAqF;AAA5E,iHAAA,oBAAoB,OAAa;AAC1C,2DAAqE;AAA5D,6GAAA,kBAAkB,OAAW;AACtC,0DAAiE;AAAxD,uGAAA,eAAe,OAAQ;AAChC,gEAAyE;AAAhE,2GAAA,iBAAiB,OAAU"}
@@ -52,6 +52,7 @@ const core_1 = require("@agentica/core");
52
52
  const openapi_1 = require("@samchon/openapi");
53
53
  const OpenApiV3_1Emender_1 = require("@samchon/openapi/lib/converters/OpenApiV3_1Emender");
54
54
  const typia_1 = __importDefault(require("typia"));
55
+ const uuid_1 = require("uuid");
55
56
  const assertSchemaModel_1 = require("../../context/assertSchemaModel");
56
57
  const transformInterfaceHistories_1 = require("./transformInterfaceHistories");
57
58
  function orchestrateInterfaceComplement(ctx, document, retry = 8) {
@@ -75,6 +76,8 @@ function step(ctx, document, retry) {
75
76
  histories: [
76
77
  ...(0, transformInterfaceHistories_1.transformInterfaceHistories)(ctx.state(), "# OpenAPI Schema Complement Agent\n\nYou are an AI agent specialized in complementing missing schema definitions in OpenAPI documents. Your primary responsibility is to identify and fill in schema types that are referenced via `$ref` but not yet defined in the `components.schemas` section.\n\n## Your Role\n\nYou analyze OpenAPI documents to find missing schema definitions and generate complete, accurate JSON Schema definitions for those missing types. You work as part of a larger OpenAPI document generation workflow, specifically handling the final step of ensuring all referenced schemas are properly defined.\n\n## Key Responsibilities\n\n1. **Identify Missing Schemas**: Scan the OpenAPI document for `$ref` references pointing to `#/components/schemas/[ISchemaName]` that don't have corresponding definitions\n2. **Generate Schema Definitions**: Create complete JSON Schema definitions for missing types based on context clues from API operations, database schemas, and usage patterns\n3. **Handle Nested References**: When creating new schemas, identify any new `$ref` references introduced in those schemas and ensure they are also defined\n4. **Iterative Completion**: Continue the process recursively until all referenced schemas (including nested ones) are properly defined\n5. **Ensure Completeness**: Make sure all generated schemas follow JSON Schema specifications and are consistent with OpenAPI 3.0+ standards\n\n## Function Calling\n\nYou have access to the `complementComponents` function which you should call when you identify missing schemas:\n\n```typescript\ncomplementComponents({\n schemas: {\n ISchemaName: {\n // Complete JSON Schema definition\n description: \"Description must be clear and detailed\"\n }\n }\n})\n```\n\n## Guidelines for Schema Generation\n\n1. **Type Inference**: Infer appropriate types based on context (API operations, database fields, naming conventions)\n2. **Property Requirements**: Determine which properties should be required vs optional based on usage patterns\n3. **Data Formats**: Apply appropriate formats (email, date-time, uri, etc.) when evident from context\n4. **Nested References**: Handle schemas that reference other schemas appropriately\n5. **Validation Rules**: Include reasonable validation constraints (minLength, maxLength, pattern, etc.) when applicable\n6. **Recursive Schema Detection**: When creating new schemas, scan them for additional `$ref` references and ensure those referenced schemas are also created\n7. **Dependency Chain Completion**: Continue generating schemas until no more missing references exist in the entire schema dependency chain\n8. **Comprehensive Descriptions**: Add detailed, clear descriptions to every schema and property that explain:\n - What the schema/property represents\n - Its purpose and usage context\n - Any business logic or constraints\n - Examples of valid values when helpful\n - Relationships to other entities or concepts\n\n## Response Format\n\n- Analyze the provided OpenAPI document systematically\n- Identify all missing schema references (including those in newly created schemas)\n- Generate appropriate schema definitions for all missing references\n- Recursively check for new `$ref` references introduced in generated schemas\n- Call the `complementComponents` function with all missing schemas (may require multiple calls if nested dependencies are discovered)\n- Provide a brief summary of what schemas were added and any dependency chains that were resolved\n\n## Quality Standards\n\n- Ensure all generated schemas are valid JSON Schema\n- Maintain consistency with existing schema patterns in the document\n- Use descriptive and clear property names\n- **Add comprehensive descriptions**: Every schema object and property must include detailed descriptions that are:\n - Clear and understandable to anyone reading the API documentation\n - Specific about the purpose and usage of each field\n - Include examples or context when helpful\n - Explain any business rules or constraints\n - Describe relationships between different entities\n- Follow OpenAPI best practices for schema design\n- Make the API documentation self-explanatory through excellent descriptions\n\nFocus on accuracy, completeness, and maintaining the integrity of the OpenAPI specification." /* AutoBeSystemPromptConstant.INTERFACE_COMPLEMENT */),
77
78
  {
79
+ id: (0, uuid_1.v4)(),
80
+ created_at: new Date().toISOString(),
78
81
  type: "assistantMessage",
79
82
  text: [
80
83
  "Here is the OpenAPI document what you've made:",
@@ -85,6 +88,8 @@ function step(ctx, document, retry) {
85
88
  ].join("\n"),
86
89
  },
87
90
  {
91
+ id: (0, uuid_1.v4)(),
92
+ created_at: new Date().toISOString(),
88
93
  type: "assistantMessage",
89
94
  text: [
90
95
  "You have missed below schema types in the document.components.schemas:",
@@ -107,7 +112,9 @@ function step(ctx, document, retry) {
107
112
  ],
108
113
  });
109
114
  agentica.on("request", (event) => __awaiter(this, void 0, void 0, function* () {
110
- event.body.tool_choice = "required";
115
+ if (event.body.tools) {
116
+ event.body.tool_choice = "required";
117
+ }
111
118
  }));
112
119
  yield agentica.conversate("Fill missing schema types please");
113
120
  if (pointer.value === null) {
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrateInterfaceComplement.js","sourceRoot":"","sources":["../../../src/orchestrate/interface/orchestrateInterfaceComplement.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,wEAMC;;;AAtBD,yCAAoE;AAEpE,8CAI0B;AAC1B,2FAAwF;AAExF,kDAA0B;AAI1B,uEAAoE;AACpE,+EAA4E;AAE5E,SAAgB,8BAA8B,CAC5C,GAAyB,EACzB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AE;gBAC7B,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC5B,CAAC;SACqB;KACzB,CAAC;AACJ,CAAC;AAED,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIT,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
1
+ {"version":3,"file":"orchestrateInterfaceComplement.js","sourceRoot":"","sources":["../../../src/orchestrate/interface/orchestrateInterfaceComplement.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,wEAMC;;;AAvBD,yCAAoE;AAEpE,8CAI0B;AAC1B,2FAAwF;AAExF,kDAA0B;AAC1B,+BAA0B;AAI1B,uEAAoE;AACpE,+EAA4E;AAE5E,SAAgB,8BAA8B,CAC5C,GAAyB,EACzB,QAAiC,EACjC,QAAgB,CAAC;IAEjB,OAAO,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AACpC,CAAC;AAED,SAAe,IAAI,CACjB,GAAyB,EACzB,QAAiC,EACjC,KAAa;;;QAEb,MAAM,MAAM,GAAa,SAAS,CAAC,QAAQ,CAAC,CAAC;QAC7C,IAAI,MAAM,CAAC,M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AAE;gBAC7B,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC5B,CAAC;SACqB;KACzB,CAAC;AACJ,CAAC;AAED,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIT,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
@@ -51,6 +51,7 @@ const __typia_transform__validateReport = __importStar(require("typia/lib/intern
51
51
  const core_1 = require("@agentica/core");
52
52
  const OpenApiV3_1Emender_1 = require("@samchon/openapi/lib/converters/OpenApiV3_1Emender");
53
53
  const typia_1 = __importDefault(require("typia"));
54
+ const uuid_1 = require("uuid");
54
55
  const assertSchemaModel_1 = require("../../context/assertSchemaModel");
55
56
  const divideArray_1 = require("../../utils/divideArray");
56
57
  const transformInterfaceHistories_1 = require("./transformInterfaceHistories");
@@ -129,6 +130,8 @@ function process(ctx, operations, oldbie, remained) {
129
130
  histories: [
130
131
  ...(0, transformInterfaceHistories_1.transformInterfaceHistories)(ctx.state(), "# AutoAPI Schema Agent System Prompt\n\nYou are AutoAPI Schema Agent, an expert in creating comprehensive schema components for OpenAPI specifications in the `AutoBeOpenApi.IDocument` format. Your specialized role focuses on the third phase of a multi-agent orchestration process for large-scale API design.\n\nYour mission is to analyze the provided API operations, paths, methods, Prisma schema files, and ERD diagrams to construct a complete and consistent set of component schemas that accurately represent all entities and their relationships in the system.\n\n## 1. Context and Your Role in the Multi-Agent Process\n\nYou are the third agent in a three-phase process:\n1. **Phase 1** (completed): Analysis of requirements, Prisma schema, and ERD to define API paths and methods\n2. **Phase 2** (completed): Creation of detailed API operations based on the defined paths and methods\n3. **Phase 3** (your role): Construction of comprehensive component schemas for all entities\n\nYou will receive:\n- The complete list of API operations from Phase 2\n- The original Prisma schema with detailed comments\n- ERD diagrams in Mermaid format\n- Requirement analysis documents\n\n## 2. Primary Responsibilities\n\nYour specific tasks are:\n\n1. **Extract All Entity Types**: Analyze all API operations and identify every distinct entity type referenced\n2. **Define Complete Schema Components**: Create detailed schema definitions for every entity and its variants\n3. **Maintain Type Naming Conventions**: Follow the established type naming patterns\n4. **Ensure Schema Completeness**: Verify that ALL entities in the Prisma schema have corresponding component schemas\n5. **Create Type Variants**: Define all necessary type variants for each entity (.ICreate, .IUpdate, .ISummary, etc.)\n6. **Document Thoroughly**: Provide comprehensive descriptions for all schema components\n7. **Validate Consistency**: Ensure schema definitions align with API operations\n8. **Use Named References Only**: NEVER use inline/anonymous object definitions - ALL object types must be defined as named types in the components.schemas section and referenced using $ref\n\n## 3. Schema Design Principles\n\n### 3.1. Type Naming Conventions\n\n- **Main Entity Types**: Use `IEntityName` format\n- **Operation-Specific Types**:\n - `IEntityName.ICreate`: Request body for creation operations (POST)\n - `IEntityName.IUpdate`: Request body for update operations (PUT or PATCH)\n - `IEntityName.ISummary`: Simplified response version with essential properties\n - `IEntityName.IRequest`: Request parameters for list operations (search/filter/pagination)\n - `IEntityName.IAbridge`: Intermediate view with more detail than Summary but less than full entity\n - `IEntityName.IInvert`: Alternative representation of an entity from a different perspective\n- **Container Types**: \n - `IPageIEntityName`: Paginated results container (use the standard IPage structure)\n\n### 3.2. Schema Definition Requirements\n\n- **Completeness**: Include ALL properties from the Prisma schema for each entity\n- **Type Accuracy**: Map Prisma types to appropriate OpenAPI types and formats\n- **Required Fields**: Accurately mark required fields based on Prisma schema constraints\n- **Relationships**: Properly handle entity relationships (references to other entities)\n- **Enumerations**: Define all enum types referenced in entity schemas\n- **Detailed Documentation**: \n - Schema descriptions must reference related Prisma schema table comments\n - Property descriptions must reference related Prisma schema column comments\n - All descriptions must be organized in multiple paragraphs for better readability\n- **Named References Only**: \n - Every object type MUST be defined as a named type in the components.schemas section\n - NEVER use inline/anonymous object definitions anywhere in the schema\n - All property types that are objects must use $ref to reference a named type\n - This applies to EVERY object in the schema, including nested objects and arrays of objects\n\n### 3.3. Standard Type Definitions\n\nFor paginated results, use the standard `IPage<T>` interface:\n\n```typescript\n/**\n * A page.\n *\n * Collection of records with pagination indformation.\n *\n * @author Samchon\n */\nexport interface IPage<T extends object> {\n /**\n * Page information.\n */\n pagination: IPage.IPagination;\n\n /**\n * List of records.\n */\n data: T[];\n}\nexport namespace IPage {\n /**\n * Page information.\n */\n export interface IPagination {\n /**\n * Current page number.\n */\n current: number & tags.Type<\"uint32\">;\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit: number & tags.Type<\"uint32\">;\n\n /**\n * Total records in the database.\n */\n records: number & tags.Type<\"uint32\">;\n\n /**\n * Total pages.\n *\n * Equal to {@link records} / {@link limit} with ceiling.\n */\n pages: number & tags.Type<\"uint32\">;\n }\n\n /**\n * Page request data\n */\n export interface IRequest {\n /**\n * Page number.\n */\n page?: null | (number & tags.Type<\"uint32\">);\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit?: null | (number & tags.Type<\"uint32\">);\n }\n}\n```\n\n## 4. Implementation Strategy\n\n### 4.1. Comprehensive Entity Identification\n\n1. **Extract All Entity References**:\n - Analyze all API operation paths for entity identifiers\n - Examine request and response bodies in API operations\n - Review the Prisma schema to identify ALL entities\n\n2. **Create Entity Tracking System**:\n - List ALL entities from the Prisma schema\n - Cross-reference with entities mentioned in API operations\n - Identify any entities that might be missing schema definitions\n\n### 4.2. Schema Definition Process\n\n1. **For Each Entity**:\n - Define the main entity schema (`IEntityName`)\n - Create all necessary variant types based on API operations\n - Ensure all properties are documented with descriptions from Prisma schema\n - Mark required fields based on Prisma schema constraints\n\n2. **For Relationship Handling**:\n - Identify all relationships from the ERD and Prisma schema\n - Define appropriate property types for relationships (IDs, nested objects, arrays)\n - Document relationship constraints and cardinality\n\n3. **For Variant Types**:\n - Create `.ICreate` types with appropriate required/optional fields for creation\n - Define `.IUpdate` types with all fields made optional for updates\n - Build `.ISummary` types with essential fields for list views\n - Define `.IRequest` types with search/filter/sort parameters\n\n### 4.3. Schema Completeness Verification\n\n1. **Entity Coverage Check**:\n - Verify every entity in the Prisma schema has at least one schema definition\n - Check that all entities referenced in API operations have schema definitions\n\n2. **Property Coverage Check**:\n - Ensure all properties from the Prisma schema are included in entity schemas\n - Verify property types align with Prisma schema definitions\n\n3. **Variant Type Verification**:\n - Confirm necessary variant types exist based on API operations\n - Ensure variant types have appropriate property subsets and constraints\n\n## 5. Documentation Quality Requirements\n\n### 5.1. **Schema Type Descriptions**\n- Must reference related Prisma schema table description comments\n- Must be extremely detailed and comprehensive\n- Must be organized in multiple paragraphs\n- Should explain the entity's role in the business domain\n- Should describe relationships with other entities\n\n### 5.2. **Property Descriptions**\n- Must reference related Prisma schema column description comments\n- Must explain the purpose, constraints, and format of each property\n- Should note business rules that apply to the property\n- Should provide examples when helpful\n- Should use multiple paragraphs for complex properties\n\n## 6. Output Format\n\nYour output should be the complete `components` section of the OpenAPI document:\n\n```typescript\nconst components: OpenApi.IComponents = {\n schemas: {\n // Main entity types\n IEntityName: { \n type: \"object\", \n properties: {\n propertyName: {\n type: \"string\",\n description: \"Detailed property description referencing Prisma schema column comments.\\n\\nMultiple paragraphs where appropriate.\"\n }\n // ...more properties\n },\n required: [...],\n description: \"Extremely detailed explanation about IEntityName referencing Prisma schema table comments.\\n\\nMultiple paragraphs focusing on different aspects of the entity.\",\n },\n // Variant types\n \"IEntityName.ICreate\": { ... },\n \"IEntityName.IUpdate\": { ... },\n \"IEntityName.ISummary\": { ... },\n \"IEntityName.IRequest\": { ... },\n \n // Repeat for ALL entities\n \n // Standard types\n \"IPage\": { ... },\n \"IPage.IPagination\": { ... },\n \"IPage.IRequest\": { ... },\n \n // Enumerations\n \"EEnumName\": { ... }\n }\n}\n```\n\n## 7. Critical Success Factors\n\n### 7.1. Absolute Completeness Principles\n\n- **Process ALL Entities**: EVERY entity defined in the Prisma schema MUST have corresponding schema components.\n- **Complete Property Coverage**: ALL properties of each entity MUST be included in schema definitions.\n- **Variant Type Comprehensiveness**: ALL necessary variant types MUST be defined based on API operations.\n- **No Simplification**: Complex entities or relationships MUST be faithfully represented without simplification.\n- **Verification of Completeness**: Before final output, verify that ALL entities and properties have been defined.\n\n### 7.2. High-Volume Processing Strategy\n\n- **Batch Processing**: If there are many entities, process them in groups, but ALL groups MUST be completed.\n- **No Prioritization**: ALL entities and their properties have equal importance and must be processed.\n- **Systematic Approach**: Use a methodical approach to ensure no entity or property is overlooked.\n- **Detailed Tracking**: Maintain a tracking system to verify completeness of schema definitions.\n\n### 7.3. Critical Warnings\n\n- **Partial Implementation Prohibited**: \"Defining schemas for only some entities and omitting others\" is a CRITICAL ERROR.\n- **Property Omission Prohibited**: \"Including only some properties of an entity\" is a SERIOUS ERROR.\n- **No Simplification**: \"Simplifying complex entities or relationships\" is NOT ACCEPTABLE.\n- **Ignore Capacity Limitations**: Processing only some entities due to their quantity is a SERIOUS ERROR.\n- **Named Types Required**: Using inline/anonymous object definitions instead of named type references ($ref) is a CRITICAL ERROR. EVERY object type must be defined in the components.schemas section and referenced by name.\n\n## 8. Execution Process\n\n1. **Initialization**:\n - Analyze all input data (API operations, Prisma schema, ERD)\n - Create a complete inventory of entities and their relationships\n\n2. **Schema Development**:\n - Systematically define schema components for each entity and its variants\n - Document all components and properties thoroughly\n\n3. **Verification**:\n - Validate completeness against the Prisma schema\n - Verify consistency with API operations\n - Ensure all relationships are properly handled\n\n4. **Output Generation**:\n - Produce the complete `components` section in the required format\n - Verify the output meets all quality and completeness requirements\n\nRemember that your role is CRITICAL to the success of the entire API design process. The schemas you define will be the foundation for ALL data exchange in the API. Thoroughness, accuracy, and completeness are your highest priorities.\n\n## 9. Integration with Previous Phases\n\n- Ensure your schema components align perfectly with the API operations defined in Phase 2\n- Reference the same entities and property names used in the API paths from Phase 1\n- Maintain consistency in naming, typing, and structure throughout the entire API design\n\n## 10. Final Output Format\n\nYour final output should be the complete `components` section that can be directly integrated with the API operations from Phase 2 to form a complete `AutoBeOpenApi.IDocument` object.\n\nAlways aim to create schema components that are intuitive, well-documented, and accurately represent the business domain. Your schema definitions should meet ALL business requirements while being extensible and maintainable. Remember to define components for EVERY SINGLE independent entity table in the Prisma schema. NO ENTITY OR PROPERTY SHOULD BE OMITTED FOR ANY REASON." /* AutoBeSystemPromptConstant.INTERFACE_SCHEMA */),
131
132
  {
133
+ id: (0, uuid_1.v4)(),
134
+ created_at: new Date().toISOString(),
132
135
  type: "assistantMessage",
133
136
  text: [
134
137
  "Here is the OpenAPI operations generated by phase 2.",
@@ -151,7 +154,9 @@ function process(ctx, operations, oldbie, remained) {
151
154
  ],
152
155
  });
153
156
  agentica.on("request", (event) => __awaiter(this, void 0, void 0, function* () {
154
- event.body.tool_choice = "required";
157
+ if (event.body.tools) {
158
+ event.body.tool_choice = "required";
159
+ }
155
160
  }));
156
161
  const already = Object.keys(oldbie.schemas);
157
162
  yield agentica.conversate([
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrateInterfaceComponents.js","sourceRoot":"","sources":["../../../src/orchestrate/interface/orchestrateInterfaceComponents.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,wEA+CC;;;AA5DD,yCAAoE;AAGpE,2FAAwF;AAExF,kDAA0B;AAI1B,uEAAoE;AACpE,yDAAsD;AACtD,+EAA4E;AAE5E,SAAsB,8BAA8B;yDAGlD,GAAyB,EACzB,UAAsC,EACtC,WA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
1
+ {"version":3,"file":"orchestrateInterfaceComponents.js","sourceRoot":"","sources":["../../../src/orchestrate/interface/orchestrateInterfaceComponents.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,wEA+CC;;;AA7DD,yCAAoE;AAGpE,2FAAwF;AAExF,kDAA0B;AAC1B,+BAA0B;AAI1B,uEAAoE;AACpE,yDAAsD;AACtD,+EAA4E;AAE5E,SAAsB,8BAA8B;yDAGlD,GAAyB,EACzB,UAAsC,EACtC,WAAmB,EAAE;QAErB,MAAM,SAAS,GAAgB,IAAI,GAAG,EAAE,CAAC;QACzC,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;YAC5B,IAAI,EAAE,CAAC,WAAW,KAAK,IAAI;gBAAE,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YACpE,IAAI,EAAE,CAAC,YAAY,KAAK,IAAI;gBAAE,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QACxE,CAAC;QACD,MAAM,MAAM,GAAe,IAAA,yBAAW,EAAC;YACrC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;YAC5B,QAAQ;SACT,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
@@ -123,7 +123,9 @@ function process(ctx, endpoints) {
123
123
  ],
124
124
  });
125
125
  agentica.on("request", (event) => __awaiter(this, void 0, void 0, function* () {
126
- event.body.tool_choice = "required";
126
+ if (event.body.tools) {
127
+ event.body.tool_choice = "required";
128
+ }
127
129
  }));
128
130
  yield agentica.conversate([
129
131
  "Make API operations for below endpoints:",
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrateInterfaceOperations.js","sourceRoot":"","sources":["../../../src/orchestrate/interface/orchestrateInterfaceOperations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,wEAkCC;;AA/CD,yCAAoE;AAGpE,+BAAkD;AAClD,kDAA0B;AAI1B,uEAAoE;AACpE,yDAAsD;AACtD,2EAAwE;AACxE,+EAA4E;AAE5E,SAAsB,8BAA8B;yDAGlD,GAAyB,EACzB,SAAoC,EACpC,WAAmB,EAAE;QAErB,MAAM,MAAM,GAAgC,IAAA,yBAAW,EAAC;YACtD,KAAK,EAAE,SAAS;YAChB,QAAQ;SACT,CAAC,CAAC;QACH,IAAI,SAAS,GAAW,CAAC,CAAC;QAC1B,MAAM,UAAU,GAAiC,MAAM,OAAO,CAAC,GAAG,CAChE,MAAM,CAAC,GAAG,CAAC,CAAO,EAAE,EAAE,EAAE;;YACtB,MAAM,GAAG,GAA+B,MAAM,gBAAgB,CAC5D,GAAG,EACH,EAAE,EACF,CAAC,EACD,CAAC,KAAK,EAAE,EAAE;gBACR,SAAS,IAAI,KAAK,CAAC;YACrB,CAAC,CACF,CAAC;YACF,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,qBAAqB;gBAC3B,UAAU,EAAE,GAAG;gBACf,SAAS;gBACT,KAAK,EAAE,SAAS,CAAC,MAAM;gBACvB,IAAI,EAAE,MA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
1
+ {"version":3,"file":"orchestrateInterfaceOperations.js","sourceRoot":"","sources":["../../../src/orchestrate/interface/orchestrateInterfaceOperations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,wEAkCC;;AA/CD,yCAAoE;AAGpE,+BAAkD;AAClD,kDAA0B;AAI1B,uEAAoE;AACpE,yDAAsD;AACtD,2EAAwE;AACxE,+EAA4E;AAE5E,SAAsB,8BAA8B;yDAGlD,GAAyB,EACzB,SAAoC,EACpC,WAAmB,EAAE;QAErB,MAAM,MAAM,GAAgC,IAAA,yBAAW,EAAC;YACtD,KAAK,EAAE,SAAS;YAChB,QAAQ;SACT,CAAC,CAAC;QACH,IAAI,SAAS,GAAW,CAAC,CAAC;QAC1B,MAAM,UAAU,GAAiC,MAAM,OAAO,CAAC,GAAG,CAChE,MAAM,CAAC,GAAG,CAAC,CAAO,EAAE,EAAE,EAAE;;YACtB,MAAM,GAAG,GAA+B,MAAM,gBAAgB,CAC5D,GAAG,EACH,EAAE,EACF,CAAC,EACD,CAAC,KAAK,EAAE,EAAE;gBACR,SAAS,IAAI,KAAK,CAAC;YACrB,CAAC,CACF,CAAC;YACF,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,qBAAqB;gBAC3B,UAAU,EAAE,GAAG;gBACf,SAAS;gBACT,KAAK,EAAE,SAAS,CAAC,MAAM;gBACvB,IAAI,EAAE,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,0CAAE,IAAI,mCAAI,CAAC;gBACpC,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACrC,CAAC,CAAC;YACH,OAAO,GAAG,CAAC;QACb,CAAC,CAAA,CAAC,CACH,CAAC;QACF,OAAO,UAAU,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;C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id");
4
5
  const transformInterfaceHistories = (state, systemMessage) => {
6
+ var _a, _b;
5
7
  if (state.analyze === null)
6
8
  return [
7
9
  {
10
+ id: (0, uuid_1.v4)(),
11
+ created_at: new Date().toISOString(),
8
12
  type: "systemMessage",
9
13
  text: [
10
14
  "Requirement analysis is not yet completed.",
@@ -16,6 +20,8 @@ const transformInterfaceHistories = (state, systemMessage) => {
16
20
  else if (state.prisma === null)
17
21
  return [
18
22
  {
23
+ id: (0, uuid_1.v4)(),
24
+ created_at: new Date().toISOString(),
19
25
  type: "systemMessage",
20
26
  text: [
21
27
  "Prisma DB schema generation is not yet completed.",
@@ -27,6 +33,8 @@ const transformInterfaceHistories = (state, systemMessage) => {
27
33
  else if (state.analyze.step !== state.prisma.step)
28
34
  return [
29
35
  {
36
+ id: (0, uuid_1.v4)(),
37
+ created_at: new Date().toISOString(),
30
38
  type: "systemMessage",
31
39
  text: [
32
40
  "Prisma DB schema generation has not been updated",
@@ -39,6 +47,8 @@ const transformInterfaceHistories = (state, systemMessage) => {
39
47
  else if (state.prisma.compiled.type !== "success")
40
48
  return [
41
49
  {
50
+ id: (0, uuid_1.v4)(),
51
+ created_at: new Date().toISOString(),
42
52
  type: "systemMessage",
43
53
  text: [
44
54
  "Prisma DB schema generation has not been updated",
@@ -50,10 +60,14 @@ const transformInterfaceHistories = (state, systemMessage) => {
50
60
  ];
51
61
  return [
52
62
  {
63
+ id: (0, uuid_1.v4)(),
64
+ created_at: new Date().toISOString(),
53
65
  type: "systemMessage",
54
66
  text: systemMessage,
55
67
  },
56
68
  {
69
+ id: (0, uuid_1.v4)(),
70
+ created_at: new Date().toISOString(),
57
71
  type: "assistantMessage",
58
72
  text: [
59
73
  "Requirement analysis and Prisma DB schema generation are ready.",
@@ -66,6 +80,31 @@ const transformInterfaceHistories = (state, systemMessage) => {
66
80
  "",
67
81
  state.analyze.reason,
68
82
  "",
83
+ "## Prefix",
84
+ "",
85
+ `* Prefix provided by the user: ${(_b = (_a = state.analyze) === null || _a === void 0 ? void 0 : _a.prefix) !== null && _b !== void 0 ? _b : null}`,
86
+ `* When defining TypeScript interfaces, the interface name must be in PascalCase. The property names, however, do not need to follow this convention.`,
87
+ "",
88
+ "The user wants all TypeScript identifiers (such as interfaces, types, and functions) to start with the prefix provided below. ",
89
+ "If the prefix is `null`, it should be ignored. ",
90
+ "If a prefix is provided, all identifier names **must begin with it**.",
91
+ "",
92
+ "However, if there is a special-purpose prefix like `mv` (e.g., for materialized view handlers or performance-related utilities), it **must precede** the given prefix.",
93
+ "",
94
+ "## Prefix Example",
95
+ "",
96
+ "If the prefix is `shopping`, then names should be like:",
97
+ "",
98
+ "* `shoppingSales`",
99
+ "* `shoppingSaleOptions`",
100
+ "* `shoppingCreateSale()`",
101
+ "",
102
+ "In cases where an identifier is created for performance-optimized logic or special processing (e.g., materialized view handling), the `mv` prefix must come first. ",
103
+ "For example:",
104
+ "",
105
+ "* `mvShoppingDailyStats`",
106
+ "* `mvShoppingAggregateView`",
107
+ "",
69
108
  // Requirement Analysis Report
70
109
  `## Requirement Analysis Report`,
71
110
  "",
@@ -75,6 +114,8 @@ const transformInterfaceHistories = (state, systemMessage) => {
75
114
  ].join("\n"),
76
115
  },
77
116
  {
117
+ id: (0, uuid_1.v4)(),
118
+ created_at: new Date().toISOString(),
78
119
  type: "assistantMessage",
79
120
  text: [
80
121
  "Database schema and entity relationship diagrams are ready.",
@@ -1 +1 @@
1
- {"version":3,"file":"transformInterfaceHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/interface/transformInterfaceHistories.ts"],"names":[],"mappings":";;;AAIO,MAAM,2BAA2B,GAAG,CACzC,KAAkB,EAClB,aAAqB,EAGrB,EAAE;IACF,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;QACxB,OAAO;YACL;gBACE,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,4CAA4C;oBAC5C,mCAAmC;oBACnC,8CAA8C;iBAC/C,CAAC,IAAI,CAAC,GAAG,CAAC;aACZ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D;gBAC7D,EAAE;gBACF,qBAAqB;gBACrB,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;gBACpC,KAAK;gBACL,EAAE;gBACF,iCAAiC;gBACjC,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBAC9C,KAAK;aACN,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC,CAAC;AA/FW,QAAA,2BAA2B,+BA+FtC"}
1
+ {"version":3,"file":"transformInterfaceHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/interface/transformInterfaceHistories.ts"],"names":[],"mappings":";;;AACA,+BAA0B;AAInB,MAAM,2BAA2B,GAAG,CACzC,KAAkB,EAClB,aAAqB,EAGrB,EAAE;;IACF,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;QACxB,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,4CAA4C;oBAC5C,mCAAmC;oBACnC,8CAA8C;iBAC/C,CAAC,IAAI,CAAC,GAAG,CAAC;aACZ;SACF,CAAC;SACC,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI;QAC5B,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,mDAAmD;oBACnD,mCAAmC;oBACnC,qDAAqD;iBACtD,CAAC,IAAI,CAAC,GAAG,CAAC;aACZ;SACF,CAAC;SACC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,MAAM,CAAC,IAAI;QAC/C,OAAO;YACL;gBACE,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BACF,wKAAwK;gBACxK,EAAE;gBACF,mBAAmB;gBACnB,EAAE;gBACF,yDAAyD;gBACzD,EAAE;gBACF,mBAAmB;gBACnB,yBAAyB;gBACzB,0BAA0B;gBAC1B,EAAE;gBACF,sKAAsK;gBACtK,cAAc;gBACd,EAAE;gBACF,0BAA0B;gBAC1B,6BAA6B;gBAC7B,EAAE;gBACF,8BAA8B;gBAC9B,gCAAgC;gBAChC,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;gBACnC,KAAK;aACN,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,6DAA6D;gBAC7D,EAAE;gBACF,qBAAqB;gBACrB,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;gBACpC,KAAK;gBACL,EAAE;gBACF,iCAAiC;gBACjC,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBAC9C,KAAK;aACN,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC,CAAC;AAtIW,QAAA,2BAA2B,+BAsItC"}
@@ -54,16 +54,17 @@ const assertSchemaModel_1 = require("../../context/assertSchemaModel");
54
54
  const transformPrismaComponentsHistories_1 = require("./transformPrismaComponentsHistories");
55
55
  function orchestratePrismaComponents(ctx_1) {
56
56
  return __awaiter(this, arguments, void 0, function* (ctx, content = "Please extract files and tables from the given documents.") {
57
- var _a, _b, _c, _d;
57
+ var _a, _b, _c, _d, _e, _f;
58
58
  const start = new Date();
59
59
  const pointer = {
60
60
  value: null,
61
61
  };
62
+ const prefix = (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.prefix) !== null && _b !== void 0 ? _b : null;
62
63
  const agentica = new core_1.MicroAgentica({
63
64
  model: ctx.model,
64
65
  vendor: ctx.vendor,
65
- config: Object.assign({}, ((_a = ctx.config) !== null && _a !== void 0 ? _a : {})),
66
- histories: (0, transformPrismaComponentsHistories_1.transformPrismaComponentsHistories)(ctx.state()),
66
+ config: Object.assign({}, ((_c = ctx.config) !== null && _c !== void 0 ? _c : {})),
67
+ histories: (0, transformPrismaComponentsHistories_1.transformPrismaComponentsHistories)(ctx.state(), prefix),
67
68
  tokenUsage: ctx.usage(),
68
69
  controllers: [
69
70
  createApplication({
@@ -75,7 +76,7 @@ function orchestratePrismaComponents(ctx_1) {
75
76
  ],
76
77
  });
77
78
  const histories = yield agentica.conversate(content);
78
- if (((_b = histories.at(-1)) === null || _b === void 0 ? void 0 : _b.type) === "assistantMessage")
79
+ if (((_d = histories.at(-1)) === null || _d === void 0 ? void 0 : _d.type) === "assistantMessage")
79
80
  return Object.assign(Object.assign({}, histories.at(-1)), { created_at: start.toISOString(), completed_at: new Date().toISOString(), id: (0, uuid_1.v4)() });
80
81
  else if (pointer.value === null) {
81
82
  throw new Error("Failed to extract files and tables."); // unreachable
@@ -84,7 +85,7 @@ function orchestratePrismaComponents(ctx_1) {
84
85
  type: "prismaComponents",
85
86
  created_at: start.toISOString(),
86
87
  components: pointer.value.components,
87
- step: (_d = (_c = ctx.state().analyze) === null || _c === void 0 ? void 0 : _c.step) !== null && _d !== void 0 ? _d : 0,
88
+ step: (_f = (_e = ctx.state().analyze) === null || _e === void 0 ? void 0 : _e.step) !== null && _f !== void 0 ? _f : 0,
88
89
  };
89
90
  });
90
91
  }
@@ -1 +1 @@
1
- {"version":3,"file":"orchestratePrismaComponent.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/orchestratePrismaComponent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
1
+ {"version":3,"file":"orchestratePrismaComponent.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/orchestratePrismaComponent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,kEAiDC;;AAlED,yCAKwB;AAKxB,kDAAoC;AACpC,+BAA0B;AAG1B,uEAAoE;AACpE,6FAA0F;AAE1F,SAAsB,2BAA2B;yDAG/C,GAAyB,EACzB,UAAkB,2DAA2D;;QAE7E,MAAM,KAAK,GAAS,IAAI,IAAI,EAAE,CAAC;QAC/B,MAAM,OAAO,GAA6C;YACxD,KAAK,EAAE,IAAI;SACZ,CAAC;QAEF,MAAM,MAAM,GAAG,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,0CAAE,MAAM,mCAAI,IAAI,CAAC;QAEnD,MAAM,QAAQ,GAAyB,IAAI,oBAAa,CAAC;YACvD,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,MAAM,oBACD,CAAC,MAAA,GAAG,CAAC,MAAM,mCAAI,EAAE,CAAC,CACtB;YACD,SAAS,EAAE,IAAA,uEAAkC,EAAC,GAAG,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC;YAClE,UAAU,EAAE,GAAG,CAAC,KAAK,EAAE;YACvB,WAAW,EAAE;gBACX,iBAAiB,CAAC;oBAChB,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;wBACd,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;oBACvB,CAAC;iBACF,CAAC;aACH;SACF,CAAC,CAAC;QAEH,MAAM,SAAS,GACb,MAAM,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,CAAA,MAAA,SAAS,CAAC,EAAE,CAAC,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import { IAgenticaHistoryJson } from "@agentica/core";
2
2
  import { AutoBeState } from "../../context/AutoBeState";
3
- export declare const transformPrismaComponentsHistories: (state: AutoBeState) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
3
+ export declare const transformPrismaComponentsHistories: (state: AutoBeState, prefix?: string | null) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.transformPrismaComponentsHistories = void 0;
4
- const transformPrismaComponentsHistories = (state) => {
4
+ const uuid_1 = require("uuid");
5
+ const transformPrismaComponentsHistories = (state, prefix = null) => {
5
6
  if (state.analyze === null)
6
7
  return [
7
8
  {
9
+ id: (0, uuid_1.v4)(),
10
+ created_at: new Date().toISOString(),
8
11
  type: "systemMessage",
9
12
  text: [
10
13
  "Requirement analysis is not yet completed.",
@@ -15,10 +18,14 @@ const transformPrismaComponentsHistories = (state) => {
15
18
  ];
16
19
  return [
17
20
  {
21
+ id: (0, uuid_1.v4)(),
22
+ created_at: new Date().toISOString(),
18
23
  type: "systemMessage",
19
24
  text: "You are a world-class database architecture analyst specializing in domain-driven design and schema organization. You excel at analyzing requirements and organizing database models into logical, maintainable file structures.\n\n### Core Principles\n\n- **Never ask for clarification** - Work with the provided requirements and make reasonable assumptions\n- **Output only structured JSON** - Return organized file-table mappings in the specified format\n- **Follow domain-driven design** - Group related entities into cohesive domains\n- **Prioritize logical separation** - Ensure clear boundaries between different business domains\n\n### Default Working Language: English\n\n- Use the language specified by user in messages as the working language when explicitly provided\n- All thinking and analysis must be in the working language\n- All model/table names must be in English regardless of working language\n\n### Task: Analyze Requirements and Generate File Structure\n\nYour primary task is to analyze user requirements and generate a structured file organization plan in the format: `{filename: string; tables: string[]}[]`\n\n### Analysis Steps\n\n1. **Domain Analysis**: Identify distinct business domains from requirements\n2. **Entity Identification**: Extract all entities/models mentioned or implied\n3. **Relationship Mapping**: Understand how entities relate across domains\n4. **File Organization**: Group related entities into logical files\n5. **Validation**: Ensure all entities are accounted for and properly grouped\n\n### File Organization Guidelines\n\n#### Naming Conventions\n\n- **Filenames**: `schema-{number}-{domain}.prisma` (e.g., `schema-01-core.prisma`, `schema-02-users.prisma`)\n- **Domain names**: Use clear, descriptive domain names in snake_case\n\n#### Grouping Strategy\n\n- **Core/Foundation**: Basic entities used across multiple domains (users, organizations)\n- **Domain-specific**: Entities belonging to specific business domains\n- **Cross-cutting**: Entities that span multiple domains (notifications, audit logs)\n- **Utility**: Helper entities (settings, configurations)\n\n#### File Structure Rules\n\n- **Maximum 8-10 models per file** for maintainability\n- **Related entities together**: Keep strongly related models in the same file\n- **Dependency consideration**: Place foundational models in earlier files\n- **Logical progression**: Order files from core to specific domains\n\n### Expected Output Format\n\n```json\n[\n {\n \"filename\": \"schema-01-core.prisma\", \n \"tables\": [\"users\", \"user_profiles\", \"organizations\"]\n },\n {\n \"filename\": \"schema-02-articles.prisma\",\n \"tables\": [\"articles\", \"article_snapshots\", \"article_comments\"]\n }\n]\n```\n\n### Quality Checklist\n\nBefore outputting, ensure:\n- [ ] All entities from requirements are included\n- [ ] Files are logically organized by domain\n- [ ] No single file is overloaded with too many models\n- [ ] Dependencies flow from core to specific domains\n- [ ] Filename conventions are followed" /* AutoBeSystemPromptConstant.PRISMA_COMPONENT */,
20
25
  },
21
26
  {
27
+ id: (0, uuid_1.v4)(),
28
+ created_at: new Date().toISOString(),
22
29
  type: "assistantMessage",
23
30
  text: [
24
31
  "Here is the requirement analysis report.",
@@ -34,6 +41,26 @@ const transformPrismaComponentsHistories = (state) => {
34
41
  "```json",
35
42
  JSON.stringify(state.analyze.files),
36
43
  "```",
44
+ "## Prefix",
45
+ "",
46
+ `* Prefix provided by the user: ${prefix}`,
47
+ "",
48
+ "The user wants all database schema (table) names to start with the prefix provided below.",
49
+ "If the prefix is `null`, it should be ignored.",
50
+ "If a prefix is provided, all table names **must begin with it**.",
51
+ "However, if there is a special-purpose prefix like `mv` (for materialized views), it **must precede** the given prefix.",
52
+ "",
53
+ "## Prefix Example",
54
+ "",
55
+ "If the prefix is `shopping`, then table names should be like:",
56
+ "",
57
+ "* `shopping_sales`",
58
+ "* `shopping_sale_options`",
59
+ "",
60
+ "In cases where a table is created for performance optimization purposes (e.g., materialized views), the `mv_` prefix must come first.",
61
+ "For example:",
62
+ "",
63
+ "* `mv_shopping_daily_stats`",
37
64
  ].join("\n"),
38
65
  },
39
66
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"transformPrismaComponentsHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/transformPrismaComponentsHistories.ts"],"names":[],"mappings":";;;AAKO,MAAM,kCAAkC,GAAG,CAChD,KAAkB,EAGlB,EAAE;IACF,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;QACxB,OAAO;YACL;gBACE,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,4CAA4C;oBAC5C,+BAA+B;oBAC/B,8CAA8C;iBAC/C,CAAC,IAAI,CAAC,GAAG,CAAC;aACZ;SACF,CAAC;IACJ,OAAO;QACL;YACE,IAAI,EAAE,eAAe;YACrB,IAAI,iiGAA6C;SAClD;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,0CAA0C;gBAC1C,EAAE;gBACF,8DAA8D;gBAC9D,gDAAgD;gBAChD,EAAE;gBACF,iBAAiB;gBACjB,KAAK,CAAC,OAAO,CAAC,MAAM;gBACpB,EAAE;gBACF,gCAAgC;gBAChC,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;gBACnC,KAAK;aACN,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC,CAAC;AAxCW,QAAA,kCAAkC,sCAwC7C"}
1
+ {"version":3,"file":"transformPrismaComponentsHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/transformPrismaComponentsHistories.ts"],"names":[],"mappings":";;;AACA,+BAA0B;AAKnB,MAAM,kCAAkC,GAAG,CAChD,KAAkB,EAClB,SAAwB,IAAI,EAG5B,EAAE;IACF,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;QACxB,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,4CAA4C;oBAC5C,+BAA+B;oBAC/B,8CAA8C;iBAC/C,CAAC,IAAI,CAAC,GAAG,CAAC;aACZ;SACF,CAAC;IACJ,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,iiGAA6C;SAClD;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,0CAA0C;gBAC1C,EAAE;gBACF,8DAA8D;gBAC9D,gDAAgD;gBAChD,EAAE;gBACF,iBAAiB;gBACjB,KAAK,CAAC,OAAO,CAAC,MAAM;gBACpB,EAAE;gBACF,gCAAgC;gBAChC,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;gBACnC,KAAK;gBACL,WAAW;gBACX,EAAE;gBACF,kCAAkC,MAAM,EAAE;gBAC1C,EAAE;gBACF,2FAA2F;gBAC3F,gDAAgD;gBAChD,kEAAkE;gBAClE,yHAAyH;gBACzH,EAAE;gBACF,mBAAmB;gBACnB,EAAE;gBACF,+DAA+D;gBAC/D,EAAE;gBACF,oBAAoB;gBACpB,2BAA2B;gBAC3B,EAAE;gBACF,uIAAuI;gBACvI,cAAc;gBACd,EAAE;gBACF,6BAA6B;aAC9B,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC,CAAC;AAnEW,QAAA,kCAAkC,sCAmE7C"}
@@ -1,13 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.transformPrismaCorrectHistories = void 0;
4
+ const uuid_1 = require("uuid");
4
5
  const transformPrismaCorrectHistories = (result) => {
5
6
  return [
6
7
  {
8
+ id: (0, uuid_1.v4)(),
9
+ created_at: new Date().toISOString(),
7
10
  type: "systemMessage",
8
11
  text: "# `AutoBePrisma` Targeted Validation Error Fixing Agent\n\nYou are a world-class Prisma schema validation and error resolution specialist working with structured `AutoBePrisma` definitions. Your primary mission is to analyze validation errors in `IAutoBePrismaValidation.IFailure` responses and provide precise fixes for **ONLY the affected tables/models** while maintaining complete schema integrity and business logic.\n\n## Core Operating Principles\n\n### \uD83D\uDEAB ABSOLUTE PROHIBITIONS\n- **NEVER ask for clarification** - analyze and fix validation errors directly\n- **NEVER remove or modify existing business logic** unless it causes validation errors\n- **NEVER delete model descriptions or field descriptions** unless removing duplicate elements\n- **NEVER create new duplicate fields, relations, or models**\n- **NEVER ignore validation errors** - every error must be addressed\n- **NEVER break existing relationships** unless they're causing validation errors\n- **NEVER change data types** unless specifically required by validation errors\n- **\uD83D\uDD34 CRITICAL: NEVER delete fields or relationships to avoid compilation errors**\n- **\uD83D\uDD34 CRITICAL: Only delete elements when they are EXACT DUPLICATES of existing elements**\n- **\uD83D\uDD34 CRITICAL: Always FIX errors by correction, not by removal (unless duplicate)**\n- **\uD83D\uDD34 CRITICAL: NEVER modify tables/models that are not mentioned in validation errors**\n\n### \u2705 MANDATORY REQUIREMENTS\n- **Fix ONLY validation errors** listed in the IAutoBePrismaValidation.IFailure.errors array\n- **Return ONLY the corrected models/tables** that had validation errors\n- **Preserve business intent** and architectural patterns from original schema\n- **Maintain referential integrity** with unchanged models\n- **Preserve ALL model and field descriptions** (except for removed duplicates)\n- **Keep original naming conventions** unless they cause validation errors\n- **\uD83D\uDFE2 PRIORITY: Correct errors through proper fixes, not deletions**\n- **\uD83D\uDFE2 PRIORITY: Maintain ALL business functionality and data structure**\n- **\uD83D\uDFE2 PRIORITY: Minimize output scope to only affected models**\n\n## Targeted Fix Strategy\n\n### 1. Error Scope Analysis\n\n#### Error Filtering Process\n```typescript\ninterface IError {\n path: string; // File path where error occurs\n table: string; // Model name with the error - TARGET FOR FIX\n column: string | null; // Field name (null for model-level errors)\n message: string; // Detailed error description\n}\n```\n\n#### Affected Model Identification\n1. **Extract unique table names** from all errors in IError[] array\n2. **Group errors by table** for efficient processing\n3. **Identify cross-table dependencies** that need consideration\n4. **Focus ONLY on models mentioned in errors** - ignore all others\n5. **Track relationship impacts** on non-error models (for reference validation only)\n\n### 2. Targeted Error Resolution\n\n#### Model-Level Fixes (Scope: Single Model)\n- **Duplicate model names**: Rename affected model only\n- **Invalid model names**: Update naming convention for specific model\n- **Missing primary keys**: Add/fix primary key in affected model only\n- **Materialized view issues**: Fix material flag and naming for specific model\n\n#### Field-Level Fixes (Scope: Specific Fields in Error Models)\n- **Duplicate field names**: Fix only within the affected model\n- **Invalid field types**: Update types for specific fields only\n- **Missing foreign keys**: Add required foreign keys to affected model only\n- **Foreign key reference errors**: Fix references in affected model only\n\n#### Relationship Fixes (Scope: Affected Model Relations)\n- **Invalid target model references**: Update references in error model only\n- **Missing relation configurations**: Add/fix relations in affected model only\n- **Relation naming conflicts**: Resolve conflicts within affected model only\n\n#### Index Fixes (Scope: Affected Model Indexes)\n- **Invalid field references**: Fix index fieldNames in affected model only\n- **Single foreign key indexes**: Restructure indexes in affected model only\n- **Duplicate indexes**: Remove duplicates within affected model only\n\n### 3. Cross-Model Impact Analysis\n\n#### Reference Validation (Read-Only for Non-Error Models)\n- **Verify target model existence** for foreign key references\n- **Check target field validity** (usually \"id\" primary key)\n- **Validate bidirectional relationship consistency**\n- **Ensure renamed model references are updated** in other models\n\n#### Dependency Tracking\n- **Identify models that reference** the corrected models\n- **Note potential cascade effects** of model/field renaming\n- **Flag models that may need reference updates** (for external handling)\n- **Maintain awareness of schema-wide implications**\n\n### 4. Minimal Output Strategy\n\n#### Output Scope Determination\n**Include in output ONLY:**\n1. **Models explicitly mentioned in validation errors**\n2. **Models with fields that reference renamed models** (if any)\n3. **Models that require relationship updates** due to fixes\n\n**Exclude from output:**\n1. **Models with no validation errors**\n2. **Models not affected by fixes**\n3. **Models that maintain valid references to corrected models**\n\n#### Fix Documentation\nFor each corrected model, provide:\n- **Original error description**\n- **Applied fix explanation**\n- **Impact on other models** (reference updates needed)\n- **Business logic preservation confirmation**\n\n## Error Resolution Workflow\n\n### 1. Error Parsing & Scope Definition\n1. **Parse IAutoBePrismaValidation.IFailure** structure\n2. **Extract unique table names** from error array\n3. **Group errors by affected model** for batch processing\n4. **Identify minimal fix scope** - only what's necessary\n5. **Plan cross-model reference updates** (if needed)\n\n### 2. Targeted Fix Planning\n1. **Analyze each error model individually**\n2. **Plan fixes for each affected model**\n3. **Check for inter-model dependency impacts**\n4. **Determine minimal output scope**\n5. **Validate fix feasibility without breaking references**\n\n### 3. Precision Fix Implementation\n1. **Apply fixes ONLY to error models**\n2. **Update cross-references ONLY if needed**\n3. **Preserve all unchanged model integrity**\n4. **Maintain business logic in fixed models**\n5. **Verify minimal scope compliance**\n\n### 4. Output Validation\n1. **Confirm all errors are addressed** in affected models\n2. **Verify no new validation issues** in fixed models\n3. **Check reference integrity** with unchanged models\n4. **Validate business logic preservation** in corrected models\n5. **Ensure minimal output scope** - no unnecessary models included\n\n## Input/Output Format\n\n### Input Structure\n```typescript\n{\n success: false,\n application: AutoBePrisma.IApplication, // Full schema for reference\n errors: IError[] // Target models for fixing\n}\n```\n\n### Output Requirement\nReturn ONLY corrected models that had validation errors:\n```typescript\nconst correctedModels: AutoBePrisma.IModel[] = [\n // ONLY models mentioned in IError[] array\n // ONLY models affected by cross-reference updates\n // All other models are preserved unchanged\n];\n\n// Include metadata about the fix scope\nconst fixSummary = {\n correctedModels: string[], // Names of models that were fixed\n crossReferenceUpdates: string[], // Models that needed reference updates\n preservedModels: string[], // Models that remain unchanged\n errorsCorrected: number // Count of resolved errors\n};\n```\n\n## Targeted Correction Examples\n\n### Example 1: Single Model Duplicate Field Error\n**Input Error:**\n```typescript\n{\n path: \"users.prisma\",\n table: \"users\",\n column: \"email\",\n message: \"Duplicate field 'email' in model 'users'\"\n}\n```\n\n**Output:** Only the `users` model with the duplicate field resolved\n- **Scope:** 1 model\n- **Change:** Rename one `email` field to `email_secondary` or merge if identical\n- **Excluded:** All other models remain unchanged\n\n### Example 2: Cross-Model Reference Error\n**Input Error:**\n```typescript\n{\n path: \"orders.prisma\",\n table: \"orders\",\n column: \"user_id\",\n message: \"Invalid target model 'user' for foreign key 'user_id'\"\n}\n```\n\n**Output:** Only the `orders` model with corrected reference\n- **Scope:** 1 model (orders)\n- **Change:** Update `targetModel` from \"user\" to \"users\"\n- **Excluded:** The `users` model remains unchanged (just referenced correctly)\n\n### Example 3: Model Name Duplication Across Files\n**Input Errors:**\n```typescript\n[\n {\n path: \"auth/users.prisma\",\n table: \"users\",\n column: null,\n message: \"Duplicate model name 'users'\"\n },\n {\n path: \"admin/users.prisma\",\n table: \"users\",\n column: null,\n message: \"Duplicate model name 'users'\"\n }\n]\n```\n\n**Output:** Both affected `users` models with one renamed\n- **Scope:** 2 models\n- **Change:** Rename one to `admin_users`, update all its references\n- **Excluded:** All other models that don't reference the renamed model\n\n## Critical Success Criteria\n\n### \u2705 Must Achieve (Targeted Scope)\n- [ ] All validation errors resolved **for mentioned models only**\n- [ ] Original business logic preserved **in corrected models**\n- [ ] Cross-model references remain valid **through minimal updates**\n- [ ] Output contains **ONLY affected models** - no unnecessary inclusions\n- [ ] Referential integrity maintained **with unchanged models**\n- [ ] **\uD83D\uDD34 MINIMAL SCOPE: Only error models + necessary reference updates**\n- [ ] **\uD83D\uDD34 UNCHANGED MODELS: Preserved completely in original schema**\n\n### \uD83D\uDEAB Must Avoid (Scope Violations)\n- [ ] Including models without validation errors in output\n- [ ] Modifying models not mentioned in error array\n- [ ] Returning entire schema when only partial fixes needed\n- [ ] Making unnecessary changes beyond error resolution\n- [ ] Breaking references to unchanged models\n- [ ] **\uD83D\uDD34 SCOPE CREEP: Fixing models that don't have errors**\n- [ ] **\uD83D\uDD34 OUTPUT BLOAT: Including unchanged models in response**\n\n## Quality Assurance Process\n\n### Pre-Output Scope Validation\n1. **Error Coverage Check**: Every error in IError[] array addressed **in minimal scope**\n2. **Output Scope Audit**: Only affected models included in response\n3. **Reference Integrity**: Unchanged models maintain valid references\n4. **Business Logic Preservation**: Corrected models maintain original intent\n5. **Cross-Model Impact**: Necessary reference updates identified and applied\n6. ****\uD83D\uDD34 Minimal Output Verification**: No unnecessary models in response**\n7. **\uD83D\uDD34 Unchanged Model Preservation**: Non-error models completely preserved**\n\n### Targeted Response Validation Questions\n- Are all validation errors resolved **with minimal model changes**?\n- Does the output include **ONLY models that had errors** or needed reference updates?\n- Are **unchanged models completely preserved** in the original schema?\n- Do **cross-model references remain valid** after targeted fixes?\n- Is the **business logic maintained** in all corrected models?\n- **\uD83D\uDD34 Is the output scope minimized** to only necessary corrections?\n- **\uD83D\uDD34 Are non-error models excluded** from the response?\n\n## \uD83C\uDFAF CORE PRINCIPLE REMINDER\n\n**Your role is TARGETED ERROR CORRECTOR, not SCHEMA RECONSTRUCTOR**\n\n- Fix **ONLY the models with validation errors**\n- Preserve **ALL unchanged models** in their original state\n- Return **MINIMAL output scope** - only what was corrected\n- Maintain **referential integrity** with unchanged models\n- **Focus on precision fixes, not comprehensive rebuilds**\n\nRemember: Your goal is to be a surgical validation error resolver, fixing only what's broken while preserving the integrity of the unchanged schema components. **Minimize context usage by returning only the corrected models, not the entire schema.**" /* AutoBeSystemPromptConstant.PRISMA_CORRECT */,
9
12
  },
10
13
  {
14
+ id: (0, uuid_1.v4)(),
15
+ created_at: new Date().toISOString(),
11
16
  type: "assistantMessage",
12
17
  text: [
13
18
  "Here is the Prisma application data what you made:",
@@ -18,6 +23,8 @@ const transformPrismaCorrectHistories = (result) => {
18
23
  ].join("\n"),
19
24
  },
20
25
  {
26
+ id: (0, uuid_1.v4)(),
27
+ created_at: new Date().toISOString(),
21
28
  type: "assistantMessage",
22
29
  text: [
23
30
  "Below are the list of errors what you have to fix:",
@@ -28,6 +35,8 @@ const transformPrismaCorrectHistories = (result) => {
28
35
  ].join("\n"),
29
36
  },
30
37
  {
38
+ id: (0, uuid_1.v4)(),
39
+ created_at: new Date().toISOString(),
31
40
  type: "systemMessage",
32
41
  text: [
33
42
  "Before fixing the schema files,",
@@ -1 +1 @@
1
- {"version":3,"file":"transformPrismaCorrectHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/transformPrismaCorrectHistories.ts"],"names":[],"mappings":";;;AAKO,MAAM,+BAA+B,GAAG,CAC7C,MAAwC,EAGxC,EAAE;IACF,OAAO;QACL;YACE,IAAI,EAAE,eAAe;YACrB,IAAI,64XAA2C;SAChD;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,oDAAoD;gBACpD,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;gBAC3B,KAAK;aACN,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,oDAAoD;gBACpD,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;gBAC7B,KAAK;aACN,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD;YACE,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE;gBACJ,iCAAiC;gBACjC,oCAAoC;gBACpC,sCAAsC;gBACtC,EAAE;;aAEH,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC,CAAC;AAzCW,QAAA,+BAA+B,mCAyC1C"}
1
+ {"version":3,"file":"transformPrismaCorrectHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/transformPrismaCorrectHistories.ts"],"names":[],"mappings":";;;AAEA,+BAA0B;AAInB,MAAM,+BAA+B,GAAG,CAC7C,MAAwC,EAGxC,EAAE;IACF,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,64XAA2C;SAChD;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,oDAAoD;gBACpD,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;gBAC3B,KAAK;aACN,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,oDAAoD;gBACpD,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;gBAC7B,KAAK;aACN,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE;gBACJ,iCAAiC;gBACjC,oCAAoC;gBACpC,sCAAsC;gBACtC,EAAE;;aAEH,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,+BAA+B,mCAiD1C"}