@openacp/cli 2026.326.4 → 2026.327.2

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.
Files changed (132) hide show
  1. package/README.md +2 -2
  2. package/dist/{adapter-6ANPBSVU.js → adapter-LC2QSDAS.js} +4 -5
  3. package/dist/{adapter-PQGHVG4K.js → adapter-Y55NXX6I.js} +2 -2
  4. package/dist/{api-server-3PYLRBCN.js → api-server-7G3ZUZRM.js} +2 -2
  5. package/dist/{api-server-CHVSUDBX.js → api-server-CAYNPUF2.js} +2 -2
  6. package/dist/{chunk-UNJUWWQO.js → chunk-2YCW3QDV.js} +21 -14
  7. package/dist/chunk-2YCW3QDV.js.map +1 -0
  8. package/dist/{chunk-Y64XWMJ4.js → chunk-36YQ44D7.js} +2 -2
  9. package/dist/{chunk-UB2QB6DE.js → chunk-3ASUU6WW.js} +2 -2
  10. package/dist/{chunk-V5JT5TPD.js → chunk-4GMLGCF2.js} +2 -2
  11. package/dist/chunk-CDAUYTVP.js +41 -0
  12. package/dist/chunk-CDAUYTVP.js.map +1 -0
  13. package/dist/{chunk-Q6ZXJTZB.js → chunk-HUWOFP2H.js} +9 -17
  14. package/dist/chunk-HUWOFP2H.js.map +1 -0
  15. package/dist/{chunk-P4SNGQNI.js → chunk-KMMEFXIE.js} +2 -2
  16. package/dist/{chunk-RKB2ZK6S.js → chunk-LP45RCA4.js} +579 -153
  17. package/dist/chunk-LP45RCA4.js.map +1 -0
  18. package/dist/{chunk-L7YNNBI5.js → chunk-QAQDGPB4.js} +1 -75
  19. package/dist/chunk-QAQDGPB4.js.map +1 -0
  20. package/dist/{chunk-V2M243KZ.js → chunk-TRXBJEZ5.js} +55 -53
  21. package/dist/chunk-TRXBJEZ5.js.map +1 -0
  22. package/dist/{chunk-NBFIBGAT.js → chunk-UMT7RU77.js} +45 -118
  23. package/dist/chunk-UMT7RU77.js.map +1 -0
  24. package/dist/{chunk-FQEBWOZR.js → chunk-XIBG7LSL.js} +181 -128
  25. package/dist/chunk-XIBG7LSL.js.map +1 -0
  26. package/dist/cli.js +155 -49
  27. package/dist/cli.js.map +1 -1
  28. package/dist/{config-editor-HNEKXRLQ.js → config-editor-3IKBPZA7.js} +2 -2
  29. package/dist/{core-plugins-VEUNFTMB.js → core-plugins-ROU4GPLT.js} +8 -12
  30. package/dist/{dev-loader-RDC5E2CW.js → dev-loader-DRU3R7ZM.js} +7 -18
  31. package/dist/dev-loader-DRU3R7ZM.js.map +1 -0
  32. package/dist/{doctor-H72BZOPA.js → doctor-QZQAP46W.js} +2 -2
  33. package/dist/index.d.ts +128 -66
  34. package/dist/index.js +41 -20
  35. package/dist/index.js.map +1 -1
  36. package/dist/{integrate-5C6KSU6D.js → integrate-G6CVXTGT.js} +3 -4
  37. package/dist/integrate-G6CVXTGT.js.map +1 -0
  38. package/dist/{main-T5WVCCFN.js → main-UVTZ46WP.js} +39 -185
  39. package/dist/main-UVTZ46WP.js.map +1 -0
  40. package/dist/plugin-create-5HQRF2ID.js +967 -0
  41. package/dist/plugin-create-5HQRF2ID.js.map +1 -0
  42. package/dist/plugin-installer-GQ2P3Q3E.js +23 -0
  43. package/dist/plugin-installer-GQ2P3Q3E.js.map +1 -0
  44. package/dist/plugin-search-HQ4WQKOF.js +40 -0
  45. package/dist/plugin-search-HQ4WQKOF.js.map +1 -0
  46. package/dist/{post-upgrade-XLHZ6ZB7.js → post-upgrade-3ADZRMYJ.js} +2 -2
  47. package/dist/registry-client-AVGRE4CF.js +8 -0
  48. package/dist/{setup-BAI2F24H.js → setup-EYAFK2WI.js} +77 -50
  49. package/dist/setup-EYAFK2WI.js.map +1 -0
  50. package/dist/{slack-KH7E3VBS.js → slack-37ZWBDUI.js} +2 -2
  51. package/dist/{telegram-ZDC3JQF2.js → telegram-2ZCCCZIY.js} +2 -2
  52. package/dist/{tunnel-M47I7H4B.js → tunnel-45HA72MB.js} +2 -2
  53. package/dist/{tunnel-service-WADYHREX.js → tunnel-service-QJPUYEKU.js} +11 -3
  54. package/dist/tunnel-service-QJPUYEKU.js.map +1 -0
  55. package/package.json +2 -3
  56. package/dist/action-detect-QPA775HB.js +0 -16
  57. package/dist/adapter-77ZCVABT.js +0 -2394
  58. package/dist/adapter-77ZCVABT.js.map +0 -1
  59. package/dist/admin-GBPZFFAU.js +0 -23
  60. package/dist/agents-BWU4MRRD.js +0 -15
  61. package/dist/chunk-2CX4IEEC.js +0 -124
  62. package/dist/chunk-2CX4IEEC.js.map +0 -1
  63. package/dist/chunk-4KGLKKQK.js +0 -298
  64. package/dist/chunk-4KGLKKQK.js.map +0 -1
  65. package/dist/chunk-5ZOFBTOR.js +0 -553
  66. package/dist/chunk-5ZOFBTOR.js.map +0 -1
  67. package/dist/chunk-6RXVEXF3.js +0 -23
  68. package/dist/chunk-6RXVEXF3.js.map +0 -1
  69. package/dist/chunk-FQEBWOZR.js.map +0 -1
  70. package/dist/chunk-GJOY37U7.js +0 -265
  71. package/dist/chunk-GJOY37U7.js.map +0 -1
  72. package/dist/chunk-HVBNCPAY.js +0 -71
  73. package/dist/chunk-HVBNCPAY.js.map +0 -1
  74. package/dist/chunk-I3CGU5W7.js +0 -134
  75. package/dist/chunk-I3CGU5W7.js.map +0 -1
  76. package/dist/chunk-L7YNNBI5.js.map +0 -1
  77. package/dist/chunk-MTSDOSXS.js +0 -219
  78. package/dist/chunk-MTSDOSXS.js.map +0 -1
  79. package/dist/chunk-NAM4ERUW.js +0 -203
  80. package/dist/chunk-NAM4ERUW.js.map +0 -1
  81. package/dist/chunk-NBFIBGAT.js.map +0 -1
  82. package/dist/chunk-O5RG4YZY.js +0 -122
  83. package/dist/chunk-O5RG4YZY.js.map +0 -1
  84. package/dist/chunk-Q6ZXJTZB.js.map +0 -1
  85. package/dist/chunk-QSDZDHNS.js +0 -145
  86. package/dist/chunk-QSDZDHNS.js.map +0 -1
  87. package/dist/chunk-RKB2ZK6S.js.map +0 -1
  88. package/dist/chunk-UNJUWWQO.js.map +0 -1
  89. package/dist/chunk-V2M243KZ.js.map +0 -1
  90. package/dist/chunk-WAAD23KY.js +0 -222
  91. package/dist/chunk-WAAD23KY.js.map +0 -1
  92. package/dist/chunk-WVLDNYOJ.js +0 -150
  93. package/dist/chunk-WVLDNYOJ.js.map +0 -1
  94. package/dist/dev-loader-RDC5E2CW.js.map +0 -1
  95. package/dist/discord-NOJQ5PZO.js +0 -8
  96. package/dist/doctor-RF6BHMCC.js +0 -15
  97. package/dist/doctor-RF6BHMCC.js.map +0 -1
  98. package/dist/integrate-5C6KSU6D.js.map +0 -1
  99. package/dist/main-T5WVCCFN.js.map +0 -1
  100. package/dist/new-session-AVQCNXRG.js +0 -17
  101. package/dist/new-session-AVQCNXRG.js.map +0 -1
  102. package/dist/plugin-create-AQ3B22BZ.js +0 -334
  103. package/dist/plugin-create-AQ3B22BZ.js.map +0 -1
  104. package/dist/session-KZFA6Z26.js +0 -20
  105. package/dist/session-KZFA6Z26.js.map +0 -1
  106. package/dist/settings-MFYM7CZO.js +0 -14
  107. package/dist/settings-MFYM7CZO.js.map +0 -1
  108. package/dist/setup-BAI2F24H.js.map +0 -1
  109. package/dist/slack-KH7E3VBS.js.map +0 -1
  110. package/dist/telegram-ZDC3JQF2.js.map +0 -1
  111. package/dist/tunnel-M47I7H4B.js.map +0 -1
  112. package/dist/tunnel-service-WADYHREX.js.map +0 -1
  113. package/dist/usage-WYNK6ZC5.js +0 -10
  114. package/dist/usage-WYNK6ZC5.js.map +0 -1
  115. package/dist/validators-6CLEZUBD.js +0 -8
  116. package/dist/validators-6CLEZUBD.js.map +0 -1
  117. /package/dist/{action-detect-QPA775HB.js.map → adapter-LC2QSDAS.js.map} +0 -0
  118. /package/dist/{adapter-PQGHVG4K.js.map → adapter-Y55NXX6I.js.map} +0 -0
  119. /package/dist/{adapter-6ANPBSVU.js.map → api-server-7G3ZUZRM.js.map} +0 -0
  120. /package/dist/{admin-GBPZFFAU.js.map → api-server-CAYNPUF2.js.map} +0 -0
  121. /package/dist/{chunk-Y64XWMJ4.js.map → chunk-36YQ44D7.js.map} +0 -0
  122. /package/dist/{chunk-UB2QB6DE.js.map → chunk-3ASUU6WW.js.map} +0 -0
  123. /package/dist/{chunk-V5JT5TPD.js.map → chunk-4GMLGCF2.js.map} +0 -0
  124. /package/dist/{chunk-P4SNGQNI.js.map → chunk-KMMEFXIE.js.map} +0 -0
  125. /package/dist/{agents-BWU4MRRD.js.map → config-editor-3IKBPZA7.js.map} +0 -0
  126. /package/dist/{api-server-3PYLRBCN.js.map → core-plugins-ROU4GPLT.js.map} +0 -0
  127. /package/dist/{api-server-CHVSUDBX.js.map → doctor-QZQAP46W.js.map} +0 -0
  128. /package/dist/{post-upgrade-XLHZ6ZB7.js.map → post-upgrade-3ADZRMYJ.js.map} +0 -0
  129. /package/dist/{config-editor-HNEKXRLQ.js.map → registry-client-AVGRE4CF.js.map} +0 -0
  130. /package/dist/{core-plugins-VEUNFTMB.js.map → slack-37ZWBDUI.js.map} +0 -0
  131. /package/dist/{discord-NOJQ5PZO.js.map → telegram-2ZCCCZIY.js.map} +0 -0
  132. /package/dist/{doctor-H72BZOPA.js.map → tunnel-45HA72MB.js.map} +0 -0
@@ -1,553 +0,0 @@
1
- // src/core/adapter-primitives/primitives/send-queue.ts
2
- var SendQueue = class {
3
- constructor(config) {
4
- this.config = config;
5
- }
6
- items = [];
7
- processing = false;
8
- lastExec = 0;
9
- lastCategoryExec = /* @__PURE__ */ new Map();
10
- get pending() {
11
- return this.items.length;
12
- }
13
- enqueue(fn, opts) {
14
- const type = opts?.type ?? "other";
15
- const key = opts?.key;
16
- const category = opts?.category;
17
- let resolve;
18
- let reject;
19
- const promise = new Promise((res, rej) => {
20
- resolve = res;
21
- reject = rej;
22
- });
23
- promise.catch(() => {
24
- });
25
- if (type === "text" && key) {
26
- const idx = this.items.findIndex(
27
- (item) => item.type === "text" && item.key === key
28
- );
29
- if (idx !== -1) {
30
- this.items[idx].resolve(void 0);
31
- this.items[idx] = { fn, type, key, category, resolve, reject, promise };
32
- this.scheduleProcess();
33
- return promise;
34
- }
35
- }
36
- this.items.push({ fn, type, key, category, resolve, reject, promise });
37
- this.scheduleProcess();
38
- return promise;
39
- }
40
- onRateLimited() {
41
- this.config.onRateLimited?.();
42
- const remaining = [];
43
- for (const item of this.items) {
44
- if (item.type === "text") {
45
- item.resolve(void 0);
46
- } else {
47
- remaining.push(item);
48
- }
49
- }
50
- this.items = remaining;
51
- }
52
- clear() {
53
- for (const item of this.items) {
54
- item.resolve(void 0);
55
- }
56
- this.items = [];
57
- }
58
- scheduleProcess() {
59
- if (this.processing) return;
60
- if (this.items.length === 0) return;
61
- const item = this.items[0];
62
- const interval = this.getInterval(item.category);
63
- const lastExec = item.category ? this.lastCategoryExec.get(item.category) ?? 0 : this.lastExec;
64
- const elapsed = Date.now() - lastExec;
65
- const delay = Math.max(0, interval - elapsed);
66
- this.processing = true;
67
- setTimeout(() => void this.processNext(), delay);
68
- }
69
- getInterval(category) {
70
- if (category && this.config.categoryIntervals?.[category] != null) {
71
- return this.config.categoryIntervals[category];
72
- }
73
- return this.config.minInterval;
74
- }
75
- async processNext() {
76
- const item = this.items.shift();
77
- if (!item) {
78
- this.processing = false;
79
- return;
80
- }
81
- try {
82
- const result = await item.fn();
83
- item.resolve(result);
84
- } catch (err) {
85
- this.config.onError?.(err instanceof Error ? err : new Error(String(err)));
86
- item.reject(err);
87
- } finally {
88
- const now = Date.now();
89
- this.lastExec = now;
90
- if (item.category) {
91
- this.lastCategoryExec.set(item.category, now);
92
- }
93
- this.processing = false;
94
- this.scheduleProcess();
95
- }
96
- }
97
- };
98
-
99
- // src/core/adapter-primitives/primitives/tool-call-tracker.ts
100
- var ToolCallTracker = class {
101
- sessions = /* @__PURE__ */ new Map();
102
- track(sessionId, meta, messageId) {
103
- if (!this.sessions.has(sessionId)) {
104
- this.sessions.set(sessionId, /* @__PURE__ */ new Map());
105
- }
106
- this.sessions.get(sessionId).set(meta.id, { ...meta, messageId });
107
- }
108
- update(sessionId, toolId, status, patch) {
109
- const tool = this.sessions.get(sessionId)?.get(toolId);
110
- if (!tool) return null;
111
- tool.status = status;
112
- if (patch?.viewerLinks) tool.viewerLinks = patch.viewerLinks;
113
- if (patch?.viewerFilePath) tool.viewerFilePath = patch.viewerFilePath;
114
- if (patch?.name) tool.name = patch.name;
115
- if (patch?.kind) tool.kind = patch.kind;
116
- return tool;
117
- }
118
- getActive(sessionId) {
119
- const session = this.sessions.get(sessionId);
120
- return session ? [...session.values()] : [];
121
- }
122
- clear(sessionId) {
123
- this.sessions.delete(sessionId);
124
- }
125
- clearAll() {
126
- this.sessions.clear();
127
- }
128
- };
129
-
130
- // src/data/product-guide.ts
131
- var PRODUCT_GUIDE = `
132
- # OpenACP \u2014 Product Guide
133
-
134
- OpenACP lets you chat with AI coding agents (like Claude Code) through messaging platforms (Telegram, Discord).
135
- You type messages in your chat platform, the agent reads/writes/runs code in your project folder, and results stream back in real time.
136
-
137
- ---
138
-
139
- ## Quick Start
140
-
141
- 1. Start OpenACP: \`openacp\` (or \`openacp start\` for background daemon)
142
- 2. Open your messaging platform (Telegram group or Discord server) \u2014 you'll see the Assistant topic/thread
143
- 3. Tap/click \u{1F195} New Session or type /new
144
- 4. Pick an agent and a project folder
145
- 5. Chat in the session topic/thread \u2014 the agent works on your code
146
-
147
- ---
148
-
149
- ## Core Concepts
150
-
151
- ### Sessions
152
- A session = one conversation with one AI agent working in one project folder.
153
- Each session gets its own topic (Telegram) or forum thread (Discord). Chat there to give instructions to the agent.
154
-
155
- ### Agents
156
- An agent is an AI coding tool (e.g., Claude Code, Gemini, Cursor, Codex, etc.).
157
- OpenACP supports 28+ agents from the official ACP Registry (agentclientprotocol.com).
158
- You can install multiple agents and choose which one to use per session.
159
- The default agent is used when you don't specify one.
160
-
161
- ### Agent Management
162
- - Browse agents: \`/agents\` in your chat platform or \`openacp agents\` in CLI
163
- - Install: tap the install button in /agents, or \`openacp agents install <name>\`
164
- - Uninstall: \`openacp agents uninstall <name>\`
165
- - Setup/login: \`openacp agents run <name> -- <args>\` (e.g., \`openacp agents run gemini -- auth login\`)
166
- - Details: \`openacp agents info <name>\` shows version, dependencies, and setup steps
167
-
168
- Some agents need additional setup before they can be used:
169
- - Claude: requires \`claude login\`
170
- - Gemini: requires \`openacp agents run gemini -- auth login\`
171
- - Codex: requires setting \`OPENAI_API_KEY\` environment variable
172
- - GitHub Copilot: requires \`openacp agents run copilot -- auth login\`
173
-
174
- Agents are installed in three ways depending on the agent:
175
- - **npx** \u2014 Node.js agents, downloaded automatically on first use
176
- - **uvx** \u2014 Python agents, downloaded automatically on first use
177
- - **binary** \u2014 Platform-specific binaries, downloaded to \`~/.openacp/agents/\`
178
-
179
- ### Project Folder (Workspace)
180
- The directory where the agent reads, writes, and runs code.
181
- When creating a session, you choose which folder the agent works in.
182
- You can type a full path like \`~/code/my-project\` or just a name like \`my-project\` (it becomes \`<base-dir>/my-project\`).
183
-
184
- ### System Topics
185
- - **Assistant** \u2014 Always-on helper that can answer questions, create sessions, check status, troubleshoot
186
- - **Notifications** \u2014 System alerts (permission requests, session errors, completions)
187
-
188
- ---
189
-
190
- ## Creating Sessions
191
-
192
- ### From menu
193
- Tap \u{1F195} New Session \u2192 choose agent (if multiple) \u2192 choose project folder \u2192 confirm
194
-
195
- ### From command
196
- - \`/new\` \u2014 Interactive flow (asks agent + folder)
197
- - \`/new claude ~/code/my-project\` \u2014 Create directly with specific agent and folder
198
-
199
- ### From Assistant topic
200
- Just ask: "Create a session for my-project with claude" \u2014 the assistant handles it
201
-
202
- ### Quick new chat
203
- \`/newchat\` in a session topic \u2014 creates new session with same agent and folder as current one
204
-
205
- ---
206
-
207
- ## Working with Sessions
208
-
209
- ### Chat
210
- Type messages in the session topic. The agent responds with code changes, explanations, tool outputs.
211
-
212
- ### What you see while the agent works
213
- - **\u{1F4AD} Thinking indicator** \u2014 Shows when the agent is reasoning, with elapsed time
214
- - **Text responses** \u2014 Streamed in real time, updated every few seconds
215
- - **Tool calls** \u2014 When the agent runs commands or edits files, you see tool name, input, status, and output
216
- - **\u{1F4CB} Plan card** \u2014 Visual task progress with completed/in-progress/pending items and progress bar
217
- - **"View File" / "View Diff" buttons** \u2014 Opens in browser with Monaco editor (requires tunnel)
218
-
219
- ### Session lifecycle
220
- 1. **Creating** \u2014 Topic created, agent spawning
221
- 2. **Warming up** \u2014 Agent primes its cache (happens automatically, invisible to you)
222
- 3. **Active** \u2014 Ready for your messages
223
- 4. **Auto-naming** \u2014 After your first message, the session gets a descriptive name (agent summarizes in ~5 words). The topic title updates automatically.
224
- 5. **Finished/Error** \u2014 Session completed or hit an error
225
-
226
- ### Agent skills
227
- Some agents provide slash commands (e.g., /compact, /review). Available skills are pinned in the session topic.
228
-
229
- ### Permission requests
230
- When the agent wants to run a command, it asks for permission.
231
- You see buttons: \u2705 Allow, \u274C Reject (and sometimes "Always Allow").
232
- A notification also appears in the Notifications topic with a link to the request.
233
-
234
- ### Dangerous mode
235
- Auto-approves ALL permission requests \u2014 the agent runs any command without asking.
236
- - Enable: \`/enable_dangerous\` or tap the \u2620\uFE0F button in the session
237
- - Disable: \`/disable_dangerous\` or tap the \u{1F510} button
238
- - \u26A0\uFE0F Use with caution \u2014 the agent can execute anything
239
-
240
- ### Session timeout
241
- Idle sessions are automatically cancelled after a configurable timeout (default: 60 minutes).
242
- Configure via \`security.sessionTimeoutMinutes\` in config.
243
-
244
- ---
245
-
246
- ## Session Transfer (Handoff)
247
-
248
- ### Chat \u2192 Terminal
249
- 1. Type \`/handoff\` in a session topic/thread
250
- 2. You get a command like \`claude --resume <SESSION_ID>\`
251
- 3. Copy and run it in your terminal \u2014 the session continues there with full conversation history
252
-
253
- ### Terminal \u2192 Chat
254
- 1. First time: run \`openacp integrate claude\` to install the handoff skill (one-time setup)
255
- 2. In Claude Code, use the /openacp:handoff slash command
256
- 3. The session appears as a new topic/thread and you can continue chatting there
257
-
258
- ### How it works
259
- - The agent session ID is shared between platforms
260
- - Conversation history is preserved \u2014 pick up where you left off
261
- - The agent that supports resume (e.g., Claude with \`--resume\`) handles the actual transfer
262
-
263
- ---
264
-
265
- ## Managing Sessions
266
-
267
- ### Status
268
- - \`/status\` \u2014 Shows active sessions count and details
269
- - Ask the Assistant: "What sessions are running?"
270
-
271
- ### List all sessions
272
- - \`/sessions\` \u2014 Shows all sessions with status (active, finished, error)
273
-
274
- ### Cancel
275
- - \`/cancel\` in a session topic \u2014 cancels that session
276
- - Ask the Assistant: "Cancel the stuck session"
277
-
278
- ### Cleanup
279
- - From \`/sessions\` \u2192 tap cleanup buttons (finished, errors, all)
280
- - Ask the Assistant: "Clean up old sessions"
281
-
282
- ---
283
-
284
- ## Assistant Topic
285
-
286
- The Assistant is an always-on AI helper in its own topic. It can:
287
- - Answer questions about OpenACP
288
- - Create sessions for you
289
- - Check status and health
290
- - Cancel sessions
291
- - Clean up old sessions
292
- - Troubleshoot issues
293
- - Manage configuration
294
-
295
- Just chat naturally: "How do I create a session?", "What's the status?", "Something is stuck"
296
-
297
- ### Clear history
298
- \`/clear\` in the Assistant topic \u2014 resets the conversation
299
-
300
- ---
301
-
302
- ## System Commands
303
-
304
- | Command | Where | What it does |
305
- |---------|-------|-------------|
306
- | \`/new [agent] [path]\` | Anywhere | Create new session |
307
- | \`/newchat\` | Session topic | New session, same agent + folder |
308
- | \`/cancel\` | Session topic | Cancel current session |
309
- | \`/status\` | Anywhere | Show status |
310
- | \`/sessions\` | Anywhere | List all sessions |
311
- | \`/agents\` | Anywhere | Browse & install agents from ACP Registry |
312
- | \`/install <name>\` | Anywhere | Install an agent |
313
- | \`/enable_dangerous\` | Session topic | Auto-approve all permissions |
314
- | \`/disable_dangerous\` | Session topic | Restore permission prompts |
315
- | \`/handoff\` | Session topic | Transfer session to terminal |
316
- | \`/clear\` | Assistant topic | Clear assistant history |
317
- | \`/menu\` | Anywhere | Show action menu |
318
- | \`/help\` | Anywhere | Show help |
319
- | \`/restart\` | Anywhere | Restart OpenACP |
320
- | \`/update\` | Anywhere | Update to latest version |
321
- | \`/integrate\` | Anywhere | Manage agent integrations |
322
-
323
- ---
324
-
325
- ## Menu Buttons
326
-
327
- | Button | Action |
328
- |--------|--------|
329
- | \u{1F195} New Session | Create new session (interactive) |
330
- | \u{1F4CB} Sessions | List all sessions with cleanup options |
331
- | \u{1F4CA} Status | Show active/total session count |
332
- | \u{1F916} Agents | List available agents |
333
- | \u{1F517} Integrate | Manage agent integrations |
334
- | \u2753 Help | Show help text |
335
- | \u{1F504} Restart | Restart OpenACP |
336
- | \u2B06\uFE0F Update | Check and install updates |
337
-
338
- ---
339
-
340
- ## CLI Commands
341
-
342
- ### Server
343
- - \`openacp\` \u2014 Start (uses configured mode: foreground or daemon)
344
- - \`openacp start\` \u2014 Start as background daemon
345
- - \`openacp stop\` \u2014 Stop daemon
346
- - \`openacp status\` \u2014 Show daemon status
347
- - \`openacp logs\` \u2014 Tail daemon logs
348
- - \`openacp --foreground\` \u2014 Force foreground mode (useful for debugging or containers)
349
-
350
- ### Auto-start (run on boot)
351
- - macOS: installs a LaunchAgent in \`~/Library/LaunchAgents/\`
352
- - Linux: installs a systemd user service in \`~/.config/systemd/user/\`
353
- - Enabled automatically when you start the daemon. Remove with \`openacp stop\`.
354
-
355
- ### Configuration
356
- - \`openacp config\` \u2014 Interactive config editor
357
- - \`openacp reset\` \u2014 Delete all data and start fresh
358
-
359
- ### Agent Management (CLI)
360
- - \`openacp agents\` \u2014 List all agents (installed + available from ACP Registry)
361
- - \`openacp agents install <name>\` \u2014 Install an agent
362
- - \`openacp agents uninstall <name>\` \u2014 Remove an agent
363
- - \`openacp agents info <name>\` \u2014 Show details, dependencies, and setup guide
364
- - \`openacp agents run <name> [-- args]\` \u2014 Run agent CLI directly (for login, config, etc.)
365
- - \`openacp agents refresh\` \u2014 Force-refresh registry cache
366
-
367
- ### Plugins
368
- - \`openacp install <package>\` \u2014 Install adapter plugin
369
- - \`openacp uninstall <package>\` \u2014 Remove adapter plugin
370
- - \`openacp plugins\` \u2014 List installed plugins
371
-
372
- ### Integration
373
- - \`openacp integrate <agent>\` \u2014 Install agent integration (e.g., Claude handoff skill)
374
- - \`openacp integrate <agent> --uninstall\` \u2014 Remove integration
375
-
376
- ### API (requires running daemon)
377
- \`openacp api <command>\` \u2014 Interact with running daemon:
378
-
379
- | Command | Description |
380
- |---------|-------------|
381
- | \`status\` | List active sessions |
382
- | \`session <id>\` | Session details |
383
- | \`new <agent> <path>\` | Create session |
384
- | \`send <id> "text"\` | Send prompt |
385
- | \`cancel <id>\` | Cancel session |
386
- | \`dangerous <id> on/off\` | Toggle dangerous mode |
387
- | \`topics [--status x,y]\` | List topics |
388
- | \`delete-topic <id> [--force]\` | Delete topic |
389
- | \`cleanup [--status x,y]\` | Cleanup old topics |
390
- | \`agents\` | List agents |
391
- | \`health\` | System health |
392
- | \`config\` | Show config |
393
- | \`config set <key> <value>\` | Update config |
394
- | \`adapters\` | List adapters |
395
- | \`tunnel\` | Tunnel status |
396
- | \`notify "message"\` | Send notification |
397
- | \`version\` | Daemon version |
398
- | \`restart\` | Restart daemon |
399
-
400
- ---
401
-
402
- ## File Viewer (Tunnel)
403
-
404
- When tunnel is enabled, file edits and diffs get "View" buttons that open in your browser:
405
- - **Monaco Editor** \u2014 Full VS Code editor with syntax highlighting
406
- - **Diff viewer** \u2014 Side-by-side or inline comparison
407
- - **Line highlighting** \u2014 Click lines to highlight
408
- - Dark/light theme toggle
409
-
410
- ### Setup
411
- Enable in config: set \`tunnel.enabled\` to \`true\`.
412
- Providers: Cloudflare (default, free), ngrok, bore, Tailscale Funnel.
413
-
414
- ### Port Tunneling
415
-
416
- Expose any local port (dev servers, APIs, etc.) to the internet:
417
-
418
- **CLI commands** (agent can call these directly):
419
- - \`openacp tunnel add <port> --label <name>\` \u2014 Create tunnel to a local port
420
- - \`openacp tunnel list\` \u2014 List active tunnels
421
- - \`openacp tunnel stop <port>\` \u2014 Stop a tunnel
422
- - \`openacp tunnel stop-all\` \u2014 Stop all user tunnels
423
-
424
- **Telegram commands**:
425
- - \`/tunnel <port> [label]\` \u2014 Create tunnel
426
- - \`/tunnels\` \u2014 List active tunnels
427
- - \`/tunnel stop <port>\` \u2014 Stop tunnel
428
-
429
- Example: after starting a dev server on port 3000, run \`openacp tunnel add 3000 --label my-app\` to get a public URL.
430
-
431
- ---
432
-
433
- ## Configuration
434
-
435
- Config file: \`~/.openacp/config.json\`
436
-
437
- ### Channels
438
- - **channels.telegram.botToken** \u2014 Your Telegram bot token
439
- - **channels.telegram.chatId** \u2014 Your Telegram supergroup ID
440
- - **channels.discord.botToken** \u2014 Your Discord bot token
441
- - **channels.discord.guildId** \u2014 Your Discord server (guild) ID
442
-
443
- ### Agents
444
- - **defaultAgent** \u2014 Which agent to use by default
445
- - Agents are managed via \`/agents\` (Telegram) or \`openacp agents\` (CLI)
446
- - Installed agents are stored in \`~/.openacp/agents.json\`
447
- - Agent list is fetched from the ACP Registry CDN and cached locally (24h)
448
-
449
- ### Workspace
450
- - **workspace.baseDir** \u2014 Base directory for project folders (default: \`~/openacp-workspace\`)
451
-
452
- ### Security
453
- - **security.allowedUserIds** \u2014 Restrict who can use the bot (empty = everyone)
454
- - **security.maxConcurrentSessions** \u2014 Max parallel sessions (default: 5)
455
- - **security.sessionTimeoutMinutes** \u2014 Auto-cancel idle sessions (default: 60)
456
-
457
- ### Tunnel / File Viewer
458
- - **tunnel.enabled** \u2014 Enable file viewer tunnel
459
- - **tunnel.provider** \u2014 Tunnel provider: cloudflare (default, free), ngrok, bore, tailscale
460
- - **tunnel.port** \u2014 Local port for tunnel server (default: 3100)
461
- - **tunnel.auth.enabled** \u2014 Enable authentication for tunnel URLs
462
- - **tunnel.auth.token** \u2014 Auth token for tunnel access
463
- - **tunnel.storeTtlMinutes** \u2014 How long viewer links stay cached (default: 60)
464
-
465
- ### Logging
466
- - **logging.level** \u2014 Log level: silent, debug, info, warn, error, fatal (default: info)
467
- - **logging.logDir** \u2014 Log directory (default: \`~/.openacp/logs\`)
468
- - **logging.maxFileSize** \u2014 Max log file size before rotation
469
- - **logging.maxFiles** \u2014 Max number of rotated log files
470
- - **logging.sessionLogRetentionDays** \u2014 Auto-delete old session logs (default: 30)
471
-
472
- ### Data Retention
473
- - **sessionStore.ttlDays** \u2014 How long session records persist (default: 30). Old records are cleaned up automatically.
474
-
475
- ### Environment variables
476
- Override config with env vars:
477
- - \`OPENACP_TELEGRAM_BOT_TOKEN\`
478
- - \`OPENACP_TELEGRAM_CHAT_ID\`
479
- - \`OPENACP_DISCORD_BOT_TOKEN\`
480
- - \`OPENACP_DISCORD_GUILD_ID\`
481
- - \`OPENACP_DEFAULT_AGENT\`
482
- - \`OPENACP_RUN_MODE\` \u2014 foreground or daemon
483
- - \`OPENACP_API_PORT\` \u2014 API server port (default: 21420)
484
- - \`OPENACP_TUNNEL_ENABLED\`
485
- - \`OPENACP_TUNNEL_PORT\`
486
- - \`OPENACP_TUNNEL_PROVIDER\`
487
- - \`OPENACP_LOG_LEVEL\`
488
- - \`OPENACP_LOG_DIR\`
489
- - \`OPENACP_DEBUG\` \u2014 Sets log level to debug
490
-
491
- ---
492
-
493
- ## Troubleshooting
494
-
495
- ### Session stuck / not responding
496
- - Check status: ask Assistant "Is anything stuck?"
497
- - Cancel and create new: \`/cancel\` then \`/new\`
498
- - Check system health: Assistant can run health check
499
-
500
- ### Agent not found
501
- - Check available agents: \`/agents\` or \`openacp agents\`
502
- - Install missing agent: \`openacp agents install <name>\`
503
- - Some agents need login first: \`openacp agents info <name>\` to see setup steps
504
- - Run agent CLI for setup: \`openacp agents run <name> -- <args>\`
505
-
506
- ### Permission request not showing
507
- - Check Notifications topic for the alert
508
- - Try \`/enable_dangerous\` to auto-approve (if you trust the agent)
509
-
510
- ### Session disappeared after restart
511
- - Sessions persist across restarts
512
- - Send a message in the old topic \u2014 it auto-resumes
513
- - If topic was deleted, the session record may still exist in status
514
-
515
- ### Bot not responding at all
516
- - Check daemon: \`openacp status\`
517
- - Check logs: \`openacp logs\`
518
- - Restart: \`openacp start\` or \`/restart\`
519
-
520
- ### Messages going to wrong topic
521
- - Each session is bound to a specific topic/thread
522
- - If you see messages appearing in the Assistant topic instead of the session topic, try creating a new session
523
-
524
- ### Viewing logs
525
- - Session-specific logs: \`~/.openacp/logs/sessions/\`
526
- - System logs: \`openacp logs\` to tail live
527
- - Set \`OPENACP_DEBUG=true\` for verbose output
528
-
529
- ---
530
-
531
- ## Data & Storage
532
-
533
- All data is stored in \`~/.openacp/\`:
534
- - \`config.json\` \u2014 Configuration
535
- - \`agents.json\` \u2014 Installed agents (managed by AgentCatalog)
536
- - \`registry-cache.json\` \u2014 Cached ACP Registry data (refreshes every 24h)
537
- - \`agents/\` \u2014 Downloaded binary agents
538
- - \`sessions/\` \u2014 Session records and state
539
- - \`topics/\` \u2014 Topic-to-session mappings
540
- - \`logs/\` \u2014 System and session logs
541
- - \`plugins/\` \u2014 Installed adapter plugins
542
- - \`openacp.pid\` \u2014 Daemon PID file
543
-
544
- Session records auto-cleanup: 30 days (configurable via \`sessionStore.ttlDays\`).
545
- Session logs auto-cleanup: 30 days (configurable via \`logging.sessionLogRetentionDays\`).
546
- `;
547
-
548
- export {
549
- PRODUCT_GUIDE,
550
- SendQueue,
551
- ToolCallTracker
552
- };
553
- //# sourceMappingURL=chunk-5ZOFBTOR.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/core/adapter-primitives/primitives/send-queue.ts","../../src/core/adapter-primitives/primitives/tool-call-tracker.ts","../../src/data/product-guide.ts"],"sourcesContent":["export type QueueItemType = 'text' | 'other'\n\nexport interface SendQueueConfig {\n minInterval: number\n categoryIntervals?: Record<string, number>\n onRateLimited?: () => void\n onError?: (error: Error) => void\n}\n\nexport interface EnqueueOptions {\n type?: QueueItemType\n key?: string\n category?: string\n}\n\ninterface QueueItem<T = unknown> {\n fn: () => Promise<T>\n type: QueueItemType\n key?: string\n category?: string\n resolve: (value: T | undefined) => void\n reject: (err: unknown) => void\n promise: Promise<T | undefined>\n}\n\nexport class SendQueue {\n private items: QueueItem[] = []\n private processing = false\n private lastExec = 0\n private lastCategoryExec = new Map<string, number>()\n\n constructor(private config: SendQueueConfig) {}\n\n get pending(): number {\n return this.items.length\n }\n\n enqueue<T>(\n fn: () => Promise<T>,\n opts?: EnqueueOptions,\n ): Promise<T | undefined> {\n const type = opts?.type ?? 'other'\n const key = opts?.key\n const category = opts?.category\n\n let resolve!: (value: T | undefined) => void\n let reject!: (err: unknown) => void\n const promise = new Promise<T | undefined>((res, rej) => {\n resolve = res\n reject = rej\n })\n // Suppress unhandled rejection — callers are expected to handle via .catch or await\n promise.catch(() => {})\n\n if (type === 'text' && key) {\n const idx = this.items.findIndex(\n (item) => item.type === 'text' && item.key === key,\n )\n if (idx !== -1) {\n this.items[idx].resolve(undefined)\n this.items[idx] = { fn, type, key, category, resolve, reject, promise } as QueueItem\n this.scheduleProcess()\n return promise\n }\n }\n\n this.items.push({ fn, type, key, category, resolve, reject, promise } as QueueItem)\n this.scheduleProcess()\n return promise\n }\n\n onRateLimited(): void {\n this.config.onRateLimited?.()\n const remaining: QueueItem[] = []\n for (const item of this.items) {\n if (item.type === 'text') {\n item.resolve(undefined)\n } else {\n remaining.push(item)\n }\n }\n this.items = remaining\n }\n\n clear(): void {\n for (const item of this.items) {\n item.resolve(undefined)\n }\n this.items = []\n }\n\n private scheduleProcess(): void {\n if (this.processing) return\n if (this.items.length === 0) return\n\n const item = this.items[0]\n const interval = this.getInterval(item.category)\n const lastExec = item.category\n ? this.lastCategoryExec.get(item.category) ?? 0\n : this.lastExec\n const elapsed = Date.now() - lastExec\n const delay = Math.max(0, interval - elapsed)\n\n this.processing = true\n setTimeout(() => void this.processNext(), delay)\n }\n\n private getInterval(category?: string): number {\n if (category && this.config.categoryIntervals?.[category] != null) {\n return this.config.categoryIntervals[category]\n }\n return this.config.minInterval\n }\n\n private async processNext(): Promise<void> {\n const item = this.items.shift()\n if (!item) {\n this.processing = false\n return\n }\n\n try {\n const result = await item.fn()\n item.resolve(result)\n } catch (err) {\n this.config.onError?.(err instanceof Error ? err : new Error(String(err)))\n item.reject(err)\n } finally {\n const now = Date.now()\n this.lastExec = now\n if (item.category) {\n this.lastCategoryExec.set(item.category, now)\n }\n this.processing = false\n this.scheduleProcess()\n }\n }\n}\n","import type { ToolCallMeta } from '../format-types.js'\n\nexport interface TrackedToolCall extends ToolCallMeta {\n messageId: string\n}\n\nexport class ToolCallTracker {\n private sessions = new Map<string, Map<string, TrackedToolCall>>()\n\n track(sessionId: string, meta: ToolCallMeta, messageId: string): void {\n if (!this.sessions.has(sessionId)) {\n this.sessions.set(sessionId, new Map())\n }\n this.sessions.get(sessionId)!.set(meta.id, { ...meta, messageId })\n }\n\n update(\n sessionId: string,\n toolId: string,\n status: string,\n patch?: Partial<Pick<ToolCallMeta, 'viewerLinks' | 'viewerFilePath' | 'name' | 'kind'>>,\n ): TrackedToolCall | null {\n const tool = this.sessions.get(sessionId)?.get(toolId)\n if (!tool) return null\n\n tool.status = status\n if (patch?.viewerLinks) tool.viewerLinks = patch.viewerLinks\n if (patch?.viewerFilePath) tool.viewerFilePath = patch.viewerFilePath\n if (patch?.name) tool.name = patch.name\n if (patch?.kind) tool.kind = patch.kind\n\n return tool\n }\n\n getActive(sessionId: string): TrackedToolCall[] {\n const session = this.sessions.get(sessionId)\n return session ? [...session.values()] : []\n }\n\n clear(sessionId: string): void {\n this.sessions.delete(sessionId)\n }\n\n clearAll(): void {\n this.sessions.clear()\n }\n}\n","/**\n * OpenACP Product Guide — comprehensive reference for the AI assistant.\n * The assistant reads this at runtime to answer user questions about features.\n */\nexport const PRODUCT_GUIDE = `\n# OpenACP — Product Guide\n\nOpenACP lets you chat with AI coding agents (like Claude Code) through messaging platforms (Telegram, Discord).\nYou type messages in your chat platform, the agent reads/writes/runs code in your project folder, and results stream back in real time.\n\n---\n\n## Quick Start\n\n1. Start OpenACP: \\`openacp\\` (or \\`openacp start\\` for background daemon)\n2. Open your messaging platform (Telegram group or Discord server) — you'll see the Assistant topic/thread\n3. Tap/click 🆕 New Session or type /new\n4. Pick an agent and a project folder\n5. Chat in the session topic/thread — the agent works on your code\n\n---\n\n## Core Concepts\n\n### Sessions\nA session = one conversation with one AI agent working in one project folder.\nEach session gets its own topic (Telegram) or forum thread (Discord). Chat there to give instructions to the agent.\n\n### Agents\nAn agent is an AI coding tool (e.g., Claude Code, Gemini, Cursor, Codex, etc.).\nOpenACP supports 28+ agents from the official ACP Registry (agentclientprotocol.com).\nYou can install multiple agents and choose which one to use per session.\nThe default agent is used when you don't specify one.\n\n### Agent Management\n- Browse agents: \\`/agents\\` in your chat platform or \\`openacp agents\\` in CLI\n- Install: tap the install button in /agents, or \\`openacp agents install <name>\\`\n- Uninstall: \\`openacp agents uninstall <name>\\`\n- Setup/login: \\`openacp agents run <name> -- <args>\\` (e.g., \\`openacp agents run gemini -- auth login\\`)\n- Details: \\`openacp agents info <name>\\` shows version, dependencies, and setup steps\n\nSome agents need additional setup before they can be used:\n- Claude: requires \\`claude login\\`\n- Gemini: requires \\`openacp agents run gemini -- auth login\\`\n- Codex: requires setting \\`OPENAI_API_KEY\\` environment variable\n- GitHub Copilot: requires \\`openacp agents run copilot -- auth login\\`\n\nAgents are installed in three ways depending on the agent:\n- **npx** — Node.js agents, downloaded automatically on first use\n- **uvx** — Python agents, downloaded automatically on first use\n- **binary** — Platform-specific binaries, downloaded to \\`~/.openacp/agents/\\`\n\n### Project Folder (Workspace)\nThe directory where the agent reads, writes, and runs code.\nWhen creating a session, you choose which folder the agent works in.\nYou can type a full path like \\`~/code/my-project\\` or just a name like \\`my-project\\` (it becomes \\`<base-dir>/my-project\\`).\n\n### System Topics\n- **Assistant** — Always-on helper that can answer questions, create sessions, check status, troubleshoot\n- **Notifications** — System alerts (permission requests, session errors, completions)\n\n---\n\n## Creating Sessions\n\n### From menu\nTap 🆕 New Session → choose agent (if multiple) → choose project folder → confirm\n\n### From command\n- \\`/new\\` — Interactive flow (asks agent + folder)\n- \\`/new claude ~/code/my-project\\` — Create directly with specific agent and folder\n\n### From Assistant topic\nJust ask: \"Create a session for my-project with claude\" — the assistant handles it\n\n### Quick new chat\n\\`/newchat\\` in a session topic — creates new session with same agent and folder as current one\n\n---\n\n## Working with Sessions\n\n### Chat\nType messages in the session topic. The agent responds with code changes, explanations, tool outputs.\n\n### What you see while the agent works\n- **💭 Thinking indicator** — Shows when the agent is reasoning, with elapsed time\n- **Text responses** — Streamed in real time, updated every few seconds\n- **Tool calls** — When the agent runs commands or edits files, you see tool name, input, status, and output\n- **📋 Plan card** — Visual task progress with completed/in-progress/pending items and progress bar\n- **\"View File\" / \"View Diff\" buttons** — Opens in browser with Monaco editor (requires tunnel)\n\n### Session lifecycle\n1. **Creating** — Topic created, agent spawning\n2. **Warming up** — Agent primes its cache (happens automatically, invisible to you)\n3. **Active** — Ready for your messages\n4. **Auto-naming** — After your first message, the session gets a descriptive name (agent summarizes in ~5 words). The topic title updates automatically.\n5. **Finished/Error** — Session completed or hit an error\n\n### Agent skills\nSome agents provide slash commands (e.g., /compact, /review). Available skills are pinned in the session topic.\n\n### Permission requests\nWhen the agent wants to run a command, it asks for permission.\nYou see buttons: ✅ Allow, ❌ Reject (and sometimes \"Always Allow\").\nA notification also appears in the Notifications topic with a link to the request.\n\n### Dangerous mode\nAuto-approves ALL permission requests — the agent runs any command without asking.\n- Enable: \\`/enable_dangerous\\` or tap the ☠️ button in the session\n- Disable: \\`/disable_dangerous\\` or tap the 🔐 button\n- ⚠️ Use with caution — the agent can execute anything\n\n### Session timeout\nIdle sessions are automatically cancelled after a configurable timeout (default: 60 minutes).\nConfigure via \\`security.sessionTimeoutMinutes\\` in config.\n\n---\n\n## Session Transfer (Handoff)\n\n### Chat → Terminal\n1. Type \\`/handoff\\` in a session topic/thread\n2. You get a command like \\`claude --resume <SESSION_ID>\\`\n3. Copy and run it in your terminal — the session continues there with full conversation history\n\n### Terminal → Chat\n1. First time: run \\`openacp integrate claude\\` to install the handoff skill (one-time setup)\n2. In Claude Code, use the /openacp:handoff slash command\n3. The session appears as a new topic/thread and you can continue chatting there\n\n### How it works\n- The agent session ID is shared between platforms\n- Conversation history is preserved — pick up where you left off\n- The agent that supports resume (e.g., Claude with \\`--resume\\`) handles the actual transfer\n\n---\n\n## Managing Sessions\n\n### Status\n- \\`/status\\` — Shows active sessions count and details\n- Ask the Assistant: \"What sessions are running?\"\n\n### List all sessions\n- \\`/sessions\\` — Shows all sessions with status (active, finished, error)\n\n### Cancel\n- \\`/cancel\\` in a session topic — cancels that session\n- Ask the Assistant: \"Cancel the stuck session\"\n\n### Cleanup\n- From \\`/sessions\\` → tap cleanup buttons (finished, errors, all)\n- Ask the Assistant: \"Clean up old sessions\"\n\n---\n\n## Assistant Topic\n\nThe Assistant is an always-on AI helper in its own topic. It can:\n- Answer questions about OpenACP\n- Create sessions for you\n- Check status and health\n- Cancel sessions\n- Clean up old sessions\n- Troubleshoot issues\n- Manage configuration\n\nJust chat naturally: \"How do I create a session?\", \"What's the status?\", \"Something is stuck\"\n\n### Clear history\n\\`/clear\\` in the Assistant topic — resets the conversation\n\n---\n\n## System Commands\n\n| Command | Where | What it does |\n|---------|-------|-------------|\n| \\`/new [agent] [path]\\` | Anywhere | Create new session |\n| \\`/newchat\\` | Session topic | New session, same agent + folder |\n| \\`/cancel\\` | Session topic | Cancel current session |\n| \\`/status\\` | Anywhere | Show status |\n| \\`/sessions\\` | Anywhere | List all sessions |\n| \\`/agents\\` | Anywhere | Browse & install agents from ACP Registry |\n| \\`/install <name>\\` | Anywhere | Install an agent |\n| \\`/enable_dangerous\\` | Session topic | Auto-approve all permissions |\n| \\`/disable_dangerous\\` | Session topic | Restore permission prompts |\n| \\`/handoff\\` | Session topic | Transfer session to terminal |\n| \\`/clear\\` | Assistant topic | Clear assistant history |\n| \\`/menu\\` | Anywhere | Show action menu |\n| \\`/help\\` | Anywhere | Show help |\n| \\`/restart\\` | Anywhere | Restart OpenACP |\n| \\`/update\\` | Anywhere | Update to latest version |\n| \\`/integrate\\` | Anywhere | Manage agent integrations |\n\n---\n\n## Menu Buttons\n\n| Button | Action |\n|--------|--------|\n| 🆕 New Session | Create new session (interactive) |\n| 📋 Sessions | List all sessions with cleanup options |\n| 📊 Status | Show active/total session count |\n| 🤖 Agents | List available agents |\n| 🔗 Integrate | Manage agent integrations |\n| ❓ Help | Show help text |\n| 🔄 Restart | Restart OpenACP |\n| ⬆️ Update | Check and install updates |\n\n---\n\n## CLI Commands\n\n### Server\n- \\`openacp\\` — Start (uses configured mode: foreground or daemon)\n- \\`openacp start\\` — Start as background daemon\n- \\`openacp stop\\` — Stop daemon\n- \\`openacp status\\` — Show daemon status\n- \\`openacp logs\\` — Tail daemon logs\n- \\`openacp --foreground\\` — Force foreground mode (useful for debugging or containers)\n\n### Auto-start (run on boot)\n- macOS: installs a LaunchAgent in \\`~/Library/LaunchAgents/\\`\n- Linux: installs a systemd user service in \\`~/.config/systemd/user/\\`\n- Enabled automatically when you start the daemon. Remove with \\`openacp stop\\`.\n\n### Configuration\n- \\`openacp config\\` — Interactive config editor\n- \\`openacp reset\\` — Delete all data and start fresh\n\n### Agent Management (CLI)\n- \\`openacp agents\\` — List all agents (installed + available from ACP Registry)\n- \\`openacp agents install <name>\\` — Install an agent\n- \\`openacp agents uninstall <name>\\` — Remove an agent\n- \\`openacp agents info <name>\\` — Show details, dependencies, and setup guide\n- \\`openacp agents run <name> [-- args]\\` — Run agent CLI directly (for login, config, etc.)\n- \\`openacp agents refresh\\` — Force-refresh registry cache\n\n### Plugins\n- \\`openacp install <package>\\` — Install adapter plugin\n- \\`openacp uninstall <package>\\` — Remove adapter plugin\n- \\`openacp plugins\\` — List installed plugins\n\n### Integration\n- \\`openacp integrate <agent>\\` — Install agent integration (e.g., Claude handoff skill)\n- \\`openacp integrate <agent> --uninstall\\` — Remove integration\n\n### API (requires running daemon)\n\\`openacp api <command>\\` — Interact with running daemon:\n\n| Command | Description |\n|---------|-------------|\n| \\`status\\` | List active sessions |\n| \\`session <id>\\` | Session details |\n| \\`new <agent> <path>\\` | Create session |\n| \\`send <id> \"text\"\\` | Send prompt |\n| \\`cancel <id>\\` | Cancel session |\n| \\`dangerous <id> on/off\\` | Toggle dangerous mode |\n| \\`topics [--status x,y]\\` | List topics |\n| \\`delete-topic <id> [--force]\\` | Delete topic |\n| \\`cleanup [--status x,y]\\` | Cleanup old topics |\n| \\`agents\\` | List agents |\n| \\`health\\` | System health |\n| \\`config\\` | Show config |\n| \\`config set <key> <value>\\` | Update config |\n| \\`adapters\\` | List adapters |\n| \\`tunnel\\` | Tunnel status |\n| \\`notify \"message\"\\` | Send notification |\n| \\`version\\` | Daemon version |\n| \\`restart\\` | Restart daemon |\n\n---\n\n## File Viewer (Tunnel)\n\nWhen tunnel is enabled, file edits and diffs get \"View\" buttons that open in your browser:\n- **Monaco Editor** — Full VS Code editor with syntax highlighting\n- **Diff viewer** — Side-by-side or inline comparison\n- **Line highlighting** — Click lines to highlight\n- Dark/light theme toggle\n\n### Setup\nEnable in config: set \\`tunnel.enabled\\` to \\`true\\`.\nProviders: Cloudflare (default, free), ngrok, bore, Tailscale Funnel.\n\n### Port Tunneling\n\nExpose any local port (dev servers, APIs, etc.) to the internet:\n\n**CLI commands** (agent can call these directly):\n- \\`openacp tunnel add <port> --label <name>\\` — Create tunnel to a local port\n- \\`openacp tunnel list\\` — List active tunnels\n- \\`openacp tunnel stop <port>\\` — Stop a tunnel\n- \\`openacp tunnel stop-all\\` — Stop all user tunnels\n\n**Telegram commands**:\n- \\`/tunnel <port> [label]\\` — Create tunnel\n- \\`/tunnels\\` — List active tunnels\n- \\`/tunnel stop <port>\\` — Stop tunnel\n\nExample: after starting a dev server on port 3000, run \\`openacp tunnel add 3000 --label my-app\\` to get a public URL.\n\n---\n\n## Configuration\n\nConfig file: \\`~/.openacp/config.json\\`\n\n### Channels\n- **channels.telegram.botToken** — Your Telegram bot token\n- **channels.telegram.chatId** — Your Telegram supergroup ID\n- **channels.discord.botToken** — Your Discord bot token\n- **channels.discord.guildId** — Your Discord server (guild) ID\n\n### Agents\n- **defaultAgent** — Which agent to use by default\n- Agents are managed via \\`/agents\\` (Telegram) or \\`openacp agents\\` (CLI)\n- Installed agents are stored in \\`~/.openacp/agents.json\\`\n- Agent list is fetched from the ACP Registry CDN and cached locally (24h)\n\n### Workspace\n- **workspace.baseDir** — Base directory for project folders (default: \\`~/openacp-workspace\\`)\n\n### Security\n- **security.allowedUserIds** — Restrict who can use the bot (empty = everyone)\n- **security.maxConcurrentSessions** — Max parallel sessions (default: 5)\n- **security.sessionTimeoutMinutes** — Auto-cancel idle sessions (default: 60)\n\n### Tunnel / File Viewer\n- **tunnel.enabled** — Enable file viewer tunnel\n- **tunnel.provider** — Tunnel provider: cloudflare (default, free), ngrok, bore, tailscale\n- **tunnel.port** — Local port for tunnel server (default: 3100)\n- **tunnel.auth.enabled** — Enable authentication for tunnel URLs\n- **tunnel.auth.token** — Auth token for tunnel access\n- **tunnel.storeTtlMinutes** — How long viewer links stay cached (default: 60)\n\n### Logging\n- **logging.level** — Log level: silent, debug, info, warn, error, fatal (default: info)\n- **logging.logDir** — Log directory (default: \\`~/.openacp/logs\\`)\n- **logging.maxFileSize** — Max log file size before rotation\n- **logging.maxFiles** — Max number of rotated log files\n- **logging.sessionLogRetentionDays** — Auto-delete old session logs (default: 30)\n\n### Data Retention\n- **sessionStore.ttlDays** — How long session records persist (default: 30). Old records are cleaned up automatically.\n\n### Environment variables\nOverride config with env vars:\n- \\`OPENACP_TELEGRAM_BOT_TOKEN\\`\n- \\`OPENACP_TELEGRAM_CHAT_ID\\`\n- \\`OPENACP_DISCORD_BOT_TOKEN\\`\n- \\`OPENACP_DISCORD_GUILD_ID\\`\n- \\`OPENACP_DEFAULT_AGENT\\`\n- \\`OPENACP_RUN_MODE\\` — foreground or daemon\n- \\`OPENACP_API_PORT\\` — API server port (default: 21420)\n- \\`OPENACP_TUNNEL_ENABLED\\`\n- \\`OPENACP_TUNNEL_PORT\\`\n- \\`OPENACP_TUNNEL_PROVIDER\\`\n- \\`OPENACP_LOG_LEVEL\\`\n- \\`OPENACP_LOG_DIR\\`\n- \\`OPENACP_DEBUG\\` — Sets log level to debug\n\n---\n\n## Troubleshooting\n\n### Session stuck / not responding\n- Check status: ask Assistant \"Is anything stuck?\"\n- Cancel and create new: \\`/cancel\\` then \\`/new\\`\n- Check system health: Assistant can run health check\n\n### Agent not found\n- Check available agents: \\`/agents\\` or \\`openacp agents\\`\n- Install missing agent: \\`openacp agents install <name>\\`\n- Some agents need login first: \\`openacp agents info <name>\\` to see setup steps\n- Run agent CLI for setup: \\`openacp agents run <name> -- <args>\\`\n\n### Permission request not showing\n- Check Notifications topic for the alert\n- Try \\`/enable_dangerous\\` to auto-approve (if you trust the agent)\n\n### Session disappeared after restart\n- Sessions persist across restarts\n- Send a message in the old topic — it auto-resumes\n- If topic was deleted, the session record may still exist in status\n\n### Bot not responding at all\n- Check daemon: \\`openacp status\\`\n- Check logs: \\`openacp logs\\`\n- Restart: \\`openacp start\\` or \\`/restart\\`\n\n### Messages going to wrong topic\n- Each session is bound to a specific topic/thread\n- If you see messages appearing in the Assistant topic instead of the session topic, try creating a new session\n\n### Viewing logs\n- Session-specific logs: \\`~/.openacp/logs/sessions/\\`\n- System logs: \\`openacp logs\\` to tail live\n- Set \\`OPENACP_DEBUG=true\\` for verbose output\n\n---\n\n## Data & Storage\n\nAll data is stored in \\`~/.openacp/\\`:\n- \\`config.json\\` — Configuration\n- \\`agents.json\\` — Installed agents (managed by AgentCatalog)\n- \\`registry-cache.json\\` — Cached ACP Registry data (refreshes every 24h)\n- \\`agents/\\` — Downloaded binary agents\n- \\`sessions/\\` — Session records and state\n- \\`topics/\\` — Topic-to-session mappings\n- \\`logs/\\` — System and session logs\n- \\`plugins/\\` — Installed adapter plugins\n- \\`openacp.pid\\` — Daemon PID file\n\nSession records auto-cleanup: 30 days (configurable via \\`sessionStore.ttlDays\\`).\nSession logs auto-cleanup: 30 days (configurable via \\`logging.sessionLogRetentionDays\\`).\n`;\n"],"mappings":";AAyBO,IAAM,YAAN,MAAgB;AAAA,EAMrB,YAAoB,QAAyB;AAAzB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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;","names":[]}
@@ -1,23 +0,0 @@
1
- // src/plugins/discord/validators.ts
2
- async function validateDiscordToken(token) {
3
- try {
4
- const res = await fetch("https://discord.com/api/v10/users/@me", {
5
- headers: { Authorization: `Bot ${token}` }
6
- });
7
- if (res.status === 200) {
8
- const data = await res.json();
9
- return { ok: true, username: data.username, id: data.id };
10
- }
11
- if (res.status === 401) {
12
- return { ok: false, error: "Token rejected by Discord (401 Unauthorized)" };
13
- }
14
- return { ok: false, error: `Discord API returned ${res.status}` };
15
- } catch (err) {
16
- return { ok: false, error: err.message };
17
- }
18
- }
19
-
20
- export {
21
- validateDiscordToken
22
- };
23
- //# sourceMappingURL=chunk-6RXVEXF3.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/plugins/discord/validators.ts"],"sourcesContent":["export async function validateDiscordToken(token: string): Promise<\n | { ok: true; username: string; id: string }\n | { ok: false; error: string }\n> {\n try {\n const res = await fetch(\"https://discord.com/api/v10/users/@me\", {\n headers: { Authorization: `Bot ${token}` },\n });\n if (res.status === 200) {\n const data = (await res.json()) as { username: string; id: string };\n return { ok: true, username: data.username, id: data.id };\n }\n if (res.status === 401) {\n return { ok: false, error: \"Token rejected by Discord (401 Unauthorized)\" };\n }\n return { ok: false, error: `Discord API returned ${res.status}` };\n } catch (err) {\n return { ok: false, error: (err as Error).message };\n }\n}\n"],"mappings":";AAAA,eAAsB,qBAAqB,OAGzC;AACA,MAAI;AACF,UAAM,MAAM,MAAM,MAAM,yCAAyC;AAAA,MAC/D,SAAS,EAAE,eAAe,OAAO,KAAK,GAAG;AAAA,IAC3C,CAAC;AACD,QAAI,IAAI,WAAW,KAAK;AACtB,YAAM,OAAQ,MAAM,IAAI,KAAK;AAC7B,aAAO,EAAE,IAAI,MAAM,UAAU,KAAK,UAAU,IAAI,KAAK,GAAG;AAAA,IAC1D;AACA,QAAI,IAAI,WAAW,KAAK;AACtB,aAAO,EAAE,IAAI,OAAO,OAAO,+CAA+C;AAAA,IAC5E;AACA,WAAO,EAAE,IAAI,OAAO,OAAO,wBAAwB,IAAI,MAAM,GAAG;AAAA,EAClE,SAAS,KAAK;AACZ,WAAO,EAAE,IAAI,OAAO,OAAQ,IAAc,QAAQ;AAAA,EACpD;AACF;","names":[]}