@autobe/rpc 0.3.6 → 0.3.9

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 (136) hide show
  1. package/lib/{rpc/src/AutoBeRpcService.d.ts → AutoBeRpcService.d.ts} +1 -1
  2. package/lib/AutoBeRpcService.js.map +1 -0
  3. package/lib/index.js.map +1 -0
  4. package/package.json +3 -3
  5. package/src/AutoBeRpcService.ts +1 -2
  6. package/lib/agent/src/AutoBeAgent.d.ts +0 -31
  7. package/lib/agent/src/AutoBeAgent.js +0 -180
  8. package/lib/agent/src/AutoBeAgent.js.map +0 -1
  9. package/lib/agent/src/analyze/AnalyzeAgent.d.ts +0 -24
  10. package/lib/agent/src/analyze/AnalyzeAgent.js +0 -143
  11. package/lib/agent/src/analyze/AnalyzeAgent.js.map +0 -1
  12. package/lib/agent/src/analyze/CreateReviewerAgent.d.ts +0 -16
  13. package/lib/agent/src/analyze/CreateReviewerAgent.js +0 -97
  14. package/lib/agent/src/analyze/CreateReviewerAgent.js.map +0 -1
  15. package/lib/agent/src/analyze/Planning.d.ts +0 -63
  16. package/lib/agent/src/analyze/Planning.js +0 -39
  17. package/lib/agent/src/analyze/Planning.js.map +0 -1
  18. package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +0 -14
  19. package/lib/agent/src/constants/AutoBeSystemPromptConstant.js +0 -4
  20. package/lib/agent/src/constants/AutoBeSystemPromptConstant.js.map +0 -1
  21. package/lib/agent/src/context/AutoBeContext.d.ts +0 -17
  22. package/lib/agent/src/context/AutoBeContext.js +0 -3
  23. package/lib/agent/src/context/AutoBeContext.js.map +0 -1
  24. package/lib/agent/src/context/AutoBeState.d.ts +0 -8
  25. package/lib/agent/src/context/AutoBeState.js +0 -3
  26. package/lib/agent/src/context/AutoBeState.js.map +0 -1
  27. package/lib/agent/src/context/AutoBeTokenUsage.d.ts +0 -2
  28. package/lib/agent/src/context/AutoBeTokenUsage.js +0 -6
  29. package/lib/agent/src/context/AutoBeTokenUsage.js.map +0 -1
  30. package/lib/agent/src/context/IAutoBeApplication.d.ts +0 -107
  31. package/lib/agent/src/context/IAutoBeApplication.js +0 -3
  32. package/lib/agent/src/context/IAutoBeApplication.js.map +0 -1
  33. package/lib/agent/src/context/IAutoBeApplicationProps.d.ts +0 -26
  34. package/lib/agent/src/context/IAutoBeApplicationProps.js +0 -3
  35. package/lib/agent/src/context/IAutoBeApplicationProps.js.map +0 -1
  36. package/lib/agent/src/context/IAutoBeApplicationResult.d.ts +0 -3
  37. package/lib/agent/src/context/IAutoBeApplicationResult.js +0 -3
  38. package/lib/agent/src/context/IAutoBeApplicationResult.js.map +0 -1
  39. package/lib/agent/src/context/assertSchemaModel.d.ts +0 -2
  40. package/lib/agent/src/context/assertSchemaModel.js +0 -15
  41. package/lib/agent/src/context/assertSchemaModel.js.map +0 -1
  42. package/lib/agent/src/factory/createAgenticaHistory.d.ts +0 -7
  43. package/lib/agent/src/factory/createAgenticaHistory.js +0 -26
  44. package/lib/agent/src/factory/createAgenticaHistory.js.map +0 -1
  45. package/lib/agent/src/factory/createAutoBeApplication.d.ts +0 -7
  46. package/lib/agent/src/factory/createAutoBeApplication.js +0 -40
  47. package/lib/agent/src/factory/createAutoBeApplication.js.map +0 -1
  48. package/lib/agent/src/factory/createAutoBeState.d.ts +0 -3
  49. package/lib/agent/src/factory/createAutoBeState.js +0 -16
  50. package/lib/agent/src/factory/createAutoBeState.js.map +0 -1
  51. package/lib/agent/src/factory/index.d.ts +0 -2
  52. package/lib/agent/src/factory/index.js +0 -19
  53. package/lib/agent/src/factory/index.js.map +0 -1
  54. package/lib/agent/src/factory/invertOpenApiDocument.d.ts +0 -3
  55. package/lib/agent/src/factory/invertOpenApiDocument.js +0 -51
  56. package/lib/agent/src/factory/invertOpenApiDocument.js.map +0 -1
  57. package/lib/agent/src/index.d.ts +0 -9
  58. package/lib/agent/src/index.js +0 -49
  59. package/lib/agent/src/index.js.map +0 -1
  60. package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.d.ts +0 -2
  61. package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js +0 -46
  62. package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js.map +0 -1
  63. package/lib/agent/src/orchestrate/index.d.ts +0 -5
  64. package/lib/agent/src/orchestrate/index.js +0 -14
  65. package/lib/agent/src/orchestrate/index.js.map +0 -1
  66. package/lib/agent/src/orchestrate/interface/OpenApiEndpointComparator.d.ts +0 -5
  67. package/lib/agent/src/orchestrate/interface/OpenApiEndpointComparator.js +0 -16
  68. package/lib/agent/src/orchestrate/interface/OpenApiEndpointComparator.js.map +0 -1
  69. package/lib/agent/src/orchestrate/interface/orchestrateInterface.d.ts +0 -5
  70. package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +0 -61
  71. package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +0 -1
  72. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComponents.d.ts +0 -4
  73. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComponents.js +0 -208
  74. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComponents.js.map +0 -1
  75. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.d.ts +0 -4
  76. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +0 -86
  77. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +0 -1
  78. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.d.ts +0 -4
  79. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +0 -154
  80. package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +0 -1
  81. package/lib/agent/src/orchestrate/interface/transformInterfaceHistories.d.ts +0 -3
  82. package/lib/agent/src/orchestrate/interface/transformInterfaceHistories.js +0 -94
  83. package/lib/agent/src/orchestrate/interface/transformInterfaceHistories.js.map +0 -1
  84. package/lib/agent/src/orchestrate/orchestrateAnalyze.d.ts +0 -6
  85. package/lib/agent/src/orchestrate/orchestrateAnalyze.js +0 -76
  86. package/lib/agent/src/orchestrate/orchestrateAnalyze.js.map +0 -1
  87. package/lib/agent/src/orchestrate/orchestrateRealize.d.ts +0 -5
  88. package/lib/agent/src/orchestrate/orchestrateRealize.js +0 -19
  89. package/lib/agent/src/orchestrate/orchestrateRealize.js.map +0 -1
  90. package/lib/agent/src/orchestrate/orchestrateTest.d.ts +0 -5
  91. package/lib/agent/src/orchestrate/orchestrateTest.js +0 -19
  92. package/lib/agent/src/orchestrate/orchestrateTest.js.map +0 -1
  93. package/lib/agent/src/orchestrate/prisma/orchestratePrisma.d.ts +0 -5
  94. package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js +0 -103
  95. package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js.map +0 -1
  96. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCompiler.d.ts +0 -6
  97. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCompiler.js +0 -127
  98. package/lib/agent/src/orchestrate/prisma/orchestratePrismaCompiler.js.map +0 -1
  99. package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.d.ts +0 -5
  100. package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js +0 -80
  101. package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +0 -1
  102. package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchema.d.ts +0 -7
  103. package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchema.js +0 -124
  104. package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchema.js.map +0 -1
  105. package/lib/agent/src/orchestrate/prisma/transformPrismaCompilerHistories.d.ts +0 -3
  106. package/lib/agent/src/orchestrate/prisma/transformPrismaCompilerHistories.js +0 -44
  107. package/lib/agent/src/orchestrate/prisma/transformPrismaCompilerHistories.js.map +0 -1
  108. package/lib/agent/src/orchestrate/prisma/transformPrismaComponentsHistories.d.ts +0 -3
  109. package/lib/agent/src/orchestrate/prisma/transformPrismaComponentsHistories.js +0 -42
  110. package/lib/agent/src/orchestrate/prisma/transformPrismaComponentsHistories.js.map +0 -1
  111. package/lib/agent/src/orchestrate/prisma/transformPrismaSchemaHistories.d.ts +0 -3
  112. package/lib/agent/src/orchestrate/prisma/transformPrismaSchemaHistories.js +0 -46
  113. package/lib/agent/src/orchestrate/prisma/transformPrismaSchemaHistories.js.map +0 -1
  114. package/lib/agent/src/structures/IAutoBeConfig.d.ts +0 -24
  115. package/lib/agent/src/structures/IAutoBeConfig.js +0 -3
  116. package/lib/agent/src/structures/IAutoBeConfig.js.map +0 -1
  117. package/lib/agent/src/structures/IAutoBeProps.d.ts +0 -11
  118. package/lib/agent/src/structures/IAutoBeProps.js +0 -3
  119. package/lib/agent/src/structures/IAutoBeProps.js.map +0 -1
  120. package/lib/agent/src/structures/IAutoBeVendor.d.ts +0 -2
  121. package/lib/agent/src/structures/IAutoBeVendor.js +0 -3
  122. package/lib/agent/src/structures/IAutoBeVendor.js.map +0 -1
  123. package/lib/agent/src/utils/StringUtil.d.ts +0 -4
  124. package/lib/agent/src/utils/StringUtil.js +0 -43
  125. package/lib/agent/src/utils/StringUtil.js.map +0 -1
  126. package/lib/agent/src/utils/divideArray.d.ts +0 -4
  127. package/lib/agent/src/utils/divideArray.js +0 -19
  128. package/lib/agent/src/utils/divideArray.js.map +0 -1
  129. package/lib/agent/src/utils/emplaceMap.d.ts +0 -1
  130. package/lib/agent/src/utils/emplaceMap.js +0 -13
  131. package/lib/agent/src/utils/emplaceMap.js.map +0 -1
  132. package/lib/rpc/src/AutoBeRpcService.js.map +0 -1
  133. package/lib/rpc/src/index.js.map +0 -1
  134. /package/lib/{rpc/src/AutoBeRpcService.js → AutoBeRpcService.js} +0 -0
  135. /package/lib/{rpc/src/index.d.ts → index.d.ts} +0 -0
  136. /package/lib/{rpc/src/index.js → index.js} +0 -0
@@ -1,6 +1,6 @@
1
+ import { AutoBeAgent } from "@autobe/agent";
1
2
  import { AutoBeHistory, AutoBeUserMessageContent, IAutoBeRpcListener, IAutoBeRpcService, IAutoBeTokenUsageJson } from "@autobe/interface";
2
3
  import { ILlmSchema } from "@samchon/openapi";
3
- import { AutoBeAgent } from "../../agent/src";
4
4
  export declare class AutoBeRpcService<Model extends ILlmSchema.Model> implements IAutoBeRpcService {
5
5
  private readonly props;
6
6
  constructor(props: AgenticaRpcService.IProps<Model>);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoBeRpcService.js","sourceRoot":"","sources":["../src/AutoBeRpcService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAUA,MAAa,gBAAgB;IAG3B,YAAoC,KAAuC;QAAvC,UAAK,GAAL,KAAK,CAAkC;QACzE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAEvC,WAAW;QACX,KAAK,CAAC,EAAE,CAAC,kBAAkB,EAAE,CAAC,KAAK,EAAE,EAAE;YACrC,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;YAChC,QAAQ,CAAC,WAAY,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QAEH,UAAU;QACV,KAAK,CAAC,EAAE,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE;YACjC,QAAQ,CAAC,YAAa,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,sBAAsB,EAAE,CAAC,KAAK,EAAE,EAAE;YACzC,QAAQ,CAAC,oBAAqB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAA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AC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE;YACpC,QAAQ,CAAC,eAAgB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,UAAU,CACf,OAAuE;QAEvE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAEY,YAAY;;YACvB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;QACzC,CAAC;KAAA;IAEY,aAAa;;YACxB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,CAAC;QACnD,CAAC;KAAA;CACF;AAtFD,4CAsFC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobe/rpc",
3
- "version": "0.3.6",
3
+ "version": "0.3.9",
4
4
  "description": "AI backend server code generator",
5
5
  "main": "lib/index.js",
6
6
  "keywords": [],
@@ -25,8 +25,8 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@samchon/openapi": "^4.3.3",
28
- "@autobe/agent": "^0.3.6",
29
- "@autobe/interface": "^0.3.6"
28
+ "@autobe/agent": "^0.3.9",
29
+ "@autobe/interface": "^0.3.9"
30
30
  },
31
31
  "devDependencies": {
32
32
  "rimraf": "^6.0.1",
@@ -1,3 +1,4 @@
1
+ import { AutoBeAgent } from "@autobe/agent";
1
2
  import {
2
3
  AutoBeHistory,
3
4
  AutoBeUserMessageContent,
@@ -7,8 +8,6 @@ import {
7
8
  } from "@autobe/interface";
8
9
  import { ILlmSchema } from "@samchon/openapi";
9
10
 
10
- import { AutoBeAgent } from "../../agent/src";
11
-
12
11
  export class AutoBeRpcService<Model extends ILlmSchema.Model>
13
12
  implements IAutoBeRpcService
14
13
  {
@@ -1,31 +0,0 @@
1
- import { AutoBeEvent, AutoBeHistory, AutoBeUserMessageContent } from "@autobe/interface";
2
- import { ILlmSchema } from "@samchon/openapi";
3
- import { AutoBeContext } from "./context/AutoBeContext";
4
- import { AutoBeTokenUsage } from "./context/AutoBeTokenUsage";
5
- import { IAutoBeProps } from "./structures/IAutoBeProps";
6
- export declare class AutoBeAgent<Model extends ILlmSchema.Model> {
7
- private readonly props;
8
- private readonly agentica_;
9
- private readonly histories_;
10
- private readonly context_;
11
- private readonly state_;
12
- private readonly listeners_;
13
- /**
14
- * Initializer constructor.
15
- *
16
- * @param props Properties to construct the agent
17
- */
18
- constructor(props: IAutoBeProps<Model>);
19
- /** @internal */
20
- clone(): AutoBeAgent<Model>;
21
- on<Type extends AutoBeEvent.Type>(type: Type, listener: (event: AutoBeEvent.Mapper[Type]) => Promise<void> | void): this;
22
- off<Type extends AutoBeEvent.Type>(type: Type, listener: (event: AutoBeEvent.Mapper[Type]) => Promise<void> | void): this;
23
- conversate(content: string | AutoBeUserMessageContent | AutoBeUserMessageContent[]): Promise<AutoBeHistory[]>;
24
- getFiles(): Record<string, string>;
25
- getHistories(): AutoBeHistory[];
26
- getTokenUsage(): AutoBeTokenUsage;
27
- /** @internal */
28
- getContext(): AutoBeContext<Model>;
29
- /** @internal */
30
- private dispatch;
31
- }
@@ -1,180 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AutoBeAgent = void 0;
13
- const core_1 = require("@agentica/core");
14
- const uuid_1 = require("uuid");
15
- const createAgenticaHistory_1 = require("./factory/createAgenticaHistory");
16
- const createAutoBeApplication_1 = require("./factory/createAutoBeApplication");
17
- const createAutoBeState_1 = require("./factory/createAutoBeState");
18
- const transformFacadeStateMessage_1 = require("./orchestrate/facade/transformFacadeStateMessage");
19
- const emplaceMap_1 = require("./utils/emplaceMap");
20
- class AutoBeAgent {
21
- /* -----------------------------------------------------------
22
- CONSTRUCTOR
23
- ----------------------------------------------------------- */
24
- /**
25
- * Initializer constructor.
26
- *
27
- * @param props Properties to construct the agent
28
- */
29
- constructor(props) {
30
- var _a, _b, _c;
31
- this.props = props;
32
- this.histories_ = (_b = (_a = props.histories) === null || _a === void 0 ? void 0 : _a.slice()) !== null && _b !== void 0 ? _b : [];
33
- this.state_ = (0, createAutoBeState_1.createAutoBeState)(this.histories_);
34
- this.context_ = {
35
- model: props.model,
36
- vendor: props.vendor,
37
- config: props.config,
38
- compiler: props.compiler,
39
- histories: () => this.histories_,
40
- state: () => this.state_,
41
- usage: () => this.agentica_.getTokenUsage(),
42
- files: () => this.getFiles(),
43
- dispatch: (event) => {
44
- this.dispatch(event).catch(() => { });
45
- },
46
- };
47
- this.listeners_ = new Map();
48
- this.agentica_ = new core_1.MicroAgentica({
49
- model: props.model,
50
- vendor: props.vendor,
51
- config: Object.assign(Object.assign({}, ((_c = props.config) !== null && _c !== void 0 ? _c : {})), { executor: {
52
- describe: null,
53
- }, systemPrompt: {
54
- execute: () => (0, transformFacadeStateMessage_1.transformFacadeStateMessage)(this.state_),
55
- } }),
56
- controllers: [
57
- (0, createAutoBeApplication_1.createAutoBeController)({
58
- model: props.model,
59
- context: this.context_,
60
- }),
61
- ],
62
- });
63
- this.agentica_.getHistories().push(...this.histories_
64
- .map((history) => (0, createAgenticaHistory_1.createAgenticaHistory)({
65
- operations: this.agentica_.getOperations(),
66
- history,
67
- }))
68
- .filter((h) => h !== null));
69
- this.agentica_.on("assistantMessage", (message) => __awaiter(this, void 0, void 0, function* () {
70
- const start = new Date();
71
- const history = {
72
- id: (0, uuid_1.v4)(),
73
- type: "assistantMessage",
74
- text: yield message.join(),
75
- created_at: start.toISOString(),
76
- completed_at: new Date().toISOString(),
77
- };
78
- this.histories_.push(history);
79
- this.dispatch({
80
- type: "assistantMessage",
81
- text: history.text,
82
- created_at: history.created_at,
83
- }).catch(() => { });
84
- }));
85
- }
86
- /** @internal */
87
- clone() {
88
- return new AutoBeAgent(Object.assign(Object.assign({}, this.props), { histories: this.histories_.slice() }));
89
- }
90
- on(type, listener) {
91
- (0, emplaceMap_1.emplaceMap)(this.listeners_, type, () => new Set()).add(listener);
92
- return this;
93
- }
94
- off(type, listener) {
95
- const set = this.listeners_.get(type);
96
- if (set === undefined)
97
- return this;
98
- set.delete(listener);
99
- if (set.size === 0)
100
- this.listeners_.delete(type);
101
- return this;
102
- }
103
- /* -----------------------------------------------------------
104
- ACCESSORS
105
- ----------------------------------------------------------- */
106
- conversate(content) {
107
- return __awaiter(this, void 0, void 0, function* () {
108
- const index = this.histories_.length;
109
- const userMessageHistory = {
110
- id: (0, uuid_1.v4)(),
111
- type: "userMessage",
112
- contents: typeof content === "string"
113
- ? [
114
- {
115
- type: "text",
116
- text: content,
117
- },
118
- ]
119
- : Array.isArray(content)
120
- ? content
121
- : [content],
122
- created_at: new Date().toISOString(),
123
- };
124
- this.histories_.push(userMessageHistory);
125
- this.dispatch(userMessageHistory).catch(() => { });
126
- yield this.agentica_.conversate(content);
127
- return this.histories_.slice(index);
128
- });
129
- }
130
- getFiles() {
131
- var _a, _b, _c;
132
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, Object.fromEntries(this.state_.analyze
133
- ? Object.entries(this.state_.analyze.files).map(([key, value]) => [
134
- `docs/analysis/${key.split("/").at(-1)}`,
135
- value,
136
- ])
137
- : [])), Object.fromEntries(((_a = this.state_.prisma) === null || _a === void 0 ? void 0 : _a.result.type) === "success"
138
- ? [
139
- ...Object.entries(this.state_.prisma.result.schemas).map(([key, value]) => [
140
- `prisma/schema/${key.split("/").at(-1)}`,
141
- value,
142
- ]),
143
- ["docs/ERD.md", this.state_.prisma.result.document],
144
- ]
145
- : [])), (this.state_.interface ? this.state_.interface.files : {})), (((_b = this.state_.test) === null || _b === void 0 ? void 0 : _b.result.type) === "success"
146
- ? this.state_.test.files
147
- : {})), (((_c = this.state_.realize) === null || _c === void 0 ? void 0 : _c.result.type) === "success"
148
- ? this.state_.realize.files
149
- : {}));
150
- }
151
- getHistories() {
152
- return this.histories_;
153
- }
154
- getTokenUsage() {
155
- return this.agentica_.getTokenUsage();
156
- }
157
- /* -----------------------------------------------------------
158
- CONTEXTS
159
- ----------------------------------------------------------- */
160
- /** @internal */
161
- getContext() {
162
- return this.context_;
163
- }
164
- /** @internal */
165
- dispatch(event) {
166
- return __awaiter(this, void 0, void 0, function* () {
167
- const set = this.listeners_.get(event.type);
168
- if (set === undefined)
169
- return;
170
- yield Promise.all(Array.from(set).map((listener) => __awaiter(this, void 0, void 0, function* () {
171
- try {
172
- yield listener(event);
173
- }
174
- catch (_a) { }
175
- })));
176
- });
177
- }
178
- }
179
- exports.AutoBeAgent = AutoBeAgent;
180
- //# sourceMappingURL=AutoBeAgent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AutoBeAgent.js","sourceRoot":"","sources":["../../../../agent/src/AutoBeAgent.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA+C;AAS/C,+BAA0B;AAK1B,2EAAwE;AACxE,+EAA2E;AAC3E,mEAAgE;AAChE,kGAA+F;AAE/F,mDAAgD;AAEhD,MAAa,WAAW;IAWtB;;kEAE8D;IAC9D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4
- import { createReviewerAgent } from "./CreateReviewerAgent";
5
- type Filename = string;
6
- type FileContent = string;
7
- export declare class AnalyzeAgent<Model extends ILlmSchema.Model> {
8
- private readonly createReviewerAgentFn;
9
- private readonly ctx;
10
- private readonly pointer;
11
- private readonly agent;
12
- private readonly fileMap;
13
- constructor(createReviewerAgentFn: typeof createReviewerAgent, ctx: AutoBeContext<Model>, pointer: IPointer<{
14
- files: Record<Filename, FileContent>;
15
- } | null>);
16
- /**
17
- * Conversate with planner agent
18
- *
19
- * @param content Conversation from user in this time.
20
- * @returns
21
- */
22
- conversate(content: string): Promise<string>;
23
- }
24
- export {};
@@ -1,143 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.AnalyzeAgent = void 0;
16
- const core_1 = require("@agentica/core");
17
- const typia_1 = __importDefault(require("typia"));
18
- const assertSchemaModel_1 = require("../context/assertSchemaModel");
19
- const Planning_1 = require("./Planning");
20
- class AnalyzeAgent {
21
- constructor(createReviewerAgentFn, ctx, pointer) {
22
- this.createReviewerAgentFn = createReviewerAgentFn;
23
- this.ctx = ctx;
24
- this.pointer = pointer;
25
- this.fileMap = {};
26
- (0, assertSchemaModel_1.assertSchemaModel)(ctx.model);
27
- const controller = createController({
28
- model: ctx.model,
29
- execute: new Planning_1.Planning(this.fileMap),
30
- build: (files) => __awaiter(this, void 0, void 0, function* () {
31
- this.pointer.value = { files };
32
- }),
33
- });
34
- this.agent = new core_1.MicroAgentica({
35
- controllers: [controller],
36
- model: ctx.model,
37
- vendor: ctx.vendor,
38
- config: {
39
- systemPrompt: {
40
- common: () => {
41
- var _a, _b;
42
- return "You are the best planner.\nYou will write documents and hand it over to the developer.\n\nThese are all the links that are currently referenced in the markdown. Please make sure to refer to them and don't forget to create the corresponding files.\nLike revision_history.md, you should not write fakes for content that does not exist yet. If written, it is only allowed if there is a user's request directly.\n\nPlease converse with the user based on the following guidelines and example templates.\nYou have to make a plan for the success of the user, and it has to be written in great detail to make the business successful.\nYour performance is measured by your customer's success.\nYou should listen to the reviewer and not make any requests to the reviewer.\nIf the reviewer asks for changes, revise the entire document from top to bottom,\nincorporating both the existing content and the requested changes. Do not add only the new parts\u2014integrate them into a full rewrite of the document.\nFor example, if you are asked to modify or expand 'internal_bulletin_board_service_plan.md',\ndo not create a document such as 'internal_bulletin_board_service_plan_expanded.md'.\nonly update 'internal_bulletin_board_service_plan.md' file.\n\n# user information\n- user locale: {% User Locale %}\n\n\n# Guidelines\nIf the user specifies the exact number of pages, please follow it precisely.\n\n{% Guidelines %}\n\n\n# Docuemtation Style\nAs with example documents, it is better to divide the documents into several pieces.\nIf the amount user want is 30,000 characters, you'll have to write 10 tables of contents, and 3,000 characters per page.\nFor readability, even if the user requests it, a file should not exceed 3,000 characters. (The amount of text is measured in String(content).length)\n\nThe first page must be the page that made up the table of contents, and you may need to modify the table of contents at the request of the reviewer.\nTake advantage of the markdown link functionality OR write step by step (use overwrite function).\nTake advantage of Mermaid.\nFor example, rather than writing a long markdown document, create a markdown document that makes up the table of contents.\nYou can also draw a gantt chart for the development period.\n\nAnd hang the link in the document in advance, and create other files that correspond to the link.\nEven if it's not the first page, divide the documents if it's readable to write them separately.\nHyperlink features allow you to create more colorful documents.\nAlso, please put numbers in the front of the document as much as possible so that the files can be arranged well.\nIt is recommended to write a longer document (more than 3,000 letters).\n\nPlease make the file appropriate for user's language.\nDocuments and descriptions should be tailored to the language of the user.\n\nPlease refer to the document below. The document below has a total of 1,500 characters and should be longer.\n\n# Example Documentation\n{% Example Documentation %}\n\n# Abort\nIf you don't have anything more to ask for, call the 'abort' function instead of answering. Never answer the text.\nSimilarly, if the reviewer says there is nothing more to modify and it is perfect, call the function 'abort'.\n'abort' is one of the tool lists that you have been given.\nIf the reviewer says the document is complete, but it appears they are referring to only one out of several documents, then it is not yet the right time to abort.\n\nWrite a long document, but keep your answer short." /* AutoBeSystemPromptConstant.ANALYZE */.replace("{% Guidelines %}", "You are the \u201CPlanning Expert (PlannerAgent)\u201D system agent.\nYou take full responsibility for all planning activities\u2014from product planning through requirements analysis, design, and documentation\u2014and you have extensive experience drafting planning documents.\n\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n1. Persona & Roles\n \u2022 **Planning Expert**: Establish business objectives, craft user scenarios, and develop a strategic roadmap \n \u2022 **Communication Specialist**: Use a friendly yet professional tone, actively engaging with stakeholders \n \u2022 **Documentation Specialist**: Follow a structured approach (Table of Contents \u2192 Detailed TOC \u2192 Final Document) and deliver outputs in Markdown\n\n2. Conversation-Driven Extraction Framework (WHY \u2192 WHAT \u2192 HOW)\n 1. **WHY (Reason for the Problem)**\n * \u201CWhy is this feature/project needed?\u201D \u201CWhat business or user problem does it solve?\u201D \n * Ask questions to clearly gather background, KPIs, and success criteria \n 2. **WHAT (What to Solve)**\n * \u201CWhat must be implemented?\u201D \u201CWhat are the key functional and non-functional requirements?\u201D \n * Distinguish between functional vs. non-functional, organize business requirements and user scenarios \n 3. **HOW (How to Execute)**\n * \u201CWhat flow and structure will the service follow?\u201D \u201CHow should the data model and ERD be designed?\u201D\n\n3. Scope & Constraints\n \u2022 Do **not** produce development-level documentation (backend, frontend, or infrastructure tech stacks). \n \u2022 API design, database structure, and architecture reviews should be suggested only at a high level from a planning perspective\u2014avoid any detailed code or configuration references.\n\n4. Deliverable Structuring Guidelines\n 1. **Present the TOC First**\n * Propose only the top-level Table of Contents initially; generate detailed sub-headings after user approval \n * When sub-TOCs grow large, split them into separate Markdown files and interlink them \n 2. **Document Augmentation**\n * Each document may be continuously updated; you may pre-link to future documents as placeholders \n * Only use links to actual, existing document paths\u2014external URLs that don\u2019t exist are prohibited \n 3. **Document Components**\n * Include: Overview, Objectives, User Personas, User Journeys, Functional & Non-Functional Requirements, Acceptance Criteria, ERD \n * Use tables, lists, and diagrams (ASCII or Mermaid) wherever helpful\n\n5. Communication & Feedback\n \u2022 After each phase, summarize progress and ask for the user\u2019s confirmation (e.g., \u201CShall we proceed with this TOC?\u201D) \n \u2022 Upon completing a document: include a feedback prompt such as \u201CIs there anything else to refine?\u201D\n\n6. Final Deliverables\n \u2022 Provide everything in Markdown (`.md`) format \n \u2022 Include inter-document reference links \n \u2022 Do **not** finalize the \u201Ccompleted\u201D version until the user has given explicit approval\n\n7. Review Loop\n \u2022 Use a while-loop process: after drafting any part, send it to the review agent and iterate until they grant approval. \n \u2022 Do not advance to the next section until the review agent confirms the current one meets quality standards.\n\n8. Approval & File Generation\n \u2022 Once the review agent approves the final draft, use the available tools to generate and export the document file. \n\n9. Iterative Writing Flow\n \u2022 Always start by proposing the top-level Table of Contents. \n \u2022 After TOC approval, draft the document one section (paragraph) at a time, submitting each for review before proceeding." /* AutoBeSystemPromptConstant.ANALYZE_GUIDELINE */)
43
- .replace("{% Example Documentation %}", "```\uAE30\uD68D\uC11C\n# \uC544\uBCF4\uCE74\uB3C4 \uB9C8\uCF13 (Avocado Market)\n\n**\uC11C\uBE44\uC2A4 \uC0C1\uC138 \uAE30\uD68D \uBCF4\uACE0\uC11C**\n\n---\n\n## 1. \uC11C\uBE44\uC2A4 \uAC1C\uC694\n\n**\uC544\uBCF4\uCE74\uB3C4 \uB9C8\uCF13**\uC740 \uC9C0\uC5ED \uAE30\uBC18 \uC911\uACE0 \uAC70\uB798\uB97C \uB118\uC5B4, **\uCE5C\uD658\uACBD \uAC00\uCE58\uC640 \uCEE4\uBBA4\uB2C8\uD2F0 \uC911\uC2EC\uC758 \uC5F0\uACB0**\uC744 \uC9C0\uD5A5\uD558\uB294 \uCC28\uC138\uB300 \uC911\uACE0\uAC70\uB798 \uD50C\uB7AB\uD3FC\uC785\uB2C8\uB2E4.\n\uC0AC\uC6A9\uC790\uB294 \uB204\uAD6C\uB098 \uC27D\uACE0 \uC548\uC804\uD558\uAC8C \uC911\uACE0 \uBB3C\uD488\uC744 \uC0AC\uACE0\uD314 \uC218 \uC788\uC73C\uBA70, \uC9C0\uC5ED \uC774\uC6C3\uACFC\uC758 \uAD50\uB958\uB97C \uD1B5\uD574 \uC9C0\uC18D \uAC00\uB2A5\uD55C \uC0DD\uD65C\uC744 \uC2E4\uD604\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n\uD83D\uDC49 [\uC790\uC138\uD788 \uBCF4\uAE30](01_overview.md)\n\n---\n\n## 2. \uC2DC\uC7A5 \uC870\uC0AC \uBC0F \uBCA4\uCE58\uB9C8\uD0B9\n\n\uAD6D\uB0B4\uC678 \uC911\uACE0\uAC70\uB798 \uD50C\uB7AB\uD3FC \uC2DC\uC7A5 \uD604\uD669\uC744 \uC885\uD569 \uBD84\uC11D\uD558\uACE0, \uC8FC\uC694 \uACBD\uC7C1\uC0AC\uC758 \uC11C\uBE44\uC2A4 \uC804\uB7B5\uACFC \uCC28\uBCC4 \uC694\uC18C\uB97C \uBE44\uAD50\uD558\uC600\uC2B5\uB2C8\uB2E4. \uB610\uD55C, \uD5A5\uD6C4 \uC2DC\uC7A5 \uC131\uC7A5 \uAC00\uB2A5\uC131\uACFC \uD2B8\uB80C\uB4DC\uB3C4 \uD568\uAED8 \uC81C\uC2DC\uD569\uB2C8\uB2E4.\n\uD83D\uDC49 [\uC790\uC138\uD788 \uBCF4\uAE30](02_market_analysis.md)\n\n---\n\n## 3. \uC8FC\uC694 \uAE30\uB2A5 \uBC0F \uC0C1\uC138 \uC124\uBA85\n\n\uC544\uBCF4\uCE74\uB3C4 \uB9C8\uCF13\uC774 \uC81C\uACF5\uD558\uB294 \uD575\uC2EC \uAE30\uB2A5\uB4E4\uACFC \uC2E4\uC81C \uC0AC\uC6A9 \uC2DC\uB098\uB9AC\uC624\uB97C \uAD6C\uCCB4\uC801\uC73C\uB85C \uC124\uBA85\uD569\uB2C8\uB2E4. \uAC01 \uAE30\uB2A5\uC758 \uBAA9\uC801, \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uC81C\uACF5\uB418\uB294 \uAC00\uCE58, \uCC28\uBCC4\uD654\uB41C \uAE30\uC220 \uB610\uB294 UI \uC694\uC18C\uB97C \uD3EC\uD568\uD569\uB2C8\uB2E4.\n\uD83D\uDC49 [\uC790\uC138\uD788 \uBCF4\uAE30](03_features.md)\n\n---\n\n## 4. \uC218\uC775 \uBAA8\uB378 \uBC0F \uC131\uC7A5 \uC804\uB7B5\n\n\uAD11\uACE0, \uD504\uB9AC\uBBF8\uC5C4 \uC11C\uBE44\uC2A4, \uC81C\uD734 \uAE30\uBC18 \uBE44\uC988\uB2C8\uC2A4 \uB4F1 \uB2E4\uC591\uD55C \uC218\uC775\uD654 \uBAA8\uB378\uC744 \uC81C\uC2DC\uD558\uBA70, \uC774\uB97C \uAE30\uBC18\uC73C\uB85C \uD55C \uC911\uC7A5\uAE30 \uC131\uC7A5 \uC804\uB7B5\uC744 \uD3EC\uD568\uD569\uB2C8\uB2E4.\n\uD83D\uDC49 [\uC790\uC138\uD788 \uBCF4\uAE30](04_business_model.md)\n\n---\n\n## 5. UX/UI \uC124\uACC4 \uAC00\uC774\uB4DC\n\n\uC0AC\uC6A9\uC790 \uCE5C\uD654\uC801 \uC778\uD130\uD398\uC774\uC2A4 \uC124\uACC4 \uBC29\uC548\uACFC \uD568\uAED8, \uB808\uD37C\uB7F0\uC2A4 \uC0AC\uB840 \uBC0F \uC0AC\uC6A9\uC790 \uACBD\uD5D8 \uD5A5\uC0C1\uC744 \uC704\uD55C \uB514\uC790\uC778 \uC6D0\uCE59\uC744 \uC81C\uACF5\uD569\uB2C8\uB2E4.\n\uD83D\uDC49 [\uC790\uC138\uD788 \uBCF4\uAE30](05_uxui_guidelines.md)\n\n---\n\n## 6. \uAC1C\uBC1C \uBC0F \uCD9C\uC2DC \uC804\uB7B5\n\n\uC11C\uBE44\uC2A4 \uAC1C\uBC1C\uBD80\uD130 MVP \uC124\uACC4, \uBCA0\uD0C0 \uD14C\uC2A4\uD2B8, \uC815\uC2DD \uCD9C\uC2DC\uAE4C\uC9C0\uC758 \uC804\uCCB4 \uB85C\uB4DC\uB9F5\uC744 \uC81C\uC2DC\uD558\uBA70, \uAC01 \uB2E8\uACC4\uBCC4 \uBAA9\uD45C\uC640 \uC804\uB7B5\uC744 \uAD6C\uCCB4\uD654\uD569\uB2C8\uB2E4.\n\uD83D\uDC49 [\uC790\uC138\uD788 \uBCF4\uAE30](06_release_strategy.md)\n\n---\n\n## 7. \uAE30\uC220 \uC544\uD0A4\uD14D\uCC98\n\n\uD50C\uB7AB\uD3FC\uC758 \uC804\uCCB4 \uC2DC\uC2A4\uD15C \uAD6C\uC870, \uD575\uC2EC \uAE30\uC220 \uC2A4\uD0DD, \uC678\uBD80 API \uC5F0\uB3D9 \uBC29\uC2DD, \uC778\uD504\uB77C \uAD6C\uC131 \uB4F1\uC744 \uD3EC\uD568\uD55C \uAE30\uC220\uC801 \uC124\uACC4 \uB0B4\uC6A9\uC744 \uC815\uB9AC\uD569\uB2C8\uB2E4.\n\uD83D\uDC49 [\uC790\uC138\uD788 \uBCF4\uAE30](07_architecture.md)\n\n---\n\n## 8. \uD3EC\uC9C0\uC154\uB2DD \uBC0F \uB9C8\uCF00\uD305 \uC804\uB7B5\n\n\uD0C0\uAE43 \uC0AC\uC6A9\uC790 \uC815\uC758, \uBE0C\uB79C\uB4DC \uC544\uC774\uB374\uD2F0\uD2F0 \uC218\uB9BD, \uD64D\uBCF4 \uC804\uB7B5, \uC9C0\uC5ED \uBC00\uCC29\uD615 \uCEE4\uBBA4\uB2C8\uD2F0 \uB9C8\uCF00\uD305 \uB4F1 \uC2E4\uC9C8\uC801\uC778 \uC2E4\uD589 \uC804\uB7B5\uC744 \uC81C\uC548\uD569\uB2C8\uB2E4.\n\uD83D\uDC49 [\uC790\uC138\uD788 \uBCF4\uAE30](08_marketing.md)\n\n---\n\n## 9. \uB9AC\uC2A4\uD06C \uAD00\uB9AC \uBC29\uC548\n\n\uC11C\uBE44\uC2A4 \uC6B4\uC601 \uC804\uBC18\uC5D0\uC11C \uBC1C\uC0DD\uD560 \uC218 \uC788\uB294 \uB2E4\uC591\uD55C \uB9AC\uC2A4\uD06C\uB97C \uC2DD\uBCC4\uD558\uACE0, \uC774\uC5D0 \uB300\uD55C \uC0AC\uC804 \uC608\uBC29 \uBC0F \uC0AC\uD6C4 \uB300\uC751 \uBC29\uC548\uC744 \uCCB4\uACC4\uC801\uC73C\uB85C \uC815\uB9AC\uD558\uC600\uC2B5\uB2C8\uB2E4.\n\uD83D\uDC49 [\uC790\uC138\uD788 \uBCF4\uAE30](09_risk_management.md)\n\n---\n\n## 10. \uC11C\uBE44\uC2A4 \uD655\uC7A5 \uAC00\uB2A5\uC131\n\n\uC911\uC7A5\uAE30\uC801\uC73C\uB85C \uACE0\uB824\uD560 \uC218 \uC788\uB294 \uC2E0\uADDC \uAE30\uB2A5, \uBE44\uC988\uB2C8\uC2A4 \uBAA8\uB378 \uD655\uC7A5, \uAE00\uB85C\uBC8C \uC9C4\uCD9C \uB4F1 \uC544\uBCF4\uCE74\uB3C4 \uB9C8\uCF13\uC758 \uBBF8\uB798 \uBE44\uC804\uC744 \uC81C\uC2DC\uD569\uB2C8\uB2E4.\n\uD83D\uDC49 [\uC790\uC138\uD788 \uBCF4\uAE30](10_expansion.md)\n\n```;" /* AutoBeSystemPromptConstant.ANALYZE_EXAMPLE */)
44
- .replace("{% User Locale %}", (_b = (_a = ctx.config) === null || _a === void 0 ? void 0 : _a.locale) !== null && _b !== void 0 ? _b : "en-US");
45
- },
46
- },
47
- },
48
- tokenUsage: ctx.usage(),
49
- });
50
- }
51
- /**
52
- * Conversate with planner agent
53
- *
54
- * @param content Conversation from user in this time.
55
- * @returns
56
- */
57
- conversate(content) {
58
- return __awaiter(this, void 0, void 0, function* () {
59
- var _a, _b, _c, _d;
60
- const response = yield this.agent.conversate(content);
61
- const lastMessage = response[response.length - 1];
62
- if ("text" in lastMessage) {
63
- this.ctx.dispatch({
64
- type: "analyzeWriteDocument",
65
- files: this.fileMap,
66
- created_at: new Date().toISOString(),
67
- step: (_b = (_a = this.ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
68
- });
69
- const aborted = lastMessage.type === "describe" &&
70
- lastMessage.executes.some((el) => {
71
- if (el.protocol === "class" &&
72
- el.operation.function.name === "abort") {
73
- el.arguments;
74
- return true;
75
- }
76
- });
77
- if (aborted === true) {
78
- return lastMessage.text;
79
- }
80
- const currentFiles = this.fileMap;
81
- const reviewer = this.createReviewerAgentFn(this.ctx, {
82
- query: content,
83
- currentFiles,
84
- });
85
- const [review] = yield reviewer.conversate(lastMessage.text);
86
- if (review) {
87
- if (review.type === "assistantMessage") {
88
- this.ctx.dispatch({
89
- type: "analyzeReview",
90
- review: review.text,
91
- created_at: new Date().toISOString(),
92
- step: (_d = (_c = this.ctx.state().analyze) === null || _c === void 0 ? void 0 : _c.step) !== null && _d !== void 0 ? _d : 0,
93
- });
94
- return this.conversate(JSON.stringify({
95
- user_query: content,
96
- message: `THIS IS ANSWER OF REVIEW AGENT. FOLLOW THIS INSTRUCTIONS. AND DON\'T REQUEST ANYTHING.`,
97
- review: review.text,
98
- }));
99
- }
100
- }
101
- }
102
- return "COMPLETE";
103
- });
104
- }
105
- }
106
- exports.AnalyzeAgent = AnalyzeAgent;
107
- function createController(props) {
108
- (0, assertSchemaModel_1.assertSchemaModel)(props.model);
109
- const application = collection[props.model];
110
- return {
111
- protocol: "class",
112
- name: "Planning",
113
- application,
114
- // execute: props.execute,
115
- execute: {
116
- removeFile: (input) => {
117
- const response = props.execute.removeFile(input);
118
- props.build(props.execute.allFiles());
119
- return response;
120
- },
121
- abort: (input) => {
122
- const response = props.execute.abort(input);
123
- props.build(props.execute.allFiles());
124
- return response;
125
- },
126
- createOrUpdateFile: (input) => {
127
- const response = props.execute.createOrUpdateFile(input);
128
- props.build(props.execute.allFiles());
129
- return response;
130
- },
131
- },
132
- };
133
- }
134
- const claude = typia_1.default.llm.application();
135
- const collection = {
136
- chatgpt: typia_1.default.llm.application(),
137
- claude,
138
- llama: claude,
139
- deepseek: claude,
140
- "3.1": claude,
141
- "3.0": typia_1.default.llm.application(),
142
- };
143
- //# sourceMappingURL=AnalyzeAgent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnalyzeAgent.js","sourceRoot":"","sources":["../../../../../agent/src/analyze/AnalyzeAgent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yCAAoE;AAGpE,kDAA0B;AAI1B,oEAAiE;AAEjE,yCAAiD;AAKjD,MAAa,YAAY;IAIvB,YACmB,qBAAiD,EACjD,GAAyB,EACzB,OAER;QAJQ,0BAAqB,GAArB,qBAAqB,CAA4B;QACjD,QAAG,GAAH,GAAG,CAAsB;QACzB,YAAO,GAAP,OAAO,CAEf;QAPM,YAAO,GAAkC,EAAE,CAAC;QAS3D,IAAA,qCAAiB,EAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAE7B,MAAM,UAAU,GAAG,gBAAgB,CAAQ;YACzC,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,OAAO,EAAE,IAAI,mBAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;YACnC,KAAK,EAAE,CAAO,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C;IAC1E,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;IACb,KAAK,EAAE,eAAK,CAAC,GAAG,CAAC,WAAW,EAAmB;CAChD,CAAC"}
@@ -1,16 +0,0 @@
1
- import { MicroAgentica } from "@agentica/core";
2
- import { ILlmSchema } from "@samchon/openapi";
3
- import { AutoBeContext } from "../context/AutoBeContext";
4
- export declare const createReviewerAgent: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, input: ICreateReviewerAgentInput) => MicroAgentica<Model>;
5
- export interface ICreateReviewerAgentInput {
6
- /**
7
- * Indicates the initial utterance of the user. Identify the purpose of your
8
- * documentation for better review.
9
- */
10
- query: string;
11
- /**
12
- * Hand over the title and name of the file that has been created so far to
13
- * the list.
14
- */
15
- currentFiles: Record<string, string>;
16
- }
@@ -1,97 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createReviewerAgent = void 0;
4
- const core_1 = require("@agentica/core");
5
- const createReviewerAgent = (ctx, input) => {
6
- // All links specified in the markdown are drawn in advance and provided to LLM.
7
- const markdownFiles = Array.from(new Set(Object.values(input.currentFiles).flatMap((content) => {
8
- const fileExtensions = ["md"];
9
- const regex = /\[[^\]]*\]\(([^)]+)\)/g;
10
- const fileLinks = [...content.matchAll(regex)]
11
- .map((match) => match[1])
12
- .filter((link) => {
13
- var _a;
14
- const ext = (_a = link.split(".").pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase();
15
- return ext && fileExtensions.includes(ext);
16
- });
17
- return fileLinks;
18
- })));
19
- return new core_1.MicroAgentica({
20
- model: ctx.model,
21
- vendor: ctx.vendor,
22
- controllers: [],
23
- config: {
24
- systemPrompt: {
25
- common: () => {
26
- return [
27
- "You are an excellent requirements analyst & reviewer agent.",
28
- "",
29
- `The reviewer's role is to ensure that this document contains sufficient information before it is delivered to developers`,
30
- `These are all the links that are currently referenced in the markdown. Please make sure to refer to them and don't forget to create the corresponding files.`,
31
- "Also, you should not create files that are not specified in the table of contents.",
32
- "If you request the creation of a file that is not specified in the table of contents, instruct them to modify the table of contents first.",
33
- "If the user specifies the exact number of pages, please follow it precisely.",
34
- "",
35
- "You should not write your own writing in any case, but only direct the modifications.",
36
- "Also, reviewers are independent beings, and should never be instructed.",
37
- "Your words should be instructions that must be followed, not recommendations.",
38
- "",
39
- `user said, "${input.query}"`,
40
- "user requests will take precedence over the other system prompts below unless they are a security concern.",
41
- "",
42
- "If there are any changes that need to be made, please provide detailed instructions.",
43
- "Just give clear and concise instructions, but don't say anything unnecessary.",
44
- "",
45
- "If you feel that the current level of analysis is sufficient, please do not make any further requests and notify us that it is complete.",
46
- "",
47
- "It is recommended to ask the planner to write a longer document (more than 1,000 letters) until it gives sufficient utility value.",
48
- "However, even if the length of the document is less than 1,000 letters, pass it if the quality is compliant.",
49
- "When increasing the volume of a document, explain to the planner how many letters the document currently has and how many more should be increased.",
50
- "Rather than simply telling them to increase the text, it is better to count the number of tables of contents compared to the existing text and instruct them to double the amount if they want to double the amount.",
51
- "When you add something about the table of contents, please clearly state the name of the table of contents.",
52
- "",
53
- "If the planner agent asks a question, the reviewer should answer on behalf of the user.",
54
- "Please do not ask any questions.",
55
- "Just give orders.",
56
- "",
57
- "If you have a hyperlink that is not yet complete, even if the document is of good quality, the document is considered incomplete.",
58
- "You should also ask for the rest of the document to be created.",
59
- "At this time, the document should be newly created with the name attached to the link, not modified.",
60
- "<CurrentFiles>",
61
- JSON.stringify(Object.entries(input.currentFiles)
62
- .slice(-2)
63
- .map(([filename, content]) => {
64
- return {
65
- filename,
66
- content,
67
- content_length: content.length,
68
- };
69
- }), null, 2),
70
- "</CurrentFiles>",
71
- "",
72
- `These are all the links that are currently referenced in the markdown. Please make sure to refer to them and don't forget to create the corresponding files.`,
73
- `<Linked Files>`,
74
- markdownFiles.map((filename) => {
75
- const isChecked = Object.keys(input.currentFiles).includes(filename);
76
- return `- [${isChecked}] ${filename}`;
77
- }),
78
- `</Linked Files>`,
79
- "",
80
- "Write a long document, but keep your answer short.",
81
- "The planner agent can only create and modify one document at a time, so do not ask to create or modify multiple documents at a time.",
82
- "If you say the document is complete, the planner will finish writing the document.",
83
- "If only one document has been written out of several that need to be completed, do not simply state that it is complete—also provide instructions for what should be done next.",
84
- "For example, if you say, “The document internal_bulletin_board_service_plan.md has already been written with over 1,000 characters. Its quality is sufficient, so mark it as complete without any further requests,” then the planner will respond with “Got it!” and stop writing—even if there are still remaining documents.",
85
- "Be cautious: the planner will try to avoid work by interpreting your words in a way that lets them do less.",
86
- "The correct response from you should be:",
87
- "\“The document's quality is sufficient, so mark it as complete without any further requests. Now, proceed to write the next document immediately.\”",
88
- "When requesting the next document to be written, you must include both the document title and a brief description of its content.",
89
- ].join("\n");
90
- },
91
- },
92
- },
93
- tokenUsage: ctx.usage(),
94
- });
95
- };
96
- exports.createReviewerAgent = createReviewerAgent;
97
- //# sourceMappingURL=CreateReviewerAgent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreateReviewerAgent.js","sourceRoot":"","sources":["../../../../../agent/src/analyze/CreateReviewerAgent.ts"],"names":[],"mappings":";;;AAAA,yCAA+C;AAKxC,MAAM,mBAAmB,GAAG,CACjC,GAAyB,EACzB,KAAgC,EAChC,EAAE;IACF,gFAAgF;IAChF,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAC9B,IAAI,GAAG,CACL,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QACpD,MAAM,cAAc,GAAG,CAAC,IAAI,CAAC,CAAC;QAE9B,MAAM,KAAK,GAAG,wBAAwB,CAAC;QAEvC,MAAM,SAAS,GAAG,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;aAC3C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aACxB,MAAM,CA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