Add Elicitation, Linting, Convert test infrastructure, Other refinements#5
Merged
Merged
Conversation
Initial elicitation implementation and tool call consolidation.
Co-authored-by: chrisreddington <791642+chrisreddington@users.noreply.github.com>
Co-authored-by: chrisreddington <791642+chrisreddington@users.noreply.github.com>
Co-authored-by: chrisreddington <791642+chrisreddington@users.noreply.github.com>
Tech Debt: Consolidate hardcoded constants and eliminate duplicate difficulty styling
Co-authored-by: chrisreddington <791642+chrisreddington@users.noreply.github.com>
Co-authored-by: chrisreddington <791642+chrisreddington@users.noreply.github.com>
Co-authored-by: chrisreddington <791642+chrisreddington@users.noreply.github.com>
Co-authored-by: chrisreddington <791642+chrisreddington@users.noreply.github.com>
Consolidate duplicate code patterns and remove dead code
…ck-paper-scissors page
Fix smart elicitation and add tests
Co-authored-by: chrisreddington <791642+chrisreddington@users.noreply.github.com>
Co-authored-by: chrisreddington <791642+chrisreddington@users.noreply.github.com>
Fix ESLint Errors in Shared Library Workspace
Bumps the npm-development group with 4 updates: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node), [typescript](https://github.com/microsoft/TypeScript), [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next) and [undici](https://github.com/nodejs/undici). Updates `@types/node` from 24.1.0 to 24.2.0 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Updates `typescript` from 5.8.3 to 5.9.2 - [Release notes](https://github.com/microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml) - [Commits](microsoft/TypeScript@v5.8.3...v5.9.2) Updates `eslint-config-next` from 15.4.5 to 15.4.6 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](https://github.com/vercel/next.js/commits/v15.4.6/packages/eslint-config-next) Updates `undici` from 7.12.0 to 7.13.0 - [Release notes](https://github.com/nodejs/undici/releases) - [Commits](nodejs/undici@v7.12.0...v7.13.0) --- updated-dependencies: - dependency-name: "@types/node" dependency-version: 24.2.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-development - dependency-name: typescript dependency-version: 5.9.2 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-development - dependency-name: eslint-config-next dependency-version: 15.4.6 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm-development - dependency-name: undici dependency-version: 7.13.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm-development ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps the npm-production group with 2 updates: [next](https://github.com/vercel/next.js) and [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk). Updates `next` from 15.4.5 to 15.4.6 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](vercel/next.js@v15.4.5...v15.4.6) Updates `@modelcontextprotocol/sdk` from 1.17.0 to 1.17.1 - [Release notes](https://github.com/modelcontextprotocol/typescript-sdk/releases) - [Commits](modelcontextprotocol/typescript-sdk@1.17.0...1.17.1) --- updated-dependencies: - dependency-name: next dependency-version: 15.4.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-production - dependency-name: "@modelcontextprotocol/sdk" dependency-version: 1.17.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm-production ... Signed-off-by: dependabot[bot] <support@github.com>
…pm-development-1fad86d8f6 Bump the npm-development group with 4 updates
…pm-production-1b125f1a35 Bump the npm-production group with 2 updates
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR significantly modernizes the codebase by migrating from Jest to Vitest, improving type safety through centralized constants, and refactoring testing infrastructure across all packages. The main focus is on eliminating duplication and establishing consistent patterns.
Key changes include:
- Migration from Jest to Vitest testing framework with shared test utilities
- Centralization of game constants and types in the shared package
- Addition of ESLint configuration and interactive elicitation features
Reviewed Changes
Copilot reviewed 93 out of 96 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| web/vitest.setup.ts | New Vitest setup replacing Jest configuration |
| web/vitest.config.ts | Vitest configuration with coverage thresholds |
| web/package.json | Updated dependencies from Jest to Vitest |
| shared/src/constants/game-constants.ts | New centralized constants module |
| shared/src/testing/vitest-setup.ts | Shared test setup utilities |
| mcp-server/src/handlers/elicitation-handlers.ts | New interactive user preference collection |
| mcp-server/src/handlers/tool-handlers.ts | Refactored to use centralized constants |
Comments suppressed due to low confidence (1)
mcp-server/src/utils/http-client.ts:48
- The type casting '(games as GenericGameStateWrapper[])' assumes the API response structure without validation. Consider adding runtime type checking or using a type guard to ensure the response matches the expected structure before casting.
export async function getGameViaAPI(gameType: string, gameId: string): Promise<GenericGameStateWrapper | undefined> {
try {
const games = await httpGet(`${WEB_API_BASE}/api/games/${gameType}/mcp`)
return (games as GenericGameStateWrapper[]).find((game) => game.gameState?.id === gameId)
} catch (error) {
console.error(`Error fetching ${gameType} game via API:`, error)
return undefined
}
}
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
This pull request makes significant improvements to type safety, code consistency, and developer tooling across the project, especially focusing on centralizing constants and types, removing duplication, and refactoring the testing and linting infrastructure. The most important changes are summarized below.
Type Safety and Constants Consolidation
DIFFICULTIES,GAME_TYPES,PLAYER_IDS, etc.) in the shared library, and enforces that all types likeDifficulty,GameType, andPlayerIdare derived from these constants usingas constassertions. Updates copilot instructions to import these types instead of redefining union types.Difficultytype, ensuring consistent difficulty handling across all games.Testing Infrastructure Refactoring
package.json.Linting and Developer Tooling
typescript-eslintfor improved TypeScript linting and code quality enforcement. Customizes rules for the MCP server and adds ignore patterns.Code Consistency and Minor Refactoring
Build and Runtime Adjustments
package.jsonto useserver.jsinstead ofindex.js, aligning with the new build output.These changes collectively improve maintainability and type safety across the codebase.