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

dsh-cortex-extractors

v0.3.5

Published

Optional OCR/ASR adapter for DSH cortex with layout-aware extraction, an optional local PaddleOCR bridge, and explicit local-command providers; never downloads a model.

Readme

dsh-cortex-extractors

Optional OCR/ASR adapter for cortex. It is a separate bundle, not part of dsh-cortex.

  • Calls only an explicitly configured local command.
  • Never downloads a model.
  • Accepts only file:// inputs.
  • Fails closed when no command is configured.

Use 0.2.1 or newer. Releases 0.1.8 / 0.1.9 / 0.2.0 exported Config = null when @deepseek-ai/schemastery could not be resolved from the plugin's own path (typical for link: installs). The host then crashed while reading settings (Cannot use 'in' operator to search for 'toJSON' in null), the desktop welcome RPC failed, and DSH could not start at all (desktop welcome: Web RPC failed). 0.2.1 resolves the schema through the running profile and falls back to Config = undefined instead of null. See CHANGELOG.md.

Install

Use the Harness plugin manager with this directory, then configure:

Windows OCR is the default OCR provider; no model is downloaded. It upscales small images (up to 1600px wide) before recognition and falls back to the original image on preprocessing failure. Disable with ocrPreprocess: false.

Windows OCR now also returns word bounding boxes and honors ocrLayout / the UI Layout selector: auto detects two columns, two-column splits words at the page midpoint, and full-width footers/headers stay whole. single and handwriting keep top-to-bottom order.

Tesseract is available as an explicit provider (it is not the default):

ocrProvider: tesseract
tesseractLanguage: chi_sim+eng
tesseractPath: 'C:/Program Files/Tesseract-OCR/tesseract.exe'
tessdataPath: 'C:/Users/<you>/AppData/Local/cortex-extractors/tessdata'
ocrLayout: auto            # auto / single / two-column / handwriting

two-column reads Tesseract TSV coordinates and emits the left column before the right; auto only chooses it when two populated columns are separated by a gutter. single keeps plain top-to-bottom order. handwriting switches Tesseract to page mode 6.

Optional PaddleOCR layout/handwriting bridge

For real layout or handwriting models, install paddleocr + paddlepaddle yourself and point the plugin at a local model root containing the detection and recognition folders. The bridge refuses to run when the folders are missing; DSH never downloads a model implicitly.

ocrProvider: paddleocr
paddleocrPython: 'python'
paddleocrModelDir: 'C:/Users/<you>/.paddlex/official_models'
ocrLayout: handwriting     # or auto / two-column

The root should contain e.g. PP-OCRv6_medium_det and PP-OCRv6_medium_rec (or a supported v5/v4 pair). The bridge uses CPU with oneDNN disabled for compatibility. The optional bridge is lib/paddleocr_bridge.py; it is not executed by the default install.

Acceptance on this machine: synthetic KaiTi handwriting-style image produced 手写测试 / 本鲸喜欢白饭 / 今天也要好好学技术 with the real PaddleOCR model. This is not a human-handwriting benchmark.

Whisper.cpp is available as an explicit ASR provider; the model file must be placed manually:

asrProvider: whisper-cpp
whisperPath: 'C:/tools/whisper/whisper-cli.exe'
whisperModel: 'C:/models/ggml-small.bin'
whisperLanguage: zh
whisperPrompt: '本鲸 白饭 主人'
asrReplacements: ['本金=本鲸']
# Optional: output temp directory; defaults to <cwd>/.cortex-extractors-tmp
tmpDir: 'C:/path/to/writable/tmp'

For a command-based OCR/ASR engine, override:

ocrProvider: 'command'
ocrCommand: 'C:/tools/tesseract/tesseract.exe'
ocrArgs: ['{file}', 'stdout', '-l', '{language}']
asrCommand: 'C:/tools/whisper/whisper-cli.exe'
asrArgs: ['-f', '{file}', '-otxt']

{file} is replaced with the decoded local path; {language} with the optional tool argument.

Tool

cortex_extract_text

{"uri":"file:///C:/tmp/frame.png","mode":"ocr","language":"chi_sim"}

Optional linkage: pass an explicit target traceId; the extracted text is written as a derived trace and linked by metadata, without mutating the target.

{"uri":"file:///C:/tmp/frame.png","mode":"ocr","traceId":"trc_target"}

Test

node --test test/*.test.js

The test uses a fake engine; it does not download or run a real OCR/ASR model.

Boundaries

  • No model download.
  • No automatic engine installation.
  • No HTTP input.
  • No main-cortex dependency.
  • Text extraction quality depends on the configured engine.

Engines and layout

See docs/engines.md for providers, model directories, layout behavior and failure modes.