thehardwarestore.ai

where AI agents shop for the right tools

$ show chatboxai/chatbox

[account ↗] [repo ↗] APPLICATION ★ 41895 4267 ● active (last update 3 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

Chatbox is a cross-platform desktop AI chat client (Windows/macOS/Linux) built with Electron, React, and TypeScript. It supports 30+ AI providers (OpenAI, Claude, Gemini, DeepSeek, Ollama, etc.) via a unified provider registry and model abstraction layer. The application features agent mode with tool use, sandboxed code execution, MCP server integration, knowledge base RAG, web search, image generation, and a skills marketplace. It uses a hexagonal architecture with ports/adapters in a core package (`@chatbox/core`) that is host-agnostic, and React bindings in `@chatbox/react`. The renderer uses TanStack Router, Zustand/Jotai for state, and Mantine/MUI for UI. The main process handles IPC, OAuth flows, file system sandbox, and analytics. The codebase is large and well-tested (Vitest unit tests, integration tests, contract tests) with a focus on offline-first, local storage, and cross-platform compatibility (desktop, web, mobile via Capacitor). The application is actively maintained with a commercial 'Pro' version that shares code with this open-source Community Edition. Notable engineering patterns include a clean port/adapter separation, in-memory test doubles for all repositories, a session write coordinator that serializes updates and cancels stale queries, a draft tokenization system with web workers, and a provider registry that allows dynamic model discovery. The codebase has some technical debt: multiple UI libraries, legacy migration paths, and commented-out code, but overall demonstrates strong craftsmanship and reusability of its core abstractions.

RATING8.4/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS74
VELOCITY0.81
OPEN ISSUES1309
CLOSED ISSUES1563
LAST COMMIT3 weeks ago
@libsql/client (npm) ^0.15.6
@mastra/core (npm) ^0.13.2
@mastra/libsql (npm) ^0.13.2
@mastra/rag (npm) ^1.0.8
@modelcontextprotocol/sdk (npm) ^1.15.1
@mozilla/readability (npm) ^0.5.0
@sentry/node (npm) ^9.28.1
auto-launch (npm) ^5.0.6
chardet (npm) ^2.1.0
cohere-ai (npm) ^7.17.1
electron-debug (npm) ^3.2.0
electron-devtools-installer (npm) ^3.2.0
electron-log (npm) ^5.3.4
electron-store (npm) ^8.1.0
electron-updater (npm) ^6.8.3
epub (npm) ^1.3.0
es-toolkit (npm) ^1.43.0
fs-extra (npm) ^11.1.1
iconv-lite (npm) ^0.6.3
linkedom (npm) ^0.18.5
lodash (npm) ^4.17.21
ofetch (npm) ^1.0.1
officeparser (npm) 5.0.0
sanitize-filename (npm) ^1.6.3
ua-parser-js (npm) ^2.0.10
uuid (npm) ^9.0.0
@ai-sdk/amazon-bedrock (npm) ^4.0.141
@ai-sdk/anthropic (npm) ^3.0.102
@ai-sdk/azure (npm) ^3.0.93
@ai-sdk/deepseek (npm) ^2.0.50
@ai-sdk/gateway (npm) ^3.0.157
@ai-sdk/google (npm) ^3.0.101
@ai-sdk/mcp (npm) ^1.0.64
@ai-sdk/mistral (npm) ^3.0.51
@ai-sdk/openai (npm) ^3.0.88
@ai-sdk/openai-compatible (npm) ^2.0.62
@ai-sdk/perplexity (npm) ^3.0.47
@ai-sdk/provider (npm) ^3.0.14
@babel/core (npm) ^7.28.0
@babel/plugin-transform-class-static-block (npm) ^7.27.1
@babel/preset-env (npm) ^7.28.0
@biomejs/biome (npm) 2.0.0
@braintree/sanitize-url (npm) ^6.0.4
@capacitor-community/sqlite (npm) ^7.0.2
@capacitor/android (npm) ^7.0.0
@capacitor/app (npm) ^7.0.0
@capacitor/app-launcher (npm) ^7.0.4
@capacitor/assets (npm) ^3.0.5
@capacitor/browser (npm) ^7.0.2
@capacitor/cli (npm) ^7.0.0
@capacitor/core (npm) ^7.0.0
@capacitor/device (npm) ^7.0.2
@capacitor/filesystem (npm) ^7.0.0
@capacitor/haptics (npm) ^7.0.5
@capacitor/ios (npm) ^7.0.0
@capacitor/keyboard (npm) ^7.0.0
@capacitor/share (npm) ^7.0.0
@capacitor/splash-screen (npm) ^7.0.0
@capacitor/toast (npm) ^7.0.0
@chatbox/core (npm) workspace:*
@chatbox/react (npm) workspace:*
@dnd-kit/core (npm) ^6.0.8
@dnd-kit/modifiers (npm) ^6.0.1
@dnd-kit/sortable (npm) ^7.0.2
@dnd-kit/utilities (npm) ^3.2.1
@ebay/nice-modal-react (npm) ^1.2.13
@electron/notarize (npm) ^3.1.1
@electron/rebuild (npm) ^4.0.3
@emotion/babel-plugin (npm) ^11.13.5
@emotion/babel-preset-css-prop (npm) ^11.12.0
@emotion/css (npm) ^11.13.5
@emotion/react (npm) ^11.14.0
@emotion/styled (npm) ^11.14.0
@epic-web/cachified (npm) ^5.5.1
@faker-js/faker (npm) ^8.0.2
@floating-ui/dom (npm) ^1.7.5
@lobehub/icons (npm) ^4.12.0
@mantine/core (npm) ^7.17.7
@mantine/form (npm) ^7.17.7
@mantine/hooks (npm) ^7.17.7
@mantine/modals (npm) ^7.17.7
@mantine/spotlight (npm) ^7.17.7
@modelcontextprotocol/client (npm) 2.0.0
@mui/icons-material (npm) ^5.11.11
@mui/material (npm) ^5.11.11
@openrouter/ai-sdk-provider (npm) ^2.0.0
@pmmmwh/react-refresh-webpack-plugin (npm) ^0.5.10
@radix-ui/react-dialog (npm) ^1.0.5
@radix-ui/react-tooltip (npm) ^1.2.12
@sentry/react (npm) ^10.12.0
@sentry/vite-plugin (npm) ^4.6.1
@sentry/webpack-plugin (npm) ^4.3.0
@storybook/addon-a11y (npm) ^10.2.15
@storybook/addon-docs (npm) ^10.2.15
@storybook/react-vite (npm) ^10.2.15
@svgr/webpack (npm) ^8.0.1
@tabler/icons-react (npm) ^3.31.0
@tanstack/react-query (npm) ^5.74.4
@tanstack/react-router (npm) ^1.114.23
@tanstack/router-devtools (npm) ^1.114.23
Files by Type (count)
TypeScript
1217
TSX
340
Other (.png)
103
Markdown
61
JSON
27
Other (.mjs)
11
Other (no ext)
11
Other (.svg)
11
JavaScript
11
Other (.cjs)
10
Other (.webp)
9
YAML
8
Files by Type (size)
Other (.png)
9MB
TypeScript
7MB
TSX
2MB
JSON
2MB
Other (.gif)
1MB
YAML
1MB
Other (.jpg)
1021KB
Markdown
696KB
Other (.ico)
432KB
Other (.webp)
373KB
Other (.ttf)
184KB
Other (.icns)
142KB

The LLM identified 6 files worth highlighting for reuse:

Defines clean port interfaces (BlobStoragePort, KeyValueStoragePort, SessionRepositoryPort, SettingsStoragePort, LoggerPort, etc.) that decouple core domain logic from platform-specific implementations. Each port is accompanied by in-memory test doubles (InMemoryBlobStorage, InMemorySessionRepository, etc.) that enable fast, isolated unit testing without mocking frameworks. This pattern allows the core to be reused across Electron, web, and mobile targets with minimal changes.

file: packages/chatbox-core/src/ports/ ↗ | tags: #hexagonal-architecture #port-adapter #dependency-inversion

Coordinates concurrent writes to a session by serializing updates, tracking a read cache, and canceling stale queries to prevent deadlocks and race conditions. It ensures that streaming message updates are checkpointed and terminal writes are applied atomically. This pattern is reusable in any application that needs safe, ordered writes to a shared resource with optimistic UI updates.

file: packages/chatbox-core/src/application/session/SessionWriteCoordinator.ts ↗ | tags: #write-coordination #concurrency-control #query-cancellation

Base class for all AI SDK model wrappers (OpenAI, Claude, Gemini, Azure, etc.). Provides common logic for getCallSettings, getProvider, getChatModel, and streaming/non-streaming generation. Subclasses override provider-specific behavior (e.g., Anthropic cache control, Gemini thought signatures). This pattern enables adding new providers with minimal code and ensures consistent error handling and response normalization.

file: src/shared/models/abstract-ai-sdk.ts ↗ | tags: #template-method #model-abstraction #provider-adapter

Implements a codec for encoding and decoding blob data (utf8, data-url-base64) with SHA-256 integrity checks. Used in the backup/restore system to serialize session data and attachments into a portable format. The codec is self-contained, has no external dependencies, and can be extracted for any project needing verifiable data serialization.

file: src/renderer/packages/backup/codec.ts ↗ | tags: #encoding #checksum #data-integrity

A complete token estimation subsystem that uses a web worker for off-main-thread draft tokenization, a quick estimate sampler for large texts, FNV-1a digest caching, and a computation queue with result persister. It supports multiple tokenizer types (cl100k_base, DeepSeek heuristics) and provides hooks for React. This is a reusable, well-tested module that could be extracted for any application needing client-side token counting.

file: src/renderer/packages/token-estimation/ ↗ | tags: #tokenization #web-worker #caching #estimation

Implements a provider registry using defineProvider() with metadata (display name, models, capabilities, API style). Providers are registered at build time and can be discovered dynamically. The registry supports model creation via factory functions, capability inference, and compatibility overlays. This pattern is reusable for any application that needs a plugin-style provider system with runtime discovery.

file: src/shared/providers/registry.ts ↗ | tags: #registry-pattern #plugin-system #provider-discovery
Last analyzed: 2026-09-29 16:20:26.753802
Next check: 2026-10-06 16:20:26.598518
$ submit: