fix(skill): pass directory to getAllSkills and fix async test timing

This commit is contained in:
Sami Jawhar
2026-04-03 20:43:18 +00:00
parent f540249838
commit d2d1541377
5 changed files with 27 additions and 7 deletions
+3 -2
View File
@@ -25,7 +25,7 @@ import {
mergeNativeSkills,
} from "./native-skills"
export function createSkillTool(options: SkillLoadOptions = {}): ToolDefinition {
export function createSkillTool(options: SkillLoadOptions): ToolDefinition {
let cachedDescription: string | null = null
const getSkills = async (context?: ToolContext): Promise<LoadedSkill[]> => {
@@ -37,6 +37,7 @@ export function createSkillTool(options: SkillLoadOptions = {}): ToolDefinition
disabledSkills: options?.disabledSkills,
browserProvider: options?.browserProvider,
teamModeEnabled: options?.teamModeEnabled,
directory: options.directory,
})) ?? []
const allSkills = options.skills ? [...options.skills] : discovered
@@ -191,4 +192,4 @@ export function createSkillTool(options: SkillLoadOptions = {}): ToolDefinition
})
}
export const skill: ToolDefinition = createSkillTool()
export const skill: ToolDefinition = createSkillTool({ directory: process.cwd() })