@autobe/agent 0.30.4-dev.20260324 → 0.30.5
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/LICENSE +661 -661
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +5 -4
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/describe/image/orchestrateImageDescribeDraft.js +6 -6
- package/lib/describe/image/structures/IAutoBeImageDescribeDraftApplication.d.ts +12 -63
- package/lib/index.mjs +2918 -2842
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeExtractDecisions.js +8 -8
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +36 -37
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenarioReview.js +7 -7
- package/lib/orchestrate/analyze/orchestrateAnalyzeSectionCrossFileReview.js +55 -42
- package/lib/orchestrate/analyze/orchestrateAnalyzeSectionCrossFileReview.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeSectionReview.js +67 -54
- package/lib/orchestrate/analyze/orchestrateAnalyzeSectionReview.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWriteSection.js +24 -25
- package/lib/orchestrate/analyze/orchestrateAnalyzeWriteSection.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWriteSectionPatch.js +24 -25
- package/lib/orchestrate/analyze/orchestrateAnalyzeWriteSectionPatch.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWriteUnit.js +30 -31
- package/lib/orchestrate/analyze/orchestrateAnalyzeWriteUnit.js.map +1 -1
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeExtractDecisionsApplication.d.ts +14 -52
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +23 -96
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioReviewApplication.d.ts +12 -40
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeSectionCrossFileReviewApplication.d.ts +30 -88
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeSectionReviewApplication.d.ts +35 -94
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteSectionApplication.d.ts +23 -93
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteUnitApplication.d.ts +15 -88
- package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistory.js +76 -31
- package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistory.js.map +1 -1
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +7 -7
- package/lib/orchestrate/common/structures/IAnalysisSectionEntry.d.ts +2 -8
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.d.ts +8 -50
- package/lib/orchestrate/common/structures/IAutoBePreliminaryCollection.d.ts +1 -9
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetAnalysisSections.d.ts +4 -23
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetDatabaseSchemas.d.ts +3 -21
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.d.ts +4 -22
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.d.ts +4 -22
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPreviousAnalysisSections.d.ts +5 -17
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPreviousDatabaseSchemas.d.ts +7 -76
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPreviousInterfaceOperations.d.ts +6 -89
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPreviousInterfaceSchemas.d.ts +7 -93
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetRealizeCollectors.d.ts +3 -22
- package/lib/orchestrate/common/structures/IAutoBePreliminaryGetRealizeTransformers.d.ts +3 -22
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorization.js +114 -139
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorization.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointReview.js +90 -91
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointWrite.js +58 -59
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointWrite.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroup.js +58 -59
- package/lib/orchestrate/interface/orchestrateInterfaceGroup.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperation.js +108 -132
- package/lib/orchestrate/interface/orchestrateInterfaceOperation.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperationReview.js +72 -72
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisite.js +76 -77
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisite.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaCasting.js +130 -159
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaCasting.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaComplement.js +126 -155
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRefine.js +114 -142
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRefine.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +5 -5
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js +100 -129
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaWrite.js +120 -149
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaWrite.js.map +1 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationApplication.d.ts +10 -97
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.d.ts +14 -83
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointWriteApplication.d.ts +12 -90
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +12 -80
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +21 -116
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationReviewApplication.d.ts +24 -112
- package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.d.ts +11 -83
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +11 -76
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaCastingApplication.d.ts +18 -96
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaComplementApplication.d.ts +11 -76
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRefineApplication.d.ts +25 -107
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.d.ts +5 -31
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaReviewApplication.d.ts +6 -42
- package/lib/orchestrate/interface/utils/AutoBeJsonSchemaValidator.js +283 -283
- package/lib/orchestrate/prisma/orchestratePrismaAuthorization.js +41 -41
- package/lib/orchestrate/prisma/orchestratePrismaAuthorizationReview.js +62 -63
- package/lib/orchestrate/prisma/orchestratePrismaAuthorizationReview.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +40 -41
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponentReview.js +60 -61
- package/lib/orchestrate/prisma/orchestratePrismaComponentReview.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +112 -116
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaGroup.js +48 -49
- package/lib/orchestrate/prisma/orchestratePrismaGroup.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaGroupReview.js +70 -71
- package/lib/orchestrate/prisma/orchestratePrismaGroupReview.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js +118 -122
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemaReview.js +126 -131
- package/lib/orchestrate/prisma/orchestratePrismaSchemaReview.js.map +1 -1
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseAuthorizationApplication.d.ts +22 -99
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseAuthorizationReviewApplication.d.ts +12 -109
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseComponentApplication.d.ts +14 -100
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseComponentReviewApplication.d.ts +15 -108
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseCorrectApplication.d.ts +24 -106
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseGroupApplication.d.ts +13 -76
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseGroupReviewApplication.d.ts +13 -111
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseSchemaApplication.d.ts +26 -97
- package/lib/orchestrate/prisma/structures/IAutoBeDatabaseSchemaReviewApplication.d.ts +16 -93
- package/lib/orchestrate/realize/histories/transformRealizeOperationCorrectHistory.js +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeOperationCorrectHistory.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeOperationWriteHistory.js +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeOperationWriteHistory.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeTransformerCorrectHistory.js +20 -2
- package/lib/orchestrate/realize/histories/transformRealizeTransformerCorrectHistory.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeTransformerWriteHistory.js +22 -2
- package/lib/orchestrate/realize/histories/transformRealizeTransformerWriteHistory.js.map +1 -1
- package/lib/orchestrate/realize/internal/orchestrateRealizeCorrectCasting.js +7 -7
- package/lib/orchestrate/realize/internal/orchestrateRealizeCorrectOverall.js +86 -6
- package/lib/orchestrate/realize/internal/orchestrateRealizeCorrectOverall.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +38 -38
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationWrite.js +34 -34
- package/lib/orchestrate/realize/orchestrateRealizeCollectorCorrectOverall.js +38 -38
- package/lib/orchestrate/realize/orchestrateRealizeCollectorPlan.js +54 -54
- package/lib/orchestrate/realize/orchestrateRealizeCollectorWrite.js +36 -36
- package/lib/orchestrate/realize/orchestrateRealizeOperationCorrectOverall.js +44 -44
- package/lib/orchestrate/realize/orchestrateRealizeOperationWrite.js +42 -42
- package/lib/orchestrate/realize/orchestrateRealizeTransformerCorrectCasting.js +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeTransformerCorrectCasting.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeTransformerCorrectOverall.js +46 -46
- package/lib/orchestrate/realize/orchestrateRealizeTransformerPlan.js +36 -36
- package/lib/orchestrate/realize/orchestrateRealizeTransformerWrite.js +44 -44
- package/lib/orchestrate/realize/programmers/AutoBeRealizeTransformerProgrammer.d.ts +18 -0
- package/lib/orchestrate/realize/programmers/AutoBeRealizeTransformerProgrammer.js +167 -8
- package/lib/orchestrate/realize/programmers/AutoBeRealizeTransformerProgrammer.js.map +1 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +17 -71
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationWriteApplication.d.ts +32 -92
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCollectorCorrectApplication.d.ts +32 -114
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCollectorPlanApplication.d.ts +29 -106
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCollectorWriteApplication.d.ts +38 -131
- package/lib/orchestrate/realize/structures/IAutoBeRealizeOperationCorrectApplication.d.ts +16 -71
- package/lib/orchestrate/realize/structures/IAutoBeRealizeOperationWriteApplication.d.ts +16 -73
- package/lib/orchestrate/realize/structures/IAutoBeRealizeTransformerCorrectApplication.d.ts +37 -155
- package/lib/orchestrate/realize/structures/IAutoBeRealizeTransformerPlanApplication.d.ts +25 -88
- package/lib/orchestrate/realize/structures/IAutoBeRealizeTransformerWriteApplication.d.ts +48 -181
- package/lib/orchestrate/realize/utils/generateTS2339Hints.d.ts +5 -3
- package/lib/orchestrate/realize/utils/generateTS2339Hints.js +37 -19
- package/lib/orchestrate/realize/utils/generateTS2339Hints.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestOperationWriteHistory.js +2 -2
- package/lib/orchestrate/test/orchestrateTestScenario.js +22 -22
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js +22 -22
- package/package.json +5 -5
- package/src/AutoBeMockAgent.ts +283 -283
- package/src/constants/AutoBeSystemPromptConstant.ts +5 -4
- package/src/describe/image/structures/IAutoBeImageDescribeDraftApplication.ts +12 -63
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeExtractDecisionsApplication.ts +14 -52
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +23 -96
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioReviewApplication.ts +12 -40
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeSectionCrossFileReviewApplication.ts +30 -88
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeSectionReviewApplication.ts +35 -94
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteSectionApplication.ts +23 -93
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteUnitApplication.ts +15 -88
- package/src/orchestrate/common/histories/transformPreviousAndLatestCorrectHistory.ts +92 -31
- package/src/orchestrate/common/structures/IAnalysisSectionEntry.ts +2 -8
- package/src/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.ts +8 -50
- package/src/orchestrate/common/structures/IAutoBePreliminaryCollection.ts +1 -9
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetAnalysisSections.ts +4 -23
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetDatabaseSchemas.ts +3 -21
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.ts +4 -22
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.ts +4 -22
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetPreviousAnalysisSections.ts +5 -17
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetPreviousDatabaseSchemas.ts +7 -76
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetPreviousInterfaceOperations.ts +6 -89
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetPreviousInterfaceSchemas.ts +7 -93
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetRealizeCollectors.ts +3 -22
- package/src/orchestrate/common/structures/IAutoBePreliminaryGetRealizeTransformers.ts +3 -22
- package/src/orchestrate/interface/orchestrateInterfaceSchemaRefine.ts +291 -291
- package/src/orchestrate/interface/orchestrateInterfaceSchemaReview.ts +309 -309
- package/src/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationApplication.ts +10 -97
- package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.ts +14 -83
- package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointWriteApplication.ts +12 -90
- package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +12 -80
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +21 -116
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationReviewApplication.ts +24 -112
- package/src/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.ts +11 -83
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +11 -76
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaCastingApplication.ts +18 -96
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaComplementApplication.ts +11 -76
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRefineApplication.ts +25 -107
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.ts +5 -31
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaReviewApplication.ts +6 -42
- package/src/orchestrate/interface/utils/AutoBeJsonSchemaValidator.ts +763 -763
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseAuthorizationApplication.ts +22 -99
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseAuthorizationReviewApplication.ts +12 -109
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseComponentApplication.ts +14 -100
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseComponentReviewApplication.ts +15 -108
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseCorrectApplication.ts +24 -106
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseGroupApplication.ts +13 -76
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseGroupReviewApplication.ts +13 -111
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseSchemaApplication.ts +26 -97
- package/src/orchestrate/prisma/structures/IAutoBeDatabaseSchemaReviewApplication.ts +16 -93
- package/src/orchestrate/realize/histories/transformRealizeTransformerCorrectHistory.ts +21 -1
- package/src/orchestrate/realize/histories/transformRealizeTransformerWriteHistory.ts +26 -4
- package/src/orchestrate/realize/internal/orchestrateRealizeCorrectOverall.ts +125 -9
- package/src/orchestrate/realize/orchestrateRealizeTransformerCorrectCasting.ts +1 -0
- package/src/orchestrate/realize/programmers/AutoBeRealizeTransformerProgrammer.ts +210 -7
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +17 -71
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationWriteApplication.ts +32 -92
- package/src/orchestrate/realize/structures/IAutoBeRealizeCollectorCorrectApplication.ts +32 -114
- package/src/orchestrate/realize/structures/IAutoBeRealizeCollectorPlanApplication.ts +29 -106
- package/src/orchestrate/realize/structures/IAutoBeRealizeCollectorWriteApplication.ts +38 -131
- package/src/orchestrate/realize/structures/IAutoBeRealizeOperationCorrectApplication.ts +16 -71
- package/src/orchestrate/realize/structures/IAutoBeRealizeOperationWriteApplication.ts +16 -73
- package/src/orchestrate/realize/structures/IAutoBeRealizeTransformerCorrectApplication.ts +37 -155
- package/src/orchestrate/realize/structures/IAutoBeRealizeTransformerPlanApplication.ts +25 -88
- package/src/orchestrate/realize/structures/IAutoBeRealizeTransformerWriteApplication.ts +48 -181
- package/src/orchestrate/realize/utils/generateTS2339Hints.ts +39 -19
- package/src/orchestrate/test/experimental/orchestrateTestCorrect.ast +237 -237
- package/src/orchestrate/test/experimental/orchestrateTestWrite.ast +322 -322
- package/src/orchestrate/test/experimental/transformTestCorrectHistories.ast +52 -52
- package/src/structures/IAutoBeVendor.ts +127 -127
- package/README.md +0 -261
package/src/AutoBeMockAgent.ts
CHANGED
|
@@ -1,283 +1,283 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AutoBeAssistantMessageHistory,
|
|
3
|
-
AutoBeEvent,
|
|
4
|
-
AutoBeEventSnapshot,
|
|
5
|
-
AutoBeHistory,
|
|
6
|
-
AutoBePhase,
|
|
7
|
-
AutoBeUserConversateContent,
|
|
8
|
-
AutoBeUserMessageHistory,
|
|
9
|
-
IAutoBeAgent,
|
|
10
|
-
IAutoBeCompiler,
|
|
11
|
-
IAutoBeCompilerListener,
|
|
12
|
-
IAutoBeGetFilesOptions,
|
|
13
|
-
IAutoBePlaygroundReplay,
|
|
14
|
-
} from "@autobe/interface";
|
|
15
|
-
import { Singleton, randint, sleep_for } from "tstl";
|
|
16
|
-
import { v7 } from "uuid";
|
|
17
|
-
|
|
18
|
-
import { AutoBeAgentBase } from "./AutoBeAgentBase";
|
|
19
|
-
import { AutoBeState } from "./context/AutoBeState";
|
|
20
|
-
import { AutoBeTokenUsage } from "./context/AutoBeTokenUsage";
|
|
21
|
-
import { createAutoBeUserMessageContent } from "./factory/createAutoBeMessageContent";
|
|
22
|
-
import { createAutoBeState } from "./factory/createAutoBeState";
|
|
23
|
-
import { getAutoBeGenerated } from "./factory/getAutoBeGenerated";
|
|
24
|
-
|
|
25
|
-
/** @internal */
|
|
26
|
-
export class AutoBeMockAgent extends AutoBeAgentBase implements IAutoBeAgent {
|
|
27
|
-
private readonly props_: AutoBeMockAgent.IProps;
|
|
28
|
-
private readonly histories_: AutoBeHistory[];
|
|
29
|
-
private readonly compiler_: Singleton<Promise<IAutoBeCompiler>>;
|
|
30
|
-
private token_usage_: AutoBeTokenUsage;
|
|
31
|
-
|
|
32
|
-
public constructor(props: AutoBeMockAgent.IProps) {
|
|
33
|
-
super();
|
|
34
|
-
this.props_ = props;
|
|
35
|
-
this.histories_ = [];
|
|
36
|
-
this.compiler_ = new Singleton(async () =>
|
|
37
|
-
props.compiler({
|
|
38
|
-
realize: {
|
|
39
|
-
test: {
|
|
40
|
-
onOperation: async () => {},
|
|
41
|
-
onReset: async () => {},
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
}),
|
|
45
|
-
);
|
|
46
|
-
this.token_usage_ = new AutoBeTokenUsage();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
public async conversate(
|
|
50
|
-
content:
|
|
51
|
-
| string
|
|
52
|
-
| AutoBeUserConversateContent
|
|
53
|
-
| AutoBeUserConversateContent[],
|
|
54
|
-
): Promise<AutoBeHistory[]> {
|
|
55
|
-
const contents: AutoBeUserConversateContent[] =
|
|
56
|
-
typeof content === "string"
|
|
57
|
-
? [
|
|
58
|
-
{
|
|
59
|
-
type: "text",
|
|
60
|
-
text: content,
|
|
61
|
-
},
|
|
62
|
-
]
|
|
63
|
-
: Array.isArray(content)
|
|
64
|
-
? content
|
|
65
|
-
: [content];
|
|
66
|
-
// ALREADY REALIZED CASE
|
|
67
|
-
const state: AutoBeState = createAutoBeState(this.histories_);
|
|
68
|
-
if (state.realize !== null) {
|
|
69
|
-
const userMessage: AutoBeUserMessageHistory = {
|
|
70
|
-
id: v7(),
|
|
71
|
-
type: "userMessage",
|
|
72
|
-
contents: contents.map((c) =>
|
|
73
|
-
createAutoBeUserMessageContent({ content: c }),
|
|
74
|
-
),
|
|
75
|
-
created_at: new Date().toISOString(),
|
|
76
|
-
};
|
|
77
|
-
void this.dispatch(userMessage).catch(() => {});
|
|
78
|
-
await sleep_for(2_000);
|
|
79
|
-
const assistantMessage: AutoBeAssistantMessageHistory = {
|
|
80
|
-
id: v7(),
|
|
81
|
-
type: "assistantMessage",
|
|
82
|
-
text: [
|
|
83
|
-
"AutoBE has successfully realized the application.",
|
|
84
|
-
"",
|
|
85
|
-
"Thanks for using AutoBE!",
|
|
86
|
-
].join("\n"),
|
|
87
|
-
created_at: new Date().toISOString(),
|
|
88
|
-
completed_at: new Date().toISOString(),
|
|
89
|
-
};
|
|
90
|
-
void this.dispatch(assistantMessage).catch(() => {});
|
|
91
|
-
this.histories_.push(userMessage, assistantMessage);
|
|
92
|
-
return this.histories_;
|
|
93
|
-
}
|
|
94
|
-
const take = async (type: AutoBePhase): Promise<void> => {
|
|
95
|
-
const snapshots: AutoBeEventSnapshot[] | null =
|
|
96
|
-
this.getEventSnapshots(type);
|
|
97
|
-
if (snapshots === null) {
|
|
98
|
-
this.histories_.push({
|
|
99
|
-
id: v7(),
|
|
100
|
-
type: "userMessage",
|
|
101
|
-
contents: contents.map((c) =>
|
|
102
|
-
createAutoBeUserMessageContent({ content: c }),
|
|
103
|
-
),
|
|
104
|
-
created_at: new Date().toISOString(),
|
|
105
|
-
});
|
|
106
|
-
this.histories_.push({
|
|
107
|
-
id: v7(),
|
|
108
|
-
type: "assistantMessage",
|
|
109
|
-
text: [
|
|
110
|
-
"The histories are prepared until current state.",
|
|
111
|
-
"",
|
|
112
|
-
"Thanks for using AutoBE!",
|
|
113
|
-
].join("\n"),
|
|
114
|
-
created_at: new Date().toISOString(),
|
|
115
|
-
completed_at: new Date().toISOString(),
|
|
116
|
-
});
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
// Find the nearest user message that led into this phase for history
|
|
120
|
-
// tracking. There may be assistant messages between the user request
|
|
121
|
-
// and the resulting phase history, so we search backwards.
|
|
122
|
-
const phaseIndex = this.props_.replay.histories.findIndex(
|
|
123
|
-
(h) => h.type === type,
|
|
124
|
-
);
|
|
125
|
-
const originalUserMessage: AutoBeHistory | undefined =
|
|
126
|
-
phaseIndex > 0
|
|
127
|
-
? this.props_.replay.histories
|
|
128
|
-
.slice(0, phaseIndex)
|
|
129
|
-
.reverse()
|
|
130
|
-
.find((h) => h.type === "userMessage")
|
|
131
|
-
: undefined;
|
|
132
|
-
for (const s of snapshots) {
|
|
133
|
-
const time: number =
|
|
134
|
-
this.props_.delay?.(s.event.type) ?? sleepMap[s.event.type] ?? 500;
|
|
135
|
-
await sleep_for(randint(time * 0.2, time * 1.8));
|
|
136
|
-
void this.dispatch(s.event).catch(() => {});
|
|
137
|
-
this.token_usage_ = new AutoBeTokenUsage(s.tokenUsage);
|
|
138
|
-
}
|
|
139
|
-
this.histories_.push(
|
|
140
|
-
originalUserMessage?.type === "userMessage"
|
|
141
|
-
? originalUserMessage
|
|
142
|
-
: {
|
|
143
|
-
id: v7(),
|
|
144
|
-
type: "userMessage",
|
|
145
|
-
contents: contents.map((c) =>
|
|
146
|
-
createAutoBeUserMessageContent({ content: c }),
|
|
147
|
-
),
|
|
148
|
-
created_at: new Date().toISOString(),
|
|
149
|
-
},
|
|
150
|
-
);
|
|
151
|
-
this.histories_.push(
|
|
152
|
-
this.props_.replay.histories.find((h) => h.type === type)!,
|
|
153
|
-
);
|
|
154
|
-
};
|
|
155
|
-
if (state.analyze === null) await take("analyze");
|
|
156
|
-
else if (state.database === null) await take("database");
|
|
157
|
-
else if (state.interface === null) await take("interface");
|
|
158
|
-
else if (state.test === null) await take("test");
|
|
159
|
-
else if (state.realize === null) await take("realize");
|
|
160
|
-
return this.histories_;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
public getHistories(): AutoBeHistory[] {
|
|
164
|
-
return this.histories_;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
public getTokenUsage(): AutoBeTokenUsage {
|
|
168
|
-
return this.token_usage_;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
public async getFiles(
|
|
172
|
-
options?: IAutoBeGetFilesOptions,
|
|
173
|
-
): Promise<Record<string, string>> {
|
|
174
|
-
return await getAutoBeGenerated({
|
|
175
|
-
compiler: await this.compiler_.get(),
|
|
176
|
-
state: createAutoBeState(this.histories_),
|
|
177
|
-
histories: this.getHistories(),
|
|
178
|
-
tokenUsage: this.getTokenUsage(),
|
|
179
|
-
options,
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
public getPhase(): AutoBePhase | null {
|
|
184
|
-
const state: AutoBeState = createAutoBeState(this.histories_);
|
|
185
|
-
if (state.analyze === null) return null;
|
|
186
|
-
else if (state.realize?.step === state.analyze.step) return "realize";
|
|
187
|
-
else if (state.test?.step === state.analyze.step) return "test";
|
|
188
|
-
else if (state.interface?.step === state.analyze.step) return "interface";
|
|
189
|
-
else if (state.database?.step === state.analyze.step) return "database";
|
|
190
|
-
return "analyze";
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
private getEventSnapshots(state: AutoBePhase): AutoBeEventSnapshot[] | null {
|
|
194
|
-
return this.props_.replay[state] ?? null;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
export namespace AutoBeMockAgent {
|
|
198
|
-
export interface IProps {
|
|
199
|
-
compiler: (
|
|
200
|
-
listener: IAutoBeCompilerListener,
|
|
201
|
-
) => IAutoBeCompiler | Promise<IAutoBeCompiler>;
|
|
202
|
-
replay: IAutoBePlaygroundReplay;
|
|
203
|
-
delay?: ((type: AutoBeEvent.Type) => number | undefined) | undefined;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
const sleepMap: Record<AutoBeEvent.Type, number> = {
|
|
208
|
-
userMessage: 1_000,
|
|
209
|
-
assistantMessage: 1_000,
|
|
210
|
-
vendorRequest: 0,
|
|
211
|
-
vendorResponse: 0,
|
|
212
|
-
vendorTimeout: 0,
|
|
213
|
-
jsonParseError: 0,
|
|
214
|
-
jsonValidateError: 0,
|
|
215
|
-
consentFunctionCall: 0,
|
|
216
|
-
preliminary: 0,
|
|
217
|
-
// DESCRIBE
|
|
218
|
-
imageDescribeStart: 1_000,
|
|
219
|
-
imageDescribeDraft: 300,
|
|
220
|
-
imageDescribeComplete: 1_000,
|
|
221
|
-
// ANALYZE
|
|
222
|
-
analyzeStart: 1_000,
|
|
223
|
-
analyzeScenario: 1_000,
|
|
224
|
-
analyzeWriteModule: 500,
|
|
225
|
-
analyzeWriteUnit: 250,
|
|
226
|
-
analyzeWriteSection: 200,
|
|
227
|
-
analyzeSectionReview: 300,
|
|
228
|
-
analyzeScenarioReview: 300,
|
|
229
|
-
analyzeComplete: 1_000,
|
|
230
|
-
// PRISMA
|
|
231
|
-
databaseStart: 1_000,
|
|
232
|
-
databaseGroup: 1_000,
|
|
233
|
-
databaseGroupReview: 1_000,
|
|
234
|
-
databaseAuthorization: 1_000,
|
|
235
|
-
databaseAuthorizationReview: 500,
|
|
236
|
-
databaseComponent: 1_000,
|
|
237
|
-
databaseComponentReview: 500,
|
|
238
|
-
databaseSchema: 500,
|
|
239
|
-
databaseSchemaReview: 500,
|
|
240
|
-
databaseValidate: 2_000,
|
|
241
|
-
databaseCorrect: 500,
|
|
242
|
-
databaseComplete: 1_000,
|
|
243
|
-
// INTERFACE
|
|
244
|
-
interfaceStart: 1_000,
|
|
245
|
-
interfaceGroup: 1_000,
|
|
246
|
-
interfaceEndpoint: 500,
|
|
247
|
-
interfaceEndpointReview: 1_000,
|
|
248
|
-
interfaceOperation: 400,
|
|
249
|
-
interfaceOperationReview: 500,
|
|
250
|
-
interfaceAuthorization: 400,
|
|
251
|
-
interfaceSchema: 400,
|
|
252
|
-
interfaceSchemaCasting: 400,
|
|
253
|
-
interfaceSchemaRefine: 400,
|
|
254
|
-
interfaceSchemaReview: 200,
|
|
255
|
-
interfaceSchemaRename: 200,
|
|
256
|
-
interfaceSchemaComplement: 2_000,
|
|
257
|
-
interfaceComplete: 1_000,
|
|
258
|
-
interfacePrerequisite: 400,
|
|
259
|
-
// TEST
|
|
260
|
-
testStart: 1_000,
|
|
261
|
-
testScenario: 40,
|
|
262
|
-
testScenarioReview: 40,
|
|
263
|
-
testWrite: 40,
|
|
264
|
-
testValidate: 100,
|
|
265
|
-
testCorrect: 100,
|
|
266
|
-
testComplete: 1_000,
|
|
267
|
-
// REALIZE
|
|
268
|
-
realizeStart: 1_000,
|
|
269
|
-
realizeComplete: 1_000,
|
|
270
|
-
realizePlan: 80,
|
|
271
|
-
realizeWrite: 80,
|
|
272
|
-
realizeCorrect: 80,
|
|
273
|
-
realizeValidate: 200,
|
|
274
|
-
realizeAuthorizationStart: 1_000,
|
|
275
|
-
realizeAuthorizationWrite: 200,
|
|
276
|
-
realizeAuthorizationValidate: 200,
|
|
277
|
-
realizeAuthorizationCorrect: 200,
|
|
278
|
-
realizeAuthorizationComplete: 1_000,
|
|
279
|
-
realizeTestStart: 1_000,
|
|
280
|
-
realizeTestReset: 2_500,
|
|
281
|
-
realizeTestOperation: 400,
|
|
282
|
-
realizeTestComplete: 1_000,
|
|
283
|
-
};
|
|
1
|
+
import {
|
|
2
|
+
AutoBeAssistantMessageHistory,
|
|
3
|
+
AutoBeEvent,
|
|
4
|
+
AutoBeEventSnapshot,
|
|
5
|
+
AutoBeHistory,
|
|
6
|
+
AutoBePhase,
|
|
7
|
+
AutoBeUserConversateContent,
|
|
8
|
+
AutoBeUserMessageHistory,
|
|
9
|
+
IAutoBeAgent,
|
|
10
|
+
IAutoBeCompiler,
|
|
11
|
+
IAutoBeCompilerListener,
|
|
12
|
+
IAutoBeGetFilesOptions,
|
|
13
|
+
IAutoBePlaygroundReplay,
|
|
14
|
+
} from "@autobe/interface";
|
|
15
|
+
import { Singleton, randint, sleep_for } from "tstl";
|
|
16
|
+
import { v7 } from "uuid";
|
|
17
|
+
|
|
18
|
+
import { AutoBeAgentBase } from "./AutoBeAgentBase";
|
|
19
|
+
import { AutoBeState } from "./context/AutoBeState";
|
|
20
|
+
import { AutoBeTokenUsage } from "./context/AutoBeTokenUsage";
|
|
21
|
+
import { createAutoBeUserMessageContent } from "./factory/createAutoBeMessageContent";
|
|
22
|
+
import { createAutoBeState } from "./factory/createAutoBeState";
|
|
23
|
+
import { getAutoBeGenerated } from "./factory/getAutoBeGenerated";
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export class AutoBeMockAgent extends AutoBeAgentBase implements IAutoBeAgent {
|
|
27
|
+
private readonly props_: AutoBeMockAgent.IProps;
|
|
28
|
+
private readonly histories_: AutoBeHistory[];
|
|
29
|
+
private readonly compiler_: Singleton<Promise<IAutoBeCompiler>>;
|
|
30
|
+
private token_usage_: AutoBeTokenUsage;
|
|
31
|
+
|
|
32
|
+
public constructor(props: AutoBeMockAgent.IProps) {
|
|
33
|
+
super();
|
|
34
|
+
this.props_ = props;
|
|
35
|
+
this.histories_ = [];
|
|
36
|
+
this.compiler_ = new Singleton(async () =>
|
|
37
|
+
props.compiler({
|
|
38
|
+
realize: {
|
|
39
|
+
test: {
|
|
40
|
+
onOperation: async () => {},
|
|
41
|
+
onReset: async () => {},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
this.token_usage_ = new AutoBeTokenUsage();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public async conversate(
|
|
50
|
+
content:
|
|
51
|
+
| string
|
|
52
|
+
| AutoBeUserConversateContent
|
|
53
|
+
| AutoBeUserConversateContent[],
|
|
54
|
+
): Promise<AutoBeHistory[]> {
|
|
55
|
+
const contents: AutoBeUserConversateContent[] =
|
|
56
|
+
typeof content === "string"
|
|
57
|
+
? [
|
|
58
|
+
{
|
|
59
|
+
type: "text",
|
|
60
|
+
text: content,
|
|
61
|
+
},
|
|
62
|
+
]
|
|
63
|
+
: Array.isArray(content)
|
|
64
|
+
? content
|
|
65
|
+
: [content];
|
|
66
|
+
// ALREADY REALIZED CASE
|
|
67
|
+
const state: AutoBeState = createAutoBeState(this.histories_);
|
|
68
|
+
if (state.realize !== null) {
|
|
69
|
+
const userMessage: AutoBeUserMessageHistory = {
|
|
70
|
+
id: v7(),
|
|
71
|
+
type: "userMessage",
|
|
72
|
+
contents: contents.map((c) =>
|
|
73
|
+
createAutoBeUserMessageContent({ content: c }),
|
|
74
|
+
),
|
|
75
|
+
created_at: new Date().toISOString(),
|
|
76
|
+
};
|
|
77
|
+
void this.dispatch(userMessage).catch(() => {});
|
|
78
|
+
await sleep_for(2_000);
|
|
79
|
+
const assistantMessage: AutoBeAssistantMessageHistory = {
|
|
80
|
+
id: v7(),
|
|
81
|
+
type: "assistantMessage",
|
|
82
|
+
text: [
|
|
83
|
+
"AutoBE has successfully realized the application.",
|
|
84
|
+
"",
|
|
85
|
+
"Thanks for using AutoBE!",
|
|
86
|
+
].join("\n"),
|
|
87
|
+
created_at: new Date().toISOString(),
|
|
88
|
+
completed_at: new Date().toISOString(),
|
|
89
|
+
};
|
|
90
|
+
void this.dispatch(assistantMessage).catch(() => {});
|
|
91
|
+
this.histories_.push(userMessage, assistantMessage);
|
|
92
|
+
return this.histories_;
|
|
93
|
+
}
|
|
94
|
+
const take = async (type: AutoBePhase): Promise<void> => {
|
|
95
|
+
const snapshots: AutoBeEventSnapshot[] | null =
|
|
96
|
+
this.getEventSnapshots(type);
|
|
97
|
+
if (snapshots === null) {
|
|
98
|
+
this.histories_.push({
|
|
99
|
+
id: v7(),
|
|
100
|
+
type: "userMessage",
|
|
101
|
+
contents: contents.map((c) =>
|
|
102
|
+
createAutoBeUserMessageContent({ content: c }),
|
|
103
|
+
),
|
|
104
|
+
created_at: new Date().toISOString(),
|
|
105
|
+
});
|
|
106
|
+
this.histories_.push({
|
|
107
|
+
id: v7(),
|
|
108
|
+
type: "assistantMessage",
|
|
109
|
+
text: [
|
|
110
|
+
"The histories are prepared until current state.",
|
|
111
|
+
"",
|
|
112
|
+
"Thanks for using AutoBE!",
|
|
113
|
+
].join("\n"),
|
|
114
|
+
created_at: new Date().toISOString(),
|
|
115
|
+
completed_at: new Date().toISOString(),
|
|
116
|
+
});
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
// Find the nearest user message that led into this phase for history
|
|
120
|
+
// tracking. There may be assistant messages between the user request
|
|
121
|
+
// and the resulting phase history, so we search backwards.
|
|
122
|
+
const phaseIndex = this.props_.replay.histories.findIndex(
|
|
123
|
+
(h) => h.type === type,
|
|
124
|
+
);
|
|
125
|
+
const originalUserMessage: AutoBeHistory | undefined =
|
|
126
|
+
phaseIndex > 0
|
|
127
|
+
? this.props_.replay.histories
|
|
128
|
+
.slice(0, phaseIndex)
|
|
129
|
+
.reverse()
|
|
130
|
+
.find((h) => h.type === "userMessage")
|
|
131
|
+
: undefined;
|
|
132
|
+
for (const s of snapshots) {
|
|
133
|
+
const time: number =
|
|
134
|
+
this.props_.delay?.(s.event.type) ?? sleepMap[s.event.type] ?? 500;
|
|
135
|
+
await sleep_for(randint(time * 0.2, time * 1.8));
|
|
136
|
+
void this.dispatch(s.event).catch(() => {});
|
|
137
|
+
this.token_usage_ = new AutoBeTokenUsage(s.tokenUsage);
|
|
138
|
+
}
|
|
139
|
+
this.histories_.push(
|
|
140
|
+
originalUserMessage?.type === "userMessage"
|
|
141
|
+
? originalUserMessage
|
|
142
|
+
: {
|
|
143
|
+
id: v7(),
|
|
144
|
+
type: "userMessage",
|
|
145
|
+
contents: contents.map((c) =>
|
|
146
|
+
createAutoBeUserMessageContent({ content: c }),
|
|
147
|
+
),
|
|
148
|
+
created_at: new Date().toISOString(),
|
|
149
|
+
},
|
|
150
|
+
);
|
|
151
|
+
this.histories_.push(
|
|
152
|
+
this.props_.replay.histories.find((h) => h.type === type)!,
|
|
153
|
+
);
|
|
154
|
+
};
|
|
155
|
+
if (state.analyze === null) await take("analyze");
|
|
156
|
+
else if (state.database === null) await take("database");
|
|
157
|
+
else if (state.interface === null) await take("interface");
|
|
158
|
+
else if (state.test === null) await take("test");
|
|
159
|
+
else if (state.realize === null) await take("realize");
|
|
160
|
+
return this.histories_;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
public getHistories(): AutoBeHistory[] {
|
|
164
|
+
return this.histories_;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
public getTokenUsage(): AutoBeTokenUsage {
|
|
168
|
+
return this.token_usage_;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
public async getFiles(
|
|
172
|
+
options?: IAutoBeGetFilesOptions,
|
|
173
|
+
): Promise<Record<string, string>> {
|
|
174
|
+
return await getAutoBeGenerated({
|
|
175
|
+
compiler: await this.compiler_.get(),
|
|
176
|
+
state: createAutoBeState(this.histories_),
|
|
177
|
+
histories: this.getHistories(),
|
|
178
|
+
tokenUsage: this.getTokenUsage(),
|
|
179
|
+
options,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
public getPhase(): AutoBePhase | null {
|
|
184
|
+
const state: AutoBeState = createAutoBeState(this.histories_);
|
|
185
|
+
if (state.analyze === null) return null;
|
|
186
|
+
else if (state.realize?.step === state.analyze.step) return "realize";
|
|
187
|
+
else if (state.test?.step === state.analyze.step) return "test";
|
|
188
|
+
else if (state.interface?.step === state.analyze.step) return "interface";
|
|
189
|
+
else if (state.database?.step === state.analyze.step) return "database";
|
|
190
|
+
return "analyze";
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
private getEventSnapshots(state: AutoBePhase): AutoBeEventSnapshot[] | null {
|
|
194
|
+
return this.props_.replay[state] ?? null;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
export namespace AutoBeMockAgent {
|
|
198
|
+
export interface IProps {
|
|
199
|
+
compiler: (
|
|
200
|
+
listener: IAutoBeCompilerListener,
|
|
201
|
+
) => IAutoBeCompiler | Promise<IAutoBeCompiler>;
|
|
202
|
+
replay: IAutoBePlaygroundReplay;
|
|
203
|
+
delay?: ((type: AutoBeEvent.Type) => number | undefined) | undefined;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const sleepMap: Record<AutoBeEvent.Type, number> = {
|
|
208
|
+
userMessage: 1_000,
|
|
209
|
+
assistantMessage: 1_000,
|
|
210
|
+
vendorRequest: 0,
|
|
211
|
+
vendorResponse: 0,
|
|
212
|
+
vendorTimeout: 0,
|
|
213
|
+
jsonParseError: 0,
|
|
214
|
+
jsonValidateError: 0,
|
|
215
|
+
consentFunctionCall: 0,
|
|
216
|
+
preliminary: 0,
|
|
217
|
+
// DESCRIBE
|
|
218
|
+
imageDescribeStart: 1_000,
|
|
219
|
+
imageDescribeDraft: 300,
|
|
220
|
+
imageDescribeComplete: 1_000,
|
|
221
|
+
// ANALYZE
|
|
222
|
+
analyzeStart: 1_000,
|
|
223
|
+
analyzeScenario: 1_000,
|
|
224
|
+
analyzeWriteModule: 500,
|
|
225
|
+
analyzeWriteUnit: 250,
|
|
226
|
+
analyzeWriteSection: 200,
|
|
227
|
+
analyzeSectionReview: 300,
|
|
228
|
+
analyzeScenarioReview: 300,
|
|
229
|
+
analyzeComplete: 1_000,
|
|
230
|
+
// PRISMA
|
|
231
|
+
databaseStart: 1_000,
|
|
232
|
+
databaseGroup: 1_000,
|
|
233
|
+
databaseGroupReview: 1_000,
|
|
234
|
+
databaseAuthorization: 1_000,
|
|
235
|
+
databaseAuthorizationReview: 500,
|
|
236
|
+
databaseComponent: 1_000,
|
|
237
|
+
databaseComponentReview: 500,
|
|
238
|
+
databaseSchema: 500,
|
|
239
|
+
databaseSchemaReview: 500,
|
|
240
|
+
databaseValidate: 2_000,
|
|
241
|
+
databaseCorrect: 500,
|
|
242
|
+
databaseComplete: 1_000,
|
|
243
|
+
// INTERFACE
|
|
244
|
+
interfaceStart: 1_000,
|
|
245
|
+
interfaceGroup: 1_000,
|
|
246
|
+
interfaceEndpoint: 500,
|
|
247
|
+
interfaceEndpointReview: 1_000,
|
|
248
|
+
interfaceOperation: 400,
|
|
249
|
+
interfaceOperationReview: 500,
|
|
250
|
+
interfaceAuthorization: 400,
|
|
251
|
+
interfaceSchema: 400,
|
|
252
|
+
interfaceSchemaCasting: 400,
|
|
253
|
+
interfaceSchemaRefine: 400,
|
|
254
|
+
interfaceSchemaReview: 200,
|
|
255
|
+
interfaceSchemaRename: 200,
|
|
256
|
+
interfaceSchemaComplement: 2_000,
|
|
257
|
+
interfaceComplete: 1_000,
|
|
258
|
+
interfacePrerequisite: 400,
|
|
259
|
+
// TEST
|
|
260
|
+
testStart: 1_000,
|
|
261
|
+
testScenario: 40,
|
|
262
|
+
testScenarioReview: 40,
|
|
263
|
+
testWrite: 40,
|
|
264
|
+
testValidate: 100,
|
|
265
|
+
testCorrect: 100,
|
|
266
|
+
testComplete: 1_000,
|
|
267
|
+
// REALIZE
|
|
268
|
+
realizeStart: 1_000,
|
|
269
|
+
realizeComplete: 1_000,
|
|
270
|
+
realizePlan: 80,
|
|
271
|
+
realizeWrite: 80,
|
|
272
|
+
realizeCorrect: 80,
|
|
273
|
+
realizeValidate: 200,
|
|
274
|
+
realizeAuthorizationStart: 1_000,
|
|
275
|
+
realizeAuthorizationWrite: 200,
|
|
276
|
+
realizeAuthorizationValidate: 200,
|
|
277
|
+
realizeAuthorizationCorrect: 200,
|
|
278
|
+
realizeAuthorizationComplete: 1_000,
|
|
279
|
+
realizeTestStart: 1_000,
|
|
280
|
+
realizeTestReset: 2_500,
|
|
281
|
+
realizeTestOperation: 400,
|
|
282
|
+
realizeTestComplete: 1_000,
|
|
283
|
+
};
|