mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-05 00:23:10 +00:00
feat: skills and agents
This commit is contained in:
@@ -263,7 +263,7 @@ export namespace Agent {
|
||||
if (!data.success || !data.tools) return []
|
||||
|
||||
return data.tools
|
||||
.filter((t: any) => t.tool_type === "agent_skill")
|
||||
.filter((t: any) => t.tool_type === "coder_agent")
|
||||
.map((t: any): Info => ({
|
||||
name: t.name,
|
||||
description: t.description,
|
||||
|
||||
@@ -201,7 +201,31 @@ export namespace Skill {
|
||||
|
||||
const all = Effect.fn("Skill.all")(function* () {
|
||||
const cache = yield* ensure()
|
||||
return Object.values(cache.skills)
|
||||
const skills = Object.values(cache.skills)
|
||||
|
||||
// Add TF agent skills from synced tools (only agent_skill type, not coder_agent)
|
||||
const toolsPath = path.join(Global.Path.data, ".tfcode", "tools.json")
|
||||
try {
|
||||
const content = yield* Effect.promise(() => Bun.file(toolsPath).text())
|
||||
const data = JSON.parse(content) as { success: boolean; tools: Array<{ tool_type: string; name: string; description?: string; id: string }> }
|
||||
if (data.success && data.tools) {
|
||||
for (const tool of data.tools) {
|
||||
// Only include agent_skill (from is_agent_skill=True), not coder_agent
|
||||
if (tool.tool_type === "agent_skill") {
|
||||
skills.push({
|
||||
name: tool.name,
|
||||
description: tool.description || "ToothFairyAI Agent Skill",
|
||||
location: `tf://${tool.id}`,
|
||||
content: "",
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// Ignore errors loading TF tools
|
||||
}
|
||||
|
||||
return skills
|
||||
})
|
||||
|
||||
const dirs = Effect.fn("Skill.dirs")(function* () {
|
||||
|
||||
Reference in New Issue
Block a user