@autobe/agent
Version:
AI backend server code generator
621 lines (618 loc) • 43.4 kB
JavaScript
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.orchestrateInterfaceGroup = orchestrateInterfaceGroup;
const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
const __typia_transform__llmApplicationFinalize = __importStar(require("typia/lib/internal/_llmApplicationFinalize.js"));
const utils_1 = require("@autobe/utils");
const typia_1 = __importDefault(require("typia"));
const uuid_1 = require("uuid");
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
const transformInterfaceGroupHistory_1 = require("./histories/transformInterfaceGroupHistory");
function orchestrateInterfaceGroup(ctx, props) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b;
const start = new Date();
const pointer = {
value: null,
};
const prisma = ctx.state().prisma;
const { metric, tokenUsage } = yield ctx.conversate(Object.assign({ source: SOURCE, controller: createController({
model: ctx.model,
build: (next) => {
pointer.value = next;
},
prismaSchemas: new Set(prisma !== null
? prisma.result.data.files
.map((f) => f.models)
.flat()
.map((m) => m.name)
: []),
}), enforceFunctionCall: true }, (0, transformInterfaceGroupHistory_1.transformInterfaceGroupHistory)({
state: ctx.state(),
instruction: props.instruction,
})));
if (pointer.value === null)
throw new Error("Failed to generate endpoint groups."); // unreachable
return {
type: SOURCE,
id: (0, uuid_1.v7)(),
created_at: start.toISOString(),
groups: pointer.value.groups,
metric,
tokenUsage,
step: (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
};
});
}
function createController(props) {
(0, assertSchemaModel_1.assertSchemaModel)(props.model);
const validate = (input) => {
const result = (() => { const _io0 = input => Array.isArray(input.groups) && (1 <= input.groups.length && input.groups.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = input => "string" === typeof input.name && "string" === typeof input.description && (Array.isArray(input.prismaSchemas) && input.prismaSchemas.every(elem => "string" === typeof elem)); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.groups) || _report(_exceptionable, {
path: _path + ".groups",
expected: "(Array<AutoBeInterfaceGroup> & MinItems<1>)",
value: input.groups
})) && ((1 <= input.groups.length || _report(_exceptionable, {
path: _path + ".groups",
expected: "Array<> & MinItems<1>",
value: input.groups
})) && input.groups.map((elem, _index3) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
path: _path + ".groups[" + _index3 + "]",
expected: "AutoBeInterfaceGroup",
value: elem
})) && _vo1(elem, _path + ".groups[" + _index3 + "]", true && _exceptionable) || _report(_exceptionable, {
path: _path + ".groups[" + _index3 + "]",
expected: "AutoBeInterfaceGroup",
value: elem
})).every(flag => flag)) || _report(_exceptionable, {
path: _path + ".groups",
expected: "(Array<AutoBeInterfaceGroup> & MinItems<1>)",
value: input.groups
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
path: _path + ".name",
expected: "string",
value: input.name
}), "string" === typeof input.description || _report(_exceptionable, {
path: _path + ".description",
expected: "string",
value: input.description
}), (Array.isArray(input.prismaSchemas) || _report(_exceptionable, {
path: _path + ".prismaSchemas",
expected: "Array<string>",
value: input.prismaSchemas
})) && input.prismaSchemas.map((elem, _index4) => "string" === typeof elem || _report(_exceptionable, {
path: _path + ".prismaSchemas[" + _index4 + "]",
expected: "string",
value: elem
})).every(flag => flag) || _report(_exceptionable, {
path: _path + ".prismaSchemas",
expected: "Array<string>",
value: input.prismaSchemas
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
if (false === __is(input)) {
errors = [];
_report = __typia_transform__validateReport._validateReport(errors);
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
path: _path + "",
expected: "IAutoBeInterfaceGroupApplication.IProps",
value: input
})) && _vo0(input, _path + "", true) || _report(true, {
path: _path + "",
expected: "IAutoBeInterfaceGroupApplication.IProps",
value: input
}))(input, "$input", true);
const success = 0 === errors.length;
return success ? {
success,
data: input
} : {
success,
errors,
data: input
};
}
return {
success: true,
data: input
};
}; })()(input);
if (result.success === false)
return result;
const errors = [];
result.data.groups.forEach((group, i) => {
group.prismaSchemas.forEach((key, j) => {
if (props.prismaSchemas.has(key) === false)
errors.push({
expected: Array.from(props.prismaSchemas)
.map((s) => JSON.stringify(s))
.join(" | "),
value: key,
path: `groups[${i}].prismaSchemas[${j}]`,
description: utils_1.StringUtil.trim `
The Prisma schema "${key}" does not exist in the current project.
Make sure to provide only the valid Prisma schema names that are present in your project.
Here is the list of available Prisma schemas in the project:
${Array.from(props.prismaSchemas)
.map((s) => `- ${s}`)
.join("\n")}
`,
});
});
});
return errors.length === 0
? result
: {
success: false,
data: result.data,
errors,
};
};
const application = collection[props.model === "chatgpt"
? "chatgpt"
: props.model === "gemini"
? "gemini"
: "claude"](validate);
return {
protocol: "class",
name: SOURCE,
application,
execute: {
makeGroups: (next) => {
props.build(next);
},
},
};
}
const collection = {
chatgpt: (validate) => (() => {
const application = {
model: "chatgpt",
options: {
reference: true,
strict: false,
separate: null
},
functions: [
{
name: "makeGroups",
parameters: {
description: " Properties containing the groups to be created for API\norganization\n\n------------------------------\n\nCurrent Type: {@link IAutoBeInterfaceGroupApplication.IProps}",
type: "object",
properties: {
groups: {
description: "Array of API endpoint groups for organizing development.\n\nDO: Organize groups around existing Prisma schema structure. DO: Provide\ncomplete coverage of all entities and requirements without overlap.\n\n\n@minItems 1",
type: "array",
items: {
$ref: "#/$defs/AutoBeInterfaceGroup"
}
}
},
required: [
"groups"
],
additionalProperties: false,
$defs: {
AutoBeInterfaceGroup: {
description: "Interface representing a logical grouping of API endpoints based on Prisma\nschema structure.\n\nThis interface defines organizational units used by the Interface agent to\nmanage API endpoint generation for large-scale projects. Each group\nrepresents a cohesive collection of database entities and their associated\nAPI operations, derived directly from the Prisma schema organization rather\nthan arbitrary business domains.\n\nGroups serve as the foundational organizing principle for:\n\n- Dividing large API specifications into manageable generation cycles\n- Maintaining alignment between API structure and database schema\n- Ensuring complete coverage of all database entities\n- Facilitating modular and scalable API development\n\nThe group structure must strictly follow Prisma schema organization patterns\nsuch as namespaces, file boundaries, or table prefix conventions to ensure\nconsistency between the data model and API design.",
type: "object",
properties: {
name: {
description: "Name identifier for the API endpoint group.\n\nThis name must be derived from the Prisma schema structure following these\npriorities:\n\n1. Prisma namespace names (e.g., `namespace Shopping` \u2192 \"Shopping\")\n2. Schema file names (e.g., `shopping.prisma` \u2192 \"Shopping\")\n3. Table prefix patterns (e.g., `shopping_*` tables \u2192 \"Shopping\")\n\nNames should use PascalCase format and range from 3-50 characters.\nExamples: \"Shopping\", \"BBS\", \"UserManagement\", \"PaymentProcessing\"",
type: "string"
},
description: {
description: "Comprehensive description of the API endpoint group's scope and purpose.\n\nThe description must include:\n\n- Schema foundation (namespace, file, or prefix pattern)\n- Specific database entities (table names) covered by this group\n- Functional operations and workflows supported\n- Relationships between entities within the group\n- How requirements map to these schema entities\n\nDescriptions should be 100-2000 characters and focus on concrete schema\nelements rather than abstract business concepts.",
type: "string"
},
prismaSchemas: {
description: "List of Prisma schema model names required for implementing endpoints in\nthis group.\n\nThis field pre-identifies all database models that are relevant to this\nendpoint group, reducing the cognitive load on the endpoint generation\nagent and enabling more comprehensive endpoint coverage.\n\nThe AI analyzes requirements during group definition phase to determine\nwhich Prisma models are needed for complete API functionality within this\ngroup's domain.\n\nSelection Guidelines:\n\n- Include ALL models that users directly interact with in this domain\n- Include related models needed for complete CRUD operations\n- Include parent/child models for nested endpoint support\n- Include snapshot models if the domain handles versioned data\n- Be thorough - better to include extra models than miss required ones\n\nWhat NOT to Include:\n\n- System-internal tables (audit_logs, system_metrics)\n- Pure cache tables (temporary_cache, session_cache)\n- Framework tables (migrations, schema_versions)",
type: "array",
items: {
type: "string"
}
}
},
required: [
"name",
"description",
"prismaSchemas"
]
}
}
},
description: "Generate logical groups for organizing API endpoint creation based on\nPrisma schema structure.\n\nDO: Derive groups from Prisma schema organization (namespaces, file\nstructure, table prefixes) rather than arbitrary business domains. DO:\nCreate new groups only when existing schema structure cannot adequately\ncover all requirements.",
validate: (() => { const _io0 = input => Array.isArray(input.groups) && (1 <= input.groups.length && input.groups.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = input => "string" === typeof input.name && "string" === typeof input.description && (Array.isArray(input.prismaSchemas) && input.prismaSchemas.every(elem => "string" === typeof elem)); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.groups) || _report(_exceptionable, {
path: _path + ".groups",
expected: "(Array<AutoBeInterfaceGroup> & MinItems<1>)",
value: input.groups
})) && ((1 <= input.groups.length || _report(_exceptionable, {
path: _path + ".groups",
expected: "Array<> & MinItems<1>",
value: input.groups
})) && input.groups.map((elem, _index3) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
path: _path + ".groups[" + _index3 + "]",
expected: "AutoBeInterfaceGroup",
value: elem
})) && _vo1(elem, _path + ".groups[" + _index3 + "]", true && _exceptionable) || _report(_exceptionable, {
path: _path + ".groups[" + _index3 + "]",
expected: "AutoBeInterfaceGroup",
value: elem
})).every(flag => flag)) || _report(_exceptionable, {
path: _path + ".groups",
expected: "(Array<AutoBeInterfaceGroup> & MinItems<1>)",
value: input.groups
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
path: _path + ".name",
expected: "string",
value: input.name
}), "string" === typeof input.description || _report(_exceptionable, {
path: _path + ".description",
expected: "string",
value: input.description
}), (Array.isArray(input.prismaSchemas) || _report(_exceptionable, {
path: _path + ".prismaSchemas",
expected: "Array<string>",
value: input.prismaSchemas
})) && input.prismaSchemas.map((elem, _index4) => "string" === typeof elem || _report(_exceptionable, {
path: _path + ".prismaSchemas[" + _index4 + "]",
expected: "string",
value: elem
})).every(flag => flag) || _report(_exceptionable, {
path: _path + ".prismaSchemas",
expected: "Array<string>",
value: input.prismaSchemas
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
if (false === __is(input)) {
errors = [];
_report = __typia_transform__validateReport._validateReport(errors);
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
path: _path + "",
expected: "IAutoBeInterfaceGroupApplication.IProps",
value: input
})) && _vo0(input, _path + "", true) || _report(true, {
path: _path + "",
expected: "IAutoBeInterfaceGroupApplication.IProps",
value: input
}))(input, "$input", true);
const success = 0 === errors.length;
return success ? {
success,
data: input
} : {
success,
errors,
data: input
};
}
return {
success: true,
data: input
};
}; })()
}
]
};
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, Object.assign(Object.assign({}, {
validate: {
makeGroups: validate,
},
}), { equals: false }));
return application;
})(),
claude: (validate) => (() => {
const application = {
model: "claude",
options: {
reference: true,
separate: null
},
functions: [
{
name: "makeGroups",
parameters: {
description: " Properties containing the groups to be created for API\norganization\n\n------------------------------\n\nCurrent Type: {@link IAutoBeInterfaceGroupApplication.IProps}",
type: "object",
properties: {
groups: {
description: "Array of API endpoint groups for organizing development.\n\nDO: Organize groups around existing Prisma schema structure. DO: Provide\ncomplete coverage of all entities and requirements without overlap.",
type: "array",
items: {
$ref: "#/$defs/AutoBeInterfaceGroup"
},
minItems: 1
}
},
required: [
"groups"
],
additionalProperties: false,
$defs: {
AutoBeInterfaceGroup: {
description: "Interface representing a logical grouping of API endpoints based on Prisma\nschema structure.\n\nThis interface defines organizational units used by the Interface agent to\nmanage API endpoint generation for large-scale projects. Each group\nrepresents a cohesive collection of database entities and their associated\nAPI operations, derived directly from the Prisma schema organization rather\nthan arbitrary business domains.\n\nGroups serve as the foundational organizing principle for:\n\n- Dividing large API specifications into manageable generation cycles\n- Maintaining alignment between API structure and database schema\n- Ensuring complete coverage of all database entities\n- Facilitating modular and scalable API development\n\nThe group structure must strictly follow Prisma schema organization patterns\nsuch as namespaces, file boundaries, or table prefix conventions to ensure\nconsistency between the data model and API design.",
type: "object",
properties: {
name: {
description: "Name identifier for the API endpoint group.\n\nThis name must be derived from the Prisma schema structure following these\npriorities:\n\n1. Prisma namespace names (e.g., `namespace Shopping` \u2192 \"Shopping\")\n2. Schema file names (e.g., `shopping.prisma` \u2192 \"Shopping\")\n3. Table prefix patterns (e.g., `shopping_*` tables \u2192 \"Shopping\")\n\nNames should use PascalCase format and range from 3-50 characters.\nExamples: \"Shopping\", \"BBS\", \"UserManagement\", \"PaymentProcessing\"",
type: "string"
},
description: {
description: "Comprehensive description of the API endpoint group's scope and purpose.\n\nThe description must include:\n\n- Schema foundation (namespace, file, or prefix pattern)\n- Specific database entities (table names) covered by this group\n- Functional operations and workflows supported\n- Relationships between entities within the group\n- How requirements map to these schema entities\n\nDescriptions should be 100-2000 characters and focus on concrete schema\nelements rather than abstract business concepts.",
type: "string"
},
prismaSchemas: {
description: "List of Prisma schema model names required for implementing endpoints in\nthis group.\n\nThis field pre-identifies all database models that are relevant to this\nendpoint group, reducing the cognitive load on the endpoint generation\nagent and enabling more comprehensive endpoint coverage.\n\nThe AI analyzes requirements during group definition phase to determine\nwhich Prisma models are needed for complete API functionality within this\ngroup's domain.\n\nSelection Guidelines:\n\n- Include ALL models that users directly interact with in this domain\n- Include related models needed for complete CRUD operations\n- Include parent/child models for nested endpoint support\n- Include snapshot models if the domain handles versioned data\n- Be thorough - better to include extra models than miss required ones\n\nWhat NOT to Include:\n\n- System-internal tables (audit_logs, system_metrics)\n- Pure cache tables (temporary_cache, session_cache)\n- Framework tables (migrations, schema_versions)",
type: "array",
items: {
type: "string"
}
}
},
required: [
"name",
"description",
"prismaSchemas"
]
}
}
},
description: "Generate logical groups for organizing API endpoint creation based on\nPrisma schema structure.\n\nDO: Derive groups from Prisma schema organization (namespaces, file\nstructure, table prefixes) rather than arbitrary business domains. DO:\nCreate new groups only when existing schema structure cannot adequately\ncover all requirements.",
validate: (() => { const _io0 = input => Array.isArray(input.groups) && (1 <= input.groups.length && input.groups.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = input => "string" === typeof input.name && "string" === typeof input.description && (Array.isArray(input.prismaSchemas) && input.prismaSchemas.every(elem => "string" === typeof elem)); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.groups) || _report(_exceptionable, {
path: _path + ".groups",
expected: "(Array<AutoBeInterfaceGroup> & MinItems<1>)",
value: input.groups
})) && ((1 <= input.groups.length || _report(_exceptionable, {
path: _path + ".groups",
expected: "Array<> & MinItems<1>",
value: input.groups
})) && input.groups.map((elem, _index3) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
path: _path + ".groups[" + _index3 + "]",
expected: "AutoBeInterfaceGroup",
value: elem
})) && _vo1(elem, _path + ".groups[" + _index3 + "]", true && _exceptionable) || _report(_exceptionable, {
path: _path + ".groups[" + _index3 + "]",
expected: "AutoBeInterfaceGroup",
value: elem
})).every(flag => flag)) || _report(_exceptionable, {
path: _path + ".groups",
expected: "(Array<AutoBeInterfaceGroup> & MinItems<1>)",
value: input.groups
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
path: _path + ".name",
expected: "string",
value: input.name
}), "string" === typeof input.description || _report(_exceptionable, {
path: _path + ".description",
expected: "string",
value: input.description
}), (Array.isArray(input.prismaSchemas) || _report(_exceptionable, {
path: _path + ".prismaSchemas",
expected: "Array<string>",
value: input.prismaSchemas
})) && input.prismaSchemas.map((elem, _index4) => "string" === typeof elem || _report(_exceptionable, {
path: _path + ".prismaSchemas[" + _index4 + "]",
expected: "string",
value: elem
})).every(flag => flag) || _report(_exceptionable, {
path: _path + ".prismaSchemas",
expected: "Array<string>",
value: input.prismaSchemas
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
if (false === __is(input)) {
errors = [];
_report = __typia_transform__validateReport._validateReport(errors);
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
path: _path + "",
expected: "IAutoBeInterfaceGroupApplication.IProps",
value: input
})) && _vo0(input, _path + "", true) || _report(true, {
path: _path + "",
expected: "IAutoBeInterfaceGroupApplication.IProps",
value: input
}))(input, "$input", true);
const success = 0 === errors.length;
return success ? {
success,
data: input
} : {
success,
errors,
data: input
};
}
return {
success: true,
data: input
};
}; })()
}
]
};
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, Object.assign(Object.assign({}, {
validate: {
makeGroups: validate,
},
}), { equals: false }));
return application;
})(),
gemini: (validate) => (() => {
const application = {
model: "gemini",
options: {
reference: true,
separate: null
},
functions: [
{
name: "makeGroups",
parameters: {
description: " Properties containing the groups to be created for API\norganization\n\n------------------------------\n\nCurrent Type: {@link IAutoBeInterfaceGroupApplication.IProps}",
type: "object",
properties: {
groups: {
description: "Array of API endpoint groups for organizing development.\n\nDO: Organize groups around existing Prisma schema structure. DO: Provide\ncomplete coverage of all entities and requirements without overlap.",
type: "array",
items: {
$ref: "#/$defs/AutoBeInterfaceGroup"
},
minItems: 1
}
},
required: [
"groups"
],
additionalProperties: false,
$defs: {
AutoBeInterfaceGroup: {
description: "Interface representing a logical grouping of API endpoints based on Prisma\nschema structure.\n\nThis interface defines organizational units used by the Interface agent to\nmanage API endpoint generation for large-scale projects. Each group\nrepresents a cohesive collection of database entities and their associated\nAPI operations, derived directly from the Prisma schema organization rather\nthan arbitrary business domains.\n\nGroups serve as the foundational organizing principle for:\n\n- Dividing large API specifications into manageable generation cycles\n- Maintaining alignment between API structure and database schema\n- Ensuring complete coverage of all database entities\n- Facilitating modular and scalable API development\n\nThe group structure must strictly follow Prisma schema organization patterns\nsuch as namespaces, file boundaries, or table prefix conventions to ensure\nconsistency between the data model and API design.",
type: "object",
properties: {
name: {
description: "Name identifier for the API endpoint group.\n\nThis name must be derived from the Prisma schema structure following these\npriorities:\n\n1. Prisma namespace names (e.g., `namespace Shopping` \u2192 \"Shopping\")\n2. Schema file names (e.g., `shopping.prisma` \u2192 \"Shopping\")\n3. Table prefix patterns (e.g., `shopping_*` tables \u2192 \"Shopping\")\n\nNames should use PascalCase format and range from 3-50 characters.\nExamples: \"Shopping\", \"BBS\", \"UserManagement\", \"PaymentProcessing\"",
type: "string"
},
description: {
description: "Comprehensive description of the API endpoint group's scope and purpose.\n\nThe description must include:\n\n- Schema foundation (namespace, file, or prefix pattern)\n- Specific database entities (table names) covered by this group\n- Functional operations and workflows supported\n- Relationships between entities within the group\n- How requirements map to these schema entities\n\nDescriptions should be 100-2000 characters and focus on concrete schema\nelements rather than abstract business concepts.",
type: "string"
},
prismaSchemas: {
description: "List of Prisma schema model names required for implementing endpoints in\nthis group.\n\nThis field pre-identifies all database models that are relevant to this\nendpoint group, reducing the cognitive load on the endpoint generation\nagent and enabling more comprehensive endpoint coverage.\n\nThe AI analyzes requirements during group definition phase to determine\nwhich Prisma models are needed for complete API functionality within this\ngroup's domain.\n\nSelection Guidelines:\n\n- Include ALL models that users directly interact with in this domain\n- Include related models needed for complete CRUD operations\n- Include parent/child models for nested endpoint support\n- Include snapshot models if the domain handles versioned data\n- Be thorough - better to include extra models than miss required ones\n\nWhat NOT to Include:\n\n- System-internal tables (audit_logs, system_metrics)\n- Pure cache tables (temporary_cache, session_cache)\n- Framework tables (migrations, schema_versions)",
type: "array",
items: {
type: "string"
}
}
},
required: [
"name",
"description",
"prismaSchemas"
]
}
}
},
description: "Generate logical groups for organizing API endpoint creation based on\nPrisma schema structure.\n\nDO: Derive groups from Prisma schema organization (namespaces, file\nstructure, table prefixes) rather than arbitrary business domains. DO:\nCreate new groups only when existing schema structure cannot adequately\ncover all requirements.",
validate: (() => { const _io0 = input => Array.isArray(input.groups) && (1 <= input.groups.length && input.groups.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = input => "string" === typeof input.name && "string" === typeof input.description && (Array.isArray(input.prismaSchemas) && input.prismaSchemas.every(elem => "string" === typeof elem)); const _vo0 = (input, _path, _exceptionable = true) => [(Array.isArray(input.groups) || _report(_exceptionable, {
path: _path + ".groups",
expected: "(Array<AutoBeInterfaceGroup> & MinItems<1>)",
value: input.groups
})) && ((1 <= input.groups.length || _report(_exceptionable, {
path: _path + ".groups",
expected: "Array<> & MinItems<1>",
value: input.groups
})) && input.groups.map((elem, _index3) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
path: _path + ".groups[" + _index3 + "]",
expected: "AutoBeInterfaceGroup",
value: elem
})) && _vo1(elem, _path + ".groups[" + _index3 + "]", true && _exceptionable) || _report(_exceptionable, {
path: _path + ".groups[" + _index3 + "]",
expected: "AutoBeInterfaceGroup",
value: elem
})).every(flag => flag)) || _report(_exceptionable, {
path: _path + ".groups",
expected: "(Array<AutoBeInterfaceGroup> & MinItems<1>)",
value: input.groups
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
path: _path + ".name",
expected: "string",
value: input.name
}), "string" === typeof input.description || _report(_exceptionable, {
path: _path + ".description",
expected: "string",
value: input.description
}), (Array.isArray(input.prismaSchemas) || _report(_exceptionable, {
path: _path + ".prismaSchemas",
expected: "Array<string>",
value: input.prismaSchemas
})) && input.prismaSchemas.map((elem, _index4) => "string" === typeof elem || _report(_exceptionable, {
path: _path + ".prismaSchemas[" + _index4 + "]",
expected: "string",
value: elem
})).every(flag => flag) || _report(_exceptionable, {
path: _path + ".prismaSchemas",
expected: "Array<string>",
value: input.prismaSchemas
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
if (false === __is(input)) {
errors = [];
_report = __typia_transform__validateReport._validateReport(errors);
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
path: _path + "",
expected: "IAutoBeInterfaceGroupApplication.IProps",
value: input
})) && _vo0(input, _path + "", true) || _report(true, {
path: _path + "",
expected: "IAutoBeInterfaceGroupApplication.IProps",
value: input
}))(input, "$input", true);
const success = 0 === errors.length;
return success ? {
success,
data: input
} : {
success,
errors,
data: input
};
}
return {
success: true,
data: input
};
}; })()
}
]
};
__typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, Object.assign(Object.assign({}, {
validate: {
makeGroups: validate,
},
}), { equals: false }));
return application;
})(),
};
const SOURCE = "interfaceGroup";
//# sourceMappingURL=orchestrateInterfaceGroup.js.map