feat: add environment variables support for agents and collections

- Add envVars field to Agent and Collection models in Prisma schema
- Add envVars to UpdateAgentSchema and UpdateCollectionSchema types
- Implement env vars merging logic (agent overrides collection)
- Pass env vars through tool executor to sandbox
- Add UI for managing env vars in agent and collection settings pages
- Update API routes to handle envVars PATCH updates
- Refactor discord tool execute functions for biome compatibility

This allows users to configure tool-specific environment variables (like
DISCORD_BOT_TOKEN) at both the collection and agent level, with agent
settings taking precedence over collection settings.
This commit is contained in:
Ajax Davis 2026-01-12 01:35:29 +10:00
parent 079c328bfc
commit 938a382aab
25 changed files with 2021 additions and 15 deletions

26
pnpm-lock.yaml generated
View file

@ -716,6 +716,32 @@ importers:
specifier: ^5.9.3
version: 5.9.3
packages/tools/discord-post:
dependencies:
ai:
specifier: 6.0.23
version: 6.0.23(zod@4.3.5)
devDependencies:
'@tpmjs/tsconfig':
specifier: workspace:*
version: link:../../config/tsconfig
typescript:
specifier: ^5.9.3
version: 5.9.3
packages/tools/discord-read:
dependencies:
ai:
specifier: 6.0.23
version: 6.0.23(zod@4.3.5)
devDependencies:
'@tpmjs/tsconfig':
specifier: workspace:*
version: link:../../config/tsconfig
typescript:
specifier: ^5.9.3
version: 5.9.3
packages/tools/emoji-magic:
dependencies:
ai: