@nine-lab/nine-mu 0.1.174 → 0.1.176
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 +119 -108
- 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 +17 -1
package/package.json
CHANGED
|
@@ -8,10 +8,12 @@ export class NineChatManager {
|
|
|
8
8
|
#onStatus;
|
|
9
9
|
#onMessage; // UI에 메시지를 뿌려줄 콜백 추가
|
|
10
10
|
#owner;
|
|
11
|
+
#routeUrl;
|
|
11
12
|
|
|
12
13
|
constructor(owner, callbacks = {}) {
|
|
13
14
|
this.#owner = owner;
|
|
14
15
|
|
|
16
|
+
this.#routeUrl = this.#owner.getAttribute("route-url");
|
|
15
17
|
// 콜백 함수들 연결
|
|
16
18
|
this.#onAction = callbacks.onAction;
|
|
17
19
|
this.#onStatus = callbacks.onStatus;
|
|
@@ -125,9 +127,23 @@ export class NineChatManager {
|
|
|
125
127
|
return this.#mcpClient.callTool({ name: toolName, arguments: args });
|
|
126
128
|
}
|
|
127
129
|
|
|
130
|
+
async #getRoutes(toolName, args = {}) {
|
|
131
|
+
|
|
132
|
+
console.log(this.#routeUrl);
|
|
133
|
+
|
|
134
|
+
const res = await fetch(this.#routeUrl);
|
|
135
|
+
if (!res.ok) {
|
|
136
|
+
throw new Error(`HTTP error! status: ${r.status}`);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return await res.json();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
128
144
|
handleChatSubmit = async el => {
|
|
129
145
|
|
|
130
|
-
const routes =
|
|
146
|
+
const routes = this.#getRoutes();
|
|
131
147
|
|
|
132
148
|
return await this.#callTool("system-brain", {
|
|
133
149
|
user_input : el.value.trim(),
|