bobo-agent 0.2.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 (98) hide show
  1. bobo_agent-0.2.0/LICENSE +21 -0
  2. bobo_agent-0.2.0/NOTICE.md +23 -0
  3. bobo_agent-0.2.0/PKG-INFO +406 -0
  4. bobo_agent-0.2.0/README.md +389 -0
  5. bobo_agent-0.2.0/bobo_agent.egg-info/PKG-INFO +406 -0
  6. bobo_agent-0.2.0/bobo_agent.egg-info/SOURCES.txt +96 -0
  7. bobo_agent-0.2.0/bobo_agent.egg-info/dependency_links.txt +1 -0
  8. bobo_agent-0.2.0/bobo_agent.egg-info/entry_points.txt +2 -0
  9. bobo_agent-0.2.0/bobo_agent.egg-info/requires.txt +4 -0
  10. bobo_agent-0.2.0/bobo_agent.egg-info/top_level.txt +3 -0
  11. bobo_agent-0.2.0/bobo_tui_gateway/__init__.py +1 -0
  12. bobo_agent-0.2.0/bobo_tui_gateway/entry.py +174 -0
  13. bobo_agent-0.2.0/bobo_tui_gateway/server.py +741 -0
  14. bobo_agent-0.2.0/bobo_tui_gateway/transport.py +50 -0
  15. bobo_agent-0.2.0/core/__init__.py +2 -0
  16. bobo_agent-0.2.0/core/context.py +147 -0
  17. bobo_agent-0.2.0/core/engine.py +479 -0
  18. bobo_agent-0.2.0/core/llm_caller.py +209 -0
  19. bobo_agent-0.2.0/core/provider.py +110 -0
  20. bobo_agent-0.2.0/core/session_manager.py +142 -0
  21. bobo_agent-0.2.0/core/skill_executor.py +80 -0
  22. bobo_agent-0.2.0/core/skill_manager.py +123 -0
  23. bobo_agent-0.2.0/core/tool_executor.py +41 -0
  24. bobo_agent-0.2.0/core/tool_runner.py +352 -0
  25. bobo_agent-0.2.0/core/tracer.py +78 -0
  26. bobo_agent-0.2.0/pyproject.toml +29 -0
  27. bobo_agent-0.2.0/setup.cfg +4 -0
  28. bobo_agent-0.2.0/tests/test_mock_engine.py +79 -0
  29. bobo_agent-0.2.0/tools/__init__.py +86 -0
  30. bobo_agent-0.2.0/tools/analyze_emails.py +21 -0
  31. bobo_agent-0.2.0/tools/api_call.py +123 -0
  32. bobo_agent-0.2.0/tools/api_register.py +95 -0
  33. bobo_agent-0.2.0/tools/append_obsidian.py +22 -0
  34. bobo_agent-0.2.0/tools/batch_copy_notes.py +63 -0
  35. bobo_agent-0.2.0/tools/batch_delete_notes.py +33 -0
  36. bobo_agent-0.2.0/tools/batch_move_notes.py +46 -0
  37. bobo_agent-0.2.0/tools/bobo_config.py +88 -0
  38. bobo_agent-0.2.0/tools/bobo_profile.py +47 -0
  39. bobo_agent-0.2.0/tools/bobo_schedule.py +196 -0
  40. bobo_agent-0.2.0/tools/browser.py +67 -0
  41. bobo_agent-0.2.0/tools/classify_note.py +116 -0
  42. bobo_agent-0.2.0/tools/clipboard.py +42 -0
  43. bobo_agent-0.2.0/tools/code_execution.py +434 -0
  44. bobo_agent-0.2.0/tools/copy_to_notion.py +67 -0
  45. bobo_agent-0.2.0/tools/copy_to_obsidian.py +49 -0
  46. bobo_agent-0.2.0/tools/crawler.py +106 -0
  47. bobo_agent-0.2.0/tools/create_calendar_event.py +46 -0
  48. bobo_agent-0.2.0/tools/create_folder.py +21 -0
  49. bobo_agent-0.2.0/tools/cross_search.py +27 -0
  50. bobo_agent-0.2.0/tools/delete_folder.py +22 -0
  51. bobo_agent-0.2.0/tools/delete_note.py +22 -0
  52. bobo_agent-0.2.0/tools/email_module.py +354 -0
  53. bobo_agent-0.2.0/tools/execute_terminal.py +125 -0
  54. bobo_agent-0.2.0/tools/file_operation.py +123 -0
  55. bobo_agent-0.2.0/tools/file_writer.py +188 -0
  56. bobo_agent-0.2.0/tools/get_current_time.py +29 -0
  57. bobo_agent-0.2.0/tools/git_status.py +69 -0
  58. bobo_agent-0.2.0/tools/github_check_auth.py +43 -0
  59. bobo_agent-0.2.0/tools/github_create_pr.py +44 -0
  60. bobo_agent-0.2.0/tools/github_create_repo.py +46 -0
  61. bobo_agent-0.2.0/tools/github_pr_comment.py +54 -0
  62. bobo_agent-0.2.0/tools/github_pr_diff.py +48 -0
  63. bobo_agent-0.2.0/tools/github_setup.py +82 -0
  64. bobo_agent-0.2.0/tools/list_calendar_events.py +53 -0
  65. bobo_agent-0.2.0/tools/list_directory.py +106 -0
  66. bobo_agent-0.2.0/tools/list_folder.py +21 -0
  67. bobo_agent-0.2.0/tools/move_note.py +22 -0
  68. bobo_agent-0.2.0/tools/move_to_folder.py +22 -0
  69. bobo_agent-0.2.0/tools/notification.py +37 -0
  70. bobo_agent-0.2.0/tools/notion_append.py +77 -0
  71. bobo_agent-0.2.0/tools/notion_create_page.py +89 -0
  72. bobo_agent-0.2.0/tools/notion_read_page.py +123 -0
  73. bobo_agent-0.2.0/tools/notion_search.py +86 -0
  74. bobo_agent-0.2.0/tools/notion_setup.py +71 -0
  75. bobo_agent-0.2.0/tools/obsidian_tools.py +338 -0
  76. bobo_agent-0.2.0/tools/open_url.py +23 -0
  77. bobo_agent-0.2.0/tools/project_info.py +111 -0
  78. bobo_agent-0.2.0/tools/read_email_content.py +22 -0
  79. bobo_agent-0.2.0/tools/read_local_file.py +154 -0
  80. bobo_agent-0.2.0/tools/read_obsidian.py +22 -0
  81. bobo_agent-0.2.0/tools/read_recent.py +22 -0
  82. bobo_agent-0.2.0/tools/refactor.py +191 -0
  83. bobo_agent-0.2.0/tools/reminder.py +118 -0
  84. bobo_agent-0.2.0/tools/rename_note.py +22 -0
  85. bobo_agent-0.2.0/tools/render.py +94 -0
  86. bobo_agent-0.2.0/tools/restore_checkpoint.py +27 -0
  87. bobo_agent-0.2.0/tools/save_memory.py +36 -0
  88. bobo_agent-0.2.0/tools/save_skill.py +40 -0
  89. bobo_agent-0.2.0/tools/search_code.py +120 -0
  90. bobo_agent-0.2.0/tools/search_emails.py +21 -0
  91. bobo_agent-0.2.0/tools/search_memory.py +19 -0
  92. bobo_agent-0.2.0/tools/search_obsidian.py +22 -0
  93. bobo_agent-0.2.0/tools/v5_memory.py +311 -0
  94. bobo_agent-0.2.0/tools/web_extract.py +51 -0
  95. bobo_agent-0.2.0/tools/web_fetch.py +20 -0
  96. bobo_agent-0.2.0/tools/web_search.py +20 -0
  97. bobo_agent-0.2.0/tools/wiki_rebuild.py +136 -0
  98. bobo_agent-0.2.0/tools/write_obsidian.py +22 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Newton
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,23 @@
1
+ # Notices
2
+
3
+ This project incorporates code from the following third-party projects:
4
+
5
+ ## Hermes Agent
6
+
7
+ The `ui-tui/` directory contains the Hermes Agent TUI frontend (React/Ink/TypeScript).
8
+
9
+ - Source: https://github.com/NousResearch/hermes-agent
10
+ - License: MIT
11
+ - Copyright (c) 2025 Nous Research
12
+
13
+ Used under the terms of the MIT License.
14
+
15
+ ## Hermes Ink
16
+
17
+ The `ui-tui/packages/hermes-ink/` directory contains a forked version of Ink, a React renderer for terminal UIs.
18
+
19
+ - Source: https://github.com/vadimdemedes/ink
20
+ - License: MIT
21
+ - Copyright (c) Vadim Demedes
22
+
23
+ Used under the terms of the MIT License.
@@ -0,0 +1,406 @@
1
+ Metadata-Version: 2.4
2
+ Name: bobo-agent
3
+ Version: 0.2.0
4
+ Summary: Bobo — a personal AI agent for your terminal, Obsidian, and email
5
+ Author: niuqingwei
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/niuqingwei/bobo-agent
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ License-File: NOTICE.md
12
+ Requires-Dist: requests>=2.28
13
+ Requires-Dist: python-dotenv>=1.0
14
+ Requires-Dist: pyyaml>=6.0
15
+ Requires-Dist: beautifulsoup4>=4.12
16
+ Dynamic: license-file
17
+
18
+ # Bobo Agent
19
+ <img width="785" height="315" alt="截屏2026-06-05 22 58 35" src="https://github.com/user-attachments/assets/7dba3e2a-37e9-455c-92d9-44f313d85f54" />
20
+
21
+
22
+ <p align="center">
23
+ <b>A personal AI agent that lives across your knowledge</b><br>
24
+ Obsidian · Notion · Email · GitHub · Any API
25
+ </p>
26
+
27
+ <p align="center">
28
+ <a href="https://github.com/Newton-666/BOBO_Project_Backup/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License"></a>
29
+ <a href="#"><img src="https://img.shields.io/badge/python-3.10+-blue.svg" alt="Python 3.10+"></a>
30
+ <a href="#"><img src="https://img.shields.io/badge/status-active-brightgreen.svg" alt="Status: Active"></a>
31
+ </p>
32
+
33
+ ---
34
+
35
+ ## Quick Start
36
+
37
+ ### Requirements
38
+
39
+ - **Python 3.10+**
40
+ - **Node.js v18+** (runs the TUI)
41
+
42
+ ```bash
43
+ node --version # should show v18+
44
+ # Install: https://nodejs.org or brew install node
45
+ ```
46
+
47
+ ### 1. Clone
48
+
49
+ ```bash
50
+ git clone https://github.com/Newton-666/BOBO_Project_Backup.git
51
+ cd BOBO_Project_Backup
52
+ ```
53
+
54
+ ### 2. Install Python backend
55
+
56
+ ```bash
57
+ python3 -m venv .venv # optional but recommended
58
+ source .venv/bin/activate
59
+ python3 -m pip install -e . # -m pip ensures correct Python
60
+ ```
61
+
62
+ ### 3. Run
63
+
64
+ **Option A — from the project folder (most reliable):**
65
+ ```bash
66
+ ./bobo
67
+ ```
68
+
69
+ **Option B — from anywhere (after pip install):**
70
+ ```bash
71
+ bobo
72
+ ```
73
+
74
+ > If `bobo` gives `ModuleNotFoundError: No module named 'bobo_tui_gateway'`, reinstall:
75
+ > ```bash
76
+ > cd /path/to/BOBO_Project_Backup
77
+ > python3 -m pip install -e . --force-reinstall
78
+ > ```
79
+
80
+ ### 4. Configure API key
81
+
82
+ On first run, the TUI shows a setup screen. Select your provider and paste your API key.
83
+
84
+ Or configure manually:
85
+ ```bash
86
+ mkdir -p ~/.bobo
87
+ echo "DEEPSEEK_API_KEY=sk-your-key-here" > ~/.bobo/.env
88
+ ```
89
+
90
+ > Get a DeepSeek key: https://platform.deepseek.com/api-keys
91
+ > Set `BOBO_PROVIDER=openai` to use OpenAI instead
92
+
93
+ ### Optional: Connect services
94
+
95
+ ```bash
96
+ # Obsidian vault
97
+ echo "OBSIDIAN_VAULT=/path/to/vault" >> ~/.bobo/.env
98
+
99
+ # Notion — just say "connect Notion" in chat
100
+ # GitHub — just say "connect GitHub" in chat
101
+
102
+ # Email
103
+ cat > ~/.bobo/mail.json << 'EOF'
104
+ {"server": "imap.gmail.com", "port": 993,
105
+ "username": "you@gmail.com", "password": "app-password"}
106
+ EOF
107
+ ```
108
+
109
+ ### Uninstall
110
+
111
+ ```bash
112
+ pip uninstall bobo-agent
113
+ rm -rf ~/.bobo ~/.bobo_v2
114
+ ```
115
+
116
+ ---
117
+
118
+ ## What Makes Bobo Unique
119
+
120
+ ### 1. Cross-Platform Knowledge
121
+
122
+ Bobo is the only agent that searches, reads, writes, and links across multiple platforms simultaneously:
123
+
124
+ ```
125
+ You: "find everything about API redesign"
126
+ Bobo: cross_search("API redesign")
127
+ → [Obsidian] Projects/API-redesign.md
128
+ → [Notion] Q1 Planning
129
+ → [Email] "Re: API redesign feedback"
130
+ → "Found 5 items across 3 platforms"
131
+ ```
132
+
133
+ | Tool | What it does |
134
+ |------|-------------|
135
+ | `cross_search(query)` | Search Obsidian + Notion + email at once |
136
+ | `copy_to_obsidian(page_id)` | Copy a Notion page to Obsidian as markdown |
137
+ | `copy_to_notion(filepath)` | Copy an Obsidian note to Notion |
138
+ | `wiki_rebuild()` | Auto-generate a Knowledge Hub with cross-links |
139
+
140
+ ### 2. Connect Any Service Without Code
141
+
142
+ Register any REST API in one command — no Python required:
143
+
144
+ ```
145
+ You: "connect my Jira"
146
+ Bobo: api_register(
147
+ name="jira", base_url="https://company.atlassian.net/rest/api/3",
148
+ auth_type="bearer", auth_key="xxx",
149
+ endpoints='[{"name":"search","method":"GET","path":"/search?jql={query}"}]'
150
+ )
151
+
152
+ You: "find my open tickets"
153
+ Bobo: api_call(api="jira", endpoint="search", params='{"query":"status=Open"}')
154
+ ```
155
+
156
+ All registered APIs are automatically advertised to the LLM on every call.
157
+
158
+ ### 3. Autonomous Coding
159
+
160
+ - **Auto-run**: After writing a `.py` file, Bobo runs it and reports output/errors immediately
161
+ - **Error enrichment**: Tracebacks become `[TypeError] main.py:42` — the LLM sees the problem instantly
162
+ - **Auto-diff**: Git diff is captured after every file write and injected into the next LLM call
163
+ - **Parallel execution**: Independent tools run simultaneously, not sequentially
164
+ - **GitHub integration**: Create repos, push code, open PRs, review diffs
165
+
166
+ ### 4. Privacy & Security
167
+
168
+ - **Secret redaction**: API keys, tokens, passwords are replaced with `[REDACTED]` before reaching the LLM
169
+ - **Tool gating**: Tools with unmet prerequisites are invisible — no Obsidian tools if no vault configured
170
+ - **Blocked folders**: `Private/`, `Archive/` folders are never read, written, or searched
171
+ - **Atomic session writes**: `tmp → rename → bak` — session files never corrupt on crash
172
+ - **No telemetry**: Zero data leaves your machine except the LLM API calls you configure
173
+
174
+ ### 5. Memory That Works
175
+
176
+ Save facts once, Bobo remembers them automatically:
177
+
178
+ ```
179
+ You: "my favorite color is blue"
180
+ Bobo: save_memory("my favorite color is blue")
181
+
182
+ (next session)
183
+ You: "what color do I like?"
184
+ Bobo: [Memory injected automatically] → "You told me your favorite color is blue!"
185
+ ```
186
+
187
+ No need to ask Bobo to "remember" — relevant memories are injected before every LLM call at ~0ms overhead.
188
+
189
+ ### 6. Scheduled Tasks
190
+
191
+ Set recurring tasks with natural language:
192
+
193
+ ```
194
+ You: "rebuild the knowledge hub every morning at 7"
195
+ Bobo: bobo_schedule(action="create", name="wiki-daily",
196
+ task="运行 wiki_rebuild 更新知识图谱",
197
+ time="07:00", repeat="daily")
198
+
199
+ You: "cancel the morning task"
200
+ Bobo: bobo_schedule(action="delete", name="wiki-daily")
201
+ ```
202
+
203
+ Uses cron under the hood. List, create, delete from the chat.
204
+
205
+ ---
206
+
207
+ ## Configuration
208
+
209
+ ### Providers
210
+
211
+ Bobo supports 7 providers out of the box. Set `BOBO_PROVIDER` in `~/.bobo/.env`:
212
+
213
+ ```
214
+ # DeepSeek (default)
215
+ BOBO_PROVIDER=deepseek
216
+ DEEPSEEK_API_KEY=sk-...
217
+
218
+ # OpenAI
219
+ BOBO_PROVIDER=openai
220
+ OPENAI_API_KEY=sk-...
221
+
222
+ # Local (Ollama)
223
+ BOBO_PROVIDER=ollama
224
+ ```
225
+
226
+ Or run `/settings` in the TUI to see current config, or just tell Bobo "switch to OpenAI."
227
+
228
+ ### Obsidian Vault
229
+
230
+ ```bash
231
+ echo "OBSIDIAN_VAULT=/path/to/your/vault" >> ~/.bobo/.env
232
+ ```
233
+
234
+ 17 tools for reading, writing, searching, classifying, and organizing notes.
235
+
236
+ ### Notion
237
+
238
+ ```
239
+ You: "connect my Notion"
240
+ Bobo: "请提供 Notion API Key"
241
+ You: paste the key
242
+ Bobo: "Notion 已连接"
243
+ ```
244
+
245
+ ### Email (IMAP)
246
+
247
+ Create `~/.bobo/mail.json`:
248
+
249
+ ```json
250
+ {
251
+ "server": "imap.gmail.com",
252
+ "port": 993,
253
+ "username": "you@gmail.com",
254
+ "password": "your-app-password"
255
+ }
256
+ ```
257
+
258
+ ### GitHub
259
+
260
+ ```
261
+ You: "connect GitHub"
262
+ Bobo: "请提供 GitHub Personal Access Token"
263
+ You: paste the token
264
+ Bobo: "GitHub 已配置"
265
+ ```
266
+
267
+ ---
268
+
269
+ ## All Commands
270
+
271
+ ```
272
+ /help — Show available commands
273
+ /settings — Show current provider, model, and API key status
274
+ /tools — List all available tools
275
+ /clear — Clear the current conversation
276
+ ```
277
+
278
+ Settings can also be changed naturally: "use gpt-4o," "switch to OpenAI."
279
+
280
+ ---
281
+
282
+ ## Tools (68 total)
283
+
284
+ | Category | Tools |
285
+ |----------|-------|
286
+ | **General** | `cross_search`, `bobo_config`, `bobo_schedule`, `wiki_rebuild`, `api_register`, `api_call`, `get_current_time`, `save_memory`, `search_memory`, `save_skill`, `project_info`, `render`, `notion_setup` |
287
+ | **Knowledge** | `search_obsidian`, `read_obsidian`, `write_obsidian`, `append_obsidian`, `notion_search`, `notion_read_page`, `notion_create_page`, `notion_append`, `search_emails`, `read_email_content`, `analyze_emails` |
288
+ | **Code** | `code_execution`, `file_writer`, `execute_terminal`, `search_code`, `refactor`, `git_status`, `github_create_repo`, `github_create_pr`, `github_pr_diff`, `github_pr_comment`, `github_check_auth`, `github_setup` |
289
+ | **Files** | `read_local_file`, `list_directory`, `file_operation`, `restore_checkpoint` |
290
+ | **Web** | `web_search`, `web_fetch`, `web_extract`, `browser_open`, `browser_get_title`, `open_url` |
291
+ | **macOS** | `send_notification`, `read_clipboard`, `write_clipboard`, `set_reminder`, `list_reminders`, `create_calendar_event`, `list_calendar_events` |
292
+ | **Obsidian** | `read_obsidian`, `write_obsidian`, `search_obsidian`, `append_obsidian`, `classify_note`, `batch_copy_notes`, `batch_delete_notes`, `batch_move_notes`, `create_folder`, `delete_folder`, `delete_note`, `list_folder`, `move_note`, `move_to_folder`, `rename_note`, `read_recent` |
293
+ | **Skills** | `skill_coding_master`, `skill_Python__` (auto-registered from YAML files) |
294
+
295
+ ---
296
+
297
+ ## Example Workflows
298
+
299
+ ```
300
+ # Research → Note → Link
301
+ "Research transformer architectures and save to Obsidian"
302
+ → web_search("transformer architectures 2026")
303
+ → write_obsidian("transformers.md", "...")
304
+ → wiki_rebuild()
305
+
306
+ # Code → Test → Ship
307
+ "Create a Python script to sort my Downloads folder, push to GitHub"
308
+ → file_writer("sort_downloads.py", "...")
309
+ → [auto-run] python3 sort_downloads.py
310
+ → github_create_repo("file-sorter")
311
+ → github_create_pr(title="Add file sorter")
312
+
313
+ # Multi-platform search → Copy
314
+ "Find the Q4 planning doc, copy it to Obsidian"
315
+ → cross_search("Q4 planning")
316
+ → notion_read_page("page-id-123")
317
+ → copy_to_obsidian("page-id-123")
318
+
319
+ # Daily automation
320
+ "Rebuild my knowledge hub every morning"
321
+ → wiki_rebuild()
322
+ → bobo_schedule(action="create", name="daily-hub",
323
+ task="运行 wiki_rebuild", time="07:00", repeat="daily")
324
+ ```
325
+
326
+ ---
327
+
328
+ ## Troubleshooting
329
+
330
+ | Problem | Solution |
331
+ |---------|----------|
332
+ | TUI shows no response | Check API key in `~/.bobo/.env`. Run `/settings`. |
333
+ | "Tool name must be unique" | Skills with Chinese names get sanitized. Rename skill files. |
334
+ | Obsidian tools missing | Set `OBSIDIAN_VAULT` in `.env`. |
335
+ | Notion tools missing | Run `notion_setup` with your API key. |
336
+ | GitHub push fails | Run `gh auth login` or `github_setup`. |
337
+ | Chinese input crashes TUI | Compact mode enabled. Use single-line input. |
338
+ | Session can't be deleted | Fixed in latest version. Ensure `session.delete` handler exists. |
339
+
340
+ ---
341
+
342
+ ## Architecture
343
+
344
+ ```
345
+ bobo (CLI)
346
+ └── ui-tui/ Hermes TUI frontend (React/Ink/TypeScript)
347
+ └── spawns python -m bobo_tui_gateway.entry
348
+ └── bobo_tui_gateway/ JSON-RPC gateway (stdin/stdout)
349
+ ├── entry.py Main loop + signal handling + setup wizard + cron scheduler
350
+ ├── server.py 30+ RPC method handlers
351
+ └── transport.py Thread-safe stdout writer
352
+ └── core/ Agent engine (~340 LOC each)
353
+ ├── engine.py Conversation loop, state machine
354
+ ├── context.py History compression, query classification
355
+ ├── tool_runner.py Tool execution, error enrichment, rollback
356
+ ├── llm_caller.py API caller with streaming + retry (3 attempts)
357
+ ├── provider.py 7 built-in providers
358
+ └── session_manager.py Atomic session persistence
359
+ └── tools/ 68 tools, auto-discovered with gating
360
+ └── __init__.py Auto-discovery + skill-as-tool registration
361
+ └── ~/.bobo/ User config directory
362
+ ├── .env Provider keys, vault paths
363
+ ├── apis/ Registered custom APIs
364
+ └── schedules.json Scheduled tasks
365
+ ```
366
+
367
+ ---
368
+
369
+ ## Development
370
+
371
+ ```bash
372
+ # Set up
373
+ git clone <repo>
374
+ cd bobo-agent && pip install -e .
375
+
376
+ # Run tests (no API key needed)
377
+ python3 tests/test_mock_engine.py
378
+
379
+ # Add a tool
380
+ # Create tools/my_tool.py with register(reg) function:
381
+ def register(reg):
382
+ reg("my_tool", execute_func, schema, check_fn=optional_check)
383
+ ```
384
+
385
+ To gate a tool behind a prerequisite:
386
+
387
+ ```python
388
+ _check = lambda: bool(os.environ.get("MY_CONFIG", ""))
389
+
390
+ def register(reg):
391
+ reg("my_tool", execute_func, schema, check_fn=_check)
392
+ ```
393
+
394
+ ---
395
+
396
+ ## Acknowledgements
397
+
398
+ The TUI frontend (`ui-tui/`) is based on [Hermes Agent](https://github.com/NousResearch/hermes-agent) by Nous Research (MIT). Hermes Ink is a fork of [Ink](https://github.com/vadimdemedes/ink) by Vadim Demedes.
399
+
400
+ See `NOTICE.md` for full details.
401
+
402
+ ---
403
+
404
+ ## License
405
+
406
+ MIT