@nine-lab/nine-mu 0.1.208 → 0.1.210

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.208",
3
+ "version": "0.1.210",
4
4
  "description": "AI-Driven Full-Stack Code Fabrication Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/nine-mu.umd.js",
@@ -48,46 +48,44 @@ export class NineChatManager {
48
48
  this.#updateStatus("✅ MCP Connected");
49
49
 
50
50
 
51
- /**
52
- transport._socket.onmessage = (event) => {
53
- try {
54
- trace.log(event);
55
- const data = JSON.parse(event.data);
56
- // 백엔드가 보낸 우리만의 비밀 표식이 있다면?
57
- if (data.isCustomLiveMessage) {
58
- // UI에 실시간 중간 멘트 꽂기 끝!
59
- //this.#pushMessage('assistant', data.message);
60
- }
61
- } catch(e) {}
62
- };
63
- */
64
51
  // 1️⃣ MCP 규격 기동을 위한 핸드셰이크 활성화
65
52
  try {
66
53
  await this.#mcpClient.request(
67
54
  { method: "logging/setLevel", params: { level: "info" } },
68
55
  z.object({})
69
56
  );
70
- trace.log("🚀 MCP 로깅 채널 활성화1111");
71
- } catch (e) {
72
- trace.warn("로깅 채널 초기화 패스 (커스텀 스트림 대응):", e);
73
- }
57
+ } catch (e) {}
58
+
59
+ // 2️⃣ [MCP 재도전 성공 팁] 외부 스키마 대신, 내부 검증기가 딱 좋아하는 구조를 직접 던져줍니다.
60
+ // 이렇게 하면 'Schema is missing a method literal' 에러도 안 나고, 데이터도 100% 통과합니다.
61
+ const customNotificationSchema = z.object({
62
+ method: z.literal("notifications/logging/message"), // 👈 검증기가 찾는 리터럴 딱 명시!
63
+ params: z.object({
64
+ level: z.string(),
65
+ logger: z.string(),
66
+ message: z.string()
67
+ })
68
+ });
74
69
 
75
-
76
- // 2️⃣ [MCP 정공법 복귀] 드디어 정식 스키마와 핸들러 구조로 당당하게 등록합니다!
77
70
  this.#mcpClient.setNotificationHandler(
78
- LoggingMessageNotificationSchema, // 👈 외부 임포트한 정식 Zod 스키마 객체
71
+ customNotificationSchema, // 👈 껍데기 통과용 커스텀 스키마
79
72
  (notification) => {
73
+ //notification.params.message
74
+ trace.log(notification);
75
+
76
+ this.add("ai", notification.params.message);
77
+ /**
80
78
  try {
81
- trace.log("🔔 [MCP 정식 엔진 수신 성공]:", notification);
79
+ trace.log("🔔 [MCP 엔진 우회 성공] 알림 도착:", notification);
82
80
 
83
81
  const logData = JSON.parse(notification.params.message);
84
82
  if (logData.type === "BRAIN_DECISION") {
85
- // 주석을 완전히 풀고 화면에 타다닥 뿌려줍니다!
86
- //this.#pushMessage('assistant', logData.message);
83
+ // 드디어 MCP 정식 핸들러를 타고 UI에 안착!
84
+ // this.#pushMessage('assistant', logData.message);
87
85
  }
88
86
  } catch (e) {
89
- trace.warn("알림 내부 데이터 파싱 실패:", e);
90
- }
87
+ trace.warn("알림 내부 파싱 에러:", e);
88
+ }*/
91
89
  }
92
90
  );
93
91
  })