@nine-lab/nine-mu 0.1.325 → 0.1.326

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.
package/dist/nine-mu.js CHANGED
@@ -9,7 +9,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
11
11
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
12
- var _owner, _collectedFiles, _NotificationHandler_instances, handleLoggingMessage_fn, _collectModifySource, _openDiffPopup, _generateSource, _generateMenu, _mcpClient, _onAction, _onStatus, _onMessage, _owner2, _routeUrl, _chatHistory, _notiHandler, _NineChatManager_instances, connect_fn, updateStatus_fn, callTool_fn, _getSourcePath, _service, _packageName, _routesPath, _connectorUrl, _manager, _config, _$nineChatMessage, _NineChat_instances, initInteractions_fn, initActions_fn, render_fn, _makeMenuHandler, _sourceGenHandler, _showDiff, _asisEditorView, _tobeEditorView, _asisEditorEl, _tobeEditorEl, _isDirty, _initialAsisSrc, _initialTobeSrc, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _checkDirtyState, _setupScrollSync, _applyDiffDecorations, _dialog, _tabContainer, _fileList, _host, _NineDiffPopup_instances, renderScaffolding_fn, handleConfirmAll_fn, handleCancel_fn, _dialog2, _diffView, _asisBackup, _host2, _NineMenuDiffPopup_instances, render_fn2, handleConfirm_fn, handleCancel_fn2, _message, _data, _unique, _init, _message2, _init2, _progressData, _progressElements, _animationIntervals, _ProgressMessage_instances, updateCurrentActiveProgress_fn, renderProgress_fn, updateProgressItemVisuals_fn, startAnimation_fn, updateProgressItem_fn, _renderer, _init3;
12
+ var _owner, _manager, _collectedFiles, _NotificationHandler_instances, handleLoggingMessage_fn, _collectModifySource, _openDiffPopup, _openRouteDiffPopup, _generateSource, _generateMenu, _mcpClient, _onAction, _onStatus, _onMessage, _owner2, _routeUrl, _chatHistory, _notiHandler, _NineChatManager_instances, connect_fn, updateStatus_fn, callTool_fn, _getSourcePath, _service, _packageName, _routesPath, _connectorUrl, _manager2, _config, _$nineChatMessage, _NineChat_instances, initInteractions_fn, initActions_fn, render_fn, _makeMenuHandler, _sourceGenHandler, _showDiff, _asisEditorView, _tobeEditorView, _asisEditorEl, _tobeEditorEl, _isDirty, _initialAsisSrc, _initialTobeSrc, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _checkDirtyState, _setupScrollSync, _applyDiffDecorations, _dialog, _tabContainer, _fileList, _host, _NineDiffPopup_instances, renderScaffolding_fn, handleConfirmAll_fn, handleCancel_fn, _dialog2, _diffView, _asisBackup, _host2, _NineMenuDiffPopup_instances, render_fn2, handleConfirm_fn, handleCancel_fn2, _message, _data, _unique, _init, _message2, _init2, _progressData, _progressElements, _animationIntervals, _ProgressMessage_instances, updateCurrentActiveProgress_fn, renderProgress_fn, updateProgressItemVisuals_fn, startAnimation_fn, updateProgressItem_fn, _renderer, _init3;
13
13
  import { trace as trace$1, api, nine as nine$1 } from "@nine-lab/nine-util";
14
14
  class Trace extends trace$1.constructor {
15
15
  constructor() {
@@ -17080,6 +17080,7 @@ class NotificationHandler {
17080
17080
  constructor(owner) {
17081
17081
  __privateAdd(this, _NotificationHandler_instances);
17082
17082
  __privateAdd(this, _owner);
17083
+ __privateAdd(this, _manager);
17083
17084
  __privateAdd(this, _collectedFiles, []);
17084
17085
  /**
17085
17086
  * 레이어별로 순차 도착하는 파일들을 유실 없이 배열 버퍼에 수집
@@ -17100,9 +17101,7 @@ class NotificationHandler {
17100
17101
  __privateAdd(this, _openDiffPopup, () => {
17101
17102
  if (__privateGet(this, _collectedFiles).length === 0) return;
17102
17103
  const $oldPopup = __privateGet(this, _owner).shadowRoot.querySelector("nine-diff-popup");
17103
- if ($oldPopup) {
17104
- $oldPopup.remove();
17105
- }
17104
+ if ($oldPopup) $oldPopup.remove();
17106
17105
  const $diffPopup = document.createElement("nine-diff-popup");
17107
17106
  $diffPopup.setAttribute("package-name", __privateGet(this, _owner).getAttribute("package-name") || "");
17108
17107
  const container = __privateGet(this, _owner).shadowRoot.querySelector(".wrapper") || __privateGet(this, _owner).shadowRoot;
@@ -17111,6 +17110,14 @@ class NotificationHandler {
17111
17110
  $diffPopup.popup();
17112
17111
  __privateSet(this, _collectedFiles, []);
17113
17112
  });
17113
+ __privateAdd(this, _openRouteDiffPopup, (asis, tobe, lang) => {
17114
+ const $oldPopup = __privateGet(this, _owner).shadowRoot.querySelector("nine-menu-diff-popup");
17115
+ if ($oldPopup) $oldPopup.remove();
17116
+ const $diffPopup = document.createElement("nine-menu-diff-popup");
17117
+ const container = __privateGet(this, _owner).shadowRoot.querySelector(".wrapper") || this.shadowRoot;
17118
+ container.appendChild($diffPopup);
17119
+ $diffPopup.popup().data(asis, tobe, lang);
17120
+ });
17114
17121
  /**
17115
17122
  * [분리 비즈니스 로직 2] 수신된 소스코드 데이터 유효성 검증 및 추후 파일 저장 연동
17116
17123
  */
@@ -17125,9 +17132,20 @@ class NotificationHandler {
17125
17132
  trace.log(res);
17126
17133
  });
17127
17134
  __privateAdd(this, _generateMenu, async (data) => {
17128
- trace.log(data);
17135
+ if (!data) return;
17136
+ const hasCreated = data.some((item) => item.action === "CREATE");
17137
+ const hasUpdated = data.some((item) => item.action === "UPDATE");
17138
+ const hasDeleted = data.some((item) => item.action === "DELETE");
17139
+ if (hasUpdated || hasCreated || hasDeleted) {
17140
+ const asis = await __privateGet(this, _manager).getRoutes();
17141
+ nine.alert("메뉴 정리를 위한 라우터 정보 저장 화면으로 이동합니다.").then((res) => {
17142
+ const tobe = (data || []).filter((item) => item.action !== "DELETE").map(({ isNew, action, ...rest }) => rest);
17143
+ __privateGet(this, _openRouteDiffPopup).call(this, asis, tobe, "json");
17144
+ });
17145
+ }
17129
17146
  });
17130
17147
  __privateSet(this, _owner, owner);
17148
+ __privateSet(this, _manager, new NineChatManager(owner));
17131
17149
  }
17132
17150
  /**
17133
17151
  * MCP로부터 수신된 날것의 노티파이 데이터를 정석대로 라우팅하는 메인 메서드
@@ -17140,6 +17158,7 @@ class NotificationHandler {
17140
17158
  }
17141
17159
  }
17142
17160
  _owner = new WeakMap();
17161
+ _manager = new WeakMap();
17143
17162
  _collectedFiles = new WeakMap();
17144
17163
  _NotificationHandler_instances = new WeakSet();
17145
17164
  /**
@@ -17161,6 +17180,7 @@ handleLoggingMessage_fn = function(params) {
17161
17180
  };
17162
17181
  _collectModifySource = new WeakMap();
17163
17182
  _openDiffPopup = new WeakMap();
17183
+ _openRouteDiffPopup = new WeakMap();
17164
17184
  _generateSource = new WeakMap();
17165
17185
  _generateMenu = new WeakMap();
17166
17186
  class NineChatManager {
@@ -17421,7 +17441,7 @@ class NineChat extends HTMLElement {
17421
17441
  __privateAdd(this, _packageName);
17422
17442
  __privateAdd(this, _routesPath);
17423
17443
  __privateAdd(this, _connectorUrl);
17424
- __privateAdd(this, _manager);
17444
+ __privateAdd(this, _manager2);
17425
17445
  __privateAdd(this, _config);
17426
17446
  __privateAdd(this, _$nineChatMessage);
17427
17447
  __publicField(this, "addMessage", (who, message) => {
@@ -17444,8 +17464,8 @@ class NineChat extends HTMLElement {
17444
17464
  }
17445
17465
  });
17446
17466
  __privateAdd(this, _sourceGenHandler, async (e) => {
17447
- const routes = await __privateGet(this, _manager).getRoutes();
17448
- const response = await __privateGet(this, _manager).analyzeUnmappedRoutes(routes);
17467
+ const routes = await __privateGet(this, _manager2).getRoutes();
17468
+ const response = await __privateGet(this, _manager2).analyzeUnmappedRoutes(routes);
17449
17469
  trace.log(response);
17450
17470
  });
17451
17471
  __privateAdd(this, _showDiff, (asis, tobe, lang) => {
@@ -17474,14 +17494,14 @@ class NineChat extends HTMLElement {
17474
17494
  __privateSet(this, _config, res);
17475
17495
  __privateGet(this, _config).packageName = __privateGet(this, _packageName);
17476
17496
  __privateSet(this, _routesPath, (res == null ? void 0 : res.userDir) + "/" + __privateGet(this, _packageName) + "/public/prompts/data/routes.json");
17477
- __privateSet(this, _manager, new NineChatManager(this));
17497
+ __privateSet(this, _manager2, new NineChatManager(this));
17478
17498
  }
17479
17499
  }
17480
17500
  _service = new WeakMap();
17481
17501
  _packageName = new WeakMap();
17482
17502
  _routesPath = new WeakMap();
17483
17503
  _connectorUrl = new WeakMap();
17484
- _manager = new WeakMap();
17504
+ _manager2 = new WeakMap();
17485
17505
  _config = new WeakMap();
17486
17506
  _$nineChatMessage = new WeakMap();
17487
17507
  _NineChat_instances = new WeakSet();
@@ -17516,7 +17536,7 @@ initActions_fn = function() {
17516
17536
  target.setAttribute("disabled", "disabled");
17517
17537
  __privateGet(this, _$nineChatMessage).add("me", userInput);
17518
17538
  __privateGet(this, _$nineChatMessage).add("ing", "");
17519
- const [result, err] = await nine$1.safe(__privateGet(this, _manager).handleChatSubmit(target.value));
17539
+ const [result, err] = await nine$1.safe(__privateGet(this, _manager2).handleChatSubmit(target.value));
17520
17540
  setTimeout(() => {
17521
17541
  target.value = "";
17522
17542
  });
@@ -17530,9 +17550,9 @@ initActions_fn = function() {
17530
17550
  try {
17531
17551
  const rawText = (_b = (_a2 = result == null ? void 0 : result.content) == null ? void 0 : _a2[0]) == null ? void 0 : _b.text;
17532
17552
  const parsed = JSON.parse(rawText);
17533
- __privateGet(this, _manager).addChatHistory(parsed.message);
17553
+ __privateGet(this, _manager2).addChatHistory(parsed.message);
17534
17554
  __privateGet(this, _$nineChatMessage).add("ai", parsed.message);
17535
- const asis = await __privateGet(this, _manager).getRoutes();
17555
+ const asis = await __privateGet(this, _manager2).getRoutes();
17536
17556
  } catch (err2) {
17537
17557
  trace.error(err2);
17538
17558
  const fallbackMessage = ((_d = (_c = result == null ? void 0 : result.content) == null ? void 0 : _c[0]) == null ? void 0 : _d.text) || "응답 데이터를 해석하지 못했습니다.";
@@ -17547,7 +17567,7 @@ render_fn = function() {
17547
17567
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
17548
17568
  this.shadowRoot.innerHTML = `
17549
17569
  <style>
17550
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.324"}/dist/css/nine-mu.css";
17570
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.325"}/dist/css/nine-mu.css";
17551
17571
  ${customImport}
17552
17572
  </style>
17553
17573
  <div class="wrapper">
@@ -43799,7 +43819,7 @@ class NineDiff extends HTMLElement {
43799
43819
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
43800
43820
  this.shadowRoot.innerHTML = `
43801
43821
  <style>
43802
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.324"}/dist/css/nine-mu.css";
43822
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.325"}/dist/css/nine-mu.css";
43803
43823
  ${customImport}
43804
43824
  </style>
43805
43825
 
@@ -43939,7 +43959,7 @@ renderScaffolding_fn = function() {
43939
43959
  const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
43940
43960
  this.shadowRoot.innerHTML = `
43941
43961
  <style>
43942
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.324"}/dist/css/nine-mu.css";
43962
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.325"}/dist/css/nine-mu.css";
43943
43963
  ${customImport}
43944
43964
  </style>
43945
43965
 
@@ -44048,7 +44068,7 @@ render_fn2 = function() {
44048
44068
  const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
44049
44069
  this.shadowRoot.innerHTML = `
44050
44070
  <style>
44051
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.324"}/dist/css/nine-mu.css";
44071
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.325"}/dist/css/nine-mu.css";
44052
44072
  ${customImport}
44053
44073
  </style>
44054
44074
 
@@ -44379,7 +44399,7 @@ class ChatMessageBody extends HTMLElement {
44379
44399
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
44380
44400
  this.shadowRoot.innerHTML = `
44381
44401
  <style>
44382
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.324"}/dist/css/nine-mu.css";
44402
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.325"}/dist/css/nine-mu.css";
44383
44403
  ${customImport}
44384
44404
  </style>
44385
44405
 
@@ -44473,7 +44493,7 @@ if (!customElements.get("nine-chat-progress")) {
44473
44493
  customElements.define("nine-chat-progress", ProgressMessage);
44474
44494
  }
44475
44495
  const NineMu = {
44476
- version: "0.1.324",
44496
+ version: "0.1.325",
44477
44497
  init: (config2) => {
44478
44498
  trace$1.log("🛠️ Nine-Mu Engine initialized", config2);
44479
44499
  }