@autobe/agent 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutoBeAgent.js +2 -2
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/AutoBeMockAgent.d.ts +1 -0
- package/lib/AutoBeMockAgent.js +18 -4
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +3 -3
- package/lib/factory/getAutoBeGenerated.js +2 -1
- package/lib/factory/getAutoBeGenerated.js.map +1 -1
- package/lib/index.mjs +739 -577
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.d.ts +0 -15
- package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.js +0 -3
- package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +19 -12
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.d.ts +1 -2
- package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.js +3 -5
- package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.d.ts +7 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js +363 -4
- package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +3 -3
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +3 -118
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.js +1 -1
- package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.js.map +1 -1
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.d.ts +11 -4
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js +61 -45
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +17 -10
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/orchestrate/realize/ProviderCodeComparator.d.ts +5 -0
- package/lib/orchestrate/realize/ProviderCodeComparator.js +16 -0
- package/lib/orchestrate/realize/ProviderCodeComparator.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealize.js +41 -53
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +13 -87
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +32 -43
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCoder.d.ts +3 -2
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js +25 -39
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +1 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +15 -15
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +11 -17
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +4 -2
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +21 -17
- package/lib/orchestrate/realize/transformRealizeAuthorization.js +5 -9
- package/lib/orchestrate/realize/transformRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.js +9 -0
- package/lib/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- package/lib/orchestrate/realize/transformRealizeCoderHistories.d.ts +3 -2
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js +58 -27
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js.map +1 -1
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.d.ts +5 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.js +10 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.js.map +1 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.d.ts +4 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js +38 -0
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js.map +1 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.d.ts +2 -1
- package/lib/orchestrate/realize/utils/replaceImportStatements.js +15 -2
- package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.d.ts +9 -2
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js +158 -100
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTest.js +1 -1
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/package.json +6 -6
- package/src/AutoBeAgent.ts +1 -1
- package/src/AutoBeMockAgent.ts +20 -6
- package/src/constants/AutoBeSystemPromptConstant.ts +3 -3
- package/src/factory/getAutoBeGenerated.ts +2 -1
- package/src/orchestrate/analyze/AutoBeAnalyzeFileSystem.ts +0 -15
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +17 -17
- package/src/orchestrate/analyze/orchestrateAnalyzeComposer.ts +4 -7
- package/src/orchestrate/analyze/orchestrateAnalyzeReviewer.ts +100 -6
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +5 -21
- package/src/orchestrate/analyze/writeDocumentUntilReviewPassed.ts +76 -59
- package/src/orchestrate/prisma/transformPrismaComponentsHistories.ts +17 -10
- package/src/orchestrate/realize/ProviderCodeComparator.ts +15 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +54 -59
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +12 -120
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +21 -5
- package/src/orchestrate/realize/orchestrateRealizeCoder.ts +10 -9
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +15 -15
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +11 -18
- package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +4 -2
- package/src/orchestrate/realize/structures/IAutoBeRealizeCompile.ts +24 -17
- package/src/orchestrate/realize/transformRealizeAuthorization.ts +5 -9
- package/src/orchestrate/realize/transformRealizeAuthorizationCorrectHistories.ts +9 -0
- package/src/orchestrate/realize/transformRealizeCoderHistories.ts +73 -25
- package/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationFileSystem.ts +9 -0
- package/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.ts +64 -0
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +41 -2
- package/src/orchestrate/realize/writeCodeUntilCompilePassed.ts +219 -145
- package/src/orchestrate/test/orchestrateTest.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateAnalyzeWrite.js","sourceRoot":"","sources":["../../../src/orchestrate/analyze/orchestrateAnalyzeWrite.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoE;
|
|
1
|
+
{"version":3,"file":"orchestrateAnalyzeWrite.js","sourceRoot":"","sources":["../../../src/orchestrate/analyze/orchestrateAnalyzeWrite.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoE;AAGpE,kDAA0B;AAG1B,uEAAoE;AACpE,iEAA8D;AAC9D,uEAImC;AAEnC,qFAAkF;AAE3E,MAAM,uBAAuB,GAAG,CACrC,GA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M;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIT,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;CACd,CAAC"}
|
|
@@ -19,7 +19,7 @@ const transformAnalyzeReviewerHistories = (input) => {
|
|
|
19
19
|
id: (0, uuid_1.v4)(),
|
|
20
20
|
created_at: new Date().toISOString(),
|
|
21
21
|
type: "systemMessage",
|
|
22
|
-
text: "# Reviewer Agent Operating Guidelines\n\n## Core Principles\n
|
|
22
|
+
text: "# Reviewer Agent Operating Guidelines\n\n## Core Principles\n- **Review only the document currently being viewed.** Ignore any references to other documents, even if implied.\n- If the current document is **not a table of contents page** (i.e., does not start with `00`) and references external documents, **instruct the planner to clear all content and rewrite the current document** to focus solely on its assigned scope.\n- **Do not request the creation of any other pages or documents.** Each agent must write and review **only the single page assigned to them.**\n- Attempts to write or request other pages are strictly prohibited. If such attempts occur, **command the agent to focus exclusively on the current page.**\n- The table of contents page (starting with `00`) is exempt from content rewriting rules unless it contains invalid references.\n- Other documents will be handled by other agents, so **do not request their creation** under any circumstances.\n\n## Role of the Reviewer\n- The Reviewer Agent\u2019s role is to **ensure the document contains sufficient information** before it is delivered to developers.\n- **Review all hyperlinks** currently referenced in the markdown and ensure they are valid or appropriately handled:\n - Internal anchor links (e.g., `#section-title`) must point to existing headings within the document.\n - External document links are allowed only if they do not impact the core content of the current document (unless it\u2019s a table of contents page).\n- **Do not create files** that are not specified in the table of contents.\n- If the user specifies an **exact number of pages**, that number **must be strictly followed.**\n- Reviewers are limited to reviewing **only their assigned single page** and must not engage with other pages or documents.\n- If an agent requests creation of other pages, **command them to stop** and enforce focus on the current page.\n\n## Conditions Requiring `reject`\nThe Reviewer Agent **must** call `reject` with a reason, feedback, and suggestions in the following cases:\n- Document length is **less than 2,000 characters** (excluding table of contents pages).\n- Any section listed in the table of contents is **missing or incomplete**.\n- Internal anchor links (e.g., `#section-title`) point to **non-existent headings** within the document.\n- External document references in a non-table-of-contents page impact the **core content** of the document.\n- Content is **insufficient relative to the number of headings** (e.g., average content per heading is less than 300 characters).\n- Any violation of the **page-based work division** rules (e.g., attempts to write or reference content outside the assigned page).\n\n## Conditions for `accept`\nThe Reviewer Agent **must** call `accept` only when **all** of the following conditions are met:\n- Document length is **between 2,000 and 6,000 characters** (excluding table of contents pages).\n- All sections listed in the table of contents are **fully written** with sufficient detail.\n- All internal anchor links point to **existing headings** within the document.\n- External document references (if any) do not impact the **core content** of the document, or the document is a table of contents page.\n- Content is **sufficient relative to the number of headings** (e.g., average content per heading is at least 300 characters).\n\n## Instructions for Revisions\n- If modifications are needed, **call `reject`** and provide:\n - A **clear reason** for rejection (e.g., \u201CDocument is 1,500 characters, below the 2,000-character minimum\u201D).\n - **Detailed feedback** identifying the issue (e.g., \u201CSection [Section Title] is missing\u201D).\n - **Specific suggestions** for correction (e.g., \u201CAdd 500 characters to Section [Section Title] with details on [specific topic]\u201D).\n- If the document is too short or lacks content:\n - Compare the number of headings to the text length.\n - Instruct the analyze agent to **expand content** within the current page (e.g., \u201CWith 5 headings and 1,500 characters, add 500 characters to Section [Section Title]\u201D).\n- If an internal anchor link points to a non-existent heading:\n - Instruct the analyze agent to **create a new section** with the same title as the hyperlink and insert it under the appropriate heading.\n- If external document references are included in a non-table-of-contents page:\n - Instruct the analyze agent to **integrate the referenced content** into the current page or remove the reference if it\u2019s not critical.\n- Requirements for revisions must follow the **EARS (Easy Approach to Requirements Syntax)** format.\n\n## Prohibited Actions\n- The Reviewer Agent **must not write content** under any circumstances.\n- Reviewers are **independent** and must not be instructed by other agents.\n- The Reviewer\u2019s words are **commands**, not recommendations, and must be followed.\n\n## Guidelines for Document Volume\n- Documents (excluding table of contents) should be **2,000\u20136,000 characters** for sufficient utility.\n- If the document is too short:\n - Indicate the current character count and the additional characters needed (e.g., \u201CCurrent length: 1,500 characters; add 500 characters\u201D).\n - Compare the number of headings to the text length and instruct the analyze agent to expand content accordingly (e.g., \u201CWith 5 headings, aim for 400 characters per heading\u201D).\n- The table of contents page is exempt from the volume limit.\n- When referencing the table of contents, **clearly state the section name**.\n\n## Guidelines for Hyperlinks\n- **Incomplete internal anchor links** (pointing to non-existent headings) trigger a `reject` call. Instruct the analyze agent to create the missing section.\n- **External document links** are allowed only if they do not impact the core content of the current document (unless it\u2019s a table of contents page). If they do, trigger a `reject` call and instruct integration or removal.\n- If a hyperlink points to a heading within the same document, that heading **must exist**. If it does not, call `reject` and instruct the analyze agent to add the section.\n- External links in non-table-of-contents pages that are not critical to the content are allowed, assuming other agents will handle those documents.\n\n## Q&A Guidelines\n- If the analyze agent asks a question, the Reviewer Agent **must answer** on behalf of the user.\n- **Never ask questions.** Only issue commands.\n\n## Review Completion Conditions\n- Call `accept` only when:\n - All sections listed in the table of contents are **fully written**.\n - All internal hyperlinks are **resolved** (point to existing headings).\n - Document length is **2,000\u20136,000 characters** (excluding table of contents).\n - External references (if any) do not impact the core content, or the document is a table of contents page.\n- If any sections are incomplete or links unresolved:\n - Call `reject` and instruct the analyze agent to continue writing, specifying the **section title** and a **brief explanation** of the needed content (e.g., \u201CSection [Section Title] lacks details on [topic]; add 300 characters\u201D).\n\n## Iterative Review Workflow\n- If issues persist after revisions, **call `reject` again** with updated reasons, feedback, and suggestions.\n- Example: \u201CDocument is still 1,800 characters. Call `reject` and add 300 characters to Section [Section Title] with details on [specific topic].\u201D\n- Continue this process until all conditions for `accept` are met.\n\n## Additional Requirements for Page-Based Work Division\n- Each agent must write and review **only their assigned single page** out of the total pages specified.\n- If an agent attempts to request or create content beyond their assigned page, **immediately command them to focus solely on the current page.**\n- All document length and content sufficiency checks must be confined to the assigned page.\n- If multiple pages exist, the **exact number of pages** must be adhered to, and no additional pages should be created.\n- Enforce strict page-level division to maintain clear boundaries of responsibility and simplify review workflows.\n\n## Enforcement\n- All guidelines must be **strictly enforced**. Any violations (e.g., referencing other pages, insufficient content) require an immediate `reject` call with clear instructions for correction." /* AutoBeSystemPromptConstant.ANALYZE_REVIEWER */,
|
|
23
23
|
},
|
|
24
24
|
];
|
|
25
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformAnalyzeReviewerHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/analyze/transformAnalyzeReviewerHistories.ts"],"names":[],"mappings":";;;AACA,+BAA0B;AAInB,MAAM,iCAAiC,GAAG,CAAC,KAGjD,EAEC,EAAE;IACF,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,6BAA6B;gBAC7B,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC;gBAC3B,KAAK;aACN,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,
|
|
1
|
+
{"version":3,"file":"transformAnalyzeReviewerHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/analyze/transformAnalyzeReviewerHistories.ts"],"names":[],"mappings":";;;AACA,+BAA0B;AAInB,MAAM,iCAAiC,GAAG,CAAC,KAGjD,EAEC,EAAE;IACF,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,6BAA6B;gBAC7B,SAAS;gBACT,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC;gBAC3B,KAAK;aACN,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,6yQAA6C;SAClD;KACF,CAAC;AACJ,CAAC,CAAC;AAzBW,QAAA,iCAAiC,qCAyB5C"}
|
|
@@ -3,7 +3,14 @@ import { ILlmSchema } from "@samchon/openapi";
|
|
|
3
3
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
4
4
|
import { IFile } from "./AutoBeAnalyzeFileSystem";
|
|
5
5
|
import { AutoBeAnalyzePointer } from "./AutoBeAnalyzePointer";
|
|
6
|
-
export declare function writeDocumentUntilReviewPassed<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export declare function writeDocumentUntilReviewPassed<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, props: {
|
|
7
|
+
totalFiles: Pick<IFile, "filename" | "reason">[];
|
|
8
|
+
filename: string;
|
|
9
|
+
roles: AutoBeAnalyzeRole[];
|
|
10
|
+
progress: {
|
|
11
|
+
total: number;
|
|
12
|
+
completed: number;
|
|
13
|
+
};
|
|
14
|
+
retry?: number;
|
|
15
|
+
prevReview?: string;
|
|
16
|
+
}): Promise<AutoBeAnalyzePointer>;
|
|
@@ -12,52 +12,68 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.writeDocumentUntilReviewPassed = writeDocumentUntilReviewPassed;
|
|
13
13
|
const orchestrateAnalyzeReviewer_1 = require("./orchestrateAnalyzeReviewer");
|
|
14
14
|
const orchestrateAnalyzeWrite_1 = require("./orchestrateAnalyzeWrite");
|
|
15
|
-
function writeDocumentUntilReviewPassed(
|
|
16
|
-
return __awaiter(this,
|
|
17
|
-
var _a, _b, _c, _d;
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
roles: roles,
|
|
29
|
-
targetFile: filename,
|
|
30
|
-
review,
|
|
31
|
-
}, pointer, isAborted);
|
|
32
|
-
yield writer.conversate(review !== null && review !== void 0 ? review : write).finally(() => {
|
|
33
|
-
const tokenUsage = writer.getTokenUsage();
|
|
34
|
-
ctx.usage().record(tokenUsage, ["analyze"]);
|
|
35
|
-
});
|
|
36
|
-
if (pointer.value === null) {
|
|
37
|
-
throw new Error("Failed to write document by unknown reason.");
|
|
38
|
-
}
|
|
39
|
-
ctx.dispatch({
|
|
40
|
-
type: "analyzeWrite",
|
|
41
|
-
files: Object.assign({}, pointer.value.files),
|
|
42
|
-
total: progress.total,
|
|
43
|
-
completed: ++progress.completed,
|
|
44
|
-
step: (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
|
|
45
|
-
created_at: new Date().toISOString(),
|
|
46
|
-
});
|
|
47
|
-
// Do review
|
|
48
|
-
review = yield (0, orchestrateAnalyzeReviewer_1.orchestrateAnalyzeReviewer)(ctx, pointer.value);
|
|
49
|
-
if (review !== null)
|
|
50
|
-
ctx.dispatch({
|
|
51
|
-
type: "analyzeReview",
|
|
52
|
-
files: Object.assign({}, pointer.value.files),
|
|
53
|
-
review,
|
|
54
|
-
total: progress.total,
|
|
55
|
-
completed: progress.completed,
|
|
56
|
-
step: (_d = (_c = ctx.state().analyze) === null || _c === void 0 ? void 0 : _c.step) !== null && _d !== void 0 ? _d : 0,
|
|
57
|
-
created_at: new Date().toISOString(),
|
|
58
|
-
});
|
|
15
|
+
function writeDocumentUntilReviewPassed(ctx, props) {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
18
|
+
const retry = (_a = props.retry) !== null && _a !== void 0 ? _a : 3;
|
|
19
|
+
const pointer = {
|
|
20
|
+
value: { files: {} },
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* `retry` means the number of times to retry the review. so if `retry` is -1,
|
|
24
|
+
* it means not execute this logic.
|
|
25
|
+
*/
|
|
26
|
+
if (retry === -1) {
|
|
27
|
+
return pointer;
|
|
59
28
|
}
|
|
60
|
-
|
|
29
|
+
let isToolCalled = false;
|
|
30
|
+
const writer = (0, orchestrateAnalyzeWrite_1.orchestrateAnalyzeWrite)(ctx, {
|
|
31
|
+
totalFiles: props.totalFiles,
|
|
32
|
+
roles: props.roles,
|
|
33
|
+
targetFile: props.filename,
|
|
34
|
+
review: (_b = props.prevReview) !== null && _b !== void 0 ? _b : "",
|
|
35
|
+
setDocument: (v) => {
|
|
36
|
+
var _a;
|
|
37
|
+
isToolCalled = true;
|
|
38
|
+
pointer.value = { files: Object.assign(Object.assign({}, (_a = pointer.value) === null || _a === void 0 ? void 0 : _a.files), v) };
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
yield writer.conversate("Write Document.").finally(() => {
|
|
42
|
+
const tokenUsage = writer.getTokenUsage();
|
|
43
|
+
ctx.usage().record(tokenUsage, ["analyze"]);
|
|
44
|
+
});
|
|
45
|
+
if (isToolCalled === false) {
|
|
46
|
+
throw new Error("Failed to write document by unknown reason.");
|
|
47
|
+
}
|
|
48
|
+
ctx.dispatch({
|
|
49
|
+
type: "analyzeWrite",
|
|
50
|
+
files: Object.assign({}, (_c = pointer.value) === null || _c === void 0 ? void 0 : _c.files),
|
|
51
|
+
total: props.progress.total,
|
|
52
|
+
completed: ++props.progress.completed,
|
|
53
|
+
step: (_e = (_d = ctx.state().analyze) === null || _d === void 0 ? void 0 : _d.step) !== null && _e !== void 0 ? _e : 0,
|
|
54
|
+
created_at: new Date().toISOString(),
|
|
55
|
+
});
|
|
56
|
+
const reviewResult = yield (0, orchestrateAnalyzeReviewer_1.orchestrateAnalyzeReviewer)(ctx, pointer.value);
|
|
57
|
+
if (reviewResult.type === "accept") {
|
|
58
|
+
return pointer;
|
|
59
|
+
}
|
|
60
|
+
ctx.dispatch({
|
|
61
|
+
type: "analyzeReview",
|
|
62
|
+
files: Object.assign({}, pointer.value.files),
|
|
63
|
+
review: reviewResult.value,
|
|
64
|
+
total: props.progress.total,
|
|
65
|
+
completed: props.progress.completed,
|
|
66
|
+
step: (_g = (_f = ctx.state().analyze) === null || _f === void 0 ? void 0 : _f.step) !== null && _g !== void 0 ? _g : 0,
|
|
67
|
+
created_at: new Date().toISOString(),
|
|
68
|
+
});
|
|
69
|
+
return yield writeDocumentUntilReviewPassed(ctx, {
|
|
70
|
+
totalFiles: props.totalFiles,
|
|
71
|
+
filename: props.filename,
|
|
72
|
+
roles: props.roles,
|
|
73
|
+
progress: props.progress,
|
|
74
|
+
retry: retry - 1,
|
|
75
|
+
prevReview: reviewResult.value,
|
|
76
|
+
});
|
|
61
77
|
});
|
|
62
78
|
}
|
|
63
79
|
//# sourceMappingURL=writeDocumentUntilReviewPassed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeDocumentUntilReviewPassed.js","sourceRoot":"","sources":["../../../src/orchestrate/analyze/writeDocumentUntilReviewPassed.ts"],"names":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"writeDocumentUntilReviewPassed.js","sourceRoot":"","sources":["../../../src/orchestrate/analyze/writeDocumentUntilReviewPassed.ts"],"names":[],"mappings":";;;;;;;;;;;AAYA,wEAmFC;AAtFD,6EAA0E;AAC1E,uEAAoE;AAEpE,SAAsB,8BAA8B,CAGlD,GAAyB,EACzB,KAOC;;;QAED,MAAM,KAAK,GAAG,MAAA,KAAK,CAAC,K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AAE,KAAK,CAAC,QAAQ,CAAC,SAAS;YACrC,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,CAAC;QAEH,MAAM,YAAY,GAAG,MAAM,IAAA,uDAA0B,EAAC,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAE1E,IAAI,YAAY,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACnC,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,eAAe;YACrB,KAAK,oBACA,OAAO,CAAC,KAAK,CAAC,KAAK,CACvB;YACD,MAAM,EAAE,YAAY,CAAC,KAAK;YAC1B,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK;YAC3B,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,SAAS;YACnC,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,CAAC;QAEH,OAAO,MAAM,8BAA8B,CAAC,GAAG,EAAE;YAC/C,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,KAAK,EAAE,KAAK,GAAG,CAAC;YAChB,UAAU,EAAE,YAAY,CAAC,KAAK;SAC/B,CAAC,CAAC;IACL,CAAC;CAAA"}
|
|
@@ -33,9 +33,6 @@ const transformPrismaComponentsHistories = (state, prefix = null) => {
|
|
|
33
33
|
"Call the provided tool function to generate Prisma DB schema",
|
|
34
34
|
"referencing below requirement analysis report.",
|
|
35
35
|
"",
|
|
36
|
-
"## User Request",
|
|
37
|
-
state.analyze.reason,
|
|
38
|
-
"",
|
|
39
36
|
`## Requirement Analysis Report`,
|
|
40
37
|
"",
|
|
41
38
|
"```json",
|
|
@@ -62,14 +59,24 @@ const transformPrismaComponentsHistories = (state, prefix = null) => {
|
|
|
62
59
|
"",
|
|
63
60
|
"* `mv_shopping_daily_stats`",
|
|
64
61
|
"",
|
|
65
|
-
"## User Role Handling",
|
|
66
|
-
"",
|
|
67
|
-
"If the Requirement Analysis Report contains User Role information, **do not normalize** user roles into a single table.",
|
|
68
|
-
"Instead, create separate tables for each distinct role mentioned in the requirements.",
|
|
69
|
-
"",
|
|
70
|
-
"For example, if the requirements mention User, Admin, and Moderator roles:",
|
|
71
62
|
"",
|
|
72
|
-
|
|
63
|
+
state.analyze.roles.length > 0
|
|
64
|
+
? [
|
|
65
|
+
"## User Role Handling",
|
|
66
|
+
"",
|
|
67
|
+
`The Requirement Analysis Report contains the following user roles: ${state.analyze.roles.join(", ")}.`,
|
|
68
|
+
"",
|
|
69
|
+
"**Do not normalize** user roles into a single table.",
|
|
70
|
+
"Instead, create separate tables for each distinct role mentioned in the requirements.",
|
|
71
|
+
"",
|
|
72
|
+
"Create separate tables for each role:",
|
|
73
|
+
"",
|
|
74
|
+
state.analyze.roles
|
|
75
|
+
.map((role) => `* ${prefix}_${role.name.toLowerCase()}`)
|
|
76
|
+
.join("\n"),
|
|
77
|
+
"",
|
|
78
|
+
].join("\n")
|
|
79
|
+
: "",
|
|
73
80
|
].join("\n"),
|
|
74
81
|
},
|
|
75
82
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformPrismaComponentsHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/transformPrismaComponentsHistories.ts"],"names":[],"mappings":";;;AACA,+BAA0B;AAKnB,MAAM,kCAAkC,GAAG,CAChD,KAAkB,EAClB,SAAwB,IAAI,EAG5B,EAAE;IACF,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;QACxB,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,4CAA4C;oBAC5C,+BAA+B;oBAC/B,8CAA8C;iBAC/C,CAAC,IAAI,CAAC,GAAG,CAAC;aACZ;SACF,CAAC;IACJ,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,mtTAA6C;SAClD;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE;gBACJ,0CAA0C;gBAC1C,EAAE;gBACF,8DAA8D;gBAC9D,gDAAgD;gBAChD,EAAE;gBACF,
|
|
1
|
+
{"version":3,"file":"transformPrismaComponentsHistories.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/transformPrismaComponentsHistories.ts"],"names":[],"mappings":";;;AACA,+BAA0B;AAKnB,MAAM,kCAAkC,GAAG,CAChD,KAAkB,EAClB,SAAwB,IAAI,EAG5B,EAAE;IACF,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;QACxB,OAAO;YACL;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,4CAA4C;oBAC5C,+BAA+B;oBAC/B,8CAA8C;iBAC/C,CAAC,IAAI,CAAC,GAAG,CAAC;aACZ;SACF,CAAC;IACJ,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EA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BACd,CAAC,CAAC,EAAE;aACP,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF,CAAC;AACJ,CAAC,CAAC;AAnFW,QAAA,kCAAkC,sCAmF7C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProviderCodeComparator = void 0;
|
|
4
|
+
const tstl_1 = require("tstl");
|
|
5
|
+
var ProviderCodeComparator;
|
|
6
|
+
(function (ProviderCodeComparator) {
|
|
7
|
+
function hashCode(e) {
|
|
8
|
+
return (0, tstl_1.hash)(e.path, e.method);
|
|
9
|
+
}
|
|
10
|
+
ProviderCodeComparator.hashCode = hashCode;
|
|
11
|
+
function equals(x, y) {
|
|
12
|
+
return x.path === y.path && x.method === y.method;
|
|
13
|
+
}
|
|
14
|
+
ProviderCodeComparator.equals = equals;
|
|
15
|
+
})(ProviderCodeComparator || (exports.ProviderCodeComparator = ProviderCodeComparator = {}));
|
|
16
|
+
//# sourceMappingURL=ProviderCodeComparator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProviderCodeComparator.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/ProviderCodeComparator.ts"],"names":[],"mappings":";;;AACA,+BAA4B;AAE5B,IAAiB,sBAAsB,CAWtC;AAXD,WAAiB,sBAAsB;IACrC,SAAgB,QAAQ,CAAC,CAA0B;QACjD,OAAO,IAAA,WAAI,EAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAFe,+BAAQ,WAEvB,CAAA;IAED,SAAgB,MAAM,CACpB,CAA0B,EAC1B,CAA0B;QAE1B,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC;IACpD,CAAC;IALe,6BAAM,SAKrB,CAAA;AACH,CAAC,EAXgB,sBAAsB,sCAAtB,sBAAsB,QAWtC"}
|
|
@@ -11,76 +11,64 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.orchestrateRealize = void 0;
|
|
13
13
|
const uuid_1 = require("uuid");
|
|
14
|
+
const getAutoBeGenerated_1 = require("../../factory/getAutoBeGenerated");
|
|
14
15
|
const orchestrateRealizeAuthorization_1 = require("./orchestrateRealizeAuthorization");
|
|
15
16
|
const writeCodeUntilCompilePassed_1 = require("./writeCodeUntilCompilePassed");
|
|
16
17
|
const orchestrateRealize = (ctx) => (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (!ops) {
|
|
18
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
19
|
+
const operations = (_a = ctx.state().interface) === null || _a === void 0 ? void 0 : _a.document.operations;
|
|
20
|
+
if (!operations) {
|
|
21
21
|
throw new Error("Can't do realize agent because operations are nothing.");
|
|
22
22
|
}
|
|
23
|
+
const start = new Date();
|
|
23
24
|
ctx.dispatch({
|
|
24
25
|
type: "realizeStart",
|
|
25
26
|
created_at: new Date().toISOString(),
|
|
26
27
|
reason: props.reason,
|
|
27
28
|
step: (_c = (_b = ctx.state().test) === null || _b === void 0 ? void 0 : _b.step) !== null && _c !== void 0 ? _c : 0,
|
|
28
29
|
});
|
|
30
|
+
// generate authorizations and functions
|
|
29
31
|
const authorizations = yield (0, orchestrateRealizeAuthorization_1.orchestrateRealizeAuthorization)(ctx);
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
functions: Object.assign(Object.assign({}, files), authorizations
|
|
43
|
-
.flatMap((el) => {
|
|
44
|
-
return [
|
|
45
|
-
{
|
|
46
|
-
[el.decorator.location]: el.decorator.content,
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
[el.payload.location]: el.payload.content,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
[el.payload.location]: el.payload.content,
|
|
53
|
-
},
|
|
54
|
-
];
|
|
55
|
-
})
|
|
56
|
-
.reduce((acc, cur) => Object.assign(acc, cur))),
|
|
57
|
-
completed_at: now,
|
|
58
|
-
created_at: now,
|
|
59
|
-
id: (0, uuid_1.v4)(),
|
|
60
|
-
reason: props.reason,
|
|
61
|
-
step: (_e = (_d = ctx.state().analyze) === null || _d === void 0 ? void 0 : _d.step) !== null && _e !== void 0 ? _e : 0,
|
|
62
|
-
authorizations: (_g = (_f = ctx.state().realize) === null || _f === void 0 ? void 0 : _f.authorizations) !== null && _g !== void 0 ? _g : [],
|
|
63
|
-
});
|
|
64
|
-
ctx.histories().push(history);
|
|
65
|
-
}
|
|
66
|
-
ctx.dispatch({
|
|
67
|
-
type: "assistantMessage",
|
|
68
|
-
text: "Any codes can not be generated.",
|
|
69
|
-
created_at: now,
|
|
32
|
+
const result = yield (0, writeCodeUntilCompilePassed_1.writeCodeUntilCompilePassed)(ctx)({
|
|
33
|
+
operations,
|
|
34
|
+
authorizations,
|
|
35
|
+
retry: 4,
|
|
36
|
+
});
|
|
37
|
+
const functions = result.functions;
|
|
38
|
+
// compile controllers
|
|
39
|
+
const compiler = yield ctx.compiler();
|
|
40
|
+
const controllers = yield compiler.realize.controller({
|
|
41
|
+
document: ctx.state().interface.document,
|
|
42
|
+
functions,
|
|
43
|
+
authorizations,
|
|
70
44
|
});
|
|
71
|
-
|
|
45
|
+
const history = {
|
|
72
46
|
type: "realize",
|
|
73
|
-
compiled:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
completed_at:
|
|
78
|
-
created_at:
|
|
47
|
+
compiled: result.compiled,
|
|
48
|
+
authorizations,
|
|
49
|
+
functions,
|
|
50
|
+
controllers,
|
|
51
|
+
completed_at: new Date().toISOString(),
|
|
52
|
+
created_at: start.toISOString(),
|
|
79
53
|
id: (0, uuid_1.v4)(),
|
|
80
54
|
reason: props.reason,
|
|
81
|
-
step: (
|
|
82
|
-
authorizations: (_l = (_k = ctx.state().realize) === null || _k === void 0 ? void 0 : _k.authorizations) !== null && _l !== void 0 ? _l : [],
|
|
55
|
+
step: (_e = (_d = ctx.state().analyze) === null || _d === void 0 ? void 0 : _d.step) !== null && _e !== void 0 ? _e : 0,
|
|
83
56
|
};
|
|
57
|
+
// report
|
|
58
|
+
ctx.dispatch({
|
|
59
|
+
type: "realizeComplete",
|
|
60
|
+
created_at: new Date().toISOString(),
|
|
61
|
+
functions: history.functions,
|
|
62
|
+
authorizations: history.authorizations,
|
|
63
|
+
controllers: history.controllers,
|
|
64
|
+
compiled: yield compiler.typescript.compile({
|
|
65
|
+
files: yield (0, getAutoBeGenerated_1.getAutoBeGenerated)(compiler, Object.assign(Object.assign({}, ctx.state()), { realize: history }), [...ctx.histories(), history], ctx.usage()),
|
|
66
|
+
}),
|
|
67
|
+
step: (_g = (_f = ctx.state().analyze) === null || _f === void 0 ? void 0 : _f.step) !== null && _g !== void 0 ? _g : 0,
|
|
68
|
+
});
|
|
69
|
+
ctx.state().realize = history;
|
|
70
|
+
ctx.histories().push(history);
|
|
71
|
+
return history;
|
|
84
72
|
});
|
|
85
73
|
exports.orchestrateRealize = orchestrateRealize;
|
|
86
74
|
//# sourceMappingURL=orchestrateRealize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateRealize.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealize.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"orchestrateRealize.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealize.ts"],"names":[],"mappings":";;;;;;;;;;;;AASA,+BAA0B;AAI1B,yEAAsE;AACt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