Skip to content

Conversation

@frontegg-david
Copy link
Contributor

@frontegg-david frontegg-david commented Dec 23, 2025

Summary by CodeRabbit

  • New Features
    • CDN-based MDX client renderer, componentCache export, and runtime JSX execution helpers.
  • Improvements
    • Packages now publish clearer CJS/ESM entry points and produce separate CJS/ESM builds.
    • MDX split into explicit client (CDN) and server pathways; added safe script-escaping utility.
    • Auth configuration types and schemas reorganized into a consolidated, typed surface with parsing/type-guards.
  • Deprecations
    • Legacy server MDX typings removed; transpiler runtime relocated — update imports accordingly.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 23, 2025

Walkthrough

Converts many libs to dual CJS/ESM distributions with conditional exports and esbuild CJS/ESM build targets; reorganizes SDK auth option types/schemas into modular schema/interface/utils; adds a client-side MDX renderer and runtime transpile/execute APIs; applies bundler-friendly lazy imports and externals across UI/uipack and SDK.

Changes

Cohort / File(s) Summary
Package manifests (exports & entrypoints)
libs/adapters/package.json, libs/json-schema-to-zod-v3/package.json, libs/mcp-from-openapi/package.json, libs/plugins/package.json, libs/testing/package.json, libs/sdk/package.json, libs/ui/package.json, libs/uipack/package.json
Add "type":"commonjs", update main/types to ./dist/..., add module: ./dist/esm/..., set sideEffects:false, and replace flat exports with conditional require/import mappings (add "./esm": null).
Package subpath exports
libs/adapters/package.json, libs/plugins/package.json, libs/testing/package.json, libs/sdk/package.json
Add/adjust per-subpath exports (e.g., ./openapi, ./cache, ./codecall, ./setup, ./fixtures, ./matchers, ./playwright, ./mcp-apps) with development/require/import + types resolution.
Build targets → esbuild CJS + ESM
libs/*/project.json (e.g., libs/adapters, libs/json-schema-to-zod-v3, libs/mcp-from-openapi, libs/plugins, libs/testing, libs/sdk, libs/uipack, libs/ui)
Replace build-tsc with build-cjs and build-esm (@nx/esbuild), adjust outputs to CJS/ESM paths, add esbuildOptions (outExtension, externals), assets, declaration controls, and additionalEntryPoints; build now depends on both.
SDK auth types & schemas — reorg
libs/sdk/src/common/types/options/*, libs/sdk/src/common/types/options/index.ts
Remove monolithic auth.options.ts; add modular files (auth.interfaces.ts, auth.schema.ts, auth.utils.ts, auth.typecheck.ts, app-auth.schema.ts, public.schema.ts, transparent.schema.ts, orchestrated.schema.ts, shared.schemas.ts, transport.deprecated.ts) and a new barrel ./auth exporting schemas, types, and helpers.
Auth call-sites & config updates
libs/sdk/src/common/interfaces/internal/primary-auth-provider.interface.ts, libs/sdk/src/common/utils/decide-request-intent.utils.ts, libs/sdk/src/scope/flows/http.request.flow.ts, libs/sdk/src/auth/instances/*.ts, libs/sdk/tsconfig.lib.json
Import DEFAULT_TRANSPORT_CONFIG, change config shapes to extend transport types, update imports to the new auth barrel (./auth), adjust docs/comments, and add TS path mapping.
UIPack / UI renderer additions
libs/ui/src/renderers/index.ts, libs/ui/src/renderers/mdx.renderer.ts, libs/ui/src/renderers/transpiler.ts, libs/uipack/src/renderers/index.ts, libs/uipack/src/renderers/mdx-client.renderer.ts, libs/uipack/src/renderers/mdx.renderer.d.ts, libs/uipack/src/renderers/types.ts, libs/uipack/src/renderers/utils/transpiler.ts
Add client-side MDX renderer (MdxClientRenderer, mdxClientRenderer) with CDN helpers and options; add runtime transpile/execute APIs in UI; switch uipack to client MDX pathway, remove server MDX typings, and stub/delegate old transpiler utilities.
UIPack bundler & runtime import indirection
libs/uipack/src/bundler/file-cache/component-builder.ts, libs/uipack/src/dependency/template-processor.ts, libs/uipack/src/registry/render-template.ts
Introduce ReactComponentType alias; replace direct React/ReactDOMServer imports with string-indirected dynamic requires; update template processing to use mdx-client renderer in relevant paths.
Transpiler/runtime surfaces moved/delegated
libs/uipack/src/renderers/utils/transpiler.ts, libs/ui/src/renderers/transpiler.ts
Add full runtime sandbox/evaluator in libs/ui and replace uipack implementation with deprecation stubs that forward users to the new @frontmcp/ui exports.
Testing updates
libs/testing/jest-preset.js, libs/testing/package.json, libs/testing/project.json
Update jest moduleNameMapper to dist/index.js; align testing package exports for CJS/ESM; change build to esbuild CJS/ESM with externals and additionalEntryPoints.
Decorator / lazy import changes
libs/sdk/src/common/decorators/front-mcp.decorator.ts
Replace top-level FrontMcpInstance import with a lazy cached require() getter to avoid circular/deferred resolution; adjust type annotations to typeof import('../../front-mcp').FrontMcpInstance.
Utilities & escapes
libs/uipack/src/utils/escape-html.ts, libs/uipack/src/utils/index.ts
Add escapeScriptClose helper and re-export from utils index.
Misc packaging & build tweaks
libs/uipack/project.json, libs/ui/project.json, various package.json outExtension/esm adjustments
Add React externals to uipack builds; change esm outExtension to .mjs; disable declaration emission for some esm builds; add sideEffects:false flags and adjust module paths.

Sequence Diagram(s)

sequenceDiagram
  participant Server as Server (render pipeline)
  participant MDX as MdxClientRenderer
  participant Browser as Browser (client)
  participant CDN as CDN (module URLs)

  Note over Server,MDX: Server prepares HTML + client bootstrap script
  Server->>MDX: transpile(template) → TranspileResult (hash)
  MDX-->>Server: HTML with container + inline ES module (uses CDN URLs)

  Note over Browser,CDN: Browser loads and runs client bundle
  Browser->>CDN: import mdx, react, react-dom, jsx-runtime (CDN)
  CDN-->>Browser: deliver modules
  Browser->>Browser: compile/evaluate MDX, create elements, render into container
  Browser-->>Server: optional console logs/errors
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: Fix build scripts to enhance tree shaking' accurately describes the main objective of the changeset, which involves reworking build configurations across multiple packages to support dual CommonJS and ESM outputs with improved tree-shaking capabilities.
Docstring Coverage ✅ Passed Docstring coverage is 95.24% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-tree-shaking

Comment @coderabbitai help to get the list of available commands and usage tips.

@frontegg-david
Copy link
Contributor Author

frontegg-david commented Dec 23, 2025

⚠️ Snyk checks are incomplete.

Status Scanner Critical High Medium Low Total (0)
⚠️ Open Source Security 0 0 0 0 See details
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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/ui/src/renderers/mdx.renderer.ts (1)

39-42: Align MDX renderer React version with peer dependencies and react.renderer consistency.

The REACT_CDN hardcodes React 18, but react.renderer.ts uses React 19 via esm.sh, and peer dependencies declare support for both ^18.0.0 || ^19.0.0. Consumers using React 19 will load React 18 from this CDN, creating a version mismatch during hydration in getRuntimeScripts() (lines 216-232) and buildMdxHydrationScript().

Update lines 40-41 to use React 19 ESM:

react: 'https://esm.sh/react@19',
reactDom: 'https://esm.sh/react-dom@19/client',

This aligns with react.renderer.ts and honors the documented peer dependency range.

🧹 Nitpick comments (5)
libs/ui/src/renderers/transpiler.ts (1)

81-91: Consider edge case when module.exports is empty.

If the transpiled code doesn't export anything, Object.keys(module.exports)[0] returns undefined, and the function returns an empty module.exports object. This may be intentional, but consider whether a more explicit error would help debugging.

🔎 Optional: Add explicit handling for empty exports
     // Return the default export or first export
-    return module.exports['default'] || module.exports[Object.keys(module.exports)[0]] || module.exports;
+    if (module.exports['default']) {
+      return module.exports['default'];
+    }
+    const keys = Object.keys(module.exports);
+    if (keys.length > 0) {
+      return module.exports[keys[0]];
+    }
+    // No exports found - return the empty exports object
+    return module.exports;
   } catch (error) {
libs/ui/src/renderers/mdx.renderer.ts (1)

185-189: Potential prop collision when spreading output properties.

Spreading context.output at the top level (line 188) could overwrite reserved prop names like input, output, structuredContent, or helpers if the output object contains keys with these names.

Suggested safer approach
     // Spread output properties at top level for convenience
-    const spreadProps = {
-      ...props,
-      ...(typeof context.output === 'object' && context.output !== null ? context.output : {}),
-    };
+    const outputData = typeof context.output === 'object' && context.output !== null ? context.output : {};
+    const reservedKeys = new Set(['input', 'output', 'structuredContent', 'helpers', 'components']);
+    const safeSpread: Record<string, unknown> = {};
+    for (const [key, value] of Object.entries(outputData)) {
+      if (!reservedKeys.has(key)) {
+        safeSpread[key] = value;
+      }
+    }
+    const spreadProps = {
+      ...props,
+      ...safeSpread,
+    };
libs/uipack/src/registry/render-template.ts (1)

14-16: Duplicate ReactComponentType definition exists in codebase.

This local ReactComponentType definition duplicates the one in libs/uipack/src/renderers/types.ts (line 251). Consider importing from the centralized types file to avoid divergence.

Suggested consolidation
-// Type-only definitions for React-like component types (no runtime dependency)
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-type ReactComponentType<P = any> = ((props: P) => unknown) & { displayName?: string; name?: string };
+import type { ReactComponentType } from '../renderers/types';

Note: The signatures differ slightly (unknown return vs any return), so verify compatibility before consolidating.

libs/uipack/src/renderers/index.ts (1)

80-84: Consider adding a deprecation comment for the deprecated utility exports.

The executeTranspiledCode and transpileAndExecute exports are deprecated stubs that throw runtime errors. Adding a brief comment here would help maintainers understand these are intentionally kept for backward compatibility.

Suggested documentation
 // Utilities
 export {
   isReactComponent,
   isTemplateBuilderFunction,
   containsJsx,
   containsMdxSyntax,
   isPlainHtml,
   detectTemplateType,
   hashString,
   hashCombined,
   isHash,
   transpileJsx,
   isSwcAvailable,
+  // Deprecated - these throw errors directing to @frontmcp/ui/renderers
   executeTranspiledCode,
   transpileAndExecute,
 } from './utils';
libs/uipack/src/renderers/mdx-client.renderer.ts (1)

35-40: Hardcoded CDN versions may require updates.

The React 19 and MDX 3 versions are hardcoded. Consider making these configurable via options or extracting to a constants file for easier maintenance when upgrading.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c94e2c8 and b8ab0fa.

⛔ Files ignored due to path filters (5)
  • libs/cli/src/commands/build/adapters/cloudflare.ts is excluded by !**/build/**
  • libs/cli/src/commands/build/adapters/vercel.ts is excluded by !**/build/**
  • libs/cli/src/commands/build/bundler.ts is excluded by !**/build/**
  • libs/cli/src/commands/build/index.ts is excluded by !**/build/**
  • libs/cli/src/commands/build/types.ts is excluded by !**/build/**
📒 Files selected for processing (24)
  • libs/adapters/package.json
  • libs/adapters/project.json
  • libs/json-schema-to-zod-v3/package.json
  • libs/json-schema-to-zod-v3/project.json
  • libs/mcp-from-openapi/package.json
  • libs/mcp-from-openapi/project.json
  • libs/plugins/package.json
  • libs/plugins/project.json
  • libs/sdk/src/common/decorators/front-mcp.decorator.ts
  • libs/testing/jest-preset.js
  • libs/testing/package.json
  • libs/testing/project.json
  • libs/ui/src/renderers/index.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/ui/src/renderers/transpiler.ts
  • libs/uipack/project.json
  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/uipack/src/dependency/template-processor.ts
  • libs/uipack/src/registry/render-template.ts
  • libs/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/uipack/src/renderers/mdx.renderer.d.ts
  • libs/uipack/src/renderers/types.ts
  • libs/uipack/src/renderers/utils/transpiler.ts
💤 Files with no reviewable changes (1)
  • libs/uipack/src/renderers/mdx.renderer.d.ts
🧰 Additional context used
📓 Path-based instructions (7)
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/testing/jest-preset.js
  • libs/uipack/src/dependency/template-processor.ts
  • libs/adapters/project.json
  • libs/ui/src/renderers/index.ts
  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/uipack/project.json
  • libs/json-schema-to-zod-v3/package.json
  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/transpiler.ts
  • libs/mcp-from-openapi/package.json
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/plugins/project.json
  • libs/sdk/src/common/decorators/front-mcp.decorator.ts
  • libs/testing/project.json
  • libs/uipack/src/registry/render-template.ts
  • libs/mcp-from-openapi/project.json
  • libs/plugins/package.json
  • libs/json-schema-to-zod-v3/project.json
  • libs/adapters/package.json
  • libs/uipack/src/renderers/types.ts
  • libs/testing/package.json
  • libs/uipack/src/renderers/utils/transpiler.ts
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use strict TypeScript mode with no any types without strong justification - use unknown instead 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/uipack/src/dependency/template-processor.ts
  • libs/ui/src/renderers/index.ts
  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/transpiler.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/sdk/src/common/decorators/front-mcp.decorator.ts
  • libs/uipack/src/registry/render-template.ts
  • libs/uipack/src/renderers/types.ts
  • libs/uipack/src/renderers/utils/transpiler.ts
libs/uipack/src/**/*.ts

📄 CodeRabbit inference engine (libs/uipack/CLAUDE.md)

libs/uipack/src/**/*.ts: Do not add React dependencies to uipack - use @frontmcp/ui package for React components instead
Avoid using any type without justification in TypeScript code
Do not expose internal error details in user-facing error messages

Files:

  • libs/uipack/src/dependency/template-processor.ts
  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/uipack/src/registry/render-template.ts
  • libs/uipack/src/renderers/types.ts
  • libs/uipack/src/renderers/utils/transpiler.ts
libs/ui/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (libs/ui/CLAUDE.md)

Do not import React-free utilities from @frontmcp/ui; use @frontmcp/uipack instead

Files:

  • libs/ui/src/renderers/index.ts
  • libs/ui/src/renderers/transpiler.ts
  • libs/ui/src/renderers/mdx.renderer.ts
libs/*/package.json

📄 CodeRabbit inference engine (CLAUDE.md)

Each library in /libs/* is independent and publishable under @frontmcp/* scope

Files:

  • libs/json-schema-to-zod-v3/package.json
  • libs/mcp-from-openapi/package.json
  • libs/plugins/package.json
  • libs/adapters/package.json
  • libs/testing/package.json
libs/uipack/src/{components,web-components,renderers,utils}/**/*.ts

📄 CodeRabbit inference engine (libs/uipack/CLAUDE.md)

Always escape user-provided content using escapeHtml() utility to prevent XSS

Files:

  • libs/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/uipack/src/renderers/types.ts
  • libs/uipack/src/renderers/utils/transpiler.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 of unknown
Use specific error classes with MCP error codes instead of generic errors
Use getCapabilities() method for dynamic capability exposure instead of hardcoding capabilities
Use changeScope property instead of scope in 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
🧠 Learnings (37)
📓 Common learnings
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
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Use entry points from package.json exports for public API access instead of direct file imports
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/**/*.{ts,tsx} : Ensure SSR support via react-dom/server for React components
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/bundler/**/*.{ts,tsx} : Use SSR component bundler (createBundler, InMemoryBundler) for bundling React components
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Configure entry points for frontmcp/ui exports: main, react, react/hooks, renderers, render, universal, and bundler
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/common/records/**/*.ts : Centralize record types in common/records directory and import from there instead of module-specific files
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/universal/**/*.{ts,tsx} : Export FrontMCPProvider and UniversalApp from universal app shell for platform-agnostic React configuration
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/**/*.{ts,tsx} : Use React 18/19 with TypeScript for all components in frontmcp/ui
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Configure entry points for frontmcp/ui exports: main, react, react/hooks, renderers, render, universal, and bundler

Applied to files:

  • libs/testing/jest-preset.js
  • libs/ui/src/renderers/index.ts
  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/uipack/project.json
  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/transpiler.ts
  • libs/mcp-from-openapi/package.json
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/mcp-from-openapi/project.json
  • libs/plugins/package.json
  • libs/adapters/package.json
  • libs/testing/package.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,components,web-components}/**/*.test.ts : Test component behavior across platform configurations (OpenAI, Claude, etc.)

Applied to files:

  • libs/testing/jest-preset.js
  • libs/adapters/project.json
  • libs/testing/package.json
  • libs/uipack/src/renderers/utils/transpiler.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Include SSR tests to verify server-side rendering output for React components

Applied to files:

  • libs/testing/jest-preset.js
  • libs/ui/src/renderers/index.ts
  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/transpiler.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/registry/render-template.ts
  • libs/uipack/src/renderers/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} : Test all code paths including error cases and constructor validation

Applied to files:

  • libs/testing/jest-preset.js
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{handlebars,build,layouts,pages}/**/*.ts : Use Handlebars template engine for dynamic template rendering with variable substitution

Applied to files:

  • libs/uipack/src/dependency/template-processor.ts
  • libs/uipack/project.json
  • libs/ui/src/renderers/transpiler.ts
  • libs/uipack/src/registry/render-template.ts
  • libs/uipack/src/renderers/utils/transpiler.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Do not add React dependencies to uipack - use frontmcp/ui package for React components instead

Applied to files:

  • libs/uipack/src/dependency/template-processor.ts
  • libs/ui/src/renderers/index.ts
  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/uipack/project.json
  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/transpiler.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/sdk/src/common/decorators/front-mcp.decorator.ts
  • libs/uipack/src/registry/render-template.ts
  • libs/uipack/src/renderers/types.ts
  • libs/testing/package.json
  • libs/uipack/src/renderers/utils/transpiler.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.{ts,tsx} : Do not import React-free utilities from frontmcp/ui; use frontmcp/uipack instead

Applied to files:

  • libs/uipack/src/dependency/template-processor.ts
  • libs/ui/src/renderers/index.ts
  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/uipack/project.json
  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/transpiler.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/sdk/src/common/decorators/front-mcp.decorator.ts
  • libs/uipack/src/registry/render-template.ts
  • libs/testing/package.json
  • libs/uipack/src/renderers/utils/transpiler.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/renderers/**/*.adapter.ts : Implement client-side hydration for interactive widgets using ReactRendererAdapter

Applied to files:

  • libs/uipack/src/dependency/template-processor.ts
  • libs/ui/src/renderers/index.ts
  • libs/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/registry/render-template.ts
  • libs/uipack/src/renderers/types.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,base-template,layouts,pages}/**/*.ts : Use buildCdnScriptsFromTheme() with appropriate inline flag for platform network access constraints

Applied to files:

  • libs/adapters/project.json
  • libs/uipack/project.json
  • libs/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/testing/project.json
  • libs/uipack/src/renderers/utils/transpiler.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/**/index.ts : Export public API through barrel files - export users' needed items, no legacy exports with different names

Applied to files:

  • libs/adapters/project.json
  • libs/ui/src/renderers/index.ts
  • libs/uipack/src/renderers/index.ts
  • libs/mcp-from-openapi/package.json
  • libs/testing/project.json
  • libs/plugins/package.json
  • libs/adapters/package.json
  • libs/testing/package.json
  • libs/uipack/src/renderers/utils/transpiler.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,build,layouts,pages}/**/*.ts : Use platform-aware theming via getPlatform(), OPENAI_PLATFORM, and CLAUDE_PLATFORM constants for network capability detection

Applied to files:

  • libs/adapters/project.json
  • libs/uipack/project.json
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/adapters/package.json
📚 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 `changeScope` property instead of `scope` in change events to avoid confusion with Scope class

Applied to files:

  • libs/adapters/project.json
📚 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: Use Nx for build system with commands like `nx build sdk`, `nx test`, `nx run-many -t test`

Applied to files:

  • libs/adapters/project.json
  • libs/plugins/project.json
  • libs/testing/project.json
  • libs/mcp-from-openapi/project.json
  • libs/json-schema-to-zod-v3/project.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/renderers/**/*.test.{ts,tsx} : Include hydration tests to verify client-side hydration behavior

Applied to files:

  • libs/ui/src/renderers/index.ts
  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/transpiler.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/types.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/**/*.{ts,tsx} : Ensure SSR support via react-dom/server for React components

Applied to files:

  • libs/ui/src/renderers/index.ts
  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/transpiler.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/registry/render-template.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/bundler/**/*.{ts,tsx} : Use SSR component bundler (createBundler, InMemoryBundler) for bundling React components

Applied to files:

  • libs/ui/src/renderers/index.ts
  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/uipack/project.json
  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/transpiler.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/uipack/src/registry/render-template.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/universal/**/*.{ts,tsx} : Export FrontMCPProvider and UniversalApp from universal app shell for platform-agnostic React configuration

Applied to files:

  • libs/ui/src/renderers/index.ts
  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/transpiler.ts
  • libs/mcp-from-openapi/package.json
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/sdk/src/common/decorators/front-mcp.decorator.ts
  • libs/uipack/src/registry/render-template.ts
  • libs/plugins/package.json
  • libs/adapters/package.json
  • libs/testing/package.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/**/*.{ts,tsx} : Use React 18/19 with TypeScript for all components in frontmcp/ui

Applied to files:

  • libs/ui/src/renderers/index.ts
  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/uipack/project.json
  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/transpiler.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/registry/render-template.ts
  • libs/uipack/src/renderers/types.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Zero React dependency constraint - this is the React-free core package

Applied to files:

  • libs/ui/src/renderers/index.ts
  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/**/*.{ts,tsx} : Provide TypeScript types for all component props without using 'any' type without justification

Applied to files:

  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/uipack/src/registry/render-template.ts
  • libs/uipack/src/renderers/types.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Avoid using `any` type without justification in TypeScript code

Applied to files:

  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/uipack/src/renderers/types.ts
  • libs/uipack/src/renderers/utils/transpiler.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Use React Testing Library for component tests with 95%+ coverage across statements, branches, functions, and lines

Applied to files:

  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/testing/package.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Maintain peer dependencies on React ^18.0.0 || ^19.0.0 and react-dom ^18.0.0 || ^19.0.0

Applied to files:

  • libs/uipack/src/bundler/file-cache/component-builder.ts
  • libs/uipack/project.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Do not expose internal error details in user-facing error messages

Applied to files:

  • libs/uipack/project.json
  • libs/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/utils/transpiler.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{theme,build,layouts,pages,base-template}/**/*.ts : Use theme.cdn configuration instead of hard-coding CDN URLs

Applied to files:

  • libs/uipack/project.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Use entry points from package.json exports for public API access instead of direct file imports

Applied to files:

  • libs/json-schema-to-zod-v3/package.json
  • libs/mcp-from-openapi/package.json
  • libs/plugins/package.json
  • libs/adapters/package.json
  • libs/testing/package.json
📚 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/json-schema-to-zod-v3/package.json
  • libs/mcp-from-openapi/package.json
  • libs/sdk/src/common/decorators/front-mcp.decorator.ts
  • libs/plugins/package.json
  • libs/adapters/package.json
  • libs/testing/package.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components}/**/*.{ts,tsx} : Every component must have a Zod schema with `.strict()` mode to reject unknown properties

Applied to files:

  • libs/json-schema-to-zod-v3/package.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components}/**/*.ts : Validate all component options using validateOptions() helper with the component's Zod schema

Applied to files:

  • libs/json-schema-to-zod-v3/package.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/hooks/**/*.{ts,tsx} : Use MCP bridge hooks (useMcpBridge, useCallTool, useToolInput, useToolOutput) for tool communication in components

Applied to files:

  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/mdx.renderer.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/mcp-from-openapi/package.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components,renderers,utils}/**/*.ts : Always escape user-provided content using escapeHtml() utility to prevent XSS

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/utils/transpiler.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components,renderers}/**/*.test.ts : Test HTML escaping for user-provided content in component tests

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/types.ts
  • libs/uipack/src/renderers/utils/transpiler.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: Ensure all builds complete without TypeScript warnings and 100% test pass rate is required

Applied to files:

  • libs/testing/project.json
📚 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/*/package.json : Each library in /libs/* is independent and publishable under frontmcp/* scope

Applied to files:

  • libs/mcp-from-openapi/project.json
  • libs/plugins/package.json
  • libs/adapters/package.json
  • libs/testing/package.json
🧬 Code graph analysis (5)
libs/uipack/src/dependency/template-processor.ts (2)
libs/uipack/src/renderers/index.ts (2)
  • mdxClientRenderer (62-62)
  • mdxClientRenderer (65-65)
libs/uipack/src/renderers/mdx-client.renderer.ts (1)
  • mdxClientRenderer (236-236)
libs/sdk/src/common/decorators/front-mcp.decorator.ts (2)
libs/sdk/src/index.ts (1)
  • FrontMcpInstance (4-4)
libs/sdk/src/front-mcp/front-mcp.ts (1)
  • FrontMcpInstance (7-69)
libs/uipack/src/registry/render-template.ts (3)
libs/ui/src/renderers/index.ts (1)
  • ReactComponentType (35-35)
libs/uipack/src/renderers/index.ts (1)
  • ReactComponentType (46-46)
libs/uipack/src/renderers/types.ts (1)
  • ReactComponentType (252-252)
libs/uipack/src/renderers/types.ts (2)
libs/ui/src/renderers/index.ts (1)
  • RendererType (24-24)
libs/uipack/src/renderers/index.ts (1)
  • RendererType (35-35)
libs/uipack/src/renderers/utils/transpiler.ts (3)
libs/ui/src/renderers/index.ts (2)
  • executeTranspiledCode (52-52)
  • transpileAndExecute (52-52)
libs/ui/src/renderers/transpiler.ts (2)
  • executeTranspiledCode (40-92)
  • transpileAndExecute (104-112)
libs/uipack/src/renderers/index.ts (2)
  • executeTranspiledCode (82-82)
  • transpileAndExecute (83-83)
🔇 Additional comments (35)
libs/sdk/src/common/decorators/front-mcp.decorator.ts (2)

84-85: LGTM! String literal import enables better tree-shaking.

The change from variable-based to string literal dynamic import allows bundlers to perform static analysis and optimize the bundle. This aligns well with the PR's tree-shaking objectives and maintains consistency with the serverless mode's require('@frontmcp/sdk') pattern.


88-88: LGTM! Error message consistent with serverless mode.

The error message correctly uses the string literal package name and maintains consistency with the identical error message in serverless mode (line 70). The specific error code follows the coding guidelines for MCP error handling.

libs/testing/jest-preset.js (1)

46-50: LGTM!

The moduleNameMapper paths are correctly updated to align with the new build output structure where entry points are at dist/index.js rather than dist/src/index.js. The comment accurately reflects this change.

libs/adapters/project.json (1)

8-75: LGTM!

The dual CJS/ESM build configuration is well-structured:

  • Proper dependency chain (^buildbuild-cjsbuild-esmbuild)
  • Consistent externalization of peer dependencies across both formats
  • Assets correctly placed only in the CJS build (ESM output shares the same dist folder)
  • Declaration generation enabled for both formats with correct root directory
libs/json-schema-to-zod-v3/package.json (1)

31-48: LGTM!

The package exports configuration follows best practices:

  • Explicit "type": "commonjs" declaration
  • Proper conditional exports with types listed before default for correct TypeScript resolution
  • "./esm": null correctly prevents consumers from importing the ESM folder directly
  • Development path enables source-level debugging in dev environments
libs/uipack/project.json (2)

43-51: LGTM!

Externalizing React and React-DOM packages aligns with the project guidelines that uipack should not bundle React dependencies. The wildcard patterns (react/*, react-dom/*) correctly cover subpath imports like react/jsx-runtime. Based on learnings, consumers should use @frontmcp/ui for React components instead.


90-98: Consistent ESM externalization.

The ESM build correctly mirrors the CJS externalization configuration, ensuring consistent behavior across both module formats.

libs/ui/src/renderers/transpiler.ts (2)

12-12: Correct import pattern.

The import from @frontmcp/uipack/renderers follows the coding guidelines. As per learnings, React-free utilities should be imported from @frontmcp/uipack rather than duplicating them in @frontmcp/ui.


40-45: any types are justified for this dynamic execution context.

The use of any here is appropriate since the function must handle arbitrary transpiled code and context objects. The eslint-disable comments properly document this deviation from strict TypeScript guidelines.

libs/mcp-from-openapi/project.json (1)

8-59: LGTM!

The dual CJS/ESM build configuration follows the consistent pattern established across the repository. External dependencies correctly match those declared in package.json, ensuring they're not bundled and consumers provide their own versions.

libs/mcp-from-openapi/package.json (1)

33-50: LGTM!

The package exports configuration is consistent with other packages in this PR:

  • Proper module type declaration and entry points
  • Conditional exports with correct TypeScript resolution order (types before default)
  • ESM subpath blocked with null to prevent incorrect imports
libs/json-schema-to-zod-v3/project.json (1)

8-55: LGTM!

The dual CJS/ESM build configuration is correctly structured:

  • zod is properly externalized as it's a peer dependency
  • Assets include the changelog for npm package consumers
  • Build dependency chain ensures sequential execution
libs/ui/src/renderers/mdx.renderer.ts (1)

1-17: Documentation and imports updated correctly.

The module documentation clearly indicates this is a server-side renderer requiring React, and correctly points users to MdxClientRenderer from @frontmcp/uipack for React-free clients. Imports are properly consolidated to scoped package paths.

libs/adapters/package.json (1)

24-52: Well-structured dual CJS/ESM exports configuration.

The exports structure correctly implements:

  • Conditional require/import blocks with proper type declarations
  • Development condition for direct TypeScript imports during development
  • "./esm": null to prevent accidental bare imports from the ESM directory

This aligns with modern package distribution best practices for tree shaking support.

libs/plugins/package.json (1)

24-63: Consistent dual CJS/ESM exports with subpath exports.

The exports configuration mirrors the adapters package pattern and correctly exposes ./cache and ./codecall subpaths with proper conditional exports. This enables consumers to import only what they need for better tree shaking.

libs/uipack/src/bundler/file-cache/component-builder.ts (3)

28-30: Type-only React definition maintains React-free constraint.

The ReactComponentType alias is type-only and doesn't introduce a runtime React dependency. This is an acceptable pattern for uipack since React is dynamically imported only when SSR is explicitly requested. The eslint-disable comment for any is justified here as the type represents an external module interface.


452-456: Variable indirection prevents bundler resolution at build time.

Using string constants (reactPkg, reactDomServerPkg) for dynamic imports is a valid technique to prevent bundlers from resolving and bundling React at build time. This supports the tree shaking goals of this PR.


483-484: SSR element creation uses the new type correctly.

The cast to ReactComponentType<unknown> aligns with the type-only definition and maintains type safety without runtime overhead.

libs/uipack/src/dependency/template-processor.ts (2)

21-21: Correct migration to MDX client renderer.

The import change from mdxRenderer to mdxClientRenderer aligns with the broader refactoring to separate server-side and client-side MDX rendering paths. This is consistent with the new exports in libs/uipack/src/renderers/index.ts.


289-289: MDX rendering calls updated consistently.

Both MDX rendering call sites (processTemplate and processMdxTemplate) are updated to use mdxClientRenderer.render(), maintaining consistency throughout the file.

Also applies to: 446-446

libs/uipack/src/registry/render-template.ts (2)

248-264: Improved error messages guide users to correct package.

The error messages now clearly indicate that React is optional and suggest @frontmcp/ui as the package for React component support. This is helpful for users who encounter the error in a React-free environment.


250-256: Variable indirection pattern correctly applied.

Using reactPkg and reactDomServerPkg string constants prevents bundlers from statically analyzing and including React in the bundle, supporting the tree shaking objectives.

libs/ui/src/renderers/index.ts (1)

1-52: Well-organized public API surface with clear documentation.

The barrel file correctly:

  • Re-exports types from @frontmcp/uipack/renderers for convenience
  • Exports React-dependent renderers (React, MDX server-side)
  • Documents the separation between React-dependent (@frontmcp/ui) and React-free (@frontmcp/uipack) renderers
  • Provides clear examples in the module documentation

This follows the coding guidelines for exporting public API through barrel files.

libs/uipack/src/renderers/types.ts (2)

19-22: Extended RendererType with clear documentation.

The new 'mdx-client' variant is well-documented, clearly distinguishing between:

  • 'mdx': Server-side rendering (requires React)
  • 'mdx-client': Client-side rendering (CDN-loaded React)

This supports the broader MDX rendering refactoring in this PR.


251-252: Centralized ReactComponentType definition.

This is the canonical definition that should be imported by other files in uipack (like render-template.ts) to avoid duplication. The any return type is justified with an eslint-disable comment and is necessary for React component type compatibility without requiring React types at compile time.

libs/uipack/src/renderers/utils/transpiler.ts (2)

159-169: Clean deprecation pattern with proper type usage.

Good use of unknown instead of any for the _context parameter, aligning with the coding guidelines. The JSDoc @deprecated tag will help IDEs surface warnings at import/call sites.

The error message provides a clear migration path to @frontmcp/ui/renderers.


174-184: Consistent deprecation approach.

The deprecation stub mirrors executeTranspiledCode appropriately. Both functions maintain their signatures for backward compatibility while guiding users to the new location.

libs/uipack/src/renderers/index.ts (1)

60-67: Well-structured MDX client renderer exports with compatibility aliases.

The dual export pattern (MdxClientRenderer + legacy MdxRenderer alias) provides a clean migration path. The comment on line 67 clearly directs users to @frontmcp/ui for React-dependent functionality.

Based on learnings, the legacy aliases are appropriate during the deprecation transition period.

libs/testing/project.json (1)

8-46: Well-structured CJS build target with appropriate externalizations.

The external dependencies list correctly excludes peer dependencies and internal packages from bundling, which is essential for tree-shaking. The thirdParty: false setting ensures only first-party code is bundled.

libs/uipack/src/renderers/mdx-client.renderer.ts (3)

158-166: Proper XSS prevention measures in place.

Good use of JSON.stringify for script-embedded data (lines 159-160) and escapeHtml() for HTML attributes (lines 163, 166). This aligns with the coding guidelines requiring XSS protection for user-provided content.


200-206: Appropriate error handling without exposing internals.

The error handler logs details to console for debugging but displays only a generic message to users. This follows the guideline to not expose internal error details in user-facing messages.


215-230: Good platform capability handling.

The renderer correctly detects blocked-network platforms and provides a meaningful warning instead of failing silently. The SSR fallback guidance is helpful.

libs/plugins/project.json (1)

8-70: Consistent dual CJS/ESM build configuration.

The build configuration mirrors the pattern established in other packages. External dependencies correctly include optional peer dependencies (ioredis, vectoriadb, @vercel/kv) preventing them from being bundled.

The same ESM .js extension consideration applies here as noted in the testing package review.

libs/testing/package.json (2)

27-42: Proper dual-format package configuration.

The "type": "commonjs" with separate main (CJS) and module (ESM) fields, plus conditional exports, follows modern Node.js package conventions for dual-format support.


91-91: Good use of null export to prevent direct ESM access.

The "./esm": null entry prevents consumers from accidentally importing from the internal ESM folder structure directly, encouraging use of the proper conditional exports.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (5)
libs/sdk/src/common/types/options/auth/auth.typecheck.ts (1)

56-62: Consider removing Partial<> wrapper to strengthen type checks.

The Partial<> wrapper on schema outputs significantly weakens these type checks. IsAssignable<PublicAccessConfig, Partial<_PublicAccessFromSchema>> will pass even if PublicAccessConfig is missing required fields from the schema, since Partial<> makes all fields optional.

If the intent is to verify interface compatibility with schema shape, consider removing Partial<>:

 // Check PublicAccessConfig is assignable to schema output
 type _PublicAccessFromSchema = z.output<typeof publicAccessConfigSchema>;
-type _PublicAccessCheck = AssertTrue<IsAssignable<PublicAccessConfig, Partial<_PublicAccessFromSchema>>>;
+type _PublicAccessCheck = AssertTrue<IsAssignable<PublicAccessConfig, _PublicAccessFromSchema>>;

 // Check RemoteProviderConfig is assignable to schema output
 type _RemoteFromSchema = z.output<typeof remoteProviderConfigSchema>;
-type _RemoteCheck = AssertTrue<IsAssignable<RemoteProviderConfig, Partial<_RemoteFromSchema>>>;
+type _RemoteCheck = AssertTrue<IsAssignable<RemoteProviderConfig, _RemoteFromSchema>>;

If Partial<> is intentional due to optional fields in the interfaces, please add a comment explaining this design decision.

libs/sdk/src/common/types/options/auth/public.schema.ts (1)

50-50: Consider consistency: .or() vs z.union().

Line 50 uses jwkSchema.or(z.instanceof(Uint8Array)) while other schemas in this PR use z.union([...]) for union types (e.g., line 25 in transparent.schema.ts uses z.union([z.string(), z.array(z.string())])).

Both approaches are valid in Zod 4, but for consistency across the codebase, consider standardizing on one approach.

libs/sdk/src/common/types/options/auth/auth.utils.ts (1)

70-75: Consider explicit exhaustiveness check.

The allowsPublicAccess function handles all three modes but doesn't explicitly ensure exhaustiveness at compile time. If a new auth mode is added in the future, TypeScript won't catch the missing case.

Consider adding an explicit exhaustiveness check:

🔎 Suggested enhancement
 export function allowsPublicAccess(options: AuthOptions): boolean {
   if (options.mode === 'public') return true;
   if (options.mode === 'transparent') return options.allowAnonymous;
   if (options.mode === 'orchestrated') return options.allowDefaultPublic;
-  return false;
+  
+  // Exhaustiveness check
+  const _exhaustive: never = options;
+  return false;
 }

This ensures TypeScript will error if a new mode is added but not handled here.

libs/sdk/src/common/types/options/auth/orchestrated.schema.ts (1)

21-173: Consider extracting shared orchestrated configuration.

The orchestratedLocalSchema and orchestratedRemoteSchema have significant duplication (lines 30-91 and 110-173 are nearly identical). While this duplication makes each schema explicit and self-contained (which aids tree shaking), it increases maintenance burden.

Consider extracting shared fields into a base schema:

🔎 Suggested refactor
const orchestratedBaseFields = {
  tokenStorage: tokenStorageConfigSchema.default({ type: 'memory' }),
  sessionMode: z.enum(['stateful', 'stateless']).default('stateful'),
  allowDefaultPublic: z.boolean().default(false),
  anonymousScopes: z.array(z.string()).default(['anonymous']),
  publicAccess: publicAccessConfigSchema.optional(),
  consent: consentConfigSchema.optional(),
  refresh: tokenRefreshConfigSchema.optional(),
  expectedAudience: z.union([z.string(), z.array(z.string())]).optional(),
  incrementalAuth: incrementalAuthConfigSchema.optional(),
  transport: transportConfigSchema.optional(),
};

export const orchestratedLocalSchema = z.object({
  mode: z.literal('orchestrated'),
  type: z.literal('local'),
  local: localSigningConfigSchema.optional(),
  ...orchestratedBaseFields,
});

export const orchestratedRemoteSchema = z.object({
  mode: z.literal('orchestrated'),
  type: z.literal('remote'),
  remote: remoteProviderConfigSchema,
  local: localSigningConfigSchema.optional(),
  ...orchestratedBaseFields,
});

This maintains tree-shaking benefits while reducing duplication.

libs/sdk/src/common/types/options/auth/index.ts (1)

126-136: Deprecated transport schemas properly marked.

The deprecated transport schemas (lines 126-136) are clearly marked with a comment indicating removal in v1.0.0. This is good deprecation practice.

Consider adding @deprecated JSDoc tags to the actual schema definitions in transport.deprecated.ts to ensure IDEs show deprecation warnings to consumers.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b8ab0fa and ab50258.

📒 Files selected for processing (18)
  • libs/sdk/src/auth/instances/instance.local-primary-auth.ts
  • libs/sdk/src/auth/instances/instance.remote-primary-auth.ts
  • libs/sdk/src/common/interfaces/internal/primary-auth-provider.interface.ts
  • libs/sdk/src/common/types/options/auth.options.ts
  • libs/sdk/src/common/types/options/auth/app-auth.schema.ts
  • libs/sdk/src/common/types/options/auth/auth.interfaces.ts
  • libs/sdk/src/common/types/options/auth/auth.schema.ts
  • libs/sdk/src/common/types/options/auth/auth.typecheck.ts
  • libs/sdk/src/common/types/options/auth/auth.utils.ts
  • libs/sdk/src/common/types/options/auth/index.ts
  • libs/sdk/src/common/types/options/auth/orchestrated.schema.ts
  • libs/sdk/src/common/types/options/auth/public.schema.ts
  • libs/sdk/src/common/types/options/auth/shared.schemas.ts
  • libs/sdk/src/common/types/options/auth/transparent.schema.ts
  • libs/sdk/src/common/types/options/auth/transport.deprecated.ts
  • libs/sdk/src/common/types/options/index.ts
  • libs/sdk/src/common/utils/decide-request-intent.utils.ts
  • libs/sdk/src/scope/flows/http.request.flow.ts
💤 Files with no reviewable changes (1)
  • libs/sdk/src/common/types/options/auth.options.ts
✅ Files skipped from review due to trivial changes (1)
  • libs/sdk/src/scope/flows/http.request.flow.ts
🧰 Additional context used
📓 Path-based instructions (4)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use strict TypeScript mode with no any types without strong justification - use unknown instead 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/auth/instances/instance.remote-primary-auth.ts
  • libs/sdk/src/common/utils/decide-request-intent.utils.ts
  • libs/sdk/src/common/types/options/auth/public.schema.ts
  • libs/sdk/src/common/types/options/auth/app-auth.schema.ts
  • libs/sdk/src/common/types/options/auth/auth.typecheck.ts
  • libs/sdk/src/common/types/options/auth/auth.utils.ts
  • libs/sdk/src/common/types/options/auth/transparent.schema.ts
  • libs/sdk/src/common/types/options/auth/auth.interfaces.ts
  • libs/sdk/src/common/types/options/auth/orchestrated.schema.ts
  • libs/sdk/src/common/types/options/index.ts
  • libs/sdk/src/common/types/options/auth/transport.deprecated.ts
  • libs/sdk/src/auth/instances/instance.local-primary-auth.ts
  • libs/sdk/src/common/interfaces/internal/primary-auth-provider.interface.ts
  • libs/sdk/src/common/types/options/auth/shared.schemas.ts
  • libs/sdk/src/common/types/options/auth/auth.schema.ts
  • libs/sdk/src/common/types/options/auth/index.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 of unknown
Use specific error classes with MCP error codes instead of generic errors
Use getCapabilities() method for dynamic capability exposure instead of hardcoding capabilities
Use changeScope property instead of scope in 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/auth/instances/instance.remote-primary-auth.ts
  • libs/sdk/src/common/utils/decide-request-intent.utils.ts
  • libs/sdk/src/common/types/options/auth/public.schema.ts
  • libs/sdk/src/common/types/options/auth/app-auth.schema.ts
  • libs/sdk/src/common/types/options/auth/auth.typecheck.ts
  • libs/sdk/src/common/types/options/auth/auth.utils.ts
  • libs/sdk/src/common/types/options/auth/transparent.schema.ts
  • libs/sdk/src/common/types/options/auth/auth.interfaces.ts
  • libs/sdk/src/common/types/options/auth/orchestrated.schema.ts
  • libs/sdk/src/common/types/options/index.ts
  • libs/sdk/src/common/types/options/auth/transport.deprecated.ts
  • libs/sdk/src/auth/instances/instance.local-primary-auth.ts
  • libs/sdk/src/common/interfaces/internal/primary-auth-provider.interface.ts
  • libs/sdk/src/common/types/options/auth/shared.schemas.ts
  • libs/sdk/src/common/types/options/auth/auth.schema.ts
  • libs/sdk/src/common/types/options/auth/index.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/auth/instances/instance.remote-primary-auth.ts
  • libs/sdk/src/common/utils/decide-request-intent.utils.ts
  • libs/sdk/src/common/types/options/auth/public.schema.ts
  • libs/sdk/src/common/types/options/auth/app-auth.schema.ts
  • libs/sdk/src/common/types/options/auth/auth.typecheck.ts
  • libs/sdk/src/common/types/options/auth/auth.utils.ts
  • libs/sdk/src/common/types/options/auth/transparent.schema.ts
  • libs/sdk/src/common/types/options/auth/auth.interfaces.ts
  • libs/sdk/src/common/types/options/auth/orchestrated.schema.ts
  • libs/sdk/src/common/types/options/index.ts
  • libs/sdk/src/common/types/options/auth/transport.deprecated.ts
  • libs/sdk/src/auth/instances/instance.local-primary-auth.ts
  • libs/sdk/src/common/interfaces/internal/primary-auth-provider.interface.ts
  • libs/sdk/src/common/types/options/auth/shared.schemas.ts
  • libs/sdk/src/common/types/options/auth/auth.schema.ts
  • libs/sdk/src/common/types/options/auth/index.ts
libs/sdk/src/**/index.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Export public API through barrel files - export users' needed items, no legacy exports with different names

Files:

  • libs/sdk/src/common/types/options/index.ts
  • libs/sdk/src/common/types/options/auth/index.ts
🧠 Learnings (14)
📓 Common learnings
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Configure entry points for frontmcp/ui exports: main, react, react/hooks, renderers, render, universal, and bundler
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/bundler/**/*.{ts,tsx} : Use SSR component bundler (createBundler, InMemoryBundler) for bundling React components
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Use entry points from package.json exports for public API access instead of direct file imports
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
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,base-template,layouts,pages}/**/*.ts : Use buildCdnScriptsFromTheme() with appropriate inline flag for platform network access constraints
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Do not add React dependencies to uipack - use frontmcp/ui package for React components instead
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components}/**/*.ts : Validate all component options using validateOptions() helper with the component's Zod schema
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.{ts,tsx} : Do not import React-free utilities from frontmcp/ui; use frontmcp/uipack instead
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{handlebars,build,layouts,pages}/**/*.ts : Use Handlebars template engine for dynamic template rendering with variable substitution
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{theme,build,layouts,pages,base-template}/**/*.ts : Use theme.cdn configuration instead of hard-coding CDN URLs
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/universal/**/*.{ts,tsx} : Export FrontMCPProvider and UniversalApp from universal app shell for platform-agnostic React configuration

Applied to files:

  • libs/sdk/src/auth/instances/instance.remote-primary-auth.ts
  • libs/sdk/src/common/interfaces/internal/primary-auth-provider.interface.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/auth/instances/instance.remote-primary-auth.ts
  • libs/sdk/src/common/types/options/auth/auth.typecheck.ts
  • libs/sdk/src/common/types/options/auth/auth.interfaces.ts
  • libs/sdk/src/common/types/options/auth/shared.schemas.ts
  • libs/sdk/src/common/types/options/auth/auth.schema.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components}/**/*.ts : Validate all component options using validateOptions() helper with the component's Zod schema

Applied to files:

  • libs/sdk/src/common/types/options/auth/app-auth.schema.ts
  • libs/sdk/src/common/types/options/auth/auth.typecheck.ts
  • libs/sdk/src/common/types/options/auth/auth.utils.ts
  • libs/sdk/src/common/types/options/auth/shared.schemas.ts
  • libs/sdk/src/common/types/options/auth/auth.schema.ts
  • libs/sdk/src/common/types/options/auth/index.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/types/options/auth/auth.typecheck.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components}/**/*.{ts,tsx} : Every component must have a Zod schema with `.strict()` mode to reject unknown properties

Applied to files:

  • libs/sdk/src/common/types/options/auth/auth.typecheck.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/common/records/**/*.ts : Centralize record types in common/records directory and import from there instead of module-specific files

Applied to files:

  • libs/sdk/src/common/types/options/auth/auth.typecheck.ts
  • libs/sdk/src/common/types/options/auth/auth.utils.ts
  • libs/sdk/src/common/types/options/auth/auth.interfaces.ts
  • libs/sdk/src/common/types/options/index.ts
  • libs/sdk/src/common/types/options/auth/transport.deprecated.ts
  • libs/sdk/src/auth/instances/instance.local-primary-auth.ts
  • libs/sdk/src/common/types/options/auth/shared.schemas.ts
  • libs/sdk/src/common/types/options/auth/auth.schema.ts
  • libs/sdk/src/common/types/options/auth/index.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/sdk/src/common/types/options/auth/auth.typecheck.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/types/options/auth/auth.typecheck.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 URIs per RFC 3986 at metadata level using proper validation

Applied to files:

  • libs/sdk/src/common/types/options/auth/auth.typecheck.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/**/index.ts : Export public API through barrel files - export users' needed items, no legacy exports with different names

Applied to files:

  • libs/sdk/src/common/types/options/auth/auth.utils.ts
  • libs/sdk/src/common/types/options/index.ts
  • libs/sdk/src/common/types/options/auth/shared.schemas.ts
  • libs/sdk/src/common/types/options/auth/index.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Use entry points from package.json exports for public API access instead of direct file imports

Applied to files:

  • libs/sdk/src/common/types/options/index.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 `changeScope` property instead of `scope` in change events to avoid confusion with Scope class

Applied to files:

  • libs/sdk/src/common/types/options/index.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 `getCapabilities()` method for dynamic capability exposure instead of hardcoding capabilities

Applied to files:

  • libs/sdk/src/common/types/options/index.ts
🧬 Code graph analysis (3)
libs/sdk/src/common/types/options/auth/public.schema.ts (2)
libs/sdk/src/common/types/options/auth/shared.schemas.ts (1)
  • publicAccessConfigSchema (15-33)
libs/sdk/src/common/types/options/auth/transport.deprecated.ts (1)
  • transportConfigSchema (34-42)
libs/sdk/src/common/types/options/auth/auth.utils.ts (4)
libs/sdk/src/common/types/options/auth/auth.schema.ts (3)
  • AuthOptionsInput (39-39)
  • AuthOptions (33-33)
  • authOptionsSchema (18-23)
libs/sdk/src/common/types/options/auth/public.schema.ts (1)
  • PublicAuthOptions (65-65)
libs/sdk/src/common/types/options/auth/transparent.schema.ts (1)
  • TransparentAuthOptions (64-64)
libs/sdk/src/common/types/options/auth/orchestrated.schema.ts (3)
  • OrchestratedAuthOptions (203-203)
  • OrchestratedLocalOptions (191-191)
  • OrchestratedRemoteOptions (197-197)
libs/sdk/src/common/types/options/auth/transport.deprecated.ts (2)
libs/sdk/src/auth/session/transport-session.types.ts (1)
  • redisConfigSchema (335-343)
libs/sdk/src/common/types/options/auth/auth.interfaces.ts (2)
  • TransportConfig (257-265)
  • TransportRecreationConfig (248-252)
⏰ 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 (14)
libs/sdk/src/common/interfaces/internal/primary-auth-provider.interface.ts (1)

5-5: Verify that DEFAULT_TRANSPORT_CONFIG is properly defined and typed.

The change from a class-level static default to an imported constant aligns with the PR's tree-shaking objective and is correctly implemented. DEFAULT_TRANSPORT_CONFIG is properly typed as TransportConfig with expected default values, sourced from the deprecated transport configuration schema.

libs/sdk/src/auth/instances/instance.local-primary-auth.ts (1)

12-12: LGTM!

Import path correctly updated to use the new centralized auth barrel export (./auth), aligning with the refactor to consolidate auth options under a unified module. This supports better tree shaking. Based on learnings, this follows the guideline to export public API through barrel files.

libs/sdk/src/common/types/options/auth/transport.deprecated.ts (1)

1-69: LGTM! Well-structured backward compatibility layer.

The deprecated transport schemas are properly implemented with:

  • Clear deprecation markers and removal timeline (v1.0.0)
  • Correct refinement logic for Redis requirement when recreation is enabled
  • Proper use of z.lazy() to handle the optional recreation field
  • Default config derived from schema parsing, ensuring a single source of truth

The schema structure aligns with the TransportConfig and TransportRecreationConfig interfaces shown in the relevant code snippets from auth.interfaces.ts.

libs/sdk/src/common/utils/decide-request-intent.utils.ts (1)

3-3: LGTM! Clean interface composition.

Extending TransportConfig instead of redeclaring individual boolean fields eliminates duplication and ensures the Config interface stays synchronized with the centralized transport configuration type. The tolerateMissingAccept runtime option is correctly added as the only extension. This improves maintainability and supports the tree-shaking goals of this PR.

Also applies to: 54-60

libs/sdk/src/auth/instances/instance.remote-primary-auth.ts (1)

2-2: LGTM!

Import path correctly updated to use the centralized auth barrel export, consistent with the changes in instance.local-primary-auth.ts.

libs/sdk/src/common/types/options/index.ts (1)

4-4: LGTM!

The barrel export correctly updated to re-export from the new ./auth module directory instead of the removed ./auth.options file. This centralizes auth-related exports and supports better tree shaking. Based on learnings, this follows the guideline to export public API through barrel files.

libs/sdk/src/common/types/options/auth/auth.schema.ts (1)

13-44: LGTM! Correct schema composition approach.

Using z.union instead of z.discriminatedUnion is the right choice here since the orchestrated variants share the same mode: 'orchestrated' discriminator and differ by a nested type field. The union correctly combines all four auth mode schemas, and the type exports (AuthOptions, AuthOptionsInput, AuthMode) provide clear, well-documented types for consumers.

libs/sdk/src/common/types/options/auth/app-auth.schema.ts (1)

31-45: LGTM! Clean schema extension pattern.

The approach of using a plain object schema with satisfies RawZodShape<StandaloneOption> ensures type alignment between the TypeScript interface and Zod schema shape. Extending each base auth schema with the standalone options using .extend() is a clean pattern that avoids code duplication while providing app-level auth configuration.

libs/sdk/src/common/types/options/auth/auth.typecheck.ts (1)

1-107: LGTM! Excellent compile-time validation approach.

This type-checking file is a valuable addition that ensures interfaces and Zod schemas stay synchronized. The pattern of using type assertions that fail compilation on mismatch is a robust way to catch schema/interface drift during development. The mode and type literal checks (lines 92-100) are particularly useful for catching discriminator mismatches.

libs/sdk/src/common/types/options/auth/auth.interfaces.ts (1)

1-10: Interface-schema synchronization approach is well-documented.

The explicit separation of interfaces (for IDE autocomplete) and schemas (for runtime validation) is a good pattern for tree shaking. The comment correctly warns about keeping them in sync.

Based on the AI summary, there's a auth.typecheck.ts file that validates this synchronization at compile time, which is an excellent safeguard against drift.

libs/sdk/src/common/types/options/auth/transparent.schema.ts (1)

13-55: LGTM! Transparent auth schema is well-structured.

The schema correctly uses Zod 4 features:

  • .default() for optional fields with sensible defaults
  • .optional() for truly optional fields
  • Required remote field ensures proper configuration
  • Type-safe literals and unions
libs/sdk/src/common/types/options/auth/shared.schemas.ts (2)

75-144: LGTM! Comprehensive OAuth provider configuration.

The remoteProviderConfigSchema is well-designed with:

  • Proper URL validation for all endpoint fields
  • Support for standard OAuth/OIDC discovery via JWKS
  • DCR (Dynamic Client Registration) support
  • Sensible optional overrides for all endpoints

The schema covers both standard OIDC providers and custom implementations well.


206-211: The schema is not duplicated. The consentConfigSchema is defined once in shared.schemas.ts and re-exported from consent.types.ts for convenient domain-specific access. This re-export pattern is a standard way to organize module APIs and avoids circular dependencies without creating a maintenance burden.

Likely an incorrect or invalid review comment.

libs/sdk/src/common/types/options/auth/index.ts (1)

7-65: Dual type system for interfaces and schemas.

This barrel file exports both:

  1. Explicit interfaces (lines 7-30) - for IDE autocomplete, ending without suffix
  2. Zod-inferred types (lines 48-65) - runtime types with Zod or Input suffix

Example: PublicAccessConfig (interface) vs PublicAccessConfigZod (Zod-inferred type)

This dual approach enables:

  • Better tree shaking (consumers can import only what they need)
  • Flexibility to use interfaces for type annotations or Zod types for runtime validation
  • Clear disambiguation when both are needed together

The naming convention is consistent and well thought out. Based on learnings, this aligns with the project's approach to exposing public APIs through barrel files.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
libs/ui/src/renderers/mdx.renderer.ts (1)

106-126: Consider clarifying the transpile method's purpose.

The JSDoc states "Transpile MDX to executable JavaScript" but the implementation stores the raw MDX template as code without actual transpilation. The actual compilation happens in render() via evaluate(). Consider updating the documentation to reflect this is a caching/hashing step rather than transpilation.

Suggested documentation fix
   /**
-   * Transpile MDX to executable JavaScript.
+   * Prepare MDX template for rendering.
+   *
+   * Note: Actual compilation happens during render() via @mdx-js/mdx evaluate().
+   * This method primarily handles caching by content hash.
    */
   async transpile(template: MdxTemplate, _options?: TranspileOptions): Promise<TranspileResult> {
libs/uipack/src/renderers/mdx-client.renderer.ts (1)

242-257: Consider adding a warning for blocked-network platforms.

The getRuntimeScripts method correctly returns a console warning for blocked-network platforms, but users might not see console output. Consider whether the render method should also detect blocked networks and provide a visible fallback.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ab50258 and 42b53d5.

📒 Files selected for processing (4)
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/ui/src/renderers/transpiler.ts
  • libs/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • libs/ui/src/renderers/transpiler.ts
🧰 Additional context used
📓 Path-based instructions (5)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use strict TypeScript mode with no any types without strong justification - use unknown instead 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/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
libs/uipack/src/{components,web-components,renderers,utils}/**/*.ts

📄 CodeRabbit inference engine (libs/uipack/CLAUDE.md)

Always escape user-provided content using escapeHtml() utility to prevent XSS

Files:

  • libs/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
libs/uipack/src/**/*.ts

📄 CodeRabbit inference engine (libs/uipack/CLAUDE.md)

libs/uipack/src/**/*.ts: Do not add React dependencies to uipack - use @frontmcp/ui package for React components instead
Avoid using any type without justification in TypeScript code
Do not expose internal error details in user-facing error messages

Files:

  • libs/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/mdx-client.renderer.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/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
libs/ui/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (libs/ui/CLAUDE.md)

Do not import React-free utilities from @frontmcp/ui; use @frontmcp/uipack instead

Files:

  • libs/ui/src/renderers/mdx.renderer.ts
🧠 Learnings (19)
📓 Common learnings
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
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/bundler/**/*.{ts,tsx} : Use SSR component bundler (createBundler, InMemoryBundler) for bundling React components
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Configure entry points for frontmcp/ui exports: main, react, react/hooks, renderers, render, universal, and bundler
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Use entry points from package.json exports for public API access instead of direct file imports
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/universal/**/*.{ts,tsx} : Export FrontMCPProvider and UniversalApp from universal app shell for platform-agnostic React configuration
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,base-template,layouts,pages}/**/*.ts : Use buildCdnScriptsFromTheme() with appropriate inline flag for platform network access constraints
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Do not add React dependencies to uipack - use frontmcp/ui package for React components instead

Applied to files:

  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/mdx.renderer.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/**/index.ts : Export public API through barrel files - export users' needed items, no legacy exports with different names

Applied to files:

  • libs/uipack/src/renderers/index.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.{ts,tsx} : Do not import React-free utilities from frontmcp/ui; use frontmcp/uipack instead

Applied to files:

  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Configure entry points for frontmcp/ui exports: main, react, react/hooks, renderers, render, universal, and bundler

Applied to files:

  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/renderers/**/*.test.{ts,tsx} : Include hydration tests to verify client-side hydration behavior

Applied to files:

  • libs/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/bundler/**/*.{ts,tsx} : Use SSR component bundler (createBundler, InMemoryBundler) for bundling React components

Applied to files:

  • libs/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/renderers/**/*.adapter.ts : Implement client-side hydration for interactive widgets using ReactRendererAdapter

Applied to files:

  • libs/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{theme,build,layouts,pages,base-template}/**/*.ts : Use theme.cdn configuration instead of hard-coding CDN URLs

Applied to files:

  • libs/uipack/src/renderers/index.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,base-template,layouts,pages}/**/*.ts : Use buildCdnScriptsFromTheme() with appropriate inline flag for platform network access constraints

Applied to files:

  • libs/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/universal/**/*.{ts,tsx} : Export FrontMCPProvider and UniversalApp from universal app shell for platform-agnostic React configuration

Applied to files:

  • libs/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/**/*.{ts,tsx} : Use React 18/19 with TypeScript for all components in frontmcp/ui

Applied to files:

  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/**/*.{ts,tsx} : Ensure SSR support via react-dom/server for React components

Applied to files:

  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Include SSR tests to verify server-side rendering output for React components

Applied to files:

  • libs/uipack/src/renderers/index.ts
  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/hooks/**/*.{ts,tsx} : Use MCP bridge hooks (useMcpBridge, useCallTool, useToolInput, useToolOutput) for tool communication in components

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components,renderers,utils}/**/*.ts : Always escape user-provided content using escapeHtml() utility to prevent XSS

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components,renderers}/**/*.test.ts : Test HTML escaping for user-provided content in component tests

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,build,layouts,pages}/**/*.ts : Use platform-aware theming via getPlatform(), OPENAI_PLATFORM, and CLAUDE_PLATFORM constants for network capability detection

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Zero React dependency constraint - this is the React-free core package

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
🧬 Code graph analysis (1)
libs/uipack/src/renderers/mdx-client.renderer.ts (2)
libs/uipack/src/renderers/types.ts (6)
  • RenderOptions (111-118)
  • UIRenderer (160-213)
  • TranspileOptions (101-106)
  • TranspileResult (87-96)
  • ToolUIProps (30-39)
  • RuntimeScripts (123-130)
libs/uipack/src/registry/render-template.ts (1)
  • containsMdxSyntax (27-65)
⏰ 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 (5)
libs/ui/src/renderers/mdx.renderer.ts (1)

186-199: Good defensive handling of reserved props.

The logic correctly prevents output properties from overwriting core props (input, output, structuredContent, helpers, components) by filtering them out before spreading. The ordering ensures reserved props take precedence.

libs/uipack/src/renderers/index.ts (2)

69-82: Well-documented deprecation with clear migration path.

The deprecation notice provides actionable guidance distinguishing between server-side (@frontmcp/ui/renderers) and client-side (@frontmcp/uipack/renderers) use cases. The alias maintains backwards compatibility during the transition period.


52-52: No action needed. componentCache is properly exported from ./cache on line 289.

libs/uipack/src/renderers/mdx-client.renderer.ts (2)

1-10: LGTM - Correct separation of React-free client renderer.

This new renderer correctly implements the React-free client-side MDX rendering path. Dependencies are loaded from CDN at runtime rather than bundled, which aligns with the uipack guideline to avoid React dependencies. Based on learnings, uipack should not add React dependencies.


185-193: Good use of escapeHtml for user-provided content.

The loadingMessage and containerId are properly escaped using escapeHtml() before embedding in HTML, preventing XSS. The MDX template and props use JSON.stringify which correctly escapes special characters for JavaScript string context. As per coding guidelines, user-provided content in uipack renderers should always be escaped.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
libs/ui/package.json (1)

57-61: Remove or replace the non-existent "enclave-vm" dependency.

The package enclave-vm@1.0.3 does not exist on the npm registry. Verify whether this should be a different package name, an internal @frontmcp scoped package, or a local dependency. Other verified versions (zod@4.0.0, esbuild@0.27.1, @swc/core@1.5.0) are valid.

♻️ Duplicate comments (2)
libs/testing/package.json (2)

45-55: Previous ESM path issue appears resolved.

The ./setup export now correctly points to ./dist/esm/setup.js with the dist/ prefix. Based on learnings, this aligns with the entry point configuration pattern.


59-69: Previous ESM path issue appears resolved.

The ./fixtures export now correctly points to ./dist/esm/fixtures/index.js with the dist/ prefix.

🧹 Nitpick comments (1)
libs/sdk/project.json (1)

25-42: Consider extracting duplicated externals list.

The external array is duplicated between build-cjs and build-esm targets. If Nx supports shared options or target defaults, consolidating would reduce maintenance burden.

This is a minor DRY concern—the current approach works correctly but requires updating both lists when dependencies change.

Also applies to: 62-79

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 42b53d5 and c302fe7.

📒 Files selected for processing (10)
  • libs/adapters/package.json
  • libs/json-schema-to-zod-v3/package.json
  • libs/mcp-from-openapi/package.json
  • libs/plugins/package.json
  • libs/sdk/package.json
  • libs/sdk/project.json
  • libs/sdk/tsconfig.lib.json
  • libs/testing/package.json
  • libs/ui/package.json
  • libs/uipack/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • libs/plugins/package.json
🧰 Additional context used
📓 Path-based instructions (2)
libs/*/package.json

📄 CodeRabbit inference engine (CLAUDE.md)

Each library in /libs/* is independent and publishable under @frontmcp/* scope

Files:

  • libs/uipack/package.json
  • libs/mcp-from-openapi/package.json
  • libs/ui/package.json
  • libs/testing/package.json
  • libs/adapters/package.json
  • libs/sdk/package.json
  • libs/json-schema-to-zod-v3/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/uipack/package.json
  • libs/mcp-from-openapi/package.json
  • libs/ui/package.json
  • libs/testing/package.json
  • libs/adapters/package.json
  • libs/sdk/package.json
  • libs/sdk/project.json
  • libs/sdk/tsconfig.lib.json
  • libs/json-schema-to-zod-v3/package.json
🧠 Learnings (24)
📓 Common learnings
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
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/bundler/**/*.{ts,tsx} : Use SSR component bundler (createBundler, InMemoryBundler) for bundling React components
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Configure entry points for frontmcp/ui exports: main, react, react/hooks, renderers, render, universal, and bundler
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Use entry points from package.json exports for public API access instead of direct file imports
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/universal/**/*.{ts,tsx} : Export FrontMCPProvider and UniversalApp from universal app shell for platform-agnostic React configuration
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Do not add React dependencies to uipack - use frontmcp/ui package for React components instead
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.{ts,tsx} : Do not import React-free utilities from frontmcp/ui; use frontmcp/uipack instead
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/**/*.{ts,tsx} : Use React 18/19 with TypeScript for all components in frontmcp/ui
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,base-template,layouts,pages}/**/*.ts : Use buildCdnScriptsFromTheme() with appropriate inline flag for platform network access constraints
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/**/*.{ts,tsx} : Ensure SSR support via react-dom/server for React components
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Do not add React dependencies to uipack - use frontmcp/ui package for React components instead

Applied to files:

  • libs/uipack/package.json
  • libs/ui/package.json
  • libs/testing/package.json
  • libs/adapters/package.json
  • libs/sdk/package.json
  • libs/sdk/tsconfig.lib.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Do not expose internal error details in user-facing error messages

Applied to files:

  • libs/uipack/package.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.{ts,tsx} : Do not import React-free utilities from frontmcp/ui; use frontmcp/uipack instead

Applied to files:

  • libs/uipack/package.json
  • libs/ui/package.json
  • libs/testing/package.json
  • libs/adapters/package.json
  • libs/sdk/package.json
  • libs/sdk/tsconfig.lib.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Avoid using `any` type without justification in TypeScript code

Applied to files:

  • libs/uipack/package.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Zero React dependency constraint - this is the React-free core package

Applied to files:

  • libs/uipack/package.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Configure entry points for frontmcp/ui exports: main, react, react/hooks, renderers, render, universal, and bundler

Applied to files:

  • libs/uipack/package.json
  • libs/mcp-from-openapi/package.json
  • libs/ui/package.json
  • libs/testing/package.json
  • libs/adapters/package.json
  • libs/sdk/package.json
  • libs/sdk/project.json
  • libs/sdk/tsconfig.lib.json
📚 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/uipack/package.json
  • libs/mcp-from-openapi/package.json
  • libs/ui/package.json
  • libs/testing/package.json
  • libs/adapters/package.json
  • libs/sdk/package.json
  • libs/sdk/project.json
  • libs/sdk/tsconfig.lib.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Use entry points from package.json exports for public API access instead of direct file imports

Applied to files:

  • libs/uipack/package.json
  • libs/mcp-from-openapi/package.json
  • libs/ui/package.json
  • libs/testing/package.json
  • libs/adapters/package.json
  • libs/sdk/package.json
  • libs/sdk/project.json
  • libs/json-schema-to-zod-v3/package.json
📚 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/*/package.json : Each library in /libs/* is independent and publishable under frontmcp/* scope

Applied to files:

  • libs/mcp-from-openapi/package.json
  • libs/testing/package.json
  • libs/adapters/package.json
  • libs/sdk/package.json
📚 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/mcp-from-openapi/package.json
  • libs/testing/package.json
  • libs/adapters/package.json
  • libs/sdk/package.json
  • libs/sdk/tsconfig.lib.json
  • libs/json-schema-to-zod-v3/package.json
📚 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/mcp-from-openapi/package.json
  • libs/sdk/tsconfig.lib.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/universal/**/*.{ts,tsx} : Export FrontMCPProvider and UniversalApp from universal app shell for platform-agnostic React configuration

Applied to files:

  • libs/mcp-from-openapi/package.json
  • libs/testing/package.json
  • libs/adapters/package.json
  • libs/sdk/package.json
  • libs/sdk/tsconfig.lib.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,build,layouts,pages}/**/*.ts : Use platform-aware theming via getPlatform(), OPENAI_PLATFORM, and CLAUDE_PLATFORM constants for network capability detection

Applied to files:

  • libs/adapters/package.json
📚 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 `changeScope` property instead of `scope` in change events to avoid confusion with Scope class

Applied to files:

  • libs/sdk/package.json
  • libs/sdk/project.json
  • libs/sdk/tsconfig.lib.json
📚 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/common/records/**/*.ts : Centralize record types in common/records directory and import from there instead of module-specific files

Applied to files:

  • libs/sdk/package.json
  • libs/sdk/project.json
  • libs/sdk/tsconfig.lib.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,base-template,layouts,pages}/**/*.ts : Use buildCdnScriptsFromTheme() with appropriate inline flag for platform network access constraints

Applied to files:

  • libs/sdk/project.json
📚 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 `getCapabilities()` method for dynamic capability exposure instead of hardcoding capabilities

Applied to files:

  • libs/sdk/project.json
  • libs/sdk/tsconfig.lib.json
📚 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: Use Nx for build system with commands like `nx build sdk`, `nx test`, `nx run-many -t test`

Applied to files:

  • libs/sdk/project.json
📚 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/tsconfig.lib.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/**/*.{ts,tsx} : Use React 18/19 with TypeScript for all components in frontmcp/ui

Applied to files:

  • libs/sdk/tsconfig.lib.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components}/**/*.{ts,tsx} : Every component must have a Zod schema with `.strict()` mode to reject unknown properties

Applied to files:

  • libs/sdk/tsconfig.lib.json
  • libs/json-schema-to-zod-v3/package.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/**/*.{ts,tsx} : Provide TypeScript types for all component props without using 'any' type without justification

Applied to files:

  • libs/sdk/tsconfig.lib.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components}/**/*.ts : Validate all component options using validateOptions() helper with the component's Zod schema

Applied to files:

  • libs/json-schema-to-zod-v3/package.json
⏰ 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: Lint & Format Checks
  • GitHub Check: Build Libraries
🔇 Additional comments (21)
libs/testing/package.json (3)

27-31: LGTM! Tree shaking configuration looks correct.

The "sideEffects": false flag combined with explicit "type": "commonjs" and dual main/module entries properly enables bundler tree shaking while maintaining backward compatibility.


36-43: Root export paths are correctly structured.

The require/import conditional exports with separate type declarations for CJS (./dist/index.d.ts) and ESM (./dist/esm/index.d.ts) follow the recommended dual-package pattern.


91-92: Good practice: Explicit null export for ./esm.

This prevents accidental direct imports from the ESM directory, ensuring consumers use the proper conditional exports.

libs/sdk/tsconfig.lib.json (1)

10-16: Self-referencing path alias for development builds.

The @frontmcp/sdk path mapping to source (vs. dist for sibling packages) enables internal imports during compilation. This aligns with the "development": "./src/index.ts" entries in package.json exports.

libs/sdk/project.json (3)

8-44: CJS build target configuration looks correct.

The esbuild configuration properly:

  • Externalizes peer dependencies and self-references
  • Generates declarations with correct root directory
  • Uses platform: node for server-side builds

46-81: ESM build target correctly chains after CJS.

The dependsOn: ["build-cjs"] ensures declarations from CJS are available, and outputting to dist/esm maintains the expected directory structure for dual-package exports.


83-89: Build orchestration is sound.

The top-level build target correctly depends on both format targets and runs the package.json path cleanup script.

libs/sdk/package.json (4)

26-30: Tree shaking configuration is correctly applied.

The combination of "type": "commonjs", "sideEffects": false, and explicit module field follows best practices for dual CJS/ESM packages with tree shaking support.


33-43: Root export conditional paths are well-structured.

The development, require, and import conditions properly map to source (for dev tools), CJS, and ESM outputs respectively. Type declarations are correctly paired with each format.


44-54: ./mcp-apps sub-path export follows the same pattern.

Consistent with the root export structure and aligns with the additionalEntryPoints in project.json. Based on learnings, using entry points from package.json exports for public API access is the correct approach.


55-55: Good: Explicit null export for ./esm.

Prevents consumers from accidentally importing @frontmcp/sdk/esm directly, enforcing use of proper conditional exports.

libs/uipack/package.json (1)

32-32: LGTM. Adding "sideEffects": false correctly enables aggressive tree shaking for this utility library, aligning with the PR's optimization goals. The package contains only pure re-exports with no code execution on import, no global modifications, and no CSS imports—confirming it is safe to mark as side-effect-free.

libs/json-schema-to-zod-v3/package.json (4)

38-48: LGTM! Well-structured conditional exports.

The exports field correctly implements dual module support following Node.js best practices:

  • development condition provides source access during development
  • require block serves CommonJS consumers with dedicated types
  • import block serves ESM consumers with dedicated types
  • Proper separation ensures bundlers can tree-shake ESM builds effectively

This structure aligns with the PR objective to enhance tree shaking.


49-49: Good defensive pattern to prevent internal path imports.

Setting "./esm": null prevents consumers from directly importing from the ESM output directory (e.g., import ... from 'json-schema-to-zod-v3/esm'), ensuring all imports go through the controlled main export. This maintains a stable public API surface.


35-35: "sideEffects": false is correctly set for this library.

The codebase confirms this package is a pure converter with no module-level side effects. No global state mutations, polyfills, or prototype modifications detected.


31-35: The build configuration correctly supports the new package.json entry points. The Nx esbuild targets output CommonJS to dist/index.js and ESM to dist/esm/index.js, with corresponding type definitions at dist/index.d.ts and dist/esm/index.d.ts. The tsconfig.lib.json uses rootDir: "./src" to prevent nested source directories in the output, and both build targets are properly configured with declaration enabled.

libs/ui/package.json (1)

30-30: sideEffects: false is correctly configured for this library.

The package contains no module-level side effects. Verification confirms:

  • No CSS, SCSS, or style imports
  • No global state initialization, mutations, or polyfills
  • No module-level event listeners (all addEventListener calls are inside functions or template strings)
  • Type augmentations in web-components/types.ts are compile-time declarations only, not runtime side effects

The library is safe for aggressive tree-shaking.

libs/adapters/package.json (1)

24-28: Build outputs are missing—verify the build system correctly outputs to dist/ and dist/esm/ directories.

The sideEffects: false declaration is accurate; no side effects were detected in the source code. However, the package.json entry points must have corresponding files on disk, as sideEffects: false signals to bundlers that only declared exports are safe to keep.

The package currently declares these entry points:

  • ./dist/index.js (CJS)
  • ./dist/index.d.ts (types)
  • ./dist/esm/index.js (ESM)
  • ./dist/esm/index.d.ts (ESM types)

None of these files exist. The build system must output to both directories with the correct structure matching the conditional exports in package.json.

⛔ Skipped due to learnings
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Use entry points from package.json exports for public API access instead of direct file imports
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,components,web-components}/**/*.test.ts : Test component behavior across platform configurations (OpenAI, Claude, etc.)
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Configure entry points for frontmcp/ui exports: main, react, react/hooks, renderers, render, universal, and bundler
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
libs/mcp-from-openapi/package.json (3)

51-51: LGTM! Blocks direct ESM path access.

The "./esm": null entry correctly prevents consumers from bypassing the conditional exports by importing directly from mcp-from-openapi/esm. This ensures all imports go through the exports map where Node.js can properly resolve the appropriate format based on the consumer's module system.


40-50: Verify that dual type declaration files are generated correctly by the build system.

The exports structure requires type declarations at two locations:

  • ./dist/index.d.ts for CommonJS consumers
  • ./dist/esm/index.d.ts for ESM consumers

esbuild doesn't support the creation of declaration files (*.d.ts), so the build process must handle type generation separately. The commonly accepted workaround is to run a tsc build before the esbuild build that only outputs the declaration files. Verify that the build configuration includes type declaration generation for both CJS and ESM output formats to ensure the package's type exports are correct.


2-2: The package naming is correct. The unscoped package name "mcp-from-openapi" is published to npm with 2,006 weekly downloads, indicating this is an intentional publishing choice.

The data shows 6 out of 9 packages in /libs/ use the @frontmcp/* scope, while 3 packages intentionally remain unscoped (mcp-from-openapi, json-schema-to-zod-v3, and frontmcp). The learning that "each library should be under @frontmcp/* scope" is overstated—unscoped packages in this monorepo serve specific purposes and are published as standalone tools with independent versioning.

No changes required.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
libs/mcp-from-openapi/package.json (1)

2-2: Critical: Package name must use @frontmcp/ scope.

Per coding guidelines, each library in /libs/* must be published under the @frontmcp/* scope. The package name should be "@frontmcp/mcp-from-openapi" instead of "mcp-from-openapi".

This is required for consistency with other packages in the monorepo (e.g., @frontmcp/sdk, @frontmcp/uipack, @frontmcp/ui).

As per coding guidelines, this package should follow the @frontmcp/* scoping convention.

🔎 Proposed fix
-  "name": "mcp-from-openapi",
+  "name": "@frontmcp/mcp-from-openapi",
libs/sdk/src/common/decorators/front-mcp.decorator.ts (1)

62-76: Inconsistent lazy loading pattern in serverless mode.

The serverless path still uses direct require('@frontmcp/sdk') instead of leveraging the getFrontMcpInstance() helper introduced above. This inconsistency means the serverless mode doesn't benefit from the lazy loading pattern designed to avoid circular dependencies.

If lazy loading is necessary to prevent circular dependency issues, the same approach should be applied consistently in both serverless and non-serverless modes.

🔎 Proposed fix to use consistent lazy loading

Consider whether ServerlessInstance should also be retrieved via getFrontMcpInstance(), or if there's a specific reason the serverless path requires a different approach. If they should be the same instance:

     if (isServerless) {
       // Serverless mode: bootstrap, prepare (no listen), store handler globally
-      // Use synchronous require for bundler compatibility (rspack/webpack)
-      // eslint-disable-next-line @typescript-eslint/no-require-imports
-      const {
-        FrontMcpInstance: ServerlessInstance,
-        setServerlessHandler,
-        setServerlessHandlerPromise,
-        setServerlessHandlerError,
-      }: {
-        FrontMcpInstance: typeof import('../../front-mcp').FrontMcpInstance;
-        setServerlessHandler: (handler: unknown) => void;
-        setServerlessHandlerPromise: (promise: Promise<unknown>) => void;
-        setServerlessHandlerError: (error: Error) => void;
-      } = require('@frontmcp/sdk');
+      const ServerlessInstance = getFrontMcpInstance();
+      // eslint-disable-next-line @typescript-eslint/no-require-imports
+      const {
+        setServerlessHandler,
+        setServerlessHandlerPromise,
+        setServerlessHandlerError,
+      } = require('@frontmcp/sdk');
 
       if (!ServerlessInstance) {
♻️ Duplicate comments (1)
libs/adapters/package.json (1)

24-54: Export structure correctly configured for dual CJS/ESM distribution.

The nested require/import blocks with proper type resolutions follow best practices for dual distribution. The "./esm": null entry correctly prevents direct ESM folder access.

However, as flagged in a previous review, ensure the build configuration generates all required outputs for the ./openapi export (dist/openapi/index.js, dist/openapi/index.d.ts, dist/esm/openapi/index.mjs).

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c302fe7 and b4c8d00.

📒 Files selected for processing (18)
  • libs/adapters/package.json
  • libs/adapters/project.json
  • libs/json-schema-to-zod-v3/package.json
  • libs/json-schema-to-zod-v3/project.json
  • libs/mcp-from-openapi/package.json
  • libs/mcp-from-openapi/project.json
  • libs/plugins/package.json
  • libs/plugins/project.json
  • libs/sdk/package.json
  • libs/sdk/project.json
  • libs/sdk/src/common/decorators/front-mcp.decorator.ts
  • libs/testing/package.json
  • libs/testing/project.json
  • libs/ui/package.json
  • libs/ui/project.json
  • libs/ui/src/web-components/index.ts
  • libs/uipack/package.json
  • libs/uipack/project.json
💤 Files with no reviewable changes (1)
  • libs/ui/src/web-components/index.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • libs/ui/package.json
  • libs/json-schema-to-zod-v3/package.json
🧰 Additional context used
📓 Path-based instructions (4)
libs/*/package.json

📄 CodeRabbit inference engine (CLAUDE.md)

Each library in /libs/* is independent and publishable under @frontmcp/* scope

Files:

  • libs/mcp-from-openapi/package.json
  • libs/sdk/package.json
  • libs/plugins/package.json
  • libs/adapters/package.json
  • libs/testing/package.json
  • libs/uipack/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/mcp-from-openapi/package.json
  • libs/plugins/project.json
  • libs/sdk/project.json
  • libs/sdk/package.json
  • libs/plugins/package.json
  • libs/adapters/project.json
  • libs/sdk/src/common/decorators/front-mcp.decorator.ts
  • libs/adapters/package.json
  • libs/testing/package.json
  • libs/testing/project.json
  • libs/json-schema-to-zod-v3/project.json
  • libs/uipack/package.json
  • libs/mcp-from-openapi/project.json
  • libs/ui/project.json
  • libs/uipack/project.json
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use strict TypeScript mode with no any types without strong justification - use unknown instead 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 of unknown
Use specific error classes with MCP error codes instead of generic errors
Use getCapabilities() method for dynamic capability exposure instead of hardcoding capabilities
Use changeScope property instead of scope in 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
🧠 Learnings (29)
📓 Common learnings
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Configure entry points for frontmcp/ui exports: main, react, react/hooks, renderers, render, universal, and bundler
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
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/bundler/**/*.{ts,tsx} : Use SSR component bundler (createBundler, InMemoryBundler) for bundling React components
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Use entry points from package.json exports for public API access instead of direct file imports
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T02:04:46.464Z
Learning: Use Nx for build system with commands like `nx build sdk`, `nx test`, `nx run-many -t test`
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Use entry points from package.json exports for public API access instead of direct file imports

Applied to files:

  • libs/mcp-from-openapi/package.json
  • libs/sdk/package.json
  • libs/plugins/package.json
  • libs/adapters/package.json
  • libs/testing/package.json
  • libs/uipack/package.json
📚 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/*/package.json : Each library in /libs/* is independent and publishable under frontmcp/* scope

Applied to files:

  • libs/mcp-from-openapi/package.json
  • libs/sdk/package.json
  • libs/plugins/package.json
  • libs/adapters/package.json
  • libs/testing/package.json
  • libs/mcp-from-openapi/project.json
📚 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/mcp-from-openapi/package.json
  • libs/sdk/package.json
  • libs/plugins/package.json
  • libs/sdk/src/common/decorators/front-mcp.decorator.ts
  • libs/adapters/package.json
  • libs/testing/package.json
📚 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/mcp-from-openapi/package.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/universal/**/*.{ts,tsx} : Export FrontMCPProvider and UniversalApp from universal app shell for platform-agnostic React configuration

Applied to files:

  • libs/mcp-from-openapi/package.json
  • libs/sdk/package.json
  • libs/plugins/package.json
  • libs/sdk/src/common/decorators/front-mcp.decorator.ts
  • libs/adapters/package.json
  • libs/testing/package.json
  • libs/uipack/package.json
  • libs/ui/project.json
  • libs/uipack/project.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Do not add React dependencies to uipack - use frontmcp/ui package for React components instead

Applied to files:

  • libs/mcp-from-openapi/package.json
  • libs/sdk/package.json
  • libs/plugins/package.json
  • libs/adapters/package.json
  • libs/testing/package.json
  • libs/uipack/package.json
  • libs/ui/project.json
  • libs/uipack/project.json
📚 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/mcp-from-openapi/package.json
  • libs/plugins/project.json
  • libs/sdk/project.json
  • libs/sdk/package.json
  • libs/plugins/package.json
  • libs/adapters/project.json
  • libs/adapters/package.json
  • libs/testing/package.json
  • libs/testing/project.json
  • libs/json-schema-to-zod-v3/project.json
  • libs/uipack/package.json
  • libs/ui/project.json
  • libs/uipack/project.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.{ts,tsx} : Do not import React-free utilities from frontmcp/ui; use frontmcp/uipack instead

Applied to files:

  • libs/mcp-from-openapi/package.json
  • libs/sdk/package.json
  • libs/plugins/package.json
  • libs/sdk/src/common/decorators/front-mcp.decorator.ts
  • libs/adapters/package.json
  • libs/testing/package.json
  • libs/uipack/package.json
  • libs/ui/project.json
  • libs/uipack/project.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Configure entry points for frontmcp/ui exports: main, react, react/hooks, renderers, render, universal, and bundler

Applied to files:

  • libs/mcp-from-openapi/package.json
  • libs/sdk/project.json
  • libs/sdk/package.json
  • libs/plugins/package.json
  • libs/adapters/package.json
  • libs/testing/package.json
  • libs/uipack/package.json
  • libs/mcp-from-openapi/project.json
  • libs/ui/project.json
  • libs/uipack/project.json
📚 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: Use Nx for build system with commands like `nx build sdk`, `nx test`, `nx run-many -t test`

Applied to files:

  • libs/plugins/project.json
  • libs/sdk/project.json
  • libs/adapters/project.json
  • libs/testing/project.json
  • libs/json-schema-to-zod-v3/project.json
  • libs/mcp-from-openapi/project.json
📚 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 `changeScope` property instead of `scope` in change events to avoid confusion with Scope class

Applied to files:

  • libs/sdk/project.json
  • libs/sdk/package.json
📚 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/common/records/**/*.ts : Centralize record types in common/records directory and import from there instead of module-specific files

Applied to files:

  • libs/sdk/project.json
  • libs/sdk/package.json
  • libs/uipack/package.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,base-template,layouts,pages}/**/*.ts : Use buildCdnScriptsFromTheme() with appropriate inline flag for platform network access constraints

Applied to files:

  • libs/adapters/project.json
  • libs/adapters/package.json
  • libs/uipack/package.json
  • libs/ui/project.json
  • libs/uipack/project.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,build,layouts,pages}/**/*.ts : Use platform-aware theming via getPlatform(), OPENAI_PLATFORM, and CLAUDE_PLATFORM constants for network capability detection

Applied to files:

  • libs/adapters/project.json
  • libs/adapters/package.json
  • libs/uipack/package.json
  • libs/ui/project.json
  • libs/uipack/project.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,components,web-components}/**/*.test.ts : Test component behavior across platform configurations (OpenAI, Claude, etc.)

Applied to files:

  • libs/adapters/project.json
  • libs/testing/package.json
  • libs/uipack/package.json
  • libs/ui/project.json
  • libs/uipack/project.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Use React Testing Library for component tests with 95%+ coverage across statements, branches, functions, and lines

Applied to files:

  • libs/testing/package.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Do not expose internal error details in user-facing error messages

Applied to files:

  • libs/uipack/package.json
  • libs/uipack/project.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Avoid using `any` type without justification in TypeScript code

Applied to files:

  • libs/uipack/package.json
  • libs/uipack/project.json
📚 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/mcp-from-openapi/project.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/bundler/**/*.{ts,tsx} : Use SSR component bundler (createBundler, InMemoryBundler) for bundling React components

Applied to files:

  • libs/ui/project.json
  • libs/uipack/project.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components}/**/*.{ts,tsx} : Every component must have a Zod schema with `.strict()` mode to reject unknown properties

Applied to files:

  • libs/ui/project.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Include SSR tests to verify server-side rendering output for React components

Applied to files:

  • libs/ui/project.json
  • libs/uipack/project.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{handlebars,build,layouts,pages}/**/*.ts : Use Handlebars template engine for dynamic template rendering with variable substitution

Applied to files:

  • libs/ui/project.json
  • libs/uipack/project.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/**/*.{ts,tsx} : Use React 18/19 with TypeScript for all components in frontmcp/ui

Applied to files:

  • libs/ui/project.json
  • libs/uipack/project.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{theme,build,layouts,pages,base-template}/**/*.ts : Use theme.cdn configuration instead of hard-coding CDN URLs

Applied to files:

  • libs/uipack/project.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Maintain peer dependencies on React ^18.0.0 || ^19.0.0 and react-dom ^18.0.0 || ^19.0.0

Applied to files:

  • libs/uipack/project.json
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/**/*.{ts,tsx} : Ensure SSR support via react-dom/server for React components

Applied to files:

  • libs/uipack/project.json
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components}/**/*.ts : Validate all component options using validateOptions() helper with the component's Zod schema

Applied to files:

  • libs/uipack/project.json
🔇 Additional comments (16)
libs/ui/project.json (1)

48-85: LGTM: Dual CJS/ESM build correctly configured.

The ESM build properly uses .mjs extension and disables duplicate declaration generation. The external dependency list correctly excludes bundling of heavy dependencies like onnxruntime-*, esbuild, and @huggingface/transformers.

libs/uipack/package.json (2)

30-32: LGTM: Tree shaking configuration correctly applied.

The "sideEffects": false declaration enables aggressive tree shaking, and the "module" field correctly points to the ESM build with .mjs extension.


33-57: LGTM: Exports correctly configured for dual CJS/ESM.

The exports map properly distinguishes between require (CJS) and import (ESM) conditions, with correct paths to .mjs files for ESM. The "./esm": null entry prevents direct imports from the esm directory.

libs/testing/project.json (1)

47-83: ESM build correctly configured with .mjs extension.

The use of .mjs extension (line 67) resolves the previous concern about Node.js module resolution. With .mjs, Node automatically treats files as ESM regardless of the parent package.json "type" field, eliminating the need for a separate package.json in dist/esm/.

libs/adapters/project.json (1)

8-67: LGTM: Dual-build configuration properly implemented.

The esbuild-based build targets correctly separate CJS and ESM outputs. The external dependency list appropriately excludes @frontmcp/*, @modelcontextprotocol/sdk, and related libraries from bundling.

libs/sdk/project.json (1)

45-80: LGTM: ESM build optimized with skipTypeCheck.

The "skipTypeCheck": true (line 58) is a valid optimization since type checking already occurs in the build-cjs target. The comprehensive external list correctly prevents bundling of runtime dependencies like ioredis, jose, express, and Vercel KV.

libs/mcp-from-openapi/project.json (1)

8-51: LGTM: Build configuration follows established pattern.

The dual-build setup correctly externalizes dependencies like @apidevtools/json-schema-ref-parser, openapi-types, yaml, and zod. Asset list appropriately includes the CHANGELOG.md for this independently versioned package.

libs/uipack/project.json (2)

41-52: LGTM: React correctly externalized for React-free core.

The addition of react, react/*, react-dom, and react-dom/* to the external list aligns with the architectural principle that uipack is a React-free core package.

Based on learnings, uipack should not bundle React dependencies.


87-98: LGTM: ESM build configuration matches CJS externals.

The ESM build correctly mirrors the CJS externalization strategy with .mjs output extension and React excluded from the bundle.

libs/mcp-from-openapi/package.json (1)

33-51: ESM configuration correctly updated with .mjs extension.

The package correctly uses .mjs extension for ESM output (line 48), which resolves the module resolution concerns from the previous review. With "type": "commonjs" and .mjs files, Node.js will correctly interpret the ESM build as ES modules.

The exports structure properly separates require and import conditions with matching type declarations.

libs/json-schema-to-zod-v3/project.json (1)

8-54: Well-structured dual CJS/ESM build configuration.

The new build targets correctly:

  • Generate CJS output with declarations in dist/
  • Generate ESM output with .mjs extension in dist/esm/
  • Mark zod as external to avoid bundling the dependency
  • Chain build-esm after build-cjs to reuse declaration files
libs/plugins/package.json (1)

24-65: Export structure correctly aligns with dual distribution pattern.

The ./cache and ./codecall subpath exports follow the established pattern with proper require/import blocks. Per coding guidelines, entry points from package.json exports should be used for public API access.

libs/plugins/project.json (1)

8-68: Build configuration properly supports all declared exports.

The additionalEntryPoints correctly include cache/index.ts and codecall/index.ts, ensuring build outputs match the package.json export declarations. The comprehensive external list prevents bundling of dependencies, which is essential for tree shaking.

libs/sdk/package.json (1)

26-56: Export configuration follows dual distribution best practices.

The structure correctly provides:

  • Shared type definitions between CJS and ESM (avoiding duplicate .d.ts in ESM)
  • Proper .mjs extensions for ESM entry points
  • The ./mcp-apps subpath aligns with barrel file export patterns
libs/testing/package.json (1)

27-93: Export paths now correctly include the dist/ prefix.

The previous issues with missing dist/ prefixes in ESM export paths have been addressed. All subpath exports (./setup, ./fixtures, ./matchers, ./playwright) now correctly resolve to ./dist/esm/*.mjs for ESM consumers.

The shared type definitions under import.types pointing to ./dist/*.d.ts (rather than ./dist/esm/*.d.ts) is correct since declarations are generated only in the CJS build and reused.

libs/sdk/src/common/decorators/front-mcp.decorator.ts (1)

94-95: Correct usage of lazy loading pattern (pending require() fix).

The non-serverless path correctly applies the lazy loading pattern via getFrontMcpInstance(). However, this usage depends on resolving the require() vs ESM issue flagged in the earlier comment on lines 7-16.

If the lazy loading mechanism is refactored to use dynamic import() for ESM compatibility, this call site will need to be adjusted to handle the asynchronous nature of ESM imports.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
libs/ui/src/renderers/mdx.renderer.ts (1)

40-52: Verify React version compatibility for peer dependency range.

While buildReactCdnUrls now accepts both '18' and '19', the CDN URLs are used only for client-side hydration scripts (Line 248). The actual SSR rendering uses the installed React version from loadReact(). However, the hard-coded default to React 19 CDN could cause hydration mismatches if the installed version is React 18.

Based on learnings: The package peer dependencies support both React 18 and 19 (^18.0.0 || ^19.0.0).

Consider detecting the installed React version at runtime and selecting the matching CDN URL:

#!/bin/bash
# Search for React version detection logic in the codebase
rg -n -C3 'React\.version|react.*version.*detect' --type=ts
🧹 Nitpick comments (1)
libs/ui/src/renderers/mdx.renderer.ts (1)

94-100: Consider using unknown instead of any for stricter type safety.

The lazy-loaded module types are declared as any with an ESLint disable comment. Per strict TypeScript guidelines, consider using unknown as the generic type default and type-guard these values before use, or explicitly type them as module interfaces.

As per coding guidelines: "Use strict TypeScript mode with no any types without strong justification - use unknown instead for generic type defaults."

Suggested type improvement
  /**
   * Lazy-loaded modules.
   */
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- private React: any = null;
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- private ReactDOMServer: any = null;
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- private jsxRuntime: any = null;
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- private mdxEvaluate: ((source: string, options: object) => Promise<{ default: any }>) | null = null;
+ private React: typeof import('react') | null = null;
+ private ReactDOMServer: typeof import('react-dom/server') | null = null;
+ private jsxRuntime: typeof import('react/jsx-runtime') | null = null;
+ private mdxEvaluate: typeof import('@mdx-js/mdx').evaluate | null = null;
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b4c8d00 and a8de2aa.

📒 Files selected for processing (6)
  • libs/sdk/src/common/interfaces/internal/primary-auth-provider.interface.ts
  • libs/sdk/src/common/types/options/auth/orchestrated.schema.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/index.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/uipack/tsconfig.lib.tsbuildinfo
✅ Files skipped from review due to trivial changes (1)
  • libs/uipack/tsconfig.lib.tsbuildinfo
🚧 Files skipped from review as they are similar to previous changes (1)
  • libs/sdk/src/common/types/options/auth/orchestrated.schema.ts
🧰 Additional context used
📓 Path-based instructions (6)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use strict TypeScript mode with no any types without strong justification - use unknown instead 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/interfaces/internal/primary-auth-provider.interface.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/index.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 of unknown
Use specific error classes with MCP error codes instead of generic errors
Use getCapabilities() method for dynamic capability exposure instead of hardcoding capabilities
Use changeScope property instead of scope in 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/interfaces/internal/primary-auth-provider.interface.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/interfaces/internal/primary-auth-provider.interface.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/index.ts
libs/uipack/src/{components,web-components,renderers,utils}/**/*.ts

📄 CodeRabbit inference engine (libs/uipack/CLAUDE.md)

Always escape user-provided content using escapeHtml() utility to prevent XSS

Files:

  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/uipack/src/renderers/index.ts
libs/uipack/src/**/*.ts

📄 CodeRabbit inference engine (libs/uipack/CLAUDE.md)

libs/uipack/src/**/*.ts: Do not add React dependencies to uipack - use @frontmcp/ui package for React components instead
Avoid using any type without justification in TypeScript code
Do not expose internal error details in user-facing error messages

Files:

  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/uipack/src/renderers/index.ts
libs/ui/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (libs/ui/CLAUDE.md)

Do not import React-free utilities from @frontmcp/ui; use @frontmcp/uipack instead

Files:

  • libs/ui/src/renderers/mdx.renderer.ts
🧠 Learnings (20)
📓 Common learnings
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Configure entry points for frontmcp/ui exports: main, react, react/hooks, renderers, render, universal, and bundler
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/bundler/**/*.{ts,tsx} : Use SSR component bundler (createBundler, InMemoryBundler) for bundling React components
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
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Use entry points from package.json exports for public API access instead of direct file imports
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/universal/**/*.{ts,tsx} : Export FrontMCPProvider and UniversalApp from universal app shell for platform-agnostic React configuration
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,base-template,layouts,pages}/**/*.ts : Use buildCdnScriptsFromTheme() with appropriate inline flag for platform network access constraints
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.{ts,tsx} : Do not import React-free utilities from frontmcp/ui; use frontmcp/uipack instead
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Do not add React dependencies to uipack - use frontmcp/ui package for React components instead
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/**/*.{ts,tsx} : Use React 18/19 with TypeScript for all components in frontmcp/ui
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,build,layouts,pages}/**/*.ts : Use platform-aware theming via getPlatform(), OPENAI_PLATFORM, and CLAUDE_PLATFORM constants for network capability detection
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/renderers/**/*.adapter.ts : Implement client-side hydration for interactive widgets using ReactRendererAdapter

Applied to files:

  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/index.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/renderers/**/*.test.{ts,tsx} : Include hydration tests to verify client-side hydration behavior

Applied to files:

  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/index.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,base-template,layouts,pages}/**/*.ts : Use buildCdnScriptsFromTheme() with appropriate inline flag for platform network access constraints

Applied to files:

  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/index.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{theme,build,layouts,pages,base-template}/**/*.ts : Use theme.cdn configuration instead of hard-coding CDN URLs

Applied to files:

  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/index.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/bundler/**/*.{ts,tsx} : Use SSR component bundler (createBundler, InMemoryBundler) for bundling React components

Applied to files:

  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/index.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/universal/**/*.{ts,tsx} : Export FrontMCPProvider and UniversalApp from universal app shell for platform-agnostic React configuration

Applied to files:

  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/index.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.test.{ts,tsx} : Include SSR tests to verify server-side rendering output for React components

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/index.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/**/*.{ts,tsx} : Ensure SSR support via react-dom/server for React components

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/index.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Configure entry points for frontmcp/ui exports: main, react, react/hooks, renderers, render, universal, and bundler

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/index.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.{ts,tsx} : Do not import React-free utilities from frontmcp/ui; use frontmcp/uipack instead

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/index.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/**/*.{ts,tsx} : Use React 18/19 with TypeScript for all components in frontmcp/ui

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
  • libs/uipack/src/renderers/index.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Maintain peer dependencies on React ^18.0.0 || ^19.0.0 and react-dom ^18.0.0 || ^19.0.0

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/hooks/**/*.{ts,tsx} : Use MCP bridge hooks (useMcpBridge, useCallTool, useToolInput, useToolOutput) for tool communication in components

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components,renderers,utils}/**/*.ts : Always escape user-provided content using escapeHtml() utility to prevent XSS

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components,renderers}/**/*.test.ts : Test HTML escaping for user-provided content in component tests

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,build,layouts,pages}/**/*.ts : Use platform-aware theming via getPlatform(), OPENAI_PLATFORM, and CLAUDE_PLATFORM constants for network capability detection

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Zero React dependency constraint - this is the React-free core package

Applied to files:

  • libs/ui/src/renderers/mdx.renderer.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Do not add React dependencies to uipack - use frontmcp/ui package for React components instead

Applied to files:

  • libs/uipack/src/renderers/index.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/**/index.ts : Export public API through barrel files - export users' needed items, no legacy exports with different names

Applied to files:

  • libs/uipack/src/renderers/index.ts
🧬 Code graph analysis (1)
libs/ui/src/renderers/mdx.renderer.ts (3)
libs/uipack/src/renderers/index.ts (5)
  • buildReactCdnUrls (65-65)
  • TranspileOptions (40-40)
  • TranspileResult (39-39)
  • hashString (95-95)
  • transpileCache (52-52)
libs/uipack/src/renderers/mdx-client.renderer.ts (1)
  • buildReactCdnUrls (36-42)
libs/uipack/src/renderers/types.ts (2)
  • TranspileOptions (101-106)
  • TranspileResult (87-96)
⏰ 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: Lint & Format Checks
  • GitHub Check: Build Libraries
🔇 Additional comments (7)
libs/sdk/src/common/interfaces/internal/primary-auth-provider.interface.ts (3)

82-82: Documentation clarity improved.

The past review concern about the documentation referencing "transport.deprecated.ts" inconsistently has been addressed. The simplified comment accurately describes the behavior without the confusing reference.


84-86: LGTM: Centralized default improves maintainability.

The change to use DEFAULT_TRANSPORT_CONFIG as the centralized source of truth for transport defaults is a sound refactoring that improves maintainability and consistency. The implementation logic is correct and maintains type safety.

Assuming the tree shaking concern from Line 5 is verified, this change enhances code organization without altering runtime behavior.


5-5: The barrel import pattern is correct for SDK public API exports per project standards. DEFAULT_TRANSPORT_CONFIG should be imported from the centralized barrel file ('../../types') as it is part of the public API. If tree-shaking optimization is a PR goal, ensure libs/sdk/package.json includes "sideEffects": false in the appropriate export configuration to enable proper dead code elimination for barrel exports, rather than bypassing the barrel with direct imports.

Likely an incorrect or invalid review comment.

libs/uipack/src/renderers/index.ts (1)

60-83: LGTM! Excellent deprecation strategy supporting tree shaking.

The migration from server-side to client-side MDX rendering with clear deprecation guidance, backward-compatible aliases, and separation of React-free (uipack) vs React-dependent (ui) code directly supports the PR's tree shaking objective. The documentation clearly guides users to the appropriate package based on their rendering needs.

Based on learnings: This aligns with the package separation principle where uipack contains React-free utilities and ui contains React-dependent components.

libs/ui/src/renderers/mdx.renderer.ts (1)

197-210: LGTM! Prop spreading now correctly preserves reserved props.

The updated logic filters reserved keys (input, output, structuredContent, helpers, components) from context.output before spreading, ensuring core props cannot be accidentally overwritten. This provides consistent and predictable behavior.

libs/uipack/src/renderers/mdx-client.renderer.ts (2)

192-205: LGTM! Prop spreading now matches server renderer.

The reserved props filtering logic is now consistent with the server renderer (mdx.renderer.ts lines 197-210). This prevents context.output properties from overwriting core props like input, output, structuredContent, helpers, and components, ensuring predictable behavior across both rendering modes.


36-52: The concern in this review is based on a misunderstanding of how client-side CDN-based rendering works. The code and documentation are already appropriate.

Documentation already addresses React 18/19 configuration: Lines 45-47 explicitly document that the default is React 19 and how to use React 18 (cdn: buildReactCdnUrls('18')). The render() method correctly supports the cdn option to override defaults (lines 178-182).

Automatic version detection is not feasible: This is client-side code that loads React from esm.sh CDN. Version must be explicit in the URL; there is no way to auto-detect from the browser. Users correctly configure this via the cdn option if their application uses React 18.

Minor enhancement suggestion: The JSDoc example (lines 105-114) could demonstrate the React 18 configuration to make this feature more discoverable.

Likely an incorrect or invalid review comment.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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)

7-19: LGTM! Past issue properly addressed.

The lazy loading pattern correctly avoids circular dependencies and dual-package hazards. The explicit error handling on lines 15-17 replaces the previous non-null assertion, following the coding guidelines.

Optional: Add explicit return type annotation

Adding an explicit return type would make the intent clearer:

-function getFrontMcpInstance() {
+function getFrontMcpInstance(): typeof import('../../front-mcp').FrontMcpInstance {
   if (!_FrontMcpInstance) {
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a8de2aa and 4975705.

📒 Files selected for processing (2)
  • libs/sdk/src/common/decorators/front-mcp.decorator.ts
  • libs/ui/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • libs/ui/package.json
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use strict TypeScript mode with no any types without strong justification - use unknown instead 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 of unknown
Use specific error classes with MCP error codes instead of generic errors
Use getCapabilities() method for dynamic capability exposure instead of hardcoding capabilities
Use changeScope property instead of scope in 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 (9)
📓 Common learnings
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/bundler/**/*.{ts,tsx} : Use SSR component bundler (createBundler, InMemoryBundler) for bundling React components
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
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Configure entry points for frontmcp/ui exports: main, react, react/hooks, renderers, render, universal, and bundler
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Use entry points from package.json exports for public API access instead of direct file imports
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/universal/**/*.{ts,tsx} : Export FrontMCPProvider and UniversalApp from universal app shell for platform-agnostic React configuration
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,base-template,layouts,pages}/**/*.ts : Use buildCdnScriptsFromTheme() with appropriate inline flag for platform network access constraints
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.{ts,tsx} : Do not import React-free utilities from frontmcp/ui; use frontmcp/uipack instead
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Do not add React dependencies to uipack - use frontmcp/ui package for React components instead
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.{ts,tsx} : Do not import React-free utilities from frontmcp/ui; use frontmcp/uipack instead

Applied to files:

  • libs/sdk/src/common/decorators/front-mcp.decorator.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/universal/**/*.{ts,tsx} : Export FrontMCPProvider and UniversalApp from universal app shell for platform-agnostic React configuration

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: 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 **/*.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 : 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-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/react/hooks/**/*.{ts,tsx} : Handle loading and error states in MCP bridge hooks (useMcpBridge, useCallTool, etc.)

Applied to files:

  • libs/sdk/src/common/decorators/front-mcp.decorator.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Configure entry points for frontmcp/ui exports: main, react, react/hooks, renderers, render, universal, and bundler

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). (14)
  • GitHub Check: E2E Tests (demo-e2e-ui)
  • GitHub Check: E2E Tests (demo-e2e-serverless)
  • GitHub Check: E2E Tests (demo-e2e-errors)
  • GitHub Check: E2E Tests (demo-e2e-multiapp)
  • GitHub Check: E2E Tests (demo-e2e-redis)
  • GitHub Check: E2E Tests (demo-e2e-cache)
  • GitHub Check: E2E Tests (demo-e2e-notifications)
  • GitHub Check: E2E Tests (demo-e2e-hooks)
  • GitHub Check: E2E Tests (demo-e2e-providers)
  • GitHub Check: E2E Tests (demo-e2e-transparent)
  • GitHub Check: E2E Tests (demo-e2e-openapi)
  • GitHub Check: E2E Tests (demo-e2e-codecall)
  • GitHub Check: E2E Tests (demo-e2e-public)
  • GitHub Check: Unit Tests
🔇 Additional comments (2)
libs/sdk/src/common/decorators/front-mcp.decorator.ts (2)

65-95: Serverless initialization pattern looks correct.

The serverless path appropriately uses direct require('@frontmcp/sdk') to access multiple exports, with clear documentation (lines 67-68) explaining the difference from the normal path. Error handling properly uses InternalMcpError with specific codes.


96-100: Normal mode path correctly uses lazy loading.

The implementation properly calls getFrontMcpInstance().bootstrap(metadata) with clear documentation explaining the dual-package hazard mitigation.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
libs/uipack/src/renderers/mdx-client.renderer.ts (1)

179-182: Consider validating CDN URLs.

While the CDN URLs are typically provided by developers, adding basic URL validation would improve robustness and catch configuration errors early.

🔎 Suggested validation
    // Merge custom CDN config with defaults
    const cdn = {
      ...DEFAULT_CDN,
      ...options?.cdn,
    };
+
+   // Validate CDN URLs are well-formed
+   const cdnUrls = [cdn.mdx, cdn.jsxRuntime, cdn.react, cdn.reactDom];
+   for (const url of cdnUrls) {
+     try {
+       new URL(url);
+     } catch {
+       throw new Error(`Invalid CDN URL: ${url}`);
+     }
+   }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4975705 and 2abf2b3.

📒 Files selected for processing (3)
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/uipack/src/utils/escape-html.ts
  • libs/uipack/src/utils/index.ts
🧰 Additional context used
📓 Path-based instructions (4)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use strict TypeScript mode with no any types without strong justification - use unknown instead 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/uipack/src/utils/escape-html.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/uipack/src/utils/index.ts
libs/uipack/src/{components,web-components,renderers,utils}/**/*.ts

📄 CodeRabbit inference engine (libs/uipack/CLAUDE.md)

Always escape user-provided content using escapeHtml() utility to prevent XSS

Files:

  • libs/uipack/src/utils/escape-html.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/uipack/src/utils/index.ts
libs/uipack/src/**/*.ts

📄 CodeRabbit inference engine (libs/uipack/CLAUDE.md)

libs/uipack/src/**/*.ts: Do not add React dependencies to uipack - use @frontmcp/ui package for React components instead
Avoid using any type without justification in TypeScript code
Do not expose internal error details in user-facing error messages

Files:

  • libs/uipack/src/utils/escape-html.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/uipack/src/utils/index.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/uipack/src/utils/escape-html.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/uipack/src/utils/index.ts
🧠 Learnings (12)
📓 Common learnings
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/bundler/**/*.{ts,tsx} : Use SSR component bundler (createBundler, InMemoryBundler) for bundling React components
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
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Configure entry points for frontmcp/ui exports: main, react, react/hooks, renderers, render, universal, and bundler
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/universal/**/*.{ts,tsx} : Export FrontMCPProvider and UniversalApp from universal app shell for platform-agnostic React configuration
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,base-template,layouts,pages}/**/*.ts : Use buildCdnScriptsFromTheme() with appropriate inline flag for platform network access constraints
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.{ts,tsx} : Do not import React-free utilities from frontmcp/ui; use frontmcp/uipack instead
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Do not add React dependencies to uipack - use frontmcp/ui package for React components instead
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components}/**/*.ts : Validate all component options using validateOptions() helper with the component's Zod schema
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Use entry points from package.json exports for public API access instead of direct file imports
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{handlebars,build,layouts,pages}/**/*.ts : Use Handlebars template engine for dynamic template rendering with variable substitution
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components,renderers,utils}/**/*.ts : Always escape user-provided content using escapeHtml() utility to prevent XSS

Applied to files:

  • libs/uipack/src/utils/escape-html.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/uipack/src/utils/index.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{components,web-components,renderers}/**/*.test.ts : Test HTML escaping for user-provided content in component tests

Applied to files:

  • libs/uipack/src/utils/escape-html.ts
  • libs/uipack/src/renderers/mdx-client.renderer.ts
  • libs/uipack/src/utils/index.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/renderers/**/*.adapter.ts : Implement client-side hydration for interactive widgets using ReactRendererAdapter

Applied to files:

  • libs/uipack/src/renderers/mdx-client.renderer.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{adapters,base-template,layouts,pages}/**/*.ts : Use buildCdnScriptsFromTheme() with appropriate inline flag for platform network access constraints

Applied to files:

  • libs/uipack/src/renderers/mdx-client.renderer.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/{theme,build,layouts,pages,base-template}/**/*.ts : Use theme.cdn configuration instead of hard-coding CDN URLs

Applied to files:

  • libs/uipack/src/renderers/mdx-client.renderer.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/renderers/**/*.test.{ts,tsx} : Include hydration tests to verify client-side hydration behavior

Applied to files:

  • libs/uipack/src/renderers/mdx-client.renderer.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/bundler/**/*.{ts,tsx} : Use SSR component bundler (createBundler, InMemoryBundler) for bundling React components

Applied to files:

  • libs/uipack/src/renderers/mdx-client.renderer.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/**/index.ts : Export public API through barrel files - export users' needed items, no legacy exports with different names

Applied to files:

  • libs/uipack/src/utils/index.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Do not expose internal error details in user-facing error messages

Applied to files:

  • libs/uipack/src/utils/index.ts
📚 Learning: 2025-12-22T13:01:03.646Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/ui/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:03.646Z
Learning: Applies to libs/ui/src/**/*.{ts,tsx} : Do not import React-free utilities from frontmcp/ui; use frontmcp/uipack instead

Applied to files:

  • libs/uipack/src/utils/index.ts
📚 Learning: 2025-12-22T13:01:16.929Z
Learnt from: CR
Repo: agentfront/frontmcp PR: 0
File: libs/uipack/CLAUDE.md:0-0
Timestamp: 2025-12-22T13:01:16.929Z
Learning: Applies to libs/uipack/src/**/*.ts : Do not add React dependencies to uipack - use frontmcp/ui package for React components instead

Applied to files:

  • libs/uipack/src/utils/index.ts
🧬 Code graph analysis (2)
libs/uipack/src/utils/escape-html.ts (1)
libs/uipack/src/utils/index.ts (1)
  • escapeScriptClose (10-10)
libs/uipack/src/renderers/mdx-client.renderer.ts (3)
libs/uipack/src/renderers/types.ts (6)
  • RenderOptions (111-118)
  • UIRenderer (160-213)
  • TranspileOptions (101-106)
  • TranspileResult (87-96)
  • ToolUIProps (30-39)
  • RuntimeScripts (123-130)
libs/uipack/src/registry/render-template.ts (1)
  • containsMdxSyntax (27-65)
libs/uipack/src/utils/escape-html.ts (3)
  • escapeScriptClose (105-107)
  • escapeJsString (76-86)
  • escapeHtml (27-41)
🔇 Additional comments (1)
libs/uipack/src/utils/index.ts (1)

10-10: LGTM - Proper barrel file export.

The export correctly includes the new escapeScriptClose function, maintaining consistency with the existing escape utility exports.

Based on learnings, this follows the pattern of exporting public API through barrel files.

@frontegg-david frontegg-david merged commit 3780f33 into main Dec 23, 2025
20 of 21 checks passed
@frontegg-david frontegg-david deleted the fix-tree-shaking branch December 23, 2025 04:25
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