refactor(tool): Tool.Def.execute returns Effect, rename defineEffect → define (#21961)

This commit is contained in:
Kit Langton
2026-04-10 22:36:02 -04:00
committed by GitHub
parent f99812443c
commit c5fb6281f0
39 changed files with 674 additions and 721 deletions
+8 -10
View File
@@ -11,7 +11,7 @@ const Parameters = z.object({
name: z.string().describe("The name of the skill from available_skills"),
})
export const SkillTool = Tool.defineEffect(
export const SkillTool = Tool.define(
"skill",
Effect.gen(function* () {
const skill = yield* Skill.Service
@@ -51,14 +51,12 @@ export const SkillTool = Tool.defineEffect(
throw new Error(`Skill "${params.name}" not found. Available skills: ${available || "none"}`)
}
yield* Effect.promise(() =>
ctx.ask({
permission: "skill",
patterns: [params.name],
always: [params.name],
metadata: {},
}),
)
yield* ctx.ask({
permission: "skill",
patterns: [params.name],
always: [params.name],
metadata: {},
})
const dir = path.dirname(info.location)
const base = pathToFileURL(dir).href
@@ -94,7 +92,7 @@ export const SkillTool = Tool.defineEffect(
dir,
},
}
}).pipe(Effect.orDie, Effect.runPromise),
}).pipe(Effect.orDie),
}
}
}),