@autobe/agent 0.9.1 → 0.10.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 +16 -5
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +6 -4
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/context/AutoBeTokenUsage.d.ts +15 -1
- package/lib/context/AutoBeTokenUsage.js +56 -1
- package/lib/context/AutoBeTokenUsage.js.map +1 -1
- package/lib/context/IAutoBeApplicationProps.d.ts +0 -61
- package/lib/factory/createAutoBeApplication.js +298 -773
- package/lib/factory/createAutoBeApplication.js.map +1 -1
- package/lib/index.mjs +5116 -7271
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js +82 -319
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js +0 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +97 -294
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js +2 -2
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
- package/lib/orchestrate/index.d.ts +2 -2
- package/lib/orchestrate/index.js +4 -4
- package/lib/orchestrate/index.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterface.js +9 -3
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +56 -142
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +195 -199
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +75 -172
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +772 -1097
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/transformInterfaceHistories.js +2 -0
- package/lib/orchestrate/interface/transformInterfaceHistories.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +64 -175
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +552 -1073
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js +571 -1119
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +9 -0
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js +8 -0
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.d.ts +11 -0
- package/lib/orchestrate/realize/orchestrateRealize.js +109 -0
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeCoder.d.ts +25 -0
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js +337 -0
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeIntegrator.d.ts +52 -0
- package/lib/orchestrate/realize/orchestrateRealizeIntegrator.js +57 -0
- package/lib/orchestrate/realize/orchestrateRealizeIntegrator.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizePlanner.d.ts +80 -0
- package/lib/orchestrate/realize/orchestrateRealizePlanner.js +53 -0
- package/lib/orchestrate/realize/orchestrateRealizePlanner.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeValidator.d.ts +46 -0
- package/lib/orchestrate/realize/orchestrateRealizeValidator.js +37 -0
- package/lib/orchestrate/realize/orchestrateRealizeValidator.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +33 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js +3 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js.map +1 -0
- package/lib/orchestrate/realize/transformRealizeCoderHistories.d.ts +5 -0
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js +127 -0
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js.map +1 -0
- package/lib/orchestrate/test/compile/completeTestCode.d.ts +2 -0
- package/lib/orchestrate/test/compile/completeTestCode.js +21 -0
- package/lib/orchestrate/test/compile/completeTestCode.js.map +1 -0
- package/lib/orchestrate/test/{filterTestFileName.js → compile/filterTestFileName.js} +1 -1
- package/lib/orchestrate/test/compile/filterTestFileName.js.map +1 -0
- package/lib/orchestrate/test/compile/getTestExternalDeclarations.d.ts +3 -0
- package/lib/orchestrate/test/compile/getTestExternalDeclarations.js +27 -0
- package/lib/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -0
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +5 -0
- package/lib/orchestrate/test/{compileTestScenario.js → compile/getTestScenarioArtifacts.js} +11 -5
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -0
- package/lib/orchestrate/test/orchestrateTest.js +14 -9
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +3 -2
- package/lib/orchestrate/test/orchestrateTestCorrect.js +150 -349
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +323 -566
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.d.ts +3 -2
- package/lib/orchestrate/test/orchestrateTestWrite.js +139 -76
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +121 -0
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.js +3 -0
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestFunction.d.ts +8 -0
- package/lib/{utils/types/BackoffOptions.js → orchestrate/test/structures/IAutoBeTestFunction.js} +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestFunction.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +32 -22
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +2 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +112 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.js +3 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.d.ts +7 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.js +3 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.js.map +1 -0
- package/lib/orchestrate/test/transformTestCorrectHistories.d.ts +3 -2
- package/lib/orchestrate/test/transformTestCorrectHistories.js +28 -41
- package/lib/orchestrate/test/transformTestCorrectHistories.js.map +1 -1
- package/lib/orchestrate/test/transformTestWriteHistories.d.ts +5 -4
- package/lib/orchestrate/test/transformTestWriteHistories.js +169 -32
- package/lib/orchestrate/test/transformTestWriteHistories.js.map +1 -1
- package/lib/structures/IAutoBeConfig.d.ts +11 -0
- package/lib/structures/IAutoBeProps.d.ts +12 -1
- package/lib/utils/backoffRetry.d.ts +4 -7
- package/lib/utils/backoffRetry.js +19 -37
- package/lib/utils/backoffRetry.js.map +1 -1
- package/lib/utils/forceRetry.d.ts +1 -0
- package/lib/{orchestrate/orchestrateRealize.js → utils/forceRetry.js} +15 -8
- package/lib/utils/forceRetry.js.map +1 -0
- package/package.json +8 -8
- package/src/AutoBeAgent.ts +26 -4
- package/src/constants/AutoBeSystemPromptConstant.ts +6 -4
- package/src/context/AutoBeTokenUsage.ts +85 -1
- package/src/context/IAutoBeApplicationProps.ts +0 -62
- package/src/factory/createAutoBeApplication.ts +2 -3
- package/src/orchestrate/analyze/AutoBeAnalyzeAgent.ts +8 -3
- package/src/orchestrate/analyze/AutoBeAnalyzeReviewer.ts +0 -1
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +8 -37
- package/src/orchestrate/facade/transformFacadeStateMessage.ts +2 -1
- package/src/orchestrate/index.ts +2 -2
- package/src/orchestrate/interface/orchestrateInterface.ts +7 -0
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +4 -3
- package/src/orchestrate/interface/orchestrateInterfaceComponents.ts +26 -23
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +6 -4
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +14 -11
- package/src/orchestrate/interface/transformInterfaceHistories.ts +2 -0
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +10 -5
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +11 -5
- package/src/orchestrate/prisma/orchestratePrismaSchema.ts +16 -8
- package/src/orchestrate/prisma/transformPrismaComponentsHistories.ts +9 -0
- package/src/orchestrate/prisma/transformPrismaSchemaHistories.ts +8 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +169 -0
- package/src/orchestrate/realize/orchestrateRealizeCoder.ts +156 -0
- package/src/orchestrate/realize/orchestrateRealizeIntegrator.ts +75 -0
- package/src/orchestrate/realize/orchestrateRealizePlanner.ts +115 -0
- package/src/orchestrate/realize/orchestrateRealizeValidator.ts +64 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +36 -0
- package/src/orchestrate/realize/transformRealizeCoderHistories.ts +136 -0
- package/src/orchestrate/test/compile/completeTestCode.ts +35 -0
- package/src/orchestrate/test/{filterTestFileName.ts → compile/filterTestFileName.ts} +1 -1
- package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +24 -0
- package/src/orchestrate/test/{compileTestScenario.ts → compile/getTestScenarioArtifacts.ts} +17 -8
- package/src/orchestrate/test/experimental/orchestrateTestCorrect.ast +240 -0
- package/src/orchestrate/test/experimental/orchestrateTestWrite.ast +316 -0
- package/src/orchestrate/test/experimental/transformTestCorrectHistories.ast +52 -0
- package/src/orchestrate/test/orchestrateTest.ts +38 -16
- package/src/orchestrate/test/orchestrateTestCorrect.ts +111 -338
- package/src/orchestrate/test/orchestrateTestScenario.ts +114 -69
- package/src/orchestrate/test/orchestrateTestWrite.ts +55 -153
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +126 -0
- package/src/orchestrate/test/structures/IAutoBeTestFunction.ts +10 -0
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +32 -22
- package/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.ts +3 -0
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +117 -0
- package/src/orchestrate/test/structures/IAutoBeTestWriteResult.ts +9 -0
- package/src/orchestrate/test/transformTestCorrectHistories.ts +38 -43
- package/src/orchestrate/test/transformTestWriteHistories.ts +89 -35
- package/src/structures/IAutoBeConfig.ts +9 -0
- package/src/structures/IAutoBeProps.ts +17 -1
- package/src/utils/backoffRetry.ts +25 -36
- package/src/utils/forceRetry.ts +13 -0
- package/lib/factory/invertOpenApiDocument.d.ts +0 -3
- package/lib/factory/invertOpenApiDocument.js +0 -51
- package/lib/factory/invertOpenApiDocument.js.map +0 -1
- package/lib/orchestrate/orchestrateRealize.d.ts +0 -5
- package/lib/orchestrate/orchestrateRealize.js.map +0 -1
- package/lib/orchestrate/test/compileTestScenario.d.ts +0 -5
- package/lib/orchestrate/test/compileTestScenario.js.map +0 -1
- package/lib/orchestrate/test/filterTestFileName.js.map +0 -1
- package/lib/utils/StringUtil.d.ts +0 -4
- package/lib/utils/StringUtil.js +0 -43
- package/lib/utils/StringUtil.js.map +0 -1
- package/lib/utils/types/BackoffOptions.d.ts +0 -12
- package/lib/utils/types/BackoffOptions.js.map +0 -1
- package/src/factory/invertOpenApiDocument.ts +0 -63
- package/src/orchestrate/orchestrateRealize.ts +0 -18
- package/src/utils/StringUtil.ts +0 -45
- package/src/utils/types/BackoffOptions.ts +0 -15
- /package/lib/orchestrate/test/{filterTestFileName.d.ts → compile/filterTestFileName.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autobe/agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "AI backend server code generator",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"author": "Wrtn Technologies",
|
|
@@ -20,17 +20,18 @@
|
|
|
20
20
|
"README.md"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@agentica/core": "^0.
|
|
23
|
+
"@agentica/core": "^0.30.2",
|
|
24
24
|
"@rollup/plugin-json": "^6.1.0",
|
|
25
25
|
"@prisma/internals": "^6.7.0",
|
|
26
|
-
"@samchon/openapi": "^4.
|
|
26
|
+
"@samchon/openapi": "^4.4.1",
|
|
27
27
|
"@types/node": "^22.15.18",
|
|
28
28
|
"chalk": "4.1.2",
|
|
29
29
|
"openai": "^5.2.0",
|
|
30
30
|
"tstl": "^3.0.0",
|
|
31
|
-
"typia": "^9.
|
|
31
|
+
"typia": "^9.4.0",
|
|
32
32
|
"uuid": "^11.1.0",
|
|
33
|
-
"@autobe/interface": "^0.
|
|
33
|
+
"@autobe/interface": "^0.10.0",
|
|
34
|
+
"@autobe/utils": "^0.10.0"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@rollup/plugin-terser": "^0.4.4",
|
|
@@ -43,8 +44,8 @@
|
|
|
43
44
|
"ts-node": "^10.9.2",
|
|
44
45
|
"ts-patch": "^3.3.0",
|
|
45
46
|
"typescript": "~5.8.3",
|
|
46
|
-
"@autobe/filesystem": "^0.
|
|
47
|
-
"@autobe/compiler": "^0.
|
|
47
|
+
"@autobe/filesystem": "^0.10.0",
|
|
48
|
+
"@autobe/compiler": "^0.10.0"
|
|
48
49
|
},
|
|
49
50
|
"keywords": [
|
|
50
51
|
"ai",
|
|
@@ -80,7 +81,6 @@
|
|
|
80
81
|
},
|
|
81
82
|
"scripts": {
|
|
82
83
|
"build": "rimraf lib && pnpm run build:prompt && rollup -c && tsc",
|
|
83
|
-
"build:examples": "ts-node build/examples.ts",
|
|
84
84
|
"build:prompt": "ts-node build/prompt.ts",
|
|
85
85
|
"dev": "rimraf lib && pnpm run build:prompt && tsc --watch"
|
|
86
86
|
},
|
package/src/AutoBeAgent.ts
CHANGED
|
@@ -19,6 +19,7 @@ import { createAutoBeController } from "./factory/createAutoBeApplication";
|
|
|
19
19
|
import { createAutoBeState } from "./factory/createAutoBeState";
|
|
20
20
|
import { transformFacadeStateMessage } from "./orchestrate/facade/transformFacadeStateMessage";
|
|
21
21
|
import { IAutoBeProps } from "./structures/IAutoBeProps";
|
|
22
|
+
import { randomBackoffStrategy } from "./utils/backoffRetry";
|
|
22
23
|
import { emplaceMap } from "./utils/emplaceMap";
|
|
23
24
|
|
|
24
25
|
/**
|
|
@@ -61,6 +62,9 @@ export class AutoBeAgent<Model extends ILlmSchema.Model> {
|
|
|
61
62
|
/** @internal */
|
|
62
63
|
private readonly state_: AutoBeState;
|
|
63
64
|
|
|
65
|
+
/** @internal */
|
|
66
|
+
private readonly usage_: AutoBeTokenUsage;
|
|
67
|
+
|
|
64
68
|
/** @internal */
|
|
65
69
|
private readonly listeners_: Map<
|
|
66
70
|
string,
|
|
@@ -94,6 +98,11 @@ export class AutoBeAgent<Model extends ILlmSchema.Model> {
|
|
|
94
98
|
this.state_ = createAutoBeState(this.histories_);
|
|
95
99
|
this.listeners_ = new Map();
|
|
96
100
|
|
|
101
|
+
this.usage_ =
|
|
102
|
+
props.tokenUsage instanceof AutoBeTokenUsage
|
|
103
|
+
? props.tokenUsage
|
|
104
|
+
: new AutoBeTokenUsage(props.tokenUsage);
|
|
105
|
+
|
|
97
106
|
// CONSTRUCT AGENTICA
|
|
98
107
|
const vendor: IAgenticaVendor = {
|
|
99
108
|
...props.vendor,
|
|
@@ -102,11 +111,14 @@ export class AutoBeAgent<Model extends ILlmSchema.Model> {
|
|
|
102
111
|
this.context_ = {
|
|
103
112
|
vendor,
|
|
104
113
|
model: props.model,
|
|
105
|
-
config:
|
|
114
|
+
config: {
|
|
115
|
+
backoffStrategy: randomBackoffStrategy,
|
|
116
|
+
...props.config,
|
|
117
|
+
},
|
|
106
118
|
compiler: props.compiler,
|
|
107
119
|
histories: () => this.histories_,
|
|
108
120
|
state: () => this.state_,
|
|
109
|
-
usage: () => this.
|
|
121
|
+
usage: () => this.getTokenUsage(),
|
|
110
122
|
files: (options) => this.getFiles(options),
|
|
111
123
|
dispatch: (event) => {
|
|
112
124
|
this.dispatch(event).catch(() => {});
|
|
@@ -124,6 +136,7 @@ export class AutoBeAgent<Model extends ILlmSchema.Model> {
|
|
|
124
136
|
execute: () => transformFacadeStateMessage(this.state_),
|
|
125
137
|
},
|
|
126
138
|
},
|
|
139
|
+
tokenUsage: props.tokenUsage?.facade,
|
|
127
140
|
controllers: [
|
|
128
141
|
createAutoBeController({
|
|
129
142
|
model: props.model,
|
|
@@ -131,6 +144,7 @@ export class AutoBeAgent<Model extends ILlmSchema.Model> {
|
|
|
131
144
|
}),
|
|
132
145
|
],
|
|
133
146
|
});
|
|
147
|
+
|
|
134
148
|
this.agentica_.getHistories().push(
|
|
135
149
|
...this.histories_
|
|
136
150
|
.map((history) =>
|
|
@@ -314,7 +328,15 @@ export class AutoBeAgent<Model extends ILlmSchema.Model> {
|
|
|
314
328
|
]
|
|
315
329
|
: [],
|
|
316
330
|
),
|
|
317
|
-
...(this.state_.interface
|
|
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
|
+
: {}),
|
|
318
340
|
...(this.state_.test
|
|
319
341
|
? Object.fromEntries(
|
|
320
342
|
this.state_.test.files.map((f) => [f.location, f.content]),
|
|
@@ -383,7 +405,7 @@ export class AutoBeAgent<Model extends ILlmSchema.Model> {
|
|
|
383
405
|
* agent, operation type, and consumption category
|
|
384
406
|
*/
|
|
385
407
|
public getTokenUsage(): AutoBeTokenUsage {
|
|
386
|
-
return this.
|
|
408
|
+
return this.usage_;
|
|
387
409
|
}
|
|
388
410
|
|
|
389
411
|
/** @internal */
|