@quangnv13/nonstop 1.0.9 → 1.0.10
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/config.js +5 -1
- package/dist/runtime.js +12 -15
- package/package.json +1 -1
package/dist/config.js
CHANGED
|
@@ -51,6 +51,7 @@ const DEFAULTS = {
|
|
|
51
51
|
language: 'en',
|
|
52
52
|
startupMode: 'disabled',
|
|
53
53
|
outputInterval: 20000,
|
|
54
|
+
actionInterval: 5000,
|
|
54
55
|
maxOutputLines: 50,
|
|
55
56
|
maxRenderLines: 200,
|
|
56
57
|
codexCmd: 'codex',
|
|
@@ -74,7 +75,8 @@ function parseConfigFromEnv(env) {
|
|
|
74
75
|
codexCmd: env.CODEX_CMD?.trim() || DEFAULTS.codexCmd,
|
|
75
76
|
codexArgs: env.CODEX_ARGS?.trim() || DEFAULTS.codexArgs,
|
|
76
77
|
antigravityCmd: env.ANTIGRAVITY_CMD?.trim() || DEFAULTS.antigravityCmd,
|
|
77
|
-
antigravityArgs: env.ANTIGRAVITY_ARGS?.trim() || DEFAULTS.antigravityArgs
|
|
78
|
+
antigravityArgs: env.ANTIGRAVITY_ARGS?.trim() || DEFAULTS.antigravityArgs,
|
|
79
|
+
actionInterval: parseInteger(env.ACTION_INTERVAL, DEFAULTS.actionInterval)
|
|
78
80
|
};
|
|
79
81
|
}
|
|
80
82
|
function getMissingConfigFields(config) {
|
|
@@ -96,6 +98,7 @@ function serializeConfigToEnv(config) {
|
|
|
96
98
|
`APP_LANGUAGE=${config.language}`,
|
|
97
99
|
`STARTUP_MODE=${config.startupMode}`,
|
|
98
100
|
`OUTPUT_INTERVAL=${config.outputInterval}`,
|
|
101
|
+
`ACTION_INTERVAL=${config.actionInterval}`,
|
|
99
102
|
`MAX_OUTPUT_LINES=${config.maxOutputLines}`,
|
|
100
103
|
`MAX_RENDER_LINES=${config.maxRenderLines}`,
|
|
101
104
|
'',
|
|
@@ -145,6 +148,7 @@ function applyConfigToProcessEnv(config) {
|
|
|
145
148
|
process.env.APP_LANGUAGE = config.language;
|
|
146
149
|
process.env.STARTUP_MODE = config.startupMode;
|
|
147
150
|
process.env.OUTPUT_INTERVAL = String(config.outputInterval);
|
|
151
|
+
process.env.ACTION_INTERVAL = String(config.actionInterval);
|
|
148
152
|
process.env.MAX_OUTPUT_LINES = String(config.maxOutputLines);
|
|
149
153
|
process.env.MAX_RENDER_LINES = String(config.maxRenderLines);
|
|
150
154
|
process.env.CODEX_CMD = config.codexCmd;
|
package/dist/runtime.js
CHANGED
|
@@ -186,7 +186,9 @@ class NonstopRuntime {
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
async flushSessionOutput() {
|
|
189
|
-
|
|
189
|
+
this.triggerActionOutputTimeout();
|
|
190
|
+
}
|
|
191
|
+
triggerActionOutputTimeout() {
|
|
190
192
|
if (this.outputTicker) {
|
|
191
193
|
clearInterval(this.outputTicker);
|
|
192
194
|
this.outputTicker = null;
|
|
@@ -195,7 +197,11 @@ class NonstopRuntime {
|
|
|
195
197
|
clearTimeout(this.actionOutputTimeout);
|
|
196
198
|
this.actionOutputTimeout = null;
|
|
197
199
|
}
|
|
198
|
-
this.
|
|
200
|
+
this.actionOutputTimeout = setTimeout(async () => {
|
|
201
|
+
this.actionOutputTimeout = null;
|
|
202
|
+
await this.flushOutput(true, true);
|
|
203
|
+
this.ensureOutputTicker();
|
|
204
|
+
}, this.config.actionInterval);
|
|
199
205
|
}
|
|
200
206
|
async startSession(chatId, workspace, preset) {
|
|
201
207
|
if (this.activeSession?.status === 'running') {
|
|
@@ -275,6 +281,9 @@ class NonstopRuntime {
|
|
|
275
281
|
return;
|
|
276
282
|
}
|
|
277
283
|
driver.write(data);
|
|
284
|
+
if (data.includes('\r') || data.includes('\n')) {
|
|
285
|
+
this.triggerActionOutputTimeout();
|
|
286
|
+
}
|
|
278
287
|
}
|
|
279
288
|
sendSessionKey(key) {
|
|
280
289
|
const driver = this.activeDriverRef.current;
|
|
@@ -293,19 +302,7 @@ class NonstopRuntime {
|
|
|
293
302
|
}
|
|
294
303
|
driver.write(input);
|
|
295
304
|
if (['send_escape', 'send_enter', 'send_up', 'send_down'].includes(key)) {
|
|
296
|
-
|
|
297
|
-
clearInterval(this.outputTicker);
|
|
298
|
-
this.outputTicker = null;
|
|
299
|
-
}
|
|
300
|
-
if (this.actionOutputTimeout) {
|
|
301
|
-
clearTimeout(this.actionOutputTimeout);
|
|
302
|
-
this.actionOutputTimeout = null;
|
|
303
|
-
}
|
|
304
|
-
this.actionOutputTimeout = setTimeout(async () => {
|
|
305
|
-
this.actionOutputTimeout = null;
|
|
306
|
-
await this.flushOutput(true);
|
|
307
|
-
this.ensureOutputTicker();
|
|
308
|
-
}, 5000);
|
|
305
|
+
this.triggerActionOutputTimeout();
|
|
309
306
|
}
|
|
310
307
|
}
|
|
311
308
|
resolveWorkspaceById(workspaceId) {
|