Package Exports
- anouk
- anouk/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (anouk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Anouk - AI Browser Extension Framework
Overview
Anouk is a framework for creating browser extensions with AI capabilities. It provides a flexible foundation for developers to build extensions that work with any OpenAI-compatible provider, including OpenAI, Together.xyz, Anthropic, and local models like Ollama.
The framework includes the Gmail Assistant as a reference implementation showing how to build a powerful email productivity tool.
Features
- Multi-Provider Support: Works with any OpenAI-compatible API provider
- Configurable UI Components: Reusable sidebar, floating buttons, and settings panels
- Caching System: Built-in caching to reduce API calls
- Rate Limiting: Queue management for API calls
- Easy Configuration: In-extension settings panel for runtime configuration
- Modular Design: Extensible architecture for custom functionality
- CLI Tool: Command-line interface for generating projects and templates
Installation
Clone this repository:
git clone https://github.com/yourusername/anouk.git cd anoukInstall dependencies:
npm installBuild the extension:
npm run buildLoad the extension in Chrome:
- Open Chrome and navigate to
chrome://extensions - Enable "Developer mode" in the top right corner
- Click "Load unpacked" and select the project directory
- Open Chrome and navigate to
CLI Usage
Anouk provides a command-line interface for generating projects and templates:
anouk <command> [options]
Commands:
init <project-name> Initialize a new Anouk project
generate <template> <name> Generate a template file
help Show help message
Templates:
extension Generate a basic extension template
service Generate an AI service template
config Generate a configuration template
Examples:
anouk init my-extension
anouk generate extension email-analyzer
anouk generate service custom-ai-serviceConfiguration
The extension now supports any OpenAI-compatible provider. You can configure the AI service through the settings panel in the extension UI or programmatically.
Using the Settings Panel
- Click the green settings button in the bottom-right corner of Gmail
- Enter your provider URL, API key, model name, and system prompt
- Click "Save Settings"
Programmatic Configuration
You can also configure the AI service programmatically by modifying the src/aiConfig.js file or by passing configuration to the AIService constructor.
Supported Providers
The extension has predefined configurations for:
- Together.xyz (default)
- OpenAI
- Anthropic Claude
- Ollama (local models)
- Hugging Face
Example configuration for OpenAI:
{
providerUrl: 'https://api.openai.com/v1/chat/completions',
apiKey: 'your-openai-api-key',
model: 'gpt-4',
systemPrompt: 'You are a helpful assistant that analyzes emails.'
}Usage as a Library
Developers can use this project as a library to create their own AI-powered browser extensions:
import { AIService } from 'anouk';
// Create an AI service instance
const aiService = new AIService({
providerUrl: 'https://api.openai.com/v1/chat/completions',
apiKey: 'your-api-key',
model: 'gpt-4'
});
// Make AI calls
const response = await aiService.call(
'Summarize this text:',
'Your content here',
'unique-id',
'cache-key'
);Development
- Run the development build with watch mode:
npm run dev - The extension will automatically rebuild when you make changes to the source files.
Project Structure
src/: Source filesaiService.js: Configurable AI service for any OpenAI-compatible providerconfigManager.js: Configuration managementsettingsPanel.js: UI component for in-extension settingsextension.js: Main extension logic (Gmail Assistant reference implementation)api.js: API interaction and caching logicgmailJsLoader.js: Gmail.js initialization
dist/: Built files (generated after runningnpm run build)manifest.json: Chrome extension manifest filebin/: CLI toolstemplates/: Template files for CLI
Dependencies
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Disclaimer
This extension is not affiliated with or endorsed by Google. Use at your own risk and ensure compliance with Gmail's terms of service.
Installation
Clone this repository:
git clone https://github.com/yourusername/gmail-assistant.git cd gmail-assistantInstall dependencies:
npm installBuild the extension:
npm run buildLoad the extension in Chrome:
- Open Chrome and navigate to
chrome://extensions - Enable "Developer mode" in the top right corner
- Click "Load unpacked" and select the
distdirectory in the project folder
- Open Chrome and navigate to
Configuration
The extension now supports any OpenAI-compatible provider. You can configure the AI service through the settings panel in the extension UI or programmatically.
Using the Settings Panel
- Click the green settings button in the bottom-right corner of Gmail
- Enter your provider URL, API key, model name, and system prompt
- Click "Save Settings"
Programmatic Configuration
You can also configure the AI service programmatically by modifying the src/aiConfig.js file or by passing configuration to the AIService constructor.
Supported Providers
The extension has predefined configurations for:
- Together.xyz (default)
- OpenAI
- Anthropic Claude
- Ollama (local models)
- Hugging Face
Example configuration for OpenAI:
{
providerUrl: 'https://api.openai.com/v1/chat/completions',
apiKey: 'your-openai-api-key',
model: 'gpt-4',
systemPrompt: 'You are a helpful assistant that analyzes emails.'
}Usage
- Open Gmail in Chrome.
- The Gmail Assistant sidebar will appear on the right side of the screen.
- As you view emails, the assistant will automatically analyze them and provide summaries, structured data, and potential replies.
- Use the "Send Automatic Reply" button to trigger automatic replies based on predefined rules.
Development
- Run the development build with watch mode:
npm run dev - The extension will automatically rebuild when you make changes to the source files.
Project Structure
src/: Source filesextension.js: Main extension logicapi.js: API interaction and caching logicgmailJsLoader.js: Gmail.js initialization
dist/: Built files (generated after runningnpm run build)manifest.json: Chrome extension manifest file
Dependencies
- gmail.js: Library for interacting with Gmail
- sqlite3: SQLite database for caching
- esbuild: Fast JavaScript bundler
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Disclaimer
This extension is not affiliated with or endorsed by Google. Use at your own risk and ensure compliance with Gmail's terms of service.