neuralos 3.2.0 → 3.2.1

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.
Files changed (2) hide show
  1. package/bin/gybackend.cjs +25 -0
  2. package/package.json +2 -2
package/bin/gybackend.cjs CHANGED
@@ -295055,6 +295055,9 @@ var TerminalService = class {
295055
295055
  pendingResizeByTerminal = /* @__PURE__ */ new Map();
295056
295056
  buffers = /* @__PURE__ */ new Map();
295057
295057
  headlessPtys = /* @__PURE__ */ new Map();
295058
+ /** Buffered writes for terminals that aren't writable yet (prevents keystroke loss during reconnection). */
295059
+ pendingWrites = /* @__PURE__ */ new Map();
295060
+ pendingWriteTimers = /* @__PURE__ */ new Map();
295058
295061
  selectionByTerminal = /* @__PURE__ */ new Map();
295059
295062
  tasksByTerminal = /* @__PURE__ */ new Map();
295060
295063
  activeTaskByTerminal = /* @__PURE__ */ new Map();
@@ -295949,6 +295952,22 @@ ${promptPrefix}`;
295949
295952
  if (terminal && this.canWriteToTerminal(terminal)) {
295950
295953
  const backend = this.getBackend(terminal.type);
295951
295954
  backend.write(terminal.ptyId, data);
295955
+ } else if (terminal) {
295956
+ const pending = this.pendingWrites.get(terminalId) ?? "";
295957
+ this.pendingWrites.set(terminalId, pending + data);
295958
+ if (!this.pendingWriteTimers.has(terminalId)) {
295959
+ const timer = setTimeout(() => {
295960
+ this.pendingWriteTimers.delete(terminalId);
295961
+ const term = this.terminals.get(terminalId);
295962
+ const buffered = this.pendingWrites.get(terminalId);
295963
+ if (term && buffered && this.canWriteToTerminal(term)) {
295964
+ this.pendingWrites.delete(terminalId);
295965
+ const b = this.getBackend(term.type);
295966
+ b.write(term.ptyId, buffered);
295967
+ }
295968
+ }, 500);
295969
+ this.pendingWriteTimers.set(terminalId, timer);
295970
+ }
295952
295971
  }
295953
295972
  }
295954
295973
  /**
@@ -296003,6 +296022,12 @@ ${promptPrefix}`;
296003
296022
  }
296004
296023
  kill(terminalId) {
296005
296024
  this.pendingResizeByTerminal.delete(terminalId);
296025
+ this.pendingWrites.delete(terminalId);
296026
+ const writeTimer = this.pendingWriteTimers.get(terminalId);
296027
+ if (writeTimer) {
296028
+ clearTimeout(writeTimer);
296029
+ this.pendingWriteTimers.delete(terminalId);
296030
+ }
296006
296031
  this.autoReconnect.clear(terminalId);
296007
296032
  const terminal = this.terminals.get(terminalId);
296008
296033
  if (terminal) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "neuralos",
3
- "version": "3.2.0",
4
- "description": "Headless AI-native backend for RTerm / neuralOS — v3.2.0: production-ready Synapse dispatch (skip JetStream ack, multi-mesh, 600s timeout). 11 plugins, 55 plugin tools wired, full-duplex Synapse agent. Transports (SSH/serial/local), SQLite, and NATS libs install automatically.",
3
+ "version": "3.2.1",
4
+ "description": "Headless AI-native backend for RTerm / neuralOS — v3.2.1: terminal freeze fix (pending-write buffer), chat re-trigger fix (isThinking guard), stop button freeze fix (async await). 11 plugins, 55 plugin tools wired. Transports (SSH/serial/local), SQLite, and NATS libs install automatically.",
5
5
  "main": "bin/gybackend.cjs",
6
6
  "bin": { "gybackend": "bin/gybackend.cjs" },
7
7
  "license": "MIT",