From 70341eebf56da61b29b12659b35eac4f5743d167 Mon Sep 17 00:00:00 2001 From: Gab Date: Tue, 24 Mar 2026 15:43:55 +1100 Subject: [PATCH] feat: tf code --- packages/tfcode/src/agent/agent.ts | 40 +++++++++++------------------- packages/tfcode/src/cli/logo.ts | 2 +- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/packages/tfcode/src/agent/agent.ts b/packages/tfcode/src/agent/agent.ts index 2ce3f41af..d434595f7 100644 --- a/packages/tfcode/src/agent/agent.ts +++ b/packages/tfcode/src/agent/agent.ts @@ -257,35 +257,25 @@ export namespace Agent { async function loadTFCoderAgents(): Promise { const toolsPath = path.join(Global.Path.data, ".tfcode", "tools.json") - console.log("[TF Agents] Loading from:", toolsPath) try { const content = await Bun.file(toolsPath).text() const data = JSON.parse(content) - console.log("[TF Agents] File loaded, success:", data.success, "tools:", data.tools?.length) - if (!data.success || !data.tools) { - console.log("[TF Agents] No tools data, returning []") - return [] - } + if (!data.success || !data.tools) return [] - const tfAgents = data.tools + return data.tools .filter((t: any) => t.tool_type === "agent_skill") - - console.log("[TF Agents] Found agent_skill items:", tfAgents.length) - console.log("[TF Agents] Names:", tfAgents.map((t: any) => t.name)) - - return tfAgents.map((t: any): Info => ({ - name: t.name, - description: t.description, - mode: "subagent" as const, - permission: Permission.fromConfig({ "*": "allow" }), - native: false, - options: { - tf_agent_id: t.id, - tf_auth_via: t.auth_via, - }, - })) - } catch (e) { - console.log("[TF Agents] Error:", e) + .map((t: any): Info => ({ + name: t.name, + description: t.description, + mode: "primary" as const, + permission: Permission.fromConfig({ "*": "allow" }), + native: false, + options: { + tf_agent_id: t.id, + tf_auth_via: t.auth_via, + }, + })) + } catch { return [] } } @@ -295,8 +285,6 @@ export namespace Agent { const localAgents = await state() const tfAgents = await loadTFCoderAgents() - console.log("[TF Agents] list() - local:", Object.keys(localAgents).length, "tf:", tfAgents.length) - return pipe( { ...localAgents, ...Object.fromEntries(tfAgents.map(a => [a.name, a])) }, values(), diff --git a/packages/tfcode/src/cli/logo.ts b/packages/tfcode/src/cli/logo.ts index 202071e85..8d6844eb5 100644 --- a/packages/tfcode/src/cli/logo.ts +++ b/packages/tfcode/src/cli/logo.ts @@ -1,6 +1,6 @@ export const logo = { left: [" ", "▀▀▀▀ ▀▀▀▀", "_█__ █^^~", "_█__ █___"], - right: [" ", "█▀▀▀ █▀▀█ █▀▀█ █▀▀█", " █___ █__█ █__█ █^^^", " ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀"], + right: [" ", " █▀▀▀ █▀▀█ █▀▀█ █▀▀█", " █___ █__█ █__█ █^^^", " ▀▀▀▀ ▀▀▀▀ ▀▀▀▀ ▀▀▀▀"], } export const marks = "_^~"