process_read
Read process output from a specified time window, handling merged PTY streams and fragmented lines, while resetting the process idle timer.
Instructions
Read output from a process. Reads records from the specified time window. Resets the process idle timer.
For PTY processes stderr is merged into stdout (source=stderr reads return empty) and records are arbitrary chunks, not lines — a line may span multiple records. Prompts may arrive without a trailing newline. Read with a generous duration — the default window is only 1s.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Internal process ID. | |
| unit | No | Time unit for duration. | ms |
| source | No | Which output stream to read. | both |
| duration | No | How far back to read (in the specified unit). |