@nine-lab/nine-mu 0.1.279 → 0.1.280

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, _NotificationHandler_instances, handleLoggingMessage_fn, _modifySource, _generateSource, _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, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _setupScrollSync, _applyDiffDecorations, _dialog, _diffView, _asisBackup, _host, _NineDiffPopup_instances, render_fn2, handleConfirm_fn, handleCancel_fn, _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, _NotificationHandler_instances, handleLoggingMessage_fn, _modifySource, _generateSource, _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, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _setupScrollSync, _applyDiffDecorations, _dialog, _tabContainer, _filesMap, _host, _NineDiffPopup_instances, renderScaffolding_fn, handleConfirmAll_fn, handleCancel_fn, _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() {
@@ -17081,7 +17081,7 @@ class NotificationHandler {
17081
17081
  __privateAdd(this, _NotificationHandler_instances);
17082
17082
  __privateAdd(this, _owner);
17083
17083
  __privateAdd(this, _modifySource, async (data) => {
17084
- console.log(data.source);
17084
+ console.log(data);
17085
17085
  });
17086
17086
  /**
17087
17087
  * [분리 비즈니스 로직 2] 수신된 소스코드 데이터 유효성 검증 및 추후 파일 저장 연동
@@ -17126,13 +17126,11 @@ handleLoggingMessage_fn = function(params) {
17126
17126
  switch (logger) {
17127
17127
  case "generate-source-brain":
17128
17128
  if (data && data.source) {
17129
- trace.log(`[시그널 감지] 설계 완료`, data);
17130
17129
  __privateGet(this, _generateSource).call(this, data);
17131
17130
  }
17132
17131
  break;
17133
17132
  case "modify-source-brain":
17134
17133
  if (data && data.source) {
17135
- trace.log(`[시그널 감지] 설계 완료`, data);
17136
17134
  __privateGet(this, _modifySource).call(this, data);
17137
17135
  }
17138
17136
  break;
@@ -17535,7 +17533,7 @@ render_fn = function() {
17535
17533
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
17536
17534
  this.shadowRoot.innerHTML = `
17537
17535
  <style>
17538
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.278"}/dist/css/nine-mu.css";
17536
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.279"}/dist/css/nine-mu.css";
17539
17537
  ${customImport}
17540
17538
  </style>
17541
17539
  <div class="wrapper">
@@ -43752,7 +43750,7 @@ class NineDiff extends HTMLElement {
43752
43750
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
43753
43751
  this.shadowRoot.innerHTML = `
43754
43752
  <style>
43755
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.278"}/dist/css/nine-mu.css";
43753
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.279"}/dist/css/nine-mu.css";
43756
43754
  ${customImport}
43757
43755
  </style>
43758
43756
 
@@ -43804,96 +43802,147 @@ class NineDiffPopup extends HTMLElement {
43804
43802
  super();
43805
43803
  __privateAdd(this, _NineDiffPopup_instances);
43806
43804
  __privateAdd(this, _dialog, null);
43807
- __privateAdd(this, _diffView, null);
43808
- // Container 대신 직접 에디터 뷰를 참조
43809
- __privateAdd(this, _asisBackup, "");
43805
+ __privateAdd(this, _tabContainer, null);
43806
+ __privateAdd(this, _filesMap, /* @__PURE__ */ new Map());
43807
+ // 각 탭(파일)별 원본 및 에디터 뷰 인스턴스, 메타데이터 관리를 위한 맵
43810
43808
  __privateAdd(this, _host);
43811
43809
  this.attachShadow({ mode: "open" });
43812
43810
  }
43813
43811
  connectedCallback() {
43814
43812
  __privateSet(this, _host, this.getRootNode().host);
43815
- __privateMethod(this, _NineDiffPopup_instances, render_fn2).call(this);
43813
+ __privateMethod(this, _NineDiffPopup_instances, renderScaffolding_fn).call(this);
43816
43814
  }
43817
43815
  popup() {
43818
43816
  __privateGet(this, _dialog).showModal();
43819
43817
  return this;
43820
43818
  }
43821
43819
  /**
43822
- * @param {string|object} asis - 소스 텍스트 또는 url:/file: 경로
43823
- * @param {string|object} tobe - 소스 텍스트 또는 url:/file: 경로
43824
- * @param {string} lang - 언어 설정
43820
+ * 💡 [핵심 고도화] 여러 파일 리스트를 받아 동적으로 탭을 생성하고 데이터를 주입하는 함수
43821
+ * @param {Array} fileList - [{ layer: "MyBatis", full_path: "...", asis_source: "...", source: "..." }]
43825
43822
  */
43826
- async data(asis, tobe, lang = "javascript") {
43827
- const loadSource = async (src) => {
43828
- if (typeof src === "string" && (src.startsWith("url:") || src.startsWith("file:"))) {
43829
- const targetUrl = src.replace(/^(url:|file:)/, "");
43830
- try {
43831
- trace.log(`📡 리모트 로드: ${targetUrl}`);
43832
- const res = await fetch(targetUrl);
43833
- if (!res.ok) throw new Error(`Status: ${res.status}`);
43834
- return await res.text();
43835
- } catch (e) {
43836
- trace.error(`로드 실패 [${targetUrl}]:`, e);
43837
- return `// 로드 실패: ${targetUrl}
43838
- ${e.message}`;
43839
- }
43840
- }
43841
- return src;
43823
+ async data(fileList) {
43824
+ if (!Array.isArray(fileList) || fileList.length === 0) return this;
43825
+ __privateGet(this, _tabContainer).innerHTML = "";
43826
+ __privateGet(this, _filesMap).clear();
43827
+ const detectLanguage = (path) => {
43828
+ const lower = (path || "").toLowerCase();
43829
+ if (lower.endsWith(".xml")) return "xml";
43830
+ if (lower.endsWith(".java")) return "java";
43831
+ if (lower.endsWith(".json")) return "json";
43832
+ return "javascript";
43842
43833
  };
43843
- const [finalAsis, finalTobe] = await Promise.all([
43844
- loadSource(asis),
43845
- loadSource(tobe)
43846
- ]);
43847
- __privateSet(this, _asisBackup, finalAsis);
43848
- __privateGet(this, _diffView).addEventListener("ready", () => {
43849
- const asisStr = typeof finalAsis === "object" ? JSON.stringify(finalAsis, null, 2) : finalAsis;
43850
- const tobeStr = typeof finalTobe === "object" ? JSON.stringify(finalTobe, null, 2) : finalTobe;
43851
- __privateGet(this, _diffView).initialize(asisStr, tobeStr, lang);
43852
- }, { once: true });
43834
+ fileList.forEach((file, index) => {
43835
+ const { layer: layer2, full_path, asis_source, source } = file;
43836
+ const lang = detectLanguage(full_path);
43837
+ const caption = `${layer2} (${full_path.split("/").pop()})`;
43838
+ const tabPage = document.createElement("nine-tab-page");
43839
+ tabPage.setAttribute("caption", caption);
43840
+ const diffWrapper = document.createElement("div");
43841
+ diffWrapper.className = "diff-wrapper";
43842
+ const diffView = document.createElement("nine-diff");
43843
+ diffWrapper.appendChild(diffView);
43844
+ tabPage.appendChild(diffWrapper);
43845
+ __privateGet(this, _tabContainer).appendChild(tabPage);
43846
+ const fileKey = `file_tab_${index}`;
43847
+ __privateGet(this, _filesMap).set(fileKey, {
43848
+ layer: layer2,
43849
+ fullPath: full_path,
43850
+ asisSource: asis_source,
43851
+ diffView
43852
+ });
43853
+ diffView.addEventListener("ready", () => {
43854
+ diffView.initialize(asis_source || "", source || "", lang);
43855
+ }, { once: true });
43856
+ });
43853
43857
  return this;
43854
43858
  }
43855
43859
  }
43856
43860
  _dialog = new WeakMap();
43857
- _diffView = new WeakMap();
43858
- _asisBackup = new WeakMap();
43861
+ _tabContainer = new WeakMap();
43862
+ _filesMap = new WeakMap();
43859
43863
  _host = new WeakMap();
43860
43864
  _NineDiffPopup_instances = new WeakSet();
43861
- render_fn2 = function() {
43865
+ /**
43866
+ * 💡 기본 다이얼로그 및 레이아웃 스케폴딩 렌더링
43867
+ */
43868
+ renderScaffolding_fn = function() {
43862
43869
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
43870
+ const appVersion = "0.1.279";
43863
43871
  this.shadowRoot.innerHTML = `
43864
- <style>
43865
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.278"}/dist/css/nine-mu.css";
43872
+ <style>
43873
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${appVersion}/dist/css/nine-mu.css";
43866
43874
  ${customImport}
43875
+
43876
+ .main-layout {
43877
+ display: flex;
43878
+ flex-direction: column;
43879
+ height: 80vh;
43880
+ width: 85vw;
43881
+ min-width: 800px;
43882
+ }
43883
+ .tab-area {
43884
+ flex: 1;
43885
+ overflow: hidden;
43886
+ display: flex;
43887
+ flex-direction: column;
43888
+ }
43889
+ nine-tab {
43890
+ flex: 1;
43891
+ display: flex;
43892
+ flex-direction: column;
43893
+ height: 100%;
43894
+ }
43895
+ .diff-wrapper {
43896
+ height: calc(80vh - 120px); /* 푸터와 탭 헤더 높이를 제외한 에디터 영역 확보 */
43897
+ width: 100%;
43898
+ }
43899
+ .footer {
43900
+ display: flex;
43901
+ justify-content: flex-end;
43902
+ gap: 10px;
43903
+ padding: 15px 0 0 0;
43904
+ border-top: 1px solid #e5e7eb;
43905
+ }
43867
43906
  </style>
43868
43907
 
43869
43908
  <nine-dialog>
43870
43909
  <div class="main-layout">
43871
- <div class="diff-area">
43872
- <nine-diff></nine-diff>
43910
+ <div class="tab-area">
43911
+ <nine-tab theme="theme-3"></nine-tab>
43873
43912
  </div>
43874
43913
  <div class="footer">
43875
43914
  <button class="btn btn-cancel">취소</button>
43876
- <button class="btn btn-confirm">저장</button>
43915
+ <button class="btn btn-confirm">모두 저장</button>
43877
43916
  </div>
43878
43917
  </div>
43879
43918
  </nine-dialog>
43880
43919
  `;
43881
43920
  __privateSet(this, _dialog, this.shadowRoot.querySelector("nine-dialog"));
43882
- __privateSet(this, _diffView, this.shadowRoot.querySelector("nine-diff"));
43883
- this.shadowRoot.querySelector(".btn-confirm").onclick = () => __privateMethod(this, _NineDiffPopup_instances, handleConfirm_fn).call(this);
43921
+ __privateSet(this, _tabContainer, this.shadowRoot.querySelector("nine-tab"));
43922
+ this.shadowRoot.querySelector(".btn-confirm").onclick = () => __privateMethod(this, _NineDiffPopup_instances, handleConfirmAll_fn).call(this);
43884
43923
  this.shadowRoot.querySelector(".btn-cancel").onclick = () => __privateMethod(this, _NineDiffPopup_instances, handleCancel_fn).call(this);
43885
43924
  };
43886
- handleConfirm_fn = function() {
43887
- const content2 = __privateGet(this, _diffView) ? __privateGet(this, _diffView).getContents() : __privateGet(this, _asisBackup);
43888
- const params = {
43889
- packageName: __privateGet(this, _host).getAttribute("package-name"),
43890
- contents: content2
43891
- };
43892
- api.post(`/nine-mu/source/generateJsonFile`, params).then((res) => {
43893
- nine$1.alert("소스를 변경하였습니다.").then((res2) => {
43894
- __privateGet(this, _dialog).close();
43925
+ handleConfirmAll_fn = async function() {
43926
+ var _a2;
43927
+ const payloadList = [];
43928
+ for (const [key, fileObj] of __privateGet(this, _filesMap).entries()) {
43929
+ const { diffView, fullPath, asisSource, layer: layer2 } = fileObj;
43930
+ const currentContent = diffView ? diffView.getContents() : asisSource;
43931
+ payloadList.push({
43932
+ layer: layer2,
43933
+ fullPath,
43934
+ packageName: ((_a2 = __privateGet(this, _host)) == null ? void 0 : _a2.getAttribute("package-name")) || "com.ninelab.ai",
43935
+ contents: currentContent
43895
43936
  });
43896
- });
43937
+ }
43938
+ try {
43939
+ await api.post(`/nine-mu/source/generateJsonFileBatch`, { fileList: payloadList });
43940
+ await nine$1.alert("요청하신 모든 파일의 소스 변경 사항이 성공적으로 반영되었습니다.");
43941
+ __privateGet(this, _dialog).close();
43942
+ } catch (error) {
43943
+ trace.error("일괄 파일 저장 처리 중 실패:", error);
43944
+ nine$1.alert("소스 저장 중 오류가 발생했습니다.");
43945
+ }
43897
43946
  };
43898
43947
  handleCancel_fn = function() {
43899
43948
  __privateGet(this, _dialog).close();
@@ -44188,7 +44237,7 @@ class ChatMessageBody extends HTMLElement {
44188
44237
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
44189
44238
  this.shadowRoot.innerHTML = `
44190
44239
  <style>
44191
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.278"}/dist/css/nine-mu.css";
44240
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.279"}/dist/css/nine-mu.css";
44192
44241
  ${customImport}
44193
44242
  </style>
44194
44243
 
@@ -44282,7 +44331,7 @@ if (!customElements.get("nine-chat-progress")) {
44282
44331
  customElements.define("nine-chat-progress", ProgressMessage);
44283
44332
  }
44284
44333
  const NineMu = {
44285
- version: "0.1.278",
44334
+ version: "0.1.279",
44286
44335
  init: (config2) => {
44287
44336
  trace$1.log("🛠️ Nine-Mu Engine initialized", config2);
44288
44337
  }