thepopebot 1.2.75-beta.2 → 1.2.75-beta.4
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/bin/cli.js +24 -4
- package/bin/docker-build.js +5 -0
- package/bin/sync.js +84 -0
- package/lib/ai/async-channel.js +51 -0
- package/lib/ai/index.js +154 -153
- package/lib/ai/tools.js +46 -30
- package/lib/chat/actions.js +12 -0
- package/lib/chat/components/settings-coding-agents-page.js +139 -1
- package/lib/chat/components/settings-coding-agents-page.jsx +160 -0
- package/lib/code/port-forwards.js +14 -3
- package/lib/config.js +4 -0
- package/lib/tools/docker.js +3 -3
- package/package.json +1 -1
- package/setup/setup-ssl.mjs +407 -0
- package/templates/CLAUDE.md.template +3 -4
- package/templates/README.md +1 -1
- package/templates/docker-compose.custom.yml +35 -58
- package/templates/docker-compose.yml +12 -17
- package/templates/docs/CLI.md +3 -3
- package/templates/docs/CONFIGURATION.md +31 -65
- package/templates/docs/GETTING_STARTED.md +1 -1
- package/templates/docs/SECURITY.md +3 -3
- package/templates/docs/SKILLS.md +2 -1
- package/templates/docker-compose.litellm.yml +0 -82
- package/templates/traefik-dynamic.yml.example +0 -7
|
@@ -29,70 +29,51 @@ Config markdown files support includes and built-in variables (processed by the
|
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
-
##
|
|
32
|
+
## Configuration Storage
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Most settings are stored in the SQLite database (encrypted for secrets, plaintext for config). The admin UI is the primary way to manage them.
|
|
35
|
+
|
|
36
|
+
`.env` is only for infrastructure variables that must exist before the database is available:
|
|
35
37
|
|
|
36
38
|
| Variable | Description | Required |
|
|
37
39
|
|----------|-------------|----------|
|
|
38
40
|
| `APP_URL` | Public URL for webhooks and Telegram | Yes |
|
|
39
|
-
| `
|
|
40
|
-
| `
|
|
41
|
+
| `APP_HOSTNAME` | Hostname extracted from APP_URL | Yes |
|
|
42
|
+
| `AUTH_SECRET` | Session encryption + DB secret key (auto-generated) | Yes |
|
|
41
43
|
| `GH_OWNER` | GitHub repository owner | Yes |
|
|
42
44
|
| `GH_REPO` | GitHub repository name | Yes |
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
| `TELEGRAM_CHAT_ID` | Default chat ID for notifications | For Telegram |
|
|
46
|
-
| `GH_WEBHOOK_SECRET` | GitHub Actions webhook auth | For notifications |
|
|
47
|
-
| `LLM_PROVIDER` | `anthropic`, `openai`, `google`, or `custom` | No (default: `anthropic`) |
|
|
48
|
-
| `LLM_MODEL` | Model name override | No |
|
|
49
|
-
| `LLM_MAX_TOKENS` | Max tokens for LLM responses | No (default: 4096) |
|
|
50
|
-
| `ANTHROPIC_API_KEY` | Anthropic API key | For anthropic provider |
|
|
51
|
-
| `OPENAI_API_KEY` | OpenAI API key / Whisper | For openai provider |
|
|
52
|
-
| `CUSTOM_OPENAI_BASE_URL` | Custom OpenAI-compatible base URL | For custom provider |
|
|
53
|
-
| `GOOGLE_API_KEY` | Google API key | For google provider |
|
|
54
|
-
| `CUSTOM_API_KEY` | Custom provider API key | For custom provider |
|
|
55
|
-
| `AGENT_BACKEND` | Agent runner: `pi` or `claude-code` | No (default: `claude-code`) |
|
|
56
|
-
| `ASSEMBLYAI_API_KEY` | API key for voice transcription | For voice input |
|
|
57
|
-
| `DATABASE_PATH` | Override SQLite DB location | No |
|
|
45
|
+
| `DATABASE_PATH` | Override SQLite DB location (default: `data/db/thepopebot.sqlite`) | No |
|
|
46
|
+
| `LETSENCRYPT_EMAIL` | Email for Let's Encrypt HTTPS certificates | For HTTPS |
|
|
58
47
|
| `COMPOSE_FILE` | Override docker-compose file | No |
|
|
59
48
|
|
|
49
|
+
All other settings (API keys, LLM config, Telegram, voice, coding agents) are managed via the admin UI and stored in the database.
|
|
50
|
+
|
|
60
51
|
---
|
|
61
52
|
|
|
62
53
|
## LLM Providers
|
|
63
54
|
|
|
64
55
|
thepopebot has **two independent LLM configurations**:
|
|
65
56
|
|
|
66
|
-
- **
|
|
67
|
-
- **
|
|
68
|
-
|
|
69
|
-
You can run different models for each. For example, Claude for interactive chat and a local Ollama model for jobs.
|
|
57
|
+
- **Chat** (web chat, Telegram, webhooks, summaries) — configured at Admin > Event Handler > Chat
|
|
58
|
+
- **Coding Agents** (code workspaces, agent jobs) — configured at Admin > Event Handler > Coding Agents
|
|
70
59
|
|
|
71
|
-
|
|
72
|
-
|----------|---------------|-----------------|
|
|
73
|
-
| `anthropic` (default) | `claude-sonnet-4-20250514` | `ANTHROPIC_API_KEY` |
|
|
74
|
-
| `openai` | `gpt-4o` | `OPENAI_API_KEY` |
|
|
75
|
-
| `google` | `gemini-2.5-pro` | `GOOGLE_API_KEY` |
|
|
76
|
-
| `custom` | Any OpenAI-compatible API | `CUSTOM_API_KEY` + `CUSTOM_OPENAI_BASE_URL` |
|
|
77
|
-
|
|
78
|
-
### Setting the Event Handler Model
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
# In .env
|
|
82
|
-
LLM_PROVIDER=anthropic
|
|
83
|
-
LLM_MODEL=claude-sonnet-4-20250514
|
|
84
|
-
ANTHROPIC_API_KEY=sk-ant-...
|
|
85
|
-
```
|
|
60
|
+
You can run different models for each. Add API keys at **Admin > Event Handler > LLMs**.
|
|
86
61
|
|
|
87
|
-
|
|
62
|
+
### Built-in Providers
|
|
88
63
|
|
|
89
|
-
|
|
64
|
+
| Provider | Default model | API key |
|
|
65
|
+
|----------|---------------|---------|
|
|
66
|
+
| `anthropic` (default) | `claude-sonnet-4-6` | `ANTHROPIC_API_KEY` |
|
|
67
|
+
| `openai` | `gpt-5.4` | `OPENAI_API_KEY` |
|
|
68
|
+
| `google` | `gemini-2.5-flash` | `GOOGLE_API_KEY` |
|
|
69
|
+
| `deepseek` | `deepseek-chat` | `DEEPSEEK_API_KEY` |
|
|
70
|
+
| `minimax` | `MiniMax-M2.7` | `MINIMAX_API_KEY` |
|
|
71
|
+
| `mistral` | `mistral-large-latest` | `MISTRAL_API_KEY` |
|
|
72
|
+
| `xai` | `grok-4.20-0309-non-reasoning` | `XAI_API_KEY` |
|
|
73
|
+
| `kimi` | `kimi-k2.5` | `MOONSHOT_API_KEY` |
|
|
74
|
+
| `openrouter` | (user-specified) | `OPENROUTER_API_KEY` |
|
|
90
75
|
|
|
91
|
-
|
|
92
|
-
npx thepopebot set-var LLM_PROVIDER openai
|
|
93
|
-
npx thepopebot set-var LLM_MODEL gpt-4o
|
|
94
|
-
# Set API keys via admin UI: Settings > Agent Jobs > Secrets
|
|
95
|
-
```
|
|
76
|
+
Custom OpenAI-compatible providers can be added via Admin > Event Handler > LLMs. Supports multiple models, a base URL, and an optional API key (for Ollama, Together AI, LM Studio, etc.).
|
|
96
77
|
|
|
97
78
|
### Per-Job Overrides
|
|
98
79
|
|
|
@@ -105,33 +86,19 @@ Add `llm_provider` and `llm_model` to any agent-type entry in `CRONS.json` or `T
|
|
|
105
86
|
"type": "agent",
|
|
106
87
|
"job": "Review open PRs",
|
|
107
88
|
"llm_provider": "openai",
|
|
108
|
-
"llm_model": "gpt-
|
|
89
|
+
"llm_model": "gpt-5.4"
|
|
109
90
|
}
|
|
110
91
|
```
|
|
111
92
|
|
|
112
|
-
###
|
|
93
|
+
### Local Models (Ollama, LM Studio)
|
|
113
94
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
# Cloud custom (DeepSeek, Together AI, etc.)
|
|
118
|
-
npx thepopebot set-var LLM_PROVIDER custom
|
|
119
|
-
npx thepopebot set-var LLM_MODEL deepseek-chat
|
|
120
|
-
npx thepopebot set-var CUSTOM_OPENAI_BASE_URL https://api.deepseek.com/v1
|
|
121
|
-
# Set CUSTOM_API_KEY via admin UI: Settings > Agent Jobs > Secrets
|
|
122
|
-
|
|
123
|
-
# Local custom (Ollama, LM Studio, etc.) — needs self-hosted runner
|
|
124
|
-
npx thepopebot set-var RUNS_ON self-hosted
|
|
125
|
-
npx thepopebot set-var LLM_PROVIDER custom
|
|
126
|
-
npx thepopebot set-var LLM_MODEL qwen3:8b
|
|
127
|
-
npx thepopebot set-var CUSTOM_OPENAI_BASE_URL http://host.docker.internal:11434/v1
|
|
128
|
-
```
|
|
95
|
+
Add a custom provider at Admin > Event Handler > LLMs with the base URL `http://host.docker.internal:11434/v1`. Containers use Docker networking to reach the host machine.
|
|
129
96
|
|
|
130
97
|
---
|
|
131
98
|
|
|
132
99
|
## Agent Job Secrets
|
|
133
100
|
|
|
134
|
-
Agent job secrets are managed
|
|
101
|
+
Agent job secrets are managed at **Admin > Event Handler > Agent Jobs**. They are stored encrypted in SQLite and injected as env vars into Docker containers. The agent can discover available secrets via the `get-secret` skill.
|
|
135
102
|
|
|
136
103
|
---
|
|
137
104
|
|
|
@@ -147,7 +114,7 @@ Agent job secrets are managed through the admin UI (Settings > Agent Jobs > Secr
|
|
|
147
114
|
| `RUNS_ON` | GitHub Actions runner label | `ubuntu-latest` |
|
|
148
115
|
| `LLM_PROVIDER` | LLM provider for Docker agent | `anthropic` |
|
|
149
116
|
| `LLM_MODEL` | LLM model name for Docker agent | Provider default |
|
|
150
|
-
| `AGENT_BACKEND` | Agent runner: `pi`
|
|
117
|
+
| `AGENT_BACKEND` | Agent runner: `claude-code`, `pi`, `gemini-cli`, `codex-cli`, `opencode` | `claude-code` |
|
|
151
118
|
|
|
152
119
|
---
|
|
153
120
|
|
|
@@ -172,7 +139,6 @@ Create a fine-grained PAT scoped to your repository:
|
|
|
172
139
|
For self-hosted deployment:
|
|
173
140
|
|
|
174
141
|
```bash
|
|
175
|
-
npm run build
|
|
176
142
|
docker compose up -d
|
|
177
143
|
```
|
|
178
144
|
|
|
@@ -27,7 +27,7 @@ curl -X POST https://your-app-url/api/create-agent-job \
|
|
|
27
27
|
-d '{"job": "Update the README with installation instructions"}'
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
Generate API keys
|
|
30
|
+
Generate API keys at **Admin > Event Handler > Webhooks** in the web UI.
|
|
31
31
|
|
|
32
32
|
## Connect Telegram (Optional)
|
|
33
33
|
|
|
@@ -11,7 +11,7 @@ thepopebot includes these security measures by default:
|
|
|
11
11
|
- **WebSocket authentication** — Code workspace WebSocket connections validate the session cookie.
|
|
12
12
|
- **Secret filtering in Docker agent** — The `env-sanitizer` filters `AGENT_*` secrets from the LLM's bash subprocess.
|
|
13
13
|
- **Auto-merge path restrictions** — `auto-merge.yml` only merges PRs where all changed files fall within `ALLOWED_PATHS` (default: `/logs`).
|
|
14
|
-
- **
|
|
14
|
+
- **Authenticated fetch route handlers** — All browser-to-server calls use `auth()` session validation.
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
@@ -27,7 +27,7 @@ thepopebot includes these security measures by default:
|
|
|
27
27
|
|
|
28
28
|
### Agent Job Secrets
|
|
29
29
|
|
|
30
|
-
Agent job secrets are managed
|
|
30
|
+
Agent job secrets are managed at **Admin > Event Handler > Agent Jobs**. They are stored encrypted in SQLite and injected as env vars into Docker containers. The agent can discover available secrets via the `get-secret` skill.
|
|
31
31
|
|
|
32
32
|
---
|
|
33
33
|
|
|
@@ -41,7 +41,7 @@ Keep `ALLOWED_PATHS` restrictive. Only widen it after reviewing what your agent
|
|
|
41
41
|
|
|
42
42
|
## API Keys
|
|
43
43
|
|
|
44
|
-
Database-backed API keys are generated
|
|
44
|
+
Database-backed API keys are generated at **Admin > Event Handler > Webhooks**. Format: `tpb_` prefix + 64 hex characters. Keys are SHA-256 hashed in the database.
|
|
45
45
|
|
|
46
46
|
---
|
|
47
47
|
|
package/templates/docs/SKILLS.md
CHANGED
|
@@ -30,6 +30,7 @@ These ship with the package but must be activated manually:
|
|
|
30
30
|
| Skill | Description |
|
|
31
31
|
|-------|-------------|
|
|
32
32
|
| `brave-search` | Web search and content extraction via Brave Search API |
|
|
33
|
+
| `browser-tools` | Browser automation via Puppeteer (screenshots, navigation, interaction) |
|
|
33
34
|
| `google-docs` | Create and manage Google Docs on a shared drive |
|
|
34
35
|
| `google-drive` | Google Drive operations (list, upload, download, delete) |
|
|
35
36
|
| `kie-ai` | AI image and video generation via kie.ai API |
|
|
@@ -102,7 +103,7 @@ If bash + curl isn't sufficient, use Node.js with a `package.json`. Dependencies
|
|
|
102
103
|
|
|
103
104
|
## Credential Setup
|
|
104
105
|
|
|
105
|
-
If a skill needs an API key, add it
|
|
106
|
+
If a skill needs an API key, add it at **Admin > Event Handler > Agent Jobs**. The secret will be injected as an env var into Docker containers. The agent can discover available secrets via the `get-secret` skill.
|
|
106
107
|
|
|
107
108
|
---
|
|
108
109
|
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
# Docker Compose configuration with LiteLLM proxy
|
|
2
|
-
# To activate: set COMPOSE_FILE=docker-compose.litellm.yml in .env
|
|
3
|
-
|
|
4
|
-
services:
|
|
5
|
-
traefik:
|
|
6
|
-
image: traefik:v3
|
|
7
|
-
command:
|
|
8
|
-
- --providers.docker=true
|
|
9
|
-
- --providers.docker.exposedByDefault=false
|
|
10
|
-
- --entrypoints.web.address=:80
|
|
11
|
-
- --entrypoints.websecure.address=:443
|
|
12
|
-
## Uncomment the following lines to enable TLS via Let's Encrypt
|
|
13
|
-
## (requires LETSENCRYPT_EMAIL in .env):
|
|
14
|
-
# - --entrypoints.web.http.redirections.entrypoint.to=websecure
|
|
15
|
-
# - --entrypoints.web.http.redirections.entrypoint.scheme=https
|
|
16
|
-
# - --certificatesresolvers.letsencrypt.acme.email=${LETSENCRYPT_EMAIL}
|
|
17
|
-
# - --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json
|
|
18
|
-
# - --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web
|
|
19
|
-
ports:
|
|
20
|
-
- "80:80"
|
|
21
|
-
- "443:443"
|
|
22
|
-
volumes:
|
|
23
|
-
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
24
|
-
- traefik_certs:/letsencrypt
|
|
25
|
-
restart: unless-stopped
|
|
26
|
-
|
|
27
|
-
event-handler:
|
|
28
|
-
container_name: thepopebot-event-handler
|
|
29
|
-
image: ${EVENT_HANDLER_IMAGE_URL:-stephengpope/thepopebot:event-handler-${THEPOPEBOT_VERSION:-latest}}
|
|
30
|
-
volumes:
|
|
31
|
-
- .:/project
|
|
32
|
-
- ./config:/app/config
|
|
33
|
-
- ./skills:/app/skills
|
|
34
|
-
- ./.env:/app/.env
|
|
35
|
-
- ./data:/app/data
|
|
36
|
-
- ./logs:/app/logs
|
|
37
|
-
- ./cron:/app/cron
|
|
38
|
-
- ./triggers:/app/triggers
|
|
39
|
-
- ./CLAUDE.md:/app/CLAUDE.md
|
|
40
|
-
- /var/run/docker.sock:/var/run/docker.sock
|
|
41
|
-
labels:
|
|
42
|
-
- traefik.enable=true
|
|
43
|
-
# Set APP_HOSTNAME in .env to the domain from APP_URL (e.g., mybot.example.com)
|
|
44
|
-
- traefik.http.routers.event-handler.rule=Host(`${APP_HOSTNAME}`)
|
|
45
|
-
- traefik.http.routers.event-handler.entrypoints=web
|
|
46
|
-
- traefik.http.services.event-handler.loadbalancer.server.port=80
|
|
47
|
-
## Uncomment the following lines to enable TLS via Let's Encrypt:
|
|
48
|
-
# - traefik.http.routers.event-handler.entrypoints=websecure
|
|
49
|
-
# - traefik.http.routers.event-handler.tls.certresolver=letsencrypt
|
|
50
|
-
stop_grace_period: 120s
|
|
51
|
-
healthcheck:
|
|
52
|
-
test: ["CMD", "curl", "-f", "http://localhost:80/api/ping"]
|
|
53
|
-
interval: 10s
|
|
54
|
-
timeout: 3s
|
|
55
|
-
retries: 3
|
|
56
|
-
start_period: 30s
|
|
57
|
-
restart: unless-stopped
|
|
58
|
-
|
|
59
|
-
runner:
|
|
60
|
-
image: myoung34/github-runner:latest
|
|
61
|
-
deploy:
|
|
62
|
-
replicas: ${RUNNER_REPLICAS:-1}
|
|
63
|
-
environment:
|
|
64
|
-
REPO_URL: https://github.com/${GH_OWNER}/${GH_REPO}
|
|
65
|
-
ACCESS_TOKEN: ${GH_TOKEN}
|
|
66
|
-
RUNNER_SCOPE: repo
|
|
67
|
-
LABELS: self-hosted
|
|
68
|
-
EPHEMERAL: "1"
|
|
69
|
-
volumes:
|
|
70
|
-
- /var/run/docker.sock:/var/run/docker.sock
|
|
71
|
-
- .:/project
|
|
72
|
-
restart: unless-stopped
|
|
73
|
-
|
|
74
|
-
litellm:
|
|
75
|
-
image: ghcr.io/berriai/litellm:main-latest
|
|
76
|
-
command: --config /litellm/main.yaml --port 4000
|
|
77
|
-
volumes:
|
|
78
|
-
- ./config/litellm:/litellm:ro
|
|
79
|
-
restart: unless-stopped
|
|
80
|
-
|
|
81
|
-
volumes:
|
|
82
|
-
traefik_certs:
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Traefik dynamic config for Tailscale TLS
|
|
2
|
-
# Copy this file to traefik-dynamic.yml and replace YOUR_HOSTNAME
|
|
3
|
-
# with your full Tailscale machine name (e.g. mybot.taila1b2c3.ts.net)
|
|
4
|
-
tls:
|
|
5
|
-
certificates:
|
|
6
|
-
- certFile: /certs/YOUR_HOSTNAME.crt
|
|
7
|
-
keyFile: /certs/YOUR_HOSTNAME.key
|