Commit Graph

168 Commits

Author SHA1 Message Date
29e95f780c feat: support all chat types in channel discovery and enrich bot messages
Channel Discovery:
- Remove channel/supergroup filter from getAccountChats — all chat types
  (private, groups, Saved Messages, etc.) are now discoverable as sources
- Detect and label the self-chat as "Saved Messages" via getMe
- Update channel picker dialog to accept any chat type string

Bot Rich Messages:
- Enhance package send preview with creator, file count, tags, and source
  channel info in MarkdownV2 caption
- Include tags in new_package subscription notifications
- Expand getPendingSendRequest to fetch richer package data

Performance:
- Reviewed pipeline for many-channel load — getChats pagination fix and
  per-channel getChat pre-load from prior commit address the main concerns
- Channels with no new messages skip in 2-3 API calls

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 18:27:48 +01:00
5fd341dfc4 feat: fix channel scanning bugs, add package tags, and kickstarters tab
Bug fixes:
- Fix channels not being scanned by paginating TDLib getChats (was only
  loading first batch, additional channels were unknown to TDLib)
- Add per-channel getChat pre-load as safety net before scanning
- Fix preview pictures not loading by checking previewData instead of
  previewMsgId for hasPreview flag
- Prevent previewMsgId from being set when preview download fails

Package Tags:
- Add tags Text[] column to Package with migration backfilling from
  channel categories
- Worker auto-inherits source channel category as initial tag
- Tag filter dropdown and Tags column in STL Files table
- Server actions for individual and bulk tag editing

Kickstarters Tab:
- New KickstarterHost, Kickstarter, and KickstarterPackage models
- Full CRUD with delivery status, payment status, host management
- Package linking (many-to-many with existing packages)
- Sidebar entry with Gift icon
- Table with search, filters, modal forms

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 18:17:44 +01:00
admin
e2dd3bb9d0 fix: cast sendMessage result type for strict TypeScript
All checks were successful
continuous-integration/drone/push Build is passing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 14:20:16 +01:00
admin
ccf6f9000d fix: rewrite bot file sending to use getMessage + inputFileRemote
Some checks failed
continuous-integration/drone/push Build is failing
forwardMessages with send_copy is unreliable for bot accounts — it
queues an internal download+reupload that can silently fail.

New approach:
1. getMessage to get the file's remote ID from the dest channel
2. sendMessage with inputMessageDocument + inputFileRemote to send
   directly to the user (no re-upload needed, file is already on
   Telegram's servers)
3. waitForSendConfirmation to actually verify delivery via
   updateMessageSendSucceeded/Failed

Also removed getChats call (not available to bot accounts).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 13:48:11 +01:00
admin
a4c264a144 fix: bot send confirmation, preview picker dialog nesting, upload button
- Bot: wait for updateMessageSendSucceeded/Failed before marking send
  complete (was returning on temp message, actual send was async)
- Preview picker: move ArchivePreviewPicker outside parent Dialog to
  fix Radix nested dialog focus trap conflict
- Upload: add explicit "Upload Preview" button always visible in the
  action bar alongside "Pick Preview"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 13:15:31 +01:00
admin
f4488a079f fix: add getChat before forwardMessages and debug logging for bot sends
The bot may not have the source channel loaded in TDLib's internal
state. Calling getChat first ensures it's resolved. Also added result
logging to diagnose silent send failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 12:39:42 +01:00
admin
729f296232 fix: use forward (not send_copy) for bot message delivery and add logging
send_copy requires re-uploading which may silently fail for bots.
Regular forward is more reliable. Added logging to debug delivery.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 12:38:24 +01:00
admin
a48f9c24a7 ci: run app/worker/bot builds in parallel and deploy after all complete
All checks were successful
continuous-integration/drone/push Build is passing
All three builds now depend only on clone and run concurrently.
Deploy step waits for all three to finish.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 11:53:53 +01:00
admin
84bb167ce6 fix: load bot chat list after TDLib auth to enable message forwarding
Some checks failed
continuous-integration/drone/push Build is failing
Without getChats after login, TDLib doesn't know about the destination
channel and forwardMessages fails with "Chat not found".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 11:33:46 +01:00
admin
7cd84dbf02 fix: map ArchiveFormat '7Z' to ArchiveType 'SEVEN_Z' in rebuild
All checks were successful
continuous-integration/drone/push Build is passing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 11:03:09 +01:00
admin
c00fc528ac fix: BigInt literal compatibility and bot link code JSON parsing
Some checks failed
continuous-integration/drone/push Build is failing
- Replace 0n literals with BigInt(0) for ES2017 target compatibility
- Parse link code JSON to extract userId and check expiration (was
  passing raw JSON string as FK, causing constraint violation)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 09:56:10 +01:00
admin
1fc2d3e1ae feat: add migration for archive extract requests and invite user relation
Some checks failed
continuous-integration/drone/push Build is failing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 00:12:26 +01:00
admin
ab558e00f5 feat: add preview management, channel controls, invite polish, and recovery
- Auto-extract preview images from ZIP/RAR/7z archives during ingestion
- Upload custom preview images via package drawer
- Select preview from archive contents with on-demand extraction UI
- Manually add Telegram channels by t.me link, username, or invite link
- Invite code UX: bulk create, copy link, usage tracking, delete confirm
- Incomplete upload recovery: verify dest messages on worker startup
- Rebuild package DB by scanning destination channel with live progress

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 00:09:59 +01:00
admin
bf093cdfca fix: 7z parser handles solid archives with empty Compressed column 2026-03-21 21:18:33 +01:00
admin
a90f653314 feat: add 7z archive content listing via p7zip
- Add p7zip-full to worker Docker image
- New read7zContents() parser using 7z l output
- 7z archives now get full file listings like ZIP/RAR
- Standalone DOCUMENT types still show as single entry
2026-03-21 21:13:58 +01:00
admin
9ac66e9d7d feat: manual creator editing on packages and bulk set
- Click creator cell in STL Files table to edit
- Server action for updating/clearing package creator
- Bulk set creator action for multiple packages
2026-03-21 20:55:22 +01:00
admin
36a7e3d5f4 feat: add channel categories and improved creator detection
- Add category field to TelegramChannel (filterable tag like STL, PDF, D&D)
- Category column in channels table with edit via dropdown menu
- Improved creator extraction: filename patterns + channel title fallback
- extractCreatorFromChannelTitle strips [Completed], (Paid), emoji, etc.
- Fix ArchiveType in PackageListItem and PackageRow for new types
- Add Prisma migration for category column
2026-03-21 20:37:44 +01:00
admin
53a76a8136 feat: add support for 7z, PDF, STL, and other document types
- Add 7Z and DOCUMENT to ArchiveType enum
- Detect .7z, .pdf, .stl, .obj, .3mf, .step, .blend, .gcode, .svg,
  .dxf, .ai, .eps, .psd files as fetchable documents
- Handle DOCUMENT and 7Z formats in worker pipeline (skip extraction,
  record file as single entry)
- Add Prisma migration for new enum values
2026-03-21 20:25:00 +01:00
admin
ba3d3a6040 fix: use searchChatMessages instead of getChatHistory for channel scanning
getChatHistory fails silently in supergroups with hidden history for new
members, returning only system messages. searchChatMessages with document
and photo filters works regardless of history visibility settings.

Also adds getChats call after TDLib client creation to populate the chat
list, preventing 'Chat not found' errors.
2026-03-21 20:15:18 +01:00
admin
fe7a548fef fix: add getChat and sync delay after openChat for proper history loading 2026-03-21 19:27:43 +01:00
admin
4a44374bb7 fix: call openChat before getChatHistory to load remote messages
All checks were successful
continuous-integration/drone/push Build is passing
2026-03-21 18:20:30 +01:00
admin
c7eb077e0d fix: resolve TypeScript null-check errors in bot tdlib client
All checks were successful
continuous-integration/drone/push Build is passing
2026-03-21 16:06:03 +01:00
admin
031a4687fb feat: add invite code system and multi-image Drone pipeline
Some checks failed
continuous-integration/drone/push Build is failing
- Add InviteCode model with code, maxUses, expiry, usage tracking
- Registration now requires a valid invite code
- New users get USER role instead of ADMIN
- Admin-only /invites page to create, manage, and share invite codes
- Invite links auto-fill code via ?code= URL param
- Drone pipeline now builds app, worker, and bot images separately
- Add NEXT_PUBLIC_APP_URL build arg to fix URL redirects
2026-03-21 15:41:12 +01:00
admin
30fb96b3f9 fix: replace drone-ssh with alpine SSH and fix YAML indentation 2026-03-21 15:41:12 +01:00
xCyanGrizzly
9a077a3648 Update .drone.yml
All checks were successful
continuous-integration/drone/push Build is passing
2026-03-21 13:28:27 +01:00
xCyanGrizzly
2ceba66313 Update .drone.yml
Some checks failed
continuous-integration/drone/push Build encountered an error
2026-03-21 13:25:56 +01:00
xCyanGrizzly
036dadcb21 Update .drone.yml
Some checks failed
continuous-integration/drone/push Build encountered an error
2026-03-21 13:07:56 +01:00
xCyanGrizzly
541ae0c614 Update .drone.yml
Some checks failed
continuous-integration/drone/push Build encountered an error
2026-03-21 13:03:27 +01:00
xCyanGrizzly
b7a76fd932 Update .drone.yml
Some checks failed
continuous-integration/drone/push Build is failing
2026-03-21 12:51:05 +01:00
xCyanGrizzly
b75b0e1f91 Update .drone.yml
Some checks failed
continuous-integration/drone/push Build is failing
2026-03-21 12:40:24 +01:00
xCyanGrizzly
50e7e02b2d Update .drone.yml
Some checks failed
continuous-integration/drone/push Build is failing
2026-03-21 12:29:49 +01:00
xCyanGrizzly
dea419b778 Update .drone.yml
Some checks failed
continuous-integration/drone/push Build encountered an error
2026-03-21 12:26:34 +01:00
xCyanGrizzly
053eeed6be Update .drone.yml
Some checks failed
continuous-integration/drone/push Build encountered an error
2026-03-21 12:24:17 +01:00
xCyanGrizzly
d5725bd52e Update .drone.yml
Some checks failed
continuous-integration/drone/push Build encountered an error
2026-03-21 12:21:24 +01:00
xCyanGrizzly
48726b9122 Update README.md
Some checks failed
continuous-integration/drone/push Build is failing
2026-03-20 00:31:05 +01:00
xCyanGrizzly
1b8df48768 Update README.md 2026-03-20 00:22:04 +01:00
xCyanGrizzly
726f55a943 Update .drone.yml 2026-03-19 23:39:00 +01:00
xCyanGrizzly
b08140b4f9 Create .drone.yml
Some checks failed
continuous-integration/drone/push Build was killed
2026-03-19 23:27:51 +01:00
xCyanGrizzly
761d5e0790 add TG skill 2026-03-17 12:59:05 +01:00
xCyanGrizzly
d7bbb7587e Update tg issues 2026-03-16 16:51:30 +01:00
2763de2711 Fix multiple issues 2026-03-07 21:33:40 +01:00
xCyanGrizzly
6926df9a2c Merge pull request #15 from xCyanGrizzly/copilot/fix-channel-tab-issues
Fix inactive source channels and add Fetch Channels button to Channels tab
2026-03-05 23:50:03 +01:00
copilot-swe-agent[bot]
651e9e6bdd Simplify redundant conditional in handleFetchChannels
Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-05 22:05:50 +00:00
copilot-swe-agent[bot]
8d508d5a86 Fix channels not active after selection and add Fetch Channels button to Channels tab
Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-05 22:04:28 +00:00
copilot-swe-agent[bot]
2bb3caf7d9 Initial plan 2026-03-05 21:57:43 +00:00
xCyanGrizzly
8d95752106 Merge pull request #14 from xCyanGrizzly/copilot/fix-telegram-worker-issue
Fix APP_PORT: align container listen port, port mapping, and healthcheck
2026-03-05 21:40:23 +01:00
copilot-swe-agent[bot]
22419106c1 Fix APP_PORT: make container listen port and healthcheck follow APP_PORT
Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-05 20:39:26 +00:00
copilot-swe-agent[bot]
e45de85c69 Add Rescan Channel option to channels tab
Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-05 20:34:53 +00:00
copilot-swe-agent[bot]
71a2e6a5e8 Fix Telegram worker: countdown timer, orphaned runs, fetch-listener reconnection, and logging
Co-authored-by: xCyanGrizzly <53275238+xCyanGrizzly@users.noreply.github.com>
2026-03-05 20:21:18 +00:00
copilot-swe-agent[bot]
1436b630e2 Initial plan 2026-03-05 20:05:41 +00:00