feat: wire new providers, auth, mention-gating, and browser into daemon

Update config schema with server auth fields (token, tailscale_identity,
auth_http), channel mention settings, browser config, and openrouter/bedrock
provider enum values. Wire GeminiClient, BedrockClient, OpenRouter into
createClientFromConfig. Initialize BrowserManager and register browser tools
in daemon startup. Pass auth config and channel mention settings through to
gateway and adapters. Add puppeteer-core, @google/generative-ai, and
@aws-sdk/client-bedrock-runtime dependencies.
This commit is contained in:
William Valentin
2026-02-06 16:52:18 -08:00
parent 8c56a5a1a8
commit 880744846f
5 changed files with 1163 additions and 7 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
export { loadConfig } from './loader.js';
export { configSchema, type Config, type TelegramConfig, type ModelConfig, type CronJobConfig, type AgentsConfig, type CompactionConfig, type ToolProfile, type ToolOverrideConfig, type ToolsConfig, type SandboxConfig, type AgentConfigEntry, type RoutingConfig } from './schema.js';
export { configSchema, type Config, type TelegramConfig, type ModelConfig, type CronJobConfig, type AgentsConfig, type CompactionConfig, type ToolProfile, type ToolOverrideConfig, type ToolsConfig, type SandboxConfig, type AgentConfigEntry, type RoutingConfig, type ServerConfig } from './schema.js';
+23 -1
View File
@@ -3,16 +3,23 @@ import { z } from 'zod';
const telegramSchema = z.object({
bot_token: z.string().min(1, 'Bot token is required'),
allowed_chat_ids: z.array(z.number()).min(1, 'At least one chat ID required'),
require_mention: z.boolean().default(true),
});
const serverSchema = z.object({
tailscale_only: z.boolean().default(true),
localhost: z.boolean().default(true),
port: z.number().default(18800),
/** Static bearer token for gateway auth. If set, all connections must provide it. */
token: z.string().optional(),
/** Trust Tailscale-User-Login header for identity. */
tailscale_identity: z.boolean().default(false),
/** Apply token auth to HTTP requests too (not just WebSocket). Default: true when token is set. */
auth_http: z.boolean().default(true),
});
const modelConfigSchema = z.object({
provider: z.enum(['anthropic', 'openai', 'gemini', 'ollama', 'llamacpp']),
provider: z.enum(['anthropic', 'openai', 'gemini', 'ollama', 'llamacpp', 'openrouter', 'bedrock']),
model: z.string(),
endpoint: z.string().optional(),
api_key: z.string().optional(),
@@ -133,13 +140,25 @@ const slackSchema = z.object({
app_token: z.string().min(1, 'App token is required'),
signing_secret: z.string().min(1, 'Signing secret is required'),
allowed_channel_ids: z.array(z.string()).default([]),
require_mention: z.boolean().default(false),
}).optional();
const whatsappSchema = z.object({
allowed_numbers: z.array(z.string()).default([]),
allowed_group_ids: z.array(z.string()).default([]),
require_mention: z.boolean().default(true),
data_dir: z.string().optional(),
}).optional();
const browserSchema = z.object({
enabled: z.boolean().default(false),
executable_path: z.string().optional(),
ws_endpoint: z.string().optional(),
headless: z.boolean().default(true),
max_pages: z.number().min(1).max(20).default(5),
default_timeout: z.number().min(1000).max(120000).default(30000),
}).default({});
const processSchema = z.object({
max_concurrent: z.number().min(1).max(50).default(10),
max_runtime_minutes: z.number().min(1).max(1440).default(60),
@@ -237,6 +256,7 @@ export const configSchema = z.object({
compaction: compactionSchema,
memory: memorySchema,
process: processSchema,
browser: browserSchema,
retry: retrySchema,
web_search: webSearchSchema,
prompt: promptSchema,
@@ -255,6 +275,7 @@ export type CompactionConfig = z.infer<typeof compactionSchema>;
export type MemoryConfig = z.infer<typeof memorySchema>;
export type WebSearchConfig = z.infer<typeof webSearchSchema>;
export type ProcessConfig = z.infer<typeof processSchema>;
export type BrowserConfig = z.infer<typeof browserSchema>;
export type DiscordConfig = z.infer<typeof discordSchema>;
export type SlackConfig = z.infer<typeof slackSchema>;
export type WhatsAppConfig = z.infer<typeof whatsappSchema>;
@@ -266,3 +287,4 @@ export type ToolsConfig = z.infer<typeof toolsSchema>;
export type SandboxConfig = z.infer<typeof sandboxSchema>;
export type AgentConfigEntry = z.infer<typeof agentConfigEntrySchema>;
export type RoutingConfig = z.infer<typeof routingSchema>;
export type ServerConfig = z.infer<typeof serverSchema>;