convert skill tool to Tool.defineEffect (#21936)

This commit is contained in:
Kit Langton 2026-04-10 19:49:53 -04:00 committed by GitHub
commit 5d6fe01465
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 90 additions and 83 deletions

View file

@ -1,4 +1,6 @@
import { Effect } from "effect"
import { Effect, Layer, ManagedRuntime } from "effect"
import { Skill } from "../../src/skill"
import { Ripgrep } from "../../src/file/ripgrep"
import { afterEach, describe, expect, test } from "bun:test"
import path from "path"
import { pathToFileURL } from "url"
@ -148,7 +150,9 @@ Use this skill.
await Instance.provide({
directory: tmp.path,
fn: async () => {
const tool = await SkillTool.init()
const runtime = ManagedRuntime.make(Layer.mergeAll(Skill.defaultLayer, Ripgrep.defaultLayer))
const info = await runtime.runPromise(SkillTool)
const tool = await info.init()
const requests: Array<Omit<Permission.Request, "id" | "sessionID" | "tool">> = []
const ctx: Tool.Context = {
...baseCtx,