polygram 0.8.0-rc.1 → 0.8.0-rc.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://anthropic.com/claude-code/plugin.schema.json",
3
3
  "name": "polygram",
4
- "version": "0.8.0-rc.1",
4
+ "version": "0.8.0-rc.2",
5
5
  "description": "Telegram integration for Claude Code that preserves the OpenClaw per-chat session model. Migration target for OpenClaw users. Multi-bot, multi-chat, per-topic isolation; SQLite transcripts; inline-keyboard approvals. Bundles /polygram:status|logs|pair-code|approvals admin commands and a history skill.",
6
6
  "keywords": [
7
7
  "telegram",
@@ -1,10 +1,13 @@
1
1
  /**
2
- * Attachment filter — caps count + total size + MIME allowlist.
2
+ * Attachment filter — caps total size + per-file size + MIME allowlist.
3
3
  * Rejected items return a human-readable reason that we surface to the
4
4
  * user and log to the events table.
5
+ *
6
+ * No count cap: per-file (10 MB) and total-size (20 MB) bound resource
7
+ * usage already; an additional count limit just produces "skipped: max
8
+ * count" surprises on Telegram albums (up to 10 photos in one send).
5
9
  */
6
10
 
7
- const MAX_COUNT = 5;
8
11
  const MAX_FILE_BYTES = 10 * 1024 * 1024;
9
12
  const MAX_TOTAL_BYTES = 20 * 1024 * 1024;
10
13
  const MIME_ALLOW = [
@@ -16,7 +19,6 @@ const MIME_ALLOW = [
16
19
  ];
17
20
 
18
21
  function filterAttachments(attachments, opts = {}) {
19
- const maxCount = opts.maxCount ?? MAX_COUNT;
20
22
  const maxFileBytes = opts.maxFileBytes ?? MAX_FILE_BYTES;
21
23
  const maxTotalBytes = opts.maxTotalBytes ?? MAX_TOTAL_BYTES;
22
24
  const mimeAllow = opts.mimeAllow ?? MIME_ALLOW;
@@ -26,10 +28,6 @@ function filterAttachments(attachments, opts = {}) {
26
28
  let totalBytes = 0;
27
29
 
28
30
  for (const a of attachments || []) {
29
- if (accepted.length >= maxCount) {
30
- rejected.push({ att: a, reason: `exceeds max count (${maxCount})` });
31
- continue;
32
- }
33
31
  const mime = a.mime_type || '';
34
32
  if (!mimeAllow.some((re) => re.test(mime))) {
35
33
  rejected.push({ att: a, reason: `mime not allowed (${mime || 'unknown'})` });
@@ -38,7 +36,7 @@ function filterAttachments(attachments, opts = {}) {
38
36
  const reported = a.size || 0;
39
37
  // Telegram sometimes reports file_size=0 or omits it. Pre-0.6.14
40
38
  // those bypassed the cumulative cap entirely (totalBytes + 0 always
41
- // ≤ maxTotalBytes), so 5 size-0 attachments could blow through the
39
+ // ≤ maxTotalBytes), so unsized attachments could blow through the
42
40
  // 20 MB total cap. Treat unknown sizes as worst-case (= per-file
43
41
  // cap) for budgeting; the per-file cap is still enforced live by
44
42
  // the streaming download in polygram.js.
@@ -57,4 +55,4 @@ function filterAttachments(attachments, opts = {}) {
57
55
  return { accepted, rejected, totalBytes };
58
56
  }
59
57
 
60
- module.exports = { filterAttachments, MAX_COUNT, MAX_FILE_BYTES, MAX_TOTAL_BYTES, MIME_ALLOW };
58
+ module.exports = { filterAttachments, MAX_FILE_BYTES, MAX_TOTAL_BYTES, MIME_ALLOW };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polygram",
3
- "version": "0.8.0-rc.1",
3
+ "version": "0.8.0-rc.2",
4
4
  "description": "Telegram daemon for Claude Code that preserves the OpenClaw per-chat session model. Migration path for OpenClaw users moving to Claude Code.",
5
5
  "main": "lib/ipc-client.js",
6
6
  "bin": {