@nine-lab/nine-mu 0.1.130 → 0.1.131
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 +11 -33
- package/dist/nine-mu.js.map +1 -1
- package/dist/nine-mu.umd.js +3 -3
- package/dist/nine-mu.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NineChat.js +13 -36
package/package.json
CHANGED
|
@@ -70,45 +70,22 @@ export class NineChat extends HTMLElement {
|
|
|
70
70
|
$textarea.addEventListener('keypress', async (e) => {
|
|
71
71
|
if (e.key === 'Enter' && !e.shiftKey) {
|
|
72
72
|
e.preventDefault();
|
|
73
|
-
const
|
|
74
|
-
if (!
|
|
73
|
+
const userInput = e.target.value.trim();
|
|
74
|
+
if (!userInput) return;
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
//
|
|
79
|
-
// AI가
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
routesPath: this.#routesPath,
|
|
89
|
-
packageName: this.#packageName,
|
|
90
|
-
genTargets: Array.from(this.shadowRoot.querySelectorAll('input[name="gen_target"]:checked')).map(el => el.value)
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
trace.log(result);
|
|
96
|
-
|
|
97
|
-
// 3. 응답 처리 (분석 결과가 오면 Diff 팝업 오픈)
|
|
98
|
-
const data = JSON.parse(result.content[0].text);
|
|
99
|
-
|
|
100
|
-
if (data.action === "SHOW_DIFF") {
|
|
101
|
-
this.#showDiff(data.asis, data.tobe, "json");
|
|
102
|
-
$status.textContent = "✅ 분석 완료";
|
|
103
|
-
} else {
|
|
104
|
-
// 일반 대화인 경우 채팅창에 표시 (nx-ai-chat 등 활용)
|
|
105
|
-
$status.textContent = "💬 답변 완료";
|
|
106
|
-
}
|
|
77
|
+
// async onUserInput(userInput) {
|
|
78
|
+
// "어떤 툴을 써라"가 아니라 "이 질문을 해결해라"라고 던짐
|
|
79
|
+
// 그러면 AI가 위 툴 목록 중 'analyze_menu_gap'이 적절한지 스스로 판단해서 실행함
|
|
80
|
+
const response = await this.#mcpClient.executeAgent(userInput);
|
|
81
|
+
console.log(response);
|
|
82
|
+
const result = JSON.parse(response.content[0].text);
|
|
83
|
+
|
|
84
|
+
// AI가 툴을 실행하고 가져온 결과(action)에 따라 화면만 띄움
|
|
85
|
+
if (result.action === "SHOW_DIFF") this.openDiff(result);
|
|
86
|
+
//}
|
|
87
|
+
|
|
107
88
|
|
|
108
|
-
} catch (err) {
|
|
109
|
-
trace.error("AI 응답 실패:", err);
|
|
110
|
-
$status.textContent = "❌ 에러 발생";
|
|
111
|
-
}
|
|
112
89
|
|
|
113
90
|
/**
|
|
114
91
|
// 1. UI 피드백
|