@nine-lab/nine-mu 0.1.201 β†’ 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nine-lab/nine-mu",
3
- "version": "0.1.201",
3
+ "version": "0.1.203",
4
4
  "description": "AI-Driven Full-Stack Code Fabrication Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/nine-mu.umd.js",
@@ -47,71 +47,48 @@ export class NineChatManager {
47
47
  .then( async () => {
48
48
  this.#updateStatus("βœ… MCP Connected");
49
49
 
50
- this.#mcpClient.onnotification = (notification) => {
51
- trace.log("πŸ”” μ‹€μ‹œκ°„ μ•Œλ¦Ό 도착:", notification);
52
-
53
- if (notification?.method === "notifications/logging/message") {
54
- try {
55
- const logData = JSON.parse(notification.params.message);
56
-
57
- if (logData.type === "BRAIN_DECISION") {
58
- //this.#updateStatus("브레인 뢄석 μˆ˜μ‹  μ™„λ£Œ");
59
-
60
- // πŸ’‘ [확인] 주석을 ν’€μ–΄μ„œ UI 챗창에 λ©”μ‹œμ§€λ₯Ό κ½‚μ•„μ€λ‹ˆλ‹€!
61
- //this.#pushMessage('assistant', logData.message);
62
- }
63
- } catch (e) {
64
- trace.warn("μ•Œλ¦Ό λ‚΄λΆ€ JSON νŒŒμ‹± μ‹€νŒ¨:", e);
65
- }
66
- }
67
- };
68
50
 
69
51
  /**
70
- // πŸ’‘ [정석] notificationHandlers에 λ‘œκΉ… λ©”μ‹œμ§€ μˆ˜μ‹  ν•Έλ“€λŸ¬λ₯Ό λ“±λ‘ν•©λ‹ˆλ‹€.
71
- // 프라이빗 λ©”μ„œλ“œ μ ‘κ·Ό(__privateGet) ν•„μš” 없이 public μΈν„°νŽ˜μ΄μŠ€λ‘œ μ œκ³΅λ©λ‹ˆλ‹€.
72
- this.#mcpClient.setNotificationHandler(
73
- LoggingMessageNotificationSchema, // πŸ‘ˆ 검증기 톡과 패슀포트
74
- (notification) => {
75
- try {
76
- trace.log(notification);
77
- const logData = JSON.parse(notification.params.message);
78
- if (logData.type === "BRAIN_DECISION") {
79
- //this.#pushMessage('assistant', logData.message);
80
- }
81
- } catch (e) {
82
- trace.warn("μ•Œλ¦Ό νŒŒμ‹± μ‹€νŒ¨:", e);
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);
83
60
  }
84
- }
85
- );*/
86
- /**
61
+ } catch(e) {}
62
+ };
63
+ */
64
+ // 1️⃣ MCP 규격 기동을 μœ„ν•œ ν•Έλ“œμ…°μ΄ν¬ ν™œμ„±ν™”
87
65
  try {
88
66
  await this.#mcpClient.request(
89
67
  { method: "logging/setLevel", params: { level: "info" } },
90
- z.object({}) // 빈 응닡 μŠ€ν‚€λ§ˆ 객체 검증
68
+ z.object({})
91
69
  );
92
- trace.log("πŸš€ MCP λ‘œκΉ… μ„Έμ…˜ ν™œμ„±ν™” μ™„λ£Œ (Level: info)");
93
- } catch (linkErr) {
94
- trace.error("❌ λ‘œκΉ… μ„Έμ…˜ ν™œμ„±ν™” μ‹€νŒ¨:", linkErr);
70
+ trace.log("πŸš€ MCP λ‘œκΉ… 채널 ν™œμ„±ν™”");
71
+ } catch (e) {
72
+ trace.warn("λ‘œκΉ… 채널 μ΄ˆκΈ°ν™” 패슀 (μ»€μŠ€ν…€ 슀트림 λŒ€μ‘):", e);
95
73
  }
96
74
 
97
- this.#mcpClient.onnotification = (notification) => {
98
- trace.log("πŸ”” μ‹€μ‹œκ°„ μ•Œλ¦Ό 도착:", notification);
99
- // MCP 곡식 λ‘œκΉ… λ©”μ»€λ‹ˆμ¦˜ ν”„λ‘œν† μ½œ μ£Όμ†Œ
100
- if (notification?.method === "notifications/logging/message") {
75
+ // 2️⃣ [MCP 정곡법 볡귀] λ“œλ””μ–΄ 정식 μŠ€ν‚€λ§ˆμ™€ ν•Έλ“€λŸ¬ ꡬ쑰둜 λ‹Ήλ‹Ήν•˜κ²Œ λ“±λ‘ν•©λ‹ˆλ‹€!
76
+ this.#mcpClient.setNotificationHandler(
77
+ LoggingMessageNotificationSchema, // πŸ‘ˆ μ™ΈλΆ€ μž„ν¬νŠΈν•œ 정식 Zod μŠ€ν‚€λ§ˆ 객체
78
+ (notification) => {
101
79
  try {
102
- trace.log("πŸ”” μ‹€μ‹œκ°„ μ•Œλ¦Ό 도착:", notification);
103
- const logData = JSON.parse(notification.params.message);
80
+ trace.log("πŸ”” [MCP 정식 μ—”μ§„ μˆ˜μ‹  성곡]:", notification);
104
81
 
82
+ const logData = JSON.parse(notification.params.message);
105
83
  if (logData.type === "BRAIN_DECISION") {
106
- // UI에 μ‹€μ‹œκ°„ 쀑간 λ©”μ‹œμ§€ 꽂기 성곡!
84
+ // 주석을 μ™„μ „νžˆ ν’€κ³  화면에 타닀λ‹₯ λΏŒλ €μ€λ‹ˆλ‹€!
107
85
  //this.#pushMessage('assistant', logData.message);
108
86
  }
109
87
  } catch (e) {
110
- trace.warn("μ•Œλ¦Ό λ‚΄λΆ€ JSON νŒŒμ‹± μ‹€νŒ¨:", e);
88
+ trace.warn("μ•Œλ¦Ό λ‚΄λΆ€ 데이터 νŒŒμ‹± μ‹€νŒ¨:", e);
111
89
  }
112
90
  }
113
- };
114
- */
91
+ );
115
92
  })
116
93
  .catch((err) => {
117
94
  trace.error("❌ MCP μ—°κ²° μ‹€νŒ¨", err);