@getmantl/core
v0.3.0
Published
Framework-agnostic core for the Mantl SDK. Used by @getmantl/react, @getmantl/angular, @getmantl/vue.
Downloads
38
Readme
@getmantl/core
Framework-agnostic core for the Mantl SDK. This package is consumed by @getmantl/react, @getmantl/angular, and (planned) @getmantl/vue. You probably want one of those, not this.
What's in here
MantlClient— vanilla TypeScript class that owns token lifecycle, conversation state, preferences, and auth-error tracking. ExposesgetSnapshot()/subscribe()so framework bindings can wrap it with their native reactivity (ReactuseSyncExternalStore, Angular signals, Vue refs).- Token utilities —
parseJwtPayload,extractUserIdFromToken. - API client —
api()with auth headers,ApiError,isAuthError. - Tool plumbing —
prepareClientTools(Zod-schema-to-JSON-Schema + input validation wrapper). - Shared types —
Conversation,ClientTool,UIMessage,UIPartvariants and their type guards. streamdownCSS— bundled Tailwind+KaTeX styles for Shadow-DOM markdown rendering.
Versioning
This package is on 0.x while the public Mantl SDKs stabilize. Breaking changes can land in any minor while we figure out the cross-framework API shape. Pin to a specific version if you depend on it directly.
License
MIT
