@autobe/agent 0.10.6 → 0.11.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.
- 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 +1652 -1402
- 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/orchestrate/test/orchestrateTestWrite.js +22 -13
- package/lib/orchestrate/test/orchestrateTestWrite.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/orchestrate/test/orchestrateTestWrite.ts +33 -27
- 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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IAgenticaController, MicroAgentica } from "@agentica/core";
|
|
2
2
|
import {
|
|
3
3
|
AutoBeTestValidateEvent,
|
|
4
|
+
IAutoBeCompiler,
|
|
4
5
|
IAutoBeTypeScriptCompileResult,
|
|
5
6
|
} from "@autobe/interface";
|
|
6
7
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
@@ -51,14 +52,14 @@ const compile = async <Model extends ILlmSchema.Model>(
|
|
|
51
52
|
ctx: AutoBeContext<Model>,
|
|
52
53
|
func: IAutoBeTestFunction,
|
|
53
54
|
): Promise<AutoBeTestValidateEvent> => {
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
const compiler: IAutoBeCompiler = await ctx.compiler();
|
|
56
|
+
const result: IAutoBeTypeScriptCompileResult = await compiler.test.compile({
|
|
57
|
+
files: {
|
|
58
|
+
...func.artifacts.dto,
|
|
59
|
+
...func.artifacts.sdk,
|
|
60
|
+
[func.location]: func.script,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
62
63
|
return {
|
|
63
64
|
type: "testValidate",
|
|
64
65
|
file: {
|
|
@@ -66,7 +67,7 @@ const compile = async <Model extends ILlmSchema.Model>(
|
|
|
66
67
|
location: func.location,
|
|
67
68
|
content: func.script,
|
|
68
69
|
},
|
|
69
|
-
result
|
|
70
|
+
result,
|
|
70
71
|
created_at: new Date().toISOString(),
|
|
71
72
|
step: ctx.state().analyze?.step ?? 0,
|
|
72
73
|
};
|
|
@@ -22,39 +22,45 @@ export async function orchestrateTestWrite<Model extends ILlmSchema.Model>(
|
|
|
22
22
|
const start: Date = new Date();
|
|
23
23
|
let complete: number = 0;
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
const result = await Promise.all(
|
|
26
26
|
/**
|
|
27
27
|
* Generate test code for each scenario. Maps through plans array to create
|
|
28
28
|
* individual test code implementations. Each scenario is processed to
|
|
29
29
|
* generate corresponding test code and progress events.
|
|
30
30
|
*/
|
|
31
|
-
scenarios.map((scenario) =>
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
31
|
+
scenarios.map(async (scenario) => {
|
|
32
|
+
try {
|
|
33
|
+
const r = await forceRetry(async () => {
|
|
34
|
+
const artifacts: IAutoBeTestScenarioArtifacts =
|
|
35
|
+
await getTestScenarioArtifacts(ctx, scenario);
|
|
36
|
+
const result: IAutoBeTestWriteApplication.IProps = await process(
|
|
37
|
+
ctx,
|
|
38
|
+
scenario,
|
|
39
|
+
artifacts,
|
|
40
|
+
);
|
|
41
|
+
const event: AutoBeTestWriteEvent = {
|
|
42
|
+
type: "testWrite",
|
|
43
|
+
created_at: start.toISOString(),
|
|
44
|
+
location: `test/features/api/${result.domain}/${scenario.functionName}.ts`,
|
|
45
|
+
...result,
|
|
46
|
+
completed: ++complete,
|
|
47
|
+
total: scenarios.length,
|
|
48
|
+
step: ctx.state().interface?.step ?? 0,
|
|
49
|
+
};
|
|
50
|
+
ctx.dispatch(event);
|
|
51
|
+
return {
|
|
52
|
+
scenario,
|
|
53
|
+
artifacts,
|
|
54
|
+
event,
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
return r;
|
|
58
|
+
} catch {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
57
62
|
);
|
|
63
|
+
return result.filter((r) => r !== null);
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AutoBeHistory,
|
|
3
3
|
IAutoBeCompiler,
|
|
4
|
+
IAutoBeCompilerListener,
|
|
4
5
|
IAutoBeTokenUsageJson,
|
|
5
6
|
} from "@autobe/interface";
|
|
6
7
|
import { ILlmSchema } from "@samchon/openapi";
|
|
@@ -64,19 +65,21 @@ export interface IAutoBeProps<Model extends ILlmSchema.Model> {
|
|
|
64
65
|
vendor: IAutoBeVendor;
|
|
65
66
|
|
|
66
67
|
/**
|
|
67
|
-
*
|
|
68
|
+
* Compiler factory function for TypeScript, Prisma, and OpenAPI operations.
|
|
68
69
|
*
|
|
69
|
-
*
|
|
70
|
-
* AST-based development pipeline. The compiler handles
|
|
71
|
-
* transformation, and code generation across all development
|
|
72
|
-
* Prisma schema compilation, OpenAPI document validation,
|
|
73
|
-
* compilation.
|
|
70
|
+
* Factory function that creates compiler instances required for the
|
|
71
|
+
* sophisticated AST-based development pipeline. The compiler handles
|
|
72
|
+
* validation, transformation, and code generation across all development
|
|
73
|
+
* phases including Prisma schema compilation, OpenAPI document validation,
|
|
74
|
+
* and TypeScript code compilation.
|
|
74
75
|
*
|
|
75
76
|
* For high-performance scenarios with multiple concurrent users, the compiler
|
|
76
77
|
* can be separated into dedicated worker processes to prevent blocking the
|
|
77
78
|
* main agent during computationally intensive compilation operations.
|
|
78
79
|
*/
|
|
79
|
-
compiler:
|
|
80
|
+
compiler: (
|
|
81
|
+
listener: IAutoBeCompilerListener,
|
|
82
|
+
) => IAutoBeCompiler | Promise<IAutoBeCompiler>;
|
|
80
83
|
|
|
81
84
|
/**
|
|
82
85
|
* Optional conversation and development histories for session continuation.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { FAILED } from "../orchestrate/realize/structures/IAutoBeRealizeFailedSymbol";
|
|
2
|
+
|
|
3
|
+
export function pipe<A, B>(
|
|
4
|
+
a: A,
|
|
5
|
+
ab: (a: A) => Promise<B | FAILED>,
|
|
6
|
+
): Promise<B | FAILED>;
|
|
7
|
+
|
|
8
|
+
export function pipe<A, B, C>(
|
|
9
|
+
a: A,
|
|
10
|
+
ab: (a: A) => Promise<B | FAILED>,
|
|
11
|
+
bc: (b: B) => Promise<C | FAILED>,
|
|
12
|
+
): Promise<C | FAILED>;
|
|
13
|
+
|
|
14
|
+
export function pipe<A, B, C, D>(
|
|
15
|
+
a: A,
|
|
16
|
+
ab: (a: A) => Promise<B | FAILED>,
|
|
17
|
+
bc: (b: B) => Promise<C | FAILED>,
|
|
18
|
+
cd: (c: C) => Promise<D | FAILED>,
|
|
19
|
+
): Promise<D | FAILED>;
|
|
20
|
+
|
|
21
|
+
export function pipe<A, B, C, D, E>(
|
|
22
|
+
a: A,
|
|
23
|
+
ab: (a: A) => Promise<B | FAILED>,
|
|
24
|
+
bc: (b: B) => Promise<C | FAILED>,
|
|
25
|
+
cd: (c: C) => Promise<D | FAILED>,
|
|
26
|
+
de: (d: D) => Promise<E | FAILED>,
|
|
27
|
+
): Promise<E | FAILED>;
|
|
28
|
+
|
|
29
|
+
export function pipe(
|
|
30
|
+
a: any,
|
|
31
|
+
...fns: Array<(arg: any) => Promise<any>>
|
|
32
|
+
): Promise<any> {
|
|
33
|
+
return fns.reduce((prev, fn) => {
|
|
34
|
+
return prev.then((result) => {
|
|
35
|
+
if (result === FAILED) return FAILED;
|
|
36
|
+
return fn(result);
|
|
37
|
+
});
|
|
38
|
+
}, Promise.resolve(a));
|
|
39
|
+
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ILlmSchema } from "@samchon/openapi";
|
|
2
|
-
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
3
|
-
import { AutoBeAnalyzePointer } from "./AutoBeAnalyzePointer";
|
|
4
|
-
import { AutoBeAnalyzeReviewer } from "./AutoBeAnalyzeReviewer";
|
|
5
|
-
export declare class AutoBeAnalyzeAgent<Model extends ILlmSchema.Model> {
|
|
6
|
-
private readonly createReviewerAgentFn;
|
|
7
|
-
private readonly ctx;
|
|
8
|
-
private readonly pointer;
|
|
9
|
-
private readonly filenames;
|
|
10
|
-
private readonly createAnalyzeAgent;
|
|
11
|
-
private readonly fileMap;
|
|
12
|
-
constructor(createReviewerAgentFn: typeof AutoBeAnalyzeReviewer, ctx: AutoBeContext<Model>, pointer: AutoBeAnalyzePointer, filenames: string[]);
|
|
13
|
-
/**
|
|
14
|
-
* Conversate with planner agent
|
|
15
|
-
*
|
|
16
|
-
* @param content Conversation from user in this time.
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
19
|
-
conversate(content: string, retry?: number): Promise<string>;
|
|
20
|
-
}
|