pty-manager 1.7.0 → 1.7.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.
package/dist/index.js CHANGED
@@ -508,6 +508,19 @@ var PTYSession = class _PTYSession extends import_events.EventEmitter {
508
508
  if (this._status !== "busy" && this._status !== "authenticating") {
509
509
  return;
510
510
  }
511
+ if (this._status === "busy" && this.adapter.detectTaskComplete?.(this.outputBuffer)) {
512
+ this._status = "ready";
513
+ this._lastBlockingPromptHash = null;
514
+ this.outputBuffer = "";
515
+ this.clearStallTimer();
516
+ this.emit("status_changed", "ready");
517
+ this.emit("task_complete");
518
+ this.logger.info(
519
+ { sessionId: this.id },
520
+ "Task complete (adapter fast-path) \u2014 agent returned to idle prompt"
521
+ );
522
+ return;
523
+ }
511
524
  if (this.adapter.detectLoading?.(this.outputBuffer)) {
512
525
  this.logger.debug(
513
526
  { sessionId: this.id },
@@ -523,19 +536,6 @@ var PTYSession = class _PTYSession extends import_events.EventEmitter {
523
536
  return;
524
537
  }
525
538
  this._lastStallHash = hash;
526
- if (this._status === "busy" && this.adapter.detectTaskComplete?.(this.outputBuffer)) {
527
- this._status = "ready";
528
- this._lastBlockingPromptHash = null;
529
- this.outputBuffer = "";
530
- this.clearStallTimer();
531
- this.emit("status_changed", "ready");
532
- this.emit("task_complete");
533
- this.logger.info(
534
- { sessionId: this.id },
535
- "Task complete (adapter fast-path) \u2014 agent returned to idle prompt"
536
- );
537
- return;
538
- }
539
539
  this._stallEmissionCount++;
540
540
  if (this._stallEmissionCount > _PTYSession.MAX_STALL_EMISSIONS) {
541
541
  this.logger.warn(