@zhongqian97-code/ecode 0.5.37 → 0.5.38
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/index.js
CHANGED
|
@@ -810,7 +810,7 @@ if (rawArgs[0] === "web") {
|
|
|
810
810
|
webAutoApprove = true;
|
|
811
811
|
}
|
|
812
812
|
}
|
|
813
|
-
const { buildServer, generateAccessToken } = await import("./web-
|
|
813
|
+
const { buildServer, generateAccessToken } = await import("./web-7WWKTWTB.js");
|
|
814
814
|
const token = generateAccessToken();
|
|
815
815
|
const manager = new SessionManager(finalConfig);
|
|
816
816
|
const server = await buildServer({
|
|
@@ -592,6 +592,7 @@ function generateAdminHtml(version) {
|
|
|
592
592
|
status: 'idle', // idle | thinking | tool_calling | awaiting_confirm
|
|
593
593
|
wsRetries: 0,
|
|
594
594
|
streamingMsgEl: null, // DOM element currently receiving delta tokens
|
|
595
|
+
streamingThinkEl: null, // DOM element currently receiving reasoning tokens
|
|
595
596
|
showTools: true,
|
|
596
597
|
skills: [], // cached skills from /api/skills
|
|
597
598
|
skillsLoaded: false,
|
|
@@ -771,6 +772,7 @@ function generateAdminHtml(version) {
|
|
|
771
772
|
'<div class="empty-chat">\u2190 \u52A0\u8F7D\u4F1A\u8BDD\u4E2D\u2026</div>';
|
|
772
773
|
state.messages = [];
|
|
773
774
|
state.streamingMsgEl = null;
|
|
775
|
+
state.streamingThinkEl = null;
|
|
774
776
|
}
|
|
775
777
|
|
|
776
778
|
async function loadMessages(sessionId) {
|
|
@@ -824,6 +826,7 @@ function generateAdminHtml(version) {
|
|
|
824
826
|
if (body) body.classList.remove('cursor-blink');
|
|
825
827
|
state.streamingMsgEl = null;
|
|
826
828
|
}
|
|
829
|
+
state.streamingThinkEl = null;
|
|
827
830
|
}
|
|
828
831
|
|
|
829
832
|
// \u2500\u2500 WebSocket \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
@@ -935,14 +938,20 @@ function generateAdminHtml(version) {
|
|
|
935
938
|
finalizeStreamingMsg();
|
|
936
939
|
setStatus('idle');
|
|
937
940
|
} else if (type === 'message.reasoning') {
|
|
941
|
+
const token = msg.reasoning || msg.text || '';
|
|
938
942
|
const msgsEl = document.getElementById('messages');
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
943
|
+
if (!state.streamingThinkEl) {
|
|
944
|
+
const placeholder = msgsEl.querySelector('.empty-chat');
|
|
945
|
+
if (placeholder) placeholder.remove();
|
|
946
|
+
const thinkEl = document.createElement('div');
|
|
947
|
+
thinkEl.className = 'thinking-block';
|
|
948
|
+
thinkEl.textContent = token;
|
|
949
|
+
if (!state.showTools) thinkEl.style.display = 'none';
|
|
950
|
+
msgsEl.appendChild(thinkEl);
|
|
951
|
+
state.streamingThinkEl = thinkEl;
|
|
952
|
+
} else {
|
|
953
|
+
state.streamingThinkEl.textContent += token;
|
|
954
|
+
}
|
|
946
955
|
msgsEl.scrollTop = msgsEl.scrollHeight;
|
|
947
956
|
} else if (type === 'session.error') {
|
|
948
957
|
finalizeStreamingMsg();
|