ide-assi 0.194.0 → 0.195.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.
@@ -193410,6 +193410,45 @@ class IdeUtils
193410
193410
  };
193411
193411
  }
193412
193412
 
193413
+ class IdeFetch {
193414
+
193415
+ static #request = (method, url, data = {}) => {
193416
+
193417
+ //console.log(method, url, data);
193418
+
193419
+ if (method === "GET") url += `?${new URLSearchParams(data)}`;
193420
+
193421
+ const options = {
193422
+ method,
193423
+ headers: { "Content-Type": "application/json" }
193424
+ };
193425
+
193426
+ if (method !== "GET") {
193427
+ options.body = JSON.stringify(data);
193428
+ }
193429
+
193430
+ return fetch(url, options)
193431
+ .then(res => {
193432
+ if (!res.ok) {
193433
+ return res.text().then(text => {
193434
+ throw new Error(`API 오류 (${res.status}): ${text}`);
193435
+ });
193436
+ }
193437
+ return res.json();
193438
+ })
193439
+ .catch(err => {
193440
+ console.error(`[fetch.${method.toLowerCase()}] ${url} 실패:`, err);
193441
+ throw err;
193442
+ });
193443
+ };
193444
+
193445
+ static get = (url, data = {}) => IdeFetch.#request("GET", url, data);
193446
+
193447
+ static post = (url, data = {}) => IdeFetch.#request("POST", url, data);
193448
+ }
193449
+
193450
+ const api = IdeFetch;
193451
+
193413
193452
  class IdeAi
193414
193453
  {
193415
193454
  #API_URL = "http://localhost:8091";
@@ -193653,6 +193692,11 @@ class IdeAi
193653
193692
 
193654
193693
  const src = await this.#invoke(promptFile, params);
193655
193694
 
193695
+ await api.post(`/api/source/generateTmplFile`, {
193696
+ fileNm: generateFileName,
193697
+ contents: src,
193698
+ });
193699
+ /**
193656
193700
  await fetch(`/api/source/generateTmplFile`, {
193657
193701
  method: "POST",
193658
193702
  headers: { "Content-Type": "application/json" },
@@ -193661,6 +193705,7 @@ class IdeAi
193661
193705
  contents: src,
193662
193706
  })
193663
193707
  });
193708
+ */
193664
193709
 
193665
193710
  return src;
193666
193711
  };
@@ -193675,23 +193720,31 @@ class IdeAi
193675
193720
 
193676
193721
  const where = await this.#where(userPrompt, this.#getMenuInfo(), await this.#getTableList());
193677
193722
  this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
193723
+
193724
+
193678
193725
  console.log(where);
193679
193726
 
193680
- return "OKKKK";
193727
+ const srcPath = IdeUtils.getSourcePath(where.menu.url);
193728
+
193729
+ console.log(srcPath);
193730
+
193731
+
193681
193732
 
193682
193733
  const columnInfo = await this.#getColumnInfo(where.table);
193683
193734
 
193684
- const namespace = where.package;
193735
+ //const namespace = where.package;
193685
193736
  const classPackage = "ide.assi.be." + where.package.split(".").slice(0, -1).join(".");
193686
193737
 
193687
193738
  //const mybatisXmlSource = await this.#generateMyBatis(userPrompt, where.package, columnInfo);
193688
193739
  const mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/BuildMyBatisMapper.txt", "mybatis.xml", {
193689
193740
  "userPrompt": userPrompt,
193690
- "namespace": namespace,
193741
+ "namespace": srcPath.namespace,
193691
193742
  "tableDefinitions": columnInfo
193692
193743
  });
193693
193744
  this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
193694
193745
 
193746
+ return "OKKKK";
193747
+
193695
193748
  const serviceSrc = await this.#generateTmplFile("/prompts/meta/BuildService.txt", "service.java", {
193696
193749
  userPrompt: userPrompt,
193697
193750
  menuUrl: where.menu.url,
@@ -193731,45 +193784,6 @@ class IdeAi
193731
193784
  }
193732
193785
  }
193733
193786
 
193734
- class IdeFetch {
193735
-
193736
- static #request = (method, url, data = {}) => {
193737
-
193738
- //console.log(method, url, data);
193739
-
193740
- if (method === "GET") url += `?${new URLSearchParams(data)}`;
193741
-
193742
- const options = {
193743
- method,
193744
- headers: { "Content-Type": "application/json" }
193745
- };
193746
-
193747
- if (method !== "GET") {
193748
- options.body = JSON.stringify(data);
193749
- }
193750
-
193751
- return fetch(url, options)
193752
- .then(res => {
193753
- if (!res.ok) {
193754
- return res.text().then(text => {
193755
- throw new Error(`API 오류 (${res.status}): ${text}`);
193756
- });
193757
- }
193758
- return res.json();
193759
- })
193760
- .catch(err => {
193761
- console.error(`[fetch.${method.toLowerCase()}] ${url} 실패:`, err);
193762
- throw err;
193763
- });
193764
- };
193765
-
193766
- static get = (url, data = {}) => IdeFetch.#request("GET", url, data);
193767
-
193768
- static post = (url, data = {}) => IdeFetch.#request("POST", url, data);
193769
- }
193770
-
193771
- const api = IdeFetch;
193772
-
193773
193787
  class IdeAssi extends HTMLElement
193774
193788
  {
193775
193789
  #ing = false;
@@ -193406,6 +193406,45 @@ class IdeUtils
193406
193406
  };
193407
193407
  }
193408
193408
 
193409
+ class IdeFetch {
193410
+
193411
+ static #request = (method, url, data = {}) => {
193412
+
193413
+ //console.log(method, url, data);
193414
+
193415
+ if (method === "GET") url += `?${new URLSearchParams(data)}`;
193416
+
193417
+ const options = {
193418
+ method,
193419
+ headers: { "Content-Type": "application/json" }
193420
+ };
193421
+
193422
+ if (method !== "GET") {
193423
+ options.body = JSON.stringify(data);
193424
+ }
193425
+
193426
+ return fetch(url, options)
193427
+ .then(res => {
193428
+ if (!res.ok) {
193429
+ return res.text().then(text => {
193430
+ throw new Error(`API 오류 (${res.status}): ${text}`);
193431
+ });
193432
+ }
193433
+ return res.json();
193434
+ })
193435
+ .catch(err => {
193436
+ console.error(`[fetch.${method.toLowerCase()}] ${url} 실패:`, err);
193437
+ throw err;
193438
+ });
193439
+ };
193440
+
193441
+ static get = (url, data = {}) => IdeFetch.#request("GET", url, data);
193442
+
193443
+ static post = (url, data = {}) => IdeFetch.#request("POST", url, data);
193444
+ }
193445
+
193446
+ const api = IdeFetch;
193447
+
193409
193448
  class IdeAi
193410
193449
  {
193411
193450
  #API_URL = "http://localhost:8091";
@@ -193649,6 +193688,11 @@ class IdeAi
193649
193688
 
193650
193689
  const src = await this.#invoke(promptFile, params);
193651
193690
 
193691
+ await api.post(`/api/source/generateTmplFile`, {
193692
+ fileNm: generateFileName,
193693
+ contents: src,
193694
+ });
193695
+ /**
193652
193696
  await fetch(`/api/source/generateTmplFile`, {
193653
193697
  method: "POST",
193654
193698
  headers: { "Content-Type": "application/json" },
@@ -193657,6 +193701,7 @@ class IdeAi
193657
193701
  contents: src,
193658
193702
  })
193659
193703
  });
193704
+ */
193660
193705
 
193661
193706
  return src;
193662
193707
  };
@@ -193671,23 +193716,31 @@ class IdeAi
193671
193716
 
193672
193717
  const where = await this.#where(userPrompt, this.#getMenuInfo(), await this.#getTableList());
193673
193718
  this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
193719
+
193720
+
193674
193721
  console.log(where);
193675
193722
 
193676
- return "OKKKK";
193723
+ const srcPath = IdeUtils.getSourcePath(where.menu.url);
193724
+
193725
+ console.log(srcPath);
193726
+
193727
+
193677
193728
 
193678
193729
  const columnInfo = await this.#getColumnInfo(where.table);
193679
193730
 
193680
- const namespace = where.package;
193731
+ //const namespace = where.package;
193681
193732
  const classPackage = "ide.assi.be." + where.package.split(".").slice(0, -1).join(".");
193682
193733
 
193683
193734
  //const mybatisXmlSource = await this.#generateMyBatis(userPrompt, where.package, columnInfo);
193684
193735
  const mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/BuildMyBatisMapper.txt", "mybatis.xml", {
193685
193736
  "userPrompt": userPrompt,
193686
- "namespace": namespace,
193737
+ "namespace": srcPath.namespace,
193687
193738
  "tableDefinitions": columnInfo
193688
193739
  });
193689
193740
  this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
193690
193741
 
193742
+ return "OKKKK";
193743
+
193691
193744
  const serviceSrc = await this.#generateTmplFile("/prompts/meta/BuildService.txt", "service.java", {
193692
193745
  userPrompt: userPrompt,
193693
193746
  menuUrl: where.menu.url,
@@ -193727,45 +193780,6 @@ class IdeAi
193727
193780
  }
193728
193781
  }
193729
193782
 
193730
- class IdeFetch {
193731
-
193732
- static #request = (method, url, data = {}) => {
193733
-
193734
- //console.log(method, url, data);
193735
-
193736
- if (method === "GET") url += `?${new URLSearchParams(data)}`;
193737
-
193738
- const options = {
193739
- method,
193740
- headers: { "Content-Type": "application/json" }
193741
- };
193742
-
193743
- if (method !== "GET") {
193744
- options.body = JSON.stringify(data);
193745
- }
193746
-
193747
- return fetch(url, options)
193748
- .then(res => {
193749
- if (!res.ok) {
193750
- return res.text().then(text => {
193751
- throw new Error(`API 오류 (${res.status}): ${text}`);
193752
- });
193753
- }
193754
- return res.json();
193755
- })
193756
- .catch(err => {
193757
- console.error(`[fetch.${method.toLowerCase()}] ${url} 실패:`, err);
193758
- throw err;
193759
- });
193760
- };
193761
-
193762
- static get = (url, data = {}) => IdeFetch.#request("GET", url, data);
193763
-
193764
- static post = (url, data = {}) => IdeFetch.#request("POST", url, data);
193765
- }
193766
-
193767
- const api = IdeFetch;
193768
-
193769
193783
  class IdeAssi extends HTMLElement
193770
193784
  {
193771
193785
  #ing = false;
@@ -1,10 +1,11 @@
1
1
  import ninegrid from "ninegrid2";
2
2
  import { IdeUtils } from "./ideUtils.js";
3
+ import { api } from "./ideFetch.js";
3
4
  import { HumanMessage, SystemMessage } from '@langchain/core/messages';
4
5
  import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
5
6
  import { Ollama } from "@langchain/ollama";
6
7
  import { ChatOpenAI } from '@langchain/openai';
7
- import {PromptTemplate} from "@langchain/core/prompts";
8
+ import { PromptTemplate } from "@langchain/core/prompts";
8
9
 
9
10
  export class IdeAi
10
11
  {
@@ -263,6 +264,11 @@ export class IdeAi
263
264
 
264
265
  const src = await this.#invoke(promptFile, params);
265
266
 
267
+ await api.post(`/api/source/generateTmplFile`, {
268
+ fileNm: generateFileName,
269
+ contents: src,
270
+ });
271
+ /**
266
272
  await fetch(`/api/source/generateTmplFile`, {
267
273
  method: "POST",
268
274
  headers: { "Content-Type": "application/json" },
@@ -271,6 +277,7 @@ export class IdeAi
271
277
  contents: src,
272
278
  })
273
279
  });
280
+ */
274
281
 
275
282
  return src;
276
283
  };
@@ -284,24 +291,32 @@ export class IdeAi
284
291
  this.#parent.addMessage("명령을 이해했습니다.");
285
292
 
286
293
  const where = await this.#where(userPrompt, this.#getMenuInfo(), await this.#getTableList());
287
- this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
294
+ this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.")
295
+
296
+
288
297
  console.log(where);
289
298
 
290
- return "OKKKK";
299
+ const srcPath = IdeUtils.getSourcePath(where.menu.url);
300
+
301
+ console.log(srcPath);
302
+
303
+
291
304
 
292
305
  const columnInfo = await this.#getColumnInfo(where.table);
293
306
 
294
- const namespace = where.package;
307
+ //const namespace = where.package;
295
308
  const classPackage = "ide.assi.be." + where.package.split(".").slice(0, -1).join(".");
296
309
 
297
310
  //const mybatisXmlSource = await this.#generateMyBatis(userPrompt, where.package, columnInfo);
298
311
  const mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/BuildMyBatisMapper.txt", "mybatis.xml", {
299
312
  "userPrompt": userPrompt,
300
- "namespace": namespace,
313
+ "namespace": srcPath.namespace,
301
314
  "tableDefinitions": columnInfo
302
315
  });
303
316
  this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
304
317
 
318
+ return "OKKKK";
319
+
305
320
  const serviceSrc = await this.#generateTmplFile("/prompts/meta/BuildService.txt", "service.java", {
306
321
  userPrompt: userPrompt,
307
322
  menuUrl: where.menu.url,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.194.0",
4
+ "version": "0.195.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -1,10 +1,11 @@
1
1
  import ninegrid from "ninegrid2";
2
2
  import { IdeUtils } from "./ideUtils.js";
3
+ import { api } from "./ideFetch.js";
3
4
  import { HumanMessage, SystemMessage } from '@langchain/core/messages';
4
5
  import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
5
6
  import { Ollama } from "@langchain/ollama";
6
7
  import { ChatOpenAI } from '@langchain/openai';
7
- import {PromptTemplate} from "@langchain/core/prompts";
8
+ import { PromptTemplate } from "@langchain/core/prompts";
8
9
 
9
10
  export class IdeAi
10
11
  {
@@ -263,6 +264,11 @@ export class IdeAi
263
264
 
264
265
  const src = await this.#invoke(promptFile, params);
265
266
 
267
+ await api.post(`/api/source/generateTmplFile`, {
268
+ fileNm: generateFileName,
269
+ contents: src,
270
+ });
271
+ /**
266
272
  await fetch(`/api/source/generateTmplFile`, {
267
273
  method: "POST",
268
274
  headers: { "Content-Type": "application/json" },
@@ -271,6 +277,7 @@ export class IdeAi
271
277
  contents: src,
272
278
  })
273
279
  });
280
+ */
274
281
 
275
282
  return src;
276
283
  };
@@ -284,24 +291,32 @@ export class IdeAi
284
291
  this.#parent.addMessage("명령을 이해했습니다.");
285
292
 
286
293
  const where = await this.#where(userPrompt, this.#getMenuInfo(), await this.#getTableList());
287
- this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
294
+ this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.")
295
+
296
+
288
297
  console.log(where);
289
298
 
290
- return "OKKKK";
299
+ const srcPath = IdeUtils.getSourcePath(where.menu.url);
300
+
301
+ console.log(srcPath);
302
+
303
+
291
304
 
292
305
  const columnInfo = await this.#getColumnInfo(where.table);
293
306
 
294
- const namespace = where.package;
307
+ //const namespace = where.package;
295
308
  const classPackage = "ide.assi.be." + where.package.split(".").slice(0, -1).join(".");
296
309
 
297
310
  //const mybatisXmlSource = await this.#generateMyBatis(userPrompt, where.package, columnInfo);
298
311
  const mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/BuildMyBatisMapper.txt", "mybatis.xml", {
299
312
  "userPrompt": userPrompt,
300
- "namespace": namespace,
313
+ "namespace": srcPath.namespace,
301
314
  "tableDefinitions": columnInfo
302
315
  });
303
316
  this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
304
317
 
318
+ return "OKKKK";
319
+
305
320
  const serviceSrc = await this.#generateTmplFile("/prompts/meta/BuildService.txt", "service.java", {
306
321
  userPrompt: userPrompt,
307
322
  menuUrl: where.menu.url,