Commit Graph
304 Commits
Author SHA1 Message Date
MythEclipseandClaude Opus 4.7 2183955133 chore(submodules): update all submodule URLs to point to MythEclipse forks
Update all vendor submodules to use forks under MythEclipse account:
- vendor/discord-video-stream
- vendor/drizzle-orm
- vendor/better-sqlite3
- vendor/node-datachannel

This ensures all submodules are under your control and can be updated
independently without relying on upstream repositories.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 17:38:34 +07:00
MythEclipse 246919cfa0 chore(vendor): update discord-video-stream subproject to latest commit 2026-05-23 17:36:09 +07:00
MythEclipseandClaude Opus 4.7 9b49c05f32 fix(streaming): quote User-Agent header to prevent ffmpeg argument splitting
The ffmpeg -headers option was receiving the User-Agent value split across
multiple arguments due to spaces not being properly quoted. This caused ffmpeg
to interpret "Mozilla/5.0" as an output format, resulting in:
  [NULL @ ...] Unable to find a suitable output format for 'Mozilla/5.0'

Fixed by wrapping the entire headers string in quotes so parseArgsStringToArgv
treats it as a single argument. The headers string is now properly passed to
ffmpeg as: -headers "User-Agent: ... \r\nConnection: ..."

The fix has been applied to vendor/discord-video-stream/src/media/newApi.ts
and compiled into dist/media/newApi.js. A patch file and documentation have
been added to the patches/ directory for reference.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 17:35:42 +07:00
MythEclipseandClaude Opus 4.7 f2b476e1f0 fix(streaming): quote User-Agent header to prevent ffmpeg argument splitting
The ffmpeg -headers option was receiving the User-Agent value split across
multiple arguments due to spaces not being properly quoted. This caused ffmpeg
to interpret "Mozilla/5.0" as an output format, resulting in:
  [NULL @ ...] Unable to find a suitable output format for 'Mozilla/5.0'

Fixed by wrapping the entire headers string in quotes so parseArgsStringToArgv
treats it as a single argument. The headers string is now properly passed to
ffmpeg as: -headers "User-Agent: ... \r\nConnection: ..."

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 17:31:21 +07:00
MythEclipse 4ec9b50f33 fix(moderation): interleave images with owning messages, Indonesian-first prompt
- Replace flat imageParts prologue with per-message image map (messageImageMap)
  keyed by message_id. Images are now inserted immediately after their owning
  message's text part in the multimodal content array, giving the vision model
  proper text+image co-context instead of a disconnected image dump before the
  entire prompt.

- Rewrite moderationPrompt as Indonesian-first bilingual system prompt:
  * Primary language: Bahasa Indonesia; English secondary
  * Explicit Discord community context with Indonesian slang awareness
    (anjay, wkwk, santuy, gw/lo abbreviations, etc.)
  * SARA, hoaks, ujaran kebencian cultural context
  * Charitable intent for ambiguous Indonesian phrasing
  * Expanded flag taxonomy: sara, hoaks, nsfw_image, gore_image, doxxing, scam
  * analysis field instructed in Bahasa Indonesia (maks 2 kalimat)
  * Retry/correction messages also in Bahasa Indonesia

- Image instruction block conditionally injected into prompt only when
  hasImages=true, explicitly telling model to treat image + preceding text
  as one semantic unit and to OCR meme/screenshot text as message content.
2026-05-22 01:04:00 +07:00
MythEclipse d0e906763e fix(moderation): fix image attachment pipeline causing PIL BadRequestError on NVIDIA inference
Three-layer defect chain causing 'cannot identify image file <_io.BytesIO object>':

1. attachmentUploader: hardcoded 'application/octet-stream' on Tele CDN upload
   regardless of actual file MIME type — CDN stored images under wrong type.

2. messageCapture: processAttachmentUpload call site never forwarded
   attachment.contentType into the options bag, so the fix in (1) would
   have received undefined and fallen back to octet-stream anyway.

3. llmModerationClient: blindly trusted att.type from the DB record
   (Discord-provided MIME) when constructing data: URLs, but validated
   neither the HTTP status of the CDN re-fetch nor the actual byte content.
   Stale/expired CDN URLs returning HTML error pages were base64-encoded
   and sent to the model as 'image/jpeg', causing PIL to reject the stream.

Fixes:
- uploadAttachmentToTele now accepts contentType param (defaults to
  application/octet-stream for non-image files)
- processAttachmentUpload options bag gains optional contentType field
- messageCapture forwards attachment.contentType at the call site
- Added sniffImageMimeType() using magic-byte probes for JPEG, PNG, GIF,
  WebP, AVIF/HEIF — runs on every downloaded attachment buffer before
  base64 encoding; skips the attachment (logs headerHex for diagnosis)
  if bytes don't match a known image format
- data: URL now uses the sniffed MIME type, not the DB record
2026-05-21 23:44:18 +07:00
Asep Haryana Saputra d76549f94a refactor(app): simplify path handling for static files and index.html 2026-05-21 12:35:28 +00:00
Asep Haryana Saputra 610bcf2b8e feat(config): add build options for rolldown checks in Vite configuration 2026-05-21 12:30:04 +00:00
Asep Haryana Saputra 41197fd2c2 feat(build): optimize Dockerfile to build vendor packages during image build and streamline package.json scripts 2026-05-21 12:27:07 +00:00
Asep Haryana Saputra 0530bf9a60 feat(deploy): update Docker Compose configuration for improved app deployment 2026-05-21 12:14:18 +00:00
Asep Haryana Saputra 9b2472ac58 feat(deploy): enhance deployment workflow with improved Docker setup and SSH actions 2026-05-21 12:10:30 +00:00
Asep Haryana Saputra 0ef6fc8d31 refactor: update import statements to use .js extensions
- Changed all import statements across the project to include the .js extension for consistency and to comply with ES module standards.
- Updated imports in various files including bootstrap.ts, shutdown.ts, config.ts, and many others.
- Ensured that all related modules and types are correctly imported with the new extension.
2026-05-21 12:03:31 +00:00
Asep Haryana Saputra 4cd92303ef fix(config): correct regex for DISCORD_TOKEN transformation to remove quotes
fix(moderation): update import statement for pagination to include file extension
2026-05-21 11:46:08 +00:00
Asep Haryana Saputra 37cb177b11 feat(config): enhance DISCORD_TOKEN validation by trimming quotes 2026-05-21 11:40:02 +00:00
Asep Haryana Saputra 5935e79867 feat(devcontainer): add initial devcontainer configuration for development environment 2026-05-21 10:55:01 +00:00
Asep Haryana Saputra 6a5bbf99d6 feat(dependencies): add TypeScript 5.9.3 and update vitest to 4.1.7 2026-05-21 10:37:03 +00:00
MythEclipse 834b19b1ae feat(moderation): enhance JSON extraction and validation in moderation analysis 2026-05-21 04:23:01 +07:00
MythEclipse f851ea0fa9 fix(moderation): improve error handling for malformed JSON responses and ensure proper response headers 2026-05-21 04:00:36 +07:00
MythEclipse 8884e29ce7 feat(recordings): add RecordingsPanel component for displaying voice recordings 2026-05-21 03:56:44 +07:00
MythEclipse 5588ece6c7 feat(moderation): normalize JSON response handling and enhance test coverage for moderation analysis 2026-05-21 03:52:51 +07:00
MythEclipse 419018ab0c fix(vendor): update discord-video-stream subproject commit reference 2026-05-21 03:28:08 +07:00
MythEclipse c1c3c99686 feat(moderation): improve message analysis scheduling and update moderation prompt structure 2026-05-21 02:56:41 +07:00
MythEclipse 7eb01606b7 feat(moderation): enhance attachment handling and AI analysis integration 2026-05-21 02:39:28 +07:00
MythEclipse 3d64228d6a feat(config): add AI analysis tuning parameters and update related logic 2026-05-21 01:55:50 +07:00
MythEclipse 5fb7b2ce24 docs: add CodeGraph usage guidelines to CLAUDE.md 2026-05-21 00:52:28 +07:00
MythEclipse d0259ddae0 fix(vendor): update discord-video-stream subproject commit reference 2026-05-21 00:45:50 +07:00
MythEclipse c349736b89 refactor(messageStore): simplify message query conditions and pagination logic
chore(package): remove unused pnpm configuration
2026-05-21 00:45:35 +07:00
MythEclipse 480bcff5e2 feat(logging): add error serialization and log metadata formatting
- Introduced `loggerSerialization.ts` to handle error serialization and log metadata formatting.
- Added `serializeError` function to convert Error objects into a structured format.
- Implemented `serializeLogValue` to handle various data types including Errors, Dates, RegExps, and plain objects.
- Created `formatLogMetadata` to format log metadata using the serialization functions.

feat(pagination): implement cursor encoding and decoding

- Added `pagination.ts` to manage cursor-based pagination.
- Implemented `encodeCursor` to convert cursor data into a base64 string.
- Developed `decodeCursor` to parse base64 strings back into cursor data, with error handling for invalid inputs.
2026-05-21 00:34:30 +07:00
MythEclipseandClaude Opus 4.7 31e8de3185 fix: add missing discord-video-stream package.json to Docker build context
The Dockerfile was only copying discord.js-selfbot-v13/package.json but not
discord-video-stream/package.json before running pnpm install. This caused
pnpm to fail with ERR_PNPM_WORKSPACE_PKG_NOT_FOUND since @dank074/discord-video-stream
is declared as a workspace dependency but its package.json wasn't available.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 17:49:14 +07:00
MythEclipse 12424e5391 chore: update pnpm workspace configuration and vendor subproject
- Added allowBuilds for specific packages in pnpm-workspace.yaml
- Excluded certain minimum release ages for packages
- Updated onlyBuiltDependencies list
- Marked discord.js-selfbot-v13 subproject as dirty
2026-05-19 16:48:06 +07:00
MythEclipse 2821b4cfae fix: allow pnpm install to proceed without frozen lockfile in Dockerfile 2026-05-19 16:36:13 +07:00
MythEclipse 80957d1eb3 fix: update Docker image tag to use commit SHA for versioning 2026-05-19 16:34:23 +07:00
MythEclipse 4687443fd4 fix: remove unused GITHUB_TOKEN and REPO_URL from deployment workflow 2026-05-19 16:31:28 +07:00
MythEclipse 0fe61e0634 fix: update permissions in deploy workflow and correct GITHUB_TOKEN reference 2026-05-19 16:15:50 +07:00
MythEclipse b51210f9b0 a 2026-05-19 16:07:50 +07:00
MythEclipse a12abaccd6 refactor: configure git safe directory for deployment 2026-05-19 16:01:14 +07:00
MythEclipse b9d75ce9a0 refactor: update deployment process to use git clone for VPS 2026-05-19 15:52:47 +07:00
MythEclipse e8e0697a84 chore: clean dependencies and format restructure 2026-05-19 15:12:09 +07:00
MythEclipse dcbe204795 refactor: extract application bootstrap 2026-05-19 15:08:02 +07:00
MythEclipse f7c8257ef1 refactor: move webserver orchestration 2026-05-19 14:58:09 +07:00
MythEclipseandClaude Opus 4.7 d98bf1a5fe refactor: extract http app setup
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 14:52:52 +07:00
MythEclipse 109a6825bc refactor: extract websocket server 2026-05-19 14:45:39 +07:00
MythEclipse d52803ae20 refactor: extract browser audio bridge 2026-05-19 14:34:24 +07:00
MythEclipse c3f7291543 refactor: isolate websocket globals 2026-05-19 14:26:06 +07:00
MythEclipse 3639028f6f refactor: extract media settings state 2026-05-19 14:16:00 +07:00
MythEclipse a1b85d8ac3 refactor: extract persisted ui state 2026-05-19 14:11:09 +07:00
MythEclipse f48f62893d refactor: extract pcm audio helpers 2026-05-19 13:56:36 +07:00
MythEclipse 7f5db953fa chore: update dependencies and improve code formatting
- Added `vendor/discord-video-stream` to pnpm workspace.
- Refactored `llmModerationClient.ts` for better readability and consistency.
- Adjusted imports in `recordingsRoutes.ts` for clarity.
- Updated `webserver.ts` to correctly import `createRecordingsRoutes`.
- Enhanced test cases in `llmModerationClient.test.ts` for improved readability.
- Updated submodule references for `better-sqlite3`, `discord-video-stream`, `discord.js-selfbot-v13`, `drizzle-orm`, and `node-datachannel`.
- Created documentation for deprecated dependency removal plan and design.
2026-05-19 02:49:55 +07:00
MythEclipse e85967ae51 style: format winston logger changes 2026-05-19 02:48:37 +07:00
MythEclipse f0b4f2cd56 chore: ignore runtime log files 2026-05-19 02:44:42 +07:00