@nine-lab/nine-mu 0.1.175 → 0.1.177

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.175",
3
+ "version": "0.1.177",
4
4
  "description": "AI-Driven Full-Stack Code Fabrication Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/nine-mu.umd.js",
@@ -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
+ const res = await fetch(this.#routeUrl);
133
+ if (!res.ok) {
134
+ throw new Error(`HTTP error! status: ${res.status}`);
135
+ }
136
+
137
+ return await res.json();
138
+ }
139
+
140
+
141
+
128
142
  handleChatSubmit = async el => {
129
143
 
130
- const routes = [];
144
+ const routes = this.#getRoutes();
145
+
146
+ trace.log(routes);
131
147
 
132
148
  return await this.#callTool("system-brain", {
133
149
  user_input : el.value.trim(),