-
Notifications
You must be signed in to change notification settings - Fork 0
Nitro #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nitro #1
Conversation
…ariables and providers
- Removed unnecessary "paths" configuration from tsconfig.json. - Changed import statements in chat.ts and webhook.ts to use 'import type' for better clarity and performance.
…date types and OpenAPI specs - Renamed PostMessageData to SendMessageData and updated related types. - Refactored response types for sending messages and editing messages. - Updated OpenAPI specifications to reflect changes in message sending and editing endpoints. - Adjusted utility functions to use the new sendMessage method. - Cleaned up unused types and errors in the Zod validation schemas. - Enhanced response structures for better clarity and consistency.
- Updated generateResponse to include bot creator information. - Modified handle-app-mention to utilize GetSessionResponse for user identification. - Enhanced handle-messages to check for keywords and direct messages before processing. - Refactored slack-utils to accept GetSessionResponse for user identification in getThread. - Updated OpenAPI specifications to remove unnecessary required fields and improve response descriptions. - Adjusted package.json build script to streamline the build process. - Made profile_background_upload_url optional in User interface for better flexibility.
- Removed unused imports of zod and zGetSessionResponse from handle-app-mention.ts, handle-messages.ts, and slack-utils.ts. - Commented out zod plugin and validator in openapi-ts.config.ts. - Added new error response codes (400, 403, 429, 500) to openapi.json for improved API documentation.
…ce in message handling; enable zod validation in OpenAPI config; add server restart script
…scourse; enhance package scripts for linting and checking
- Updated import statements in `chat.ts`, `discourse.ts`, `index.ts`, and `webhook.ts` to use single quotes for consistency. - Removed trailing commas in `tsconfig.json` and adjusted the `exclude` and `include` arrays for clarity. - Ensured all type definitions in `webhook.ts` are properly formatted and aligned for better readability.
…d API definitions
…tching thread details and messages
… integrate env-core package
…nt variables - Created API endpoint that returns "Hello World!" - Added configuration file with keywords, location, and speed settings - Implemented environment variable management using zod for validation - Developed AI response generation logic with weather fetching capability - Handled app mentions and message processing for AI interactions - Introduced utility functions for Slack message handling and verification - Defined types for chat and webhook interactions - Updated TypeScript configuration for improved compatibility - Removed obsolete Vercel configuration file
…event and status utilities
…dMessages functions
- Updated import paths in events.post.ts for consistency. - Removed deprecated ai/providers.ts file. - Added prompts.ts to define various AI prompts for response generation. - Reintroduced providers.ts with updated structure for AI model integration. - Created discourse-utils.ts for handling Discourse API interactions. - Implemented generate-response.ts to manage AI response generation logic. - Added handle-app-mention.ts to process app mentions and generate responses. - Created handle-messages.ts to manage incoming chat messages and trigger AI responses.
…tions and chat messages - Deleted the run.sh script that was used to start the Bun server in a loop. - Added a new API endpoint at server/api/events/index.post.ts to handle incoming events from Discourse, including app mentions and chat messages. - Updated tsconfig.json to enable strict null checks for better type safety.
- Updated nitro.config.ts to set esbuild target to "esnext". - Added new dependencies in package.json for date-fns and compromise. - Implemented a logger using pino for better logging in various modules. - Created prompts for AI responses in server/lib/ai/prompts.ts. - Added AI provider configurations in server/lib/ai/providers.ts. - Refactored event handling to use the new logger in server/api/events/index.post.ts. - Updated discourse utility functions to log signature validation and HMAC comparison. - Enhanced message handling with logging in server/utils/handle-app-mention.ts and server/utils/handle-messages.ts. - Introduced utility functions for time zone handling in server/utils/time.ts. - Added message tokenization functions in server/utils/tokenize-messages.ts.
…hat messages and notifications
…sage and notification processing
…message formatting in getMessages
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Caution Review failedThe pull request is closed. WalkthroughThis update transitions the project from a Slack-based AI chatbot to a Discourse-based chatbot, introducing a new modular server-side architecture. It removes Slack-specific logic and adds comprehensive support for Discourse APIs, event handling, AI-driven response generation, and utilities for rate limiting, logging, and validation. The codebase now features a robust configuration, OpenAPI-generated client SDK, and improved type safety. Changes
Sequence Diagram(s)sequenceDiagram
participant Discourse as Discourse Webhook
participant API as /api/events.post
participant Verifier as verifyRequest
participant BotUser as getBotUser
participant Events as events[eventType]
participant AI as generateResponse
participant DiscourseAPI as sendMessage
Discourse->>API: POST event (chat_message/notification)
API->>Verifier: Verify request signature
Verifier-->>API: Valid/Invalid
API->>BotUser: Retrieve bot user session
BotUser-->>API: Bot user
API->>Events: Find handler for event type
API->>Events: Execute handler with payload and bot user
Events->>AI: Generate AI response (if applicable)
AI-->>Events: AI-generated reply
Events->>DiscourseAPI: Send reply message
DiscourseAPI-->>Events: Reply confirmation
API-->>Discourse: 200 OK / error response
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (53)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Refactor
Documentation