(id: number, result: ToolResult)
| 57 | emitError(): void { this.errorCb?.(new Error('worker failed')); } |
| 58 | emitExit(): void { this.exitCb?.(13); } |
| 59 | private reply(id: number, result: ToolResult): void { |
| 60 | if (this.alive) this.msgCb?.({ type: 'result', id, result }); |
| 61 | } |
| 62 | postMessage(msg: unknown): void { |
| 63 | const m = msg as CallMsg | { type: 'close' } | { type: 'trim' }; |
| 64 | if (m?.type === 'trim') { |