Skip to content

Conversation

@tiye
Copy link
Member

@tiye tiye commented Dec 18, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 18, 2025 16:53
Copy link

Copilot AI left a 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-ai v0.24.1 to @google/genai v1.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';
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import TaskProgress.

Suggested change
import { Task, TaskProgress, DailyUsage, DAILY_LIMIT } from './types.js';
import { Task, DailyUsage, DAILY_LIMIT } from './types.js';

Copilot uses AI. Check for mistakes.
import { z } from 'zod';
import { GoogleGenAI } from '@google/genai';
import { Task, TaskProgress, DailyUsage, DAILY_LIMIT } from './types.js';
import { runQuery, updateTaskProgress } from './query.js';
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import updateTaskProgress.

Suggested change
import { runQuery, updateTaskProgress } from './query.js';
import { runQuery } from './query.js';

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants