grok-telegram-bot 2.2.3 → 2.3.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.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Prompt appendix so the agent keeps generated images in the session media
3
+ * folder and mentions absolute paths (the bot delivers those as Telegram files).
4
+ *
5
+ * Keep tidy-idempotent (no trailing spaces / 3+ blank lines) so
6
+ * `cleanStoredText` can strip it by exact match after extractProgress/tidy.
7
+ */
8
+ export const IMAGE_OUTPUT_DIRECTIVE = [
9
+ "IMAGE OUTPUT RULES:",
10
+ "When generating images (image_gen / image_edit) or saving image files, write them under the current Grok session media folder (session images/ or assets/) or the project images/ directory — not random temp locations.",
11
+ "Always mention the absolute path of each image file you create in your reply so the client can deliver it as a downloadable Telegram file.",
12
+ ].join("\n");
@@ -3,6 +3,7 @@
3
3
  * Reads only the tail of large logs to stay fast.
4
4
  */
5
5
  import { closeSync, openSync, readSync, statSync } from "node:fs";
6
+ import { IMAGE_OUTPUT_DIRECTIVE } from "../render/image-output.js";
6
7
  import { extractProgress, PROGRESS_DIRECTIVE } from "../render/progress.js";
7
8
  import type { HistoryEntry, HistoryRole } from "./types.js";
8
9
 
@@ -161,6 +162,7 @@ function cleanStoredText(text: string): string {
161
162
  if (!text) return text;
162
163
  let t = extractProgress(text).cleaned;
163
164
  if (t.includes(PROGRESS_DIRECTIVE)) t = t.split(PROGRESS_DIRECTIVE).join("").trim();
165
+ if (t.includes(IMAGE_OUTPUT_DIRECTIVE)) t = t.split(IMAGE_OUTPUT_DIRECTIVE).join("").trim();
164
166
  return t;
165
167
  }
166
168
 
@@ -1,16 +0,0 @@
1
- import { execSync } from "node:child_process";
2
-
3
- function run(cmd) {
4
- console.log(`$ ${cmd}`);
5
- execSync(cmd, { stdio: "inherit" });
6
- }
7
-
8
- // Annotated release tag (triggers GitHub Release workflow on push).
9
- try {
10
- run('git tag -a v2.2.3 -m "v2.2.3 — instant account rotate on 402 balance exhausted"');
11
- } catch {
12
- console.log("tag v2.2.3 already exists locally — continuing");
13
- }
14
- run("git push origin v2.2.3");
15
- run("npm publish --access public");
16
- console.log("done");