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

@imiobe/omnia-assistant-ui

v0.3.2

Published

AI chat assistant widget for iMio's Omnia API

Readme

@imiobe/omnia-assistant-ui

AI chat assistant widget that integrates iMio's Omnia API for conversational AI interactions. Features a draggable/resizable chat panel, streaming responses via SSE, page content injection, and keyboard shortcuts.

Installation

npm install @imiobe/omnia-assistant-ui preact

Preact (>=10) is a peer dependency and must be installed separately.

Quick start

import { mount } from '@imiobe/omnia-assistant-ui';
import '@imiobe/omnia-assistant-ui/dist/omnia-assistant-ui.css';

// Configure via window global
window.assistant_settings = {
  api_service_url: 'https://example.be/api',
  api_key: 'your-bearer-token',
  model: 'your-model-name',
  base_prompt: 'You are a helpful assistant.',
};

mount('app'); // mount into element with id="app"

Or pass configuration directly:

import { mount } from '@imiobe/omnia-assistant-ui';
import '@imiobe/omnia-assistant-ui/dist/omnia-assistant-ui.css';

mount('app', {
  apiServiceUrl: 'https://example.be/api',
  apiKey: 'your-bearer-token',
  model: 'your-model-name',
  basePrompt: 'You are a helpful assistant.',
  mode: 'floating',
  initialWidth: 380,
  initialHeight: 520,
});

You can also import the Preact component directly:

import { AIAssistant } from '@imiobe/omnia-assistant-ui';
import '@imiobe/omnia-assistant-ui/dist/omnia-assistant-ui.css';

function App() {
  return <AIAssistant config={{ apiServiceUrl: '...', apiKey: '...' }} />;
}

Configuration

Settings can be provided via the config prop / mount() argument (camelCase) or via window.assistant_settings (snake_case). The config prop takes precedence.

API settings

| config prop | window.assistant_settings | Default | Description | |---|---|---|---| | apiServiceUrl | api_service_url | — | Required. Base URL of the OpenAI-compatible chat API. | | apiKey | api_key | — | Required. Bearer token for authentication. | | model | model | — | Required. Model name sent in the completions request. | | basePrompt | base_prompt | — | System prompt prepended to every conversation. |

Page context settings

| config prop | window.assistant_settings | Default | Description | |---|---|---|---| | includePageContent | include_page_content | true | Inject the host page content as a system message. | | pageContentSelector | page_content_selector | '#content' | CSS selector(s) to extract page content from. Can be a string or array of strings. | | pageContentClean | page_content_clean | false | Use innerText instead of innerHTML for cleaner extraction. | | maxContextChars | — | 20000 | Max characters for page context. When exceeded, the user can select text on the page to provide a smaller context. |

UI settings

| config prop | Default | Description | |---|---|---| | mode | 'floating' | 'floating' for a draggable/resizable panel, 'fixed' for a stationary panel. | | initialWidth | 380 | Initial panel width in pixels. | | initialHeight | 520 | Initial panel height in pixels. | | disclaimer | French AI disclaimer | Disclaimer text shown at the bottom of the panel. Set to null to hide. |

API endpoint

The API endpoint must serve OpenAI-compatible SSE streaming responses at {apiServiceUrl}/chat/completions.

Request:

{
  "model": "model-name",
  "messages": [
    { "role": "system", "content": "System prompt..." },
    { "role": "system", "content": "Page content..." },
    { "role": "user", "content": "User message" }
  ],
  "stream": true
}

Response: SSE stream in OpenAI chat completions format:

data: {"choices":[{"delta":{"content":"Hello "}}]}

data: {"choices":[{"delta":{"content":"world."}}]}

data: [DONE]

Keyboard shortcuts

| Shortcut | Action | |----------|--------| | Alt+I | Toggle the chat panel open/closed |

Development

make install   # npm install
make dev       # Storybook on port 6006
make build     # Build to dist/
make lint      # ESLint

Copy .env.example to .env for the Storybook live API stories:

VITE_OMNIA_BASE_URL=https://ipa.imio.be/imio/omnia/openai
VITE_OMNIA_API_KEY=your-key
VITE_OMNIA_MODEL=your-model

When VITE_OMNIA_BASE_URL is a full URL, Storybook automatically proxies requests to avoid CORS.

Available commands

| Command | Description | |---------|-------------| | make install | Install dependencies | | make dev | Start Storybook dev server (port 6006) | | make build | Build library to dist/ (ES + UMD + CSS) | | make build-storybook | Build static Storybook site | | make lint | Run ESLint | | make lint-fix | Run ESLint with auto-fix | | make clean | Remove dist/ and storybook-static/ | | make publish | Build and publish to npm |

Build output

The library builds to dist/ in two formats:

  • omnia-assistant-ui.js -- ES module
  • omnia-assistant-ui.umd.cjs -- UMD (global: OmniaAssistantUI)
  • omnia-assistant-ui.css -- Styles (Tailwind + @assistant-ui + theme)

Preact is not bundled -- it must be provided by the host application.

Stack

  • Preact for UI (with preact/compat aliasing for React libraries)
  • @assistant-ui/react for chat thread, composer, and markdown rendering
  • Vite for builds (library mode)
  • Tailwind CSS v3 with @assistant-ui plugins
  • Framer Motion for panel animations (drag, resize, open/close)
  • Mousetrap for keyboard shortcuts (Alt+I)
  • Storybook 10 for component development

License

Proprietary -- (c) iMio