npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mbubela/oaa-ai-assistant

v0.0.2

Published

AI Assistant Web Components - Angular-based web components for OpenAsApp AI features

Readme

OAA AI Assistant Web Components

Angular Web Components для интеграции AI ассистента в любой проект.

Установка

npm install @your-org/oaa-ai-assistant

Быстрый старт

1. Добавьте скрипт в angular.json

{
  "projects": {
    "your-app": {
      "architect": {
        "build": {
          "options": {
            "scripts": [
              "node_modules/@your-org/oaa-ai-assistant/bundles/web-components.js"
            ]
          }
        }
      }
    }
  }
}

2. Перезапустите dev сервер

npm start

3. Используйте компоненты в HTML

Главный компонент - AI Ассистент

<app-assistant
  title="AI Assistant"
  greeting="Привет!"
  welcomeText="Добро пожаловать"
  description="Ваш AI помощник"
  inputPlaceholder="Введите сообщение..."
  [messages]="messages"
  [isLoading]="isLoading"
  (messageSubmit)="onMessageSubmit($event)">
</app-assistant>

Другие доступные компоненты

<!-- Хедер -->
<app-header
  title="My App"
  (menuClick)="onMenuClick()"
  (closeClick)="onCloseClick()">
</app-header>

<!-- Поле ввода -->
<app-input-field
  placeholder="Type a message..."
  [value]="inputValue"
  (submitMessage)="onSubmit($event)"
  (voiceClick)="onVoiceClick()">
</app-input-field>

<!-- История чата -->
<app-chat-history
  [messages]="messages">
</app-chat-history>

<!-- Сайдбар -->
<app-sidebar
  [isOpen]="sidebarOpen"
  [conversations]="conversations"
  (conversationClick)="onConversationClick($event)">
</app-sidebar>

<!-- Уведомления -->
<app-toast-container></app-toast-container>

<!-- Модальное окно подтверждения -->
<app-confirmation-modal></app-confirmation-modal>

Настройка API

Компоненты используют встроенные сервисы для работы с API. По умолчанию используется https://localhost:7592.

Для настройки API endpoint'а создайте файл config.json в папке public/:

{
  "apiUrl": "https://your-api-url.com",
  "apiTimeout": 30000,
  "environmentName": "production"
}

Доступные сервисы

Компоненты автоматически используют следующие Angular сервисы:

  • ApiService - HTTP клиент для работы с бэкендом
  • ChatService - Управление чатом и сообщениями
  • ConfigService - Конфигурация приложения
  • ToastService - Уведомления
  • ConfirmationService - Модальные окна подтверждения
  • VoiceRecognition - Распознавание голоса

Типы данных

interface Message {
  id: string;
  text: string;
  sender: 'user' | 'assistant';
  timestamp: Date;
  isTyping?: boolean;
}

interface ConversationItem {
  id: string;
  title: string;
  date: string;
}

interface VoiceRecognitionStatus {
  state: 'idle' | 'listening' | 'processing' | 'error';
  transcript: string;
  interimTranscript: string;
  errorMessage?: string;
}

Пример интеграции в Angular проект

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  template: `
    <app-assistant
      [messages]="messages"
      [isLoading]="isLoading"
      (messageSubmit)="onMessageSubmit($event)">
    </app-assistant>
  `
})
export class AppComponent {
  messages = [];
  isLoading = false;

  onMessageSubmit(message: string) {
    console.log('User message:', message);
    // Отправка на сервер
  }
}

Совместимость

  • Angular 15+
  • AngularJS (через angular.json scripts)
  • Любой HTML проект (через script tag)

API Backend

Для работы с AI функциями необходим запущенный бэкенд со следующими endpoint'ами:

  • POST /conversations - Создание нового разговора
  • GET /conversations - Получение списка разговоров
  • GET /conversations/:id - Получение конкретного разговора
  • POST /conversations/:id/messages - Отправка сообщения
  • GET /conversations/:id/messages - Получение истории сообщений
  • DELETE /conversations/:id - Удаление разговора

Разработка

Сборка компонентов

npm run build:web-components

Публикация в NPM

cd dist/web-components
npm version patch
npm publish --access public

Лицензия

MIT