@nine-lab/nine-mu 0.1.112 โ†’ 0.1.114

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,15 +9,23 @@ 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 _getSourcePath, _service, _routes, _diffPopup, _packageName, _routesPath, _connectorUrl, _mcpClient, _NineChat_instances, initInteractions_fn, initActions_fn, _initMcp, 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;
13
- import { trace as trace$1, api, nine } from "@nine-lab/nine-util";
14
- class Trace extends trace$1 {
12
+ var _logger, _getSourcePath, _service, _routes, _diffPopup, _packageName, _routesPath, _connectorUrl, _mcpClient, _NineChat_instances, initInteractions_fn, initActions_fn, _initMcp, 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;
13
+ import { trace, api, nine } from "@nine-lab/nine-util";
14
+ class NineMuTrace extends trace {
15
15
  constructor() {
16
16
  super();
17
+ __privateAdd(this, _logger);
17
18
  this.init("nine-mu", "#0969da");
18
19
  }
20
+ /**
21
+ // ๐Ÿ”ด ๋ถ€๋ชจ์˜ log๋ฅผ ๋‚ด ๋ฆฌ๋ชจ์ปจ์˜ log๋กœ ๋ฎ์–ด์”Œ์›๋‹ˆ๋‹ค (Override)
22
+ get log() {
23
+ return this.#logger.log;
24
+ } */
25
+ // ํ•„์š”ํ•˜๋‹ค๋ฉด warn, error๋„ ๋˜‘๊ฐ™์ด...
19
26
  }
20
- const trace = new Trace();
27
+ _logger = new WeakMap();
28
+ const trace1 = new NineMuTrace();
21
29
  class NineMuService {
22
30
  constructor(connectorUrl) {
23
31
  __privateAdd(this, _getSourcePath, (menuUrl) => {
@@ -33,7 +41,7 @@ class NineMuService {
33
41
  */
34
42
  async generate(command2, targets, currentRoutes) {
35
43
  try {
36
- trace$1.log(`๊ณต์ • ์‹œ์ž‘: "${command2}" [๋Œ€์ƒ: ${targets.join(", ")}]`);
44
+ trace.log(`๊ณต์ • ์‹œ์ž‘: "${command2}" [๋Œ€์ƒ: ${targets.join(", ")}]`);
37
45
  const response = await fetch(`${this.connectorUrl}/api/mu/generate`, {
38
46
  method: "POST",
39
47
  headers: { "Content-Type": "application/json" },
@@ -50,7 +58,7 @@ class NineMuService {
50
58
  }
51
59
  return result;
52
60
  } catch (error) {
53
- trace$1.error("NineMu Service Error:", error);
61
+ trace.error("NineMu Service Error:", error);
54
62
  throw error;
55
63
  }
56
64
  }
@@ -58,7 +66,7 @@ class NineMuService {
58
66
  }
59
67
  async generateAll_BAK(command2, targets, currentRoutes) {
60
68
  try {
61
- trace$1.log(`๊ณต์ • ์‹œ์ž‘: "${command2}" [๋Œ€์ƒ: ${targets.join(", ")}]`);
69
+ trace.log(`๊ณต์ • ์‹œ์ž‘: "${command2}" [๋Œ€์ƒ: ${targets.join(", ")}]`);
62
70
  const srcPath = __privateGet(this, _getSourcePath).call(this, "/admin/payment/order-list");
63
71
  const srcPath1 = {
64
72
  mybatis: "",
@@ -67,9 +75,9 @@ class NineMuService {
67
75
  javascriptFrom: "",
68
76
  javascriptTo: ""
69
77
  };
70
- trace$1.log(srcPath);
78
+ trace.log(srcPath);
71
79
  const src = await api.post("/nine-ai/source/read", srcPath);
72
- trace$1.log(src);
80
+ trace.log(src);
73
81
  const response = await fetch(`${this.connectorUrl}/api/mu/generateAll`, {
74
82
  method: "POST",
75
83
  headers: { "Content-Type": "application/json" },
@@ -80,14 +88,14 @@ class NineMuService {
80
88
  //currentRoutes
81
89
  })
82
90
  });
83
- trace$1.log(response);
91
+ trace.log(response);
84
92
  const result = await response.json();
85
93
  if (!result.success) {
86
94
  throw new Error(result.error || "์†Œ์Šค ์ƒ์„ฑ ์ค‘ ์„œ๋ฒ„ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค.");
87
95
  }
88
96
  return result;
89
97
  } catch (error) {
90
- trace$1.error("NineMu Service Error:", error);
98
+ trace.error("NineMu Service Error:", error);
91
99
  throw error;
92
100
  }
93
101
  }
@@ -100,7 +108,7 @@ class NineMuService {
100
108
  const res = await fetch(routeUrl);
101
109
  return await res.json();
102
110
  } catch (err) {
103
- trace$1.error("Route load fail", err);
111
+ trace.error("Route load fail", err);
104
112
  return [];
105
113
  }
106
114
  }
@@ -13609,21 +13617,21 @@ class NineChat extends HTMLElement {
13609
13617
  name: "nine-mcp-client",
13610
13618
  version: "1.0.0"
13611
13619
  }, { capabilities: { tools: {} } }));
13612
- trace.log("Connecting to MCP via WebSocket...");
13620
+ trace1.log("Connecting to MCP via WebSocket...");
13613
13621
  await __privateGet(this, _mcpClient).connect(transport);
13614
- trace.log("โœ… Nine MCP Connected (WebSocket)");
13622
+ trace1.log("โœ… Nine MCP Connected (WebSocket)");
13615
13623
  } catch (err) {
13616
- trace.error("โŒ MCP ์ดˆ๊ธฐํ™” ์—๋Ÿฌ:", err);
13624
+ trace1.error("โŒ MCP ์ดˆ๊ธฐํ™” ์—๋Ÿฌ:", err);
13617
13625
  }
13618
13626
  });
13619
13627
  __privateAdd(this, _makeMenuHandler, async (e) => {
13620
13628
  const prompt = await nine.prompt("๋ฉ”๋‰ด์ƒ์„ฑ์‹œ ํ•„์š”ํ•œ AI ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”.").rgb();
13621
13629
  if (prompt === null || prompt === void 0) return;
13622
13630
  const res = await api.post(`/nine-mu/source/readFile`, { path: __privateGet(this, _routesPath) });
13623
- trace.log(res);
13631
+ trace1.log(res);
13624
13632
  if (!res || !(res == null ? void 0 : res.contents)) return;
13625
13633
  const jsonRoutes = (res == null ? void 0 : res.contents) ? JSON.parse(res == null ? void 0 : res.contents) : {};
13626
- trace.log(jsonRoutes);
13634
+ trace1.log(jsonRoutes);
13627
13635
  const res2 = await api.post(`${__privateGet(this, _connectorUrl)}/api/source/missing`, {
13628
13636
  routes: jsonRoutes,
13629
13637
  prompt
@@ -13720,7 +13728,7 @@ render_fn = function() {
13720
13728
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
13721
13729
  this.shadowRoot.innerHTML = `
13722
13730
  <style>
13723
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.111"}/dist/css/nine-mu.css";
13731
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.113"}/dist/css/nine-mu.css";
13724
13732
  ${customImport}
13725
13733
  </style>
13726
13734
  <div class="wrapper">
@@ -39615,9 +39623,9 @@ class MergeButtonWidget extends WidgetType {
39615
39623
  button.className = "cm-merge-button accept";
39616
39624
  }
39617
39625
  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);
39626
+ trace.log(`๋ฒ„ํŠผ ํด๋ฆญ: ${this.isAsisButton ? "ASIS ์ชฝ (์‚ญ์ œ)" : "TOBE ์ชฝ (์ ์šฉ)"}`, this.textToApply);
39627
+ trace.log("๋Œ€์ƒ ์—๋””ํ„ฐ:", this.targetEditorView === this.hostComponent.asisEditorView ? "ASIS" : "TOBE");
39628
+ trace.log("๋Œ€์ƒ ๋ฒ”์œ„:", this.diffRange);
39621
39629
  this.applyChanges(this.textToApply, this.targetEditorView, this.diffRange);
39622
39630
  });
39623
39631
  const container = document.createElement("div");
@@ -39628,7 +39636,7 @@ class MergeButtonWidget extends WidgetType {
39628
39636
  // ์‹ค์ œ ๋ณ€๊ฒฝ ์ ์šฉ ๋กœ์ง
39629
39637
  applyChanges(text, editorView, range) {
39630
39638
  if (!editorView || !range) {
39631
- trace$1.error("Target editor view or range is undefined.", editorView, range);
39639
+ trace.error("Target editor view or range is undefined.", editorView, range);
39632
39640
  return;
39633
39641
  }
39634
39642
  editorView.dispatch({
@@ -39669,7 +39677,7 @@ class NineDiff extends HTMLElement {
39669
39677
  __privateSet(this, _asisEditorEl, this.shadowRoot.querySelector(".panel.asis"));
39670
39678
  __privateSet(this, _tobeEditorEl, this.shadowRoot.querySelector(".panel.tobe"));
39671
39679
  if (!__privateGet(this, _asisEditorEl) || !__privateGet(this, _tobeEditorEl)) {
39672
- trace$1.error("CodeMirror panel containers not found!");
39680
+ trace.error("CodeMirror panel containers not found!");
39673
39681
  return;
39674
39682
  }
39675
39683
  const basicExtensions = [
@@ -39710,7 +39718,7 @@ class NineDiff extends HTMLElement {
39710
39718
  EditorView.updateListener.of((update) => {
39711
39719
  if (update.view.contentDOM.firstChild && !update.view._initialAsisContentLoaded) {
39712
39720
  update.view._initialAsisContentLoaded = true;
39713
- trace$1.log("CodeMirror ASIS view is ready for initial content.");
39721
+ trace.log("CodeMirror ASIS view is ready for initial content.");
39714
39722
  asisReady = true;
39715
39723
  checkAllReady();
39716
39724
  }
@@ -39732,7 +39740,7 @@ class NineDiff extends HTMLElement {
39732
39740
  EditorView.updateListener.of((update) => {
39733
39741
  if (update.view.contentDOM.firstChild && !update.view._initialTobeContentLoaded) {
39734
39742
  update.view._initialTobeContentLoaded = true;
39735
- trace$1.log("CodeMirror TOBE view is ready for initial content.");
39743
+ trace.log("CodeMirror TOBE view is ready for initial content.");
39736
39744
  tobeReady = true;
39737
39745
  checkAllReady();
39738
39746
  }
@@ -39795,7 +39803,7 @@ class NineDiff extends HTMLElement {
39795
39803
  const tobeRangeStart = tobeCursor;
39796
39804
  switch (op) {
39797
39805
  case diffMatchPatchExports.diff_match_patch.DIFF_INSERT:
39798
- trace$1.log("DIFF_INSERT (TOBE added):", JSON.stringify(text));
39806
+ trace.log("DIFF_INSERT (TOBE added):", JSON.stringify(text));
39799
39807
  const tobeLines = text.split("\n");
39800
39808
  for (let i = 0; i < tobeLines.length; i++) {
39801
39809
  if (!(i === tobeLines.length - 1 && tobeLines[i] === "" && text.endsWith("\n"))) {
@@ -39823,7 +39831,7 @@ class NineDiff extends HTMLElement {
39823
39831
  );
39824
39832
  break;
39825
39833
  case diffMatchPatchExports.diff_match_patch.DIFF_DELETE:
39826
- trace$1.log("DIFF_DELETE (ASIS deleted):", JSON.stringify(text));
39834
+ trace.log("DIFF_DELETE (ASIS deleted):", JSON.stringify(text));
39827
39835
  const asisLines = text.split("\n");
39828
39836
  for (let i = 0; i < asisLines.length; i++) {
39829
39837
  if (!(i === asisLines.length - 1 && asisLines[i] === "" && text.endsWith("\n"))) {
@@ -39882,7 +39890,7 @@ class NineDiff extends HTMLElement {
39882
39890
  });
39883
39891
  __publicField(this, "initialize", (src1, src2, language2 = "javascript") => {
39884
39892
  if (!__privateGet(this, _asisEditorView) || !__privateGet(this, _tobeEditorView)) {
39885
- trace$1.warn("CodeMirror Editors not initialized yet.");
39893
+ trace.warn("CodeMirror Editors not initialized yet.");
39886
39894
  return;
39887
39895
  }
39888
39896
  __privateSet(this, _isScrollSyncActive, false);
@@ -39938,7 +39946,7 @@ class NineDiff extends HTMLElement {
39938
39946
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
39939
39947
  this.shadowRoot.innerHTML = `
39940
39948
  <style>
39941
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.111"}/dist/css/nine-mu.css";
39949
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.113"}/dist/css/nine-mu.css";
39942
39950
  ${customImport}
39943
39951
  </style>
39944
39952
 
@@ -39955,7 +39963,7 @@ class NineDiff extends HTMLElement {
39955
39963
  bubbles: true,
39956
39964
  composed: true
39957
39965
  }));
39958
- trace$1.log("dispatchEvent");
39966
+ trace.log("dispatchEvent");
39959
39967
  });
39960
39968
  }
39961
39969
  disconnectedCallback() {
@@ -40014,12 +40022,12 @@ class NineDiffPopup extends HTMLElement {
40014
40022
  if (typeof src === "string" && (src.startsWith("url:") || src.startsWith("file:"))) {
40015
40023
  const targetUrl = src.replace(/^(url:|file:)/, "");
40016
40024
  try {
40017
- trace$1.log(`๐Ÿ“ก ๋ฆฌ๋ชจํŠธ ๋กœ๋“œ: ${targetUrl}`);
40025
+ trace.log(`๐Ÿ“ก ๋ฆฌ๋ชจํŠธ ๋กœ๋“œ: ${targetUrl}`);
40018
40026
  const res = await fetch(targetUrl);
40019
40027
  if (!res.ok) throw new Error(`Status: ${res.status}`);
40020
40028
  return await res.text();
40021
40029
  } catch (e) {
40022
- trace$1.error(`๋กœ๋“œ ์‹คํŒจ [${targetUrl}]:`, e);
40030
+ trace.error(`๋กœ๋“œ ์‹คํŒจ [${targetUrl}]:`, e);
40023
40031
  return `// ๋กœ๋“œ ์‹คํŒจ: ${targetUrl}
40024
40032
  ${e.message}`;
40025
40033
  }
@@ -40048,7 +40056,7 @@ render_fn2 = function() {
40048
40056
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
40049
40057
  this.shadowRoot.innerHTML = `
40050
40058
  <style>
40051
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.111"}/dist/css/nine-mu.css";
40059
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.113"}/dist/css/nine-mu.css";
40052
40060
  ${customImport}
40053
40061
  </style>
40054
40062
 
@@ -40087,9 +40095,9 @@ handleCancel_fn = function() {
40087
40095
  };
40088
40096
  customElements.define("nine-diff-popup", NineDiffPopup);
40089
40097
  const NineMu = {
40090
- version: "0.1.111",
40098
+ version: "0.1.113",
40091
40099
  init: (config2) => {
40092
- trace$1.log("๐Ÿ› ๏ธ Nine-Mu Engine initialized", config2);
40100
+ trace.log("๐Ÿ› ๏ธ Nine-Mu Engine initialized", config2);
40093
40101
  }
40094
40102
  };
40095
40103
  export {