mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-08-31 20:29:56 +02:00
Multi-provider support (WIP - not fully tested): - Owned agent loop replacing claude_agent_sdk (agent_loop.py, mcp_client.py) - Provider adapters: Anthropic (native), OpenAI-compat (any endpoint), Gemini (native + schema cleaning) - 19 models across 9 providers (Anthropic, OpenAI, Google, xAI, Meta, DeepSeek, Mistral, Qwen, Cohere) - OpenRouter integration for 300+ models via single API key - Builtin tool reimplementations (Read, Write, Edit, Glob, Grep, Bash, WebSearch, WebFetch, AskUserQuestion) - Standalone MCP client manager (stdio/sse/http) - Frontend: grouped model dropdown, provider selection, dynamic context windows Analytics (tested): - PostHog integration as single analytics source - Tracks: app.opened, session.started/completed, tool.called, tool.approval_resolved, error.occurred - Rich session data: user messages, assistant messages, session titles, tools used, MCP servers, task categories - PostHog dashboard with 14 insights created via API - Usage stats in Settings (Usage tab) with pixel-art bars Settings (tested): - 4 tabs: General, Models, Usage, Commands - Model Providers tab with OpenRouter (recommended), Anthropic, OpenAI, Google key fields - "Get key" links for each provider - Usage tab with session/cost/tool stats + analytics opt-in toggle - analytics_opt_in defaults to true, installation_id auto-generated Merged haik/updates-v1 (tested): - Sub-agent spawning, chat branching, browser control improvements - Settings: auto_select_mode, expand_new_chats, auto_reveal_sub_agents, dev_mode Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
85 lines
2.6 KiB
TypeScript
85 lines
2.6 KiB
TypeScript
import React from 'react';
|
|
import Box from '@mui/material/Box';
|
|
import Typography from '@mui/material/Typography';
|
|
import Button from '@mui/material/Button';
|
|
import Paper from '@mui/material/Paper';
|
|
import { useAppDispatch, useAppSelector } from '@/shared/hooks';
|
|
import { updateSettings } from '@/shared/state/settingsSlice';
|
|
import { useClaudeTokens } from '@/shared/styles/ThemeContext';
|
|
|
|
const AnalyticsOptIn: React.FC = () => {
|
|
const c = useClaudeTokens();
|
|
const dispatch = useAppDispatch();
|
|
const settings = useAppSelector((s) => s.settings.data);
|
|
const loaded = useAppSelector((s) => s.settings.loaded);
|
|
|
|
if (!loaded || settings.analytics_opt_in !== null) return null;
|
|
|
|
const handleChoice = (optIn: boolean) => {
|
|
dispatch(updateSettings({ ...settings, analytics_opt_in: optIn }));
|
|
};
|
|
|
|
return (
|
|
<Box
|
|
sx={{
|
|
position: 'fixed',
|
|
bottom: 24,
|
|
left: '50%',
|
|
transform: 'translateX(-50%)',
|
|
zIndex: 1400,
|
|
maxWidth: 480,
|
|
width: '90%',
|
|
}}
|
|
>
|
|
<Paper
|
|
elevation={0}
|
|
sx={{
|
|
p: 2.5,
|
|
bgcolor: c.bg.surface,
|
|
border: `1px solid ${c.border.medium}`,
|
|
borderRadius: 3,
|
|
boxShadow: c.shadow.lg,
|
|
}}
|
|
>
|
|
<Typography sx={{ color: c.text.primary, fontSize: '0.9rem', fontWeight: 600, mb: 0.5 }}>
|
|
Help improve OpenSwarm
|
|
</Typography>
|
|
<Typography sx={{ color: c.text.muted, fontSize: '0.8rem', lineHeight: 1.5, mb: 2 }}>
|
|
Share anonymous usage statistics like session counts, feature usage, and model preferences.
|
|
No conversations, file paths, or personal information — ever.
|
|
You can change this anytime in Settings.
|
|
</Typography>
|
|
<Box sx={{ display: 'flex', gap: 1, justifyContent: 'flex-end' }}>
|
|
<Button
|
|
onClick={() => handleChoice(false)}
|
|
sx={{
|
|
color: c.text.muted,
|
|
textTransform: 'none',
|
|
fontSize: '0.82rem',
|
|
'&:hover': { bgcolor: `${c.text.tertiary}0A` },
|
|
}}
|
|
>
|
|
No thanks
|
|
</Button>
|
|
<Button
|
|
variant="contained"
|
|
onClick={() => handleChoice(true)}
|
|
sx={{
|
|
bgcolor: c.accent.primary,
|
|
'&:hover': { bgcolor: c.accent.pressed },
|
|
textTransform: 'none',
|
|
fontSize: '0.82rem',
|
|
borderRadius: 1.5,
|
|
px: 2,
|
|
}}
|
|
>
|
|
Share anonymous data
|
|
</Button>
|
|
</Box>
|
|
</Paper>
|
|
</Box>
|
|
);
|
|
};
|
|
|
|
export default AnalyticsOptIn;
|