@quangnv13/nonstop 1.0.9 → 1.0.11

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/README.md CHANGED
@@ -37,7 +37,7 @@
37
37
  * **🤖 Telegram PTY Terminal** — Execute and control real-time, interactive shell sessions (PowerShell, Bash, Codex, or Antigravity) remotely from Telegram.
38
38
  * **⚙️ Inline Configuration Engine** — Modify environment settings dynamically through the new `/config` inline Telegram menu or directly in the CLI.
39
39
  * **📂 Smart Workspaces** — Navigate and switch between different working directories on your machine with a few taps.
40
- * **🔄 Optimized Output Stream** — Advanced batch-delivery mechanics with configurable output intervals, ensuring fluid terminal logs inside Telegram without hitting API limits.
40
+ * **🔄 Optimized Output Stream** — Advanced batch-delivery mechanics with configurable output intervals (`OUTPUT_INTERVAL`) and interaction-triggered flush delays (`ACTION_INTERVAL`), ensuring fluid terminal logs inside Telegram without hitting API limits.
41
41
  * **🚀 Native OS Autostart** — Easy configuration to run as a background service on OS startup (supports Windows and Linux).
42
42
  * **🌐 Bilingual Support** — Fully localized in English (`en`) and Vietnamese (`vi`).
43
43
  * **🛡️ Hardened Security** — Hardened token validation and authorization checks, restricting control access strictly to the configured admin account.
@@ -126,6 +126,9 @@ Once the bot runtime is active, you can interact with it via the following Teleg
126
126
  * **⛔ Esc** — Send the Escape key to interrupt/cancel processes.
127
127
  * **⏎ Enter** — Send a carriage return.
128
128
  * **▲ Up / ▼ Down** — Navigate command history.
129
+ * **🔄 Refresh** — Request an update of the terminal screen.
130
+ > [!NOTE]
131
+ > Pressing control keys (**Esc**, **Enter**, **Up**, **Down**) or clicking **Refresh** will trigger a quick output delivery after a short interactive delay (configured via `ACTION_INTERVAL`, default 5s) and bypass standard duplicate output filters to guarantee updates are delivered.
129
132
 
130
133
  #### **📂 Directory Workspaces**
131
134
  * Select **📁 Workspaces** from the main menu to view configured folders.
@@ -149,6 +152,8 @@ TELEGRAM_USERNAME=@your_telegram_username
149
152
  CLIENT_NAME=nonstop-local
150
153
  APP_LANGUAGE=en
151
154
  STARTUP_MODE=disabled
155
+ OUTPUT_INTERVAL=20000
156
+ ACTION_INTERVAL=5000
152
157
  ```
153
158
 
154
159
  ---
package/README.vi.md CHANGED
@@ -37,7 +37,7 @@
37
37
  * **🤖 Terminal PTY Qua Telegram** — Thực thi và điều khiển các phiên shell tương tác thời gian thực (PowerShell, Bash, Codex hoặc Antigravity) từ xa thông qua Telegram.
38
38
  * **⚙️ Trình Cấu Hình Động Trực Tiếp** — Thay đổi các tham số môi trường động thông qua menu `/config` bằng các phím inline Telegram hoặc trực tiếp trên CLI.
39
39
  * **📂 Quản Lý Workspace Linh Hoạt** — Điều hướng và chuyển đổi nhanh chóng giữa các thư mục làm việc khác nhau trên máy chủ cục bộ.
40
- * **🔄 Luồng Đầu Ra Được Tối Ưu Hóa** — Cơ chế gom cụm dữ liệu đầu ra thông minh với khoảng giãn cách (intervals) cấu hình được, giúp đảm bảo nhật ký terminal hiển thị mượt mà mà không vượt quá giới hạn API Telegram.
40
+ * **🔄 Luồng Đầu Ra Được Tối Ưu Hóa** — Cơ chế gom cụm đầu ra thông minh với khoảng giãn cách cấu hình được (`OUTPUT_INTERVAL`) độ trễ flush kích hoạt bởi tương tác (`ACTION_INTERVAL`), giúp nhật ký terminal hiển thị mượt mà trên Telegram mà không vượt quá giới hạn API.
41
41
  * **🚀 Khởi Động Cùng Hệ Điều Hành** — Dễ dàng cấu hình để chạy như một dịch vụ nền khi hệ thống khởi động (hỗ trợ Windows và Linux).
42
42
  * **🌐 Hỗ Trợ Đa Ngôn Ngữ** — Bản dịch hoàn chỉnh cho tiếng Anh (`en`) và tiếng Việt (`vi`).
43
43
  * **🛡️ Bảo Mật Nghiêm Ngặt** — Xác thực token và kiểm tra quyền hạn chặt chẽ, chỉ cho phép tài khoản Admin đã cấu hình điều khiển hệ thống.
@@ -126,6 +126,9 @@ Khi bot đang hoạt động, bạn có thể tương tác với nó thông qua
126
126
  * **⛔ Esc** — Gửi phím Escape để hủy lệnh/tiến trình đang chạy.
127
127
  * **⏎ Enter** — Gửi phím xuống dòng (chấp nhận lệnh).
128
128
  * **▲ Up / ▼ Down** — Duyệt lại lịch sử các lệnh đã gõ.
129
+ * **🔄 Tải lại** — Yêu cầu cập nhật màn hình terminal ngay lập tức.
130
+ > [!NOTE]
131
+ > Việc nhấn các phím chức năng (**Esc**, **Enter**, **Up**, **Down**) hoặc nút **Tải lại** sẽ kích hoạt gửi kết quả terminal sau một khoảng trễ ngắn (cấu hình qua `ACTION_INTERVAL`, mặc định là 5 giây) và bỏ qua bộ lọc tin nhắn trùng lặp để đảm bảo bạn thấy kết quả mới nhất.
129
132
 
130
133
  #### **📂 Thư Mục Làm Việc (Workspaces)**
131
134
  * Chọn **📁 Workspaces** từ menu chính để xem danh sách các thư mục được cấu hình.
@@ -149,6 +152,8 @@ TELEGRAM_USERNAME=@your_telegram_username
149
152
  CLIENT_NAME=nonstop-local
150
153
  APP_LANGUAGE=en
151
154
  STARTUP_MODE=disabled
155
+ OUTPUT_INTERVAL=20000
156
+ ACTION_INTERVAL=5000
152
157
  ```
153
158
 
154
159
  ---
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
- await this.flushOutput(true, true);
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.ensureOutputTicker();
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
- if (this.outputTicker) {
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quangnv13/nonstop",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "preferGlobal": true,
5
5
  "publishConfig": {
6
6
  "access": "public"