ide-assi 0.664.0 → 0.665.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.
@@ -203810,46 +203810,43 @@ console.log(el, href, title);
203810
203810
 
203811
203811
  static generateWhereCause = async (xmlPath, queryId, userPrompt, apiKey) => {
203812
203812
 
203813
- const invoke = async (path, params) => {
203814
- const prompt = await IdeUtils.generatePrompt(path, params);
203815
-
203816
- //console.log(prompt);
203813
+ const res = await api.post("/api/source/query", {
203814
+ xmlPath: xmlPath,
203815
+ queryId: queryId
203816
+ });
203817
203817
 
203818
- try {
203819
- const model = new ChatGoogleGenerativeAI({ model: "gemini-2.5-flash", apiKey: apiKey, temperature: 0,});
203818
+ console.log(res.query);
203820
203819
 
203821
- const response = await model.invoke([
203822
- //new SystemMessage(systemMessage),
203823
- new HumanMessage(prompt),
203824
- ]);
203820
+ if (res.query) {
203821
+ const o = await this.#invoke('/prompts/user/generateWhereCause.txt', {
203822
+ "query": res.query,
203823
+ "userPrompt": userPrompt
203824
+ });
203825
203825
 
203826
- let r = IdeUtils.extractResponse(response, "gemini");
203827
- if ((r.startsWith("'") && r.endsWith("'")) || (r.startsWith('"') && r.endsWith('"')) || (r.startsWith('`') && r.endsWith('`'))) {
203828
- r = r.slice(1, -1); // 맨 앞, 맨 뒤 한 글자씩 제거
203829
- }
203826
+ console.log(o);
203830
203827
 
203831
- return r;
203828
+ if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
203829
+ if (o.result !== true) throw new Error(o.condition);
203832
203830
  }
203833
- catch (error) {
203834
- throw error;
203831
+ else {
203832
+ throw new Error(o);
203835
203833
  }
203836
- };
203837
203834
 
203838
- const res = await api.post("/api/source/query", {
203839
- xmlPath: xmlPath,
203840
- queryId: queryId
203841
- });
203835
+ return o.condition;
203842
203836
 
203843
- if (res.query) {
203837
+ /**
203844
203838
  const o = await invoke('/prompts/user/generateWhereCause.txt', {
203845
203839
  "query": res.query,
203846
203840
  "userPrompt": userPrompt
203847
203841
  });
203848
203842
 
203849
- console.log(o);
203843
+ //console.log(o);
203850
203844
 
203851
- return o.result ? o.condition : null;
203845
+ return o;
203846
+ */
203852
203847
  }
203848
+
203849
+
203853
203850
  };
203854
203851
  }
203855
203852
 
@@ -203806,46 +203806,43 @@ console.log(el, href, title);
203806
203806
 
203807
203807
  static generateWhereCause = async (xmlPath, queryId, userPrompt, apiKey) => {
203808
203808
 
203809
- const invoke = async (path, params) => {
203810
- const prompt = await IdeUtils.generatePrompt(path, params);
203811
-
203812
- //console.log(prompt);
203809
+ const res = await api.post("/api/source/query", {
203810
+ xmlPath: xmlPath,
203811
+ queryId: queryId
203812
+ });
203813
203813
 
203814
- try {
203815
- const model = new ChatGoogleGenerativeAI({ model: "gemini-2.5-flash", apiKey: apiKey, temperature: 0,});
203814
+ console.log(res.query);
203816
203815
 
203817
- const response = await model.invoke([
203818
- //new SystemMessage(systemMessage),
203819
- new HumanMessage(prompt),
203820
- ]);
203816
+ if (res.query) {
203817
+ const o = await this.#invoke('/prompts/user/generateWhereCause.txt', {
203818
+ "query": res.query,
203819
+ "userPrompt": userPrompt
203820
+ });
203821
203821
 
203822
- let r = IdeUtils.extractResponse(response, "gemini");
203823
- if ((r.startsWith("'") && r.endsWith("'")) || (r.startsWith('"') && r.endsWith('"')) || (r.startsWith('`') && r.endsWith('`'))) {
203824
- r = r.slice(1, -1); // 맨 앞, 맨 뒤 한 글자씩 제거
203825
- }
203822
+ console.log(o);
203826
203823
 
203827
- return r;
203824
+ if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
203825
+ if (o.result !== true) throw new Error(o.condition);
203828
203826
  }
203829
- catch (error) {
203830
- throw error;
203827
+ else {
203828
+ throw new Error(o);
203831
203829
  }
203832
- };
203833
203830
 
203834
- const res = await api.post("/api/source/query", {
203835
- xmlPath: xmlPath,
203836
- queryId: queryId
203837
- });
203831
+ return o.condition;
203838
203832
 
203839
- if (res.query) {
203833
+ /**
203840
203834
  const o = await invoke('/prompts/user/generateWhereCause.txt', {
203841
203835
  "query": res.query,
203842
203836
  "userPrompt": userPrompt
203843
203837
  });
203844
203838
 
203845
- console.log(o);
203839
+ //console.log(o);
203846
203840
 
203847
- return o.result ? o.condition : null;
203841
+ return o;
203842
+ */
203848
203843
  }
203844
+
203845
+
203849
203846
  };
203850
203847
  }
203851
203848
 
@@ -1278,6 +1278,8 @@ console.log(el, href, title);
1278
1278
  new HumanMessage(prompt),
1279
1279
  ]);
1280
1280
 
1281
+ console.log(response);
1282
+
1281
1283
  let r = IdeUtils.extractResponse(response, "gemini");
1282
1284
  if ((r.startsWith("'") && r.endsWith("'")) || (r.startsWith('"') && r.endsWith('"')) || (r.startsWith('`') && r.endsWith('`'))) {
1283
1285
  r = r.slice(1, -1); // 맨 앞, 맨 뒤 한 글자씩 제거
@@ -1295,16 +1297,38 @@ console.log(el, href, title);
1295
1297
  queryId: queryId
1296
1298
  });
1297
1299
 
1300
+ console.log(res.query);
1301
+
1298
1302
  if (res.query) {
1299
- const o = await invoke('/prompts/user/generateWhereCause.txt', {
1303
+ const o = await this.#invoke('/prompts/user/generateWhereCause.txt', {
1300
1304
  "query": res.query,
1301
1305
  "userPrompt": userPrompt
1302
1306
  });
1303
1307
 
1304
1308
  console.log(o);
1305
1309
 
1306
- return o.result ? o.condition : null;
1310
+ if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
1311
+ if (o.result !== true) throw new Error(o.condition);
1312
+ }
1313
+ else {
1314
+ throw new Error(o);
1315
+ }
1316
+
1317
+ return o.condition;
1318
+
1319
+ /**
1320
+ const o = await invoke('/prompts/user/generateWhereCause.txt', {
1321
+ "query": res.query,
1322
+ "userPrompt": userPrompt
1323
+ });
1324
+
1325
+ //console.log(o);
1326
+
1327
+ return o;
1328
+ */
1307
1329
  }
1330
+
1331
+
1308
1332
  };
1309
1333
  }
1310
1334
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.664.0",
4
+ "version": "0.665.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -1278,6 +1278,8 @@ console.log(el, href, title);
1278
1278
  new HumanMessage(prompt),
1279
1279
  ]);
1280
1280
 
1281
+ console.log(response);
1282
+
1281
1283
  let r = IdeUtils.extractResponse(response, "gemini");
1282
1284
  if ((r.startsWith("'") && r.endsWith("'")) || (r.startsWith('"') && r.endsWith('"')) || (r.startsWith('`') && r.endsWith('`'))) {
1283
1285
  r = r.slice(1, -1); // 맨 앞, 맨 뒤 한 글자씩 제거
@@ -1295,16 +1297,38 @@ console.log(el, href, title);
1295
1297
  queryId: queryId
1296
1298
  });
1297
1299
 
1300
+ console.log(res.query);
1301
+
1298
1302
  if (res.query) {
1299
- const o = await invoke('/prompts/user/generateWhereCause.txt', {
1303
+ const o = await this.#invoke('/prompts/user/generateWhereCause.txt', {
1300
1304
  "query": res.query,
1301
1305
  "userPrompt": userPrompt
1302
1306
  });
1303
1307
 
1304
1308
  console.log(o);
1305
1309
 
1306
- return o.result ? o.condition : null;
1310
+ if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
1311
+ if (o.result !== true) throw new Error(o.condition);
1312
+ }
1313
+ else {
1314
+ throw new Error(o);
1315
+ }
1316
+
1317
+ return o.condition;
1318
+
1319
+ /**
1320
+ const o = await invoke('/prompts/user/generateWhereCause.txt', {
1321
+ "query": res.query,
1322
+ "userPrompt": userPrompt
1323
+ });
1324
+
1325
+ //console.log(o);
1326
+
1327
+ return o;
1328
+ */
1307
1329
  }
1330
+
1331
+
1308
1332
  };
1309
1333
  }
1310
1334