@nine-lab/nine-mu 0.1.367 → 0.1.368
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 +53 -127
- 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/exception/NineHook.js +160 -0
- package/src/index.js +2 -2
- package/src/components/exception/ExceptionHook.js +0 -266
package/dist/nine-mu.js
CHANGED
|
@@ -11,7 +11,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
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;
|
|
13
13
|
import { trace as trace$1, api, nine as nine$1 } from "@nine-lab/nine-util";
|
|
14
|
-
import React from "react";
|
|
14
|
+
import React, { createContext, useState } from "react";
|
|
15
15
|
class Trace extends trace$1.constructor {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
@@ -17538,7 +17538,7 @@ render_fn = function() {
|
|
|
17538
17538
|
const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
|
|
17539
17539
|
this.shadowRoot.innerHTML = `
|
|
17540
17540
|
<style>
|
|
17541
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
17541
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.367"}/dist/css/nine-mu.css";
|
|
17542
17542
|
${customImport}
|
|
17543
17543
|
</style>
|
|
17544
17544
|
<div class="wrapper">
|
|
@@ -43788,7 +43788,7 @@ class NineDiff extends HTMLElement {
|
|
|
43788
43788
|
const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-mu.css";` : "";
|
|
43789
43789
|
this.shadowRoot.innerHTML = `
|
|
43790
43790
|
<style>
|
|
43791
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
43791
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.367"}/dist/css/nine-mu.css";
|
|
43792
43792
|
${customImport}
|
|
43793
43793
|
</style>
|
|
43794
43794
|
|
|
@@ -43928,7 +43928,7 @@ renderScaffolding_fn = function() {
|
|
|
43928
43928
|
const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
|
|
43929
43929
|
this.shadowRoot.innerHTML = `
|
|
43930
43930
|
<style>
|
|
43931
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
43931
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.367"}/dist/css/nine-mu.css";
|
|
43932
43932
|
${customImport}
|
|
43933
43933
|
</style>
|
|
43934
43934
|
|
|
@@ -44037,7 +44037,7 @@ render_fn2 = function() {
|
|
|
44037
44037
|
const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
|
|
44038
44038
|
this.shadowRoot.innerHTML = `
|
|
44039
44039
|
<style>
|
|
44040
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
44040
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.367"}/dist/css/nine-mu.css";
|
|
44041
44041
|
${customImport}
|
|
44042
44042
|
</style>
|
|
44043
44043
|
|
|
@@ -44367,7 +44367,7 @@ class ChatMessageBody extends HTMLElement {
|
|
|
44367
44367
|
const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-mu.css";` : "";
|
|
44368
44368
|
this.shadowRoot.innerHTML = `
|
|
44369
44369
|
<style>
|
|
44370
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
44370
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.367"}/dist/css/nine-mu.css";
|
|
44371
44371
|
${customImport}
|
|
44372
44372
|
</style>
|
|
44373
44373
|
|
|
@@ -44465,6 +44465,20 @@ if (!customElements.get("nine-chat-ing")) {
|
|
|
44465
44465
|
if (!customElements.get("nine-chat-progress")) {
|
|
44466
44466
|
customElements.define("nine-chat-progress", ProgressMessage);
|
|
44467
44467
|
}
|
|
44468
|
+
const ScreenContext = createContext();
|
|
44469
|
+
const ScreenProvider = ({ children }) => {
|
|
44470
|
+
const [activeView, setActiveView] = useState("list-wrapper");
|
|
44471
|
+
const [selectedData, setSelectedData] = useState(null);
|
|
44472
|
+
const goto = (selector, data) => {
|
|
44473
|
+
setActiveView(selector);
|
|
44474
|
+
if (data) setSelectedData(data);
|
|
44475
|
+
};
|
|
44476
|
+
return React.createElement(
|
|
44477
|
+
ScreenContext.Provider,
|
|
44478
|
+
{ value: { activeView, selectedData, goto } },
|
|
44479
|
+
children
|
|
44480
|
+
);
|
|
44481
|
+
};
|
|
44468
44482
|
const NineExceptionStyles = {
|
|
44469
44483
|
container: {
|
|
44470
44484
|
minHeight: "100%",
|
|
@@ -44478,70 +44492,19 @@ const NineExceptionStyles = {
|
|
|
44478
44492
|
display: "flex",
|
|
44479
44493
|
flexDirection: "column",
|
|
44480
44494
|
gap: "10px",
|
|
44481
|
-
// ⭐ 수정: 아까 보기 좋았던 넉넉하고 정돈된 줄간격 비율로 복구
|
|
44482
44495
|
lineHeight: "1.5"
|
|
44483
44496
|
},
|
|
44484
|
-
|
|
44485
|
-
|
|
44486
|
-
|
|
44487
|
-
|
|
44488
|
-
|
|
44489
|
-
|
|
44490
|
-
display: "block"
|
|
44491
|
-
},
|
|
44492
|
-
// 2. 에러 본문 텍스트도 불필요한 속성을 다 버리고 일반 라인과 똑같이 흐르게 교정
|
|
44493
|
-
pre: {
|
|
44494
|
-
background: "transparent",
|
|
44495
|
-
color: "#666",
|
|
44496
|
-
// aa is not defined는 요청하신 #666 적용
|
|
44497
|
-
padding: "0",
|
|
44498
|
-
margin: "0",
|
|
44499
|
-
border: "none",
|
|
44500
|
-
overflowX: "auto",
|
|
44501
|
-
whiteSpace: "pre-wrap",
|
|
44502
|
-
fontFamily: "inherit",
|
|
44503
|
-
// 부모 폰트 그대로 상속
|
|
44504
|
-
fontSize: "inherit",
|
|
44505
|
-
// 부모 크기 그대로 상속
|
|
44506
|
-
display: "block"
|
|
44507
|
-
},
|
|
44508
|
-
// 3. 에러 위치 추적 라인
|
|
44509
|
-
locationRow: {
|
|
44510
|
-
color: "#999",
|
|
44511
|
-
margin: "0",
|
|
44512
|
-
padding: "0",
|
|
44513
|
-
display: "block",
|
|
44514
|
-
fontFamily: "inherit",
|
|
44515
|
-
fontSize: "inherit"
|
|
44516
|
-
},
|
|
44517
|
-
// 4. 하단 영역의 flex와 gap을 완전히 제거하여 줄간격 왜곡 원천 차단
|
|
44518
|
-
footer: {
|
|
44519
|
-
margin: "0",
|
|
44520
|
-
padding: "0",
|
|
44521
|
-
display: "none"
|
|
44522
|
-
},
|
|
44523
|
-
promptRow: {
|
|
44524
|
-
margin: "0",
|
|
44525
|
-
padding: "0",
|
|
44526
|
-
display: "block",
|
|
44527
|
-
color: "#999"
|
|
44528
|
-
},
|
|
44529
|
-
cliLink: {
|
|
44530
|
-
color: "#38A169",
|
|
44531
|
-
// y 링크 터미널 그린
|
|
44532
|
-
padding: "0",
|
|
44533
|
-
fontFamily: "inherit",
|
|
44534
|
-
fontSize: "inherit",
|
|
44535
|
-
fontWeight: "bold",
|
|
44536
|
-
cursor: "pointer",
|
|
44537
|
-
textDecoration: "underline",
|
|
44538
|
-
textUnderlineOffset: "3px"
|
|
44539
|
-
}
|
|
44497
|
+
systemError: { color: "#999", fontWeight: "bold", margin: "0", padding: "0", display: "block" },
|
|
44498
|
+
pre: { background: "transparent", color: "#666", padding: "0", margin: "0", border: "none", overflowX: "auto", whiteSpace: "pre-wrap", fontFamily: "inherit", fontSize: "inherit", display: "block" },
|
|
44499
|
+
locationRow: { color: "#999", margin: "0", padding: "0", display: "block", fontFamily: "inherit", fontSize: "inherit" },
|
|
44500
|
+
footer: { margin: "0", padding: "0", display: "none" },
|
|
44501
|
+
promptRow: { margin: "0", padding: "0", display: "block", color: "#999" },
|
|
44502
|
+
cliLink: { color: "#38A169", padding: "0", fontFamily: "inherit", fontSize: "inherit", fontWeight: "bold", cursor: "pointer", textDecoration: "underline", textUnderlineOffset: "3px" }
|
|
44540
44503
|
};
|
|
44541
44504
|
class NineExceptionHook extends React.Component {
|
|
44542
44505
|
constructor(props) {
|
|
44543
44506
|
super(props);
|
|
44544
|
-
this.state = { hasError: false, error: null, reportStatus: "idle" };
|
|
44507
|
+
this.state = { hasError: false, error: null, reportStatus: "idle", errorInfo: null };
|
|
44545
44508
|
this.lastPath = window.location.pathname;
|
|
44546
44509
|
this.handleLocationChange = this.handleLocationChange.bind(this);
|
|
44547
44510
|
this.handleReport = this.handleReport.bind(this);
|
|
@@ -44551,13 +44514,8 @@ class NineExceptionHook extends React.Component {
|
|
|
44551
44514
|
return { hasError: true, error, reportStatus: "idle" };
|
|
44552
44515
|
}
|
|
44553
44516
|
componentDidCatch(error, errorInfo) {
|
|
44554
|
-
|
|
44555
|
-
this.
|
|
44556
|
-
errorInfo: errorInfo || null
|
|
44557
|
-
});
|
|
44558
|
-
if (this.props.onCatch) {
|
|
44559
|
-
this.props.onCatch(error, errorInfo);
|
|
44560
|
-
}
|
|
44517
|
+
this.setState({ errorInfo: errorInfo || null });
|
|
44518
|
+
if (this.props.onCatch) this.props.onCatch(error, errorInfo);
|
|
44561
44519
|
}
|
|
44562
44520
|
componentDidMount() {
|
|
44563
44521
|
window.addEventListener("popstate", this.handleLocationChange);
|
|
@@ -44580,9 +44538,8 @@ class NineExceptionHook extends React.Component {
|
|
|
44580
44538
|
handleLocationChange() {
|
|
44581
44539
|
setTimeout(() => {
|
|
44582
44540
|
if (this.state.hasError && this.lastPath !== window.location.pathname) {
|
|
44583
|
-
console.log("[Nine-Library] 페이지 주소 변경 감지 -> 에러 상태 초기화");
|
|
44584
44541
|
this.lastPath = window.location.pathname;
|
|
44585
|
-
this.setState({ hasError: false, error: null, reportStatus: "idle" });
|
|
44542
|
+
this.setState({ hasError: false, error: null, reportStatus: "idle", errorInfo: null });
|
|
44586
44543
|
}
|
|
44587
44544
|
}, 10);
|
|
44588
44545
|
}
|
|
@@ -44592,20 +44549,14 @@ class NineExceptionHook extends React.Component {
|
|
|
44592
44549
|
this.setState({ reportStatus: "sending" });
|
|
44593
44550
|
const errorMessage = ((_a2 = this.state.error) == null ? void 0 : _a2.message) || String(this.state.error);
|
|
44594
44551
|
setTimeout(() => {
|
|
44595
|
-
if (window.triggerAutoRecovery)
|
|
44596
|
-
window.triggerAutoRecovery(errorMessage);
|
|
44597
|
-
} else {
|
|
44598
|
-
console.warn("[Nine-Library] window.triggerAutoRecovery 가 정의되지 않았습니다.");
|
|
44599
|
-
}
|
|
44552
|
+
if (window.triggerAutoRecovery) window.triggerAutoRecovery(errorMessage);
|
|
44600
44553
|
this.setState({ reportStatus: "success" });
|
|
44601
44554
|
}, 600);
|
|
44602
44555
|
}
|
|
44603
44556
|
render() {
|
|
44604
44557
|
var _a2;
|
|
44605
44558
|
if (this.state.hasError) {
|
|
44606
|
-
if (this.props.fallback)
|
|
44607
|
-
return this.props.fallback(this.state.error);
|
|
44608
|
-
}
|
|
44559
|
+
if (this.props.fallback) return this.props.fallback(this.state.error);
|
|
44609
44560
|
let errorMessage = "";
|
|
44610
44561
|
if (this.state.error) {
|
|
44611
44562
|
const errorName = this.state.error.name ? `[${this.state.error.name}] ` : "";
|
|
@@ -44638,60 +44589,35 @@ class NineExceptionHook extends React.Component {
|
|
|
44638
44589
|
}
|
|
44639
44590
|
return React.createElement(
|
|
44640
44591
|
"div",
|
|
44641
|
-
{
|
|
44642
|
-
|
|
44643
|
-
},
|
|
44644
|
-
|
|
44592
|
+
{ style: { ...NineExceptionStyles.container, ...customStyles.container, ...this.props.containerStyle } },
|
|
44593
|
+
React.createElement("div", { style: NineExceptionStyles.systemError }, "[SYSTEM] Component render error detected."),
|
|
44594
|
+
React.createElement("pre", { style: NineExceptionStyles.pre }, errorMessage),
|
|
44595
|
+
errorLocation && React.createElement("div", { style: NineExceptionStyles.locationRow }, errorLocation),
|
|
44645
44596
|
React.createElement(
|
|
44646
44597
|
"div",
|
|
44647
|
-
{ style:
|
|
44648
|
-
"
|
|
44649
|
-
|
|
44650
|
-
|
|
44651
|
-
React.createElement("pre", { style: { ...NineExceptionStyles.pre, ...customStyles.pre } }, errorMessage),
|
|
44652
|
-
// 3. 파싱된 에러 발생 파일명 및 라인 위치
|
|
44653
|
-
errorLocation && React.createElement(
|
|
44654
|
-
"div",
|
|
44655
|
-
{ style: { ...NineExceptionStyles.locationRow, ...customStyles.locationRow } },
|
|
44656
|
-
errorLocation
|
|
44657
|
-
),
|
|
44658
|
-
// 4. CLI 프롬프트 영역
|
|
44659
|
-
React.createElement(
|
|
44660
|
-
"div",
|
|
44661
|
-
{ style: { ...NineExceptionStyles.footer, ...customStyles.footer } },
|
|
44662
|
-
this.state.reportStatus === "idle" && React.createElement(
|
|
44663
|
-
"div",
|
|
44664
|
-
{ style: { ...NineExceptionStyles.promptRow, ...customStyles.promptRow } },
|
|
44665
|
-
React.createElement("span", null, "Send error log to Control Tower ("),
|
|
44666
|
-
React.createElement(
|
|
44667
|
-
"span",
|
|
44668
|
-
{
|
|
44669
|
-
style: { ...NineExceptionStyles.cliLink, ...customStyles.cliLink },
|
|
44670
|
-
onClick: this.handleReport
|
|
44671
|
-
},
|
|
44672
|
-
"y"
|
|
44673
|
-
),
|
|
44674
|
-
React.createElement("span", null, "/n)?")
|
|
44675
|
-
),
|
|
44676
|
-
this.state.reportStatus === "sending" && React.createElement(
|
|
44677
|
-
"div",
|
|
44678
|
-
{ style: { color: "#ED8936", margin: "0" } },
|
|
44679
|
-
">> Connecting to Control Tower... Sending payload."
|
|
44680
|
-
),
|
|
44681
|
-
this.state.reportStatus === "success" && React.createElement(
|
|
44682
|
-
"div",
|
|
44683
|
-
{ style: { display: "flex", flexDirection: "column", gap: "12px", margin: "0" } },
|
|
44684
|
-
React.createElement("div", { style: { color: "#38A169", fontWeight: "bold" } }, ">> Transmit complete. Core engine initialized."),
|
|
44685
|
-
React.createElement("div", { style: { color: "#A0AEC0", fontStyle: "italic", fontSize: "13px" } }, "AI가 소스 코드를 재수정하는 동안 잠시만 기다려주세요...")
|
|
44686
|
-
)
|
|
44598
|
+
{ style: NineExceptionStyles.footer },
|
|
44599
|
+
this.state.reportStatus === "idle" && React.createElement("div", { style: NineExceptionStyles.promptRow }, "Send error log to Control Tower (", React.createElement("span", { style: NineExceptionStyles.cliLink, onClick: this.handleReport }, "y"), "/n)?"),
|
|
44600
|
+
this.state.reportStatus === "sending" && React.createElement("div", { style: { color: "#ED8936" } }, ">> Connecting to Control Tower... Sending payload."),
|
|
44601
|
+
this.state.reportStatus === "success" && React.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "12px" } }, React.createElement("div", { style: { color: "#38A169", fontWeight: "bold" } }, ">> Transmit complete. Core engine initialized."), React.createElement("div", { style: { color: "#A0AEC0", fontStyle: "italic", fontSize: "13px" } }, "AI가 소스 코드를 재수정하는 동안 잠시만 기다려주세요..."))
|
|
44687
44602
|
)
|
|
44688
44603
|
);
|
|
44689
44604
|
}
|
|
44690
44605
|
return this.props.children;
|
|
44691
44606
|
}
|
|
44692
44607
|
}
|
|
44608
|
+
function NineHook({ children, onCatch, fallback, styles, containerStyle }) {
|
|
44609
|
+
return React.createElement(
|
|
44610
|
+
ScreenProvider,
|
|
44611
|
+
null,
|
|
44612
|
+
React.createElement(
|
|
44613
|
+
NineExceptionHook,
|
|
44614
|
+
{ onCatch, fallback, styles, containerStyle },
|
|
44615
|
+
children
|
|
44616
|
+
)
|
|
44617
|
+
);
|
|
44618
|
+
}
|
|
44693
44619
|
const NineMu = {
|
|
44694
|
-
version: "0.1.
|
|
44620
|
+
version: "0.1.367",
|
|
44695
44621
|
init: (config2) => {
|
|
44696
44622
|
trace$1.log("🛠️ Nine-Mu Engine initialized", config2);
|
|
44697
44623
|
}
|
|
@@ -44700,7 +44626,7 @@ export {
|
|
|
44700
44626
|
NineChat,
|
|
44701
44627
|
NineDiff,
|
|
44702
44628
|
NineDiffPopup,
|
|
44703
|
-
|
|
44629
|
+
NineHook,
|
|
44704
44630
|
NineMu,
|
|
44705
44631
|
NineMu as default
|
|
44706
44632
|
};
|