| 102 | const decodeJson = Schema.decodeUnknownSync(Schema.UnknownFromJsonString); |
| 103 | |
| 104 | const toPublishError = ( |
| 105 | stage: PublishError["stage"], |
| 106 | path: string, |
| 107 | cause: { |
| 108 | readonly message: string; |
| 109 | readonly diagnostics?: readonly { readonly path: string; readonly message: string }[]; |
| 110 | }, |
| 111 | ): PublishError => |
| 112 | new PublishError({ |
| 113 | stage, |
| 114 | // oxlint-disable-next-line executor/no-unknown-error-message -- typed AppExecutorError conversion keeps its stable diagnostic message |
| 115 | message: cause.message, |
| 116 | diagnostics: |
| 117 | cause.diagnostics && cause.diagnostics.length > 0 |
| 118 | ? cause.diagnostics |
| 119 | : // oxlint-disable-next-line executor/no-unknown-error-message -- typed AppExecutorError conversion keeps its stable diagnostic message |
| 120 | [{ path, message: cause.message }], |
| 121 | }); |
| 122 | |
| 123 | const toolDescriptor = (input: { |
| 124 | readonly collected: CollectedTool; |