@autobe/agent 0.0.0 → 0.3.9

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 (166) hide show
  1. package/LICENSE +21 -21
  2. package/lib/AutoBeAgent.d.ts +9 -7
  3. package/lib/AutoBeAgent.js +106 -14
  4. package/lib/AutoBeAgent.js.map +1 -1
  5. package/lib/analyze/AnalyzeAgent.d.ts +24 -0
  6. package/lib/analyze/AnalyzeAgent.js +817 -0
  7. package/lib/analyze/AnalyzeAgent.js.map +1 -0
  8. package/lib/analyze/CreateReviewerAgent.d.ts +16 -0
  9. package/lib/analyze/CreateReviewerAgent.js +97 -0
  10. package/lib/analyze/CreateReviewerAgent.js.map +1 -0
  11. package/lib/analyze/Planning.d.ts +63 -0
  12. package/lib/{orchestrate/orchestratePrisma.js → analyze/Planning.js} +28 -11
  13. package/lib/analyze/Planning.js.map +1 -0
  14. package/lib/constants/AutoBeSystemPromptConstant.d.ts +14 -0
  15. package/lib/constants/AutoBeSystemPromptConstant.js +4 -0
  16. package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -0
  17. package/lib/context/AutoBeContext.d.ts +7 -3
  18. package/lib/context/IAutoBeApplication.d.ts +72 -32
  19. package/lib/context/IAutoBeApplicationProps.d.ts +22 -2
  20. package/lib/context/IAutoBeApplicationResult.d.ts +0 -1
  21. package/lib/context/assertSchemaModel.d.ts +2 -0
  22. package/lib/context/assertSchemaModel.js +15 -0
  23. package/lib/context/assertSchemaModel.js.map +1 -0
  24. package/lib/{internal/transformAgenticaHistory.d.ts → factory/createAgenticaHistory.d.ts} +1 -1
  25. package/lib/{internal/transformAgenticaHistory.js → factory/createAgenticaHistory.js} +3 -4
  26. package/lib/factory/createAgenticaHistory.js.map +1 -0
  27. package/lib/factory/createAutoBeApplication.js +1195 -0
  28. package/lib/factory/createAutoBeApplication.js.map +1 -0
  29. package/lib/factory/createAutoBeState.js.map +1 -0
  30. package/lib/factory/index.d.ts +2 -0
  31. package/lib/factory/index.js +19 -0
  32. package/lib/factory/index.js.map +1 -0
  33. package/lib/factory/invertOpenApiDocument.d.ts +3 -0
  34. package/lib/factory/invertOpenApiDocument.js +51 -0
  35. package/lib/factory/invertOpenApiDocument.js.map +1 -0
  36. package/lib/index.d.ts +3 -3
  37. package/lib/index.js +4 -4
  38. package/lib/index.js.map +1 -1
  39. package/lib/index.mjs +5455 -547
  40. package/lib/index.mjs.map +1 -1
  41. package/lib/orchestrate/facade/transformFacadeStateMessage.d.ts +2 -0
  42. package/lib/orchestrate/facade/transformFacadeStateMessage.js +46 -0
  43. package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -0
  44. package/lib/orchestrate/index.d.ts +2 -2
  45. package/lib/orchestrate/index.js +2 -2
  46. package/lib/orchestrate/index.js.map +1 -1
  47. package/lib/orchestrate/interface/OpenApiEndpointComparator.d.ts +5 -0
  48. package/lib/orchestrate/interface/OpenApiEndpointComparator.js +16 -0
  49. package/lib/orchestrate/interface/OpenApiEndpointComparator.js.map +1 -0
  50. package/lib/orchestrate/interface/orchestrateInterface.d.ts +5 -0
  51. package/lib/orchestrate/interface/orchestrateInterface.js +61 -0
  52. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -0
  53. package/lib/orchestrate/interface/orchestrateInterfaceComponents.d.ts +4 -0
  54. package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +702 -0
  55. package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -0
  56. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.d.ts +4 -0
  57. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +452 -0
  58. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -0
  59. package/lib/orchestrate/interface/orchestrateInterfaceOperations.d.ts +4 -0
  60. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +2065 -0
  61. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -0
  62. package/lib/orchestrate/interface/transformInterfaceHistories.d.ts +3 -0
  63. package/lib/orchestrate/interface/transformInterfaceHistories.js +94 -0
  64. package/lib/orchestrate/interface/transformInterfaceHistories.js.map +1 -0
  65. package/lib/orchestrate/orchestrateAnalyze.d.ts +1 -3
  66. package/lib/orchestrate/orchestrateAnalyze.js +60 -6
  67. package/lib/orchestrate/orchestrateAnalyze.js.map +1 -1
  68. package/lib/orchestrate/{orchestratePrisma.d.ts → prisma/orchestratePrisma.d.ts} +3 -6
  69. package/lib/orchestrate/prisma/orchestratePrisma.js +103 -0
  70. package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -0
  71. package/lib/orchestrate/prisma/orchestratePrismaCompiler.d.ts +6 -0
  72. package/lib/orchestrate/prisma/orchestratePrismaCompiler.js +436 -0
  73. package/lib/orchestrate/prisma/orchestratePrismaCompiler.js.map +1 -0
  74. package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +5 -0
  75. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +437 -0
  76. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -0
  77. package/lib/orchestrate/prisma/orchestratePrismaSchema.d.ts +7 -0
  78. package/lib/orchestrate/prisma/orchestratePrismaSchema.js +369 -0
  79. package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -0
  80. package/lib/orchestrate/prisma/transformPrismaCompilerHistories.d.ts +3 -0
  81. package/lib/orchestrate/prisma/transformPrismaCompilerHistories.js +44 -0
  82. package/lib/orchestrate/prisma/transformPrismaCompilerHistories.js.map +1 -0
  83. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.d.ts +3 -0
  84. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +42 -0
  85. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -0
  86. package/lib/orchestrate/prisma/transformPrismaHistories.d.ts +3 -0
  87. package/lib/orchestrate/prisma/transformPrismaHistories.js +46 -0
  88. package/lib/orchestrate/prisma/transformPrismaHistories.js.map +1 -0
  89. package/lib/orchestrate/prisma/transformPrismaSchemaHistories.d.ts +3 -0
  90. package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js +46 -0
  91. package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js.map +1 -0
  92. package/lib/structures/IAutoBeConfig.d.ts +4 -4
  93. package/lib/utils/StringUtil.d.ts +4 -0
  94. package/lib/utils/StringUtil.js +43 -0
  95. package/lib/utils/StringUtil.js.map +1 -0
  96. package/lib/utils/divideArray.d.ts +4 -0
  97. package/lib/utils/divideArray.js +19 -0
  98. package/lib/utils/divideArray.js.map +1 -0
  99. package/lib/utils/emplaceMap.d.ts +1 -0
  100. package/lib/utils/emplaceMap.js +13 -0
  101. package/lib/utils/emplaceMap.js.map +1 -0
  102. package/package.json +29 -8
  103. package/src/AutoBeAgent.ts +227 -101
  104. package/src/analyze/AnalyzeAgent.ts +167 -0
  105. package/src/analyze/CreateReviewerAgent.ts +126 -0
  106. package/src/analyze/Planning.ts +75 -0
  107. package/src/constants/AutoBeSystemPromptConstant.ts +15 -0
  108. package/src/context/AutoBeContext.ts +19 -15
  109. package/src/context/AutoBeState.ts +15 -15
  110. package/src/context/AutoBeTokenUsage.ts +3 -3
  111. package/src/context/IAutoBeApplication.ts +112 -72
  112. package/src/context/IAutoBeApplicationProps.ts +27 -6
  113. package/src/context/IAutoBeApplicationResult.ts +3 -4
  114. package/src/context/assertSchemaModel.ts +17 -0
  115. package/src/{internal/transformAgenticaHistory.ts → factory/createAgenticaHistory.ts} +51 -54
  116. package/src/{internal → factory}/createAutoBeApplication.ts +52 -47
  117. package/src/{internal → factory}/createAutoBeState.ts +14 -14
  118. package/src/factory/index.ts +2 -0
  119. package/src/factory/invertOpenApiDocument.ts +63 -0
  120. package/src/index.ts +13 -12
  121. package/src/orchestrate/facade/transformFacadeStateMessage.ts +58 -0
  122. package/src/orchestrate/index.ts +5 -5
  123. package/src/orchestrate/interface/OpenApiEndpointComparator.ts +15 -0
  124. package/src/orchestrate/interface/orchestrateInterface.ts +66 -0
  125. package/src/orchestrate/interface/orchestrateInterfaceComponents.ts +324 -0
  126. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +140 -0
  127. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +247 -0
  128. package/src/orchestrate/interface/transformInterfaceHistories.ts +98 -0
  129. package/src/orchestrate/orchestrateAnalyze.ts +86 -21
  130. package/src/orchestrate/orchestrateRealize.ts +18 -18
  131. package/src/orchestrate/orchestrateTest.ts +18 -18
  132. package/src/orchestrate/prisma/orchestratePrisma.ts +117 -0
  133. package/src/orchestrate/prisma/orchestratePrismaCompiler.ts +194 -0
  134. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +176 -0
  135. package/src/orchestrate/prisma/orchestratePrismaSchema.ts +181 -0
  136. package/src/orchestrate/prisma/transformPrismaCompilerHistories.ts +49 -0
  137. package/src/orchestrate/prisma/transformPrismaComponentsHistories.ts +46 -0
  138. package/src/orchestrate/prisma/transformPrismaHistories.ts +50 -0
  139. package/src/orchestrate/prisma/transformPrismaSchemaHistories.ts +50 -0
  140. package/src/structures/IAutoBeConfig.ts +25 -25
  141. package/src/structures/IAutoBeProps.ts +13 -13
  142. package/src/structures/IAutoBeVendor.ts +3 -3
  143. package/src/utils/StringUtil.ts +45 -0
  144. package/src/utils/divideArray.ts +16 -0
  145. package/src/utils/emplaceMap.ts +14 -0
  146. package/lib/factory/transformRouteDocument.d.ts +0 -3
  147. package/lib/factory/transformRouteDocument.js +0 -50
  148. package/lib/factory/transformRouteDocument.js.map +0 -1
  149. package/lib/internal/createAutoBeApplication.js +0 -1452
  150. package/lib/internal/createAutoBeApplication.js.map +0 -1
  151. package/lib/internal/createAutoBeState.js.map +0 -1
  152. package/lib/internal/transformAgenticaHistory.js.map +0 -1
  153. package/lib/orchestrate/interface/AutoBeInterfaceAgent.d.ts +0 -0
  154. package/lib/orchestrate/interface/AutoBeInterfaceAgent.js +0 -2
  155. package/lib/orchestrate/interface/AutoBeInterfaceAgent.js.map +0 -1
  156. package/lib/orchestrate/orchestrateInterface.d.ts +0 -8
  157. package/lib/orchestrate/orchestrateInterface.js +0 -22
  158. package/lib/orchestrate/orchestrateInterface.js.map +0 -1
  159. package/lib/orchestrate/orchestratePrisma.js.map +0 -1
  160. package/src/factory/transformRouteDocument.ts +0 -49
  161. package/src/orchestrate/interface/AutoBeInterfaceAgent.ts +0 -0
  162. package/src/orchestrate/orchestrateInterface.ts +0 -21
  163. package/src/orchestrate/orchestratePrisma.ts +0 -21
  164. /package/lib/{internal → factory}/createAutoBeApplication.d.ts +0 -0
  165. /package/lib/{internal → factory}/createAutoBeState.d.ts +0 -0
  166. /package/lib/{internal → factory}/createAutoBeState.js +0 -0
@@ -0,0 +1,436 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ var __importDefault = (this && this.__importDefault) || function (mod) {
45
+ return (mod && mod.__esModule) ? mod : { "default": mod };
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.orchestratePrismaCompiler = orchestratePrismaCompiler;
49
+ const __typia_transform__accessExpressionAsString = __importStar(require("typia/lib/internal/_accessExpressionAsString.js"));
50
+ const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
51
+ const core_1 = require("@agentica/core");
52
+ const typia_1 = __importDefault(require("typia"));
53
+ const assertSchemaModel_1 = require("../../context/assertSchemaModel");
54
+ const transformPrismaCompilerHistories_1 = require("./transformPrismaCompilerHistories");
55
+ function orchestratePrismaCompiler(ctx_1, files_1) {
56
+ return __awaiter(this, arguments, void 0, function* (ctx, files, retry = 10) {
57
+ var _a, _b, _c, _d, _e, _f, _g;
58
+ const pointer = {
59
+ value: { files, description: "" },
60
+ };
61
+ const agentica = new core_1.MicroAgentica({
62
+ model: ctx.model,
63
+ vendor: ctx.vendor,
64
+ config: Object.assign({}, ((_a = ctx.config) !== null && _a !== void 0 ? _a : {})),
65
+ histories: (0, transformPrismaCompilerHistories_1.transformPrismaCompilerHistories)(ctx.state(), files),
66
+ tokenUsage: ctx.usage(),
67
+ controllers: [
68
+ createApplication({
69
+ model: ctx.model,
70
+ build: (next) => {
71
+ pointer.value = next;
72
+ },
73
+ }),
74
+ ],
75
+ });
76
+ agentica.on("request", (event) => {
77
+ if (event.body.tools) {
78
+ event.body.tool_choice = "required";
79
+ }
80
+ });
81
+ let result;
82
+ for (let i = 0; i < retry; ++i) {
83
+ result = yield ctx.compiler.prisma({
84
+ files: (_c = (_b = pointer.value) === null || _b === void 0 ? void 0 : _b.files) !== null && _c !== void 0 ? _c : files,
85
+ });
86
+ if (result.type !== "failure")
87
+ break;
88
+ ctx.dispatch({
89
+ type: "prismaValidate",
90
+ schemas: files,
91
+ result,
92
+ step: (_e = (_d = ctx.state().analyze) === null || _d === void 0 ? void 0 : _d.step) !== null && _e !== void 0 ? _e : 0,
93
+ created_at: new Date().toISOString(),
94
+ });
95
+ yield agentica.conversate([
96
+ "The Prisma schema files have compilation errors that must be fixed. You MUST provide complete, corrected files.",
97
+ "",
98
+ "============================================== CURRENT FILES ==============================================",
99
+ "",
100
+ ...Object.entries((_g = (_f = pointer.value) === null || _f === void 0 ? void 0 : _f.files) !== null && _g !== void 0 ? _g : files).flatMap(([filename, content]) => [`### ${filename} ###`, content, ""]),
101
+ "",
102
+ "============================================== COMPILATION ERRORS ==============================================",
103
+ "",
104
+ result.reason,
105
+ "",
106
+ "============================================== REQUIREMENTS ==============================================",
107
+ "",
108
+ "CRITICAL: You must call the modifyPrismaSchemaFiles function with:",
109
+ "",
110
+ "1. **COMPLETE file contents** - Do NOT truncate or abbreviate any content",
111
+ "2. **ALL files** - Every file from the input must be included in the output",
112
+ "3. **Fixed errors** - Resolve all compilation errors shown above",
113
+ "4. **Preserved structure** - Keep all models, fields, relationships, and comments",
114
+ "5. **Proper syntax** - Ensure valid Prisma schema syntax",
115
+ "",
116
+ "IMPORTANT NOTES:",
117
+ "- Include the ENTIRE content of each file, not summaries or truncated versions",
118
+ "- Maintain all existing relationships between models",
119
+ "- Keep all field definitions, attributes, and indexes",
120
+ "- Preserve all comments and documentation",
121
+ "- Fix ONLY the compilation errors, don't make unnecessary changes",
122
+ "",
123
+ "Example of what NOT to do:",
124
+ "```",
125
+ "// ... (truncated for brevity)",
126
+ "// ... other fields and relationships",
127
+ "// ... unchanged ...",
128
+ "```",
129
+ "",
130
+ "You must provide the COMPLETE file content for each file.",
131
+ ].join("\n"));
132
+ if (i === retry - 1) {
133
+ throw new Error("Prisma schema compiler failed");
134
+ }
135
+ }
136
+ return Object.assign(Object.assign({}, result), { description: pointer.value.description });
137
+ });
138
+ }
139
+ function createApplication(props) {
140
+ (0, assertSchemaModel_1.assertSchemaModel)(props.model);
141
+ const application = collection[props.model];
142
+ return {
143
+ protocol: "class",
144
+ name: "Prisma Compiler",
145
+ application,
146
+ execute: {
147
+ modifyPrismaSchemaFiles: (next) => {
148
+ props.build(next);
149
+ },
150
+ },
151
+ };
152
+ }
153
+ const claude = {
154
+ model: "claude",
155
+ options: {
156
+ reference: true,
157
+ separate: null
158
+ },
159
+ functions: [
160
+ {
161
+ name: "modifyPrismaSchemaFiles",
162
+ parameters: {
163
+ description: " Contains files to fix and requires complete file contents in\nresponse\n\n------------------------------\n\nCurrent Type: {@link IModifyPrismaSchemaFilesProps}",
164
+ type: "object",
165
+ properties: {
166
+ files: {
167
+ description: "COMPLETE Prisma schema files with ALL content included.\n\nCRITICAL REQUIREMENTS:\n\n- Each file must contain the ENTIRE schema content\n- Do NOT truncate, abbreviate, or use placeholders like \"... unchanged ...\"\n- Include ALL models, fields, relationships, indexes, and comments\n- Maintain exact same file organization and naming\n\nFile organization patterns:\n\n- Main.prisma: Configuration, datasource, generators\n- Schema-XX-domain.prisma: Complete domain-specific models with ALL fields\n\nKey = filename (e.g., \"main.prisma\", \"schema-01-core.prisma\") Value =\nCOMPLETE file content (no truncation allowed)\n\n------------------------------\n\nDescription of the current {@link Recordstringstring} type:\n\n> Construct a type with a set of properties K of type T",
168
+ type: "object",
169
+ properties: {},
170
+ required: [],
171
+ additionalProperties: {
172
+ type: "string"
173
+ }
174
+ },
175
+ description: {
176
+ description: "Brief description of what was fixed or modified in the schema files. Should\nsummarize the changes made to resolve compilation errors.",
177
+ type: "string"
178
+ }
179
+ },
180
+ required: [
181
+ "files",
182
+ "description"
183
+ ],
184
+ additionalProperties: false,
185
+ $defs: {}
186
+ },
187
+ description: "Fixes compilation errors in Prisma schema files.\n\nCRITICAL: This function must return COMPLETE file contents, not truncated\nversions.\n\nResponsibilities:\n\n1. Analyze compilation errors in the provided schema files\n2. Fix all syntax and structural issues\n3. Return COMPLETE corrected files (no truncation or abbreviation)\n4. Preserve all existing models, relationships, and business logic\n5. Maintain proper cross-file references and dependencies",
188
+ validate: (() => { const _io0 = input => "object" === typeof input.files && null !== input.files && false === Array.isArray(input.files) && _io1(input.files) && "string" === typeof input.description; const _io1 = input => Object.keys(input).every(key => {
189
+ const value = input[key];
190
+ if (undefined === value)
191
+ return true;
192
+ return "string" === typeof value;
193
+ }); const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.files && null !== input.files && false === Array.isArray(input.files) || _report(_exceptionable, {
194
+ path: _path + ".files",
195
+ expected: "Record<string, string>",
196
+ value: input.files
197
+ })) && _vo1(input.files, _path + ".files", true && _exceptionable) || _report(_exceptionable, {
198
+ path: _path + ".files",
199
+ expected: "Record<string, string>",
200
+ value: input.files
201
+ }), "string" === typeof input.description || _report(_exceptionable, {
202
+ path: _path + ".description",
203
+ expected: "string",
204
+ value: input.description
205
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
206
+ const value = input[key];
207
+ if (undefined === value)
208
+ return true;
209
+ return "string" === typeof value || _report(_exceptionable, {
210
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
211
+ expected: "string",
212
+ value: value
213
+ });
214
+ }).every(flag => flag)].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
215
+ if (false === __is(input)) {
216
+ errors = [];
217
+ _report = __typia_transform__validateReport._validateReport(errors);
218
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
219
+ path: _path + "",
220
+ expected: "IModifyPrismaSchemaFilesProps",
221
+ value: input
222
+ })) && _vo0(input, _path + "", true) || _report(true, {
223
+ path: _path + "",
224
+ expected: "IModifyPrismaSchemaFilesProps",
225
+ value: input
226
+ }))(input, "$input", true);
227
+ const success = 0 === errors.length;
228
+ return success ? {
229
+ success,
230
+ data: input
231
+ } : {
232
+ success,
233
+ errors,
234
+ data: input
235
+ };
236
+ }
237
+ return {
238
+ success: true,
239
+ data: input
240
+ };
241
+ }; })()
242
+ }
243
+ ]
244
+ };
245
+ const collection = {
246
+ chatgpt: {
247
+ model: "chatgpt",
248
+ options: {
249
+ reference: true,
250
+ strict: false,
251
+ separate: null
252
+ },
253
+ functions: [
254
+ {
255
+ name: "modifyPrismaSchemaFiles",
256
+ parameters: {
257
+ description: " Contains files to fix and requires complete file contents in\nresponse\n\n------------------------------\n\nCurrent Type: {@link IModifyPrismaSchemaFilesProps}",
258
+ type: "object",
259
+ properties: {
260
+ files: {
261
+ description: "COMPLETE Prisma schema files with ALL content included.\n\nCRITICAL REQUIREMENTS:\n\n- Each file must contain the ENTIRE schema content\n- Do NOT truncate, abbreviate, or use placeholders like \"... unchanged ...\"\n- Include ALL models, fields, relationships, indexes, and comments\n- Maintain exact same file organization and naming\n\nFile organization patterns:\n\n- Main.prisma: Configuration, datasource, generators\n- Schema-XX-domain.prisma: Complete domain-specific models with ALL fields\n\nKey = filename (e.g., \"main.prisma\", \"schema-01-core.prisma\") Value =\nCOMPLETE file content (no truncation allowed)\n\n------------------------------\n\nDescription of the current {@link Recordstringstring} type:\n\n> Construct a type with a set of properties K of type T",
262
+ type: "object",
263
+ properties: {},
264
+ required: [],
265
+ additionalProperties: {
266
+ type: "string"
267
+ }
268
+ },
269
+ description: {
270
+ description: "Brief description of what was fixed or modified in the schema files. Should\nsummarize the changes made to resolve compilation errors.",
271
+ type: "string"
272
+ }
273
+ },
274
+ required: [
275
+ "files",
276
+ "description"
277
+ ],
278
+ additionalProperties: false,
279
+ $defs: {}
280
+ },
281
+ description: "Fixes compilation errors in Prisma schema files.\n\nCRITICAL: This function must return COMPLETE file contents, not truncated\nversions.\n\nResponsibilities:\n\n1. Analyze compilation errors in the provided schema files\n2. Fix all syntax and structural issues\n3. Return COMPLETE corrected files (no truncation or abbreviation)\n4. Preserve all existing models, relationships, and business logic\n5. Maintain proper cross-file references and dependencies",
282
+ validate: (() => { const _io0 = input => "object" === typeof input.files && null !== input.files && false === Array.isArray(input.files) && _io1(input.files) && "string" === typeof input.description; const _io1 = input => Object.keys(input).every(key => {
283
+ const value = input[key];
284
+ if (undefined === value)
285
+ return true;
286
+ return "string" === typeof value;
287
+ }); const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.files && null !== input.files && false === Array.isArray(input.files) || _report(_exceptionable, {
288
+ path: _path + ".files",
289
+ expected: "Record<string, string>",
290
+ value: input.files
291
+ })) && _vo1(input.files, _path + ".files", true && _exceptionable) || _report(_exceptionable, {
292
+ path: _path + ".files",
293
+ expected: "Record<string, string>",
294
+ value: input.files
295
+ }), "string" === typeof input.description || _report(_exceptionable, {
296
+ path: _path + ".description",
297
+ expected: "string",
298
+ value: input.description
299
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
300
+ const value = input[key];
301
+ if (undefined === value)
302
+ return true;
303
+ return "string" === typeof value || _report(_exceptionable, {
304
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
305
+ expected: "string",
306
+ value: value
307
+ });
308
+ }).every(flag => flag)].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
309
+ if (false === __is(input)) {
310
+ errors = [];
311
+ _report = __typia_transform__validateReport._validateReport(errors);
312
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
313
+ path: _path + "",
314
+ expected: "IModifyPrismaSchemaFilesProps",
315
+ value: input
316
+ })) && _vo0(input, _path + "", true) || _report(true, {
317
+ path: _path + "",
318
+ expected: "IModifyPrismaSchemaFilesProps",
319
+ value: input
320
+ }))(input, "$input", true);
321
+ const success = 0 === errors.length;
322
+ return success ? {
323
+ success,
324
+ data: input
325
+ } : {
326
+ success,
327
+ errors,
328
+ data: input
329
+ };
330
+ }
331
+ return {
332
+ success: true,
333
+ data: input
334
+ };
335
+ }; })()
336
+ }
337
+ ]
338
+ },
339
+ claude,
340
+ llama: claude,
341
+ deepseek: claude,
342
+ "3.1": claude,
343
+ "3.0": {
344
+ model: "3.0",
345
+ options: {
346
+ constraint: true,
347
+ recursive: 3,
348
+ separate: null
349
+ },
350
+ functions: [
351
+ {
352
+ name: "modifyPrismaSchemaFiles",
353
+ parameters: {
354
+ type: "object",
355
+ properties: {
356
+ files: {
357
+ type: "object",
358
+ properties: {},
359
+ required: [],
360
+ description: "COMPLETE Prisma schema files with ALL content included.\n\nCRITICAL REQUIREMENTS:\n\n- Each file must contain the ENTIRE schema content\n- Do NOT truncate, abbreviate, or use placeholders like \"... unchanged ...\"\n- Include ALL models, fields, relationships, indexes, and comments\n- Maintain exact same file organization and naming\n\nFile organization patterns:\n\n- Main.prisma: Configuration, datasource, generators\n- Schema-XX-domain.prisma: Complete domain-specific models with ALL fields\n\nKey = filename (e.g., \"main.prisma\", \"schema-01-core.prisma\") Value =\nCOMPLETE file content (no truncation allowed)\n\n------------------------------\n\nDescription of the current {@link Recordstringstring} type:\n\n> Construct a type with a set of properties K of type T",
361
+ additionalProperties: {
362
+ type: "string"
363
+ }
364
+ },
365
+ description: {
366
+ type: "string",
367
+ description: "Brief description of what was fixed or modified in the schema files. Should\nsummarize the changes made to resolve compilation errors."
368
+ }
369
+ },
370
+ required: [
371
+ "files",
372
+ "description"
373
+ ],
374
+ description: " Contains files to fix and requires complete file contents in\nresponse\n\n------------------------------\n\nCurrent Type: {@link IModifyPrismaSchemaFilesProps}",
375
+ additionalProperties: false
376
+ },
377
+ description: "Fixes compilation errors in Prisma schema files.\n\nCRITICAL: This function must return COMPLETE file contents, not truncated\nversions.\n\nResponsibilities:\n\n1. Analyze compilation errors in the provided schema files\n2. Fix all syntax and structural issues\n3. Return COMPLETE corrected files (no truncation or abbreviation)\n4. Preserve all existing models, relationships, and business logic\n5. Maintain proper cross-file references and dependencies",
378
+ validate: (() => { const _io0 = input => "object" === typeof input.files && null !== input.files && false === Array.isArray(input.files) && _io1(input.files) && "string" === typeof input.description; const _io1 = input => Object.keys(input).every(key => {
379
+ const value = input[key];
380
+ if (undefined === value)
381
+ return true;
382
+ return "string" === typeof value;
383
+ }); const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.files && null !== input.files && false === Array.isArray(input.files) || _report(_exceptionable, {
384
+ path: _path + ".files",
385
+ expected: "Record<string, string>",
386
+ value: input.files
387
+ })) && _vo1(input.files, _path + ".files", true && _exceptionable) || _report(_exceptionable, {
388
+ path: _path + ".files",
389
+ expected: "Record<string, string>",
390
+ value: input.files
391
+ }), "string" === typeof input.description || _report(_exceptionable, {
392
+ path: _path + ".description",
393
+ expected: "string",
394
+ value: input.description
395
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
396
+ const value = input[key];
397
+ if (undefined === value)
398
+ return true;
399
+ return "string" === typeof value || _report(_exceptionable, {
400
+ path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
401
+ expected: "string",
402
+ value: value
403
+ });
404
+ }).every(flag => flag)].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
405
+ if (false === __is(input)) {
406
+ errors = [];
407
+ _report = __typia_transform__validateReport._validateReport(errors);
408
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
409
+ path: _path + "",
410
+ expected: "IModifyPrismaSchemaFilesProps",
411
+ value: input
412
+ })) && _vo0(input, _path + "", true) || _report(true, {
413
+ path: _path + "",
414
+ expected: "IModifyPrismaSchemaFilesProps",
415
+ value: input
416
+ }))(input, "$input", true);
417
+ const success = 0 === errors.length;
418
+ return success ? {
419
+ success,
420
+ data: input
421
+ } : {
422
+ success,
423
+ errors,
424
+ data: input
425
+ };
426
+ }
427
+ return {
428
+ success: true,
429
+ data: input
430
+ };
431
+ }; })()
432
+ }
433
+ ]
434
+ },
435
+ };
436
+ //# sourceMappingURL=orchestratePrismaCompiler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestratePrismaCompiler.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/orchestratePrismaCompiler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,8DAgGC;;;AA1GD,yCAAoE;AAIpE,kDAA0B;AAG1B,uEAAoE;AACpE,yFAAsF;AAEtF,SAAsB,yBAAyB;yDAC7C,GAAyB,EACzB,KAA6B,EAC7B,QAAgB,EAAE;;QAElB,MAAM,OAAO,GAA4C;YACvD,KAAK,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE;SAClC,CAAC;QACF,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,mEAAgC,EAAC,GAAG,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC;YAC/D,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,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;Y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KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA8C;CACpD,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { AutoBeAssistantMessageHistory } from "@autobe/interface";
2
+ import { AutoBePrismaComponentsEvent } from "@autobe/interface/src/events/AutoBePrismaComponentsEvent";
3
+ import { ILlmSchema } from "@samchon/openapi";
4
+ import { AutoBeContext } from "../../context/AutoBeContext";
5
+ export declare function orchestratePrismaComponents<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, content?: string): Promise<AutoBeAssistantMessageHistory | AutoBePrismaComponentsEvent>;