(limits: {
maxCalls?: number;
maxTotalRequestBytes?: number;
maxTotalResponseBytes?: number;
})
| 7 | const args = JSON.stringify(["run", "value"]); |
| 8 | |
| 9 | function bridge(limits: { |
| 10 | maxCalls?: number; |
| 11 | maxTotalRequestBytes?: number; |
| 12 | maxTotalResponseBytes?: number; |
| 13 | }) { |
| 14 | return new WorkspaceRuntimeBridge({} as WorkspaceRuntimeCapability, { |
| 15 | ...limits, |
| 16 | trustedModules: { |
| 17 | "ws:test": { |
| 18 | async call() { |
| 19 | return "ok"; |
| 20 | }, |
| 21 | }, |
| 22 | }, |
| 23 | }); |
| 24 | } |
| 25 | |
| 26 | async function message(response: Promise<string>) { |
| 27 | return (JSON.parse(await response) as { error?: { message?: string } }).error?.message; |