@autobe/agent 0.24.2 → 0.25.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/constants/AutoBeSystemPromptConstant.d.ts +16 -16
- package/lib/context/IAutoBeApplication.d.ts +101 -6
- package/lib/context/IAutoBeApplicationProps.d.ts +6 -2
- package/lib/factory/createAgenticaHistory.js +1 -1
- package/lib/factory/createAgenticaHistory.js.map +1 -1
- package/lib/factory/createAutoBeApplication.js +80 -90
- package/lib/factory/createAutoBeApplication.js.map +1 -1
- package/lib/factory/createAutoBeContext.js +5 -5
- package/lib/factory/createAutoBeContext.js.map +1 -1
- package/lib/index.mjs +941 -1065
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +5 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.d.ts +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +18 -3
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +5 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +19 -7
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +3 -2
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.d.ts +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +2 -2
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +1 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +2 -2
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js +1 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js +2 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +5 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +20 -7
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.d.ts +6 -1
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +31 -23
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.d.ts +6 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +22 -6
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.d.ts +4 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +26 -5
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.d.ts +5 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +21 -5
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +5 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +20 -4
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterface.js +25 -7
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +17 -8
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +4 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +18 -11
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.d.ts +6 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +25 -10
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +4 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +9 -6
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.d.ts +5 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +33 -17
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.d.ts +5 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +36 -18
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.d.ts +4 -1
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +19 -8
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.d.ts +6 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +20 -6
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrisma.js +3 -3
- package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +6 -3
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.d.ts +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +12 -6
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/orchestrate/{common/histories/transformCommonCorrectDateHistories.d.ts → realize/histories/transformRealizeCorrectCastingHistories.d.ts} +1 -2
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js +33 -0
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js.map +1 -0
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js +21 -7
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.js +3 -9
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +12 -2
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/orchestrate/realize/utils/generateRealizeScenario.js +1 -5
- package/lib/orchestrate/realize/utils/generateRealizeScenario.js.map +1 -1
- package/lib/orchestrate/realize/utils/replaceImportStatements.js +3 -1
- package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +5 -1
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +11 -7
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +7 -1
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +39 -31
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.d.ts +6 -3
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +32 -26
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.d.ts +5 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js +111 -94
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTest.js +20 -14
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +4 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +51 -35
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.d.ts +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +14 -3
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.d.ts +5 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js +19 -11
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.d.ts +4 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js +9 -4
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/package.json +5 -5
- package/src/constants/AutoBeSystemPromptConstant.ts +16 -16
- package/src/context/IAutoBeApplication.ts +101 -6
- package/src/context/IAutoBeApplicationProps.ts +6 -2
- package/src/factory/createAgenticaHistory.ts +11 -5
- package/src/factory/createAutoBeContext.ts +5 -5
- package/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.ts +5 -1
- package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +16 -0
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +22 -7
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +3 -2
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +2 -1
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +3 -2
- package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +2 -1
- package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +23 -9
- package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +33 -24
- package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +26 -9
- package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +27 -5
- package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +24 -7
- package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +23 -6
- package/src/orchestrate/interface/orchestrateInterface.ts +29 -10
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +22 -12
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +25 -17
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +35 -23
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +9 -3
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +44 -29
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +51 -32
- package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +20 -6
- package/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.ts +24 -9
- package/src/orchestrate/prisma/orchestratePrisma.ts +7 -3
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +5 -1
- package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +15 -10
- package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.ts +45 -0
- package/src/orchestrate/realize/orchestRateRealizeCorrectCasting.ts +26 -7
- package/src/orchestrate/realize/orchestrateRealize.ts +6 -17
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +18 -2
- package/src/orchestrate/realize/utils/generateRealizeScenario.ts +1 -5
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +5 -0
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +14 -7
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +44 -36
- package/src/orchestrate/test/histories/transformTestScenarioReviewHistories.ts +74 -71
- package/src/orchestrate/test/histories/transformTestWriteHistories.ts +35 -12
- package/src/orchestrate/test/orchestrateTest.ts +19 -13
- package/src/orchestrate/test/orchestrateTestCorrect.ts +65 -46
- package/src/orchestrate/test/orchestrateTestScenario.ts +15 -11
- package/src/orchestrate/test/orchestrateTestScenarioReview.ts +29 -16
- package/src/orchestrate/test/orchestrateTestWrite.ts +13 -4
- package/lib/orchestrate/common/histories/transformCommonCorrectDateHistories.js +0 -48
- package/lib/orchestrate/common/histories/transformCommonCorrectDateHistories.js.map +0 -1
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.d.ts +0 -35
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.js +0 -3
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.js.map +0 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.d.ts +0 -4
- package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.js +0 -540
- package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.js.map +0 -1
- package/src/orchestrate/common/histories/transformCommonCorrectDateHistories.ts +0 -60
- package/src/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.ts +0 -40
- package/src/orchestrate/realize/orchestrateRealizeCorrectDate.ts +0 -372
|
@@ -1,540 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
-
};
|
|
47
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
exports.orchestrateRealizeCorrectDate = void 0;
|
|
49
|
-
const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
|
|
50
|
-
const utils_1 = require("@autobe/utils");
|
|
51
|
-
const typia_1 = __importDefault(require("typia"));
|
|
52
|
-
const uuid_1 = require("uuid");
|
|
53
|
-
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
54
|
-
const executeCachedBatch_1 = require("../../utils/executeCachedBatch");
|
|
55
|
-
const transformCommonCorrectDateHistories_1 = require("../common/histories/transformCommonCorrectDateHistories");
|
|
56
|
-
const compileRealizeFiles_1 = require("./internal/compileRealizeFiles");
|
|
57
|
-
const orchestrateRealizeCorrectDate = (ctx_1, authorizations_1, functions_1, progress_1, ...args_1) => __awaiter(void 0, [ctx_1, authorizations_1, functions_1, progress_1, ...args_1], void 0, function* (ctx, authorizations, functions, progress, life = ctx.retry) {
|
|
58
|
-
const validateEvent = yield (0, compileRealizeFiles_1.compileRealizeFiles)(ctx, {
|
|
59
|
-
authorizations,
|
|
60
|
-
functions,
|
|
61
|
-
});
|
|
62
|
-
return predicate(ctx, authorizations, functions, [], progress, validateEvent, life);
|
|
63
|
-
});
|
|
64
|
-
exports.orchestrateRealizeCorrectDate = orchestrateRealizeCorrectDate;
|
|
65
|
-
const predicate = (ctx, authorizations, functions, failures, progress, event, life) => __awaiter(void 0, void 0, void 0, function* () {
|
|
66
|
-
if (event.result.type === "failure") {
|
|
67
|
-
ctx.dispatch(event);
|
|
68
|
-
return yield correct(ctx, authorizations, functions, [...failures, ...event.result.diagnostics], progress, event, life);
|
|
69
|
-
}
|
|
70
|
-
return functions;
|
|
71
|
-
});
|
|
72
|
-
const correct = (ctx, authorizations, functions, failures, progress, event, life) => __awaiter(void 0, void 0, void 0, function* () {
|
|
73
|
-
// Early returns for non-correctable cases
|
|
74
|
-
if (event.result.type !== "failure" || life < 0) {
|
|
75
|
-
return functions;
|
|
76
|
-
}
|
|
77
|
-
// Filter only Date-related errors
|
|
78
|
-
const dateErrors = filterDateErrors(failures);
|
|
79
|
-
const locations = diagnose(event).filter((l) => functions.map((f) => f.location).includes(l) &&
|
|
80
|
-
dateErrors.some((e) => e.file === l));
|
|
81
|
-
// If no date errors found, return original functions
|
|
82
|
-
if (locations.length === 0) {
|
|
83
|
-
return functions;
|
|
84
|
-
}
|
|
85
|
-
progress.total += locations.length;
|
|
86
|
-
const converted = yield (0, executeCachedBatch_1.executeCachedBatch)(locations.map((location) => () => __awaiter(void 0, void 0, void 0, function* () {
|
|
87
|
-
var _a, _b;
|
|
88
|
-
const func = functions.find((f) => f.location === location);
|
|
89
|
-
const pointer = {
|
|
90
|
-
value: null,
|
|
91
|
-
};
|
|
92
|
-
const { tokenUsage } = yield ctx.conversate({
|
|
93
|
-
source: "realizeCorrect",
|
|
94
|
-
histories: (0, transformCommonCorrectDateHistories_1.transformCommonCorrectDateHistories)([
|
|
95
|
-
{
|
|
96
|
-
script: func.content,
|
|
97
|
-
diagnostics: dateErrors.filter((d) => d.file === location),
|
|
98
|
-
},
|
|
99
|
-
]),
|
|
100
|
-
controller: createController({
|
|
101
|
-
model: ctx.model,
|
|
102
|
-
then: (next) => {
|
|
103
|
-
pointer.value = next;
|
|
104
|
-
},
|
|
105
|
-
reject: () => {
|
|
106
|
-
pointer.value = false;
|
|
107
|
-
},
|
|
108
|
-
}),
|
|
109
|
-
enforceFunctionCall: true,
|
|
110
|
-
message: utils_1.StringUtil.trim `
|
|
111
|
-
Fix ALL Date type problems in this code following these ABSOLUTE RULES:
|
|
112
|
-
|
|
113
|
-
🔴 CRITICAL DATE TYPE RULES:
|
|
114
|
-
1. NEVER declare variables with ': Date' type
|
|
115
|
-
2. NEVER use 'Date' as return type or parameter type
|
|
116
|
-
3. ALWAYS use 'string & tags.Format<"date-time">' for date type declarations
|
|
117
|
-
4. Use toISOStringSafe() to convert Date or string to ISO format
|
|
118
|
-
5. toISOStringSafe() REQUIRES a parameter - it's NOT optional
|
|
119
|
-
|
|
120
|
-
📅 toISOStringSafe FUNCTION SIGNATURE:
|
|
121
|
-
function toISOStringSafe(
|
|
122
|
-
value: Date | (string & tags.Format<"date-time">)
|
|
123
|
-
): string & tags.Format<"date-time">
|
|
124
|
-
|
|
125
|
-
Note: This function CANNOT accept null or undefined!
|
|
126
|
-
|
|
127
|
-
📅 CORRECT PATTERNS:
|
|
128
|
-
- Creating timestamps: toISOStringSafe(new Date())
|
|
129
|
-
- Converting nullable dates: value ? toISOStringSafe(value) : null
|
|
130
|
-
- Converting strings: toISOStringSafe(dateString)
|
|
131
|
-
- Type declarations: string & tags.Format<'date-time'>
|
|
132
|
-
- Never store Date in variables: const now = new Date() is FORBIDDEN
|
|
133
|
-
|
|
134
|
-
🚨 COMMON ERRORS TO FIX:
|
|
135
|
-
- Type 'Date' is not assignable → Use toISOStringSafe()
|
|
136
|
-
- Direct Date assignment → Wrap with toISOStringSafe()
|
|
137
|
-
- Date type in function signature → Change to string & tags.Format<'date-time'>
|
|
138
|
-
- For nullable values → Check null BEFORE calling toISOStringSafe()
|
|
139
|
-
|
|
140
|
-
Fix these Date type issues immediately. If you cannot fix them, reject the task.
|
|
141
|
-
Do not explain, just fix the code or give up.
|
|
142
|
-
`,
|
|
143
|
-
});
|
|
144
|
-
++progress.completed;
|
|
145
|
-
if (pointer.value === null)
|
|
146
|
-
return { result: "exception", func: func };
|
|
147
|
-
else if (pointer.value === false)
|
|
148
|
-
return { result: "ignore", func: func };
|
|
149
|
-
ctx.dispatch({
|
|
150
|
-
id: (0, uuid_1.v7)(),
|
|
151
|
-
type: "realizeCorrect",
|
|
152
|
-
content: pointer.value.revise.final,
|
|
153
|
-
created_at: new Date().toISOString(),
|
|
154
|
-
location: func.location,
|
|
155
|
-
step: (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
|
|
156
|
-
tokenUsage,
|
|
157
|
-
completed: progress.completed,
|
|
158
|
-
total: progress.total,
|
|
159
|
-
});
|
|
160
|
-
return {
|
|
161
|
-
result: "success",
|
|
162
|
-
func: Object.assign(Object.assign({}, func), { content: pointer.value.revise.final }),
|
|
163
|
-
};
|
|
164
|
-
})));
|
|
165
|
-
const newValidate = yield (0, compileRealizeFiles_1.compileRealizeFiles)(ctx, { authorizations, functions: converted.map((c) => c.func) });
|
|
166
|
-
if (newValidate.result.type === "success") {
|
|
167
|
-
return converted.map((c) => c.func);
|
|
168
|
-
}
|
|
169
|
-
const newLocations = diagnose(newValidate);
|
|
170
|
-
// Separate successful, failed, and ignored corrections
|
|
171
|
-
const { success, failed, ignored } = separateCorrectionResults(converted, newLocations);
|
|
172
|
-
// If no failures to retry, return success and ignored functions
|
|
173
|
-
if (failed.length === 0) {
|
|
174
|
-
return [...success, ...ignored];
|
|
175
|
-
}
|
|
176
|
-
// Collect diagnostics relevant to failed functions
|
|
177
|
-
const failedLocations = failed.map((f) => f.location);
|
|
178
|
-
const allDiagnostics = [
|
|
179
|
-
...failures,
|
|
180
|
-
...(newValidate.result.type === "failure"
|
|
181
|
-
? newValidate.result.diagnostics
|
|
182
|
-
: []),
|
|
183
|
-
];
|
|
184
|
-
const relevantDiagnostics = filterRelevantDiagnostics(allDiagnostics, failedLocations);
|
|
185
|
-
// Recursively retry failed functions
|
|
186
|
-
const retriedFunctions = yield predicate(ctx, authorizations, failed, relevantDiagnostics, progress, newValidate, life - 1);
|
|
187
|
-
return [...success, ...ignored, ...retriedFunctions];
|
|
188
|
-
});
|
|
189
|
-
/**
|
|
190
|
-
* Extract unique file locations from validation event diagnostics
|
|
191
|
-
*
|
|
192
|
-
* @param event - Validation event containing compilation results
|
|
193
|
-
* @returns Array of unique file paths that have errors
|
|
194
|
-
*/
|
|
195
|
-
const diagnose = (event) => {
|
|
196
|
-
if (event.result.type !== "failure") {
|
|
197
|
-
return [];
|
|
198
|
-
}
|
|
199
|
-
const diagnostics = event.result.diagnostics;
|
|
200
|
-
const locations = diagnostics
|
|
201
|
-
.map((d) => d.file)
|
|
202
|
-
.filter((f) => f !== null)
|
|
203
|
-
.filter((f) => f.startsWith("src/providers"));
|
|
204
|
-
return Array.from(new Set(locations));
|
|
205
|
-
};
|
|
206
|
-
/**
|
|
207
|
-
* Filter diagnostics to only include Date-related errors
|
|
208
|
-
*
|
|
209
|
-
* @param diagnostics - All diagnostics
|
|
210
|
-
* @returns Date-related diagnostics only
|
|
211
|
-
*/
|
|
212
|
-
const filterDateErrors = (diagnostics) => {
|
|
213
|
-
return diagnostics.filter((d) => {
|
|
214
|
-
var _a;
|
|
215
|
-
const messageText = ((_a = d.messageText) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || "";
|
|
216
|
-
return (messageText.includes("date") ||
|
|
217
|
-
messageText.includes("date-time") ||
|
|
218
|
-
messageText.includes("toisostring") ||
|
|
219
|
-
messageText.includes("cannot read property") ||
|
|
220
|
-
messageText.includes("type 'date'") ||
|
|
221
|
-
messageText.includes("tags.format<'date-time'>") ||
|
|
222
|
-
messageText.includes('tags.format<"date-time">'));
|
|
223
|
-
});
|
|
224
|
-
};
|
|
225
|
-
/**
|
|
226
|
-
* Separate correction results into successful, failed, and ignored functions
|
|
227
|
-
*
|
|
228
|
-
* @param corrections - Array of correction results
|
|
229
|
-
* @param errorLocations - File paths that still have errors
|
|
230
|
-
* @returns Object with success, failed, and ignored function arrays
|
|
231
|
-
*/
|
|
232
|
-
const separateCorrectionResults = (corrections, errorLocations) => {
|
|
233
|
-
const success = corrections
|
|
234
|
-
.filter((c) => c.result === "success" && !errorLocations.includes(c.func.location))
|
|
235
|
-
.map((c) => c.func);
|
|
236
|
-
const failed = corrections
|
|
237
|
-
.filter((c) => c.result === "success" && errorLocations.includes(c.func.location))
|
|
238
|
-
.map((c) => c.func);
|
|
239
|
-
const ignored = corrections
|
|
240
|
-
.filter((c) => c.result === "ignore" || c.result === "exception")
|
|
241
|
-
.map((c) => c.func);
|
|
242
|
-
return { success, failed, ignored };
|
|
243
|
-
};
|
|
244
|
-
/**
|
|
245
|
-
* Filter diagnostics to only include those relevant to specific functions
|
|
246
|
-
*
|
|
247
|
-
* @param diagnostics - All diagnostics
|
|
248
|
-
* @param functionLocations - Locations of functions to filter for
|
|
249
|
-
* @returns Filtered diagnostics
|
|
250
|
-
*/
|
|
251
|
-
const filterRelevantDiagnostics = (diagnostics, functionLocations) => {
|
|
252
|
-
return diagnostics.filter((d) => d.file && functionLocations.includes(d.file));
|
|
253
|
-
};
|
|
254
|
-
const createController = (props) => {
|
|
255
|
-
(0, assertSchemaModel_1.assertSchemaModel)(props.model);
|
|
256
|
-
const application = collection[props.model === "chatgpt" ? "chatgpt" : "claude"];
|
|
257
|
-
return {
|
|
258
|
-
protocol: "class",
|
|
259
|
-
name: "correctDateInvalidRequest",
|
|
260
|
-
application,
|
|
261
|
-
execute: {
|
|
262
|
-
rewrite: (next) => {
|
|
263
|
-
props.then(next);
|
|
264
|
-
},
|
|
265
|
-
reject: () => {
|
|
266
|
-
props.reject();
|
|
267
|
-
},
|
|
268
|
-
},
|
|
269
|
-
};
|
|
270
|
-
};
|
|
271
|
-
const collection = {
|
|
272
|
-
chatgpt: {
|
|
273
|
-
model: "chatgpt",
|
|
274
|
-
options: {
|
|
275
|
-
reference: true,
|
|
276
|
-
strict: false,
|
|
277
|
-
separate: null
|
|
278
|
-
},
|
|
279
|
-
functions: [
|
|
280
|
-
{
|
|
281
|
-
name: "rewrite",
|
|
282
|
-
parameters: {
|
|
283
|
-
description: " - Correction properties\n\n------------------------------\n\nDescription of the current {@link IAutoBeCommonCorrectDateApplication.IProps} type:\n\n> Properties for Date type correction",
|
|
284
|
-
type: "object",
|
|
285
|
-
properties: {
|
|
286
|
-
revise: {
|
|
287
|
-
description: "The correction revision containing the fixed code",
|
|
288
|
-
type: "object",
|
|
289
|
-
properties: {
|
|
290
|
-
analysis: {
|
|
291
|
-
description: "Optional: Analysis of Date type errors found\n\n\n@maxLength 4000",
|
|
292
|
-
type: "string"
|
|
293
|
-
},
|
|
294
|
-
strategy: {
|
|
295
|
-
description: "Optional: Strategy for fixing Date issues\n\n\n@maxLength 2000",
|
|
296
|
-
type: "string"
|
|
297
|
-
},
|
|
298
|
-
final: {
|
|
299
|
-
description: "Final corrected code with all Date type issues resolved\n\nMust follow these rules:\n\n- No ': Date' type declarations\n- All dates use 'string & tags.Format<\"date-time\">'\n- All Date objects wrapped with toISOStringSafe()\n- Null checks before toISOStringSafe()",
|
|
300
|
-
type: "string"
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
required: [
|
|
304
|
-
"final"
|
|
305
|
-
]
|
|
306
|
-
}
|
|
307
|
-
},
|
|
308
|
-
required: [
|
|
309
|
-
"revise"
|
|
310
|
-
],
|
|
311
|
-
additionalProperties: false,
|
|
312
|
-
$defs: {}
|
|
313
|
-
},
|
|
314
|
-
description: "Rewrite the function to fix Date type issues",
|
|
315
|
-
validate: (() => { const _io0 = input => "object" === typeof input.revise && null !== input.revise && _io1(input.revise); const _io1 = input => (undefined === input.analysis || "string" === typeof input.analysis && input.analysis.length <= 4000) && (undefined === input.strategy || "string" === typeof input.strategy && input.strategy.length <= 2000) && "string" === typeof input.final; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
316
|
-
path: _path + ".revise",
|
|
317
|
-
expected: "__type",
|
|
318
|
-
value: input.revise
|
|
319
|
-
})) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
|
|
320
|
-
path: _path + ".revise",
|
|
321
|
-
expected: "__type",
|
|
322
|
-
value: input.revise
|
|
323
|
-
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [undefined === input.analysis || "string" === typeof input.analysis && (input.analysis.length <= 4000 || _report(_exceptionable, {
|
|
324
|
-
path: _path + ".analysis",
|
|
325
|
-
expected: "string & MaxLength<4000>",
|
|
326
|
-
value: input.analysis
|
|
327
|
-
})) || _report(_exceptionable, {
|
|
328
|
-
path: _path + ".analysis",
|
|
329
|
-
expected: "((string & MaxLength<4000>) | undefined)",
|
|
330
|
-
value: input.analysis
|
|
331
|
-
}), undefined === input.strategy || "string" === typeof input.strategy && (input.strategy.length <= 2000 || _report(_exceptionable, {
|
|
332
|
-
path: _path + ".strategy",
|
|
333
|
-
expected: "string & MaxLength<2000>",
|
|
334
|
-
value: input.strategy
|
|
335
|
-
})) || _report(_exceptionable, {
|
|
336
|
-
path: _path + ".strategy",
|
|
337
|
-
expected: "((string & MaxLength<2000>) | undefined)",
|
|
338
|
-
value: input.strategy
|
|
339
|
-
}), "string" === typeof input.final || _report(_exceptionable, {
|
|
340
|
-
path: _path + ".final",
|
|
341
|
-
expected: "string",
|
|
342
|
-
value: input.final
|
|
343
|
-
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
344
|
-
if (false === __is(input)) {
|
|
345
|
-
errors = [];
|
|
346
|
-
_report = __typia_transform__validateReport._validateReport(errors);
|
|
347
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
348
|
-
path: _path + "",
|
|
349
|
-
expected: "IAutoBeCommonCorrectDateApplication.IProps",
|
|
350
|
-
value: input
|
|
351
|
-
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
352
|
-
path: _path + "",
|
|
353
|
-
expected: "IAutoBeCommonCorrectDateApplication.IProps",
|
|
354
|
-
value: input
|
|
355
|
-
}))(input, "$input", true);
|
|
356
|
-
const success = 0 === errors.length;
|
|
357
|
-
return success ? {
|
|
358
|
-
success,
|
|
359
|
-
data: input
|
|
360
|
-
} : {
|
|
361
|
-
success,
|
|
362
|
-
errors,
|
|
363
|
-
data: input
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
return {
|
|
367
|
-
success: true,
|
|
368
|
-
data: input
|
|
369
|
-
};
|
|
370
|
-
}; })()
|
|
371
|
-
},
|
|
372
|
-
{
|
|
373
|
-
name: "reject",
|
|
374
|
-
parameters: {
|
|
375
|
-
type: "object",
|
|
376
|
-
properties: {},
|
|
377
|
-
additionalProperties: false,
|
|
378
|
-
required: [],
|
|
379
|
-
$defs: {}
|
|
380
|
-
},
|
|
381
|
-
description: "Reject the correction task if Date issues cannot be fixed",
|
|
382
|
-
validate: (() => { const __is = input => true; let errors; let _report; return input => {
|
|
383
|
-
if (false === __is(input)) {
|
|
384
|
-
errors = [];
|
|
385
|
-
_report = __typia_transform__validateReport._validateReport(errors);
|
|
386
|
-
((input, _path, _exceptionable = true) => true)(input, "$input", true);
|
|
387
|
-
const success = 0 === errors.length;
|
|
388
|
-
return success ? {
|
|
389
|
-
success,
|
|
390
|
-
data: input
|
|
391
|
-
} : {
|
|
392
|
-
success,
|
|
393
|
-
errors,
|
|
394
|
-
data: input
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
return {
|
|
398
|
-
success: true,
|
|
399
|
-
data: input
|
|
400
|
-
};
|
|
401
|
-
}; })()
|
|
402
|
-
}
|
|
403
|
-
]
|
|
404
|
-
},
|
|
405
|
-
claude: {
|
|
406
|
-
model: "claude",
|
|
407
|
-
options: {
|
|
408
|
-
reference: true,
|
|
409
|
-
separate: null
|
|
410
|
-
},
|
|
411
|
-
functions: [
|
|
412
|
-
{
|
|
413
|
-
name: "rewrite",
|
|
414
|
-
parameters: {
|
|
415
|
-
description: " - Correction properties\n\n------------------------------\n\nDescription of the current {@link IAutoBeCommonCorrectDateApplication.IProps} type:\n\n> Properties for Date type correction",
|
|
416
|
-
type: "object",
|
|
417
|
-
properties: {
|
|
418
|
-
revise: {
|
|
419
|
-
description: "The correction revision containing the fixed code",
|
|
420
|
-
type: "object",
|
|
421
|
-
properties: {
|
|
422
|
-
analysis: {
|
|
423
|
-
description: "Optional: Analysis of Date type errors found",
|
|
424
|
-
type: "string",
|
|
425
|
-
maxLength: 4000
|
|
426
|
-
},
|
|
427
|
-
strategy: {
|
|
428
|
-
description: "Optional: Strategy for fixing Date issues",
|
|
429
|
-
type: "string",
|
|
430
|
-
maxLength: 2000
|
|
431
|
-
},
|
|
432
|
-
final: {
|
|
433
|
-
description: "Final corrected code with all Date type issues resolved\n\nMust follow these rules:\n\n- No ': Date' type declarations\n- All dates use 'string & tags.Format<\"date-time\">'\n- All Date objects wrapped with toISOStringSafe()\n- Null checks before toISOStringSafe()",
|
|
434
|
-
type: "string"
|
|
435
|
-
}
|
|
436
|
-
},
|
|
437
|
-
required: [
|
|
438
|
-
"final"
|
|
439
|
-
]
|
|
440
|
-
}
|
|
441
|
-
},
|
|
442
|
-
required: [
|
|
443
|
-
"revise"
|
|
444
|
-
],
|
|
445
|
-
additionalProperties: false,
|
|
446
|
-
$defs: {}
|
|
447
|
-
},
|
|
448
|
-
description: "Rewrite the function to fix Date type issues",
|
|
449
|
-
validate: (() => { const _io0 = input => "object" === typeof input.revise && null !== input.revise && _io1(input.revise); const _io1 = input => (undefined === input.analysis || "string" === typeof input.analysis && input.analysis.length <= 4000) && (undefined === input.strategy || "string" === typeof input.strategy && input.strategy.length <= 2000) && "string" === typeof input.final; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.revise && null !== input.revise || _report(_exceptionable, {
|
|
450
|
-
path: _path + ".revise",
|
|
451
|
-
expected: "__type",
|
|
452
|
-
value: input.revise
|
|
453
|
-
})) && _vo1(input.revise, _path + ".revise", true && _exceptionable) || _report(_exceptionable, {
|
|
454
|
-
path: _path + ".revise",
|
|
455
|
-
expected: "__type",
|
|
456
|
-
value: input.revise
|
|
457
|
-
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [undefined === input.analysis || "string" === typeof input.analysis && (input.analysis.length <= 4000 || _report(_exceptionable, {
|
|
458
|
-
path: _path + ".analysis",
|
|
459
|
-
expected: "string & MaxLength<4000>",
|
|
460
|
-
value: input.analysis
|
|
461
|
-
})) || _report(_exceptionable, {
|
|
462
|
-
path: _path + ".analysis",
|
|
463
|
-
expected: "((string & MaxLength<4000>) | undefined)",
|
|
464
|
-
value: input.analysis
|
|
465
|
-
}), undefined === input.strategy || "string" === typeof input.strategy && (input.strategy.length <= 2000 || _report(_exceptionable, {
|
|
466
|
-
path: _path + ".strategy",
|
|
467
|
-
expected: "string & MaxLength<2000>",
|
|
468
|
-
value: input.strategy
|
|
469
|
-
})) || _report(_exceptionable, {
|
|
470
|
-
path: _path + ".strategy",
|
|
471
|
-
expected: "((string & MaxLength<2000>) | undefined)",
|
|
472
|
-
value: input.strategy
|
|
473
|
-
}), "string" === typeof input.final || _report(_exceptionable, {
|
|
474
|
-
path: _path + ".final",
|
|
475
|
-
expected: "string",
|
|
476
|
-
value: input.final
|
|
477
|
-
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
478
|
-
if (false === __is(input)) {
|
|
479
|
-
errors = [];
|
|
480
|
-
_report = __typia_transform__validateReport._validateReport(errors);
|
|
481
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
482
|
-
path: _path + "",
|
|
483
|
-
expected: "IAutoBeCommonCorrectDateApplication.IProps",
|
|
484
|
-
value: input
|
|
485
|
-
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
486
|
-
path: _path + "",
|
|
487
|
-
expected: "IAutoBeCommonCorrectDateApplication.IProps",
|
|
488
|
-
value: input
|
|
489
|
-
}))(input, "$input", true);
|
|
490
|
-
const success = 0 === errors.length;
|
|
491
|
-
return success ? {
|
|
492
|
-
success,
|
|
493
|
-
data: input
|
|
494
|
-
} : {
|
|
495
|
-
success,
|
|
496
|
-
errors,
|
|
497
|
-
data: input
|
|
498
|
-
};
|
|
499
|
-
}
|
|
500
|
-
return {
|
|
501
|
-
success: true,
|
|
502
|
-
data: input
|
|
503
|
-
};
|
|
504
|
-
}; })()
|
|
505
|
-
},
|
|
506
|
-
{
|
|
507
|
-
name: "reject",
|
|
508
|
-
parameters: {
|
|
509
|
-
type: "object",
|
|
510
|
-
properties: {},
|
|
511
|
-
additionalProperties: false,
|
|
512
|
-
required: [],
|
|
513
|
-
$defs: {}
|
|
514
|
-
},
|
|
515
|
-
description: "Reject the correction task if Date issues cannot be fixed",
|
|
516
|
-
validate: (() => { const __is = input => true; let errors; let _report; return input => {
|
|
517
|
-
if (false === __is(input)) {
|
|
518
|
-
errors = [];
|
|
519
|
-
_report = __typia_transform__validateReport._validateReport(errors);
|
|
520
|
-
((input, _path, _exceptionable = true) => true)(input, "$input", true);
|
|
521
|
-
const success = 0 === errors.length;
|
|
522
|
-
return success ? {
|
|
523
|
-
success,
|
|
524
|
-
data: input
|
|
525
|
-
} : {
|
|
526
|
-
success,
|
|
527
|
-
errors,
|
|
528
|
-
data: input
|
|
529
|
-
};
|
|
530
|
-
}
|
|
531
|
-
return {
|
|
532
|
-
success: true,
|
|
533
|
-
data: input
|
|
534
|
-
};
|
|
535
|
-
}; })()
|
|
536
|
-
}
|
|
537
|
-
]
|
|
538
|
-
},
|
|
539
|
-
};
|
|
540
|
-
//# sourceMappingURL=orchestrateRealizeCorrectDate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateRealizeCorrectDate.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeCorrectDate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,yCAA2C;AAG3C,kDAA0B;AAC1B,+BAA0B;AAG1B,uEAAoE;AACpE,uEAAoE;AACpE,iHAA8G;AAE9G,wEAAqE;AAQ9D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C/B,MAAM,WAAW,GAAG,UAAU,CAC5B,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CACe,CAAC;IAClE,OAAO;QACL,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,2BAA2B;QACjC,WAAW;QACX,OAAO,EAAE;YACP,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,CAAC;YACD,MAAM,EAAE,GAAG,EAAE;gBACX,KAAK,CAAC,MAAM,EAAE,CAAC;YACjB,CAAC;SAC4C;KAChD,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG;IACjB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAGJ;IACH,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAGH;CACJ,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
-
import { IAutoBeTypeScriptCompileResult } from "@autobe/interface";
|
|
3
|
-
import { StringUtil } from "@autobe/utils";
|
|
4
|
-
import { v7 } from "uuid";
|
|
5
|
-
|
|
6
|
-
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
7
|
-
|
|
8
|
-
interface IFailure {
|
|
9
|
-
diagnostics: IAutoBeTypeScriptCompileResult.IDiagnostic[];
|
|
10
|
-
script: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/** Transform date correction histories for AI conversation */
|
|
14
|
-
export const transformCommonCorrectDateHistories = (
|
|
15
|
-
failures: IFailure[],
|
|
16
|
-
): Array<
|
|
17
|
-
IAgenticaHistoryJson.IAssistantMessage | IAgenticaHistoryJson.ISystemMessage
|
|
18
|
-
> => [
|
|
19
|
-
{
|
|
20
|
-
id: v7(),
|
|
21
|
-
created_at: new Date().toISOString(),
|
|
22
|
-
type: "systemMessage",
|
|
23
|
-
text: AutoBeSystemPromptConstant.REALIZE_DATE,
|
|
24
|
-
},
|
|
25
|
-
...failures.map(
|
|
26
|
-
(f, i, array) =>
|
|
27
|
-
({
|
|
28
|
-
id: v7(),
|
|
29
|
-
created_at: new Date().toISOString(),
|
|
30
|
-
type: "assistantMessage",
|
|
31
|
-
text: StringUtil.trim`
|
|
32
|
-
# ${i === array.length - 1 ? "Latest Date Type Failure" : "Previous Date Type Failure"}
|
|
33
|
-
|
|
34
|
-
## Generated TypeScript Code
|
|
35
|
-
\`\`\`typescript
|
|
36
|
-
${f.script}
|
|
37
|
-
\`\`\`
|
|
38
|
-
|
|
39
|
-
## Date-Related Compile Errors
|
|
40
|
-
${f.diagnostics
|
|
41
|
-
.map((d) => {
|
|
42
|
-
const location = d.file
|
|
43
|
-
? `[${d.file}${d.start ? `:${d.start}` : ""}]`
|
|
44
|
-
: "[Unknown location]";
|
|
45
|
-
const code = d.code ? `TS${d.code}` : "";
|
|
46
|
-
const messageText = d.messageText || "Date type error";
|
|
47
|
-
return `- ${location} ${code}: ${messageText}`;
|
|
48
|
-
})
|
|
49
|
-
.join("\n")}
|
|
50
|
-
|
|
51
|
-
## Required Fixes:
|
|
52
|
-
- Replace all Date type declarations with string & tags.Format<"date-time">
|
|
53
|
-
- Wrap Date objects with toISOStringSafe(value)
|
|
54
|
-
- Check null/undefined BEFORE calling toISOStringSafe (it doesn't accept null)
|
|
55
|
-
- Remove Date variable declarations (const now = new Date() is forbidden)
|
|
56
|
-
- toISOStringSafe requires a parameter - it's not optional
|
|
57
|
-
`,
|
|
58
|
-
}) satisfies IAgenticaHistoryJson.IAssistantMessage,
|
|
59
|
-
),
|
|
60
|
-
];
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import typia from "typia";
|
|
2
|
-
|
|
3
|
-
/** Application interface for Date type correction in generated code */
|
|
4
|
-
export interface IAutoBeCommonCorrectDateApplication {
|
|
5
|
-
/**
|
|
6
|
-
* Rewrite the function to fix Date type issues
|
|
7
|
-
*
|
|
8
|
-
* @param props - Correction properties
|
|
9
|
-
*/
|
|
10
|
-
rewrite(props: IAutoBeCommonCorrectDateApplication.IProps): void;
|
|
11
|
-
|
|
12
|
-
/** Reject the correction task if Date issues cannot be fixed */
|
|
13
|
-
reject(): void;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export namespace IAutoBeCommonCorrectDateApplication {
|
|
17
|
-
/** Properties for Date type correction */
|
|
18
|
-
export interface IProps {
|
|
19
|
-
/** The correction revision containing the fixed code */
|
|
20
|
-
revise: {
|
|
21
|
-
/** Optional: Analysis of Date type errors found */
|
|
22
|
-
analysis?: string & typia.tags.MaxLength<4000>;
|
|
23
|
-
|
|
24
|
-
/** Optional: Strategy for fixing Date issues */
|
|
25
|
-
strategy?: string & typia.tags.MaxLength<2000>;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Final corrected code with all Date type issues resolved
|
|
29
|
-
*
|
|
30
|
-
* Must follow these rules:
|
|
31
|
-
*
|
|
32
|
-
* - No ': Date' type declarations
|
|
33
|
-
* - All dates use 'string & tags.Format<"date-time">'
|
|
34
|
-
* - All Date objects wrapped with toISOStringSafe()
|
|
35
|
-
* - Null checks before toISOStringSafe()
|
|
36
|
-
*/
|
|
37
|
-
final: string;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
}
|