Commit graph

122 commits

Author SHA1 Message Date
clucraft
33b944588d Fix Puppeteer crash handler error in Docker
Add --disable-crash-reporter flag to Puppeteer launch args to fix
"chrome_crashpad_handler: --database is required" error that occurs
when running in Docker containers with system Chromium.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 19:32:27 -05:00
clucraft
2549118555 Add self-hosted ntfy support with authentication
- Add server URL field (defaults to ntfy.sh if blank)
- Add optional username/password for protected servers
- Auth fields only shown when custom server URL is entered
- Database migration for ntfy_server_url, ntfy_username, ntfy_password
- Update CHANGELOG with self-hosted ntfy feature

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 21:27:09 -05:00
clucraft
109ce08d29 Bump service worker cache version to 1.0.6
Forces browser to refresh cached version.json file.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 21:06:37 -05:00
clucraft
617953dcf5 Add Google Gemini AI support (v1.0.6)
- Add Gemini as new AI provider option alongside Anthropic, OpenAI, Ollama
- Support models: Gemini 2.5 Flash Lite (default), Flash, Pro, 3 Flash Preview
- Add test API key endpoint to verify connection before saving
- Full support for extraction, verification, stock status, and arbitration
- Update all version files to 1.0.6

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 21:02:14 -05:00
clucraft
fb00f5b5b2 Add pause/resume feature to CHANGELOG 2026-01-25 21:09:34 -05:00
clucraft
26a802e3d0 Add per-product pause/resume checking feature
Users can now pause and resume price checking for individual products
or in bulk via the Actions menu.

Backend:
- Added checking_paused column to products table
- Scheduler skips products with checking_paused=true
- Added POST /products/bulk/pause endpoint for bulk pause/resume

Frontend:
- Added Pause Checking and Resume Checking to bulk Actions menu
- Added filter dropdown (All/Active/Paused) next to sort controls
- Paused products show greyed out with pause icon and "Paused" label
- Progress bar hidden when paused

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 21:04:02 -05:00
clucraft
1f668239bd Release v1.0.5 - AI model selector, Gotify support, Ollama fixes
New Features:
- AI model selector for Anthropic and OpenAI
- Per-product AI extraction/verification disable toggles
- Gotify self-hosted notification support with connection testing
- AI stock status verification for variant products

Fixes:
- Ollama thinking mode (/nothink message, num_ctx: 16384)
- AI now returns out_of_stock for pre-order/coming soon items

Documentation:
- Added recommended models: Claude Haiku 4.5 and Qwen3
- Added Gotify setup instructions
- Updated API reference with new endpoints

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 20:48:31 -05:00
clucraft
84d088a8d1 Fix AI returning 'unknown' stock status for unavailable items
Updated prompts to explicitly require 'out_of_stock' when the AI's
reasoning mentions the product is not available, coming soon, pre-order,
or has a future availability date.

The AI was returning 'unknown' even when its reason clearly stated
"not available for purchase right now" - now it must use 'out_of_stock'.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 20:39:30 -05:00
clucraft
f1a055c3b9 Fix Ollama thinking mode with /nothink chat message
Send /nothink as a separate message before the actual prompt,
with a mock assistant response. This properly disables thinking
mode for Qwen3/DeepSeek models.

Removed the ineffective think:false API parameter.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 19:40:02 -05:00
clucraft
aad5a797b6 Increase Ollama context window to 16K tokens
Default 4K context was truncating the HTML before the model could see it.
Added num_ctx: 16384 to all 4 Ollama API calls to ensure the full
~25K character HTML content fits in context.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 19:35:27 -05:00
clucraft
57ba90ee25 Fix Ollama thinking mode - use think:false API parameter
The /nothink prefix in prompt text doesn't work for Qwen3/DeepSeek.
The correct way is to pass "think": false in the API request body.

- Added think: false to all 4 Ollama API calls (extract, verify,
  stock status, arbitrate)
- Removed ineffective /nothink prefixes from prompts
- Kept stripThinkingTags() as additional fallback protection

Ref: https://docs.ollama.com/capabilities/thinking

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 14:45:22 -05:00
clucraft
e8edc0c0e3 Fix Ollama Qwen3/DeepSeek thinking mode breaking JSON parsing
These models output <think>...</think> blocks before their actual JSON
response when in "thinking mode". This fix:

1. Adds /nothink prefix to all AI prompts (EXTRACTION_PROMPT,
   VERIFICATION_PROMPT, STOCK_STATUS_PROMPT, ARBITRATION_PROMPT)
   to request models disable thinking mode

2. Adds stripThinkingTags() helper function that removes <think>
   blocks from responses as a fallback if models ignore /nothink

3. Applies stripping in all parse functions before JSON extraction

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 11:23:32 -05:00
clucraft
4c302a7e51 Add AI stock status verification for variant products
When anchor price matches (user previously selected a specific variant),
we now call AI specifically to verify stock status for that price point.

- Add STOCK_STATUS_PROMPT focused on variant availability
- Add AIStockStatusResult interface
- Add verifyStockStatusWith{Anthropic,OpenAI,Ollama} functions
- Add tryAIStockStatusVerification export function
- Call stock verification when anchor price matches in scraper

The prompt instructs AI to only check stock for the specific variant at
the user's selected price, ignoring other variants that may be out of
stock. This fixes false "out of stock" reports on variant product pages.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 23:04:20 -05:00
clucraft
d9374c2f57 Add Gotify notification support
- Add gotify_url, gotify_app_token, gotify_enabled columns to users table
- Add sendGotifyNotification function with priority levels
- Add testGotifyConnection function to verify server connectivity
- Add test-gotify endpoint for connection testing before save
- Add Gotify section in Settings with:
  - Server URL input with Test Connection button
  - App Token input (masked)
  - Enable/disable toggle
  - Send Test button (after configured)
- Include Gotify in notification dispatching

Gotify is a self-hosted push notification server popular in the
self-hosted community, complementing the existing ntfy support.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 21:52:33 -05:00
clucraft
5e850aee18 Fix manual refresh to respect AI disable flags
- Update refresh endpoint to use scrapeProductWithVoting instead of scrapeProduct
- Pass skipAiVerification and skipAiExtraction flags from product settings
- Also use preferred extraction method and anchor price for consistency

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 21:14:56 -05:00
clucraft
be6dd6382e Add per-product AI extraction disable option
- Add ai_extraction_disabled column to products table
- Add toggle in Advanced Settings alongside AI verification disable
- Pass skipAiExtraction flag through scheduler to scraper
- Skip AI extraction fallback when flag is set for product

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 21:09:19 -05:00
clucraft
0a66d55d79 Add AI model selector to settings
- Add anthropic_model and openai_model columns to database
- Allow users to select their preferred AI model in settings
- Update defaults to current models (Claude Haiku 4.5, GPT-4.1 Nano)
- Include model options: Claude 4.5 series, GPT-4.1/5.1 series
- Pass user-selected model to all AI extraction/verification functions
- Log which model is being used for debugging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 20:58:54 -05:00
clucraft
7f6f108243 Switch from Sonnet 4 to Haiku 3.5 to reduce API costs
Sonnet 4 is ~4-12x more expensive than Haiku 3.5.
Haiku 3.5 should still be capable enough for price extraction.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 20:46:03 -05:00
clucraft
b9d8d15e68 Add per-product AI verification disable option
Users can now disable AI verification for individual products that
AI is having trouble with (e.g., Amazon products where AI keeps
picking the main buy box price instead of "other sellers").

Changes:
- Add ai_verification_disabled column to products table
- Add toggle in product detail page under "Advanced Settings"
- Pass skip flag to scrapeProductWithVoting
- Skip AI verification when flag is set

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 20:32:25 -05:00
clucraft
d2e1cc70fc Switch from Claude Haiku to Claude Sonnet for better accuracy
Haiku was being too literal in price extraction, often "correcting"
valid alternative prices (like Amazon other sellers) to the main
buy box price.

Sonnet is more capable and should handle nuanced cases better.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 19:24:37 -05:00
clucraft
6327fd6cf1 Skip AI verification when multiple price candidates exist
When the scraper finds multiple valid prices (e.g., Amazon main price +
other sellers), skip AI verification entirely. AI was "correcting"
valid alternative prices to the main buy box price.

Now with multiple candidates, users see all options in the modal and
choose themselves - no AI interference.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 19:23:04 -05:00
clucraft
3a3291a779 Fix Amazon multi-price extraction and prevent AI override
Amazon products can have multiple prices:
- Main buy box price
- "Other Sellers" prices
- Subscribe & Save prices
- New & Used prices

The scraper now extracts ALL prices, not just the main one. This allows
anchor price matching to find the specific price the user selected.

Also fixed AI verification overriding user's anchor price selection.
When user deliberately chose a price (e.g., "other sellers" at $52.91),
don't let AI "correct" it to the main buy box price ($79.99).

Changes:
- Amazon scraper now collects all price variants
- extractSiteSpecificCandidates handles allPrices array
- Anchor matching now always returns (no fall-through to AI override)
- Increased anchor tolerance from 10% to 15% for small sales
- Added debug logging showing all candidate prices

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 19:15:32 -05:00
clucraft
8131017f3a Fix anchor price selection - prioritize anchor over method
The previous logic checked preferred method first, which could select
a wrong price even when anchor price was available. Now:

1. PRIORITY 1: Anchor price - if user confirmed a price, find closest
   match (within 10% tolerance) across ALL candidates
2. PRIORITY 2: Preferred method - only used if no anchor match found
3. PRIORITY 3: Consensus voting

Also added debug logging to trace anchor price saving and retrieval.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 19:01:15 -05:00
clucraft
389915a6ec Add anchor price support for variant products
When a user confirms a price from the modal, we now store it as an
"anchor price". On subsequent refreshes, if multiple price candidates
are found (common with variant products like different sizes/colors),
we select the candidate closest to the anchor price.

This fixes the issue where variant products would randomly switch to
a different variant's price on refresh.

Changes:
- Add anchor_price column to products table
- Save anchor price when user confirms a price selection
- Use anchor price to select correct variant on refresh
- 20% tolerance - if no candidate is within 20% of anchor, fall back to consensus

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 15:50:18 -05:00
clucraft
bffc427fff Update README with emphasis on Price Voting Modal feature
- Add prominent "You Choose the Price. Always." section at the top
- Explain the 4-method extraction system (JSON-LD, site-specific, CSS, AI)
- Detail the Price Selection Modal and its benefits
- Compare to competitors (Keepa, CamelCamelCamel, Honey)
- Add new "Multi-Strategy Price Extraction" feature section
- Add "Supported Retailers" table with browser rendering info
- Mention AI Arbitration as a new capability

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 15:46:04 -05:00
clucraft
196ff8fd0b Fix Best Buy price extraction and add browser rendering for JS-heavy sites
- Fix TypeScript narrowing issue in Best Buy scraper
- Add browser rendering for JS-heavy sites (Best Buy, Target, Walmart, Costco)
- Improve Best Buy site-specific scraper with better selectors and logging
- Skip payment plan prices (/mo, per month, etc.)
- Enhance AI HTML preparation:
  - Extract JSON-LD data before removing scripts
  - Add price element extraction for better context
  - Increase character limit from 15000 to 25000

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 15:09:42 -05:00
clucraft
cf23ac9db1 fix: Always show price selection modal and use browser for JS-heavy sites
- Always show price selection modal when adding a product so users can verify
- Use browser rendering for known JS-heavy sites (Best Buy, Target, Walmart, Costco)
- Update modal text to say "Confirm Price" for single candidates

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 14:58:58 -05:00
clucraft
4fd04cd160 feat: Multi-strategy price voting system with user selection
- Add multi-strategy voting: runs JSON-LD, site-specific, generic CSS,
  and AI extraction methods in parallel
- Implement consensus voting to select the correct price when methods agree
- Add AI arbitration when extraction methods disagree
- Add PriceSelectionModal for users to select correct price when ambiguous
- Store preferred extraction method per product for faster re-checks
- Add database columns for preferred_extraction_method and needs_price_review

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 14:45:51 -05:00
clucraft
40c45b49c8 Fix Best Buy scraper picking up payment plan prices
- Add global filter in priceParser to reject monthly/payment plan prices
- Filters: "/mo", "per month", "payments starting", "4 payments", etc.
- Update Best Buy scraper to check each price element for payment terms
- Prevents scraping "$25/mo" instead of actual "$229.99" price

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 04:01:16 -05:00
clucraft
710e4c0483 Update changelog with particle background effect
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 03:41:49 -05:00
clucraft
2bbaab8793 Add particle background effect
- Pure CSS/JS particle animation behind all content
- Multiple layers with different speeds for depth effect
- Theme-aware: white particles on dark mode, purple on light mode
- Low opacity for subtle, non-distracting ambiance
- Uses box-shadow technique for performance

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 03:41:02 -05:00
clucraft
c4c05236c0 Update changelog for v1.0.3
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 03:21:46 -05:00
clucraft
28d6523959 Add Clear button to notification bell dropdown
- Add notifications_cleared_at column to users table
- Clear button marks notifications as seen without deleting history
- Badge and dropdown only show notifications after last clear
- History page still shows all notifications

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 03:20:03 -05:00
clucraft
262a91b558 Fix notification history crash when prices are strings
PostgreSQL DECIMAL fields are returned as strings by node-postgres.
Convert to numbers before calling toFixed() to prevent TypeError.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 03:10:06 -05:00
clucraft
38faf59d1e Add star history chart to README
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 20:40:34 -05:00
clucraft
fe857e3625 Move version info to sidebar in Settings page
- Relocate PriceGhost version, changelog, and GitHub links from bottom
  of page to underneath the left navigation buttons
- Update sidebar CSS to use flexbox for proper layout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 20:37:57 -05:00
clucraft
63fcaebfd8 Add notification history feature with bell icon and history page
- Add notification_history database table for logging all triggered notifications
- Create API endpoints for fetching recent and historical notifications
- Add NotificationBell component in navbar with badge showing recent count
- Dropdown shows 5 most recent notifications with links to products
- Create full NotificationHistory page with filtering by notification type
- Log notifications when sent: price drops, target prices, back-in-stock
- Track which channels (telegram, discord, pushover, ntfy) received each notification
- Update sendNotifications to return which channels succeeded
- Bump version to 1.0.3

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 20:32:34 -05:00
clucraft
45363e4d97
Update image in README.md 2026-01-23 14:12:29 -05:00
clucraft
01d6da7cea Center PriceGhost header SVG in viewBox
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:57:30 -05:00
clucraft
afa4f0c96a Fix stock status false positives for in-stock items
- Remove overly generic pre-order phrases that caused false positives
  ("available in", "coming in", "arriving in" matched normal text)
- Add in-stock phrase priority check - "in stock", "add to cart",
  "add to basket" now take precedence over pre-order detection
- Add Magento 2 stock status detection using stock classes and
  add-to-cart buttons
- Bump version to 1.0.2

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:56:26 -05:00
clucraft
2c8843ed8a Fix Ghost text gradient - keep end visible at 20% opacity
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:48:48 -05:00
clucraft
a8126e0fb3 Fix header SVG - widen viewBox to show full Ghost text
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:46:22 -05:00
clucraft
e18be5bbc7 Add Magento 2 site scraper for better price extraction
- Added dedicated Magento 2 scraper that targets data-price-amount
- Looks for price in correct context (price-box, special-price, finalPrice)
- Properly detects CHF, EUR, GBP, USD currencies
- Improved generic currency detection with multiple text sources
- Fixes CHF price extraction for Degussa gold shop and other Magento sites

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:43:35 -05:00
clucraft
5a682276b6 Add Magento price selector support
- Added data-price-amount selector (Magento 2 stores numeric price here)
- Added .price-wrapper, .price-box, .special-price selectors
- Extract price directly from data-price-amount attribute
- Detect currency from surrounding text when using numeric attribute
- Fixes CHF price extraction from Magento/Degussa gold shop

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:35:48 -05:00
clucraft
925ff1cb27 v1.0.1: CI optimization, changelog update
- CI/CD now only rebuilds images when backend/ or frontend/ changes
- Uses dorny/paths-filter to detect which components changed
- README, docs, and asset changes no longer trigger builds
- Updated CHANGELOG with all recent changes
- Bumped version to 1.0.1

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:31:27 -05:00
clucraft
18cf8125cd
Update header image width in README
Increased the width of the header image from 450 to 500 pixels.
2026-01-23 13:30:58 -05:00
clucraft
5bafab3623
Update header image width in README
Reduced header image width in README.
2026-01-23 13:30:19 -05:00
clucraft
85dc4b9b34
Update header image width in README
Increased the width of the header image from 500 to 600 pixels.
2026-01-23 13:30:00 -05:00
clucraft
9398b5989c Fix README header: remove space, adjust gradient opacity
- Removed space between Price and Ghost (now one word)
- Ghost gradient starts at 85% opacity for smoother transition
- Price text remains fully prominent

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:26:24 -05:00
clucraft
b8c3b80db7 Add ghostly header SVG for README
- Combined icon + PriceGhost text in single SVG header
- Ghost text has gradient fade effect (solid to transparent)
- Subtle glow filter for ethereal look
- Replaces separate icon and h1 in README

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:23:54 -05:00