thepopebot 1.2.75-beta.2 → 1.2.75-beta.21
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/README.md +1 -1
- package/api/CLAUDE.md +1 -1
- package/api/index.js +5 -12
- package/bin/CLAUDE.md +1 -1
- package/bin/cli.js +329 -14
- package/bin/docker-build.js +5 -0
- package/bin/managed-paths.js +0 -7
- package/bin/sync.js +84 -0
- package/config/CLAUDE.md +1 -29
- package/config/instrumentation.js +1 -1
- package/lib/CLAUDE.md +3 -3
- package/lib/ai/CLAUDE.md +24 -3
- package/lib/ai/agent.js +8 -5
- package/lib/ai/async-channel.js +51 -0
- package/lib/ai/headless-stream.js +3 -0
- package/lib/ai/index.js +149 -173
- package/lib/ai/line-mappers.js +72 -9
- package/lib/ai/tools.js +40 -28
- package/lib/chat/actions.js +34 -6
- package/lib/chat/api.js +17 -1
- package/lib/chat/components/chat-header.js +4 -0
- package/lib/chat/components/chat-header.jsx +4 -0
- package/lib/chat/components/chat-input.js +1 -0
- package/lib/chat/components/chat-input.jsx +1 -0
- package/lib/chat/components/chat.js +9 -1
- package/lib/chat/components/chat.jsx +15 -2
- package/lib/chat/components/chats-page.js +3 -3
- package/lib/chat/components/chats-page.jsx +4 -6
- package/lib/chat/components/crons-page.js +1 -1
- package/lib/chat/components/crons-page.jsx +1 -1
- package/lib/chat/components/message.js +12 -4
- package/lib/chat/components/message.jsx +17 -4
- package/lib/chat/components/settings-chat-page.js +2 -1
- package/lib/chat/components/settings-chat-page.jsx +4 -1
- package/lib/chat/components/settings-coding-agents-page.js +139 -1
- package/lib/chat/components/settings-coding-agents-page.jsx +160 -0
- package/lib/chat/components/settings-jobs-page.js +13 -2
- package/lib/chat/components/settings-jobs-page.jsx +15 -1
- package/lib/chat/components/settings-secrets-layout.js +1 -1
- package/lib/chat/components/settings-secrets-layout.jsx +1 -1
- package/lib/chat/components/sidebar-history-item.js +3 -3
- package/lib/chat/components/sidebar-history-item.jsx +4 -6
- package/lib/chat/components/triggers-page.js +1 -1
- package/lib/chat/components/triggers-page.jsx +1 -1
- package/lib/cluster/actions.js +4 -4
- package/lib/cluster/execute.js +3 -1
- package/lib/code/actions.js +34 -11
- package/lib/code/code-page.js +40 -40
- package/lib/code/code-page.jsx +36 -36
- package/lib/code/port-forwards.js +17 -3
- package/lib/code/terminal-view.js +16 -0
- package/lib/code/terminal-view.jsx +18 -0
- package/lib/config.js +4 -0
- package/lib/cron.js +3 -3
- package/lib/db/api-keys.js +22 -61
- package/lib/db/config.js +23 -0
- package/lib/db/index.js +3 -1
- package/lib/maintenance.js +34 -11
- package/lib/paths.js +1 -38
- package/lib/tools/create-agent-job.js +0 -4
- package/lib/tools/docker.js +23 -16
- package/lib/triggers.js +4 -3
- package/lib/utils/render-md.js +3 -1
- package/package.json +2 -1
- package/setup/setup-ssl.mjs +414 -0
- package/templates/.github/workflows/rebuild-event-handler.yml +3 -0
- package/templates/.github/workflows/upgrade-event-handler.yml +1 -1
- package/templates/.gitignore.template +7 -3
- package/templates/.tmp/CLAUDE.md.template +5 -0
- package/templates/CLAUDE.md +3 -2
- package/templates/CLAUDE.md.template +24 -357
- package/templates/agent-job/CLAUDE.md.template +57 -0
- package/templates/agent-job/CRONS.json +16 -0
- package/templates/{config/agent-job → agent-job}/SOUL.md +3 -3
- package/templates/agent-job/SYSTEM.md +60 -0
- package/templates/agents/CLAUDE.md.template +54 -0
- package/templates/data/CLAUDE.md.template +5 -0
- package/templates/docker-compose.custom.yml +41 -62
- package/templates/docker-compose.yml +14 -21
- package/templates/event-handler/CLAUDE.md.template +0 -0
- package/templates/logs/CLAUDE.md.template +5 -0
- package/templates/skills/CLAUDE.md.template +57 -32
- package/templates/skills/active/.gitkeep +0 -0
- package/templates/skills/library/agent-job-secrets/SKILL.md +23 -0
- package/templates/skills/library/agent-job-secrets/agent-job-secrets.js +62 -0
- package/templates/.pi/extensions/env-sanitizer/index.ts +0 -48
- package/templates/.pi/extensions/env-sanitizer/package.json +0 -5
- package/templates/README.md +0 -75
- package/templates/config/CLAUDE.md.template +0 -40
- package/templates/config/CRONS.json +0 -56
- package/templates/config/agent-job/AGENT_JOB.md +0 -30
- package/templates/cron/CLAUDE.md.template +0 -24
- package/templates/docker-compose.litellm.yml +0 -82
- package/templates/docs/CLAUDE.md.template +0 -12
- package/templates/docs/CLI.md +0 -59
- package/templates/docs/CLUSTERS.md +0 -151
- package/templates/docs/CONFIGURATION.md +0 -181
- package/templates/docs/CRONS_AND_TRIGGERS.md +0 -132
- package/templates/docs/GETTING_STARTED.md +0 -64
- package/templates/docs/SECURITY.md +0 -61
- package/templates/docs/SKILLS.md +0 -113
- package/templates/docs/UPGRADING.md +0 -92
- package/templates/skills/LICENSE +0 -21
- package/templates/skills/README.md +0 -117
- package/templates/skills/agent-job-secrets/SKILL.md +0 -25
- package/templates/skills/agent-job-secrets/agent-job-secrets.js +0 -66
- package/templates/traefik-dynamic.yml.example +0 -7
- package/templates/triggers/CLAUDE.md.template +0 -41
- /package/templates/{config → agent-job}/HEARTBEAT.md +0 -0
- /package/templates/{cron → data}/.gitkeep +0 -0
- /package/templates/{logs → data/clusters}/.gitkeep +0 -0
- /package/templates/{triggers → data/db}/.gitkeep +0 -0
- /package/templates/{config/agent-job → event-handler}/SUMMARY.md +0 -0
- /package/templates/{config → event-handler}/TRIGGERS.json +0 -0
- /package/templates/{config → event-handler}/agent-chat/SYSTEM.md +0 -0
- /package/templates/{config/cluster → event-handler/clusters}/ROLE.md +0 -0
- /package/templates/{config/cluster → event-handler/clusters}/SYSTEM.md +0 -0
- /package/templates/{config → event-handler}/code-chat/SYSTEM.md +0 -0
- /package/templates/{config → event-handler}/litellm/main.yaml +0 -0
- /package/templates/skills/{playwright-cli → library/playwright-cli}/SKILL.md +0 -0
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
# Crons and Triggers
|
|
2
|
-
|
|
3
|
-
## Action Types
|
|
4
|
-
|
|
5
|
-
Both cron jobs and webhook triggers use the same dispatch system. Every action has a `type`:
|
|
6
|
-
|
|
7
|
-
| | `agent` (default) | `command` | `webhook` |
|
|
8
|
-
|---|---|---|---|
|
|
9
|
-
| **Uses LLM** | Yes — spins up Docker agent | No | No |
|
|
10
|
-
| **Runtime** | Minutes to hours | Milliseconds to seconds | Milliseconds to seconds |
|
|
11
|
-
| **Cost** | LLM API calls + GitHub Actions | Free (runs on event handler) | Free (runs on event handler) |
|
|
12
|
-
| **Use case** | Tasks that need to think | Shell scripts, file operations | Call external APIs |
|
|
13
|
-
|
|
14
|
-
If it needs to *think*, use `agent`. If it just needs to *do*, use `command`. If it needs to *call an external service*, use `webhook`.
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## Cron Jobs
|
|
19
|
-
|
|
20
|
-
Defined in `config/CRONS.json`, loaded at server startup.
|
|
21
|
-
|
|
22
|
-
```json
|
|
23
|
-
[
|
|
24
|
-
{
|
|
25
|
-
"name": "Daily Check",
|
|
26
|
-
"schedule": "0 9 * * *",
|
|
27
|
-
"type": "agent",
|
|
28
|
-
"job": "Review recent activity and summarize findings",
|
|
29
|
-
"enabled": true
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"name": "Cleanup Logs",
|
|
33
|
-
"schedule": "0 0 * * 0",
|
|
34
|
-
"type": "command",
|
|
35
|
-
"command": "node cleanup.js --older-than 7d",
|
|
36
|
-
"enabled": false
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
| Field | Required | Description |
|
|
42
|
-
|-------|----------|-------------|
|
|
43
|
-
| `name` | Yes | Display name |
|
|
44
|
-
| `schedule` | Yes | Cron expression (e.g., `0 9 * * *` = daily at 9am) |
|
|
45
|
-
| `type` | No | `agent` (default), `command`, or `webhook` |
|
|
46
|
-
| `job` | For agent | Task prompt passed to the LLM |
|
|
47
|
-
| `command` | For command | Shell command (runs in `cron/` directory) |
|
|
48
|
-
| `url` | For webhook | Target URL |
|
|
49
|
-
| `method` | For webhook | `GET` or `POST` (default: `POST`) |
|
|
50
|
-
| `headers` | For webhook | Custom request headers |
|
|
51
|
-
| `vars` | For webhook | Key-value pairs merged into request body |
|
|
52
|
-
| `enabled` | No | Set `false` to disable (default: `true`) |
|
|
53
|
-
| `llm_provider` | No | Override LLM provider for this cron (agent type only) |
|
|
54
|
-
| `llm_model` | No | Override LLM model for this cron (agent type only) |
|
|
55
|
-
|
|
56
|
-
### Agent Action
|
|
57
|
-
|
|
58
|
-
```json
|
|
59
|
-
{ "type": "agent", "job": "Analyze the logs and write a summary report" }
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Creates a Docker Agent job. The `job` string is the LLM's task prompt.
|
|
63
|
-
|
|
64
|
-
### Command Action
|
|
65
|
-
|
|
66
|
-
```json
|
|
67
|
-
{ "type": "command", "command": "node cleanup.js --older-than 7d" }
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Runs a shell command on the event handler. Working directory: `cron/` for crons, `triggers/` for triggers. Put your scripts in those directories.
|
|
71
|
-
|
|
72
|
-
### Webhook Action
|
|
73
|
-
|
|
74
|
-
```json
|
|
75
|
-
{
|
|
76
|
-
"type": "webhook",
|
|
77
|
-
"url": "https://api.example.com/notify",
|
|
78
|
-
"method": "POST",
|
|
79
|
-
"headers": { "Authorization": "Bearer token" },
|
|
80
|
-
"vars": { "source": "my-agent" }
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Makes an HTTP request. `GET` skips the body. `POST` sends `{ ...vars }` or `{ ...vars, data: <incoming payload> }` when triggered by a webhook.
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## Webhook Triggers
|
|
89
|
-
|
|
90
|
-
Defined in `config/TRIGGERS.json`. Triggers fire on POST requests to watched paths.
|
|
91
|
-
|
|
92
|
-
```json
|
|
93
|
-
[
|
|
94
|
-
{
|
|
95
|
-
"name": "GitHub Push",
|
|
96
|
-
"watch_path": "/webhook/github-push",
|
|
97
|
-
"enabled": true,
|
|
98
|
-
"actions": [
|
|
99
|
-
{
|
|
100
|
-
"type": "agent",
|
|
101
|
-
"job": "Review the push to {{body.ref}}: {{body.head_commit.message}}"
|
|
102
|
-
}
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
| Field | Required | Description |
|
|
109
|
-
|-------|----------|-------------|
|
|
110
|
-
| `name` | Yes | Display name |
|
|
111
|
-
| `watch_path` | Yes | URL path to watch (e.g., `/webhook/github-push`) |
|
|
112
|
-
| `actions` | Yes | Array of actions to fire (same fields as cron actions) |
|
|
113
|
-
| `enabled` | No | Set `false` to disable (default: `true`) |
|
|
114
|
-
|
|
115
|
-
### Template Tokens
|
|
116
|
-
|
|
117
|
-
Use these in `job` and `command` strings to reference the incoming request:
|
|
118
|
-
|
|
119
|
-
| Token | Resolves to |
|
|
120
|
-
|-------|-------------|
|
|
121
|
-
| `{{body}}` | Entire request body as JSON |
|
|
122
|
-
| `{{body.field}}` | Nested field from request body |
|
|
123
|
-
| `{{query}}` | All query parameters as JSON |
|
|
124
|
-
| `{{query.field}}` | Specific query parameter |
|
|
125
|
-
| `{{headers}}` | All request headers as JSON |
|
|
126
|
-
| `{{headers.field}}` | Specific request header |
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## Managing from the Web UI
|
|
131
|
-
|
|
132
|
-
Crons and triggers can also be managed from the **Admin** page (`/admin`) in the web UI. Changes made there are written back to the JSON config files.
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
# Getting Started
|
|
2
|
-
|
|
3
|
-
## Access the Web UI
|
|
4
|
-
|
|
5
|
-
Open your `APP_URL` in a browser. On first visit you'll create an admin account (email + password). After that, log in at `/login`.
|
|
6
|
-
|
|
7
|
-
## Your First Chat
|
|
8
|
-
|
|
9
|
-
Click the chat input at `/` and start a conversation. The AI streams responses in real-time. You can:
|
|
10
|
-
|
|
11
|
-
- **Upload files** — images, PDFs, and text files
|
|
12
|
-
- **Use voice** — click the microphone for real-time transcription (requires `ASSEMBLYAI_API_KEY`)
|
|
13
|
-
- **Browse history** — past conversations are in the sidebar, grouped by date
|
|
14
|
-
|
|
15
|
-
## Your First Job
|
|
16
|
-
|
|
17
|
-
Jobs are autonomous coding tasks. The AI creates a branch, works in a Docker container, and opens a PR.
|
|
18
|
-
|
|
19
|
-
From chat, ask the AI to do something that requires code changes — like "update the README" or "add a new cron job." The AI will create a job, and you can monitor it on the **Runners** page (`/runners`).
|
|
20
|
-
|
|
21
|
-
You can also create jobs via the API:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
curl -X POST https://your-app-url/api/create-agent-job \
|
|
25
|
-
-H "Content-Type: application/json" \
|
|
26
|
-
-H "x-api-key: YOUR_API_KEY" \
|
|
27
|
-
-d '{"job": "Update the README with installation instructions"}'
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Generate API keys from **Settings > Secrets** in the web UI.
|
|
31
|
-
|
|
32
|
-
## Connect Telegram (Optional)
|
|
33
|
-
|
|
34
|
-
Chat with your agent on the go via a Telegram bot:
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
npm run setup-telegram
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
The setup wizard configures your bot token, webhook, and chat ID. Once connected, you can text or send voice messages to create jobs and get responses.
|
|
41
|
-
|
|
42
|
-
## Monitor Activity
|
|
43
|
-
|
|
44
|
-
- **Runners** (`/runners`) — watch running jobs, see logs
|
|
45
|
-
- **Notifications** (`/notifications`) — job completion alerts
|
|
46
|
-
- **Admin** (`/admin`) — manage users, crons, triggers, API keys, and GitHub settings
|
|
47
|
-
|
|
48
|
-
## Code Workspaces
|
|
49
|
-
|
|
50
|
-
Launch interactive coding sessions directly from chat. The AI spins up a Docker container with Claude Code and your repo, giving you a browser-based terminal at `/code/{id}`.
|
|
51
|
-
|
|
52
|
-
## Cluster Workspaces
|
|
53
|
-
|
|
54
|
-
Create multi-role agent teams from `/clusters`. Define roles (Researcher, Writer, etc.), set triggers, and let them collaborate in shared directories. See [CLUSTERS.md](CLUSTERS.md) for details.
|
|
55
|
-
|
|
56
|
-
## What's Next
|
|
57
|
-
|
|
58
|
-
- [CONFIGURATION.md](CONFIGURATION.md) — environment variables, LLM providers, GitHub setup
|
|
59
|
-
- [CRONS_AND_TRIGGERS.md](CRONS_AND_TRIGGERS.md) — schedule recurring jobs and webhook automations
|
|
60
|
-
- [SKILLS.md](SKILLS.md) — extend your agent with custom skills
|
|
61
|
-
- [CLUSTERS.md](CLUSTERS.md) — multi-role agent teams
|
|
62
|
-
- [CLI.md](CLI.md) — all CLI commands
|
|
63
|
-
- [UPGRADING.md](UPGRADING.md) — keeping your agent up to date
|
|
64
|
-
- [SECURITY.md](SECURITY.md) — API keys, secret handling, security model
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# Security
|
|
2
|
-
|
|
3
|
-
## Security Measures
|
|
4
|
-
|
|
5
|
-
thepopebot includes these security measures by default:
|
|
6
|
-
|
|
7
|
-
- **API key authentication** — All external `/api` routes require a valid `x-api-key` header. Keys are SHA-256 hashed and verified with timing-safe comparison.
|
|
8
|
-
- **Webhook secret validation** — Telegram and GitHub webhook endpoints validate shared secrets. Unconfigured endpoints reject all requests (fail-closed).
|
|
9
|
-
- **Cluster webhook authentication** — Cluster role webhook endpoints require a valid API key.
|
|
10
|
-
- **Session encryption** — Web sessions use JWT encrypted with `AUTH_SECRET` in httpOnly cookies.
|
|
11
|
-
- **WebSocket authentication** — Code workspace WebSocket connections validate the session cookie.
|
|
12
|
-
- **Secret filtering in Docker agent** — The `env-sanitizer` filters `AGENT_*` secrets from the LLM's bash subprocess.
|
|
13
|
-
- **Auto-merge path restrictions** — `auto-merge.yml` only merges PRs where all changed files fall within `ALLOWED_PATHS` (default: `/logs`).
|
|
14
|
-
- **Server Actions with session checks** — All browser-to-server mutations use `requireAuth()` session validation.
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## Secret Protection
|
|
19
|
-
|
|
20
|
-
### How It Works
|
|
21
|
-
|
|
22
|
-
1. The event handler passes agent job secrets directly to the Docker container via `buildAgentAuthEnv()`
|
|
23
|
-
2. The container entrypoint exports each key into the environment
|
|
24
|
-
3. The `env-sanitizer` extension filters ALL secret keys from the LLM's bash subprocess env
|
|
25
|
-
4. SDKs (Anthropic, GitHub CLI) read their keys from `process.env` normally
|
|
26
|
-
5. The LLM cannot `echo $ANYTHING` — subprocess env is filtered
|
|
27
|
-
|
|
28
|
-
### Agent Job Secrets
|
|
29
|
-
|
|
30
|
-
Agent job secrets are managed through the admin UI (Settings > Agent Jobs > Secrets). 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
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Auto-Merge Restrictions
|
|
35
|
-
|
|
36
|
-
The `auto-merge.yml` workflow checks every changed file in a job PR against `ALLOWED_PATHS` (GitHub repo variable, default: `/logs`). PRs with changes outside allowed paths require manual review.
|
|
37
|
-
|
|
38
|
-
Keep `ALLOWED_PATHS` restrictive. Only widen it after reviewing what your agent might change.
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## API Keys
|
|
43
|
-
|
|
44
|
-
Database-backed API keys are generated through the web UI (**Settings > Secrets**). Format: `tpb_` prefix + 64 hex characters. Keys are SHA-256 hashed in the database.
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Recommendations
|
|
49
|
-
|
|
50
|
-
- **Set webhook secrets** — Configure `TELEGRAM_WEBHOOK_SECRET` and `GH_WEBHOOK_SECRET`, even for local development
|
|
51
|
-
- **Generate API keys** before exposing your server
|
|
52
|
-
- **Restrict Telegram** — Set `TELEGRAM_CHAT_ID` to your personal chat ID
|
|
53
|
-
- **Stop tunnels when not in use** — Don't leave endpoints exposed overnight
|
|
54
|
-
- **Use Docker Compose with TLS for production** — Enable Let's Encrypt via `LETSENCRYPT_EMAIL`
|
|
55
|
-
- **Review auto-merge settings** — Keep `ALLOWED_PATHS` restrictive
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## Disclaimer
|
|
60
|
-
|
|
61
|
-
All software carries risk. thepopebot is provided as-is. You are responsible for securing your infrastructure, managing API keys, reviewing agent-generated PRs, and monitoring agent activity.
|
package/templates/docs/SKILLS.md
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# Skills
|
|
2
|
-
|
|
3
|
-
Skills extend your agent's capabilities. A skill is a folder containing a `SKILL.md` file and optionally script files. The agent reads the SKILL.md to learn how to use it, then runs scripts via bash.
|
|
4
|
-
|
|
5
|
-
Skills work with both Pi and Claude Code — they share the same `skills/active/` directory.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## How Skills Work
|
|
10
|
-
|
|
11
|
-
- `skills/` — all available skills
|
|
12
|
-
- `skills/active/` — symlinks to activated skills (both agents read from here)
|
|
13
|
-
|
|
14
|
-
At startup, the agent scans `skills/active/` and loads **only the name + description** from each SKILL.md frontmatter into its system prompt. Full instructions are loaded on-demand when the agent decides a skill is relevant.
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## Default Active Skills
|
|
19
|
-
|
|
20
|
-
These are activated out of the box:
|
|
21
|
-
|
|
22
|
-
| Skill | Description |
|
|
23
|
-
|-------|-------------|
|
|
24
|
-
| `get-secret` | List available LLM-accessible credentials |
|
|
25
|
-
|
|
26
|
-
## Available Skills
|
|
27
|
-
|
|
28
|
-
These ship with the package but must be activated manually:
|
|
29
|
-
|
|
30
|
-
| Skill | Description |
|
|
31
|
-
|-------|-------------|
|
|
32
|
-
| `brave-search` | Web search and content extraction via Brave Search API |
|
|
33
|
-
| `google-docs` | Create and manage Google Docs on a shared drive |
|
|
34
|
-
| `google-drive` | Google Drive operations (list, upload, download, delete) |
|
|
35
|
-
| `kie-ai` | AI image and video generation via kie.ai API |
|
|
36
|
-
| `youtube-transcript` | YouTube transcript extraction |
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Activate / Deactivate
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
# Activate
|
|
44
|
-
cd skills/active
|
|
45
|
-
ln -s ../skill-name skill-name
|
|
46
|
-
|
|
47
|
-
# Deactivate
|
|
48
|
-
rm skills/active/skill-name
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## Building a Custom Skill
|
|
54
|
-
|
|
55
|
-
### Skill Folder Structure
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
skills/my-skill/
|
|
59
|
-
├── SKILL.md # Instructions for agent and human
|
|
60
|
-
├── package.json # Optional: npm dependencies
|
|
61
|
-
└── script.sh # Script(s) the agent runs
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### SKILL.md Format
|
|
65
|
-
|
|
66
|
-
```markdown
|
|
67
|
-
---
|
|
68
|
-
name: my-skill
|
|
69
|
-
description: One sentence describing what the skill does and when to use it.
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
# My Skill
|
|
73
|
-
|
|
74
|
-
## Usage
|
|
75
|
-
|
|
76
|
-
\```bash
|
|
77
|
-
skills/my-skill/script.sh <args>
|
|
78
|
-
\```
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
- **`name`** — kebab-case, matches the folder name
|
|
82
|
-
- **`description`** — appears in the system prompt under "Active skills"
|
|
83
|
-
- **Body** — full usage instructions the agent reads on-demand
|
|
84
|
-
- Use **project-root-relative paths** in all examples
|
|
85
|
-
|
|
86
|
-
### Simple Bash Skill
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
#!/bin/bash
|
|
90
|
-
if [ -z "$1" ]; then echo "Usage: my-skill.sh <arg>"; exit 1; fi
|
|
91
|
-
if [ -z "$MY_API_KEY" ]; then echo "Error: MY_API_KEY not set"; exit 1; fi
|
|
92
|
-
curl -s "https://api.example.com/endpoint" \
|
|
93
|
-
-H "Authorization: Bearer $MY_API_KEY" \
|
|
94
|
-
-d "query=$1"
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### Node.js Skill
|
|
98
|
-
|
|
99
|
-
If bash + curl isn't sufficient, use Node.js with a `package.json`. Dependencies are installed automatically in Docker. Run `npm install` once locally in the skill directory.
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## Credential Setup
|
|
104
|
-
|
|
105
|
-
If a skill needs an API key, add it via the admin UI (Settings > Agent Jobs > Secrets). 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
|
-
---
|
|
108
|
-
|
|
109
|
-
## External Skills
|
|
110
|
-
|
|
111
|
-
Additional skills are available at: https://github.com/badlogic/pi-skills
|
|
112
|
-
|
|
113
|
-
Skills follow the **Agent Skills standard** (SKILL.md format), compatible with Pi, Claude Code, Codex CLI, Amp, and Droid.
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
# Upgrading
|
|
2
|
-
|
|
3
|
-
## Quick Upgrade
|
|
4
|
-
|
|
5
|
-
Run the upgrade command from your project directory:
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npx thepopebot upgrade
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
This installs the latest version, runs `init` to update managed files, rebuilds, commits, pushes, and restarts Docker.
|
|
12
|
-
|
|
13
|
-
## Automated Upgrades via GitHub Actions
|
|
14
|
-
|
|
15
|
-
Two workflows handle automated upgrades:
|
|
16
|
-
|
|
17
|
-
### 1. upgrade-event-handler.yml (manual trigger)
|
|
18
|
-
|
|
19
|
-
Trigger from the Actions tab in GitHub: **"Upgrade Event Handler" > Run workflow**. This:
|
|
20
|
-
|
|
21
|
-
1. Runs `npm update thepopebot` in the event handler container
|
|
22
|
-
2. If the version changed, creates an `upgrade/thepopebot-<version>` branch
|
|
23
|
-
3. Opens a PR with auto-merge enabled
|
|
24
|
-
|
|
25
|
-
This only updates `package.json` and `package-lock.json`. Template updates and rebuilds happen when the PR merges.
|
|
26
|
-
|
|
27
|
-
### 2. rebuild-event-handler.yml (on push to main)
|
|
28
|
-
|
|
29
|
-
Triggered when the upgrade PR merges. Detects the version change and:
|
|
30
|
-
|
|
31
|
-
1. Runs `npx thepopebot init` to update managed templates
|
|
32
|
-
2. Commits template changes back to `main`
|
|
33
|
-
3. Pulls the new Docker image
|
|
34
|
-
4. Restarts the container, installs dependencies, builds, and reloads PM2
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## What Gets Updated
|
|
39
|
-
|
|
40
|
-
### Managed files (auto-updated)
|
|
41
|
-
|
|
42
|
-
These are overwritten to match the new package version:
|
|
43
|
-
|
|
44
|
-
- `.github/workflows/` — GitHub Actions workflows
|
|
45
|
-
- `docker-compose.yml` — Docker Compose config
|
|
46
|
-
- `.dockerignore` — Docker ignore rules
|
|
47
|
-
- `CLAUDE.md` — AI assistant context
|
|
48
|
-
|
|
49
|
-
### Your files (never overwritten)
|
|
50
|
-
|
|
51
|
-
Config files, skills, cron scripts, trigger scripts, and other user-editable files are left alone. If the package ships new defaults, `init` will notify you:
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
Updated templates available:
|
|
55
|
-
config/CRONS.json
|
|
56
|
-
|
|
57
|
-
To view differences: npx thepopebot diff <file>
|
|
58
|
-
To reset to default: npx thepopebot reset <file>
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## Recovering from a Failed Upgrade
|
|
64
|
-
|
|
65
|
-
SSH into your server and rebuild manually:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
docker exec thepopebot-event-handler npm install --omit=dev
|
|
69
|
-
docker exec thepopebot-event-handler bash -c 'rm -rf .next-new .next-old && NEXT_BUILD_DIR=.next-new npm run build && mv .next .next-old 2>/dev/null; mv .next-new .next && rm -rf .next-old'
|
|
70
|
-
docker exec thepopebot-event-handler npx pm2 restart all
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Merge Conflicts on Upgrade PR
|
|
74
|
-
|
|
75
|
-
Resolve in the GitHub UI or locally:
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
git fetch origin
|
|
79
|
-
git checkout upgrade/thepopebot-<version>-<timestamp>
|
|
80
|
-
git merge main
|
|
81
|
-
# resolve conflicts
|
|
82
|
-
git push
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Diagnostic Commands
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
docker ps -a | grep thepopebot-event-handler # container running?
|
|
89
|
-
docker logs thepopebot-event-handler --tail 50 # container logs
|
|
90
|
-
docker exec thepopebot-event-handler npx pm2 status # PM2 status
|
|
91
|
-
docker exec thepopebot-event-handler npx pm2 logs --lines 30 # app logs
|
|
92
|
-
```
|
package/templates/skills/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Mario Zechner
|
|
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.
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
# pi-skills
|
|
2
|
-
|
|
3
|
-
A collection of skills for [pi-coding-agent](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent), compatible with Claude Code, Codex CLI, Amp, and Droid.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
### pi-coding-agent
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
# User-level (available in all projects)
|
|
11
|
-
git clone https://github.com/badlogic/pi-skills ~/.pi/agent/skills/pi-skills
|
|
12
|
-
|
|
13
|
-
# Or project-level
|
|
14
|
-
git clone https://github.com/badlogic/pi-skills .pi/skills/pi-skills
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
### Codex CLI
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
git clone https://github.com/badlogic/pi-skills ~/.codex/skills/pi-skills
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Amp
|
|
24
|
-
|
|
25
|
-
Amp finds skills recursively in toolboxes:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
git clone https://github.com/badlogic/pi-skills ~/.config/amp/tools/pi-skills
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Droid (Factory)
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
# User-level
|
|
35
|
-
git clone https://github.com/badlogic/pi-skills ~/.factory/skills/pi-skills
|
|
36
|
-
|
|
37
|
-
# Or project-level
|
|
38
|
-
git clone https://github.com/badlogic/pi-skills .factory/skills/pi-skills
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### Claude Code
|
|
42
|
-
|
|
43
|
-
Claude Code only looks one level deep for `SKILL.md` files, so each skill folder must be directly under the skills directory. Clone the repo somewhere, then symlink individual skills:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
# Clone to a convenient location
|
|
47
|
-
git clone https://github.com/badlogic/pi-skills ~/pi-skills
|
|
48
|
-
|
|
49
|
-
# Symlink individual skills (user-level)
|
|
50
|
-
mkdir -p ~/.claude/skills
|
|
51
|
-
ln -s ~/pi-skills/brave-search ~/.claude/skills/brave-search
|
|
52
|
-
ln -s ~/pi-skills/browser-tools ~/.claude/skills/browser-tools
|
|
53
|
-
ln -s ~/pi-skills/gccli ~/.claude/skills/gccli
|
|
54
|
-
ln -s ~/pi-skills/gdcli ~/.claude/skills/gdcli
|
|
55
|
-
ln -s ~/pi-skills/gmcli ~/.claude/skills/gmcli
|
|
56
|
-
ln -s ~/pi-skills/transcribe ~/.claude/skills/transcribe
|
|
57
|
-
ln -s ~/pi-skills/vscode ~/.claude/skills/vscode
|
|
58
|
-
ln -s ~/pi-skills/youtube-transcript ~/.claude/skills/youtube-transcript
|
|
59
|
-
|
|
60
|
-
# Or project-level
|
|
61
|
-
mkdir -p .claude/skills
|
|
62
|
-
ln -s ~/pi-skills/brave-search .claude/skills/brave-search
|
|
63
|
-
ln -s ~/pi-skills/browser-tools .claude/skills/browser-tools
|
|
64
|
-
ln -s ~/pi-skills/gccli .claude/skills/gccli
|
|
65
|
-
ln -s ~/pi-skills/gdcli .claude/skills/gdcli
|
|
66
|
-
ln -s ~/pi-skills/gmcli .claude/skills/gmcli
|
|
67
|
-
ln -s ~/pi-skills/transcribe .claude/skills/transcribe
|
|
68
|
-
ln -s ~/pi-skills/vscode .claude/skills/vscode
|
|
69
|
-
ln -s ~/pi-skills/youtube-transcript .claude/skills/youtube-transcript
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Available Skills
|
|
73
|
-
|
|
74
|
-
| Skill | Description |
|
|
75
|
-
|-------|-------------|
|
|
76
|
-
| [brave-search](brave-search/SKILL.md) | Web search and content extraction via Brave Search |
|
|
77
|
-
| [gccli](gccli/SKILL.md) | Google Calendar CLI for events and availability |
|
|
78
|
-
| [gdcli](gdcli/SKILL.md) | Google Drive CLI for file management and sharing |
|
|
79
|
-
| [gmcli](gmcli/SKILL.md) | Gmail CLI for email, drafts, and labels |
|
|
80
|
-
| [transcribe](transcribe/SKILL.md) | Speech-to-text transcription via Groq Whisper API |
|
|
81
|
-
| [vscode](vscode/SKILL.md) | VS Code integration for diffs and file comparison |
|
|
82
|
-
| [youtube-transcript](youtube-transcript/SKILL.md) | Fetch YouTube video transcripts |
|
|
83
|
-
|
|
84
|
-
## Skill Format
|
|
85
|
-
|
|
86
|
-
Each skill follows the pi/Claude Code format:
|
|
87
|
-
|
|
88
|
-
```markdown
|
|
89
|
-
---
|
|
90
|
-
name: skill-name
|
|
91
|
-
description: Short description shown to agent
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
# Instructions
|
|
95
|
-
|
|
96
|
-
Detailed instructions here...
|
|
97
|
-
Helper files available at: skills/skill-name/
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
Skills use project-root-relative paths (e.g., `skills/brave-search/search.js`).
|
|
101
|
-
|
|
102
|
-
## Requirements
|
|
103
|
-
|
|
104
|
-
Some skills require additional setup. Generally, the agent will walk you through that. But if not, here you go:
|
|
105
|
-
|
|
106
|
-
- **brave-search**: Requires Node.js. Run `npm install` in the skill directory.
|
|
107
|
-
- **gccli**: Requires Node.js. Install globally with `npm install -g @mariozechner/gccli`.
|
|
108
|
-
- **gdcli**: Requires Node.js. Install globally with `npm install -g @mariozechner/gdcli`.
|
|
109
|
-
- **gmcli**: Requires Node.js. Install globally with `npm install -g @mariozechner/gmcli`.
|
|
110
|
-
- **subagent**: Requires pi-coding-agent. Install globally with `npm install -g @mariozechner/pi-coding-agent`.
|
|
111
|
-
- **transcribe**: Requires curl and a Groq API key.
|
|
112
|
-
- **vscode**: Requires VS Code with `code` CLI in PATH.
|
|
113
|
-
- **youtube-transcript**: Requires Node.js. Run `npm install` in the skill directory.
|
|
114
|
-
|
|
115
|
-
## License
|
|
116
|
-
|
|
117
|
-
MIT
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: agent-job-secrets
|
|
3
|
-
description: List, get, or update agent secrets. Use get for OAuth credentials (auto-refreshed on every call). Use set to persist updated credentials back to the event handler.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Usage
|
|
7
|
-
|
|
8
|
-
```bash
|
|
9
|
-
# List available secrets (null = must fetch, plain = already in env)
|
|
10
|
-
node skills/agent-job-secrets/agent-job-secrets.js
|
|
11
|
-
|
|
12
|
-
# Get a secret value (OAuth credentials are auto-refreshed)
|
|
13
|
-
node skills/agent-job-secrets/agent-job-secrets.js get MY_CREDENTIALS
|
|
14
|
-
|
|
15
|
-
# Set/update a secret (plain string or piped value)
|
|
16
|
-
node skills/agent-job-secrets/agent-job-secrets.js set MY_KEY "value"
|
|
17
|
-
echo "$UPDATED_CREDENTIALS" | node skills/agent-job-secrets/agent-job-secrets.js set MY_KEY
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Notes
|
|
21
|
-
|
|
22
|
-
- `AGENT_JOB_TOKEN` and `APP_URL` are injected automatically — no setup required
|
|
23
|
-
- OAuth credentials show as `null` in the list and must be fetched via `get`
|
|
24
|
-
- `get` on an OAuth credential refreshes it and persists the updated token immediately
|
|
25
|
-
- Plain secrets are available directly as env vars (e.g. `echo $MY_KEY`)
|