levix-bot 4.3.1 → 4.5.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.
Files changed (47) hide show
  1. package/README.md +4 -2
  2. package/package.json +1 -1
  3. package/public/dashboard/assets/index-COI8zgqa.css +2 -0
  4. package/public/dashboard/assets/index-IZMBuNAZ.js +505 -0
  5. package/public/dashboard/index.html +2 -2
  6. package/public/dashboard.css +32 -0
  7. package/scheduler.cjs +66 -7
  8. package/src/bootstrap/panel.js +16 -4
  9. package/src/commands/pack.cjs +159 -0
  10. package/src/commands/packs.cjs +47 -0
  11. package/src/commands/send.cjs +1 -18
  12. package/src/commands/sticker.cjs +77 -232
  13. package/src/commands/stickers.cjs +100 -0
  14. package/src/commands/toimage.cjs +88 -0
  15. package/src/config/defaults.cjs +5 -0
  16. package/src/config/settings.cjs +10 -0
  17. package/src/core/events.js +15 -1
  18. package/src/core/session.js +7 -0
  19. package/src/db/db.cjs +387 -0
  20. package/src/db/store.cjs +746 -24
  21. package/src/handlers/command.handler.js +4 -0
  22. package/src/panel/feedback.cjs +43 -14
  23. package/src/routes/dashboard.api.esm.js +172 -20
  24. package/src/routes/stickers.api.esm.js +570 -0
  25. package/src/services/llmDiscovery.cjs +32 -10
  26. package/src/stickers/errors.cjs +239 -0
  27. package/src/stickers/ffmpeg.cjs +133 -0
  28. package/src/stickers/jobs.cjs +183 -0
  29. package/src/stickers/library.cjs +712 -0
  30. package/src/stickers/limits.cjs +60 -0
  31. package/src/stickers/media.cjs +748 -0
  32. package/src/stickers/options.cjs +128 -0
  33. package/src/stickers/owner.cjs +103 -0
  34. package/src/stickers/studio.cjs +473 -0
  35. package/src/stickers/uploads.cjs +263 -0
  36. package/src/stickers/webp.cjs +231 -0
  37. package/src/stickers/zip.cjs +107 -0
  38. package/src/utils/messageContent.cjs +30 -4
  39. package/src/utils/multipart.esm.js +81 -0
  40. package/src/utils/recurrence.cjs +189 -30
  41. package/src/utils/stickerBot.cjs +84 -0
  42. package/src/utils/storage.cjs +3 -0
  43. package/src/utils/storage.esm.js +3 -0
  44. package/views/login.ejs +39 -3
  45. package/views/setup.ejs +21 -0
  46. package/public/dashboard/assets/index-B6RhYFIy.js +0 -446
  47. package/public/dashboard/assets/index-vEwOcxiH.css +0 -2
@@ -0,0 +1,60 @@
1
+ // Sticker Studio limits, shared by the converter, the library, the panel API
2
+ // and the bot commands. Change a number here and every surface follows.
3
+ //
4
+ // WhatsApp's own numbers: a sticker is a 512×512 WebP; a static one should be
5
+ // ≤ 100 KB and an animated one ≤ 500 KB, and clients refuse anything near
6
+ // 1 MB. Animations longer than 10 seconds are not shown as stickers.
7
+
8
+ const MB = 1024 * 1024;
9
+
10
+ module.exports = Object.freeze({
11
+ CANVAS: 512,
12
+
13
+ // What we accept as input.
14
+ UPLOAD_MAX_BYTES: 16 * MB,
15
+ WHATSAPP_MEDIA_MAX_BYTES: 16 * MB,
16
+ MAX_INPUT_SIDE: 4096,
17
+ MAX_INPUT_PIXELS: 4096 * 4096,
18
+ // A source video may be longer than a sticker as long as the panel trims it.
19
+ VIDEO_MAX_SOURCE_SECONDS: 60,
20
+ // The bot has no trim control, so its sources must already fit.
21
+ BOT_VIDEO_MAX_SECONDS: 10,
22
+ STICKER_MAX_SECONDS: 10,
23
+ ANIMATED_MAX_FRAMES: 300,
24
+
25
+ // What we produce.
26
+ ANIMATED_FPS: 15,
27
+ STATIC_TARGET_BYTES: 100 * 1024,
28
+ ANIMATED_TARGET_BYTES: 500 * 1024,
29
+ STICKER_MAX_BYTES: 1 * MB,
30
+ // A saved WhatsApp sticker is kept byte for byte when it fits these.
31
+ EXISTING_MAX_SIDE: 1024,
32
+ THUMB_SIZE: 160,
33
+
34
+ // The conversion queue.
35
+ JOB_CONCURRENCY: 2,
36
+ JOB_MAX_QUEUED: 16,
37
+ JOB_TIMEOUT_MS: 90_000,
38
+ FFMPEG_STEP_TIMEOUT_MS: 60_000,
39
+ JOB_RETENTION_MS: 10 * 60_000,
40
+ UPLOAD_TTL_MS: 60 * 60_000,
41
+
42
+ // The library.
43
+ STICKER_NAME_MAX: 60,
44
+ PACK_NAME_MAX: 40,
45
+ PACKS_MAX_PER_OWNER: 100,
46
+ EXPORT_MAX_IDS: 200,
47
+ SEND_MAX_IDS: 10,
48
+ BOT_PAGE_SIZE: 5,
49
+
50
+ // Sub-command words of `!pack`. A pack can't be named any of them, in the
51
+ // panel either, or the bot could never address it.
52
+ PACK_SUBCOMMANDS: Object.freeze({
53
+ create: Object.freeze(["create", "new", "إنشاء", "انشاء", "جديد"]),
54
+ add: Object.freeze(["add", "أضف", "اضف", "إضافة", "اضافة"]),
55
+ remove: Object.freeze(["remove", "rm", "أزل", "ازل", "إزالة", "ازالة"]),
56
+ rename: Object.freeze(["rename", "تسمية", "إعادة-تسمية", "اعادة-تسمية"]),
57
+ delete: Object.freeze(["delete", "del", "احذف", "حذف"]),
58
+ show: Object.freeze(["show", "list", "عرض"]),
59
+ }),
60
+ });