@nine-lab/nine-mu 0.1.332 → 0.1.333

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
@@ -17537,7 +17537,7 @@ render_fn = function() {
17537
17537
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
17538
17538
  this.shadowRoot.innerHTML = `
17539
17539
  <style>
17540
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.331"}/dist/css/nine-mu.css";
17540
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.332"}/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 = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
43788
43788
  this.shadowRoot.innerHTML = `
43789
43789
  <style>
43790
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.331"}/dist/css/nine-mu.css";
43790
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.332"}/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.331"}/dist/css/nine-mu.css";
43930
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.332"}/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.331"}/dist/css/nine-mu.css";
44039
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.332"}/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}/ninePanel.css";` : "";
44367
44367
  this.shadowRoot.innerHTML = `
44368
44368
  <style>
44369
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.331"}/dist/css/nine-mu.css";
44369
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.332"}/dist/css/nine-mu.css";
44370
44370
  ${customImport}
44371
44371
  </style>
44372
44372
 
@@ -44464,8 +44464,84 @@ if (!customElements.get("nine-chat-ing")) {
44464
44464
  if (!customElements.get("nine-chat-progress")) {
44465
44465
  customElements.define("nine-chat-progress", ProgressMessage);
44466
44466
  }
44467
+ class ExceptionHook extends HTMLElement {
44468
+ constructor() {
44469
+ super();
44470
+ this.lastPath = window.location.pathname;
44471
+ this.hasError = false;
44472
+ this.cssPath = "/css/nine-exception-hook.css";
44473
+ }
44474
+ connectedCallback() {
44475
+ this.injectStylesheet();
44476
+ window.addEventListener("error", this.handleRuntimeError.bind(this), true);
44477
+ window.addEventListener("unhandledrejection", this.handlePromiseError.bind(this), true);
44478
+ window.addEventListener("popstate", this.handleLocationChange.bind(this));
44479
+ document.addEventListener("click", this.handleLocationChange.bind(this), true);
44480
+ }
44481
+ disconnectedCallback() {
44482
+ window.removeEventListener("error", this.handleRuntimeError);
44483
+ window.removeEventListener("unhandledrejection", this.handlePromiseError);
44484
+ window.removeEventListener("popstate", this.handleLocationChange);
44485
+ document.removeEventListener("click", this.handleLocationChange, true);
44486
+ }
44487
+ injectStylesheet() {
44488
+ if (document.querySelector(`link[href="${this.cssPath}"]`)) return;
44489
+ const link = document.createElement("link");
44490
+ link.rel = "stylesheet";
44491
+ link.href = this.cssPath;
44492
+ document.head.appendChild(link);
44493
+ }
44494
+ handleRuntimeError(event) {
44495
+ var _a2;
44496
+ if (this.contains(event.target) || event.error) {
44497
+ this.renderError(((_a2 = event.error) == null ? void 0 : _a2.message) || event.message);
44498
+ }
44499
+ }
44500
+ handlePromiseError(event) {
44501
+ var _a2;
44502
+ this.renderError(((_a2 = event.reason) == null ? void 0 : _a2.message) || String(event.reason));
44503
+ }
44504
+ handleLocationChange() {
44505
+ setTimeout(() => {
44506
+ if (this.hasError && this.lastPath !== window.location.pathname) {
44507
+ console.log("✨ [nine-exception-hook] 예외 해제 및 렌더링 정상 복구");
44508
+ this.lastPath = window.location.pathname;
44509
+ this.hasError = false;
44510
+ const errorBox = this.querySelector(".nine-error-container");
44511
+ if (errorBox) errorBox.remove();
44512
+ Array.from(this.children).forEach((child) => {
44513
+ if (child.tagName !== "LINK") child.style.display = "";
44514
+ });
44515
+ }
44516
+ }, 10);
44517
+ }
44518
+ renderError(errorMessage) {
44519
+ if (this.hasError) return;
44520
+ this.hasError = true;
44521
+ if (window.triggerAutoRecovery) {
44522
+ window.triggerAutoRecovery(errorMessage);
44523
+ }
44524
+ Array.from(this.children).forEach((child) => {
44525
+ if (child.tagName !== "LINK") child.style.display = "none";
44526
+ });
44527
+ const errorHTML = `
44528
+ <div class="nine-error-container">
44529
+ <h3 class="nine-error-title">⚠️ 시스템 예외 감지 (${this.tagName.toLowerCase()})</h3>
44530
+ <p class="nine-error-label">[에러 원인 로그]:</p>
44531
+ <pre class="nine-error-log">${errorMessage}</pre>
44532
+ <div class="nine-error-footer">
44533
+ 🔄 에러 로그가 관제탑으로 자동 피드백되었습니다. AI가 소스 코드를 재수정하는 동안 잠시만 기다려주세요...
44534
+ </div>
44535
+ </div>
44536
+ `;
44537
+ this.insertAdjacentHTML("beforeend", errorHTML);
44538
+ }
44539
+ }
44540
+ if (!customElements.get("nine-exception-hook")) {
44541
+ customElements.define("nine-exception-hook", ExceptionHook);
44542
+ }
44467
44543
  const NineMu = {
44468
- version: "0.1.331",
44544
+ version: "0.1.332",
44469
44545
  init: (config2) => {
44470
44546
  trace$1.log("🛠️ Nine-Mu Engine initialized", config2);
44471
44547
  }