(data: SessionData, callID: string, source: ShellCall["source"], command?: string)
| 639 | } |
| 640 | |
| 641 | function claimShell(data: SessionData, callID: string, source: ShellCall["source"], command?: string): ShellCall { |
| 642 | const current = data.shell.get(callID) |
| 643 | if (current) { |
| 644 | if (command && !current.command) { |
| 645 | current.command = command |
| 646 | } |
| 647 | |
| 648 | return current |
| 649 | } |
| 650 | |
| 651 | const next = { |
| 652 | source, |
| 653 | ...(command ? { command } : {}), |
| 654 | } satisfies ShellCall |
| 655 | data.shell.set(callID, next) |
| 656 | return next |
| 657 | } |
| 658 | |
| 659 | function bashCommand(part: ToolPart): string | undefined { |
| 660 | if (part.tool !== "bash") { |
no test coverage detected