root-engine 0.1.4__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 (76) hide show
  1. root_engine-0.1.4/.gitignore +13 -0
  2. root_engine-0.1.4/LICENSE +13 -0
  3. root_engine-0.1.4/PKG-INFO +437 -0
  4. root_engine-0.1.4/README.md +388 -0
  5. root_engine-0.1.4/bridge/package.json +26 -0
  6. root_engine-0.1.4/bridge/src/index.ts +51 -0
  7. root_engine-0.1.4/bridge/src/server.ts +129 -0
  8. root_engine-0.1.4/bridge/src/types.d.ts +3 -0
  9. root_engine-0.1.4/bridge/src/whatsapp.ts +185 -0
  10. root_engine-0.1.4/bridge/tsconfig.json +16 -0
  11. root_engine-0.1.4/pyproject.toml +105 -0
  12. root_engine-0.1.4/root_engine/__init__.py +6 -0
  13. root_engine-0.1.4/root_engine/__main__.py +8 -0
  14. root_engine-0.1.4/root_engine/agent/__init__.py +8 -0
  15. root_engine-0.1.4/root_engine/agent/context.py +242 -0
  16. root_engine-0.1.4/root_engine/agent/loop.py +519 -0
  17. root_engine-0.1.4/root_engine/agent/memory.py +30 -0
  18. root_engine-0.1.4/root_engine/agent/skills.py +228 -0
  19. root_engine-0.1.4/root_engine/agent/subagent.py +257 -0
  20. root_engine-0.1.4/root_engine/agent/tools/__init__.py +6 -0
  21. root_engine-0.1.4/root_engine/agent/tools/base.py +102 -0
  22. root_engine-0.1.4/root_engine/agent/tools/cron.py +147 -0
  23. root_engine-0.1.4/root_engine/agent/tools/filesystem.py +211 -0
  24. root_engine-0.1.4/root_engine/agent/tools/mcp.py +80 -0
  25. root_engine-0.1.4/root_engine/agent/tools/message.py +94 -0
  26. root_engine-0.1.4/root_engine/agent/tools/registry.py +73 -0
  27. root_engine-0.1.4/root_engine/agent/tools/shell.py +144 -0
  28. root_engine-0.1.4/root_engine/agent/tools/spawn.py +65 -0
  29. root_engine-0.1.4/root_engine/agent/tools/web.py +163 -0
  30. root_engine-0.1.4/root_engine/bus/__init__.py +6 -0
  31. root_engine-0.1.4/root_engine/bus/events.py +37 -0
  32. root_engine-0.1.4/root_engine/bus/queue.py +81 -0
  33. root_engine-0.1.4/root_engine/channels/__init__.py +6 -0
  34. root_engine-0.1.4/root_engine/channels/base.py +127 -0
  35. root_engine-0.1.4/root_engine/channels/dingtalk.py +245 -0
  36. root_engine-0.1.4/root_engine/channels/discord.py +261 -0
  37. root_engine-0.1.4/root_engine/channels/email.py +403 -0
  38. root_engine-0.1.4/root_engine/channels/feishu.py +402 -0
  39. root_engine-0.1.4/root_engine/channels/manager.py +227 -0
  40. root_engine-0.1.4/root_engine/channels/mochat.py +895 -0
  41. root_engine-0.1.4/root_engine/channels/qq.py +134 -0
  42. root_engine-0.1.4/root_engine/channels/slack.py +237 -0
  43. root_engine-0.1.4/root_engine/channels/telegram.py +421 -0
  44. root_engine-0.1.4/root_engine/channels/whatsapp.py +148 -0
  45. root_engine-0.1.4/root_engine/cli/__init__.py +1 -0
  46. root_engine-0.1.4/root_engine/cli/commands.py +1025 -0
  47. root_engine-0.1.4/root_engine/config/__init__.py +6 -0
  48. root_engine-0.1.4/root_engine/config/loader.py +69 -0
  49. root_engine-0.1.4/root_engine/config/schema.py +340 -0
  50. root_engine-0.1.4/root_engine/cron/__init__.py +6 -0
  51. root_engine-0.1.4/root_engine/cron/service.py +352 -0
  52. root_engine-0.1.4/root_engine/cron/types.py +59 -0
  53. root_engine-0.1.4/root_engine/heartbeat/__init__.py +5 -0
  54. root_engine-0.1.4/root_engine/heartbeat/service.py +130 -0
  55. root_engine-0.1.4/root_engine/providers/__init__.py +7 -0
  56. root_engine-0.1.4/root_engine/providers/base.py +70 -0
  57. root_engine-0.1.4/root_engine/providers/custom_provider.py +47 -0
  58. root_engine-0.1.4/root_engine/providers/litellm_provider.py +208 -0
  59. root_engine-0.1.4/root_engine/providers/openai_codex_provider.py +312 -0
  60. root_engine-0.1.4/root_engine/providers/registry.py +431 -0
  61. root_engine-0.1.4/root_engine/providers/transcription.py +65 -0
  62. root_engine-0.1.4/root_engine/session/__init__.py +5 -0
  63. root_engine-0.1.4/root_engine/session/manager.py +185 -0
  64. root_engine-0.1.4/root_engine/skills/README.md +20 -0
  65. root_engine-0.1.4/root_engine/skills/clawhub/SKILL.md +53 -0
  66. root_engine-0.1.4/root_engine/skills/cron/SKILL.md +57 -0
  67. root_engine-0.1.4/root_engine/skills/github/SKILL.md +48 -0
  68. root_engine-0.1.4/root_engine/skills/memory/SKILL.md +31 -0
  69. root_engine-0.1.4/root_engine/skills/skill-creator/SKILL.md +371 -0
  70. root_engine-0.1.4/root_engine/skills/summarize/SKILL.md +67 -0
  71. root_engine-0.1.4/root_engine/skills/tmux/SKILL.md +121 -0
  72. root_engine-0.1.4/root_engine/skills/tmux/scripts/find-sessions.sh +112 -0
  73. root_engine-0.1.4/root_engine/skills/tmux/scripts/wait-for-text.sh +83 -0
  74. root_engine-0.1.4/root_engine/skills/weather/SKILL.md +49 -0
  75. root_engine-0.1.4/root_engine/utils/__init__.py +5 -0
  76. root_engine-0.1.4/root_engine/utils/helpers.py +80 -0
@@ -0,0 +1,13 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyo
5
+ *.egg-info/
6
+ dist/
7
+ build/
8
+ .pytest_cache/
9
+ *.log
10
+ bridge/node_modules/
11
+ bridge/dist/
12
+ CLAUDE.md
13
+ core_agent_lines.sh
@@ -0,0 +1,13 @@
1
+ Proprietary Software License
2
+
3
+ Copyright (c) 2026 Trey Timbrook / Rootbros AI LLC. All rights reserved.
4
+
5
+ This software and its source code are the exclusive property of Trey Timbrook
6
+ and Rootbros AI LLC. Unauthorized copying, modification, distribution,
7
+ sublicensing, or use of this software, in whole or in part, is strictly
8
+ prohibited without prior written permission from Rootbros AI LLC.
9
+
10
+ This software is provided for authorized use only. Access to this software
11
+ does not grant any rights to the underlying intellectual property.
12
+
13
+ For licensing inquiries, contact: trey@rootbrosai.com
@@ -0,0 +1,437 @@
1
+ Metadata-Version: 2.4
2
+ Name: root-engine
3
+ Version: 0.1.4
4
+ Summary: A lightweight personal AI assistant framework
5
+ Project-URL: Homepage, https://github.com/TreyBros/root_engine
6
+ Project-URL: Repository, https://github.com/TreyBros/root_engine
7
+ Project-URL: Bug Tracker, https://github.com/TreyBros/root_engine/issues
8
+ Author-email: Trey Timbrook <trey@rootbrosai.com>
9
+ Maintainer-email: Trey Timbrook <trey@rootbrosai.com>
10
+ License: Proprietary
11
+ License-File: LICENSE
12
+ Keywords: agent,ai,chatbot
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: Other/Proprietary License
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Requires-Python: >=3.11
19
+ Requires-Dist: croniter>=2.0.0
20
+ Requires-Dist: dingtalk-stream>=0.4.0
21
+ Requires-Dist: httpx>=0.25.0
22
+ Requires-Dist: json-repair>=0.30.0
23
+ Requires-Dist: lark-oapi>=1.0.0
24
+ Requires-Dist: litellm>=1.0.0
25
+ Requires-Dist: loguru>=0.7.0
26
+ Requires-Dist: mcp>=1.0.0
27
+ Requires-Dist: msgpack>=1.0.8
28
+ Requires-Dist: oauth-cli-kit>=0.1.1
29
+ Requires-Dist: prompt-toolkit>=3.0.0
30
+ Requires-Dist: pydantic-settings>=2.0.0
31
+ Requires-Dist: pydantic>=2.0.0
32
+ Requires-Dist: python-socketio>=5.11.0
33
+ Requires-Dist: python-socks[asyncio]>=2.4.0
34
+ Requires-Dist: python-telegram-bot[socks]>=21.0
35
+ Requires-Dist: qq-botpy>=1.0.0
36
+ Requires-Dist: readability-lxml>=0.8.0
37
+ Requires-Dist: rich>=13.0.0
38
+ Requires-Dist: slack-sdk>=3.26.0
39
+ Requires-Dist: slackify-markdown>=0.2.0
40
+ Requires-Dist: socksio>=1.0.0
41
+ Requires-Dist: typer>=0.9.0
42
+ Requires-Dist: websocket-client>=1.6.0
43
+ Requires-Dist: websockets>=12.0
44
+ Provides-Extra: dev
45
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
46
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
47
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
48
+ Description-Content-Type: text/markdown
49
+
50
+ <div align="center">
51
+ <img src="root_engine_logo.png" alt="Root Engine" width="500">
52
+ <h1>Root Engine</h1>
53
+ <p><b>Ultra-lightweight, extensible runtime for personal agents, tool use, and multi-channel automation.</b></p>
54
+ <p>
55
+ <img src="https://img.shields.io/badge/python-≥3.11-blue" alt="Python">
56
+ </p>
57
+ </div>
58
+
59
+ ## What is Root Engine?
60
+
61
+ **Root Engine** is a compact agent runtime designed to be **easy to read**, **easy to extend**, and **fast to ship**.
62
+ It focuses on the fundamentals: **agent loop + tools + skills + memory + channels + scheduling**—without burying you in frameworks.
63
+
64
+ If you want a repo you can actually *understand end-to-end*, modify confidently, and deploy quickly, this is the point.
65
+
66
+ ---
67
+
68
+ ## Key Features
69
+
70
+ - **Ultra-Lightweight Core**
71
+ Small, focused agent runtime with clean boundaries between agent logic, tools, and integrations.
72
+
73
+ - **Provider-Driven LLM Support**
74
+ Plug in popular LLM providers (or any OpenAI-compatible endpoint) via a simple provider registry + config.
75
+
76
+ - **Tool Use + Skills System**
77
+ Built-in tools and a skills loader so agents can execute actions, call external capabilities, and stay modular.
78
+
79
+ - **Persistent Memory**
80
+ Optional long-running memory for continuity across sessions.
81
+
82
+ - **Multi-Channel Gateways**
83
+ Run Root Engine through chat platforms and messaging channels (where supported in this repo).
84
+
85
+ - **Scheduled Tasks (Cron)**
86
+ Run proactive reminders, routines, and agent jobs on a schedule.
87
+
88
+ - **MCP Support**
89
+ Connect external tool servers using Model Context Protocol, automatically discovered on startup.
90
+
91
+ - **Security Controls**
92
+ Workspace restrictions and allow-lists to reduce risk when running agents in real environments.
93
+
94
+ ---
95
+
96
+ ## Architecture
97
+
98
+ <p align="center">
99
+ <img src="root_engine_arch.png" alt="Root Engine architecture" width="800">
100
+ </p>
101
+
102
+ At a high level:
103
+ - A **CLI** launches an **agent** or a **gateway**
104
+ - The **agent loop** runs LLM ↔ tool execution
105
+ - A **provider registry** resolves LLM routing
106
+ - **Skills** extend capabilities cleanly
107
+ - **Channels** handle inbound/outbound messaging
108
+ - **Cron/heartbeat** enable proactive behavior
109
+
110
+ ---
111
+
112
+ ## Install
113
+
114
+ **Requires Python 3.11+**
115
+
116
+ ```bash
117
+ git clone https://github.com/TreyBros/root_engine
118
+ cd root-engine
119
+ pip install -e .
120
+ ```
121
+
122
+ > Once published on PyPI: `pip install root-engine`
123
+
124
+ ---
125
+
126
+ ## Quick Start
127
+
128
+ Root Engine reads configuration from: `~/.root-engine/config.json`
129
+
130
+ ### 1) Initialize
131
+
132
+ ```bash
133
+ root-engine onboard
134
+ ```
135
+
136
+ ### 2) Configure your provider + model
137
+
138
+ Edit `~/.root-engine/config.json` and set at minimum:
139
+
140
+ Provider API key (example: OpenRouter)
141
+
142
+ ```json
143
+ {
144
+ "providers": {
145
+ "openrouter": {
146
+ "apiKey": "sk-or-v1-xxx"
147
+ }
148
+ }
149
+ }
150
+ ```
151
+
152
+ Default model
153
+
154
+ ```json
155
+ {
156
+ "agents": {
157
+ "defaults": {
158
+ "model": "anthropic/claude-opus-4-5"
159
+ }
160
+ }
161
+ }
162
+ ```
163
+
164
+ ### 3) Chat
165
+
166
+ ```bash
167
+ root-engine agent
168
+ ```
169
+
170
+ Or one-shot:
171
+
172
+ ```bash
173
+ root-engine agent -m "Hello!"
174
+ ```
175
+
176
+ ---
177
+
178
+ ## Chat Apps
179
+
180
+ Root Engine can run as a gateway for supported chat platforms (tokens/credentials required).
181
+ Enable a channel in `~/.root-engine/config.json`, then run:
182
+
183
+ ```bash
184
+ root-engine gateway
185
+ ```
186
+
187
+ ### Channel Config Examples
188
+
189
+ **Telegram**
190
+
191
+ ```json
192
+ {
193
+ "channels": {
194
+ "telegram": {
195
+ "enabled": true,
196
+ "token": "YOUR_BOT_TOKEN",
197
+ "allowFrom": ["YOUR_USER_ID"]
198
+ }
199
+ }
200
+ }
201
+ ```
202
+
203
+ **Discord**
204
+
205
+ ```json
206
+ {
207
+ "channels": {
208
+ "discord": {
209
+ "enabled": true,
210
+ "token": "YOUR_BOT_TOKEN",
211
+ "allowFrom": ["YOUR_USER_ID"]
212
+ }
213
+ }
214
+ }
215
+ ```
216
+
217
+ **Slack (Socket Mode)**
218
+
219
+ ```json
220
+ {
221
+ "channels": {
222
+ "slack": {
223
+ "enabled": true,
224
+ "botToken": "xoxb-...",
225
+ "appToken": "xapp-...",
226
+ "groupPolicy": "mention"
227
+ }
228
+ }
229
+ }
230
+ ```
231
+
232
+ ---
233
+
234
+ ## Configuration
235
+
236
+ Config file: `~/.root-engine/config.json`
237
+
238
+ ### Providers
239
+
240
+ Root Engine uses a provider registry to route models and normalize configuration.
241
+
242
+ Common provider entries include:
243
+
244
+ - `openrouter`
245
+ - `anthropic`
246
+ - `openai`
247
+ - `deepseek`
248
+ - `groq`
249
+ - `gemini`
250
+ - `minimax`
251
+ - `dashscope`
252
+ - `moonshot`
253
+ - `zhipu`
254
+ - `vllm` (local / OpenAI-compatible)
255
+ - `custom` (any OpenAI-compatible API base)
256
+
257
+ Exact available providers depend on what's included in this repo version.
258
+
259
+ ### Custom Provider (Any OpenAI-compatible API)
260
+
261
+ ```json
262
+ {
263
+ "providers": {
264
+ "custom": {
265
+ "apiKey": "your-api-key",
266
+ "apiBase": "https://api.your-provider.com/v1"
267
+ }
268
+ },
269
+ "agents": {
270
+ "defaults": {
271
+ "model": "your-model-name"
272
+ }
273
+ }
274
+ }
275
+ ```
276
+
277
+ ### vLLM (local / OpenAI-compatible)
278
+
279
+ ```json
280
+ {
281
+ "providers": {
282
+ "vllm": {
283
+ "apiKey": "dummy",
284
+ "apiBase": "http://localhost:8000/v1"
285
+ }
286
+ },
287
+ "agents": {
288
+ "defaults": {
289
+ "model": "meta-llama/Llama-3.1-8B-Instruct"
290
+ }
291
+ }
292
+ }
293
+ ```
294
+
295
+ ---
296
+
297
+ ## MCP (Model Context Protocol)
298
+
299
+ Root Engine can connect to MCP tool servers and expose them as native tools.
300
+
301
+ Example config:
302
+
303
+ ```json
304
+ {
305
+ "tools": {
306
+ "mcpServers": {
307
+ "filesystem": {
308
+ "command": "npx",
309
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"]
310
+ }
311
+ }
312
+ }
313
+ }
314
+ ```
315
+
316
+ Supported transport modes:
317
+
318
+ - **Stdio**: `command` + `args`
319
+ - **HTTP**: `url` (remote endpoint)
320
+
321
+ MCP tools are discovered and registered on startup.
322
+
323
+ ---
324
+
325
+ ## Security
326
+
327
+ For safer local/prod use, restrict tool access to your workspace:
328
+
329
+ ```json
330
+ {
331
+ "tools": {
332
+ "restrictToWorkspace": true
333
+ }
334
+ }
335
+ ```
336
+
337
+ And restrict who can interact on channels:
338
+
339
+ ```json
340
+ {
341
+ "channels": {
342
+ "telegram": {
343
+ "enabled": true,
344
+ "token": "YOUR_BOT_TOKEN",
345
+ "allowFrom": ["YOUR_USER_ID"]
346
+ }
347
+ }
348
+ }
349
+ ```
350
+
351
+ ---
352
+
353
+ ## CLI Reference
354
+
355
+ | Command | Description |
356
+ |---------|-------------|
357
+ | `root-engine onboard` | Initialize config & workspace |
358
+ | `root-engine agent` | Interactive agent chat |
359
+ | `root-engine agent -m "..."` | One-shot message |
360
+ | `root-engine agent --no-markdown` | Plain-text replies |
361
+ | `root-engine agent --logs` | Show runtime logs |
362
+ | `root-engine gateway` | Start multi-channel gateway |
363
+ | `root-engine status` | Show runtime/config status |
364
+ | `root-engine channels status` | Show channel status |
365
+ | `root-engine cron add ...` | Add scheduled job |
366
+ | `root-engine cron list` | List scheduled jobs |
367
+ | `root-engine cron remove <id>` | Remove scheduled job |
368
+
369
+ Interactive mode exits: `exit`, `quit`, `/exit`, `/quit`, `:q`, or `Ctrl+D`.
370
+
371
+ ---
372
+
373
+ ## Scheduled Tasks (Cron)
374
+
375
+ ```bash
376
+ # Add a job
377
+ root-engine cron add --name "daily" --message "Good morning!" --cron "0 9 * * *"
378
+ root-engine cron add --name "hourly" --message "Check status" --every 3600
379
+
380
+ # List jobs
381
+ root-engine cron list
382
+
383
+ # Remove a job
384
+ root-engine cron remove <job_id>
385
+ ```
386
+
387
+ ---
388
+
389
+ ## Docker
390
+
391
+ ### Compose
392
+
393
+ ```bash
394
+ docker compose run --rm root-engine-cli onboard
395
+ vim ~/.root-engine/config.json
396
+ docker compose up -d root-engine-gateway
397
+ docker compose run --rm root-engine-cli agent -m "Hello!"
398
+ docker compose logs -f root-engine-gateway
399
+ docker compose down
400
+ ```
401
+
402
+ ### Docker
403
+
404
+ ```bash
405
+ docker build -t root-engine .
406
+
407
+ docker run -v ~/.root-engine:/root/.root-engine --rm root-engine onboard
408
+ vim ~/.root-engine/config.json
409
+
410
+ docker run -v ~/.root-engine:/root/.root-engine -p 18790:18790 root-engine gateway
411
+ docker run -v ~/.root-engine:/root/.root-engine --rm root-engine agent -m "Hello!"
412
+ docker run -v ~/.root-engine:/root/.root-engine --rm root-engine status
413
+ ```
414
+
415
+ ---
416
+
417
+ ## Project Structure
418
+
419
+ ```
420
+ root_engine/
421
+ ├── agent/ # Core agent logic
422
+ │ ├── loop.py # Agent loop (LLM ↔ tool execution)
423
+ │ ├── context.py # Prompt builder
424
+ │ ├── memory.py # Persistent memory
425
+ │ ├── skills.py # Skills loader
426
+ │ ├── subagent.py # Background task execution
427
+ │ └── tools/ # Built-in tools
428
+ ├── skills/ # Bundled skills
429
+ ├── channels/ # Chat channel integrations
430
+ ├── bus/ # Message routing
431
+ ├── cron/ # Scheduled tasks
432
+ ├── heartbeat/ # Proactive wake-up
433
+ ├── providers/ # LLM providers
434
+ ├── session/ # Conversation sessions
435
+ ├── config/ # Configuration schema + loader
436
+ └── cli/ # CLI commands
437
+ ```