@flusys/ng-ai-assistant
v6.2.0
Published
FLUSYS-native wrapper for the @flusys/ai-assistant-core chat widget: auth-integrated endpoints, pinned results, chat history
Readme
@flusys/ng-ai-assistant
Native Angular chat widget for @flusys/nestjs-ai-assistant, built entirely from @flusys/ng-ui
components and signals — no dependency on @flusys/ai-assistant-core's ui-core Web Component.
The AI orchestration itself (tool-calling loop, provider abstraction) lives on the backend only;
this package just talks to the backend's plain JSON endpoints over HttpClient.
Usage
// app.config.ts — nothing to register, the widget host reads AUTH_STATE_PROVIDER directly.
// app.component.ts template — mount once, globally:<flusys-ai-chat-widget-host />The widget renders only when the user is authenticated and holds the ai-assistant.use
permission. Requests go through Angular's normal HttpClient, so the existing auth interceptor
attaches the bearer token automatically — no manual token plumbing needed. Endpoints are built
from APP_CONFIG.services.aiAssistant (falls back to apiBaseUrl).
Tabular tool results (lastToolResult.renderHint === 'table', or any array-of-flat-objects data)
render as a real <table> inline in the chat log; everything else renders as plain text. Each
assistant reply has a "Pin" button that saves it via POST /ai-assistant/pin.
Routes
import { AI_ASSISTANT_ROUTES } from '@flusys/ng-ai-assistant';
{
path: 'ai-assistant',
children: AI_ASSISTANT_ROUTES,
canActivate: [authGuard],
}/ai-assistant/pinned— pinned chat replies, with a "Sync" action for pins backed by a tool/ai-assistant/history— past conversations;ai-assistant.view-all-historyunlocks an "all users" toggle
