@autobe/agent 0.8.0 → 0.9.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 (73) hide show
  1. package/lib/AutoBeAgent.d.ts +183 -12
  2. package/lib/AutoBeAgent.js +245 -65
  3. package/lib/AutoBeAgent.js.map +1 -1
  4. package/lib/constants/AutoBeSystemPromptConstant.d.ts +4 -3
  5. package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
  6. package/lib/context/AutoBeContext.d.ts +2 -2
  7. package/lib/factory/index.d.ts +0 -1
  8. package/lib/factory/index.js +0 -1
  9. package/lib/factory/index.js.map +1 -1
  10. package/lib/index.mjs +976 -633
  11. package/lib/index.mjs.map +1 -1
  12. package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js +1 -1
  13. package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +1 -1
  14. package/lib/orchestrate/interface/orchestrateInterface.js +1 -1
  15. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
  16. package/lib/orchestrate/prisma/orchestratePrisma.js +1 -1
  17. package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  18. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +1 -1
  19. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  20. package/lib/orchestrate/test/orchestrateTest.js +4 -8
  21. package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
  22. package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +2 -2
  23. package/lib/orchestrate/test/orchestrateTestCorrect.js +89 -57
  24. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  25. package/lib/orchestrate/test/orchestrateTestProgress.d.ts +3 -2
  26. package/lib/orchestrate/test/orchestrateTestProgress.js +73 -46
  27. package/lib/orchestrate/test/orchestrateTestProgress.js.map +1 -1
  28. package/lib/orchestrate/test/orchestrateTestScenario.d.ts +2 -2
  29. package/lib/orchestrate/test/orchestrateTestScenario.js +616 -237
  30. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  31. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +123 -0
  32. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.js +3 -0
  33. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.js.map +1 -0
  34. package/lib/orchestrate/test/transformTestCorrectHistories.d.ts +2 -1
  35. package/lib/orchestrate/test/transformTestCorrectHistories.js +14 -10
  36. package/lib/orchestrate/test/transformTestCorrectHistories.js.map +1 -1
  37. package/lib/orchestrate/test/transformTestProgressHistories.d.ts +7 -1
  38. package/lib/orchestrate/test/transformTestProgressHistories.js +20 -20
  39. package/lib/orchestrate/test/transformTestProgressHistories.js.map +1 -1
  40. package/lib/orchestrate/test/transformTestScenarioHistories.d.ts +1 -2
  41. package/lib/orchestrate/test/transformTestScenarioHistories.js +1 -77
  42. package/lib/orchestrate/test/transformTestScenarioHistories.js.map +1 -1
  43. package/lib/structures/IAutoBeConfig.d.ts +48 -10
  44. package/lib/structures/IAutoBeProps.d.ts +87 -0
  45. package/lib/structures/IAutoBeVendor.d.ts +64 -22
  46. package/lib/utils/backoffRetry.d.ts +7 -0
  47. package/lib/utils/backoffRetry.js +73 -0
  48. package/lib/utils/backoffRetry.js.map +1 -0
  49. package/lib/utils/types/BackoffOptions.d.ts +12 -0
  50. package/lib/utils/types/BackoffOptions.js +3 -0
  51. package/lib/utils/types/BackoffOptions.js.map +1 -0
  52. package/package.json +4 -4
  53. package/src/AutoBeAgent.ts +248 -52
  54. package/src/constants/AutoBeSystemPromptConstant.ts +4 -3
  55. package/src/context/AutoBeContext.ts +7 -2
  56. package/src/factory/index.ts +0 -1
  57. package/src/orchestrate/analyze/AutoBeAnalyzeAgent.ts +1 -1
  58. package/src/orchestrate/interface/orchestrateInterface.ts +1 -1
  59. package/src/orchestrate/prisma/orchestratePrisma.ts +1 -0
  60. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +4 -2
  61. package/src/orchestrate/test/orchestrateTest.ts +6 -13
  62. package/src/orchestrate/test/orchestrateTestCorrect.ts +125 -72
  63. package/src/orchestrate/test/orchestrateTestProgress.ts +86 -42
  64. package/src/orchestrate/test/orchestrateTestScenario.ts +192 -151
  65. package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +132 -0
  66. package/src/orchestrate/test/transformTestCorrectHistories.ts +14 -10
  67. package/src/orchestrate/test/transformTestProgressHistories.ts +25 -22
  68. package/src/orchestrate/test/transformTestScenarioHistories.ts +0 -79
  69. package/src/structures/IAutoBeConfig.ts +48 -10
  70. package/src/structures/IAutoBeProps.ts +91 -0
  71. package/src/structures/IAutoBeVendor.ts +64 -22
  72. package/src/utils/backoffRetry.ts +84 -0
  73. package/src/utils/types/BackoffOptions.ts +15 -0
@@ -1,24 +1,195 @@
1
- import { AutoBeEvent, AutoBeHistory, AutoBeUserMessageContent } from "@autobe/interface";
1
+ import { AutoBeEvent, AutoBeHistory, AutoBeUserMessageContent, IAutoBeGetFilesOptions } from "@autobe/interface";
2
2
  import { ILlmSchema } from "@samchon/openapi";
3
3
  import { AutoBeTokenUsage } from "./context/AutoBeTokenUsage";
4
4
  import { IAutoBeProps } from "./structures/IAutoBeProps";
5
+ /**
6
+ * Main agent class that orchestrates the entire vibe coding pipeline through
7
+ * conversation-driven development.
8
+ *
9
+ * The AutoBeAgent serves as the central coordinator for the waterfall-based
10
+ * development process with spiral model iterative improvements. It manages the
11
+ * five specialized agents (Analyze, Prisma, Interface, Test, Realize) that
12
+ * transform user conversations into complete working applications through a
13
+ * sophisticated AST-based compilation infrastructure.
14
+ *
15
+ * The agent operates through natural language conversation, supporting
16
+ * multimodal input including text, images, files, and audio. It maintains
17
+ * conversation history, tracks development progress through real-time events,
18
+ * and provides access to all generated artifacts including requirements
19
+ * documentation, database schemas, API specifications, test suites, and
20
+ * implementation code.
21
+ *
22
+ * The vibe coding approach eliminates traditional development barriers by
23
+ * enabling users to express requirements naturally while the agent handles all
24
+ * technical implementation details through validated AST transformations and
25
+ * continuous quality assurance feedback loops.
26
+ *
27
+ * @author Samchon
28
+ */
5
29
  export declare class AutoBeAgent<Model extends ILlmSchema.Model> {
6
- private readonly props;
7
- private readonly agentica_;
8
- private readonly histories_;
9
- private readonly context_;
10
- private readonly state_;
11
- private readonly listeners_;
12
30
  /**
13
- * Initializer constructor.
31
+ * Initializes a new AutoBeAgent instance with the specified configuration.
14
32
  *
15
- * @param props Properties to construct the agent
33
+ * Creates and configures the agent with AI vendor settings, behavioral
34
+ * context (locale/timezone), and compilation infrastructure. The agent can
35
+ * optionally resume from previous conversation histories to continue
36
+ * development sessions or build upon existing work.
37
+ *
38
+ * The constructor sets up the internal MicroAgentica engine, initializes the
39
+ * development state from provided histories, and establishes the event
40
+ * dispatch system for real-time progress notifications. The agent becomes
41
+ * ready for conversation-driven development immediately after construction.
42
+ *
43
+ * @param props Configuration properties including AI vendor settings,
44
+ * behavioral context, compilation tools, and optional conversation
45
+ * histories for session continuation
16
46
  */
17
47
  constructor(props: IAutoBeProps<Model>);
18
- on<Type extends AutoBeEvent.Type>(type: Type, listener: (event: AutoBeEvent.Mapper[Type]) => Promise<void> | void): this;
19
- off<Type extends AutoBeEvent.Type>(type: Type, listener: (event: AutoBeEvent.Mapper[Type]) => Promise<void> | void): this;
48
+ /**
49
+ * Engages in conversation with the agent to drive the vibe coding process.
50
+ *
51
+ * Accepts user input in multiple formats including simple text strings,
52
+ * single multimodal content items, or arrays of content supporting text,
53
+ * images, file uploads, and audio input. The conversation serves as the
54
+ * primary interface for expressing requirements, providing feedback, and
55
+ * guiding the development process through natural language interaction.
56
+ *
57
+ * The agent analyzes the conversation context to determine appropriate
58
+ * actions, potentially activating specialized agents (Analyze, Prisma,
59
+ * Interface, Test, Realize) through function calling based on user needs.
60
+ * Real-time progress events are fired through registered listeners while the
61
+ * conversation processes.
62
+ *
63
+ * Returns all history records generated during this conversation turn,
64
+ * including user messages, assistant responses, and any development
65
+ * activities triggered by the interaction. This enables clients to track both
66
+ * conversational flow and development progress.
67
+ *
68
+ * @param content User input as text, single content item, or multimodal array
69
+ * @returns Promise resolving to array of history records from this
70
+ * conversation
71
+ */
20
72
  conversate(content: string | AutoBeUserMessageContent | AutoBeUserMessageContent[]): Promise<AutoBeHistory[]>;
21
- getFiles(): Record<string, string>;
73
+ /**
74
+ * Retrieves all generated files from the current development session.
75
+ *
76
+ * Transforms the complete conversation-driven development process into a
77
+ * comprehensive collection of deployable artifacts, including requirements
78
+ * documentation, database schemas, API specifications, NestJS implementation
79
+ * code, and test suites. The generated files represent a fully functional
80
+ * backend application ready for immediate deployment or further
81
+ * customization.
82
+ *
83
+ * The method produces a meticulously organized project structure that
84
+ * reflects professional software development standards. Requirements analysis
85
+ * documents capture and formalize your conversational input into structured
86
+ * technical specifications, providing clear traceability from user intent to
87
+ * final implementation. Database artifacts include Prisma schemas with
88
+ * precise type definitions, relationships, and constraints, along with
89
+ * migration files for proper database initialization and evolution.
90
+ *
91
+ * The API layer emerges through comprehensive OpenAPI specifications
92
+ * documenting every endpoint, request format, response structure, and error
93
+ * condition. Generated NestJS controllers, DTOs, and service classes
94
+ * implement these specifications with TypeScript's strong typing system
95
+ * providing compile-time safety. Quality assurance is embedded throughout
96
+ * with complete test suites covering both unit and end-to-end scenarios.
97
+ *
98
+ * The database configuration specified through the `dbms` option
99
+ * fundamentally shapes the entire generated codebase. PostgreSQL
100
+ * configuration produces production-ready code with robust connection pooling
101
+ * and enterprise-grade optimizations, while SQLite generates lightweight code
102
+ * perfect for local development and rapid prototyping without external
103
+ * dependencies.
104
+ *
105
+ * All artifacts maintain perfect consistency across the chosen database
106
+ * system, from Prisma configurations and connection strings to Docker compose
107
+ * files and environment templates. This deep integration ensures immediate
108
+ * deployment compatibility without manual configuration adjustments.
109
+ *
110
+ * @param options Configuration specifying the target database management
111
+ * system and other code generation preferences that influence the structure
112
+ * and characteristics of the generated project files
113
+ * @returns Promise resolving to key-value pairs mapping logical file paths to
114
+ * complete file contents for all generated development artifacts, ready for
115
+ * immediate file system operations, build integration, or deployment
116
+ * workflows
117
+ */
118
+ getFiles(options?: Partial<IAutoBeGetFilesOptions>): Promise<Record<string, string>>;
119
+ /**
120
+ * Retrieves the complete conversation and development history.
121
+ *
122
+ * Returns the chronologically ordered record of all events from the current
123
+ * session including user messages, assistant responses, development phase
124
+ * activities, progress events, and completion notifications. This
125
+ * comprehensive history enables conversation replay, development process
126
+ * analysis, and understanding of how requirements evolved into working
127
+ * software.
128
+ *
129
+ * The history provides complete transparency into the vibe coding process,
130
+ * showing both conversational interactions and behind-the-scenes development
131
+ * activities. This information is valuable for debugging, process
132
+ * improvement, and educational purposes to understand the agent's
133
+ * decision-making process.
134
+ *
135
+ * @returns Chronologically ordered array of all history records including
136
+ * messages, events, and development activities
137
+ */
22
138
  getHistories(): AutoBeHistory[];
139
+ /**
140
+ * Retrieves comprehensive AI token usage statistics for the current session.
141
+ *
142
+ * Returns detailed breakdown of token consumption across all specialized
143
+ * agents and processing phases, enabling cost monitoring, performance
144
+ * analysis, and optimization of AI resource utilization. Statistics include
145
+ * aggregate totals and component-specific breakdowns with input/output
146
+ * categorization, caching analysis, and reasoning token tracking.
147
+ *
148
+ * Token usage data is essential for understanding the computational costs of
149
+ * different development phases and optimizing AI efficiency. The breakdown
150
+ * helps identify which agents or operations consume the most resources,
151
+ * enabling targeted optimization efforts while maintaining development
152
+ * quality.
153
+ *
154
+ * @returns Comprehensive token usage statistics with detailed breakdowns by
155
+ * agent, operation type, and consumption category
156
+ */
23
157
  getTokenUsage(): AutoBeTokenUsage;
158
+ /**
159
+ * Registers an event listener for specific development phase events.
160
+ *
161
+ * Enables client applications to receive real-time notifications about
162
+ * conversation flow, development progress, and completion events throughout
163
+ * the vibe coding pipeline. Event listeners provide visibility into agent
164
+ * activities and enable responsive user interfaces that can display progress,
165
+ * handle artifacts, and provide feedback.
166
+ *
167
+ * The type-safe event system ensures that listeners receive properly typed
168
+ * events corresponding to their registration type, enabling robust event
169
+ * handling without runtime type issues. Multiple listeners can be registered
170
+ * for the same event type to support complex notification requirements.
171
+ *
172
+ * @param type Event type to listen for (e.g., "analyzeComplete",
173
+ * "prismaStart")
174
+ * @param listener Callback function that receives the typed event when fired
175
+ * @returns The agent instance for method chaining
176
+ */
177
+ on<Type extends AutoBeEvent.Type>(type: Type, listener: (event: AutoBeEvent.Mapper[Type]) => Promise<void> | void): this;
178
+ /**
179
+ * Unregisters a previously registered event listener.
180
+ *
181
+ * Removes the specified event listener from the agent's notification system,
182
+ * stopping further event notifications for that particular listener function.
183
+ * This is useful for cleanup, dynamic listener management, or when components
184
+ * no longer need to receive specific event notifications.
185
+ *
186
+ * The listener function reference must exactly match the function that was
187
+ * originally registered with {@link on} for successful removal. If no matching
188
+ * listener is found, the operation has no effect.
189
+ *
190
+ * @param type Event type the listener was registered for
191
+ * @param listener The exact listener function reference to remove
192
+ * @returns The agent instance for method chaining
193
+ */
194
+ off<Type extends AutoBeEvent.Type>(type: Type, listener: (event: AutoBeEvent.Mapper[Type]) => Promise<void> | void): this;
24
195
  }
@@ -18,37 +18,76 @@ const createAutoBeApplication_1 = require("./factory/createAutoBeApplication");
18
18
  const createAutoBeState_1 = require("./factory/createAutoBeState");
19
19
  const transformFacadeStateMessage_1 = require("./orchestrate/facade/transformFacadeStateMessage");
20
20
  const emplaceMap_1 = require("./utils/emplaceMap");
21
+ /**
22
+ * Main agent class that orchestrates the entire vibe coding pipeline through
23
+ * conversation-driven development.
24
+ *
25
+ * The AutoBeAgent serves as the central coordinator for the waterfall-based
26
+ * development process with spiral model iterative improvements. It manages the
27
+ * five specialized agents (Analyze, Prisma, Interface, Test, Realize) that
28
+ * transform user conversations into complete working applications through a
29
+ * sophisticated AST-based compilation infrastructure.
30
+ *
31
+ * The agent operates through natural language conversation, supporting
32
+ * multimodal input including text, images, files, and audio. It maintains
33
+ * conversation history, tracks development progress through real-time events,
34
+ * and provides access to all generated artifacts including requirements
35
+ * documentation, database schemas, API specifications, test suites, and
36
+ * implementation code.
37
+ *
38
+ * The vibe coding approach eliminates traditional development barriers by
39
+ * enabling users to express requirements naturally while the agent handles all
40
+ * technical implementation details through validated AST transformations and
41
+ * continuous quality assurance feedback loops.
42
+ *
43
+ * @author Samchon
44
+ */
21
45
  class AutoBeAgent {
22
46
  /* -----------------------------------------------------------
23
47
  CONSTRUCTOR
24
48
  ----------------------------------------------------------- */
25
49
  /**
26
- * Initializer constructor.
50
+ * Initializes a new AutoBeAgent instance with the specified configuration.
27
51
  *
28
- * @param props Properties to construct the agent
52
+ * Creates and configures the agent with AI vendor settings, behavioral
53
+ * context (locale/timezone), and compilation infrastructure. The agent can
54
+ * optionally resume from previous conversation histories to continue
55
+ * development sessions or build upon existing work.
56
+ *
57
+ * The constructor sets up the internal MicroAgentica engine, initializes the
58
+ * development state from provided histories, and establishes the event
59
+ * dispatch system for real-time progress notifications. The agent becomes
60
+ * ready for conversation-driven development immediately after construction.
61
+ *
62
+ * @param props Configuration properties including AI vendor settings,
63
+ * behavioral context, compilation tools, and optional conversation
64
+ * histories for session continuation
29
65
  */
30
66
  constructor(props) {
31
67
  var _a, _b, _c, _d;
32
- this.props = props;
68
+ // INITIALIZE MEMBERS
69
+ this.props_ = props;
33
70
  this.histories_ = (_b = (_a = props.histories) === null || _a === void 0 ? void 0 : _a.slice()) !== null && _b !== void 0 ? _b : [];
34
71
  this.state_ = (0, createAutoBeState_1.createAutoBeState)(this.histories_);
72
+ this.listeners_ = new Map();
73
+ // CONSTRUCT AGENTICA
74
+ const vendor = Object.assign(Object.assign({}, props.vendor), { semaphore: new tstl_1.Semaphore((_c = props.vendor.semaphore) !== null && _c !== void 0 ? _c : 16) });
35
75
  this.context_ = {
76
+ vendor,
36
77
  model: props.model,
37
- vendor: props.vendor,
38
78
  config: props.config,
39
79
  compiler: props.compiler,
40
80
  histories: () => this.histories_,
41
81
  state: () => this.state_,
42
82
  usage: () => this.agentica_.getTokenUsage(),
43
- files: () => this.getFiles(),
83
+ files: (options) => this.getFiles(options),
44
84
  dispatch: (event) => {
45
85
  this.dispatch(event).catch(() => { });
46
86
  },
47
87
  };
48
- this.listeners_ = new Map();
49
88
  this.agentica_ = new core_1.MicroAgentica({
89
+ vendor,
50
90
  model: props.model,
51
- vendor: Object.assign(Object.assign({}, props.vendor), { semaphore: new tstl_1.Semaphore((_c = props.vendor.semaphore) !== null && _c !== void 0 ? _c : 16) }),
52
91
  config: Object.assign(Object.assign({}, ((_d = props.config) !== null && _d !== void 0 ? _d : {})), { executor: {
53
92
  describe: null,
54
93
  }, systemPrompt: {
@@ -90,24 +129,35 @@ class AutoBeAgent {
90
129
  }
91
130
  /** @internal */
92
131
  clone() {
93
- return new AutoBeAgent(Object.assign(Object.assign({}, this.props), { histories: this.histories_.slice() }));
94
- }
95
- on(type, listener) {
96
- (0, emplaceMap_1.emplaceMap)(this.listeners_, type, () => new Set()).add(listener);
97
- return this;
98
- }
99
- off(type, listener) {
100
- const set = this.listeners_.get(type);
101
- if (set === undefined)
102
- return this;
103
- set.delete(listener);
104
- if (set.size === 0)
105
- this.listeners_.delete(type);
106
- return this;
132
+ return new AutoBeAgent(Object.assign(Object.assign({}, this.props_), { histories: this.histories_.slice() }));
107
133
  }
108
134
  /* -----------------------------------------------------------
109
135
  ACCESSORS
110
136
  ----------------------------------------------------------- */
137
+ /**
138
+ * Engages in conversation with the agent to drive the vibe coding process.
139
+ *
140
+ * Accepts user input in multiple formats including simple text strings,
141
+ * single multimodal content items, or arrays of content supporting text,
142
+ * images, file uploads, and audio input. The conversation serves as the
143
+ * primary interface for expressing requirements, providing feedback, and
144
+ * guiding the development process through natural language interaction.
145
+ *
146
+ * The agent analyzes the conversation context to determine appropriate
147
+ * actions, potentially activating specialized agents (Analyze, Prisma,
148
+ * Interface, Test, Realize) through function calling based on user needs.
149
+ * Real-time progress events are fired through registered listeners while the
150
+ * conversation processes.
151
+ *
152
+ * Returns all history records generated during this conversation turn,
153
+ * including user messages, assistant responses, and any development
154
+ * activities triggered by the interaction. This enables clients to track both
155
+ * conversational flow and development progress.
156
+ *
157
+ * @param content User input as text, single content item, or multimodal array
158
+ * @returns Promise resolving to array of history records from this
159
+ * conversation
160
+ */
111
161
  conversate(content) {
112
162
  return __awaiter(this, void 0, void 0, function* () {
113
163
  const index = this.histories_.length;
@@ -132,62 +182,192 @@ class AutoBeAgent {
132
182
  return this.histories_.slice(index);
133
183
  });
134
184
  }
135
- getFiles() {
136
- var _a, _b, _c;
137
- const files = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, Object.fromEntries(this.state_.analyze
138
- ? Object.entries(this.state_.analyze.files).map(([key, value]) => [
139
- `docs/analysis/${key.split("/").at(-1)}`,
140
- value,
141
- ])
142
- : [])), Object.fromEntries(((_a = this.state_.prisma) === null || _a === void 0 ? void 0 : _a.result.success) === true
143
- ? [
144
- ...Object.entries(this.state_.prisma.schemas).map(([key, value]) => [
145
- `prisma/schema/${key.split("/").at(-1)}`,
185
+ /**
186
+ * Retrieves all generated files from the current development session.
187
+ *
188
+ * Transforms the complete conversation-driven development process into a
189
+ * comprehensive collection of deployable artifacts, including requirements
190
+ * documentation, database schemas, API specifications, NestJS implementation
191
+ * code, and test suites. The generated files represent a fully functional
192
+ * backend application ready for immediate deployment or further
193
+ * customization.
194
+ *
195
+ * The method produces a meticulously organized project structure that
196
+ * reflects professional software development standards. Requirements analysis
197
+ * documents capture and formalize your conversational input into structured
198
+ * technical specifications, providing clear traceability from user intent to
199
+ * final implementation. Database artifacts include Prisma schemas with
200
+ * precise type definitions, relationships, and constraints, along with
201
+ * migration files for proper database initialization and evolution.
202
+ *
203
+ * The API layer emerges through comprehensive OpenAPI specifications
204
+ * documenting every endpoint, request format, response structure, and error
205
+ * condition. Generated NestJS controllers, DTOs, and service classes
206
+ * implement these specifications with TypeScript's strong typing system
207
+ * providing compile-time safety. Quality assurance is embedded throughout
208
+ * with complete test suites covering both unit and end-to-end scenarios.
209
+ *
210
+ * The database configuration specified through the `dbms` option
211
+ * fundamentally shapes the entire generated codebase. PostgreSQL
212
+ * configuration produces production-ready code with robust connection pooling
213
+ * and enterprise-grade optimizations, while SQLite generates lightweight code
214
+ * perfect for local development and rapid prototyping without external
215
+ * dependencies.
216
+ *
217
+ * All artifacts maintain perfect consistency across the chosen database
218
+ * system, from Prisma configurations and connection strings to Docker compose
219
+ * files and environment templates. This deep integration ensures immediate
220
+ * deployment compatibility without manual configuration adjustments.
221
+ *
222
+ * @param options Configuration specifying the target database management
223
+ * system and other code generation preferences that influence the structure
224
+ * and characteristics of the generated project files
225
+ * @returns Promise resolving to key-value pairs mapping logical file paths to
226
+ * complete file contents for all generated development artifacts, ready for
227
+ * immediate file system operations, build integration, or deployment
228
+ * workflows
229
+ */
230
+ getFiles(options) {
231
+ return __awaiter(this, void 0, void 0, function* () {
232
+ var _a, _b;
233
+ const files = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, Object.fromEntries(this.state_.analyze
234
+ ? Object.entries(this.state_.analyze.files).map(([key, value]) => [
235
+ `docs/analysis/${key.split("/").at(-1)}`,
146
236
  value,
147
- ]),
148
- ...(this.state_.prisma.compiled.type === "success"
149
- ? [["docs/ERD.md", this.state_.prisma.compiled.document]]
150
- : []),
151
- ...(this.state_.prisma.compiled.type === "failure"
152
- ? [
153
- [
154
- "prisma/compile-error-reason.log",
155
- this.state_.prisma.compiled.reason,
156
- ],
157
- ]
158
- : []),
159
- [
160
- "autobe/prisma.json",
161
- JSON.stringify(this.state_.prisma.result.data, null, 2),
162
- ],
163
- ]
164
- : [])), (this.state_.interface ? this.state_.interface.files : {})), (((_b = this.state_.test) === null || _b === void 0 ? void 0 : _b.compiled.type) === "success"
165
- ? this.state_.test.files
166
- : {})), (((_c = this.state_.realize) === null || _c === void 0 ? void 0 : _c.compiled.type) === "success"
167
- ? this.state_.realize.files
168
- : {})), { "autobe/histories.json": JSON.stringify(this.histories_, null, 2), "autobe/tokenUsage.json": JSON.stringify(this.getTokenUsage(), null, 2) }), (this.state_.interface
169
- ? {
170
- "autobe/document.json": JSON.stringify(this.state_.interface.document, null, 2),
171
- }
172
- : {}));
173
- return Object.fromEntries(Object.entries(files).map(([k, v]) => [
174
- k.startsWith("/") ? k.substring(1) : k,
175
- v,
176
- ]));
237
+ ])
238
+ : [])), Object.fromEntries(!!((_a = this.state_.prisma) === null || _a === void 0 ? void 0 : _a.result)
239
+ ? [
240
+ ...Object.entries(((_b = options === null || options === void 0 ? void 0 : options.dbms) !== null && _b !== void 0 ? _b : "postgres") === "postgres"
241
+ ? this.state_.prisma.schemas
242
+ : yield this.context_.compiler.prisma.write(this.state_.prisma.result.data, options.dbms)).map(([key, value]) => [
243
+ `prisma/schema/${key.split("/").at(-1)}`,
244
+ value,
245
+ ]),
246
+ ...(this.state_.prisma.compiled.type === "success"
247
+ ? [["docs/ERD.md", this.state_.prisma.compiled.document]]
248
+ : []),
249
+ ...(this.state_.prisma.compiled.type === "failure"
250
+ ? [
251
+ [
252
+ "prisma/compile-error-reason.log",
253
+ this.state_.prisma.compiled.reason,
254
+ ],
255
+ ]
256
+ : []),
257
+ [
258
+ "autobe/prisma.json",
259
+ JSON.stringify(this.state_.prisma.result.data, null, 2),
260
+ ],
261
+ ]
262
+ : [])), (this.state_.interface ? this.state_.interface.files : {})), (this.state_.test ? this.state_.test.files : {})), (this.state_.realize ? this.state_.realize.files : {})), { "autobe/histories.json": JSON.stringify(this.histories_, null, 2), "autobe/tokenUsage.json": JSON.stringify(this.getTokenUsage(), null, 2) }), (this.state_.interface
263
+ ? {
264
+ "autobe/document.json": JSON.stringify(this.state_.interface.document, null, 2),
265
+ }
266
+ : {}));
267
+ return Object.fromEntries(Object.entries(files).map(([k, v]) => [
268
+ k.startsWith("/") ? k.substring(1) : k,
269
+ v,
270
+ ]));
271
+ });
177
272
  }
273
+ /**
274
+ * Retrieves the complete conversation and development history.
275
+ *
276
+ * Returns the chronologically ordered record of all events from the current
277
+ * session including user messages, assistant responses, development phase
278
+ * activities, progress events, and completion notifications. This
279
+ * comprehensive history enables conversation replay, development process
280
+ * analysis, and understanding of how requirements evolved into working
281
+ * software.
282
+ *
283
+ * The history provides complete transparency into the vibe coding process,
284
+ * showing both conversational interactions and behind-the-scenes development
285
+ * activities. This information is valuable for debugging, process
286
+ * improvement, and educational purposes to understand the agent's
287
+ * decision-making process.
288
+ *
289
+ * @returns Chronologically ordered array of all history records including
290
+ * messages, events, and development activities
291
+ */
178
292
  getHistories() {
179
293
  return this.histories_;
180
294
  }
295
+ /**
296
+ * Retrieves comprehensive AI token usage statistics for the current session.
297
+ *
298
+ * Returns detailed breakdown of token consumption across all specialized
299
+ * agents and processing phases, enabling cost monitoring, performance
300
+ * analysis, and optimization of AI resource utilization. Statistics include
301
+ * aggregate totals and component-specific breakdowns with input/output
302
+ * categorization, caching analysis, and reasoning token tracking.
303
+ *
304
+ * Token usage data is essential for understanding the computational costs of
305
+ * different development phases and optimizing AI efficiency. The breakdown
306
+ * helps identify which agents or operations consume the most resources,
307
+ * enabling targeted optimization efforts while maintaining development
308
+ * quality.
309
+ *
310
+ * @returns Comprehensive token usage statistics with detailed breakdowns by
311
+ * agent, operation type, and consumption category
312
+ */
181
313
  getTokenUsage() {
182
314
  return this.agentica_.getTokenUsage();
183
315
  }
184
- /* -----------------------------------------------------------
185
- CONTEXTS
186
- ----------------------------------------------------------- */
187
316
  /** @internal */
188
317
  getContext() {
189
318
  return this.context_;
190
319
  }
320
+ /* -----------------------------------------------------------
321
+ EVENT HANDLERS
322
+ ----------------------------------------------------------- */
323
+ /**
324
+ * Registers an event listener for specific development phase events.
325
+ *
326
+ * Enables client applications to receive real-time notifications about
327
+ * conversation flow, development progress, and completion events throughout
328
+ * the vibe coding pipeline. Event listeners provide visibility into agent
329
+ * activities and enable responsive user interfaces that can display progress,
330
+ * handle artifacts, and provide feedback.
331
+ *
332
+ * The type-safe event system ensures that listeners receive properly typed
333
+ * events corresponding to their registration type, enabling robust event
334
+ * handling without runtime type issues. Multiple listeners can be registered
335
+ * for the same event type to support complex notification requirements.
336
+ *
337
+ * @param type Event type to listen for (e.g., "analyzeComplete",
338
+ * "prismaStart")
339
+ * @param listener Callback function that receives the typed event when fired
340
+ * @returns The agent instance for method chaining
341
+ */
342
+ on(type, listener) {
343
+ (0, emplaceMap_1.emplaceMap)(this.listeners_, type, () => new Set()).add(listener);
344
+ return this;
345
+ }
346
+ /**
347
+ * Unregisters a previously registered event listener.
348
+ *
349
+ * Removes the specified event listener from the agent's notification system,
350
+ * stopping further event notifications for that particular listener function.
351
+ * This is useful for cleanup, dynamic listener management, or when components
352
+ * no longer need to receive specific event notifications.
353
+ *
354
+ * The listener function reference must exactly match the function that was
355
+ * originally registered with {@link on} for successful removal. If no matching
356
+ * listener is found, the operation has no effect.
357
+ *
358
+ * @param type Event type the listener was registered for
359
+ * @param listener The exact listener function reference to remove
360
+ * @returns The agent instance for method chaining
361
+ */
362
+ off(type, listener) {
363
+ const set = this.listeners_.get(type);
364
+ if (set === undefined)
365
+ return this;
366
+ set.delete(listener);
367
+ if (set.size === 0)
368
+ this.listeners_.delete(type);
369
+ return this;
370
+ }
191
371
  /** @internal */
192
372
  dispatch(event) {
193
373
  return __awaiter(this, void 0, void 0, function* () {
@@ -1 +1 @@
1
- {"version":3,"file":"AutoBeAgent.js","sourceRoot":"","sources":["../src/AutoBeAgent.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA+C;AAS/C,+BAAiC;AACjC,+BAA0B;AAK1B,2EAAwE;AACxE,+EAA2E;AAC3E,mEAAgE;AAChE,kGAA+F;AAE/F,mDAAgD;AAEhD,MAAa,WAAW;IAWtB;;kEAE8D;IAC9D;;;;OAIG;IACH,YAAoC,KAA0B;;QAA1B,UAAK,GAAL,KAAK,CAAqB;QAC5D,IAAI,CAAC,UAAU,GAAG,MAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,KAAK,EAAE,mCAAI,EAAE,CAAC;QACjD,IAAI,CAAC,MAAM,GAAG,IAAA,qCAAiB,EAAC,IAAI,CAAC,UAAU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