| 112 | } |
| 113 | |
| 114 | export async function tools(providerID: string) { |
| 115 | const tools = await all() |
| 116 | const result = await Promise.all( |
| 117 | tools |
| 118 | .filter((t) => { |
| 119 | // Enable websearch/codesearch for zen users OR via enable flag |
| 120 | if (t.id === "codesearch" || t.id === "websearch") { |
| 121 | return providerID === "arctic" || Flag.ARCTIC_ENABLE_EXA |
| 122 | } |
| 123 | return true |
| 124 | }) |
| 125 | .map(async (t) => ({ |
| 126 | id: t.id, |
| 127 | ...(await t.init()), |
| 128 | })), |
| 129 | ) |
| 130 | return result |
| 131 | } |
| 132 | |
| 133 | export async function enabled(agent: Agent.Info): Promise<Record<string, boolean>> { |
| 134 | const result: Record<string, boolean> = {} |