@harbinger-ai/harbinger 0.1.0
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/LICENSE +21 -0
- package/README.md +406 -0
- package/agents/README.md +76 -0
- package/agents/_template/CONFIG.yaml +7 -0
- package/agents/_template/HEARTBEAT.md +59 -0
- package/agents/_template/IDENTITY.md +4 -0
- package/agents/_template/SKILLS.md +1 -0
- package/agents/_template/SOUL.md +25 -0
- package/agents/_template/TOOLS.md +3 -0
- package/agents/binary-reverser/CONFIG.yaml +21 -0
- package/agents/binary-reverser/HEARTBEAT.md +65 -0
- package/agents/binary-reverser/IDENTITY.md +1 -0
- package/agents/binary-reverser/SKILLS.md +1 -0
- package/agents/binary-reverser/SOUL.md +23 -0
- package/agents/binary-reverser/TOOLS.md +99 -0
- package/agents/browser-agent/CONFIG.yaml +20 -0
- package/agents/browser-agent/HEARTBEAT.md +79 -0
- package/agents/browser-agent/IDENTITY.md +5 -0
- package/agents/browser-agent/SKILLS.md +86 -0
- package/agents/browser-agent/SOUL.md +23 -0
- package/agents/browser-agent/TOOLS.md +186 -0
- package/agents/cloud-infiltrator/CONFIG.yaml +22 -0
- package/agents/cloud-infiltrator/HEARTBEAT.md +78 -0
- package/agents/cloud-infiltrator/IDENTITY.md +1 -0
- package/agents/cloud-infiltrator/SKILLS.md +1 -0
- package/agents/cloud-infiltrator/SOUL.md +23 -0
- package/agents/cloud-infiltrator/TOOLS.md +68 -0
- package/agents/coding-assistant/CONFIG.yaml +22 -0
- package/agents/coding-assistant/HEARTBEAT.md +57 -0
- package/agents/coding-assistant/IDENTITY.md +5 -0
- package/agents/coding-assistant/SKILLS.md +69 -0
- package/agents/coding-assistant/SOUL.md +60 -0
- package/agents/coding-assistant/TOOLS.md +168 -0
- package/agents/learning-agent/CONFIG.yaml +21 -0
- package/agents/learning-agent/HEARTBEAT.md +63 -0
- package/agents/learning-agent/IDENTITY.md +5 -0
- package/agents/learning-agent/SKILLS.md +86 -0
- package/agents/learning-agent/SOUL.md +77 -0
- package/agents/learning-agent/TOOLS.md +145 -0
- package/agents/maintainer/CONFIG.yaml +31 -0
- package/agents/maintainer/HEARTBEAT.md +28 -0
- package/agents/maintainer/IDENTITY.md +33 -0
- package/agents/maintainer/SKILLS.md +24 -0
- package/agents/maintainer/SOUL.md +61 -0
- package/agents/maintainer/TOOLS.md +29 -0
- package/agents/maintainer/lib/engine.js +279 -0
- package/agents/maintainer/lib/safe-fixer.js +183 -0
- package/agents/morning-brief/CONFIG.yaml +22 -0
- package/agents/morning-brief/HEARTBEAT.md +60 -0
- package/agents/morning-brief/IDENTITY.md +5 -0
- package/agents/morning-brief/SKILLS.md +56 -0
- package/agents/morning-brief/SOUL.md +64 -0
- package/agents/morning-brief/TOOLS.md +112 -0
- package/agents/osint-detective/CONFIG.yaml +24 -0
- package/agents/osint-detective/HEARTBEAT.md +66 -0
- package/agents/osint-detective/IDENTITY.md +1 -0
- package/agents/osint-detective/SKILLS.md +1 -0
- package/agents/osint-detective/SOUL.md +23 -0
- package/agents/osint-detective/TOOLS.md +81 -0
- package/agents/recon-scout/CONFIG.yaml +22 -0
- package/agents/recon-scout/HEARTBEAT.md +79 -0
- package/agents/recon-scout/IDENTITY.md +1 -0
- package/agents/recon-scout/SKILLS.md +1 -0
- package/agents/recon-scout/SOUL.md +23 -0
- package/agents/recon-scout/TOOLS.md +93 -0
- package/agents/report-writer/CONFIG.yaml +21 -0
- package/agents/report-writer/HEARTBEAT.md +63 -0
- package/agents/report-writer/IDENTITY.md +1 -0
- package/agents/report-writer/SKILLS.md +1 -0
- package/agents/report-writer/SOUL.md +23 -0
- package/agents/report-writer/TOOLS.md +69 -0
- package/agents/shared/README.md +13 -0
- package/agents/web-hacker/CONFIG.yaml +24 -0
- package/agents/web-hacker/HEARTBEAT.md +78 -0
- package/agents/web-hacker/IDENTITY.md +1 -0
- package/agents/web-hacker/SKILLS.md +1 -0
- package/agents/web-hacker/SOUL.md +23 -0
- package/agents/web-hacker/TOOLS.md +86 -0
- package/api/CLAUDE.md +19 -0
- package/api/index.js +274 -0
- package/bin/cli.js +620 -0
- package/bin/local.sh +31 -0
- package/bin/postinstall.js +63 -0
- package/config/index.js +24 -0
- package/config/instrumentation.js +93 -0
- package/drizzle/0000_initial.sql +52 -0
- package/drizzle/0001_bounty_and_registry.sql +82 -0
- package/drizzle/0002_sync_columns.sql +7 -0
- package/drizzle/0003_graceful_bloodscream.sql +86 -0
- package/drizzle/meta/0000_snapshot.json +321 -0
- package/drizzle/meta/0003_snapshot.json +878 -0
- package/drizzle/meta/_journal.json +34 -0
- package/drizzle/relations.ts +3 -0
- package/drizzle/schema.ts +145 -0
- package/lib/actions.js +47 -0
- package/lib/agents.js +166 -0
- package/lib/ai/agent.js +96 -0
- package/lib/ai/autonomous-engine.js +261 -0
- package/lib/ai/index.js +359 -0
- package/lib/ai/model-router.js +254 -0
- package/lib/ai/model.js +73 -0
- package/lib/ai/tools.js +84 -0
- package/lib/auth/actions.js +28 -0
- package/lib/auth/config.js +27 -0
- package/lib/auth/edge-config.js +27 -0
- package/lib/auth/index.js +27 -0
- package/lib/auth/middleware.js +53 -0
- package/lib/bounty/actions.js +119 -0
- package/lib/bounty/findings.js +64 -0
- package/lib/bounty/programs.js +34 -0
- package/lib/bounty/sync-targets.js +267 -0
- package/lib/bounty/targets.js +33 -0
- package/lib/channels/base.js +56 -0
- package/lib/channels/index.js +15 -0
- package/lib/channels/telegram.js +148 -0
- package/lib/chat/actions.js +288 -0
- package/lib/chat/api.js +135 -0
- package/lib/chat/components/app-sidebar.js +237 -0
- package/lib/chat/components/app-sidebar.jsx +289 -0
- package/lib/chat/components/chat-header.js +27 -0
- package/lib/chat/components/chat-header.jsx +37 -0
- package/lib/chat/components/chat-input.js +230 -0
- package/lib/chat/components/chat-input.jsx +228 -0
- package/lib/chat/components/chat-nav-context.js +11 -0
- package/lib/chat/components/chat-nav-context.jsx +11 -0
- package/lib/chat/components/chat-page.js +81 -0
- package/lib/chat/components/chat-page.jsx +100 -0
- package/lib/chat/components/chat.js +150 -0
- package/lib/chat/components/chat.jsx +182 -0
- package/lib/chat/components/chats-page.js +302 -0
- package/lib/chat/components/chats-page.jsx +330 -0
- package/lib/chat/components/crons-page.js +172 -0
- package/lib/chat/components/crons-page.jsx +244 -0
- package/lib/chat/components/enhanced-tool-call.js +103 -0
- package/lib/chat/components/enhanced-tool-call.jsx +139 -0
- package/lib/chat/components/findings-page.js +175 -0
- package/lib/chat/components/findings-page.jsx +214 -0
- package/lib/chat/components/greeting.js +22 -0
- package/lib/chat/components/greeting.jsx +26 -0
- package/lib/chat/components/icons.js +777 -0
- package/lib/chat/components/icons.jsx +741 -0
- package/lib/chat/components/index.js +26 -0
- package/lib/chat/components/mcp-page.js +260 -0
- package/lib/chat/components/mcp-page.jsx +355 -0
- package/lib/chat/components/message.js +289 -0
- package/lib/chat/components/message.jsx +315 -0
- package/lib/chat/components/messages.js +66 -0
- package/lib/chat/components/messages.jsx +77 -0
- package/lib/chat/components/notifications-page.js +56 -0
- package/lib/chat/components/notifications-page.jsx +87 -0
- package/lib/chat/components/page-layout.js +21 -0
- package/lib/chat/components/page-layout.jsx +28 -0
- package/lib/chat/components/registry-page.js +222 -0
- package/lib/chat/components/registry-page.jsx +255 -0
- package/lib/chat/components/settings-layout.js +40 -0
- package/lib/chat/components/settings-layout.jsx +54 -0
- package/lib/chat/components/settings-secrets-page.js +216 -0
- package/lib/chat/components/settings-secrets-page.jsx +264 -0
- package/lib/chat/components/sidebar-history-item.js +132 -0
- package/lib/chat/components/sidebar-history-item.jsx +113 -0
- package/lib/chat/components/sidebar-history.js +115 -0
- package/lib/chat/components/sidebar-history.jsx +157 -0
- package/lib/chat/components/sidebar-user-nav.js +63 -0
- package/lib/chat/components/sidebar-user-nav.jsx +73 -0
- package/lib/chat/components/status-bar.js +39 -0
- package/lib/chat/components/status-bar.jsx +51 -0
- package/lib/chat/components/swarm-page.js +157 -0
- package/lib/chat/components/swarm-page.jsx +210 -0
- package/lib/chat/components/targets-page.js +376 -0
- package/lib/chat/components/targets-page.jsx +389 -0
- package/lib/chat/components/tool-call.js +86 -0
- package/lib/chat/components/tool-call.jsx +104 -0
- package/lib/chat/components/tool-panel.js +107 -0
- package/lib/chat/components/tool-panel.jsx +145 -0
- package/lib/chat/components/triggers-page.js +153 -0
- package/lib/chat/components/triggers-page.jsx +221 -0
- package/lib/chat/components/ui/confirm-dialog.js +53 -0
- package/lib/chat/components/ui/confirm-dialog.jsx +57 -0
- package/lib/chat/components/ui/dropdown-menu.js +98 -0
- package/lib/chat/components/ui/dropdown-menu.jsx +116 -0
- package/lib/chat/components/ui/rename-dialog.js +74 -0
- package/lib/chat/components/ui/rename-dialog.jsx +72 -0
- package/lib/chat/components/ui/scroll-area.js +13 -0
- package/lib/chat/components/ui/scroll-area.jsx +17 -0
- package/lib/chat/components/ui/separator.js +21 -0
- package/lib/chat/components/ui/separator.jsx +18 -0
- package/lib/chat/components/ui/sheet.js +75 -0
- package/lib/chat/components/ui/sheet.jsx +95 -0
- package/lib/chat/components/ui/sidebar.js +227 -0
- package/lib/chat/components/ui/sidebar.jsx +245 -0
- package/lib/chat/components/ui/tooltip.js +56 -0
- package/lib/chat/components/ui/tooltip.jsx +66 -0
- package/lib/chat/components/upgrade-dialog.js +151 -0
- package/lib/chat/components/upgrade-dialog.jsx +170 -0
- package/lib/chat/utils.js +11 -0
- package/lib/cron.js +246 -0
- package/lib/db/api-keys.js +163 -0
- package/lib/db/chats.js +145 -0
- package/lib/db/index.js +52 -0
- package/lib/db/notifications.js +99 -0
- package/lib/db/schema.js +145 -0
- package/lib/db/update-check.js +96 -0
- package/lib/db/users.js +89 -0
- package/lib/mcp/actions.js +104 -0
- package/lib/mcp/client.js +79 -0
- package/lib/mcp/handler.js +57 -0
- package/lib/mcp/server.js +165 -0
- package/lib/paths.js +46 -0
- package/lib/registry/actions.js +164 -0
- package/lib/registry/catalog.js +137 -0
- package/lib/registry/tools.js +71 -0
- package/lib/tools/create-job.js +99 -0
- package/lib/tools/github.js +217 -0
- package/lib/tools/openai.js +35 -0
- package/lib/tools/telegram.js +292 -0
- package/lib/triggers.js +118 -0
- package/lib/utils/render-md.js +102 -0
- package/package.json +103 -0
- package/setup/lib/auth.mjs +81 -0
- package/setup/lib/env.mjs +21 -0
- package/setup/lib/fs-utils.mjs +20 -0
- package/setup/lib/github.mjs +149 -0
- package/setup/lib/prerequisites.mjs +155 -0
- package/setup/lib/prompts.mjs +267 -0
- package/setup/lib/providers.mjs +48 -0
- package/setup/lib/sync.mjs +125 -0
- package/setup/lib/targets.mjs +45 -0
- package/setup/lib/telegram-verify.mjs +63 -0
- package/setup/lib/telegram.mjs +76 -0
- package/setup/setup-telegram.mjs +264 -0
- package/setup/setup.mjs +842 -0
- package/templates/.dockerignore +5 -0
- package/templates/.env.example +63 -0
- package/templates/.github/workflows/auto-merge.yml +117 -0
- package/templates/.github/workflows/build-image.yml +36 -0
- package/templates/.github/workflows/notify-job-failed.yml +64 -0
- package/templates/.github/workflows/notify-pr-complete.yml +119 -0
- package/templates/.github/workflows/rebuild-event-handler.yml +121 -0
- package/templates/.github/workflows/run-job.yml +89 -0
- package/templates/.github/workflows/upgrade-event-handler.yml +62 -0
- package/templates/.gitignore.template +45 -0
- package/templates/.pi/extensions/env-sanitizer/index.ts +48 -0
- package/templates/.pi/extensions/env-sanitizer/package.json +5 -0
- package/templates/CLAUDE.md +29 -0
- package/templates/CLAUDE.md.template +307 -0
- package/templates/app/api/[...thepopebot]/route.js +1 -0
- package/templates/app/api/auth/[...nextauth]/route.js +1 -0
- package/templates/app/chat/[chatId]/page.js +8 -0
- package/templates/app/chats/page.js +7 -0
- package/templates/app/components/ascii-logo.jsx +10 -0
- package/templates/app/components/login-form.jsx +92 -0
- package/templates/app/components/setup-form.jsx +82 -0
- package/templates/app/components/theme-provider.jsx +11 -0
- package/templates/app/components/theme-toggle.jsx +38 -0
- package/templates/app/components/ui/button.jsx +21 -0
- package/templates/app/components/ui/card.jsx +23 -0
- package/templates/app/components/ui/input.jsx +10 -0
- package/templates/app/components/ui/label.jsx +10 -0
- package/templates/app/crons/page.js +5 -0
- package/templates/app/findings/page.js +7 -0
- package/templates/app/globals.css +90 -0
- package/templates/app/layout.js +19 -0
- package/templates/app/login/page.js +15 -0
- package/templates/app/notifications/page.js +7 -0
- package/templates/app/page.js +7 -0
- package/templates/app/settings/crons/page.js +5 -0
- package/templates/app/settings/layout.js +7 -0
- package/templates/app/settings/mcp/page.js +5 -0
- package/templates/app/settings/page.js +5 -0
- package/templates/app/settings/secrets/page.js +5 -0
- package/templates/app/settings/triggers/page.js +5 -0
- package/templates/app/stream/chat/route.js +1 -0
- package/templates/app/swarm/page.js +7 -0
- package/templates/app/targets/page.js +7 -0
- package/templates/app/toolbox/page.js +7 -0
- package/templates/app/triggers/page.js +5 -0
- package/templates/config/AGENT.md +34 -0
- package/templates/config/CRONS.json +56 -0
- package/templates/config/EVENT_HANDLER.md +224 -0
- package/templates/config/HEARTBEAT.md +3 -0
- package/templates/config/JOB_SUMMARY.md +130 -0
- package/templates/config/MCP_SERVERS.json +1 -0
- package/templates/config/SKILL_BUILDING_GUIDE.md +90 -0
- package/templates/config/SOUL.md +17 -0
- package/templates/config/TRIGGERS.json +58 -0
- package/templates/docker/event-handler/Dockerfile +20 -0
- package/templates/docker/event-handler/ecosystem.config.cjs +8 -0
- package/templates/docker/job-claude-code/Dockerfile +34 -0
- package/templates/docker/job-claude-code/entrypoint.sh +139 -0
- package/templates/docker/job-pi-coding-agent/Dockerfile +44 -0
- package/templates/docker/job-pi-coding-agent/entrypoint.sh +163 -0
- package/templates/docker-compose.yml +63 -0
- package/templates/instrumentation.js +6 -0
- package/templates/middleware.js +1 -0
- package/templates/next.config.mjs +3 -0
- package/templates/postcss.config.mjs +5 -0
- package/templates/skills/LICENSE +21 -0
- package/templates/skills/README.md +119 -0
- package/templates/skills/brave-search/SKILL.md +79 -0
- package/templates/skills/brave-search/content.js +86 -0
- package/templates/skills/brave-search/package-lock.json +621 -0
- package/templates/skills/brave-search/package.json +14 -0
- package/templates/skills/brave-search/search.js +199 -0
- package/templates/skills/browser-tools/SKILL.md +196 -0
- package/templates/skills/browser-tools/browser-content.js +103 -0
- package/templates/skills/browser-tools/browser-cookies.js +35 -0
- package/templates/skills/browser-tools/browser-eval.js +53 -0
- package/templates/skills/browser-tools/browser-hn-scraper.js +108 -0
- package/templates/skills/browser-tools/browser-nav.js +44 -0
- package/templates/skills/browser-tools/browser-pick.js +162 -0
- package/templates/skills/browser-tools/browser-screenshot.js +34 -0
- package/templates/skills/browser-tools/browser-start.js +87 -0
- package/templates/skills/browser-tools/package-lock.json +2556 -0
- package/templates/skills/browser-tools/package.json +19 -0
- package/templates/skills/llm-secrets/SKILL.md +34 -0
- package/templates/skills/llm-secrets/llm-secrets.js +33 -0
- package/templates/skills/modify-self/SKILL.md +12 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Stephen G. Pope
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
# Why thepopebot?
|
|
2
|
+
|
|
3
|
+
**The repository IS the agent** — Every action your agent takes is a git commit. You can see exactly what it did, when, and why. If it screws up, revert it. Want to clone your agent? Fork the repo — code, personality, scheduled jobs, full history, all of it goes with your fork.
|
|
4
|
+
|
|
5
|
+
**Free compute, built in** — Every GitHub account comes with free cloud computing time. thepopebot uses that to run your agent. One task or a hundred in parallel — the compute is already included.
|
|
6
|
+
|
|
7
|
+
**Self-evolving** — The agent modifies its own code through pull requests. Every change is auditable, every change is reversible. You stay in control.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## How It Works
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
┌──────────────────────────────────────────────────────────────────────┐
|
|
15
|
+
│ │
|
|
16
|
+
│ ┌─────────────────┐ ┌─────────────────┐ │
|
|
17
|
+
│ │ Event Handler │ ──1──► │ GitHub │ │
|
|
18
|
+
│ │ (creates job) │ │ (job/* branch) │ │
|
|
19
|
+
│ └────────▲────────┘ └────────┬────────┘ │
|
|
20
|
+
│ │ │ │
|
|
21
|
+
│ │ 2 (triggers run-job.yml) │
|
|
22
|
+
│ │ │ │
|
|
23
|
+
│ │ ▼ │
|
|
24
|
+
│ │ ┌─────────────────┐ │
|
|
25
|
+
│ │ │ Docker Agent │ │
|
|
26
|
+
│ │ │ (runs Pi, PRs) │ │
|
|
27
|
+
│ │ └────────┬────────┘ │
|
|
28
|
+
│ │ │ │
|
|
29
|
+
│ │ 3 (creates PR) │
|
|
30
|
+
│ │ │ │
|
|
31
|
+
│ │ ▼ │
|
|
32
|
+
│ │ ┌─────────────────┐ │
|
|
33
|
+
│ │ │ GitHub │ │
|
|
34
|
+
│ │ │ (PR opened) │ │
|
|
35
|
+
│ │ └────────┬────────┘ │
|
|
36
|
+
│ │ │ │
|
|
37
|
+
│ │ 4a (auto-merge.yml) │
|
|
38
|
+
│ │ 4b (rebuild-event-handler.yml) │
|
|
39
|
+
│ │ │ │
|
|
40
|
+
│ 5 (notify-pr-complete.yml / │ │
|
|
41
|
+
│ │ notify-job-failed.yml) │ │
|
|
42
|
+
│ └───────────────────────────┘ │
|
|
43
|
+
│ │
|
|
44
|
+
└──────────────────────────────────────────────────────────────────────┘
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
You interact with your bot via the web chat interface or Telegram (optional). The Event Handler creates a job branch. GitHub Actions spins up a Docker container with the Pi coding agent. The agent does the work, commits the results, and opens a PR. Auto-merge handles the rest. You get a notification when it's done.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Star History
|
|
52
|
+
|
|
53
|
+
[](https://www.star-history.com/#stephengpope/thepopebot&type=date&legend=top-left)
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Get Started
|
|
58
|
+
|
|
59
|
+
### Prerequisites
|
|
60
|
+
|
|
61
|
+
| Requirement | Install |
|
|
62
|
+
|-------------|---------|
|
|
63
|
+
| **Node.js 18+** | [nodejs.org](https://nodejs.org) |
|
|
64
|
+
| **npm** | Included with Node.js |
|
|
65
|
+
| **Git** | [git-scm.com](https://git-scm.com) |
|
|
66
|
+
| **GitHub CLI** | [cli.github.com](https://cli.github.com) |
|
|
67
|
+
| **Docker + Docker Compose** | [docker.com](https://docs.docker.com/get-docker/) (installer requires admin password) |
|
|
68
|
+
| **ngrok*** | [ngrok.com](https://ngrok.com/download) (free account + authtoken required) |
|
|
69
|
+
|
|
70
|
+
*\*ngrok is only required for local installs without port forwarding. VPS/cloud deployments don't need it. [Sign up](https://dashboard.ngrok.com/signup) for a free ngrok account, then run `ngrok config add-authtoken <YOUR_TOKEN>` before starting setup.*
|
|
71
|
+
|
|
72
|
+
### Two steps
|
|
73
|
+
|
|
74
|
+
**Step 1** — Scaffold a new project:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
mkdir my-agent && cd my-agent
|
|
78
|
+
npx thepopebot@latest init
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
This creates a Next.js project with configuration files, GitHub Actions workflows, and agent templates. You don't need to create a GitHub repo first — the setup wizard handles that.
|
|
82
|
+
|
|
83
|
+
**Step 2** — Run the setup wizard:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npm run setup
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The wizard walks you through everything:
|
|
90
|
+
- Checks prerequisites (Node.js, Git, GitHub CLI)
|
|
91
|
+
- Creates a GitHub repository and pushes your initial commit
|
|
92
|
+
- Creates a GitHub Personal Access Token (scoped to your repo)
|
|
93
|
+
- Collects API keys (Anthropic required; OpenAI, Brave optional)
|
|
94
|
+
- Sets GitHub repository secrets and variables
|
|
95
|
+
- Generates `.env`
|
|
96
|
+
- Builds the project and starts Docker for you
|
|
97
|
+
|
|
98
|
+
**That's it.** Visit your APP_URL when the wizard finishes.
|
|
99
|
+
|
|
100
|
+
- **Web Chat**: Visit your APP_URL to chat with your agent, create jobs, upload files
|
|
101
|
+
- **Telegram** (optional): Run `npm run setup-telegram` to connect a Telegram bot
|
|
102
|
+
- **Webhook**: Send a POST to `/api/create-job` with your API key to create jobs programmatically
|
|
103
|
+
- **Cron**: Edit `config/CRONS.json` to schedule recurring jobs
|
|
104
|
+
|
|
105
|
+
### Chat vs Agent LLM
|
|
106
|
+
|
|
107
|
+
Your bot has two sides — a **chat** side and an **agent** side.
|
|
108
|
+
|
|
109
|
+
**Chat** is the conversational part. When you talk to your bot in the web UI or Telegram, it uses the chat LLM. This runs on your server and responds in real time.
|
|
110
|
+
|
|
111
|
+
**Agent** is the worker. When your bot needs to write code, modify files, or do a bigger task, it spins up a separate job that runs in a Docker container on GitHub. That job uses the agent LLM.
|
|
112
|
+
|
|
113
|
+
By default, both use the same model. But during setup, you can choose different models for each — for example, a faster model for chat and a more capable one for agent jobs. The wizard asks "Would you like agent jobs to use different LLM settings?" and lets you pick.
|
|
114
|
+
|
|
115
|
+
### Using a Claude Subscription (OAuth Token)
|
|
116
|
+
|
|
117
|
+
If you have a Claude Pro ($20/mo) or Max ($100+/mo) subscription, you can use it to power your agent jobs instead of paying per API call. During setup, choose Anthropic as your agent provider and say yes when asked about a subscription.
|
|
118
|
+
|
|
119
|
+
You'll need to generate a token:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Install Claude Code CLI (if you don't have it)
|
|
123
|
+
npm install -g @anthropic-ai/claude-code
|
|
124
|
+
|
|
125
|
+
# Generate your token (opens browser to log in)
|
|
126
|
+
claude setup-token
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Paste the token (starts with `sk-ant-oat01-`) into the setup wizard. Your agent jobs will now run through your subscription. Note that usage counts toward your Claude.ai limits, and you still need an API key for the chat side.
|
|
130
|
+
|
|
131
|
+
See [Claude Code vs Pi](docs/CLAUDE_CODE_VS_PI.md) for more details on the two agent backends.
|
|
132
|
+
|
|
133
|
+
> **Local installs**: Your server needs to be reachable from the internet for GitHub webhooks and Telegram. On a VPS/cloud server, your APP_URL is just your domain. For local development, use [ngrok](https://ngrok.com) (`ngrok http 80`) or port forwarding to expose your machine.
|
|
134
|
+
>
|
|
135
|
+
> **If your ngrok URL changes** (it changes every time you restart ngrok on the free plan), you must update APP_URL everywhere:
|
|
136
|
+
>
|
|
137
|
+
> ```bash
|
|
138
|
+
> # Update .env and GitHub variable in one command:
|
|
139
|
+
> npx thepopebot set-var APP_URL https://your-new-url.ngrok.io
|
|
140
|
+
> # If Telegram is configured, re-register the webhook:
|
|
141
|
+
> npm run setup-telegram
|
|
142
|
+
> ```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Manual Updating
|
|
147
|
+
|
|
148
|
+
**1. Update the package**
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
npm install thepopebot@latest
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**2. Scaffold and update templates**
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
npx thepopebot init
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
For most people, that's it — `init` handles everything. It updates your project files, runs `npm install`, and updates `THEPOPEBOT_VERSION` in your local `.env`. See [Understanding `init`](#understanding-init) below for details on what this updates and how to handle custom changes.
|
|
161
|
+
|
|
162
|
+
**3. Rebuild for local dev**
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
npm run build
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**4. Commit and push**
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
git add -A && git commit -m "upgrade thepopebot to vX.X.X"
|
|
172
|
+
git push
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Pushing to `main` triggers the `rebuild-event-handler.yml` workflow on your server. It detects the version change, runs `thepopebot init`, updates `THEPOPEBOT_VERSION` in the server's `.env`, pulls the new Docker image, restarts the container, rebuilds `.next`, and reloads PM2 — no manual `docker compose` needed.
|
|
176
|
+
|
|
177
|
+
> **Upgrade failed?** See [Recovering from a Failed Upgrade](docs/UPGRADE.md#recovering-from-a-failed-upgrade).
|
|
178
|
+
|
|
179
|
+
### Understanding `init`
|
|
180
|
+
|
|
181
|
+
#### How your project is structured
|
|
182
|
+
|
|
183
|
+
When you ran `thepopebot init` the first time, it scaffolded a project folder with two kinds of files:
|
|
184
|
+
|
|
185
|
+
**Your files** — These are yours to customize. `init` will never overwrite them:
|
|
186
|
+
|
|
187
|
+
| Files | What they do |
|
|
188
|
+
|-------|-------------|
|
|
189
|
+
| `config/SOUL.md`, `EVENT_HANDLER.md`, `AGENT.md`, etc. | Your agent's personality, behavior, and prompts |
|
|
190
|
+
| `config/CRONS.json`, `TRIGGERS.json` | Your scheduled jobs and webhook triggers |
|
|
191
|
+
| `app/` | Next.js pages and UI components |
|
|
192
|
+
| `docker/job-pi-coding-agent/` | The Dockerfile for the Pi coding agent job container |
|
|
193
|
+
|
|
194
|
+
**Managed files** — These are infrastructure files that need to stay in sync with the package version. `init` auto-updates them for you:
|
|
195
|
+
|
|
196
|
+
| Files | What they do |
|
|
197
|
+
|-------|-------------|
|
|
198
|
+
| `.github/workflows/` | GitHub Actions that run jobs, auto-merge PRs, rebuild on deploy |
|
|
199
|
+
| `docker-compose.yml` | Defines how your containers run together (Traefik, event handler, runner) |
|
|
200
|
+
| `docker/event-handler/` | The Dockerfile for the event handler container |
|
|
201
|
+
| `.dockerignore` | Keeps unnecessary files out of Docker builds |
|
|
202
|
+
| `CLAUDE.md` | AI assistant context for your project |
|
|
203
|
+
|
|
204
|
+
#### What happens when you run `init`
|
|
205
|
+
|
|
206
|
+
1. **Managed files** are updated automatically to match the new package version
|
|
207
|
+
2. **Your files** are left alone — but if the package ships new defaults (e.g., a new field in `CRONS.json`), `init` lets you know:
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
Updated templates available:
|
|
211
|
+
These files differ from the current package templates.
|
|
212
|
+
|
|
213
|
+
config/CRONS.json
|
|
214
|
+
|
|
215
|
+
To view differences: npx thepopebot diff <file>
|
|
216
|
+
To reset to default: npx thepopebot reset <file>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
You can review at your own pace:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
npx thepopebot diff config/CRONS.json # see what changed
|
|
223
|
+
npx thepopebot reset config/CRONS.json # accept the new template
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
#### If you've modified managed files
|
|
227
|
+
|
|
228
|
+
If you've made custom changes to managed files (e.g., added extra steps to a GitHub Actions workflow), use `--no-managed` so `init` doesn't overwrite your changes:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
npx thepopebot init --no-managed
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
#### Template file conventions
|
|
235
|
+
|
|
236
|
+
The `templates/` directory contains files scaffolded into user projects by `thepopebot init`. Two naming conventions handle files that npm or AI tools would otherwise misinterpret:
|
|
237
|
+
|
|
238
|
+
**`.template` suffix** — Files ending in `.template` are scaffolded with the suffix stripped. This is used for files that npm mangles (`.gitignore`) or that AI tools would pick up as real project docs (`CLAUDE.md`).
|
|
239
|
+
|
|
240
|
+
| In `templates/` | Scaffolded as |
|
|
241
|
+
|-----------------|---------------|
|
|
242
|
+
| `.gitignore.template` | `.gitignore` |
|
|
243
|
+
| `CLAUDE.md.template` | `CLAUDE.md` |
|
|
244
|
+
| `api/CLAUDE.md.template` | `api/CLAUDE.md` |
|
|
245
|
+
|
|
246
|
+
**`CLAUDE.md` exclusion** — The scaffolding walker skips any file named `CLAUDE.md` (without the `.template` suffix). This is a safety net so a bare `CLAUDE.md` accidentally added to `templates/` never gets copied into user projects where AI tools would confuse it with real project instructions.
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## CLI Commands
|
|
251
|
+
|
|
252
|
+
All commands are run via `npx thepopebot <command>` (or the `npm run` shortcuts where noted).
|
|
253
|
+
|
|
254
|
+
**Project setup:**
|
|
255
|
+
|
|
256
|
+
| Command | Description |
|
|
257
|
+
|---------|-------------|
|
|
258
|
+
| `init` | Scaffold a new project, or update templates in an existing one |
|
|
259
|
+
| `setup` | Run the full interactive setup wizard (`npm run setup`) |
|
|
260
|
+
| `setup-telegram` | Reconfigure the Telegram webhook (`npm run setup-telegram`) |
|
|
261
|
+
| `reset-auth` | Regenerate AUTH_SECRET, invalidating all sessions |
|
|
262
|
+
|
|
263
|
+
**Templates:**
|
|
264
|
+
|
|
265
|
+
| Command | Description |
|
|
266
|
+
|---------|-------------|
|
|
267
|
+
| `diff [file]` | List files that differ from package templates, or diff a specific file |
|
|
268
|
+
| `reset [file]` | List all template files, or restore a specific one to package default |
|
|
269
|
+
|
|
270
|
+
**Secrets & variables:**
|
|
271
|
+
|
|
272
|
+
These commands set individual GitHub repository secrets/variables using the `gh` CLI. They read `GH_OWNER` and `GH_REPO` from your `.env`. If VALUE is omitted, you'll be prompted with masked input (keeps secrets out of shell history).
|
|
273
|
+
|
|
274
|
+
| Command | Description |
|
|
275
|
+
|---------|-------------|
|
|
276
|
+
| `set-agent-secret KEY [VALUE]` | Set `AGENT_<KEY>` GitHub secret and update `.env` |
|
|
277
|
+
| `set-agent-llm-secret KEY [VALUE]` | Set `AGENT_LLM_<KEY>` GitHub secret |
|
|
278
|
+
| `set-var KEY [VALUE]` | Set a GitHub repository variable |
|
|
279
|
+
|
|
280
|
+
GitHub secrets use a prefix convention so the workflow can route them correctly:
|
|
281
|
+
|
|
282
|
+
- **`AGENT_`** — Protected secrets passed to the Docker container (filtered from LLM). Example: `AGENT_GH_TOKEN`, `AGENT_ANTHROPIC_API_KEY`
|
|
283
|
+
- **`AGENT_LLM_`** — LLM-accessible secrets (not filtered). Example: `AGENT_LLM_BRAVE_API_KEY`
|
|
284
|
+
- **No prefix** — Workflow-only secrets, never passed to container. Example: `GH_WEBHOOK_SECRET`
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Security
|
|
289
|
+
|
|
290
|
+
thepopebot includes API key authentication, webhook secret validation (fail-closed), session encryption, secret filtering in the Docker agent, and auto-merge path restrictions. However, all software carries risk — thepopebot is provided as-is, and you are responsible for securing your own infrastructure. If you're running locally with a tunnel (ngrok, Cloudflare Tunnel, port forwarding), be aware that your dev server endpoints are publicly accessible with no rate limiting and no TLS on the local hop.
|
|
291
|
+
|
|
292
|
+
See [Security](docs/SECURITY.md) for full details on what's exposed, the risks, and recommendations.
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Harbinger Agent System
|
|
297
|
+
|
|
298
|
+
thepopebot includes 11 specialized agent profiles (the Harbinger swarm), each with a distinct personality, skills, and area of expertise. Route messages to specific agents using `@mentions`:
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
@PATHFINDER enumerate subdomains for example.com
|
|
302
|
+
@BREACH scan the login page for XSS
|
|
303
|
+
@SAM refactor the database module
|
|
304
|
+
@SPECTER run OSINT on target.com
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
Available agents: **SPECTER** (OSINT), **SAM** (Coding), **SAGE** (Learning), **PATHFINDER** (Recon), **BREACH** (Web Hacking), **PHANTOM** (Cloud), **CIPHER** (Binary), **SCRIBE** (Reports), **LENS** (Browser), **MAINTAINER** (Code Quality), **BRIEF** (Daily Briefs).
|
|
308
|
+
|
|
309
|
+
Create custom agents by copying `agents/_template/` and editing the profile files. Agents are auto-discovered at startup.
|
|
310
|
+
|
|
311
|
+
See [agents/README.md](agents/README.md) for the full guide.
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
## Bug Bounty Automation
|
|
316
|
+
|
|
317
|
+
thepopebot includes a full bug bounty hunting automation suite — manage programs, targets, findings, and security tools from the web UI.
|
|
318
|
+
|
|
319
|
+
### Features
|
|
320
|
+
|
|
321
|
+
- **Targets Dashboard** (`/targets`) — Manage bug bounty programs and their in-scope targets. Sync targets directly from HackerOne, Bugcrowd, Intigriti, YesWeHack, and Federacy using live data from [bounty-targets-data](https://github.com/arkadiyt/bounty-targets-data).
|
|
322
|
+
- **Findings Feed** (`/findings`) — Track discovered vulnerabilities with severity ratings, status workflow (new → triaging → confirmed → reported → bounty_paid), and bounty amounts.
|
|
323
|
+
- **Toolbox** (`/toolbox`) — Browse and install from a catalog of 68+ real security tools (subfinder, nuclei, httpx, ffuf, sqlmap, etc.). Install tools from any GitHub repo. Manage Docker containers for agent terminal access.
|
|
324
|
+
|
|
325
|
+
### Quick Start
|
|
326
|
+
|
|
327
|
+
After setup, visit your app URL and navigate to **Targets** in the sidebar to start:
|
|
328
|
+
|
|
329
|
+
1. Click **Sync from Bounty Platforms** to import programs from HackerOne/Bugcrowd/etc.
|
|
330
|
+
2. Or add programs manually with the **Add** button
|
|
331
|
+
3. Add targets to your programs (domains, IPs, wildcards, APIs)
|
|
332
|
+
4. Visit **Toolbox** to install scanning tools from the catalog
|
|
333
|
+
5. Findings appear automatically as agents discover vulnerabilities, or add them manually
|
|
334
|
+
|
|
335
|
+
See [Bug Bounty](docs/BUG_BOUNTY.md) for the full guide.
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## MCP (Model Context Protocol)
|
|
340
|
+
|
|
341
|
+
thepopebot exposes an MCP server at `/api/mcp` and can consume tools from external MCP servers — connecting your agents to Claude Desktop, Cursor, and any MCP-compatible client.
|
|
342
|
+
|
|
343
|
+
### Server (expose your agent's tools)
|
|
344
|
+
|
|
345
|
+
External AI clients connect to `https://your-app-url/api/mcp` with your API key. Exposed capabilities:
|
|
346
|
+
|
|
347
|
+
| Type | Items |
|
|
348
|
+
|------|-------|
|
|
349
|
+
| **Tools** | `create_job`, `get_job_status`, `chat`, `list_agents`, `get_agent_profile` |
|
|
350
|
+
| **Resources** | `agent://agents`, `agent://{id}/soul`, `config://soul`, `config://crons`, `config://triggers` |
|
|
351
|
+
| **Prompts** | `agent-prompt` (parameterized by agent ID) |
|
|
352
|
+
|
|
353
|
+
### Client (consume external MCP tools)
|
|
354
|
+
|
|
355
|
+
Add external MCP servers to `config/MCP_SERVERS.json`:
|
|
356
|
+
|
|
357
|
+
```json
|
|
358
|
+
[
|
|
359
|
+
{
|
|
360
|
+
"name": "my-tool-server",
|
|
361
|
+
"transport": "http",
|
|
362
|
+
"url": "http://localhost:3001/mcp",
|
|
363
|
+
"headers": {},
|
|
364
|
+
"enabled": true
|
|
365
|
+
}
|
|
366
|
+
]
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
External tools are automatically available to your agents. Manage and test them from **Settings → MCP** in the web UI.
|
|
370
|
+
|
|
371
|
+
See [MCP Integration](docs/MCP.md) for the full guide.
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
## Running Different Models
|
|
376
|
+
|
|
377
|
+
The Event Handler (chat, Telegram, webhooks) and Jobs (Docker agent) are two independent layers — each can run a different LLM. Use Claude for interactive chat and a cheaper or local model for long-running jobs, mix providers per cron entry, or run everything on a single model.
|
|
378
|
+
|
|
379
|
+
See [Running Different Models](docs/RUNNING_DIFFERENT_MODELS.md) for the full guide: Event Handler config, job defaults, per-job overrides, provider table, and custom provider setup.
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
## Docs
|
|
384
|
+
|
|
385
|
+
| Document | Description |
|
|
386
|
+
|----------|-------------|
|
|
387
|
+
| [Architecture](docs/ARCHITECTURE.md) | Two-layer design, file structure, API endpoints, GitHub Actions, Docker agent |
|
|
388
|
+
| [Configuration](docs/CONFIGURATION.md) | Environment variables, GitHub secrets, repo variables, ngrok, Telegram setup |
|
|
389
|
+
| [Customization](docs/CUSTOMIZATION.md) | Personality, skills, operating system files, using your bot, security details |
|
|
390
|
+
| [Chat Integrations](docs/CHAT_INTEGRATIONS.md) | Web chat, Telegram, adding new channels |
|
|
391
|
+
| [Running Different Models](docs/RUNNING_DIFFERENT_MODELS.md) | Event Handler vs job model config, per-job overrides, providers, custom provider |
|
|
392
|
+
| [Auto-Merge](docs/AUTO_MERGE.md) | Auto-merge controls, ALLOWED_PATHS configuration |
|
|
393
|
+
| [Deployment](docs/DEPLOYMENT.md) | VPS setup, Docker Compose, HTTPS with Let's Encrypt |
|
|
394
|
+
| [Claude Code vs Pi](docs/CLAUDE_CODE_VS_PI.md) | Comparing the two agent backends (subscription vs API credits) |
|
|
395
|
+
| [How to Build Skills](docs/HOW_TO_BUILD_SKILLS.md) | Guide to building and activating agent skills |
|
|
396
|
+
| [Pre-Release](docs/PRE_RELEASE.md) | Installing beta/alpha builds |
|
|
397
|
+
| [Security](docs/SECURITY.md) | Security disclaimer, local development risks |
|
|
398
|
+
| [Upgrading](docs/UPGRADE.md) | Automated upgrades, recovering from failed upgrades |
|
|
399
|
+
| [Bug Bounty](docs/BUG_BOUNTY.md) | Targets, findings, tool registry, platform sync |
|
|
400
|
+
| [MCP Integration](docs/MCP.md) | MCP server/client setup, external tool consumption |
|
|
401
|
+
|
|
402
|
+
### Maintainer
|
|
403
|
+
|
|
404
|
+
| Document | Description |
|
|
405
|
+
|----------|-------------|
|
|
406
|
+
| [NPM](docs/NPM.md) | Updating skills, versioning, and publishing releases |
|
package/agents/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Harbinger Agent System
|
|
2
|
+
|
|
3
|
+
The Harbinger framework provides a system of customizable agent profiles, each with a distinct identity, personality, and skill set. Agents can be routed to via `@mentions` in chat or selected explicitly via the MCP `chat` tool.
|
|
4
|
+
|
|
5
|
+
## How Agent Selection Works
|
|
6
|
+
|
|
7
|
+
In chat (web UI, Telegram, or MCP), prefix your message with `@CODENAME` to route to a specific agent:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
@PATHFINDER enumerate subdomains for example.com
|
|
11
|
+
@BREACH test the login form for SQL injection
|
|
12
|
+
@SAM refactor the authentication module
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The system matches against agent codenames, directory names, and display names (case-insensitive). If no match is found, the default event handler agent is used.
|
|
16
|
+
|
|
17
|
+
Via MCP, pass the `agent_id` parameter to the `chat` tool:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{ "thread_id": "abc", "message": "scan for open ports", "agent_id": "recon-scout" }
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Agent Profiles
|
|
24
|
+
|
|
25
|
+
Each agent profile directory contains:
|
|
26
|
+
|
|
27
|
+
| File | Purpose |
|
|
28
|
+
|------|---------|
|
|
29
|
+
| **SOUL.md** | Core personality, communication style, and system prompt |
|
|
30
|
+
| **IDENTITY.md** | Name, codename, role, and specialization |
|
|
31
|
+
| **CONFIG.yaml** | Model, temperature, Docker image, handoff rules |
|
|
32
|
+
| **SKILLS.md** | Techniques, methodologies, and knowledge domains |
|
|
33
|
+
| **TOOLS.md** | Command-line tools and APIs the agent is proficient with |
|
|
34
|
+
| **HEARTBEAT.md** | Health check template |
|
|
35
|
+
|
|
36
|
+
### Available Agents
|
|
37
|
+
|
|
38
|
+
| Codename | Name | Role |
|
|
39
|
+
|----------|------|------|
|
|
40
|
+
| SPECTER | OSINT Detective | Open-source intelligence gathering |
|
|
41
|
+
| SAM | Coding Assistant | Code generation, review, debugging |
|
|
42
|
+
| SAGE | Learning Agent | Workflow optimization |
|
|
43
|
+
| PATHFINDER | Recon Scout | Attack surface discovery |
|
|
44
|
+
| BREACH | Web Hacker | Web vulnerability discovery |
|
|
45
|
+
| PHANTOM | Cloud Infiltrator | Cloud security assessment |
|
|
46
|
+
| CIPHER | Binary Reverser | Binary analysis, reverse engineering |
|
|
47
|
+
| SCRIBE | Report Writer | Vulnerability report generation |
|
|
48
|
+
| LENS | Browser Agent | Browser automation via CDP |
|
|
49
|
+
| MAINTAINER | Code Quality | Nightly code quality enforcement |
|
|
50
|
+
| BRIEF | Morning Brief | Automated daily reporting |
|
|
51
|
+
|
|
52
|
+
## Implementation Status
|
|
53
|
+
|
|
54
|
+
Agent profiles provide **personality and knowledge context** when selected. The SOUL.md becomes the system prompt, and SKILLS.md + TOOLS.md are appended as context.
|
|
55
|
+
|
|
56
|
+
The runtime agent engine (`lib/ai/agent.js`) provides:
|
|
57
|
+
- LangGraph agent with tool use and SQLite checkpointing
|
|
58
|
+
- 4 built-in tools: `create_job`, `get_job_status`, `get_system_technical_specs`, `get_skill_building_guide`
|
|
59
|
+
- External MCP tools (from `config/MCP_SERVERS.json`)
|
|
60
|
+
|
|
61
|
+
Agent-specific Docker containers and direct tool execution (e.g., running `nuclei` or `subfinder`) are planned for future releases. Currently, agents can instruct jobs to use these tools via the Docker agent container.
|
|
62
|
+
|
|
63
|
+
## Creating a Custom Agent
|
|
64
|
+
|
|
65
|
+
1. Copy `agents/_template/` to `agents/my-agent/`
|
|
66
|
+
2. Edit all `.md` and `.yaml` files to define your agent's identity
|
|
67
|
+
3. The agent is auto-discovered at startup and available via `@MY_AGENT_CODENAME`
|
|
68
|
+
|
|
69
|
+
## Runtime Infrastructure
|
|
70
|
+
|
|
71
|
+
| Component | Location | Description |
|
|
72
|
+
|-----------|----------|-------------|
|
|
73
|
+
| Agent Discovery | `lib/agents.js` | Scans `agents/` for profiles |
|
|
74
|
+
| Agent Runtime | `lib/ai/agent.js` | LangGraph agent with profile-specific system prompts |
|
|
75
|
+
| Model Router | `lib/ai/model-router.js` | Complexity-based model selection |
|
|
76
|
+
| Autonomous Engine | `lib/ai/autonomous-engine.js` | Background thinking loop (opt-in) |
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# {{CODENAME}} — Heartbeat Protocol
|
|
2
|
+
|
|
3
|
+
> This file defines how the agent checks in, what it monitors, and how it reports health.
|
|
4
|
+
|
|
5
|
+
## Heartbeat Schedule
|
|
6
|
+
|
|
7
|
+
- **Interval:** Every 60 seconds while active
|
|
8
|
+
- **Endpoint:** `POST /api/agents/{{agent_id}}/heartbeat`
|
|
9
|
+
- **Model:** Use cheapest available (Haiku or Gemini Flash)
|
|
10
|
+
- **Cost target:** < $0.005 per heartbeat
|
|
11
|
+
|
|
12
|
+
## Health Check Tasks
|
|
13
|
+
|
|
14
|
+
### 1. Self-Check
|
|
15
|
+
- [ ] Am I still running? (process health)
|
|
16
|
+
- [ ] Is my workspace accessible? (`/workspace` mounted and writable)
|
|
17
|
+
- [ ] Are my tools functional? (spot-check one primary tool)
|
|
18
|
+
- [ ] Is my memory within limits? (check against `memory_mb` in CONFIG.yaml)
|
|
19
|
+
- [ ] Is my network accessible? (can I reach the Harbinger API?)
|
|
20
|
+
|
|
21
|
+
### 2. Task Status
|
|
22
|
+
- [ ] Do I have an active task? If yes, report progress (0-100%)
|
|
23
|
+
- [ ] Is my current task stalled? (no progress in last 5 minutes)
|
|
24
|
+
- [ ] Are there queued tasks waiting for me?
|
|
25
|
+
- [ ] Have I produced output that hasn't been handed off yet?
|
|
26
|
+
|
|
27
|
+
### 3. Swarm Health
|
|
28
|
+
- [ ] Can I reach the message bus? (`/api/agents/broadcast`)
|
|
29
|
+
- [ ] Are my upstream agents (receives_from) responsive?
|
|
30
|
+
- [ ] Are my downstream agents (handoff_to) responsive?
|
|
31
|
+
- [ ] Is the shared context accessible? (`/api/agents/context`)
|
|
32
|
+
|
|
33
|
+
### 4. Container Health
|
|
34
|
+
- [ ] Are my sub-containers (if any) still running?
|
|
35
|
+
- [ ] Is disk usage within acceptable limits?
|
|
36
|
+
- [ ] Are there zombie processes?
|
|
37
|
+
|
|
38
|
+
## Response Format
|
|
39
|
+
|
|
40
|
+
**If ALL CLEAR:**
|
|
41
|
+
```json
|
|
42
|
+
{"status": "active", "current_task": "{{task}}", "progress": 0, "healthy": true}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**If IDLE:**
|
|
46
|
+
```json
|
|
47
|
+
{"status": "idle", "current_task": null, "progress": 0, "healthy": true}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**If ISSUES:**
|
|
51
|
+
```json
|
|
52
|
+
{"status": "error", "current_task": "{{task}}", "progress": 0, "healthy": false, "issues": ["{{issue_1}}"]}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Escalation
|
|
56
|
+
|
|
57
|
+
1. **Unresponsive (3 missed):** Orchestrator logs warning, attempts health probe
|
|
58
|
+
2. **Critical (5 missed):** Orchestrator restarts container, notifies operator
|
|
59
|
+
3. **Persistent failure:** Orchestrator removes agent from active pool, creates incident
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Skills:
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Personality:
|
|
2
|
+
Communication style:
|
|
3
|
+
Motto:
|
|
4
|
+
|
|
5
|
+
## Meta-Cognition — Autonomous Thinking
|
|
6
|
+
|
|
7
|
+
### Self-Awareness
|
|
8
|
+
- Monitor task queue depth, success rate, and resource consumption
|
|
9
|
+
- Track which tools and techniques yield the best results
|
|
10
|
+
- Evaluate efficiency: time per task, quality metrics, error rate
|
|
11
|
+
|
|
12
|
+
### Enhancement Identification
|
|
13
|
+
- Detect repetitive patterns that could be automated
|
|
14
|
+
- Evaluate model tier: use lightweight models for routine tasks, reserve heavy models for complex analysis
|
|
15
|
+
- Identify collaboration opportunities with other agents in the swarm
|
|
16
|
+
|
|
17
|
+
### Efficiency Tracking
|
|
18
|
+
- Formula: COST_BENEFIT = (TIME_SAVED x FREQUENCY) / (IMPL_COST + RUNNING_COST)
|
|
19
|
+
- Only propose automations where cost_benefit > 1.0
|
|
20
|
+
- Track: tasks per cycle, findings per task, false positive rate
|
|
21
|
+
|
|
22
|
+
### Swarm Awareness
|
|
23
|
+
- Read swarm state before starting work to avoid duplication
|
|
24
|
+
- Announce significant findings for other agents to act on
|
|
25
|
+
- Auto-handoff tasks to specialized agents when their expertise is needed
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
model: configurable
|
|
2
|
+
temperature: 0.2 # precise
|
|
3
|
+
docker_image: harbinger/binary-reverser
|
|
4
|
+
sandbox_mode: isolated
|
|
5
|
+
auto_handoff: true
|
|
6
|
+
handoff_to: [report-writer]
|
|
7
|
+
receives_from: [recon-scout, web-hacker]
|
|
8
|
+
|
|
9
|
+
# Resource limits (enforced by Docker — higher for RE tools)
|
|
10
|
+
memory_mb: 4096
|
|
11
|
+
cpu_count: 4
|
|
12
|
+
|
|
13
|
+
# Agent capabilities
|
|
14
|
+
capabilities:
|
|
15
|
+
- disassembly
|
|
16
|
+
- decompilation
|
|
17
|
+
- binary_diffing
|
|
18
|
+
- exploit_development
|
|
19
|
+
- shellcode_analysis
|
|
20
|
+
- format_string_analysis
|
|
21
|
+
- rop_chain_generation
|