@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,437 @@
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.orchestratePrismaComponents = orchestratePrismaComponents;
49
+ const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
50
+ const core_1 = require("@agentica/core");
51
+ const typia_1 = __importDefault(require("typia"));
52
+ const uuid_1 = require("uuid");
53
+ const assertSchemaModel_1 = require("../../context/assertSchemaModel");
54
+ const transformPrismaComponentsHistories_1 = require("./transformPrismaComponentsHistories");
55
+ function orchestratePrismaComponents(ctx_1) {
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;
58
+ const start = new Date();
59
+ const pointer = {
60
+ value: null,
61
+ };
62
+ const agentica = new core_1.MicroAgentica({
63
+ model: ctx.model,
64
+ vendor: ctx.vendor,
65
+ config: Object.assign({}, ((_a = ctx.config) !== null && _a !== void 0 ? _a : {})),
66
+ histories: (0, transformPrismaComponentsHistories_1.transformPrismaComponentsHistories)(ctx.state()),
67
+ tokenUsage: ctx.usage(),
68
+ controllers: [
69
+ createApplication({
70
+ model: ctx.model,
71
+ build: (next) => {
72
+ pointer.value = next;
73
+ },
74
+ }),
75
+ ],
76
+ });
77
+ const histories = yield agentica.conversate(content);
78
+ if (((_b = histories.at(-1)) === null || _b === void 0 ? void 0 : _b.type) === "assistantMessage")
79
+ return Object.assign(Object.assign({}, histories.at(-1)), { created_at: start.toISOString(), completed_at: new Date().toISOString(), id: (0, uuid_1.v4)() });
80
+ else if (pointer.value === null) {
81
+ throw new Error("Failed to extract files and tables."); // unreachable
82
+ }
83
+ return {
84
+ type: "prismaComponents",
85
+ created_at: start.toISOString(),
86
+ 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
+ };
89
+ });
90
+ }
91
+ function createApplication(props) {
92
+ (0, assertSchemaModel_1.assertSchemaModel)(props.model);
93
+ const application = collection[props.model];
94
+ return {
95
+ protocol: "class",
96
+ name: "Prisma Extract Files and Tables",
97
+ application,
98
+ execute: {
99
+ extractComponents: (next) => {
100
+ props.build(next);
101
+ },
102
+ },
103
+ };
104
+ }
105
+ const claude = {
106
+ model: "claude",
107
+ options: {
108
+ reference: true,
109
+ separate: null
110
+ },
111
+ functions: [
112
+ {
113
+ name: "extractComponents",
114
+ parameters: {
115
+ description: " - Configuration object containing the file-to-table mapping\nstructure\n\n------------------------------\n\nCurrent Type: {@link IExtractComponentsProps}",
116
+ type: "object",
117
+ properties: {
118
+ components: {
119
+ title: "Maps Prisma schema filenames to their contained database tables",
120
+ description: "Maps Prisma schema filenames to their contained database tables.\n\n**Structure:**\n\n- Key: Prisma schema filename with .prisma extension\n- Value: Array of table names defined in that file\n\n**Example:**\n\n```typescript\n{\n {\n filename: \"schema-01-users.prisma\",\n tables: [\"user\", \"user_profile\", \"user_settings\"]\n },\n {\n filename: \"schema-02-articles.prisma\",\n tables: [\"article\", \"article_snapshot\"]\n },\n {\n filename: \"schema-03-comments.prisma\",\n tables: [\"comment\", \"comment_like\"]\n }\n}\n```\n\n**Notes:**\n\n- Table names must match exact Prisma model names (case-sensitive)\n- Keep mapping synchronized with actual schema files\n- Use consistent naming convention for files",
121
+ type: "array",
122
+ items: {
123
+ description: "Current Type: {@link IComponent}",
124
+ type: "object",
125
+ properties: {
126
+ filename: {
127
+ type: "string"
128
+ },
129
+ tables: {
130
+ type: "array",
131
+ items: {
132
+ type: "string"
133
+ }
134
+ }
135
+ },
136
+ required: [
137
+ "filename",
138
+ "tables"
139
+ ]
140
+ }
141
+ }
142
+ },
143
+ required: [
144
+ "components"
145
+ ],
146
+ additionalProperties: false,
147
+ $defs: {}
148
+ },
149
+ description: "Extracts and organizes database schema files with their corresponding table\ndefinitions.\n\nProcesses Prisma schema files and maps each file to its contained database\ntables, enabling structured organization of schemas across multiple files\nfor large projects.",
150
+ validate: (() => { const _io0 = input => Array.isArray(input.components) && input.components.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.filename && (Array.isArray(input.tables) && input.tables.every(elem => "string" === typeof elem)); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.components) || _report(_exceptionable, {
151
+ path: _path + ".components",
152
+ expected: "Array<IComponent>",
153
+ value: input.components
154
+ })) && input.components.map((elem, _index3) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
155
+ path: _path + ".components[" + _index3 + "]",
156
+ expected: "IComponent",
157
+ value: elem
158
+ })) && _vo1(elem, _path + ".components[" + _index3 + "]", true && _exceptionable) || _report(_exceptionable, {
159
+ path: _path + ".components[" + _index3 + "]",
160
+ expected: "IComponent",
161
+ value: elem
162
+ })).every(flag => flag) || _report(_exceptionable, {
163
+ path: _path + ".components",
164
+ expected: "Array<IComponent>",
165
+ value: input.components
166
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.filename || _report(_exceptionable, {
167
+ path: _path + ".filename",
168
+ expected: "string",
169
+ value: input.filename
170
+ }), (Array.isArray(input.tables) || _report(_exceptionable, {
171
+ path: _path + ".tables",
172
+ expected: "Array<string>",
173
+ value: input.tables
174
+ })) && input.tables.map((elem, _index4) => "string" === typeof elem || _report(_exceptionable, {
175
+ path: _path + ".tables[" + _index4 + "]",
176
+ expected: "string",
177
+ value: elem
178
+ })).every(flag => flag) || _report(_exceptionable, {
179
+ path: _path + ".tables",
180
+ expected: "Array<string>",
181
+ value: input.tables
182
+ })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
183
+ if (false === __is(input)) {
184
+ errors = [];
185
+ _report = __typia_transform__validateReport._validateReport(errors);
186
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
187
+ path: _path + "",
188
+ expected: "IExtractComponentsProps",
189
+ value: input
190
+ })) && _vo0(input, _path + "", true) || _report(true, {
191
+ path: _path + "",
192
+ expected: "IExtractComponentsProps",
193
+ value: input
194
+ }))(input, "$input", true);
195
+ const success = 0 === errors.length;
196
+ return success ? {
197
+ success,
198
+ data: input
199
+ } : {
200
+ success,
201
+ errors,
202
+ data: input
203
+ };
204
+ }
205
+ return {
206
+ success: true,
207
+ data: input
208
+ };
209
+ }; })()
210
+ }
211
+ ]
212
+ };
213
+ const collection = {
214
+ chatgpt: {
215
+ model: "chatgpt",
216
+ options: {
217
+ reference: true,
218
+ strict: false,
219
+ separate: null
220
+ },
221
+ functions: [
222
+ {
223
+ name: "extractComponents",
224
+ parameters: {
225
+ description: " - Configuration object containing the file-to-table mapping\nstructure\n\n------------------------------\n\nCurrent Type: {@link IExtractComponentsProps}",
226
+ type: "object",
227
+ properties: {
228
+ components: {
229
+ title: "Maps Prisma schema filenames to their contained database tables",
230
+ description: "Maps Prisma schema filenames to their contained database tables.\n\n**Structure:**\n\n- Key: Prisma schema filename with .prisma extension\n- Value: Array of table names defined in that file\n\n**Example:**\n\n```typescript\n{\n {\n filename: \"schema-01-users.prisma\",\n tables: [\"user\", \"user_profile\", \"user_settings\"]\n },\n {\n filename: \"schema-02-articles.prisma\",\n tables: [\"article\", \"article_snapshot\"]\n },\n {\n filename: \"schema-03-comments.prisma\",\n tables: [\"comment\", \"comment_like\"]\n }\n}\n```\n\n**Notes:**\n\n- Table names must match exact Prisma model names (case-sensitive)\n- Keep mapping synchronized with actual schema files\n- Use consistent naming convention for files",
231
+ type: "array",
232
+ items: {
233
+ description: "Current Type: {@link IComponent}",
234
+ type: "object",
235
+ properties: {
236
+ filename: {
237
+ type: "string"
238
+ },
239
+ tables: {
240
+ type: "array",
241
+ items: {
242
+ type: "string"
243
+ }
244
+ }
245
+ },
246
+ required: [
247
+ "filename",
248
+ "tables"
249
+ ]
250
+ }
251
+ }
252
+ },
253
+ required: [
254
+ "components"
255
+ ],
256
+ additionalProperties: false,
257
+ $defs: {}
258
+ },
259
+ description: "Extracts and organizes database schema files with their corresponding table\ndefinitions.\n\nProcesses Prisma schema files and maps each file to its contained database\ntables, enabling structured organization of schemas across multiple files\nfor large projects.",
260
+ validate: (() => { const _io0 = input => Array.isArray(input.components) && input.components.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.filename && (Array.isArray(input.tables) && input.tables.every(elem => "string" === typeof elem)); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.components) || _report(_exceptionable, {
261
+ path: _path + ".components",
262
+ expected: "Array<IComponent>",
263
+ value: input.components
264
+ })) && input.components.map((elem, _index3) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
265
+ path: _path + ".components[" + _index3 + "]",
266
+ expected: "IComponent",
267
+ value: elem
268
+ })) && _vo1(elem, _path + ".components[" + _index3 + "]", true && _exceptionable) || _report(_exceptionable, {
269
+ path: _path + ".components[" + _index3 + "]",
270
+ expected: "IComponent",
271
+ value: elem
272
+ })).every(flag => flag) || _report(_exceptionable, {
273
+ path: _path + ".components",
274
+ expected: "Array<IComponent>",
275
+ value: input.components
276
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.filename || _report(_exceptionable, {
277
+ path: _path + ".filename",
278
+ expected: "string",
279
+ value: input.filename
280
+ }), (Array.isArray(input.tables) || _report(_exceptionable, {
281
+ path: _path + ".tables",
282
+ expected: "Array<string>",
283
+ value: input.tables
284
+ })) && input.tables.map((elem, _index4) => "string" === typeof elem || _report(_exceptionable, {
285
+ path: _path + ".tables[" + _index4 + "]",
286
+ expected: "string",
287
+ value: elem
288
+ })).every(flag => flag) || _report(_exceptionable, {
289
+ path: _path + ".tables",
290
+ expected: "Array<string>",
291
+ value: input.tables
292
+ })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
293
+ if (false === __is(input)) {
294
+ errors = [];
295
+ _report = __typia_transform__validateReport._validateReport(errors);
296
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
297
+ path: _path + "",
298
+ expected: "IExtractComponentsProps",
299
+ value: input
300
+ })) && _vo0(input, _path + "", true) || _report(true, {
301
+ path: _path + "",
302
+ expected: "IExtractComponentsProps",
303
+ value: input
304
+ }))(input, "$input", true);
305
+ const success = 0 === errors.length;
306
+ return success ? {
307
+ success,
308
+ data: input
309
+ } : {
310
+ success,
311
+ errors,
312
+ data: input
313
+ };
314
+ }
315
+ return {
316
+ success: true,
317
+ data: input
318
+ };
319
+ }; })()
320
+ }
321
+ ]
322
+ },
323
+ claude,
324
+ llama: claude,
325
+ deepseek: claude,
326
+ "3.1": claude,
327
+ "3.0": {
328
+ model: "3.0",
329
+ options: {
330
+ constraint: true,
331
+ recursive: 3,
332
+ separate: null
333
+ },
334
+ functions: [
335
+ {
336
+ name: "extractComponents",
337
+ parameters: {
338
+ type: "object",
339
+ properties: {
340
+ components: {
341
+ type: "array",
342
+ items: {
343
+ type: "object",
344
+ properties: {
345
+ filename: {
346
+ type: "string"
347
+ },
348
+ tables: {
349
+ type: "array",
350
+ items: {
351
+ type: "string"
352
+ }
353
+ }
354
+ },
355
+ required: [
356
+ "filename",
357
+ "tables"
358
+ ],
359
+ description: "Current Type: {@link IComponent}",
360
+ additionalProperties: false
361
+ },
362
+ title: "Maps Prisma schema filenames to their contained database tables",
363
+ description: "Maps Prisma schema filenames to their contained database tables.\n\n**Structure:**\n\n- Key: Prisma schema filename with .prisma extension\n- Value: Array of table names defined in that file\n\n**Example:**\n\n```typescript\n{\n {\n filename: \"schema-01-users.prisma\",\n tables: [\"user\", \"user_profile\", \"user_settings\"]\n },\n {\n filename: \"schema-02-articles.prisma\",\n tables: [\"article\", \"article_snapshot\"]\n },\n {\n filename: \"schema-03-comments.prisma\",\n tables: [\"comment\", \"comment_like\"]\n }\n}\n```\n\n**Notes:**\n\n- Table names must match exact Prisma model names (case-sensitive)\n- Keep mapping synchronized with actual schema files\n- Use consistent naming convention for files"
364
+ }
365
+ },
366
+ required: [
367
+ "components"
368
+ ],
369
+ description: " - Configuration object containing the file-to-table mapping\nstructure\n\n------------------------------\n\nCurrent Type: {@link IExtractComponentsProps}",
370
+ additionalProperties: false
371
+ },
372
+ description: "Extracts and organizes database schema files with their corresponding table\ndefinitions.\n\nProcesses Prisma schema files and maps each file to its contained database\ntables, enabling structured organization of schemas across multiple files\nfor large projects.",
373
+ validate: (() => { const _io0 = input => Array.isArray(input.components) && input.components.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.filename && (Array.isArray(input.tables) && input.tables.every(elem => "string" === typeof elem)); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.components) || _report(_exceptionable, {
374
+ path: _path + ".components",
375
+ expected: "Array<IComponent>",
376
+ value: input.components
377
+ })) && input.components.map((elem, _index3) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
378
+ path: _path + ".components[" + _index3 + "]",
379
+ expected: "IComponent",
380
+ value: elem
381
+ })) && _vo1(elem, _path + ".components[" + _index3 + "]", true && _exceptionable) || _report(_exceptionable, {
382
+ path: _path + ".components[" + _index3 + "]",
383
+ expected: "IComponent",
384
+ value: elem
385
+ })).every(flag => flag) || _report(_exceptionable, {
386
+ path: _path + ".components",
387
+ expected: "Array<IComponent>",
388
+ value: input.components
389
+ })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.filename || _report(_exceptionable, {
390
+ path: _path + ".filename",
391
+ expected: "string",
392
+ value: input.filename
393
+ }), (Array.isArray(input.tables) || _report(_exceptionable, {
394
+ path: _path + ".tables",
395
+ expected: "Array<string>",
396
+ value: input.tables
397
+ })) && input.tables.map((elem, _index4) => "string" === typeof elem || _report(_exceptionable, {
398
+ path: _path + ".tables[" + _index4 + "]",
399
+ expected: "string",
400
+ value: elem
401
+ })).every(flag => flag) || _report(_exceptionable, {
402
+ path: _path + ".tables",
403
+ expected: "Array<string>",
404
+ value: input.tables
405
+ })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
406
+ if (false === __is(input)) {
407
+ errors = [];
408
+ _report = __typia_transform__validateReport._validateReport(errors);
409
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
410
+ path: _path + "",
411
+ expected: "IExtractComponentsProps",
412
+ value: input
413
+ })) && _vo0(input, _path + "", true) || _report(true, {
414
+ path: _path + "",
415
+ expected: "IExtractComponentsProps",
416
+ value: input
417
+ }))(input, "$input", true);
418
+ const success = 0 === errors.length;
419
+ return success ? {
420
+ success,
421
+ data: input
422
+ } : {
423
+ success,
424
+ errors,
425
+ data: input
426
+ };
427
+ }
428
+ return {
429
+ success: true,
430
+ data: input
431
+ };
432
+ }; })()
433
+ }
434
+ ]
435
+ },
436
+ };
437
+ //# sourceMappingURL=orchestratePrismaComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestratePrismaComponent.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/orchestratePrismaComponent.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ import { AutoBePrismaSchemasEvent } from "@autobe/interface/src/events/AutoBePrismaSchemasEvent";
2
+ import { ILlmSchema } from "@samchon/openapi";
3
+ import { AutoBeContext } from "../../context/AutoBeContext";
4
+ export declare function orchestratePrismaSchemas<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, components: {
5
+ filename: string;
6
+ tables: string[];
7
+ }[]): Promise<AutoBePrismaSchemasEvent[]>;