squidbot 0.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.
- squidbot-0.1.0/PKG-INFO +542 -0
- squidbot-0.1.0/README.md +510 -0
- squidbot-0.1.0/pyproject.toml +58 -0
- squidbot-0.1.0/squidbot/__init__.py +5 -0
- squidbot-0.1.0/squidbot/agent.py +263 -0
- squidbot-0.1.0/squidbot/channels.py +271 -0
- squidbot-0.1.0/squidbot/character.py +83 -0
- squidbot-0.1.0/squidbot/client.py +318 -0
- squidbot-0.1.0/squidbot/config.py +148 -0
- squidbot-0.1.0/squidbot/daemon.py +310 -0
- squidbot-0.1.0/squidbot/lanes.py +41 -0
- squidbot-0.1.0/squidbot/main.py +157 -0
- squidbot-0.1.0/squidbot/memory_db.py +706 -0
- squidbot-0.1.0/squidbot/playwright_check.py +233 -0
- squidbot-0.1.0/squidbot/plugins/__init__.py +47 -0
- squidbot-0.1.0/squidbot/plugins/base.py +96 -0
- squidbot-0.1.0/squidbot/plugins/hooks.py +416 -0
- squidbot-0.1.0/squidbot/plugins/loader.py +248 -0
- squidbot-0.1.0/squidbot/plugins/web3_plugin.py +407 -0
- squidbot-0.1.0/squidbot/scheduler.py +214 -0
- squidbot-0.1.0/squidbot/server.py +487 -0
- squidbot-0.1.0/squidbot/session.py +609 -0
- squidbot-0.1.0/squidbot/skills.py +141 -0
- squidbot-0.1.0/squidbot/skills_template/reminder/SKILL.md +13 -0
- squidbot-0.1.0/squidbot/skills_template/search/SKILL.md +11 -0
- squidbot-0.1.0/squidbot/skills_template/summarize/SKILL.md +14 -0
- squidbot-0.1.0/squidbot/tools/__init__.py +100 -0
- squidbot-0.1.0/squidbot/tools/base.py +42 -0
- squidbot-0.1.0/squidbot/tools/browser.py +311 -0
- squidbot-0.1.0/squidbot/tools/coding.py +599 -0
- squidbot-0.1.0/squidbot/tools/cron.py +218 -0
- squidbot-0.1.0/squidbot/tools/memory_tool.py +152 -0
- squidbot-0.1.0/squidbot/tools/web_search.py +50 -0
squidbot-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,542 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: squidbot
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Autonomous AI agent with Telegram, tool chaining, skills, and proactive messaging
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: ai,agent,telegram,bot,autonomous
|
|
7
|
+
Author: leejw51
|
|
8
|
+
Requires-Python: >=3.11,<4.0
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Requires-Dist: aiofiles (>=23.0,<24.0)
|
|
18
|
+
Requires-Dist: aiosqlite (>=0.19,<0.20)
|
|
19
|
+
Requires-Dist: apscheduler (>=3.10,<4.0)
|
|
20
|
+
Requires-Dist: duckduckgo-search (>=6.0,<7.0)
|
|
21
|
+
Requires-Dist: mnemonic (>=0.21,<0.22)
|
|
22
|
+
Requires-Dist: numpy (>=1.26,<2.0)
|
|
23
|
+
Requires-Dist: openai (>=1.0,<2.0)
|
|
24
|
+
Requires-Dist: playwright (>=1.40,<2.0)
|
|
25
|
+
Requires-Dist: python-dotenv (>=1.0,<2.0)
|
|
26
|
+
Requires-Dist: python-telegram-bot (>=20.0,<21.0)
|
|
27
|
+
Requires-Dist: web3 (>=7.0,<8.0)
|
|
28
|
+
Project-URL: Homepage, https://github.com/leejw51/SquidBot
|
|
29
|
+
Project-URL: Repository, https://github.com/leejw51/SquidBot
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
# SquidBot
|
|
33
|
+
|
|
34
|
+
<p align="center">
|
|
35
|
+
<img src="squidbot.png" alt="SquidBot" width="200">
|
|
36
|
+
</p>
|
|
37
|
+
|
|
38
|
+
An autonomous AI agent with Telegram integration, persistent memory, web search, browser automation, and scheduled tasks.
|
|
39
|
+
|
|
40
|
+
## Features
|
|
41
|
+
|
|
42
|
+
- **Telegram Bot Interface** - Chat with your AI assistant via Telegram
|
|
43
|
+
- **OpenAI LLM** - Powered by GPT-4o with tool calling
|
|
44
|
+
- **Autonomous Tool Chaining** - Agent can chain multiple tools to complete complex tasks
|
|
45
|
+
- **Persistent Memory** - Remembers information across sessions (SQLite + vector search)
|
|
46
|
+
- **Web Search** - Search the web for current information
|
|
47
|
+
- **Browser Automation** - Browse and interact with websites via Playwright
|
|
48
|
+
- **Scheduled Tasks** - Set reminders and recurring tasks with cron expressions
|
|
49
|
+
- **Coding Agent** - Write, run, and test Zig and Python code in isolated workspace
|
|
50
|
+
- **Plugin System** - Extend functionality with plugins and lifecycle hooks
|
|
51
|
+
- **Web3 Integration** - Blockchain wallet with balance checking and CRO transfers
|
|
52
|
+
- **Custom Skills** - Extend agent behavior with markdown skill files
|
|
53
|
+
- **Custom Character** - Define AI personality and communication style
|
|
54
|
+
|
|
55
|
+
## Quick Start
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
cd app
|
|
59
|
+
|
|
60
|
+
# Install dependencies
|
|
61
|
+
make install
|
|
62
|
+
|
|
63
|
+
# Configure environment
|
|
64
|
+
cp .env.example .env
|
|
65
|
+
# Edit .env with your API keys
|
|
66
|
+
|
|
67
|
+
# Start the server
|
|
68
|
+
make start
|
|
69
|
+
|
|
70
|
+
# Run the chat client (optional - for terminal chat)
|
|
71
|
+
make client
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Environment Variables
|
|
75
|
+
|
|
76
|
+
Create a `.env` file in the `app/` directory:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Required
|
|
80
|
+
TELEGRAM_BOT_TOKEN=your_telegram_bot_token # From @BotFather
|
|
81
|
+
OPENAI_API_KEY=your_openai_api_key # From OpenAI
|
|
82
|
+
|
|
83
|
+
# Optional - Model
|
|
84
|
+
OPENAI_MODEL=gpt-4o # Default: gpt-4o
|
|
85
|
+
|
|
86
|
+
# Optional - Proactive messaging
|
|
87
|
+
HEARTBEAT_INTERVAL_MINUTES=30 # Default: 30
|
|
88
|
+
|
|
89
|
+
# Optional - Local server port
|
|
90
|
+
SQUID_PORT=7777 # Default: 7777
|
|
91
|
+
|
|
92
|
+
# Optional - Home directory for all data
|
|
93
|
+
SQUIDBOT_HOME=~/.squidbot # Default: ~/.squidbot
|
|
94
|
+
|
|
95
|
+
# Optional - AI Character/Personality
|
|
96
|
+
CHARACTER_NAME=Assistant # Bot's name
|
|
97
|
+
CHARACTER_PERSONA=You are a helpful assistant # Personality description
|
|
98
|
+
CHARACTER_STYLE=helpful, friendly, concise # Communication style
|
|
99
|
+
|
|
100
|
+
# Optional - Web3 Plugin (Blockchain)
|
|
101
|
+
SQUIDBOT_MNEMONICS= # BIP39 mnemonic (random if empty)
|
|
102
|
+
SQUIDBOT_WALLET_INDEX=0 # HD wallet derivation index
|
|
103
|
+
SQUIDBOT_CHAINID=338 # Chain ID (338 = Cronos testnet)
|
|
104
|
+
SQUIDBOT_RPC=https://evm-dev-t3.cronos.org # RPC endpoint URL
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Getting API Keys
|
|
108
|
+
|
|
109
|
+
1. **Telegram Bot Token**: Message [@BotFather](https://t.me/BotFather) on Telegram, use `/newbot` command
|
|
110
|
+
2. **OpenAI API Key**: Get from [OpenAI Platform](https://platform.openai.com/api-keys)
|
|
111
|
+
|
|
112
|
+
## Skills System
|
|
113
|
+
|
|
114
|
+
Skills are markdown files that teach the agent specific behaviors. They are loaded from `~/.squidbot/skills/`.
|
|
115
|
+
|
|
116
|
+
### Directory Structure
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
~/.squidbot/
|
|
120
|
+
├── skills/
|
|
121
|
+
│ ├── weather/
|
|
122
|
+
│ │ └── SKILL.md
|
|
123
|
+
│ ├── search/
|
|
124
|
+
│ │ └── SKILL.md
|
|
125
|
+
│ └── reminder/
|
|
126
|
+
│ └── SKILL.md
|
|
127
|
+
├── CHARACTER.md # Optional character definition
|
|
128
|
+
└── memory.db # SQLite memory database
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Skill File Format
|
|
132
|
+
|
|
133
|
+
Each skill is a directory containing a `SKILL.md` file with YAML frontmatter:
|
|
134
|
+
|
|
135
|
+
```markdown
|
|
136
|
+
---
|
|
137
|
+
name: search
|
|
138
|
+
description: Search the web for information
|
|
139
|
+
---
|
|
140
|
+
When user asks a question requiring current information:
|
|
141
|
+
|
|
142
|
+
1. Use `web_search` tool with a clear query
|
|
143
|
+
2. Review the results
|
|
144
|
+
3. Synthesize a helpful answer with sources
|
|
145
|
+
|
|
146
|
+
Always cite sources when providing factual information.
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Example Skills
|
|
150
|
+
|
|
151
|
+
**Reminder Skill** (`~/.squidbot/skills/reminder/SKILL.md`):
|
|
152
|
+
```markdown
|
|
153
|
+
---
|
|
154
|
+
name: reminder
|
|
155
|
+
description: Set reminders and scheduled tasks
|
|
156
|
+
---
|
|
157
|
+
When user wants to set a reminder:
|
|
158
|
+
|
|
159
|
+
1. Extract the message and time
|
|
160
|
+
2. Use `cron_create` tool with appropriate delay_minutes or cron_expression
|
|
161
|
+
3. Confirm the reminder was set
|
|
162
|
+
|
|
163
|
+
Examples:
|
|
164
|
+
- "Remind me in 10 minutes" → delay_minutes=10
|
|
165
|
+
- "Remind me daily at 9am" → cron_expression="0 9 * * *"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Template Skills
|
|
169
|
+
|
|
170
|
+
Example skills are provided in `app/skills_template/`:
|
|
171
|
+
- `search/` - Web search behavior
|
|
172
|
+
- `reminder/` - Setting reminders
|
|
173
|
+
- `summarize/` - Summarizing content
|
|
174
|
+
|
|
175
|
+
Copy these to `~/.squidbot/skills/` to use them.
|
|
176
|
+
|
|
177
|
+
## Character Configuration
|
|
178
|
+
|
|
179
|
+
Define your AI's personality in `~/.squidbot/CHARACTER.md`:
|
|
180
|
+
|
|
181
|
+
```markdown
|
|
182
|
+
# Character Definition
|
|
183
|
+
|
|
184
|
+
You are a helpful AI assistant with the following traits:
|
|
185
|
+
|
|
186
|
+
## Personality
|
|
187
|
+
- Friendly and approachable
|
|
188
|
+
- Patient and thorough
|
|
189
|
+
- Honest about limitations
|
|
190
|
+
|
|
191
|
+
## Communication Style
|
|
192
|
+
- Clear and concise responses
|
|
193
|
+
- Use examples when helpful
|
|
194
|
+
- Ask clarifying questions when needed
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Available Tools
|
|
198
|
+
|
|
199
|
+
| Tool | Description |
|
|
200
|
+
|------|-------------|
|
|
201
|
+
| `memory_store` | Store information for later recall |
|
|
202
|
+
| `memory_search` | Search stored memories |
|
|
203
|
+
| `web_search` | Search the web |
|
|
204
|
+
| `browser_navigate` | Navigate to a URL |
|
|
205
|
+
| `browser_get_text` | Extract text from current page |
|
|
206
|
+
| `browser_screenshot` | Take a screenshot |
|
|
207
|
+
| `cron_create` | Create scheduled tasks |
|
|
208
|
+
| `cron_list` | List scheduled tasks |
|
|
209
|
+
| `cron_delete` | Delete a scheduled task |
|
|
210
|
+
| `code_write` | Write Zig or Python code to workspace |
|
|
211
|
+
| `code_read` | Read code from workspace |
|
|
212
|
+
| `code_run` | Execute Zig or Python files |
|
|
213
|
+
| `code_list` | List projects and files |
|
|
214
|
+
| `code_delete` | Delete files or projects |
|
|
215
|
+
| `zig_build` | Build Zig projects (with release option) |
|
|
216
|
+
| `zig_test` | Run Zig tests |
|
|
217
|
+
| `python_test` | Run Python tests with pytest |
|
|
218
|
+
| `wallet_info` | Get wallet address and chain info (Web3 Plugin) |
|
|
219
|
+
| `get_balance` | Get CRO balance of wallet or address (Web3 Plugin) |
|
|
220
|
+
| `send_cro` | Send CRO to an address (Web3 Plugin) |
|
|
221
|
+
| `get_tx_count` | Get transaction count/nonce (Web3 Plugin) |
|
|
222
|
+
|
|
223
|
+
## Coding Agent
|
|
224
|
+
|
|
225
|
+
The coding agent allows the AI to write, run, and test code in an isolated workspace. It supports **Zig** and **Python**.
|
|
226
|
+
|
|
227
|
+
### Workspace Structure
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
~/.squidbot/coding/
|
|
231
|
+
├── my_project/
|
|
232
|
+
│ ├── main.py
|
|
233
|
+
│ ├── utils.py
|
|
234
|
+
│ └── test_main.py
|
|
235
|
+
├── zig_project/
|
|
236
|
+
│ ├── main.zig
|
|
237
|
+
│ └── build.zig
|
|
238
|
+
└── algorithms/
|
|
239
|
+
└── sort.zig
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Supported Languages
|
|
243
|
+
|
|
244
|
+
| Language | Extensions | Features |
|
|
245
|
+
|----------|------------|----------|
|
|
246
|
+
| **Python** | `.py` | Run scripts, pytest integration, multi-file imports |
|
|
247
|
+
| **Zig** | `.zig` | Compile & run, build with release optimization, built-in test runner |
|
|
248
|
+
|
|
249
|
+
### Example Usage
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
User: Write a Python function to calculate fibonacci numbers and test it
|
|
253
|
+
|
|
254
|
+
Agent: [Uses code_write to create fibonacci.py]
|
|
255
|
+
[Uses code_write to create test_fibonacci.py]
|
|
256
|
+
[Uses python_test to run the tests]
|
|
257
|
+
All 3 tests passed!
|
|
258
|
+
|
|
259
|
+
User: Now write the same in Zig
|
|
260
|
+
|
|
261
|
+
Agent: [Uses code_write to create fibonacci.zig with tests]
|
|
262
|
+
[Uses zig_test to run the tests]
|
|
263
|
+
All tests passed!
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Requirements
|
|
267
|
+
|
|
268
|
+
- **Python**: Uses the same Python interpreter as SquidBot
|
|
269
|
+
- **Zig**: Optional - install from [ziglang.org](https://ziglang.org/download/) for Zig support
|
|
270
|
+
|
|
271
|
+
## Plugin System
|
|
272
|
+
|
|
273
|
+
SquidBot supports a modular plugin architecture for extending functionality. Plugins can provide tools and register lifecycle hooks.
|
|
274
|
+
|
|
275
|
+
### Plugin Structure
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
app/plugins/
|
|
279
|
+
├── __init__.py # Plugin exports
|
|
280
|
+
├── base.py # Plugin base class
|
|
281
|
+
├── hooks.py # Hook system
|
|
282
|
+
├── loader.py # Plugin loader/registry
|
|
283
|
+
└── web3_plugin.py # Web3 blockchain plugin
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Creating a Plugin
|
|
287
|
+
|
|
288
|
+
```python
|
|
289
|
+
from plugins.base import Plugin, PluginApi, PluginManifest
|
|
290
|
+
from plugins.hooks import HookName, BeforeToolCallEvent, BeforeToolCallResult
|
|
291
|
+
from tools.base import Tool
|
|
292
|
+
|
|
293
|
+
class MyPlugin(Plugin):
|
|
294
|
+
@property
|
|
295
|
+
def manifest(self) -> PluginManifest:
|
|
296
|
+
return PluginManifest(
|
|
297
|
+
id="my-plugin",
|
|
298
|
+
name="My Plugin",
|
|
299
|
+
description="A custom plugin",
|
|
300
|
+
version="1.0.0",
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
def get_tools(self) -> list[Tool]:
|
|
304
|
+
return [MyCustomTool()]
|
|
305
|
+
|
|
306
|
+
def register_hooks(self, api: PluginApi) -> None:
|
|
307
|
+
api.on(HookName.BEFORE_TOOL_CALL, self.on_before_tool, priority=10)
|
|
308
|
+
|
|
309
|
+
async def on_before_tool(self, event: BeforeToolCallEvent, ctx) -> BeforeToolCallResult | None:
|
|
310
|
+
# Intercept and optionally block tool calls
|
|
311
|
+
if event.tool_name == "dangerous_tool":
|
|
312
|
+
return BeforeToolCallResult(block=True, block_reason="Blocked!")
|
|
313
|
+
return None
|
|
314
|
+
|
|
315
|
+
def get_plugin() -> Plugin:
|
|
316
|
+
return MyPlugin()
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Available Hooks
|
|
320
|
+
|
|
321
|
+
| Hook | Type | Description |
|
|
322
|
+
|------|------|-------------|
|
|
323
|
+
| `before_agent_start` | Modifying | Inject context into system prompt |
|
|
324
|
+
| `agent_end` | Void | React to agent completion |
|
|
325
|
+
| `message_received` | Void | Intercept incoming messages |
|
|
326
|
+
| `message_sending` | Modifying | Modify or cancel outgoing messages |
|
|
327
|
+
| `message_sent` | Void | React to message delivery |
|
|
328
|
+
| `before_tool_call` | Modifying | Block or modify tool parameters |
|
|
329
|
+
| `after_tool_call` | Void | Log or react to tool results |
|
|
330
|
+
| `session_start` | Void | Track session start |
|
|
331
|
+
| `session_end` | Void | Track session end |
|
|
332
|
+
|
|
333
|
+
**Hook Types:**
|
|
334
|
+
- **Void**: Fire-and-forget, runs in parallel
|
|
335
|
+
- **Modifying**: Sequential execution, can return modified results
|
|
336
|
+
|
|
337
|
+
### Hook Priority
|
|
338
|
+
|
|
339
|
+
Hooks with higher priority run first. Default priority is 0.
|
|
340
|
+
|
|
341
|
+
```python
|
|
342
|
+
api.on(HookName.BEFORE_TOOL_CALL, handler, priority=100) # Runs first
|
|
343
|
+
api.on(HookName.BEFORE_TOOL_CALL, handler, priority=10) # Runs second
|
|
344
|
+
api.on(HookName.BEFORE_TOOL_CALL, handler) # Runs last (priority=0)
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
## Web3 Plugin
|
|
348
|
+
|
|
349
|
+
The Web3 plugin provides blockchain wallet functionality for the Cronos chain.
|
|
350
|
+
|
|
351
|
+
### Features
|
|
352
|
+
|
|
353
|
+
- **Wallet Management**: Create wallet from mnemonic or generate random
|
|
354
|
+
- **Balance Checking**: Query CRO balance for any address
|
|
355
|
+
- **Send Transactions**: Transfer CRO to other addresses
|
|
356
|
+
- **Transaction Count**: Get nonce for an address
|
|
357
|
+
|
|
358
|
+
### Configuration
|
|
359
|
+
|
|
360
|
+
Set these environment variables in `.env`:
|
|
361
|
+
|
|
362
|
+
```bash
|
|
363
|
+
SQUIDBOT_MNEMONICS=word1 word2 ... word12 # BIP39 mnemonic (12 or 24 words)
|
|
364
|
+
SQUIDBOT_WALLET_INDEX=0 # HD derivation index
|
|
365
|
+
SQUIDBOT_CHAINID=338 # 338=Cronos testnet, 25=Cronos mainnet
|
|
366
|
+
SQUIDBOT_RPC=https://evm-dev-t3.cronos.org # RPC endpoint
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
If `SQUIDBOT_MNEMONICS` is not set, a random wallet is generated on each startup.
|
|
370
|
+
|
|
371
|
+
### Web3 Tools
|
|
372
|
+
|
|
373
|
+
| Tool | Description |
|
|
374
|
+
|------|-------------|
|
|
375
|
+
| `wallet_info` | Get wallet address, chain ID, and connection status |
|
|
376
|
+
| `get_balance` | Get CRO balance (own wallet or specified address) |
|
|
377
|
+
| `send_cro` | Send CRO to an address (requires amount and recipient) |
|
|
378
|
+
| `get_tx_count` | Get transaction count (nonce) for address |
|
|
379
|
+
|
|
380
|
+
### Security Hooks
|
|
381
|
+
|
|
382
|
+
The Web3 plugin includes security hooks:
|
|
383
|
+
- **Transaction Limit**: Blocks transactions over 100 CRO by default
|
|
384
|
+
- **Logging**: All Web3 tool calls are logged with results
|
|
385
|
+
|
|
386
|
+
### Example Usage
|
|
387
|
+
|
|
388
|
+
```
|
|
389
|
+
User: What's my wallet address?
|
|
390
|
+
Agent: [Uses wallet_info]
|
|
391
|
+
Your wallet address is 0x1aac...05aA on Cronos testnet (chain 338)
|
|
392
|
+
|
|
393
|
+
User: Check my balance
|
|
394
|
+
Agent: [Uses get_balance]
|
|
395
|
+
Your balance is 803.16 CRO
|
|
396
|
+
|
|
397
|
+
User: Send 10 CRO to 0x1961...37d6
|
|
398
|
+
Agent: [Uses send_cro]
|
|
399
|
+
Sent 10 CRO to 0x1961...37d6
|
|
400
|
+
Transaction hash: 0x9680c829...
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
## Makefile Commands
|
|
404
|
+
|
|
405
|
+
### Server Management
|
|
406
|
+
|
|
407
|
+
| Command | Description |
|
|
408
|
+
|---------|-------------|
|
|
409
|
+
| `make start` | Start the server as a background daemon |
|
|
410
|
+
| `make stop` | Stop the server |
|
|
411
|
+
| `make stopall` | Stop server and kill all clients |
|
|
412
|
+
| `make restart` | Restart the server |
|
|
413
|
+
| `make status` | Show server status |
|
|
414
|
+
| `make logs` | Show recent server logs |
|
|
415
|
+
| `make logs-follow` | Follow logs in real-time (tail -f) |
|
|
416
|
+
| `make server` | Run server in foreground (for debugging) |
|
|
417
|
+
| `make client` | Run the terminal chat client |
|
|
418
|
+
|
|
419
|
+
### Installation
|
|
420
|
+
|
|
421
|
+
| Command | Description |
|
|
422
|
+
|---------|-------------|
|
|
423
|
+
| `make install` | Install dependencies with pip |
|
|
424
|
+
| `make install-dev` | Install with dev dependencies (pytest, coverage) |
|
|
425
|
+
| `make poetry-install` | Install with Poetry |
|
|
426
|
+
| `make poetry-install-dev` | Install dev dependencies with Poetry |
|
|
427
|
+
|
|
428
|
+
### Testing
|
|
429
|
+
|
|
430
|
+
| Command | Description |
|
|
431
|
+
|---------|-------------|
|
|
432
|
+
| `make test` | Run unit tests only |
|
|
433
|
+
| `make testall` | Run all tests (unit + integration) |
|
|
434
|
+
| `make integrationtest` | Run integration tests only |
|
|
435
|
+
| `make test-verbose` | Run unit tests with extra output |
|
|
436
|
+
| `make test-cov` | Run unit tests with coverage report |
|
|
437
|
+
| `make test-memory` | Run memory tests only |
|
|
438
|
+
| `make test-tools` | Run tool tests only |
|
|
439
|
+
| `make test-chaining` | Run tool chaining tests |
|
|
440
|
+
| `make test-proactive` | Run proactive messaging tests |
|
|
441
|
+
| `make test-coding` | Run coding agent tests (Zig/Python) |
|
|
442
|
+
| `make test-session` | Run session management tests |
|
|
443
|
+
| `make test-sqlite-vec` | Run vector search tests |
|
|
444
|
+
|
|
445
|
+
### Packaging
|
|
446
|
+
|
|
447
|
+
| Command | Description |
|
|
448
|
+
|---------|-------------|
|
|
449
|
+
| `make package` | Build standalone binary using PyInstaller |
|
|
450
|
+
| `make package-debug` | Build binary with console output (for debugging) |
|
|
451
|
+
| `make package-clean` | Remove PyInstaller build artifacts |
|
|
452
|
+
|
|
453
|
+
### Cleanup
|
|
454
|
+
|
|
455
|
+
| Command | Description |
|
|
456
|
+
|---------|-------------|
|
|
457
|
+
| `make clean` | Remove all cache and build files |
|
|
458
|
+
|
|
459
|
+
### Poetry Commands
|
|
460
|
+
|
|
461
|
+
| Command | Description |
|
|
462
|
+
|---------|-------------|
|
|
463
|
+
| `make poetry-test` | Run tests via Poetry |
|
|
464
|
+
| `make poetry-start` | Start server via Poetry |
|
|
465
|
+
| `make poetry-stop` | Stop server via Poetry |
|
|
466
|
+
| `make poetry-client` | Run client via Poetry |
|
|
467
|
+
|
|
468
|
+
## Architecture
|
|
469
|
+
|
|
470
|
+
```
|
|
471
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
472
|
+
│ SquidBot Server │
|
|
473
|
+
├─────────────────────────────────────────────────────────────────────┤
|
|
474
|
+
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
|
|
475
|
+
│ │ Telegram │ │ TCP/HTTP │ │ Scheduler │ │
|
|
476
|
+
│ │ Bot │ │ Clients │ │ (cron/heartbeat) │ │
|
|
477
|
+
│ └──────┬──────┘ └──────┬──────┘ └──────────┬──────────┘ │
|
|
478
|
+
│ │ │ │ │
|
|
479
|
+
│ └────────────────┼────────────────────┘ │
|
|
480
|
+
│ ▼ │
|
|
481
|
+
│ ┌─────────────────────────────────────────────────────────────┐ │
|
|
482
|
+
│ │ Plugin System │ │
|
|
483
|
+
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │ │
|
|
484
|
+
│ │ │ Hooks │ │ Registry │ │ Plugin Loader │ │ │
|
|
485
|
+
│ │ │ (10 types) │ │ (tools) │ │ (auto-discovery) │ │ │
|
|
486
|
+
│ │ └─────────────┘ └─────────────┘ └─────────────────────┘ │ │
|
|
487
|
+
│ └─────────────────────────────────────────────────────────────┘ │
|
|
488
|
+
│ │ │
|
|
489
|
+
│ ▼ │
|
|
490
|
+
│ ┌───────────┐ │
|
|
491
|
+
│ │ Agent │ ◄── Skills + Character │
|
|
492
|
+
│ │ (GPT-4o) │ │
|
|
493
|
+
│ └─────┬─────┘ │
|
|
494
|
+
│ │ │
|
|
495
|
+
│ ┌──────────┬──────────┼──────────┬──────────┬──────────┐ │
|
|
496
|
+
│ ▼ ▼ ▼ ▼ ▼ ▼ │
|
|
497
|
+
│ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ │
|
|
498
|
+
│ │ Memory │ │ Web │ │Browser │ │ Cron │ │ Coding │ │ Web3 │ │
|
|
499
|
+
│ │(SQLite)│ │ Search │ │ Auto │ │ Jobs │ │ Agent │ │ Plugin │ │
|
|
500
|
+
│ └────────┘ └────────┘ └────────┘ └────────┘ └────────┘ └────────┘ │
|
|
501
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
## Data Storage
|
|
505
|
+
|
|
506
|
+
All user data is stored in `~/.squidbot/` (or `$SQUIDBOT_HOME` if set).
|
|
507
|
+
|
|
508
|
+
On first startup, SquidBot automatically creates:
|
|
509
|
+
- Default `CHARACTER.md` with a helpful assistant personality
|
|
510
|
+
- Default skills (`search/` and `reminder/`)
|
|
511
|
+
- All required directories
|
|
512
|
+
|
|
513
|
+
**Startup Info**: When the server starts, it displays configuration info:
|
|
514
|
+
```
|
|
515
|
+
============================================================
|
|
516
|
+
SquidBot Configuration
|
|
517
|
+
============================================================
|
|
518
|
+
Home Directory : /Users/you/.squidbot
|
|
519
|
+
Server Port : 7777
|
|
520
|
+
Model : gpt-4o
|
|
521
|
+
Heartbeat : 30 minutes
|
|
522
|
+
------------------------------------------------------------
|
|
523
|
+
Character File : /Users/you/.squidbot/CHARACTER.md
|
|
524
|
+
Skills Dir : /Users/you/.squidbot/skills
|
|
525
|
+
Coding Dir : /Users/you/.squidbot/coding
|
|
526
|
+
Sessions Dir : /Users/you/.squidbot/sessions
|
|
527
|
+
============================================================
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
| File | Description |
|
|
531
|
+
|------|-------------|
|
|
532
|
+
| `memory.db` | SQLite database with vector embeddings (WAL mode) |
|
|
533
|
+
| `cron_jobs.json` | Scheduled tasks |
|
|
534
|
+
| `CHARACTER.md` | AI character definition |
|
|
535
|
+
| `skills/` | Custom skill definitions |
|
|
536
|
+
| `coding/` | Coding agent workspace (Zig & Python projects) |
|
|
537
|
+
| `sessions/` | Session transcripts (JSONL format) |
|
|
538
|
+
|
|
539
|
+
## License
|
|
540
|
+
|
|
541
|
+
MIT
|
|
542
|
+
|