@autobe/agent 0.15.1 → 0.16.1

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 (98) hide show
  1. package/LICENSE +661 -21
  2. package/lib/AutoBeAgent.js +2 -2
  3. package/lib/AutoBeAgent.js.map +1 -1
  4. package/lib/AutoBeMockAgent.d.ts +1 -0
  5. package/lib/AutoBeMockAgent.js +18 -4
  6. package/lib/AutoBeMockAgent.js.map +1 -1
  7. package/lib/constants/AutoBeSystemPromptConstant.d.ts +3 -3
  8. package/lib/factory/getAutoBeGenerated.js +2 -1
  9. package/lib/factory/getAutoBeGenerated.js.map +1 -1
  10. package/lib/index.mjs +739 -577
  11. package/lib/index.mjs.map +1 -1
  12. package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.d.ts +0 -15
  13. package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.js +0 -3
  14. package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.js.map +1 -1
  15. package/lib/orchestrate/analyze/orchestrateAnalyze.js +19 -12
  16. package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  17. package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.d.ts +1 -2
  18. package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.js +3 -5
  19. package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.js.map +1 -1
  20. package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.d.ts +7 -1
  21. package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js +363 -4
  22. package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js.map +1 -1
  23. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +3 -3
  24. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +3 -118
  25. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
  26. package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.js +1 -1
  27. package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.js.map +1 -1
  28. package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.d.ts +11 -4
  29. package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js +61 -45
  30. package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js.map +1 -1
  31. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +17 -10
  32. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -1
  33. package/lib/orchestrate/realize/ProviderCodeComparator.d.ts +5 -0
  34. package/lib/orchestrate/realize/ProviderCodeComparator.js +16 -0
  35. package/lib/orchestrate/realize/ProviderCodeComparator.js.map +1 -0
  36. package/lib/orchestrate/realize/orchestrateRealize.js +41 -53
  37. package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
  38. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +13 -87
  39. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
  40. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +32 -43
  41. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
  42. package/lib/orchestrate/realize/orchestrateRealizeCoder.d.ts +3 -2
  43. package/lib/orchestrate/realize/orchestrateRealizeCoder.js +25 -39
  44. package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +1 -1
  45. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +15 -15
  46. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +11 -17
  47. package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +4 -2
  48. package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +21 -17
  49. package/lib/orchestrate/realize/transformRealizeAuthorization.js +5 -9
  50. package/lib/orchestrate/realize/transformRealizeAuthorization.js.map +1 -1
  51. package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.js +9 -0
  52. package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
  53. package/lib/orchestrate/realize/transformRealizeCoderHistories.d.ts +3 -2
  54. package/lib/orchestrate/realize/transformRealizeCoderHistories.js +58 -27
  55. package/lib/orchestrate/realize/transformRealizeCoderHistories.js.map +1 -1
  56. package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.d.ts +5 -0
  57. package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.js +10 -0
  58. package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.js.map +1 -0
  59. package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.d.ts +4 -0
  60. package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js +38 -0
  61. package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js.map +1 -0
  62. package/lib/orchestrate/realize/utils/replaceImportStatements.d.ts +2 -1
  63. package/lib/orchestrate/realize/utils/replaceImportStatements.js +15 -2
  64. package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
  65. package/lib/orchestrate/realize/writeCodeUntilCompilePassed.d.ts +9 -2
  66. package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js +158 -100
  67. package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js.map +1 -1
  68. package/lib/orchestrate/test/orchestrateTest.js +1 -1
  69. package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
  70. package/package.json +7 -7
  71. package/src/AutoBeAgent.ts +1 -1
  72. package/src/AutoBeMockAgent.ts +20 -6
  73. package/src/constants/AutoBeSystemPromptConstant.ts +3 -3
  74. package/src/factory/getAutoBeGenerated.ts +2 -1
  75. package/src/orchestrate/analyze/AutoBeAnalyzeFileSystem.ts +0 -15
  76. package/src/orchestrate/analyze/orchestrateAnalyze.ts +17 -17
  77. package/src/orchestrate/analyze/orchestrateAnalyzeComposer.ts +4 -7
  78. package/src/orchestrate/analyze/orchestrateAnalyzeReviewer.ts +100 -6
  79. package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +5 -21
  80. package/src/orchestrate/analyze/writeDocumentUntilReviewPassed.ts +76 -59
  81. package/src/orchestrate/prisma/transformPrismaComponentsHistories.ts +17 -10
  82. package/src/orchestrate/realize/ProviderCodeComparator.ts +15 -0
  83. package/src/orchestrate/realize/orchestrateRealize.ts +54 -59
  84. package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +12 -120
  85. package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +21 -5
  86. package/src/orchestrate/realize/orchestrateRealizeCoder.ts +10 -9
  87. package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +15 -15
  88. package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +11 -18
  89. package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +4 -2
  90. package/src/orchestrate/realize/structures/IAutoBeRealizeCompile.ts +24 -17
  91. package/src/orchestrate/realize/transformRealizeAuthorization.ts +5 -9
  92. package/src/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.ts +9 -0
  93. package/src/orchestrate/realize/transformRealizeCoderHistories.ts +73 -25
  94. package/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.ts +9 -0
  95. package/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.ts +64 -0
  96. package/src/orchestrate/realize/utils/replaceImportStatements.ts +41 -2
  97. package/src/orchestrate/realize/writeCodeUntilCompilePassed.ts +219 -145
  98. package/src/orchestrate/test/orchestrateTest.ts +1 -1
@@ -68,15 +68,13 @@ export class AutoBeMockAgent extends AutoBeAgentBase implements IAutoBeAgent {
68
68
 
69
69
  // ALREADY REALIZED CASE
70
70
  const state: AutoBeState = createAutoBeState(this.histories_);
71
- if (state.test !== null) {
71
+ if (state.realize !== null) {
72
72
  await sleep_for(2_000);
73
73
  const assistantMessage: AutoBeAssistantMessageHistory = {
74
74
  id: v4(),
75
75
  type: "assistantMessage",
76
76
  text: [
77
- "You've reached to the test agent.",
78
- "",
79
- "The realize agent would be developed until 2025-08-31.",
77
+ "AutoBE has successfully realized the application.",
80
78
  "",
81
79
  "Thanks for using AutoBE!",
82
80
  ].join("\n"),
@@ -88,7 +86,7 @@ export class AutoBeMockAgent extends AutoBeAgentBase implements IAutoBeAgent {
88
86
  return this.histories_;
89
87
  }
90
88
  const take = async (
91
- type: "analyze" | "prisma" | "interface" | "test",
89
+ type: "analyze" | "prisma" | "interface" | "test" | "realize",
92
90
  ): Promise<void> => {
93
91
  for (const s of this.getEventSnapshots(type)) {
94
92
  const time: number = sleepMap[s.event.type] ?? 500;
@@ -105,6 +103,7 @@ export class AutoBeMockAgent extends AutoBeAgentBase implements IAutoBeAgent {
105
103
  else if (state.prisma === null) await take("prisma");
106
104
  else if (state.interface === null) await take("interface");
107
105
  else if (state.test === null) await take("test");
106
+ else if (state.realize === null) await take("realize");
108
107
  return this.histories_;
109
108
  }
110
109
 
@@ -117,7 +116,7 @@ export class AutoBeMockAgent extends AutoBeAgentBase implements IAutoBeAgent {
117
116
  }
118
117
 
119
118
  private getEventSnapshots(
120
- state: "analyze" | "prisma" | "interface" | "test",
119
+ state: "analyze" | "prisma" | "interface" | "test" | "realize",
121
120
  ): AutoBeEventSnapshot[] {
122
121
  return this.props_.preset[state];
123
122
  }
@@ -135,14 +134,17 @@ export namespace AutoBeMockAgent {
135
134
  prisma: AutoBeEventSnapshot[];
136
135
  interface: AutoBeEventSnapshot[];
137
136
  test: AutoBeEventSnapshot[];
137
+ realize: AutoBeEventSnapshot[];
138
138
  }
139
139
  }
140
140
 
141
141
  const sleepMap: Partial<Record<AutoBeEvent.Type, number>> = {
142
+ // ANALYZE
142
143
  analyzeStart: 1_000,
143
144
  analyzeWrite: 500,
144
145
  analyzeReview: 300,
145
146
  analyzeComplete: 1_000,
147
+ // PRISMA
146
148
  prismaStart: 1_000,
147
149
  prismaComponents: 1_000,
148
150
  prismaSchemas: 500,
@@ -150,16 +152,28 @@ const sleepMap: Partial<Record<AutoBeEvent.Type, number>> = {
150
152
  prismaCorrect: 500,
151
153
  prismaInsufficient: 1_000,
152
154
  prismaComplete: 1_000,
155
+ // INTERFACE
153
156
  interfaceStart: 1_000,
154
157
  interfaceEndpoints: 1_000,
155
158
  interfaceOperations: 400,
156
159
  interfaceSchemas: 400,
157
160
  interfaceComplement: 2_000,
158
161
  interfaceComplete: 1_000,
162
+ // TEST
159
163
  testStart: 1_000,
160
164
  testScenario: 1_000,
161
165
  testWrite: 40,
162
166
  testValidate: 100,
163
167
  testCorrect: 100,
164
168
  testComplete: 1_000,
169
+ // REALIZE
170
+ realizeStart: 1_000,
171
+ realizeComplete: 1_000,
172
+ realizeWrite: 80,
173
+ realizeCorrect: 80,
174
+ realizeValidate: 200,
175
+ realizeAuthorizationStart: 1_000,
176
+ realizeAuthorizationWrite: 200,
177
+ realizeAuthorizationValidate: 200,
178
+ realizeAuthorizationComplete: 1_000,
165
179
  };