ide-assi 0.450.0 → 0.453.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.
@@ -202114,13 +202114,13 @@ class IdeAi
202114
202114
  await this.#generateRealFile(srcPath, apply);
202115
202115
  };
202116
202116
 
202117
- #modifySource = async (userPrompt, apply) => {
202117
+ #modifySource = async (userPrompt, apply, progressMessageInstance) => {
202118
202118
 
202119
202119
  const el = ninegrid.querySelector("nx-side-menu-item.active");
202120
202120
  if (!el) throw new Error("관련 메뉴를 찾을 수 없습니다.");
202121
202121
 
202122
202122
  const href = el.getAttribute("href");
202123
- el.getAttribute("title");
202123
+ const title = el.getAttribute("title");
202124
202124
 
202125
202125
  const srcPath = this.#getSourcePath(href);
202126
202126
  console.log(srcPath);
@@ -202139,7 +202139,7 @@ class IdeAi
202139
202139
  * "javascriptPullPath": "ide-assi-fe-vite-react-js/src/views/tmpla/doc-manager.jsx"
202140
202140
  * }
202141
202141
  */
202142
- await api.post("/api/source/read", srcPath);
202142
+ const src = await api.post("/api/source/read", srcPath);
202143
202143
  //console.log(src);
202144
202144
 
202145
202145
  /**
@@ -202155,28 +202155,122 @@ class IdeAi
202155
202155
  title: elem.getAttribute("title"),
202156
202156
  })*/
202157
202157
 
202158
+
202159
+
202160
+
202161
+
202162
+ const where = await this.#where(`${title}에서 ${userPrompt}`, [{url: href, title: title}], await this.#getTableList());
202163
+ //this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
202164
+ progressMessageInstance.updateProgress('prepare2', 'completed');
202165
+
202166
+ console.log(where);
202167
+
202168
+ //const srcPath = this.#getSourcePath(where.menu.url);
202169
+
202170
+ console.log(srcPath);
202171
+
202172
+ const columnInfo = await this.#getColumnInfo(where.table);
202173
+
202174
+ let mybatisXmlSource;
202175
+ if (apply.mybatis) {
202176
+ mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/U.BuildMyBatisMapper.txt", "mybatis.xml", {
202177
+ userPrompt: userPrompt,
202178
+ originSrc: src.mybatis,
202179
+ resultType: srcPath.resultType,
202180
+ namespace: srcPath.namespace,
202181
+ tableDefinitions: columnInfo,
202182
+ });
202183
+ //this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
202184
+ progressMessageInstance.updateProgress('mybatis', 'completed');
202185
+ }
202186
+ else {
202187
+ mybatisXmlSource = src.mybatis;
202188
+ }
202189
+
202190
+ let serviceSrc;
202191
+ if (apply.service) {
202192
+ serviceSrc = await this.#generateTmplFile("/prompts/meta/U.BuildService.txt", "service.java", {
202193
+ userPrompt: userPrompt,
202194
+ originSrc: src.service,
202195
+ baseClass: srcPath.baseClass,
202196
+ myBatisPath: srcPath.mybatis,
202197
+ namespace: srcPath.namespace,
202198
+ package: srcPath.package + ".service",
202199
+ mybatisXmlSource: mybatisXmlSource,
202200
+ });
202201
+ //this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
202202
+ progressMessageInstance.updateProgress('service', 'completed');
202203
+ }
202204
+ else {
202205
+ serviceSrc = src.service;
202206
+ }
202207
+
202208
+ let controllerSrc;
202209
+ if (apply.controller) {
202210
+ controllerSrc = await this.#generateTmplFile("/prompts/meta/U.BuildController.txt", "controller.java", {
202211
+ userPrompt: userPrompt,
202212
+ originSrc: src.controller,
202213
+ baseClass: srcPath.baseClass,
202214
+ menuUrl: where.menu.url,
202215
+ package: srcPath.package + ".controller",
202216
+ serviceSource: serviceSrc,
202217
+ });
202218
+ //this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
202219
+ progressMessageInstance.updateProgress('controller', 'completed');
202220
+ }
202221
+ else {
202222
+ controllerSrc = src.controller;
202223
+ }
202224
+ if (apply.javascript) {
202225
+ await this.#generateTmplFile("/prompts/meta/U.BuildReactJsx.txt", "react.jsx", {
202226
+ userPrompt: userPrompt,
202227
+ mybatis: srcPath.mybatis,
202228
+ originSrc: src.javascript,
202229
+ menuUrl: where.menu.url,
202230
+ menuName: where.menu.name,
202231
+ baseClass: srcPath.baseClass,
202232
+ controllerSource: controllerSrc,
202233
+ tableDefinitions: columnInfo,
202234
+ });
202235
+ //this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
202236
+ progressMessageInstance.updateProgress('javascript', 'completed');
202237
+ }
202238
+ else {
202239
+ src.javascript;
202240
+ }
202241
+ //console.log(src.javascript);
202242
+ //progressMessageInstance.updateProgress('javascript', 'completed');
202243
+
202244
+ await this.#generateRealFile(srcPath, apply);
202245
+ };
202246
+
202247
+ generateSourceClient = async (userPrompt, apply) => {
202248
+
202249
+ this.#createModel();
202250
+
202158
202251
  const initialProgressData = [
202159
- { id: '1', message: '메뉴와 테이블을 검색중입니다', completedMessage: '관련 메뉴와 테이블을 찾았습니다.' }
202252
+ { id: 'prepare1', message: '명령을 해석중입니다.', completedMessage: '명령을 해석했습니다.' },
202253
+ { id: 'prepare2', message: '메뉴와 테이블을 검색중입니다', completedMessage: '관련 메뉴와 테이블을 찾았습니다.' },
202160
202254
  ];
202161
202255
  if (apply.mybatis) {
202162
- initialProgressData.push({ id: '2', message: 'MyBatis 소스파일을 생성중입니다', completedMessage: 'MyBatis 소스파일을 생성했습니다.' });
202256
+ initialProgressData.push({ id: 'mybatis', message: 'MyBatis 소스파일을 생성중입니다', completedMessage: 'MyBatis 소스파일을 생성했습니다.' });
202163
202257
  }
202164
202258
  if (apply.service) {
202165
- initialProgressData.push({ id: '3', message: 'Java(Service) 소스파일을 생성중입니다', completedMessage: 'Java(Service) 소스파일을 생성했습니다.' });
202259
+ initialProgressData.push({ id: 'service', message: 'Java(Service) 소스파일을 생성중입니다', completedMessage: 'Java(Service) 소스파일을 생성했습니다.' });
202166
202260
  }
202167
202261
 
202168
202262
  if (apply.controller) {
202169
- initialProgressData.push({ id: '4', message: 'Java(Controller) 소스파일을 생성중입니다', completedMessage: 'Java(Controller) 소스파일을 생성했습니다.' });
202263
+ initialProgressData.push({ id: 'controller', message: 'Java(Controller) 소스파일을 생성중입니다', completedMessage: 'Java(Controller) 소스파일을 생성했습니다.' });
202170
202264
  }
202171
202265
 
202172
202266
  if (apply.javascript) {
202173
- initialProgressData.push({ id: '5', message: 'Jsx(React) 소스파일을 생성중입니다', completedMessage: 'Jsx(React) 소스파일을 생성했습니다.' });
202267
+ initialProgressData.push({ id: 'javascript', message: 'Jsx(React) 소스파일을 생성중입니다', completedMessage: 'Jsx(React) 소스파일을 생성했습니다.' });
202174
202268
  }
202175
202269
 
202176
202270
  const elAiChat = this.#parent.shadowRoot.querySelector("nx-ai-chat");
202177
202271
  const progressMessageInstance = elAiChat.addProgress(initialProgressData);
202178
202272
 
202179
-
202273
+ /**
202180
202274
  // 2. 시간이 지난 후, 특정 단계의 완료를 알림
202181
202275
  // 예를 들어, 3초 후에 분석 완료
202182
202276
  setTimeout(() => {
@@ -202198,25 +202292,19 @@ class IdeAi
202198
202292
  setTimeout(() => {
202199
202293
  elAiChat.add("ai", "모든 작업이 성공적으로 완료되었습니다!", [], []);
202200
202294
  }, 9000);
202201
-
202202
-
202203
- return;
202204
- };
202205
-
202206
- generateSourceClient = async (userPrompt, apply) => {
202207
-
202208
- this.#createModel();
202295
+ */
202209
202296
 
202210
202297
  const what = await this.#what(userPrompt);
202211
- this.#parent.addMessage("명령을 이해했습니다.");
202298
+ //this.#parent.addMessage("명령을 이해했습니다.");
202299
+ progressMessageInstance.updateProgress('prepare1', 'completed');
202212
202300
 
202213
202301
  if (what === "1") {
202214
202302
  if (!apply.mybatis || !apply.service || !apply.controller || !apply.javascript) ;
202215
202303
  //await this.#createSource(userPrompt, apply);
202216
- await this.#modifySource(userPrompt, apply);
202304
+ await this.#modifySource(userPrompt, apply, progressMessageInstance);
202217
202305
  }
202218
202306
  else if (what === "2") {
202219
- await this.#modifySource(userPrompt, apply);
202307
+ await this.#modifySource(userPrompt, apply, progressMessageInstance);
202220
202308
  }
202221
202309
 
202222
202310
  return "OK";
@@ -202502,7 +202590,7 @@ class IdeAssi extends HTMLElement
202502
202590
 
202503
202591
  try {
202504
202592
  const r = await this.#ai.generateSourceClient(userPrompt, apply);
202505
- elAiChat.add("ai", r);
202593
+ //elAiChat.add("ai", r);
202506
202594
  } catch (error) {
202507
202595
  console.error(error);
202508
202596
  elAiChat.add("ai", String(error).replace("Error:", ""));
@@ -202110,13 +202110,13 @@ class IdeAi
202110
202110
  await this.#generateRealFile(srcPath, apply);
202111
202111
  };
202112
202112
 
202113
- #modifySource = async (userPrompt, apply) => {
202113
+ #modifySource = async (userPrompt, apply, progressMessageInstance) => {
202114
202114
 
202115
202115
  const el = ninegrid.querySelector("nx-side-menu-item.active");
202116
202116
  if (!el) throw new Error("관련 메뉴를 찾을 수 없습니다.");
202117
202117
 
202118
202118
  const href = el.getAttribute("href");
202119
- el.getAttribute("title");
202119
+ const title = el.getAttribute("title");
202120
202120
 
202121
202121
  const srcPath = this.#getSourcePath(href);
202122
202122
  console.log(srcPath);
@@ -202135,7 +202135,7 @@ class IdeAi
202135
202135
  * "javascriptPullPath": "ide-assi-fe-vite-react-js/src/views/tmpla/doc-manager.jsx"
202136
202136
  * }
202137
202137
  */
202138
- await api.post("/api/source/read", srcPath);
202138
+ const src = await api.post("/api/source/read", srcPath);
202139
202139
  //console.log(src);
202140
202140
 
202141
202141
  /**
@@ -202151,28 +202151,122 @@ class IdeAi
202151
202151
  title: elem.getAttribute("title"),
202152
202152
  })*/
202153
202153
 
202154
+
202155
+
202156
+
202157
+
202158
+ const where = await this.#where(`${title}에서 ${userPrompt}`, [{url: href, title: title}], await this.#getTableList());
202159
+ //this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
202160
+ progressMessageInstance.updateProgress('prepare2', 'completed');
202161
+
202162
+ console.log(where);
202163
+
202164
+ //const srcPath = this.#getSourcePath(where.menu.url);
202165
+
202166
+ console.log(srcPath);
202167
+
202168
+ const columnInfo = await this.#getColumnInfo(where.table);
202169
+
202170
+ let mybatisXmlSource;
202171
+ if (apply.mybatis) {
202172
+ mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/U.BuildMyBatisMapper.txt", "mybatis.xml", {
202173
+ userPrompt: userPrompt,
202174
+ originSrc: src.mybatis,
202175
+ resultType: srcPath.resultType,
202176
+ namespace: srcPath.namespace,
202177
+ tableDefinitions: columnInfo,
202178
+ });
202179
+ //this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
202180
+ progressMessageInstance.updateProgress('mybatis', 'completed');
202181
+ }
202182
+ else {
202183
+ mybatisXmlSource = src.mybatis;
202184
+ }
202185
+
202186
+ let serviceSrc;
202187
+ if (apply.service) {
202188
+ serviceSrc = await this.#generateTmplFile("/prompts/meta/U.BuildService.txt", "service.java", {
202189
+ userPrompt: userPrompt,
202190
+ originSrc: src.service,
202191
+ baseClass: srcPath.baseClass,
202192
+ myBatisPath: srcPath.mybatis,
202193
+ namespace: srcPath.namespace,
202194
+ package: srcPath.package + ".service",
202195
+ mybatisXmlSource: mybatisXmlSource,
202196
+ });
202197
+ //this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
202198
+ progressMessageInstance.updateProgress('service', 'completed');
202199
+ }
202200
+ else {
202201
+ serviceSrc = src.service;
202202
+ }
202203
+
202204
+ let controllerSrc;
202205
+ if (apply.controller) {
202206
+ controllerSrc = await this.#generateTmplFile("/prompts/meta/U.BuildController.txt", "controller.java", {
202207
+ userPrompt: userPrompt,
202208
+ originSrc: src.controller,
202209
+ baseClass: srcPath.baseClass,
202210
+ menuUrl: where.menu.url,
202211
+ package: srcPath.package + ".controller",
202212
+ serviceSource: serviceSrc,
202213
+ });
202214
+ //this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
202215
+ progressMessageInstance.updateProgress('controller', 'completed');
202216
+ }
202217
+ else {
202218
+ controllerSrc = src.controller;
202219
+ }
202220
+ if (apply.javascript) {
202221
+ await this.#generateTmplFile("/prompts/meta/U.BuildReactJsx.txt", "react.jsx", {
202222
+ userPrompt: userPrompt,
202223
+ mybatis: srcPath.mybatis,
202224
+ originSrc: src.javascript,
202225
+ menuUrl: where.menu.url,
202226
+ menuName: where.menu.name,
202227
+ baseClass: srcPath.baseClass,
202228
+ controllerSource: controllerSrc,
202229
+ tableDefinitions: columnInfo,
202230
+ });
202231
+ //this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
202232
+ progressMessageInstance.updateProgress('javascript', 'completed');
202233
+ }
202234
+ else {
202235
+ src.javascript;
202236
+ }
202237
+ //console.log(src.javascript);
202238
+ //progressMessageInstance.updateProgress('javascript', 'completed');
202239
+
202240
+ await this.#generateRealFile(srcPath, apply);
202241
+ };
202242
+
202243
+ generateSourceClient = async (userPrompt, apply) => {
202244
+
202245
+ this.#createModel();
202246
+
202154
202247
  const initialProgressData = [
202155
- { id: '1', message: '메뉴와 테이블을 검색중입니다', completedMessage: '관련 메뉴와 테이블을 찾았습니다.' }
202248
+ { id: 'prepare1', message: '명령을 해석중입니다.', completedMessage: '명령을 해석했습니다.' },
202249
+ { id: 'prepare2', message: '메뉴와 테이블을 검색중입니다', completedMessage: '관련 메뉴와 테이블을 찾았습니다.' },
202156
202250
  ];
202157
202251
  if (apply.mybatis) {
202158
- initialProgressData.push({ id: '2', message: 'MyBatis 소스파일을 생성중입니다', completedMessage: 'MyBatis 소스파일을 생성했습니다.' });
202252
+ initialProgressData.push({ id: 'mybatis', message: 'MyBatis 소스파일을 생성중입니다', completedMessage: 'MyBatis 소스파일을 생성했습니다.' });
202159
202253
  }
202160
202254
  if (apply.service) {
202161
- initialProgressData.push({ id: '3', message: 'Java(Service) 소스파일을 생성중입니다', completedMessage: 'Java(Service) 소스파일을 생성했습니다.' });
202255
+ initialProgressData.push({ id: 'service', message: 'Java(Service) 소스파일을 생성중입니다', completedMessage: 'Java(Service) 소스파일을 생성했습니다.' });
202162
202256
  }
202163
202257
 
202164
202258
  if (apply.controller) {
202165
- initialProgressData.push({ id: '4', message: 'Java(Controller) 소스파일을 생성중입니다', completedMessage: 'Java(Controller) 소스파일을 생성했습니다.' });
202259
+ initialProgressData.push({ id: 'controller', message: 'Java(Controller) 소스파일을 생성중입니다', completedMessage: 'Java(Controller) 소스파일을 생성했습니다.' });
202166
202260
  }
202167
202261
 
202168
202262
  if (apply.javascript) {
202169
- initialProgressData.push({ id: '5', message: 'Jsx(React) 소스파일을 생성중입니다', completedMessage: 'Jsx(React) 소스파일을 생성했습니다.' });
202263
+ initialProgressData.push({ id: 'javascript', message: 'Jsx(React) 소스파일을 생성중입니다', completedMessage: 'Jsx(React) 소스파일을 생성했습니다.' });
202170
202264
  }
202171
202265
 
202172
202266
  const elAiChat = this.#parent.shadowRoot.querySelector("nx-ai-chat");
202173
202267
  const progressMessageInstance = elAiChat.addProgress(initialProgressData);
202174
202268
 
202175
-
202269
+ /**
202176
202270
  // 2. 시간이 지난 후, 특정 단계의 완료를 알림
202177
202271
  // 예를 들어, 3초 후에 분석 완료
202178
202272
  setTimeout(() => {
@@ -202194,25 +202288,19 @@ class IdeAi
202194
202288
  setTimeout(() => {
202195
202289
  elAiChat.add("ai", "모든 작업이 성공적으로 완료되었습니다!", [], []);
202196
202290
  }, 9000);
202197
-
202198
-
202199
- return;
202200
- };
202201
-
202202
- generateSourceClient = async (userPrompt, apply) => {
202203
-
202204
- this.#createModel();
202291
+ */
202205
202292
 
202206
202293
  const what = await this.#what(userPrompt);
202207
- this.#parent.addMessage("명령을 이해했습니다.");
202294
+ //this.#parent.addMessage("명령을 이해했습니다.");
202295
+ progressMessageInstance.updateProgress('prepare1', 'completed');
202208
202296
 
202209
202297
  if (what === "1") {
202210
202298
  if (!apply.mybatis || !apply.service || !apply.controller || !apply.javascript) ;
202211
202299
  //await this.#createSource(userPrompt, apply);
202212
- await this.#modifySource(userPrompt, apply);
202300
+ await this.#modifySource(userPrompt, apply, progressMessageInstance);
202213
202301
  }
202214
202302
  else if (what === "2") {
202215
- await this.#modifySource(userPrompt, apply);
202303
+ await this.#modifySource(userPrompt, apply, progressMessageInstance);
202216
202304
  }
202217
202305
 
202218
202306
  return "OK";
@@ -202498,7 +202586,7 @@ class IdeAssi extends HTMLElement
202498
202586
 
202499
202587
  try {
202500
202588
  const r = await this.#ai.generateSourceClient(userPrompt, apply);
202501
- elAiChat.add("ai", r);
202589
+ //elAiChat.add("ai", r);
202502
202590
  } catch (error) {
202503
202591
  console.error(error);
202504
202592
  elAiChat.add("ai", String(error).replace("Error:", ""));
@@ -390,7 +390,7 @@ export class IdeAi
390
390
  await this.#generateRealFile(srcPath, apply);
391
391
  };
392
392
 
393
- #modifySource = async (userPrompt, apply) => {
393
+ #modifySource = async (userPrompt, apply, progressMessageInstance) => {
394
394
 
395
395
  const el = ninegrid.querySelector("nx-side-menu-item.active");
396
396
  if (!el) throw new Error("관련 메뉴를 찾을 수 없습니다.");
@@ -431,58 +431,13 @@ export class IdeAi
431
431
  title: elem.getAttribute("title"),
432
432
  })*/
433
433
 
434
- const initialProgressData = [
435
- { id: '1', message: '메뉴와 테이블을 검색중입니다', completedMessage: '관련 메뉴와 테이블을 찾았습니다.' }
436
- ];
437
- if (apply.mybatis) {
438
- initialProgressData.push({ id: '2', message: 'MyBatis 소스파일을 생성중입니다', completedMessage: 'MyBatis 소스파일을 생성했습니다.' });
439
- }
440
- if (apply.service) {
441
- initialProgressData.push({ id: '3', message: 'Java(Service) 소스파일을 생성중입니다', completedMessage: 'Java(Service) 소스파일을 생성했습니다.' });
442
- }
443
-
444
- if (apply.controller) {
445
- initialProgressData.push({ id: '4', message: 'Java(Controller) 소스파일을 생성중입니다', completedMessage: 'Java(Controller) 소스파일을 생성했습니다.' });
446
- }
447
-
448
- if (apply.javascript) {
449
- initialProgressData.push({ id: '5', message: 'Jsx(React) 소스파일을 생성중입니다', completedMessage: 'Jsx(React) 소스파일을 생성했습니다.' });
450
- }
451
-
452
- const elAiChat = this.#parent.shadowRoot.querySelector("nx-ai-chat");
453
- const progressMessageInstance = elAiChat.addProgress(initialProgressData);
454
-
455
-
456
- // 2. 시간이 지난 후, 특정 단계의 완료를 알림
457
- // 예를 들어, 3초 후에 분석 완료
458
- setTimeout(() => {
459
- if (progressMessageInstance) {
460
- progressMessageInstance.updateProgress('1', 'completed');
461
- console.log("분석 완료 메시지 업데이트");
462
- }
463
- }, 3000);
464
-
465
- // 예를 들어, 6초 후에 설계 완료
466
- setTimeout(() => {
467
- if (progressMessageInstance) {
468
- progressMessageInstance.updateProgress('2', 'completed');
469
- console.log("설계 완료 메시지 업데이트");
470
- }
471
- }, 6000);
472
-
473
- // 모든 단계가 완료된 후, 일반 AI 메시지 추가 (선택 사항)
474
- setTimeout(() => {
475
- elAiChat.add("ai", "모든 작업이 성공적으로 완료되었습니다!", [], []);
476
- }, 9000);
477
-
478
-
479
- return;
480
434
 
481
435
 
482
436
 
483
437
 
484
438
  const where = await this.#where(`${title}에서 ${userPrompt}`, [{url: href, title: title}], await this.#getTableList());
485
- this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.")
439
+ //this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
440
+ progressMessageInstance.updateProgress('prepare2', 'completed');
486
441
 
487
442
  console.log(where);
488
443
 
@@ -501,7 +456,8 @@ export class IdeAi
501
456
  namespace: srcPath.namespace,
502
457
  tableDefinitions: columnInfo,
503
458
  });
504
- this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
459
+ //this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
460
+ progressMessageInstance.updateProgress('mybatis', 'completed');
505
461
  }
506
462
  else {
507
463
  mybatisXmlSource = src.mybatis;
@@ -518,7 +474,8 @@ export class IdeAi
518
474
  package: srcPath.package + ".service",
519
475
  mybatisXmlSource: mybatisXmlSource,
520
476
  });
521
- this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
477
+ //this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
478
+ progressMessageInstance.updateProgress('service', 'completed');
522
479
  }
523
480
  else {
524
481
  serviceSrc = src.service;
@@ -534,7 +491,8 @@ export class IdeAi
534
491
  package: srcPath.package + ".controller",
535
492
  serviceSource: serviceSrc,
536
493
  });
537
- this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
494
+ //this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
495
+ progressMessageInstance.updateProgress('controller', 'completed');
538
496
  }
539
497
  else {
540
498
  controllerSrc = src.controller;
@@ -552,12 +510,14 @@ export class IdeAi
552
510
  controllerSource: controllerSrc,
553
511
  tableDefinitions: columnInfo,
554
512
  });
555
- this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
513
+ //this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
514
+ progressMessageInstance.updateProgress('javascript', 'completed');
556
515
  }
557
516
  else {
558
517
  jsSrc = src.javascript;
559
518
  }
560
519
  //console.log(src.javascript);
520
+ //progressMessageInstance.updateProgress('javascript', 'completed');
561
521
 
562
522
  await this.#generateRealFile(srcPath, apply);
563
523
  };
@@ -566,18 +526,65 @@ export class IdeAi
566
526
 
567
527
  this.#createModel();
568
528
 
529
+ const initialProgressData = [
530
+ { id: 'prepare1', message: '명령을 해석중입니다.', completedMessage: '명령을 해석했습니다.' },
531
+ { id: 'prepare2', message: '메뉴와 테이블을 검색중입니다', completedMessage: '관련 메뉴와 테이블을 찾았습니다.' },
532
+ ];
533
+ if (apply.mybatis) {
534
+ initialProgressData.push({ id: 'mybatis', message: 'MyBatis 소스파일을 생성중입니다', completedMessage: 'MyBatis 소스파일을 생성했습니다.' });
535
+ }
536
+ if (apply.service) {
537
+ initialProgressData.push({ id: 'service', message: 'Java(Service) 소스파일을 생성중입니다', completedMessage: 'Java(Service) 소스파일을 생성했습니다.' });
538
+ }
539
+
540
+ if (apply.controller) {
541
+ initialProgressData.push({ id: 'controller', message: 'Java(Controller) 소스파일을 생성중입니다', completedMessage: 'Java(Controller) 소스파일을 생성했습니다.' });
542
+ }
543
+
544
+ if (apply.javascript) {
545
+ initialProgressData.push({ id: 'javascript', message: 'Jsx(React) 소스파일을 생성중입니다', completedMessage: 'Jsx(React) 소스파일을 생성했습니다.' });
546
+ }
547
+
548
+ const elAiChat = this.#parent.shadowRoot.querySelector("nx-ai-chat");
549
+ const progressMessageInstance = elAiChat.addProgress(initialProgressData);
550
+
551
+ /**
552
+ // 2. 시간이 지난 후, 특정 단계의 완료를 알림
553
+ // 예를 들어, 3초 후에 분석 완료
554
+ setTimeout(() => {
555
+ if (progressMessageInstance) {
556
+ progressMessageInstance.updateProgress('1', 'completed');
557
+ console.log("분석 완료 메시지 업데이트");
558
+ }
559
+ }, 3000);
560
+
561
+ // 예를 들어, 6초 후에 설계 완료
562
+ setTimeout(() => {
563
+ if (progressMessageInstance) {
564
+ progressMessageInstance.updateProgress('2', 'completed');
565
+ console.log("설계 완료 메시지 업데이트");
566
+ }
567
+ }, 6000);
568
+
569
+ // 모든 단계가 완료된 후, 일반 AI 메시지 추가 (선택 사항)
570
+ setTimeout(() => {
571
+ elAiChat.add("ai", "모든 작업이 성공적으로 완료되었습니다!", [], []);
572
+ }, 9000);
573
+ */
574
+
569
575
  const what = await this.#what(userPrompt);
570
- this.#parent.addMessage("명령을 이해했습니다.");
576
+ //this.#parent.addMessage("명령을 이해했습니다.");
577
+ progressMessageInstance.updateProgress('prepare1', 'completed');
571
578
 
572
579
  if (what === "1") {
573
580
  if (!apply.mybatis || !apply.service || !apply.controller || !apply.javascript) {
574
581
  //return "소스 생성하실려면 변경대상 소스를 모두 선택하세요.";
575
582
  }
576
583
  //await this.#createSource(userPrompt, apply);
577
- await this.#modifySource(userPrompt, apply);
584
+ await this.#modifySource(userPrompt, apply, progressMessageInstance);
578
585
  }
579
586
  else if (what === "2") {
580
- await this.#modifySource(userPrompt, apply);
587
+ await this.#modifySource(userPrompt, apply, progressMessageInstance);
581
588
  }
582
589
 
583
590
  return "OK";
@@ -578,7 +578,7 @@ export default DocManager;
578
578
 
579
579
  try {
580
580
  const r = await this.#ai.generateSourceClient(userPrompt, apply);
581
- elAiChat.add("ai", r);
581
+ //elAiChat.add("ai", r);
582
582
  } catch (error) {
583
583
  console.error(error);
584
584
  elAiChat.add("ai", String(error).replace("Error:", ""));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.450.0",
4
+ "version": "0.453.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -390,7 +390,7 @@ export class IdeAi
390
390
  await this.#generateRealFile(srcPath, apply);
391
391
  };
392
392
 
393
- #modifySource = async (userPrompt, apply) => {
393
+ #modifySource = async (userPrompt, apply, progressMessageInstance) => {
394
394
 
395
395
  const el = ninegrid.querySelector("nx-side-menu-item.active");
396
396
  if (!el) throw new Error("관련 메뉴를 찾을 수 없습니다.");
@@ -431,58 +431,13 @@ export class IdeAi
431
431
  title: elem.getAttribute("title"),
432
432
  })*/
433
433
 
434
- const initialProgressData = [
435
- { id: '1', message: '메뉴와 테이블을 검색중입니다', completedMessage: '관련 메뉴와 테이블을 찾았습니다.' }
436
- ];
437
- if (apply.mybatis) {
438
- initialProgressData.push({ id: '2', message: 'MyBatis 소스파일을 생성중입니다', completedMessage: 'MyBatis 소스파일을 생성했습니다.' });
439
- }
440
- if (apply.service) {
441
- initialProgressData.push({ id: '3', message: 'Java(Service) 소스파일을 생성중입니다', completedMessage: 'Java(Service) 소스파일을 생성했습니다.' });
442
- }
443
-
444
- if (apply.controller) {
445
- initialProgressData.push({ id: '4', message: 'Java(Controller) 소스파일을 생성중입니다', completedMessage: 'Java(Controller) 소스파일을 생성했습니다.' });
446
- }
447
-
448
- if (apply.javascript) {
449
- initialProgressData.push({ id: '5', message: 'Jsx(React) 소스파일을 생성중입니다', completedMessage: 'Jsx(React) 소스파일을 생성했습니다.' });
450
- }
451
-
452
- const elAiChat = this.#parent.shadowRoot.querySelector("nx-ai-chat");
453
- const progressMessageInstance = elAiChat.addProgress(initialProgressData);
454
-
455
-
456
- // 2. 시간이 지난 후, 특정 단계의 완료를 알림
457
- // 예를 들어, 3초 후에 분석 완료
458
- setTimeout(() => {
459
- if (progressMessageInstance) {
460
- progressMessageInstance.updateProgress('1', 'completed');
461
- console.log("분석 완료 메시지 업데이트");
462
- }
463
- }, 3000);
464
-
465
- // 예를 들어, 6초 후에 설계 완료
466
- setTimeout(() => {
467
- if (progressMessageInstance) {
468
- progressMessageInstance.updateProgress('2', 'completed');
469
- console.log("설계 완료 메시지 업데이트");
470
- }
471
- }, 6000);
472
-
473
- // 모든 단계가 완료된 후, 일반 AI 메시지 추가 (선택 사항)
474
- setTimeout(() => {
475
- elAiChat.add("ai", "모든 작업이 성공적으로 완료되었습니다!", [], []);
476
- }, 9000);
477
-
478
-
479
- return;
480
434
 
481
435
 
482
436
 
483
437
 
484
438
  const where = await this.#where(`${title}에서 ${userPrompt}`, [{url: href, title: title}], await this.#getTableList());
485
- this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.")
439
+ //this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
440
+ progressMessageInstance.updateProgress('prepare2', 'completed');
486
441
 
487
442
  console.log(where);
488
443
 
@@ -501,7 +456,8 @@ export class IdeAi
501
456
  namespace: srcPath.namespace,
502
457
  tableDefinitions: columnInfo,
503
458
  });
504
- this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
459
+ //this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
460
+ progressMessageInstance.updateProgress('mybatis', 'completed');
505
461
  }
506
462
  else {
507
463
  mybatisXmlSource = src.mybatis;
@@ -518,7 +474,8 @@ export class IdeAi
518
474
  package: srcPath.package + ".service",
519
475
  mybatisXmlSource: mybatisXmlSource,
520
476
  });
521
- this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
477
+ //this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
478
+ progressMessageInstance.updateProgress('service', 'completed');
522
479
  }
523
480
  else {
524
481
  serviceSrc = src.service;
@@ -534,7 +491,8 @@ export class IdeAi
534
491
  package: srcPath.package + ".controller",
535
492
  serviceSource: serviceSrc,
536
493
  });
537
- this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
494
+ //this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
495
+ progressMessageInstance.updateProgress('controller', 'completed');
538
496
  }
539
497
  else {
540
498
  controllerSrc = src.controller;
@@ -552,12 +510,14 @@ export class IdeAi
552
510
  controllerSource: controllerSrc,
553
511
  tableDefinitions: columnInfo,
554
512
  });
555
- this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
513
+ //this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
514
+ progressMessageInstance.updateProgress('javascript', 'completed');
556
515
  }
557
516
  else {
558
517
  jsSrc = src.javascript;
559
518
  }
560
519
  //console.log(src.javascript);
520
+ //progressMessageInstance.updateProgress('javascript', 'completed');
561
521
 
562
522
  await this.#generateRealFile(srcPath, apply);
563
523
  };
@@ -566,18 +526,65 @@ export class IdeAi
566
526
 
567
527
  this.#createModel();
568
528
 
529
+ const initialProgressData = [
530
+ { id: 'prepare1', message: '명령을 해석중입니다.', completedMessage: '명령을 해석했습니다.' },
531
+ { id: 'prepare2', message: '메뉴와 테이블을 검색중입니다', completedMessage: '관련 메뉴와 테이블을 찾았습니다.' },
532
+ ];
533
+ if (apply.mybatis) {
534
+ initialProgressData.push({ id: 'mybatis', message: 'MyBatis 소스파일을 생성중입니다', completedMessage: 'MyBatis 소스파일을 생성했습니다.' });
535
+ }
536
+ if (apply.service) {
537
+ initialProgressData.push({ id: 'service', message: 'Java(Service) 소스파일을 생성중입니다', completedMessage: 'Java(Service) 소스파일을 생성했습니다.' });
538
+ }
539
+
540
+ if (apply.controller) {
541
+ initialProgressData.push({ id: 'controller', message: 'Java(Controller) 소스파일을 생성중입니다', completedMessage: 'Java(Controller) 소스파일을 생성했습니다.' });
542
+ }
543
+
544
+ if (apply.javascript) {
545
+ initialProgressData.push({ id: 'javascript', message: 'Jsx(React) 소스파일을 생성중입니다', completedMessage: 'Jsx(React) 소스파일을 생성했습니다.' });
546
+ }
547
+
548
+ const elAiChat = this.#parent.shadowRoot.querySelector("nx-ai-chat");
549
+ const progressMessageInstance = elAiChat.addProgress(initialProgressData);
550
+
551
+ /**
552
+ // 2. 시간이 지난 후, 특정 단계의 완료를 알림
553
+ // 예를 들어, 3초 후에 분석 완료
554
+ setTimeout(() => {
555
+ if (progressMessageInstance) {
556
+ progressMessageInstance.updateProgress('1', 'completed');
557
+ console.log("분석 완료 메시지 업데이트");
558
+ }
559
+ }, 3000);
560
+
561
+ // 예를 들어, 6초 후에 설계 완료
562
+ setTimeout(() => {
563
+ if (progressMessageInstance) {
564
+ progressMessageInstance.updateProgress('2', 'completed');
565
+ console.log("설계 완료 메시지 업데이트");
566
+ }
567
+ }, 6000);
568
+
569
+ // 모든 단계가 완료된 후, 일반 AI 메시지 추가 (선택 사항)
570
+ setTimeout(() => {
571
+ elAiChat.add("ai", "모든 작업이 성공적으로 완료되었습니다!", [], []);
572
+ }, 9000);
573
+ */
574
+
569
575
  const what = await this.#what(userPrompt);
570
- this.#parent.addMessage("명령을 이해했습니다.");
576
+ //this.#parent.addMessage("명령을 이해했습니다.");
577
+ progressMessageInstance.updateProgress('prepare1', 'completed');
571
578
 
572
579
  if (what === "1") {
573
580
  if (!apply.mybatis || !apply.service || !apply.controller || !apply.javascript) {
574
581
  //return "소스 생성하실려면 변경대상 소스를 모두 선택하세요.";
575
582
  }
576
583
  //await this.#createSource(userPrompt, apply);
577
- await this.#modifySource(userPrompt, apply);
584
+ await this.#modifySource(userPrompt, apply, progressMessageInstance);
578
585
  }
579
586
  else if (what === "2") {
580
- await this.#modifySource(userPrompt, apply);
587
+ await this.#modifySource(userPrompt, apply, progressMessageInstance);
581
588
  }
582
589
 
583
590
  return "OK";
@@ -578,7 +578,7 @@ export default DocManager;
578
578
 
579
579
  try {
580
580
  const r = await this.#ai.generateSourceClient(userPrompt, apply);
581
- elAiChat.add("ai", r);
581
+ //elAiChat.add("ai", r);
582
582
  } catch (error) {
583
583
  console.error(error);
584
584
  elAiChat.add("ai", String(error).replace("Error:", ""));