@autobe/agent 0.6.0 → 0.7.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 (77) hide show
  1. package/lib/constants/AutoBeSystemPromptConstant.d.ts +4 -1
  2. package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
  3. package/lib/factory/createAutoBeApplication.js +1 -1
  4. package/lib/factory/createAutoBeApplication.js.map +1 -1
  5. package/lib/index.mjs +1704 -144
  6. package/lib/index.mjs.map +1 -1
  7. package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js +15 -18
  8. package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +1 -1
  9. package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js +3 -5
  10. package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js.map +1 -1
  11. package/lib/orchestrate/analyze/orchestrateAnalyze.d.ts +25 -0
  12. package/lib/orchestrate/analyze/orchestrateAnalyze.js +103 -25
  13. package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  14. package/lib/orchestrate/index.d.ts +1 -1
  15. package/lib/orchestrate/index.js +1 -1
  16. package/lib/orchestrate/index.js.map +1 -1
  17. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +3 -1
  18. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  19. package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +3 -1
  20. package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -1
  21. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +3 -1
  22. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  23. package/lib/orchestrate/interface/transformInterfaceHistories.js +26 -0
  24. package/lib/orchestrate/interface/transformInterfaceHistories.js.map +1 -1
  25. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +6 -5
  26. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  27. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.d.ts +1 -1
  28. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +21 -1
  29. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -1
  30. package/lib/orchestrate/{orchestrateTest.d.ts → test/orchestrateTest.d.ts} +2 -2
  31. package/lib/orchestrate/test/orchestrateTest.js +70 -0
  32. package/lib/orchestrate/test/orchestrateTest.js.map +1 -0
  33. package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +4 -0
  34. package/lib/orchestrate/test/orchestrateTestCorrect.js +543 -0
  35. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -0
  36. package/lib/orchestrate/test/orchestrateTestProgress.d.ts +4 -0
  37. package/lib/orchestrate/test/orchestrateTestProgress.js +403 -0
  38. package/lib/orchestrate/test/orchestrateTestProgress.js.map +1 -0
  39. package/lib/orchestrate/test/orchestrateTestScenario.d.ts +4 -0
  40. package/lib/orchestrate/test/orchestrateTestScenario.js +700 -0
  41. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -0
  42. package/lib/orchestrate/test/transformTestCorrectHistories.d.ts +2 -0
  43. package/lib/orchestrate/test/transformTestCorrectHistories.js +47 -0
  44. package/lib/orchestrate/test/transformTestCorrectHistories.js.map +1 -0
  45. package/lib/orchestrate/test/transformTestHistories.d.ts +3 -0
  46. package/lib/orchestrate/test/transformTestHistories.js +74 -0
  47. package/lib/orchestrate/test/transformTestHistories.js.map +1 -0
  48. package/lib/orchestrate/test/transformTestProgressHistories.d.ts +2 -0
  49. package/lib/orchestrate/test/transformTestProgressHistories.js +47 -0
  50. package/lib/orchestrate/test/transformTestProgressHistories.js.map +1 -0
  51. package/lib/orchestrate/test/transformTestScenarioHistories.d.ts +4 -0
  52. package/lib/orchestrate/test/transformTestScenarioHistories.js +176 -0
  53. package/lib/orchestrate/test/transformTestScenarioHistories.js.map +1 -0
  54. package/package.json +4 -4
  55. package/src/constants/AutoBeSystemPromptConstant.ts +4 -1
  56. package/src/factory/createAutoBeApplication.ts +1 -1
  57. package/src/orchestrate/analyze/AutoBeAnalyzeAgent.ts +18 -21
  58. package/src/orchestrate/analyze/AutoBeAnalyzeReviewer.ts +2 -4
  59. package/src/orchestrate/analyze/orchestrateAnalyze.ts +53 -20
  60. package/src/orchestrate/index.ts +1 -1
  61. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +3 -1
  62. package/src/orchestrate/interface/orchestrateInterfaceComponents.ts +3 -1
  63. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +3 -1
  64. package/src/orchestrate/interface/transformInterfaceHistories.ts +25 -0
  65. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +4 -1
  66. package/src/orchestrate/prisma/transformPrismaComponentsHistories.ts +21 -0
  67. package/src/orchestrate/test/orchestrateTest.ts +86 -0
  68. package/src/orchestrate/test/orchestrateTestCorrect.ts +368 -0
  69. package/src/orchestrate/test/orchestrateTestProgress.ts +264 -0
  70. package/src/orchestrate/test/orchestrateTestScenario.ts +178 -0
  71. package/src/orchestrate/test/transformTestCorrectHistories.ts +51 -0
  72. package/src/orchestrate/test/transformTestHistories.ts +77 -0
  73. package/src/orchestrate/test/transformTestProgressHistories.ts +51 -0
  74. package/src/orchestrate/test/transformTestScenarioHistories.ts +184 -0
  75. package/lib/orchestrate/orchestrateTest.js +0 -19
  76. package/lib/orchestrate/orchestrateTest.js.map +0 -1
  77. package/src/orchestrate/orchestrateTest.ts +0 -18
@@ -0,0 +1,184 @@
1
+ import { IAgenticaHistoryJson } from "@agentica/core";
2
+ import { AutoBeOpenApi } from "@autobe/interface";
3
+ import { v4 } from "uuid";
4
+
5
+ import { AutoBeSystemPromptConstant } from "../../constants/AutoBeSystemPromptConstant";
6
+ import { AutoBeState } from "../../context/AutoBeState";
7
+
8
+ export const transformTestScenarioHistories = (
9
+ state: AutoBeState,
10
+ endponits: AutoBeOpenApi.IEndpoint[],
11
+ files: Record<string, string>,
12
+ ): Array<
13
+ IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
14
+ > => {
15
+ if (state.analyze === null)
16
+ return [
17
+ {
18
+ id: v4(),
19
+ created_at: new Date().toISOString(),
20
+ type: "systemMessage",
21
+ text: [
22
+ "Requirement analysis is not yet completed.",
23
+ "Don't call the any tool function,",
24
+ "but say to process the requirement analysis.",
25
+ ].join(" "),
26
+ },
27
+ ];
28
+ else if (state.prisma === null)
29
+ return [
30
+ {
31
+ id: v4(),
32
+ created_at: new Date().toISOString(),
33
+ type: "systemMessage",
34
+ text: [
35
+ "Prisma DB schema generation is not yet completed.",
36
+ "Don't call the any tool function,",
37
+ "but say to process the Prisma DB schema generation.",
38
+ ].join(" "),
39
+ },
40
+ ];
41
+ else if (state.analyze.step !== state.prisma.step)
42
+ return [
43
+ {
44
+ id: v4(),
45
+ created_at: new Date().toISOString(),
46
+ type: "systemMessage",
47
+ text: [
48
+ "Prisma DB schema generation has not been updated",
49
+ "for the latest requirement analysis.",
50
+ "Don't call the any tool function,",
51
+ "but say to re-process the Prisma DB schema generation.",
52
+ ].join(" "),
53
+ },
54
+ ];
55
+ else if (state.prisma.compiled.type !== "success")
56
+ return [
57
+ {
58
+ id: v4(),
59
+ created_at: new Date().toISOString(),
60
+ type: "systemMessage",
61
+ text: [
62
+ "Prisma DB schema generation has not been updated",
63
+ "for the latest requirement analysis.",
64
+ "Don't call the any tool function,",
65
+ "but say to re-process the Prisma DB schema generation.",
66
+ ].join(" "),
67
+ },
68
+ ];
69
+ else if (state.interface === null)
70
+ return [
71
+ {
72
+ id: v4(),
73
+ created_at: new Date().toISOString(),
74
+ type: "systemMessage",
75
+ text: [
76
+ "Interface generation is not yet completed.",
77
+ "Don't call the any tool function,",
78
+ "but say to process the interface generation.",
79
+ ].join(" "),
80
+ },
81
+ ];
82
+
83
+ return [
84
+ {
85
+ id: v4(),
86
+ created_at: new Date().toISOString(),
87
+ type: "systemMessage",
88
+ text: AutoBeSystemPromptConstant.TEST,
89
+ },
90
+ {
91
+ id: v4(),
92
+ created_at: new Date().toISOString(),
93
+ type: "systemMessage",
94
+ text: [
95
+ "# Result of Analyze Agent",
96
+ "- The following document contains the user requirements that were extracted through conversations with the user by the Analyze Agent.",
97
+ "- The database schema was designed based on these requirements, so you may refer to this document when writing test code or reviewing the schema.",
98
+ "",
99
+ `## User Request`,
100
+ "",
101
+ `- ${state.analyze.reason}`,
102
+ "",
103
+ `## Requirement Analysis Report`,
104
+ "",
105
+ "```json",
106
+ JSON.stringify(state.analyze.files),
107
+ "```",
108
+ ].join("\n"),
109
+ },
110
+ {
111
+ id: v4(),
112
+ created_at: new Date().toISOString(),
113
+ type: "systemMessage",
114
+ text: [
115
+ "# Result of Prisma Agent",
116
+ "- Given the following database schema and entity-relationship diagram, write appropriate test code to validate the constraints and relationships defined in the schema. For example, if there is a unique column, include a test that ensures its uniqueness.",
117
+ "- The test code should strictly adhere to the schema and relationships—no violations of constraints should occur.",
118
+ "- Use the information from the schema and diagram to design meaningful and accurate test cases.",
119
+ "",
120
+ "## Prisma DB Schema",
121
+ "```json",
122
+ JSON.stringify(state.prisma.schemas),
123
+ "```",
124
+ "",
125
+ "## Entity Relationship Diagrams",
126
+ "```json",
127
+ JSON.stringify(state.prisma.compiled.diagrams),
128
+ "```",
129
+ ].join("\n"),
130
+ },
131
+ {
132
+ id: v4(),
133
+ created_at: new Date().toISOString(),
134
+ type: "systemMessage",
135
+ text: [
136
+ "# Result of Interfaced Agent",
137
+ "- OpenAPI document generation is ready.",
138
+ "",
139
+ "Call the provided tool function to generate the user scenarios",
140
+ "referencing below OpenAPI document.",
141
+ "",
142
+ `## OpenAPI Document`,
143
+ "```json",
144
+ JSON.stringify(state.interface.document),
145
+ "```",
146
+ ].join("\n"),
147
+ },
148
+ {
149
+ id: v4(),
150
+ created_at: new Date().toISOString(),
151
+ type: "systemMessage",
152
+ text: AutoBeSystemPromptConstant.TEST,
153
+ },
154
+ {
155
+ id: v4(),
156
+ created_at: new Date().toISOString(),
157
+ type: "systemMessage",
158
+ text: [
159
+ `This is a description of different APIs.`,
160
+ `Different APIs may have to be called to create one.`,
161
+ `Check which functions have been developed.`,
162
+ "```json",
163
+ JSON.stringify(endponits, null, 2),
164
+ "```",
165
+ ].join("\n"),
166
+ },
167
+ {
168
+ id: v4(),
169
+ created_at: new Date().toISOString(),
170
+ type: "systemMessage",
171
+ text: [
172
+ "Below is basically the generated test code,",
173
+ "which is a test to verify that the API is simply called and successful.",
174
+ "Since there is already an automatically generated API,",
175
+ "when a user requests to create a test scenario, two or more APIs must be combined,",
176
+ "but a test in which the currently given endpoint is the main must be created.",
177
+ '"Input Test Files" should be selected from the list of files here.',
178
+ "```json",
179
+ JSON.stringify(files, null, 2),
180
+ "```",
181
+ ].join("\n"),
182
+ },
183
+ ];
184
+ };
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.orchestrateTest = void 0;
13
- const orchestrateTest = (ctx) => (props) => __awaiter(void 0, void 0, void 0, function* () {
14
- ctx;
15
- props;
16
- return null;
17
- });
18
- exports.orchestrateTest = orchestrateTest;
19
- //# sourceMappingURL=orchestrateTest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orchestrateTest.js","sourceRoot":"","sources":["../../src/orchestrate/orchestrateTest.ts"],"names":[],"mappings":";;;;;;;;;;;;AASO,MAAM,eAAe,GAC1B,CAAiC,GAAyB,EAAE,EAAE,CAC9D,CACE,KAA8B,EAC8B,EAAE;IAC9D,GAAG,CAAC;IACJ,KAAK,CAAC;IACN,OAAO,IAAK,CAAC;AACf,CAAC,CAAA,CAAC;AARS,QAAA,eAAe,mBAQxB"}
@@ -1,18 +0,0 @@
1
- import {
2
- AutoBeAssistantMessageHistory,
3
- AutoBeTestHistory,
4
- } from "@autobe/interface";
5
- import { ILlmSchema } from "@samchon/openapi";
6
-
7
- import { AutoBeContext } from "../context/AutoBeContext";
8
- import { IAutoBeApplicationProps } from "../context/IAutoBeApplicationProps";
9
-
10
- export const orchestrateTest =
11
- <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>) =>
12
- async (
13
- props: IAutoBeApplicationProps,
14
- ): Promise<AutoBeAssistantMessageHistory | AutoBeTestHistory> => {
15
- ctx;
16
- props;
17
- return null!;
18
- };