( // biome-ignore lint/suspicious/noExplicitAny: underlying surface differs per path surface: any, rehydrate: (handle: unknown, metadata?: RuntimeHandleMetadata) => unknown, dispose: () => void, useThink: boolean, )
| 328 | } |
| 329 | |
| 330 | function makeClient( |
| 331 | // biome-ignore lint/suspicious/noExplicitAny: underlying surface differs per path |
| 332 | surface: any, |
| 333 | rehydrate: (handle: unknown, metadata?: RuntimeHandleMetadata) => unknown, |
| 334 | dispose: () => void, |
| 335 | useThink: boolean, |
| 336 | ): WorkspaceClient { |
| 337 | const runtime = makeRuntimeClient( |
| 338 | surface.runtime as UnderlyingRuntime, |
| 339 | rehydrate as RehydrateRuntimeHandle, |
| 340 | ); |
| 341 | const client: WorkspaceClient = { |
| 342 | get fs() { |
| 343 | return surface.fs; |
| 344 | }, |
| 345 | runtime, |
| 346 | get git() { |
| 347 | return surface.git; |
| 348 | }, |
| 349 | get assets() { |
| 350 | return surface.assets; |
| 351 | }, |
| 352 | get artifacts() { |
| 353 | return surface.artifacts; |
| 354 | }, |
| 355 | [Symbol.dispose]: dispose, |
| 356 | }; |
| 357 | if (useThink) Object.assign(client, createThinkCompatibility(client.fs)); |
| 358 | return client; |
| 359 | } |
| 360 | |
| 361 | // What `getWorkspace` accepts: a local host carrying the symbol stash |
| 362 | // (the durable object `this`), or a remote stub exposing |
no test coverage detected