@autobe/agent 0.29.0 → 0.29.2
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.d.ts +2 -1
- package/lib/AutoBeAgent.js +17 -8
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/AutoBeAgentBase.d.ts +2 -3
- package/lib/AutoBeAgentBase.js +1 -8
- package/lib/AutoBeAgentBase.js.map +1 -1
- package/lib/AutoBeMockAgent.js +13 -4
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/factory/createAutoBeContext.js +8 -10
- package/lib/factory/createAutoBeContext.js.map +1 -1
- package/lib/factory/getAutoBeGenerated.d.ts +7 -1
- package/lib/factory/getAutoBeGenerated.js +138 -33
- package/lib/factory/getAutoBeGenerated.js.map +1 -1
- package/lib/factory/getAutoBeRealizeGenerated.js +2 -2
- package/lib/factory/getAutoBeRealizeGenerated.js.map +1 -1
- package/lib/factory/getCriticalCompiler.js +2 -4
- package/lib/factory/getCriticalCompiler.js.map +1 -1
- package/lib/index.mjs +139 -222
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/realize/internal/compileRealizeFiles.js +2 -1
- package/lib/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationWrite.js +2 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationWrite.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteDto.js +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteDto.js.map +1 -1
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js +1 -1
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +1 -1
- package/lib/utils/executeCachedBatch.js +1 -1
- package/lib/utils/executeCachedBatch.js.map +1 -1
- package/package.json +5 -5
- package/src/AutoBeAgent.ts +16 -5
- package/src/AutoBeAgentBase.ts +3 -12
- package/src/AutoBeMockAgent.ts +15 -4
- package/src/factory/createAutoBeContext.ts +5 -3
- package/src/factory/getAutoBeGenerated.ts +203 -42
- package/src/factory/getAutoBeRealizeGenerated.ts +0 -1
- package/src/factory/getCriticalCompiler.ts +3 -5
- package/src/orchestrate/realize/internal/compileRealizeFiles.ts +4 -4
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationWrite.ts +2 -1
- package/src/orchestrate/realize/utils/getRealizeWriteDto.ts +1 -2
- package/src/orchestrate/test/compile/getTestScenarioArtifacts.ts +1 -1
- package/src/orchestrate/test/orchestrateTestCorrect.ts +1 -1
- package/src/utils/executeCachedBatch.ts +1 -1
- package/lib/factory/AutoBeFunctionCallingMetricFactory.d.ts +0 -7
- package/lib/factory/AutoBeFunctionCallingMetricFactory.js +0 -35
- package/lib/factory/AutoBeFunctionCallingMetricFactory.js.map +0 -1
- package/lib/factory/AutoBeProcessAggregateFactory.d.ts +0 -13
- package/lib/factory/AutoBeProcessAggregateFactory.js +0 -100
- package/lib/factory/AutoBeProcessAggregateFactory.js.map +0 -1
- package/lib/utils/TokenUsageComputer.d.ts +0 -5
- package/lib/utils/TokenUsageComputer.js +0 -29
- package/lib/utils/TokenUsageComputer.js.map +0 -1
- package/src/factory/AutoBeFunctionCallingMetricFactory.ts +0 -44
- package/src/factory/AutoBeProcessAggregateFactory.ts +0 -141
- package/src/utils/TokenUsageComputer.ts +0 -35
|
@@ -17,7 +17,8 @@ function compileRealizeFiles(ctx, props) {
|
|
|
17
17
|
const prisma = (_a = ctx.state().prisma) === null || _a === void 0 ? void 0 : _a.compiled;
|
|
18
18
|
const payloads = Object.fromEntries(props.authorizations.map((el) => [el.payload.location, el.payload.content]));
|
|
19
19
|
const compiler = yield ctx.compiler();
|
|
20
|
-
const templateFiles = yield compiler.
|
|
20
|
+
const templateFiles = yield compiler.getTemplate({
|
|
21
|
+
phase: "realize",
|
|
21
22
|
dbms: "sqlite",
|
|
22
23
|
});
|
|
23
24
|
const nodeModules = (prisma === null || prisma === void 0 ? void 0 : prisma.type) === "success" ? prisma.nodeModules : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileRealizeFiles.js","sourceRoot":"","sources":["../../../../src/orchestrate/realize/internal/compileRealizeFiles.ts"],"names":[],"mappings":";;;;;;;;;;;AAYA,kDAiDC;AArDD,+BAA0B;AAI1B,SAAsB,mBAAmB,CACvC,GAAyB,EACzB,KAGC;;;QAED,MAAM,MAAM,GAAG,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,MAAM,0CAAE,QAAQ,CAAC;QAC5C,MAAM,QAAQ,GAA2B,MAAM,CAAC,WAAW,CACzD,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAC5E,CAAC;QACF,MAAM,QAAQ,GAAoB,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;QACvD,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"compileRealizeFiles.js","sourceRoot":"","sources":["../../../../src/orchestrate/realize/internal/compileRealizeFiles.ts"],"names":[],"mappings":";;;;;;;;;;;AAYA,kDAiDC;AArDD,+BAA0B;AAI1B,SAAsB,mBAAmB,CACvC,GAAyB,EACzB,KAGC;;;QAED,MAAM,MAAM,GAAG,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,MAAM,0CAAE,QAAQ,CAAC;QAC5C,MAAM,QAAQ,GAA2B,MAAM,CAAC,WAAW,CACzD,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAC5E,CAAC;QACF,MAAM,QAAQ,GAAoB,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;QACvD,M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AQ;YAChB,IAAI,EAAE,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,0CAAE,IAAI,mCAAI,CAAC;YACpC,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACrC,CAAC;IACJ,CAAC;CAAA"}
|
|
@@ -77,7 +77,8 @@ function orchestrateRealizeAuthorizationWrite(ctx) {
|
|
|
77
77
|
total: actors.length,
|
|
78
78
|
completed: 0,
|
|
79
79
|
};
|
|
80
|
-
const templates = yield (yield ctx.compiler()).
|
|
80
|
+
const templates = yield (yield ctx.compiler()).getTemplate({
|
|
81
|
+
phase: "realize",
|
|
81
82
|
dbms: "sqlite",
|
|
82
83
|
});
|
|
83
84
|
const authorizations = yield (0, executeCachedBatch_1.executeCachedBatch)(ctx, actors.map((a) => (promptCacheKey) => process(ctx, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateRealizeAuthorizationWrite.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeAuthorizationWrite.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,
|
|
1
|
+
{"version":3,"file":"orchestrateRealizeAuthorizationWrite.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeAuthorizationWrite.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,oFA0CC;;;AA7DD,kDAA0B;AAC1B,+BAA0B;AAG1B,uEAAoE;AACpE,uEAAoE;AACpE,uFAAoF;AACpF,qHAAkH;AAClH,qGAAkG;AAElG,6EAA0E;AAC1E,mEAAgE;AAEhE;;;;;GAKG;AACH,SAAsB,oCAAoC,CAExD,GAAyB;;;QACzB,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,2BAA2B;YACjC,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,IAAI,EAAE,MAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uHAI5B;YACA,QAAQ,EAAE;gBACR,OAAO,EAAE,QAAQ;aAClB;SACF;;QAAC;IACJ,MAAM,EAAE,CAAC,QAAmB,EAAE,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uHAI5B;YACA,QAAQ,EAAE;gBACR,OAAO,EAAE,QAAQ;aAClB;SACF;;QAAC;CACL,CAAC;AAMF,MAAM,MAAM,GAAG,2BAAuD,CAAC"}
|
|
@@ -15,7 +15,7 @@ function getRealizeWriteDto(ctx, operation) {
|
|
|
15
15
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
16
|
const document = filterDocument(operation, ctx.state().interface.document);
|
|
17
17
|
const compiler = yield ctx.compiler();
|
|
18
|
-
const entries = Object.entries(yield compiler.interface.write(document));
|
|
18
|
+
const entries = Object.entries(yield compiler.interface.write(document, []));
|
|
19
19
|
const filter = (prefix, exclude) => {
|
|
20
20
|
const result = entries.filter(([key]) => key.startsWith(prefix) === true);
|
|
21
21
|
return Object.fromEntries(exclude
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRealizeWriteDto.js","sourceRoot":"","sources":["../../../../src/orchestrate/realize/utils/getRealizeWriteDto.ts"],"names":[],"mappings":";;;;;;;;;;;AAKA,
|
|
1
|
+
{"version":3,"file":"getRealizeWriteDto.js","sourceRoot":"","sources":["../../../../src/orchestrate/realize/utils/getRealizeWriteDto.ts"],"names":[],"mappings":";;;;;;;;;;;AAKA,gDA0BC;AA9BD,8CAAkE;AAIlE,SAAsB,kBAAkB,CACtC,GAAyB,EACzB,SAAmC;;QAEnC,MAAM,QAAQ,GAA4B,cAAc,CACtD,SAAS,EACT,GAAG,CAAC,KAAK,EAAE,CAAC,SAAU,CAAC,QAAQ,CAChC,CAAC;QAEF,MAAM,QAAQ,GAAoB,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;QACvD,MAAM,OAAO,GAAuB,MAAM,CAAC,OAAO,CAChD,MAAM,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAC7C,CAAC;QAEF,MAAM,MAAM,GAAG,CAAC,MAAc,EAAE,OAAgB,EAAE,EAAE;YAClD,MAAM,MAAM,GAAuB,OAAO,CAAC,MAAM,CAC/C,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,IAAI,CAC3C,CAAC;YACF,OAAO,MAAM,CAAC,WAAW,CACvB,OAAO;gBACL,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,KAAK,CAAC;gBAC7D,CAAC,CAAC,MAAM,CACX,CAAC;QACJ,CAAC,CAAC;QACF,MAAM,GAAG,GAA2B,MAAM,CAAC,oBAAoB,CAAC,CAAC;QACjE,OAAO,GAAG,CAAC;IACb,CAAC;CAAA;AAED,SAAS,cAAc,CACrB,SAAmC,EACnC,QAAiC;IAEjC,MAAM,UAAU,GAA8B;QAC5C,cAAc,EAAE,QAAQ,CAAC,UAAU,CAAC,cAAc;QAClD,OAAO,EAAE,EAAE;KACZ,CAAC;IAEF,MAAM,KAAK,GAAG,CAAC,QAAgB,EAAE,EAAE;QACjC,4BAAkB,CAAC,KAAK,CAAC;YACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,MAAM,EAAE,EAAE,IAAI,EAAE,wBAAwB,QAAQ,EAAE,EAAE;YACpD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gBACb,IAAI,4BAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;oBACtC,MAAM,GAAG,GAAW,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG,CAAC;oBAC7C,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;gBAC7D,CAAC;YACH,CAAC;SACF,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,IAAI,SAAS,CAAC,WAAW;QAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACjE,IAAI,SAAS,CAAC,YAAY;QAAE,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAEnE,OAAO;QACL,UAAU,EAAE,CAAC,SAAS,CAAC;QACvB,UAAU;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -16,7 +16,7 @@ function getTestScenarioArtifacts(ctx, scenario) {
|
|
|
16
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
17
|
const compiler = yield ctx.compiler();
|
|
18
18
|
const document = filterDocument(scenario, ctx.state().interface.document);
|
|
19
|
-
const entries = Object.entries(yield compiler.interface.write(document));
|
|
19
|
+
const entries = Object.entries(yield compiler.interface.write(document, []));
|
|
20
20
|
const filter = (prefix, exclude) => {
|
|
21
21
|
const result = entries.filter(([key]) => key.startsWith(prefix) === true);
|
|
22
22
|
return Object.fromEntries(exclude
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTestScenarioArtifacts.js","sourceRoot":"","sources":["../../../../src/orchestrate/test/compile/getTestScenarioArtifacts.ts"],"names":[],"mappings":";;;;;;;;;;;AAWA,4DAgCC;AAtCD,8CAAkE;AAIlE,+DAA4D;AAE5D,SAAsB,wBAAwB,CAC5C,GAAyB,EACzB,QAGC;;QAED,MAAM,QAAQ,GAAoB,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;QACvD,MAAM,QAAQ,GAA4B,cAAc,CACtD,QAAQ,EACR,GAAG,CAAC,KAAK,EAAE,CAAC,SAAU,CAAC,QAAQ,CAChC,CAAC;QACF,MAAM,OAAO,GAAuB,MAAM,CAAC,OAAO,CAChD,MAAM,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"getTestScenarioArtifacts.js","sourceRoot":"","sources":["../../../../src/orchestrate/test/compile/getTestScenarioArtifacts.ts"],"names":[],"mappings":";;;;;;;;;;;AAWA,4DAgCC;AAtCD,8CAAkE;AAIlE,+DAA4D;AAE5D,SAAsB,wBAAwB,CAC5C,GAAyB,EACzB,QAGC;;QAED,MAAM,QAAQ,GAAoB,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;QACvD,MAAM,QAAQ,GAA4B,cAAc,CACtD,QAAQ,EACR,GAAG,CAAC,KAAK,EAAE,CAAC,SAAU,CAAC,QAAQ,CAChC,CAAC;QACF,MAAM,OAAO,GAAuB,MAAM,CAAC,OAAO,CAChD,MAAM,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAC7C,CAAC;QACF,MAAM,MAAM,GAAG,CAAC,MAAc,EAAE,OAAgB,EAAE,EAAE;YAClD,MAAM,MAAM,GAAuB,OAAO,CAAC,MAAM,CAC/C,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,IAAI,CAC3C,CAAC;YACF,OAAO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AAwB,QAAQ,EAAE,EAAE;YACpD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gBACb,IAAI,4BAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;oBACtC,MAAM,GAAG,GAAW,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG,CAAC;oBAC7C,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;gBAC7D,CAAC;YACH,CAAC;SACF,CAAC,CAAC;IACL,CAAC,CAAC;IACF,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;QAC5B,IAAI,EAAE,CAAC,WAAW;YAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACnD,IAAI,EAAE,CAAC,YAAY;YAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IACvD,CAAC;IACD,OAAO;QACL,UAAU;QACV,UAAU;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -166,7 +166,7 @@ const correct = (ctx, props, life) => __awaiter(void 0, void 0, void 0, function
|
|
|
166
166
|
pointer.value.draft = yield (0, completeTestCode_1.completeTestCode)(ctx, props.function.artifacts, pointer.value.draft);
|
|
167
167
|
ctx.dispatch({
|
|
168
168
|
type: "testCorrect",
|
|
169
|
-
kind: "
|
|
169
|
+
kind: "overall",
|
|
170
170
|
id: (0, uuid_1.v7)(),
|
|
171
171
|
created_at: new Date().toISOString(),
|
|
172
172
|
file: props.validate.file,
|
|
@@ -25,7 +25,7 @@ const executeCachedBatch = (ctx, taskList, promptCacheKey) => __awaiter(void 0,
|
|
|
25
25
|
.slice(1)
|
|
26
26
|
.map((task, index) => new tstl_1.Pair(task, index));
|
|
27
27
|
const tail = [];
|
|
28
|
-
yield Promise.all(new Array(semaphore).map(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
+
yield Promise.all(new Array(semaphore).fill(0).map(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
29
|
while (remained.length !== 0) {
|
|
30
30
|
const batch = remained.splice(0, 1)[0];
|
|
31
31
|
const result = yield batch.first(promptCacheKey);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeCachedBatch.js","sourceRoot":"","sources":["../../src/utils/executeCachedBatch.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+BAAuC;AACvC,+BAA0B;AAKnB,MAAM,kBAAkB,GAAG,CAChC,GAAyB,EACzB,QAAmB,EACnB,cAAuB,EACT,EAAE;;IAChB,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,cAAc,aAAd,cAAc,cAAd,cAAc,IAAd,cAAc,GAAK,IAAA,SAAE,GAAE,EAAC;IACxB,MAAM,KAAK,GAAM,MAAM,QAAQ,CAAC,CAAC,CAAE,CAAC,cAAc,CAAC,CAAC;IACpD,MAAM,SAAS,GACb,GAAG,CAAC,MAAM,CAAC,SAAS,IAAI,GAAG,CAAC,MAAM,CAAC,SAAS,YAAY,gBAAS;QAC/D,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE;QAC5B,CAAC,CAAC,CAAC,MAAA,GAAG,CAAC,MAAM,CAAC,SAAS,0EAAkC,CAAC,CAAC;IAE/D,MAAM,QAAQ,GAAiC,QAAQ;SACpD,KAAK,CAAC,CAAC,CAAC;SACR,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,WAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAC/C,MAAM,IAAI,GAAsB,EAAE,CAAC;IACnC,MAAM,OAAO,CAAC,GAAG,CACf,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAS,EAAE;
|
|
1
|
+
{"version":3,"file":"executeCachedBatch.js","sourceR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C,IAAI,CAAC,IAAI,WAAI,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC,CAAA,CAAC,CACH,CAAC;IACF,OAAO;QACL,KAAK;QACL,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;KAChE,CAAC;AACJ,CAAC,CAAA,CAAC;AA/BW,QAAA,kBAAkB,sBA+B7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autobe/agent",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.2",
|
|
4
4
|
"description": "AI backend server code generator",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"author": "Wrtn Technologies",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"tstl": "^3.0.0",
|
|
29
29
|
"typia": "^10.0.2",
|
|
30
30
|
"uuid": "^11.1.0",
|
|
31
|
-
"@autobe/
|
|
32
|
-
"@autobe/
|
|
31
|
+
"@autobe/utils": "^0.29.2",
|
|
32
|
+
"@autobe/interface": "^0.29.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@rollup/plugin-json": "^6.1.0",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"ts-node": "^10.9.2",
|
|
43
43
|
"ts-patch": "^3.3.0",
|
|
44
44
|
"typescript": "~5.9.3",
|
|
45
|
-
"@autobe/compiler": "^0.29.
|
|
46
|
-
"@autobe/filesystem": "^0.29.
|
|
45
|
+
"@autobe/compiler": "^0.29.2",
|
|
46
|
+
"@autobe/filesystem": "^0.29.2"
|
|
47
47
|
},
|
|
48
48
|
"keywords": [
|
|
49
49
|
"ai",
|
package/src/AutoBeAgent.ts
CHANGED
|
@@ -14,7 +14,9 @@ import {
|
|
|
14
14
|
AutoBeUserMessageHistory,
|
|
15
15
|
IAutoBeAgent,
|
|
16
16
|
IAutoBeCompilerListener,
|
|
17
|
+
IAutoBeGetFilesOptions,
|
|
17
18
|
} from "@autobe/interface";
|
|
19
|
+
import { AutoBeProcessAggregateFactory } from "@autobe/utils";
|
|
18
20
|
import { ILlmSchema } from "@samchon/openapi";
|
|
19
21
|
import { Semaphore, Singleton } from "tstl";
|
|
20
22
|
import { v7 } from "uuid";
|
|
@@ -24,10 +26,10 @@ import { AutoBeConfigConstant } from "./constants/AutoBeConfigConstant";
|
|
|
24
26
|
import { AutoBeContext } from "./context/AutoBeContext";
|
|
25
27
|
import { AutoBeState } from "./context/AutoBeState";
|
|
26
28
|
import { AutoBeTokenUsage } from "./context/AutoBeTokenUsage";
|
|
27
|
-
import { AutoBeProcessAggregateFactory } from "./factory/AutoBeProcessAggregateFactory";
|
|
28
29
|
import { createAgenticaHistory } from "./factory/createAgenticaHistory";
|
|
29
30
|
import { createAutoBeContext } from "./factory/createAutoBeContext";
|
|
30
31
|
import { createAutoBeState } from "./factory/createAutoBeState";
|
|
32
|
+
import { getAutoBeGenerated } from "./factory/getAutoBeGenerated";
|
|
31
33
|
import { getCommonPrompt } from "./factory/getCommonPrompt";
|
|
32
34
|
import { supportMistral } from "./factory/supportMistral";
|
|
33
35
|
import { createAutoBeFacadeController } from "./orchestrate/facade/createAutoBeFacadeController";
|
|
@@ -106,10 +108,7 @@ export class AutoBeAgent<Model extends ILlmSchema.Model>
|
|
|
106
108
|
*/
|
|
107
109
|
public constructor(props: IAutoBeProps<Model>) {
|
|
108
110
|
// INITIALIZE MEMBERS
|
|
109
|
-
super(
|
|
110
|
-
compiler: () => this.context_.compiler(),
|
|
111
|
-
state: () => this.state_,
|
|
112
|
-
});
|
|
111
|
+
super();
|
|
113
112
|
this.props_ = props;
|
|
114
113
|
this.histories_ = props.histories?.slice() ?? [];
|
|
115
114
|
this.state_ = createAutoBeState(this.histories_);
|
|
@@ -333,6 +332,18 @@ export class AutoBeAgent<Model extends ILlmSchema.Model>
|
|
|
333
332
|
return this.usage_;
|
|
334
333
|
}
|
|
335
334
|
|
|
335
|
+
public async getFiles(
|
|
336
|
+
options?: IAutoBeGetFilesOptions,
|
|
337
|
+
): Promise<Record<string, string>> {
|
|
338
|
+
return await getAutoBeGenerated({
|
|
339
|
+
compiler: await this.context_.compiler(),
|
|
340
|
+
state: this.state_,
|
|
341
|
+
histories: this.getHistories(),
|
|
342
|
+
tokenUsage: this.getTokenUsage(),
|
|
343
|
+
options,
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
|
|
336
347
|
public getAggregates(
|
|
337
348
|
latest: boolean = false,
|
|
338
349
|
): AutoBeProcessAggregateCollection {
|
package/src/AutoBeAgentBase.ts
CHANGED
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import { AutoBeState } from "./context/AutoBeState";
|
|
9
9
|
import { AutoBeTokenUsage } from "./context/AutoBeTokenUsage";
|
|
10
|
-
import { getAutoBeGenerated } from "./factory/getAutoBeGenerated";
|
|
11
10
|
import { emplaceMap } from "./utils/emplaceMap";
|
|
12
11
|
|
|
13
12
|
export abstract class AutoBeAgentBase {
|
|
@@ -17,21 +16,13 @@ export abstract class AutoBeAgentBase {
|
|
|
17
16
|
Set<(event: AutoBeEvent) => Promise<void> | void>
|
|
18
17
|
>;
|
|
19
18
|
|
|
20
|
-
public constructor(
|
|
19
|
+
public constructor() {
|
|
21
20
|
this.listeners_ = new Map();
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
public
|
|
23
|
+
public abstract getFiles(
|
|
25
24
|
options?: Partial<IAutoBeGetFilesOptions>,
|
|
26
|
-
): Promise<Record<string, string
|
|
27
|
-
return getAutoBeGenerated(
|
|
28
|
-
await this.asset.compiler(),
|
|
29
|
-
this.asset.state(),
|
|
30
|
-
this.getHistories(),
|
|
31
|
-
this.getTokenUsage(),
|
|
32
|
-
options,
|
|
33
|
-
);
|
|
34
|
-
}
|
|
25
|
+
): Promise<Record<string, string>>;
|
|
35
26
|
public abstract getHistories(): AutoBeHistory[];
|
|
36
27
|
public abstract getTokenUsage(): AutoBeTokenUsage;
|
|
37
28
|
|
package/src/AutoBeMockAgent.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
IAutoBeAgent,
|
|
10
10
|
IAutoBeCompiler,
|
|
11
11
|
IAutoBeCompilerListener,
|
|
12
|
+
IAutoBeGetFilesOptions,
|
|
12
13
|
IAutoBePlaygroundReplay,
|
|
13
14
|
} from "@autobe/interface";
|
|
14
15
|
import { Singleton, randint, sleep_for } from "tstl";
|
|
@@ -18,6 +19,7 @@ import { AutoBeAgentBase } from "./AutoBeAgentBase";
|
|
|
18
19
|
import { AutoBeState } from "./context/AutoBeState";
|
|
19
20
|
import { AutoBeTokenUsage } from "./context/AutoBeTokenUsage";
|
|
20
21
|
import { createAutoBeState } from "./factory/createAutoBeState";
|
|
22
|
+
import { getAutoBeGenerated } from "./factory/getAutoBeGenerated";
|
|
21
23
|
|
|
22
24
|
/** @internal */
|
|
23
25
|
export class AutoBeMockAgent extends AutoBeAgentBase implements IAutoBeAgent {
|
|
@@ -27,10 +29,7 @@ export class AutoBeMockAgent extends AutoBeAgentBase implements IAutoBeAgent {
|
|
|
27
29
|
private token_usage_: AutoBeTokenUsage;
|
|
28
30
|
|
|
29
31
|
public constructor(props: AutoBeMockAgent.IProps) {
|
|
30
|
-
super(
|
|
31
|
-
compiler: () => this.compiler_.get(),
|
|
32
|
-
state: () => createAutoBeState(this.histories_),
|
|
33
|
-
});
|
|
32
|
+
super();
|
|
34
33
|
this.props_ = props;
|
|
35
34
|
this.histories_ = [];
|
|
36
35
|
this.compiler_ = new Singleton(async () =>
|
|
@@ -134,6 +133,18 @@ export class AutoBeMockAgent extends AutoBeAgentBase implements IAutoBeAgent {
|
|
|
134
133
|
return this.token_usage_;
|
|
135
134
|
}
|
|
136
135
|
|
|
136
|
+
public async getFiles(
|
|
137
|
+
options?: IAutoBeGetFilesOptions,
|
|
138
|
+
): Promise<Record<string, string>> {
|
|
139
|
+
return await getAutoBeGenerated({
|
|
140
|
+
compiler: await this.compiler_.get(),
|
|
141
|
+
state: createAutoBeState(this.histories_),
|
|
142
|
+
histories: this.getHistories(),
|
|
143
|
+
tokenUsage: this.getTokenUsage(),
|
|
144
|
+
options,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
137
148
|
public getPhase(): AutoBePhase | null {
|
|
138
149
|
const state: AutoBeState = createAutoBeState(this.histories_);
|
|
139
150
|
if (state.analyze === null) return null;
|
|
@@ -26,7 +26,11 @@ import {
|
|
|
26
26
|
IAutoBeGetFilesOptions,
|
|
27
27
|
IAutoBeTokenUsageJson,
|
|
28
28
|
} from "@autobe/interface";
|
|
29
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
AutoBeProcessAggregateFactory,
|
|
31
|
+
StringUtil,
|
|
32
|
+
TokenUsageComputer,
|
|
33
|
+
} from "@autobe/utils";
|
|
30
34
|
import { ILlmSchema } from "@samchon/openapi";
|
|
31
35
|
import { Semaphore } from "tstl";
|
|
32
36
|
import typia from "typia";
|
|
@@ -42,8 +46,6 @@ import { IAutoBeConfig } from "../structures/IAutoBeConfig";
|
|
|
42
46
|
import { IAutoBeVendor } from "../structures/IAutoBeVendor";
|
|
43
47
|
import { AutoBeTimeoutError } from "../utils/AutoBeTimeoutError";
|
|
44
48
|
import { TimedConversation } from "../utils/TimedConversation";
|
|
45
|
-
import { TokenUsageComputer } from "../utils/TokenUsageComputer";
|
|
46
|
-
import { AutoBeProcessAggregateFactory } from "./AutoBeProcessAggregateFactory";
|
|
47
49
|
import { consentFunctionCall } from "./consentFunctionCall";
|
|
48
50
|
import { getCommonPrompt } from "./getCommonPrompt";
|
|
49
51
|
import { getCriticalCompiler } from "./getCriticalCompiler";
|
|
@@ -1,40 +1,63 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AutoBeAnalyzeHistory,
|
|
2
3
|
AutoBeHistory,
|
|
4
|
+
AutoBeInterfaceHistory,
|
|
5
|
+
AutoBePrismaHistory,
|
|
6
|
+
AutoBeProcessAggregateCollection,
|
|
7
|
+
AutoBeRealizeHistory,
|
|
8
|
+
AutoBeTestHistory,
|
|
3
9
|
IAutoBeCompiler,
|
|
4
10
|
IAutoBeGetFilesOptions,
|
|
5
11
|
} from "@autobe/interface";
|
|
12
|
+
import { AutoBeProcessAggregateFactory } from "@autobe/utils";
|
|
6
13
|
|
|
7
14
|
import { AutoBeState } from "../context/AutoBeState";
|
|
8
15
|
import { AutoBeTokenUsage } from "../context/AutoBeTokenUsage";
|
|
9
16
|
import { getAutoBeRealizeGenerated } from "./getAutoBeRealizeGenerated";
|
|
10
17
|
|
|
11
|
-
export async function getAutoBeGenerated(
|
|
12
|
-
compiler: IAutoBeCompiler
|
|
13
|
-
state: AutoBeState
|
|
14
|
-
histories: Readonly<AutoBeHistory[]
|
|
15
|
-
tokenUsage: AutoBeTokenUsage
|
|
16
|
-
options?: Partial<IAutoBeGetFilesOptions
|
|
17
|
-
): Promise<Record<string, string>> {
|
|
18
|
+
export async function getAutoBeGenerated(props: {
|
|
19
|
+
compiler: IAutoBeCompiler;
|
|
20
|
+
state: AutoBeState;
|
|
21
|
+
histories: Readonly<AutoBeHistory[]>;
|
|
22
|
+
tokenUsage: AutoBeTokenUsage;
|
|
23
|
+
options?: Partial<IAutoBeGetFilesOptions>;
|
|
24
|
+
}): Promise<Record<string, string>> {
|
|
25
|
+
const options: Required<IAutoBeGetFilesOptions> = {
|
|
26
|
+
phase:
|
|
27
|
+
(props.options?.phase ?? props.state.realize)
|
|
28
|
+
? "realize"
|
|
29
|
+
: props.state.test
|
|
30
|
+
? "test"
|
|
31
|
+
: props.state.interface
|
|
32
|
+
? "interface"
|
|
33
|
+
: "analyze",
|
|
34
|
+
dbms: props.options?.dbms ?? "postgres",
|
|
35
|
+
};
|
|
36
|
+
const ret: Record<string, string> = await props.compiler.getTemplate(options);
|
|
37
|
+
ret["README.md"] = writeReadMe(props.state, ret["README.md"]);
|
|
38
|
+
if (props.state.analyze === null) return ret;
|
|
39
|
+
|
|
18
40
|
// ANALYZE
|
|
19
|
-
const ret: Record<string, string> = {};
|
|
20
|
-
if (state.analyze === null) return {};
|
|
21
41
|
Object.assign<Record<string, string>, Record<string, string>>(
|
|
22
42
|
ret,
|
|
23
43
|
Object.fromEntries(
|
|
24
|
-
state.analyze.files.map((file) => [
|
|
44
|
+
props.state.analyze.files.map((file) => [
|
|
25
45
|
`docs/analysis/${file.filename.split("/").at(-1)}`,
|
|
26
46
|
file.content,
|
|
27
47
|
]),
|
|
28
48
|
),
|
|
29
49
|
);
|
|
30
|
-
if (options?.
|
|
50
|
+
if (props.options?.phase === "analyze") return ret;
|
|
31
51
|
|
|
32
52
|
// PRISMA
|
|
33
|
-
if (state.prisma?.step === state.analyze.step) {
|
|
53
|
+
if (props.state.prisma?.step === props.state.analyze.step) {
|
|
34
54
|
const schemaFiles: Record<string, string> =
|
|
35
55
|
(options?.dbms ?? "postgres") === "postgres"
|
|
36
|
-
? state.prisma.schemas
|
|
37
|
-
: await compiler.prisma.write(
|
|
56
|
+
? props.state.prisma.schemas
|
|
57
|
+
: await props.compiler.prisma.write(
|
|
58
|
+
props.state.prisma.result.data,
|
|
59
|
+
options!.dbms!,
|
|
60
|
+
);
|
|
38
61
|
Object.assign<
|
|
39
62
|
Record<string, string>,
|
|
40
63
|
Record<string, string>,
|
|
@@ -48,20 +71,22 @@ export async function getAutoBeGenerated(
|
|
|
48
71
|
]),
|
|
49
72
|
),
|
|
50
73
|
{
|
|
51
|
-
"autobe/prisma.json": JSON.stringify(state.prisma.result.data),
|
|
74
|
+
"autobe/prisma.json": JSON.stringify(props.state.prisma.result.data),
|
|
52
75
|
},
|
|
53
76
|
);
|
|
54
|
-
if (state.prisma.compiled.type === "success")
|
|
55
|
-
ret["docs/ERD.md"] = state.prisma.compiled.document;
|
|
56
|
-
else if (state.prisma.compiled.type === "failure")
|
|
57
|
-
ret["prisma/compile-error-reason.log"] =
|
|
77
|
+
if (props.state.prisma.compiled.type === "success")
|
|
78
|
+
ret["docs/ERD.md"] = props.state.prisma.compiled.document;
|
|
79
|
+
else if (props.state.prisma.compiled.type === "failure")
|
|
80
|
+
ret["prisma/compile-error-reason.log"] =
|
|
81
|
+
props.state.prisma.compiled.reason;
|
|
58
82
|
}
|
|
59
|
-
if (options?.
|
|
83
|
+
if (props.options?.phase === "prisma") return ret;
|
|
60
84
|
|
|
61
85
|
// INTERFACE
|
|
62
|
-
if (state.interface?.step === state.analyze.step) {
|
|
63
|
-
const files: Record<string, string> = await compiler.interface.write(
|
|
64
|
-
state.interface.document,
|
|
86
|
+
if (props.state.interface?.step === props.state.analyze.step) {
|
|
87
|
+
const files: Record<string, string> = await props.compiler.interface.write(
|
|
88
|
+
props.state.interface.document,
|
|
89
|
+
Object.keys(ret),
|
|
65
90
|
);
|
|
66
91
|
Object.assign<
|
|
67
92
|
Record<string, string>,
|
|
@@ -69,7 +94,7 @@ export async function getAutoBeGenerated(
|
|
|
69
94
|
Record<string, string>
|
|
70
95
|
>(
|
|
71
96
|
ret,
|
|
72
|
-
state.test?.step === state.interface.step
|
|
97
|
+
props.state.test?.step === props.state.interface.step
|
|
73
98
|
? Object.fromEntries(
|
|
74
99
|
Object.entries(files).filter(
|
|
75
100
|
([key]) => key.startsWith("test/features/") === false,
|
|
@@ -77,44 +102,180 @@ export async function getAutoBeGenerated(
|
|
|
77
102
|
)
|
|
78
103
|
: files,
|
|
79
104
|
{
|
|
80
|
-
"autobe/document.json": JSON.stringify(state.interface.document),
|
|
105
|
+
"autobe/document.json": JSON.stringify(props.state.interface.document),
|
|
81
106
|
},
|
|
82
107
|
);
|
|
83
108
|
}
|
|
84
|
-
if (options?.
|
|
109
|
+
if (props.options?.phase === "interface") return ret;
|
|
85
110
|
|
|
86
111
|
// TEST
|
|
87
|
-
if (state.test?.step === state.analyze.step)
|
|
88
|
-
Object.assign<
|
|
89
|
-
Record<string, string>,
|
|
90
|
-
Record<string, string>,
|
|
91
|
-
Record<string, string>
|
|
92
|
-
>(
|
|
112
|
+
if (props.state.test?.step === props.state.analyze.step)
|
|
113
|
+
Object.assign<Record<string, string>, Record<string, string>>(
|
|
93
114
|
ret,
|
|
94
|
-
Object.fromEntries(
|
|
95
|
-
|
|
115
|
+
Object.fromEntries(
|
|
116
|
+
props.state.test.files.map((f) => [f.location, f.content]),
|
|
117
|
+
),
|
|
96
118
|
);
|
|
97
119
|
|
|
98
120
|
// REALIZE
|
|
99
|
-
if (state.realize?.step === state.analyze.step)
|
|
121
|
+
if (props.state.realize?.step === props.state.analyze.step)
|
|
100
122
|
Object.assign<Record<string, string>, Record<string, string>>(
|
|
101
123
|
ret,
|
|
102
124
|
await getAutoBeRealizeGenerated({
|
|
103
|
-
compiler,
|
|
104
|
-
document: state.interface!.document,
|
|
105
|
-
authorizations: state.realize.authorizations,
|
|
106
|
-
functions: state.realize.functions,
|
|
125
|
+
compiler: props.compiler,
|
|
126
|
+
document: props.state.interface!.document,
|
|
127
|
+
authorizations: props.state.realize.authorizations,
|
|
128
|
+
functions: props.state.realize.functions,
|
|
107
129
|
options: {
|
|
108
130
|
dbms: options?.dbms ?? "postgres",
|
|
109
131
|
},
|
|
110
132
|
}),
|
|
111
133
|
);
|
|
112
|
-
if (options?.
|
|
134
|
+
if (props.options?.phase === "test") return ret;
|
|
113
135
|
|
|
114
136
|
// LOGGING
|
|
115
137
|
Object.assign<Record<string, string>, Record<string, string>>(ret, {
|
|
116
|
-
"autobe/histories.json": JSON.stringify(histories),
|
|
117
|
-
"autobe/tokenUsage.json": JSON.stringify(tokenUsage),
|
|
138
|
+
"autobe/histories.json": JSON.stringify(props.histories),
|
|
139
|
+
"autobe/tokenUsage.json": JSON.stringify(props.tokenUsage),
|
|
118
140
|
});
|
|
119
141
|
return ret;
|
|
120
142
|
}
|
|
143
|
+
|
|
144
|
+
function writeReadMe(state: AutoBeState, readme: string): string {
|
|
145
|
+
const emoji = (
|
|
146
|
+
history:
|
|
147
|
+
| AutoBeAnalyzeHistory
|
|
148
|
+
| AutoBePrismaHistory
|
|
149
|
+
| AutoBeInterfaceHistory
|
|
150
|
+
| AutoBeTestHistory
|
|
151
|
+
| AutoBeRealizeHistory
|
|
152
|
+
| null,
|
|
153
|
+
): string => (history ? (success(history) ? "✅" : "❌") : "⬜");
|
|
154
|
+
return readme
|
|
155
|
+
.replaceAll("{{ANALYSIS_EMOJI}}", emoji(state.analyze))
|
|
156
|
+
.replaceAll("{{PRISMA_EMOJI}}", emoji(state.prisma))
|
|
157
|
+
.replaceAll("{{INTERFACE_EMOJI}}", emoji(state.interface))
|
|
158
|
+
.replaceAll("{{TEST_EMOJI}}", emoji(state.test))
|
|
159
|
+
.replaceAll("{{REALIZE_EMOJI}}", emoji(state.realize))
|
|
160
|
+
.replaceAll("{{BENCHMARK_AGGREGATE}}", writeBenchmarkAggregate(state))
|
|
161
|
+
.replaceAll(
|
|
162
|
+
"{{BENCHMARK_FUNCTION_CALLING}}",
|
|
163
|
+
writeBenchmarkFunctionCalling(state),
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function writeBenchmarkAggregate(state: AutoBeState): string {
|
|
168
|
+
return (["analyze", "prisma", "interface", "test", "realize"] as const)
|
|
169
|
+
.map((key) => {
|
|
170
|
+
const h = state[key];
|
|
171
|
+
if (h === null) return `⬜ ${key} | | | | `;
|
|
172
|
+
return [
|
|
173
|
+
`${success(h) ? "✅" : "❌"} ${h.type}`,
|
|
174
|
+
Object.entries(label(h))
|
|
175
|
+
.map(([k, v]) => `${k}: ${v.toLocaleString()}`)
|
|
176
|
+
.join(", "),
|
|
177
|
+
(
|
|
178
|
+
(h.aggregates.total.metric.success /
|
|
179
|
+
h.aggregates.total.metric.attempt) *
|
|
180
|
+
100
|
|
181
|
+
).toFixed(2) + " %",
|
|
182
|
+
h.aggregates.total.tokenUsage.total.toLocaleString(),
|
|
183
|
+
Math.round(
|
|
184
|
+
(new Date(h.completed_at).getTime() -
|
|
185
|
+
new Date(h.created_at).getTime()) /
|
|
186
|
+
1_000,
|
|
187
|
+
) + " sec",
|
|
188
|
+
].join(" | ");
|
|
189
|
+
})
|
|
190
|
+
.join("\n");
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function writeBenchmarkFunctionCalling(state: AutoBeState): string {
|
|
194
|
+
const aggregates: AutoBeProcessAggregateCollection =
|
|
195
|
+
AutoBeProcessAggregateFactory.reduce(
|
|
196
|
+
[state.analyze, state.prisma, state.interface, state.test, state.realize]
|
|
197
|
+
.filter((h) => h !== null)
|
|
198
|
+
.map((h) => h.aggregates),
|
|
199
|
+
);
|
|
200
|
+
return Object.entries(aggregates)
|
|
201
|
+
.map(([key, value]) =>
|
|
202
|
+
[
|
|
203
|
+
key,
|
|
204
|
+
value.metric.attempt.toLocaleString(),
|
|
205
|
+
value.metric.validationFailure.toLocaleString(),
|
|
206
|
+
value.metric.invalidJson.toLocaleString(),
|
|
207
|
+
value.metric.success.toLocaleString(),
|
|
208
|
+
((value.metric.success / value.metric.attempt) * 100).toFixed(2) + " %",
|
|
209
|
+
].join(" | "),
|
|
210
|
+
)
|
|
211
|
+
.join("\n");
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function success(
|
|
215
|
+
history:
|
|
216
|
+
| AutoBeAnalyzeHistory
|
|
217
|
+
| AutoBePrismaHistory
|
|
218
|
+
| AutoBeInterfaceHistory
|
|
219
|
+
| AutoBeTestHistory
|
|
220
|
+
| AutoBeRealizeHistory,
|
|
221
|
+
): boolean {
|
|
222
|
+
if (history.type === "analyze") return true;
|
|
223
|
+
else if (history.type === "interface") return history.missed.length === 0;
|
|
224
|
+
else if (
|
|
225
|
+
history.type === "prisma" ||
|
|
226
|
+
history.type === "test" ||
|
|
227
|
+
history.type === "realize"
|
|
228
|
+
)
|
|
229
|
+
return history.compiled.type === "success";
|
|
230
|
+
history satisfies never;
|
|
231
|
+
throw new Error("Unknown history type encountered.");
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function label(
|
|
235
|
+
history:
|
|
236
|
+
| AutoBeAnalyzeHistory
|
|
237
|
+
| AutoBePrismaHistory
|
|
238
|
+
| AutoBeInterfaceHistory
|
|
239
|
+
| AutoBeTestHistory
|
|
240
|
+
| AutoBeRealizeHistory,
|
|
241
|
+
): Record<string, number> {
|
|
242
|
+
if (history.type === "analyze")
|
|
243
|
+
return {
|
|
244
|
+
actors: history.actors.length,
|
|
245
|
+
documents: history.files.length,
|
|
246
|
+
};
|
|
247
|
+
else if (history.type === "prisma")
|
|
248
|
+
return {
|
|
249
|
+
namespaces: history.result.data.files.length,
|
|
250
|
+
models: history.result.data.files.map((f) => f.models).flat().length,
|
|
251
|
+
};
|
|
252
|
+
else if (history.type === "interface")
|
|
253
|
+
return {
|
|
254
|
+
operations: history.document.operations.length,
|
|
255
|
+
schemas: Object.keys(history.document.components.schemas).length,
|
|
256
|
+
};
|
|
257
|
+
else if (history.type === "test") {
|
|
258
|
+
return {
|
|
259
|
+
functions: history.files.length,
|
|
260
|
+
...(history.compiled.type === "failure"
|
|
261
|
+
? {
|
|
262
|
+
errors: new Set(
|
|
263
|
+
history.compiled.diagnostics.map((d) => d.file ?? ""),
|
|
264
|
+
).size,
|
|
265
|
+
}
|
|
266
|
+
: {}),
|
|
267
|
+
};
|
|
268
|
+
} else if (history.type === "realize")
|
|
269
|
+
return {
|
|
270
|
+
functions: history.functions.length,
|
|
271
|
+
...(history.compiled.type === "failure"
|
|
272
|
+
? {
|
|
273
|
+
errors: new Set(
|
|
274
|
+
history.compiled.diagnostics.map((d) => d.file ?? ""),
|
|
275
|
+
).size,
|
|
276
|
+
}
|
|
277
|
+
: {}),
|
|
278
|
+
};
|
|
279
|
+
history satisfies never;
|
|
280
|
+
throw new Error("Unknown history type encountered.");
|
|
281
|
+
}
|