🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

pi-mdxml-context

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pi-mdxml-context

Pi extension that converts Markdown context to XML-like structure at model send time

latest
Source
npmnpm
Version
0.1.11
Version published
Maintainers
1
Created
Source

pi-mdxml-context

CI Publish npm version npm downloads License: MIT Pi package Trusted Publishing Buy Me A Coffee

Convert Markdown context to XML-like structure at model send time while keeping the original Markdown in session history.

What this is

pi-mdxml-context is a Pi extension for agent workflows where Markdown is convenient for humans, but explicit XML-like boundaries can make complex context easier for models to parse.

It converts loaded Markdown context files and recent Markdown tool results before each model request. Saved session history stays in Markdown; conversion happens only in the provider-bound context.

Features

  • Converts Markdown context files before model requests.
  • Converts Markdown tool results without mutating saved session history.
  • Preserves source metadata on the generated XML root element.
  • Supports frontmatter, GFM, code blocks, tables, wikilinks, and Obsidian-style callouts.
  • Provides preview and on/off toggle commands.
  • Skips conversion when XML output grows too large.

Install

Install the published npm package with Pi:

pi install npm:pi-mdxml-context

Pin a specific version when you want reproducible installs:

pi install npm:pi-mdxml-context@0.1.9

Install into the current project instead of your user Pi settings:

pi install npm:pi-mdxml-context -l

Or install from GitHub:

pi install git:github.com/eiei114/pi-mdxml-context

Try it without permanently installing:

pi -e npm:pi-mdxml-context

Quick start

After install, reload Pi if needed:

/reload

Check that conversion is active:

/mdxml:status

Preview XML-like output for a Markdown file:

/mdxml:preview path/to/file.md

For commands, output shape, runtime hooks, and safety behavior, see docs/usage.md.

Usage summary

CommandDescription
/mdxml:onEnable send-time conversion.
/mdxml:offDisable send-time conversion.
/mdxml:statusShow conversion state and recent stats.
/mdxml:preview <path>Preview XML-like output for a Markdown file.
/mdxml:preview recent:NPreview XML-like output for a recent Markdown tool result.

Conversion is enabled by default after the extension loads. Use /mdxml:off to disable it immediately.

Package contents

PathPurpose
index.tsPi TypeScript extension entrypoint
tests/Converter, runtime hook, and preview tests
docs/Usage and release docs (usage.md, release.md)
README.mdPublic entrypoint (this file)
CHANGELOG.mdVersion history
CODE_OF_CONDUCT.mdContributor Covenant code of conduct
CONTRIBUTING.mdContribution guidelines
SECURITY.mdVulnerability reporting
LICENSEMIT license

Development

npm install
npm run check
npm test

Before opening a PR with publishable changes, bump package.json and update CHANGELOG.md in the same PR. CI runs npm run version:check on pull requests.

Release

This package uses npm Trusted Publishing with GitHub Actions OIDC — no NPM_TOKEN is required.

On main, a version bump in package.json triggers Auto Release, which creates the semver tag and GitHub Release, then dispatches Publish to npm (publish.yml).

See docs/release.md for setup details and tag-to-npm verification steps. See CHANGELOG.md for semver history.

Security

Pi packages run with your local permissions. Review extensions before installing third-party packages.

For vulnerability reporting, see SECURITY.md.

License

MIT

Keywords

pi

FAQs

Package last updated on 04 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts