ide-assi 0.663.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,39 +203810,31 @@ 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
-
203838
- const res = await api.post("/api/source/query", {
203839
- xmlPath: xmlPath,
203840
- queryId: queryId
203841
- });
203842
203834
 
203843
- console.log(res.where);
203835
+ return o.condition;
203844
203836
 
203845
- if (res.query) {
203837
+ /**
203846
203838
  const o = await invoke('/prompts/user/generateWhereCause.txt', {
203847
203839
  "query": res.query,
203848
203840
  "userPrompt": userPrompt
@@ -203851,7 +203843,10 @@ console.log(el, href, title);
203851
203843
  //console.log(o);
203852
203844
 
203853
203845
  return o;
203846
+ */
203854
203847
  }
203848
+
203849
+
203855
203850
  };
203856
203851
  }
203857
203852
 
@@ -237581,7 +237576,7 @@ class aiNatualInput extends HTMLElement
237581
237576
  #keyDownHandler = async e => {
237582
237577
  if (e.key === 'Enter' && !e.isComposing && this.#selectFunc) {
237583
237578
 
237584
- //this.#target.disabled = true;
237579
+ this.#target.disabled = true;
237585
237580
  ninegrid.loading.show();
237586
237581
 
237587
237582
  let params = {};
@@ -237591,7 +237586,7 @@ class aiNatualInput extends HTMLElement
237591
237586
 
237592
237587
  this.#selectFunc.call(this, params);
237593
237588
 
237594
- //this.#target.disabled = false;
237589
+ this.#target.disabled = false;
237595
237590
  }
237596
237591
  };
237597
237592
 
@@ -203806,39 +203806,31 @@ 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
-
203834
- const res = await api.post("/api/source/query", {
203835
- xmlPath: xmlPath,
203836
- queryId: queryId
203837
- });
203838
203830
 
203839
- console.log(res.where);
203831
+ return o.condition;
203840
203832
 
203841
- if (res.query) {
203833
+ /**
203842
203834
  const o = await invoke('/prompts/user/generateWhereCause.txt', {
203843
203835
  "query": res.query,
203844
203836
  "userPrompt": userPrompt
@@ -203847,7 +203839,10 @@ console.log(el, href, title);
203847
203839
  //console.log(o);
203848
203840
 
203849
203841
  return o;
203842
+ */
203850
203843
  }
203844
+
203845
+
203851
203846
  };
203852
203847
  }
203853
203848
 
@@ -237577,7 +237572,7 @@ class aiNatualInput extends HTMLElement
237577
237572
  #keyDownHandler = async e => {
237578
237573
  if (e.key === 'Enter' && !e.isComposing && this.#selectFunc) {
237579
237574
 
237580
- //this.#target.disabled = true;
237575
+ this.#target.disabled = true;
237581
237576
  ninegrid.loading.show();
237582
237577
 
237583
237578
  let params = {};
@@ -237587,7 +237582,7 @@ class aiNatualInput extends HTMLElement
237587
237582
 
237588
237583
  this.#selectFunc.call(this, params);
237589
237584
 
237590
- //this.#target.disabled = false;
237585
+ this.#target.disabled = false;
237591
237586
  }
237592
237587
  };
237593
237588
 
@@ -29,7 +29,7 @@ class aiNatualInput extends HTMLElement
29
29
  #keyDownHandler = async e => {
30
30
  if (e.key === 'Enter' && !e.isComposing && this.#selectFunc) {
31
31
 
32
- //this.#target.disabled = true;
32
+ this.#target.disabled = true;
33
33
  ninegrid.loading.show();
34
34
 
35
35
  let params = {};
@@ -39,7 +39,7 @@ class aiNatualInput extends HTMLElement
39
39
 
40
40
  this.#selectFunc.call(this, params);
41
41
 
42
- //this.#target.disabled = false;
42
+ this.#target.disabled = false;
43
43
  }
44
44
  };
45
45
 
@@ -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,9 +1297,26 @@ console.log(el, href, title);
1295
1297
  queryId: queryId
1296
1298
  });
1297
1299
 
1298
- console.log(res.where);
1300
+ console.log(res.query);
1299
1301
 
1300
1302
  if (res.query) {
1303
+ const o = await this.#invoke('/prompts/user/generateWhereCause.txt', {
1304
+ "query": res.query,
1305
+ "userPrompt": userPrompt
1306
+ });
1307
+
1308
+ console.log(o);
1309
+
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
+ /**
1301
1320
  const o = await invoke('/prompts/user/generateWhereCause.txt', {
1302
1321
  "query": res.query,
1303
1322
  "userPrompt": userPrompt
@@ -1306,7 +1325,10 @@ console.log(el, href, title);
1306
1325
  //console.log(o);
1307
1326
 
1308
1327
  return o;
1328
+ */
1309
1329
  }
1330
+
1331
+
1310
1332
  };
1311
1333
  }
1312
1334
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.663.0",
4
+ "version": "0.665.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -29,7 +29,7 @@ class aiNatualInput extends HTMLElement
29
29
  #keyDownHandler = async e => {
30
30
  if (e.key === 'Enter' && !e.isComposing && this.#selectFunc) {
31
31
 
32
- //this.#target.disabled = true;
32
+ this.#target.disabled = true;
33
33
  ninegrid.loading.show();
34
34
 
35
35
  let params = {};
@@ -39,7 +39,7 @@ class aiNatualInput extends HTMLElement
39
39
 
40
40
  this.#selectFunc.call(this, params);
41
41
 
42
- //this.#target.disabled = false;
42
+ this.#target.disabled = false;
43
43
  }
44
44
  };
45
45
 
@@ -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,9 +1297,26 @@ console.log(el, href, title);
1295
1297
  queryId: queryId
1296
1298
  });
1297
1299
 
1298
- console.log(res.where);
1300
+ console.log(res.query);
1299
1301
 
1300
1302
  if (res.query) {
1303
+ const o = await this.#invoke('/prompts/user/generateWhereCause.txt', {
1304
+ "query": res.query,
1305
+ "userPrompt": userPrompt
1306
+ });
1307
+
1308
+ console.log(o);
1309
+
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
+ /**
1301
1320
  const o = await invoke('/prompts/user/generateWhereCause.txt', {
1302
1321
  "query": res.query,
1303
1322
  "userPrompt": userPrompt
@@ -1306,7 +1325,10 @@ console.log(el, href, title);
1306
1325
  //console.log(o);
1307
1326
 
1308
1327
  return o;
1328
+ */
1309
1329
  }
1330
+
1331
+
1310
1332
  };
1311
1333
  }
1312
1334