feat: skills and agents

This commit is contained in:
Gab
2026-03-24 17:59:49 +11:00
parent ff77a81141
commit 7b81c4db73
6 changed files with 31 additions and 4 deletions

View File

@@ -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,

View File

@@ -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* () {