@autobe/agent 0.3.24 → 0.4.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 (48) hide show
  1. package/lib/AutoBeAgent.d.ts +0 -7
  2. package/lib/AutoBeAgent.js +5 -5
  3. package/lib/AutoBeAgent.js.map +1 -1
  4. package/lib/constants/AutoBeSystemPromptConstant.d.ts +4 -4
  5. package/lib/factory/createAgenticaHistory.js +1 -1
  6. package/lib/factory/createAgenticaHistory.js.map +1 -1
  7. package/lib/factory/createAutoBeApplication.js +9 -9
  8. package/lib/factory/createAutoBeApplication.js.map +1 -1
  9. package/lib/index.d.ts +0 -4
  10. package/lib/index.mjs +3508 -504
  11. package/lib/index.mjs.map +1 -1
  12. package/lib/orchestrate/interface/transformInterfaceHistories.js +3 -3
  13. package/lib/orchestrate/interface/transformInterfaceHistories.js.map +1 -1
  14. package/lib/orchestrate/prisma/orchestratePrisma.js +13 -8
  15. package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  16. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +67 -26
  17. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  18. package/lib/orchestrate/prisma/orchestratePrismaCorrect.d.ts +4 -0
  19. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +2010 -0
  20. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -0
  21. package/lib/orchestrate/prisma/orchestratePrismaSchema.js +1649 -80
  22. package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -1
  23. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +1 -1
  24. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -1
  25. package/lib/orchestrate/prisma/transformPrismaCorrectHistories.d.ts +3 -0
  26. package/lib/orchestrate/prisma/{transformPrismaCompilerHistories.js → transformPrismaCorrectHistories.js} +11 -10
  27. package/lib/orchestrate/prisma/transformPrismaCorrectHistories.js.map +1 -0
  28. package/lib/orchestrate/prisma/transformPrismaHistories.js +1 -1
  29. package/lib/orchestrate/prisma/transformPrismaHistories.js.map +1 -1
  30. package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js +1 -1
  31. package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js.map +1 -1
  32. package/package.json +4 -4
  33. package/src/AutoBeAgent.ts +5 -5
  34. package/src/constants/AutoBeSystemPromptConstant.ts +4 -4
  35. package/src/factory/createAgenticaHistory.ts +1 -1
  36. package/src/factory/createAutoBeApplication.ts +9 -9
  37. package/src/orchestrate/interface/transformInterfaceHistories.ts +3 -3
  38. package/src/orchestrate/prisma/orchestratePrisma.ts +20 -12
  39. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +6 -3
  40. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +258 -0
  41. package/src/orchestrate/prisma/orchestratePrismaSchema.ts +16 -53
  42. package/src/orchestrate/prisma/{transformPrismaCompilerHistories.ts → transformPrismaCorrectHistories.ts} +10 -10
  43. package/lib/orchestrate/prisma/orchestratePrismaCompiler.d.ts +0 -4
  44. package/lib/orchestrate/prisma/orchestratePrismaCompiler.js +0 -443
  45. package/lib/orchestrate/prisma/orchestratePrismaCompiler.js.map +0 -1
  46. package/lib/orchestrate/prisma/transformPrismaCompilerHistories.d.ts +0 -3
  47. package/lib/orchestrate/prisma/transformPrismaCompilerHistories.js.map +0 -1
  48. package/src/orchestrate/prisma/orchestratePrismaCompiler.ts +0 -276
@@ -1,443 +0,0 @@
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 StringUtil_1 = require("../../utils/StringUtil");
55
- const transformPrismaCompilerHistories_1 = require("./transformPrismaCompilerHistories");
56
- function orchestratePrismaCompiler(ctx, files, retry = 8) {
57
- return step(ctx, files, retry);
58
- }
59
- function step(ctx, files, life) {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- var _a, _b, _c, _d, _e;
62
- // FIX MAIN PRISMA FILE
63
- files["main.prisma"] = MAIN_PRISMA_FILE;
64
- // TRY COMPILATION
65
- const result = yield ctx.compiler.prisma({
66
- files,
67
- });
68
- if (result.type !== "failure" || life <= 0)
69
- return result;
70
- // VALIDATION FAILED
71
- ctx.dispatch({
72
- type: "prismaValidate",
73
- schemas: files,
74
- result,
75
- step: (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
76
- created_at: new Date().toISOString(),
77
- });
78
- const pointer = {
79
- value: null,
80
- };
81
- const agentica = new core_1.MicroAgentica({
82
- model: ctx.model,
83
- vendor: ctx.vendor,
84
- config: Object.assign({}, ((_c = ctx.config) !== null && _c !== void 0 ? _c : {})),
85
- histories: (0, transformPrismaCompilerHistories_1.transformPrismaCompilerHistories)(files, result),
86
- tokenUsage: ctx.usage(),
87
- controllers: [
88
- createApplication({
89
- model: ctx.model,
90
- build: (next) => {
91
- pointer.value = next;
92
- },
93
- }),
94
- ],
95
- });
96
- agentica.on("request", (event) => {
97
- if (event.body.tools) {
98
- event.body.tool_choice = "required";
99
- }
100
- });
101
- // REQUEST CORRECTION
102
- yield agentica.conversate(StringUtil_1.StringUtil.trim `
103
- Resolve the compilation errors in the provided Prisma schema files.
104
-
105
- Don't remake every schema files. Fix only some of the files that have
106
- compilation errors. You MUST provide complete, corrected files.
107
- `);
108
- if (pointer.value === null) {
109
- console.error("Unreachable error: PrismaCompilerAgent.pointer.value is null");
110
- return result; // unreachable
111
- }
112
- ctx.dispatch({
113
- type: "prismaCorrect",
114
- input: files,
115
- failure: result,
116
- correction: pointer.value.files,
117
- planning: pointer.value.planning,
118
- step: (_e = (_d = ctx.state().analyze) === null || _d === void 0 ? void 0 : _d.step) !== null && _e !== void 0 ? _e : 0,
119
- created_at: new Date().toISOString(),
120
- });
121
- const newFiles = Object.assign(Object.assign({}, files), pointer.value.files);
122
- return step(ctx, newFiles, life - 1);
123
- });
124
- }
125
- function createApplication(props) {
126
- (0, assertSchemaModel_1.assertSchemaModel)(props.model);
127
- const application = collection[props.model];
128
- return {
129
- protocol: "class",
130
- name: "Prisma Compiler",
131
- application,
132
- execute: {
133
- modifyPrismaSchemaFiles: (next) => {
134
- props.build(next);
135
- },
136
- },
137
- };
138
- }
139
- const claude = {
140
- model: "claude",
141
- options: {
142
- reference: true,
143
- separate: null
144
- },
145
- functions: [
146
- {
147
- name: "modifyPrismaSchemaFiles",
148
- parameters: {
149
- description: "Current Type: {@link IModifyPrismaSchemaFilesProps}",
150
- type: "object",
151
- properties: {
152
- planning: {
153
- title: "Detailed execution plan for fixing Prisma compilation errors",
154
- description: "Detailed execution plan for fixing Prisma compilation errors.\n\n\uD83C\uDFAF Purpose: Enable systematic reasoning and step-by-step error resolution\napproach\n\n\uD83D\uDCCB Required Planning Content:\n\n1. **Error Analysis Summary**\n\n - List all identified compilation errors with their locations\n - Categorize errors by type (syntax, relationships, types, constraints)\n - Identify root causes and error interdependencies\n2. **Fix Strategy Overview**\n\n - Prioritize fixes based on dependencies (fix foundational errors first)\n - Outline minimal changes needed for each error\n - Identify potential impact on other schema parts\n3. **Step-by-Step Fix Plan**\n\n - File-by-file modification plan with specific changes\n - Exact line numbers or sections to be modified\n - New code additions or corrections to be applied\n - Verification steps to ensure fixes don't break other parts\n4. **Preservation Checklist**\n\n - Confirm which comments/documentation must be preserved\n - List relationships and business logic to maintain unchanged\n - Identify cross-file dependencies that must remain intact\n5. **Risk Assessment**\n\n - Potential side effects of each planned fix\n - Validation points to check after applying fixes\n - Rollback considerations if fixes introduce new issues\n\n\uD83D\uDCA1 Example Planning Structure:\n\n ## Error Analysis\n - Error 1: Missing foreign key field 'userId' in Post model (schema-02-posts.prisma:15)\n - Error 2: Invalid",
155
- type: "string"
156
- },
157
- files: {
158
- description: "Original Prisma schema files that contain compilation errors and need\ncorrection.\n\n\uD83D\uDCE5 Input Structure:\n\n- Key: filename (e.g., \"schema-01-users.prisma\")\n- Value: COMPLETE original file content with compilation errors\n\n\uD83D\uDD0D Expected Input File Types:\n\n- Domain-specific schema files: \"schema-XX-domain.prisma\" \u2192 Contains complete\n model definitions for specific business domains\n\n\uD83D\uDCDD Input File Content Analysis:\n\n- All models with their complete field definitions\n- All relationships (@relation directives with field mappings)\n- All indexes, constraints, and unique identifiers\n- All enums and their complete value sets\n- All comments and documentation\n- Cross-file model references and dependencies\n\n\u26A0\uFE0F Input Processing Notes:\n\n- Files may contain syntax errors, type mismatches, or missing references\n- Some models might reference non-existent fields or models\n- Relationship mappings might be incorrect or incomplete\n- Foreign key fields might be missing or incorrectly defined\n- Cross-file dependencies might be broken or circular\n\n------------------------------\n\nDescription of the current {@link Recordstringstring} type:\n\n> Construct a type with a set of properties K of type T",
159
- type: "object",
160
- properties: {},
161
- required: [],
162
- additionalProperties: {
163
- type: "string"
164
- }
165
- }
166
- },
167
- required: [
168
- "planning",
169
- "files"
170
- ],
171
- additionalProperties: false,
172
- $defs: {}
173
- },
174
- description: "Fixes Prisma compilation errors while preserving ALL existing comments,\ndocumentation, and schema structure.\n\n## Core Rules\n\n1. Fix ONLY compilation errors - never remove comments/documentation\n2. Apply minimal changes - preserve original design and relationships\n3. Return COMPLETE files - no truncation allowed\n4. NEVER use mapping names in",
175
- validate: (() => { const _io0 = input => "string" === typeof input.planning && ("object" === typeof input.files && null !== input.files && false === Array.isArray(input.files) && _io1(input.files)); const _io1 = input => Object.keys(input).every(key => {
176
- const value = input[key];
177
- if (undefined === value)
178
- return true;
179
- return "string" === typeof value;
180
- }); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.planning || _report(_exceptionable, {
181
- path: _path + ".planning",
182
- expected: "string",
183
- value: input.planning
184
- }), ("object" === typeof input.files && null !== input.files && false === Array.isArray(input.files) || _report(_exceptionable, {
185
- path: _path + ".files",
186
- expected: "Record<string, string>",
187
- value: input.files
188
- })) && _vo1(input.files, _path + ".files", true && _exceptionable) || _report(_exceptionable, {
189
- path: _path + ".files",
190
- expected: "Record<string, string>",
191
- value: input.files
192
- })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
193
- const value = input[key];
194
- if (undefined === value)
195
- return true;
196
- return "string" === typeof value || _report(_exceptionable, {
197
- path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
198
- expected: "string",
199
- value: value
200
- });
201
- }).every(flag => flag)].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
202
- if (false === __is(input)) {
203
- errors = [];
204
- _report = __typia_transform__validateReport._validateReport(errors);
205
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
206
- path: _path + "",
207
- expected: "IModifyPrismaSchemaFilesProps",
208
- value: input
209
- })) && _vo0(input, _path + "", true) || _report(true, {
210
- path: _path + "",
211
- expected: "IModifyPrismaSchemaFilesProps",
212
- value: input
213
- }))(input, "$input", true);
214
- const success = 0 === errors.length;
215
- return success ? {
216
- success,
217
- data: input
218
- } : {
219
- success,
220
- errors,
221
- data: input
222
- };
223
- }
224
- return {
225
- success: true,
226
- data: input
227
- };
228
- }; })()
229
- }
230
- ]
231
- };
232
- const collection = {
233
- chatgpt: {
234
- model: "chatgpt",
235
- options: {
236
- reference: true,
237
- strict: false,
238
- separate: null
239
- },
240
- functions: [
241
- {
242
- name: "modifyPrismaSchemaFiles",
243
- parameters: {
244
- description: "Current Type: {@link IModifyPrismaSchemaFilesProps}",
245
- type: "object",
246
- properties: {
247
- planning: {
248
- title: "Detailed execution plan for fixing Prisma compilation errors",
249
- description: "Detailed execution plan for fixing Prisma compilation errors.\n\n\uD83C\uDFAF Purpose: Enable systematic reasoning and step-by-step error resolution\napproach\n\n\uD83D\uDCCB Required Planning Content:\n\n1. **Error Analysis Summary**\n\n - List all identified compilation errors with their locations\n - Categorize errors by type (syntax, relationships, types, constraints)\n - Identify root causes and error interdependencies\n2. **Fix Strategy Overview**\n\n - Prioritize fixes based on dependencies (fix foundational errors first)\n - Outline minimal changes needed for each error\n - Identify potential impact on other schema parts\n3. **Step-by-Step Fix Plan**\n\n - File-by-file modification plan with specific changes\n - Exact line numbers or sections to be modified\n - New code additions or corrections to be applied\n - Verification steps to ensure fixes don't break other parts\n4. **Preservation Checklist**\n\n - Confirm which comments/documentation must be preserved\n - List relationships and business logic to maintain unchanged\n - Identify cross-file dependencies that must remain intact\n5. **Risk Assessment**\n\n - Potential side effects of each planned fix\n - Validation points to check after applying fixes\n - Rollback considerations if fixes introduce new issues\n\n\uD83D\uDCA1 Example Planning Structure:\n\n ## Error Analysis\n - Error 1: Missing foreign key field 'userId' in Post model (schema-02-posts.prisma:15)\n - Error 2: Invalid",
250
- type: "string"
251
- },
252
- files: {
253
- description: "Original Prisma schema files that contain compilation errors and need\ncorrection.\n\n\uD83D\uDCE5 Input Structure:\n\n- Key: filename (e.g., \"schema-01-users.prisma\")\n- Value: COMPLETE original file content with compilation errors\n\n\uD83D\uDD0D Expected Input File Types:\n\n- Domain-specific schema files: \"schema-XX-domain.prisma\" \u2192 Contains complete\n model definitions for specific business domains\n\n\uD83D\uDCDD Input File Content Analysis:\n\n- All models with their complete field definitions\n- All relationships (@relation directives with field mappings)\n- All indexes, constraints, and unique identifiers\n- All enums and their complete value sets\n- All comments and documentation\n- Cross-file model references and dependencies\n\n\u26A0\uFE0F Input Processing Notes:\n\n- Files may contain syntax errors, type mismatches, or missing references\n- Some models might reference non-existent fields or models\n- Relationship mappings might be incorrect or incomplete\n- Foreign key fields might be missing or incorrectly defined\n- Cross-file dependencies might be broken or circular\n\n------------------------------\n\nDescription of the current {@link Recordstringstring} type:\n\n> Construct a type with a set of properties K of type T",
254
- type: "object",
255
- properties: {},
256
- required: [],
257
- additionalProperties: {
258
- type: "string"
259
- }
260
- }
261
- },
262
- required: [
263
- "planning",
264
- "files"
265
- ],
266
- additionalProperties: false,
267
- $defs: {}
268
- },
269
- description: "Fixes Prisma compilation errors while preserving ALL existing comments,\ndocumentation, and schema structure.\n\n## Core Rules\n\n1. Fix ONLY compilation errors - never remove comments/documentation\n2. Apply minimal changes - preserve original design and relationships\n3. Return COMPLETE files - no truncation allowed\n4. NEVER use mapping names in",
270
- validate: (() => { const _io0 = input => "string" === typeof input.planning && ("object" === typeof input.files && null !== input.files && false === Array.isArray(input.files) && _io1(input.files)); const _io1 = input => Object.keys(input).every(key => {
271
- const value = input[key];
272
- if (undefined === value)
273
- return true;
274
- return "string" === typeof value;
275
- }); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.planning || _report(_exceptionable, {
276
- path: _path + ".planning",
277
- expected: "string",
278
- value: input.planning
279
- }), ("object" === typeof input.files && null !== input.files && false === Array.isArray(input.files) || _report(_exceptionable, {
280
- path: _path + ".files",
281
- expected: "Record<string, string>",
282
- value: input.files
283
- })) && _vo1(input.files, _path + ".files", true && _exceptionable) || _report(_exceptionable, {
284
- path: _path + ".files",
285
- expected: "Record<string, string>",
286
- value: input.files
287
- })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
288
- const value = input[key];
289
- if (undefined === value)
290
- return true;
291
- return "string" === typeof value || _report(_exceptionable, {
292
- path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
293
- expected: "string",
294
- value: value
295
- });
296
- }).every(flag => flag)].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
297
- if (false === __is(input)) {
298
- errors = [];
299
- _report = __typia_transform__validateReport._validateReport(errors);
300
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
301
- path: _path + "",
302
- expected: "IModifyPrismaSchemaFilesProps",
303
- value: input
304
- })) && _vo0(input, _path + "", true) || _report(true, {
305
- path: _path + "",
306
- expected: "IModifyPrismaSchemaFilesProps",
307
- value: input
308
- }))(input, "$input", true);
309
- const success = 0 === errors.length;
310
- return success ? {
311
- success,
312
- data: input
313
- } : {
314
- success,
315
- errors,
316
- data: input
317
- };
318
- }
319
- return {
320
- success: true,
321
- data: input
322
- };
323
- }; })()
324
- }
325
- ]
326
- },
327
- claude,
328
- llama: claude,
329
- deepseek: claude,
330
- "3.1": claude,
331
- "3.0": {
332
- model: "3.0",
333
- options: {
334
- constraint: true,
335
- recursive: 3,
336
- separate: null
337
- },
338
- functions: [
339
- {
340
- name: "modifyPrismaSchemaFiles",
341
- parameters: {
342
- type: "object",
343
- properties: {
344
- planning: {
345
- type: "string",
346
- title: "Detailed execution plan for fixing Prisma compilation errors",
347
- description: "Detailed execution plan for fixing Prisma compilation errors.\n\n\uD83C\uDFAF Purpose: Enable systematic reasoning and step-by-step error resolution\napproach\n\n\uD83D\uDCCB Required Planning Content:\n\n1. **Error Analysis Summary**\n\n - List all identified compilation errors with their locations\n - Categorize errors by type (syntax, relationships, types, constraints)\n - Identify root causes and error interdependencies\n2. **Fix Strategy Overview**\n\n - Prioritize fixes based on dependencies (fix foundational errors first)\n - Outline minimal changes needed for each error\n - Identify potential impact on other schema parts\n3. **Step-by-Step Fix Plan**\n\n - File-by-file modification plan with specific changes\n - Exact line numbers or sections to be modified\n - New code additions or corrections to be applied\n - Verification steps to ensure fixes don't break other parts\n4. **Preservation Checklist**\n\n - Confirm which comments/documentation must be preserved\n - List relationships and business logic to maintain unchanged\n - Identify cross-file dependencies that must remain intact\n5. **Risk Assessment**\n\n - Potential side effects of each planned fix\n - Validation points to check after applying fixes\n - Rollback considerations if fixes introduce new issues\n\n\uD83D\uDCA1 Example Planning Structure:\n\n ## Error Analysis\n - Error 1: Missing foreign key field 'userId' in Post model (schema-02-posts.prisma:15)\n - Error 2: Invalid"
348
- },
349
- files: {
350
- type: "object",
351
- properties: {},
352
- required: [],
353
- description: "Original Prisma schema files that contain compilation errors and need\ncorrection.\n\n\uD83D\uDCE5 Input Structure:\n\n- Key: filename (e.g., \"schema-01-users.prisma\")\n- Value: COMPLETE original file content with compilation errors\n\n\uD83D\uDD0D Expected Input File Types:\n\n- Domain-specific schema files: \"schema-XX-domain.prisma\" \u2192 Contains complete\n model definitions for specific business domains\n\n\uD83D\uDCDD Input File Content Analysis:\n\n- All models with their complete field definitions\n- All relationships (@relation directives with field mappings)\n- All indexes, constraints, and unique identifiers\n- All enums and their complete value sets\n- All comments and documentation\n- Cross-file model references and dependencies\n\n\u26A0\uFE0F Input Processing Notes:\n\n- Files may contain syntax errors, type mismatches, or missing references\n- Some models might reference non-existent fields or models\n- Relationship mappings might be incorrect or incomplete\n- Foreign key fields might be missing or incorrectly defined\n- Cross-file dependencies might be broken or circular\n\n------------------------------\n\nDescription of the current {@link Recordstringstring} type:\n\n> Construct a type with a set of properties K of type T",
354
- additionalProperties: {
355
- type: "string"
356
- }
357
- }
358
- },
359
- required: [
360
- "planning",
361
- "files"
362
- ],
363
- description: "Current Type: {@link IModifyPrismaSchemaFilesProps}",
364
- additionalProperties: false
365
- },
366
- description: "Fixes Prisma compilation errors while preserving ALL existing comments,\ndocumentation, and schema structure.\n\n## Core Rules\n\n1. Fix ONLY compilation errors - never remove comments/documentation\n2. Apply minimal changes - preserve original design and relationships\n3. Return COMPLETE files - no truncation allowed\n4. NEVER use mapping names in",
367
- validate: (() => { const _io0 = input => "string" === typeof input.planning && ("object" === typeof input.files && null !== input.files && false === Array.isArray(input.files) && _io1(input.files)); const _io1 = input => Object.keys(input).every(key => {
368
- const value = input[key];
369
- if (undefined === value)
370
- return true;
371
- return "string" === typeof value;
372
- }); const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.planning || _report(_exceptionable, {
373
- path: _path + ".planning",
374
- expected: "string",
375
- value: input.planning
376
- }), ("object" === typeof input.files && null !== input.files && false === Array.isArray(input.files) || _report(_exceptionable, {
377
- path: _path + ".files",
378
- expected: "Record<string, string>",
379
- value: input.files
380
- })) && _vo1(input.files, _path + ".files", true && _exceptionable) || _report(_exceptionable, {
381
- path: _path + ".files",
382
- expected: "Record<string, string>",
383
- value: input.files
384
- })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
385
- const value = input[key];
386
- if (undefined === value)
387
- return true;
388
- return "string" === typeof value || _report(_exceptionable, {
389
- path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
390
- expected: "string",
391
- value: value
392
- });
393
- }).every(flag => flag)].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
394
- if (false === __is(input)) {
395
- errors = [];
396
- _report = __typia_transform__validateReport._validateReport(errors);
397
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
398
- path: _path + "",
399
- expected: "IModifyPrismaSchemaFilesProps",
400
- value: input
401
- })) && _vo0(input, _path + "", true) || _report(true, {
402
- path: _path + "",
403
- expected: "IModifyPrismaSchemaFilesProps",
404
- value: input
405
- }))(input, "$input", true);
406
- const success = 0 === errors.length;
407
- return success ? {
408
- success,
409
- data: input
410
- } : {
411
- success,
412
- errors,
413
- data: input
414
- };
415
- }
416
- return {
417
- success: true,
418
- data: input
419
- };
420
- }; })()
421
- }
422
- ]
423
- },
424
- };
425
- const MAIN_PRISMA_FILE = StringUtil_1.StringUtil.trim `
426
- generator client {
427
- provider = "prisma-client-js"
428
- previewFeatures = ["postgresqlExtensions", "views"]
429
- binaryTargets = ["native"]
430
- }
431
-
432
- datasource db {
433
- provider = "postgresql"
434
- url = env("DATABASE_URL")
435
- extensions = []
436
- }
437
-
438
- generator markdown {
439
- provider = "prisma-markdown"
440
- output = "../docs/ERD.md"
441
- }
442
- `;
443
- //# sourceMappingURL=orchestratePrismaCompiler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orchestratePrismaCompiler.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/orchestratePrismaCompiler.ts"],"names":[],"mappings":";;;;;;;;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BAAiB,CAAiC,KAG1D;IACC,IAAA,qCAAiB,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/B,MAAM,WAAW,GAA2B,UAAU,CACpD,KAAK,CAAC,KAAK,CACyB,CAAC;IACvC,OAAO;QACL,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,iBAAiB;QACvB,WAAW;QACX,OAAO,EAAE;YACP,uBAAuB,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACpB,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;AAyHF,MAAM,gBAAgB,GAAG,uBAAU,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;CAiBvC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { IAgenticaHistoryJson } from "@agentica/core";
2
- import { IAutoBePrismaCompilerResult } from "@autobe/interface";
3
- export declare const transformPrismaCompilerHistories: (files: Record<string, string>, result: IAutoBePrismaCompilerResult.IFailure) => Array<IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformPrismaCompilerHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/transformPrismaCompilerHistories.ts"],"names":[],"mappings":";;;AAKO,MAAM,gCAAgC,GAAG,CAC9C,KAA6B,EAC7B,MAA4C,EAG5C,EAAE;IACF,OAAO;QACL;YACE,IAAI,EAAE,eAAe;YACrB,IAAI,u4TAA4C;SACjD;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,6DAA6D;gBAC7D,EAAE;gBACF,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;gBACrB,KAAK;aACN,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,iEAAiE;gBACjE,gCAAgC;gBAChC,EAAE;gBACF,MAAM,CAAC,MAAM;aACd,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,gCAAgC,oCAyC3C"}