@autobe/agent 0.11.2 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutoBeAgent.d.ts +3 -146
- package/lib/AutoBeAgent.js +6 -180
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/AutoBeAgentBase.d.ts +18 -0
- package/lib/AutoBeAgentBase.js +54 -0
- package/lib/AutoBeAgentBase.js.map +1 -0
- package/lib/AutoBeMockAgent.d.ts +14 -0
- package/lib/AutoBeMockAgent.js +135 -0
- package/lib/AutoBeMockAgent.js.map +1 -0
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +8 -4
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/factory/getAutoBeGenerated.d.ts +3 -4
- package/lib/factory/getAutoBeGenerated.js +6 -250
- package/lib/factory/getAutoBeGenerated.js.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +883 -399
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +6 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.d.ts +4 -1
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js +6 -2
- package/lib/orchestrate/analyze/writeDocumentUntilReviewPassed.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.js +11 -2
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js +46 -15
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeDecorator.d.ts +10 -0
- package/lib/orchestrate/realize/orchestrateRealizeDecorator.js +545 -0
- package/lib/orchestrate/realize/orchestrateRealizeDecorator.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +12 -9
- package/lib/orchestrate/realize/structures/IAutoBeRealizeDecoratorApplication.d.ts +85 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeDecoratorApplication.js +3 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeDecoratorApplication.js.map +1 -0
- package/lib/orchestrate/realize/transformRealizeCoderHistories.d.ts +1 -1
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js +24 -30
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js.map +1 -1
- package/lib/orchestrate/realize/transformRealizeDecorator.d.ts +4 -0
- package/lib/orchestrate/realize/transformRealizeDecorator.js +32 -0
- package/lib/orchestrate/realize/transformRealizeDecorator.js.map +1 -0
- package/lib/orchestrate/realize/transformRealizeDecoratorCorrectHistories.d.ts +6 -0
- package/lib/orchestrate/realize/transformRealizeDecoratorCorrectHistories.js +49 -0
- package/lib/orchestrate/realize/transformRealizeDecoratorCorrectHistories.js.map +1 -0
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js +30 -11
- package/lib/orchestrate/realize/writeCodeUntilCompilePassed.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +2 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/utils/backoffRetry.d.ts +18 -0
- package/lib/utils/backoffRetry.js +38 -0
- package/lib/utils/backoffRetry.js.map +1 -1
- package/package.json +8 -8
- package/src/AutoBeAgent.ts +10 -203
- package/src/AutoBeAgentBase.ts +78 -0
- package/src/AutoBeMockAgent.ts +163 -0
- package/src/constants/AutoBeSystemPromptConstant.ts +8 -4
- package/src/factory/getAutoBeGenerated.ts +8 -13
- package/src/index.ts +3 -1
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +7 -1
- package/src/orchestrate/analyze/writeDocumentUntilReviewPassed.ts +8 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +11 -0
- package/src/orchestrate/realize/orchestrateRealizeCoder.ts +26 -4
- package/src/orchestrate/realize/orchestrateRealizeDecorator.ts +286 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +12 -9
- package/src/orchestrate/realize/structures/IAutoBeRealizeDecoratorApplication.ts +94 -0
- package/src/orchestrate/realize/transformRealizeCoderHistories.ts +22 -29
- package/src/orchestrate/realize/transformRealizeDecorator.ts +37 -0
- package/src/orchestrate/realize/transformRealizeDecoratorCorrectHistories.ts +58 -0
- package/src/orchestrate/realize/writeCodeUntilCompilePassed.ts +34 -9
- package/src/orchestrate/test/orchestrateTest.ts +1 -0
- package/src/orchestrate/test/orchestrateTestCorrect.ts +1 -1
- package/src/utils/backoffRetry.ts +56 -0
|
@@ -50,6 +50,7 @@ const __typia_transform__validateReport = __importStar(require("typia/lib/intern
|
|
|
50
50
|
const core_1 = require("@agentica/core");
|
|
51
51
|
const typia_1 = __importDefault(require("typia"));
|
|
52
52
|
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
53
|
+
const backoffRetry_1 = require("../../utils/backoffRetry");
|
|
53
54
|
const enforceToolCall_1 = require("../../utils/enforceToolCall");
|
|
54
55
|
const getTestScenarioArtifacts_1 = require("../test/compile/getTestScenarioArtifacts");
|
|
55
56
|
const IAutoBeRealizeFailedSymbol_1 = require("./structures/IAutoBeRealizeFailedSymbol");
|
|
@@ -73,6 +74,7 @@ const transformRealizeCoderHistories_1 = require("./transformRealizeCoderHistori
|
|
|
73
74
|
* @returns The generated function name and TypeScript code
|
|
74
75
|
*/
|
|
75
76
|
const orchestrateRealizeCoder = (ctx, operation, props, previous, total, diagnostics) => __awaiter(void 0, void 0, void 0, function* () {
|
|
77
|
+
total;
|
|
76
78
|
const artifacts = yield (0, getTestScenarioArtifacts_1.getTestScenarioArtifacts)(ctx, {
|
|
77
79
|
endpoint: {
|
|
78
80
|
method: operation.method,
|
|
@@ -93,15 +95,28 @@ const orchestrateRealizeCoder = (ctx, operation, props, previous, total, diagnos
|
|
|
93
95
|
controllers: [controller],
|
|
94
96
|
model: ctx.model,
|
|
95
97
|
vendor: ctx.vendor,
|
|
96
|
-
config: Object.assign(Object.assign({}, ctx.config), { executor: {
|
|
98
|
+
config: Object.assign(Object.assign({}, ctx.config), { backoffStrategy: backoffRetry_1.randomBackoffStrategy, executor: {
|
|
97
99
|
describe: null,
|
|
98
100
|
} }),
|
|
99
|
-
histories: (0, transformRealizeCoderHistories_1.transformRealizeCoderHistories)(ctx.state(), props, artifacts, previous,
|
|
101
|
+
histories: (0, transformRealizeCoderHistories_1.transformRealizeCoderHistories)(ctx.state(), props, artifacts, previous, diagnostics),
|
|
100
102
|
});
|
|
101
103
|
(0, enforceToolCall_1.enforceToolCall)(agent);
|
|
102
|
-
yield agent.conversate(
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
yield (0, backoffRetry_1.randomBackoffRetry)(() => agent.conversate([
|
|
105
|
+
`Write complete, production-ready TypeScript code that strictly follows these rules:`,
|
|
106
|
+
"",
|
|
107
|
+
`1. Do **not** use the native \`Date\` type anywhere.`,
|
|
108
|
+
`2. All date or datetime values must be written as \`string & tags.Format<'date-time'>\`.`,
|
|
109
|
+
`3. UUIDs must be generated using \`v4()\` and typed as \`string & tags.Format<'uuid'>\`.`,
|
|
110
|
+
`4. Do not use \`as\` for type assertions — resolve types properly.`,
|
|
111
|
+
`5. All functions must be fully typed with clear parameter and return types.`,
|
|
112
|
+
`6. Do not skip validations or default values where necessary.`,
|
|
113
|
+
`7. Follow functional, immutable, and consistent code structure.`,
|
|
114
|
+
"",
|
|
115
|
+
`Use \`@nestia/e2e\` test structure if relevant.`,
|
|
116
|
+
].join("\n"))).finally(() => {
|
|
117
|
+
const tokenUsage = agent.getTokenUsage();
|
|
118
|
+
ctx.usage().record(tokenUsage, ["realize"]);
|
|
119
|
+
});
|
|
105
120
|
if (pointer.value === null) {
|
|
106
121
|
return IAutoBeRealizeFailedSymbol_1.FAILED;
|
|
107
122
|
}
|
|
@@ -178,11 +193,14 @@ const claude = {
|
|
|
178
193
|
type: "object",
|
|
179
194
|
properties: {
|
|
180
195
|
filename: {
|
|
181
|
-
description: "The name of the file to be generated (e.g., \"user.create.ts\")",
|
|
182
196
|
type: "string"
|
|
183
197
|
},
|
|
184
198
|
plan: {
|
|
185
|
-
description: "\uD83E\uDDE0 Provider Function Implementation Plan\n\nThis field outlines the strategic plan for implementing the provider\nfunction according to the Realize Coder Agent specification. Before\nwriting the actual code, think through the logic and structure.\n\nThe plan must consider:\n\n- \uD83E\uDDE9 Required business entities (e.g., users, posts, logs) and their\n relationships\n- \uD83D\uDEE0 Operations needed to fulfill the business scenario (e.g., fetch,\n create, update)\n- \uD83D\uDD04 Data dependencies between steps (e.g., use userId to fetch related\n data)\n- \u2705 Validation points (based on business rules, not field presence)\n- \uD83D\uDEA7 Error and edge cases that must be handled explicitly (e.g., missing\n records)\n- \uD83C\uDFD7 Structure: always a single `async function`, using only `parameters`\n and `body`\n\n\u26A0\uFE0F Important Constraints:\n\n- Do NOT perform input validation \u2014 assume `parameters` and `body` are\n already valid\n- Use `typia.random<T>()` with an explanatory comment if logic can't be\n implemented\n- Never use `any` or make assumptions without sufficient context\n- Use only allowed imports \u2014 DTOs and Prisma types\n- Use `MyGlobal.prisma` for DB access and respect Prisma typing rules\n\n\u26A0\uFE0F TypeScript-specific considerations:\n\n- Do **not** use native `Date` objects directly; convert all dates
|
|
199
|
+
description: "\uD83E\uDDE0 Provider Function Implementation Plan\n\nThis field outlines the strategic plan for implementing the provider\nfunction according to the Realize Coder Agent specification. Before\nwriting the actual code, think through the logic and structure.\n\nThe plan must consider:\n\n- \uD83E\uDDE9 Required business entities (e.g., users, posts, logs) and their\n relationships\n- \uD83D\uDEE0 Operations needed to fulfill the business scenario (e.g., fetch,\n create, update)\n- \uD83D\uDD04 Data dependencies between steps (e.g., use userId to fetch related\n data)\n- \u2705 Validation points (based on business rules, not field presence)\n- \uD83D\uDEA7 Error and edge cases that must be handled explicitly (e.g., missing\n records)\n- \uD83C\uDFD7 Structure: always a single `async function`, using only `parameters`\n and `body`\n\n\u26A0\uFE0F Important Constraints:\n\n- Do NOT perform input validation \u2014 assume `parameters` and `body` are\n already valid\n- Use `typia.random<T>()` with an explanatory comment if logic can't be\n implemented\n- Never use `any` or make assumptions without sufficient context\n- Use only allowed imports \u2014 DTOs and Prisma types\n- Use `MyGlobal.prisma` for DB access and respect Prisma typing rules\n\n\u26A0\uFE0F TypeScript-specific considerations:\n\n- Do **not** use native `Date` objects directly; always convert all dates\n to ISO strings with `.toISOString()` and brand as `string &\n tags.Format<'date-time'>`. This rule applies throughout all phases.\n- Prefer `satisfies` for DTO conformance instead of unsafe `as` casts\n- Avoid weak typing such as `any`, `as any`, or `satisfies any`\n- Use branded types (e.g., `tags.Format<'uuid'>`) and literal unions where\n applicable\n\n\u2705 Example Structure:\n\n```ts\nexport async function doSomething(\n user: { id: string & tags.Format<\"uuid\">; type: string },\n parameters: IParams,\n body: IBody\n): Promise<IReturn> {\n const { id } = parameters;\n const { name } = body;\n const user = await MyGlobal.prisma.users.findFirst({ where: { id } });\n if (!user) throw new Error(\"User not found\");\n ...\n return result;\n}\n```\n\n\uD83D\uDD25 Error Handling Plan:\n\nIf an error is expected or encountered during implementation:\n\n- Clearly document the error message(s) and TypeScript error codes.\n- Analyze the root cause (e.g., type mismatch, missing field, nullability\n issue).\n- Define concrete steps to resolve the issue, such as:\n\n - Adjusting type declarations or using Prisma-generated input types.\n - Using `?? undefined` to normalize nullable fields.\n - Applying correct relation handling (e.g., `connect` instead of direct\n foreign key assignment).\n - Ensuring all date fields use `.toISOString()` and proper branding.\n- Include fallback or workaround plans if a direct fix is complex.\n- If no error is present, simply omit this section.\n\nThis plan ensures the function will:\n\n- Respect the global architecture and coding conventions\n- Be safe, predictable, and aligned with upstream logic",
|
|
200
|
+
type: "string"
|
|
201
|
+
},
|
|
202
|
+
draft_without_date_type: {
|
|
203
|
+
description: "\u270F\uFE0F Phase 1: Draft code\n\nThis is the initial drafting phase where you outline the basic skeleton\nof the function.\n\n- The function signature must correctly include `user`, `parameters`, and\n `body` arguments.\n- Design the main flow of business logic, such as DB fetches and early\n returns based on conditions.\n- Mark any incomplete or missing parts clearly with placeholders (e.g.,\n comments or temporary values).\n\n\u26A0\uFE0F Import rules:\n\n- Do NOT add any new import statements manually.\n- All necessary imports are provided globally or by the system\n automatically.\n- Writing import statements directly is prohibited and may cause compile\n errors. If import errors occur, check your environment configuration.\n\n\u2705 Requirements:\n\n- Avoid using the `any` type at all costs to ensure type safety.\n- Do NOT assign native `Date` objects directly; always convert dates using\n `.toISOString()` before assignment and apply proper branding.\n- Maintain a single-function structure; avoid using classes.",
|
|
186
204
|
type: "string"
|
|
187
205
|
},
|
|
188
206
|
review: {
|
|
@@ -190,24 +208,25 @@ const claude = {
|
|
|
190
208
|
type: "string"
|
|
191
209
|
},
|
|
192
210
|
withCompilerFeedback: {
|
|
193
|
-
description: "\uD83D\uDEE0 Phase 3: With compiler feedback (optional)\n\nA correction pass that applies fixes for compile-time errors that arose\nduring the review stage (if any).\n\n\u2705 Must:\n\n- Resolve all TypeScript errors without using `as any
|
|
211
|
+
description: "\uD83D\uDEE0 Phase 3: With compiler feedback (optional)\n\nA correction pass that applies fixes for compile-time errors that arose\nduring the review stage (if any).\n\n\u2705 Must:\n\n- Only include this field if TypeScript errors are detected in the Review\n phase.\n- Resolve all TypeScript errors without using `as any`.\n- Provide safe brand casting only if required (e.g., `as string &\n tags.Format<'uuid'>`).",
|
|
194
212
|
type: "string"
|
|
195
213
|
},
|
|
196
214
|
implementationCode: {
|
|
197
|
-
description: "\u2705 Phase 4: Final implementation\n\nThe complete and fully correct TypeScript function implementation.\n\n- Passes strict type checking without errors.\n- Uses only safe branding or literal type assertions.\n- Converts all
|
|
215
|
+
description: "\u2705 Phase 4: Final implementation\n\nThe complete and fully correct TypeScript function implementation.\n\n- Passes strict type checking without errors.\n- Uses only safe branding or literal type assertions.\n- Converts all date values properly to ISO string format.\n- Follows DTO structures using `satisfies`.\n- Avoids any weak typing such as `any`, `as any`, or `satisfies any`.\n- Uses only allowed imports (e.g., from `src/api/structures` and\n `MyGlobal.prisma`).\n\n\u26A0\uFE0F Prohibited Practices:\n\n- Do NOT add or modify import statements manually. Imports are handled\n automatically by the system.\n- Do NOT use `any`, `as any`, or `satisfies any` to bypass type checking.\n- Do NOT assign native `Date` objects directly; always convert them to ISO\n strings with `.toISOString()`.\n- Do NOT use unsafe type assertions except for safe branding or literal\n narrowing.\n- Do NOT write code outside the single async function structure (e.g., no\n classes or multiple functions).\n- Do NOT perform any input validation \u2014 assume all inputs are already\n validated.\n- Do NOT use dynamic import expressions (`import()`); all imports must be\n static.\n- Do NOT rely on DTO types for database update input; always use\n Prisma-generated input types.",
|
|
198
216
|
type: "string"
|
|
199
217
|
}
|
|
200
218
|
},
|
|
201
219
|
required: [
|
|
202
220
|
"filename",
|
|
203
221
|
"plan",
|
|
222
|
+
"draft_without_date_type",
|
|
204
223
|
"review",
|
|
205
224
|
"implementationCode"
|
|
206
225
|
]
|
|
207
226
|
}
|
|
208
227
|
}
|
|
209
228
|
},
|
|
210
|
-
validate: (() => { const _io0 = input => "object" === typeof input.output && null !== input.output && _io1(input.output); const _io1 = input => "string" === typeof input.filename && "string" === typeof input.plan && "string" === typeof input.review && (undefined === input.withCompilerFeedback || "string" === typeof input.withCompilerFeedback) && "string" === typeof input.implementationCode; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.output && null !== input.output || _report(_exceptionable, {
|
|
229
|
+
validate: (() => { const _io0 = input => "object" === typeof input.output && null !== input.output && _io1(input.output); const _io1 = input => "string" === typeof input.filename && "string" === typeof input.plan && "string" === typeof input.draft_without_date_type && "string" === typeof input.review && (undefined === input.withCompilerFeedback || "string" === typeof input.withCompilerFeedback) && "string" === typeof input.implementationCode; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.output && null !== input.output || _report(_exceptionable, {
|
|
211
230
|
path: _path + ".output",
|
|
212
231
|
expected: "IAutoBeRealizeCoderApplication.RealizeCoderOutput",
|
|
213
232
|
value: input.output
|
|
@@ -223,6 +242,10 @@ const claude = {
|
|
|
223
242
|
path: _path + ".plan",
|
|
224
243
|
expected: "string",
|
|
225
244
|
value: input.plan
|
|
245
|
+
}), "string" === typeof input.draft_without_date_type || _report(_exceptionable, {
|
|
246
|
+
path: _path + ".draft_without_date_type",
|
|
247
|
+
expected: "string",
|
|
248
|
+
value: input.draft_without_date_type
|
|
226
249
|
}), "string" === typeof input.review || _report(_exceptionable, {
|
|
227
250
|
path: _path + ".review",
|
|
228
251
|
expected: "string",
|
|
@@ -295,11 +318,14 @@ const collection = {
|
|
|
295
318
|
type: "object",
|
|
296
319
|
properties: {
|
|
297
320
|
filename: {
|
|
298
|
-
description: "The name of the file to be generated (e.g., \"user.create.ts\")",
|
|
299
321
|
type: "string"
|
|
300
322
|
},
|
|
301
323
|
plan: {
|
|
302
|
-
description: "\uD83E\uDDE0 Provider Function Implementation Plan\n\nThis field outlines the strategic plan for implementing the provider\nfunction according to the Realize Coder Agent specification. Before\nwriting the actual code, think through the logic and structure.\n\nThe plan must consider:\n\n- \uD83E\uDDE9 Required business entities (e.g., users, posts, logs) and their\n relationships\n- \uD83D\uDEE0 Operations needed to fulfill the business scenario (e.g., fetch,\n create, update)\n- \uD83D\uDD04 Data dependencies between steps (e.g., use userId to fetch related\n data)\n- \u2705 Validation points (based on business rules, not field presence)\n- \uD83D\uDEA7 Error and edge cases that must be handled explicitly (e.g., missing\n records)\n- \uD83C\uDFD7 Structure: always a single `async function`, using only `parameters`\n and `body`\n\n\u26A0\uFE0F Important Constraints:\n\n- Do NOT perform input validation \u2014 assume `parameters` and `body` are\n already valid\n- Use `typia.random<T>()` with an explanatory comment if logic can't be\n implemented\n- Never use `any` or make assumptions without sufficient context\n- Use only allowed imports \u2014 DTOs and Prisma types\n- Use `MyGlobal.prisma` for DB access and respect Prisma typing rules\n\n\u26A0\uFE0F TypeScript-specific considerations:\n\n- Do **not** use native `Date` objects directly; convert all dates
|
|
324
|
+
description: "\uD83E\uDDE0 Provider Function Implementation Plan\n\nThis field outlines the strategic plan for implementing the provider\nfunction according to the Realize Coder Agent specification. Before\nwriting the actual code, think through the logic and structure.\n\nThe plan must consider:\n\n- \uD83E\uDDE9 Required business entities (e.g., users, posts, logs) and their\n relationships\n- \uD83D\uDEE0 Operations needed to fulfill the business scenario (e.g., fetch,\n create, update)\n- \uD83D\uDD04 Data dependencies between steps (e.g., use userId to fetch related\n data)\n- \u2705 Validation points (based on business rules, not field presence)\n- \uD83D\uDEA7 Error and edge cases that must be handled explicitly (e.g., missing\n records)\n- \uD83C\uDFD7 Structure: always a single `async function`, using only `parameters`\n and `body`\n\n\u26A0\uFE0F Important Constraints:\n\n- Do NOT perform input validation \u2014 assume `parameters` and `body` are\n already valid\n- Use `typia.random<T>()` with an explanatory comment if logic can't be\n implemented\n- Never use `any` or make assumptions without sufficient context\n- Use only allowed imports \u2014 DTOs and Prisma types\n- Use `MyGlobal.prisma` for DB access and respect Prisma typing rules\n\n\u26A0\uFE0F TypeScript-specific considerations:\n\n- Do **not** use native `Date` objects directly; always convert all dates\n to ISO strings with `.toISOString()` and brand as `string &\n tags.Format<'date-time'>`. This rule applies throughout all phases.\n- Prefer `satisfies` for DTO conformance instead of unsafe `as` casts\n- Avoid weak typing such as `any`, `as any`, or `satisfies any`\n- Use branded types (e.g., `tags.Format<'uuid'>`) and literal unions where\n applicable\n\n\u2705 Example Structure:\n\n```ts\nexport async function doSomething(\n user: { id: string & tags.Format<\"uuid\">; type: string },\n parameters: IParams,\n body: IBody\n): Promise<IReturn> {\n const { id } = parameters;\n const { name } = body;\n const user = await MyGlobal.prisma.users.findFirst({ where: { id } });\n if (!user) throw new Error(\"User not found\");\n ...\n return result;\n}\n```\n\n\uD83D\uDD25 Error Handling Plan:\n\nIf an error is expected or encountered during implementation:\n\n- Clearly document the error message(s) and TypeScript error codes.\n- Analyze the root cause (e.g., type mismatch, missing field, nullability\n issue).\n- Define concrete steps to resolve the issue, such as:\n\n - Adjusting type declarations or using Prisma-generated input types.\n - Using `?? undefined` to normalize nullable fields.\n - Applying correct relation handling (e.g., `connect` instead of direct\n foreign key assignment).\n - Ensuring all date fields use `.toISOString()` and proper branding.\n- Include fallback or workaround plans if a direct fix is complex.\n- If no error is present, simply omit this section.\n\nThis plan ensures the function will:\n\n- Respect the global architecture and coding conventions\n- Be safe, predictable, and aligned with upstream logic",
|
|
325
|
+
type: "string"
|
|
326
|
+
},
|
|
327
|
+
draft_without_date_type: {
|
|
328
|
+
description: "\u270F\uFE0F Phase 1: Draft code\n\nThis is the initial drafting phase where you outline the basic skeleton\nof the function.\n\n- The function signature must correctly include `user`, `parameters`, and\n `body` arguments.\n- Design the main flow of business logic, such as DB fetches and early\n returns based on conditions.\n- Mark any incomplete or missing parts clearly with placeholders (e.g.,\n comments or temporary values).\n\n\u26A0\uFE0F Import rules:\n\n- Do NOT add any new import statements manually.\n- All necessary imports are provided globally or by the system\n automatically.\n- Writing import statements directly is prohibited and may cause compile\n errors. If import errors occur, check your environment configuration.\n\n\u2705 Requirements:\n\n- Avoid using the `any` type at all costs to ensure type safety.\n- Do NOT assign native `Date` objects directly; always convert dates using\n `.toISOString()` before assignment and apply proper branding.\n- Maintain a single-function structure; avoid using classes.",
|
|
303
329
|
type: "string"
|
|
304
330
|
},
|
|
305
331
|
review: {
|
|
@@ -307,24 +333,25 @@ const collection = {
|
|
|
307
333
|
type: "string"
|
|
308
334
|
},
|
|
309
335
|
withCompilerFeedback: {
|
|
310
|
-
description: "\uD83D\uDEE0 Phase 3: With compiler feedback (optional)\n\nA correction pass that applies fixes for compile-time errors that arose\nduring the review stage (if any).\n\n\u2705 Must:\n\n- Resolve all TypeScript errors without using `as any
|
|
336
|
+
description: "\uD83D\uDEE0 Phase 3: With compiler feedback (optional)\n\nA correction pass that applies fixes for compile-time errors that arose\nduring the review stage (if any).\n\n\u2705 Must:\n\n- Only include this field if TypeScript errors are detected in the Review\n phase.\n- Resolve all TypeScript errors without using `as any`.\n- Provide safe brand casting only if required (e.g., `as string &\n tags.Format<'uuid'>`).",
|
|
311
337
|
type: "string"
|
|
312
338
|
},
|
|
313
339
|
implementationCode: {
|
|
314
|
-
description: "\u2705 Phase 4: Final implementation\n\nThe complete and fully correct TypeScript function implementation.\n\n- Passes strict type checking without errors.\n- Uses only safe branding or literal type assertions.\n- Converts all
|
|
340
|
+
description: "\u2705 Phase 4: Final implementation\n\nThe complete and fully correct TypeScript function implementation.\n\n- Passes strict type checking without errors.\n- Uses only safe branding or literal type assertions.\n- Converts all date values properly to ISO string format.\n- Follows DTO structures using `satisfies`.\n- Avoids any weak typing such as `any`, `as any`, or `satisfies any`.\n- Uses only allowed imports (e.g., from `src/api/structures` and\n `MyGlobal.prisma`).\n\n\u26A0\uFE0F Prohibited Practices:\n\n- Do NOT add or modify import statements manually. Imports are handled\n automatically by the system.\n- Do NOT use `any`, `as any`, or `satisfies any` to bypass type checking.\n- Do NOT assign native `Date` objects directly; always convert them to ISO\n strings with `.toISOString()`.\n- Do NOT use unsafe type assertions except for safe branding or literal\n narrowing.\n- Do NOT write code outside the single async function structure (e.g., no\n classes or multiple functions).\n- Do NOT perform any input validation \u2014 assume all inputs are already\n validated.\n- Do NOT use dynamic import expressions (`import()`); all imports must be\n static.\n- Do NOT rely on DTO types for database update input; always use\n Prisma-generated input types.",
|
|
315
341
|
type: "string"
|
|
316
342
|
}
|
|
317
343
|
},
|
|
318
344
|
required: [
|
|
319
345
|
"filename",
|
|
320
346
|
"plan",
|
|
347
|
+
"draft_without_date_type",
|
|
321
348
|
"review",
|
|
322
349
|
"implementationCode"
|
|
323
350
|
]
|
|
324
351
|
}
|
|
325
352
|
}
|
|
326
353
|
},
|
|
327
|
-
validate: (() => { const _io0 = input => "object" === typeof input.output && null !== input.output && _io1(input.output); const _io1 = input => "string" === typeof input.filename && "string" === typeof input.plan && "string" === typeof input.review && (undefined === input.withCompilerFeedback || "string" === typeof input.withCompilerFeedback) && "string" === typeof input.implementationCode; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.output && null !== input.output || _report(_exceptionable, {
|
|
354
|
+
validate: (() => { const _io0 = input => "object" === typeof input.output && null !== input.output && _io1(input.output); const _io1 = input => "string" === typeof input.filename && "string" === typeof input.plan && "string" === typeof input.draft_without_date_type && "string" === typeof input.review && (undefined === input.withCompilerFeedback || "string" === typeof input.withCompilerFeedback) && "string" === typeof input.implementationCode; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.output && null !== input.output || _report(_exceptionable, {
|
|
328
355
|
path: _path + ".output",
|
|
329
356
|
expected: "IAutoBeRealizeCoderApplication.RealizeCoderOutput",
|
|
330
357
|
value: input.output
|
|
@@ -340,6 +367,10 @@ const collection = {
|
|
|
340
367
|
path: _path + ".plan",
|
|
341
368
|
expected: "string",
|
|
342
369
|
value: input.plan
|
|
370
|
+
}), "string" === typeof input.draft_without_date_type || _report(_exceptionable, {
|
|
371
|
+
path: _path + ".draft_without_date_type",
|
|
372
|
+
expected: "string",
|
|
373
|
+
value: input.draft_without_date_type
|
|
343
374
|
}), "string" === typeof input.review || _report(_exceptionable, {
|
|
344
375
|
path: _path + ".review",
|
|
345
376
|
expected: "string",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateRealizeCoder.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeCoder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoE;AAQpE,kDAA0B;AAG1B,uEAAoE;AACpE,iEAA8D;AAC9D,uFAAoF;AAIpF,wFAAiE;AACjE,qFAAkF;AAElF;;;;;;;;;;;;;;;;;GAiBG;AACI,MAAM,uBAAuB,GAAG,CACrC,GAAyB,EACzB,SAAmC,EACnC,KAA2B,EAC3B,QAAuB,EACvB,KAAmD,EACnD,WAAyD,EAOzD,EAAE;IACF,MAAM,SAAS,GACb,MAAM,IAAA,mDAAwB,EAAC,GAAG,EAAE;QAClC,QAAQ,EAAE;YACR,MAAM,EAAE,SAAS,CAAC,MAAM;YACxB,IAAI,EAAE,SAAS,CAAC,IAAI;SACrB;QACD,YAAY,EAAE,EAAE;KACjB,CAAC,CAAC;IAEL,MAAM,OAAO,GAGD;QACV,KAAK,EAAE,IAAI;KACZ,CAAC;IAEF,MAAM,UAAU,GAAG,iBAAiB,CAAC;QACnC,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;YACf,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;QAC/B,CAAC;KACF,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,IAAI,oBAAa,CAAC;QAC9B,WAAW,EAAE,CAAC,UAAU,CAAC;QACzB,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,MAAM,kCACD,GAAG,CAAC,MAAM,KACb,QAAQ,EAAE;gBACR,QAAQ,EAAE,IAAI;aACf,GACF;QACD,SAAS,EAAE,IAAA,+DAA8B,EACvC,GAAG,CAAC,KAAK,EAAE,EACX,KAAK,EACL,SAAS,EACT,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"orchestrateRealizeCoder.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeCoder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoE;AAQpE,kDAA0B;AAG1B,uEAAoE;AACpE,2DAGkC;AAClC,iEAA8D;AAC9D,uFAAoF;AAIpF,wFAAiE;AACjE,qFAAkF;AAElF;;;;;;;;;;;;;;;;;GAiBG;AACI,MAAM,uBAAuB,GAAG,CACrC,GAAyB,EACzB,SAAmC,EACnC,KAA2B,EAC3B,QAAuB,EACvB,KAAmD,EACnD,WAAyD,EAOzD,EAAE;IACF,KAAK,CAAC;IACN,MAAM,SAAS,GACb,MAAM,IAAA,mDAAwB,EAAC,GAAG,EAAE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AAC;QACd,CAAC;KAAA,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAiC,KAG1D;IACC,IAAA,qCAAiB,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAE/B,MAAM,WAAW,GAA2B,UAAU,CACpD,KAAK,CAAC,KAAK,CACyB,CAAC;IAEvC,OAAO;QACL,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,YAAY;QAClB,WAAW;QACX,OAAO,EAAE;YACP,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE;gBACpB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;SACuC;KAC3C,CAAC;AACJ,CAAC;AAED,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMT,CAAC;AACJ,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;CACd,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
3
|
+
import { IAutoBeRealizeDecoratorApplication } from "./structures/IAutoBeRealizeDecoratorApplication";
|
|
4
|
+
/**
|
|
5
|
+
* 1. Create decorator and its parameters. and design the Authorization Provider.
|
|
6
|
+
* 2. According to Authorization Provider design, create the Provider.
|
|
7
|
+
*
|
|
8
|
+
* @param ctx
|
|
9
|
+
*/
|
|
10
|
+
export declare function orchestrateRealizeDecorator<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>): Promise<IAutoBeRealizeDecoratorApplication.IProps[]>;
|