@autobe/agent 0.10.5 → 0.11.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/lib/AutoBeAgent.js +13 -46
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +11 -6
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/context/AutoBeContext.d.ts +3 -2
- package/lib/factory/getAutoBeGenerated.d.ts +5 -0
- package/lib/factory/getAutoBeGenerated.js +307 -0
- package/lib/factory/getAutoBeGenerated.js.map +1 -0
- package/lib/index.mjs +1631 -1389
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.d.ts +2 -7
- package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.js +1 -9
- package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.js.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeRole.d.ts +13 -0
- package/lib/orchestrate/analyze/AutoBeAnalyzeRole.js +3 -0
- package/lib/orchestrate/analyze/AutoBeAnalyzeRole.js.map +1 -0
- package/lib/orchestrate/analyze/orchestrateAnalyze.d.ts +0 -25
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +22 -420
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.d.ts +6 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.js +561 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.js.map +1 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.d.ts +6 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js +41 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js.map +1 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +14 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +468 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -0
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeComposerApplication.d.ts +68 -0
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeComposerApplication.js +3 -0
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeComposerApplication.js.map +1 -0
- package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.d.ts +5 -0
- package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.js +27 -0
- package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.js.map +1 -0
- package/lib/orchestrate/analyze/transformAnalyzeWriteHistories.d.ts +12 -0
- package/lib/orchestrate/analyze/transformAnalyzeWriteHistories.js +78 -0
- package/lib/orchestrate/analyze/transformAnalyzeWriteHistories.js.map +1 -0
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.d.ts +6 -0
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js +58 -0
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterface.js +0 -2
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +17 -137
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +92 -141
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrisma.js +9 -5
- package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +54 -25
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +4 -3
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/prisma/{orchestratePrismaSchema.d.ts → orchestratePrismaSchemas.d.ts} +2 -4
- package/lib/orchestrate/prisma/{orchestratePrismaSchema.js → orchestratePrismaSchemas.js} +269 -203
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -0
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +1 -1
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaCorrectHistories.js +1 -1
- package/lib/orchestrate/prisma/transformPrismaHistories.js +1 -1
- package/lib/orchestrate/prisma/transformPrismaHistories.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.d.ts +2 -6
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js +24 -32
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/orchestrate/realize/RealizePipe.d.ts +5 -0
- package/lib/orchestrate/realize/RealizePipe.js +14 -0
- package/lib/orchestrate/realize/RealizePipe.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealize.d.ts +0 -6
- package/lib/orchestrate/realize/orchestrateRealize.js +6 -43
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCoder.d.ts +3 -3
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js +124 -59
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +1 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +188 -18
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +23 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.js +3 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +2 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js +5 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js.map +1 -0
- package/lib/orchestrate/realize/transformRealizeCoderHistories.d.ts +2 -1
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js +50 -36
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js.map +1 -1
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.d.ts +5 -0
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js +123 -0
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js.map +1 -0
- package/lib/orchestrate/test/compile/getTestExternalDeclarations.js +4 -1
- package/lib/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -1
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js +2 -1
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTest.js +11 -5
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +3 -2
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/structures/IAutoBeProps.d.ts +8 -8
- package/lib/utils/pipe.d.ts +5 -0
- package/lib/utils/pipe.js +14 -0
- package/lib/utils/pipe.js.map +1 -0
- package/package.json +6 -6
- package/src/AutoBeAgent.ts +22 -76
- package/src/constants/AutoBeSystemPromptConstant.ts +11 -6
- package/src/context/AutoBeContext.ts +3 -1
- package/src/factory/getAutoBeGenerated.ts +113 -0
- package/src/orchestrate/analyze/AutoBeAnalyzeFileSystem.ts +5 -13
- package/src/orchestrate/analyze/AutoBeAnalyzeRole.ts +14 -0
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +30 -165
- package/src/orchestrate/analyze/orchestrateAnalyzeComposer.ts +115 -0
- package/src/orchestrate/analyze/orchestrateAnalyzeReviewer.ts +39 -0
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +106 -0
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeComposerApplication.ts +74 -0
- package/src/orchestrate/analyze/transformAnalyzeReviewerHistories.ts +31 -0
- package/src/orchestrate/analyze/transformAnalyzeWriteHistories.ts +94 -0
- package/src/orchestrate/analyze/writeDocumentUntilReviewPassed.ts +66 -0
- package/src/orchestrate/interface/orchestrateInterface.ts +0 -2
- package/src/orchestrate/interface/orchestrateInterfaceComponents.ts +2 -3
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +21 -0
- package/src/orchestrate/prisma/orchestratePrisma.ts +12 -5
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +4 -13
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +9 -4
- package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +265 -0
- package/src/orchestrate/prisma/transformPrismaSchemaHistories.ts +26 -37
- package/src/orchestrate/realize/RealizePipe.ts +39 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +3 -91
- package/src/orchestrate/realize/orchestrateRealizeCoder.ts +60 -25
- package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +192 -18
- package/src/orchestrate/realize/structures/IAutoBeRealizeCompile.ts +34 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.ts +2 -0
- package/src/orchestrate/realize/transformRealizeCoderHistories.ts +58 -34
- package/src/orchestrate/realize/writeCodeUntilCompilePassed.ts +178 -0
- package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +5 -4
- package/src/orchestrate/test/compile/getTestScenarioArtifacts.ts +7 -2
- package/src/orchestrate/test/orchestrateTest.ts +14 -12
- package/src/orchestrate/test/orchestrateTestCorrect.ts +10 -9
- package/src/structures/IAutoBeProps.ts +10 -7
- package/src/utils/pipe.ts +39 -0
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.d.ts +0 -20
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js +0 -735
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +0 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.d.ts +0 -15
- package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js +0 -44
- package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js.map +0 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +0 -1
- package/src/orchestrate/analyze/AutoBeAnalyzeAgent.ts +0 -219
- package/src/orchestrate/analyze/AutoBeAnalyzeReviewer.ts +0 -62
- package/src/orchestrate/prisma/orchestratePrismaSchema.ts +0 -157
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autobe/agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "AI backend server code generator",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"author": "Wrtn Technologies",
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
"README.md"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@agentica/core": "^0.30.
|
|
23
|
+
"@agentica/core": "^0.30.4",
|
|
24
24
|
"@prisma/internals": "^6.7.0",
|
|
25
25
|
"@samchon/openapi": "^4.5.0",
|
|
26
26
|
"openai": "^5.2.0",
|
|
27
27
|
"tstl": "^3.0.0",
|
|
28
28
|
"typia": "^9.5.0",
|
|
29
29
|
"uuid": "^11.1.0",
|
|
30
|
-
"@autobe/interface": "^0.
|
|
31
|
-
"@autobe/utils": "^0.
|
|
30
|
+
"@autobe/interface": "^0.11.0",
|
|
31
|
+
"@autobe/utils": "^0.11.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@rollup/plugin-json": "^6.1.0",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"ts-node": "^10.9.2",
|
|
41
41
|
"ts-patch": "^3.3.0",
|
|
42
42
|
"typescript": "~5.8.3",
|
|
43
|
-
"@autobe/compiler": "^0.
|
|
44
|
-
"@autobe/filesystem": "^0.
|
|
43
|
+
"@autobe/compiler": "^0.11.0",
|
|
44
|
+
"@autobe/filesystem": "^0.11.0"
|
|
45
45
|
},
|
|
46
46
|
"keywords": [
|
|
47
47
|
"ai",
|
package/src/AutoBeAgent.ts
CHANGED
|
@@ -5,10 +5,11 @@ import {
|
|
|
5
5
|
AutoBeHistory,
|
|
6
6
|
AutoBeUserMessageContent,
|
|
7
7
|
AutoBeUserMessageHistory,
|
|
8
|
+
IAutoBeCompilerListener,
|
|
8
9
|
IAutoBeGetFilesOptions,
|
|
9
10
|
} from "@autobe/interface";
|
|
10
11
|
import { ILlmSchema } from "@samchon/openapi";
|
|
11
|
-
import { Semaphore } from "tstl";
|
|
12
|
+
import { Semaphore, Singleton } from "tstl";
|
|
12
13
|
import { v4 } from "uuid";
|
|
13
14
|
|
|
14
15
|
import { AutoBeContext } from "./context/AutoBeContext";
|
|
@@ -17,6 +18,7 @@ import { AutoBeTokenUsage } from "./context/AutoBeTokenUsage";
|
|
|
17
18
|
import { createAgenticaHistory } from "./factory/createAgenticaHistory";
|
|
18
19
|
import { createAutoBeController } from "./factory/createAutoBeApplication";
|
|
19
20
|
import { createAutoBeState } from "./factory/createAutoBeState";
|
|
21
|
+
import { getAutoBeGenerated } from "./factory/getAutoBeGenerated";
|
|
20
22
|
import { transformFacadeStateMessage } from "./orchestrate/facade/transformFacadeStateMessage";
|
|
21
23
|
import { IAutoBeProps } from "./structures/IAutoBeProps";
|
|
22
24
|
import { randomBackoffStrategy } from "./utils/backoffRetry";
|
|
@@ -108,6 +110,17 @@ export class AutoBeAgent<Model extends ILlmSchema.Model> {
|
|
|
108
110
|
...props.vendor,
|
|
109
111
|
semaphore: new Semaphore(props.vendor.semaphore ?? 16),
|
|
110
112
|
};
|
|
113
|
+
const compilerListener: IAutoBeCompilerListener = {
|
|
114
|
+
realize: {
|
|
115
|
+
test: {
|
|
116
|
+
onOperation: async () => {},
|
|
117
|
+
onReset: async () => {},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
const compiler = new Singleton(async () =>
|
|
122
|
+
props.compiler(compilerListener),
|
|
123
|
+
);
|
|
111
124
|
this.context_ = {
|
|
112
125
|
vendor,
|
|
113
126
|
model: props.model,
|
|
@@ -115,7 +128,8 @@ export class AutoBeAgent<Model extends ILlmSchema.Model> {
|
|
|
115
128
|
backoffStrategy: randomBackoffStrategy,
|
|
116
129
|
...props.config,
|
|
117
130
|
},
|
|
118
|
-
compiler:
|
|
131
|
+
compiler: () => compiler.get(),
|
|
132
|
+
compilerListener,
|
|
119
133
|
histories: () => this.histories_,
|
|
120
134
|
state: () => this.state_,
|
|
121
135
|
usage: () => this.getTokenUsage(),
|
|
@@ -123,7 +137,7 @@ export class AutoBeAgent<Model extends ILlmSchema.Model> {
|
|
|
123
137
|
dispatch: (event) => {
|
|
124
138
|
this.dispatch(event).catch(() => {});
|
|
125
139
|
},
|
|
126
|
-
}
|
|
140
|
+
} satisfies AutoBeContext<Model>;
|
|
127
141
|
this.agentica_ = new MicroAgentica({
|
|
128
142
|
vendor,
|
|
129
143
|
model: props.model,
|
|
@@ -287,79 +301,11 @@ export class AutoBeAgent<Model extends ILlmSchema.Model> {
|
|
|
287
301
|
public async getFiles(
|
|
288
302
|
options?: Partial<IAutoBeGetFilesOptions>,
|
|
289
303
|
): Promise<Record<string, string>> {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
value,
|
|
296
|
-
])
|
|
297
|
-
: [],
|
|
298
|
-
),
|
|
299
|
-
...Object.fromEntries(
|
|
300
|
-
!!this.state_.prisma?.result
|
|
301
|
-
? [
|
|
302
|
-
...Object.entries(
|
|
303
|
-
(options?.dbms ?? "postgres") === "postgres"
|
|
304
|
-
? this.state_.prisma.schemas
|
|
305
|
-
: await this.context_.compiler.prisma.write(
|
|
306
|
-
this.state_.prisma.result.data,
|
|
307
|
-
options!.dbms!,
|
|
308
|
-
),
|
|
309
|
-
).map(([key, value]) => [
|
|
310
|
-
`prisma/schema/${key.split("/").at(-1)}`,
|
|
311
|
-
value,
|
|
312
|
-
]),
|
|
313
|
-
...(this.state_.prisma.compiled.type === "success"
|
|
314
|
-
? [["docs/ERD.md", this.state_.prisma.compiled.document]]
|
|
315
|
-
: []),
|
|
316
|
-
...(this.state_.prisma.compiled.type === "failure"
|
|
317
|
-
? [
|
|
318
|
-
[
|
|
319
|
-
"prisma/compile-error-reason.log",
|
|
320
|
-
this.state_.prisma.compiled.reason,
|
|
321
|
-
],
|
|
322
|
-
]
|
|
323
|
-
: []),
|
|
324
|
-
[
|
|
325
|
-
"autobe/prisma.json",
|
|
326
|
-
JSON.stringify(this.state_.prisma.result.data, null, 2),
|
|
327
|
-
],
|
|
328
|
-
]
|
|
329
|
-
: [],
|
|
330
|
-
),
|
|
331
|
-
...(this.state_.interface
|
|
332
|
-
? this.state_.test
|
|
333
|
-
? Object.fromEntries(
|
|
334
|
-
Object.entries(this.state_.interface.files).filter(
|
|
335
|
-
([key]) => key.startsWith("test/features/") === false,
|
|
336
|
-
),
|
|
337
|
-
)
|
|
338
|
-
: this.state_.interface.files
|
|
339
|
-
: {}),
|
|
340
|
-
...(this.state_.test
|
|
341
|
-
? Object.fromEntries(
|
|
342
|
-
this.state_.test.files.map((f) => [f.location, f.content]),
|
|
343
|
-
)
|
|
344
|
-
: {}),
|
|
345
|
-
...(this.state_.realize ? this.state_.realize.files : {}),
|
|
346
|
-
"autobe/histories.json": JSON.stringify(this.histories_, null, 2),
|
|
347
|
-
"autobe/tokenUsage.json": JSON.stringify(this.getTokenUsage(), null, 2),
|
|
348
|
-
...(this.state_.interface
|
|
349
|
-
? {
|
|
350
|
-
"autobe/document.json": JSON.stringify(
|
|
351
|
-
this.state_.interface.document,
|
|
352
|
-
null,
|
|
353
|
-
2,
|
|
354
|
-
),
|
|
355
|
-
}
|
|
356
|
-
: {}),
|
|
357
|
-
};
|
|
358
|
-
return Object.fromEntries(
|
|
359
|
-
Object.entries(files).map(([k, v]) => [
|
|
360
|
-
k.startsWith("/") ? k.substring(1) : k,
|
|
361
|
-
v,
|
|
362
|
-
]),
|
|
304
|
+
return getAutoBeGenerated(
|
|
305
|
+
await this.getContext(),
|
|
306
|
+
this.histories_,
|
|
307
|
+
this.usage_,
|
|
308
|
+
options,
|
|
363
309
|
);
|
|
364
310
|
}
|
|
365
311
|
|