@quangnv13/nonstop 1.0.8 → 1.0.9
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/bot.js +1 -0
- package/dist/runtime.js +16 -3
- package/package.json +1 -1
package/dist/bot.js
CHANGED
package/dist/runtime.js
CHANGED
|
@@ -134,7 +134,8 @@ class NonstopRuntime {
|
|
|
134
134
|
sendInput: (data) => this.sendSessionInput(data),
|
|
135
135
|
sendKey: (key) => this.sendSessionKey(key),
|
|
136
136
|
setInputMode: (inputMode) => this.setSessionInputMode(inputMode),
|
|
137
|
-
setAutoEnter: (autoEnter) => this.setSessionAutoEnter(autoEnter)
|
|
137
|
+
setAutoEnter: (autoEnter) => this.setSessionAutoEnter(autoEnter),
|
|
138
|
+
flushSessionOutput: () => this.flushSessionOutput()
|
|
138
139
|
});
|
|
139
140
|
this.setSessionOutputPushCallback(async (chatId, text, options) => {
|
|
140
141
|
await this.bot?.pushSessionOutput(chatId, text, options);
|
|
@@ -184,6 +185,18 @@ class NonstopRuntime {
|
|
|
184
185
|
this.writeHeartbeat();
|
|
185
186
|
}
|
|
186
187
|
}
|
|
188
|
+
async flushSessionOutput() {
|
|
189
|
+
await this.flushOutput(true, true);
|
|
190
|
+
if (this.outputTicker) {
|
|
191
|
+
clearInterval(this.outputTicker);
|
|
192
|
+
this.outputTicker = null;
|
|
193
|
+
}
|
|
194
|
+
if (this.actionOutputTimeout) {
|
|
195
|
+
clearTimeout(this.actionOutputTimeout);
|
|
196
|
+
this.actionOutputTimeout = null;
|
|
197
|
+
}
|
|
198
|
+
this.ensureOutputTicker();
|
|
199
|
+
}
|
|
187
200
|
async startSession(chatId, workspace, preset) {
|
|
188
201
|
if (this.activeSession?.status === 'running') {
|
|
189
202
|
throw new Error(`Session "${this.activeSession.sessionId}" is already running.`);
|
|
@@ -345,7 +358,7 @@ class NonstopRuntime {
|
|
|
345
358
|
applyTerminalOutput(this.terminalState, chunk, this.config.maxRenderLines);
|
|
346
359
|
this.ensureOutputTicker();
|
|
347
360
|
}
|
|
348
|
-
async flushOutput(forceSnapshot = false) {
|
|
361
|
+
async flushOutput(forceSnapshot = false, ignoreDuplicate = false) {
|
|
349
362
|
const session = this.activeSession;
|
|
350
363
|
if (!session) {
|
|
351
364
|
this.outputBuffer.current = '';
|
|
@@ -366,7 +379,7 @@ class NonstopRuntime {
|
|
|
366
379
|
if (isSpinnerOrNoiseOutput(finalText)) {
|
|
367
380
|
return;
|
|
368
381
|
}
|
|
369
|
-
if ((0, session_delivery_js_1.shouldSkipSessionOutput)(session.lastSentFinalText, finalText)) {
|
|
382
|
+
if (!ignoreDuplicate && (0, session_delivery_js_1.shouldSkipSessionOutput)(session.lastSentFinalText, finalText)) {
|
|
370
383
|
return;
|
|
371
384
|
}
|
|
372
385
|
const messages = (0, session_output_js_1.buildSessionOutputMessages)({
|