How jcalhinho/dacti works
DACTI is a Chrome extension for text assistance. A user selects page text (or uses page context) and triggers a task through the toolbar, context menu, or shortcut; the background worker coordinates the task and updates the floating panel. Task modules prefer Chrome’s local AI APIs and can fall back to cloud generation, with optional PII masking and session caching. The graph follows documented flows and shown calls; some panel-to-worker task wiring and unsampled task implementations are represented only where README or the source index supports them.
Main entry points: index.ts Background worker · gemini-api.ts Cloud API client · events.ts Content event bridge · panel.ts Floating panel
Components 19
Extension interaction
- Floating panel
src/content/panel.ts - Content event bridge
src/content/events.ts - Panel state
src/content/globals.ts - Markdown renderer
src/content/utils.ts
Task coordination
- Background worker
src/background/index.ts - Session cache
AI capabilities
- Summarization
src/shared/ai/summarizer.ts - Translation
src/shared/ai/translator.ts - Rewriting
src/shared/ai/rewriter.ts - Writing
src/shared/ai/writer.ts - Proofreading
src/shared/ai/proofreader.ts - PII masking
src/shared/utils/mask.ts
AI execution
- Chrome local AI
- Cloud API client
src/shared/ai/gemini-api.ts
Other components
- User
- Chrome APIs
- Page context
- Cloud proxy
- Gemini REST API
Connections 32
- User → Floating panel: opens
README.md - User → Background worker: triggers task
README.md - Page context → Background worker: provides context
README.md - Background worker → Floating panel: updates progress
README.md - Floating panel → Background worker: cancels task
src/content/panel.ts - Background worker → Session cache: reads and writes
src/background/index.ts - Background worker → Summarization: summarizes
src/background/index.ts - Background worker → Translation: translates
src/background/index.ts - Background worker → Rewriting: rewrites
src/background/index.ts - Background worker → Writing: generates text
src/background/index.ts - Background worker → Proofreading: proofreads
src/background/index.ts - Background worker → Content event bridge: requests local task
src/background/index.ts - Content event bridge → Chrome local AI: runs local AI
src/content/events.ts - Content event bridge → Panel state: updates
src/content/events.ts - Floating panel → Panel state: uses
src/content/panel.ts - Floating panel → Markdown renderer: renders output
README.md - Content event bridge → Markdown renderer: renders output
README.md - Content event bridge → PII masking: masks PII
src/content/events.ts - Background worker → PII masking: masks PII
src/background/index.ts - Summarization → Chrome local AI: tries local
src/shared/ai/summarizer.ts - Translation → Chrome local AI: tries local
src/shared/ai/translator.ts - Rewriting → Chrome local AI: tries local
- Writing → Chrome local AI: tries local
README.md - Proofreading → Chrome local AI: tries local
src/shared/ai/proofreader.ts - Summarization → Cloud API client: falls back
src/shared/ai/summarizer.ts - Translation → Cloud API client: falls back
src/shared/ai/translator.ts - Rewriting → Cloud API client: falls back
src/shared/ai/rewriter.ts - Writing → Cloud API client: falls back
src/shared/ai/writer.ts - Proofreading → Cloud API client: falls back
src/shared/ai/proofreader.ts - Cloud API client → Cloud proxy: sends request
src/shared/ai/gemini-api.ts - Cloud API client → Gemini REST API: sends request
src/shared/ai/gemini-api.ts - Chrome APIs → Background worker: dispatches events
src/background/index.ts