ide-assi 0.296.0 → 0.299.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.
@@ -193310,6 +193310,45 @@ window.jQuery = window.$ = $$1;
193310
193310
 
193311
193311
  //export default new ninegrid();
193312
193312
 
193313
+ class IdeFetch {
193314
+
193315
+ static #request = (method, url, data = {}) => {
193316
+
193317
+ //console.log(method, url, data);
193318
+
193319
+ if (method === "GET") url += `?${new URLSearchParams(data)}`;
193320
+
193321
+ const options = {
193322
+ method,
193323
+ headers: { "Content-Type": "application/json" }
193324
+ };
193325
+
193326
+ if (method !== "GET") {
193327
+ options.body = JSON.stringify(data);
193328
+ }
193329
+
193330
+ return fetch(url, options)
193331
+ .then(res => {
193332
+ if (!res.ok) {
193333
+ return res.text().then(text => {
193334
+ throw new Error(`API 오류 (${res.status}): ${text}`);
193335
+ });
193336
+ }
193337
+ return res.json();
193338
+ })
193339
+ .catch(err => {
193340
+ console.error(`[fetch.${method.toLowerCase()}] ${url} 실패:`, err);
193341
+ throw err;
193342
+ });
193343
+ };
193344
+
193345
+ static get = (url, data = {}) => IdeFetch.#request("GET", url, data);
193346
+
193347
+ static post = (url, data = {}) => IdeFetch.#request("POST", url, data);
193348
+ }
193349
+
193350
+ const api = IdeFetch;
193351
+
193313
193352
  class IdeUtils
193314
193353
  {
193315
193354
  constructor() {
@@ -193387,45 +193426,6 @@ class IdeUtils
193387
193426
  };
193388
193427
  }
193389
193428
 
193390
- class IdeFetch {
193391
-
193392
- static #request = (method, url, data = {}) => {
193393
-
193394
- //console.log(method, url, data);
193395
-
193396
- if (method === "GET") url += `?${new URLSearchParams(data)}`;
193397
-
193398
- const options = {
193399
- method,
193400
- headers: { "Content-Type": "application/json" }
193401
- };
193402
-
193403
- if (method !== "GET") {
193404
- options.body = JSON.stringify(data);
193405
- }
193406
-
193407
- return fetch(url, options)
193408
- .then(res => {
193409
- if (!res.ok) {
193410
- return res.text().then(text => {
193411
- throw new Error(`API 오류 (${res.status}): ${text}`);
193412
- });
193413
- }
193414
- return res.json();
193415
- })
193416
- .catch(err => {
193417
- console.error(`[fetch.${method.toLowerCase()}] ${url} 실패:`, err);
193418
- throw err;
193419
- });
193420
- };
193421
-
193422
- static get = (url, data = {}) => IdeFetch.#request("GET", url, data);
193423
-
193424
- static post = (url, data = {}) => IdeFetch.#request("POST", url, data);
193425
- }
193426
-
193427
- const api = IdeFetch;
193428
-
193429
193429
  class IdeAi
193430
193430
  {
193431
193431
  #API_URL = "http://localhost:8091";
@@ -193949,7 +193949,33 @@ class IdeAi
193949
193949
  }
193950
193950
 
193951
193951
 
193952
- generateWhereCause = async (xmlPath, queryId) => {
193952
+
193953
+
193954
+ static generateWhereCause = async (xmlPath, queryId, userPrompt, apiKey) => {
193955
+
193956
+ const invoke = async (path, params) => {
193957
+ const prompt = await IdeUtils.generatePrompt(path, params);
193958
+
193959
+ console.log(prompt);
193960
+
193961
+ try {
193962
+
193963
+ const model = new ChatGoogleGenerativeAI({ model: "gemini-2.5-flash", apiKey: apiKey, temperature: 0,});
193964
+
193965
+ const response = await model.invoke([
193966
+ //new SystemMessage(systemMessage),
193967
+ new HumanMessage(prompt),
193968
+ ]);
193969
+
193970
+ //console.log(response);
193971
+
193972
+ return IdeUtils.extractResponse(response, "gemini");
193973
+ }
193974
+ catch (error) {
193975
+ //console.error("00000000");
193976
+ throw error;
193977
+ }
193978
+ };
193953
193979
 
193954
193980
  const res = await api.post("/api/source/query", {
193955
193981
  xmlPath: xmlPath,
@@ -193959,7 +193985,7 @@ class IdeAi
193959
193985
  console.log(res.where);
193960
193986
 
193961
193987
  if (res.query) {
193962
- const o = await this.#invoke('/prompts/user/generateWhereCause.txt', {
193988
+ const o = await invoke('/prompts/user/generateWhereCause.txt', {
193963
193989
  "query": res.query,
193964
193990
  "userPrompt": userPrompt
193965
193991
  });
@@ -193306,6 +193306,45 @@ window.jQuery = window.$ = $$1;
193306
193306
 
193307
193307
  //export default new ninegrid();
193308
193308
 
193309
+ class IdeFetch {
193310
+
193311
+ static #request = (method, url, data = {}) => {
193312
+
193313
+ //console.log(method, url, data);
193314
+
193315
+ if (method === "GET") url += `?${new URLSearchParams(data)}`;
193316
+
193317
+ const options = {
193318
+ method,
193319
+ headers: { "Content-Type": "application/json" }
193320
+ };
193321
+
193322
+ if (method !== "GET") {
193323
+ options.body = JSON.stringify(data);
193324
+ }
193325
+
193326
+ return fetch(url, options)
193327
+ .then(res => {
193328
+ if (!res.ok) {
193329
+ return res.text().then(text => {
193330
+ throw new Error(`API 오류 (${res.status}): ${text}`);
193331
+ });
193332
+ }
193333
+ return res.json();
193334
+ })
193335
+ .catch(err => {
193336
+ console.error(`[fetch.${method.toLowerCase()}] ${url} 실패:`, err);
193337
+ throw err;
193338
+ });
193339
+ };
193340
+
193341
+ static get = (url, data = {}) => IdeFetch.#request("GET", url, data);
193342
+
193343
+ static post = (url, data = {}) => IdeFetch.#request("POST", url, data);
193344
+ }
193345
+
193346
+ const api = IdeFetch;
193347
+
193309
193348
  class IdeUtils
193310
193349
  {
193311
193350
  constructor() {
@@ -193383,45 +193422,6 @@ class IdeUtils
193383
193422
  };
193384
193423
  }
193385
193424
 
193386
- class IdeFetch {
193387
-
193388
- static #request = (method, url, data = {}) => {
193389
-
193390
- //console.log(method, url, data);
193391
-
193392
- if (method === "GET") url += `?${new URLSearchParams(data)}`;
193393
-
193394
- const options = {
193395
- method,
193396
- headers: { "Content-Type": "application/json" }
193397
- };
193398
-
193399
- if (method !== "GET") {
193400
- options.body = JSON.stringify(data);
193401
- }
193402
-
193403
- return fetch(url, options)
193404
- .then(res => {
193405
- if (!res.ok) {
193406
- return res.text().then(text => {
193407
- throw new Error(`API 오류 (${res.status}): ${text}`);
193408
- });
193409
- }
193410
- return res.json();
193411
- })
193412
- .catch(err => {
193413
- console.error(`[fetch.${method.toLowerCase()}] ${url} 실패:`, err);
193414
- throw err;
193415
- });
193416
- };
193417
-
193418
- static get = (url, data = {}) => IdeFetch.#request("GET", url, data);
193419
-
193420
- static post = (url, data = {}) => IdeFetch.#request("POST", url, data);
193421
- }
193422
-
193423
- const api = IdeFetch;
193424
-
193425
193425
  class IdeAi
193426
193426
  {
193427
193427
  #API_URL = "http://localhost:8091";
@@ -193945,7 +193945,33 @@ class IdeAi
193945
193945
  }
193946
193946
 
193947
193947
 
193948
- generateWhereCause = async (xmlPath, queryId) => {
193948
+
193949
+
193950
+ static generateWhereCause = async (xmlPath, queryId, userPrompt, apiKey) => {
193951
+
193952
+ const invoke = async (path, params) => {
193953
+ const prompt = await IdeUtils.generatePrompt(path, params);
193954
+
193955
+ console.log(prompt);
193956
+
193957
+ try {
193958
+
193959
+ const model = new ChatGoogleGenerativeAI({ model: "gemini-2.5-flash", apiKey: apiKey, temperature: 0,});
193960
+
193961
+ const response = await model.invoke([
193962
+ //new SystemMessage(systemMessage),
193963
+ new HumanMessage(prompt),
193964
+ ]);
193965
+
193966
+ //console.log(response);
193967
+
193968
+ return IdeUtils.extractResponse(response, "gemini");
193969
+ }
193970
+ catch (error) {
193971
+ //console.error("00000000");
193972
+ throw error;
193973
+ }
193974
+ };
193949
193975
 
193950
193976
  const res = await api.post("/api/source/query", {
193951
193977
  xmlPath: xmlPath,
@@ -193955,7 +193981,7 @@ class IdeAi
193955
193981
  console.log(res.where);
193956
193982
 
193957
193983
  if (res.query) {
193958
- const o = await this.#invoke('/prompts/user/generateWhereCause.txt', {
193984
+ const o = await invoke('/prompts/user/generateWhereCause.txt', {
193959
193985
  "query": res.query,
193960
193986
  "userPrompt": userPrompt
193961
193987
  });
@@ -534,7 +534,33 @@ export class IdeAi
534
534
  }
535
535
 
536
536
 
537
- generateWhereCause = async (xmlPath, queryId) => {
537
+
538
+
539
+ static generateWhereCause = async (xmlPath, queryId, userPrompt, apiKey) => {
540
+
541
+ const invoke = async (path, params) => {
542
+ const prompt = await IdeUtils.generatePrompt(path, params);
543
+
544
+ console.log(prompt);
545
+
546
+ try {
547
+
548
+ const model = new ChatGoogleGenerativeAI({ model: "gemini-2.5-flash", apiKey: apiKey, temperature: 0,});
549
+
550
+ const response = await model.invoke([
551
+ //new SystemMessage(systemMessage),
552
+ new HumanMessage(prompt),
553
+ ]);
554
+
555
+ //console.log(response);
556
+
557
+ return IdeUtils.extractResponse(response, "gemini");
558
+ }
559
+ catch (error) {
560
+ //console.error("00000000");
561
+ throw error;
562
+ }
563
+ }
538
564
 
539
565
  const res = await api.post("/api/source/query", {
540
566
  xmlPath: xmlPath,
@@ -544,7 +570,7 @@ export class IdeAi
544
570
  console.log(res.where);
545
571
 
546
572
  if (res.query) {
547
- const o = await this.#invoke('/prompts/user/generateWhereCause.txt', {
573
+ const o = await invoke('/prompts/user/generateWhereCause.txt', {
548
574
  "query": res.query,
549
575
  "userPrompt": userPrompt
550
576
  });
@@ -1,4 +1,5 @@
1
1
  import { PromptTemplate } from '@langchain/core/prompts';
2
+ import {api} from "./ideFetch.js";
2
3
 
3
4
  export class IdeUtils
4
5
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.296.0",
4
+ "version": "0.299.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -534,7 +534,33 @@ export class IdeAi
534
534
  }
535
535
 
536
536
 
537
- generateWhereCause = async (xmlPath, queryId) => {
537
+
538
+
539
+ static generateWhereCause = async (xmlPath, queryId, userPrompt, apiKey) => {
540
+
541
+ const invoke = async (path, params) => {
542
+ const prompt = await IdeUtils.generatePrompt(path, params);
543
+
544
+ console.log(prompt);
545
+
546
+ try {
547
+
548
+ const model = new ChatGoogleGenerativeAI({ model: "gemini-2.5-flash", apiKey: apiKey, temperature: 0,});
549
+
550
+ const response = await model.invoke([
551
+ //new SystemMessage(systemMessage),
552
+ new HumanMessage(prompt),
553
+ ]);
554
+
555
+ //console.log(response);
556
+
557
+ return IdeUtils.extractResponse(response, "gemini");
558
+ }
559
+ catch (error) {
560
+ //console.error("00000000");
561
+ throw error;
562
+ }
563
+ }
538
564
 
539
565
  const res = await api.post("/api/source/query", {
540
566
  xmlPath: xmlPath,
@@ -544,7 +570,7 @@ export class IdeAi
544
570
  console.log(res.where);
545
571
 
546
572
  if (res.query) {
547
- const o = await this.#invoke('/prompts/user/generateWhereCause.txt', {
573
+ const o = await invoke('/prompts/user/generateWhereCause.txt', {
548
574
  "query": res.query,
549
575
  "userPrompt": userPrompt
550
576
  });
@@ -1,4 +1,5 @@
1
1
  import { PromptTemplate } from '@langchain/core/prompts';
2
+ import {api} from "./ideFetch.js";
2
3
 
3
4
  export class IdeUtils
4
5
  {