@fentaris/core has three supported API tiers:
- High-level application builders for most apps.
- Advanced low-level APIs for explicit proxy and transport wiring.
- Extension contracts for third-party integrations.
@fentaris/core as the primary import path. Use @fentaris/core/extensions when implementing custom extension contracts and you need names such as Policy without colliding with top-level declaration helpers.
Avoid deep imports from @fentaris/core/dist/* or source-layout paths. Those paths are package internals and can move during pre-alpha.
Experimental plugin contracts
Plugin support is experimental and mostly placeholder-only in the current alpha surface. The package exposes the reserved contracts from@fentaris/core/experimental/plugins, but Fentaris does not yet provide a working plugin runtime.
What exists today:
- Manifest types.
- Registry contract.
- Loader contract.
- Lifecycle hook contract.
- Capability metadata placeholder.
- Real plugin loading flow.
- Package discovery.
- Activation runtime.
- Permission negotiation.
- Plugin auth integration.
- CLI plugin management.
High-level app builders
Preferfentaris() with declaration helpers for new applications:
Local capability declarations
Useapp.local(name) for app-owned tools, resources, prompts, and completions. This is the preferred path when the behavior lives inside the Fentaris app and should still use policy, middleware, operation events, logging, and audit metadata.
.mcp(name).
Advanced low-level APIs
UsecreateProxy(), McpProxy, McpServer, and explicit transports when you need direct construction or custom downstream exposure:
Extension contracts
Extension authors can implement contracts from@fentaris/core/extensions.
Upstream transport
CustomFentarisTransport implementations remain the advanced escape hatch for protocol adapters, external runtimes, or behavior that should be packaged as an MCP server-like transport. For app-owned capabilities, prefer app.local(name).
Downstream exposure transport
Policy
Registry
Rate limiter
consume(key) is the enforcement path used by middleware. Custom limiters and custom RateLimitStore implementations should perform the check and increment atomically for each limiter key, for example with a Redis Lua script, transaction, or native atomic counter operation. checkLimit() and recordCall() remain useful for diagnostics and compatibility, but they are not used for middleware enforcement.
Logger driver
Middleware and events
Import policy
| Tier | Import path | Stability |
|---|---|---|
| High-level builders | @fentaris/core | Public |
| Advanced runtime APIs | @fentaris/core | Public advanced |
| Extension contracts | @fentaris/core/extensions or top-level type aliases | Public extension |
| Plugin contracts | @fentaris/core/experimental/plugins | Experimental placeholder |
Source files and dist/* internals | Deep package paths | Internal compatibility only |