You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gpt-pilot/src/media
thepagent 0ee11d3321
feat: add --force-document to message.send for Telegram (bypass sendPhoto + image optimizer) (#45111)
* feat: add --force-document to message.send for Telegram

Adds --force-document CLI flag to bypass sendPhoto and use sendDocument
instead, avoiding Telegram image compression for PNG/image files.

- TelegramSendOpts: add forceDocument field
- send.ts: skip sendPhoto when forceDocument=true (mediaSender pattern)
- ChannelOutboundContext: add forceDocument field
- telegramOutbound.sendMedia: pass forceDocument to sendMessageTelegram
- ChannelHandlerParams / DeliverOutboundPayloadsCoreParams: add forceDocument
- createChannelOutboundContextBase: propagate forceDocument
- outbound-send-service.ts: add forceDocument to executeSendAction params
- message-action-runner.ts: read forceDocument from params
- message.ts: add forceDocument to MessageSendParams
- register.send.ts: add --force-document CLI option

* fix: pass forceDocument through telegram action dispatch path

The actual send path goes through dispatchChannelMessageAction ->
telegramMessageActions.handleAction -> handleTelegramAction, not
deliverOutboundPayloads. forceDocument was not being read in
readTelegramSendParams or passed to sendMessageTelegram.

* fix: apply forceDocument to GIF branch to avoid sendAnimation

* fix: add disable_content_type_detection=true to sendDocument for --force-document

* fix: add forceDocument to buildSendSchema for agent discoverability

* fix: scope telegram force-document detection

* test: fix heartbeat target helper typing

* fix: skip image optimization when forceDocument is set

* fix: persist forceDocument in WAL queue for crash-recovery replay

* test: tighten heartbeat target test entry typing

---------

Co-authored-by: thepagent <thepagent@users.noreply.github.com>
Co-authored-by: Frank Yang <frank.ekn@gmail.com>
8 months ago
..
audio-tags.ts refactor: unify inline directives and media fetch 11 months ago
audio.test.ts refactor(media): centralize voice compatibility policy 9 months ago
audio.ts refactor(media): centralize voice compatibility policy 9 months ago
base64.test.ts fix(security): harden session export image data-url handling 9 months ago
base64.ts fix(security): harden session export image data-url handling 9 months ago
constants.ts fix(media): harden unknown mime handling from #39199 (thanks @nicolasgrasset) 9 months ago
fetch.telegram-network.test.ts refactor: remove channel shim directories, point all imports to extensions (#45967) 8 months ago
fetch.test.ts fix: retry Telegram inbound media downloads over IPv4 fallback (#45327) 8 months ago
fetch.ts fix: retry Telegram inbound media downloads over IPv4 fallback (#45327) 8 months ago
ffmpeg-exec.test.ts refactor(media): add shared ffmpeg helpers 9 months ago
ffmpeg-exec.ts refactor(media): add shared ffmpeg helpers 9 months ago
ffmpeg-limits.ts refactor(media): add shared ffmpeg helpers 9 months ago
host.test.ts style: align formatting with oxfmt 0.33 9 months ago
host.ts chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 10 months ago
image-ops.helpers.test.ts refactor(media): share image resize side grid and quality steps 9 months ago
image-ops.ts refactor(media): share image resize side grid and quality steps 9 months ago
inbound-path-policy.test.ts fix: enforce inbound attachment root policy across pipelines 9 months ago
inbound-path-policy.ts fix: enforce inbound attachment root policy across pipelines 9 months ago
input-files.fetch-guard.test.ts Media: reject spoofed input_image MIME payloads (#38289) 9 months ago
input-files.ts Media: reject spoofed input_image MIME payloads (#38289) 9 months ago
load-options.test.ts refactor: split telegram delivery and unify media/frontmatter/i18n pipelines 9 months ago
load-options.ts feat: add --force-document to message.send for Telegram (bypass sendPhoto + image optimizer) (#45111) 8 months ago
local-roots.ts refactor(tmp): harden temp boundary guardrails 9 months ago
mime.test.ts fix(media): harden unknown mime handling from #39199 (thanks @nicolasgrasset) 9 months ago
mime.ts Memory: add multimodal image and audio indexing (#43460) 9 months ago
outbound-attachment.ts refactor: remove channel shim directories, point all imports to extensions (#45967) 8 months ago
parse.test.ts test: optimize gateway infra memory and security coverage 9 months ago
parse.ts refactor(runtime): harden channel-registry cache invalidation and split outbound delivery flow 9 months ago
pdf-extract.ts feat: add PDF analysis tool with native provider support (#31319) 9 months ago
png-encode.ts refactor: consolidate PNG encoder and safeParseJson utilities (#12457) 10 months ago
read-response-with-limit.test.ts fix(telegram): add download timeout to prevent polling loop hang (#40098) 9 months ago
read-response-with-limit.ts fix(media): accept reader read result type 9 months ago
server.outside-workspace.test.ts fix: harden sandbox media reads against TOCTOU escapes 9 months ago
server.test.ts security: add X-Content-Type-Options nosniff header to media route (#30356) 9 months ago
server.ts fix(media): retain inbound media with recursive cleanup TTL (#38292) 9 months ago
sniff-mime-from-base64.ts refactor(media): share base64 mime sniff helper 9 months ago
store.outside-workspace.test.ts test: add outside-workspace error mapping coverage 9 months ago
store.redirect.test.ts fix: use 0o644 for inbound media files to allow sandbox read access (#17943) 9 months ago
store.test.ts fix(media): retain inbound media with recursive cleanup TTL (#38292) 9 months ago
store.ts refactor: deduplicate media store writes 8 months ago
temp-files.ts refactor(media): add shared ffmpeg helpers 9 months ago