@nine-lab/nine-mu 0.1.144 → 0.1.146
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 +26 -18
- 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 +26 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
2
|
import { WebSocketClientTransport } from "@modelcontextprotocol/sdk/client/websocket.js";
|
|
3
|
-
import { trace
|
|
3
|
+
import { trace } from "@nopeer";
|
|
4
4
|
|
|
5
5
|
export class NineChatManager {
|
|
6
6
|
#mcpClient;
|
|
@@ -31,6 +31,7 @@ export class NineChatManager {
|
|
|
31
31
|
name: "nine-mu-client", version: "1.0.0"
|
|
32
32
|
}, { capabilities: { tools: {} } });
|
|
33
33
|
|
|
34
|
+
trace.log(this.#mcpClient);
|
|
34
35
|
|
|
35
36
|
this.#mcpClient.connect(transport)
|
|
36
37
|
.then(() => {
|
|
@@ -120,15 +121,30 @@ export class NineChatManager {
|
|
|
120
121
|
trace.log(`[Status]: ${msg}`);
|
|
121
122
|
}
|
|
122
123
|
|
|
124
|
+
async #callTool(toolName, args = {}) {
|
|
125
|
+
|
|
126
|
+
this.#updateStatus("AI 분석 중...");
|
|
127
|
+
|
|
128
|
+
this.#mcpClient.callTool({ name: toolName, arguments: args })
|
|
129
|
+
.then((res) => {
|
|
130
|
+
trace.log(res);
|
|
131
|
+
//this.#updateStatus("✅ MCP Connected");
|
|
132
|
+
})
|
|
133
|
+
.catch((err) => {
|
|
134
|
+
trace.error(err);
|
|
135
|
+
this.#updateStatus("에러 발생");
|
|
136
|
+
throw err;
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
123
140
|
handleChatSubmit = async el => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
console.log(response);
|
|
141
|
+
|
|
142
|
+
trace.log(this.#mcpClient);
|
|
143
|
+
|
|
144
|
+
this.#callTool("system-brain", {
|
|
145
|
+
user_input : el.value.trim(),
|
|
146
|
+
routes : routes,
|
|
147
|
+
current_path : "/group_member/student_management",
|
|
148
|
+
})
|
|
133
149
|
}
|
|
134
150
|
}
|