Skip to content

DeepLifeStudio/DeepSeekAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ DeepSeekAI - Smart Web Assistant

๐Ÿ“– Introduction

DeepSeekAI is an unofficial, open-source browser extension that lets you summon a private DeepSeek-powered co-pilot anywhere on the web. Highlight text, tap a quick action, or press a shortcut to open a floating chat workspace that streams answers, shows reasoning traces, and remembers your preferred layout. The project is independent from DeepSeek, and you must provide your own API key (DeepSeek or any OpenAI-compatible endpoint).

Note: This extension is a community project and is not affiliated with DeepSeek. Keys, custom endpoints, and preferences are stored only in chrome.storage.sync on your device.

๐Ÿ”Œ Supported API Providers

โœจ Feature Overview

๐Ÿช„ Inline Assistants

  • Rich quick-action bubble appears beside any text selection with Chat, Copy, Translate (19 languages), Explain, Summarize, Email, and Analyze templates.
  • SelectionPreservationManager keeps the DOM range alive so the bubble never steals your highlight during double/triple clicks or context-menu usage.
  • Right-click context menu entry and toolbar popup both reuse the same flow, so highlighted text, manual prompts, and keyboard shortcuts share the session logic.

๐ŸชŸ Floating Workspace

  • interactjs gives the chat window magnetic drag + resize handles, snap animations, and a persistent minimize icon whose position is saved per user.
  • Toggle "Remember window size" to keep the workspace dimensions across sites, and "Pin window" to prevent accidental closes when clicking outside.
  • Minimized state, popup visibility, and icon location are tracked by popupStateManager, ensuring state survives selection changes.
  • Built-in input container includes auto-expanding textarea, send icon, abort/stop square, and smart focus rules so existing form inputs retain priority.
  • Each answer provides inline copy + regenerate controls; DeepSeek-R1/openrouter reasoning is rendered above the final response with a collapsible panel.
  • Auto-scroll follows the stream until you scroll manually. Scroll momentum + cooldown logic prevent janky jumps.

๐Ÿง  Provider & Model Controls

  • Popup UI (English/Chinese) manages API keys per provider, preferred language (auto-detect or force output), and whether the selection bubble is enabled.
  • Add, rename, hide, or delete custom providers with their own base URL, display name, default model, and placeholder API-key links.
  • ModelManager stores multiple custom models per provider. Dropdowns support inline delete buttons, and forms auto-save via TempStateManager so unfinished entries survive popup reloads.
  • Configure a global custom system prompt used for every conversation, or override per quick action via templated prompts.

๐Ÿ“ Rendering, Safety & UX Polishing

  • Markdown-It + highlight.js + KaTeX + DOMPurify ensure rich formatting, syntax highlighting, math rendering, and sanitized HTML.
  • Code blocks gain reusable โ€œCopyโ€ controls, while each AI block also exposes regenerate + share-ready text copy actions.
  • Streaming is proxied through the background service worker using modern fetch + AbortController, so stop/regenerate/shortcut commands instantly cut network traffic.
  • ThemeManager listens to prefers-color-scheme and toggles CSS variables to keep the popover and quick buttons readable in both modes.

โŒจ๏ธ Shortcuts & Invocation Options

  • Two Chrome commands ship by default:
    • Ctrl/Cmd + Shift + Y โ†’ toggle chat (new session)
    • Ctrl/Cmd + Shift + U โ†’ show/hide chat (preserve session)
  • Use chrome://extensions/shortcuts (or the โ€œShortcut Settingsโ€ link inside the popup) to rebind commands.
  • Context menu entry (โ€œDeepSeek AIโ€) sends the selected text directly, and the icon in the toolbar opens the configuration popup.

๐Ÿ” Privacy & Onboarding

  • On first install we open src/Instructions/Instructions.html, an offline-friendly Apple-style guide covering every screen.
  • PRIVACY.html documents exactly what is stored (API keys + user preferences in local browser storage) and reminds you that no remote server is involved.
  • DOMPurify sanitizes all rendered HTML, and no telemetry or analytics is collected.

๐Ÿ”„ How It Works

sequenceDiagram
    participant User
    participant Content as Content Script
    participant Background
    participant Provider
    User->>Content: Select text / press shortcut
    Content->>Background: chrome.runtime.sendMessage({ action: "proxyRequest" | "getSettings" })
    Background->>Provider: fetch(OpenAI-compatible endpoint)
    Provider-->>Background: SSE / JSON chunks
    Background-->>Content: streamResponse events (AbortController aware)
    Content-->>User: Renders markdown, reasoning, quick actions
Loading
  • content/content.js glues together selection tracking, quick actions, the popup workspace, markdown renderer, theme watcher, scroll manager, and focus manager.
  • background.js is the single network surface: it loads provider settings, streams responses, parses errors, handles aborts, manages commands/context menus, and opens onboarding tabs.
  • popup/ houses the modular settings UI (ApiKeyManager, ProviderManager, ModelManager, SystemPromptManager, etc.) with i18n + autosave.
  • Instructions/ exposes the offline guide viewed after installation.

๐Ÿš€ Installation & Build

1. Install from the store (recommended)

  • Chrome: Chrome Web Store
  • Microsoft Edge: enable โ€œAllow extensions from other stores,โ€ then install via the same Chrome Web Store listing above.

2. Manual installation / development flow

# Requirements: Node.js 18+, pnpm (or npm), and a Chromium-based browser
pnpm install
pnpm run build   # outputs the production bundle into dist/
  1. Open chrome://extensions โ†’ enable Developer mode โ†’ Load unpacked โ†’ pick the dist folder.
  2. To ship a store package, run one of:
    • pnpm run build:zip โ†’ extension.zip
    • pnpm run build:chrome โ†’ chrome-submission.zip
    • pnpm run build:edge โ†’ edge-submission.zip
  3. Upload the generated ZIP to the respective store dashboards.

๐Ÿงฉ Setup & Daily Use

  1. Click the extension icon to open the popup.
  2. Choose a provider (or create a custom one with a name + base URL + default model) and paste its API key. Each provider keeps its own key and optional custom API URL.
  3. Pick or add a model. Non-DeepSeek providers require an explicit model ID; the UI will auto-prompt you to add one if missing.
  4. Configure behavior:
    • Enable/disable the selection quick-action bubble.
    • Choose automatic language detection or force a language from the dropdown (20+ locales).
    • Toggle Save Window Size, Pin Window, and Custom System Prompt.
    • Use the Shortcut Settings link to jump to Chromeโ€™s command editor.
  5. Highlight text (or open the chat via shortcut) โ†’ the quick-action bubble appears โ†’ select Chat or a template. You can also open the floating window first and paste custom prompts.
  6. While streaming, use the stop square icon to abort. Each answer ends with copy + regenerate icons; reasoning blocks collapse/expand with one click.
  7. Need a refresher? Open the in-extension usage guide or switch to the Simplified Chinese README linked at the top.

โŒจ๏ธ Shortcuts & Quick Actions

  • Quick actions:
    • Chat โ†’ sends selection verbatim.
    • Copy โ†’ copies selection without opening chat.
    • Translate โ†’ language picker drives a prompt that asks DeepSeek to translate into your chosen target language.
    • Explain, Summarize, Email, Analyze โ†’ curated prompts (with MBTI-flavored tone) for instant structured answers.
  • Window commands: toggle-chat destroys and recreates the session; show-hide-chat keeps the current context alive between invocations; close-chat is exposed internally for context menu cleanup.
  • Context menu: right-click โ†’ โ€œDeepSeek AIโ€ to push highlighted text directly into a new chat with a contextual greeting (morning/afternoon/evening).

๐Ÿ—๏ธ Project Layout & Stack

.
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ manifest.json           # MV3 metadata & permissions
โ”‚   โ”œโ”€โ”€ background.js           # service worker + proxy + commands
โ”‚   โ”œโ”€โ”€ content/                # selection bubble, popup workspace, services, utils, styles
โ”‚   โ”œโ”€โ”€ popup/                  # settings UI (managers, i18n, HTML)
โ”‚   โ””โ”€โ”€ Instructions/           # onboarding guide (HTML + JS)
โ”œโ”€โ”€ dist/                       # build output (loaded during development/packaging)
โ”œโ”€โ”€ extension.zip               # generated via build:zip / build:chrome / build:edge
โ”œโ”€โ”€ webpack.config.js           # bundler config (Babel, CSS loader, copy plugin, terser)
โ”œโ”€โ”€ PRIVACY.html                # privacy policy
โ””โ”€โ”€ README*.md                  # documentation (English + ็ฎ€ไฝ“ไธญๆ–‡)

Key dependencies: interactjs, markdown-it, highlight.js, DOMPurify, katex, clipboard, perfect-scrollbar, and openai (for payload typing) plus the MV3 APIs exposed by Chrome/Edge.

๐Ÿ”’ Privacy & Security

  • API keys, preferences, quick-action states, and minimized icon positions live only inside chrome.storage.sync.
  • Text is sent solely to the provider endpoint you configure. There are no intermediary servers, analytics calls, or remote logs.
  • The offline privacy policy inside the repo details data handling, and DOMPurify removes any potentially unsafe markup before rendering.

๐Ÿค Contributing

Contributions are welcomeโ€”bug reports, documentation fixes, and feature proposals all help the community.

  1. Fork the repo and create a branch (git checkout -b feature/my-update).
  2. Install deps + build once (pnpm install && pnpm run build).
  3. Make your changes, keep them focused, and run pnpm run build again to ensure dist/ refreshes.
  4. Submit a Pull Request describing the change, affected files, and any verification notes.

๐Ÿ“„ License

This project is licensed under the MIT License - see LICENSE for details.

๐Ÿ“ฎ Contact

If this project helps you, please consider giving it a โญ๏ธ

About

Browser extension for invoking the DeepSeek AI large model.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •