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 🙏

© 2024 – Pkg Stats / Ryan Hefner

agenticsjs

v1.0.5

Published

AgenticJS is a powerful and flexible JavaScript library designed to provide an intelligent and interactive search experience with real-time results and advanced visualization.

Downloads

4

Readme

AgenticsJS

AgenticsJS is a powerful and flexible JavaScript library designed to provide an intelligent and interactive search experience with real-time results, advanced visualization, and plugin capabilities. Built with Vite, React, and Tailwind CSS, AgenticsJS offers a seamless integration with modern web development workflows. It uses the same approach as Perplexity, the o1 for ChatGPT UI, and you.com style display of sequential queries and results.

Demo

https://agenticjs.gptengineer.run

Features

  • Real-time Search: Get instant search results as you type.
  • Advanced Visualization: Visualize search results with interactive charts and graphs.
  • Customizable: Easily customize the look and feel to match your brand.
  • Modular Components: Use only the components you need.
  • Responsive Design: Optimized for both desktop and mobile devices.
  • Plugin System: Extend and customize functionality with plugins.

Installation

To install AgenticsJS, you can use npm:

npm install agenticsjs

Usage

Here's a basic example of how to use AgenticsJS in your project:

import { App, SearchInput, SearchResults } from 'agenticsjs';

const MyApp = () => (
  <App>
    <SearchInput />
    <SearchResults />
  </App>
);

export default MyApp;

Customization

AgenticsJS is highly customizable. You can override default styles and configurations to fit your needs. For example, to customize the theme:

import { UIConfigProvider } from 'agenticsjs';

const customConfig = {
  theme: 'dark',
  searchBarPosition: 'top',
};

const MyApp = () => (
  <UIConfigProvider config={customConfig}>
    <App />
  </UIConfigProvider>
);

export default MyApp;

API/SDK Overview

AgenticsJS provides a comprehensive API for developers to interact with the library. Below is an overview of the main components and their usage:

App

The main component that wraps your application.

SearchInput

A component for the search input field.

SearchResults

A component to display search results.

UIConfigProvider

A provider component to pass custom configurations to the library.

Advanced Features

AgenticsJS also supports advanced features such as:

  • Pro Search: Advanced search techniques for more accurate results.
  • Source Highlighting: Highlight sources in the search results.
  • Error Handling: Built-in error handling and reporting.

Plugin System

AgenticsJS includes a powerful plugin system that allows you to extend and customize the functionality of the library. You can create, apply, and manage plugins to add new features or modify existing ones.

Creating a Plugin

To create a plugin:

  1. Define the plugin structure:
import { createPlugin } from '../config/uiConfig';

const myPlugin = createPlugin(
  'myPluginId',
  '1.0.0',
  (config) => {
    // Modify config or add new features
    return {
      ...config,
      // Add your modifications here
    };
  }
);

export default myPlugin;
  1. Ensure proper null checks when accessing config properties:
(config) => {
  return {
    ...config,
    hooks: {
      ...config.hooks,
      afterSearch: [
        ...(config.hooks?.afterSearch || []),
        (results) => {
          // Your hook logic here
        },
      ],
    },
  };
}

Registering and Applying Plugins

To use a plugin:

  1. Import the plugin in your main application file:
import myPlugin from './plugins/myPlugin';
  1. Register the plugin:
import { registerPlugin } from '../config/uiConfig';

registerPlugin(myPlugin);
  1. Apply the plugin when updating the UI config:
import { applyPlugin } from '../config/uiConfig';

const updatedConfig = applyPlugin(config, myPlugin);

Managing Plugins

Use these functions to manage plugins:

  • registerPlugin(plugin): Register a new plugin
  • unregisterPlugin(pluginId): Unregister an existing plugin
  • listPlugins(): List all registered plugins

Example:

import { registerPlugin, unregisterPlugin, listPlugins } from '../config/uiConfig';

registerPlugin(myPlugin);
unregisterPlugin('myPluginId');
const plugins = listPlugins();
console.log(plugins);

Best Practices

  1. Single Responsibility: Keep plugins focused on a single task.
  2. Error Handling: Implement proper error handling and null checks.
  3. Documentation: Provide clear documentation for your plugin.
  4. Testing: Thoroughly test your plugin with different configurations.
  5. Performance: Optimize your plugin for performance.
  6. Compatibility: Ensure your plugin is compatible with different versions of the core system.

For detailed implementation instructions and best practices, please refer to the Plugin System Documentation.

Running Demo Mode

To run AgenticsJS in demo mode, you can use the following command:

npm run demo

This will start a local server with a demo of AgenticsJS.

Contributing

We welcome contributions from the community. Please read our contributing guidelines before submitting a pull request.

License

AgenticsJS is licensed under the MIT License. See the LICENSE file for more information.