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

@lumifai/harness-tool-pack-office-editing

v1.1.0

Published

Headless, format-aware editing for DOCX, XLSX, PPTX, and PDF files.

Readme

@lumifai/harness-tool-pack-office-editing

Headless, format-aware editing for DOCX, XLSX, PPTX, and PDF files.

import {
  createOfficeDocument,
  createOfficeEditingToolPack,
} from '@lumifai/harness-tool-pack-office-editing';

const officeEditing = createOfficeEditingToolPack();

Register it alongside the existing Docling pack when the agent needs both broad document retrieval and authoritative file mutation. The two packs are independent: Docling converts files for reading, while this pack rereads the original file and owns editing, revision checks, atomic output, and verification. This package does not import or copy GenOffice source; it is a clean-room implementation of the relevant headless design patterns.

The pack exposes office_inspect, office_outline, office_find, office_read, office_propose_edits, office_apply_edits, and office_verify.

Edits use a validated JSON operation DSL. The public createOfficeDocument factory is the pack seam: inspect, find, read, propose, apply, and verify. Direct apply is the normal mutation path:

const document = createOfficeDocument();
const receipt = await document.apply(
  {
    sourcePath: 'documents/report.docx',
    revision: { sha256: sourceSha256, mtime: sourceMtime },
    operations: [{ op: 'replace_text', target: '10 million', replacement: '12 million' }],
  },
  context,
);

For workflows needing a reviewable plan, call propose first and pass its plan to apply. Plans use the lumif.office-edit-plan discriminator and include a digest-covered, format-native preview. OOXML previews record output hash, changed parts, and untouched-part verification; PDF previews omit package fields and do not treat output hash as a stable fingerprint. Plans are rejected when the strict source SHA-256 or mtime revision is stale, when the digest or preview is tampered with, or when verification cannot be rerun. New output files are written below edited/ by default; outputPath, overwrite, and inPlace are apply-time options, and in-place writes require explicit host configuration.

Supported headless mutations include depth-aware DOCX text replacement/insertion (including rich runs, text boxes, tables, headers, footers, comments, footnotes, and endnotes), block replacement with style-template preservation, and basic run styling; XLSX typed cells, formulas, ranges, hyperlinks, bounded find/replace, sheet renames, and safe row/column shifts; PPTX shape/picture/table/group text and geometry edits; and PDF page operations, text overlays, persistent highlight/underline/strikeout annotations, and typed AcroForm fields.

DOCX replace_text is first-match by default; pass all: true when a plan intentionally targets every occurrence. PDF markup_text is the persistent counterpart to the read-only evidence anchors returned by office_find.

XLSX structural edits fail closed when tables or defined names are present. Formula values are not calculated by this package; formula writes mark the workbook for recalculation on open and report a warning. Unsupported OOXML parts are preserved through the internal OOXML package preservation seam and untouched-entry hash checks, but complex visual layouts should still be reviewed. PDF editing remains independent of that seam.

Evidence anchors from office_find include a source quote; DOCX/PPTX anchors include character offsets, and PDF anchors include character spans plus approximate page boxes. These anchors support temporary source highlighting and citations without mutating the source.