(client: RpcClient)
| 40 | } |
| 41 | |
| 42 | function createEventSource(client: RpcClient): EventSource { |
| 43 | return { |
| 44 | subscribe: async (handler) => { |
| 45 | return client.on<GlobalEvent>("global.event", (e) => { |
| 46 | handler(e) |
| 47 | }) |
| 48 | }, |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | async function target() { |
| 53 | if (typeof OPENCODE_WORKER_PATH !== "undefined") return OPENCODE_WORKER_PATH |