-
Notifications
You must be signed in to change notification settings - Fork 0
Prototype #2
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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'; |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import TaskProgress.
| 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'; |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import updateTaskProgress.
| import { runQuery, updateTaskProgress } from './query.js'; | |
| import { runQuery } from './query.js'; |
No description provided.