@openacp/cli 2026.326.3 → 2026.327.1

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 (72) hide show
  1. package/README.md +2 -2
  2. package/dist/{adapter-77ZCVABT.js → adapter-IZNL6AK2.js} +13 -13
  3. package/dist/{adapter-6ANPBSVU.js → adapter-Z435XYBQ.js} +2 -2
  4. package/dist/{api-server-CHVSUDBX.js → api-server-2I7B3MXR.js} +2 -2
  5. package/dist/{api-server-3PYLRBCN.js → api-server-5VEESFOT.js} +2 -2
  6. package/dist/{chunk-Y64XWMJ4.js → chunk-366FOUJG.js} +2 -2
  7. package/dist/{chunk-WVLDNYOJ.js → chunk-5RO42TWV.js} +2 -2
  8. package/dist/{chunk-UNJUWWQO.js → chunk-5YW56UJK.js} +1 -10
  9. package/dist/chunk-5YW56UJK.js.map +1 -0
  10. package/dist/{chunk-NBFIBGAT.js → chunk-7KGWYNWE.js} +1 -1
  11. package/dist/chunk-CDAUYTVP.js +41 -0
  12. package/dist/chunk-CDAUYTVP.js.map +1 -0
  13. package/dist/{chunk-Q6ZXJTZB.js → chunk-CFM4GJ74.js} +7 -11
  14. package/dist/chunk-CFM4GJ74.js.map +1 -0
  15. package/dist/{chunk-RKB2ZK6S.js → chunk-FDLQ5M6W.js} +17 -136
  16. package/dist/chunk-FDLQ5M6W.js.map +1 -0
  17. package/dist/{chunk-FQEBWOZR.js → chunk-QUXTZU36.js} +45 -126
  18. package/dist/chunk-QUXTZU36.js.map +1 -0
  19. package/dist/{chunk-QSDZDHNS.js → chunk-VO3A2NI4.js} +4 -4
  20. package/dist/{chunk-V5JT5TPD.js → chunk-ZPTM4NGK.js} +2 -2
  21. package/dist/cli.js +145 -46
  22. package/dist/cli.js.map +1 -1
  23. package/dist/{config-editor-HNEKXRLQ.js → config-editor-2GYL2SSZ.js} +2 -2
  24. package/dist/{core-plugins-VEUNFTMB.js → core-plugins-I6UPXQBL.js} +7 -10
  25. package/dist/{discord-NOJQ5PZO.js → discord-DXDTGVGS.js} +2 -2
  26. package/dist/index.d.ts +14 -62
  27. package/dist/index.js +15 -21
  28. package/dist/index.js.map +1 -1
  29. package/dist/{integrate-5C6KSU6D.js → integrate-APK4OEQF.js} +2 -2
  30. package/dist/integrate-APK4OEQF.js.map +1 -0
  31. package/dist/{main-T5WVCCFN.js → main-EJBK65NS.js} +33 -52
  32. package/dist/main-EJBK65NS.js.map +1 -0
  33. package/dist/{new-session-AVQCNXRG.js → new-session-HFO5GHSZ.js} +3 -3
  34. package/dist/plugin-create-LCXXNDK6.js +950 -0
  35. package/dist/plugin-create-LCXXNDK6.js.map +1 -0
  36. package/dist/plugin-search-HQ4WQKOF.js +40 -0
  37. package/dist/plugin-search-HQ4WQKOF.js.map +1 -0
  38. package/dist/{post-upgrade-XLHZ6ZB7.js → post-upgrade-2MG3VUDV.js} +2 -2
  39. package/dist/registry-client-AVGRE4CF.js +8 -0
  40. package/dist/{setup-BAI2F24H.js → setup-N7KT56O7.js} +7 -7
  41. package/dist/{telegram-ZDC3JQF2.js → telegram-QWMJU3A6.js} +2 -2
  42. package/package.json +2 -2
  43. package/dist/chunk-2CX4IEEC.js +0 -124
  44. package/dist/chunk-2CX4IEEC.js.map +0 -1
  45. package/dist/chunk-FQEBWOZR.js.map +0 -1
  46. package/dist/chunk-Q6ZXJTZB.js.map +0 -1
  47. package/dist/chunk-RKB2ZK6S.js.map +0 -1
  48. package/dist/chunk-UNJUWWQO.js.map +0 -1
  49. package/dist/chunk-WAAD23KY.js +0 -222
  50. package/dist/chunk-WAAD23KY.js.map +0 -1
  51. package/dist/integrate-5C6KSU6D.js.map +0 -1
  52. package/dist/main-T5WVCCFN.js.map +0 -1
  53. package/dist/plugin-create-LYF5PP5W.js +0 -327
  54. package/dist/plugin-create-LYF5PP5W.js.map +0 -1
  55. package/dist/usage-WYNK6ZC5.js +0 -10
  56. /package/dist/{adapter-77ZCVABT.js.map → adapter-IZNL6AK2.js.map} +0 -0
  57. /package/dist/{adapter-6ANPBSVU.js.map → adapter-Z435XYBQ.js.map} +0 -0
  58. /package/dist/{api-server-3PYLRBCN.js.map → api-server-2I7B3MXR.js.map} +0 -0
  59. /package/dist/{api-server-CHVSUDBX.js.map → api-server-5VEESFOT.js.map} +0 -0
  60. /package/dist/{chunk-Y64XWMJ4.js.map → chunk-366FOUJG.js.map} +0 -0
  61. /package/dist/{chunk-WVLDNYOJ.js.map → chunk-5RO42TWV.js.map} +0 -0
  62. /package/dist/{chunk-NBFIBGAT.js.map → chunk-7KGWYNWE.js.map} +0 -0
  63. /package/dist/{chunk-QSDZDHNS.js.map → chunk-VO3A2NI4.js.map} +0 -0
  64. /package/dist/{chunk-V5JT5TPD.js.map → chunk-ZPTM4NGK.js.map} +0 -0
  65. /package/dist/{config-editor-HNEKXRLQ.js.map → config-editor-2GYL2SSZ.js.map} +0 -0
  66. /package/dist/{core-plugins-VEUNFTMB.js.map → core-plugins-I6UPXQBL.js.map} +0 -0
  67. /package/dist/{discord-NOJQ5PZO.js.map → discord-DXDTGVGS.js.map} +0 -0
  68. /package/dist/{new-session-AVQCNXRG.js.map → new-session-HFO5GHSZ.js.map} +0 -0
  69. /package/dist/{post-upgrade-XLHZ6ZB7.js.map → post-upgrade-2MG3VUDV.js.map} +0 -0
  70. /package/dist/{telegram-ZDC3JQF2.js.map → registry-client-AVGRE4CF.js.map} +0 -0
  71. /package/dist/{setup-BAI2F24H.js.map → setup-N7KT56O7.js.map} +0 -0
  72. /package/dist/{usage-WYNK6ZC5.js.map → telegram-QWMJU3A6.js.map} +0 -0
@@ -205,43 +205,6 @@ ${bar} ${pct}%`;
205
205
  \u{1F4B0} $${cost.toFixed(2)}`;
206
206
  return text;
207
207
  }
208
- var PERIOD_LABEL = {
209
- today: "Today",
210
- week: "This Week",
211
- month: "This Month",
212
- all: "All Time"
213
- };
214
- function formatUsageReport(summaries, budgetStatus) {
215
- const hasData = summaries.some((s) => s.recordCount > 0);
216
- if (!hasData) {
217
- return "\u{1F4CA} <b>Usage Report</b>\n\nNo usage data yet.";
218
- }
219
- const formatCost = (n) => `$${n.toFixed(2)}`;
220
- const lines = ["\u{1F4CA} <b>Usage Report</b>"];
221
- for (const summary of summaries) {
222
- lines.push("");
223
- lines.push(
224
- `\u2500\u2500 <b>${PERIOD_LABEL[summary.period] ?? summary.period}</b> \u2500\u2500`
225
- );
226
- lines.push(
227
- `\u{1F4B0} ${formatCost(summary.totalCost)} \xB7 \u{1F524} ${formatTokens(summary.totalTokens)} tokens \xB7 \u{1F4CB} ${summary.sessionCount} sessions`
228
- );
229
- if (summary.period === "month" && budgetStatus.budget > 0) {
230
- const bar = progressBar(budgetStatus.used / budgetStatus.budget);
231
- lines.push(
232
- `Budget: ${formatCost(budgetStatus.used)} / ${formatCost(budgetStatus.budget)} (${budgetStatus.percent}%)`
233
- );
234
- lines.push(`${bar} ${budgetStatus.percent}%`);
235
- }
236
- }
237
- return lines.join("\n");
238
- }
239
- function formatSummary(summary, sessionName) {
240
- const header = sessionName ? `\u{1F4CB} <b>Summary \u2014 ${escapeHtml(sessionName)}</b>` : "\u{1F4CB} <b>Session Summary</b>";
241
- return `${header}
242
-
243
- ${escapeHtml(summary)}`;
244
- }
245
208
  function splitMessage2(text, maxLength = 3800) {
246
209
  return splitMessage(text, maxLength);
247
210
  }
@@ -1277,27 +1240,6 @@ function setupSessionCallbacks(bot, core, chatId, systemTopicIds) {
1277
1240
  }
1278
1241
  });
1279
1242
  }
1280
- async function handleUsage(ctx, core) {
1281
- if (!core.usageStore) {
1282
- await ctx.reply("\u{1F4CA} Usage tracking is disabled.", { parse_mode: "HTML" });
1283
- return;
1284
- }
1285
- const rawMatch = ctx.match;
1286
- const period = typeof rawMatch === "string" ? rawMatch.trim().toLowerCase() : "";
1287
- let summaries;
1288
- if (period === "today" || period === "week" || period === "month") {
1289
- summaries = [core.usageStore.query(period)];
1290
- } else {
1291
- summaries = [
1292
- core.usageStore.query("month"),
1293
- core.usageStore.query("week"),
1294
- core.usageStore.query("today")
1295
- ];
1296
- }
1297
- const budgetStatus = core.usageBudget ? core.usageBudget.getStatus() : { status: "ok", used: 0, budget: 0, percent: 0 };
1298
- const text = formatUsageReport(summaries, budgetStatus);
1299
- await ctx.reply(text, { parse_mode: "HTML" });
1300
- }
1301
1243
  async function handleArchive(ctx, core) {
1302
1244
  const threadId = ctx.message?.message_thread_id;
1303
1245
  if (!threadId) return;
@@ -1365,57 +1307,6 @@ async function handleArchiveConfirm(ctx, core, chatId) {
1365
1307
  }
1366
1308
  }
1367
1309
  }
1368
- async function handleSummary(ctx, core) {
1369
- const threadId = ctx.message?.message_thread_id;
1370
- if (!threadId) return;
1371
- const session = core.sessionManager.getSessionByThread("telegram", String(threadId));
1372
- const record = !session ? core.sessionManager.getRecordByThread("telegram", String(threadId)) : void 0;
1373
- const sessionId = session?.id ?? record?.sessionId;
1374
- if (!sessionId) {
1375
- await ctx.reply(
1376
- "\u2139\uFE0F <b>/summary</b> works in session topics \u2014 it asks the agent to summarize the session.\n\nGo to a session topic and type /summary there.",
1377
- { parse_mode: "HTML" }
1378
- );
1379
- return;
1380
- }
1381
- await ctx.replyWithChatAction("typing");
1382
- const result = await core.summarizeSession(sessionId);
1383
- if (result.ok) {
1384
- await ctx.reply(formatSummary(result.summary, session?.name ?? record?.name), { parse_mode: "HTML" });
1385
- } else {
1386
- await ctx.reply(`\u26A0\uFE0F ${escapeHtml(result.error)}`, { parse_mode: "HTML" });
1387
- }
1388
- }
1389
- async function handleSummaryCallback(ctx, core, chatId) {
1390
- const data = ctx.callbackQuery?.data;
1391
- if (!data) return;
1392
- const sessionId = data.replace("sm:summary:", "");
1393
- try {
1394
- await ctx.answerCallbackQuery();
1395
- } catch {
1396
- }
1397
- const session = core.sessionManager.getSession(sessionId);
1398
- const record = !session ? core.sessionManager.getSessionRecord(sessionId) : void 0;
1399
- const threadId = session ? Number(session.threadId) : record?.platform?.topicId ?? 0;
1400
- if (!threadId) return;
1401
- await ctx.api.sendMessage(chatId, "\u{1F4CB} Generating summary...", {
1402
- message_thread_id: threadId,
1403
- parse_mode: "HTML"
1404
- });
1405
- const result = await core.summarizeSession(sessionId);
1406
- const sessionName = session?.name ?? record?.name;
1407
- if (result.ok) {
1408
- await ctx.api.sendMessage(chatId, formatSummary(result.summary, sessionName), {
1409
- message_thread_id: threadId,
1410
- parse_mode: "HTML"
1411
- });
1412
- } else {
1413
- await ctx.api.sendMessage(chatId, `\u26A0\uFE0F ${escapeHtml(result.error)}`, {
1414
- message_thread_id: threadId,
1415
- parse_mode: "HTML"
1416
- });
1417
- }
1418
- }
1419
1310
 
1420
1311
  // src/plugins/telegram/commands/agents.ts
1421
1312
  import { InlineKeyboard as InlineKeyboard4 } from "grammy";
@@ -1619,7 +1510,7 @@ Downloading... ${bar} ${percent}%`, { parse_mode: "HTML" });
1619
1510
  const { getAgentCapabilities } = await import("./agent-dependencies-WS7Z2DFW.js");
1620
1511
  const caps = getAgentCapabilities(result.agentKey);
1621
1512
  if (caps.integration) {
1622
- const { installIntegration } = await import("./integrate-5C6KSU6D.js");
1513
+ const { installIntegration } = await import("./integrate-APK4OEQF.js");
1623
1514
  const intResult = await installIntegration(result.agentKey, caps.integration);
1624
1515
  if (intResult.success) {
1625
1516
  try {
@@ -1689,7 +1580,7 @@ function buildProgressBar(percent) {
1689
1580
  // src/plugins/telegram/commands/integrate.ts
1690
1581
  import { InlineKeyboard as InlineKeyboard5 } from "grammy";
1691
1582
  async function handleIntegrate(ctx, _core) {
1692
- const { listIntegrations } = await import("./integrate-5C6KSU6D.js");
1583
+ const { listIntegrations } = await import("./integrate-APK4OEQF.js");
1693
1584
  const agents = listIntegrations();
1694
1585
  const keyboard = new InlineKeyboard5();
1695
1586
  for (const agent of agents) {
@@ -1722,7 +1613,7 @@ function setupIntegrateCallbacks(bot, core) {
1722
1613
  } catch {
1723
1614
  }
1724
1615
  if (data === "i:back") {
1725
- const { listIntegrations } = await import("./integrate-5C6KSU6D.js");
1616
+ const { listIntegrations } = await import("./integrate-APK4OEQF.js");
1726
1617
  const agents = listIntegrations();
1727
1618
  const keyboard2 = new InlineKeyboard5();
1728
1619
  for (const agent of agents) {
@@ -1742,7 +1633,7 @@ Select an agent to manage its integrations.`,
1742
1633
  const agentMatch = data.match(/^i:agent:(.+)$/);
1743
1634
  if (agentMatch) {
1744
1635
  const agentName2 = agentMatch[1];
1745
- const { getIntegration: getIntegration2 } = await import("./integrate-5C6KSU6D.js");
1636
+ const { getIntegration: getIntegration2 } = await import("./integrate-APK4OEQF.js");
1746
1637
  const integration2 = getIntegration2(agentName2);
1747
1638
  if (!integration2) {
1748
1639
  await ctx.reply(`\u274C No integration available for '${escapeHtml(agentName2)}'.`, { parse_mode: "HTML" });
@@ -1769,7 +1660,7 @@ ${integration2.items.map((i) => `\u2022 <b>${escapeHtml(i.name)}</b> \u2014 ${es
1769
1660
  const action = actionMatch[1];
1770
1661
  const agentName = actionMatch[2];
1771
1662
  const itemId = actionMatch[3];
1772
- const { getIntegration } = await import("./integrate-5C6KSU6D.js");
1663
+ const { getIntegration } = await import("./integrate-APK4OEQF.js");
1773
1664
  const integration = getIntegration(agentName);
1774
1665
  if (!integration) return;
1775
1666
  const item = integration.items.find((i) => i.id === itemId);
@@ -2570,11 +2461,9 @@ function setupCommands(bot, core, chatId, assistant) {
2570
2461
  bot.command("integrate", (ctx) => handleIntegrate(ctx, core));
2571
2462
  bot.command("clear", (ctx) => handleClear(ctx, assistant));
2572
2463
  bot.command("doctor", (ctx) => handleDoctor(ctx));
2573
- bot.command("usage", (ctx) => handleUsage(ctx, core));
2574
2464
  bot.command("tunnel", (ctx) => handleTunnel(ctx, core));
2575
2465
  bot.command("tunnels", (ctx) => handleTunnels(ctx, core));
2576
2466
  bot.command("archive", (ctx) => handleArchive(ctx, core));
2577
- bot.command("summary", (ctx) => handleSummary(ctx, core));
2578
2467
  bot.command("text_to_speech", (ctx) => handleTTS(ctx, core));
2579
2468
  bot.command("verbosity", (ctx) => handleVerbosity(ctx, core));
2580
2469
  bot.command("resume", (ctx) => handleResume(ctx, core, chatId, assistant));
@@ -2599,7 +2488,6 @@ function setupAllCallbacks(bot, core, chatId, systemTopicIds, getAssistantSessio
2599
2488
  );
2600
2489
  });
2601
2490
  bot.callbackQuery(/^ar:/, (ctx) => handleArchiveConfirm(ctx, core, chatId));
2602
- bot.callbackQuery(/^sm:/, (ctx) => handleSummaryCallback(ctx, core, chatId));
2603
2491
  bot.callbackQuery(/^m:/, async (ctx) => {
2604
2492
  const data = ctx.callbackQuery.data;
2605
2493
  try {
@@ -2661,11 +2549,9 @@ var STATIC_COMMANDS = [
2661
2549
  { command: "restart", description: "Restart OpenACP" },
2662
2550
  { command: "update", description: "Update to latest version and restart" },
2663
2551
  { command: "doctor", description: "Run system diagnostics" },
2664
- { command: "usage", description: "View token usage and cost report" },
2665
2552
  { command: "tunnel", description: "Create/stop tunnel for a local port" },
2666
2553
  { command: "tunnels", description: "List active tunnels" },
2667
2554
  { command: "archive", description: "Archive session topic (recreate with clean history)" },
2668
- { command: "summary", description: "Get AI summary of current session" },
2669
2555
  { command: "text_to_speech", description: "Toggle Text to Speech (/text_to_speech on, /text_to_speech off)" },
2670
2556
  { command: "verbosity", description: "Set display verbosity (/verbosity low|medium|high)" },
2671
2557
  { command: "resume", description: "Resume with conversation history from Entire checkpoints" }
@@ -2937,7 +2823,7 @@ openacp api restart # Restart daemon
2937
2823
  - Respond in the same language the user uses.
2938
2824
  - Format responses for Telegram: use <b>bold</b>, <code>code</code>, keep it concise.
2939
2825
  - When you don't know something, check with the relevant \`openacp api\` command first before answering.
2940
- - Talk to users like a helpful assistant, not a CLI manual. Example: "B\u1EA1n c\xF3 2 session \u0111ang ch\u1EA1y. Mu\u1ED1n xem chi ti\u1EBFt kh\xF4ng?" instead of listing commands.
2826
+ - Talk to users like a helpful assistant, not a CLI manual. Example: "You have 2 sessions running. Want to see details?" instead of listing commands.
2941
2827
 
2942
2828
  ## Product Reference
2943
2829
  ${PRODUCT_GUIDE}`;
@@ -4077,7 +3963,12 @@ var TelegramAdapter = class extends MessagingAdapter {
4077
3963
  if (!text?.startsWith("/")) return next();
4078
3964
  const registry = this.core.lifecycleManager?.serviceRegistry?.get("command-registry");
4079
3965
  if (!registry) return next();
4080
- const commandName = text.split(" ")[0].slice(1).split("@")[0];
3966
+ const rawCommand = text.split(" ")[0].slice(1);
3967
+ const atIdx = rawCommand.indexOf("@");
3968
+ if (atIdx !== -1 && rawCommand.slice(atIdx + 1).toLowerCase() !== ctx.me.username.toLowerCase()) {
3969
+ return next();
3970
+ }
3971
+ const commandName = atIdx === -1 ? rawCommand : rawCommand.slice(0, atIdx);
4081
3972
  const def = registry.get(commandName);
4082
3973
  if (!def) return next();
4083
3974
  const chatId = ctx.chat.id;
@@ -4097,9 +3988,10 @@ var TelegramAdapter = class extends MessagingAdapter {
4097
3988
  }
4098
3989
  }
4099
3990
  });
4100
- if (response.type !== "silent") {
4101
- await this.renderCommandResponse(response, chatId, topicId);
3991
+ if (response.type === "silent") {
3992
+ return next();
4102
3993
  }
3994
+ await this.renderCommandResponse(response, chatId, topicId);
4103
3995
  } catch (err) {
4104
3996
  await ctx.reply(`\u26A0\uFE0F Command failed: ${String(err)}`);
4105
3997
  }
@@ -4803,22 +4695,11 @@ Task completed.
4803
4695
 
4804
4696
  <a href="${deepLink}">\u2192 Go to topic</a>`;
4805
4697
  }
4806
- const replyMarkup = notification.type === "completed" ? {
4807
- inline_keyboard: [
4808
- [
4809
- {
4810
- text: "\u{1F4CB} Summary",
4811
- callback_data: `sm:summary:${notification.sessionId}`
4812
- }
4813
- ]
4814
- ]
4815
- } : void 0;
4816
4698
  await this.sendQueue.enqueue(
4817
4699
  () => this.bot.api.sendMessage(this.telegramConfig.chatId, text, {
4818
4700
  message_thread_id: this.notificationTopicId,
4819
4701
  parse_mode: "HTML",
4820
- disable_notification: false,
4821
- reply_markup: replyMarkup
4702
+ disable_notification: false
4822
4703
  })
4823
4704
  );
4824
4705
  }
@@ -4957,4 +4838,4 @@ Task completed.
4957
4838
  export {
4958
4839
  TelegramAdapter
4959
4840
  };
4960
- //# sourceMappingURL=chunk-RKB2ZK6S.js.map
4841
+ //# sourceMappingURL=chunk-FDLQ5M6W.js.map