Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/core/src/tool/skill.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export * as SkillTool from "./skill"

import path from "path"
import { pathToFileURL } from "url"
import { ToolFailure } from "@opencode-ai/llm"
import { Effect, Layer, Schema } from "effect"
import { FSUtil } from "../fs-util"
Expand Down Expand Up @@ -39,7 +38,7 @@ export const toModelOutput = (skill: SkillV2.Info, files: ReadonlyArray<string>)
"",
skill.content.trim(),
"",
`Base directory for this skill: ${pathToFileURL(directory).href}`,
`Base directory for this skill: ${directory}`,
"Relative paths in this skill (e.g., scripts/, reference/) are relative to this base directory.",
"Note: file list is sampled.",
"",
Expand Down
3 changes: 1 addition & 2 deletions packages/core/test/tool-skill.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import fs from "fs/promises"
import path from "path"
import { pathToFileURL } from "url"
import { describe, expect } from "bun:test"
import { Effect, Layer } from "effect"
import { FSUtil } from "@opencode-ai/core/fs-util"
Expand Down Expand Up @@ -90,7 +89,7 @@ describe("SkillTool", () => {
value: SkillTool.toModelOutput(info, [reference]),
})
expect(SkillTool.toModelOutput(info, [reference])).toContain(
`Base directory for this skill: ${pathToFileURL(directory).href}`,
`Base directory for this skill: ${directory}`,
)
expect(
yield* settleTool(registry, {
Expand Down
3 changes: 1 addition & 2 deletions packages/opencode/src/tool/skill.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import path from "path"
import { pathToFileURL } from "url"
import { Effect, Schema } from "effect"
import { Ripgrep } from "@opencode-ai/core/ripgrep"
import { Skill } from "../skill"
Expand Down Expand Up @@ -33,7 +32,7 @@ export const SkillTool = Tool.define(
})

const dir = path.dirname(info.location)
const base = pathToFileURL(dir).href
const base = dir
const files = yield* ripgrep.find({
cwd: dir,
pattern: "!**/SKILL.md",
Expand Down
3 changes: 1 addition & 2 deletions packages/opencode/test/tool/skill.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Ripgrep } from "@opencode-ai/core/ripgrep"
import { Cause, Effect, Exit, Layer } from "effect"
import { afterEach, describe, expect } from "bun:test"
import path from "path"
import { pathToFileURL } from "url"
import type { Permission } from "../../src/permission"
import type { Tool } from "@/tool/tool"
import { SkillTool } from "../../src/tool/skill"
Expand Down Expand Up @@ -90,7 +89,7 @@ Use this skill.
expect(requests[0].always).toContain("tool-skill")
expect(result.metadata.dir).toBe(skill)
expect(result.output).toContain(`<skill_content name="tool-skill">`)
expect(result.output).toContain(`Base directory for this skill: ${pathToFileURL(skill).href}`)
expect(result.output).toContain(`Base directory for this skill: ${skill}`)
expect(result.output).toContain(`<file>${file}</file>`)
}),
)
Expand Down
Loading