@nine-lab/nine-mu 0.1.137 → 0.1.139
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 -30
- package/dist/nine-mu.js.map +1 -1
- package/dist/nine-mu.umd.js +1 -1
- package/dist/nine-mu.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NineChatManager.js +5 -5
package/package.json
CHANGED
|
@@ -4,7 +4,6 @@ import { trace, api, nine } from "@nine-lab/nine-util";
|
|
|
4
4
|
|
|
5
5
|
export class NineChatManager {
|
|
6
6
|
#client;
|
|
7
|
-
#connectorUrl;
|
|
8
7
|
#onAction;
|
|
9
8
|
#onStatus;
|
|
10
9
|
#onMessage; // UI에 메시지를 뿌려줄 콜백 추가
|
|
@@ -12,7 +11,6 @@ export class NineChatManager {
|
|
|
12
11
|
|
|
13
12
|
constructor(owner, callbacks = {}) {
|
|
14
13
|
this.#owner = owner;
|
|
15
|
-
this.#connectorUrl = this.#owner.getAttribute('connector-url');
|
|
16
14
|
|
|
17
15
|
// 콜백 함수들 연결
|
|
18
16
|
this.#onAction = callbacks.onAction;
|
|
@@ -20,13 +18,15 @@ export class NineChatManager {
|
|
|
20
18
|
this.#onMessage = callbacks.onMessage;
|
|
21
19
|
|
|
22
20
|
// 연결 시작 (비동기)
|
|
23
|
-
this
|
|
21
|
+
this.#connect();
|
|
24
22
|
}
|
|
25
23
|
|
|
26
|
-
async connect() {
|
|
24
|
+
async #connect() {
|
|
27
25
|
if (this.#client) return;
|
|
28
26
|
try {
|
|
29
|
-
|
|
27
|
+
const connectorUrl = this.#owner.getAttribute('connector-url');
|
|
28
|
+
|
|
29
|
+
const transport = new WebSocketClientTransport(new URL(connectorUrl));
|
|
30
30
|
this.#client = new Client({
|
|
31
31
|
name: "nine-mu-client", version: "1.0.0"
|
|
32
32
|
}, { capabilities: { tools: {} } });
|