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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@xpert-ai/plugin-file-system

v0.0.2

Published

## Overview

Downloads

135

Readme

Xpert Plugin: File System

Overview

@xpert-ai/plugin-file-system adds a document-source provider capable of ingesting content from local disks and popular remote file systems. It registers a NestJS plugin with lifecycle hooks and exposes a strategy that turns discovered files into LangChain Document instances that downstream Xpert workflows can consume.

Features

  • Registers the FileSystemPlugin NestJS module with bootstrap/shutdown logging and global availability.
  • Publishes a file-system document-source strategy that advertises metadata for the Xpert catalogue and validates configs before use.
  • Supports local, sftp, ftp, smb, and webdav back ends, recursively crawling directories and emitting documents enriched with path, size, modified date, and source protocol metadata.
  • Ships a WebDAV client with HTTPS, self-signed certificate, and skipForbidden controls for restricted directories.
  • Provides a test hook that reuses the loader logic to validate connectivity during integration setup.

Installation

npm install @xpert-ai/plugin-file-system

Peer dependencies: the host must already provide @xpert-ai/plugin-sdk, @nestjs/common, @nestjs/config, @metad/contracts, @langchain/core, chalk, zod, and the respective protocol clients (basic-ftp, ssh2-sftp-client, smb2, @awo00/smb2, webdav). Review package.json for the exact version expectations.

Configuration

The document-source strategy accepts the following options:

| Option | Type | Required | Description | | --- | --- | --- | --- | | type | 'local' \| 'ftp' \| 'sftp' \| 'smb' \| 'webdav' | ✅ | Selects the file-system connector. | | filePath | string | ✅ | Absolute path (local) or remote path to read. Directories are crawled recursively. | | host | string | ⛔ for local, ✅ otherwise | Remote server host name or IP. | | port | number | Optional | Defaults to 22 (SFTP), 21 (FTP), 445 (SMB), 80/443 (WebDAV). | | username / password | string | ⛔ for local, ✅ otherwise | Credentials for remote protocols. | | https | boolean | WebDAV only | Enables HTTPS when true. | | allowSelfSigned | boolean | WebDAV only | Accepts self-signed certificates. | | skipForbidden | boolean | WebDAV only | Ignores directories that return HTTP 403. |

Remote connectors perform strict validation so missing host or credentials fail fast. For directories, nodes are emitted as empty-content documents with metadata.kind = 'directory'; files include their UTF-8 content and metadata.kind = 'file'.

Usage

Add this plugin to the PLUGINS environment variable when starting the XpertAI system, and it will be loaded automatically:

PLUGINS=@xpert-ai/plugin-file-system

Once loaded, create a document source pointing at the desired system. Below is an example payload for the Xpert document ingestion workflow:

{
  provider: 'file-system',
  options: {
    type: 'sftp',
    filePath: '/docs/product',
    host: 'sftp.example.com',
    port: 22,
    username: 'ingest',
    password: process.env.SFTP_PASSWORD
  }
}

During configuration, call the strategy test method (available through the plugin host API) to confirm credentials before committing the integration. Successful tests return lightweight metadata describing the discovered files or directories.

WebDAV example

{
  provider: 'file-system',
  options: {
    type: 'webdav',
    filePath: '/remote/docs',
    host: 'webdav.example.com',
    port: 443,
    username: 'svc-docs',
    password: process.env.WEBDAV_PASSWORD,
    https: true,
    allowSelfSigned: true,
    skipForbidden: true
  }
}

Development

From the monorepo root (xpertai/), build and test with Nx:

npx nx build @xpert-ai/plugin-file-system
npx nx test @xpert-ai/plugin-file-system

Build output lands in dist/, and the Jest suite validates the document-source strategy (configured via jest.config.ts).

License

MIT – see the repository root LICENSE.