sentinel-ai-os 1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. sentinel_ai_os-1.0/LICENSE +21 -0
  2. sentinel_ai_os-1.0/MANIFEST.in +1 -0
  3. sentinel_ai_os-1.0/PKG-INFO +282 -0
  4. sentinel_ai_os-1.0/README.md +225 -0
  5. sentinel_ai_os-1.0/pyproject.toml +82 -0
  6. sentinel_ai_os-1.0/sentinel/__init__.py +0 -0
  7. sentinel_ai_os-1.0/sentinel/auth.py +40 -0
  8. sentinel_ai_os-1.0/sentinel/cli.py +9 -0
  9. sentinel_ai_os-1.0/sentinel/core/__init__.py +0 -0
  10. sentinel_ai_os-1.0/sentinel/core/agent.py +298 -0
  11. sentinel_ai_os-1.0/sentinel/core/audit.py +48 -0
  12. sentinel_ai_os-1.0/sentinel/core/cognitive.py +94 -0
  13. sentinel_ai_os-1.0/sentinel/core/config.py +99 -0
  14. sentinel_ai_os-1.0/sentinel/core/llm.py +143 -0
  15. sentinel_ai_os-1.0/sentinel/core/registry.py +351 -0
  16. sentinel_ai_os-1.0/sentinel/core/scheduler.py +61 -0
  17. sentinel_ai_os-1.0/sentinel/core/schema.py +11 -0
  18. sentinel_ai_os-1.0/sentinel/core/setup.py +101 -0
  19. sentinel_ai_os-1.0/sentinel/core/ui.py +112 -0
  20. sentinel_ai_os-1.0/sentinel/main.py +110 -0
  21. sentinel_ai_os-1.0/sentinel/paths.py +77 -0
  22. sentinel_ai_os-1.0/sentinel/tools/__init__.py +0 -0
  23. sentinel_ai_os-1.0/sentinel/tools/apps.py +462 -0
  24. sentinel_ai_os-1.0/sentinel/tools/audio.py +30 -0
  25. sentinel_ai_os-1.0/sentinel/tools/browser.py +66 -0
  26. sentinel_ai_os-1.0/sentinel/tools/calendar_ops.py +163 -0
  27. sentinel_ai_os-1.0/sentinel/tools/clock.py +25 -0
  28. sentinel_ai_os-1.0/sentinel/tools/context.py +40 -0
  29. sentinel_ai_os-1.0/sentinel/tools/desktop.py +116 -0
  30. sentinel_ai_os-1.0/sentinel/tools/email_ops.py +62 -0
  31. sentinel_ai_os-1.0/sentinel/tools/factory.py +125 -0
  32. sentinel_ai_os-1.0/sentinel/tools/file_ops.py +81 -0
  33. sentinel_ai_os-1.0/sentinel/tools/flights.py +62 -0
  34. sentinel_ai_os-1.0/sentinel/tools/gmail_auth.py +47 -0
  35. sentinel_ai_os-1.0/sentinel/tools/indexer.py +156 -0
  36. sentinel_ai_os-1.0/sentinel/tools/installer.py +69 -0
  37. sentinel_ai_os-1.0/sentinel/tools/macros.py +58 -0
  38. sentinel_ai_os-1.0/sentinel/tools/memory_ops.py +281 -0
  39. sentinel_ai_os-1.0/sentinel/tools/navigation.py +109 -0
  40. sentinel_ai_os-1.0/sentinel/tools/notes.py +78 -0
  41. sentinel_ai_os-1.0/sentinel/tools/office.py +67 -0
  42. sentinel_ai_os-1.0/sentinel/tools/organizer.py +150 -0
  43. sentinel_ai_os-1.0/sentinel/tools/smart_index.py +76 -0
  44. sentinel_ai_os-1.0/sentinel/tools/sql_index.py +186 -0
  45. sentinel_ai_os-1.0/sentinel/tools/system_ops.py +86 -0
  46. sentinel_ai_os-1.0/sentinel/tools/vision.py +94 -0
  47. sentinel_ai_os-1.0/sentinel/tools/weather_ops.py +59 -0
  48. sentinel_ai_os-1.0/sentinel_ai_os.egg-info/PKG-INFO +282 -0
  49. sentinel_ai_os-1.0/sentinel_ai_os.egg-info/SOURCES.txt +52 -0
  50. sentinel_ai_os-1.0/sentinel_ai_os.egg-info/dependency_links.txt +1 -0
  51. sentinel_ai_os-1.0/sentinel_ai_os.egg-info/entry_points.txt +2 -0
  52. sentinel_ai_os-1.0/sentinel_ai_os.egg-info/requires.txt +43 -0
  53. sentinel_ai_os-1.0/sentinel_ai_os.egg-info/top_level.txt +1 -0
  54. sentinel_ai_os-1.0/setup.cfg +4 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sam Selvaraj
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ recursive-include src/sentinel/scripts *
@@ -0,0 +1,282 @@
1
+ Metadata-Version: 2.4
2
+ Name: sentinel-ai-os
3
+ Version: 1.0
4
+ Summary: Autonomous AI Operating System layer
5
+ Author-email: Sam Selvaraj <samselvaraj1801@gmail.com>
6
+ License: MIT
7
+ Keywords: ai,agent,automation,llm
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: rich
14
+ Requires-Dist: typer[all]
15
+ Requires-Dist: pydantic
16
+ Requires-Dist: tabulate
17
+ Requires-Dist: markdown
18
+ Requires-Dist: schedule
19
+ Requires-Dist: keyring
20
+ Requires-Dist: tzlocal
21
+ Requires-Dist: psutil
22
+ Requires-Dist: litellm
23
+ Requires-Dist: anthropic
24
+ Requires-Dist: groq
25
+ Requires-Dist: openai
26
+ Requires-Dist: chromadb
27
+ Requires-Dist: tavily
28
+ Requires-Dist: requests
29
+ Requires-Dist: beautifulsoup4
30
+ Requires-Dist: duckduckgo-search
31
+ Requires-Dist: ddgs
32
+ Requires-Dist: googlemaps
33
+ Requires-Dist: google-auth
34
+ Requires-Dist: google-auth-oauthlib
35
+ Requires-Dist: google-auth-httplib2
36
+ Requires-Dist: google-api-python-client
37
+ Requires-Dist: pandas
38
+ Requires-Dist: openpyxl
39
+ Requires-Dist: python-docx
40
+ Requires-Dist: fpdf
41
+ Requires-Dist: docx2pdf
42
+ Requires-Dist: pymupdf
43
+ Requires-Dist: pypdf
44
+ Requires-Dist: pyautogui
45
+ Requires-Dist: pygetwindow
46
+ Requires-Dist: screen_brightness_control
47
+ Requires-Dist: pycaw
48
+ Requires-Dist: comtypes
49
+ Requires-Dist: pyperclip
50
+ Requires-Dist: plyer
51
+ Requires-Dist: pyttsx3
52
+ Requires-Dist: pillow
53
+ Requires-Dist: opencv-python
54
+ Requires-Dist: SpeechRecognition
55
+ Requires-Dist: pyaudio
56
+ Dynamic: license-file
57
+
58
+ <img width="1065" height="226" alt="image" src="https://github.com/user-attachments/assets/d8c6fede-1cd8-4517-b626-2deb2d9bd9c5" />
59
+
60
+ > **Your proactive OS assistant.** Sentinel is a terminal-based autonomous agent that integrates deeply with your local operating system, files, and cloud services to execute complex workflows via natural language.
61
+
62
+ ---
63
+
64
+ ## 📖 Table of Contents
65
+
66
+ * [Overview](#-overview)
67
+ * [Key Features](#-key-features)
68
+ * [System Architecture](#-system-architecture)
69
+ * [Installation & Setup](#-installation--setup)
70
+ * [Configuration](#-configuration)
71
+ * [Usage Guide](#-usage-guide)
72
+ * [Available Tools](#-available-tools)
73
+ * [Contributing](#-contributing)
74
+ * [Safety & Privacy](#-safety--privacy)
75
+
76
+ ---
77
+
78
+ ## 🔭 Overview
79
+ <img width="1127" height="550" alt="image" src="https://github.com/user-attachments/assets/9ac617d6-a959-4a8c-b245-ff2c98f083ea" />
80
+
81
+ Sentinel is not just a chatbot; it is an **Action Engine**. Unlike web-based LLMs that live in a sandbox, Sentinel runs locally on your machine with access to your file system, applications, and peripherals.
82
+
83
+ It operates on a **Think-Plan-Act** loop:
84
+
85
+ 1. **Perceives** user intent via natural language.
86
+ 2. **Retrieves** context from its long-term vector memory and local SQL file index.
87
+ 3. **Selects** specific tools from a registry (e.g., "Send Email", "Search Files", "Analyze Screen").
88
+ 4. **Executes** the action safely (asking for permission when necessary).
89
+ 5. **Learns** from the interaction to build a persistent user profile.
90
+
91
+ ---
92
+
93
+ ## ✨ Key Features
94
+ <img width="2836" height="1338" alt="image" src="https://github.com/user-attachments/assets/877e5ec8-f398-4c04-b0b0-0c45b12d08c8" />
95
+
96
+ * **🧠 Multi-Brain Support:** Powered by `litellm`, Sentinel can seamlessly switch between **OpenAI**, **Anthropic**, **Groq**, or run locally with **Ollama**.
97
+ * **💾 Hybrid Memory Architecture:**
98
+ * **Vector Database (ChromaDB):** Stores semantic memories, facts, and user preferences for long-term recall.
99
+ * **SQL Index (SQLite):** Maintains a lightning-fast index of your local filesystem for rapid file retrieval.
100
+ * **🔌 Deep OS Integration:**
101
+ * Launch/close apps, manage processes, and control system volume/brightness.
102
+ * Organize messy folders, bulk rename files, and create documents.
103
+ * "Digital Twin" context awareness (knows what app you are using).
104
+ * **☁️ Google Workspace Native:**
105
+ * Full 2-way sync with **Google Calendar** and **Gmail**.
106
+ * Natural language scheduling ("Clear my afternoon", "Draft an email to Bob").
107
+ * **👀 Computer Vision:** Analyze your screen or webcam feed using Vision-capable models (GPT-4o, Claude 3.5 Sonnet).
108
+ * **🛡️ Safety First:** "Human-in-the-loop" protocols require user approval for high-risk actions like deleting files, sending emails, or executing shell commands.
109
+
110
+ ---
111
+
112
+ ## 🏗 System Architecture
113
+
114
+ Sentinel is built on a modular Python architecture designed for extensibility.
115
+
116
+ ### Core Components
117
+
118
+ * **`main.py`**: The entry point. Handles CLI arguments using `typer` and initiates the boot sequence.
119
+ * **`core/agent.py`**: The main agent loop. Manages the context window, parses JSON responses from the LLM, and triggers tools.
120
+ * **`core/llm.py`**: A unified wrapper for different API providers (via `litellm`) that handles model selection, streaming, and error recovery.
121
+ * **`core/registry.py`**: The "Tool Belt." Maps natural language tool descriptions to actual Python functions and injects safety wrappers like `ask_permission`.
122
+ * **`tools/`**: A directory containing isolated modules for specific capabilities (e.g., `browser.py`, `file_ops.py`, `vision.py`).
123
+
124
+ ---
125
+
126
+ ## 🚀 Installation & Setup
127
+
128
+ ### Prerequisites
129
+
130
+ * Python 3.9 or higher.
131
+ * (Optional) **Ollama** installed for local offline inference.
132
+ * (Optional) A Google Cloud Console project for Gmail/Calendar integration.
133
+
134
+ ### Step 1: Install from PyPI
135
+
136
+ As a published package, you can install Sentinel directly using pip:
137
+ ```bash
138
+ pip install sentinel-ai
139
+ ```
140
+
141
+ ### Step 2: System Boot & Configuration
142
+
143
+ Run the initial setup wizard. This will guide you through setting your name, location, and API keys, which are stored securely using the `keyring` library.
144
+
145
+ ```bash
146
+ sentinel config
147
+ ```
148
+
149
+ ### Step 3: Google Authentication (Optional but Recommended)
150
+
151
+ To enable Calendar and Gmail features:
152
+
153
+ 1. Download your OAuth 2.0 Client ID JSON from your Google Cloud Console project.
154
+ 2. Rename it to `credentials.json` and place it in the directory where you run Sentinel.
155
+ 3. Run the auth repair tool. This will open a browser window to authorize Sentinel.
156
+
157
+ ```bash
158
+ sentinel auth
159
+ ```
160
+
161
+ ---
162
+
163
+ ## ⚙ Configuration
164
+
165
+ Sentinel stores its primary configuration in `config.json` and sensitive API keys in your OS's secure credential manager.
166
+
167
+ **Supported Services:**
168
+
169
+ * **Primary Brains:** OpenAI, Anthropic, Groq, Ollama
170
+ * **Search Tools:** Tavily (recommended for RAG), DuckDuckGo
171
+ * **Navigation:** Google Maps API
172
+
173
+ To view or update keys after the initial setup, you can re-run the configuration wizard:
174
+ ```bash
175
+ sentinel config
176
+ ```
177
+
178
+ ---
179
+
180
+ ## 🎮 Usage Guide
181
+
182
+ Start the agent's interactive shell:
183
+
184
+ ```bash
185
+ sentinel
186
+ ```
187
+
188
+ Or, start with a daily briefing (Weather, Calendar, Email summary):
189
+
190
+ ```bash
191
+ sentinel --briefing
192
+ ```
193
+
194
+ ### Interactive CLI
195
+
196
+ Once inside the Sentinel shell, you can communicate with the agent using natural language.
197
+
198
+ ### Example Natural Language Prompts
199
+
200
+ * *"Find all PDF files on my Desktop modified last week and move them to a folder named Reports."*
201
+ * *"Summarize the last 5 emails from my boss."*
202
+ * *"Take a screenshot and tell me what code is visible."*
203
+ * *"Plan a trip to New York for next weekend, check flights, and add it to my calendar."*
204
+
205
+ ---
206
+
207
+ ## 🛠 Available Tools
208
+
209
+ Sentinel comes equipped with a vast array of tools, dynamically registered and made available to the LLM. Below is a summary of its capabilities.
210
+
211
+ ### 📂 File System & Indexing
212
+
213
+ * **Smart Search:** Uses SQLite `fts5` for fast filename search and a Vector index for semantic content search ("Find that document about the project budget").
214
+ * **File Operations:** Full CRUD (Create, Read, Write) for files.
215
+ * **Code Drafts:** Safely drafts code to a `drafts/` directory for user review, never executing it directly.
216
+ * **Organization:** Bulk rename files or sort them into folders based on date, extension, or other criteria.
217
+ * **Document Factory:** Create Word (`.docx`) and Excel (`.xlsx`) files from scratch.
218
+
219
+ ### 🌐 Web & Knowledge
220
+
221
+ * **Deep Research:** Uses Tavily API to browse the web, scrape content, and synthesize answers.
222
+ * **Browser Automation:** Can open URLs and extract text from webpages.
223
+ * **Flight Search:** Find flight information via the SerperDev API.
224
+
225
+ ### 🖥️ Desktop Automation & OS
226
+
227
+ * **App Launcher:** Intelligent fuzzy matching to launch and close applications.
228
+ * **System Control:** Set volume, brightness, or execute shell commands (with permission).
229
+ * **Process Management:** List and kill running processes.
230
+ * **Macros:** Execute pre-defined sequences of actions.
231
+
232
+ ### 👀 Perception & Vision
233
+
234
+ * **Screen Analysis:** `analyze_screen` allows the agent to "see" and understand the content on your display.
235
+ * **Webcam Capture:** Use the webcam to capture images for analysis.
236
+ * **Speech I/O:** `listen` to user voice commands and `speak` to provide audio responses.
237
+ * **Context Awareness:** Can identify the currently active application window.
238
+
239
+ ### 🧠 Memory & Cognition
240
+
241
+ * **Long-term Memory:** Stores facts and user preferences (e.g., "User prefers dark mode") in ChromaDB for future interactions.
242
+ * **Note Taking:** A simple system for adding and retrieving categorized notes.
243
+ * **Reflection:** Can look back at logs to provide continuity across sessions.
244
+
245
+ ### 📅 Calendar & Email (Google Workspace)
246
+
247
+ * **Full Calendar Control:** List, create, and query events on your Google Calendar.
248
+ * **Gmail Integration:** Read and send emails through your Gmail account.
249
+
250
+ ---
251
+
252
+ ## 🤝 Contributing
253
+
254
+ We welcome contributions! Sentinel is designed to be easily extensible.
255
+
256
+ ### Directory Structure
257
+
258
+ * `sentinel/core/`: The brain. Modify this if you are improving the LLM loop, context management, or configuration.
259
+ * `sentinel/tools/`: The hands. **This is the best place to start.** Add new capabilities here.
260
+
261
+ ### How to Add a New Tool
262
+
263
+ 1. Create a new Python file in `sentinel/tools/` (e.g., `spotify.py`).
264
+ 2. Define your function(s) in that file.
265
+ 3. Import your function into `sentinel/core/registry.py`.
266
+ 4. Add the function to the `TOOLS` dictionary in `registry.py`, wrapping it in `ask_permission` if it's a high-risk action.
267
+ 5. Add a description of the tool and its arguments to the `SYSTEM_PROMPT` in `registry.py` so the LLM knows how to use it.
268
+
269
+ ---
270
+
271
+ ## 🛡 Safety & Privacy
272
+
273
+ Because Sentinel has deep access to your system, safety is a core design principle.
274
+
275
+ 1. **Permission Gate:** Critical tools (File Deletion, Shell Commands, Sending Email, etc.) are wrapped in the `ask_permission` function. The agent's execution pauses until you explicitly approve the action by typing `y`.
276
+ 2. **Safe Code Drafting:** Sentinel never executes code it generates. It uses the `draft_code` tool to save scripts to a `drafts/` directory, allowing you to review them before manual execution.
277
+ 3. **Command Guardrails:** The `run_cmd` tool has extra checks to prevent accidental use of destructive commands like `rm` or `format`.
278
+ 4. **Local First:** All file indexes (SQL and ChromaDB) are stored locally in your user directory. No file data is sent to the cloud except for the specific text chunks required by the LLM API for a given task. Your API keys are stored securely in your operating system's native credential manager.
279
+
280
+ ---
281
+
282
+ **Disclaimer:** *Sentinel is an autonomous agent. While many safety checks are in place, always review the actions it proposes before approving them, especially those involving file modification or shell command execution.*
@@ -0,0 +1,225 @@
1
+ <img width="1065" height="226" alt="image" src="https://github.com/user-attachments/assets/d8c6fede-1cd8-4517-b626-2deb2d9bd9c5" />
2
+
3
+ > **Your proactive OS assistant.** Sentinel is a terminal-based autonomous agent that integrates deeply with your local operating system, files, and cloud services to execute complex workflows via natural language.
4
+
5
+ ---
6
+
7
+ ## 📖 Table of Contents
8
+
9
+ * [Overview](#-overview)
10
+ * [Key Features](#-key-features)
11
+ * [System Architecture](#-system-architecture)
12
+ * [Installation & Setup](#-installation--setup)
13
+ * [Configuration](#-configuration)
14
+ * [Usage Guide](#-usage-guide)
15
+ * [Available Tools](#-available-tools)
16
+ * [Contributing](#-contributing)
17
+ * [Safety & Privacy](#-safety--privacy)
18
+
19
+ ---
20
+
21
+ ## 🔭 Overview
22
+ <img width="1127" height="550" alt="image" src="https://github.com/user-attachments/assets/9ac617d6-a959-4a8c-b245-ff2c98f083ea" />
23
+
24
+ Sentinel is not just a chatbot; it is an **Action Engine**. Unlike web-based LLMs that live in a sandbox, Sentinel runs locally on your machine with access to your file system, applications, and peripherals.
25
+
26
+ It operates on a **Think-Plan-Act** loop:
27
+
28
+ 1. **Perceives** user intent via natural language.
29
+ 2. **Retrieves** context from its long-term vector memory and local SQL file index.
30
+ 3. **Selects** specific tools from a registry (e.g., "Send Email", "Search Files", "Analyze Screen").
31
+ 4. **Executes** the action safely (asking for permission when necessary).
32
+ 5. **Learns** from the interaction to build a persistent user profile.
33
+
34
+ ---
35
+
36
+ ## ✨ Key Features
37
+ <img width="2836" height="1338" alt="image" src="https://github.com/user-attachments/assets/877e5ec8-f398-4c04-b0b0-0c45b12d08c8" />
38
+
39
+ * **🧠 Multi-Brain Support:** Powered by `litellm`, Sentinel can seamlessly switch between **OpenAI**, **Anthropic**, **Groq**, or run locally with **Ollama**.
40
+ * **💾 Hybrid Memory Architecture:**
41
+ * **Vector Database (ChromaDB):** Stores semantic memories, facts, and user preferences for long-term recall.
42
+ * **SQL Index (SQLite):** Maintains a lightning-fast index of your local filesystem for rapid file retrieval.
43
+ * **🔌 Deep OS Integration:**
44
+ * Launch/close apps, manage processes, and control system volume/brightness.
45
+ * Organize messy folders, bulk rename files, and create documents.
46
+ * "Digital Twin" context awareness (knows what app you are using).
47
+ * **☁️ Google Workspace Native:**
48
+ * Full 2-way sync with **Google Calendar** and **Gmail**.
49
+ * Natural language scheduling ("Clear my afternoon", "Draft an email to Bob").
50
+ * **👀 Computer Vision:** Analyze your screen or webcam feed using Vision-capable models (GPT-4o, Claude 3.5 Sonnet).
51
+ * **🛡️ Safety First:** "Human-in-the-loop" protocols require user approval for high-risk actions like deleting files, sending emails, or executing shell commands.
52
+
53
+ ---
54
+
55
+ ## 🏗 System Architecture
56
+
57
+ Sentinel is built on a modular Python architecture designed for extensibility.
58
+
59
+ ### Core Components
60
+
61
+ * **`main.py`**: The entry point. Handles CLI arguments using `typer` and initiates the boot sequence.
62
+ * **`core/agent.py`**: The main agent loop. Manages the context window, parses JSON responses from the LLM, and triggers tools.
63
+ * **`core/llm.py`**: A unified wrapper for different API providers (via `litellm`) that handles model selection, streaming, and error recovery.
64
+ * **`core/registry.py`**: The "Tool Belt." Maps natural language tool descriptions to actual Python functions and injects safety wrappers like `ask_permission`.
65
+ * **`tools/`**: A directory containing isolated modules for specific capabilities (e.g., `browser.py`, `file_ops.py`, `vision.py`).
66
+
67
+ ---
68
+
69
+ ## 🚀 Installation & Setup
70
+
71
+ ### Prerequisites
72
+
73
+ * Python 3.9 or higher.
74
+ * (Optional) **Ollama** installed for local offline inference.
75
+ * (Optional) A Google Cloud Console project for Gmail/Calendar integration.
76
+
77
+ ### Step 1: Install from PyPI
78
+
79
+ As a published package, you can install Sentinel directly using pip:
80
+ ```bash
81
+ pip install sentinel-ai
82
+ ```
83
+
84
+ ### Step 2: System Boot & Configuration
85
+
86
+ Run the initial setup wizard. This will guide you through setting your name, location, and API keys, which are stored securely using the `keyring` library.
87
+
88
+ ```bash
89
+ sentinel config
90
+ ```
91
+
92
+ ### Step 3: Google Authentication (Optional but Recommended)
93
+
94
+ To enable Calendar and Gmail features:
95
+
96
+ 1. Download your OAuth 2.0 Client ID JSON from your Google Cloud Console project.
97
+ 2. Rename it to `credentials.json` and place it in the directory where you run Sentinel.
98
+ 3. Run the auth repair tool. This will open a browser window to authorize Sentinel.
99
+
100
+ ```bash
101
+ sentinel auth
102
+ ```
103
+
104
+ ---
105
+
106
+ ## ⚙ Configuration
107
+
108
+ Sentinel stores its primary configuration in `config.json` and sensitive API keys in your OS's secure credential manager.
109
+
110
+ **Supported Services:**
111
+
112
+ * **Primary Brains:** OpenAI, Anthropic, Groq, Ollama
113
+ * **Search Tools:** Tavily (recommended for RAG), DuckDuckGo
114
+ * **Navigation:** Google Maps API
115
+
116
+ To view or update keys after the initial setup, you can re-run the configuration wizard:
117
+ ```bash
118
+ sentinel config
119
+ ```
120
+
121
+ ---
122
+
123
+ ## 🎮 Usage Guide
124
+
125
+ Start the agent's interactive shell:
126
+
127
+ ```bash
128
+ sentinel
129
+ ```
130
+
131
+ Or, start with a daily briefing (Weather, Calendar, Email summary):
132
+
133
+ ```bash
134
+ sentinel --briefing
135
+ ```
136
+
137
+ ### Interactive CLI
138
+
139
+ Once inside the Sentinel shell, you can communicate with the agent using natural language.
140
+
141
+ ### Example Natural Language Prompts
142
+
143
+ * *"Find all PDF files on my Desktop modified last week and move them to a folder named Reports."*
144
+ * *"Summarize the last 5 emails from my boss."*
145
+ * *"Take a screenshot and tell me what code is visible."*
146
+ * *"Plan a trip to New York for next weekend, check flights, and add it to my calendar."*
147
+
148
+ ---
149
+
150
+ ## 🛠 Available Tools
151
+
152
+ Sentinel comes equipped with a vast array of tools, dynamically registered and made available to the LLM. Below is a summary of its capabilities.
153
+
154
+ ### 📂 File System & Indexing
155
+
156
+ * **Smart Search:** Uses SQLite `fts5` for fast filename search and a Vector index for semantic content search ("Find that document about the project budget").
157
+ * **File Operations:** Full CRUD (Create, Read, Write) for files.
158
+ * **Code Drafts:** Safely drafts code to a `drafts/` directory for user review, never executing it directly.
159
+ * **Organization:** Bulk rename files or sort them into folders based on date, extension, or other criteria.
160
+ * **Document Factory:** Create Word (`.docx`) and Excel (`.xlsx`) files from scratch.
161
+
162
+ ### 🌐 Web & Knowledge
163
+
164
+ * **Deep Research:** Uses Tavily API to browse the web, scrape content, and synthesize answers.
165
+ * **Browser Automation:** Can open URLs and extract text from webpages.
166
+ * **Flight Search:** Find flight information via the SerperDev API.
167
+
168
+ ### 🖥️ Desktop Automation & OS
169
+
170
+ * **App Launcher:** Intelligent fuzzy matching to launch and close applications.
171
+ * **System Control:** Set volume, brightness, or execute shell commands (with permission).
172
+ * **Process Management:** List and kill running processes.
173
+ * **Macros:** Execute pre-defined sequences of actions.
174
+
175
+ ### 👀 Perception & Vision
176
+
177
+ * **Screen Analysis:** `analyze_screen` allows the agent to "see" and understand the content on your display.
178
+ * **Webcam Capture:** Use the webcam to capture images for analysis.
179
+ * **Speech I/O:** `listen` to user voice commands and `speak` to provide audio responses.
180
+ * **Context Awareness:** Can identify the currently active application window.
181
+
182
+ ### 🧠 Memory & Cognition
183
+
184
+ * **Long-term Memory:** Stores facts and user preferences (e.g., "User prefers dark mode") in ChromaDB for future interactions.
185
+ * **Note Taking:** A simple system for adding and retrieving categorized notes.
186
+ * **Reflection:** Can look back at logs to provide continuity across sessions.
187
+
188
+ ### 📅 Calendar & Email (Google Workspace)
189
+
190
+ * **Full Calendar Control:** List, create, and query events on your Google Calendar.
191
+ * **Gmail Integration:** Read and send emails through your Gmail account.
192
+
193
+ ---
194
+
195
+ ## 🤝 Contributing
196
+
197
+ We welcome contributions! Sentinel is designed to be easily extensible.
198
+
199
+ ### Directory Structure
200
+
201
+ * `sentinel/core/`: The brain. Modify this if you are improving the LLM loop, context management, or configuration.
202
+ * `sentinel/tools/`: The hands. **This is the best place to start.** Add new capabilities here.
203
+
204
+ ### How to Add a New Tool
205
+
206
+ 1. Create a new Python file in `sentinel/tools/` (e.g., `spotify.py`).
207
+ 2. Define your function(s) in that file.
208
+ 3. Import your function into `sentinel/core/registry.py`.
209
+ 4. Add the function to the `TOOLS` dictionary in `registry.py`, wrapping it in `ask_permission` if it's a high-risk action.
210
+ 5. Add a description of the tool and its arguments to the `SYSTEM_PROMPT` in `registry.py` so the LLM knows how to use it.
211
+
212
+ ---
213
+
214
+ ## 🛡 Safety & Privacy
215
+
216
+ Because Sentinel has deep access to your system, safety is a core design principle.
217
+
218
+ 1. **Permission Gate:** Critical tools (File Deletion, Shell Commands, Sending Email, etc.) are wrapped in the `ask_permission` function. The agent's execution pauses until you explicitly approve the action by typing `y`.
219
+ 2. **Safe Code Drafting:** Sentinel never executes code it generates. It uses the `draft_code` tool to save scripts to a `drafts/` directory, allowing you to review them before manual execution.
220
+ 3. **Command Guardrails:** The `run_cmd` tool has extra checks to prevent accidental use of destructive commands like `rm` or `format`.
221
+ 4. **Local First:** All file indexes (SQL and ChromaDB) are stored locally in your user directory. No file data is sent to the cloud except for the specific text chunks required by the LLM API for a given task. Your API keys are stored securely in your operating system's native credential manager.
222
+
223
+ ---
224
+
225
+ **Disclaimer:** *Sentinel is an autonomous agent. While many safety checks are in place, always review the actions it proposes before approving them, especially those involving file modification or shell command execution.*
@@ -0,0 +1,82 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "sentinel-ai-os"
7
+ version = "1.0"
8
+ description = "Autonomous AI Operating System layer"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = {text = "MIT"}
12
+ authors = [
13
+ { name="Sam Selvaraj", email="samselvaraj1801@gmail.com" }
14
+ ]
15
+ keywords = ["ai", "agent", "automation", "llm"]
16
+ classifiers = [
17
+ "Programming Language :: Python :: 3",
18
+ "Operating System :: OS Independent",
19
+ ]
20
+
21
+ dependencies = [
22
+ # Core
23
+ "rich",
24
+ "typer[all]",
25
+ "pydantic",
26
+ "tabulate",
27
+ "markdown",
28
+ "schedule",
29
+ "keyring",
30
+ "tzlocal",
31
+ "psutil",
32
+
33
+ # LLM / AI
34
+ "litellm",
35
+ "anthropic",
36
+ "groq",
37
+ "openai",
38
+ "chromadb",
39
+ "tavily",
40
+
41
+ # Web / Search
42
+ "requests",
43
+ "beautifulsoup4",
44
+ "duckduckgo-search",
45
+ "ddgs",
46
+ "googlemaps",
47
+
48
+ # Google APIs
49
+ "google-auth",
50
+ "google-auth-oauthlib",
51
+ "google-auth-httplib2",
52
+ "google-api-python-client",
53
+
54
+ # Files / Office
55
+ "pandas",
56
+ "openpyxl",
57
+ "python-docx",
58
+ "fpdf",
59
+ "docx2pdf",
60
+ "pymupdf",
61
+ "pypdf",
62
+
63
+ # Desktop / OS
64
+ "pyautogui",
65
+ "pygetwindow",
66
+ "screen_brightness_control",
67
+ "pycaw",
68
+ "comtypes",
69
+ "pyperclip",
70
+ "plyer",
71
+ "pyttsx3",
72
+
73
+ # Vision / Audio
74
+ "pillow",
75
+ "opencv-python",
76
+ "SpeechRecognition",
77
+ "pyaudio"
78
+ ]
79
+
80
+ [project.scripts]
81
+ sentinel = "sentinel.main:app"
82
+
File without changes
@@ -0,0 +1,40 @@
1
+ # sentinel/auth.py
2
+
3
+ from google_auth_oauthlib.flow import InstalledAppFlow
4
+ from sentinel.paths import CREDS_FILE, TOKEN_FILE
5
+
6
+ SCOPES = [
7
+ 'https://www.googleapis.com/auth/gmail.readonly',
8
+ 'https://www.googleapis.com/auth/gmail.send',
9
+ 'https://www.googleapis.com/auth/calendar'
10
+ ]
11
+
12
+
13
+ def fix_authentication():
14
+ print("--- SENTINEL GOOGLE AUTH ---\n")
15
+
16
+ if not CREDS_FILE.exists():
17
+ print("❌ credentials.json not found.\n")
18
+ print("Download it from Google Cloud Console and place it here:\n")
19
+ print(CREDS_FILE)
20
+ return
21
+
22
+ if TOKEN_FILE.exists():
23
+ print("⚠ Found old token. Deleting...")
24
+ TOKEN_FILE.unlink()
25
+
26
+ print("Opening browser for Google login...\n")
27
+
28
+ flow = InstalledAppFlow.from_client_secrets_file(
29
+ str(CREDS_FILE),
30
+ SCOPES
31
+ )
32
+
33
+ creds = flow.run_local_server(port=0)
34
+
35
+ with open(TOKEN_FILE, "w") as f:
36
+ f.write(creds.to_json())
37
+
38
+ print("\n✅ Authentication complete.")
39
+ print("Token saved to:")
40
+ print(TOKEN_FILE)
@@ -0,0 +1,9 @@
1
+ from sentinel.main import app
2
+ from sentinel.core.config import ConfigManager
3
+ from sentinel.core.setup import setup_wizard
4
+
5
+ def main():
6
+ cfg = ConfigManager()
7
+ if not cfg.exists():
8
+ setup_wizard()
9
+ app()
File without changes