@nine-lab/nine-mu 0.1.125 → 0.1.126

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
@@ -33,7 +33,7 @@ class NineMuService {
33
33
  */
34
34
  async generate(command2, targets, currentRoutes) {
35
35
  try {
36
- trace$1.log(`공정 시작: "${command2}" [대상: ${targets.join(", ")}]`);
36
+ trace.log(`공정 시작: "${command2}" [대상: ${targets.join(", ")}]`);
37
37
  const response = await fetch(`${this.connectorUrl}/api/mu/generate`, {
38
38
  method: "POST",
39
39
  headers: { "Content-Type": "application/json" },
@@ -50,7 +50,7 @@ class NineMuService {
50
50
  }
51
51
  return result;
52
52
  } catch (error) {
53
- trace$1.error("NineMu Service Error:", error);
53
+ trace.error("NineMu Service Error:", error);
54
54
  throw error;
55
55
  }
56
56
  }
@@ -58,7 +58,7 @@ class NineMuService {
58
58
  }
59
59
  async generateAll_BAK(command2, targets, currentRoutes) {
60
60
  try {
61
- trace$1.log(`공정 시작: "${command2}" [대상: ${targets.join(", ")}]`);
61
+ trace.log(`공정 시작: "${command2}" [대상: ${targets.join(", ")}]`);
62
62
  const srcPath = __privateGet(this, _getSourcePath).call(this, "/admin/payment/order-list");
63
63
  const srcPath1 = {
64
64
  mybatis: "",
@@ -67,9 +67,9 @@ class NineMuService {
67
67
  javascriptFrom: "",
68
68
  javascriptTo: ""
69
69
  };
70
- trace$1.log(srcPath);
70
+ trace.log(srcPath);
71
71
  const src = await api.post("/nine-ai/source/read", srcPath);
72
- trace$1.log(src);
72
+ trace.log(src);
73
73
  const response = await fetch(`${this.connectorUrl}/api/mu/generateAll`, {
74
74
  method: "POST",
75
75
  headers: { "Content-Type": "application/json" },
@@ -80,14 +80,14 @@ class NineMuService {
80
80
  //currentRoutes
81
81
  })
82
82
  });
83
- trace$1.log(response);
83
+ trace.log(response);
84
84
  const result = await response.json();
85
85
  if (!result.success) {
86
86
  throw new Error(result.error || "소스 생성 중 서버 오류가 발생했습니다.");
87
87
  }
88
88
  return result;
89
89
  } catch (error) {
90
- trace$1.error("NineMu Service Error:", error);
90
+ trace.error("NineMu Service Error:", error);
91
91
  throw error;
92
92
  }
93
93
  }
@@ -100,7 +100,7 @@ class NineMuService {
100
100
  const res = await fetch(routeUrl);
101
101
  return await res.json();
102
102
  } catch (err) {
103
- trace$1.error("Route load fail", err);
103
+ trace.error("Route load fail", err);
104
104
  return [];
105
105
  }
106
106
  }
@@ -13697,19 +13697,31 @@ initActions_fn = function() {
13697
13697
  $textarea.addEventListener("keypress", async (e) => {
13698
13698
  if (e.key === "Enter" && !e.shiftKey) {
13699
13699
  e.preventDefault();
13700
- const command2 = e.target.value.trim();
13701
- if (!command2) return;
13702
- $status2.textContent = "⚙️ 공정 분석 중...";
13703
- e.target.value = "";
13704
- const targets = Array.from(this.shadowRoot.querySelectorAll('input[name="gen_target"]:checked')).map((el) => el.value);
13700
+ const userPrompt = e.target.value.trim();
13701
+ if (!userPrompt) return;
13705
13702
  try {
13706
- const result = await __privateGet(this, _service).generate(command2, targets, __privateGet(this, _routes));
13707
- $status2.textContent = "✅ 완료";
13708
- nine.alert("소스 생성 성공").rgb();
13709
- this.dispatchEvent(new CustomEvent("nine-mu-completed", { detail: result, bubbles: true }));
13703
+ const result = await __privateGet(this, _mcpClient).callTool({
13704
+ name: "chat_agent",
13705
+ // 모든 요청을 처리하는 통합 에이전트 도구 (예시)
13706
+ arguments: {
13707
+ query: userPrompt,
13708
+ context: {
13709
+ routesPath: __privateGet(this, _routesPath),
13710
+ packageName: __privateGet(this, _packageName),
13711
+ targets: Array.from(this.shadowRoot.querySelectorAll('input[name="gen_target"]:checked')).map((el) => el.value)
13712
+ }
13713
+ }
13714
+ });
13715
+ const data = JSON.parse(result.content[0].text);
13716
+ if (data.action === "SHOW_DIFF") {
13717
+ __privateGet(this, _showDiff).call(this, data.asis, data.tobe, "json");
13718
+ $status2.textContent = "✅ 분석 완료";
13719
+ } else {
13720
+ $status2.textContent = "💬 답변 완료";
13721
+ }
13710
13722
  } catch (err) {
13711
- $status2.textContent = " 실패";
13712
- nine.alert(err.message).rgb().shake();
13723
+ trace.error("AI 응답 실패:", err);
13724
+ $status2.textContent = "❌ 에러 발생";
13713
13725
  }
13714
13726
  }
13715
13727
  });
@@ -13720,7 +13732,7 @@ render_fn = function() {
13720
13732
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
13721
13733
  this.shadowRoot.innerHTML = `
13722
13734
  <style>
13723
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.124"}/dist/css/nine-mu.css";
13735
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.125"}/dist/css/nine-mu.css";
13724
13736
  ${customImport}
13725
13737
  </style>
13726
13738
  <div class="wrapper">
@@ -39615,9 +39627,9 @@ class MergeButtonWidget extends WidgetType {
39615
39627
  button.className = "cm-merge-button accept";
39616
39628
  }
39617
39629
  button.addEventListener("click", () => {
39618
- trace$1.log(`버튼 클릭: ${this.isAsisButton ? "ASIS 쪽 (삭제)" : "TOBE 쪽 (적용)"}`, this.textToApply);
39619
- trace$1.log("대상 에디터:", this.targetEditorView === this.hostComponent.asisEditorView ? "ASIS" : "TOBE");
39620
- trace$1.log("대상 범위:", this.diffRange);
39630
+ trace.log(`버튼 클릭: ${this.isAsisButton ? "ASIS 쪽 (삭제)" : "TOBE 쪽 (적용)"}`, this.textToApply);
39631
+ trace.log("대상 에디터:", this.targetEditorView === this.hostComponent.asisEditorView ? "ASIS" : "TOBE");
39632
+ trace.log("대상 범위:", this.diffRange);
39621
39633
  this.applyChanges(this.textToApply, this.targetEditorView, this.diffRange);
39622
39634
  });
39623
39635
  const container = document.createElement("div");
@@ -39628,7 +39640,7 @@ class MergeButtonWidget extends WidgetType {
39628
39640
  // 실제 변경 적용 로직
39629
39641
  applyChanges(text, editorView, range) {
39630
39642
  if (!editorView || !range) {
39631
- trace$1.error("Target editor view or range is undefined.", editorView, range);
39643
+ trace.error("Target editor view or range is undefined.", editorView, range);
39632
39644
  return;
39633
39645
  }
39634
39646
  editorView.dispatch({
@@ -39669,7 +39681,7 @@ class NineDiff extends HTMLElement {
39669
39681
  __privateSet(this, _asisEditorEl, this.shadowRoot.querySelector(".panel.asis"));
39670
39682
  __privateSet(this, _tobeEditorEl, this.shadowRoot.querySelector(".panel.tobe"));
39671
39683
  if (!__privateGet(this, _asisEditorEl) || !__privateGet(this, _tobeEditorEl)) {
39672
- trace$1.error("CodeMirror panel containers not found!");
39684
+ trace.error("CodeMirror panel containers not found!");
39673
39685
  return;
39674
39686
  }
39675
39687
  const basicExtensions = [
@@ -39710,7 +39722,7 @@ class NineDiff extends HTMLElement {
39710
39722
  EditorView.updateListener.of((update) => {
39711
39723
  if (update.view.contentDOM.firstChild && !update.view._initialAsisContentLoaded) {
39712
39724
  update.view._initialAsisContentLoaded = true;
39713
- trace$1.log("CodeMirror ASIS view is ready for initial content.");
39725
+ trace.log("CodeMirror ASIS view is ready for initial content.");
39714
39726
  asisReady = true;
39715
39727
  checkAllReady();
39716
39728
  }
@@ -39732,7 +39744,7 @@ class NineDiff extends HTMLElement {
39732
39744
  EditorView.updateListener.of((update) => {
39733
39745
  if (update.view.contentDOM.firstChild && !update.view._initialTobeContentLoaded) {
39734
39746
  update.view._initialTobeContentLoaded = true;
39735
- trace$1.log("CodeMirror TOBE view is ready for initial content.");
39747
+ trace.log("CodeMirror TOBE view is ready for initial content.");
39736
39748
  tobeReady = true;
39737
39749
  checkAllReady();
39738
39750
  }
@@ -39795,7 +39807,7 @@ class NineDiff extends HTMLElement {
39795
39807
  const tobeRangeStart = tobeCursor;
39796
39808
  switch (op) {
39797
39809
  case diffMatchPatchExports.diff_match_patch.DIFF_INSERT:
39798
- trace$1.log("DIFF_INSERT (TOBE added):", JSON.stringify(text));
39810
+ trace.log("DIFF_INSERT (TOBE added):", JSON.stringify(text));
39799
39811
  const tobeLines = text.split("\n");
39800
39812
  for (let i = 0; i < tobeLines.length; i++) {
39801
39813
  if (!(i === tobeLines.length - 1 && tobeLines[i] === "" && text.endsWith("\n"))) {
@@ -39823,7 +39835,7 @@ class NineDiff extends HTMLElement {
39823
39835
  );
39824
39836
  break;
39825
39837
  case diffMatchPatchExports.diff_match_patch.DIFF_DELETE:
39826
- trace$1.log("DIFF_DELETE (ASIS deleted):", JSON.stringify(text));
39838
+ trace.log("DIFF_DELETE (ASIS deleted):", JSON.stringify(text));
39827
39839
  const asisLines = text.split("\n");
39828
39840
  for (let i = 0; i < asisLines.length; i++) {
39829
39841
  if (!(i === asisLines.length - 1 && asisLines[i] === "" && text.endsWith("\n"))) {
@@ -39882,7 +39894,7 @@ class NineDiff extends HTMLElement {
39882
39894
  });
39883
39895
  __publicField(this, "initialize", (src1, src2, language2 = "javascript") => {
39884
39896
  if (!__privateGet(this, _asisEditorView) || !__privateGet(this, _tobeEditorView)) {
39885
- trace$1.warn("CodeMirror Editors not initialized yet.");
39897
+ trace.warn("CodeMirror Editors not initialized yet.");
39886
39898
  return;
39887
39899
  }
39888
39900
  __privateSet(this, _isScrollSyncActive, false);
@@ -39938,7 +39950,7 @@ class NineDiff extends HTMLElement {
39938
39950
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
39939
39951
  this.shadowRoot.innerHTML = `
39940
39952
  <style>
39941
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.124"}/dist/css/nine-mu.css";
39953
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.125"}/dist/css/nine-mu.css";
39942
39954
  ${customImport}
39943
39955
  </style>
39944
39956
 
@@ -39955,7 +39967,7 @@ class NineDiff extends HTMLElement {
39955
39967
  bubbles: true,
39956
39968
  composed: true
39957
39969
  }));
39958
- trace$1.log("dispatchEvent");
39970
+ trace.log("dispatchEvent");
39959
39971
  });
39960
39972
  }
39961
39973
  disconnectedCallback() {
@@ -40014,12 +40026,12 @@ class NineDiffPopup extends HTMLElement {
40014
40026
  if (typeof src === "string" && (src.startsWith("url:") || src.startsWith("file:"))) {
40015
40027
  const targetUrl = src.replace(/^(url:|file:)/, "");
40016
40028
  try {
40017
- trace$1.log(`📡 리모트 로드: ${targetUrl}`);
40029
+ trace.log(`📡 리모트 로드: ${targetUrl}`);
40018
40030
  const res = await fetch(targetUrl);
40019
40031
  if (!res.ok) throw new Error(`Status: ${res.status}`);
40020
40032
  return await res.text();
40021
40033
  } catch (e) {
40022
- trace$1.error(`로드 실패 [${targetUrl}]:`, e);
40034
+ trace.error(`로드 실패 [${targetUrl}]:`, e);
40023
40035
  return `// 로드 실패: ${targetUrl}
40024
40036
  ${e.message}`;
40025
40037
  }
@@ -40048,7 +40060,7 @@ render_fn2 = function() {
40048
40060
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
40049
40061
  this.shadowRoot.innerHTML = `
40050
40062
  <style>
40051
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.124"}/dist/css/nine-mu.css";
40063
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.125"}/dist/css/nine-mu.css";
40052
40064
  ${customImport}
40053
40065
  </style>
40054
40066
 
@@ -40087,7 +40099,7 @@ handleCancel_fn = function() {
40087
40099
  };
40088
40100
  customElements.define("nine-diff-popup", NineDiffPopup);
40089
40101
  const NineMu = {
40090
- version: "0.1.124",
40102
+ version: "0.1.125",
40091
40103
  init: (config2) => {
40092
40104
  trace$1.log("🛠️ Nine-Mu Engine initialized", config2);
40093
40105
  }