refactor(core): return directory and content from the skill tool (#63623)

This commit is contained in:
Aiden Cline
2026-11-12 17:43:44 -06:00
committed by GitHub
Unverified
parent f1bbaea632
commit 9070bff302
2 changed files with 9 additions and 11 deletions
+8 -10
View File
@@ -14,9 +14,8 @@ export const Input = Schema.Struct({
})
export const Output = Schema.Struct({
name: Skill.Name,
directory: Schema.String,
output: Schema.String,
content: Schema.String,
})
export const description = [
"Load a specialized skill's instructions and resources into the current conversation when the task at hand matches its description.",
@@ -55,15 +54,14 @@ export const Plugin = {
...Permission.invocation(context),
})
const files = yield* skills.files(skill.id)
return { name: skill.name, ...(yield* Skill.prepare(fs, skill, files)) }
const { directory, output: content } = yield* Skill.prepare(fs, skill, files)
return {
output: { directory, content },
content,
metadata: { name: skill.name, directory },
}
}).pipe(Effect.mapError((error) => unableToLoad(input.id, error)))
}).pipe(
Effect.map((output) => ({
output,
content: output.output,
metadata: { name: output.name, directory: output.directory },
})),
),
}),
}),
)
.pipe(Effect.orDie)
+1 -1
View File
@@ -139,7 +139,7 @@ describe("SkillTool", () => {
}),
).toEqual({
status: "completed",
output: { name: "Effect", directory, output: Skill.toModelOutput(info, [reference]) },
output: { directory, content: Skill.toModelOutput(info, [reference]) },
content: [{ type: "text", text: Skill.toModelOutput(info, [reference]) }],
metadata: { name: "Effect", directory },
})