Open source file-system and knowledge based agent template. Build AI agents that stay up to date with your knowledge base
up
Hugo Richard2997b572e080
diff --git a/apps/chat/server/api/chats/[id].post.ts b/apps/chat/server/api/chats/[id].post.tsindex 44f1e2f..132ed2b 100644--- a/apps/chat/server/api/chats/[id].post.ts+++ b/apps/chat/server/api/chats/[id].post.ts@@ -1,4 +1,4 @@-import { convertToModelMessages, createUIMessageStream, createUIMessageStreamResponse, ToolLoopAgent, type UIMessage } from 'ai'+import { convertToModelMessages, createUIMessageStream, createUIMessageStreamResponse, stepCountIs, ToolLoopAgent, type UIMessage } from 'ai'import { z } from 'zod'import { db, schema } from '@nuxthub/db'import { and, eq } from 'drizzle-orm'diff --git a/apps/github-bot/package.json b/apps/github-bot/package.jsonindex 6cc8358..8d8fdd0 100644--- a/apps/github-bot/package.json+++ b/apps/github-bot/package.json@@ -11,15 +11,16 @@"typecheck": "nuxt typecheck"},"dependencies": {- "@ai-sdk/gateway": "^3.0.29",+ "@ai-sdk/gateway": "^3.0.32","@savoir/sdk": "workspace:*",- "ai": "^6.0.62",+ "ai": "^6.0.68","chat": "^4.7.1","mdast-util-from-markdown": "^2.0.2","mdast-util-gfm": "^3.1.0","mdast-util-to-markdown": "^2.1.2","micromark-extension-gfm": "^3.0.0",- "nuxt": "^4.3.0"+ "nuxt": "^4.3.0",+ "zod": "^4.3.6"},"devDependencies": {"@nuxthub/core": "^0.10.5",diff --git a/apps/github-bot/server/utils/ai.ts b/apps/github-bot/server/utils/ai.tsindex 6d55acf..f02c31f 100644--- a/apps/github-bot/server/utils/ai.ts+++ b/apps/github-bot/server/utils/ai.ts@@ -41,7 +41,7 @@ Once configured, I'll be able to search the documentation and help answer your qconst agent = new ToolLoopAgent({model: 'google/gemini-3-flash',instructions: buildSystemPrompt(context),- tools: { bash: savoir.tools.bash } as any,+ tools: savoir.tools,onStepFinish: ({ usage, toolCalls }) => {stepCount++totalInputTokens += usage.inputTokens || 0@@ -70,8 +70,7 @@ Once configured, I'll be able to search the documentation and help answer your q}return result.text- }- catch (error) {+ } catch (error) {const durationMs = Date.now() - startTimeconst errorMessage = error instanceof Error ? error.message : 'Unknown error'log.error('github-bot', `Agent failed after ${durationMs}ms: ${errorMessage}`)diff --git a/apps/github-bot/tsconfig.json b/apps/github-bot/tsconfig.jsonindex 6ae5970..dd3a40a 100644--- a/apps/github-bot/tsconfig.json+++ b/apps/github-bot/tsconfig.json@@ -1,17 +1,3 @@{- "files": [],- "references": [- {- "path": "./.nuxt/tsconfig.app.json"- },- {- "path": "./.nuxt/tsconfig.server.json"- },- {- "path": "./.nuxt/tsconfig.shared.json"- },- {- "path": "./.nuxt/tsconfig.node.json"- }- ]+ "extends": "./.nuxt/tsconfig.server.json"}diff --git a/bun.lock b/bun.lockindex 2edaf19..2c87d73 100644--- a/bun.lock+++ b/bun.lock@@ -1,6 +1,5 @@{"lockfileVersion": 1,- "configVersion": 0,"workspaces": {"": {"name": "@savoir/monorepo",@@ -53,15 +52,16 @@"name": "@savoir/github-bot","version": "0.0.1","dependencies": {- "@ai-sdk/gateway": "^3.0.29",+ "@ai-sdk/gateway": "^3.0.32","@savoir/sdk": "workspace:*",- "ai": "^6.0.62",+ "ai": "^6.0.68","chat": "^4.7.1","mdast-util-from-markdown": "^2.0.2","mdast-util-gfm": "^3.1.0","mdast-util-to-markdown": "^2.1.2","micromark-extension-gfm": "^3.0.0","nuxt": "^4.3.0",+ "zod": "^4.3.6",},"devDependencies": {"@nuxthub/core": "^0.10.5",diff --git a/packages/sdk/tsdown.config.ts b/packages/sdk/tsdown.config.tsindex 03c2d29..27412ff 100644--- a/packages/sdk/tsdown.config.ts+++ b/packages/sdk/tsdown.config.ts@@ -8,4 +8,5 @@ export default defineConfig({},clean: true,hash: false,+ external: ['ai', 'zod'],})