@nine-lab/nine-mu 0.1.125 → 0.1.127

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,32 @@ 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
+ trace.log(result);
13716
+ const data = JSON.parse(result.content[0].text);
13717
+ if (data.action === "SHOW_DIFF") {
13718
+ __privateGet(this, _showDiff).call(this, data.asis, data.tobe, "json");
13719
+ $status2.textContent = "✅ 분석 완료";
13720
+ } else {
13721
+ $status2.textContent = "💬 답변 완료";
13722
+ }
13710
13723
  } catch (err) {
13711
- $status2.textContent = " 실패";
13712
- nine.alert(err.message).rgb().shake();
13724
+ trace.error("AI 응답 실패:", err);
13725
+ $status2.textContent = "❌ 에러 발생";
13713
13726
  }
13714
13727
  }
13715
13728
  });
@@ -13720,7 +13733,7 @@ render_fn = function() {
13720
13733
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
13721
13734
  this.shadowRoot.innerHTML = `
13722
13735
  <style>
13723
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.124"}/dist/css/nine-mu.css";
13736
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.126"}/dist/css/nine-mu.css";
13724
13737
  ${customImport}
13725
13738
  </style>
13726
13739
  <div class="wrapper">
@@ -39615,9 +39628,9 @@ class MergeButtonWidget extends WidgetType {
39615
39628
  button.className = "cm-merge-button accept";
39616
39629
  }
39617
39630
  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);
39631
+ trace.log(`버튼 클릭: ${this.isAsisButton ? "ASIS 쪽 (삭제)" : "TOBE 쪽 (적용)"}`, this.textToApply);
39632
+ trace.log("대상 에디터:", this.targetEditorView === this.hostComponent.asisEditorView ? "ASIS" : "TOBE");
39633
+ trace.log("대상 범위:", this.diffRange);
39621
39634
  this.applyChanges(this.textToApply, this.targetEditorView, this.diffRange);
39622
39635
  });
39623
39636
  const container = document.createElement("div");
@@ -39628,7 +39641,7 @@ class MergeButtonWidget extends WidgetType {
39628
39641
  // 실제 변경 적용 로직
39629
39642
  applyChanges(text, editorView, range) {
39630
39643
  if (!editorView || !range) {
39631
- trace$1.error("Target editor view or range is undefined.", editorView, range);
39644
+ trace.error("Target editor view or range is undefined.", editorView, range);
39632
39645
  return;
39633
39646
  }
39634
39647
  editorView.dispatch({
@@ -39669,7 +39682,7 @@ class NineDiff extends HTMLElement {
39669
39682
  __privateSet(this, _asisEditorEl, this.shadowRoot.querySelector(".panel.asis"));
39670
39683
  __privateSet(this, _tobeEditorEl, this.shadowRoot.querySelector(".panel.tobe"));
39671
39684
  if (!__privateGet(this, _asisEditorEl) || !__privateGet(this, _tobeEditorEl)) {
39672
- trace$1.error("CodeMirror panel containers not found!");
39685
+ trace.error("CodeMirror panel containers not found!");
39673
39686
  return;
39674
39687
  }
39675
39688
  const basicExtensions = [
@@ -39710,7 +39723,7 @@ class NineDiff extends HTMLElement {
39710
39723
  EditorView.updateListener.of((update) => {
39711
39724
  if (update.view.contentDOM.firstChild && !update.view._initialAsisContentLoaded) {
39712
39725
  update.view._initialAsisContentLoaded = true;
39713
- trace$1.log("CodeMirror ASIS view is ready for initial content.");
39726
+ trace.log("CodeMirror ASIS view is ready for initial content.");
39714
39727
  asisReady = true;
39715
39728
  checkAllReady();
39716
39729
  }
@@ -39732,7 +39745,7 @@ class NineDiff extends HTMLElement {
39732
39745
  EditorView.updateListener.of((update) => {
39733
39746
  if (update.view.contentDOM.firstChild && !update.view._initialTobeContentLoaded) {
39734
39747
  update.view._initialTobeContentLoaded = true;
39735
- trace$1.log("CodeMirror TOBE view is ready for initial content.");
39748
+ trace.log("CodeMirror TOBE view is ready for initial content.");
39736
39749
  tobeReady = true;
39737
39750
  checkAllReady();
39738
39751
  }
@@ -39795,7 +39808,7 @@ class NineDiff extends HTMLElement {
39795
39808
  const tobeRangeStart = tobeCursor;
39796
39809
  switch (op) {
39797
39810
  case diffMatchPatchExports.diff_match_patch.DIFF_INSERT:
39798
- trace$1.log("DIFF_INSERT (TOBE added):", JSON.stringify(text));
39811
+ trace.log("DIFF_INSERT (TOBE added):", JSON.stringify(text));
39799
39812
  const tobeLines = text.split("\n");
39800
39813
  for (let i = 0; i < tobeLines.length; i++) {
39801
39814
  if (!(i === tobeLines.length - 1 && tobeLines[i] === "" && text.endsWith("\n"))) {
@@ -39823,7 +39836,7 @@ class NineDiff extends HTMLElement {
39823
39836
  );
39824
39837
  break;
39825
39838
  case diffMatchPatchExports.diff_match_patch.DIFF_DELETE:
39826
- trace$1.log("DIFF_DELETE (ASIS deleted):", JSON.stringify(text));
39839
+ trace.log("DIFF_DELETE (ASIS deleted):", JSON.stringify(text));
39827
39840
  const asisLines = text.split("\n");
39828
39841
  for (let i = 0; i < asisLines.length; i++) {
39829
39842
  if (!(i === asisLines.length - 1 && asisLines[i] === "" && text.endsWith("\n"))) {
@@ -39882,7 +39895,7 @@ class NineDiff extends HTMLElement {
39882
39895
  });
39883
39896
  __publicField(this, "initialize", (src1, src2, language2 = "javascript") => {
39884
39897
  if (!__privateGet(this, _asisEditorView) || !__privateGet(this, _tobeEditorView)) {
39885
- trace$1.warn("CodeMirror Editors not initialized yet.");
39898
+ trace.warn("CodeMirror Editors not initialized yet.");
39886
39899
  return;
39887
39900
  }
39888
39901
  __privateSet(this, _isScrollSyncActive, false);
@@ -39938,7 +39951,7 @@ class NineDiff extends HTMLElement {
39938
39951
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
39939
39952
  this.shadowRoot.innerHTML = `
39940
39953
  <style>
39941
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.124"}/dist/css/nine-mu.css";
39954
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.126"}/dist/css/nine-mu.css";
39942
39955
  ${customImport}
39943
39956
  </style>
39944
39957
 
@@ -39955,7 +39968,7 @@ class NineDiff extends HTMLElement {
39955
39968
  bubbles: true,
39956
39969
  composed: true
39957
39970
  }));
39958
- trace$1.log("dispatchEvent");
39971
+ trace.log("dispatchEvent");
39959
39972
  });
39960
39973
  }
39961
39974
  disconnectedCallback() {
@@ -40014,12 +40027,12 @@ class NineDiffPopup extends HTMLElement {
40014
40027
  if (typeof src === "string" && (src.startsWith("url:") || src.startsWith("file:"))) {
40015
40028
  const targetUrl = src.replace(/^(url:|file:)/, "");
40016
40029
  try {
40017
- trace$1.log(`📡 리모트 로드: ${targetUrl}`);
40030
+ trace.log(`📡 리모트 로드: ${targetUrl}`);
40018
40031
  const res = await fetch(targetUrl);
40019
40032
  if (!res.ok) throw new Error(`Status: ${res.status}`);
40020
40033
  return await res.text();
40021
40034
  } catch (e) {
40022
- trace$1.error(`로드 실패 [${targetUrl}]:`, e);
40035
+ trace.error(`로드 실패 [${targetUrl}]:`, e);
40023
40036
  return `// 로드 실패: ${targetUrl}
40024
40037
  ${e.message}`;
40025
40038
  }
@@ -40048,7 +40061,7 @@ render_fn2 = function() {
40048
40061
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
40049
40062
  this.shadowRoot.innerHTML = `
40050
40063
  <style>
40051
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.124"}/dist/css/nine-mu.css";
40064
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.126"}/dist/css/nine-mu.css";
40052
40065
  ${customImport}
40053
40066
  </style>
40054
40067
 
@@ -40087,7 +40100,7 @@ handleCancel_fn = function() {
40087
40100
  };
40088
40101
  customElements.define("nine-diff-popup", NineDiffPopup);
40089
40102
  const NineMu = {
40090
- version: "0.1.124",
40103
+ version: "0.1.126",
40091
40104
  init: (config2) => {
40092
40105
  trace$1.log("🛠️ Nine-Mu Engine initialized", config2);
40093
40106
  }