@autobe/agent 0.23.1 → 0.24.1
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/constants/AutoBeSystemPromptConstant.d.ts +30 -29
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/factory/consentFunctionCall.js +1 -1
- package/lib/factory/consentFunctionCall.js.map +1 -1
- package/lib/factory/createAutoBeContext.js +3 -3
- package/lib/factory/createAutoBeContext.js.map +1 -1
- package/lib/index.mjs +683 -260
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +2 -2
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js +1 -1
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js.map +1 -1
- package/lib/orchestrate/common/histories/transformCommonCorrectDateHistories.d.ts +9 -0
- package/lib/orchestrate/common/histories/transformCommonCorrectDateHistories.js +48 -0
- package/lib/orchestrate/common/histories/transformCommonCorrectDateHistories.js.map +1 -0
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.d.ts +35 -0
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.js +3 -0
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.js.map +1 -0
- package/lib/orchestrate/facade/transformFacadeStateMessage.js +1 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js +2 -2
- package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +2 -2
- package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js +2 -2
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js +2 -2
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js +4 -3
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.js +6 -10
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +46 -61
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.d.ts +4 -0
- package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.js +540 -0
- package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js +37 -55
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +8 -8
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +20 -264
- package/lib/orchestrate/realize/utils/filterDiagnostics.d.ts +13 -0
- package/lib/orchestrate/realize/utils/filterDiagnostics.js +20 -0
- package/lib/orchestrate/realize/utils/filterDiagnostics.js.map +1 -0
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js +1 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/structures/IAutoBeConfig.d.ts +34 -1
- package/lib/utils/{TimeoutConversation.d.ts → TimedConversation.d.ts} +2 -2
- package/lib/utils/{TimeoutConversation.js → TimedConversation.js} +20 -6
- package/lib/utils/TimedConversation.js.map +1 -0
- package/package.json +6 -6
- package/src/constants/AutoBeSystemPromptConstant.ts +30 -29
- package/src/factory/createAutoBeContext.ts +5 -5
- package/src/orchestrate/common/histories/transformCommonCorrectDateHistories.ts +60 -0
- package/src/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.ts +40 -0
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +1 -1
- package/src/orchestrate/realize/orchestRateRealizeCorrectCasting.ts +4 -3
- package/src/orchestrate/realize/orchestrateRealize.ts +22 -16
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +44 -16
- package/src/orchestrate/realize/orchestrateRealizeCorrectDate.ts +372 -0
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +3 -3
- package/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.ts +8 -10
- package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +21 -267
- package/src/orchestrate/realize/utils/filterDiagnostics.ts +21 -0
- package/src/structures/IAutoBeConfig.ts +34 -1
- package/src/utils/{TimeoutConversation.ts → TimedConversation.ts} +18 -3
- package/lib/utils/TimeoutConversation.js.map +0 -1
|
@@ -98,16 +98,16 @@ function orchestrateRealizeWrite(ctx, props) {
|
|
|
98
98
|
});
|
|
99
99
|
if (pointer.value === null)
|
|
100
100
|
throw new Error("Failed to write code.");
|
|
101
|
-
pointer.value.
|
|
101
|
+
pointer.value.final = yield (0, replaceImportStatements_1.replaceImportStatements)(ctx, {
|
|
102
102
|
operation: props.scenario.operation,
|
|
103
|
-
code: pointer.value.
|
|
103
|
+
code: pointer.value.final,
|
|
104
104
|
decoratorType: (_a = props.authorization) === null || _a === void 0 ? void 0 : _a.payload.name,
|
|
105
105
|
});
|
|
106
106
|
const event = {
|
|
107
107
|
type: "realizeWrite",
|
|
108
108
|
id: (0, uuid_1.v7)(),
|
|
109
109
|
location: props.scenario.location,
|
|
110
|
-
content: pointer.value.
|
|
110
|
+
content: pointer.value.final,
|
|
111
111
|
tokenUsage,
|
|
112
112
|
completed: ++props.progress.completed,
|
|
113
113
|
total: props.progress.total,
|
|
@@ -142,61 +142,52 @@ const claude = {
|
|
|
142
142
|
{
|
|
143
143
|
name: "coding",
|
|
144
144
|
parameters: {
|
|
145
|
-
description: " Properties containing the multi-phase implementation plan and
|
|
145
|
+
description: " Properties containing the multi-phase implementation plan and\ncode\n\n------------------------------\n\nDescription of the current {@link IAutoBeRealizeWriteApplication.IProps} type:\n\n> Properties for the Realize Write Application following Chain of Thinking\n> (CoT).\n> \n> Each field represents a distinct phase in the implementation process.\n> Detailed guidelines are in REALIZE_WRITE.md.",
|
|
146
146
|
type: "object",
|
|
147
147
|
properties: {
|
|
148
148
|
plan: {
|
|
149
|
-
description: "Step 1 - Planning Phase (CoT: Initial Reasoning)\n\
|
|
149
|
+
description: "Step 1 - Planning Phase (CoT: Initial Reasoning)\n\nStrategic plan following SCHEMA-FIRST APPROACH:\n\n1. Verify Prisma schema fields (list existing and non-existing)\n2. Plan field usage in operations\n3. Plan type conversions and nullable handling\n4. Define implementation approach with error handling\n\nSee REALIZE_WRITE.md for detailed requirements.",
|
|
150
150
|
type: "string"
|
|
151
151
|
},
|
|
152
|
-
|
|
153
|
-
description: "Step 2 -
|
|
154
|
-
type: "string"
|
|
155
|
-
},
|
|
156
|
-
draft_without_date_type: {
|
|
157
|
-
description: "Step 3 - Initial Draft (CoT: First Implementation Attempt)\n\nDraft WITHOUT using native Date type.\n\nThis is the initial drafting phase where you outline the basic skeleton\nof the function.\n\nDO NOT: Use the native Date type.\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\nImport rules:\n\nDO NOT:\n\n- Add any new import statements manually\n- Write import statements directly (this causes compile errors)\n\nNote: All necessary imports are provided globally or by the system\nautomatically.\n\n\u2705 Requirements:\n\n- Avoid using the `any` type at all costs to ensure type safety.\n- NEVER declare variables with `: Date` type\n- ALWAYS use `string & tags.Format<'date-time'>` for date values\n- Use `toISOStringSafe(new Date())` for current timestamps\n- Maintain a single-function structure; avoid using classes.",
|
|
152
|
+
prismaSchemas: {
|
|
153
|
+
description: "Step 2 - Relevant Prisma schema models and fields",
|
|
158
154
|
type: "string"
|
|
159
155
|
},
|
|
160
156
|
review: {
|
|
161
|
-
description: "Step
|
|
157
|
+
description: "Step 3 - Refined version with real operations",
|
|
162
158
|
type: "string"
|
|
163
159
|
},
|
|
164
|
-
|
|
165
|
-
description: "Step
|
|
160
|
+
final: {
|
|
161
|
+
description: "Step 4 - Final implementation See REALIZE_WRITE.md for requirements",
|
|
166
162
|
type: "string"
|
|
167
163
|
}
|
|
168
164
|
},
|
|
169
165
|
required: [
|
|
170
166
|
"plan",
|
|
171
|
-
"
|
|
172
|
-
"draft_without_date_type",
|
|
167
|
+
"prismaSchemas",
|
|
173
168
|
"review",
|
|
174
|
-
"
|
|
169
|
+
"final"
|
|
175
170
|
],
|
|
176
171
|
additionalProperties: false,
|
|
177
172
|
$defs: {}
|
|
178
173
|
},
|
|
179
|
-
description: "Generates provider function implementation through multi-phase development.\n\nThis method implements a systematic approach to generate NestJS provider\nfunctions that handle business logic for API operations. It follows a\nschema-first approach with multiple refinement phases to ensure type-safe,\nerror-free code generation.\n\nThe generation process includes:\n1. Strategic planning based on Prisma schema analysis\n2.
|
|
180
|
-
validate: (() => { const _io0 = input => "string" === typeof input.plan && "string" === typeof input.
|
|
174
|
+
description: "Generates provider function implementation through multi-phase development.\n\nThis method implements a systematic approach to generate NestJS provider\nfunctions that handle business logic for API operations. It follows a\nschema-first approach with multiple refinement phases to ensure type-safe,\nerror-free code generation.\n\nThe generation process includes:\n\n1. Strategic planning based on Prisma schema analysis\n2. Schema definition for relevant models\n3. Review and refinement for completeness\n4. Final implementation with all validations and type safety",
|
|
175
|
+
validate: (() => { const _io0 = input => "string" === typeof input.plan && "string" === typeof input.prismaSchemas && "string" === typeof input.review && "string" === typeof input.final; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.plan || _report(_exceptionable, {
|
|
181
176
|
path: _path + ".plan",
|
|
182
177
|
expected: "string",
|
|
183
178
|
value: input.plan
|
|
184
|
-
}), "string" === typeof input.
|
|
185
|
-
path: _path + ".
|
|
186
|
-
expected: "string",
|
|
187
|
-
value: input.prisma_schemas
|
|
188
|
-
}), "string" === typeof input.draft_without_date_type || _report(_exceptionable, {
|
|
189
|
-
path: _path + ".draft_without_date_type",
|
|
179
|
+
}), "string" === typeof input.prismaSchemas || _report(_exceptionable, {
|
|
180
|
+
path: _path + ".prismaSchemas",
|
|
190
181
|
expected: "string",
|
|
191
|
-
value: input.
|
|
182
|
+
value: input.prismaSchemas
|
|
192
183
|
}), "string" === typeof input.review || _report(_exceptionable, {
|
|
193
184
|
path: _path + ".review",
|
|
194
185
|
expected: "string",
|
|
195
186
|
value: input.review
|
|
196
|
-
}), "string" === typeof input.
|
|
197
|
-
path: _path + ".
|
|
187
|
+
}), "string" === typeof input.final || _report(_exceptionable, {
|
|
188
|
+
path: _path + ".final",
|
|
198
189
|
expected: "string",
|
|
199
|
-
value: input.
|
|
190
|
+
value: input.final
|
|
200
191
|
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
201
192
|
if (false === __is(input)) {
|
|
202
193
|
errors = [];
|
|
@@ -240,61 +231,52 @@ const collection = {
|
|
|
240
231
|
{
|
|
241
232
|
name: "coding",
|
|
242
233
|
parameters: {
|
|
243
|
-
description: " Properties containing the multi-phase implementation plan and
|
|
234
|
+
description: " Properties containing the multi-phase implementation plan and\ncode\n\n------------------------------\n\nDescription of the current {@link IAutoBeRealizeWriteApplication.IProps} type:\n\n> Properties for the Realize Write Application following Chain of Thinking\n> (CoT).\n> \n> Each field represents a distinct phase in the implementation process.\n> Detailed guidelines are in REALIZE_WRITE.md.",
|
|
244
235
|
type: "object",
|
|
245
236
|
properties: {
|
|
246
237
|
plan: {
|
|
247
|
-
description: "Step 1 - Planning Phase (CoT: Initial Reasoning)\n\
|
|
238
|
+
description: "Step 1 - Planning Phase (CoT: Initial Reasoning)\n\nStrategic plan following SCHEMA-FIRST APPROACH:\n\n1. Verify Prisma schema fields (list existing and non-existing)\n2. Plan field usage in operations\n3. Plan type conversions and nullable handling\n4. Define implementation approach with error handling\n\nSee REALIZE_WRITE.md for detailed requirements.",
|
|
248
239
|
type: "string"
|
|
249
240
|
},
|
|
250
|
-
|
|
251
|
-
description: "Step 2 -
|
|
252
|
-
type: "string"
|
|
253
|
-
},
|
|
254
|
-
draft_without_date_type: {
|
|
255
|
-
description: "Step 3 - Initial Draft (CoT: First Implementation Attempt)\n\nDraft WITHOUT using native Date type.\n\nThis is the initial drafting phase where you outline the basic skeleton\nof the function.\n\nDO NOT: Use the native Date type.\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\nImport rules:\n\nDO NOT:\n\n- Add any new import statements manually\n- Write import statements directly (this causes compile errors)\n\nNote: All necessary imports are provided globally or by the system\nautomatically.\n\n\u2705 Requirements:\n\n- Avoid using the `any` type at all costs to ensure type safety.\n- NEVER declare variables with `: Date` type\n- ALWAYS use `string & tags.Format<'date-time'>` for date values\n- Use `toISOStringSafe(new Date())` for current timestamps\n- Maintain a single-function structure; avoid using classes.",
|
|
241
|
+
prismaSchemas: {
|
|
242
|
+
description: "Step 2 - Relevant Prisma schema models and fields",
|
|
256
243
|
type: "string"
|
|
257
244
|
},
|
|
258
245
|
review: {
|
|
259
|
-
description: "Step
|
|
246
|
+
description: "Step 3 - Refined version with real operations",
|
|
260
247
|
type: "string"
|
|
261
248
|
},
|
|
262
|
-
|
|
263
|
-
description: "Step
|
|
249
|
+
final: {
|
|
250
|
+
description: "Step 4 - Final implementation See REALIZE_WRITE.md for requirements",
|
|
264
251
|
type: "string"
|
|
265
252
|
}
|
|
266
253
|
},
|
|
267
254
|
required: [
|
|
268
255
|
"plan",
|
|
269
|
-
"
|
|
270
|
-
"draft_without_date_type",
|
|
256
|
+
"prismaSchemas",
|
|
271
257
|
"review",
|
|
272
|
-
"
|
|
258
|
+
"final"
|
|
273
259
|
],
|
|
274
260
|
additionalProperties: false,
|
|
275
261
|
$defs: {}
|
|
276
262
|
},
|
|
277
|
-
description: "Generates provider function implementation through multi-phase development.\n\nThis method implements a systematic approach to generate NestJS provider\nfunctions that handle business logic for API operations. It follows a\nschema-first approach with multiple refinement phases to ensure type-safe,\nerror-free code generation.\n\nThe generation process includes:\n1. Strategic planning based on Prisma schema analysis\n2.
|
|
278
|
-
validate: (() => { const _io0 = input => "string" === typeof input.plan && "string" === typeof input.
|
|
263
|
+
description: "Generates provider function implementation through multi-phase development.\n\nThis method implements a systematic approach to generate NestJS provider\nfunctions that handle business logic for API operations. It follows a\nschema-first approach with multiple refinement phases to ensure type-safe,\nerror-free code generation.\n\nThe generation process includes:\n\n1. Strategic planning based on Prisma schema analysis\n2. Schema definition for relevant models\n3. Review and refinement for completeness\n4. Final implementation with all validations and type safety",
|
|
264
|
+
validate: (() => { const _io0 = input => "string" === typeof input.plan && "string" === typeof input.prismaSchemas && "string" === typeof input.review && "string" === typeof input.final; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.plan || _report(_exceptionable, {
|
|
279
265
|
path: _path + ".plan",
|
|
280
266
|
expected: "string",
|
|
281
267
|
value: input.plan
|
|
282
|
-
}), "string" === typeof input.
|
|
283
|
-
path: _path + ".
|
|
284
|
-
expected: "string",
|
|
285
|
-
value: input.prisma_schemas
|
|
286
|
-
}), "string" === typeof input.draft_without_date_type || _report(_exceptionable, {
|
|
287
|
-
path: _path + ".draft_without_date_type",
|
|
268
|
+
}), "string" === typeof input.prismaSchemas || _report(_exceptionable, {
|
|
269
|
+
path: _path + ".prismaSchemas",
|
|
288
270
|
expected: "string",
|
|
289
|
-
value: input.
|
|
271
|
+
value: input.prismaSchemas
|
|
290
272
|
}), "string" === typeof input.review || _report(_exceptionable, {
|
|
291
273
|
path: _path + ".review",
|
|
292
274
|
expected: "string",
|
|
293
275
|
value: input.review
|
|
294
|
-
}), "string" === typeof input.
|
|
295
|
-
path: _path + ".
|
|
276
|
+
}), "string" === typeof input.final || _report(_exceptionable, {
|
|
277
|
+
path: _path + ".final",
|
|
296
278
|
expected: "string",
|
|
297
|
-
value: input.
|
|
279
|
+
value: input.final
|
|
298
280
|
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
299
281
|
if (false === __is(input)) {
|
|
300
282
|
errors = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateRealizeWrite.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeWrite.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,0DAuEC;;AArFD,yCAA2C;AAG3C,kDAA0B;AAC1B,+BAA0B;AAG1B,uEAAoE;AACpE,+FAA4F;AAG5F,mEAAgE;AAChE,6EAA0E;AAE1E,SAAsB,uBAAuB,CAC3C,GAAyB,EACzB,KAMC;;;QAED,MAAM,OAAO,GAA2D;YACtE,KAAK,EAAE,IAAI;SACZ,CAAC;QAEF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21,19 @@ export declare namespace IAutoBeRealizeCorrectApplication {
|
|
|
21
21
|
revise: IRevise;
|
|
22
22
|
}
|
|
23
23
|
interface IRevise {
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Step 1: TypeScript compilation error analysis and resolution strategy.
|
|
26
|
+
* Analyzes TypeScript compiler diagnostics (error codes, messages) to understand
|
|
27
|
+
* type mismatches, missing properties, nullable conflicts, and other compilation issues.
|
|
28
|
+
*/
|
|
25
29
|
errorAnalysis?: string;
|
|
26
30
|
/** Step 2: Provider function implementation plan. */
|
|
27
31
|
plan?: string;
|
|
28
32
|
/** Step 3: Relevant Prisma schema definitions. */
|
|
29
33
|
prismaSchemas?: string;
|
|
30
|
-
/** Step 4:
|
|
31
|
-
draftWithoutDateType?: string;
|
|
32
|
-
/** Step 5: Refined version with improved completeness. */
|
|
34
|
+
/** Step 4: Refined version with improved completeness. */
|
|
33
35
|
review?: string;
|
|
34
|
-
/** Step
|
|
35
|
-
|
|
36
|
-
/** Step 7: Final complete TypeScript function implementation. */
|
|
37
|
-
implementationCode: string;
|
|
36
|
+
/** Step 5: Final complete TypeScript function implementation. */
|
|
37
|
+
final: string;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -8,288 +8,44 @@ export interface IAutoBeRealizeWriteApplication {
|
|
|
8
8
|
* error-free code generation.
|
|
9
9
|
*
|
|
10
10
|
* The generation process includes:
|
|
11
|
+
*
|
|
11
12
|
* 1. Strategic planning based on Prisma schema analysis
|
|
12
|
-
* 2.
|
|
13
|
+
* 2. Schema definition for relevant models
|
|
13
14
|
* 3. Review and refinement for completeness
|
|
14
|
-
* 4.
|
|
15
|
-
* 5. Final implementation with all validations and type safety
|
|
15
|
+
* 4. Final implementation with all validations and type safety
|
|
16
16
|
*
|
|
17
|
-
* @param next Properties containing the multi-phase implementation plan and
|
|
17
|
+
* @param next Properties containing the multi-phase implementation plan and
|
|
18
|
+
* code
|
|
18
19
|
*/
|
|
19
20
|
coding: (next: IAutoBeRealizeWriteApplication.IProps) => void;
|
|
20
21
|
}
|
|
21
22
|
export declare namespace IAutoBeRealizeWriteApplication {
|
|
22
23
|
/**
|
|
23
|
-
* Properties for the Realize Write Application following Chain of Thinking
|
|
24
|
+
* Properties for the Realize Write Application following Chain of Thinking
|
|
25
|
+
* (CoT).
|
|
24
26
|
*
|
|
25
|
-
* Each field represents a distinct phase in the
|
|
26
|
-
*
|
|
27
|
-
* This structured approach ensures clarity, debuggability, and systematic thinking.
|
|
27
|
+
* Each field represents a distinct phase in the implementation process.
|
|
28
|
+
* Detailed guidelines are in REALIZE_WRITE.md.
|
|
28
29
|
*/
|
|
29
30
|
interface IProps {
|
|
30
31
|
/**
|
|
31
32
|
* Step 1 - Planning Phase (CoT: Initial Reasoning)
|
|
32
33
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* This field outlines the strategic plan for implementing the provider
|
|
36
|
-
* function according to the Realize Coder Agent specification. Before
|
|
37
|
-
* writing the actual code, think through the logic and structure.
|
|
38
|
-
*
|
|
39
|
-
* The plan follows a SCHEMA-FIRST APPROACH:
|
|
40
|
-
*
|
|
41
|
-
* 📋 STEP 1 - PRISMA SCHEMA VERIFICATION:
|
|
42
|
-
*
|
|
43
|
-
* DO:
|
|
44
|
-
*
|
|
45
|
-
* - Examine the actual Prisma schema model definition
|
|
46
|
-
* - List EVERY field that exists in the model with exact types
|
|
47
|
-
* - Explicitly note fields that DO NOT exist
|
|
48
|
-
* - Verify database compatibility (PostgreSQL AND SQLite)
|
|
49
|
-
*
|
|
50
|
-
* DO NOT:
|
|
51
|
-
*
|
|
52
|
-
* - Assume common fields exist without verification
|
|
53
|
-
* - Use fields like deleted_at, created_by, updated_by, is_deleted, is_active
|
|
54
|
-
* without checking
|
|
55
|
-
* - Use PostgreSQL-specific features like mode: "insensitive"
|
|
56
|
-
*
|
|
57
|
-
* 📋 STEP 2 - FIELD INVENTORY:
|
|
58
|
-
*
|
|
59
|
-
* - List ONLY fields confirmed to exist in schema
|
|
60
|
-
* - Example: "Verified fields in user model: id (String), email (String),
|
|
61
|
-
* created_at (DateTime), updated_at (DateTime)"
|
|
62
|
-
* - Example: "Fields that DO NOT exist: deleted_at, is_active, created_by"
|
|
63
|
-
*
|
|
64
|
-
* 📋 STEP 3 - FIELD ACCESS STRATEGY:
|
|
65
|
-
*
|
|
66
|
-
* - Plan which verified fields will be used in select, update, create
|
|
67
|
-
* operations
|
|
68
|
-
* - For complex operations with type errors, plan to use separate queries
|
|
69
|
-
* instead of nested operations
|
|
70
|
-
*
|
|
71
|
-
* 📋 STEP 4 - TYPE COMPATIBILITY:
|
|
72
|
-
*
|
|
73
|
-
* - Plan DateTime to ISO string conversions using toISOStringSafe()
|
|
74
|
-
* - Plan handling of nullable vs required fields
|
|
75
|
-
*
|
|
76
|
-
* 📋 STEP 5 - IMPLEMENTATION APPROACH:
|
|
77
|
-
*
|
|
78
|
-
* - 🧩 Required business entities (e.g., users, posts, logs) and their
|
|
79
|
-
* relationships
|
|
80
|
-
* - 🛠 Operations needed to fulfill the business scenario (e.g., fetch,
|
|
81
|
-
* create, update) using ONLY verified fields
|
|
82
|
-
* - 🔄 Data dependencies between steps (e.g., use userId to fetch related
|
|
83
|
-
* data)
|
|
84
|
-
* - ✅ Validation points (based on business rules, not field presence)
|
|
85
|
-
* - 🚧 Error and edge cases that must be handled explicitly (e.g., missing
|
|
86
|
-
* records)
|
|
87
|
-
* - 🏗 Structure: always a single `async function`, using only `parameters`
|
|
88
|
-
* and `body`
|
|
34
|
+
* Strategic plan following SCHEMA-FIRST APPROACH:
|
|
89
35
|
*
|
|
90
|
-
*
|
|
36
|
+
* 1. Verify Prisma schema fields (list existing and non-existing)
|
|
37
|
+
* 2. Plan field usage in operations
|
|
38
|
+
* 3. Plan type conversions and nullable handling
|
|
39
|
+
* 4. Define implementation approach with error handling
|
|
91
40
|
*
|
|
92
|
-
*
|
|
93
|
-
* already valid
|
|
94
|
-
* - Use `typia.random<T>()` with an explanatory comment if logic can't be
|
|
95
|
-
* implemented
|
|
96
|
-
* - Never use `any` or make assumptions without sufficient context
|
|
97
|
-
* - Use only allowed imports — DTOs and Prisma types
|
|
98
|
-
* - Use `MyGlobal.prisma` for DB access and respect Prisma typing rules
|
|
99
|
-
*
|
|
100
|
-
* ⚠️ TypeScript-specific considerations:
|
|
101
|
-
*
|
|
102
|
-
* - Do **not** use native `Date` objects directly; always convert all dates
|
|
103
|
-
* using `toISOStringSafe()` and brand as `string &
|
|
104
|
-
* tags.Format<'date-time'>`. This rule applies throughout all phases.
|
|
105
|
-
* - Prefer `satisfies` for DTO conformance instead of unsafe `as` casts
|
|
106
|
-
* - Avoid weak typing such as `any`, `as any`, or `satisfies any`
|
|
107
|
-
* - Use branded types (e.g., `tags.Format<'uuid'>`) and literal unions where
|
|
108
|
-
* applicable
|
|
109
|
-
*
|
|
110
|
-
* ✅ Example Structure:
|
|
111
|
-
*
|
|
112
|
-
* ```ts
|
|
113
|
-
* export async function doSomething(
|
|
114
|
-
* user: { id: string & tags.Format<"uuid">; type: string },
|
|
115
|
-
* parameters: IParams,
|
|
116
|
-
* body: IBody
|
|
117
|
-
* ): Promise<IReturn> {
|
|
118
|
-
* const { id } = parameters;
|
|
119
|
-
* const { name } = body;
|
|
120
|
-
* const user = await MyGlobal.prisma.users.findFirst({ where: { id } });
|
|
121
|
-
* if (!user) throw new Error("User not found");
|
|
122
|
-
* ...
|
|
123
|
-
* return result;
|
|
124
|
-
* }
|
|
125
|
-
* ```
|
|
126
|
-
*
|
|
127
|
-
* 🔍 Feasibility Analysis Requirement:
|
|
128
|
-
*
|
|
129
|
-
* - Before generating any code, the agent **must analyze** whether the
|
|
130
|
-
* requested implementation is **feasible based on the given Prisma schema
|
|
131
|
-
* and DTO types**.
|
|
132
|
-
* - If required fields or relationships are **missing or incompatible**, the
|
|
133
|
-
* plan should explicitly state that the implementation is **not
|
|
134
|
-
* possible** with the current schema/DTO, and no code should be generated
|
|
135
|
-
* in later stages.
|
|
136
|
-
* - In such cases, only a detailed **comment in the `implementationCode`**
|
|
137
|
-
* should be returned explaining why the logic cannot be implemented.
|
|
138
|
-
*
|
|
139
|
-
* 🔥 Error Handling Plan:
|
|
140
|
-
*
|
|
141
|
-
* If an error is expected or encountered during implementation:
|
|
142
|
-
*
|
|
143
|
-
* - Clearly document the error message(s) and TypeScript error codes.
|
|
144
|
-
* - Analyze the root cause (e.g., type mismatch, missing field, nullability
|
|
145
|
-
* issue).
|
|
146
|
-
* - Define concrete steps to resolve the issue, such as:
|
|
147
|
-
*
|
|
148
|
-
* - Adjusting type declarations or using Prisma-generated input types.
|
|
149
|
-
* - Using `?? undefined` to normalize nullable fields.
|
|
150
|
-
* - Applying correct relation handling (e.g., `connect` instead of direct
|
|
151
|
-
* foreign key assignment).
|
|
152
|
-
* - Ensuring all date fields use `.toISOString()` and proper branding.
|
|
153
|
-
* - Include fallback or workaround plans if a direct fix is complex.
|
|
154
|
-
* - If no error is present, simply omit this section.
|
|
155
|
-
*
|
|
156
|
-
* This plan ensures the function will:
|
|
157
|
-
*
|
|
158
|
-
* - Respect the global architecture and coding conventions
|
|
159
|
-
* - Be safe, predictable, and aligned with upstream logic
|
|
41
|
+
* See REALIZE_WRITE.md for detailed requirements.
|
|
160
42
|
*/
|
|
161
43
|
plan: string;
|
|
162
|
-
/**
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
* The Prisma schema string that will be used to validate the implementation
|
|
166
|
-
* logic in this file.
|
|
167
|
-
*
|
|
168
|
-
* You must **explicitly specify only the relevant models and fields** from
|
|
169
|
-
* your full schema that are used in this implementation. This ensures that
|
|
170
|
-
* your logic is aligned with the expected database structure without
|
|
171
|
-
* accidentally introducing unrelated fields or models.
|
|
172
|
-
*
|
|
173
|
-
* ⚠️ Important: The value of this field must be a valid Prisma schema
|
|
174
|
-
* string containing only the models used in this code — not the entire
|
|
175
|
-
* schema.
|
|
176
|
-
*
|
|
177
|
-
* This acts as a safeguard against:
|
|
178
|
-
*
|
|
179
|
-
* - Forgetting required fields used in this implementation
|
|
180
|
-
* - Including fields or models that are not actually used
|
|
181
|
-
*/
|
|
182
|
-
prisma_schemas: string;
|
|
183
|
-
/**
|
|
184
|
-
* Step 3 - Initial Draft (CoT: First Implementation Attempt)
|
|
185
|
-
*
|
|
186
|
-
* Draft WITHOUT using native Date type.
|
|
187
|
-
*
|
|
188
|
-
* This is the initial drafting phase where you outline the basic skeleton
|
|
189
|
-
* of the function.
|
|
190
|
-
*
|
|
191
|
-
* DO NOT: Use the native Date type.
|
|
192
|
-
*
|
|
193
|
-
* - The function signature must correctly include `user`, `parameters`, and
|
|
194
|
-
* `body` arguments.
|
|
195
|
-
* - Design the main flow of business logic, such as DB fetches and early
|
|
196
|
-
* returns based on conditions.
|
|
197
|
-
* - Mark any incomplete or missing parts clearly with placeholders (e.g.,
|
|
198
|
-
* comments or temporary values).
|
|
199
|
-
*
|
|
200
|
-
* Import rules:
|
|
201
|
-
*
|
|
202
|
-
* DO NOT:
|
|
203
|
-
*
|
|
204
|
-
* - Add any new import statements manually
|
|
205
|
-
* - Write import statements directly (this causes compile errors)
|
|
206
|
-
*
|
|
207
|
-
* Note: All necessary imports are provided globally or by the system
|
|
208
|
-
* automatically.
|
|
209
|
-
*
|
|
210
|
-
* ✅ Requirements:
|
|
211
|
-
*
|
|
212
|
-
* - Avoid using the `any` type at all costs to ensure type safety.
|
|
213
|
-
* - NEVER declare variables with `: Date` type
|
|
214
|
-
* - ALWAYS use `string & tags.Format<'date-time'>` for date values
|
|
215
|
-
* - Use `toISOStringSafe(new Date())` for current timestamps
|
|
216
|
-
* - Maintain a single-function structure; avoid using classes.
|
|
217
|
-
*/
|
|
218
|
-
draft_without_date_type: string;
|
|
219
|
-
/**
|
|
220
|
-
* Step 4 - Review and Refinement (CoT: Self-Reflection)
|
|
221
|
-
*
|
|
222
|
-
* A refined version of the draft with improved completeness.
|
|
223
|
-
*
|
|
224
|
-
* - Replace placeholder logic with real DTO-conformant operations.
|
|
225
|
-
* - Add error handling (`throw new Error(...)`) where necessary.
|
|
226
|
-
* - Begin resolving structural or type mismatches.
|
|
227
|
-
*
|
|
228
|
-
* ✅ Requirements:
|
|
229
|
-
*
|
|
230
|
-
* - Use `satisfies` to ensure DTO conformity.
|
|
231
|
-
* - Avoid unsafe `as` casts unless only for branding or literal narrowing.
|
|
232
|
-
* - Use `toISOStringSafe()` for all date conversions (NOT `.toISOString()`).
|
|
233
|
-
* - Ensure all object keys strictly conform to the expected type definitions.
|
|
234
|
-
* - NEVER use `mode: "insensitive"` in string operations (breaks SQLite).
|
|
235
|
-
*/
|
|
44
|
+
/** Step 2 - Relevant Prisma schema models and fields */
|
|
45
|
+
prismaSchemas: string;
|
|
46
|
+
/** Step 3 - Refined version with real operations */
|
|
236
47
|
review: string;
|
|
237
|
-
/**
|
|
238
|
-
|
|
239
|
-
*
|
|
240
|
-
* The complete and fully correct TypeScript function implementation.
|
|
241
|
-
*
|
|
242
|
-
* - Passes strict type checking without errors.
|
|
243
|
-
* - Uses only safe branding or literal type assertions.
|
|
244
|
-
* - Converts all date values properly using `toISOStringSafe()`.
|
|
245
|
-
* - Follows DTO structures using `satisfies`.
|
|
246
|
-
* - Avoids any weak typing such as `any`, `as any`, or `satisfies any`.
|
|
247
|
-
* - Uses only allowed imports (e.g., from `../api/structures` and
|
|
248
|
-
* `MyGlobal.prisma`).
|
|
249
|
-
* - NEVER creates intermediate variables for Prisma operations.
|
|
250
|
-
* - NEVER uses `mode: "insensitive"` (PostgreSQL-only, breaks SQLite).
|
|
251
|
-
*
|
|
252
|
-
* ⚠️ Fallback Behavior:
|
|
253
|
-
*
|
|
254
|
-
* - If the `plan` phase explicitly determines that the requested logic is
|
|
255
|
-
* **not feasible** due to mismatches or limitations in the provided
|
|
256
|
-
* Prisma schema and DTO types:
|
|
257
|
-
*
|
|
258
|
-
* - The implementation must still return a syntactically valid function.
|
|
259
|
-
* - In such cases, return mock data using `typia.random<T>()` wrapped in the
|
|
260
|
-
* correct structure, along with a comment explaining the limitation.
|
|
261
|
-
*
|
|
262
|
-
* Example fallback:
|
|
263
|
-
*
|
|
264
|
-
* ```ts
|
|
265
|
-
* // ⚠️ Cannot implement logic due to missing relation between A and B
|
|
266
|
-
* export async function someFunction(...) {
|
|
267
|
-
* return typia.random<IReturn>(); // mocked output
|
|
268
|
-
* }
|
|
269
|
-
* ```
|
|
270
|
-
*
|
|
271
|
-
* ⚠️ Prohibited Practices:
|
|
272
|
-
*
|
|
273
|
-
* - Do NOT add or modify import statements manually. Imports are handled
|
|
274
|
-
* automatically by the system.
|
|
275
|
-
* - Do NOT use `any`, `as any`, or `satisfies any` to bypass type checking.
|
|
276
|
-
* - Do NOT assign native `Date` objects directly; always convert them using
|
|
277
|
-
* `toISOStringSafe()`.
|
|
278
|
-
* - Do NOT use unsafe type assertions except for safe branding or literal
|
|
279
|
-
* narrowing.
|
|
280
|
-
* - Do NOT write code outside the single async function structure (e.g., no
|
|
281
|
-
* classes or multiple functions).
|
|
282
|
-
* - Do NOT perform any input validation — assume all inputs are already
|
|
283
|
-
* validated.
|
|
284
|
-
* - Do NOT use dynamic import expressions (`import()`); all imports must be
|
|
285
|
-
* static.
|
|
286
|
-
* - Do NOT use Prisma-generated input types; always use types from
|
|
287
|
-
* `../api/structures`.
|
|
288
|
-
* - Do NOT use `Object.prototype.hasOwnProperty.call()` for field checks.
|
|
289
|
-
* - Do NOT escape newlines or quotes in the implementation string (e.g., no
|
|
290
|
-
* `\\n` or `\"`); use a properly formatted template literal with actual
|
|
291
|
-
* line breaks instead.
|
|
292
|
-
*/
|
|
293
|
-
implementationCode: string;
|
|
48
|
+
/** Step 4 - Final implementation See REALIZE_WRITE.md for requirements */
|
|
49
|
+
final: string;
|
|
294
50
|
}
|
|
295
51
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IAutoBeRealizeFunctionFailure } from "../structures/IAutoBeRealizeFunctionFailure";
|
|
2
|
+
/**
|
|
3
|
+
* Filter diagnostic failures to only include those matching the given
|
|
4
|
+
* locations.
|
|
5
|
+
*
|
|
6
|
+
* @param failures - Array of function failures with diagnostic information
|
|
7
|
+
* @param locations - Array of file locations to filter by
|
|
8
|
+
* @returns Filtered array of failures matching the specified locations
|
|
9
|
+
* @warning This function assumes f.function and f.function.location are always defined.
|
|
10
|
+
* If f.function is undefined, this will throw a runtime error.
|
|
11
|
+
* Consider using optional chaining: f.function?.location
|
|
12
|
+
*/
|
|
13
|
+
export declare function filterDiagnostics(failures: IAutoBeRealizeFunctionFailure[], locations: string[]): IAutoBeRealizeFunctionFailure[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterDiagnostics = filterDiagnostics;
|
|
4
|
+
/**
|
|
5
|
+
* Filter diagnostic failures to only include those matching the given
|
|
6
|
+
* locations.
|
|
7
|
+
*
|
|
8
|
+
* @param failures - Array of function failures with diagnostic information
|
|
9
|
+
* @param locations - Array of file locations to filter by
|
|
10
|
+
* @returns Filtered array of failures matching the specified locations
|
|
11
|
+
* @warning This function assumes f.function and f.function.location are always defined.
|
|
12
|
+
* If f.function is undefined, this will throw a runtime error.
|
|
13
|
+
* Consider using optional chaining: f.function?.location
|
|
14
|
+
*/
|
|
15
|
+
function filterDiagnostics(failures, locations) {
|
|
16
|
+
return failures
|
|
17
|
+
.filter((f) => f.function.location.startsWith("src/providers"))
|
|
18
|
+
.filter((f) => locations.includes(f.function.location));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=filterDiagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterDiagnostics.js","sourceRoot":"","sources":["../../../../src/orchestrate/realize/utils/filterDiagnostics.ts"],"names":[],"mappings":";;AAaA,8CAOC;AAlBD;;;;;;;;;;GAUG;AACH,SAAgB,iBAAiB,CAC/B,QAAyC,EACzC,SAAmB;IAEnB,OAAO,QAAQ;SACZ,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;SAC9D,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC5D,CAAC"}
|