fix(skill): type expected skill failures (#28885)

This commit is contained in:
Shoubhit Dash
2026-05-22 23:18:52 +05:30
committed by GitHub
parent 536ee857c6
commit 7265c46af6
5 changed files with 102 additions and 12 deletions

View File

@@ -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",