( current: ShellRunStatus, next: ShellRunStatus, )
| 171 | } |
| 172 | |
| 173 | export function isValidShellRunStatusTransition( |
| 174 | current: ShellRunStatus, |
| 175 | next: ShellRunStatus, |
| 176 | ): boolean { |
| 177 | if (current === next) return true; |
| 178 | if (current === 'starting') { |
| 179 | return next === 'running' || next === 'failed' || next === 'orphaned'; |
| 180 | } |
| 181 | return current === 'running' && isTerminalShellRunStatus(next); |
| 182 | } |
| 183 | |
| 184 | export function isShellOutput(value: unknown): value is ShellOutput { |
| 185 | if (!value || typeof value !== 'object' || Array.isArray(value)) return false; |
no test coverage detected