| 757 | } |
| 758 | |
| 759 | #resolveCommandBackendId(id: string | undefined): string | undefined { |
| 760 | const target = id ?? this.#defaultCommandBackendId; |
| 761 | if (target === undefined) return undefined; |
| 762 | if (!this.#registeredBackendIds.has(target)) { |
| 763 | throw new Error(`Workspace: no backend with id ${JSON.stringify(target)}`); |
| 764 | } |
| 765 | if (!this.#backendsById.has(target)) { |
| 766 | throw new Error( |
| 767 | `Workspace backend ${JSON.stringify(target)} does not accept shell commands.`, |
| 768 | ); |
| 769 | } |
| 770 | return target; |
| 771 | } |
| 772 | |
| 773 | async close(): Promise<void> { |
| 774 | // Close every cached handle in parallel. Drop caches before |