@nine-lab/nine-mu 0.1.212 β 0.1.214
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 +21 -9
- 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/NineChat.js +28 -2
- package/src/components/NineChatManager.js +3 -15
package/dist/nine-mu.js
CHANGED
|
@@ -17169,8 +17169,8 @@ connect_fn = async function() {
|
|
|
17169
17169
|
// π κ»λ°κΈ° ν΅κ³Όμ© 컀μ€ν
μ€ν€λ§
|
|
17170
17170
|
(notification) => {
|
|
17171
17171
|
trace.log(notification);
|
|
17172
|
-
|
|
17173
|
-
this.
|
|
17172
|
+
__privateGet(this, _owner).addMessage("ai", notification.params.message);
|
|
17173
|
+
__privateGet(this, _owner).addMessage("ing", "");
|
|
17174
17174
|
}
|
|
17175
17175
|
);
|
|
17176
17176
|
}).catch((err) => {
|
|
@@ -17289,6 +17289,9 @@ class NineChat extends HTMLElement {
|
|
|
17289
17289
|
__privateAdd(this, _connectorUrl);
|
|
17290
17290
|
__privateAdd(this, _manager);
|
|
17291
17291
|
__privateAdd(this, _$nineChatMessage);
|
|
17292
|
+
__publicField(this, "addMessage", (who, message) => {
|
|
17293
|
+
__privateGet(this, _$nineChatMessage).add(who, message);
|
|
17294
|
+
});
|
|
17292
17295
|
__privateAdd(this, _makeMenuHandler, async (e) => {
|
|
17293
17296
|
const prompt = await nine.prompt("λ©λ΄μμ±μ νμν AI ν둬ννΈλ₯Ό μ
λ ₯νμΈμ.").rgb();
|
|
17294
17297
|
if (prompt === null || prompt === void 0) return;
|
|
@@ -17367,6 +17370,7 @@ initInteractions_fn = function() {
|
|
|
17367
17370
|
// --- [κ·Έλ£Ή 2: Action] μν°ν€ μ
λ ₯ μ μλΉμ€ νΈμΆ ---
|
|
17368
17371
|
initActions_fn = function() {
|
|
17369
17372
|
this.shadowRoot.querySelector("#q").addEventListener("keypress", async (e) => {
|
|
17373
|
+
var _a2, _b, _c, _d;
|
|
17370
17374
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
17371
17375
|
e.preventDefault();
|
|
17372
17376
|
const target = e.target;
|
|
@@ -17386,8 +17390,16 @@ initActions_fn = function() {
|
|
|
17386
17390
|
__privateGet(this, _$nineChatMessage).add("ai", err.message || "μ μ μλ μ€λ₯κ° λ°μνμ΅λλ€. λ€μ μλν΄μ£ΌμΈμ.");
|
|
17387
17391
|
} else {
|
|
17388
17392
|
trace.log(result);
|
|
17389
|
-
|
|
17390
|
-
|
|
17393
|
+
try {
|
|
17394
|
+
const rawText = (_b = (_a2 = result == null ? void 0 : result.content) == null ? void 0 : _a2[0]) == null ? void 0 : _b.text;
|
|
17395
|
+
const parsedData = JSON.parse(rawText);
|
|
17396
|
+
const aiMessage = parsedData.message || "μ²λ¦¬κ° μλ£λμμ΅λλ€.";
|
|
17397
|
+
__privateGet(this, _manager).addChatHistory(aiMessage);
|
|
17398
|
+
__privateGet(this, _$nineChatMessage).add("ai", aiMessage);
|
|
17399
|
+
} catch (parseErr) {
|
|
17400
|
+
const fallbackMessage = ((_d = (_c = result == null ? void 0 : result.content) == null ? void 0 : _c[0]) == null ? void 0 : _d.text) || "μλ΅ λ°μ΄ν°λ₯Ό ν΄μνμ§ λͺ»νμ΅λλ€.";
|
|
17401
|
+
__privateGet(this, _$nineChatMessage).add("ai", fallbackMessage);
|
|
17402
|
+
}
|
|
17391
17403
|
}
|
|
17392
17404
|
}
|
|
17393
17405
|
});
|
|
@@ -17397,7 +17409,7 @@ render_fn = function() {
|
|
|
17397
17409
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
17398
17410
|
this.shadowRoot.innerHTML = `
|
|
17399
17411
|
<style>
|
|
17400
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
17412
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.213"}/dist/css/nine-mu.css";
|
|
17401
17413
|
${customImport}
|
|
17402
17414
|
</style>
|
|
17403
17415
|
<div class="wrapper">
|
|
@@ -43616,7 +43628,7 @@ class NineDiff extends HTMLElement {
|
|
|
43616
43628
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
43617
43629
|
this.shadowRoot.innerHTML = `
|
|
43618
43630
|
<style>
|
|
43619
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
43631
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.213"}/dist/css/nine-mu.css";
|
|
43620
43632
|
${customImport}
|
|
43621
43633
|
</style>
|
|
43622
43634
|
|
|
@@ -43726,7 +43738,7 @@ render_fn2 = function() {
|
|
|
43726
43738
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
43727
43739
|
this.shadowRoot.innerHTML = `
|
|
43728
43740
|
<style>
|
|
43729
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
43741
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.213"}/dist/css/nine-mu.css";
|
|
43730
43742
|
${customImport}
|
|
43731
43743
|
</style>
|
|
43732
43744
|
|
|
@@ -44053,7 +44065,7 @@ class ChatMessageBody extends HTMLElement {
|
|
|
44053
44065
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
44054
44066
|
this.shadowRoot.innerHTML = `
|
|
44055
44067
|
<style>
|
|
44056
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
44068
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.213"}/dist/css/nine-mu.css";
|
|
44057
44069
|
${customImport}
|
|
44058
44070
|
</style>
|
|
44059
44071
|
|
|
@@ -44147,7 +44159,7 @@ if (!customElements.get("nine-chat-progress")) {
|
|
|
44147
44159
|
customElements.define("nine-chat-progress", ProgressMessage);
|
|
44148
44160
|
}
|
|
44149
44161
|
const NineMu = {
|
|
44150
|
-
version: "0.1.
|
|
44162
|
+
version: "0.1.213",
|
|
44151
44163
|
init: (config2) => {
|
|
44152
44164
|
trace$1.log("π οΈ Nine-Mu Engine initialized", config2);
|
|
44153
44165
|
}
|