pty-manager 1.2.22 → 1.3.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.
@@ -469,6 +469,19 @@ var PTYSession = class _PTYSession extends import_events.EventEmitter {
469
469
  return;
470
470
  }
471
471
  this._lastStallHash = hash;
472
+ if (this._status === "busy" && this.adapter.detectTaskComplete?.(this.outputBuffer)) {
473
+ this._status = "ready";
474
+ this._lastBlockingPromptHash = null;
475
+ this.outputBuffer = "";
476
+ this.clearStallTimer();
477
+ this.emit("status_changed", "ready");
478
+ this.emit("task_complete");
479
+ this.logger.info(
480
+ { sessionId: this.id },
481
+ "Task complete (adapter fast-path) \u2014 agent returned to idle prompt"
482
+ );
483
+ return;
484
+ }
472
485
  const recentRaw = this.outputBuffer.slice(-2e3);
473
486
  const recentOutput = this.stripAnsiForStall(recentRaw);
474
487
  const stallDurationMs = this._stallStartedAt ? Date.now() - this._stallStartedAt : this._stallTimeoutMs;
@@ -511,6 +524,7 @@ var PTYSession = class _PTYSession extends import_events.EventEmitter {
511
524
  result = result.replace(/\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g, "");
512
525
  result = result.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g, "");
513
526
  result = result.replace(/[│╭╰╮╯─═╌║╔╗╚╝╠╣╦╩╬┌┐└┘├┤┬┴┼●○❯❮▶◀⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏⣾⣽⣻⢿⡿⣟⣯⣷✻✶✳✢⏺←→↑↓⬆⬇◆◇▪▫■□▲△▼▽◈⟨⟩⌘⏎⏏⌫⌦⇧⇪⌥]/g, " ");
527
+ result = result.replace(/\d+[hms](?:\s+\d+[hms])*/g, "0s");
514
528
  result = result.replace(/ {2,}/g, " ");
515
529
  return result;
516
530
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pty-manager",
3
- "version": "1.2.22",
3
+ "version": "1.3.1",
4
4
  "description": "PTY session manager with lifecycle management, pluggable adapters, and blocking prompt detection",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",