agent-window 1.0.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/Dockerfile +23 -0
- package/README.md +138 -0
- package/SECURITY.md +31 -0
- package/bin/cli.js +743 -0
- package/config/config.example.json +70 -0
- package/docker-compose.yml +31 -0
- package/docs/legacy/DEVELOPMENT.md +174 -0
- package/docs/legacy/HANDOVER.md +149 -0
- package/ecosystem.config.cjs +26 -0
- package/hooks/hook.mjs +299 -0
- package/hooks/settings.json +15 -0
- package/package.json +45 -0
- package/sandbox/Dockerfile +61 -0
- package/scripts/install.sh +114 -0
- package/src/bot.js +1518 -0
- package/src/core/config.js +195 -0
- package/src/core/perf-monitor.js +360 -0
package/Dockerfile
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# AgentBridge Dockerfile
|
|
2
|
+
#
|
|
3
|
+
# For running AgentBridge in a container.
|
|
4
|
+
# The sandbox (claude-sandbox) is built separately.
|
|
5
|
+
|
|
6
|
+
FROM node:20-alpine
|
|
7
|
+
|
|
8
|
+
RUN apk add --no-cache docker-cli
|
|
9
|
+
|
|
10
|
+
WORKDIR /app
|
|
11
|
+
|
|
12
|
+
COPY package*.json ./
|
|
13
|
+
RUN npm ci --only=production
|
|
14
|
+
|
|
15
|
+
COPY src/ ./src/
|
|
16
|
+
COPY bin/ ./bin/
|
|
17
|
+
COPY hooks/ ./hooks/
|
|
18
|
+
COPY config/config.example.json ./config/
|
|
19
|
+
|
|
20
|
+
RUN mkdir -p .pending-permissions
|
|
21
|
+
RUN chmod +x bin/cli.js
|
|
22
|
+
|
|
23
|
+
ENTRYPOINT ["node", "src/bot.js"]
|
package/README.md
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# AgentWindow
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>Your Window to AI Agent Collaboration</strong>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
Simplified interaction, powerful backend capabilities
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- **Simplicity First** - Easy chat-based interaction with AI agents
|
|
16
|
+
- **Multi-Platform Ready** - Discord today, Slack/Telegram coming soon
|
|
17
|
+
- **Docker Sandbox** - Secure isolated execution environment
|
|
18
|
+
- **Permission Control** - Approve operations via chat buttons
|
|
19
|
+
- **Session Management** - Resume conversations, channel binding
|
|
20
|
+
- **Multi-Bot Ready** - Unified management for multiple instances
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Quick Start
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Install globally
|
|
28
|
+
npm install -g agent-window
|
|
29
|
+
|
|
30
|
+
# Initialize multi-bot directory
|
|
31
|
+
agent-window init
|
|
32
|
+
|
|
33
|
+
# Add a bot instance
|
|
34
|
+
agent-window add-bot myproject
|
|
35
|
+
|
|
36
|
+
# Start all bots
|
|
37
|
+
pm2 start ~/bots/ecosystem.config.cjs
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## CLI Commands
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Single-Bot Commands
|
|
46
|
+
agent-window setup # Interactive setup wizard
|
|
47
|
+
agent-window start # Start the bridge
|
|
48
|
+
agent-window stop # Stop the bridge
|
|
49
|
+
agent-window restart # Restart the bridge
|
|
50
|
+
agent-window status # Show status
|
|
51
|
+
agent-window logs # View logs (live)
|
|
52
|
+
agent-window update # Update to latest version
|
|
53
|
+
agent-window config # Show config location
|
|
54
|
+
|
|
55
|
+
# Multi-Bot Commands
|
|
56
|
+
agent-window init # Initialize ~/bots directory
|
|
57
|
+
agent-window add-bot <name> # Add a new bot instance
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Configuration
|
|
63
|
+
|
|
64
|
+
Each bot instance has its own `config.json`:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"BOT_TOKEN": "your-discord-bot-token",
|
|
69
|
+
"CLAUDE_CODE_OAUTH_TOKEN": "your-claude-oauth-token",
|
|
70
|
+
"PROJECT_DIR": "/path/to/your/project",
|
|
71
|
+
"ALLOWED_CHANNELS": "channel-id-1,channel-id-2"
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Required
|
|
76
|
+
|
|
77
|
+
| Key | Description |
|
|
78
|
+
|-----|-------------|
|
|
79
|
+
| `BOT_TOKEN` | Discord Bot Token |
|
|
80
|
+
| `CLAUDE_CODE_OAUTH_TOKEN` | Claude Code OAuth Token |
|
|
81
|
+
| `PROJECT_DIR` | Project directory to work on |
|
|
82
|
+
| `ALLOWED_CHANNELS` | Comma-separated channel IDs |
|
|
83
|
+
|
|
84
|
+
### Optional
|
|
85
|
+
|
|
86
|
+
See `config/config.example.json` for all options.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Chat Commands
|
|
91
|
+
|
|
92
|
+
In Discord, mention the bot:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
@bot <message> # Send message (continues last session)
|
|
96
|
+
@bot -n <message> # Start new session
|
|
97
|
+
@bot -r <session_id> <msg> # Resume specific session
|
|
98
|
+
@bot /pick # Choose session (button UI)
|
|
99
|
+
@bot /sessions # List recent sessions
|
|
100
|
+
@bot /status # Show bot status
|
|
101
|
+
@bot /help # Show help
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Multi-Bot Management
|
|
107
|
+
|
|
108
|
+
Organize multiple bot instances in one directory:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
~/bots/
|
|
112
|
+
├── agent-window/ # Shared code (symlink to global install)
|
|
113
|
+
├── project1/config.json # Bot 1 configuration
|
|
114
|
+
├── project2/config.json # Bot 2 configuration
|
|
115
|
+
└── ecosystem.config.cjs # PM2 unified management
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Unified commands:**
|
|
119
|
+
```bash
|
|
120
|
+
pm2 start ~/bots/ecosystem.config.cjs # Start all
|
|
121
|
+
pm2 stop all # Stop all
|
|
122
|
+
pm2 restart all # Restart all
|
|
123
|
+
pm2 logs # View all logs
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Update
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
agent-window update
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## License
|
|
137
|
+
|
|
138
|
+
MIT
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
| Version | Supported |
|
|
6
|
+
| ------- | ------------------ |
|
|
7
|
+
| 1.0.x | :white_check_mark: |
|
|
8
|
+
|
|
9
|
+
## Reporting a Vulnerability
|
|
10
|
+
|
|
11
|
+
If you discover a security vulnerability, please report it by:
|
|
12
|
+
|
|
13
|
+
1. **Email**: Open an issue with `[SECURITY]` prefix (without sensitive details)
|
|
14
|
+
2. **Private disclosure**: Use GitHub's private vulnerability reporting feature
|
|
15
|
+
|
|
16
|
+
Please include:
|
|
17
|
+
- Description of the vulnerability
|
|
18
|
+
- Steps to reproduce
|
|
19
|
+
- Potential impact
|
|
20
|
+
- Suggested fix (if any)
|
|
21
|
+
|
|
22
|
+
We will respond within 48 hours and work on a fix as soon as possible.
|
|
23
|
+
|
|
24
|
+
## Security Best Practices
|
|
25
|
+
|
|
26
|
+
When using AgentBridge:
|
|
27
|
+
|
|
28
|
+
- Never commit `config/config.json` (contains tokens)
|
|
29
|
+
- Use Docker isolation for untrusted code execution
|
|
30
|
+
- Review permission requests before approving
|
|
31
|
+
- Keep dependencies updated
|