@nine-lab/nine-mu 0.1.197 โ 0.1.199
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 +28 -14
- 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/NineChatManager.js +36 -5
package/package.json
CHANGED
|
@@ -33,14 +33,20 @@ export class NineChatManager {
|
|
|
33
33
|
const transport = new WebSocketClientTransport(new URL(connectorUrl));
|
|
34
34
|
this.#mcpClient = new Client({
|
|
35
35
|
name: "nine-mu-client", version: "1.0.0"
|
|
36
|
-
}, {
|
|
36
|
+
}, {
|
|
37
|
+
capabilities: {
|
|
38
|
+
tools: {},
|
|
39
|
+
logging: {}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
37
42
|
|
|
38
43
|
trace.log(this.#mcpClient);
|
|
39
44
|
|
|
40
45
|
this.#mcpClient.connect(transport)
|
|
41
|
-
.then(() => {
|
|
46
|
+
.then( async () => {
|
|
42
47
|
this.#updateStatus("โ
MCP Connected");
|
|
43
48
|
|
|
49
|
+
/**
|
|
44
50
|
// ๐ก [์ ์] notificationHandlers์ ๋ก๊น
๋ฉ์์ง ์์ ํธ๋ค๋ฌ๋ฅผ ๋ฑ๋กํฉ๋๋ค.
|
|
45
51
|
// ํ๋ผ์ด๋น ๋ฉ์๋ ์ ๊ทผ(__privateGet) ํ์ ์์ด public ์ธํฐํ์ด์ค๋ก ์ ๊ณต๋ฉ๋๋ค.
|
|
46
52
|
this.#mcpClient.setNotificationHandler(
|
|
@@ -56,14 +62,39 @@ export class NineChatManager {
|
|
|
56
62
|
trace.warn("์๋ฆผ ํ์ฑ ์คํจ:", e);
|
|
57
63
|
}
|
|
58
64
|
}
|
|
59
|
-
)
|
|
65
|
+
);*/
|
|
66
|
+
try {
|
|
67
|
+
await this.#mcpClient.request(
|
|
68
|
+
{ method: "logging/setLevel", params: { level: "info" } },
|
|
69
|
+
z.object({}) // ๋น ์๋ต ์คํค๋ง ๊ฐ์ฒด ๊ฒ์ฆ
|
|
70
|
+
);
|
|
71
|
+
trace.log("๐ MCP ๋ก๊น
์ธ์
ํ์ฑํ ์๋ฃ (Level: info)");
|
|
72
|
+
} catch (linkErr) {
|
|
73
|
+
trace.error("โ ๋ก๊น
์ธ์
ํ์ฑํ ์คํจ:", linkErr);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
this.#mcpClient.onnotification = (notification) => {
|
|
77
|
+
trace.log("๐ ์ค์๊ฐ ์๋ฆผ ๋์ฐฉ:", notification);
|
|
78
|
+
// MCP ๊ณต์ ๋ก๊น
๋ฉ์ปค๋์ฆ ํ๋กํ ์ฝ ์ฃผ์
|
|
79
|
+
if (notification?.method === "notifications/logging/message") {
|
|
80
|
+
try {
|
|
81
|
+
trace.log("๐ ์ค์๊ฐ ์๋ฆผ ๋์ฐฉ:", notification);
|
|
82
|
+
const logData = JSON.parse(notification.params.message);
|
|
83
|
+
|
|
84
|
+
if (logData.type === "BRAIN_DECISION") {
|
|
85
|
+
// UI์ ์ค์๊ฐ ์ค๊ฐ ๋ฉ์์ง ๊ฝ๊ธฐ ์ฑ๊ณต!
|
|
86
|
+
//this.#pushMessage('assistant', logData.message);
|
|
87
|
+
}
|
|
88
|
+
} catch (e) {
|
|
89
|
+
trace.warn("์๋ฆผ ๋ด๋ถ JSON ํ์ฑ ์คํจ:", e);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
60
93
|
})
|
|
61
94
|
.catch((err) => {
|
|
62
95
|
trace.error("โ MCP ์ฐ๊ฒฐ ์คํจ", err);
|
|
63
96
|
this.#updateStatus("โ Connection Failed");
|
|
64
97
|
});
|
|
65
|
-
|
|
66
|
-
|
|
67
98
|
}
|
|
68
99
|
|
|
69
100
|
|