(id: string)
| 920 | // always paired with the live handle for that id at the moment |
| 921 | // of the lookup. |
| 922 | async #shellFor(id: string): Promise<{ shell: WorkspaceShell; handle: BackendHandle }> { |
| 923 | const handle = await this.#handleFor(id); |
| 924 | const cached = this.#shells.get(id); |
| 925 | if (cached !== undefined) return { shell: cached, handle }; |
| 926 | const shell = new WorkspaceShell( |
| 927 | handle.rpc.shell, |
| 928 | { |
| 929 | push: () => this.push(id), |
| 930 | pull: () => this.pull(id), |
| 931 | onPullPending: () => this.#schedulePendingSync(id), |
| 932 | }, |
| 933 | this.#observer, |
| 934 | ); |
| 935 | this.#shells.set(id, shell); |
| 936 | return { shell, handle }; |
| 937 | } |
| 938 | |
| 939 | // Routed shell facade. Each method picks the right backend per |
| 940 | // call (default, or the one named through ExecOptions.backend) |
no test coverage detected