feat(codemode): add confined execution package (#35079)
This commit is contained in:
parent
379adee35c
commit
2409c7a3d5
20 changed files with 9109 additions and 15 deletions
11
packages/codemode/src/tool-error.ts
Normal file
11
packages/codemode/src/tool-error.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
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 }) })
|
||||
Loading…
Add table
Add a link
Reference in a new issue