cc-claw 0.17.1 → 0.17.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 (2) hide show
  1. package/dist/cli.js +26 -8
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -33,7 +33,7 @@ var VERSION;
33
33
  var init_version = __esm({
34
34
  "src/version.ts"() {
35
35
  "use strict";
36
- VERSION = true ? "0.17.1" : (() => {
36
+ VERSION = true ? "0.17.2" : (() => {
37
37
  try {
38
38
  return JSON.parse(readFileSync(join(process.cwd(), "package.json"), "utf-8")).version ?? "unknown";
39
39
  } catch {
@@ -18144,9 +18144,12 @@ ${PERM_MODES[chosen]}`,
18144
18144
  }
18145
18145
  removePendingPlan(chatId);
18146
18146
  await channel.sendText(chatId, "\u2705 Approved. Executing...", { parseMode: "plain" });
18147
+ bypassBusyCheck.add(chatId);
18147
18148
  const { handleMessage: handleMessage2 } = await Promise.resolve().then(() => (init_router(), router_exports));
18149
+ const overrideMsg = `[SYSTEM: Planning mode disabled. Execution APPROVED. Please execute the plan.]
18150
+ ${plan.originalMessage}`;
18148
18151
  await handleMessage2(
18149
- { text: `>>${plan.originalMessage}`, chatId, source: "telegram", type: "text", senderName: "", messageId: "" },
18152
+ { text: `>>${overrideMsg}`, chatId, source: "telegram", type: "text", senderName: "", messageId: "" },
18150
18153
  channel
18151
18154
  );
18152
18155
  return;
@@ -18169,9 +18172,12 @@ ${PERM_MODES[chosen]}`,
18169
18172
  removePendingPlan(chatId);
18170
18173
  setExecMode(chatId, "yolo");
18171
18174
  await channel.sendText(chatId, "\u26A1 Switched to YOLO mode. Executing without approval gate...", { parseMode: "plain" });
18175
+ bypassBusyCheck.add(chatId);
18172
18176
  const { handleMessage: handleMessage2 } = await Promise.resolve().then(() => (init_router(), router_exports));
18177
+ const overrideMsg = `[SYSTEM: Planning mode disabled. YOLO mode enabled. Proceed immediately without asking for approval.]
18178
+ ${plan.originalMessage}`;
18173
18179
  await handleMessage2(
18174
- { text: `>>${plan.originalMessage}`, chatId, source: "telegram", type: "text", senderName: "", messageId: "" },
18180
+ { text: `>>${overrideMsg}`, chatId, source: "telegram", type: "text", senderName: "", messageId: "" },
18175
18181
  channel
18176
18182
  );
18177
18183
  return;
@@ -19238,9 +19244,10 @@ You're still in discussion mode \u2014 try again or click a button to exit.`, {
19238
19244
  });
19239
19245
  typingActive2 = false;
19240
19246
  if (planResponse.text) {
19241
- storePendingPlan(chatId, planResponse.text, cleanText || text);
19247
+ let planText = planResponse.text.replace(/\[REACT:.+?\]/g, "").replace(/\[SEND_FILE:.+?\]/g, "").replace(/\[GENERATE_IMAGE:.+?\]/g, "").replace(/\[HISTORY_SEARCH:[^\]]+\]/g, "").trim();
19248
+ storePendingPlan(chatId, planText, cleanText || text);
19242
19249
  if (typeof channel.sendKeyboard === "function") {
19243
- await channel.sendKeyboard(chatId, `\u{1F50D} ${planResponse.text}`, [
19250
+ await channel.sendKeyboard(chatId, `\u{1F50D} ${planText}`, [
19244
19251
  [
19245
19252
  { label: "\u2705 Approve", data: "exec:approve", style: "success" },
19246
19253
  { label: "\u274C Reject", data: "exec:reject", style: "danger" }
@@ -20785,13 +20792,24 @@ var init_telegram2 = __esm({
20785
20792
  }
20786
20793
  keyboard.row();
20787
20794
  }
20795
+ const MAX_KEYBOARD_TEXT = 4e3;
20796
+ const safeText = text.length > MAX_KEYBOARD_TEXT ? text.slice(0, MAX_KEYBOARD_TEXT) + "\n\n\u2026(truncated)" : text;
20788
20797
  try {
20789
- const msg = await this.bot.api.sendMessage(numericChatId(chatId), text, {
20798
+ const msg = await this.bot.api.sendMessage(numericChatId(chatId), safeText, {
20790
20799
  reply_markup: keyboard
20791
20800
  });
20792
20801
  return msg.message_id.toString();
20793
- } catch {
20794
- return void 0;
20802
+ } catch (err) {
20803
+ error(`[telegram] sendKeyboard failed (chat=${chatId}, textLen=${text.length}):`, err);
20804
+ try {
20805
+ const fallbackMsg = await this.bot.api.sendMessage(numericChatId(chatId), "\u2B06\uFE0F (see above for details)", {
20806
+ reply_markup: keyboard
20807
+ });
20808
+ return fallbackMsg.message_id.toString();
20809
+ } catch (fallbackErr) {
20810
+ error(`[telegram] sendKeyboard fallback also failed:`, fallbackErr);
20811
+ return void 0;
20812
+ }
20795
20813
  }
20796
20814
  }
20797
20815
  async reactToMessage(chatId, messageId, emoji) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-claw",
3
- "version": "0.17.1",
3
+ "version": "0.17.2",
4
4
  "description": "CC-Claw: Personal AI assistant on Telegram — multi-backend (Claude, Gemini, Codex, Cursor), sub-agent orchestration, MCP management",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",