appback-remoteagent 0.13.19 → 0.13.20

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 (2) hide show
  1. package/dist/bot.js +9 -6
  2. package/package.json +1 -1
package/dist/bot.js CHANGED
@@ -726,12 +726,12 @@ ${bridge.formatStatus(mapping)}`);
726
726
  return;
727
727
  }
728
728
  if (action === "main") {
729
- const result = await botManagement.setMainBot(rest?.trim() ?? args[1]?.trim() ?? "");
729
+ const result = await botManagement.setMainBot(commandTarget(args, rest));
730
730
  await reply(ctx, result.message);
731
731
  return;
732
732
  }
733
733
  if (action === "remove") {
734
- const result = await botManagement.removeBot(rest?.trim() ?? "", sourceBotId, sourceBotToken, ctx.chat.id);
734
+ const result = await botManagement.removeBot(commandTarget(args, rest), sourceBotId, sourceBotToken, ctx.chat.id);
735
735
  await reply(ctx, result.message);
736
736
  return;
737
737
  }
@@ -741,14 +741,14 @@ ${bridge.formatStatus(mapping)}`);
741
741
  bot.command("sleep", async (ctx) => {
742
742
  await ensureOwnerControlAccess(ctx);
743
743
  const sourceBotId = getBotId();
744
- const { rest } = parseCommand(ctx.message?.text, 2);
745
- const result = await botManagement.sleepBot(rest?.trim() ?? "", sourceBotId);
744
+ const { args, rest } = parseCommand(ctx.message?.text, 1);
745
+ const result = await botManagement.sleepBot(commandTarget(args, rest), sourceBotId);
746
746
  await reply(ctx, result.message);
747
747
  });
748
748
  bot.command("wake", async (ctx) => {
749
749
  await ensureOwnerControlAccess(ctx);
750
- const { rest } = parseCommand(ctx.message?.text, 2);
751
- const result = await botManagement.wakeBot(rest?.trim() ?? "");
750
+ const { args, rest } = parseCommand(ctx.message?.text, 1);
751
+ const result = await botManagement.wakeBot(commandTarget(args, rest));
752
752
  await reply(ctx, result.message);
753
753
  });
754
754
  bot.command("install", async (ctx) => {
@@ -1657,6 +1657,9 @@ function parseCommand(text, headCount) {
1657
1657
  rest: remaining || undefined,
1658
1658
  };
1659
1659
  }
1660
+ function commandTarget(args, rest) {
1661
+ return (rest?.trim() || args.slice(1).join(" ").trim() || args[0]?.trim() || "");
1662
+ }
1660
1663
  function formatSecretHelp() {
1661
1664
  return [
1662
1665
  "Secret command guide",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appback-remoteagent",
3
- "version": "0.13.19",
3
+ "version": "0.13.20",
4
4
  "description": "Personal installable session server for continuing local AI work across PC and Telegram",
5
5
  "license": "MIT",
6
6
  "type": "module",