@autobe/rpc 0.0.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.
- package/LICENSE +21 -0
- package/lib/agent/src/AutoBeAgent.d.ts +31 -0
- package/lib/agent/src/AutoBeAgent.js +180 -0
- package/lib/agent/src/AutoBeAgent.js.map +1 -0
- package/lib/agent/src/analyze/AnalyzeAgent.d.ts +24 -0
- package/lib/agent/src/analyze/AnalyzeAgent.js +143 -0
- package/lib/agent/src/analyze/AnalyzeAgent.js.map +1 -0
- package/lib/agent/src/analyze/CreateReviewerAgent.d.ts +16 -0
- package/lib/agent/src/analyze/CreateReviewerAgent.js +97 -0
- package/lib/agent/src/analyze/CreateReviewerAgent.js.map +1 -0
- package/lib/agent/src/analyze/Planning.d.ts +63 -0
- package/lib/agent/src/analyze/Planning.js +39 -0
- package/lib/agent/src/analyze/Planning.js.map +1 -0
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +14 -0
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.js +4 -0
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +1 -0
- package/lib/agent/src/context/AutoBeContext.d.ts +17 -0
- package/lib/agent/src/context/AutoBeContext.js +3 -0
- package/lib/agent/src/context/AutoBeContext.js.map +1 -0
- package/lib/agent/src/context/AutoBeState.d.ts +8 -0
- package/lib/agent/src/context/AutoBeState.js +3 -0
- package/lib/agent/src/context/AutoBeState.js.map +1 -0
- package/lib/agent/src/context/AutoBeTokenUsage.d.ts +2 -0
- package/lib/agent/src/context/AutoBeTokenUsage.js +6 -0
- package/lib/agent/src/context/AutoBeTokenUsage.js.map +1 -0
- package/lib/agent/src/context/IAutoBeApplication.d.ts +107 -0
- package/lib/agent/src/context/IAutoBeApplication.js +3 -0
- package/lib/agent/src/context/IAutoBeApplication.js.map +1 -0
- package/lib/agent/src/context/IAutoBeApplicationProps.d.ts +26 -0
- package/lib/agent/src/context/IAutoBeApplicationProps.js +3 -0
- package/lib/agent/src/context/IAutoBeApplicationProps.js.map +1 -0
- package/lib/agent/src/context/IAutoBeApplicationResult.d.ts +3 -0
- package/lib/agent/src/context/IAutoBeApplicationResult.js +3 -0
- package/lib/agent/src/context/IAutoBeApplicationResult.js.map +1 -0
- package/lib/agent/src/context/assertSchemaModel.d.ts +2 -0
- package/lib/agent/src/context/assertSchemaModel.js +15 -0
- package/lib/agent/src/context/assertSchemaModel.js.map +1 -0
- package/lib/agent/src/factory/createAgenticaHistory.d.ts +7 -0
- package/lib/agent/src/factory/createAgenticaHistory.js +26 -0
- package/lib/agent/src/factory/createAgenticaHistory.js.map +1 -0
- package/lib/agent/src/factory/createAutoBeApplication.d.ts +7 -0
- package/lib/agent/src/factory/createAutoBeApplication.js +40 -0
- package/lib/agent/src/factory/createAutoBeApplication.js.map +1 -0
- package/lib/agent/src/factory/createAutoBeState.d.ts +3 -0
- package/lib/agent/src/factory/createAutoBeState.js +16 -0
- package/lib/agent/src/factory/createAutoBeState.js.map +1 -0
- package/lib/agent/src/factory/index.d.ts +2 -0
- package/lib/agent/src/factory/index.js +19 -0
- package/lib/agent/src/factory/index.js.map +1 -0
- package/lib/agent/src/factory/invertOpenApiDocument.d.ts +3 -0
- package/lib/agent/src/factory/invertOpenApiDocument.js +51 -0
- package/lib/agent/src/factory/invertOpenApiDocument.js.map +1 -0
- package/lib/agent/src/index.d.ts +9 -0
- package/lib/agent/src/index.js +49 -0
- package/lib/agent/src/index.js.map +1 -0
- package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.d.ts +2 -0
- package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js +46 -0
- package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js.map +1 -0
- package/lib/agent/src/orchestrate/index.d.ts +5 -0
- package/lib/agent/src/orchestrate/index.js +14 -0
- package/lib/agent/src/orchestrate/index.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/OpenApiEndpointComparator.d.ts +5 -0
- package/lib/agent/src/orchestrate/interface/OpenApiEndpointComparator.js +16 -0
- package/lib/agent/src/orchestrate/interface/OpenApiEndpointComparator.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.d.ts +5 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +61 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComponents.d.ts +4 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComponents.js +208 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.d.ts +4 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +86 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.d.ts +4 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +154 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/transformInterfaceHistories.d.ts +3 -0
- package/lib/agent/src/orchestrate/interface/transformInterfaceHistories.js +94 -0
- package/lib/agent/src/orchestrate/interface/transformInterfaceHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/orchestrateAnalyze.d.ts +6 -0
- package/lib/agent/src/orchestrate/orchestrateAnalyze.js +76 -0
- package/lib/agent/src/orchestrate/orchestrateAnalyze.js.map +1 -0
- package/lib/agent/src/orchestrate/orchestrateRealize.d.ts +5 -0
- package/lib/agent/src/orchestrate/orchestrateRealize.js +19 -0
- package/lib/agent/src/orchestrate/orchestrateRealize.js.map +1 -0
- package/lib/agent/src/orchestrate/orchestrateTest.d.ts +5 -0
- package/lib/agent/src/orchestrate/orchestrateTest.js +19 -0
- package/lib/agent/src/orchestrate/orchestrateTest.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.d.ts +5 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js +103 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCompiler.d.ts +6 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCompiler.js +127 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCompiler.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.d.ts +5 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js +80 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchema.d.ts +7 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchema.js +124 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/transformPrismaCompilerHistories.d.ts +3 -0
- package/lib/agent/src/orchestrate/prisma/transformPrismaCompilerHistories.js +44 -0
- package/lib/agent/src/orchestrate/prisma/transformPrismaCompilerHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/transformPrismaComponentsHistories.d.ts +3 -0
- package/lib/agent/src/orchestrate/prisma/transformPrismaComponentsHistories.js +42 -0
- package/lib/agent/src/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/transformPrismaSchemaHistories.d.ts +3 -0
- package/lib/agent/src/orchestrate/prisma/transformPrismaSchemaHistories.js +46 -0
- package/lib/agent/src/orchestrate/prisma/transformPrismaSchemaHistories.js.map +1 -0
- package/lib/agent/src/structures/IAutoBeConfig.d.ts +24 -0
- package/lib/agent/src/structures/IAutoBeConfig.js +3 -0
- package/lib/agent/src/structures/IAutoBeConfig.js.map +1 -0
- package/lib/agent/src/structures/IAutoBeProps.d.ts +11 -0
- package/lib/agent/src/structures/IAutoBeProps.js +3 -0
- package/lib/agent/src/structures/IAutoBeProps.js.map +1 -0
- package/lib/agent/src/structures/IAutoBeVendor.d.ts +2 -0
- package/lib/agent/src/structures/IAutoBeVendor.js +3 -0
- package/lib/agent/src/structures/IAutoBeVendor.js.map +1 -0
- package/lib/agent/src/utils/StringUtil.d.ts +4 -0
- package/lib/agent/src/utils/StringUtil.js +43 -0
- package/lib/agent/src/utils/StringUtil.js.map +1 -0
- package/lib/agent/src/utils/divideArray.d.ts +4 -0
- package/lib/agent/src/utils/divideArray.js +19 -0
- package/lib/agent/src/utils/divideArray.js.map +1 -0
- package/lib/agent/src/utils/emplaceMap.d.ts +1 -0
- package/lib/agent/src/utils/emplaceMap.js +13 -0
- package/lib/agent/src/utils/emplaceMap.js.map +1 -0
- package/lib/rpc/src/AutoBeRpcService.d.ts +19 -0
- package/lib/rpc/src/AutoBeRpcService.js +93 -0
- package/lib/rpc/src/AutoBeRpcService.js.map +1 -0
- package/lib/rpc/src/index.d.ts +1 -0
- package/lib/rpc/src/index.js +18 -0
- package/lib/rpc/src/index.js.map +1 -0
- package/package.json +40 -0
- package/src/AutoBeRpcService.ts +108 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoBeSystemPromptConstant.js","sourceRoot":"","sources":["../../../../../agent/src/constants/AutoBeSystemPromptConstant.ts"],"names":[],"mappings":";;AAcC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AutoBeEvent, AutoBeHistory, IAutoBeCompiler } from "@autobe/interface";
|
|
2
|
+
import { ILlmSchema } from "@samchon/openapi";
|
|
3
|
+
import { IAutoBeConfig } from "../structures/IAutoBeConfig";
|
|
4
|
+
import { IAutoBeVendor } from "../structures/IAutoBeVendor";
|
|
5
|
+
import { AutoBeState } from "./AutoBeState";
|
|
6
|
+
import { AutoBeTokenUsage } from "./AutoBeTokenUsage";
|
|
7
|
+
export interface AutoBeContext<Model extends ILlmSchema.Model> {
|
|
8
|
+
model: Model;
|
|
9
|
+
vendor: IAutoBeVendor;
|
|
10
|
+
config: IAutoBeConfig | undefined;
|
|
11
|
+
compiler: IAutoBeCompiler;
|
|
12
|
+
files: () => Record<string, string>;
|
|
13
|
+
histories: () => AutoBeHistory[];
|
|
14
|
+
state: () => AutoBeState;
|
|
15
|
+
usage: () => AutoBeTokenUsage;
|
|
16
|
+
dispatch: (event: AutoBeEvent) => void;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoBeContext.js","sourceRoot":"","sources":["../../../../../agent/src/context/AutoBeContext.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AutoBeAnalyzeHistory, AutoBeInterfaceHistory, AutoBePrismaHistory, AutoBeRealizeHistory, AutoBeTestHistory } from "@autobe/interface";
|
|
2
|
+
export interface AutoBeState {
|
|
3
|
+
analyze: AutoBeAnalyzeHistory | null;
|
|
4
|
+
prisma: AutoBePrismaHistory | null;
|
|
5
|
+
interface: AutoBeInterfaceHistory | null;
|
|
6
|
+
test: AutoBeTestHistory | null;
|
|
7
|
+
realize: AutoBeRealizeHistory | null;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoBeState.js","sourceRoot":"","sources":["../../../../../agent/src/context/AutoBeState.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoBeTokenUsage.js","sourceRoot":"","sources":["../../../../../agent/src/context/AutoBeTokenUsage.ts"],"names":[],"mappings":";;;AAAA,yCAAoD;AAEtC,QAAA,gBAAgB,GAAG,yBAAkB,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { IAutoBeApplicationProps } from "./IAutoBeApplicationProps";
|
|
2
|
+
import { IAutoBeApplicationResult } from "./IAutoBeApplicationResult";
|
|
3
|
+
/**
|
|
4
|
+
* Application for AutoBE function calling.
|
|
5
|
+
*
|
|
6
|
+
* @author Samchon
|
|
7
|
+
*/
|
|
8
|
+
export interface IAutoBeApplication {
|
|
9
|
+
/**
|
|
10
|
+
* Run Analyze Agent.
|
|
11
|
+
*
|
|
12
|
+
* Executes the Analyze agent to process user requirements and generate a
|
|
13
|
+
* structured specification document. This agent analyzes all conversation
|
|
14
|
+
* history between users and AI, separates business logic from technical
|
|
15
|
+
* requirements, and establishes development priorities and scope.
|
|
16
|
+
*
|
|
17
|
+
* **IMPORTANT**: Only call this function when sufficient requirements have
|
|
18
|
+
* been discussed to generate a comprehensive specification. The context must
|
|
19
|
+
* contain enough detail about the system's purpose, core features, data
|
|
20
|
+
* models, and business rules. If requirements are unclear or incomplete,
|
|
21
|
+
* continue gathering information through conversation instead.
|
|
22
|
+
*
|
|
23
|
+
* The agent will automatically generate follow-up questions for any ambiguous
|
|
24
|
+
* requirements and continuously refine its understanding through iterative
|
|
25
|
+
* conversation. When executed after other agents have generated code, it can
|
|
26
|
+
* also interpret change requests in the context of existing implementations.
|
|
27
|
+
*/
|
|
28
|
+
analyze(props: IAutoBeApplicationProps): Promise<IAutoBeApplicationResult>;
|
|
29
|
+
/**
|
|
30
|
+
* Run prisma agent.
|
|
31
|
+
*
|
|
32
|
+
* Executes the Prisma agent to generate database schema files and ERD
|
|
33
|
+
* documentation. This agent reads the requirements specification created by
|
|
34
|
+
* the {@link analyze Analyze agent} and produces a complete Prisma schema with
|
|
35
|
+
* comprehensive documentation for each entity and attribute.
|
|
36
|
+
*
|
|
37
|
+
* **PREREQUISITE**: Only call this function after the {@link analyze} function
|
|
38
|
+
* has been successfully executed and a requirements specification document
|
|
39
|
+
* has been generated. The Prisma agent depends on the structured requirements
|
|
40
|
+
* analysis to design the database schema properly. Without a completed
|
|
41
|
+
* requirements specification, this function should NOT be called.
|
|
42
|
+
*
|
|
43
|
+
* The agent will automatically validate the generated schema using the Prisma
|
|
44
|
+
* compiler, self-correct any compilation errors through feedback loops, and
|
|
45
|
+
* generate ERD documentation using prisma-markdown. An internal review
|
|
46
|
+
* process ensures schema quality and optimization.
|
|
47
|
+
*/
|
|
48
|
+
prisma(props: IAutoBeApplicationProps): Promise<IAutoBeApplicationResult>;
|
|
49
|
+
/**
|
|
50
|
+
* Run interface agent.
|
|
51
|
+
*
|
|
52
|
+
* Executes the Interface agent to design and generate API interfaces. This
|
|
53
|
+
* agent creates OpenAPI schemas and TypeScript/NestJS code based on the
|
|
54
|
+
* requirements specification and ERD documentation from previous agents.
|
|
55
|
+
*
|
|
56
|
+
* The agent follows a sophisticated pipeline: first constructing formal
|
|
57
|
+
* OpenAPI Operation Schemas and JSON Schemas, then validating these schemas,
|
|
58
|
+
* and finally transforming them into NestJS controllers and DTOs. Each
|
|
59
|
+
* generated interface includes comprehensive JSDoc comments and undergoes
|
|
60
|
+
* internal review for consistency.
|
|
61
|
+
*/
|
|
62
|
+
interface(props: IAutoBeApplicationProps): Promise<IAutoBeApplicationResult>;
|
|
63
|
+
/**
|
|
64
|
+
* Run test program agent.
|
|
65
|
+
*
|
|
66
|
+
* Executes the Test agent to generate comprehensive E2E test suites for all
|
|
67
|
+
* {@link interface API interfaces}. This agent synthesizes outputs from
|
|
68
|
+
* previous agents to create tests that validate both individual endpoints and
|
|
69
|
+
* their interactions.
|
|
70
|
+
*
|
|
71
|
+
* **PREREQUISITE**: Only call this function after the {@link interface}
|
|
72
|
+
* function has been successfully executed and API interfaces have been
|
|
73
|
+
* generated. The Test agent requires the completed API interface definitions,
|
|
74
|
+
* OpenAPI schemas, and TypeScript code to generate appropriate test
|
|
75
|
+
* scenarios. Without completed interface design, this function should NOT be
|
|
76
|
+
* called.
|
|
77
|
+
*
|
|
78
|
+
* The agent will analyze dependency relationships between API functions,
|
|
79
|
+
* structure integrated test scenarios with correct execution sequences, and
|
|
80
|
+
* enhance pre-generated test scaffolds with business logic validation.
|
|
81
|
+
* TypeScript compiler validation and internal review ensure test quality and
|
|
82
|
+
* optimal coverage.
|
|
83
|
+
*/
|
|
84
|
+
test(props: IAutoBeApplicationProps): Promise<IAutoBeApplicationResult>;
|
|
85
|
+
/**
|
|
86
|
+
* Run realize agent.
|
|
87
|
+
*
|
|
88
|
+
* Executes the Realize agent to implement the actual business logic for each
|
|
89
|
+
* API endpoint. This agent synthesizes all outputs from previous agents to
|
|
90
|
+
* generate fully functional service provider code.
|
|
91
|
+
*
|
|
92
|
+
* **PREREQUISITE**: Only call this function after the {@link interface}
|
|
93
|
+
* function has been successfully executed and API interfaces have been
|
|
94
|
+
* generated. The Realize agent requires the completed API interface
|
|
95
|
+
* definitions to implement the corresponding service logic. It also benefits
|
|
96
|
+
* from having test code available for validation. Without completed interface
|
|
97
|
+
* design, this function should NOT be called.
|
|
98
|
+
*
|
|
99
|
+
* The agent will create service implementations with multiple validation
|
|
100
|
+
* layers: TypeScript compiler feedback, runtime validation through test
|
|
101
|
+
* execution, and quality optimization through internal review. The generated
|
|
102
|
+
* code handles database interactions through Prisma, implements security and
|
|
103
|
+
* validation checks, and processes business rules according to
|
|
104
|
+
* specifications.
|
|
105
|
+
*/
|
|
106
|
+
realize(props: IAutoBeApplicationProps): Promise<IAutoBeApplicationResult>;
|
|
107
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAutoBeApplication.js","sourceRoot":"","sources":["../../../../../agent/src/context/IAutoBeApplication.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface IAutoBeApplicationProps {
|
|
2
|
+
/** The reason of the function call. */
|
|
3
|
+
reason: string;
|
|
4
|
+
/**
|
|
5
|
+
* This prompt defines how to convert a user's planning-oriented requirements into a structured message for an internal agent.
|
|
6
|
+
*
|
|
7
|
+
* All content the user provides must be included in the message. However, if some parts of the user's input are inappropriate or insufficient from a planning standpoint, you are allowed to add **supplementary remarks**—but only under strict rules.
|
|
8
|
+
*
|
|
9
|
+
* <Supplementary Remark Rules>
|
|
10
|
+
*
|
|
11
|
+
* 1. **Definition**
|
|
12
|
+
* A supplementary remark is additional information that may differ from the user's original intent. Because of this, **you must clearly indicate that it is *not* part of the user’s thinking**.
|
|
13
|
+
*
|
|
14
|
+
* 2. **When to Supplement**
|
|
15
|
+
* - If the user's input reveals a lack of technical understanding (e.g., suggesting "put all data into one table"), and the plan is not an MVP or PoC, it's encouraged to make reasonable additions for a more scalable or robust structure.
|
|
16
|
+
* - If there are clear gaps in the user's planning logic, you may supplement the content to ensure completeness.
|
|
17
|
+
*
|
|
18
|
+
* 3. **When Not to Supplement**
|
|
19
|
+
* - If the user's input is vague or ambiguous, **do not assume or add extra details**. Instead, it’s better to ask the user follow-up questions to clarify their intent.
|
|
20
|
+
* - If the user has made no comment on design, **do not impose design-related decisions** (e.g., colors, fonts, tone). However, you may state explicitly that no design requirements were provided.
|
|
21
|
+
* - Generic advice like "UX should be good" can be omitted unless it adds value, as such goals are assumed in all services.
|
|
22
|
+
*
|
|
23
|
+
* </Supplementary Remark Rules>
|
|
24
|
+
*/
|
|
25
|
+
userPlanningRequirements?: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAutoBeApplicationProps.js","sourceRoot":"","sources":["../../../../../agent/src/context/IAutoBeApplicationProps.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAutoBeApplicationResult.js","sourceRoot":"","sources":["../../../../../agent/src/context/IAutoBeApplicationResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertSchemaModel = assertSchemaModel;
|
|
4
|
+
function assertSchemaModel(model) {
|
|
5
|
+
if (model === "gemini")
|
|
6
|
+
throw new Error([
|
|
7
|
+
"Error on AutoBeAgent.constructor(): gemini is not supported",
|
|
8
|
+
"because it does not follow standard JSON schema specification.",
|
|
9
|
+
"@autobe requires union type (`oneOf` or `anyOf`) for backend code generation,",
|
|
10
|
+
"but gemini has banned them. Please wait until when `@agentica`",
|
|
11
|
+
"supports prompt based function calling which can detour gemini's",
|
|
12
|
+
"restriction of JSON schema specification.",
|
|
13
|
+
].join(" "));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=assertSchemaModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertSchemaModel.js","sourceRoot":"","sources":["../../../../../agent/src/context/assertSchemaModel.ts"],"names":[],"mappings":";;AAEA,8CAcC;AAdD,SAAgB,iBAAiB,CAC/B,KAAY;IAEZ,IAAI,KAAK,KAAK,QAAQ;QACpB,MAAM,IAAI,KAAK,CACb;YACE,6DAA6D;YAC7D,gEAAgE;YAChE,+EAA+E;YAC/E,gEAAgE;YAChE,kEAAkE;YAClE,2CAA2C;SAC5C,CAAC,IAAI,CAAC,GAAG,CAAC,CACZ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AgenticaOperation, MicroAgenticaHistory } from "@agentica/core";
|
|
2
|
+
import { AutoBeHistory } from "@autobe/interface";
|
|
3
|
+
import { ILlmSchema } from "@samchon/openapi";
|
|
4
|
+
export declare function createAgenticaHistory<Model extends ILlmSchema.Model>(props: {
|
|
5
|
+
operations: readonly AgenticaOperation<Model>[];
|
|
6
|
+
history: AutoBeHistory;
|
|
7
|
+
}): MicroAgenticaHistory<Model> | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAgenticaHistory = createAgenticaHistory;
|
|
4
|
+
function createAgenticaHistory(props) {
|
|
5
|
+
if (props.history.type === "userMessage")
|
|
6
|
+
return Object.assign(Object.assign({}, props.history), { toJSON: () => props.history });
|
|
7
|
+
else if (props.history.type === "assistantMessage")
|
|
8
|
+
return Object.assign(Object.assign({}, props.history), { toJSON: () => props.history });
|
|
9
|
+
const operation = props.operations.find((op) => op.function.name === props.history.type);
|
|
10
|
+
if (operation === undefined)
|
|
11
|
+
return null;
|
|
12
|
+
const partial = {
|
|
13
|
+
id: props.history.id,
|
|
14
|
+
type: "execute",
|
|
15
|
+
arguments: {
|
|
16
|
+
reason: props.history.reason,
|
|
17
|
+
},
|
|
18
|
+
value: {
|
|
19
|
+
success: props.history.type === "analyze" || props.history.type === "interface"
|
|
20
|
+
? true
|
|
21
|
+
: props.history.result.type === "success",
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
return Object.assign(Object.assign({}, partial), { protocol: operation.protocol, operation: operation, toJSON: () => (Object.assign(Object.assign({}, partial), { protocol: operation.protocol, operation: operation.toJSON() })) });
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=createAgenticaHistory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAgenticaHistory.js","sourceRoot":"","sources":["../../../../../agent/src/factory/createAgenticaHistory.ts"],"names":[],"mappings":";;AAQA,sDA0CC;AA1CD,SAAgB,qBAAqB,CAAiC,KAGrE;IACC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,aAAa;QACtC,uCACK,KAAK,CAAC,OAAO,KAChB,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAmC,IACvD;SACC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,kBAAkB;QAChD,uCACK,KAAK,CAAC,OAAO,KAChB,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAwC,IAC5D;IAEJ,MAAM,SAAS,GAAyC,KAAK,CAAC,UAAU,CAAC,IAAI,CAC3E,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,CAAC,IAAI,CAChD,CAAC;IACF,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACzC,MAAM,OAAO,GAAG;QACd,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE;QACpB,IAAI,EAAE,SAAkB;QACxB,SAAS,EAAE;YACT,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM;SAC7B;QACD,KAAK,EAAE;YACL,OAAO,EACL,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,WAAW;gBACpE,CAAC,CAAC,IAAI;gBACN,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS;SAC9C;KACF,CAAC;IACF,uCACK,OAAO,KACV,QAAQ,EAAE,SAAS,CAAC,QAAmB,EACvC,SAAS,EAAE,SAA2C,EACtD,MAAM,EAAE,GAAG,EAAE,CAAC,iCACT,OAAO,KACV,QAAQ,EAAE,SAAS,CAAC,QAAmB,EACvC,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,IAC7B,IACF;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IAgenticaController } from "@agentica/core";
|
|
2
|
+
import { ILlmSchema } from "@samchon/openapi";
|
|
3
|
+
import { AutoBeContext } from "../context/AutoBeContext";
|
|
4
|
+
export declare const createAutoBeController: <Model extends ILlmSchema.Model>(props: {
|
|
5
|
+
model: Model;
|
|
6
|
+
context: AutoBeContext<Model>;
|
|
7
|
+
}) => IAgenticaController.IClass<Model>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createAutoBeController = void 0;
|
|
7
|
+
const typia_1 = __importDefault(require("typia"));
|
|
8
|
+
const assertSchemaModel_1 = require("../context/assertSchemaModel");
|
|
9
|
+
const orchestrateInterface_1 = require("../orchestrate/interface/orchestrateInterface");
|
|
10
|
+
const orchestrateAnalyze_1 = require("../orchestrate/orchestrateAnalyze");
|
|
11
|
+
const orchestrateRealize_1 = require("../orchestrate/orchestrateRealize");
|
|
12
|
+
const orchestrateTest_1 = require("../orchestrate/orchestrateTest");
|
|
13
|
+
const orchestratePrisma_1 = require("../orchestrate/prisma/orchestratePrisma");
|
|
14
|
+
const createAutoBeController = (props) => {
|
|
15
|
+
(0, assertSchemaModel_1.assertSchemaModel)(props.model);
|
|
16
|
+
const application = collection[props.model];
|
|
17
|
+
return {
|
|
18
|
+
protocol: "class",
|
|
19
|
+
name: "autobe",
|
|
20
|
+
application,
|
|
21
|
+
execute: {
|
|
22
|
+
analyze: (0, orchestrateAnalyze_1.orchestrateAnalyze)(props.context),
|
|
23
|
+
prisma: (0, orchestratePrisma_1.orchestratePrisma)(props.context),
|
|
24
|
+
interface: (0, orchestrateInterface_1.orchestrateInterface)(props.context),
|
|
25
|
+
test: (0, orchestrateTest_1.orchestrateTest)(props.context),
|
|
26
|
+
realize: (0, orchestrateRealize_1.orchestrateRealize)(props.context),
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
exports.createAutoBeController = createAutoBeController;
|
|
31
|
+
const claude = typia_1.default.llm.application();
|
|
32
|
+
const collection = {
|
|
33
|
+
chatgpt: typia_1.default.llm.application(),
|
|
34
|
+
claude,
|
|
35
|
+
llama: claude,
|
|
36
|
+
deepseek: claude,
|
|
37
|
+
"3.1": claude,
|
|
38
|
+
"3.0": typia_1.default.llm.application(),
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=createAutoBeApplication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAutoBeApplication.js","sourceRoot":"","sources":["../../../../../agent/src/factory/createAutoBeApplication.ts"],"names":[],"mappings":";;;;;;AAEA,kDAA0B;AAI1B,oEAAiE;AACjE,wFAAqF;AACrF,0EAAuE;AACvE,0EAAuE;AACvE,oEAAiE;AACjE,+EAA4E;AAErE,MAAM,sBAAsB,GAAG,CAAiC,KAGtE,EAAqC,EAAE;IACtC,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,QAAQ;QACd,WAAW;QACX,OAAO,EAAE;YACP,OAAO,EAAE,IAAA,uCAAkB,EAAC,KAAK,CAAC,OAAO,CAAC;YAC1C,MAAM,EAAE,IAAA,qCAAiB,EAAC,KAAK,CAAC,OAAO,CAAC;YACxC,SAAS,EAAE,IAAA,2CAAoB,EAAC,KAAK,CAAC,OAAO,CAAC;YAC9C,IAAI,EAAE,IAAA,iCAAe,EAAC,KAAK,CAAC,OAAO,CAAC;YACpC,OAAO,EAAE,IAAA,uCAAkB,EAAC,KAAK,CAAC,OAAO,CAAC;SAC3C;KACF,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,sBAAsB,0BAoBjC;AAEF,MAAM,MAAM,GAAG,eAAK,CAAC,GAAG,CAAC,WAAW,EAIjC,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,eAAK,CAAC,GAAG,CAAC,WAAW,EAI3B;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,eAAK,CAAC,GAAG,CAAC,WAAW,EAA6B;CAC1D,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAutoBeState = void 0;
|
|
4
|
+
const createAutoBeState = (histories) => {
|
|
5
|
+
var _a, _b, _c, _d, _e;
|
|
6
|
+
const reversed = histories.slice().reverse();
|
|
7
|
+
return {
|
|
8
|
+
analyze: (_a = reversed.find((h) => h.type === "analyze")) !== null && _a !== void 0 ? _a : null,
|
|
9
|
+
prisma: (_b = reversed.find((h) => h.type === "prisma")) !== null && _b !== void 0 ? _b : null,
|
|
10
|
+
interface: (_c = reversed.find((h) => h.type === "interface")) !== null && _c !== void 0 ? _c : null,
|
|
11
|
+
test: (_d = reversed.find((h) => h.type === "test")) !== null && _d !== void 0 ? _d : null,
|
|
12
|
+
realize: (_e = reversed.find((h) => h.type === "realize")) !== null && _e !== void 0 ? _e : null,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.createAutoBeState = createAutoBeState;
|
|
16
|
+
//# sourceMappingURL=createAutoBeState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAutoBeState.js","sourceRoot":"","sources":["../../../../../agent/src/factory/createAutoBeState.ts"],"names":[],"mappings":";;;AAIO,MAAM,iBAAiB,GAAG,CAAC,SAA0B,EAAe,EAAE;;IAC3E,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,CAAC;IAC7C,OAAO;QACL,OAAO,EAAE,MAAA,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,mCAAI,IAAI;QAC3D,MAAM,EAAE,MAAA,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,mCAAI,IAAI;QACzD,SAAS,EAAE,MAAA,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,mCAAI,IAAI;QAC/D,IAAI,EAAE,MAAA,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,mCAAI,IAAI;QACrD,OAAO,EAAE,MAAA,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,mCAAI,IAAI;KAC5D,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,iBAAiB,qBAS5B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./createAgenticaHistory"), exports);
|
|
18
|
+
__exportStar(require("./invertOpenApiDocument"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../agent/src/factory/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,0DAAwC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.invertOpenApiDocument = invertOpenApiDocument;
|
|
4
|
+
const openapi_1 = require("@samchon/openapi");
|
|
5
|
+
function invertOpenApiDocument(document) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
const app = openapi_1.HttpMigration.application(document);
|
|
8
|
+
return {
|
|
9
|
+
operations: app.routes
|
|
10
|
+
.filter((r) => r.query === null)
|
|
11
|
+
.map((r) => {
|
|
12
|
+
var _a, _b, _c, _d, _e, _f;
|
|
13
|
+
return ({
|
|
14
|
+
specification: empty("specification"),
|
|
15
|
+
method: r.method,
|
|
16
|
+
path: r.path,
|
|
17
|
+
summary: (_a = r.operation().summary) !== null && _a !== void 0 ? _a : empty("summary"),
|
|
18
|
+
description: (_b = r.operation().description) !== null && _b !== void 0 ? _b : empty("description"),
|
|
19
|
+
parameters: r.parameters.map((p) => {
|
|
20
|
+
var _a;
|
|
21
|
+
return ({
|
|
22
|
+
name: p.name,
|
|
23
|
+
description: (_a = p.parameter().description) !== null && _a !== void 0 ? _a : empty("description"),
|
|
24
|
+
schema: p.schema,
|
|
25
|
+
});
|
|
26
|
+
}),
|
|
27
|
+
requestBody: ((_c = r.body) === null || _c === void 0 ? void 0 : _c.type) === "application/json" &&
|
|
28
|
+
openapi_1.OpenApiTypeChecker.isReference(r.body.schema)
|
|
29
|
+
? {
|
|
30
|
+
description: (_d = r.body.description()) !== null && _d !== void 0 ? _d : empty("description"),
|
|
31
|
+
typeName: r.body.schema.$ref.split("/").pop(),
|
|
32
|
+
}
|
|
33
|
+
: null,
|
|
34
|
+
responseBody: ((_e = r.success) === null || _e === void 0 ? void 0 : _e.type) === "application/json" &&
|
|
35
|
+
openapi_1.OpenApiTypeChecker.isReference(r.success.schema)
|
|
36
|
+
? {
|
|
37
|
+
description: (_f = r.success.description()) !== null && _f !== void 0 ? _f : empty("description"),
|
|
38
|
+
typeName: r.success.schema.$ref.split("/").pop(),
|
|
39
|
+
}
|
|
40
|
+
: null,
|
|
41
|
+
});
|
|
42
|
+
}),
|
|
43
|
+
components: {
|
|
44
|
+
schemas: ((_b = (_a = document.components) === null || _a === void 0 ? void 0 : _a.schemas) !== null && _b !== void 0 ? _b : {}),
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function empty(key) {
|
|
49
|
+
return `Describe ${key} as much as possible with clear and concise words.`;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=invertOpenApiDocument.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invertOpenApiDocument.js","sourceRoot":"","sources":["../../../../../agent/src/factory/invertOpenApiDocument.ts"],"names":[],"mappings":";;AAQA,sDAkDC;AAzDD,8CAK0B;AAE1B,SAAgB,qBAAqB,CACnC,QAA2B;;IAE3B,MAAM,GAAG,GAA4B,uBAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACzE,OAAO;QACL,UAAU,EAAE,GAAG,CAAC,MAAM;aACnB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC;aAC/B,GAAG,CACF,CAAC,CAAC,EAAE,EAAE;;YACJ,OAAA,CAAC;gBACC,aAAa,EAAE,KAAK,CAAC,eAAe,CAAC;gBACrC,MAAM,EAAE,CAAC,CAAC,MAAgB;gBAC1B,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,OAAO,EAAE,MAAA,CAAC,CAAC,SAAS,EAAE,CAAC,OAAO,mCAAI,KAAK,CAAC,SAAS,CAAC;gBAClD,WAAW,EAAE,MAAA,CAAC,CAAC,SAAS,EAAE,CAAC,WAAW,mCAAI,KAAK,CAAC,aAAa,CAAC;gBAC9D,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAC1B,CAAC,CAAC,EAAE,EAAE;;oBACJ,OAAA,CAAC;wBACC,IAAI,EAAE,CAAC,CAAC,IAAI;wBACZ,WAAW,EACT,MAAA,CAAC,CAAC,SAAS,EAAE,CAAC,WAAW,mCAAI,KAAK,CAAC,aAAa,CAAC;wBACnD,MAAM,EAAE,CAAC,CAAC,MAAa;qBACxB,CAAoC,CAAA;iBAAA,CACxC;gBACD,WAAW,EACT,CAAA,MAAA,CAAC,CAAC,IAAI,0CAAE,IAAI,MAAK,kBAAkB;oBACnC,4BAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;oBAC3C,CAAC,CAAC;wBACE,WAAW,EAAE,MAAA,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,mCAAI,KAAK,CAAC,aAAa,CAAC;wBACzD,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG;qBAC/C;oBACH,CAAC,CAAC,IAAI;gBACV,YAAY,EACV,CAAA,MAAA,CAAC,CAAC,OAAO,0CAAE,IAAI,MAAK,kBAAkB;oBACtC,4BAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;oBAC9C,CAAC,CAAC;wBACE,WAAW,EACT,MAAA,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,mCAAI,KAAK,CAAC,aAAa,CAAC;wBACjD,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG;qBAClD;oBACH,CAAC,CAAC,IAAI;aACX,CAAoC,CAAA;SAAA,CACxC;QACH,UAAU,EAAE;YACV,OAAO,EAAE,CAAC,MAAA,MAAA,QAAQ,CAAC,UAAU,0CAAE,OAAO,mCAAI,EAAE,CAG3C;SACF;KACF,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,GAAW;IACxB,OAAO,YAAY,GAAG,oDAAoD,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./AutoBeAgent";
|
|
2
|
+
export * from "./context/AutoBeTokenUsage";
|
|
3
|
+
export * from "./structures/IAutoBeProps";
|
|
4
|
+
export * from "./structures/IAutoBeConfig";
|
|
5
|
+
export * from "./structures/IAutoBeVendor";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export * as factory from "./factory";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export * as orchestrate from "./orchestrate";
|
|
@@ -0,0 +1,49 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.orchestrate = exports.factory = void 0;
|
|
40
|
+
__exportStar(require("./AutoBeAgent"), exports);
|
|
41
|
+
__exportStar(require("./context/AutoBeTokenUsage"), exports);
|
|
42
|
+
__exportStar(require("./structures/IAutoBeProps"), exports);
|
|
43
|
+
__exportStar(require("./structures/IAutoBeConfig"), exports);
|
|
44
|
+
__exportStar(require("./structures/IAutoBeVendor"), exports);
|
|
45
|
+
/** @internal */
|
|
46
|
+
exports.factory = __importStar(require("./factory"));
|
|
47
|
+
/** @internal */
|
|
48
|
+
exports.orchestrate = __importStar(require("./orchestrate"));
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../agent/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA8B;AAE9B,6DAA2C;AAE3C,4DAA0C;AAC1C,6DAA2C;AAC3C,6DAA2C;AAE3C,gBAAgB;AAChB,qDAAqC;AAErC,gBAAgB;AAChB,6DAA6C"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformFacadeStateMessage = transformFacadeStateMessage;
|
|
4
|
+
const StringUtil_1 = require("../../utils/StringUtil");
|
|
5
|
+
function transformFacadeStateMessage(state) {
|
|
6
|
+
const currentState = getCurrentState(state);
|
|
7
|
+
return "# AutoBE Main Agent System Prompt\n\nYou are the AutoBE Main Agent, an orchestrator for backend server development automation. Your role is to manage the conversation with users about their backend requirements and coordinate the execution of five specialized functional agents through function calling.\n\n## Core Responsibilities\n\n1. **Requirements Gathering**: Engage in detailed conversations with users to understand their backend server needs, asking clarifying questions about business logic, data models, API endpoints, and technical requirements.\n\n2. **Agent Orchestration**: Execute the appropriate functional agents in the correct sequence based on the development stage and user needs.\n\n3. **Progress Communication**: Keep users informed about the current development stage, what has been completed, and what steps remain.\n\n## Functional Agents Overview\n\nYou have access to five functional agents that must be executed in a specific order:\n\n1. **Analyze Agent** - Converts conversations into structured requirements specifications\n2. **Prisma Agent** - Generates database schemas and ERD documentation\n3. **Interface Agent** - Creates API interfaces with OpenAPI schemas and TypeScript code\n4. **Test Agent** - Generates comprehensive E2E test suites\n5. **Realize Agent** - Implements actual business logic for service providers\n\n## Execution Rules\n\n### 1. Sequential Dependencies\n\n- **analyze()**: Can only be called when sufficient requirements have been gathered\n- **prisma()**: Requires successful completion of analyze()\n- **interface()**: Requires successful completion of prisma()\n- **test()**: Requires successful completion of interface()\n- **realize()**: Requires successful completion of interface()\n\n### 2. Requirements Gathering Phase\n\nBefore calling analyze(), ensure you have discussed:\n\n- System purpose and overall goals\n- Core features and functionalities\n- User roles and permissions\n- Main data entities and their relationships\n- Key business rules and constraints\n- API endpoints needed\n- Any specific technical requirements\n\nIf these aspects are unclear, continue the conversation to gather more details.\n\n### 3. Development Workflow\n\n1. Start by understanding the user's needs through conversation\n2. When requirements are sufficiently detailed, execute analyze()\n3. Review the analysis results with the user\n4. If approved, proceed with prisma() \u2192 interface() \u2192 test() \u2192 realize()\n5. At each stage, present results and get user confirmation before proceeding\n\n### 4. Handling Changes\n\n- If users request changes after agents have been executed, first understand the scope\n- For minor adjustments, you may re-run specific agents\n- For major changes, consider re-running analyze() to update the specification\n- Always explain the impact of changes on already generated code\n\n## Communication Guidelines\n\n1. **Be Transparent**: Clearly explain which agent is being executed and why\n2. **Show Progress**: Indicate completed steps and remaining work\n3. **Confirm Understanding**: Summarize requirements before executing agents\n4. **Request Approval**: Get user confirmation before moving to the next stage\n5. **Explain Results**: Briefly describe what each agent has generated\n\n## Current State\n\n{% STATE %}" /* AutoBeSystemPromptConstant.FACADE */.replace("{% STATE %}", StringUtil_1.StringUtil.trim `
|
|
8
|
+
## Current State
|
|
9
|
+
|
|
10
|
+
The current execution status of each functional agent is shown below.
|
|
11
|
+
Each agent can be in one of three states: "none" (never executed),
|
|
12
|
+
"up-to-date" (successfully executed with current output),
|
|
13
|
+
or "out-of-date" (previously executed but needs updating due to
|
|
14
|
+
changes in earlier stages).
|
|
15
|
+
|
|
16
|
+
An agent cannot be executed if any of its prerequisite agents have
|
|
17
|
+
a status of "none" or "out-of-date". In such cases, you must complete or
|
|
18
|
+
update the earlier stages first. Additionally, re-executing an "up-to-date"
|
|
19
|
+
agent will cause all subsequent agents to become "out-of-date", as they
|
|
20
|
+
depend on the updated output.
|
|
21
|
+
|
|
22
|
+
- analyze: ${currentState.analyze}
|
|
23
|
+
- prisma: ${currentState.prisma}
|
|
24
|
+
- interface: ${currentState.interface}
|
|
25
|
+
- test: ${currentState.test}
|
|
26
|
+
- realize: ${currentState.realize}
|
|
27
|
+
`);
|
|
28
|
+
}
|
|
29
|
+
function getCurrentState(state) {
|
|
30
|
+
const value = (obj) => {
|
|
31
|
+
if (state.analyze === null || obj === null)
|
|
32
|
+
return "none";
|
|
33
|
+
else if (state.analyze.step === obj.step)
|
|
34
|
+
return "up-to-date";
|
|
35
|
+
else
|
|
36
|
+
return "out-of-date";
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
analyze: state.analyze === null ? "none" : "up-to-date",
|
|
40
|
+
prisma: value(state.prisma),
|
|
41
|
+
interface: value(state.interface),
|
|
42
|
+
test: value(state.test),
|
|
43
|
+
realize: value(state.realize),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=transformFacadeStateMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformFacadeStateMessage.js","sourceRoot":"","sources":["../../../../../../agent/src/orchestrate/facade/transformFacadeStateMessage.ts"],"names":[],"mappings":";;AAIA,kEA0BC;AA5BD,uDAAoD;AAEpD,SAAgB,2BAA2B,CAAC,KAAkB;IAC5D,MAAM,YAAY,GAAkB,eAAe,CAAC,KAAK,CAAC,CAAC;IAC3D,OAAO,myGAAkC,OAAO,CAC9C,aAAa,EACb,uBAAU,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;mBAeA,YAAY,CAAC,OAAO;kBACrB,YAAY,CAAC,MAAM;qBAChB,YAAY,CAAC,SAAS;gBAC3B,YAAY,CAAC,IAAI;mBACd,YAAY,CAAC,OAAO;KAClC,CACF,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,KAAkB;IACzC,MAAM,KAAK,GAAG,CACZ,GAEQ,EACR,EAAE;QACF,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI;YAAE,OAAO,MAAM,CAAC;aACrD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI;YAAE,OAAO,YAAY,CAAC;;YACzD,OAAO,aAAa,CAAC;IAC5B,CAAC,CAAC;IACF,OAAO;QACL,OAAO,EAAE,KAAK,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY;QACvD,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;QAC3B,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC;QACjC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;QACvB,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { orchestrateAnalyze as analyze } from "./orchestrateAnalyze";
|
|
2
|
+
export { orchestrateInterface as interface } from "./interface/orchestrateInterface";
|
|
3
|
+
export { orchestratePrisma as prisma } from "./prisma/orchestratePrisma";
|
|
4
|
+
export { orchestrateTest as test } from "./orchestrateTest";
|
|
5
|
+
export { orchestrateRealize as realize } from "./orchestrateRealize";
|