Commit Graph
12 Commits
Author SHA1 Message Date
asepharyanaandKilo d4bbde9320 feat: implement image tools (compress, resize, convert) and PDF tools (merge, split, images-to-pdf)
Image tools now actually process images:
- Compress: re-encode JPEG with configurable quality
- Resize: Lanczos3 resize with fit modes (inside/fill/crop)
- Convert: cross-format conversion (JPEG/PNG/WebP/GIF/BMP)

PDF tools:
- Merge: combine multiple PDFs into one document
- Split: extract page ranges via pagespec (1-3,5,7-9)
- Images to PDF: embed images as JPEG in A4 pages with scaling
- Compress: re-save PDF with optimized cross-reference table

Also fix metrics format to emit default zero values.

Co-Authored-By: Kilo <kilo@kilo.ai>
2026-07-24 19:52:39 +07:00
asepharyanaandKilo 1a606d5c64 feat: add interactive resize/convert options (width, height, format, quality)
Resize page: width/height number inputs, aspect ratio lock, quality slider
Convert page: target format dropdown (JPEG/PNG/WebP/GIF/BMP), quality slider

Co-Authored-By: Kilo <kilo@kilo.ai>
2026-07-24 19:07:05 +07:00
asepharyanaandKilo 5a64048ba2 fix: wrap contour detection and pipeline in catch_unwind
imageproc::find_contours panics on some edge images (called
Option::unwrap() on None). Wrap with catch_unwind and provide
a safe fallback (use full image bounds).

Also add catch_unwind around the entire pipeline so no panic
can crash the worker thread.

Co-Authored-By: Kilo <kilo@kilo.ai>
2026-07-24 19:01:28 +07:00
asepharyanaandKilo d2bfcb83a0 fix: audit perbaikan NATS subject, worker spawn, frontend options, pipeline PDF output
Bug fixes:
1. NATS subject doubled prefix — gateway publish ke tools.tools.scan.*
   padahal workers subscribe ke tools.scan.*. Fix: pakai group() method
2. Worker subscriptions pake tokio::select! — cuma satu subscription
   yang diproses, sisanya di-cancel. Fix: ganti ke tokio::spawn + loop
3. WebSocket URL hardcoded ke localhost:3001 — gak jalan di prod.
   Fix: infer dari window.location atau env var
4. Frontend scan options hardcoded — user gak bisa atur OCR/enhance/format.
   Fix: interactive toggles, selects, slider
5. Frontend compress quality hardcoded — user gak bisa atur kualitas.
   Fix: quality range slider
6. Pipeline cuma output PNG — gak ada PDF/OCR.
   Fix: generate searchable PDF kalo tesseract feature enabled

Enhancements:
- Tool::group() method added — returns 'scan', 'image', 'pdf' dll
- Dockerfile: --features tesseract pas cargo build
- leptess OCR: proper API usage (set_image_from_mem, recognize, etc.)

Co-Authored-By: Kilo <kilo@kilo.ai>
2026-07-24 18:24:22 +07:00
asepharyanaandKilo 37cc3a7486 fix: use bun for Next.js server, not node
Node.js not available in runtime image. Use bun instead which is
copied from frontend-builder stage.

Co-Authored-By: Kilo <kilo@kilo.ai>
2026-07-24 17:55:37 +07:00
asepharyanaandKilo f2677d37e8 feat: add Next.js frontend to entrypoint
Start Next.js on port 3000 alongside gateway (3001) and workers.
Frontend proxies /api/* to localhost:3001.

Co-Authored-By: Kilo <kilo@kilo.ai>
2026-07-24 17:51:58 +07:00
asepharyanaandKilo 082a6eab19 fix: make entrypoint auto-detect binary locations
Binary paths differ between builder stages (nested in source dirs
like /app/gateway/tools-gateway instead of /app/gateway).
Make entrypoint search multiple candidate paths.

Co-Authored-By: Kilo <kilo@kilo.ai>
2026-07-24 17:47:13 +07:00
asepharyanaandKilo 62ea87565b fix: update rust-toolchain to 1.89 for dependency compatibility
Dependencies built, icu_collections, icu_locale_core require rustc >=1.86.
Update toolchain to 1.89 to match production Docker image.

Co-Authored-By: Kilo <kilo@kilo.ai>
2026-07-24 13:57:12 +07:00
asepharyanaandKilo f6008b36c3 fix: use useRef instead of useState for AbortController
TypeScript error: Property 'abort' does not exist on type
'Dispatch<SetStateAction<AbortController | null>>'. Fixed by using
useRef which properly stores the controller reference.

Co-Authored-By: Kilo <kilo@kilo.ai>
2026-07-24 13:43:21 +07:00
asepharyanaandKilo 084ff4109f fix: replace missing lucide icons (Github, ImageResize), remove reactCompiler
Github icon doesn't exist in lucide-react 1.26.0, replaced with ExternalLink.
ImageResize doesn't exist, replaced with Crop.
reactCompiler requires babel-plugin-react-compiler which isn't installed.

Co-Authored-By: Kilo <kilo@kilo.ai>
2026-07-24 13:40:54 +07:00
asepharyana efdf762a97 chore: add bun.lock for reproducible builds 2026-07-24 13:25:07 +07:00
asepharyanaandKilo a00ad62f6c feat: initial tools service with document scanner, image & PDF tools
Self-hosted document scanner and media processing tools.
- Rust Axum gateway + worker pool with NATS JetStream
- Next.js 16 frontend with shadcn/ui
- Scanner pipeline: edge detection, warp, binarization, OCR
- Image tools: compress, resize, convert
- PDF tools: merge, split, compress
- CI/CD with Docker multi-stage build

Co-Authored-By: Kilo <kilo@kilo.ai>
2026-07-24 13:10:59 +07:00