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-mineru

v0.0.9

Published

`@xpert-ai/plugin-mineru` is a MinerU document converter plugin for the [Xpert AI](https://github.com/xpert-ai/xpert) platform, providing extraction capabilities from PDF to Markdown and structured JSON. The plugin includes built-in MinerU integration str

Downloads

353

Readme

Xpert Plugin: MinerU

@xpert-ai/plugin-mineru is a MinerU document converter plugin for the Xpert AI platform, providing extraction capabilities from PDF to Markdown and structured JSON. The plugin includes built-in MinerU integration strategies, document conversion strategies, and result parsing services, enabling secure access to the MinerU API in automated workflows, polling task status, and writing parsed content and attachment resources to the platform file system.

Installation

pnpm add @xpert-ai/plugin-mineru
# or
npm install @xpert-ai/plugin-mineru

Note: This plugin depends on @xpert-ai/plugin-sdk, @nestjs/common@^11, @nestjs/config@^4, @metad/contracts, axios@1, chalk@4, @langchain/core@^0.3.72, and uuid@8 as peerDependencies. Please ensure these packages are installed in your host project.

Quick Start

  1. Prepare MinerU Credentials
    Obtain a valid API Key from the MinerU dashboard and confirm the service address (default: https://mineru.net/api/v4).

  2. Configure Integration in Xpert

    • Via Xpert Console: Create a MinerU integration and fill in the following fields.
    • Or set environment variables in your deployment environment:
      • MINERU_API_BASE_URL: Optional, defaults to https://mineru.net/api/v4.
      • MINERU_API_TOKEN: Required, used as a fallback credential if no integration is configured.

    Example integration configuration (JSON):

    {
      "provider": "mineru",
      "options": {
         "apiUrl": "https://mineru.net/api/v4",
         "apiKey": "your-mineru-api-key"
      }
    }
  3. Register the Plugin
    Configure the plugin in your host service's plugin registration process:

    PLUGINS=@xpert-ai/plugin-mineru

    The plugin returns the NestJS module MinerUPlugin in the register hook and logs messages during the onStart/onStop lifecycle.

MinerU Integration Options

| Field | Type | Description | Required | Default | | -------- | ------ | ------------------------------------- | -------- | ---------------------------- | | apiUrl | string | MinerU API base URL | No | https://mineru.net/api/v4 | | apiKey | string | MinerU service API Key (keep secret) | Yes | — |

If both integration configuration and environment variables are provided, options from the integration configuration take precedence.

Document Conversion Parameters

MinerUTransformerStrategy supports the following configuration options (passed to the MinerU API when starting a workflow):

| Field | Type | Default | Description | | ---------------- | ------- | ------------ | --------------------------------------------------- | | isOcr | boolean | true | Enable OCR for image-based PDFs. | | enableFormula | boolean | true | Recognize mathematical formulas and output tags. | | enableTable | boolean | true | Recognize tables and output structured tags. | | language | string | "ch" | Main document language, per MinerU API (en/ch). | | modelVersion | string | "pipeline" | MinerU model version (pipeline, vlm, etc.). |

By default, the plugin creates MinerU tasks for each file to be processed, polls until full_zip_url is returned, then downloads and parses the zip package in memory.

Permissions

  • Integration: Access MinerU integration configuration to read API address and credentials.
  • File System: Perform read/write/list on XpFileSystem to store image resources from MinerU results.

Ensure the plugin is granted these permissions in your authorization policy, or it will not be able to retrieve results or write attachments.

Output Content

The parser generates:

  • Full Markdown: Resource links are automatically replaced to point to actual URLs written via XpFileSystem.
  • Structured metadata: Includes MinerU task ID, layout JSON (layout.json), content list (content_list.json), original PDF filename, etc.
  • Attachment asset list: Records written image resources for easy association by callers.

The returned Document<ChunkMetadata> array currently defaults to a single chunk containing the full Markdown; you can split it as needed.

Development & Debugging

Run the following commands in the repository root to build and test locally:

npm install
npx nx build @xpert-ai/plugin-mineru
npx nx test @xpert-ai/plugin-mineru

TypeScript build artifacts are output to packages/mineru/dist. Before publishing, ensure package.json, type declarations, and runtime files are in sync.

License

This project follows the AGPL-3.0 License in the repository root.