@nine-lab/nine-mu 0.1.93 → 0.1.95

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 _getSourcePath, _service, _routes, _diffPopup, _packageName, _routesPath, _NineChat_instances, initInteractions_fn, initActions_fn, render_fn, _makeMenuHandler, _sourceGenHandler, _asisEditorView, _tobeEditorView, _asisEditorEl, _tobeEditorEl, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _setupScrollSync, _applyDiffDecorations, _dialog, _diffView, _asisBackup, _host, _NineDiffPopup_instances, render_fn2, handleConfirm_fn, handleCancel_fn;
12
+ var _getSourcePath, _service, _routes, _diffPopup, _packageName, _routesPath, _connectorUrl, _NineChat_instances, initInteractions_fn, initActions_fn, render_fn, _makeMenuHandler, _sourceGenHandler, _asisEditorView, _tobeEditorView, _asisEditorEl, _tobeEditorEl, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _setupScrollSync, _applyDiffDecorations, _dialog, _diffView, _asisBackup, _host, _NineDiffPopup_instances, render_fn2, handleConfirm_fn, handleCancel_fn;
13
13
  import { trace, api, nine } from "@nine-lab/nine-util";
14
14
  class NineMuService {
15
15
  constructor(connectorUrl) {
@@ -108,12 +108,20 @@ class NineChat extends HTMLElement {
108
108
  __privateAdd(this, _diffPopup);
109
109
  __privateAdd(this, _packageName);
110
110
  __privateAdd(this, _routesPath);
111
+ __privateAdd(this, _connectorUrl);
111
112
  __privateAdd(this, _makeMenuHandler, async (e) => {
112
- nine.prompt("aaa");
113
- const res = await api.post("/nine-mu/source/readFile", { path: __privateGet(this, _routesPath) });
113
+ const prompt = await nine.prompt("메뉴생성시 필요한 AI 프롬프트를 입력하세요.");
114
+ if (prompt === null || prompt === void 0) return;
115
+ const res = await api.post(`/nine-mu/source/readFile`, { path: __privateGet(this, _routesPath) });
114
116
  trace.log(res);
117
+ if (!rec || !(res == null ? void 0 : res.contents)) return;
115
118
  const jsonRoutes = (res == null ? void 0 : res.contents) ? JSON.parse(res == null ? void 0 : res.contents) : {};
116
119
  trace.log(jsonRoutes);
120
+ const res2 = await api.post(`${__privateGet(this, _connectorUrl)}/api/source/missing`, {
121
+ routes: jsonRoutes,
122
+ prompt
123
+ });
124
+ trace.log("분석 완료. 생성할 태스크:", res2 == null ? void 0 : res2.tasks);
117
125
  });
118
126
  __privateAdd(this, _sourceGenHandler, async (e) => {
119
127
  const command2 = "";
@@ -135,8 +143,8 @@ class NineChat extends HTMLElement {
135
143
  }
136
144
  async connectedCallback() {
137
145
  __privateSet(this, _packageName, this.getAttribute("package-name"));
138
- const connectorUrl = this.getAttribute("connector-url") || "http://localhost:3002";
139
- __privateSet(this, _service, new NineMuService(connectorUrl));
146
+ __privateSet(this, _connectorUrl, this.getAttribute("connector-url") || "http://localhost:3002");
147
+ __privateSet(this, _service, new NineMuService(__privateGet(this, _connectorUrl)));
140
148
  __privateMethod(this, _NineChat_instances, render_fn).call(this);
141
149
  __privateMethod(this, _NineChat_instances, initInteractions_fn).call(this);
142
150
  __privateMethod(this, _NineChat_instances, initActions_fn).call(this);
@@ -150,6 +158,7 @@ _routes = new WeakMap();
150
158
  _diffPopup = new WeakMap();
151
159
  _packageName = new WeakMap();
152
160
  _routesPath = new WeakMap();
161
+ _connectorUrl = new WeakMap();
153
162
  _NineChat_instances = new WeakSet();
154
163
  // --- [그룹 1: Interaction] 화면 토글 및 메뉴 클릭 ---
155
164
  initInteractions_fn = function() {
@@ -199,7 +208,7 @@ render_fn = function() {
199
208
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
200
209
  this.shadowRoot.innerHTML = `
201
210
  <style>
202
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.92"}/dist/css/nine-mu.css";
211
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.94"}/dist/css/nine-mu.css";
203
212
  ${customImport}
204
213
  </style>
205
214
  <div class="wrapper">
@@ -10735,21 +10744,21 @@ class DOMObserver {
10735
10744
  this.view.update([]);
10736
10745
  return handled;
10737
10746
  }
10738
- readMutation(rec) {
10739
- let tile = this.view.docView.tile.nearest(rec.target);
10747
+ readMutation(rec2) {
10748
+ let tile = this.view.docView.tile.nearest(rec2.target);
10740
10749
  if (!tile || tile.isWidget())
10741
10750
  return null;
10742
- tile.markDirty(rec.type == "attributes");
10743
- if (rec.type == "childList") {
10744
- let childBefore = findChild(tile, rec.previousSibling || rec.target.previousSibling, -1);
10745
- let childAfter = findChild(tile, rec.nextSibling || rec.target.nextSibling, 1);
10751
+ tile.markDirty(rec2.type == "attributes");
10752
+ if (rec2.type == "childList") {
10753
+ let childBefore = findChild(tile, rec2.previousSibling || rec2.target.previousSibling, -1);
10754
+ let childAfter = findChild(tile, rec2.nextSibling || rec2.target.nextSibling, 1);
10746
10755
  return {
10747
10756
  from: childBefore ? tile.posAfter(childBefore) : tile.posAtStart,
10748
10757
  to: childAfter ? tile.posBefore(childAfter) : tile.posAtEnd,
10749
10758
  typeOver: false
10750
10759
  };
10751
- } else if (rec.type == "characterData") {
10752
- return { from: tile.posAtStart, to: tile.posAtEnd, typeOver: rec.target.nodeValue == rec.oldValue };
10760
+ } else if (rec2.type == "characterData") {
10761
+ return { from: tile.posAtStart, to: tile.posAtEnd, typeOver: rec2.target.nodeValue == rec2.oldValue };
10753
10762
  } else {
10754
10763
  return null;
10755
10764
  }
@@ -26417,7 +26426,7 @@ class NineDiff extends HTMLElement {
26417
26426
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
26418
26427
  this.shadowRoot.innerHTML = `
26419
26428
  <style>
26420
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.92"}/dist/css/nine-mu.css";
26429
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.94"}/dist/css/nine-mu.css";
26421
26430
  ${customImport}
26422
26431
  </style>
26423
26432
 
@@ -26527,7 +26536,7 @@ render_fn2 = function() {
26527
26536
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
26528
26537
  this.shadowRoot.innerHTML = `
26529
26538
  <style>
26530
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.92"}/dist/css/nine-mu.css";
26539
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.94"}/dist/css/nine-mu.css";
26531
26540
  ${customImport}
26532
26541
  </style>
26533
26542
 
@@ -26566,7 +26575,7 @@ handleCancel_fn = function() {
26566
26575
  };
26567
26576
  customElements.define("nine-diff-popup", NineDiffPopup);
26568
26577
  const NineMu = {
26569
- version: "0.1.92",
26578
+ version: "0.1.94",
26570
26579
  init: (config) => {
26571
26580
  trace.log("🛠️ Nine-Mu Engine initialized", config);
26572
26581
  }