Build a capability context that hands the adapter the given sandbox.
(handle: SandboxHandle)
| 52 | |
| 53 | /** Build a capability context that hands the adapter the given sandbox. */ |
| 54 | function capabilityContextWith(handle: SandboxHandle): CapabilityContext { |
| 55 | const [, provideSandbox] = SandboxCapability |
| 56 | const ctx = { |
| 57 | capabilities: { markProvided: () => {}, has: () => true }, |
| 58 | } as unknown as CapabilityContext |
| 59 | provideSandbox(ctx, handle) |
| 60 | return ctx |
| 61 | } |
| 62 | |
| 63 | async function collect( |
| 64 | stream: AsyncIterable<StreamChunk>, |