Download packages/codemode/src/tool-error.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 518 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/codemode/src/tool-error.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/codemode/src/tool-error.ts
-
curl -L -o tool-error.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/codemode/src/tool-error.ts
518 Bytes
| import { Schema } from "effect" | |
| /** Safe operational refusal from a standard tool pack, reported as `ToolFailure`. */ | |
| export class ToolError extends Schema.TaggedErrorClass<ToolError>()("ToolError", { | |
| message: Schema.String, | |
| cause: Schema.optionalKey(Schema.Defect()), | |
| }) {} | |
| /** Creates a tool refusal whose message is safe to include in an execution diagnostic. */ | |
| export const toolError = (message: string, cause?: unknown): ToolError => | |
| new ToolError({ message, ...(cause === undefined ? {} : { cause }) }) | |