ide-assi 0.110.0 → 0.112.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/dist/bundle.cjs.js +19 -39
- package/dist/bundle.esm.js +19 -39
- package/dist/components/ideAi.js +26 -31
- package/package.json +1 -1
- package/src/components/ideAi.js +26 -31
package/dist/bundle.cjs.js
CHANGED
|
@@ -193510,49 +193510,21 @@ class IdeAi
|
|
|
193510
193510
|
return o;
|
|
193511
193511
|
};
|
|
193512
193512
|
|
|
193513
|
-
#
|
|
193513
|
+
#generateRealFile = async (filePath, src) => {
|
|
193514
193514
|
|
|
193515
|
-
const
|
|
193516
|
-
|
|
193517
|
-
"namespace": namespace,
|
|
193518
|
-
"tableDefinitions": tableDefinitions
|
|
193519
|
-
});
|
|
193520
|
-
|
|
193521
|
-
await fetch(`/api/source/tmpl/generateFile`, {
|
|
193522
|
-
method: "POST",
|
|
193523
|
-
headers: { "Content-Type": "application/json" },
|
|
193524
|
-
body: JSON.stringify({
|
|
193525
|
-
fileNm: "mybatis.xml",
|
|
193526
|
-
contents: src,
|
|
193527
|
-
})
|
|
193528
|
-
});
|
|
193529
|
-
|
|
193530
|
-
return src;
|
|
193531
|
-
};
|
|
193532
|
-
|
|
193533
|
-
#generateService = async (params) => {
|
|
193534
|
-
|
|
193535
|
-
const src = await this.#invoke('/prompts/meta/BuildService.txt', params);
|
|
193536
|
-
|
|
193537
|
-
const response3 = await fetch(`/api/source/tmpl/generateFile`, {
|
|
193538
|
-
method: "POST",
|
|
193539
|
-
headers: { "Content-Type": "application/json" },
|
|
193540
|
-
body: JSON.stringify({
|
|
193541
|
-
fileNm: "service.java",
|
|
193542
|
-
contents: src,
|
|
193543
|
-
})
|
|
193544
|
-
});
|
|
193515
|
+
const path = "ide-assi-be/tmpl/mybatis.xml";
|
|
193516
|
+
const template = await fetch(path).then(res => res.text());
|
|
193545
193517
|
|
|
193546
|
-
console.log(
|
|
193518
|
+
console.log(template);
|
|
193547
193519
|
|
|
193548
|
-
return
|
|
193520
|
+
return;
|
|
193549
193521
|
};
|
|
193550
193522
|
|
|
193551
|
-
#
|
|
193523
|
+
#generateTmplFile = async (promptFile, generateFileName, params) => {
|
|
193552
193524
|
|
|
193553
193525
|
const src = await this.#invoke(promptFile, params);
|
|
193554
193526
|
|
|
193555
|
-
await fetch(`/api/source/
|
|
193527
|
+
await fetch(`/api/source/generateTmplFile`, {
|
|
193556
193528
|
method: "POST",
|
|
193557
193529
|
headers: { "Content-Type": "application/json" },
|
|
193558
193530
|
body: JSON.stringify({
|
|
@@ -193578,14 +193550,14 @@ class IdeAi
|
|
|
193578
193550
|
const columnInfo = await this.#getColumnInfo(where.table);
|
|
193579
193551
|
|
|
193580
193552
|
//const mybatisXmlSource = await this.#generateMyBatis(userPrompt, where.package, columnInfo);
|
|
193581
|
-
const mybatisXmlSource = await this.#
|
|
193553
|
+
const mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/BuildMyBatisMapper.txt", "mybatis.xml", {
|
|
193582
193554
|
"userPrompt": userPrompt,
|
|
193583
193555
|
"namespace": where.package,
|
|
193584
193556
|
"tableDefinitions": columnInfo
|
|
193585
193557
|
});
|
|
193586
193558
|
this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
|
|
193587
193559
|
|
|
193588
|
-
const serviceSrc = await this.#
|
|
193560
|
+
const serviceSrc = await this.#generateTmplFile("/prompts/meta/BuildService.txt", "service.java", {
|
|
193589
193561
|
userPrompt: userPrompt,
|
|
193590
193562
|
menuUrl: where.menu.url,
|
|
193591
193563
|
classPackage: "ide.assi.be." + where.package + ".service",
|
|
@@ -193594,15 +193566,23 @@ class IdeAi
|
|
|
193594
193566
|
});
|
|
193595
193567
|
this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
|
|
193596
193568
|
|
|
193597
|
-
await this.#
|
|
193569
|
+
const controllerSrc = await this.#generateTmplFile("/prompts/meta/BuildController.txt", "controller.java", {
|
|
193598
193570
|
userPrompt: userPrompt,
|
|
193599
193571
|
menuUrl: where.menu.url,
|
|
193600
193572
|
classPackage: "ide.assi.be." + where.package + ".controller",
|
|
193601
193573
|
namespace: where.package,
|
|
193602
193574
|
serviceSource: serviceSrc,
|
|
193603
193575
|
});
|
|
193604
|
-
this.#parent.addMessage("Java(
|
|
193576
|
+
this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
|
|
193577
|
+
|
|
193578
|
+
await this.#generateTmplFile("/prompts/meta/BuildReactJsx.txt", "react.jsx", {
|
|
193579
|
+
userPrompt: userPrompt,
|
|
193580
|
+
menuUrl: where.menu.url,
|
|
193581
|
+
controllerSource: controllerSrc,
|
|
193582
|
+
});
|
|
193583
|
+
this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
|
|
193605
193584
|
|
|
193585
|
+
await this.#generateRealFile();
|
|
193606
193586
|
|
|
193607
193587
|
return "OK";
|
|
193608
193588
|
}
|
package/dist/bundle.esm.js
CHANGED
|
@@ -193506,49 +193506,21 @@ class IdeAi
|
|
|
193506
193506
|
return o;
|
|
193507
193507
|
};
|
|
193508
193508
|
|
|
193509
|
-
#
|
|
193509
|
+
#generateRealFile = async (filePath, src) => {
|
|
193510
193510
|
|
|
193511
|
-
const
|
|
193512
|
-
|
|
193513
|
-
"namespace": namespace,
|
|
193514
|
-
"tableDefinitions": tableDefinitions
|
|
193515
|
-
});
|
|
193516
|
-
|
|
193517
|
-
await fetch(`/api/source/tmpl/generateFile`, {
|
|
193518
|
-
method: "POST",
|
|
193519
|
-
headers: { "Content-Type": "application/json" },
|
|
193520
|
-
body: JSON.stringify({
|
|
193521
|
-
fileNm: "mybatis.xml",
|
|
193522
|
-
contents: src,
|
|
193523
|
-
})
|
|
193524
|
-
});
|
|
193525
|
-
|
|
193526
|
-
return src;
|
|
193527
|
-
};
|
|
193528
|
-
|
|
193529
|
-
#generateService = async (params) => {
|
|
193530
|
-
|
|
193531
|
-
const src = await this.#invoke('/prompts/meta/BuildService.txt', params);
|
|
193532
|
-
|
|
193533
|
-
const response3 = await fetch(`/api/source/tmpl/generateFile`, {
|
|
193534
|
-
method: "POST",
|
|
193535
|
-
headers: { "Content-Type": "application/json" },
|
|
193536
|
-
body: JSON.stringify({
|
|
193537
|
-
fileNm: "service.java",
|
|
193538
|
-
contents: src,
|
|
193539
|
-
})
|
|
193540
|
-
});
|
|
193511
|
+
const path = "ide-assi-be/tmpl/mybatis.xml";
|
|
193512
|
+
const template = await fetch(path).then(res => res.text());
|
|
193541
193513
|
|
|
193542
|
-
console.log(
|
|
193514
|
+
console.log(template);
|
|
193543
193515
|
|
|
193544
|
-
return
|
|
193516
|
+
return;
|
|
193545
193517
|
};
|
|
193546
193518
|
|
|
193547
|
-
#
|
|
193519
|
+
#generateTmplFile = async (promptFile, generateFileName, params) => {
|
|
193548
193520
|
|
|
193549
193521
|
const src = await this.#invoke(promptFile, params);
|
|
193550
193522
|
|
|
193551
|
-
await fetch(`/api/source/
|
|
193523
|
+
await fetch(`/api/source/generateTmplFile`, {
|
|
193552
193524
|
method: "POST",
|
|
193553
193525
|
headers: { "Content-Type": "application/json" },
|
|
193554
193526
|
body: JSON.stringify({
|
|
@@ -193574,14 +193546,14 @@ class IdeAi
|
|
|
193574
193546
|
const columnInfo = await this.#getColumnInfo(where.table);
|
|
193575
193547
|
|
|
193576
193548
|
//const mybatisXmlSource = await this.#generateMyBatis(userPrompt, where.package, columnInfo);
|
|
193577
|
-
const mybatisXmlSource = await this.#
|
|
193549
|
+
const mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/BuildMyBatisMapper.txt", "mybatis.xml", {
|
|
193578
193550
|
"userPrompt": userPrompt,
|
|
193579
193551
|
"namespace": where.package,
|
|
193580
193552
|
"tableDefinitions": columnInfo
|
|
193581
193553
|
});
|
|
193582
193554
|
this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
|
|
193583
193555
|
|
|
193584
|
-
const serviceSrc = await this.#
|
|
193556
|
+
const serviceSrc = await this.#generateTmplFile("/prompts/meta/BuildService.txt", "service.java", {
|
|
193585
193557
|
userPrompt: userPrompt,
|
|
193586
193558
|
menuUrl: where.menu.url,
|
|
193587
193559
|
classPackage: "ide.assi.be." + where.package + ".service",
|
|
@@ -193590,15 +193562,23 @@ class IdeAi
|
|
|
193590
193562
|
});
|
|
193591
193563
|
this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
|
|
193592
193564
|
|
|
193593
|
-
await this.#
|
|
193565
|
+
const controllerSrc = await this.#generateTmplFile("/prompts/meta/BuildController.txt", "controller.java", {
|
|
193594
193566
|
userPrompt: userPrompt,
|
|
193595
193567
|
menuUrl: where.menu.url,
|
|
193596
193568
|
classPackage: "ide.assi.be." + where.package + ".controller",
|
|
193597
193569
|
namespace: where.package,
|
|
193598
193570
|
serviceSource: serviceSrc,
|
|
193599
193571
|
});
|
|
193600
|
-
this.#parent.addMessage("Java(
|
|
193572
|
+
this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
|
|
193573
|
+
|
|
193574
|
+
await this.#generateTmplFile("/prompts/meta/BuildReactJsx.txt", "react.jsx", {
|
|
193575
|
+
userPrompt: userPrompt,
|
|
193576
|
+
menuUrl: where.menu.url,
|
|
193577
|
+
controllerSource: controllerSrc,
|
|
193578
|
+
});
|
|
193579
|
+
this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
|
|
193601
193580
|
|
|
193581
|
+
await this.#generateRealFile();
|
|
193602
193582
|
|
|
193603
193583
|
return "OK";
|
|
193604
193584
|
}
|
package/dist/components/ideAi.js
CHANGED
|
@@ -4,6 +4,7 @@ import { HumanMessage, SystemMessage } from '@langchain/core/messages';
|
|
|
4
4
|
import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
|
|
5
5
|
import { Ollama } from "@langchain/ollama";
|
|
6
6
|
import { ChatOpenAI } from '@langchain/openai';
|
|
7
|
+
import {PromptTemplate} from "@langchain/core/prompts";
|
|
7
8
|
|
|
8
9
|
export class IdeAi
|
|
9
10
|
{
|
|
@@ -215,49 +216,35 @@ export class IdeAi
|
|
|
215
216
|
return o;
|
|
216
217
|
};
|
|
217
218
|
|
|
218
|
-
#
|
|
219
|
+
#generateRealFile = async (filePath, src) => {
|
|
219
220
|
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
"namespace": namespace,
|
|
223
|
-
"tableDefinitions": tableDefinitions
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
await fetch(`/api/source/tmpl/generateFile`, {
|
|
227
|
-
method: "POST",
|
|
228
|
-
headers: { "Content-Type": "application/json" },
|
|
229
|
-
body: JSON.stringify({
|
|
230
|
-
fileNm: "mybatis.xml",
|
|
231
|
-
contents: src,
|
|
232
|
-
})
|
|
233
|
-
});
|
|
221
|
+
const path = "ide-assi-be/tmpl/mybatis.xml";
|
|
222
|
+
const template = await fetch(path).then(res => res.text());
|
|
234
223
|
|
|
235
|
-
|
|
236
|
-
};
|
|
224
|
+
console.log(template);
|
|
237
225
|
|
|
238
|
-
|
|
226
|
+
return;
|
|
239
227
|
|
|
240
|
-
|
|
228
|
+
return await new PromptTemplate({
|
|
229
|
+
template,
|
|
230
|
+
inputVariables: Object.keys(params),
|
|
231
|
+
}).format(params);
|
|
241
232
|
|
|
242
|
-
const response3 = await fetch(`/api/source/
|
|
233
|
+
const response3 = await fetch(`/api/source/generateRealFile`, {
|
|
243
234
|
method: "POST",
|
|
244
235
|
headers: { "Content-Type": "application/json" },
|
|
245
236
|
body: JSON.stringify({
|
|
246
|
-
fileNm:
|
|
237
|
+
fileNm: filePath,
|
|
247
238
|
contents: src,
|
|
248
239
|
})
|
|
249
240
|
});
|
|
250
|
-
|
|
251
|
-
console.log(response3);
|
|
252
|
-
|
|
253
|
-
return "";
|
|
254
241
|
};
|
|
255
242
|
|
|
256
|
-
#
|
|
243
|
+
#generateTmplFile = async (promptFile, generateFileName, params) => {
|
|
257
244
|
|
|
258
245
|
const src = await this.#invoke(promptFile, params);
|
|
259
246
|
|
|
260
|
-
const response3 = await fetch(`/api/source/
|
|
247
|
+
const response3 = await fetch(`/api/source/generateTmplFile`, {
|
|
261
248
|
method: "POST",
|
|
262
249
|
headers: { "Content-Type": "application/json" },
|
|
263
250
|
body: JSON.stringify({
|
|
@@ -283,14 +270,14 @@ export class IdeAi
|
|
|
283
270
|
const columnInfo = await this.#getColumnInfo(where.table);
|
|
284
271
|
|
|
285
272
|
//const mybatisXmlSource = await this.#generateMyBatis(userPrompt, where.package, columnInfo);
|
|
286
|
-
const mybatisXmlSource = await this.#
|
|
273
|
+
const mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/BuildMyBatisMapper.txt", "mybatis.xml", {
|
|
287
274
|
"userPrompt": userPrompt,
|
|
288
275
|
"namespace": where.package,
|
|
289
276
|
"tableDefinitions": columnInfo
|
|
290
277
|
});
|
|
291
278
|
this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
|
|
292
279
|
|
|
293
|
-
const serviceSrc = await this.#
|
|
280
|
+
const serviceSrc = await this.#generateTmplFile("/prompts/meta/BuildService.txt", "service.java", {
|
|
294
281
|
userPrompt: userPrompt,
|
|
295
282
|
menuUrl: where.menu.url,
|
|
296
283
|
classPackage: "ide.assi.be." + where.package + ".service",
|
|
@@ -299,15 +286,23 @@ export class IdeAi
|
|
|
299
286
|
});
|
|
300
287
|
this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
|
|
301
288
|
|
|
302
|
-
const controllerSrc = await this.#
|
|
289
|
+
const controllerSrc = await this.#generateTmplFile("/prompts/meta/BuildController.txt", "controller.java", {
|
|
303
290
|
userPrompt: userPrompt,
|
|
304
291
|
menuUrl: where.menu.url,
|
|
305
292
|
classPackage: "ide.assi.be." + where.package + ".controller",
|
|
306
293
|
namespace: where.package,
|
|
307
294
|
serviceSource: serviceSrc,
|
|
308
295
|
});
|
|
309
|
-
this.#parent.addMessage("Java(
|
|
296
|
+
this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
|
|
297
|
+
|
|
298
|
+
const jsSrc = await this.#generateTmplFile("/prompts/meta/BuildReactJsx.txt", "react.jsx", {
|
|
299
|
+
userPrompt: userPrompt,
|
|
300
|
+
menuUrl: where.menu.url,
|
|
301
|
+
controllerSource: controllerSrc,
|
|
302
|
+
});
|
|
303
|
+
this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
|
|
310
304
|
|
|
305
|
+
await this.#generateRealFile();
|
|
311
306
|
|
|
312
307
|
return "OK";
|
|
313
308
|
}
|
package/package.json
CHANGED
package/src/components/ideAi.js
CHANGED
|
@@ -4,6 +4,7 @@ import { HumanMessage, SystemMessage } from '@langchain/core/messages';
|
|
|
4
4
|
import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
|
|
5
5
|
import { Ollama } from "@langchain/ollama";
|
|
6
6
|
import { ChatOpenAI } from '@langchain/openai';
|
|
7
|
+
import {PromptTemplate} from "@langchain/core/prompts";
|
|
7
8
|
|
|
8
9
|
export class IdeAi
|
|
9
10
|
{
|
|
@@ -215,49 +216,35 @@ export class IdeAi
|
|
|
215
216
|
return o;
|
|
216
217
|
};
|
|
217
218
|
|
|
218
|
-
#
|
|
219
|
+
#generateRealFile = async (filePath, src) => {
|
|
219
220
|
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
"namespace": namespace,
|
|
223
|
-
"tableDefinitions": tableDefinitions
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
await fetch(`/api/source/tmpl/generateFile`, {
|
|
227
|
-
method: "POST",
|
|
228
|
-
headers: { "Content-Type": "application/json" },
|
|
229
|
-
body: JSON.stringify({
|
|
230
|
-
fileNm: "mybatis.xml",
|
|
231
|
-
contents: src,
|
|
232
|
-
})
|
|
233
|
-
});
|
|
221
|
+
const path = "ide-assi-be/tmpl/mybatis.xml";
|
|
222
|
+
const template = await fetch(path).then(res => res.text());
|
|
234
223
|
|
|
235
|
-
|
|
236
|
-
};
|
|
224
|
+
console.log(template);
|
|
237
225
|
|
|
238
|
-
|
|
226
|
+
return;
|
|
239
227
|
|
|
240
|
-
|
|
228
|
+
return await new PromptTemplate({
|
|
229
|
+
template,
|
|
230
|
+
inputVariables: Object.keys(params),
|
|
231
|
+
}).format(params);
|
|
241
232
|
|
|
242
|
-
const response3 = await fetch(`/api/source/
|
|
233
|
+
const response3 = await fetch(`/api/source/generateRealFile`, {
|
|
243
234
|
method: "POST",
|
|
244
235
|
headers: { "Content-Type": "application/json" },
|
|
245
236
|
body: JSON.stringify({
|
|
246
|
-
fileNm:
|
|
237
|
+
fileNm: filePath,
|
|
247
238
|
contents: src,
|
|
248
239
|
})
|
|
249
240
|
});
|
|
250
|
-
|
|
251
|
-
console.log(response3);
|
|
252
|
-
|
|
253
|
-
return "";
|
|
254
241
|
};
|
|
255
242
|
|
|
256
|
-
#
|
|
243
|
+
#generateTmplFile = async (promptFile, generateFileName, params) => {
|
|
257
244
|
|
|
258
245
|
const src = await this.#invoke(promptFile, params);
|
|
259
246
|
|
|
260
|
-
const response3 = await fetch(`/api/source/
|
|
247
|
+
const response3 = await fetch(`/api/source/generateTmplFile`, {
|
|
261
248
|
method: "POST",
|
|
262
249
|
headers: { "Content-Type": "application/json" },
|
|
263
250
|
body: JSON.stringify({
|
|
@@ -283,14 +270,14 @@ export class IdeAi
|
|
|
283
270
|
const columnInfo = await this.#getColumnInfo(where.table);
|
|
284
271
|
|
|
285
272
|
//const mybatisXmlSource = await this.#generateMyBatis(userPrompt, where.package, columnInfo);
|
|
286
|
-
const mybatisXmlSource = await this.#
|
|
273
|
+
const mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/BuildMyBatisMapper.txt", "mybatis.xml", {
|
|
287
274
|
"userPrompt": userPrompt,
|
|
288
275
|
"namespace": where.package,
|
|
289
276
|
"tableDefinitions": columnInfo
|
|
290
277
|
});
|
|
291
278
|
this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
|
|
292
279
|
|
|
293
|
-
const serviceSrc = await this.#
|
|
280
|
+
const serviceSrc = await this.#generateTmplFile("/prompts/meta/BuildService.txt", "service.java", {
|
|
294
281
|
userPrompt: userPrompt,
|
|
295
282
|
menuUrl: where.menu.url,
|
|
296
283
|
classPackage: "ide.assi.be." + where.package + ".service",
|
|
@@ -299,15 +286,23 @@ export class IdeAi
|
|
|
299
286
|
});
|
|
300
287
|
this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
|
|
301
288
|
|
|
302
|
-
const controllerSrc = await this.#
|
|
289
|
+
const controllerSrc = await this.#generateTmplFile("/prompts/meta/BuildController.txt", "controller.java", {
|
|
303
290
|
userPrompt: userPrompt,
|
|
304
291
|
menuUrl: where.menu.url,
|
|
305
292
|
classPackage: "ide.assi.be." + where.package + ".controller",
|
|
306
293
|
namespace: where.package,
|
|
307
294
|
serviceSource: serviceSrc,
|
|
308
295
|
});
|
|
309
|
-
this.#parent.addMessage("Java(
|
|
296
|
+
this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
|
|
297
|
+
|
|
298
|
+
const jsSrc = await this.#generateTmplFile("/prompts/meta/BuildReactJsx.txt", "react.jsx", {
|
|
299
|
+
userPrompt: userPrompt,
|
|
300
|
+
menuUrl: where.menu.url,
|
|
301
|
+
controllerSource: controllerSrc,
|
|
302
|
+
});
|
|
303
|
+
this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
|
|
310
304
|
|
|
305
|
+
await this.#generateRealFile();
|
|
311
306
|
|
|
312
307
|
return "OK";
|
|
313
308
|
}
|