@openacp/cli 0.5.3 → 0.6.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.
Files changed (90) hide show
  1. package/README.md +40 -14
  2. package/dist/action-detect-6M5GCGAU.js +15 -0
  3. package/dist/admin-IKPS5PFC.js +16 -0
  4. package/dist/agents-55NX3DHM.js +14 -0
  5. package/dist/{api-client-UN7BXQOQ.js → api-client-BH2JFHQW.js} +4 -2
  6. package/dist/{autostart-K73RQZVV.js → autostart-A7JRU4WJ.js} +6 -2
  7. package/dist/chunk-3WPG7GXA.js +134 -0
  8. package/dist/chunk-3WPG7GXA.js.map +1 -0
  9. package/dist/{chunk-6DAZSKE5.js → chunk-437NLISU.js} +2 -2
  10. package/dist/chunk-5NBWM7P6.js +438 -0
  11. package/dist/chunk-5NBWM7P6.js.map +1 -0
  12. package/dist/{chunk-IQIPQTQT.js → chunk-6Q7PZWCL.js} +171 -26
  13. package/dist/chunk-6Q7PZWCL.js.map +1 -0
  14. package/dist/chunk-7G5QKLLF.js +105 -0
  15. package/dist/chunk-7G5QKLLF.js.map +1 -0
  16. package/dist/chunk-AKIU4JBF.js +145 -0
  17. package/dist/chunk-AKIU4JBF.js.map +1 -0
  18. package/dist/{chunk-2Z2XPUD5.js → chunk-DWQKUECJ.js} +12 -2
  19. package/dist/chunk-DWQKUECJ.js.map +1 -0
  20. package/dist/{chunk-KSIQZC3J.js → chunk-EVFJW45N.js} +1 -1
  21. package/dist/chunk-EVFJW45N.js.map +1 -0
  22. package/dist/chunk-H7ZMPBZC.js +203 -0
  23. package/dist/chunk-H7ZMPBZC.js.map +1 -0
  24. package/dist/chunk-I7WC6E5S.js +71 -0
  25. package/dist/chunk-I7WC6E5S.js.map +1 -0
  26. package/dist/{chunk-ECBD5I5R.js → chunk-MHFCZGRW.js} +112 -15
  27. package/dist/chunk-MHFCZGRW.js.map +1 -0
  28. package/dist/{chunk-X6LLG7XN.js → chunk-PMGNLNSH.js} +15 -6
  29. package/dist/chunk-PMGNLNSH.js.map +1 -0
  30. package/dist/chunk-SM3G6UAX.js +122 -0
  31. package/dist/chunk-SM3G6UAX.js.map +1 -0
  32. package/dist/{chunk-K53OZH5Y.js → chunk-SPX7CKWV.js} +76 -2
  33. package/dist/chunk-SPX7CKWV.js.map +1 -0
  34. package/dist/chunk-T22OLSET.js +265 -0
  35. package/dist/chunk-T22OLSET.js.map +1 -0
  36. package/dist/chunk-THBR6OXH.js +62 -0
  37. package/dist/chunk-THBR6OXH.js.map +1 -0
  38. package/dist/{chunk-LCJIPE5S.js → chunk-V2V767XI.js} +58 -440
  39. package/dist/chunk-V2V767XI.js.map +1 -0
  40. package/dist/{chunk-OORPX73T.js → chunk-W3EYKZNQ.js} +17 -2
  41. package/dist/chunk-W3EYKZNQ.js.map +1 -0
  42. package/dist/{chunk-5KYLXEG3.js → chunk-YYQXWA62.js} +52 -9
  43. package/dist/chunk-YYQXWA62.js.map +1 -0
  44. package/dist/cli.js +30 -29
  45. package/dist/cli.js.map +1 -1
  46. package/dist/{config-OH26EIWN.js → config-KF2MQWAP.js} +2 -2
  47. package/dist/config-editor-OTODXUF7.js +12 -0
  48. package/dist/{daemon-VKCONJUY.js → daemon-U6UC7OM4.js} +3 -3
  49. package/dist/discord-SLLKRUP7.js +2034 -0
  50. package/dist/discord-SLLKRUP7.js.map +1 -0
  51. package/dist/doctor-DB5PRQ6D.js +14 -0
  52. package/dist/doctor-DB5PRQ6D.js.map +1 -0
  53. package/dist/doctor-SYWNJFYK.js +9 -0
  54. package/dist/doctor-SYWNJFYK.js.map +1 -0
  55. package/dist/index.d.ts +12 -4
  56. package/dist/index.js +11 -9
  57. package/dist/{main-NEYPQHB4.js → main-M6RH3SS5.js} +30 -22
  58. package/dist/main-M6RH3SS5.js.map +1 -0
  59. package/dist/new-session-DRRP2J7E.js +16 -0
  60. package/dist/new-session-DRRP2J7E.js.map +1 -0
  61. package/dist/session-FVFLBREJ.js +19 -0
  62. package/dist/session-FVFLBREJ.js.map +1 -0
  63. package/dist/settings-LPOLJ6SA.js +12 -0
  64. package/dist/settings-LPOLJ6SA.js.map +1 -0
  65. package/dist/{setup-ZCWGOEAH.js → setup-LI5CKYDK.js} +9 -5
  66. package/dist/setup-LI5CKYDK.js.map +1 -0
  67. package/dist/{version-VC5CPXBX.js → version-ALWGGVKM.js} +2 -2
  68. package/dist/version-ALWGGVKM.js.map +1 -0
  69. package/package.json +2 -1
  70. package/dist/chunk-2Z2XPUD5.js.map +0 -1
  71. package/dist/chunk-5KYLXEG3.js.map +0 -1
  72. package/dist/chunk-ECBD5I5R.js.map +0 -1
  73. package/dist/chunk-IQIPQTQT.js.map +0 -1
  74. package/dist/chunk-K53OZH5Y.js.map +0 -1
  75. package/dist/chunk-KSIQZC3J.js.map +0 -1
  76. package/dist/chunk-LCJIPE5S.js.map +0 -1
  77. package/dist/chunk-OORPX73T.js.map +0 -1
  78. package/dist/chunk-X6LLG7XN.js.map +0 -1
  79. package/dist/config-editor-5TICUK3K.js +0 -12
  80. package/dist/doctor-X6UCE7GQ.js +0 -9
  81. package/dist/main-NEYPQHB4.js.map +0 -1
  82. /package/dist/{api-client-UN7BXQOQ.js.map → action-detect-6M5GCGAU.js.map} +0 -0
  83. /package/dist/{autostart-K73RQZVV.js.map → admin-IKPS5PFC.js.map} +0 -0
  84. /package/dist/{config-OH26EIWN.js.map → agents-55NX3DHM.js.map} +0 -0
  85. /package/dist/{config-editor-5TICUK3K.js.map → api-client-BH2JFHQW.js.map} +0 -0
  86. /package/dist/{daemon-VKCONJUY.js.map → autostart-A7JRU4WJ.js.map} +0 -0
  87. /package/dist/{chunk-6DAZSKE5.js.map → chunk-437NLISU.js.map} +0 -0
  88. /package/dist/{doctor-X6UCE7GQ.js.map → config-KF2MQWAP.js.map} +0 -0
  89. /package/dist/{setup-ZCWGOEAH.js.map → config-editor-OTODXUF7.js.map} +0 -0
  90. /package/dist/{version-VC5CPXBX.js.map → daemon-U6UC7OM4.js.map} +0 -0
@@ -1,6 +1,10 @@
1
+ import {
2
+ ChannelAdapter,
3
+ PRODUCT_GUIDE
4
+ } from "./chunk-5NBWM7P6.js";
1
5
  import {
2
6
  DoctorEngine
3
- } from "./chunk-K53OZH5Y.js";
7
+ } from "./chunk-SPX7CKWV.js";
4
8
  import {
5
9
  buildMenuKeyboard,
6
10
  buildSkillMessages,
@@ -488,9 +492,10 @@ ${stderr}`
488
492
  }
489
493
  async prompt(text, attachments) {
490
494
  const contentBlocks = [{ type: "text", text }];
495
+ const SUPPORTED_IMAGE_MIMES = /* @__PURE__ */ new Set(["image/jpeg", "image/png", "image/gif", "image/webp"]);
491
496
  for (const att of attachments ?? []) {
492
497
  const tooLarge = att.size > 10 * 1024 * 1024;
493
- if (att.type === "image" && this.promptCapabilities?.image && !tooLarge) {
498
+ if (att.type === "image" && this.promptCapabilities?.image && !tooLarge && SUPPORTED_IMAGE_MIMES.has(att.mimeType)) {
494
499
  const data = await fs.promises.readFile(att.filePath);
495
500
  contentBlocks.push({ type: "image", data: data.toString("base64"), mimeType: att.mimeType });
496
501
  } else if (att.type === "audio" && this.promptCapabilities?.audio && !tooLarge) {
@@ -972,7 +977,7 @@ var SessionManager = class {
972
977
  getRecordByThread(channelId, threadId) {
973
978
  return this.store?.findByPlatform(
974
979
  channelId,
975
- (p) => String(p.topicId) === threadId
980
+ (p) => String(p.topicId) === threadId || p.threadId === threadId
976
981
  );
977
982
  }
978
983
  registerSession(session) {
@@ -1715,9 +1720,10 @@ var OpenACPCore = class {
1715
1720
  "Incoming message"
1716
1721
  );
1717
1722
  if (config.security.allowedUserIds.length > 0) {
1718
- if (!config.security.allowedUserIds.includes(message.userId)) {
1723
+ const userId = String(message.userId);
1724
+ if (!config.security.allowedUserIds.includes(userId)) {
1719
1725
  log5.warn(
1720
- { userId: message.userId },
1726
+ { userId },
1721
1727
  "Rejected message from unauthorized user"
1722
1728
  );
1723
1729
  return;
@@ -1814,7 +1820,11 @@ var OpenACPCore = class {
1814
1820
  ...existingRecord?.platform ?? {}
1815
1821
  };
1816
1822
  if (session.threadId) {
1817
- platform.topicId = Number(session.threadId);
1823
+ if (params.channelId === "telegram") {
1824
+ platform.topicId = Number(session.threadId);
1825
+ } else {
1826
+ platform.threadId = session.threadId;
1827
+ }
1818
1828
  }
1819
1829
  await this.sessionManager.patchRecord(session.id, {
1820
1830
  sessionId: session.id,
@@ -2019,26 +2029,12 @@ var OpenACPCore = class {
2019
2029
  }
2020
2030
  };
2021
2031
 
2022
- // src/core/channel.ts
2023
- var ChannelAdapter = class {
2024
- constructor(core, config) {
2025
- this.core = core;
2026
- this.config = config;
2027
- }
2028
- async deleteSessionThread(_sessionId) {
2029
- }
2030
- // Skill commands — override in adapters that support dynamic commands
2031
- async sendSkillCommands(_sessionId, _commands) {
2032
- }
2033
- async cleanupSkillCommands(_sessionId) {
2034
- }
2035
- };
2036
-
2037
2032
  // src/core/api-server.ts
2038
2033
  import * as http from "http";
2039
2034
  import * as fs4 from "fs";
2040
2035
  import * as path5 from "path";
2041
2036
  import * as os2 from "os";
2037
+ import * as crypto from "crypto";
2042
2038
  import { fileURLToPath } from "url";
2043
2039
  var log6 = createChildLogger({ module: "api-server" });
2044
2040
  var DEFAULT_PORT_FILE = path5.join(os2.homedir(), ".openacp", "api.port");
@@ -2071,17 +2067,21 @@ function redactDeep(obj) {
2071
2067
  }
2072
2068
  }
2073
2069
  var ApiServer = class {
2074
- constructor(core, config, portFilePath, topicManager) {
2070
+ constructor(core, config, portFilePath, topicManager, secretFilePath) {
2075
2071
  this.core = core;
2076
2072
  this.config = config;
2077
2073
  this.topicManager = topicManager;
2078
2074
  this.portFilePath = portFilePath ?? DEFAULT_PORT_FILE;
2075
+ this.secretFilePath = secretFilePath ?? path5.join(os2.homedir(), ".openacp", "api-secret");
2079
2076
  }
2080
2077
  server = null;
2081
2078
  actualPort = 0;
2082
2079
  portFilePath;
2083
2080
  startedAt = Date.now();
2081
+ secret = "";
2082
+ secretFilePath;
2084
2083
  async start() {
2084
+ this.loadOrCreateSecret();
2085
2085
  this.server = http.createServer((req, res) => this.handleRequest(req, res));
2086
2086
  await new Promise((resolve2, reject) => {
2087
2087
  this.server.on("error", (err) => {
@@ -2127,9 +2127,42 @@ var ApiServer = class {
2127
2127
  } catch {
2128
2128
  }
2129
2129
  }
2130
+ loadOrCreateSecret() {
2131
+ const dir = path5.dirname(this.secretFilePath);
2132
+ fs4.mkdirSync(dir, { recursive: true });
2133
+ try {
2134
+ this.secret = fs4.readFileSync(this.secretFilePath, "utf-8").trim();
2135
+ if (this.secret) {
2136
+ try {
2137
+ const stat = fs4.statSync(this.secretFilePath);
2138
+ const mode = stat.mode & 511;
2139
+ if (mode & 63) {
2140
+ log6.warn({ path: this.secretFilePath, mode: "0" + mode.toString(8) }, "API secret file has insecure permissions (should be 0600). Run: chmod 600 %s", this.secretFilePath);
2141
+ }
2142
+ } catch {
2143
+ }
2144
+ return;
2145
+ }
2146
+ } catch {
2147
+ }
2148
+ this.secret = crypto.randomBytes(32).toString("hex");
2149
+ fs4.writeFileSync(this.secretFilePath, this.secret, { mode: 384 });
2150
+ }
2151
+ authenticate(req) {
2152
+ const authHeader = req.headers.authorization;
2153
+ if (!authHeader?.startsWith("Bearer ")) return false;
2154
+ const token = authHeader.slice(7);
2155
+ if (token.length !== this.secret.length) return false;
2156
+ return crypto.timingSafeEqual(Buffer.from(token, "utf-8"), Buffer.from(this.secret, "utf-8"));
2157
+ }
2130
2158
  async handleRequest(req, res) {
2131
2159
  const method = req.method?.toUpperCase();
2132
2160
  const url = req.url || "";
2161
+ const isExempt = method === "GET" && (url === "/api/health" || url === "/api/version");
2162
+ if (!isExempt && !this.authenticate(req)) {
2163
+ this.sendJson(res, 401, { error: "Unauthorized" });
2164
+ return;
2165
+ }
2133
2166
  try {
2134
2167
  if (method === "POST" && url === "/api/sessions/adopt") {
2135
2168
  await this.handleAdoptSession(req, res);
@@ -2400,7 +2433,7 @@ var ApiServer = class {
2400
2433
  return;
2401
2434
  }
2402
2435
  target[lastKey] = value;
2403
- const { ConfigSchema } = await import("./config-OH26EIWN.js");
2436
+ const { ConfigSchema } = await import("./config-KF2MQWAP.js");
2404
2437
  const result = ConfigSchema.safeParse(cloned);
2405
2438
  if (!result.success) {
2406
2439
  this.sendJson(res, 400, {
@@ -3048,7 +3081,7 @@ async function handleUpdate(ctx, core) {
3048
3081
  await ctx.reply("\u26A0\uFE0F Update is not available (no restart handler registered).", { parse_mode: "HTML" });
3049
3082
  return;
3050
3083
  }
3051
- const { getCurrentVersion, getLatestVersion, compareVersions, runUpdate } = await import("./version-VC5CPXBX.js");
3084
+ const { getCurrentVersion, getLatestVersion, compareVersions, runUpdate } = await import("./version-ALWGGVKM.js");
3052
3085
  const current = getCurrentVersion();
3053
3086
  const statusMsg = await ctx.reply(`\u{1F50D} Checking for updates... (current: v${escapeHtml(current)})`, { parse_mode: "HTML" });
3054
3087
  const latest = await getLatestVersion();
@@ -4764,420 +4797,6 @@ ${escapeHtml(request.description)}`,
4764
4797
  }
4765
4798
  };
4766
4799
 
4767
- // src/product-guide.ts
4768
- var PRODUCT_GUIDE = `
4769
- # OpenACP \u2014 Product Guide
4770
-
4771
- OpenACP lets you chat with AI coding agents (like Claude Code) through Telegram.
4772
- You type messages in Telegram, the agent reads/writes/runs code in your project folder, and results stream back in real time.
4773
-
4774
- ---
4775
-
4776
- ## Quick Start
4777
-
4778
- 1. Start OpenACP: \`openacp\` (or \`openacp start\` for background daemon)
4779
- 2. Open your Telegram group \u2014 you'll see the Assistant topic
4780
- 3. Tap \u{1F195} New Session or type /new
4781
- 4. Pick an agent and a project folder
4782
- 5. Chat in the session topic \u2014 the agent works on your code
4783
-
4784
- ---
4785
-
4786
- ## Core Concepts
4787
-
4788
- ### Sessions
4789
- A session = one conversation with one AI agent working in one project folder.
4790
- Each session gets its own Telegram topic. Chat there to give instructions to the agent.
4791
-
4792
- ### Agents
4793
- An agent is an AI coding tool (e.g., Claude Code, Gemini, Cursor, Codex, etc.).
4794
- OpenACP supports 28+ agents from the official ACP Registry (agentclientprotocol.com).
4795
- You can install multiple agents and choose which one to use per session.
4796
- The default agent is used when you don't specify one.
4797
-
4798
- ### Agent Management
4799
- - Browse agents: \`/agents\` in Telegram or \`openacp agents\` in CLI
4800
- - Install: tap the install button in /agents, or \`openacp agents install <name>\`
4801
- - Uninstall: \`openacp agents uninstall <name>\`
4802
- - Setup/login: \`openacp agents run <name> -- <args>\` (e.g., \`openacp agents run gemini -- auth login\`)
4803
- - Details: \`openacp agents info <name>\` shows version, dependencies, and setup steps
4804
-
4805
- Some agents need additional setup before they can be used:
4806
- - Claude: requires \`claude login\`
4807
- - Gemini: requires \`openacp agents run gemini -- auth login\`
4808
- - Codex: requires setting \`OPENAI_API_KEY\` environment variable
4809
- - GitHub Copilot: requires \`openacp agents run copilot -- auth login\`
4810
-
4811
- Agents are installed in three ways depending on the agent:
4812
- - **npx** \u2014 Node.js agents, downloaded automatically on first use
4813
- - **uvx** \u2014 Python agents, downloaded automatically on first use
4814
- - **binary** \u2014 Platform-specific binaries, downloaded to \`~/.openacp/agents/\`
4815
-
4816
- ### Project Folder (Workspace)
4817
- The directory where the agent reads, writes, and runs code.
4818
- When creating a session, you choose which folder the agent works in.
4819
- You can type a full path like \`~/code/my-project\` or just a name like \`my-project\` (it becomes \`<base-dir>/my-project\`).
4820
-
4821
- ### System Topics
4822
- - **Assistant** \u2014 Always-on helper that can answer questions, create sessions, check status, troubleshoot
4823
- - **Notifications** \u2014 System alerts (permission requests, session errors, completions)
4824
-
4825
- ---
4826
-
4827
- ## Creating Sessions
4828
-
4829
- ### From menu
4830
- Tap \u{1F195} New Session \u2192 choose agent (if multiple) \u2192 choose project folder \u2192 confirm
4831
-
4832
- ### From command
4833
- - \`/new\` \u2014 Interactive flow (asks agent + folder)
4834
- - \`/new claude ~/code/my-project\` \u2014 Create directly with specific agent and folder
4835
-
4836
- ### From Assistant topic
4837
- Just ask: "Create a session for my-project with claude" \u2014 the assistant handles it
4838
-
4839
- ### Quick new chat
4840
- \`/newchat\` in a session topic \u2014 creates new session with same agent and folder as current one
4841
-
4842
- ---
4843
-
4844
- ## Working with Sessions
4845
-
4846
- ### Chat
4847
- Type messages in the session topic. The agent responds with code changes, explanations, tool outputs.
4848
-
4849
- ### What you see while the agent works
4850
- - **\u{1F4AD} Thinking indicator** \u2014 Shows when the agent is reasoning, with elapsed time
4851
- - **Text responses** \u2014 Streamed in real time, updated every few seconds
4852
- - **Tool calls** \u2014 When the agent runs commands or edits files, you see tool name, input, status, and output
4853
- - **\u{1F4CB} Plan card** \u2014 Visual task progress with completed/in-progress/pending items and progress bar
4854
- - **"View File" / "View Diff" buttons** \u2014 Opens in browser with Monaco editor (requires tunnel)
4855
-
4856
- ### Session lifecycle
4857
- 1. **Creating** \u2014 Topic created, agent spawning
4858
- 2. **Warming up** \u2014 Agent primes its cache (happens automatically, invisible to you)
4859
- 3. **Active** \u2014 Ready for your messages
4860
- 4. **Auto-naming** \u2014 After your first message, the session gets a descriptive name (agent summarizes in ~5 words). The topic title updates automatically.
4861
- 5. **Finished/Error** \u2014 Session completed or hit an error
4862
-
4863
- ### Agent skills
4864
- Some agents provide slash commands (e.g., /compact, /review). Available skills are pinned in the session topic.
4865
-
4866
- ### Permission requests
4867
- When the agent wants to run a command, it asks for permission.
4868
- You see buttons: \u2705 Allow, \u274C Reject (and sometimes "Always Allow").
4869
- A notification also appears in the Notifications topic with a link to the request.
4870
-
4871
- ### Dangerous mode
4872
- Auto-approves ALL permission requests \u2014 the agent runs any command without asking.
4873
- - Enable: \`/enable_dangerous\` or tap the \u2620\uFE0F button in the session
4874
- - Disable: \`/disable_dangerous\` or tap the \u{1F510} button
4875
- - \u26A0\uFE0F Use with caution \u2014 the agent can execute anything
4876
-
4877
- ### Session timeout
4878
- Idle sessions are automatically cancelled after a configurable timeout (default: 60 minutes).
4879
- Configure via \`security.sessionTimeoutMinutes\` in config.
4880
-
4881
- ---
4882
-
4883
- ## Session Transfer (Handoff)
4884
-
4885
- ### Telegram \u2192 Terminal
4886
- 1. Type \`/handoff\` in a session topic
4887
- 2. You get a command like \`claude --resume <SESSION_ID>\`
4888
- 3. Copy and run it in your terminal \u2014 the session continues there with full conversation history
4889
-
4890
- ### Terminal \u2192 Telegram
4891
- 1. First time: run \`openacp integrate claude\` to install the handoff skill (one-time setup)
4892
- 2. In Claude Code, use the /openacp:handoff slash command
4893
- 3. The session appears as a new topic in Telegram and you can continue chatting there
4894
-
4895
- ### How it works
4896
- - The agent session ID is shared between platforms
4897
- - Conversation history is preserved \u2014 pick up where you left off
4898
- - The agent that supports resume (e.g., Claude with \`--resume\`) handles the actual transfer
4899
-
4900
- ---
4901
-
4902
- ## Managing Sessions
4903
-
4904
- ### Status
4905
- - \`/status\` \u2014 Shows active sessions count and details
4906
- - Ask the Assistant: "What sessions are running?"
4907
-
4908
- ### List all sessions
4909
- - \`/sessions\` \u2014 Shows all sessions with status (active, finished, error)
4910
-
4911
- ### Cancel
4912
- - \`/cancel\` in a session topic \u2014 cancels that session
4913
- - Ask the Assistant: "Cancel the stuck session"
4914
-
4915
- ### Cleanup
4916
- - From \`/sessions\` \u2192 tap cleanup buttons (finished, errors, all)
4917
- - Ask the Assistant: "Clean up old sessions"
4918
-
4919
- ---
4920
-
4921
- ## Assistant Topic
4922
-
4923
- The Assistant is an always-on AI helper in its own topic. It can:
4924
- - Answer questions about OpenACP
4925
- - Create sessions for you
4926
- - Check status and health
4927
- - Cancel sessions
4928
- - Clean up old sessions
4929
- - Troubleshoot issues
4930
- - Manage configuration
4931
-
4932
- Just chat naturally: "How do I create a session?", "What's the status?", "Something is stuck"
4933
-
4934
- ### Clear history
4935
- \`/clear\` in the Assistant topic \u2014 resets the conversation
4936
-
4937
- ---
4938
-
4939
- ## System Commands
4940
-
4941
- | Command | Where | What it does |
4942
- |---------|-------|-------------|
4943
- | \`/new [agent] [path]\` | Anywhere | Create new session |
4944
- | \`/newchat\` | Session topic | New session, same agent + folder |
4945
- | \`/cancel\` | Session topic | Cancel current session |
4946
- | \`/status\` | Anywhere | Show status |
4947
- | \`/sessions\` | Anywhere | List all sessions |
4948
- | \`/agents\` | Anywhere | Browse & install agents from ACP Registry |
4949
- | \`/install <name>\` | Anywhere | Install an agent |
4950
- | \`/enable_dangerous\` | Session topic | Auto-approve all permissions |
4951
- | \`/disable_dangerous\` | Session topic | Restore permission prompts |
4952
- | \`/handoff\` | Session topic | Transfer session to terminal |
4953
- | \`/clear\` | Assistant topic | Clear assistant history |
4954
- | \`/menu\` | Anywhere | Show action menu |
4955
- | \`/help\` | Anywhere | Show help |
4956
- | \`/restart\` | Anywhere | Restart OpenACP |
4957
- | \`/update\` | Anywhere | Update to latest version |
4958
- | \`/integrate\` | Anywhere | Manage agent integrations |
4959
-
4960
- ---
4961
-
4962
- ## Menu Buttons
4963
-
4964
- | Button | Action |
4965
- |--------|--------|
4966
- | \u{1F195} New Session | Create new session (interactive) |
4967
- | \u{1F4CB} Sessions | List all sessions with cleanup options |
4968
- | \u{1F4CA} Status | Show active/total session count |
4969
- | \u{1F916} Agents | List available agents |
4970
- | \u{1F517} Integrate | Manage agent integrations |
4971
- | \u2753 Help | Show help text |
4972
- | \u{1F504} Restart | Restart OpenACP |
4973
- | \u2B06\uFE0F Update | Check and install updates |
4974
-
4975
- ---
4976
-
4977
- ## CLI Commands
4978
-
4979
- ### Server
4980
- - \`openacp\` \u2014 Start (uses configured mode: foreground or daemon)
4981
- - \`openacp start\` \u2014 Start as background daemon
4982
- - \`openacp stop\` \u2014 Stop daemon
4983
- - \`openacp status\` \u2014 Show daemon status
4984
- - \`openacp logs\` \u2014 Tail daemon logs
4985
- - \`openacp --foreground\` \u2014 Force foreground mode (useful for debugging or containers)
4986
-
4987
- ### Auto-start (run on boot)
4988
- - macOS: installs a LaunchAgent in \`~/Library/LaunchAgents/\`
4989
- - Linux: installs a systemd user service in \`~/.config/systemd/user/\`
4990
- - Enabled automatically when you start the daemon. Remove with \`openacp stop\`.
4991
-
4992
- ### Configuration
4993
- - \`openacp config\` \u2014 Interactive config editor
4994
- - \`openacp reset\` \u2014 Delete all data and start fresh
4995
-
4996
- ### Agent Management (CLI)
4997
- - \`openacp agents\` \u2014 List all agents (installed + available from ACP Registry)
4998
- - \`openacp agents install <name>\` \u2014 Install an agent
4999
- - \`openacp agents uninstall <name>\` \u2014 Remove an agent
5000
- - \`openacp agents info <name>\` \u2014 Show details, dependencies, and setup guide
5001
- - \`openacp agents run <name> [-- args]\` \u2014 Run agent CLI directly (for login, config, etc.)
5002
- - \`openacp agents refresh\` \u2014 Force-refresh registry cache
5003
-
5004
- ### Plugins
5005
- - \`openacp install <package>\` \u2014 Install adapter plugin (e.g., \`@openacp/adapter-discord\`)
5006
- - \`openacp uninstall <package>\` \u2014 Remove adapter plugin
5007
- - \`openacp plugins\` \u2014 List installed plugins
5008
-
5009
- ### Integration
5010
- - \`openacp integrate <agent>\` \u2014 Install agent integration (e.g., Claude handoff skill)
5011
- - \`openacp integrate <agent> --uninstall\` \u2014 Remove integration
5012
-
5013
- ### API (requires running daemon)
5014
- \`openacp api <command>\` \u2014 Interact with running daemon:
5015
-
5016
- | Command | Description |
5017
- |---------|-------------|
5018
- | \`status\` | List active sessions |
5019
- | \`session <id>\` | Session details |
5020
- | \`new <agent> <path>\` | Create session |
5021
- | \`send <id> "text"\` | Send prompt |
5022
- | \`cancel <id>\` | Cancel session |
5023
- | \`dangerous <id> on/off\` | Toggle dangerous mode |
5024
- | \`topics [--status x,y]\` | List topics |
5025
- | \`delete-topic <id> [--force]\` | Delete topic |
5026
- | \`cleanup [--status x,y]\` | Cleanup old topics |
5027
- | \`agents\` | List agents |
5028
- | \`health\` | System health |
5029
- | \`config\` | Show config |
5030
- | \`config set <key> <value>\` | Update config |
5031
- | \`adapters\` | List adapters |
5032
- | \`tunnel\` | Tunnel status |
5033
- | \`notify "message"\` | Send notification |
5034
- | \`version\` | Daemon version |
5035
- | \`restart\` | Restart daemon |
5036
-
5037
- ---
5038
-
5039
- ## File Viewer (Tunnel)
5040
-
5041
- When tunnel is enabled, file edits and diffs get "View" buttons that open in your browser:
5042
- - **Monaco Editor** \u2014 Full VS Code editor with syntax highlighting
5043
- - **Diff viewer** \u2014 Side-by-side or inline comparison
5044
- - **Line highlighting** \u2014 Click lines to highlight
5045
- - Dark/light theme toggle
5046
-
5047
- ### Setup
5048
- Enable in config: set \`tunnel.enabled\` to \`true\`.
5049
- Providers: Cloudflare (default, free), ngrok, bore, Tailscale Funnel.
5050
-
5051
- ### Port Tunneling
5052
-
5053
- Expose any local port (dev servers, APIs, etc.) to the internet:
5054
-
5055
- **CLI commands** (agent can call these directly):
5056
- - \`openacp tunnel add <port> --label <name>\` \u2014 Create tunnel to a local port
5057
- - \`openacp tunnel list\` \u2014 List active tunnels
5058
- - \`openacp tunnel stop <port>\` \u2014 Stop a tunnel
5059
- - \`openacp tunnel stop-all\` \u2014 Stop all user tunnels
5060
-
5061
- **Telegram commands**:
5062
- - \`/tunnel <port> [label]\` \u2014 Create tunnel
5063
- - \`/tunnels\` \u2014 List active tunnels
5064
- - \`/tunnel stop <port>\` \u2014 Stop tunnel
5065
-
5066
- Example: after starting a dev server on port 3000, run \`openacp tunnel add 3000 --label my-app\` to get a public URL.
5067
-
5068
- ---
5069
-
5070
- ## Configuration
5071
-
5072
- Config file: \`~/.openacp/config.json\`
5073
-
5074
- ### Telegram
5075
- - **telegram.botToken** \u2014 Your Telegram bot token
5076
- - **telegram.chatId** \u2014 Your Telegram supergroup ID
5077
-
5078
- ### Agents
5079
- - **defaultAgent** \u2014 Which agent to use by default
5080
- - Agents are managed via \`/agents\` (Telegram) or \`openacp agents\` (CLI)
5081
- - Installed agents are stored in \`~/.openacp/agents.json\`
5082
- - Agent list is fetched from the ACP Registry CDN and cached locally (24h)
5083
-
5084
- ### Workspace
5085
- - **workspace.baseDir** \u2014 Base directory for project folders (default: \`~/openacp-workspace\`)
5086
-
5087
- ### Security
5088
- - **security.allowedUserIds** \u2014 Restrict who can use the bot (empty = everyone)
5089
- - **security.maxConcurrentSessions** \u2014 Max parallel sessions (default: 5)
5090
- - **security.sessionTimeoutMinutes** \u2014 Auto-cancel idle sessions (default: 60)
5091
-
5092
- ### Tunnel / File Viewer
5093
- - **tunnel.enabled** \u2014 Enable file viewer tunnel
5094
- - **tunnel.provider** \u2014 Tunnel provider: cloudflare (default, free), ngrok, bore, tailscale
5095
- - **tunnel.port** \u2014 Local port for tunnel server (default: 3100)
5096
- - **tunnel.auth.enabled** \u2014 Enable authentication for tunnel URLs
5097
- - **tunnel.auth.token** \u2014 Auth token for tunnel access
5098
- - **tunnel.storeTtlMinutes** \u2014 How long viewer links stay cached (default: 60)
5099
-
5100
- ### Logging
5101
- - **logging.level** \u2014 Log level: silent, debug, info, warn, error, fatal (default: info)
5102
- - **logging.logDir** \u2014 Log directory (default: \`~/.openacp/logs\`)
5103
- - **logging.maxFileSize** \u2014 Max log file size before rotation
5104
- - **logging.maxFiles** \u2014 Max number of rotated log files
5105
- - **logging.sessionLogRetentionDays** \u2014 Auto-delete old session logs (default: 30)
5106
-
5107
- ### Data Retention
5108
- - **sessionStore.ttlDays** \u2014 How long session records persist (default: 30). Old records are cleaned up automatically.
5109
-
5110
- ### Environment variables
5111
- Override config with env vars:
5112
- - \`OPENACP_TELEGRAM_BOT_TOKEN\`
5113
- - \`OPENACP_TELEGRAM_CHAT_ID\`
5114
- - \`OPENACP_DEFAULT_AGENT\`
5115
- - \`OPENACP_RUN_MODE\` \u2014 foreground or daemon
5116
- - \`OPENACP_API_PORT\` \u2014 API server port (default: 21420)
5117
- - \`OPENACP_TUNNEL_ENABLED\`
5118
- - \`OPENACP_TUNNEL_PORT\`
5119
- - \`OPENACP_TUNNEL_PROVIDER\`
5120
- - \`OPENACP_LOG_LEVEL\`
5121
- - \`OPENACP_LOG_DIR\`
5122
- - \`OPENACP_DEBUG\` \u2014 Sets log level to debug
5123
-
5124
- ---
5125
-
5126
- ## Troubleshooting
5127
-
5128
- ### Session stuck / not responding
5129
- - Check status: ask Assistant "Is anything stuck?"
5130
- - Cancel and create new: \`/cancel\` then \`/new\`
5131
- - Check system health: Assistant can run health check
5132
-
5133
- ### Agent not found
5134
- - Check available agents: \`/agents\` or \`openacp agents\`
5135
- - Install missing agent: \`openacp agents install <name>\`
5136
- - Some agents need login first: \`openacp agents info <name>\` to see setup steps
5137
- - Run agent CLI for setup: \`openacp agents run <name> -- <args>\`
5138
-
5139
- ### Permission request not showing
5140
- - Check Notifications topic for the alert
5141
- - Try \`/enable_dangerous\` to auto-approve (if you trust the agent)
5142
-
5143
- ### Session disappeared after restart
5144
- - Sessions persist across restarts
5145
- - Send a message in the old topic \u2014 it auto-resumes
5146
- - If topic was deleted, the session record may still exist in status
5147
-
5148
- ### Bot not responding at all
5149
- - Check daemon: \`openacp status\`
5150
- - Check logs: \`openacp logs\`
5151
- - Restart: \`openacp start\` or \`/restart\`
5152
-
5153
- ### Messages going to wrong topic
5154
- - Each session is bound to a specific Telegram topic
5155
- - If you see messages appearing in the Assistant topic instead of the session topic, try creating a new session
5156
-
5157
- ### Viewing logs
5158
- - Session-specific logs: \`~/.openacp/logs/sessions/\`
5159
- - System logs: \`openacp logs\` to tail live
5160
- - Set \`OPENACP_DEBUG=true\` for verbose output
5161
-
5162
- ---
5163
-
5164
- ## Data & Storage
5165
-
5166
- All data is stored in \`~/.openacp/\`:
5167
- - \`config.json\` \u2014 Configuration
5168
- - \`agents.json\` \u2014 Installed agents (managed by AgentCatalog)
5169
- - \`registry-cache.json\` \u2014 Cached ACP Registry data (refreshes every 24h)
5170
- - \`agents/\` \u2014 Downloaded binary agents
5171
- - \`sessions/\` \u2014 Session records and state
5172
- - \`topics/\` \u2014 Topic-to-session mappings
5173
- - \`logs/\` \u2014 System and session logs
5174
- - \`plugins/\` \u2014 Installed adapter plugins
5175
- - \`openacp.pid\` \u2014 Daemon PID file
5176
-
5177
- Session records auto-cleanup: 30 days (configurable via \`sessionStore.ttlDays\`).
5178
- Session logs auto-cleanup: 30 days (configurable via \`logging.sessionLogRetentionDays\`).
5179
- `;
5180
-
5181
4800
  // src/adapters/telegram/assistant.ts
5182
4801
  var log16 = createChildLogger({ module: "telegram-assistant" });
5183
4802
  async function spawnAssistant(core, adapter, assistantTopicId) {
@@ -7012,9 +6631,8 @@ export {
7012
6631
  NotificationManager,
7013
6632
  MessageTransformer,
7014
6633
  OpenACPCore,
7015
- ChannelAdapter,
7016
6634
  ApiServer,
7017
6635
  TopicManager,
7018
6636
  TelegramAdapter
7019
6637
  };
7020
- //# sourceMappingURL=chunk-LCJIPE5S.js.map
6638
+ //# sourceMappingURL=chunk-V2V767XI.js.map