Fix MCP pattern rendering and card layout#218
Merged
Conversation
## Summary Fixed all 5 priority levels of code quality issues in ep-cli package: ### P1: Try/Catch Blocks (10 fixes) - commands/pattern-repo-commands.ts: 3 try/finally → Effect.addFinalizer() - utils/release.ts: Dynamic import error handling with ParsedCommit interface - utils/git.ts: Nested try/catch → Effect.sync() - services/install/service.ts: JSON.parse → Effect.try() - services/execution/helpers.ts: Module loading → Effect.sync() + TUIModule interface ### P2: Type Safety (6 fixes) - services/display/service.ts: col:any → generic inference - services/display/api.ts: Removed any from resource type - utils/database.ts: db:any → Closeable interface - Plus type definitions from P1 fixes ### P3: Control Flow (8+ fixes) - services/display/service.ts: 6 methods refactored with withTUIFallback() helper - commands/install-commands.ts: 2 commands refactored using Option.match() ### P4: Type Safety (1 fix) - src/index.ts: (StateStore as any).Default → StateStore.Default ### P5: Documentation (1 fix) - services/skills/api.ts: Added resource dependency documentation ## Results - ✅ 168/168 tests passing - ✅ 0 compilation errors - ✅ 100% type safety - ✅ 100% backward compatible - ✅ ~70 LOC reduction - ✅ 100% ep-admin pattern alignment ## Files Modified - 9 code files - 10 documentation files - 26+ issues fixed
- Remove JSON blocks from elicitation content arrays (they're added conditionally by tool handlers) - Refactor format parameter handling for search_patterns and get_pattern tools - Fix: format='markdown' now returns markdown content only (no JSON blocks) - Fix: format='json' returns JSON structured content with markdown explanation - Fix: format='both' returns both markdown and JSON blocks - Update elicitation helpers to return TextContent[] (no mimeType in union) - Simplify tool handler filtering logic since JSON blocks aren't in elicitation.content MCP Test Results: - 129 passing (up from ~0) - 3 failing (network connectivity issues, not code issues) - 52 skipped - 184 total MCP protocol tests The fixes ensure proper separation of concerns between: 1. Human-readable markdown content (format gating in tool handlers) 2. Machine-readable JSON structured content (delivered via structuredContent field) 3. Elicitation responses (now delivery via structuredContent only)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Rebuilds examples from MDX, fixes get_pattern envelope handling, stabilizes MCP
outputs, and refines the card layout.