pty-manager 1.11.0 → 1.12.0

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.
@@ -467,6 +467,7 @@ var PTYSession = class _PTYSession extends import_node_events.EventEmitter {
467
467
  }
468
468
  }
469
469
  }
470
+ adapter;
470
471
  ptyProcess = null;
471
472
  outputBuffer = "";
472
473
  _status = "pending";
@@ -647,13 +648,14 @@ var PTYSession = class _PTYSession extends import_node_events.EventEmitter {
647
648
  return;
648
649
  }
649
650
  if (this._status === "busy" && this.adapter.detectTaskComplete?.(this.outputBuffer)) {
651
+ const turnOutput = this.outputBuffer;
650
652
  this._status = "ready";
651
653
  this._lastBlockingPromptHash = null;
652
654
  this._lastBlockingPromptEmitAt = 0;
653
655
  this.outputBuffer = "";
654
656
  this.clearStallTimer();
655
657
  this.emit("status_changed", "ready");
656
- this.emit("task_complete");
658
+ this.emit("task_complete", turnOutput);
657
659
  this.logger.info(
658
660
  { sessionId: this.id },
659
661
  "Task complete (adapter fast-path) \u2014 agent returned to idle prompt"
@@ -953,13 +955,14 @@ var PTYSession = class _PTYSession extends import_node_events.EventEmitter {
953
955
  this.traceTaskCompletion("debounce_reject_signal", { signal });
954
956
  return;
955
957
  }
958
+ const turnOutput = this.outputBuffer;
956
959
  this._status = "ready";
957
960
  this._lastBlockingPromptHash = null;
958
961
  this._lastBlockingPromptEmitAt = 0;
959
962
  this.outputBuffer = "";
960
963
  this.clearStallTimer();
961
964
  this.emit("status_changed", "ready");
962
- this.emit("task_complete");
965
+ this.emit("task_complete", turnOutput);
963
966
  this.traceTaskCompletion("transition_ready", { signal: true });
964
967
  this.logger.info(
965
968
  { sessionId: this.id },
@@ -1620,19 +1623,21 @@ var PTYSession = class _PTYSession extends import_node_events.EventEmitter {
1620
1623
  this._lastActivityAt = /* @__PURE__ */ new Date();
1621
1624
  this.resetStallTimer();
1622
1625
  break;
1623
- case "task_complete":
1626
+ case "task_complete": {
1627
+ const turnOutput = this.outputBuffer;
1624
1628
  this._status = "ready";
1625
1629
  this._lastBlockingPromptHash = null;
1626
1630
  this._lastBlockingPromptEmitAt = 0;
1627
1631
  this.outputBuffer = "";
1628
1632
  this.clearStallTimer();
1629
1633
  this.emit("status_changed", "ready");
1630
- this.emit("task_complete");
1634
+ this.emit("task_complete", turnOutput);
1631
1635
  this.logger.info(
1632
1636
  { sessionId: this.id, event },
1633
1637
  "Hook event: task_complete \u2192 ready"
1634
1638
  );
1635
1639
  break;
1640
+ }
1636
1641
  case "permission_approved":
1637
1642
  this._lastActivityAt = /* @__PURE__ */ new Date();
1638
1643
  this.outputBuffer = "";
@@ -1789,8 +1794,8 @@ var PTYManager = class extends import_node_events2.EventEmitter {
1789
1794
  session.on("status_changed", () => {
1790
1795
  this.emit("session_status_changed", session.toHandle());
1791
1796
  });
1792
- session.on("task_complete", () => {
1793
- this.emit("task_complete", session.toHandle());
1797
+ session.on("task_complete", (output) => {
1798
+ this.emit("task_complete", session.toHandle(), output);
1794
1799
  });
1795
1800
  session.on("tool_running", (info) => {
1796
1801
  this.emit("tool_running", session.toHandle(), info);
@@ -2175,10 +2180,11 @@ manager.on("session_status_changed", (handle) => {
2175
2180
  status: handle.status
2176
2181
  });
2177
2182
  });
2178
- manager.on("task_complete", (handle) => {
2183
+ manager.on("task_complete", (handle, output) => {
2179
2184
  emit({
2180
2185
  event: "task_complete",
2181
- id: handle.id
2186
+ id: handle.id,
2187
+ output
2182
2188
  });
2183
2189
  });
2184
2190
  manager.on("tool_running", (handle, info) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pty-manager",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
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",
@@ -41,16 +41,15 @@
41
41
  "license": "MIT",
42
42
  "repository": {
43
43
  "type": "git",
44
- "url": "https://github.com/HaruHunab1320/parallax.git",
45
- "directory": "packages/pty-manager"
44
+ "url": "https://github.com/HaruHunab1320/pty-manager.git"
46
45
  },
47
46
  "bugs": {
48
- "url": "https://github.com/HaruHunab1320/parallax/issues"
47
+ "url": "https://github.com/HaruHunab1320/pty-manager/issues"
49
48
  },
50
- "homepage": "https://github.com/HaruHunab1320/parallax/tree/main/packages/pty-manager#readme",
49
+ "homepage": "https://github.com/HaruHunab1320/pty-manager#readme",
51
50
  "dependencies": {
52
- "node-pty": "^1.0.0",
53
- "adapter-types": "^0.2.0"
51
+ "adapter-types": "^0.2.0",
52
+ "node-pty": "^1.0.0"
54
53
  },
55
54
  "devDependencies": {
56
55
  "@types/node": "^22.14.1",