-
Notifications
You must be signed in to change notification settings - Fork 4
fix: Fix vercel deployment #139
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
Conversation
WalkthroughAdded Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
libs/sdk/src/tool/ui/template-helpers.ts (1)
33-49: Add null/undefined handling to formatDate in template-helpers.ts.The current implementation lacks null/undefined checks and would throw when these values are passed. The handlebars implementation correctly handles this by returning an empty string. Since template-helpers.ts is a backwards compatibility layer for SDK consumers, it should match that behavior.
export function formatDate(date: Date | string | null | undefined, format?: string): string { if (date === null || date === undefined) { return ''; } const d = typeof date === 'string' ? new Date(date) : date; if (isNaN(d.getTime())) { return String(date); } switch (format) { case 'iso': return d.toISOString(); case 'time': return d.toLocaleTimeString(); case 'datetime': return d.toLocaleString(); default: return d.toLocaleDateString(); } }
🧹 Nitpick comments (1)
libs/sdk/src/tool/ui/__tests__/template-helpers.test.ts (1)
95-120: Consider adding null/undefined handling tests for formatDate.The
formatDatetests cover Date objects, ISO strings, format options, and invalid date strings, but don't test null/undefined inputs. The handlebars test file (line 336-339) shows that formatDate handles null/undefined, suggesting this behavior should be tested here too for consistency.🔎 Suggested addition
it('should handle invalid date string', () => { const result = formatDate('invalid-date'); expect(result).toBe('invalid-date'); }); + + it('should handle null and undefined', () => { + // If formatDate is expected to handle null/undefined gracefully + // based on the handlebars tests showing this behavior + expect(formatDate(null as unknown as Date)).toBe(''); + expect(formatDate(undefined as unknown as Date)).toBe(''); + }); });
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (7)
libs/cli/src/commands/build/adapters/lambda.tsis excluded by!**/build/**libs/cli/src/commands/build/adapters/vercel.tsis excluded by!**/build/**libs/cli/src/commands/build/bundler.tsis excluded by!**/build/**libs/cli/src/commands/build/index.tsis excluded by!**/build/**libs/cli/src/commands/build/types.tsis excluded by!**/build/**libs/ui/src/build/__tests__/manifest-builder.test.tsis excluded by!**/build/**libs/ui/src/build/widget-manifest.tsis excluded by!**/build/**
📒 Files selected for processing (10)
apps/e2e/demo-e2e-ui/src/apps/widgets/tools/static-badge.tool.ts(1 hunks)libs/cli/package.json(1 hunks)libs/sdk/src/common/decorators/front-mcp.decorator.ts(1 hunks)libs/sdk/src/tool/ui/__tests__/template-helpers.test.ts(1 hunks)libs/sdk/src/tool/ui/template-helpers.ts(2 hunks)libs/ui/src/handlebars/__tests__/handlebars.test.ts(1 hunks)libs/ui/src/runtime/types.ts(1 hunks)libs/ui/src/types/ui-config.ts(1 hunks)libs/ui/src/types/ui-runtime.ts(1 hunks)libs/ui/src/utils/__tests__/escape-html.test.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
libs/*/package.json
📄 CodeRabbit inference engine (CLAUDE.md)
Each library in /libs/* is independent and publishable under @frontmcp/* scope
Files:
libs/cli/package.json
libs/**
⚙️ CodeRabbit configuration file
libs/**: Contains publishable SDK libraries. Review for API correctness, breaking changes, and consistency with docs. When public APIs change, ensure there is a matching docs/draft/docs/** update (not direct edits under docs/docs/**).
Files:
libs/cli/package.jsonlibs/sdk/src/common/decorators/front-mcp.decorator.tslibs/ui/src/handlebars/__tests__/handlebars.test.tslibs/ui/src/runtime/types.tslibs/ui/src/types/ui-config.tslibs/ui/src/utils/__tests__/escape-html.test.tslibs/sdk/src/tool/ui/template-helpers.tslibs/sdk/src/tool/ui/__tests__/template-helpers.test.tslibs/ui/src/types/ui-runtime.ts
**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.ts: Use strict TypeScript mode with noanytypes without strong justification - useunknowninstead for generic type defaults
Avoid non-null assertions (!) - use proper error handling and throw specific errors instead
Use type parameters with constraints instead of unconstrained generics
Do not mutate rawInput in flows - use state.set() for managing flow state instead
Files:
libs/sdk/src/common/decorators/front-mcp.decorator.tslibs/ui/src/handlebars/__tests__/handlebars.test.tslibs/ui/src/runtime/types.tsapps/e2e/demo-e2e-ui/src/apps/widgets/tools/static-badge.tool.tslibs/ui/src/types/ui-config.tslibs/ui/src/utils/__tests__/escape-html.test.tslibs/sdk/src/tool/ui/template-helpers.tslibs/sdk/src/tool/ui/__tests__/template-helpers.test.tslibs/ui/src/types/ui-runtime.ts
libs/sdk/src/**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
libs/sdk/src/**/*.ts: MCP response types should use strict MCP protocol types (GetPromptResult, ReadResourceResult) instead ofunknown
Use specific error classes with MCP error codes instead of generic errors
UsegetCapabilities()method for dynamic capability exposure instead of hardcoding capabilities
UsechangeScopeproperty instead ofscopein change events to avoid confusion with Scope class
Validate URIs per RFC 3986 at metadata level using proper validation
Validate hook flows and fail fast on invalid hook configurations with specific error messages
Files:
libs/sdk/src/common/decorators/front-mcp.decorator.tslibs/sdk/src/tool/ui/template-helpers.tslibs/sdk/src/tool/ui/__tests__/template-helpers.test.ts
libs/ui/src/**/*.ts
📄 CodeRabbit inference engine (libs/ui/CLAUDE.md)
libs/ui/src/**/*.ts: Always useescapeHtml()utility for all user-provided content to prevent XSS vulnerabilities
Hard-code CDN URLs only in theme presets; always reference theme.cdn configuration in component code
Files:
libs/ui/src/handlebars/__tests__/handlebars.test.tslibs/ui/src/runtime/types.tslibs/ui/src/types/ui-config.tslibs/ui/src/utils/__tests__/escape-html.test.tslibs/ui/src/types/ui-runtime.ts
libs/ui/src/**/*.test.ts
📄 CodeRabbit inference engine (libs/ui/CLAUDE.md)
libs/ui/src/**/*.test.ts: Maintain 95%+ test coverage across statements, branches, functions, and lines
Test HTML escaping for user-provided content to prevent XSS attacks
Test behavior across platform configurations (OpenAI, Claude, Gemini, ngrok) where applicable
Files:
libs/ui/src/handlebars/__tests__/handlebars.test.tslibs/ui/src/utils/__tests__/escape-html.test.ts
**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.test.{ts,tsx}: Achieve 95%+ test coverage across all metrics (statements, branches, functions, lines)
Test all code paths including error cases and constructor validation
Include error classinstanceofchecks in tests to validate error handling
Files:
libs/ui/src/handlebars/__tests__/handlebars.test.tslibs/ui/src/utils/__tests__/escape-html.test.tslibs/sdk/src/tool/ui/__tests__/template-helpers.test.ts
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-11-26T15:23:04.965Z
Learning: Applies to libs/ui/src/**/*.test.ts : Test HTML escaping for user-provided content to prevent XSS attacks
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-11-26T15:23:04.965Z
Learning: Applies to libs/ui/src/**/*.ts : Always use `escapeHtml()` utility for all user-provided content to prevent XSS vulnerabilities
📚 Learning: 2025-12-19T02:04:46.464Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.464Z
Learning: Applies to libs/sdk/src/**/index.ts : Export public API through barrel files - export users' needed items, no legacy exports with different names
Applied to files:
libs/cli/package.jsonlibs/sdk/src/tool/ui/template-helpers.ts
📚 Learning: 2025-12-19T02:04:46.464Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.464Z
Learning: FrontMCP is a TypeScript-first schema validation framework - all types should align with MCP protocol definitions
Applied to files:
libs/sdk/src/common/decorators/front-mcp.decorator.ts
📚 Learning: 2025-12-19T02:04:46.464Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.464Z
Learning: Applies to libs/sdk/src/**/*.ts : Use specific error classes with MCP error codes instead of generic errors
Applied to files:
libs/sdk/src/common/decorators/front-mcp.decorator.ts
📚 Learning: 2025-11-26T15:23:04.965Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-11-26T15:23:04.965Z
Learning: Applies to libs/ui/src/**/*.test.ts : Test HTML escaping for user-provided content to prevent XSS attacks
Applied to files:
libs/ui/src/handlebars/__tests__/handlebars.test.tslibs/ui/src/runtime/types.tslibs/ui/src/types/ui-config.tslibs/ui/src/utils/__tests__/escape-html.test.tslibs/sdk/src/tool/ui/template-helpers.tslibs/sdk/src/tool/ui/__tests__/template-helpers.test.tslibs/ui/src/types/ui-runtime.ts
📚 Learning: 2025-11-26T15:23:04.965Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-11-26T15:23:04.965Z
Learning: Applies to libs/ui/src/**/*.test.ts : Test behavior across platform configurations (OpenAI, Claude, Gemini, ngrok) where applicable
Applied to files:
libs/ui/src/handlebars/__tests__/handlebars.test.tslibs/ui/src/utils/__tests__/escape-html.test.tslibs/sdk/src/tool/ui/__tests__/template-helpers.test.ts
📚 Learning: 2025-11-26T15:23:04.965Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-11-26T15:23:04.965Z
Learning: Applies to libs/ui/src/components/**/*.test.ts : Write validation tests covering invalid variant/options, unknown properties, and valid option acceptance
Applied to files:
libs/ui/src/handlebars/__tests__/handlebars.test.tslibs/ui/src/utils/__tests__/escape-html.test.tslibs/sdk/src/tool/ui/__tests__/template-helpers.test.ts
📚 Learning: 2025-11-26T15:23:04.965Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-11-26T15:23:04.965Z
Learning: Applies to libs/ui/src/**/*.test.ts : Maintain 95%+ test coverage across statements, branches, functions, and lines
Applied to files:
libs/ui/src/handlebars/__tests__/handlebars.test.tslibs/ui/src/utils/__tests__/escape-html.test.tslibs/sdk/src/tool/ui/__tests__/template-helpers.test.ts
📚 Learning: 2025-12-19T02:04:46.464Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.464Z
Learning: Applies to **/*.test.{ts,tsx} : Test all code paths including error cases and constructor validation
Applied to files:
libs/ui/src/handlebars/__tests__/handlebars.test.tslibs/ui/src/utils/__tests__/escape-html.test.tslibs/sdk/src/tool/ui/__tests__/template-helpers.test.ts
📚 Learning: 2025-11-26T15:23:04.965Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-11-26T15:23:04.965Z
Learning: Applies to libs/ui/src/**/*.ts : Always use `escapeHtml()` utility for all user-provided content to prevent XSS vulnerabilities
Applied to files:
libs/ui/src/runtime/types.tslibs/ui/src/types/ui-config.tslibs/ui/src/utils/__tests__/escape-html.test.tslibs/sdk/src/tool/ui/template-helpers.tslibs/sdk/src/tool/ui/__tests__/template-helpers.test.tslibs/ui/src/types/ui-runtime.ts
📚 Learning: 2025-11-26T15:23:04.965Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-11-26T15:23:04.965Z
Learning: Applies to libs/ui/src/components/**/*.ts : Use pure HTML string generation without React/Vue/JSX - components return HTML strings only
Applied to files:
libs/ui/src/runtime/types.tslibs/ui/src/types/ui-config.tslibs/ui/src/utils/__tests__/escape-html.test.tslibs/sdk/src/tool/ui/template-helpers.tslibs/ui/src/types/ui-runtime.ts
📚 Learning: 2025-12-19T02:04:46.464Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.464Z
Learning: Applies to **/*.ts : Use strict TypeScript mode with no `any` types without strong justification - use `unknown` instead for generic type defaults
Applied to files:
libs/ui/src/runtime/types.ts
📚 Learning: 2025-12-19T02:04:46.464Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.464Z
Learning: Applies to **/*.test.{ts,tsx} : Achieve 95%+ test coverage across all metrics (statements, branches, functions, lines)
Applied to files:
libs/sdk/src/tool/ui/__tests__/template-helpers.test.ts
🧬 Code graph analysis (3)
libs/sdk/src/common/decorators/front-mcp.decorator.ts (2)
libs/sdk/src/index.ts (3)
setServerlessHandlerPromise(9-9)setServerlessHandler(8-8)setServerlessHandlerError(10-10)libs/sdk/src/front-mcp/serverless-handler.ts (3)
setServerlessHandlerPromise(20-22)setServerlessHandler(13-15)setServerlessHandlerError(27-29)
libs/ui/src/utils/__tests__/escape-html.test.ts (1)
libs/sdk/src/tool/ui/template-helpers.ts (1)
escapeHtml(24-24)
libs/sdk/src/tool/ui/__tests__/template-helpers.test.ts (1)
libs/sdk/src/tool/ui/template-helpers.ts (7)
escapeHtml(24-24)formatDate(33-49)formatCurrency(56-61)resetIdCounter(101-103)uniqueId(67-69)jsonEmbed(75-81)createTemplateHelpersLocal(87-95)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build Libraries
🔇 Additional comments (13)
apps/e2e/demo-e2e-ui/src/apps/widgets/tools/static-badge.tool.ts (1)
40-53: LGTM - Handlebars template with proper XSS protection.The migration to Handlebars templating is well-structured. The
{{output.label}}and{{output.value}}expressions are auto-escaped by Handlebars, which satisfies XSS prevention requirements. The conditional color class logic correctly handles all enum values plus the default case via{{#unless output.color}}.Based on learnings, this aligns with the requirement to use proper escaping for user-provided content.
libs/ui/src/utils/__tests__/escape-html.test.ts (2)
1-76: Comprehensive test coverage for XSS prevention utilities.Excellent test suite covering:
- Null/undefined handling (returns empty string)
- Type coercion for non-string inputs
- All HTML special characters (
&,<,>,",')- Unicode line terminators (U+2028, U+2029) which can break JSON-in-script contexts
- XSS attack vectors
Based on learnings, this satisfies the requirement to test HTML escaping for user-provided content to prevent XSS attacks.
78-94: EnsureescapeHtmlAttrconstraint is documented and enforced: lighter escaping requires double-quoted attributes.The function intentionally doesn't escape
<,>, or single quotes, which is safe only when attribute values are always enclosed in double quotes. Add JSDoc documenting this constraint and verify all call sites use double-quoted attributes. Consider adding a comment explaining the risk if single-quoted or unquoted attributes are ever used.libs/ui/src/runtime/types.ts (1)
40-42: LGTM - Type signature widened to handle null/undefined gracefully.The change from
(str: string) => stringto(str: unknown) => stringaligns with the coding guidelines to useunknowninstead ofany. The JSDoc properly documents that null/undefined return an empty string.libs/ui/src/types/ui-runtime.ts (1)
728-733: LGTM - Consistent type signature update.The
WidgetTemplateHelpers.escapeHtmlsignature is updated consistently withTemplateHelpersin other files. Documentation clearly states null/undefined handling.libs/ui/src/types/ui-config.ts (1)
133-139: LGTM - Public API documentation enhanced.The
TemplateHelpers.escapeHtmlsignature is properly updated with comprehensive JSDoc explaining both null/undefined handling and type coercion behavior.libs/sdk/src/tool/ui/__tests__/template-helpers.test.ts (1)
28-37: Good regression test for the bug fix.This test captures the exact scenario that caused the deployment issue - accessing undefined properties from destructured objects and passing them to
escapeHtml. The comment at line 33-34 clearly documents the before/after behavior.libs/ui/src/handlebars/__tests__/handlebars.test.ts (3)
519-596: LGTM - Comprehensive static widget template tests.Excellent coverage of static mode scenarios including:
- Empty output handling during build time (the core deployment fix scenario)
- Undefined properties with
eqhelper producing correct defaults- Actual data rendering with color conditionals
These tests directly validate the Handlebars template patterns used in
static-badge.tool.ts.
598-625: Good XSS prevention validation.Tests confirm that Handlebars auto-escapes output values by default, preventing script injection. This satisfies the requirement to test HTML escaping for user-provided content. Based on learnings.
627-683: LGTM - Complex template pattern coverage.Good coverage of:
- Nested conditionals with multiple branches
#eachloops with empty array fallback ({{else}})- Hidden state rendering
These patterns align with real-world widget template complexity.
libs/sdk/src/tool/ui/template-helpers.ts (2)
11-12: LGTM - Centralized escapeHtml with backwards compatibility.Re-exporting
escapeHtmlfrom@frontmcp/ui/utilsestablishes a single source of truth while maintaining backwards compatibility for SDK consumers. This is a clean refactoring pattern.Also applies to: 23-24
87-95: Deprecation documented correctly.The
createTemplateHelpersLocalfunction is properly marked as deprecated with a clear migration path tocreateTemplateHelpersfrom@frontmcp/ui/runtime.libs/sdk/src/common/decorators/front-mcp.decorator.ts (1)
51-83: The architectural pattern is justified for bundler compatibility and properly documented.The synchronous
requirefor serverless is a necessary fix for rspack/webpack bundler compatibility (as indicated by the commit "enhance serverless deployment with rspack bundling and setup generation"). This is clearly documented in the code comment at line 53. The documentation has been appropriately updated indocs/draft/docs/deployment/serverless.mdxcovering Vercel, AWS Lambda, and Cloudflare Workers deployment. The E2E test suite inapps/e2e/demo-e2e-serverless/validates serverless deployment behavior. The inconsistency between serverless (synchronous require) and normal mode (dynamic import) is intentional and unavoidable given bundler constraints; this pattern is standard in serverless frameworks.
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
libs/sdk/src/common/decorators/front-mcp.decorator.ts (1)
75-81: Improved error handling with InternalMcpError for non-Error cases.The error handling now properly uses
InternalMcpErrorwithSERVERLESS_INIT_FAILEDfor non-Error values, addressing the previous review feedback. Preserving originalErrorinstances maintains stack traces.One consideration: if a plain
Erroris caught (notInternalMcpError), it's passed through without an MCP error code. Depending on howsetServerlessHandlerErrorconsumers handle the error, you may want to wrap all errors:🔎 Optional: Wrap all errors for consistent MCP error codes
handlerPromise.then(setServerlessHandler).catch((err: unknown) => { - const e = err instanceof Error ? err : new InternalMcpError(String(err), 'SERVERLESS_INIT_FAILED'); + const e = err instanceof InternalMcpError + ? err + : new InternalMcpError( + err instanceof Error ? err.message : String(err), + 'SERVERLESS_INIT_FAILED', + err instanceof Error ? { cause: err } : undefined, + ); setServerlessHandlerError(e); console.error('[FrontMCP] Serverless initialization failed:', e); });
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
libs/sdk/src/common/decorators/front-mcp.decorator.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.ts: Use strict TypeScript mode with noanytypes without strong justification - useunknowninstead for generic type defaults
Avoid non-null assertions (!) - use proper error handling and throw specific errors instead
Use type parameters with constraints instead of unconstrained generics
Do not mutate rawInput in flows - use state.set() for managing flow state instead
Files:
libs/sdk/src/common/decorators/front-mcp.decorator.ts
libs/sdk/src/**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
libs/sdk/src/**/*.ts: MCP response types should use strict MCP protocol types (GetPromptResult, ReadResourceResult) instead ofunknown
Use specific error classes with MCP error codes instead of generic errors
UsegetCapabilities()method for dynamic capability exposure instead of hardcoding capabilities
UsechangeScopeproperty instead ofscopein change events to avoid confusion with Scope class
Validate URIs per RFC 3986 at metadata level using proper validation
Validate hook flows and fail fast on invalid hook configurations with specific error messages
Files:
libs/sdk/src/common/decorators/front-mcp.decorator.ts
libs/**
⚙️ CodeRabbit configuration file
libs/**: Contains publishable SDK libraries. Review for API correctness, breaking changes, and consistency with docs. When public APIs change, ensure there is a matching docs/draft/docs/** update (not direct edits under docs/docs/**).
Files:
libs/sdk/src/common/decorators/front-mcp.decorator.ts
🧠 Learnings (6)
📓 Common learnings
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.464Z
Learning: FrontMCP is a TypeScript-first schema validation framework - all types should align with MCP protocol definitions
📚 Learning: 2025-12-19T02:04:46.464Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.464Z
Learning: FrontMCP is a TypeScript-first schema validation framework - all types should align with MCP protocol definitions
Applied to files:
libs/sdk/src/common/decorators/front-mcp.decorator.ts
📚 Learning: 2025-12-19T02:04:46.464Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.464Z
Learning: Applies to libs/sdk/src/**/*.ts : Use specific error classes with MCP error codes instead of generic errors
Applied to files:
libs/sdk/src/common/decorators/front-mcp.decorator.ts
📚 Learning: 2025-12-19T02:04:46.464Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.464Z
Learning: Applies to libs/sdk/src/**/*.ts : MCP response types should use strict MCP protocol types (GetPromptResult, ReadResourceResult) instead of `unknown`
Applied to files:
libs/sdk/src/common/decorators/front-mcp.decorator.ts
📚 Learning: 2025-12-19T02:04:46.464Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.464Z
Learning: Applies to **/*.ts : Avoid non-null assertions (`!`) - use proper error handling and throw specific errors instead
Applied to files:
libs/sdk/src/common/decorators/front-mcp.decorator.ts
📚 Learning: 2025-12-19T02:04:46.464Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.464Z
Learning: Applies to libs/sdk/src/**/*.ts : Validate hook flows and fail fast on invalid hook configurations with specific error messages
Applied to files:
libs/sdk/src/common/decorators/front-mcp.decorator.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Build Libraries
- GitHub Check: Lint & Format Checks
🔇 Additional comments (4)
libs/sdk/src/common/decorators/front-mcp.decorator.ts (4)
6-6: Good addition of MCP-specific error import.This import aligns with the coding guideline requiring specific error classes with MCP error codes instead of generic errors. Based on learnings.
54-66: Well-typed synchronous require for bundler compatibility.The explicit type annotations address the previous review feedback. The synchronous
requireis the correct approach for serverless bundlers (rspack/webpack) that may not handle dynamic imports correctly.
68-73: Proper MCP error handling for version mismatch.Uses
InternalMcpErrorwith theSDK_VERSION_MISMATCHcode and includes helpful guidance in the error message, matching the consistency with the non-serverless path. Based on learnings.
87-90: Consistent use of InternalMcpError in non-serverless path.Properly uses
InternalMcpErrorwithSDK_VERSION_MISMATCHcode, matching the serverless path and adhering to coding guidelines. Based on learnings.
Summary by CodeRabbit
Release Notes
Chores
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.