@nine-lab/nine-mu 0.1.334 → 0.1.336

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.
@@ -943,9 +943,19 @@
943
943
  }
944
944
 
945
945
  :host(nine-exception-hook) {
946
- display: block;
946
+ display: flex;
947
947
  width: 100%;
948
948
  height: 100%;
949
+ color: inherit;
950
+ font-size: inherit;
951
+ line-height: inherit;
952
+
953
+ /* 내부 모든 엘리먼트의 여백 계산법을 어드민 기본형에 동기화 */
954
+ .nine-error-container *,
955
+ .nine-error-container *::before,
956
+ .nine-error-container *::after {
957
+ box-sizing: border-box;
958
+ }
949
959
 
950
960
  .nine-error-container {
951
961
  padding: 30px;
@@ -1012,10 +1022,10 @@
1012
1022
  font-size: 14px;
1013
1023
  color: #718096;
1014
1024
  }
1025
+ }
1015
1026
 
1016
- @keyframes pulse {
1017
- 0% { opacity: 0.6; }
1018
- 50% { opacity: 1; }
1019
- 100% { opacity: 0.6; }
1020
- }
1027
+ @keyframes pulse {
1028
+ 0% { opacity: 0.6; }
1029
+ 50% { opacity: 1; }
1030
+ 100% { opacity: 0.6; }
1021
1031
  }
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, _collectedFiles, _NotificationHandler_instances, handleLoggingMessage_fn, _collectModifySource, _openDiffPopup, _openRouteDiffPopup, _generateSource, _generateMenu, _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, _sourceGenHandler, _asisEditorView, _tobeEditorView, _asisEditorEl, _tobeEditorEl, _isDirty, _initialAsisSrc, _initialTobeSrc, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _checkDirtyState, _setupScrollSync, _applyDiffDecorations, _dialog, _tabContainer, _fileList, _host, _NineDiffPopup_instances, renderScaffolding_fn, handleConfirmAll_fn, handleCancel_fn, _dialog2, _diffView, _asisBackup, _host2, _NineMenuDiffPopup_instances, render_fn2, handleConfirm_fn, handleCancel_fn2, _message, _data, _unique, _init, _message2, _init2, _progressData, _progressElements, _animationIntervals, _ProgressMessage_instances, updateCurrentActiveProgress_fn, renderProgress_fn, updateProgressItemVisuals_fn, startAnimation_fn, updateProgressItem_fn, _renderer, _init3, _renderer2, _ExceptionHook_instances, injectShadowStylesheet_fn, handleRuntimeError_fn, handlePromiseError_fn, handleLocationChange_fn, sendToAiAction_fn, renderError_fn;
12
+ var _owner, _collectedFiles, _NotificationHandler_instances, handleLoggingMessage_fn, _collectModifySource, _openDiffPopup, _openRouteDiffPopup, _generateSource, _generateMenu, _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, _sourceGenHandler, _asisEditorView, _tobeEditorView, _asisEditorEl, _tobeEditorEl, _isDirty, _initialAsisSrc, _initialTobeSrc, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _checkDirtyState, _setupScrollSync, _applyDiffDecorations, _dialog, _tabContainer, _fileList, _host, _NineDiffPopup_instances, renderScaffolding_fn, handleConfirmAll_fn, handleCancel_fn, _dialog2, _diffView, _asisBackup, _host2, _NineMenuDiffPopup_instances, render_fn2, handleConfirm_fn, handleCancel_fn2, _message, _data, _unique, _init, _message2, _init2, _progressData, _progressElements, _animationIntervals, _ProgressMessage_instances, updateCurrentActiveProgress_fn, renderProgress_fn, updateProgressItemVisuals_fn, startAnimation_fn, updateProgressItem_fn, _renderer, _init3, _lastPath, _hasError, _cssPath, _renderer2, _ExceptionHook_instances, injectShadowStylesheet_fn, _handleRuntimeError, _handlePromiseError, _handleLocationChange, _sendToAiAction, renderError_fn;
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() {
@@ -17537,7 +17537,7 @@ render_fn = function() {
17537
17537
  const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
17538
17538
  this.shadowRoot.innerHTML = `
17539
17539
  <style>
17540
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.333"}/dist/css/nine-mu.css";
17540
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.335"}/dist/css/nine-mu.css";
17541
17541
  ${customImport}
17542
17542
  </style>
17543
17543
  <div class="wrapper">
@@ -43787,7 +43787,7 @@ class NineDiff extends HTMLElement {
43787
43787
  const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-mu.css";` : "";
43788
43788
  this.shadowRoot.innerHTML = `
43789
43789
  <style>
43790
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.333"}/dist/css/nine-mu.css";
43790
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.335"}/dist/css/nine-mu.css";
43791
43791
  ${customImport}
43792
43792
  </style>
43793
43793
 
@@ -43927,7 +43927,7 @@ renderScaffolding_fn = function() {
43927
43927
  const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
43928
43928
  this.shadowRoot.innerHTML = `
43929
43929
  <style>
43930
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.333"}/dist/css/nine-mu.css";
43930
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.335"}/dist/css/nine-mu.css";
43931
43931
  ${customImport}
43932
43932
  </style>
43933
43933
 
@@ -44036,7 +44036,7 @@ render_fn2 = function() {
44036
44036
  const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
44037
44037
  this.shadowRoot.innerHTML = `
44038
44038
  <style>
44039
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.333"}/dist/css/nine-mu.css";
44039
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.335"}/dist/css/nine-mu.css";
44040
44040
  ${customImport}
44041
44041
  </style>
44042
44042
 
@@ -44366,7 +44366,7 @@ class ChatMessageBody extends HTMLElement {
44366
44366
  const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-mu.css";` : "";
44367
44367
  this.shadowRoot.innerHTML = `
44368
44368
  <style>
44369
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.333"}/dist/css/nine-mu.css";
44369
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.335"}/dist/css/nine-mu.css";
44370
44370
  ${customImport}
44371
44371
  </style>
44372
44372
 
@@ -44468,103 +44468,120 @@ class ExceptionHook extends HTMLElement {
44468
44468
  constructor() {
44469
44469
  super();
44470
44470
  __privateAdd(this, _ExceptionHook_instances);
44471
+ // 💡 [핵심] 비공개 인스턴스 필드는 클래스 최상단에 먼저 선언해야 합니다.
44472
+ __privateAdd(this, _lastPath, window.location.pathname);
44473
+ __privateAdd(this, _hasError, false);
44474
+ __privateAdd(this, _cssPath, "/css/nine-exception-hook.css");
44471
44475
  __privateAdd(this, _renderer2, () => {
44472
44476
  const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-mu.css";` : "";
44473
44477
  this.shadowRoot.innerHTML = `
44474
44478
  <style>
44475
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.333"}/dist/css/nine-mu.css";
44479
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.335"}/dist/css/nine-mu.css";
44476
44480
  ${customImport}
44477
44481
  </style>
44478
44482
 
44479
44483
  <div class="nine-hook-core">
44480
44484
  <slot></slot>
44481
44485
  </div>
44486
+ <div class="nine-exception-board"></div>
44482
44487
  `;
44483
44488
  });
44484
- this.lastPath = window.location.pathname;
44485
- this.hasError = false;
44486
- this.cssPath = "/css/nine-exception-hook.css";
44489
+ // src/components/exception/ExceptionHook.js
44490
+ __privateAdd(this, _handleRuntimeError, (event) => {
44491
+ var _a2, _b;
44492
+ if (__privateGet(this, _hasError)) return;
44493
+ const isReactError = event.error || event.target && this.contains(event.target);
44494
+ if (isReactError) {
44495
+ const message = ((_a2 = event.error) == null ? void 0 : _a2.message) || event.message || "알 수 없는 런타임 에러";
44496
+ const stack = ((_b = event.error) == null ? void 0 : _b.stack) || "Stack trace unavailable";
44497
+ __privateMethod(this, _ExceptionHook_instances, renderError_fn).call(this, message, stack);
44498
+ }
44499
+ });
44500
+ __privateAdd(this, _handlePromiseError, (event) => {
44501
+ var _a2, _b;
44502
+ if (__privateGet(this, _hasError)) return;
44503
+ __privateMethod(this, _ExceptionHook_instances, renderError_fn).call(this, ((_a2 = event.reason) == null ? void 0 : _a2.message) || String(event.reason), (_b = event.reason) == null ? void 0 : _b.stack);
44504
+ });
44505
+ __privateAdd(this, _handleLocationChange, () => {
44506
+ setTimeout(() => {
44507
+ if (__privateGet(this, _hasError) && __privateGet(this, _lastPath) !== window.location.pathname) {
44508
+ console.log("✨ [nine-exception-hook] Shadow DOM 내부 예외 청소 및 정상 복구");
44509
+ __privateSet(this, _lastPath, window.location.pathname);
44510
+ __privateSet(this, _hasError, false);
44511
+ const exceptionBoard = this.shadowRoot.querySelector(".nine-exception-board");
44512
+ if (exceptionBoard) exceptionBoard.innerHTML = "";
44513
+ const coreContainer = this.shadowRoot.querySelector(".nine-hook-core");
44514
+ if (coreContainer) coreContainer.style.display = "";
44515
+ }
44516
+ }, 10);
44517
+ });
44518
+ __privateAdd(this, _sendToAiAction, async (errorMessage, errorStack) => {
44519
+ const btn = this.shadowRoot.querySelector(".nine-ai-btn");
44520
+ const footer = this.shadowRoot.querySelector(".nine-error-footer");
44521
+ if (!btn) return;
44522
+ btn.disabled = true;
44523
+ btn.innerText = "⚡ AI 관제탑에 소스 분석 요청 중...";
44524
+ btn.classList.add("loading");
44525
+ try {
44526
+ if (window.triggerAutoRecovery) {
44527
+ await window.triggerAutoRecovery({
44528
+ message: errorMessage,
44529
+ stack: errorStack || "No stack trace available",
44530
+ path: window.location.pathname
44531
+ });
44532
+ footer.innerHTML = `✅ <b>AI 관제탑 접수 완료:</b> 분석을 바탕으로 소스 코드를 교정하고 있습니다. 잠시만 기다려주세요.`;
44533
+ btn.innerText = "🚀 전송 완료";
44534
+ } else {
44535
+ throw new Error("window.triggerAutoRecovery 관제탑 엔진이 로드되지 않았습니다.");
44536
+ }
44537
+ } catch (err) {
44538
+ console.error("❌ AI 전송 실패:", err);
44539
+ btn.disabled = false;
44540
+ btn.innerText = "❌ 재전송 시도";
44541
+ footer.innerHTML = `<span style="color: #E53E3E;">⚠️ 전송 실패: ${err.message}</span>`;
44542
+ }
44543
+ });
44487
44544
  this.attachShadow({ mode: "open" });
44488
44545
  }
44546
+ // src/components/exception/ExceptionHook.js 내부 수정
44489
44547
  connectedCallback() {
44490
44548
  __privateGet(this, _renderer2).call(this);
44491
44549
  __privateMethod(this, _ExceptionHook_instances, injectShadowStylesheet_fn).call(this);
44492
- window.addEventListener("error", __privateMethod(this, _ExceptionHook_instances, handleRuntimeError_fn).bind(this), true);
44493
- window.addEventListener("unhandledrejection", __privateMethod(this, _ExceptionHook_instances, handlePromiseError_fn).bind(this), true);
44494
- window.addEventListener("popstate", __privateMethod(this, _ExceptionHook_instances, handleLocationChange_fn).bind(this));
44495
- document.addEventListener("click", __privateMethod(this, _ExceptionHook_instances, handleLocationChange_fn).bind(this), true);
44550
+ window.addEventListener("error", __privateGet(this, _handleRuntimeError), true);
44551
+ window.addEventListener("unhandledrejection", __privateGet(this, _handlePromiseError), true);
44552
+ window.addEventListener("popstate", __privateGet(this, _handleLocationChange));
44553
+ document.addEventListener("click", __privateGet(this, _handleLocationChange), true);
44496
44554
  }
44497
44555
  disconnectedCallback() {
44498
- window.removeEventListener("error", __privateMethod(this, _ExceptionHook_instances, handleRuntimeError_fn));
44499
- window.removeEventListener("unhandledrejection", __privateMethod(this, _ExceptionHook_instances, handlePromiseError_fn));
44500
- window.removeEventListener("popstate", __privateMethod(this, _ExceptionHook_instances, handleLocationChange_fn));
44501
- document.removeEventListener("click", __privateMethod(this, _ExceptionHook_instances, handleLocationChange_fn), true);
44556
+ window.removeEventListener("error", __privateGet(this, _handleRuntimeError), true);
44557
+ window.removeEventListener("unhandledrejection", __privateGet(this, _handlePromiseError), true);
44558
+ window.removeEventListener("popstate", __privateGet(this, _handleLocationChange));
44559
+ document.removeEventListener("click", __privateGet(this, _handleLocationChange), true);
44502
44560
  }
44503
44561
  }
44562
+ _lastPath = new WeakMap();
44563
+ _hasError = new WeakMap();
44564
+ _cssPath = new WeakMap();
44504
44565
  _renderer2 = new WeakMap();
44505
44566
  _ExceptionHook_instances = new WeakSet();
44506
- // 💡 2. Shadow Root 내부 전용 스타일 링크 주입 함수
44507
44567
  injectShadowStylesheet_fn = function() {
44508
- if (this.shadowRoot.querySelector(`link[href="${this.cssPath}"]`)) return;
44568
+ if (this.shadowRoot.querySelector(`link[href="${__privateGet(this, _cssPath)}"]`)) return;
44509
44569
  const link = document.createElement("link");
44510
44570
  link.rel = "stylesheet";
44511
- link.href = this.cssPath;
44571
+ link.href = __privateGet(this, _cssPath);
44512
44572
  this.shadowRoot.appendChild(link);
44513
44573
  };
44514
- handleRuntimeError_fn = function(event) {
44515
- var _a2, _b;
44516
- if (this.contains(event.target) || event.error) {
44517
- __privateMethod(this, _ExceptionHook_instances, renderError_fn).call(this, ((_a2 = event.error) == null ? void 0 : _a2.message) || event.message, (_b = event.error) == null ? void 0 : _b.stack);
44518
- }
44519
- };
44520
- handlePromiseError_fn = function(event) {
44521
- var _a2, _b;
44522
- __privateMethod(this, _ExceptionHook_instances, renderError_fn).call(this, ((_a2 = event.reason) == null ? void 0 : _a2.message) || String(event.reason), (_b = event.reason) == null ? void 0 : _b.stack);
44523
- };
44524
- handleLocationChange_fn = function() {
44525
- setTimeout(() => {
44526
- if (this.hasError && this.lastPath !== window.location.pathname) {
44527
- console.log("✨ [nine-exception-hook] Shadow DOM 내부 예외 청소 및 정상 복구");
44528
- this.lastPath = window.location.pathname;
44529
- this.hasError = false;
44530
- const errorBox = this.shadowRoot.querySelector(".nine-error-container");
44531
- if (errorBox) errorBox.remove();
44532
- const coreContainer = this.shadowRoot.querySelector(".nine-hook-core");
44533
- if (coreContainer) coreContainer.style.display = "";
44534
- }
44535
- }, 10);
44536
- };
44537
- sendToAiAction_fn = async function(errorMessage, errorStack) {
44538
- const btn = this.shadowRoot.querySelector(".nine-ai-btn");
44539
- const footer = this.shadowRoot.querySelector(".nine-error-footer");
44540
- if (!btn) return;
44541
- btn.disabled = true;
44542
- btn.innerText = "⚡ AI 관제탑에 소스 분석 요청 중...";
44543
- btn.classList.add("loading");
44544
- try {
44545
- if (window.triggerAutoRecovery) {
44546
- await window.triggerAutoRecovery({
44547
- message: errorMessage,
44548
- stack: errorStack || "No stack trace available",
44549
- path: window.location.pathname
44550
- });
44551
- footer.innerHTML = `✅ <b>AI 관제탑 접수 완료:</b> 분석을 바탕으로 소스 코드를 교정하고 있습니다. 잠시만 기다려주세요.`;
44552
- btn.innerText = "🚀 전송 완료";
44553
- } else {
44554
- throw new Error("window.triggerAutoRecovery 관제탑 엔진이 로드되지 않았습니다.");
44555
- }
44556
- } catch (err) {
44557
- console.error("❌ AI 전송 실패:", err);
44558
- btn.disabled = false;
44559
- btn.innerText = "❌ 재전송 시도";
44560
- footer.innerHTML = `<span style="color: #E53E3E;">⚠️ 전송 실패: ${err.message}</span>`;
44561
- }
44562
- };
44574
+ _handleRuntimeError = new WeakMap();
44575
+ _handlePromiseError = new WeakMap();
44576
+ _handleLocationChange = new WeakMap();
44577
+ _sendToAiAction = new WeakMap();
44563
44578
  renderError_fn = function(errorMessage, errorStack) {
44564
- if (this.hasError) return;
44565
- this.hasError = true;
44579
+ if (__privateGet(this, _hasError)) return;
44580
+ __privateSet(this, _hasError, true);
44566
44581
  const coreContainer = this.shadowRoot.querySelector(".nine-hook-core");
44567
44582
  if (coreContainer) coreContainer.style.display = "none";
44583
+ const exceptionBoard = this.shadowRoot.querySelector(".nine-exception-board");
44584
+ if (!exceptionBoard) return;
44568
44585
  const errorHTML = `
44569
44586
  <div class="nine-error-container">
44570
44587
  <h3 class="nine-error-title">⚠️ 시스템 예외 감지 (${this.tagName.toLowerCase()})</h3>
@@ -44579,17 +44596,17 @@ renderError_fn = function(errorMessage, errorStack) {
44579
44596
  </div>
44580
44597
  </div>
44581
44598
  `;
44582
- this.shadowRoot.insertAdjacentHTML("beforeend", errorHTML);
44599
+ exceptionBoard.innerHTML = errorHTML;
44583
44600
  const aiBtn = this.shadowRoot.querySelector(".nine-ai-btn");
44584
44601
  if (aiBtn) {
44585
- aiBtn.addEventListener("click", () => __privateMethod(this, _ExceptionHook_instances, sendToAiAction_fn).call(this, errorMessage, errorStack));
44602
+ aiBtn.addEventListener("click", () => __privateGet(this, _sendToAiAction).call(this, errorMessage, errorStack));
44586
44603
  }
44587
44604
  };
44588
44605
  if (!customElements.get("nine-exception-hook")) {
44589
44606
  customElements.define("nine-exception-hook", ExceptionHook);
44590
44607
  }
44591
44608
  const NineMu = {
44592
- version: "0.1.333",
44609
+ version: "0.1.335",
44593
44610
  init: (config2) => {
44594
44611
  trace$1.log("🛠️ Nine-Mu Engine initialized", config2);
44595
44612
  }