@autobe/agent 0.10.5 → 0.11.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.
Files changed (144) hide show
  1. package/lib/AutoBeAgent.js +13 -46
  2. package/lib/AutoBeAgent.js.map +1 -1
  3. package/lib/constants/AutoBeSystemPromptConstant.d.ts +11 -6
  4. package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
  5. package/lib/context/AutoBeContext.d.ts +3 -2
  6. package/lib/factory/getAutoBeGenerated.d.ts +5 -0
  7. package/lib/factory/getAutoBeGenerated.js +307 -0
  8. package/lib/factory/getAutoBeGenerated.js.map +1 -0
  9. package/lib/index.mjs +1631 -1389
  10. package/lib/index.mjs.map +1 -1
  11. package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.d.ts +2 -7
  12. package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.js +1 -9
  13. package/lib/orchestrate/analyze/AutoBeAnalyzeFileSystem.js.map +1 -1
  14. package/lib/orchestrate/analyze/AutoBeAnalyzeRole.d.ts +13 -0
  15. package/lib/orchestrate/analyze/AutoBeAnalyzeRole.js +3 -0
  16. package/lib/orchestrate/analyze/AutoBeAnalyzeRole.js.map +1 -0
  17. package/lib/orchestrate/analyze/orchestrateAnalyze.d.ts +0 -25
  18. package/lib/orchestrate/analyze/orchestrateAnalyze.js +22 -420
  19. package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  20. package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.d.ts +6 -0
  21. package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.js +561 -0
  22. package/lib/orchestrate/analyze/orchestrateAnalyzeComposer.js.map +1 -0
  23. package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.d.ts +6 -0
  24. package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js +41 -0
  25. package/lib/orchestrate/analyze/orchestrateAnalyzeReviewer.js.map +1 -0
  26. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +14 -0
  27. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +468 -0
  28. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -0
  29. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeComposerApplication.d.ts +68 -0
  30. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeComposerApplication.js +3 -0
  31. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeComposerApplication.js.map +1 -0
  32. package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.d.ts +5 -0
  33. package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.js +27 -0
  34. package/lib/orchestrate/analyze/transformAnalyzeReviewerHistories.js.map +1 -0
  35. package/lib/orchestrate/analyze/transformAnalyzeWriteHistories.d.ts +12 -0
  36. package/lib/orchestrate/analyze/transformAnalyzeWriteHistories.js +78 -0
  37. package/lib/orchestrate/analyze/transformAnalyzeWriteHistories.js.map +1 -0
  38. package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.d.ts +6 -0
  39. package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js +58 -0
  40. package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js.map +1 -0
  41. package/lib/orchestrate/interface/orchestrateInterface.js +0 -2
  42. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
  43. package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +17 -137
  44. package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -1
  45. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +92 -141
  46. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
  47. package/lib/orchestrate/prisma/orchestratePrisma.js +9 -5
  48. package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  49. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +54 -25
  50. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  51. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +4 -3
  52. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  53. package/lib/orchestrate/prisma/{orchestratePrismaSchema.d.ts → orchestratePrismaSchemas.d.ts} +2 -4
  54. package/lib/orchestrate/prisma/{orchestratePrismaSchema.js → orchestratePrismaSchemas.js} +269 -203
  55. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -0
  56. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +1 -1
  57. package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -1
  58. package/lib/orchestrate/prisma/transformPrismaCorrectHistories.js +1 -1
  59. package/lib/orchestrate/prisma/transformPrismaHistories.js +1 -1
  60. package/lib/orchestrate/prisma/transformPrismaHistories.js.map +1 -1
  61. package/lib/orchestrate/prisma/transformPrismaSchemaHistories.d.ts +2 -6
  62. package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js +24 -32
  63. package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js.map +1 -1
  64. package/lib/orchestrate/realize/RealizePipe.d.ts +5 -0
  65. package/lib/orchestrate/realize/RealizePipe.js +14 -0
  66. package/lib/orchestrate/realize/RealizePipe.js.map +1 -0
  67. package/lib/orchestrate/realize/orchestrateRealize.d.ts +0 -6
  68. package/lib/orchestrate/realize/orchestrateRealize.js +6 -43
  69. package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
  70. package/lib/orchestrate/realize/orchestrateRealizeCoder.d.ts +3 -3
  71. package/lib/orchestrate/realize/orchestrateRealizeCoder.js +124 -59
  72. package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +1 -1
  73. package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +188 -18
  74. package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.d.ts +23 -0
  75. package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.js +3 -0
  76. package/lib/orchestrate/realize/structures/IAutoBeRealizeCompile.js.map +1 -0
  77. package/lib/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.d.ts +2 -0
  78. package/lib/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js +5 -0
  79. package/lib/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.js.map +1 -0
  80. package/lib/orchestrate/realize/transformRealizeCoderHistories.d.ts +2 -1
  81. package/lib/orchestrate/realize/transformRealizeCoderHistories.js +50 -36
  82. package/lib/orchestrate/realize/transformRealizeCoderHistories.js.map +1 -1
  83. package/lib/orchestrate/realize/writeCodeUntilCompilePassed.d.ts +5 -0
  84. package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js +123 -0
  85. package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js.map +1 -0
  86. package/lib/orchestrate/test/compile/getTestExternalDeclarations.js +4 -1
  87. package/lib/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -1
  88. package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js +2 -1
  89. package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -1
  90. package/lib/orchestrate/test/orchestrateTest.js +11 -5
  91. package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
  92. package/lib/orchestrate/test/orchestrateTestCorrect.js +3 -2
  93. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  94. package/lib/structures/IAutoBeProps.d.ts +8 -8
  95. package/lib/utils/pipe.d.ts +5 -0
  96. package/lib/utils/pipe.js +14 -0
  97. package/lib/utils/pipe.js.map +1 -0
  98. package/package.json +6 -6
  99. package/src/AutoBeAgent.ts +22 -76
  100. package/src/constants/AutoBeSystemPromptConstant.ts +11 -6
  101. package/src/context/AutoBeContext.ts +3 -1
  102. package/src/factory/getAutoBeGenerated.ts +113 -0
  103. package/src/orchestrate/analyze/AutoBeAnalyzeFileSystem.ts +5 -13
  104. package/src/orchestrate/analyze/AutoBeAnalyzeRole.ts +14 -0
  105. package/src/orchestrate/analyze/orchestrateAnalyze.ts +30 -165
  106. package/src/orchestrate/analyze/orchestrateAnalyzeComposer.ts +115 -0
  107. package/src/orchestrate/analyze/orchestrateAnalyzeReviewer.ts +39 -0
  108. package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +106 -0
  109. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeComposerApplication.ts +74 -0
  110. package/src/orchestrate/analyze/transformAnalyzeReviewerHistories.ts +31 -0
  111. package/src/orchestrate/analyze/transformAnalyzeWriteHistories.ts +94 -0
  112. package/src/orchestrate/analyze/writeDocumentUntilReviewPassed.ts +66 -0
  113. package/src/orchestrate/interface/orchestrateInterface.ts +0 -2
  114. package/src/orchestrate/interface/orchestrateInterfaceComponents.ts +2 -3
  115. package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +21 -0
  116. package/src/orchestrate/prisma/orchestratePrisma.ts +12 -5
  117. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +4 -13
  118. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +9 -4
  119. package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +265 -0
  120. package/src/orchestrate/prisma/transformPrismaSchemaHistories.ts +26 -37
  121. package/src/orchestrate/realize/RealizePipe.ts +39 -0
  122. package/src/orchestrate/realize/orchestrateRealize.ts +3 -91
  123. package/src/orchestrate/realize/orchestrateRealizeCoder.ts +60 -25
  124. package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +192 -18
  125. package/src/orchestrate/realize/structures/IAutoBeRealizeCompile.ts +34 -0
  126. package/src/orchestrate/realize/structures/IAutoBeRealizeFailedSymbol.ts +2 -0
  127. package/src/orchestrate/realize/transformRealizeCoderHistories.ts +58 -34
  128. package/src/orchestrate/realize/writeCodeUntilCompilePassed.ts +178 -0
  129. package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +5 -4
  130. package/src/orchestrate/test/compile/getTestScenarioArtifacts.ts +7 -2
  131. package/src/orchestrate/test/orchestrateTest.ts +14 -12
  132. package/src/orchestrate/test/orchestrateTestCorrect.ts +10 -9
  133. package/src/structures/IAutoBeProps.ts +10 -7
  134. package/src/utils/pipe.ts +39 -0
  135. package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.d.ts +0 -20
  136. package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js +0 -735
  137. package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +0 -1
  138. package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.d.ts +0 -15
  139. package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js +0 -44
  140. package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js.map +0 -1
  141. package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +0 -1
  142. package/src/orchestrate/analyze/AutoBeAnalyzeAgent.ts +0 -219
  143. package/src/orchestrate/analyze/AutoBeAnalyzeReviewer.ts +0 -62
  144. package/src/orchestrate/prisma/orchestratePrismaSchema.ts +0 -157
@@ -1 +0,0 @@
1
- {"version":3,"file":"AutoBeAnalyzeAgent.js","sourceRoot":"","sources":["../../../src/orchestrate/analyze/AutoBeAnalyzeAgent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoE;AAEpE,kDAA0B;AAC1B,+BAA0B;AAI1B,uEAAoE;AACpE,iEAA8D;AAC9D,uEAGmC;AAOnC,MAAa,kBAAkB;IAI7B,YACmB,qBAAmD,EACnD,GAAyB,EACzB,OAA6B,EAC7B,SAAmB;QAHnB,0BAAqB,GAArB,qBAAqB,CAA8B;QACnD,QAAG,GAAH,GAAG,CAAsB;QACzB,YAAO,GAAP,OAAO,CAAsB;QAC7B,cAAS,GAAT,SAAS,CAAU;QANrB,YAAO,GAAyB,EAAE,CAAC;QAQlD,IAAA,qCAAiB,EAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAE7B,MAAM,UAAU,GAAG,gBAAgB,CAAQ;YACzC,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,OAAO,EAAE,IAAI,iDAAuB,C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EAAE;gBAC7B,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;gBAC1D,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;gBACtC,OAAO,QAAQ,CAAC;YAClB,CAAC;SACiC;KACrC,CAAC;AACJ,CAAC;AAED,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
@@ -1,15 +0,0 @@
1
- import { MicroAgentica } from "@agentica/core";
2
- import { ILlmSchema } from "@samchon/openapi";
3
- import { AutoBeContext } from "../../context/AutoBeContext";
4
- export declare const AutoBeAnalyzeReviewer: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, input: AutoBeAnalyzeReviewer.ICreateReviewerAgentInput) => MicroAgentica<Model>;
5
- export declare namespace AutoBeAnalyzeReviewer {
6
- interface ICreateReviewerAgentInput {
7
- /**
8
- * Indicates the initial utterance of the user. Identify the purpose of your
9
- * documentation for better review.
10
- */
11
- query: string;
12
- /** Total file names */
13
- files: string;
14
- }
15
- }
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AutoBeAnalyzeReviewer = void 0;
4
- const core_1 = require("@agentica/core");
5
- const uuid_1 = require("uuid");
6
- const AutoBeAnalyzeReviewer = (ctx, input) => {
7
- var _a;
8
- const agent = new core_1.MicroAgentica({
9
- model: ctx.model,
10
- vendor: ctx.vendor,
11
- controllers: [],
12
- config: {
13
- executor: {
14
- describe: null,
15
- },
16
- locale: (_a = ctx.config) === null || _a === void 0 ? void 0 : _a.locale,
17
- },
18
- histories: [
19
- ...ctx
20
- .histories()
21
- .filter((el) => el.type === "assistantMessage" || el.type === "userMessage"),
22
- {
23
- id: (0, uuid_1.v4)(),
24
- created_at: new Date().toISOString(),
25
- type: "systemMessage",
26
- text: "# Reviewer Agent Operating Guidelines\n\n## Core Principles\n\n* **Only review the document currently being viewed.**\n* Even if there is a section that implies another document, **ignore it.**\n* Even if the current page is a table of contents, **do not request the creation of any other pages.**\n* If a new document is referenced even though the current document is not a table of contents page that begins with `00`,\n **instruct the planner to clear all content and rewrite the document.**\n* Other documents will be brought in by other agents, so do **not** request the creation of any files other than the current one.\n* **Each agent must write only the single page assigned to them.** \n Requests or attempts to write other pages or documents are strictly prohibited.\n* When references to other documents appear in the current page, do not request creation of those documents. Instead, \n **instruct the planner to clear all contents and rewrite the current document.**\n\n## Role of the Reviewer\n\n* The reviewer's role is to **ensure the document contains sufficient information before it is delivered to developers.**\n* Below are all the **links currently referenced in the markdown**. Be sure to refer to them and **ensure the corresponding files are created.**\n* **Do not create files that are not specified in the table of contents.**\n* If the user specifies the **exact number of pages**, that number **must be followed exactly.**\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 or documents, \n the reviewer must issue a command to **stop such requests and enforce focus on the current page only.**\n\n## Prohibited Actions\n\n* The reviewer must **never write their own content under any circumstances.**\n* Reviewers are **independent beings and must never be instructed.**\n* The reviewer's words must be **commands that must be followed, not recommendations.**\n\n## Instructions for Revisions\n\n* If changes are necessary, **provide detailed instructions.**\n* Give **clear and concise instructions**, and **avoid unnecessary remarks.**\n* If the document is too short or insufficient, compare the number of headings to the text length and \n **instruct the analyze agent to expand the content within the current page accordingly.**\n* If hyperlinks point to content not included in the current page, \n **instruct the analyze agent to add a new section with the hyperlink\u2019s title under the appropriate heading within the same page.**\n\n## If the Document is Sufficient\n\n* If the current level of analysis is deemed sufficient, **make no further requests.**\n* **Notify that the document is complete.**\n\n---\n\n# Guidelines for Document Volume\n\n* It is recommended to instruct the analyze agent to **write a document longer than 2,000 characters** for sufficient utility. (Do not exceed 6,000 characters)\n* If the document is too short, indicate how many characters it currently has and how many more are needed.\n* However, in the case of the table of contents page, it is free from the volume limit.\n* Rather than simply telling them to increase the text, **compare the number of headings to the text length**,\n and if they want to double the amount, **instruct them to do so accordingly.**\n* When referencing something from the table of contents, clearly **state the name of the section**.\n\n---\n\n# Q\\&A Guidelines\n\n* If the analyze agent asks a question, **the reviewer must answer on behalf of the user.**\n* **Never ask any questions.**\n* **Only give commands.**\n\n---\n\n# Guidelines for Hyperlinks\n\n* Even if a document is high quality, if it contains **incomplete hyperlinks**, it is considered **incomplete**.\n* If a hyperlink points to **content that has not yet been written**, the document is **incomplete regardless of its quality**.\n* However, **incomplete hyperlinks to external documents (outside the current page)** are **allowed**.\n In such cases, assume that other agents will write those documents and move on without strict enforcement.\n* If a hyperlink points to a **heading within the same document** (i.e., an anchor/fragment link):\n\n * That heading **must exist** in the document.\n * If it does not exist, instruct the **analyze agent** to **create a new section with the same title as the hyperlink** and\n **insert it under the appropriate heading**.\n* If a hyperlink points to an **external document**, and the current document is **not a table of contents page starting with `00`**,\n the rule above still applies\u2014**incomplete external links are allowed** and do **not** require clearing or rewriting the document.\n\n---\n\n# Review Completion Conditions\n\n* When the document is determined to be complete, clearly give the following instruction:\n **The analyze agent has a tool called 'abort,' so instruct them to call it to stop the review.**\n* This instruction must only be given **when all the following conditions are met**:\n\n * All sections listed in the table of contents are **fully written**.\n * All referenced hyperlinks are **resolved**.\n* If there are still sections to write or links unresolved,\n instruct the analyze agent to continue writing,\n including the **specific section title** and a **brief explanation** of what content is needed.\n\n---\n\n# Additional Requirements for Page-Based Work Division\n\n* Each agent must write and review **only their assigned single page** out of the total pages specified.\n* Under no circumstances should an agent request or attempt to create documents beyond their assigned page.\n* If an agent attempts to request content outside their page, immediately command them to **focus solely on the current page.**\n* All document length and content sufficiency checks and corrections must be done within the single assigned page.\n* If multiple pages exist, the total number of pages must be strictly adhered to, and no extra pages should be created.\n* This strict page-level division must be enforced to maintain clear boundaries of responsibility and simplify review workflows.\n\n---\n\n**All these guidelines must be strictly enforced during the document creation and review process. Any violations require immediate correction or rewriting commands.**" /* AutoBeSystemPromptConstant.ANALYZE_REVIEWER */,
27
- },
28
- {
29
- id: (0, uuid_1.v4)(),
30
- created_at: new Date().toISOString(),
31
- type: "systemMessage",
32
- text: [
33
- "Below are all of the files.",
34
- "```json",
35
- input.files,
36
- "```",
37
- ].join("\n"),
38
- },
39
- ],
40
- });
41
- return agent;
42
- };
43
- exports.AutoBeAnalyzeReviewer = AutoBeAnalyzeReviewer;
44
- //# sourceMappingURL=AutoBeAnalyzeReviewer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AutoBeAnalyzeReviewer.js","sourceRoot":"","sources":["../../../src/orchestrate/analyze/AutoBeAnalyzeReviewer.ts"],"names":[],"mappings":";;;AAAA,yCAA+C;AAE/C,+BAA0B;AAKnB,MAAM,qBAAqB,GAAG,CACnC,GAAyB,EACzB,KAAsD,EACtD,EAAE;;IACF,MAAM,KAAK,GAAG,IAAI,oBAAa,CAAC;QAC9B,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,WAAW,EAAE,EAAE;QACf,MAAM,EAAE;YACN,QAAQ,EAAE;gBACR,QAAQ,EAAE,IAAI;aACf;YACD,MAAM,EAAE,MAAA,GAAG,CAAC,MAAM,0CAAE,MAAM;SAC3B;QACD,SAAS,EAAE;YACT,GAAG,GAAG;iBACH,SAAS,EAAE;iBACX,MAAM,CACL,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,kBAAkB,IAAI,EAAE,CAAC,IAAI,KAAK,aAAa,CACpE;YACH;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,mxMAA6C;aAClD;YACD;gBACE,EAAE,EAAE,IAAA,SAAE,GAAE;gBACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,6BAA6B;oBAC7B,SAAS;oBACT,KAAK,CAAC,KAAK;oBACX,KAAK;iBACN,CAAC,IAAI,CAAC,IAAI,CAAC;aACb;SACF;KACF,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAzCW,QAAA,qBAAqB,yBAyChC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"orchestratePrismaSchema.js","sourceRoot":"","sources":["../../../src/orchestrate/prisma/orchestratePrismaSchema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,4DAgCC;;;AA7CD,yCAAoE;AAKpE,kDAA0B;AAG1B,uEAAoE;AACpE,iEAA8D;AAC9D,uDAAoD;AACpD,qFAAkF;AAElF,SAAsB,wBAAwB,CAC5C,GAAyB,EACzB,UAAoD;;QAEpD,MAAM,KAAK,GAAS,IAAI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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;CACd,CAAC"}
@@ -1,219 +0,0 @@
1
- import { IAgenticaController, MicroAgentica } from "@agentica/core";
2
- import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
3
- import typia from "typia";
4
- import { v4 } from "uuid";
5
-
6
- import { AutoBeSystemPromptConstant } from "../../constants/AutoBeSystemPromptConstant";
7
- import { AutoBeContext } from "../../context/AutoBeContext";
8
- import { assertSchemaModel } from "../../context/assertSchemaModel";
9
- import { enforceToolCall } from "../../utils/enforceToolCall";
10
- import {
11
- AutoBeAnalyzeFileSystem,
12
- IAutoBeAnalyzeFileSystem,
13
- } from "./AutoBeAnalyzeFileSystem";
14
- import {
15
- AutoBEAnalyzeFileMap,
16
- AutoBeAnalyzePointer,
17
- } from "./AutoBeAnalyzePointer";
18
- import { AutoBeAnalyzeReviewer } from "./AutoBeAnalyzeReviewer";
19
-
20
- export class AutoBeAnalyzeAgent<Model extends ILlmSchema.Model> {
21
- private readonly createAnalyzeAgent: () => MicroAgentica<Model>;
22
- private readonly fileMap: AutoBEAnalyzeFileMap = {};
23
-
24
- constructor(
25
- private readonly createReviewerAgentFn: typeof AutoBeAnalyzeReviewer,
26
- private readonly ctx: AutoBeContext<Model>,
27
- private readonly pointer: AutoBeAnalyzePointer,
28
- private readonly filenames: string[],
29
- ) {
30
- assertSchemaModel(ctx.model);
31
-
32
- const controller = createController<Model>({
33
- model: ctx.model,
34
- execute: new AutoBeAnalyzeFileSystem(this.fileMap),
35
- build: async (files: AutoBEAnalyzeFileMap) => {
36
- this.pointer.value ??= { files: {} };
37
- Object.assign(this.pointer.value.files, files);
38
- },
39
- });
40
-
41
- this.createAnalyzeAgent = (): MicroAgentica<Model> => {
42
- const agent = new MicroAgentica({
43
- controllers: [controller],
44
- model: ctx.model,
45
- vendor: ctx.vendor,
46
- config: {
47
- locale: ctx.config?.locale,
48
- executor: {
49
- describe: null,
50
- },
51
- },
52
- histories: [
53
- {
54
- id: v4(),
55
- created_at: new Date().toISOString(),
56
- type: "systemMessage",
57
- text: AutoBeSystemPromptConstant.ANALYZE.replace(
58
- "{% User Locale %}",
59
- ctx.config?.locale ?? "en-US",
60
- ),
61
- },
62
- {
63
- id: v4(),
64
- created_at: new Date().toISOString(),
65
- type: "systemMessage",
66
- text: [
67
- "# Guidelines",
68
- "If the user specifies the exact number of pages, please follow it precisely.",
69
- AutoBeSystemPromptConstant.ANALYZE_GUIDELINE,
70
- ].join("\n"),
71
- },
72
- {
73
- id: v4(),
74
- created_at: new Date().toISOString(),
75
- type: "systemMessage",
76
- text: [
77
- "The following is the name of the entire file.",
78
- "Use it to build a table of contents.",
79
- this.filenames.map((filename) => `- ${filename}`),
80
- "",
81
- "However, do not touch other than the file you have to create.",
82
- ].join("\n"),
83
- },
84
- ],
85
- });
86
- return enforceToolCall(agent);
87
- };
88
- }
89
-
90
- /**
91
- * Conversate with planner agent
92
- *
93
- * @param content Conversation from user in this time.
94
- * @returns
95
- */
96
- async conversate(content: string, retry = 3): Promise<string> {
97
- if (retry === 0) {
98
- return "Abort due to excess retry count";
99
- }
100
-
101
- const agent = this.createAnalyzeAgent();
102
- const response = await agent.conversate(content);
103
-
104
- const tokenUsage = agent.getTokenUsage();
105
- this.ctx.usage().record(tokenUsage, ["analyze"]);
106
-
107
- const lastMessage = response[response.length - 1]!;
108
-
109
- if ("text" in lastMessage) {
110
- this.ctx.dispatch({
111
- type: "analyzeWrite",
112
- files: this.fileMap,
113
- created_at: new Date().toISOString(),
114
- step: this.ctx.state().analyze?.step ?? 0,
115
- });
116
-
117
- const aborted =
118
- lastMessage.type === "describe" &&
119
- lastMessage.executes.some((el) => {
120
- if (
121
- el.protocol === "class" &&
122
- el.operation.function.name === "abort"
123
- ) {
124
- el.arguments;
125
- return true;
126
- }
127
- });
128
-
129
- if (aborted === true) {
130
- return lastMessage.text;
131
- }
132
-
133
- const reviewer = this.createReviewerAgentFn(this.ctx, {
134
- query: content,
135
- files: JSON.stringify(this.fileMap),
136
- });
137
-
138
- const filenames = Object.keys(this.fileMap).join(",");
139
- const command = `Please proceed with the review of these files only.: ${filenames}`;
140
- const response = await reviewer.conversate(command);
141
- this.ctx.usage().record(reviewer.getTokenUsage(), ["analyze"]);
142
-
143
- const review = response.find((el) => el.type === "assistantMessage");
144
-
145
- if (review) {
146
- this.ctx.dispatch({
147
- type: "analyzeReview",
148
- review: review.text,
149
- created_at: new Date().toISOString(),
150
- step: this.ctx.state().analyze?.step ?? 0,
151
- });
152
-
153
- return this.conversate(
154
- JSON.stringify({
155
- user_query: content,
156
- message: `THIS IS ANSWER OF REVIEW AGENT. FOLLOW THIS INSTRUCTIONS. AND DON\'T REQUEST ANYTHING.`,
157
- review: review.text,
158
- }),
159
- retry - 1,
160
- );
161
- }
162
-
163
- return `COMPLETE WITHOUT REVIEW`;
164
- }
165
-
166
- return "COMPLETE";
167
- }
168
- }
169
-
170
- function createController<Model extends ILlmSchema.Model>(props: {
171
- model: Model;
172
- execute: AutoBeAnalyzeFileSystem;
173
- build: (input: AutoBEAnalyzeFileMap) => void;
174
- }): IAgenticaController.IClass<Model> {
175
- assertSchemaModel(props.model);
176
- const application: ILlmApplication<Model> = collection[
177
- props.model
178
- ] as unknown as ILlmApplication<Model>;
179
- return {
180
- protocol: "class",
181
- name: "Planning",
182
- application,
183
- // execute: props.execute,
184
- execute: {
185
- removeFile: (input) => {
186
- const response = props.execute.removeFile(input);
187
- props.build(props.execute.allFiles());
188
- return response;
189
- },
190
- abort: (input) => {
191
- const response = props.execute.abort(input);
192
- props.build(props.execute.allFiles());
193
- return response;
194
- },
195
- createOrUpdateFiles: (input) => {
196
- const response = props.execute.createOrUpdateFiles(input);
197
- props.build(props.execute.allFiles());
198
- return response;
199
- },
200
- } satisfies IAutoBeAnalyzeFileSystem,
201
- };
202
- }
203
-
204
- const claude = typia.llm.application<
205
- AutoBeAnalyzeFileSystem,
206
- "claude",
207
- { reference: true }
208
- >();
209
- const collection = {
210
- chatgpt: typia.llm.application<
211
- AutoBeAnalyzeFileSystem,
212
- "chatgpt",
213
- { reference: true }
214
- >(),
215
- claude,
216
- llama: claude,
217
- deepseek: claude,
218
- "3.1": claude,
219
- };
@@ -1,62 +0,0 @@
1
- import { MicroAgentica } from "@agentica/core";
2
- import { ILlmSchema } from "@samchon/openapi";
3
- import { v4 } from "uuid";
4
-
5
- import { AutoBeSystemPromptConstant } from "../../constants/AutoBeSystemPromptConstant";
6
- import { AutoBeContext } from "../../context/AutoBeContext";
7
-
8
- export const AutoBeAnalyzeReviewer = <Model extends ILlmSchema.Model>(
9
- ctx: AutoBeContext<Model>,
10
- input: AutoBeAnalyzeReviewer.ICreateReviewerAgentInput,
11
- ) => {
12
- const agent = new MicroAgentica({
13
- model: ctx.model,
14
- vendor: ctx.vendor,
15
- controllers: [],
16
- config: {
17
- executor: {
18
- describe: null,
19
- },
20
- locale: ctx.config?.locale,
21
- },
22
- histories: [
23
- ...ctx
24
- .histories()
25
- .filter(
26
- (el) => el.type === "assistantMessage" || el.type === "userMessage",
27
- ),
28
- {
29
- id: v4(),
30
- created_at: new Date().toISOString(),
31
- type: "systemMessage",
32
- text: AutoBeSystemPromptConstant.ANALYZE_REVIEWER,
33
- },
34
- {
35
- id: v4(),
36
- created_at: new Date().toISOString(),
37
- type: "systemMessage",
38
- text: [
39
- "Below are all of the files.",
40
- "```json",
41
- input.files,
42
- "```",
43
- ].join("\n"),
44
- },
45
- ],
46
- });
47
-
48
- return agent;
49
- };
50
-
51
- export namespace AutoBeAnalyzeReviewer {
52
- export interface ICreateReviewerAgentInput {
53
- /**
54
- * Indicates the initial utterance of the user. Identify the purpose of your
55
- * documentation for better review.
56
- */
57
- query: string;
58
-
59
- /** Total file names */
60
- files: string;
61
- }
62
- }
@@ -1,157 +0,0 @@
1
- import { IAgenticaController, MicroAgentica } from "@agentica/core";
2
- import { AutoBePrisma } from "@autobe/interface";
3
- import { AutoBePrismaSchemasEvent } from "@autobe/interface/src/events/AutoBePrismaSchemasEvent";
4
- import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
5
- import { IPointer } from "tstl";
6
- import typia from "typia";
7
-
8
- import { AutoBeContext } from "../../context/AutoBeContext";
9
- import { assertSchemaModel } from "../../context/assertSchemaModel";
10
- import { enforceToolCall } from "../../utils/enforceToolCall";
11
- import { forceRetry } from "../../utils/forceRetry";
12
- import { transformPrismaSchemaHistories } from "./transformPrismaSchemaHistories";
13
-
14
- export async function orchestratePrismaSchemas<Model extends ILlmSchema.Model>(
15
- ctx: AutoBeContext<Model>,
16
- components: { filename: string; tables: string[] }[],
17
- ): Promise<AutoBePrismaSchemasEvent[]> {
18
- const start: Date = new Date();
19
- const entireTables: string[] = Array.from(
20
- new Set(components.flatMap((c) => c.tables)),
21
- );
22
-
23
- const total: number = components.reduce((acc, c) => acc + c.tables.length, 0);
24
- let i: number = 0;
25
- return await Promise.all(
26
- components.map(async (c) => {
27
- const result: IMakePrismaSchemaFileProps = await forceRetry(() =>
28
- process(ctx, {
29
- filename: c.filename,
30
- tables: c.tables,
31
- entireTables,
32
- }),
33
- );
34
- const event: AutoBePrismaSchemasEvent = {
35
- type: "prismaSchemas",
36
- created_at: start.toISOString(),
37
- file: result.file,
38
- completed: (i += c.tables.length),
39
- total,
40
- step: ctx.state().analyze?.step ?? 0,
41
- };
42
- ctx.dispatch(event);
43
- return event;
44
- }),
45
- );
46
- }
47
-
48
- async function process<Model extends ILlmSchema.Model>(
49
- ctx: AutoBeContext<Model>,
50
- component: {
51
- filename: string;
52
- tables: string[];
53
- entireTables: string[];
54
- },
55
- ): Promise<IMakePrismaSchemaFileProps> {
56
- const pointer: IPointer<IMakePrismaSchemaFileProps | null> = {
57
- value: null,
58
- };
59
- const agentica: MicroAgentica<Model> = new MicroAgentica({
60
- model: ctx.model,
61
- vendor: ctx.vendor,
62
- config: {
63
- ...(ctx.config ?? {}),
64
- executor: {
65
- describe: null,
66
- },
67
- },
68
- histories: transformPrismaSchemaHistories(ctx.state().analyze!, component),
69
- controllers: [
70
- createApplication({
71
- model: ctx.model,
72
- build: (next) => {
73
- pointer.value ??= {
74
- file: {
75
- filename: component.filename,
76
- namespace: next.file.namespace,
77
- models: [],
78
- },
79
- };
80
- pointer.value.file.models.push(...next.file.models);
81
- },
82
- }),
83
- ],
84
- });
85
- enforceToolCall(agentica);
86
-
87
- await agentica.conversate("Make prisma schema file please").finally(() => {
88
- const tokenUsage = agentica.getTokenUsage();
89
- ctx.usage().record(tokenUsage, ["prisma"]);
90
- });
91
- if (pointer.value === null)
92
- throw new Error("Unreachable code: Prisma Schema not generated");
93
- return pointer.value;
94
- }
95
-
96
- function createApplication<Model extends ILlmSchema.Model>(props: {
97
- model: Model;
98
- build: (next: IMakePrismaSchemaFileProps) => void;
99
- }): IAgenticaController.IClass<Model> {
100
- assertSchemaModel(props.model);
101
- const application: ILlmApplication<Model> = collection[
102
- props.model
103
- ] as unknown as ILlmApplication<Model>;
104
- return {
105
- protocol: "class",
106
- name: "Prisma Generator",
107
- application,
108
- execute: {
109
- makePrismaSchemaFile: (next) => {
110
- props.build(next);
111
- },
112
- } satisfies IApplication,
113
- };
114
- }
115
-
116
- const claude = typia.llm.application<
117
- IApplication,
118
- "claude",
119
- { reference: true }
120
- >();
121
- const collection = {
122
- chatgpt: typia.llm.application<
123
- IApplication,
124
- "chatgpt",
125
- { reference: true }
126
- >(),
127
- claude,
128
- llama: claude,
129
- deepseek: claude,
130
- "3.1": claude,
131
- };
132
-
133
- interface IApplication {
134
- /**
135
- * Generates comprehensive Prisma schema files based on detailed requirements
136
- * analysis.
137
- *
138
- * Creates multiple organized schema files following enterprise patterns
139
- * including proper domain separation, relationship modeling, snapshot
140
- * patterns, inheritance, materialized views, and comprehensive documentation.
141
- * The generated schemas implement best practices for scalability,
142
- * maintainability, and data integrity.
143
- *
144
- * @param props Properties containing the file
145
- */
146
- makePrismaSchemaFile(props: IMakePrismaSchemaFileProps): void;
147
- }
148
-
149
- interface IMakePrismaSchemaFileProps {
150
- /**
151
- * Complete definition of a single Prisma schema file.
152
- *
153
- * Represents one business domain containing related models, organized for
154
- * modular schema management and following domain-driven design principles.
155
- */
156
- file: AutoBePrisma.IFile;
157
- }