@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
|
@@ -0,0 +1,545 @@
|
|
|
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.orchestrateRealizeDecorator = orchestrateRealizeDecorator;
|
|
49
|
+
const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
|
|
50
|
+
const core_1 = require("@agentica/core");
|
|
51
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
52
|
+
const path_1 = __importDefault(require("path"));
|
|
53
|
+
const typia_1 = __importDefault(require("typia"));
|
|
54
|
+
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
55
|
+
const enforceToolCall_1 = require("../../utils/enforceToolCall");
|
|
56
|
+
const transformRealizeDecorator_1 = require("./transformRealizeDecorator");
|
|
57
|
+
const transformRealizeDecoratorCorrectHistories_1 = require("./transformRealizeDecoratorCorrectHistories");
|
|
58
|
+
/**
|
|
59
|
+
* 1. Create decorator and its parameters. and design the Authorization Provider.
|
|
60
|
+
* 2. According to Authorization Provider design, create the Provider.
|
|
61
|
+
*
|
|
62
|
+
* @param ctx
|
|
63
|
+
*/
|
|
64
|
+
function orchestrateRealizeDecorator(ctx) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
var _a, _b, _c;
|
|
67
|
+
const roles = (_c = (_b = (_a = ctx
|
|
68
|
+
.state()
|
|
69
|
+
.interface) === null || _a === void 0 ? void 0 : _a.document.components.authorization) === null || _b === void 0 ? void 0 : _b.map((auth) => auth.name)) !== null && _c !== void 0 ? _c : [];
|
|
70
|
+
const decorators = [];
|
|
71
|
+
let completed = 0;
|
|
72
|
+
const templateFiles = {
|
|
73
|
+
"src/MyGlobal.ts": yield promises_1.default.readFile(path_1.default.join(__dirname, "../../../../../internals/template/realize/src/MyGlobal.ts"), "utf-8"),
|
|
74
|
+
"src/authentications/jwtAuthorize.ts": yield promises_1.default.readFile(path_1.default.join(__dirname, "../../../../../internals/template/realize/src/providers/jwtAuthorize.ts"), "utf-8"),
|
|
75
|
+
};
|
|
76
|
+
const files = Object.assign({}, templateFiles);
|
|
77
|
+
yield Promise.all(roles.map((role) => __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
var _a, _b;
|
|
79
|
+
const decorator = yield process(ctx, role, templateFiles);
|
|
80
|
+
files[`src/decorators/${decorator.decorator.name}.ts`] =
|
|
81
|
+
decorator.decorator.code;
|
|
82
|
+
files[`src/authentications/${decorator.provider.name}.ts`] =
|
|
83
|
+
decorator.provider.code;
|
|
84
|
+
files[`src/authentications/types/${decorator.decoratorType.name}.ts`] =
|
|
85
|
+
decorator.decoratorType.code;
|
|
86
|
+
decorators.push(decorator);
|
|
87
|
+
const events = {
|
|
88
|
+
type: "realizeDecorator",
|
|
89
|
+
created_at: new Date().toISOString(),
|
|
90
|
+
files,
|
|
91
|
+
completed: ++completed,
|
|
92
|
+
total: roles.length,
|
|
93
|
+
step: (_b = (_a = ctx.state().test) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
|
|
94
|
+
};
|
|
95
|
+
ctx.dispatch(events);
|
|
96
|
+
})));
|
|
97
|
+
return decorators;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function process(ctx, role, templateFiles) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
var _a, _b;
|
|
103
|
+
const pointer = {
|
|
104
|
+
value: null,
|
|
105
|
+
};
|
|
106
|
+
const agentica = new core_1.MicroAgentica({
|
|
107
|
+
model: ctx.model,
|
|
108
|
+
vendor: ctx.vendor,
|
|
109
|
+
config: Object.assign(Object.assign({}, ((_a = ctx.config) !== null && _a !== void 0 ? _a : {})), { executor: {
|
|
110
|
+
describe: null,
|
|
111
|
+
} }),
|
|
112
|
+
histories: (0, transformRealizeDecorator_1.transformRealizeDecoratorHistories)(ctx, role),
|
|
113
|
+
controllers: [
|
|
114
|
+
createApplication({
|
|
115
|
+
model: ctx.model,
|
|
116
|
+
build: (next) => {
|
|
117
|
+
pointer.value = next;
|
|
118
|
+
},
|
|
119
|
+
}),
|
|
120
|
+
],
|
|
121
|
+
});
|
|
122
|
+
(0, enforceToolCall_1.enforceToolCall)(agentica);
|
|
123
|
+
yield agentica
|
|
124
|
+
.conversate("Create Authorization Provider and Decorator.")
|
|
125
|
+
.finally(() => {
|
|
126
|
+
const tokenUsage = agentica.getTokenUsage();
|
|
127
|
+
ctx.usage().record(tokenUsage, ["realize"]);
|
|
128
|
+
});
|
|
129
|
+
if (pointer.value === null)
|
|
130
|
+
throw new Error("Failed to create decorator.");
|
|
131
|
+
const compiled = (_b = ctx.state().prisma) === null || _b === void 0 ? void 0 : _b.compiled;
|
|
132
|
+
const prismaClients = (compiled === null || compiled === void 0 ? void 0 : compiled.type) === "success" ? compiled.nodeModules : {};
|
|
133
|
+
return yield correctDecorator(ctx, pointer.value, prismaClients, templateFiles);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function correctDecorator(ctx_1, result_1, prismaClients_1, templateFiles_1) {
|
|
137
|
+
return __awaiter(this, arguments, void 0, function* (ctx, result, prismaClients, templateFiles, life = 4) {
|
|
138
|
+
var _a, _b, _c, _d, _e;
|
|
139
|
+
// Check Compile
|
|
140
|
+
const files = Object.assign(Object.assign(Object.assign({}, templateFiles), prismaClients), { [`src/decorators/${result.decorator.name}.ts`]: result.decorator.code, [`src/authentications/${result.provider.name}.ts`]: result.provider.code, [`src/authentications/types/${result.decoratorType.name}.ts`]: result.decoratorType.code });
|
|
141
|
+
const compiler = yield ctx.compiler();
|
|
142
|
+
const compiled = yield compiler.typescript.compile({
|
|
143
|
+
files,
|
|
144
|
+
});
|
|
145
|
+
ctx.dispatch({
|
|
146
|
+
type: "realizeDecoratorValidate",
|
|
147
|
+
created_at: new Date().toISOString(),
|
|
148
|
+
result: compiled,
|
|
149
|
+
files,
|
|
150
|
+
step: (_b = (_a = ctx.state().test) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
|
|
151
|
+
});
|
|
152
|
+
if (compiled.type === "success") {
|
|
153
|
+
return result;
|
|
154
|
+
}
|
|
155
|
+
else if (compiled.type === "exception" || life === 0) {
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
const pointer = {
|
|
159
|
+
value: null,
|
|
160
|
+
};
|
|
161
|
+
const agentica = new core_1.MicroAgentica({
|
|
162
|
+
model: ctx.model,
|
|
163
|
+
vendor: ctx.vendor,
|
|
164
|
+
config: Object.assign(Object.assign({}, ((_c = ctx.config) !== null && _c !== void 0 ? _c : {})), { executor: {
|
|
165
|
+
describe: null,
|
|
166
|
+
} }),
|
|
167
|
+
histories: (0, transformRealizeDecoratorCorrectHistories_1.transformRealizeDecoratorCorrectHistories)(ctx, result, templateFiles, compiled.diagnostics),
|
|
168
|
+
controllers: [
|
|
169
|
+
createApplication({
|
|
170
|
+
model: ctx.model,
|
|
171
|
+
build: (next) => {
|
|
172
|
+
pointer.value = next;
|
|
173
|
+
},
|
|
174
|
+
}),
|
|
175
|
+
],
|
|
176
|
+
});
|
|
177
|
+
(0, enforceToolCall_1.enforceToolCall)(agentica);
|
|
178
|
+
yield agentica
|
|
179
|
+
.conversate("Please correct the decorator and the provider.")
|
|
180
|
+
.finally(() => {
|
|
181
|
+
const tokenUsage = agentica.getTokenUsage();
|
|
182
|
+
ctx.usage().record(tokenUsage, ["realize"]);
|
|
183
|
+
});
|
|
184
|
+
if (pointer.value === null)
|
|
185
|
+
throw new Error("Failed to correct decorator.");
|
|
186
|
+
const correctedFiles = Object.assign(Object.assign({}, files), { [`src/decorators/${pointer.value.decorator.name}.ts`]: pointer.value.decorator.code, [`src/authentications/${pointer.value.provider.name}.ts`]: pointer.value.provider.code, [`src/authentications/types/${pointer.value.decoratorType.name}.ts`]: pointer.value.decoratorType.code });
|
|
187
|
+
ctx.dispatch({
|
|
188
|
+
type: "realizeDecoratorCorrect",
|
|
189
|
+
created_at: new Date().toISOString(),
|
|
190
|
+
files: correctedFiles,
|
|
191
|
+
result: compiled,
|
|
192
|
+
step: (_e = (_d = ctx.state().test) === null || _d === void 0 ? void 0 : _d.step) !== null && _e !== void 0 ? _e : 0,
|
|
193
|
+
});
|
|
194
|
+
return yield correctDecorator(ctx, pointer.value, prismaClients, templateFiles, life - 1);
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
function createApplication(props) {
|
|
198
|
+
(0, assertSchemaModel_1.assertSchemaModel)(props.model);
|
|
199
|
+
const application = collection[props.model];
|
|
200
|
+
return {
|
|
201
|
+
protocol: "class",
|
|
202
|
+
name: "Create Decorator",
|
|
203
|
+
application,
|
|
204
|
+
execute: {
|
|
205
|
+
createDecorator: (next) => {
|
|
206
|
+
props.build(next);
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
const claude = {
|
|
212
|
+
model: "claude",
|
|
213
|
+
options: {
|
|
214
|
+
reference: true,
|
|
215
|
+
separate: null
|
|
216
|
+
},
|
|
217
|
+
functions: [
|
|
218
|
+
{
|
|
219
|
+
name: "createDecorator",
|
|
220
|
+
parameters: {
|
|
221
|
+
description: "Current Type: {@link IAutoBeRealizeDecoratorApplication.IProps}",
|
|
222
|
+
type: "object",
|
|
223
|
+
properties: {
|
|
224
|
+
provider: {
|
|
225
|
+
description: "Authentication Provider function configuration containing the function\nname and implementation code. The Provider handles JWT token\nverification, role validation, and database queries to authenticate\nusers.",
|
|
226
|
+
$ref: "#/$defs/IAutoBeRealizeDecoratorApplication.IProvider"
|
|
227
|
+
},
|
|
228
|
+
decorator: {
|
|
229
|
+
description: "Authentication Decorator configuration containing the decorator name and\nimplementation code. The Decorator integrates with NestJS parameter\ndecorators to automatically inject authenticated user data into\nController methods.",
|
|
230
|
+
$ref: "#/$defs/IAutoBeRealizeDecoratorApplication.IDecorator"
|
|
231
|
+
},
|
|
232
|
+
decoratorType: {
|
|
233
|
+
description: "Authentication Decorator Type configuration containing the decorator type\nname and implementation code. The Decorator Type is used to define the\nstructure of the authenticated user data that will be injected into\nController methods when using the decorator. It serves as the TypeScript\ntype for the parameter in Controller method signatures.",
|
|
234
|
+
$ref: "#/$defs/IAutoBeRealizeDecoratorApplication.IDecoratorType"
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
required: [
|
|
238
|
+
"provider",
|
|
239
|
+
"decorator",
|
|
240
|
+
"decoratorType"
|
|
241
|
+
],
|
|
242
|
+
additionalProperties: false,
|
|
243
|
+
$defs: {
|
|
244
|
+
"IAutoBeRealizeDecoratorApplication.IProvider": {
|
|
245
|
+
type: "object",
|
|
246
|
+
properties: {
|
|
247
|
+
name: {
|
|
248
|
+
description: "The name of the authentication Provider function in {role}Authorize\nformat (e.g., adminAuthorize, userAuthorize). This function will be\ncalled by the decorator to verify JWT tokens and return authenticated\nuser information for the specified role.",
|
|
249
|
+
type: "string"
|
|
250
|
+
},
|
|
251
|
+
code: {
|
|
252
|
+
description: "Complete TypeScript code for the authentication Provider function and its\ncorresponding Payload interface. Must include: JWT token verification\nusing jwtAuthorize function, role type checking against payload.type,\ndatabase query using MyGlobal.prisma.{tableName} pattern to verify user\nexistence, proper error handling with ForbiddenException and\nUnauthorizedException, and the Payload interface definition with id (UUID\nformat) and type (role discriminator) fields using typia tags.",
|
|
253
|
+
type: "string"
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
required: [
|
|
257
|
+
"name",
|
|
258
|
+
"code"
|
|
259
|
+
]
|
|
260
|
+
},
|
|
261
|
+
"IAutoBeRealizeDecoratorApplication.IDecorator": {
|
|
262
|
+
type: "object",
|
|
263
|
+
properties: {
|
|
264
|
+
name: {
|
|
265
|
+
description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.",
|
|
266
|
+
type: "string"
|
|
267
|
+
},
|
|
268
|
+
code: {
|
|
269
|
+
description: "Complete TypeScript code for the authentication Decorator implementation.\nMust include: SwaggerCustomizer integration to add bearer token security\nschema to API documentation, createParamDecorator implementation that\ncalls the corresponding Provider function for authentication, Singleton\npattern using tstl library for efficient decorator instance management,\nand proper TypeScript typing for the ParameterDecorator interface.",
|
|
270
|
+
type: "string"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
required: [
|
|
274
|
+
"name",
|
|
275
|
+
"code"
|
|
276
|
+
]
|
|
277
|
+
},
|
|
278
|
+
"IAutoBeRealizeDecoratorApplication.IDecoratorType": {
|
|
279
|
+
type: "object",
|
|
280
|
+
properties: {
|
|
281
|
+
name: {
|
|
282
|
+
description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.",
|
|
283
|
+
type: "string"
|
|
284
|
+
},
|
|
285
|
+
code: {
|
|
286
|
+
description: "The TypeScript code for the Payload type in {Role}Payload format (e.g.,\nAdminPayload, UserPayload). This interface defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator. It serves as the TypeScript type for the\nparameter in Controller method signatures.",
|
|
287
|
+
type: "string"
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
required: [
|
|
291
|
+
"name",
|
|
292
|
+
"code"
|
|
293
|
+
]
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
validate: (() => { const _io0 = input => "object" === typeof input.provider && null !== input.provider && _io1(input.provider) && ("object" === typeof input.decorator && null !== input.decorator && _io2(input.decorator)) && ("object" === typeof input.decoratorType && null !== input.decoratorType && _io3(input.decoratorType)); const _io1 = input => "string" === typeof input.name && "string" === typeof input.code; const _io2 = input => "string" === typeof input.name && "string" === typeof input.code; const _io3 = input => "string" === typeof input.name && "string" === typeof input.code; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.provider && null !== input.provider || _report(_exceptionable, {
|
|
298
|
+
path: _path + ".provider",
|
|
299
|
+
expected: "IAutoBeRealizeDecoratorApplication.IProvider",
|
|
300
|
+
value: input.provider
|
|
301
|
+
})) && _vo1(input.provider, _path + ".provider", true && _exceptionable) || _report(_exceptionable, {
|
|
302
|
+
path: _path + ".provider",
|
|
303
|
+
expected: "IAutoBeRealizeDecoratorApplication.IProvider",
|
|
304
|
+
value: input.provider
|
|
305
|
+
}), ("object" === typeof input.decorator && null !== input.decorator || _report(_exceptionable, {
|
|
306
|
+
path: _path + ".decorator",
|
|
307
|
+
expected: "IAutoBeRealizeDecoratorApplication.IDecorator",
|
|
308
|
+
value: input.decorator
|
|
309
|
+
})) && _vo2(input.decorator, _path + ".decorator", true && _exceptionable) || _report(_exceptionable, {
|
|
310
|
+
path: _path + ".decorator",
|
|
311
|
+
expected: "IAutoBeRealizeDecoratorApplication.IDecorator",
|
|
312
|
+
value: input.decorator
|
|
313
|
+
}), ("object" === typeof input.decoratorType && null !== input.decoratorType || _report(_exceptionable, {
|
|
314
|
+
path: _path + ".decoratorType",
|
|
315
|
+
expected: "IAutoBeRealizeDecoratorApplication.IDecoratorType",
|
|
316
|
+
value: input.decoratorType
|
|
317
|
+
})) && _vo3(input.decoratorType, _path + ".decoratorType", true && _exceptionable) || _report(_exceptionable, {
|
|
318
|
+
path: _path + ".decoratorType",
|
|
319
|
+
expected: "IAutoBeRealizeDecoratorApplication.IDecoratorType",
|
|
320
|
+
value: input.decoratorType
|
|
321
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
|
|
322
|
+
path: _path + ".name",
|
|
323
|
+
expected: "string",
|
|
324
|
+
value: input.name
|
|
325
|
+
}), "string" === typeof input.code || _report(_exceptionable, {
|
|
326
|
+
path: _path + ".code",
|
|
327
|
+
expected: "string",
|
|
328
|
+
value: input.code
|
|
329
|
+
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
|
|
330
|
+
path: _path + ".name",
|
|
331
|
+
expected: "string",
|
|
332
|
+
value: input.name
|
|
333
|
+
}), "string" === typeof input.code || _report(_exceptionable, {
|
|
334
|
+
path: _path + ".code",
|
|
335
|
+
expected: "string",
|
|
336
|
+
value: input.code
|
|
337
|
+
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
|
|
338
|
+
path: _path + ".name",
|
|
339
|
+
expected: "string",
|
|
340
|
+
value: input.name
|
|
341
|
+
}), "string" === typeof input.code || _report(_exceptionable, {
|
|
342
|
+
path: _path + ".code",
|
|
343
|
+
expected: "string",
|
|
344
|
+
value: input.code
|
|
345
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
346
|
+
if (false === __is(input)) {
|
|
347
|
+
errors = [];
|
|
348
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
349
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
350
|
+
path: _path + "",
|
|
351
|
+
expected: "IAutoBeRealizeDecoratorApplication.IProps",
|
|
352
|
+
value: input
|
|
353
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
354
|
+
path: _path + "",
|
|
355
|
+
expected: "IAutoBeRealizeDecoratorApplication.IProps",
|
|
356
|
+
value: input
|
|
357
|
+
}))(input, "$input", true);
|
|
358
|
+
const success = 0 === errors.length;
|
|
359
|
+
return success ? {
|
|
360
|
+
success,
|
|
361
|
+
data: input
|
|
362
|
+
} : {
|
|
363
|
+
success,
|
|
364
|
+
errors,
|
|
365
|
+
data: input
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
return {
|
|
369
|
+
success: true,
|
|
370
|
+
data: input
|
|
371
|
+
};
|
|
372
|
+
}; })()
|
|
373
|
+
}
|
|
374
|
+
]
|
|
375
|
+
};
|
|
376
|
+
const collection = {
|
|
377
|
+
chatgpt: {
|
|
378
|
+
model: "chatgpt",
|
|
379
|
+
options: {
|
|
380
|
+
reference: true,
|
|
381
|
+
strict: false,
|
|
382
|
+
separate: null
|
|
383
|
+
},
|
|
384
|
+
functions: [
|
|
385
|
+
{
|
|
386
|
+
name: "createDecorator",
|
|
387
|
+
parameters: {
|
|
388
|
+
description: "Current Type: {@link IAutoBeRealizeDecoratorApplication.IProps}\n\n### Description of {@link provider} property:\n\n> Authentication Provider function configuration containing the function\n> name and implementation code. The Provider handles JWT token\n> verification, role validation, and database queries to authenticate\n> users.\n\n### Description of {@link decorator} property:\n\n> Authentication Decorator configuration containing the decorator name and\n> implementation code. The Decorator integrates with NestJS parameter\n> decorators to automatically inject authenticated user data into\n> Controller methods.\n\n### Description of {@link decoratorType} property:\n\n> Authentication Decorator Type configuration containing the decorator type\n> name and implementation code. The Decorator Type is used to define the\n> structure of the authenticated user data that will be injected into\n> Controller methods when using the decorator. It serves as the TypeScript\n> type for the parameter in Controller method signatures.",
|
|
389
|
+
type: "object",
|
|
390
|
+
properties: {
|
|
391
|
+
provider: {
|
|
392
|
+
$ref: "#/$defs/IAutoBeRealizeDecoratorApplication.IProvider"
|
|
393
|
+
},
|
|
394
|
+
decorator: {
|
|
395
|
+
$ref: "#/$defs/IAutoBeRealizeDecoratorApplication.IDecorator"
|
|
396
|
+
},
|
|
397
|
+
decoratorType: {
|
|
398
|
+
$ref: "#/$defs/IAutoBeRealizeDecoratorApplication.IDecoratorType"
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
required: [
|
|
402
|
+
"provider",
|
|
403
|
+
"decorator",
|
|
404
|
+
"decoratorType"
|
|
405
|
+
],
|
|
406
|
+
additionalProperties: false,
|
|
407
|
+
$defs: {
|
|
408
|
+
"IAutoBeRealizeDecoratorApplication.IProvider": {
|
|
409
|
+
type: "object",
|
|
410
|
+
properties: {
|
|
411
|
+
name: {
|
|
412
|
+
description: "The name of the authentication Provider function in {role}Authorize\nformat (e.g., adminAuthorize, userAuthorize). This function will be\ncalled by the decorator to verify JWT tokens and return authenticated\nuser information for the specified role.",
|
|
413
|
+
type: "string"
|
|
414
|
+
},
|
|
415
|
+
code: {
|
|
416
|
+
description: "Complete TypeScript code for the authentication Provider function and its\ncorresponding Payload interface. Must include: JWT token verification\nusing jwtAuthorize function, role type checking against payload.type,\ndatabase query using MyGlobal.prisma.{tableName} pattern to verify user\nexistence, proper error handling with ForbiddenException and\nUnauthorizedException, and the Payload interface definition with id (UUID\nformat) and type (role discriminator) fields using typia tags.",
|
|
417
|
+
type: "string"
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
required: [
|
|
421
|
+
"name",
|
|
422
|
+
"code"
|
|
423
|
+
]
|
|
424
|
+
},
|
|
425
|
+
"IAutoBeRealizeDecoratorApplication.IDecorator": {
|
|
426
|
+
type: "object",
|
|
427
|
+
properties: {
|
|
428
|
+
name: {
|
|
429
|
+
description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.",
|
|
430
|
+
type: "string"
|
|
431
|
+
},
|
|
432
|
+
code: {
|
|
433
|
+
description: "Complete TypeScript code for the authentication Decorator implementation.\nMust include: SwaggerCustomizer integration to add bearer token security\nschema to API documentation, createParamDecorator implementation that\ncalls the corresponding Provider function for authentication, Singleton\npattern using tstl library for efficient decorator instance management,\nand proper TypeScript typing for the ParameterDecorator interface.",
|
|
434
|
+
type: "string"
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
required: [
|
|
438
|
+
"name",
|
|
439
|
+
"code"
|
|
440
|
+
]
|
|
441
|
+
},
|
|
442
|
+
"IAutoBeRealizeDecoratorApplication.IDecoratorType": {
|
|
443
|
+
type: "object",
|
|
444
|
+
properties: {
|
|
445
|
+
name: {
|
|
446
|
+
description: "The name of the Decorator to be generated in {Role}Auth format (e.g.,\nAdminAuth, UserAuth). This decorator will be used as a parameter\ndecorator in Controller methods to automatically authenticate and\nauthorize users for the specific role, injecting the authenticated user\npayload as a method parameter.",
|
|
447
|
+
type: "string"
|
|
448
|
+
},
|
|
449
|
+
code: {
|
|
450
|
+
description: "The TypeScript code for the Payload type in {Role}Payload format (e.g.,\nAdminPayload, UserPayload). This interface defines the structure of the\nauthenticated user data that will be injected into Controller methods\nwhen using the decorator. It serves as the TypeScript type for the\nparameter in Controller method signatures.",
|
|
451
|
+
type: "string"
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
required: [
|
|
455
|
+
"name",
|
|
456
|
+
"code"
|
|
457
|
+
]
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
validate: (() => { const _io0 = input => "object" === typeof input.provider && null !== input.provider && _io1(input.provider) && ("object" === typeof input.decorator && null !== input.decorator && _io2(input.decorator)) && ("object" === typeof input.decoratorType && null !== input.decoratorType && _io3(input.decoratorType)); const _io1 = input => "string" === typeof input.name && "string" === typeof input.code; const _io2 = input => "string" === typeof input.name && "string" === typeof input.code; const _io3 = input => "string" === typeof input.name && "string" === typeof input.code; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.provider && null !== input.provider || _report(_exceptionable, {
|
|
462
|
+
path: _path + ".provider",
|
|
463
|
+
expected: "IAutoBeRealizeDecoratorApplication.IProvider",
|
|
464
|
+
value: input.provider
|
|
465
|
+
})) && _vo1(input.provider, _path + ".provider", true && _exceptionable) || _report(_exceptionable, {
|
|
466
|
+
path: _path + ".provider",
|
|
467
|
+
expected: "IAutoBeRealizeDecoratorApplication.IProvider",
|
|
468
|
+
value: input.provider
|
|
469
|
+
}), ("object" === typeof input.decorator && null !== input.decorator || _report(_exceptionable, {
|
|
470
|
+
path: _path + ".decorator",
|
|
471
|
+
expected: "IAutoBeRealizeDecoratorApplication.IDecorator",
|
|
472
|
+
value: input.decorator
|
|
473
|
+
})) && _vo2(input.decorator, _path + ".decorator", true && _exceptionable) || _report(_exceptionable, {
|
|
474
|
+
path: _path + ".decorator",
|
|
475
|
+
expected: "IAutoBeRealizeDecoratorApplication.IDecorator",
|
|
476
|
+
value: input.decorator
|
|
477
|
+
}), ("object" === typeof input.decoratorType && null !== input.decoratorType || _report(_exceptionable, {
|
|
478
|
+
path: _path + ".decoratorType",
|
|
479
|
+
expected: "IAutoBeRealizeDecoratorApplication.IDecoratorType",
|
|
480
|
+
value: input.decoratorType
|
|
481
|
+
})) && _vo3(input.decoratorType, _path + ".decoratorType", true && _exceptionable) || _report(_exceptionable, {
|
|
482
|
+
path: _path + ".decoratorType",
|
|
483
|
+
expected: "IAutoBeRealizeDecoratorApplication.IDecoratorType",
|
|
484
|
+
value: input.decoratorType
|
|
485
|
+
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
|
|
486
|
+
path: _path + ".name",
|
|
487
|
+
expected: "string",
|
|
488
|
+
value: input.name
|
|
489
|
+
}), "string" === typeof input.code || _report(_exceptionable, {
|
|
490
|
+
path: _path + ".code",
|
|
491
|
+
expected: "string",
|
|
492
|
+
value: input.code
|
|
493
|
+
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
|
|
494
|
+
path: _path + ".name",
|
|
495
|
+
expected: "string",
|
|
496
|
+
value: input.name
|
|
497
|
+
}), "string" === typeof input.code || _report(_exceptionable, {
|
|
498
|
+
path: _path + ".code",
|
|
499
|
+
expected: "string",
|
|
500
|
+
value: input.code
|
|
501
|
+
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name || _report(_exceptionable, {
|
|
502
|
+
path: _path + ".name",
|
|
503
|
+
expected: "string",
|
|
504
|
+
value: input.name
|
|
505
|
+
}), "string" === typeof input.code || _report(_exceptionable, {
|
|
506
|
+
path: _path + ".code",
|
|
507
|
+
expected: "string",
|
|
508
|
+
value: input.code
|
|
509
|
+
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
510
|
+
if (false === __is(input)) {
|
|
511
|
+
errors = [];
|
|
512
|
+
_report = __typia_transform__validateReport._validateReport(errors);
|
|
513
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
514
|
+
path: _path + "",
|
|
515
|
+
expected: "IAutoBeRealizeDecoratorApplication.IProps",
|
|
516
|
+
value: input
|
|
517
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
518
|
+
path: _path + "",
|
|
519
|
+
expected: "IAutoBeRealizeDecoratorApplication.IProps",
|
|
520
|
+
value: input
|
|
521
|
+
}))(input, "$input", true);
|
|
522
|
+
const success = 0 === errors.length;
|
|
523
|
+
return success ? {
|
|
524
|
+
success,
|
|
525
|
+
data: input
|
|
526
|
+
} : {
|
|
527
|
+
success,
|
|
528
|
+
errors,
|
|
529
|
+
data: input
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
return {
|
|
533
|
+
success: true,
|
|
534
|
+
data: input
|
|
535
|
+
};
|
|
536
|
+
}; })()
|
|
537
|
+
}
|
|
538
|
+
]
|
|
539
|
+
},
|
|
540
|
+
claude,
|
|
541
|
+
llama: claude,
|
|
542
|
+
deepseek: claude,
|
|
543
|
+
"3.1": claude,
|
|
544
|
+
};
|
|
545
|
+
//# sourceMappingURL=orchestrateRealizeDecorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrateRealizeDecorator.js","sourceRoot":"","sources":["../../../src/orchestrate/realize/orchestrateRealizeDecorator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,kEAgEC;;AAxFD,yCAAoE;AAMpE,2DAA6B;AAC7B,gDAAwB;AAExB,kDAA0B;AAG1B,uEAAoE;AACpE,iEAA8D;AAE9D,2EAAiF;AACjF,2GAAwG;AAExG;;;;;GAKG;AACH,SAAsB,2BAA2B,CAG/C,GAAyB;;;QAEzB,MAAM,KAAK,GACT,MAAA,MAAA,MAAA,GAAG;aACA,KAAK,EAAE;aACP,SAAS,0CAAE,QAAQ,CAAC,UAAU,CAAC,aAAa,0CAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,mCACzE,EAAE,CAAC;QAEL,MAAM,UAAU,GAAgD,EAAE,CAAC;QAEnE,IAAI,SAAS,GAAG,CAAC,CAAC;QAElB,MAAM,aAAa,GAAG;YACpB,iBAAiB,EAAE,MAAM,kBAAE,CAAC,QAAQ,CAClC,cAAI,CAAC,IAAI,CACP,SAAS,EACT,2DAA2D,CAC5D,EACD,OAAO,CACR;YACD,qCAAqC,EAAE,MAAM,kBAAE,CAAC,QAAQ,CACtD,cAAI,CAAC,IAAI,CACP,SAAS,EACT,y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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIJ;IACH,MAAM;IACN,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,MAAM;CACd,CAAC"}
|
|
@@ -28,7 +28,7 @@ export declare namespace IAutoBeRealizeCoderApplication {
|
|
|
28
28
|
* logic.
|
|
29
29
|
*/
|
|
30
30
|
interface RealizeCoderOutput {
|
|
31
|
-
/**
|
|
31
|
+
/** @ignore */
|
|
32
32
|
filename: string;
|
|
33
33
|
/**
|
|
34
34
|
* 🧠 Provider Function Implementation Plan
|
|
@@ -63,9 +63,9 @@ export declare namespace IAutoBeRealizeCoderApplication {
|
|
|
63
63
|
*
|
|
64
64
|
* ⚠️ TypeScript-specific considerations:
|
|
65
65
|
*
|
|
66
|
-
* - Do **not** use native `Date` objects directly; convert all dates
|
|
67
|
-
* `.toISOString()`
|
|
68
|
-
*
|
|
66
|
+
* - Do **not** use native `Date` objects directly; always convert all dates
|
|
67
|
+
* to ISO strings with `.toISOString()` and brand as `string &
|
|
68
|
+
* tags.Format<'date-time'>`. This rule applies throughout all phases.
|
|
69
69
|
* - Prefer `satisfies` for DTO conformance instead of unsafe `as` casts
|
|
70
70
|
* - Avoid weak typing such as `any`, `as any`, or `satisfies any`
|
|
71
71
|
* - Use branded types (e.g., `tags.Format<'uuid'>`) and literal unions where
|
|
@@ -101,7 +101,7 @@ export declare namespace IAutoBeRealizeCoderApplication {
|
|
|
101
101
|
* - Using `?? undefined` to normalize nullable fields.
|
|
102
102
|
* - Applying correct relation handling (e.g., `connect` instead of direct
|
|
103
103
|
* foreign key assignment).
|
|
104
|
-
* - Ensuring
|
|
104
|
+
* - Ensuring all date fields use `.toISOString()` and proper branding.
|
|
105
105
|
* - Include fallback or workaround plans if a direct fix is complex.
|
|
106
106
|
* - If no error is present, simply omit this section.
|
|
107
107
|
*
|
|
@@ -136,9 +136,10 @@ export declare namespace IAutoBeRealizeCoderApplication {
|
|
|
136
136
|
*
|
|
137
137
|
* - Avoid using the `any` type at all costs to ensure type safety.
|
|
138
138
|
* - Do NOT assign native `Date` objects directly; always convert dates using
|
|
139
|
-
* `.toISOString()` before assignment.
|
|
139
|
+
* `.toISOString()` before assignment and apply proper branding.
|
|
140
140
|
* - Maintain a single-function structure; avoid using classes.
|
|
141
141
|
*/
|
|
142
|
+
draft_without_date_type: string;
|
|
142
143
|
/**
|
|
143
144
|
* 🔍 Phase 2: Review code
|
|
144
145
|
*
|
|
@@ -164,9 +165,11 @@ export declare namespace IAutoBeRealizeCoderApplication {
|
|
|
164
165
|
*
|
|
165
166
|
* ✅ Must:
|
|
166
167
|
*
|
|
167
|
-
* -
|
|
168
|
+
* - Only include this field if TypeScript errors are detected in the Review
|
|
169
|
+
* phase.
|
|
170
|
+
* - Resolve all TypeScript errors without using `as any`.
|
|
168
171
|
* - Provide safe brand casting only if required (e.g., `as string &
|
|
169
|
-
* tags.Format<'uuid'>`)
|
|
172
|
+
* tags.Format<'uuid'>`).
|
|
170
173
|
*/
|
|
171
174
|
withCompilerFeedback?: string;
|
|
172
175
|
/**
|
|
@@ -176,7 +179,7 @@ export declare namespace IAutoBeRealizeCoderApplication {
|
|
|
176
179
|
*
|
|
177
180
|
* - Passes strict type checking without errors.
|
|
178
181
|
* - Uses only safe branding or literal type assertions.
|
|
179
|
-
* - Converts all
|
|
182
|
+
* - Converts all date values properly to ISO string format.
|
|
180
183
|
* - Follows DTO structures using `satisfies`.
|
|
181
184
|
* - Avoids any weak typing such as `any`, `as any`, or `satisfies any`.
|
|
182
185
|
* - Uses only allowed imports (e.g., from `src/api/structures` and
|