@nine-lab/nine-mu 0.1.343 โ†’ 0.1.345

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nine-lab/nine-mu",
3
- "version": "0.1.343",
3
+ "version": "0.1.345",
4
4
  "description": "AI-Driven Full-Stack Code Fabrication Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/nine-mu.umd.js",
@@ -11,14 +11,11 @@ export class ExceptionHook extends HTMLElement {
11
11
  constructor() {
12
12
  super();
13
13
  this.attachShadow({ mode: 'open' });
14
- trace.log("๐Ÿ” [nine-exception-hook] ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ๋จ");
15
14
  }
16
15
 
17
16
  connectedCallback() {
18
- trace.log("๐Ÿ” [nine-exception-hook] DOM์— ๋งˆ์šดํŠธ๋จ. ์ด๋ฒคํŠธ ๋ฆฌ์Šค๋„ˆ ๋ฐ”์ธ๋”ฉ ์‹œ์ž‘");
19
17
  this.#renderer();
20
18
  this.#injectShadowStylesheet();
21
-
22
19
  this.#setupGlobalSniffer();
23
20
 
24
21
  window.addEventListener('unhandledrejection', this.#handlePromiseError, true);
@@ -27,7 +24,6 @@ export class ExceptionHook extends HTMLElement {
27
24
  }
28
25
 
29
26
  disconnectedCallback() {
30
- trace.log("๐Ÿ” [nine-exception-hook] DOM์—์„œ ์–ธ๋งˆ์šดํŠธ๋จ. ๋ฆฌ์Šค๋„ˆ ํ•ด์ œ");
31
27
  window.removeEventListener('error', this.#handleRuntimeError, true);
32
28
  window.removeEventListener('unhandledrejection', this.#handlePromiseError, true);
33
29
  window.removeEventListener('popstate', this.#handleLocationChange);
@@ -35,40 +31,31 @@ export class ExceptionHook extends HTMLElement {
35
31
 
36
32
  if (window.onerror === this.#handleRuntimeError || this.#oldOnError) {
37
33
  window.onerror = this.#oldOnError;
38
- trace.log("๐Ÿ” [nine-exception-hook] window.onerror ๋ณต๊ตฌ ์™„๋ฃŒ");
39
34
  }
40
35
  }
41
36
 
42
37
  #setupGlobalSniffer() {
43
38
  window.addEventListener('error', this.#handleRuntimeError, true);
44
- trace.log("๐Ÿ” [nine-exception-hook] window.addEventListener('error') ๋“ฑ๋ก ์™„๋ฃŒ");
45
39
 
46
40
  this.#oldOnError = window.onerror;
47
41
  window.onerror = (message, source, lineno, colno, error) => {
48
- trace.log("๐Ÿšจ [nine-exception-hook] ์›์‹œ window.onerror ํฌ์ฐฉ!!", { message, source, lineno, error });
49
-
50
42
  if (!this.#hasError) {
51
- trace.log("๐ŸŽฏ [nine-exception-hook] ํ˜„์žฌ ์—๋Ÿฌ ์ƒํƒœ ์—†์Œ -> ์—๋Ÿฌ ๋ณด๋“œ ์ถœ๋ ฅ ์‹œ๋„");
52
43
  const errorMessage = error?.message || message || "์•Œ ์ˆ˜ ์—†๋Š” ๋Ÿฐํƒ€์ž„ ์˜ˆ์™ธ";
53
44
  const errorStack = error?.stack || `${source}:${lineno}:${colno}`;
54
45
  this.#renderError(errorMessage, errorStack);
55
- } else {
56
- trace.log("โš ๏ธ [nine-exception-hook] ์ด๋ฏธ ์—๋Ÿฌ ํ™”๋ฉด์ด ํ™œ์„ฑํ™”๋˜์–ด ์žˆ์–ด ์›์‹œ onerror ํŒจ์Šค");
57
46
  }
58
-
59
47
  if (this.#oldOnError) {
60
- trace.log("๐Ÿ”„ [nine-exception-hook] ๊ธฐ์กด์— ๋“ฑ๋ก๋˜์–ด ์žˆ๋˜ ๋‹ค๋ฅธ onerror ์—”์ง„์œผ๋กœ ์œ„์ž„");
61
48
  return this.#oldOnError(message, source, lineno, colno, error);
62
49
  }
63
50
  return false;
64
51
  };
65
- trace.log("๐Ÿ” [nine-exception-hook] ์›์‹œ window.onerror ๊ฐ€๋กœ์ฑ„๊ธฐ(Chaining) ์™„๋ฃŒ");
66
52
  }
67
53
 
68
54
  #renderer = () => {
69
55
  const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-mu.css";` : "";
70
56
 
71
- // ๐ŸŽฏ [์ˆ˜์ • 1] ๊ธ€๋กœ๋ฒŒ ๋กœ๋”ฉ ์˜ค๋ฒ„๋ ˆ์ด๋ฅผ ํ™”๋ฉด ์ „์ฒด์—์„œ ์ฐ์–ด๋ˆ„๋ฅด๊ธฐ ์œ„ํ•œ ํ˜ธ์ŠคํŠธ ๋ฐ ๋ ˆ์ด์–ด ์Šคํƒ€์ผ ๋‚ด์žฅ
57
+ // ๐ŸŽฏ [ํ•ต์‹ฌ ๋ณ€๊ฒฝ 1] :host ์ž์ฒด๋ฅผ absolute์˜ ๊ธฐ์ค€์ ์ด ๋˜๋Š” block์œผ๋กœ ์žก๊ณ ,
58
+ // ๋ฆฌ์•กํŠธ ์Šฌ๋กฏ ๋‚ด์šฉ๋ฌผ(๋ฉ”๋‰ด ๋“ฑ)์€ ์ ˆ๋Œ€ ์ˆจ๊ธฐ์ง€ ์•Š๊ณ  100% ํฌ๊ธฐ๋กœ ์œ ์ง€ํ•ฉ๋‹ˆ๋‹ค.
72
59
  this.shadowRoot.innerHTML = `
73
60
  <style>
74
61
  @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${__APP_VERSION__}/dist/css/nine-mu.css";
@@ -78,25 +65,33 @@ export class ExceptionHook extends HTMLElement {
78
65
  display: block;
79
66
  width: 100%;
80
67
  height: 100%;
68
+ position: relative !important; /* ๋‚ด๋ถ€ ์—๋Ÿฌ ๋ณด๋“œ์˜ ๊ธฐ์ค€์  ๊ธฐ๋‘ฅ ์ƒ์„ฑ */
81
69
  }
82
- /* ์–ด๋–ค ๋กœ๋”ฉ ๋ ˆ์ด์–ด๊ฐ€ ๋Œ๊ณ  ์žˆ์–ด๋„ ๋ทฐํฌํŠธ ๊ธฐ์ค€ ๋ฌด์กฐ๊ฑด ๋งจ ์•ž(์ตœ์ƒ๋‹จ)์œผ๋กœ ๋นผ๋ฒ„๋ฆฌ๋Š” ์ ˆ๋Œ€ ๋ฐฉ์–ด ํด๋ž˜์Šค */
83
- .nine-hook-full-overlay {
84
- position: fixed !important;
70
+
71
+ .nine-hook-core {
72
+ width: 100%;
73
+ height: 100%;
74
+ }
75
+
76
+ /* ๐ŸŽฏ [ํ•ต์‹ฌ ๋ณ€๊ฒฝ 2] ๋ฆฌ์•กํŠธ ์Šฌ๋กฏ์„ ๊ฐ€๋ฆฌ์ง€ ์•Š๊ณ , ์˜ค์ง "์ด ์ปดํฌ๋„ŒํŠธ ๊ตฌ์—ญ"๋งŒ ๊ฐ€๋“ ์ฑ„์šฐ๋Š” ๋…๋ฆฝ ํŒ์—… ๋ ˆ์ด์–ด */
77
+ .nine-hook-inner-cover {
78
+ position: absolute !important;
85
79
  top: 0 !important;
86
80
  left: 0 !important;
87
- width: 100vw !important;
88
- height: 100vh !important;
81
+ width: 100% !important;
82
+ height: 100% !important;
89
83
  box-sizing: border-box !important;
90
84
  background-color: #FFF5F5 !important;
91
- z-index: 99999999 !important;
85
+ z-index: 2147483647 !important; /* ๋ฆฌ์•กํŠธ ๋‚ด๋ถ€ ๊ทธ ์–ด๋–ค ์˜ค๋ฒ„๋ ˆ์ด๋ณด๋‹ค ๋ฌด์กฐ๊ฑด ์œ„ */
92
86
  overflow: auto !important;
87
+ display: none; /* ํ‰์†Œ์—” ์ˆจ๊น€ */
93
88
  }
94
89
  </style>
95
90
 
96
- <div class="nine-hook-core" style="width: 100%; height: 100%;">
91
+ <div class="nine-hook-core">
97
92
  <slot></slot>
98
93
  </div>
99
- <div class="nine-exception-board"></div>
94
+ <div class="nine-exception-board class-target-board"></div>
100
95
  `;
101
96
  }
102
97
 
@@ -110,61 +105,42 @@ export class ExceptionHook extends HTMLElement {
110
105
  }
111
106
 
112
107
  #handleRuntimeError = (event) => {
113
- trace.log("๐Ÿšจ [nine-exception-hook] window.addEventListener('error') ๋ฆฌ์Šค๋„ˆ ํฌ์ฐฉ!!", event);
114
-
115
- if (this.#hasError) {
116
- trace.log("โš ๏ธ [nine-exception-hook] ์ด๋ฏธ ์—๋Ÿฌ ํ™”๋ฉด์ด ํ™œ์„ฑํ™”๋˜์–ด ์žˆ์–ด ์ด๋ฒคํŠธ ๋ฆฌ์Šค๋„ˆ ํŒจ์Šค");
117
- return;
118
- }
108
+ if (this.#hasError) return;
119
109
 
120
110
  const errorMessage = event.error?.message || event.message || String(event);
121
111
  const errorStack = event.error?.stack || "No stack trace available";
122
112
 
123
113
  if (errorMessage && errorMessage !== "Script error.") {
124
- trace.log("๐ŸŽฏ [nine-exception-hook] ์ •์ƒ์ ์ธ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€ ํ™•์ธ -> ์—๋Ÿฌ ๋ณด๋“œ ์ถœ๋ ฅ ์‹œ๋„", { errorMessage });
125
114
  this.#renderError(errorMessage, errorStack);
126
- } else {
127
- trace.log("โš ๏ธ [nine-exception-hook] 'Script error.' ์ด๊ฑฐ๋‚˜ ๋นˆ ๋ฉ”์‹œ์ง€๋ผ ๋ฌด์‹œ๋จ");
128
115
  }
129
116
  }
130
117
 
131
118
  #handlePromiseError = (event) => {
132
- trace.log("๐Ÿšจ [nine-exception-hook] unhandledrejection (Promise ์—๋Ÿฌ) ํฌ์ฐฉ!!", event);
133
-
134
119
  if (this.#hasError) return;
135
120
 
136
121
  const reason = event.reason;
137
122
  const errorMessage = reason?.message || String(reason || "Unhandled Promise Rejection");
138
123
  const errorStack = reason?.stack || "No stack trace available";
139
124
 
140
- trace.log("๐ŸŽฏ [nine-exception-hook] Promise ๊ฑฐ๋ถ€ ํ™•์ธ -> ์—๋Ÿฌ ๋ณด๋“œ ์ถœ๋ ฅ ์‹œ๋„");
141
125
  this.#renderError(errorMessage, errorStack);
142
126
  }
143
127
 
144
128
  #handleLocationChange = () => {
145
129
  setTimeout(() => {
146
- trace.log("๐Ÿ“ [nine-exception-hook] ์ฃผ์†Œ ์ด๋™ ๊ฐ์ง€ ์ฒดํฌ", {
147
- hasError: this.#hasError,
148
- lastPath: this.#lastPath,
149
- currentPath: window.location.pathname
150
- });
151
-
152
130
  if (this.#hasError && this.#lastPath !== window.location.pathname) {
153
- trace.log("โœจ [nine-exception-hook] Shadow DOM ๋‚ด๋ถ€ ์˜ˆ์™ธ ์ฒญ์†Œ ๋ฐ ์ •์ƒ ๋ณต๊ตฌ");
154
131
  this.#lastPath = window.location.pathname;
155
132
  this.#hasError = false;
156
133
 
157
134
  const exceptionBoard = this.shadowRoot.querySelector('.nine-exception-board');
158
- if (exceptionBoard) exceptionBoard.innerHTML = '';
159
-
160
- const coreContainer = this.shadowRoot.querySelector('.nine-hook-core');
161
- if (coreContainer) coreContainer.style.display = '';
135
+ if (exceptionBoard) {
136
+ exceptionBoard.innerHTML = '';
137
+ exceptionBoard.className = 'nine-exception-board'; // ํด๋ž˜์Šค ๋ฆฌ์…‹
138
+ }
162
139
  }
163
- }, 50); // ๋ผ์šฐํŒ… ์™„๋ฃŒ ๋Œ€๊ธฐ ์‹œ๊ฐ„์„ ์œ„ํ•ด ๋ฏธ์„ธ ์ƒํ–ฅ (50ms)
140
+ }, 50);
164
141
  }
165
142
 
166
143
  #sendToAiAction = async (errorMessage, errorStack) => {
167
- trace.log("๐Ÿš€ [nine-exception-hook] AI ์ˆ˜์ • ์š”์ฒญ ๋ฒ„ํŠผ ํด๋ฆญ๋จ");
168
144
  const btn = this.shadowRoot.querySelector('.nine-ai-btn');
169
145
  const footer = this.shadowRoot.querySelector('.nine-error-footer');
170
146
  if (!btn) return;
@@ -175,7 +151,6 @@ export class ExceptionHook extends HTMLElement {
175
151
 
176
152
  try {
177
153
  if (window.triggerAutoRecovery) {
178
- trace.log("๐Ÿ“ก [nine-exception-hook] window.triggerAutoRecovery ํ˜ธ์ถœ ์‹คํ–‰");
179
154
  await window.triggerAutoRecovery({
180
155
  message: errorMessage,
181
156
  stack: errorStack || "No stack trace available",
@@ -188,7 +163,6 @@ export class ExceptionHook extends HTMLElement {
188
163
  throw new Error("window.triggerAutoRecovery ๊ด€์ œํƒ‘ ์—”์ง„์ด ๋กœ๋“œ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.");
189
164
  }
190
165
  } catch (err) {
191
- trace.error("โŒ AI ์ „์†ก ์‹คํŒจ:", err);
192
166
  btn.disabled = false;
193
167
  btn.innerText = "โŒ ์žฌ์ „์†ก ์‹œ๋„";
194
168
  footer.innerHTML = `<span style="color: #E53E3E;">โš ๏ธ ์ „์†ก ์‹คํŒจ: ${err.message}</span>`;
@@ -200,45 +174,33 @@ export class ExceptionHook extends HTMLElement {
200
174
  this.#hasError = true;
201
175
 
202
176
  setTimeout(() => {
203
- trace.log("๐ŸŽจ [nine-exception-hook] ๋ฆฌ์•กํŠธ ์‚ฌ์ดํด ์ข…๋ฃŒ ํ›„ ์—๋Ÿฌ UI ์ตœ์ข… ๋ Œ๋”๋ง");
204
-
205
- const coreContainer = this.shadowRoot.querySelector('.nine-hook-core');
206
- if (coreContainer) {
207
- coreContainer.style.display = 'none';
208
- trace.log("๐ŸŽจ [nine-exception-hook] <slot> ๋ณธ๋ฌธ ์˜์—ญ ์ปจํ…Œ์ด๋„ˆ ์ˆจ๊น€");
209
- }
210
-
211
177
  const exceptionBoard = this.shadowRoot.querySelector('.nine-exception-board');
212
- if (!exceptionBoard) {
213
- trace.error("โŒ [nine-exception-hook] .nine-exception-board ์—˜๋ฆฌ๋จผํŠธ๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.");
214
- return;
215
- }
178
+ if (!exceptionBoard) return;
179
+
180
+ // ๐ŸŽฏ [ํ•ต์‹ฌ ๋ณ€๊ฒฝ 3] ๊ธฐ์กด ์Šฌ๋กฏ ์ปจํ…Œ์ด๋„ˆ๋ฅผ ์ˆจ๊ธฐ์ง€(display: none) ์•Š์Šต๋‹ˆ๋‹ค!
181
+ // ๋Œ€์‹  ์—๋Ÿฌ ๋ณด๋“œ์— ์ปค๋ฒ„ ํด๋ž˜์Šค๋ฅผ ์ฃผ์ž…ํ•˜์—ฌ "์˜ค์ง ๋ณธ๋ฌธ ๊ณต๊ฐ„๋งŒ" ๋ฌผ๋ฆฌ์ ์œผ๋กœ ์™„์ „ํžˆ ๋ฎ์–ด์”Œ์›๋‹ˆ๋‹ค.
182
+ exceptionBoard.className = 'nine-hook-inner-cover';
216
183
 
217
- // ๐ŸŽฏ [์ˆ˜์ • 2] ์—๋Ÿฌ HTML ์ปจํ…Œ์ด๋„ˆ ๊ตฌ์กฐ๋ฅผ ํ™”๋ฉด ์ „์ฒด ๋ทฐํฌํŠธ๋ฅผ ์žฅ์•…ํ•˜๋Š” ๊ณ ์ • ๋ ˆ์ด์•„์›ƒ ๊ตฌ์กฐ๋กœ ๋žฉํ•‘
218
184
  const errorHTML = `
219
- <div class="nine-hook-full-overlay">
220
- <div class="nine-error-container" style="padding: 40px; max-width: 1200px; margin: 40px auto; font-family: sans-serif; background: white; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.08); text-align: left;">
221
- <h3 class="nine-error-title" style="color: #C53030; margin-top: 0; font-size: 22px; font-weight: 700; border-bottom: 2px solid #FED2D2; padding-bottom: 12px;">โš ๏ธ ์‹œ์Šคํ…œ ์˜ˆ์™ธ ๊ฐ์ง€ (${this.tagName.toLowerCase()})</h3>
222
- <p class="nine-error-label" style="font-weight: bold; margin: 20px 0 8px 0; color: #4A5568; font-size: 15px;">[์—๋Ÿฌ ์›์ธ ๋กœ๊ทธ]:</p>
223
- <pre class="nine-error-log" style="background: #1A202C; color: #EDF2F7; padding: 20px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; font-family: monospace; font-size: 14px; line-height: 1.6; margin-bottom: 25px;">${errorMessage}\n\n[Stack Trace]\n${errorStack}</pre>
224
-
225
- <div class="nine-action-area" style="display: flex; align-items: center; gap: 20px; border-top: 1px solid #E2E8F0; padding-top: 20px;">
226
- <button class="nine-ai-btn" style="background: #3182CE; color: white; border: none; padding: 14px 28px; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 16px; transition: background 0.2s;">๐Ÿค– AI์—๊ฒŒ ์†Œ์Šค์ฝ”๋“œ ์ˆ˜์ • ์š”์ฒญ</button>
227
- <div class="nine-error-footer" style="font-size: 14px; color: #718096; line-height: 1.4;">
228
- ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด AI๊ฐ€ ๋กœ๊ทธ ๋ฐ ์ปดํฌ๋„ŒํŠธ ๋งต์„ ์—ญ์ถ”์ ํ•˜์—ฌ ์ˆ˜์ •์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.
229
- </div>
185
+ <div class="nine-error-container" style="padding: 30px; box-sizing: border-box; font-family: sans-serif; background: white; min-height: 100%; text-align: left;">
186
+ <h3 class="nine-error-title" style="color: #C53030; margin-top: 0; font-size: 20px; font-weight: 700; border-bottom: 2px solid #FED2D2; padding-bottom: 12px; font-family: sans-serif;">โš ๏ธ ์‹œ์Šคํ…œ ์˜ˆ์™ธ ๊ฐ์ง€ (${this.tagName.toLowerCase()})</h3>
187
+ <p class="nine-error-label" style="font-weight: bold; margin: 15px 0 6px 0; color: #4A5568; font-size: 14px; font-family: sans-serif;">[์—๋Ÿฌ ์›์ธ ๋กœ๊ทธ]:</p>
188
+ <pre class="nine-error-log" style="background: #1A202C; color: #EDF2F7; padding: 15px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; font-family: monospace; font-size: 13px; line-height: 1.5; margin-bottom: 20px;">${errorMessage}\n\n[Stack Trace]\n${errorStack}</pre>
189
+
190
+ <div class="nine-action-area" style="display: flex; align-items: center; gap: 15px; border-top: 1px solid #E2E8F0; padding-top: 15px;">
191
+ <button class="nine-ai-btn" style="background: #3182CE; color: white; border: none; padding: 10px 20px; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 14px;">๐Ÿค– AI์—๊ฒŒ ์†Œ์Šค์ฝ”๋“œ ์ˆ˜์ • ์š”์ฒญ</button>
192
+ <div class="nine-error-footer" style="font-size: 13px; color: #718096; line-height: 1.4; font-family: sans-serif;">
193
+ ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด AI๊ฐ€ ๋กœ๊ทธ ๋ฐ ์ปดํฌ๋„ŒํŠธ ๋งต์„ ์—ญ์ถ”์ ํ•˜์—ฌ ์ˆ˜์ •์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.
230
194
  </div>
231
195
  </div>
232
196
  </div>
233
197
  `;
234
198
 
235
199
  exceptionBoard.innerHTML = errorHTML;
236
- trace.log("๐ŸŽจ [nine-exception-hook] Shadow DOM์— ์—๋Ÿฌ UI ์ตœ์ข… ์‚ฝ์ž… ์„ฑ๊ณต");
237
200
 
238
- const aiBtn = this.shadowRoot.querySelector('.nine-ai-btn');
201
+ const aiBtn = exceptionBoard.querySelector('.nine-ai-btn');
239
202
  if (aiBtn) {
240
203
  aiBtn.addEventListener('click', () => this.#sendToAiAction(errorMessage, errorStack));
241
- trace.log("๐ŸŽจ [nine-exception-hook] AI ์š”์ฒญ ๋ฒ„ํŠผ ์ด๋ฒคํŠธ ๋ฆฌ์Šค๋„ˆ ์ตœ์ข… ๋ฐ”์ธ๋”ฉ ์„ฑ๊ณต");
242
204
  }
243
205
  }, 0);
244
206
  }