@openacp/cli 0.2.19 → 0.2.23
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 +49 -213
- package/dist/{chunk-HTXK4NLG.js → chunk-EIBLQU3H.js} +15 -2
- package/dist/chunk-EIBLQU3H.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{main-WH6JJXBY.js → main-VJUX7RUY.js} +3 -3
- package/dist/{setup-FB4DGR6R.js → setup-XQBEZZQB.js} +2 -2
- package/dist/{setup-FB4DGR6R.js.map → setup-XQBEZZQB.js.map} +1 -1
- package/package.json +1 -1
- package/dist/chunk-HTXK4NLG.js.map +0 -1
- /package/dist/{main-WH6JJXBY.js.map → main-VJUX7RUY.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,82 +1,58 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# OpenACP
|
|
2
4
|
|
|
3
|
-
Self-hosted bridge
|
|
5
|
+
**Self-hosted bridge between messaging platforms and AI coding agents**
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
One message, any channel, any agent.
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
[](https://nodejs.org/)
|
|
11
|
+
[](https://agentclientprotocol.org/)
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
You (Telegram / Discord / ...)
|
|
11
|
-
│
|
|
12
|
-
▼
|
|
13
|
-
OpenACP (ChannelAdapter)
|
|
14
|
-
│
|
|
15
|
-
▼
|
|
16
|
-
ACP Protocol (JSON-RPC over stdio)
|
|
17
|
-
│
|
|
18
|
-
▼
|
|
19
|
-
AI Agent subprocess (Claude Code, Codex, ...)
|
|
20
|
-
```
|
|
13
|
+
[Getting Started](docs/guide/getting-started.md) | [Usage](docs/guide/usage.md) | [Configuration](docs/guide/configuration.md) | [Tunnel](docs/guide/tunnel.md) | [Plugins](docs/guide/plugins.md) | [Development](docs/guide/development.md)
|
|
21
14
|
|
|
22
|
-
|
|
15
|
+
</div>
|
|
23
16
|
|
|
24
|
-
|
|
17
|
+
---
|
|
25
18
|
|
|
26
|
-
|
|
27
|
-
- **Telegram integration** — Forum topics per session, real-time streaming, inline permission buttons
|
|
28
|
-
- **Session management** — Multiple parallel sessions, prompt queue, auto-naming
|
|
29
|
-
- **Assistant topic** — AI-powered help bot that guides you through creating sessions
|
|
30
|
-
- **Notification topic** — Aggregated notifications with deep links
|
|
31
|
-
- **Workspace management** — Named workspaces or custom paths
|
|
32
|
-
- **Self-hosted** — Your keys, your data, your machine
|
|
33
|
-
|
|
34
|
-
## Quick Start
|
|
19
|
+
Send a message in Telegram. An AI coding agent picks it up, writes code, runs commands, and streams everything back — in real time.
|
|
35
20
|
|
|
36
|
-
|
|
21
|
+
OpenACP connects messaging platforms (Telegram, Discord, ...) to AI coding agents (Claude Code, Codex, ...) via the [Agent Client Protocol (ACP)](https://agentclientprotocol.org/). You host it, you own the data.
|
|
37
22
|
|
|
38
|
-
|
|
39
|
-
- pnpm
|
|
40
|
-
- A Telegram bot token (from [@BotFather](https://t.me/BotFather))
|
|
41
|
-
- A Telegram Supergroup with **Forum/Topics enabled**
|
|
42
|
-
- At least one ACP agent installed (e.g., `claude-agent-acp`)
|
|
23
|
+
## Architecture
|
|
43
24
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
25
|
+
```
|
|
26
|
+
You (Telegram / Discord / ...)
|
|
27
|
+
↓
|
|
28
|
+
OpenACP ─── ChannelAdapter ─── Session Manager ─── Session Store
|
|
29
|
+
↓ ↓
|
|
30
|
+
ACP Protocol (JSON-RPC / stdio) Tunnel Service
|
|
31
|
+
↓ ↓
|
|
32
|
+
AI Agent (Claude Code, Codex, ...) File/Diff Viewer (Monaco)
|
|
49
33
|
```
|
|
50
34
|
|
|
51
|
-
|
|
35
|
+
## Highlights
|
|
52
36
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
37
|
+
- [**Multi-agent**](docs/guide/configuration.md#agents) — Claude Code, Codex, or any ACP-compatible agent
|
|
38
|
+
- [**Telegram**](docs/guide/telegram-setup.md) — Forum topics, real-time streaming, permission buttons, skill commands
|
|
39
|
+
- [**Tunnel & Viewer**](docs/guide/tunnel.md) — Public file/diff viewer via Cloudflare, ngrok, bore, Tailscale
|
|
40
|
+
- [**Session persistence**](docs/guide/usage.md#session-persistence--resume) — Lazy resume across restarts
|
|
41
|
+
- [**Setup wizard**](docs/guide/getting-started.md) — Interactive first-run setup with bot validation and auto-detect
|
|
42
|
+
- [**Plugin system**](docs/guide/plugins.md) — Install channel adapters as npm packages
|
|
43
|
+
- [**Structured logging**](docs/guide/configuration.md#logging) — Pino with rotation, per-session log files
|
|
44
|
+
- **Self-hosted** — Your keys, your data, your machine
|
|
57
45
|
|
|
58
|
-
|
|
46
|
+
## Quick Start
|
|
59
47
|
|
|
60
48
|
```bash
|
|
49
|
+
npm install -g @openacp/cli
|
|
61
50
|
openacp
|
|
62
51
|
```
|
|
63
52
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
1. **Telegram** — bot token + chat ID (validated against Telegram API)
|
|
67
|
-
2. **Agents** — auto-detects installed agents, select which to enable
|
|
68
|
-
3. **Workspace** — base directory for project workspaces
|
|
69
|
-
4. **Security** — allowed users, session limits, timeout
|
|
70
|
-
|
|
71
|
-
Config is saved to `~/.openacp/config.json`. See [docs/setup-guide.md](docs/setup-guide.md) for details.
|
|
72
|
-
|
|
73
|
-
OpenACP will auto-create two topics in your group:
|
|
74
|
-
- Notifications — aggregated alerts with deep links
|
|
75
|
-
- Assistant — AI helper for managing sessions
|
|
53
|
+
First run launches an [interactive setup wizard](docs/guide/getting-started.md) that validates your bot token, auto-detects your Telegram group, and finds installed agents.
|
|
76
54
|
|
|
77
|
-
##
|
|
78
|
-
|
|
79
|
-
### Commands
|
|
55
|
+
## Commands
|
|
80
56
|
|
|
81
57
|
| Command | Description |
|
|
82
58
|
|---------|-------------|
|
|
@@ -85,169 +61,29 @@ OpenACP will auto-create two topics in your group:
|
|
|
85
61
|
| `/cancel` | Cancel current session |
|
|
86
62
|
| `/status` | Show session or system status |
|
|
87
63
|
| `/agents` | List available agents |
|
|
88
|
-
| `/help` | Show help |
|
|
89
|
-
|
|
90
|
-
### Examples
|
|
91
|
-
|
|
92
|
-
```
|
|
93
|
-
/new claude my-app → New session with Claude in ~/openacp-workspace/my-app/
|
|
94
|
-
/new codex api-server → New session with Codex in ~/openacp-workspace/api-server/
|
|
95
|
-
/new claude ~/code/project → New session with absolute path
|
|
96
|
-
/new → New session with default agent and workspace
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### Session Flow
|
|
100
|
-
|
|
101
|
-
1. Type `/new claude my-project` — bot creates a new topic
|
|
102
|
-
2. Send your coding request in the topic
|
|
103
|
-
3. Agent responds with streaming text, tool calls, and code
|
|
104
|
-
4. When agent needs permission (run command, edit file) → inline buttons appear
|
|
105
|
-
5. Click Allow/Deny → agent continues
|
|
106
|
-
6. `/cancel` to stop, or start a new topic with `/new`
|
|
107
|
-
|
|
108
|
-
## Configuration
|
|
109
|
-
|
|
110
|
-
Config file: `~/.openacp/config.json`
|
|
111
|
-
|
|
112
|
-
```json
|
|
113
|
-
{
|
|
114
|
-
"channels": {
|
|
115
|
-
"telegram": {
|
|
116
|
-
"enabled": true,
|
|
117
|
-
"botToken": "...",
|
|
118
|
-
"chatId": -1001234567890,
|
|
119
|
-
"notificationTopicId": null,
|
|
120
|
-
"assistantTopicId": null
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
"agents": {
|
|
124
|
-
"claude": {
|
|
125
|
-
"command": "claude-agent-acp",
|
|
126
|
-
"args": [],
|
|
127
|
-
"env": {}
|
|
128
|
-
},
|
|
129
|
-
"codex": {
|
|
130
|
-
"command": "codex",
|
|
131
|
-
"args": ["--acp"],
|
|
132
|
-
"env": {}
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
"defaultAgent": "claude",
|
|
136
|
-
"workspace": {
|
|
137
|
-
"baseDir": "~/openacp-workspace"
|
|
138
|
-
},
|
|
139
|
-
"security": {
|
|
140
|
-
"allowedUserIds": [],
|
|
141
|
-
"maxConcurrentSessions": 5,
|
|
142
|
-
"sessionTimeoutMinutes": 60
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### Environment Variables
|
|
148
|
-
|
|
149
|
-
| Variable | Overrides |
|
|
150
|
-
|----------|-----------|
|
|
151
|
-
| `OPENACP_CONFIG_PATH` | Config file location |
|
|
152
|
-
| `OPENACP_TELEGRAM_BOT_TOKEN` | `channels.telegram.botToken` |
|
|
153
|
-
| `OPENACP_TELEGRAM_CHAT_ID` | `channels.telegram.chatId` |
|
|
154
|
-
| `OPENACP_DEFAULT_AGENT` | `defaultAgent` |
|
|
155
|
-
| `OPENACP_DEBUG` | Enable debug logging (set to `1`) |
|
|
156
|
-
|
|
157
|
-
## Plugins
|
|
158
|
-
|
|
159
|
-
Install additional adapters:
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
openacp install @openacp/adapter-discord
|
|
163
|
-
openacp plugins # list installed
|
|
164
|
-
openacp uninstall @openacp/adapter-discord # remove
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
Configure in `~/.openacp/config.json`:
|
|
168
|
-
|
|
169
|
-
```json
|
|
170
|
-
{
|
|
171
|
-
"channels": {
|
|
172
|
-
"discord": {
|
|
173
|
-
"enabled": true,
|
|
174
|
-
"adapter": "@openacp/adapter-discord",
|
|
175
|
-
"botToken": "..."
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
## Project Structure
|
|
182
|
-
|
|
183
|
-
```
|
|
184
|
-
src/
|
|
185
|
-
cli.ts → CLI entry point
|
|
186
|
-
main.ts → Server startup
|
|
187
|
-
index.ts → Public API exports
|
|
188
|
-
core/
|
|
189
|
-
core.ts → OpenACPCore orchestrator
|
|
190
|
-
config.ts → ConfigManager + Zod validation
|
|
191
|
-
setup.ts → Interactive setup wizard
|
|
192
|
-
session.ts → Session (prompt queue, auto-name)
|
|
193
|
-
agent-instance.ts → ACP SDK integration
|
|
194
|
-
channel.ts → ChannelAdapter abstract class
|
|
195
|
-
plugin-manager.ts → Plugin install/uninstall/load
|
|
196
|
-
types.ts → Shared types
|
|
197
|
-
adapters/
|
|
198
|
-
telegram/
|
|
199
|
-
adapter.ts → TelegramAdapter
|
|
200
|
-
streaming.ts → Real-time message streaming
|
|
201
|
-
commands.ts → Bot commands
|
|
202
|
-
permissions.ts → Permission inline buttons
|
|
203
|
-
assistant.ts → AI assistant topic
|
|
204
|
-
formatting.ts → Markdown → Telegram HTML
|
|
205
|
-
topics.ts → Forum topic management
|
|
206
|
-
```
|
|
207
64
|
|
|
208
65
|
## Roadmap
|
|
209
66
|
|
|
210
|
-
- **Phase 1**
|
|
211
|
-
- **Phase 2** —
|
|
212
|
-
- **Phase 3** — Agent skills as commands,
|
|
213
|
-
- **Phase 4** — Voice control, file sharing
|
|
67
|
+
- **Phase 1** — Core + Telegram + ACP agents
|
|
68
|
+
- **Phase 2** — Tunnel/file viewer, session persistence, logging, plugin system
|
|
69
|
+
- **Phase 3** — Agent skills as commands, Discord adapter, Web UI
|
|
70
|
+
- **Phase 4** — Voice control, file/image sharing
|
|
214
71
|
- **Phase 5** — WhatsApp, agent chaining, plugin marketplace
|
|
215
72
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
## Adding a Channel Adapter
|
|
219
|
-
|
|
220
|
-
Extend `ChannelAdapter` from `@openacp/cli`:
|
|
221
|
-
|
|
222
|
-
```typescript
|
|
223
|
-
import { ChannelAdapter } from '@openacp/cli'
|
|
224
|
-
|
|
225
|
-
class MyAdapter extends ChannelAdapter {
|
|
226
|
-
async start() { /* connect to platform */ }
|
|
227
|
-
async stop() { /* disconnect */ }
|
|
228
|
-
async sendMessage(sessionId, content) { /* send to user */ }
|
|
229
|
-
async sendPermissionRequest(sessionId, request) { /* show buttons */ }
|
|
230
|
-
async sendNotification(notification) { /* notify user */ }
|
|
231
|
-
async createSessionThread(sessionId, name) { /* create thread */ }
|
|
232
|
-
async renameSessionThread(sessionId, name) { /* rename thread */ }
|
|
233
|
-
}
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
## Development
|
|
73
|
+
## Star History
|
|
237
74
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
75
|
+
<a href="https://star-history.com/#Open-ACP/OpenACP&Date">
|
|
76
|
+
<picture>
|
|
77
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=Open-ACP/OpenACP&type=Date&theme=dark" />
|
|
78
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=Open-ACP/OpenACP&type=Date" />
|
|
79
|
+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=Open-ACP/OpenACP&type=Date" />
|
|
80
|
+
</picture>
|
|
81
|
+
</a>
|
|
244
82
|
|
|
245
|
-
|
|
83
|
+
## Contributing
|
|
246
84
|
|
|
247
|
-
|
|
248
|
-
pnpm start
|
|
249
|
-
```
|
|
85
|
+
See [development guide](docs/guide/development.md).
|
|
250
86
|
|
|
251
87
|
## License
|
|
252
88
|
|
|
253
|
-
AGPL-3.0
|
|
89
|
+
[AGPL-3.0](LICENSE)
|
|
@@ -1949,6 +1949,19 @@ function redirectToAssistant(chatId, assistantTopicId) {
|
|
|
1949
1949
|
|
|
1950
1950
|
// src/adapters/telegram/adapter.ts
|
|
1951
1951
|
var log7 = createChildLogger({ module: "telegram" });
|
|
1952
|
+
function patchedFetch(input, init) {
|
|
1953
|
+
if (init?.signal && !(init.signal instanceof AbortSignal)) {
|
|
1954
|
+
const nativeController = new AbortController();
|
|
1955
|
+
const polyfillSignal = init.signal;
|
|
1956
|
+
if (polyfillSignal.aborted) {
|
|
1957
|
+
nativeController.abort();
|
|
1958
|
+
} else {
|
|
1959
|
+
polyfillSignal.addEventListener("abort", () => nativeController.abort());
|
|
1960
|
+
}
|
|
1961
|
+
init = { ...init, signal: nativeController.signal };
|
|
1962
|
+
}
|
|
1963
|
+
return fetch(input, init);
|
|
1964
|
+
}
|
|
1952
1965
|
var TelegramAdapter = class extends ChannelAdapter {
|
|
1953
1966
|
bot;
|
|
1954
1967
|
telegramConfig;
|
|
@@ -1966,7 +1979,7 @@ var TelegramAdapter = class extends ChannelAdapter {
|
|
|
1966
1979
|
this.telegramConfig = config;
|
|
1967
1980
|
}
|
|
1968
1981
|
async start() {
|
|
1969
|
-
this.bot = new Bot(this.telegramConfig.botToken, { client: { fetch } });
|
|
1982
|
+
this.bot = new Bot(this.telegramConfig.botToken, { client: { fetch: patchedFetch } });
|
|
1970
1983
|
this.bot.catch((err) => {
|
|
1971
1984
|
const rootCause = err.error instanceof Error ? err.error : err;
|
|
1972
1985
|
log7.error({ err: rootCause }, "Telegram bot error");
|
|
@@ -2389,4 +2402,4 @@ export {
|
|
|
2389
2402
|
ChannelAdapter,
|
|
2390
2403
|
TelegramAdapter
|
|
2391
2404
|
};
|
|
2392
|
-
//# sourceMappingURL=chunk-
|
|
2405
|
+
//# sourceMappingURL=chunk-EIBLQU3H.js.map
|