Conversation
There was a problem hiding this comment.
Pull request overview
This PR represents a major architectural shift from an MCP (Model Context Protocol) server to an HTTP API server for the Moonverse MoonBit documentation search service. The changes include migrating to a newer Google Gemini SDK, implementing an asynchronous task queue system with polling, adding file caching, and introducing deployment configurations.
- Replaced MCP protocol with HTTP JSON API supporting docs, source, and hybrid query modes
- Migrated from
@google/generative-aiv0.24.1 to@google/genaiv1.34.0 - Implemented file caching system to avoid redundant uploads to Gemini
- Added API key authentication with per-user keys and global quota (100/day)
- Introduced deployment infrastructure (Docker, Kubernetes, GitHub Actions)
Reviewed changes
Copilot reviewed 28 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Updated dependencies: esbuild 0.25→0.27, removed MCP SDK, added @google/genai v1.34.0, added undici proxy support |
| package.json | Removed MCP dependencies, added @google/genai, undici, prettier; added format scripts |
| src/index.ts | Complete rewrite from MCP server to HTTP server initialization |
| src/server.ts | New HTTP server with task queue, polling endpoints, CORS support, and API key management |
| src/query.ts | Query execution logic for docs/source/hybrid modes with progress tracking |
| src/search.ts | Local source code search with LLM-organized results and symbol query support |
| src/store.ts | File upload management with caching integration |
| src/cache.ts | File caching system with 47-hour TTL and hash validation |
| src/genai.ts | AI client factory with proxy support and upload URL rewriting |
| src/files.ts | File system utilities for reading and traversing directories |
| src/types.ts | TypeScript type definitions for tasks, cache, and API usage |
| src/utils.ts | Logging and timing utilities |
| README.md | Updated documentation for HTTP API usage in Chinese |
| USAGE.md | Complete rewrite with HTTP API examples and troubleshooting |
| ARCHITECTURE.md | New architecture documentation with flow diagrams |
| Agents.md | Detailed developer guide with commands and workflows |
| Dockerfile | Multi-stage Docker build configuration |
| k8s.yaml | Kubernetes deployment manifests with health checks |
| .github/workflows/*.yaml | CI/CD workflows for Docker builds on PR and release |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import { randomUUID } from 'crypto'; | ||
| import { z } from 'zod'; | ||
| import { GoogleGenAI } from '@google/genai'; | ||
| import { Task, TaskProgress, DailyUsage, DAILY_LIMIT } from './types.js'; |
There was a problem hiding this comment.
Unused import TaskProgress.
Suggested change
| import { Task, TaskProgress, DailyUsage, DAILY_LIMIT } from './types.js'; | |
| import { Task, DailyUsage, DAILY_LIMIT } from './types.js'; |
| import { z } from 'zod'; | ||
| import { GoogleGenAI } from '@google/genai'; | ||
| import { Task, TaskProgress, DailyUsage, DAILY_LIMIT } from './types.js'; | ||
| import { runQuery, updateTaskProgress } from './query.js'; |
There was a problem hiding this comment.
Unused import updateTaskProgress.
Suggested change
| import { runQuery, updateTaskProgress } from './query.js'; | |
| import { runQuery } from './query.js'; |
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.
No description provided.