@nine-lab/nine-mu 0.1.202 → 0.1.203
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 +20 -16
- package/dist/nine-mu.js.map +1 -1
- package/dist/nine-mu.umd.js +1 -1
- package/dist/nine-mu.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NineChatManager.js +16 -42
package/package.json
CHANGED
|
@@ -47,16 +47,8 @@ export class NineChatManager {
|
|
|
47
47
|
.then( async () => {
|
|
48
48
|
this.#updateStatus("✅ MCP Connected");
|
|
49
49
|
|
|
50
|
-
try {
|
|
51
|
-
await this.#mcpClient.request(
|
|
52
|
-
{ method: "logging/setLevel", params: { level: "info" } },
|
|
53
|
-
z.object({}) // 빈 응답 스키마 객체 검증
|
|
54
|
-
);
|
|
55
|
-
trace.log("🚀 MCP 로깅 세션 활성화 완료 (Level: info)");
|
|
56
|
-
} catch (linkErr) {
|
|
57
|
-
trace.error("❌ 로깅 세션 활성화 실패:", linkErr);
|
|
58
|
-
}
|
|
59
50
|
|
|
51
|
+
/**
|
|
60
52
|
transport._socket.onmessage = (event) => {
|
|
61
53
|
try {
|
|
62
54
|
trace.log(event);
|
|
@@ -68,53 +60,35 @@ export class NineChatManager {
|
|
|
68
60
|
}
|
|
69
61
|
} catch(e) {}
|
|
70
62
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
// 💡 [정석] notificationHandlers에 로깅 메시지 수신 핸들러를 등록합니다.
|
|
74
|
-
// 프라이빗 메서드 접근(__privateGet) 필요 없이 public 인터페이스로 제공됩니다.
|
|
75
|
-
this.#mcpClient.setNotificationHandler(
|
|
76
|
-
LoggingMessageNotificationSchema, // 👈 검증기 통과 패스포트
|
|
77
|
-
(notification) => {
|
|
78
|
-
try {
|
|
79
|
-
trace.log(notification);
|
|
80
|
-
const logData = JSON.parse(notification.params.message);
|
|
81
|
-
if (logData.type === "BRAIN_DECISION") {
|
|
82
|
-
//this.#pushMessage('assistant', logData.message);
|
|
83
|
-
}
|
|
84
|
-
} catch (e) {
|
|
85
|
-
trace.warn("알림 파싱 실패:", e);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
);*/
|
|
89
|
-
/**
|
|
63
|
+
*/
|
|
64
|
+
// 1️⃣ MCP 규격 기동을 위한 핸드셰이크 활성화
|
|
90
65
|
try {
|
|
91
66
|
await this.#mcpClient.request(
|
|
92
67
|
{ method: "logging/setLevel", params: { level: "info" } },
|
|
93
|
-
z.object({})
|
|
68
|
+
z.object({})
|
|
94
69
|
);
|
|
95
|
-
trace.log("🚀 MCP 로깅
|
|
96
|
-
} catch (
|
|
97
|
-
trace.
|
|
70
|
+
trace.log("🚀 MCP 로깅 채널 활성화");
|
|
71
|
+
} catch (e) {
|
|
72
|
+
trace.warn("로깅 채널 초기화 패스 (커스텀 스트림 대응):", e);
|
|
98
73
|
}
|
|
99
74
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
//
|
|
103
|
-
|
|
75
|
+
// 2️⃣ [MCP 정공법 복귀] 드디어 정식 스키마와 핸들러 구조로 당당하게 등록합니다!
|
|
76
|
+
this.#mcpClient.setNotificationHandler(
|
|
77
|
+
LoggingMessageNotificationSchema, // 👈 외부 임포트한 정식 Zod 스키마 객체
|
|
78
|
+
(notification) => {
|
|
104
79
|
try {
|
|
105
|
-
trace.log("🔔
|
|
106
|
-
const logData = JSON.parse(notification.params.message);
|
|
80
|
+
trace.log("🔔 [MCP 정식 엔진 수신 성공]:", notification);
|
|
107
81
|
|
|
82
|
+
const logData = JSON.parse(notification.params.message);
|
|
108
83
|
if (logData.type === "BRAIN_DECISION") {
|
|
109
|
-
//
|
|
84
|
+
// 주석을 완전히 풀고 화면에 타다닥 뿌려줍니다!
|
|
110
85
|
//this.#pushMessage('assistant', logData.message);
|
|
111
86
|
}
|
|
112
87
|
} catch (e) {
|
|
113
|
-
trace.warn("알림 내부
|
|
88
|
+
trace.warn("알림 내부 데이터 파싱 실패:", e);
|
|
114
89
|
}
|
|
115
90
|
}
|
|
116
|
-
|
|
117
|
-
*/
|
|
91
|
+
);
|
|
118
92
|
})
|
|
119
93
|
.catch((err) => {
|
|
120
94
|
trace.error("❌ MCP 연결 실패", err);
|