( operation: string, fn: () => Promise<A>, )
| 82 | } |
| 83 | |
| 84 | export const runOpenCodeSdk = <A>( |
| 85 | operation: string, |
| 86 | fn: () => Promise<A>, |
| 87 | ): Effect.Effect<A, OpenCodeRuntimeError> => |
| 88 | Effect.tryPromise({ |
| 89 | try: fn, |
| 90 | catch: (cause) => |
| 91 | new OpenCodeRuntimeError({ operation, detail: openCodeRuntimeErrorDetail(cause), cause }), |
| 92 | }).pipe(Effect.withSpan(`opencode.${operation}`)); |
| 93 | |
| 94 | export interface OpenCodeCommandResult { |
| 95 | readonly stdout: string; |
no test coverage detected