ide-assi 0.94.0 → 0.96.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.
@@ -193337,7 +193337,7 @@ class IdeAi
193337
193337
  ninegrid.querySelectorAll("nx-side-menu-item[url][title]").forEach(elem => {
193338
193338
  arr.push({
193339
193339
  //menuId: elem.getAttribute("menu-id"),
193340
- url: elem.getAttribute("url"),
193340
+ url: elem.getAttribute("href"),
193341
193341
  title: elem.getAttribute("title"),
193342
193342
  });
193343
193343
  });
@@ -193468,14 +193468,35 @@ class IdeAi
193468
193468
  return null;
193469
193469
  };
193470
193470
 
193471
+ #getGenerateAction = async (userPrompt) => {
193472
+ const systemMessage = "You are a helpful assistant.";
193473
+ console.log("====================");
193474
+ const prompt = await IdeUtils.generatePrompt('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
193475
+
193476
+ const response = await this.#model.invoke([
193477
+ new SystemMessage(systemMessage),
193478
+ new HumanMessage(prompt),
193479
+ ]);
193480
+
193481
+ const o = IdeUtils.extractResponse(response, this.#parent.settings.server);
193482
+ if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
193483
+ if (o.result == "0") throw new Error(o.reason);
193484
+ }
193485
+ else {
193486
+ throw new Error(o);
193487
+ }
193488
+
193489
+ return o.result;
193490
+ };
193491
+
193471
193492
  generateSourceClient = async (userPrompt) => {
193472
193493
 
193473
193494
  this.#createModel();
193474
-
193495
+ /**
193475
193496
  const systemMessage = "You are a helpful assistant.";
193476
193497
  console.log("====================");
193477
193498
  const prompt = await IdeUtils.generatePrompt('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
193478
- console.log(prompt);
193499
+
193479
193500
  const response = await this.#model.invoke([
193480
193501
  new SystemMessage(systemMessage),
193481
193502
  new HumanMessage(prompt),
@@ -193483,18 +193504,20 @@ console.log(prompt);
193483
193504
 
193484
193505
  const o = IdeUtils.extractResponse(response, this.#parent.settings.server);
193485
193506
  if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
193486
- if (o.result == "0") {
193487
- //return o.reason;
193488
- throw new Error(o.reason);
193489
- }
193507
+ if (o.result == "0") throw new Error(o.reason);
193490
193508
  }
193491
193509
  else {
193492
193510
  throw new Error(o);
193493
193511
  }
193512
+ */
193513
+ const action = await this.#getGenerateAction(userPrompt);
193514
+
193515
+ console.log(action);
193494
193516
 
193495
193517
  const menus = this.#getMenuInfo();
193496
193518
  const tables = await this.#getTableList();
193497
193519
 
193520
+
193498
193521
  console.log(menus);
193499
193522
  console.log(tables);
193500
193523
 
@@ -193333,7 +193333,7 @@ class IdeAi
193333
193333
  ninegrid.querySelectorAll("nx-side-menu-item[url][title]").forEach(elem => {
193334
193334
  arr.push({
193335
193335
  //menuId: elem.getAttribute("menu-id"),
193336
- url: elem.getAttribute("url"),
193336
+ url: elem.getAttribute("href"),
193337
193337
  title: elem.getAttribute("title"),
193338
193338
  });
193339
193339
  });
@@ -193464,14 +193464,35 @@ class IdeAi
193464
193464
  return null;
193465
193465
  };
193466
193466
 
193467
+ #getGenerateAction = async (userPrompt) => {
193468
+ const systemMessage = "You are a helpful assistant.";
193469
+ console.log("====================");
193470
+ const prompt = await IdeUtils.generatePrompt('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
193471
+
193472
+ const response = await this.#model.invoke([
193473
+ new SystemMessage(systemMessage),
193474
+ new HumanMessage(prompt),
193475
+ ]);
193476
+
193477
+ const o = IdeUtils.extractResponse(response, this.#parent.settings.server);
193478
+ if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
193479
+ if (o.result == "0") throw new Error(o.reason);
193480
+ }
193481
+ else {
193482
+ throw new Error(o);
193483
+ }
193484
+
193485
+ return o.result;
193486
+ };
193487
+
193467
193488
  generateSourceClient = async (userPrompt) => {
193468
193489
 
193469
193490
  this.#createModel();
193470
-
193491
+ /**
193471
193492
  const systemMessage = "You are a helpful assistant.";
193472
193493
  console.log("====================");
193473
193494
  const prompt = await IdeUtils.generatePrompt('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
193474
- console.log(prompt);
193495
+
193475
193496
  const response = await this.#model.invoke([
193476
193497
  new SystemMessage(systemMessage),
193477
193498
  new HumanMessage(prompt),
@@ -193479,18 +193500,20 @@ console.log(prompt);
193479
193500
 
193480
193501
  const o = IdeUtils.extractResponse(response, this.#parent.settings.server);
193481
193502
  if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
193482
- if (o.result == "0") {
193483
- //return o.reason;
193484
- throw new Error(o.reason);
193485
- }
193503
+ if (o.result == "0") throw new Error(o.reason);
193486
193504
  }
193487
193505
  else {
193488
193506
  throw new Error(o);
193489
193507
  }
193508
+ */
193509
+ const action = await this.#getGenerateAction(userPrompt);
193510
+
193511
+ console.log(action);
193490
193512
 
193491
193513
  const menus = this.#getMenuInfo();
193492
193514
  const tables = await this.#getTableList();
193493
193515
 
193516
+
193494
193517
  console.log(menus);
193495
193518
  console.log(tables);
193496
193519
 
@@ -42,7 +42,7 @@ export class IdeAi
42
42
  ninegrid.querySelectorAll("nx-side-menu-item[url][title]").forEach(elem => {
43
43
  arr.push({
44
44
  //menuId: elem.getAttribute("menu-id"),
45
- url: elem.getAttribute("url"),
45
+ url: elem.getAttribute("href"),
46
46
  title: elem.getAttribute("title"),
47
47
  })
48
48
  });
@@ -173,14 +173,35 @@ export class IdeAi
173
173
  return null;
174
174
  };
175
175
 
176
+ #getGenerateAction = async (userPrompt) => {
177
+ const systemMessage = "You are a helpful assistant.";
178
+ console.log("====================");
179
+ const prompt = await IdeUtils.generatePrompt('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
180
+
181
+ const response = await this.#model.invoke([
182
+ new SystemMessage(systemMessage),
183
+ new HumanMessage(prompt),
184
+ ]);
185
+
186
+ const o = IdeUtils.extractResponse(response, this.#parent.settings.server);
187
+ if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
188
+ if (o.result == "0") throw new Error(o.reason);
189
+ }
190
+ else {
191
+ throw new Error(o);
192
+ }
193
+
194
+ return o.result;
195
+ };
196
+
176
197
  generateSourceClient = async (userPrompt) => {
177
198
 
178
199
  this.#createModel();
179
-
200
+ /**
180
201
  const systemMessage = "You are a helpful assistant.";
181
202
  console.log("====================");
182
203
  const prompt = await IdeUtils.generatePrompt('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
183
- console.log(prompt);
204
+
184
205
  const response = await this.#model.invoke([
185
206
  new SystemMessage(systemMessage),
186
207
  new HumanMessage(prompt),
@@ -188,18 +209,20 @@ console.log(prompt);
188
209
 
189
210
  const o = IdeUtils.extractResponse(response, this.#parent.settings.server);
190
211
  if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
191
- if (o.result == "0") {
192
- //return o.reason;
193
- throw new Error(o.reason);
194
- }
212
+ if (o.result == "0") throw new Error(o.reason);
195
213
  }
196
214
  else {
197
215
  throw new Error(o);
198
216
  }
217
+ */
218
+ const action = await this.#getGenerateAction(userPrompt);
219
+
220
+ console.log(action);
199
221
 
200
222
  const menus = this.#getMenuInfo();
201
223
  const tables = await this.#getTableList();
202
224
 
225
+
203
226
  console.log(menus);
204
227
  console.log(tables);
205
228
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.94.0",
4
+ "version": "0.96.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -42,7 +42,7 @@ export class IdeAi
42
42
  ninegrid.querySelectorAll("nx-side-menu-item[url][title]").forEach(elem => {
43
43
  arr.push({
44
44
  //menuId: elem.getAttribute("menu-id"),
45
- url: elem.getAttribute("url"),
45
+ url: elem.getAttribute("href"),
46
46
  title: elem.getAttribute("title"),
47
47
  })
48
48
  });
@@ -173,14 +173,35 @@ export class IdeAi
173
173
  return null;
174
174
  };
175
175
 
176
+ #getGenerateAction = async (userPrompt) => {
177
+ const systemMessage = "You are a helpful assistant.";
178
+ console.log("====================");
179
+ const prompt = await IdeUtils.generatePrompt('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
180
+
181
+ const response = await this.#model.invoke([
182
+ new SystemMessage(systemMessage),
183
+ new HumanMessage(prompt),
184
+ ]);
185
+
186
+ const o = IdeUtils.extractResponse(response, this.#parent.settings.server);
187
+ if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
188
+ if (o.result == "0") throw new Error(o.reason);
189
+ }
190
+ else {
191
+ throw new Error(o);
192
+ }
193
+
194
+ return o.result;
195
+ };
196
+
176
197
  generateSourceClient = async (userPrompt) => {
177
198
 
178
199
  this.#createModel();
179
-
200
+ /**
180
201
  const systemMessage = "You are a helpful assistant.";
181
202
  console.log("====================");
182
203
  const prompt = await IdeUtils.generatePrompt('/prompts/meta/개발액션분류.txt', { "userPrompt": userPrompt });
183
- console.log(prompt);
204
+
184
205
  const response = await this.#model.invoke([
185
206
  new SystemMessage(systemMessage),
186
207
  new HumanMessage(prompt),
@@ -188,18 +209,20 @@ console.log(prompt);
188
209
 
189
210
  const o = IdeUtils.extractResponse(response, this.#parent.settings.server);
190
211
  if (Object.prototype.toString.call(o) === "[object Object]" && o.hasOwnProperty("result")) {
191
- if (o.result == "0") {
192
- //return o.reason;
193
- throw new Error(o.reason);
194
- }
212
+ if (o.result == "0") throw new Error(o.reason);
195
213
  }
196
214
  else {
197
215
  throw new Error(o);
198
216
  }
217
+ */
218
+ const action = await this.#getGenerateAction(userPrompt);
219
+
220
+ console.log(action);
199
221
 
200
222
  const menus = this.#getMenuInfo();
201
223
  const tables = await this.#getTableList();
202
224
 
225
+
203
226
  console.log(menus);
204
227
  console.log(tables);
205
228