@nine-lab/nine-mu 0.1.168 → 0.1.170

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.168",
3
+ "version": "0.1.170",
4
4
  "description": "AI-Driven Full-Stack Code Fabrication Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/nine-mu.umd.js",
@@ -73,12 +73,12 @@ export class NineChat extends HTMLElement {
73
73
  if (e.key === 'Enter' && !e.shiftKey) {
74
74
  e.preventDefault();
75
75
 
76
- const userInput = e.target.value.trim();
76
+ const target = e.target;
77
+
78
+ const userInput = target.value.trim();
77
79
  if (!userInput) return;
78
80
 
79
- //this.isProcessing = true;
80
- //e.target.disabled = true;
81
- e.target.setAttribute('disabled', 'disabled');
81
+ target.setAttribute('disabled', 'disabled');
82
82
 
83
83
  // 1. 즉시 UI 반영
84
84
  this.#$nineChatMessage.add("me", userInput);
@@ -86,25 +86,21 @@ export class NineChat extends HTMLElement {
86
86
 
87
87
  // 2. 입력창 비우기
88
88
  setTimeout(() => {
89
- e.target.value = "";
89
+ target.value = "";
90
90
  });
91
91
 
92
- console.log("===========start");
93
92
  // 3. nine.safe로 매니저 로직 실행
94
- const [_, err] = await nine.safe(this.#manager.handleChatSubmit(e.target));
95
-
96
- console.log("===========end");
93
+ const [result, err] = await nine.safe(this.#manager.handleChatSubmit(target));
94
+ target.removeAttribute('disabled');
97
95
 
98
96
  if (err) {
99
97
  console.error("Manager 실행 에러:", err);
100
98
  // 필요 시 'ing' 메시지 제거 및 사용자 알림
101
99
  this.shadowRoot.querySelectorAll("nx-ai-ing-message").forEach(el => el.remove());
102
100
  nine.alert("메시지 전송 중 오류가 발생했습니다.").rgb().shake();
101
+ } else {
102
+ console.log(result);
103
103
  }
104
-
105
- console.log(e.target);
106
-
107
- e.target.removeAttribute('disabled');
108
104
  }
109
105
  });
110
106
  }