fix(skill): type expected skill failures (#28885)
This commit is contained in:
@@ -22,12 +22,9 @@ export const SkillTool = Tool.define(
|
||||
parameters: Parameters,
|
||||
execute: (params: Schema.Schema.Type<typeof Parameters>, ctx: Tool.Context) =>
|
||||
Effect.gen(function* () {
|
||||
const info = yield* skill.get(params.name)
|
||||
if (!info) {
|
||||
const all = yield* skill.all()
|
||||
const available = all.map((item) => item.name).join(", ")
|
||||
throw new Error(`Skill "${params.name}" not found. Available skills: ${available || "none"}`)
|
||||
}
|
||||
const info = yield* skill
|
||||
.require(params.name)
|
||||
.pipe(Effect.catchTag("Skill.NotFoundError", (error) => Effect.die(new Error(error.message))))
|
||||
|
||||
yield* ctx.ask({
|
||||
permission: "skill",
|
||||
|
||||
Reference in New Issue
Block a user