@nine-lab/nine-mu 0.1.401 → 0.1.403
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 +103 -13
- 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/ai/NineNatualQuery.js +1 -1
- package/src/index.js +1 -1
package/dist/nine-mu.js
CHANGED
|
@@ -9,7 +9,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
|
-
var _owner, _collectedFiles, _NotificationHandler_instances, handleLoggingMessage_fn, _collectModifySource, _openDiffPopup, _openRouteDiffPopup, _generateSource, _generateMenu, _mcpClient, _onAction, _onStatus, _onMessage, _owner2, _routeUrl, _chatHistory, _notiHandler, _NineChatManager_instances, connect_fn, updateStatus_fn, callTool_fn, _getSourcePath, _service, _packageName, _routesPath, _connectorUrl, _manager, _config, _$nineChatMessage, _NineChat_instances, initInteractions_fn, initActions_fn, render_fn, _sourceGenHandler, _asisEditorView, _tobeEditorView, _asisEditorEl, _tobeEditorEl, _isDirty, _initialAsisSrc, _initialTobeSrc, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _checkDirtyState, _setupScrollSync, _applyDiffDecorations, _dialog, _tabContainer, _fileList, _host, _NineDiffPopup_instances, renderScaffolding_fn, handleConfirmAll_fn, handleCancel_fn, _dialog2, _diffView, _asisBackup, _host2, _NineMenuDiffPopup_instances, render_fn2, handleConfirm_fn, handleCancel_fn2, _message, _data, _unique, _init, _message2, _init2, _progressData, _progressElements, _animationIntervals, _ProgressMessage_instances, updateCurrentActiveProgress_fn, renderProgress_fn, updateProgressItemVisuals_fn, startAnimation_fn, updateProgressItem_fn, _renderer, _init3;
|
|
12
|
+
var _owner, _collectedFiles, _NotificationHandler_instances, handleLoggingMessage_fn, _collectModifySource, _openDiffPopup, _openRouteDiffPopup, _generateSource, _generateMenu, _mcpClient, _onAction, _onStatus, _onMessage, _owner2, _routeUrl, _chatHistory, _notiHandler, _NineChatManager_instances, connect_fn, updateStatus_fn, callTool_fn, _getSourcePath, _service, _packageName, _routesPath, _connectorUrl, _manager, _config, _$nineChatMessage, _NineChat_instances, initInteractions_fn, initActions_fn, render_fn, _sourceGenHandler, _asisEditorView, _tobeEditorView, _asisEditorEl, _tobeEditorEl, _isDirty, _initialAsisSrc, _initialTobeSrc, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _checkDirtyState, _setupScrollSync, _applyDiffDecorations, _dialog, _tabContainer, _fileList, _host, _NineDiffPopup_instances, renderScaffolding_fn, handleConfirmAll_fn, handleCancel_fn, _dialog2, _diffView, _asisBackup, _host2, _NineMenuDiffPopup_instances, render_fn2, handleConfirm_fn, handleCancel_fn2, _message, _data, _unique, _init, _message2, _init2, _progressData, _progressElements, _animationIntervals, _ProgressMessage_instances, updateCurrentActiveProgress_fn, renderProgress_fn, updateProgressItemVisuals_fn, startAnimation_fn, updateProgressItem_fn, _renderer, _init3, _schema, _connectorUrl2, _aiProcessor, _tipPopup, _NineNatualQuery_instances, runQuery_fn, render_fn3, handleQuestion_fn;
|
|
13
13
|
import { trace as trace$1, api, nine as nine$1 } from "@nine-lab/nine-util";
|
|
14
14
|
import React, { createContext, Suspense, useContext, useState, lazy } from "react";
|
|
15
15
|
import { Routes, Route } from "react-router-dom";
|
|
@@ -13604,9 +13604,9 @@ function requireCore$1() {
|
|
|
13604
13604
|
}
|
|
13605
13605
|
const { loadSchema } = this.opts;
|
|
13606
13606
|
return runCompileAsync.call(this, schema, meta2);
|
|
13607
|
-
async function runCompileAsync(
|
|
13608
|
-
await loadMetaSchema.call(this,
|
|
13609
|
-
const sch = this._addSchema(
|
|
13607
|
+
async function runCompileAsync(_schema2, _meta) {
|
|
13608
|
+
await loadMetaSchema.call(this, _schema2.$schema);
|
|
13609
|
+
const sch = this._addSchema(_schema2, _meta);
|
|
13610
13610
|
return sch.validate || _compileAsync.call(this, sch);
|
|
13611
13611
|
}
|
|
13612
13612
|
async function loadMetaSchema($ref) {
|
|
@@ -13631,11 +13631,11 @@ function requireCore$1() {
|
|
|
13631
13631
|
}
|
|
13632
13632
|
}
|
|
13633
13633
|
async function loadMissingSchema(ref2) {
|
|
13634
|
-
const
|
|
13634
|
+
const _schema2 = await _loadSchema.call(this, ref2);
|
|
13635
13635
|
if (!this.refs[ref2])
|
|
13636
|
-
await loadMetaSchema.call(this,
|
|
13636
|
+
await loadMetaSchema.call(this, _schema2.$schema);
|
|
13637
13637
|
if (!this.refs[ref2])
|
|
13638
|
-
this.addSchema(
|
|
13638
|
+
this.addSchema(_schema2, ref2, meta2);
|
|
13639
13639
|
}
|
|
13640
13640
|
async function _loadSchema(ref2) {
|
|
13641
13641
|
const p = this._loading[ref2];
|
|
@@ -17539,7 +17539,7 @@ render_fn = function() {
|
|
|
17539
17539
|
const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
|
|
17540
17540
|
this.shadowRoot.innerHTML = `
|
|
17541
17541
|
<style>
|
|
17542
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
17542
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.402"}/dist/css/nine-mu.css";
|
|
17543
17543
|
${customImport}
|
|
17544
17544
|
</style>
|
|
17545
17545
|
<div class="wrapper">
|
|
@@ -43789,7 +43789,7 @@ class NineDiff extends HTMLElement {
|
|
|
43789
43789
|
const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-mu.css";` : "";
|
|
43790
43790
|
this.shadowRoot.innerHTML = `
|
|
43791
43791
|
<style>
|
|
43792
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
43792
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.402"}/dist/css/nine-mu.css";
|
|
43793
43793
|
${customImport}
|
|
43794
43794
|
</style>
|
|
43795
43795
|
|
|
@@ -43929,7 +43929,7 @@ renderScaffolding_fn = function() {
|
|
|
43929
43929
|
const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
|
|
43930
43930
|
this.shadowRoot.innerHTML = `
|
|
43931
43931
|
<style>
|
|
43932
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
43932
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.402"}/dist/css/nine-mu.css";
|
|
43933
43933
|
${customImport}
|
|
43934
43934
|
</style>
|
|
43935
43935
|
|
|
@@ -44038,7 +44038,7 @@ render_fn2 = function() {
|
|
|
44038
44038
|
const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
|
|
44039
44039
|
this.shadowRoot.innerHTML = `
|
|
44040
44040
|
<style>
|
|
44041
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
44041
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.402"}/dist/css/nine-mu.css";
|
|
44042
44042
|
${customImport}
|
|
44043
44043
|
</style>
|
|
44044
44044
|
|
|
@@ -44368,7 +44368,7 @@ class ChatMessageBody extends HTMLElement {
|
|
|
44368
44368
|
const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-mu.css";` : "";
|
|
44369
44369
|
this.shadowRoot.innerHTML = `
|
|
44370
44370
|
<style>
|
|
44371
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
44371
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.402"}/dist/css/nine-mu.css";
|
|
44372
44372
|
${customImport}
|
|
44373
44373
|
</style>
|
|
44374
44374
|
|
|
@@ -44466,6 +44466,96 @@ if (!customElements.get("nine-chat-ing")) {
|
|
|
44466
44466
|
if (!customElements.get("nine-chat-progress")) {
|
|
44467
44467
|
customElements.define("nine-chat-progress", ProgressMessage);
|
|
44468
44468
|
}
|
|
44469
|
+
class NineNatualQuery extends HTMLElement {
|
|
44470
|
+
constructor() {
|
|
44471
|
+
super();
|
|
44472
|
+
__privateAdd(this, _NineNatualQuery_instances);
|
|
44473
|
+
__privateAdd(this, _schema, null);
|
|
44474
|
+
__privateAdd(this, _connectorUrl2, "");
|
|
44475
|
+
__privateAdd(this, _aiProcessor, null);
|
|
44476
|
+
__privateAdd(this, _tipPopup);
|
|
44477
|
+
this.attachShadow({ mode: "open" });
|
|
44478
|
+
}
|
|
44479
|
+
async connectedCallback() {
|
|
44480
|
+
__privateSet(this, _connectorUrl2, this.getAttribute("connector-url") || "http://localhost:3001");
|
|
44481
|
+
__privateMethod(this, _NineNatualQuery_instances, render_fn3).call(this);
|
|
44482
|
+
}
|
|
44483
|
+
}
|
|
44484
|
+
_schema = new WeakMap();
|
|
44485
|
+
_connectorUrl2 = new WeakMap();
|
|
44486
|
+
_aiProcessor = new WeakMap();
|
|
44487
|
+
_tipPopup = new WeakMap();
|
|
44488
|
+
_NineNatualQuery_instances = new WeakSet();
|
|
44489
|
+
runQuery_fn = async function(sql) {
|
|
44490
|
+
try {
|
|
44491
|
+
trace.log("🚀 쿼리 실행 요청:", sql);
|
|
44492
|
+
const response = await fetch(`${__privateGet(this, _connectorUrl2)}/api/query`, {
|
|
44493
|
+
method: "POST",
|
|
44494
|
+
headers: { "Content-Type": "application/json" },
|
|
44495
|
+
body: JSON.stringify({ sql })
|
|
44496
|
+
});
|
|
44497
|
+
trace.log(response);
|
|
44498
|
+
if (!response.ok) throw new Error("쿼리 실행 실패");
|
|
44499
|
+
const result = await response.json();
|
|
44500
|
+
if (result.success) {
|
|
44501
|
+
trace.log("✅ 쿼리 실행 결과:", result.data);
|
|
44502
|
+
return result.data;
|
|
44503
|
+
} else {
|
|
44504
|
+
throw new Error(result.error || "쿼리 실행 중 오류 발생");
|
|
44505
|
+
}
|
|
44506
|
+
} catch (error) {
|
|
44507
|
+
trace.error("❌ 쿼리 실행 실패:", error.message);
|
|
44508
|
+
}
|
|
44509
|
+
};
|
|
44510
|
+
render_fn3 = function() {
|
|
44511
|
+
const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-mu.css";` : "";
|
|
44512
|
+
this.shadowRoot.innerHTML = `
|
|
44513
|
+
<style>
|
|
44514
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.402"}/dist/css/nine-mu.css";
|
|
44515
|
+
${customImport}
|
|
44516
|
+
</style>
|
|
44517
|
+
|
|
44518
|
+
<div class="input-wrapper">
|
|
44519
|
+
<input type="text" placeholder="자연어로 질문을 입력하고 엔터를 누르세요.">
|
|
44520
|
+
<!-- CSS로 제어되는 워터마크 -->
|
|
44521
|
+
<a href="https://www.nine-lab.com" target="_blank" class="watermark-link">powered by nine-lab.com</a>
|
|
44522
|
+
</div>
|
|
44523
|
+
`;
|
|
44524
|
+
const input = this.shadowRoot.querySelector("input");
|
|
44525
|
+
if (customElements.get("nine-ai-tip-popup")) {
|
|
44526
|
+
__privateSet(this, _tipPopup, document.createElement("nine-ai-tip-popup"));
|
|
44527
|
+
this.shadowRoot.appendChild(__privateGet(this, _tipPopup));
|
|
44528
|
+
} else {
|
|
44529
|
+
trace.error("nine-ai-tip-popup 컴포넌트를 찾을 수 없습니다.");
|
|
44530
|
+
}
|
|
44531
|
+
input.addEventListener("keypress", (e) => {
|
|
44532
|
+
if (e.key === "Enter") {
|
|
44533
|
+
const question2 = e.target.value.trim();
|
|
44534
|
+
if (question2) {
|
|
44535
|
+
__privateMethod(this, _NineNatualQuery_instances, handleQuestion_fn).call(this, question2);
|
|
44536
|
+
e.target.value = "";
|
|
44537
|
+
}
|
|
44538
|
+
}
|
|
44539
|
+
});
|
|
44540
|
+
};
|
|
44541
|
+
handleQuestion_fn = async function(question2) {
|
|
44542
|
+
var _a2, _b;
|
|
44543
|
+
try {
|
|
44544
|
+
await ((_a2 = __privateGet(this, _tipPopup)) == null ? void 0 : _a2.popup());
|
|
44545
|
+
const response = await api.post(`/nine-mu/query/executeNaturalLanguageQuery`, {
|
|
44546
|
+
userInput: question2
|
|
44547
|
+
});
|
|
44548
|
+
trace.log(response);
|
|
44549
|
+
} catch (error) {
|
|
44550
|
+
trace.error("서버 통신 실패:", error);
|
|
44551
|
+
nine.alert("서버와 연결할 수 없습니다.").rgb().shake();
|
|
44552
|
+
} finally {
|
|
44553
|
+
(_b = __privateGet(this, _tipPopup)) == null ? void 0 : _b.close();
|
|
44554
|
+
}
|
|
44555
|
+
};
|
|
44556
|
+
if (!customElements.get("nine-natual-query")) {
|
|
44557
|
+
customElements.define("nine-natual-query", NineNatualQuery);
|
|
44558
|
+
}
|
|
44469
44559
|
const ScreenContext = createContext();
|
|
44470
44560
|
const useScreen = () => useContext(ScreenContext);
|
|
44471
44561
|
const ScreenProvider = ({ children }) => {
|
|
@@ -44681,7 +44771,7 @@ function NineHook({ children, menuData, views, error404, onCatch, fallback, styl
|
|
|
44681
44771
|
);
|
|
44682
44772
|
}
|
|
44683
44773
|
const NineMu = {
|
|
44684
|
-
version: "0.1.
|
|
44774
|
+
version: "0.1.402",
|
|
44685
44775
|
init: (config2) => {
|
|
44686
44776
|
trace$1.log("🛠️ Nine-Mu Engine initialized", config2);
|
|
44687
44777
|
}
|