pty-manager 1.2.15 → 1.2.16

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.d.mts CHANGED
@@ -453,7 +453,7 @@ declare class PTYSession extends EventEmitter {
453
453
  clearAutoResponseRules(): void;
454
454
  /**
455
455
  * Start or reset the stall detection timer.
456
- * Only active when status is "busy" and stall detection is enabled.
456
+ * Active when status is "busy" or "authenticating" and stall detection is enabled.
457
457
  */
458
458
  private resetStallTimer;
459
459
  /**
package/dist/index.d.ts CHANGED
@@ -453,7 +453,7 @@ declare class PTYSession extends EventEmitter {
453
453
  clearAutoResponseRules(): void;
454
454
  /**
455
455
  * Start or reset the stall detection timer.
456
- * Only active when status is "busy" and stall detection is enabled.
456
+ * Active when status is "busy" or "authenticating" and stall detection is enabled.
457
457
  */
458
458
  private resetStallTimer;
459
459
  /**
package/dist/index.js CHANGED
@@ -416,11 +416,11 @@ var PTYSession = class extends import_events.EventEmitter {
416
416
  // ─────────────────────────────────────────────────────────────────────────────
417
417
  /**
418
418
  * Start or reset the stall detection timer.
419
- * Only active when status is "busy" and stall detection is enabled.
419
+ * Active when status is "busy" or "authenticating" and stall detection is enabled.
420
420
  */
421
421
  resetStallTimer() {
422
422
  this.clearStallTimer();
423
- if (!this._stallDetectionEnabled || this._status !== "busy") {
423
+ if (!this._stallDetectionEnabled || this._status !== "busy" && this._status !== "authenticating") {
424
424
  return;
425
425
  }
426
426
  this._stallStartedAt = Date.now();
@@ -443,7 +443,7 @@ var PTYSession = class extends import_events.EventEmitter {
443
443
  * Called when the stall timer fires (no output for stallTimeoutMs).
444
444
  */
445
445
  onStallTimerFired() {
446
- if (this._status !== "busy") {
446
+ if (this._status !== "busy" && this._status !== "authenticating") {
447
447
  return;
448
448
  }
449
449
  const tail = this.outputBuffer.slice(-500);
@@ -494,7 +494,7 @@ var PTYSession = class extends import_events.EventEmitter {
494
494
  * Called by the manager after onStallClassify resolves.
495
495
  */
496
496
  handleStallClassification(classification) {
497
- if (this._status !== "busy") {
497
+ if (this._status !== "busy" && this._status !== "authenticating") {
498
498
  return;
499
499
  }
500
500
  if (!classification || classification.state === "still_working") {
@@ -598,10 +598,14 @@ var PTYSession = class extends import_events.EventEmitter {
598
598
  this.ptyProcess.onData((data) => {
599
599
  this._lastActivityAt = /* @__PURE__ */ new Date();
600
600
  this.outputBuffer += data;
601
- if (this._status === "busy") {
601
+ if (this._status === "busy" || this._status === "authenticating") {
602
602
  this.resetStallTimer();
603
603
  }
604
604
  this.emit("output", data);
605
+ const blockingPrompt = this.detectAndHandleBlockingPrompt();
606
+ if (blockingPrompt) {
607
+ return;
608
+ }
605
609
  if ((this._status === "starting" || this._status === "authenticating") && this.adapter.detectReady(this.outputBuffer)) {
606
610
  this._status = "ready";
607
611
  this._lastBlockingPromptHash = null;
@@ -611,10 +615,6 @@ var PTYSession = class extends import_events.EventEmitter {
611
615
  this.logger.info({ sessionId: this.id }, "Session ready");
612
616
  return;
613
617
  }
614
- const blockingPrompt = this.detectAndHandleBlockingPrompt();
615
- if (blockingPrompt) {
616
- return;
617
- }
618
618
  if (this._status !== "ready" && this._status !== "busy") {
619
619
  const loginDetection = this.adapter.detectLogin(this.outputBuffer);
620
620
  if (loginDetection.required && this._status !== "authenticating") {