kernelbot 1.0.33 → 1.0.35
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.
- package/.env.example +11 -0
- package/README.md +76 -341
- package/bin/kernel.js +134 -15
- package/config.example.yaml +2 -1
- package/goals.md +20 -0
- package/knowledge_base/index.md +11 -0
- package/package.json +2 -1
- package/src/agent.js +166 -19
- package/src/automation/automation-manager.js +16 -0
- package/src/automation/automation.js +6 -2
- package/src/bot.js +295 -163
- package/src/conversation.js +70 -3
- package/src/life/engine.js +87 -68
- package/src/life/evolution.js +4 -8
- package/src/life/improvements.js +2 -6
- package/src/life/journal.js +3 -6
- package/src/life/memory.js +3 -10
- package/src/life/share-queue.js +4 -9
- package/src/prompts/orchestrator.js +21 -12
- package/src/prompts/persona.md +27 -0
- package/src/providers/base.js +51 -8
- package/src/providers/google-genai.js +198 -0
- package/src/providers/index.js +6 -1
- package/src/providers/models.js +6 -2
- package/src/providers/openai-compat.js +25 -11
- package/src/security/auth.js +38 -1
- package/src/services/stt.js +10 -1
- package/src/tools/docker.js +37 -15
- package/src/tools/git.js +6 -0
- package/src/tools/github.js +6 -0
- package/src/tools/jira.js +5 -0
- package/src/tools/monitor.js +13 -15
- package/src/tools/network.js +22 -18
- package/src/tools/os.js +37 -2
- package/src/tools/process.js +21 -14
- package/src/utils/config.js +66 -0
- package/src/utils/date.js +19 -0
- package/src/utils/display.js +1 -1
- package/src/utils/ids.js +12 -0
- package/src/utils/shell.js +31 -0
- package/src/utils/temporal-awareness.js +199 -0
- package/src/utils/timeUtils.js +110 -0
- package/src/utils/truncate.js +42 -0
- package/src/worker.js +2 -18
package/.env.example
CHANGED
|
@@ -7,6 +7,9 @@ GROQ_API_KEY=gsk_...
|
|
|
7
7
|
# Required
|
|
8
8
|
TELEGRAM_BOT_TOKEN=123456:ABC-DEF...
|
|
9
9
|
|
|
10
|
+
# Owner Telegram user ID — only this user can interact with the bot
|
|
11
|
+
OWNER_TELEGRAM_ID=
|
|
12
|
+
|
|
10
13
|
# Optional
|
|
11
14
|
GITHUB_TOKEN=ghp_...
|
|
12
15
|
|
|
@@ -16,3 +19,11 @@ ELEVENLABS_VOICE_ID=JBFqnCBsd6RMkjVDRZzb
|
|
|
16
19
|
JIRA_BASE_URL=https://yourcompany.atlassian.net
|
|
17
20
|
JIRA_EMAIL=you@company.com
|
|
18
21
|
JIRA_API_TOKEN=your-jira-api-token
|
|
22
|
+
|
|
23
|
+
# Quiet Hours — optional "Do Not Disturb" window (format: HH:mm)
|
|
24
|
+
# When set, these take priority over config.yaml quiet_hours values.
|
|
25
|
+
# KernelBot skips non-urgent automations during this time range.
|
|
26
|
+
# Ranges that cross midnight are supported (e.g. 22:00–06:00).
|
|
27
|
+
# Leave unset to fall back to config.yaml (default: 02:00–06:00).
|
|
28
|
+
QUIET_HOURS_START=
|
|
29
|
+
QUIET_HOURS_END=
|
package/README.md
CHANGED
|
@@ -2,395 +2,130 @@
|
|
|
2
2
|
|
|
3
3
|
[kernelbot.io](https://kernelbot.io) | [npm](https://www.npmjs.com/package/kernelbot) | [GitHub](https://github.com/KernelCode/kernelbot)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Send a message and KernelBot dispatches workers that write code, run commands, open PRs, manage Docker, and browse the web autonomously in parallel.
|
|
5
|
+
An AI-powered Telegram assistant that runs a multi-agent swarm on your machine. Send a message and KernelBot dispatches specialized AI workers that write code, run commands, open pull requests, manage servers, and browse the web — all in parallel, all from Telegram.
|
|
8
6
|
|
|
9
7
|
## How It Works
|
|
10
8
|
|
|
11
9
|
```text
|
|
12
|
-
You (Telegram) → Orchestrator (
|
|
10
|
+
You (Telegram) → Orchestrator (your chosen model)
|
|
13
11
|
↓ dispatch_task
|
|
14
12
|
┌───────────┼───────────────┐
|
|
15
13
|
↓ ↓ ↓
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
↕ ↕ ↕ ↕ ↕
|
|
19
|
-
git, PRs, web search, shell, CPU, Docker, multi-source
|
|
20
|
-
Claude Code screenshots RAM, disk deploy, git web research
|
|
14
|
+
Coding Browser System DevOps Research
|
|
15
|
+
Worker Worker Worker Worker Worker
|
|
21
16
|
```
|
|
22
17
|
|
|
23
|
-
|
|
18
|
+
1. You send a message on Telegram.
|
|
19
|
+
2. The **orchestrator** figures out what needs to happen.
|
|
20
|
+
3. It dispatches **workers** that run in the background using your chosen AI model.
|
|
21
|
+
4. Each worker has a focused set of tools (git, shell, Docker, browser, etc.).
|
|
22
|
+
5. You get live progress updates and a summary when the work is done.
|
|
24
23
|
|
|
25
24
|
## Features
|
|
26
25
|
|
|
27
|
-
- **Multi-agent swarm** — orchestrator
|
|
28
|
-
- **
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
31
|
-
- **
|
|
32
|
-
- **
|
|
33
|
-
- **
|
|
34
|
-
- **
|
|
35
|
-
- **
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
38
|
-
- **Claude Code sub-agent** — spawn a dedicated Claude Code CLI session for complex coding tasks (write, edit, debug, refactor)
|
|
39
|
-
- **Docker management** — list containers, read logs, exec into containers, run compose commands
|
|
40
|
-
- **Process control** — list, kill, and manage system processes and systemd services
|
|
41
|
-
- **System monitoring** — check CPU, RAM, disk usage, and read system logs
|
|
42
|
-
- **Networking** — make HTTP requests, check ports, test and reload nginx
|
|
43
|
-
- **Send images** — share screenshots and files directly in the Telegram chat
|
|
44
|
-
- **Skills system** — 35+ built-in persona skills across 11 categories (engineering, design, marketing, etc.) plus custom skills you create
|
|
45
|
-
- **User personas** — auto-learns your preferences, expertise, and communication style across conversations
|
|
46
|
-
- **Smart progress** — live-updating Telegram messages show each worker's activity in real time
|
|
47
|
-
- **Conversation memory** — per-chat history with summarization that persists across restarts
|
|
48
|
-
- **Security built-in** — user allowlist, blocked paths, dangerous operation confirmation, audit logging, secret redaction
|
|
49
|
-
- **Zero config setup** — auto-detects config, prompts for missing credentials on first run
|
|
50
|
-
|
|
51
|
-
## Worker Types
|
|
52
|
-
|
|
53
|
-
| Worker | Tools | Use Case |
|
|
54
|
-
| --- | --- | --- |
|
|
55
|
-
| **Coding** | shell, files, git, GitHub, Claude Code | Write code, fix bugs, create PRs |
|
|
56
|
-
| **Browser** | web search, browse, screenshot, extract, interact | Web search, scraping, screenshots |
|
|
57
|
-
| **System** | shell, files, process, monitor, network | OS operations, monitoring, diagnostics |
|
|
58
|
-
| **DevOps** | shell, files, Docker, process, monitor, network, git | Docker, deploy, infrastructure |
|
|
59
|
-
| **Research** | web search, browse, shell, files | Deep web research and analysis |
|
|
60
|
-
|
|
61
|
-
The orchestrator picks the right worker (or multiple workers in parallel) based on your request. You can also run `/jobs` to see what's running and `/cancel` to stop any worker.
|
|
62
|
-
|
|
63
|
-
## Tools
|
|
64
|
-
|
|
65
|
-
### File System & Shell
|
|
66
|
-
|
|
67
|
-
| Tool | Description |
|
|
68
|
-
| --- | --- |
|
|
69
|
-
| `execute_command` | Run any shell command (git, npm, python, etc.) |
|
|
70
|
-
| `read_file` | Read file contents with optional line limits |
|
|
71
|
-
| `write_file` | Write/create files, auto-creates parent directories |
|
|
72
|
-
| `list_directory` | List directory contents, optionally recursive |
|
|
73
|
-
|
|
74
|
-
### Git & GitHub
|
|
75
|
-
|
|
76
|
-
| Tool | Description |
|
|
77
|
-
| --- | --- |
|
|
78
|
-
| `git_clone` | Clone a repo (`org/repo` shorthand or full URL) |
|
|
79
|
-
| `git_checkout` | Checkout or create branches |
|
|
80
|
-
| `git_commit` | Stage all changes and commit |
|
|
81
|
-
| `git_push` | Push current branch to remote |
|
|
82
|
-
| `git_diff` | Show uncommitted changes |
|
|
83
|
-
| `github_create_pr` | Create a pull request |
|
|
84
|
-
| `github_get_pr_diff` | Get the diff of a PR |
|
|
85
|
-
| `github_post_review` | Post a review on a PR |
|
|
86
|
-
| `github_create_repo` | Create a new GitHub repository |
|
|
87
|
-
| `github_list_prs` | List pull requests for a repo |
|
|
88
|
-
|
|
89
|
-
### Web Browsing & Search
|
|
90
|
-
|
|
91
|
-
| Tool | Description |
|
|
92
|
-
| --- | --- |
|
|
93
|
-
| `web_search` | Search the web and return results |
|
|
94
|
-
| `browse_website` | Navigate to a URL and extract page content (title, headings, text, links) |
|
|
95
|
-
| `screenshot_website` | Take a screenshot of a website, supports full-page and element capture |
|
|
96
|
-
| `extract_content` | Extract specific content using CSS selectors |
|
|
97
|
-
| `interact_with_page` | Click, type, scroll, and run JS on a webpage |
|
|
98
|
-
| `send_image` | Send an image/screenshot directly to the Telegram chat |
|
|
99
|
-
|
|
100
|
-
### JIRA
|
|
101
|
-
|
|
102
|
-
| Tool | Description |
|
|
103
|
-
| --- | --- |
|
|
104
|
-
| `jira_get_ticket` | Get details of a specific JIRA ticket |
|
|
105
|
-
| `jira_search_tickets` | Search tickets using JQL queries |
|
|
106
|
-
| `jira_list_my_tickets` | List tickets assigned to the current user |
|
|
107
|
-
| `jira_get_project_tickets` | Get tickets from a specific JIRA project |
|
|
108
|
-
|
|
109
|
-
### Docker
|
|
110
|
-
|
|
111
|
-
| Tool | Description |
|
|
112
|
-
| --- | --- |
|
|
113
|
-
| `docker_ps` | List containers |
|
|
114
|
-
| `docker_logs` | Get container logs |
|
|
115
|
-
| `docker_exec` | Execute a command inside a running container |
|
|
116
|
-
| `docker_compose` | Run docker compose commands |
|
|
117
|
-
|
|
118
|
-
### Process & System
|
|
119
|
-
|
|
120
|
-
| Tool | Description |
|
|
121
|
-
| --- | --- |
|
|
122
|
-
| `process_list` | List running processes, optionally filter by name |
|
|
123
|
-
| `kill_process` | Kill a process by PID or name |
|
|
124
|
-
| `service_control` | Manage systemd services (start, stop, restart, status) |
|
|
125
|
-
|
|
126
|
-
### Monitoring
|
|
127
|
-
|
|
128
|
-
| Tool | Description |
|
|
129
|
-
| --- | --- |
|
|
130
|
-
| `disk_usage` | Show disk space usage |
|
|
131
|
-
| `memory_usage` | Show RAM usage |
|
|
132
|
-
| `cpu_usage` | Show CPU load |
|
|
133
|
-
| `system_logs` | Read system or application logs |
|
|
134
|
-
|
|
135
|
-
### Networking
|
|
136
|
-
|
|
137
|
-
| Tool | Description |
|
|
138
|
-
| --- | --- |
|
|
139
|
-
| `check_port` | Check if a port is open and listening |
|
|
140
|
-
| `curl_url` | Make HTTP requests and return the response |
|
|
141
|
-
| `nginx_reload` | Test nginx config and reload if valid |
|
|
142
|
-
|
|
143
|
-
### Coding
|
|
144
|
-
|
|
145
|
-
| Tool | Description |
|
|
146
|
-
| --- | --- |
|
|
147
|
-
| `spawn_claude_code` | Spawn Claude Code CLI for coding tasks — writing, fixing, reviewing, and scaffolding code |
|
|
148
|
-
|
|
149
|
-
## Disclaimer
|
|
150
|
-
|
|
151
|
-
> **WARNING:** KernelBot has full access to your operating system. It can execute shell commands, read/write files, manage processes, control Docker containers, browse the web, and interact with external services (GitHub, Telegram) on your behalf. Only run KernelBot on machines you own and control. Always configure `allowed_users` in production to restrict who can interact with the bot. The authors are not responsible for any damage caused by misuse.
|
|
152
|
-
|
|
153
|
-
## Installation
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
npm install -g kernelbot
|
|
157
|
-
```
|
|
26
|
+
- **Multi-agent swarm** — orchestrator + five worker types (coding, browser, system, devops, research) running in parallel.
|
|
27
|
+
- **Multi-model** — Anthropic, OpenAI, Google Gemini, and Groq. Switch anytime with `/brain` or `/orchestrator`.
|
|
28
|
+
- **40+ tools** — shell, files, Git, GitHub PRs, Docker, Puppeteer browsing, JIRA, system monitoring, networking, Claude Code.
|
|
29
|
+
- **Skills** — 35+ persona skills across 11 categories. Activate one to change expertise and style, or create your own.
|
|
30
|
+
- **Voice** — send voice messages and get voice replies (ElevenLabs + Whisper).
|
|
31
|
+
- **Memory** — conversation history, user personas, episodic and semantic memory that persist across restarts.
|
|
32
|
+
- **Living AI** — autonomous background activity: thinking, journaling, browsing, creating, reflecting, and sharing discoveries with you.
|
|
33
|
+
- **Self-awareness** — maintains its own identity (goals, journey, life, hobbies) that evolves over time.
|
|
34
|
+
- **Self-evolution** — proposes and codes its own improvements via PRs. Never auto-merges — you stay in control.
|
|
35
|
+
- **Automations** — recurring tasks on a schedule.
|
|
36
|
+
- **Security** — user allowlist, blocked paths, dangerous-op confirmation, audit logging, secret redaction, job timeouts.
|
|
158
37
|
|
|
159
38
|
## Quick Start
|
|
160
39
|
|
|
161
40
|
```bash
|
|
41
|
+
npm install -g kernelbot
|
|
162
42
|
kernelbot
|
|
163
43
|
```
|
|
164
44
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
1. Prompt you to select an AI provider and model
|
|
168
|
-
2. Ask for your API key and Telegram bot token
|
|
169
|
-
3. Save credentials to `~/.kernelbot/.env`
|
|
170
|
-
4. Verify API connections
|
|
171
|
-
5. Launch the Telegram bot
|
|
172
|
-
|
|
173
|
-
You can change your AI provider/model anytime from the CLI menu (option 5) or via the `/brain` command in Telegram.
|
|
45
|
+
On first run, KernelBot walks you through picking a provider, entering API keys, and setting up your Telegram bot token. Config is saved to `~/.kernelbot/`.
|
|
174
46
|
|
|
175
|
-
##
|
|
176
|
-
|
|
177
|
-
KernelBot auto-detects config from the current directory or `~/.kernelbot/`. Everything works with zero config — just provide your API keys when prompted.
|
|
47
|
+
## Requirements
|
|
178
48
|
|
|
179
|
-
|
|
49
|
+
- Node.js 18+
|
|
50
|
+
- [Telegram Bot Token](https://t.me/BotFather)
|
|
51
|
+
- An API key for your chosen provider(s):
|
|
52
|
+
[Anthropic](https://console.anthropic.com/) | [OpenAI](https://platform.openai.com/api-keys) | [Google AI](https://aistudio.google.com/apikey) | [Groq](https://console.groq.com/keys)
|
|
53
|
+
- Optional: [GitHub Token](https://github.com/settings/tokens), [JIRA API Token](https://id.atlassian.net/manage-profile/security/api-tokens), [ElevenLabs API Key](https://elevenlabs.io/), [Claude Code CLI](https://www.npmjs.com/package/@anthropic-ai/claude-code)
|
|
180
54
|
|
|
181
|
-
|
|
55
|
+
## Commands
|
|
182
56
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
57
|
+
| Command | What it does |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| `/brain` | Switch the worker AI model |
|
|
60
|
+
| `/orchestrator` | Switch the orchestrator model |
|
|
61
|
+
| `/skills` | Browse and activate persona skills |
|
|
62
|
+
| `/jobs` | List running and recent jobs |
|
|
63
|
+
| `/cancel` | Cancel running job(s) |
|
|
64
|
+
| `/life` | Life engine status, pause/resume/trigger |
|
|
65
|
+
| `/journal` | Read journal entries |
|
|
66
|
+
| `/memories` | Browse or search memories |
|
|
67
|
+
| `/evolution` | Self-improvement proposals and history |
|
|
68
|
+
| `/auto` | Manage recurring automations |
|
|
69
|
+
| `/context` | Show conversation context |
|
|
70
|
+
| `/clean` | Clear conversation history |
|
|
71
|
+
| `/browse <url>` | Browse a website |
|
|
72
|
+
| `/help` | Show help |
|
|
73
|
+
|
|
74
|
+
## Workers
|
|
75
|
+
|
|
76
|
+
| Worker | Tools | Best for |
|
|
77
|
+
| --- | --- | --- |
|
|
78
|
+
| **Coding** | shell, files, git, GitHub, Claude Code | Writing code, fixing bugs, creating PRs |
|
|
79
|
+
| **Browser** | web search, browse, screenshot, extract | Web research, scraping, screenshots |
|
|
80
|
+
| **System** | shell, files, process, monitor, network | OS tasks, monitoring, diagnostics |
|
|
81
|
+
| **DevOps** | shell, files, Docker, process, monitor, network, git | Deployment, containers, infrastructure |
|
|
82
|
+
| **Research** | web search, browse, shell, files | Deep web research and analysis |
|
|
198
83
|
|
|
199
|
-
|
|
84
|
+
## Configuration
|
|
200
85
|
|
|
201
|
-
|
|
86
|
+
Config auto-detected from `./config.yaml` or `~/.kernelbot/config.yaml`. Environment variables go in `.env` or `~/.kernelbot/.env`.
|
|
202
87
|
|
|
203
88
|
```yaml
|
|
204
|
-
bot:
|
|
205
|
-
name: KernelBot
|
|
206
|
-
|
|
207
|
-
# Orchestrator — always Anthropic (Claude), manages the swarm
|
|
208
89
|
orchestrator:
|
|
209
|
-
|
|
90
|
+
provider: anthropic # anthropic | openai | google | groq
|
|
91
|
+
model: claude-opus-4-6
|
|
210
92
|
max_tokens: 8192
|
|
211
|
-
temperature: 0.3
|
|
212
|
-
max_tool_depth: 15
|
|
213
93
|
|
|
214
|
-
# Worker brain — your choice of provider/model for all workers
|
|
215
94
|
brain:
|
|
216
95
|
provider: anthropic # anthropic | openai | google | groq
|
|
217
|
-
model: claude-sonnet-4-
|
|
96
|
+
model: claude-sonnet-4-6
|
|
218
97
|
max_tokens: 8192
|
|
219
|
-
temperature: 0.3
|
|
220
98
|
|
|
221
|
-
# Swarm settings
|
|
222
99
|
swarm:
|
|
223
100
|
max_concurrent_jobs: 3
|
|
224
101
|
job_timeout_seconds: 300
|
|
225
|
-
cleanup_interval_minutes: 30
|
|
226
102
|
|
|
227
103
|
telegram:
|
|
228
|
-
allowed_users: []
|
|
229
|
-
# allowed_users: [123456789] # lock to specific Telegram user IDs
|
|
230
|
-
|
|
231
|
-
jira:
|
|
232
|
-
base_url: https://yourcompany.atlassian.net
|
|
233
|
-
email: you@company.com
|
|
234
|
-
api_token: your-api-token
|
|
235
|
-
|
|
236
|
-
security:
|
|
237
|
-
blocked_paths: # paths the agent cannot touch
|
|
238
|
-
- /etc/shadow
|
|
239
|
-
- /etc/passwd
|
|
240
|
-
|
|
241
|
-
claude_code:
|
|
242
|
-
max_turns: 50
|
|
243
|
-
timeout_seconds: 600
|
|
244
|
-
# model: claude-sonnet-4-20250514 # optional model override
|
|
245
|
-
|
|
246
|
-
logging:
|
|
247
|
-
level: info
|
|
248
|
-
max_file_size: 5242880 # 5 MB
|
|
249
|
-
|
|
250
|
-
conversation:
|
|
251
|
-
max_history: 50 # messages per chat
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
## Telegram Commands
|
|
104
|
+
allowed_users: [] # empty = allow all
|
|
255
105
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
| `/skills reset` | Clear active skill back to default |
|
|
261
|
-
| `/jobs` | List running and recent jobs |
|
|
262
|
-
| `/cancel` | Cancel running job(s) |
|
|
263
|
-
| `/context` | Show conversation context and brain info |
|
|
264
|
-
| `/clean` | Clear conversation and start fresh |
|
|
265
|
-
| `/history` | Show message count in memory |
|
|
266
|
-
| `/browse <url>` | Browse a website and get a summary |
|
|
267
|
-
| `/screenshot <url>` | Take a screenshot of a website |
|
|
268
|
-
| `/extract <url> <selector>` | Extract content using CSS selector |
|
|
269
|
-
| `/help` | Show help message |
|
|
270
|
-
|
|
271
|
-
## Skills
|
|
272
|
-
|
|
273
|
-
KernelBot comes with **35+ built-in persona skills** across 11 categories that change the agent's expertise and communication style. Use `/skills` to browse and activate them.
|
|
274
|
-
|
|
275
|
-
| Category | Examples |
|
|
276
|
-
| --- | --- |
|
|
277
|
-
| Engineering | Sr. Frontend, Sr. Backend, DevOps, Mobile, Security, Data Engineer |
|
|
278
|
-
| Design | UI/UX Designer, Graphic Designer, Product Designer |
|
|
279
|
-
| Marketing | Content Marketer, SEO Specialist, Growth Hacker, Social Media |
|
|
280
|
-
| Business | Product Manager, Business Analyst, Startup Advisor, Project Manager |
|
|
281
|
-
| Writing | Technical Writer, Copywriter, Creative Writer, Academic Writer |
|
|
282
|
-
| Data & AI | Data Scientist, ML Engineer, BI Analyst |
|
|
283
|
-
| Finance | Financial Analyst, Accountant, Crypto & DeFi Advisor |
|
|
284
|
-
| Legal | Legal Advisor, Contract Reviewer |
|
|
285
|
-
| Education | Tutor, Curriculum Designer, Language Teacher |
|
|
286
|
-
| Healthcare | Medical Researcher, Health & Wellness Advisor |
|
|
287
|
-
| Creative | Video Producer, Music Producer, Photographer |
|
|
288
|
-
|
|
289
|
-
You can also create **custom skills** with your own system prompts — type or upload a `.md` file via the `/skills` menu.
|
|
290
|
-
|
|
291
|
-
## Security
|
|
292
|
-
|
|
293
|
-
- **User allowlist** — restrict bot access to specific Telegram user IDs. Empty list = dev mode (anyone can use it).
|
|
294
|
-
- **Blocked paths** — files/directories the agent is forbidden from reading or writing (e.g., `/etc/shadow`, SSH keys).
|
|
295
|
-
- **Dangerous operation confirmation** — destructive actions require user confirmation before execution.
|
|
296
|
-
- **Browser URL blocklist** — internal/private network addresses are blocked from browsing.
|
|
297
|
-
- **Audit logging** — every tool call is logged to `kernel-audit.log` with user, tool, params, result, and duration. Secrets in params are automatically redacted.
|
|
298
|
-
- **Command timeout** — shell commands are killed after 30 seconds by default.
|
|
299
|
-
- **Job timeout** — workers are automatically terminated after configurable timeout (default 300s).
|
|
300
|
-
- **Circuit breaker** — workers that fail 3 consecutive tool call iterations are stopped to prevent runaway loops.
|
|
301
|
-
|
|
302
|
-
## JIRA Integration
|
|
303
|
-
|
|
304
|
-
KernelBot can read and search JIRA tickets. Supports both Atlassian Cloud (`*.atlassian.net`) and self-hosted JIRA Server instances.
|
|
305
|
-
|
|
306
|
-
### Setup
|
|
307
|
-
|
|
308
|
-
1. **Get an API token** — for Atlassian Cloud, generate one at [id.atlassian.net/manage-profile/security/api-tokens](https://id.atlassian.net/manage-profile/security/api-tokens). For JIRA Server, use your password or a personal access token.
|
|
309
|
-
|
|
310
|
-
2. **Configure** via environment variables or `config.yaml`:
|
|
311
|
-
|
|
312
|
-
```text
|
|
313
|
-
JIRA_BASE_URL=https://yourcompany.atlassian.net
|
|
314
|
-
JIRA_EMAIL=you@company.com
|
|
315
|
-
JIRA_API_TOKEN=your-api-token
|
|
106
|
+
life:
|
|
107
|
+
enabled: true
|
|
108
|
+
self_coding:
|
|
109
|
+
enabled: true
|
|
316
110
|
```
|
|
317
111
|
|
|
318
|
-
|
|
112
|
+
See the [full config reference](https://github.com/KernelCode/kernelbot/blob/main/config.yaml) for all options.
|
|
319
113
|
|
|
320
|
-
##
|
|
114
|
+
## Architecture
|
|
321
115
|
|
|
322
116
|
```text
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
│ ├── coder.js # Claude Code CLI spawner + smart output
|
|
331
|
-
│ ├── conversation.js # Per-chat conversation history + summarization
|
|
332
|
-
│ ├── persona.js # UserPersonaManager — auto-learning user profiles
|
|
333
|
-
│ ├── intents/
|
|
334
|
-
│ │ ├── detector.js # Web search/browse intent detection
|
|
335
|
-
│ │ └── planner.js # Execution plan generation for intents
|
|
336
|
-
│ ├── prompts/
|
|
337
|
-
│ │ ├── orchestrator.js # Orchestrator system prompt
|
|
338
|
-
│ │ ├── workers.js # Per-worker-type system prompts
|
|
339
|
-
│ │ └── system.js # Core tool instructions
|
|
340
|
-
│ ├── providers/
|
|
341
|
-
│ │ ├── models.js # Provider & model catalog
|
|
342
|
-
│ │ ├── base.js # Abstract provider interface
|
|
343
|
-
│ │ ├── anthropic.js # Anthropic (Claude) provider
|
|
344
|
-
│ │ ├── openai-compat.js # OpenAI / Gemini / Groq provider
|
|
345
|
-
│ │ └── index.js # Provider factory
|
|
346
|
-
│ ├── security/
|
|
347
|
-
│ │ ├── auth.js # User allowlist
|
|
348
|
-
│ │ ├── audit.js # Tool call audit logging
|
|
349
|
-
│ │ └── confirm.js # Dangerous operation detection
|
|
350
|
-
│ ├── skills/
|
|
351
|
-
│ │ ├── catalog.js # 35+ built-in persona skills
|
|
352
|
-
│ │ └── custom.js # Custom skill CRUD + unified lookups
|
|
353
|
-
│ ├── swarm/
|
|
354
|
-
│ │ ├── job.js # Job class (state machine, transitions, summary)
|
|
355
|
-
│ │ ├── job-manager.js # JobManager (EventEmitter, CRUD, cleanup, timeouts)
|
|
356
|
-
│ │ └── worker-registry.js # Worker type → tool category mapping
|
|
357
|
-
│ ├── tools/
|
|
358
|
-
│ │ ├── categories.js # Tool category definitions + keyword matching
|
|
359
|
-
│ │ ├── orchestrator-tools.js # dispatch_task, list_jobs, cancel_job
|
|
360
|
-
│ │ ├── os.js # File system + shell tools
|
|
361
|
-
│ │ ├── git.js # Git operations
|
|
362
|
-
│ │ ├── github.js # GitHub API (PRs, repos, reviews)
|
|
363
|
-
│ │ ├── browser.js # Web browsing + search (Puppeteer)
|
|
364
|
-
│ │ ├── docker.js # Docker management
|
|
365
|
-
│ │ ├── process.js # Process management
|
|
366
|
-
│ │ ├── monitor.js # System monitoring (CPU, RAM, disk)
|
|
367
|
-
│ │ ├── network.js # Network tools (HTTP, ports, nginx)
|
|
368
|
-
│ │ ├── coding.js # Claude Code CLI handler
|
|
369
|
-
│ │ ├── jira.js # JIRA ticket reading + search
|
|
370
|
-
│ │ ├── persona.js # User persona update tool
|
|
371
|
-
│ │ └── index.js # Tool registry + dispatcher
|
|
372
|
-
│ └── utils/
|
|
373
|
-
│ ├── config.js # Config loading (auto-detect + prompt)
|
|
374
|
-
│ ├── display.js # CLI display (logo, spinners, banners)
|
|
375
|
-
│ └── logger.js # Winston logger
|
|
376
|
-
├── config.example.yaml
|
|
377
|
-
├── .env.example
|
|
378
|
-
└── package.json
|
|
117
|
+
Telegram Bot (src/bot.js)
|
|
118
|
+
↓
|
|
119
|
+
OrchestratorAgent (src/agent.js) — 3 core tools
|
|
120
|
+
↓ dispatch_task / list_jobs / cancel_job
|
|
121
|
+
JobManager (src/swarm/) — queued → running → completed/failed/cancelled
|
|
122
|
+
↓
|
|
123
|
+
WorkerAgent (src/worker.js) — scoped tools, background execution
|
|
379
124
|
```
|
|
380
125
|
|
|
381
|
-
|
|
126
|
+
Both the orchestrator and workers are configurable — use any supported provider and model. All persistent data lives in `~/.kernelbot/`.
|
|
382
127
|
|
|
383
|
-
|
|
384
|
-
- [Anthropic API key](https://console.anthropic.com/) — always required (orchestrator runs on Claude)
|
|
385
|
-
- [Telegram Bot Token](https://t.me/BotFather)
|
|
386
|
-
- Chromium/Chrome (for browser tools — installed automatically by Puppeteer)
|
|
387
|
-
- Worker brain API key (optional if using Anthropic for workers too):
|
|
388
|
-
- [OpenAI API key](https://platform.openai.com/api-keys) (GPT)
|
|
389
|
-
- [Google AI API key](https://aistudio.google.com/apikey) (Gemini)
|
|
390
|
-
- [Groq API key](https://console.groq.com/keys) (Llama/Mixtral)
|
|
391
|
-
- [GitHub Token](https://github.com/settings/tokens) (optional, for GitHub tools)
|
|
392
|
-
- [JIRA API Token](https://id.atlassian.net/manage-profile/security/api-tokens) (optional, for JIRA integration)
|
|
393
|
-
- [Claude Code CLI](https://www.npmjs.com/package/@anthropic-ai/claude-code) (optional, for coding tasks)
|
|
128
|
+
> **WARNING:** KernelBot has full access to your operating system. Only run it on machines you own and control. Always configure `allowed_users` in production.
|
|
394
129
|
|
|
395
130
|
## License
|
|
396
131
|
|