( deps: ServerDependencies, feedPolicy: SessionBoundFeedPolicy )
| 239 | `PTY size must include integer cols ${MIN_PTY_COLS}-${MAX_PTY_COLS} and rows ${MIN_PTY_ROWS}-${MAX_PTY_ROWS}` |
| 240 | ); |
| 241 | } |
| 242 | |
| 243 | return { cols, rows }; |
| 244 | } |
| 245 | |
| 246 | function parsePtyPath(path: string): { ptyId: string; action?: 'connect' } | null { |
| 247 | const match = path.match(/^\/pty\/([^/]+)(?:\/(connect))?$/); |
| 248 | if (!match) return null; |
| 249 | |
| 250 | const ptyId = validatePtyId(match[1]); |
| 251 | if (!ptyId) return null; |
| 252 | |
| 253 | return { |
| 254 | ptyId, |
| 255 | action: match[2] === 'connect' ? 'connect' : undefined, |
| 256 | }; |
no test coverage detected