Merged
Conversation
Contributor
amaruki
commented
Feb 18, 2026
- change LLM protocol from Gemini API to OpenAI SDK
- add configuration for deployment
- secure refresh, schedule start/stop, config API
- secure config with AdminGuard component
- add CTA to telegram bot
- enforces schedule as UTC +7 (WIB)
Add *.log and data/*.json to .gitignore to prevent committing runtime artifacts. Remove existing backend and frontend log files.
Replace @google/genai with openai dependency to interact with the Antigravity Manager via OpenAI-compatible endpoints. Refactor client initialization and content generation to use chat completions instead of the Gemini API structure. Key changes: - Update dependency from @google/genai to openai - Modify generateContent to use openai.chat.completions.create - Update error handling to detect OpenAI rate limit errors - Increase test timeout in llm-client.test.ts
- Replace single chat ID config with database-driven user management - Add `telegram_users` table and related schema migrations - Implement polling service for handling /start and /stop commands - Update notification sender to broadcast to all active subscribers - Automatically deactivate users if bot is blocked (403 Forbidden)
Enable the API server to serve the compiled frontend application from `web/dist` with SPA fallback support. Update database and config loading to use absolute paths relative to CWD to ensure correct behavior in compiled builds. Add build and serve scripts to package.json.
Add ecosystem.config.cjs to support running the application with PM2 using the Bun interpreter.
Add a new section to the configuration page with instructions on how to subscribe to Telegram alerts for recommendations and anomalies.
This commit introduces a security layer for administrative actions and enhances user engagement: - Add `AdminGuard` component and backend middleware to protect sensitive endpoints using a password defined in environment variables. - Refactor `ConfigPage` to require authentication and provide a lock mechanism. - Add `TelegramCallToAction` component to the dashboard to encourage bot subscriptions. - Update documentation with production deployment and PM2 instructions.
Remove verbose comments and exclude /api/analyze-ticker from the protected paths list to focus security on core administrative endpoints.
Introduces `isMarketOpen` and `getJakartaTime` functions to determine if the Indonesia Stock Exchange (IDX) is currently trading. The `monitor` service now utilizes this check to prevent data fetching and prediction updates from running outside official trading hours and on weekends, improving efficiency and resource management.
Moved the logic for transforming Yahoo quote data into the internal StockQuote type into a new dedicated function, `mapYahooQuoteToStockQuote`. This allows the `prediction-tracker` and `monitor` services to directly utilize the comprehensive quote data provided by `updateAllPredictions`, avoiding unnecessary subsequent calls to `fetchCurrentQuote` for details like volume. This improves data flow and reduces API requests.
Integrates Zod for defining and validating LLM response schemas. The `generateContent` function now supports an optional Zod schema, enabling automatic validation of LLM output. Implements retry logic that provides detailed validation errors back to the LLM for self-correction. This enhances the reliability and consistency of LLM-generated data. Introduces new `tickerExtractionSchema` and `stockAnalysisSchema` along with their respective unit tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.