{"_id":"@aefree/pi-markdown-utility","_rev":"4-79bbfbe1bd9a7cec4339d53dcb677cdb","name":"@aefree/pi-markdown-utility","dist-tags":{"latest":"0.4.0"},"versions":{"0.3.2":{"name":"@aefree/pi-markdown-utility","version":"0.3.2","keywords":["pi-package"],"license":"MIT","_id":"@aefree/pi-markdown-utility@0.3.2","maintainers":[{"name":"aefree","email":"aaron@secretcrush.net"}],"homepage":"https://github.com/aefreedman/pi-markdown-utility#readme","bugs":{"url":"https://github.com/aefreedman/pi-markdown-utility/issues"},"pi":{"extensions":["./index.ts"]},"dist":{"shasum":"1d7f5a368efcfac5e6cd4d3786ef70e69f38112f","tarball":"https://registry.npmjs.org/@aefree/pi-markdown-utility/-/pi-markdown-utility-0.3.2.tgz","fileCount":7,"integrity":"sha512-OfNgrtPr4r1QqZYhIDsM/Kf1odBlzfTePViX1et1nIQxmirR1y2n8XqctqzTuvDJgunakpetuKcLebzY5BdbNg==","signatures":[{"sig":"MEYCIQC5wtpdW0+ZRcUJbXhmWxzXGxZfIon7qL+SOHgzacSZygIhAPm0gFp8/TTjW6GNY7pjFjthzKPr/BXsieaKo8IrLYMs","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40919},"type":"module","gitHead":"582d20bdf087dc98c106078ab6d312210505cbb8","scripts":{"test":"tsx tests/executables-validation.ts && tsx tests/unwrap-markdown-validation.ts","unwrap":"tsx unwrap-markdown-cli.ts"},"_npmUser":{"name":"aefree","email":"aaron@secretcrush.net"},"repository":{"url":"git+https://github.com/aefreedman/pi-markdown-utility.git","type":"git"},"_npmVersion":"11.6.2","description":"Pi utility tools for opening and structurally formatting Markdown files.","directories":{},"_nodeVersion":"24.13.0","dependencies":{"tsx":"4.23.9","typebox":"^1.3.10"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-markdown-utility_0.3.2_1786019169992_0.9395837387410815","host":"s3://npm-registry-packages-npm-production"}},"0.3.3":{"name":"@aefree/pi-markdown-utility","version":"0.3.3","keywords":["pi-package"],"license":"MIT","_id":"@aefree/pi-markdown-utility@0.3.3","maintainers":[{"name":"aefree","email":"aaron@secretcrush.net"}],"homepage":"https://github.com/aefreedman/pi-markdown-utility#readme","bugs":{"url":"https://github.com/aefreedman/pi-markdown-utility/issues"},"pi":{"extensions":["./index.ts"]},"dist":{"shasum":"e644f6092c40ab02bff4d0292ec4b465f7d50266","tarball":"https://registry.npmjs.org/@aefree/pi-markdown-utility/-/pi-markdown-utility-0.3.3.tgz","fileCount":7,"integrity":"sha512-u2K2zLEpbP2U4gPdq+tTPj7HWrxtTEIZE27e8i2iM9JT/6nsFqTHEbWcKfdPCWJxNCWAT/XTpSmBd8LtaU6cqQ==","signatures":[{"sig":"MEUCIQC5uj08o3SvrDF5y9fiCk6QyQ0yTFjdXxkigRVd/xtNlgIgL7ZbRR6lFKxRGq8iI02YhNuUHwrbp1f7+T2KrC6wvJo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIA+vJB/7i14vH9wPV8Dt4r3mdIihXqmqb6Xnjq9BfVAhAiEAvdygv4LXZnEArbd8RV9nV3abYGLfReYGmfkdCY1Tymg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aefree%2fpi-markdown-utility@0.3.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":39945},"type":"module","gitHead":"9a48e74c67fe6cf83f2ec8b4fa44065c11c23ecb","scripts":{"test":"tsx tests/executables-validation.ts && tsx tests/unwrap-markdown-validation.ts","unwrap":"tsx unwrap-markdown-cli.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:587b9b1d-3103-4aeb-828b-873dd606a857"}},"repository":{"url":"git+https://github.com/aefreedman/pi-markdown-utility.git","type":"git"},"_npmVersion":"11.5.1","description":"Pi utility tools for opening and structurally formatting Markdown files.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"tsx":"4.23.9","typebox":"^1.3.10"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@earendil-works/pi-coding-agent":"0.86.1"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-markdown-utility_0.3.3_1789916177667_0.2558002155736414","host":"s3://npm-registry-packages-npm-production"}},"0.3.4":{"name":"@aefree/pi-markdown-utility","version":"0.3.4","keywords":["pi-package"],"license":"MIT","_id":"@aefree/pi-markdown-utility@0.3.4","maintainers":[{"name":"aefree","email":"aaron@secretcrush.net"}],"homepage":"https://github.com/aefreedman/pi-markdown-utility#readme","bugs":{"url":"https://github.com/aefreedman/pi-markdown-utility/issues"},"pi":{"extensions":["./index.ts"]},"dist":{"shasum":"15af2dc12a58665d2972da2cf02e5534dd4223d8","tarball":"https://registry.npmjs.org/@aefree/pi-markdown-utility/-/pi-markdown-utility-0.3.4.tgz","fileCount":7,"integrity":"sha512-Kv8nK3ZXqj4h6NaqRoXy8EuWJENMDhaX6JSJPAiIceISSUNzu4UwRqJCL5RXBwPXI6C2N3jME/0qHQIl/mbiJQ==","signatures":[{"sig":"MEUCIAPm52y2ahesUONojxYMWAukSu1E4fkNEUE/2uH5UZ75AiEAxiiMcTkpzbqaPnd0ABpGNl1IMjZGvYVn+u8sCnQmUik=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQDw+98oyy77oByN8LagCJAor8hh0u5dzoDnm6DarqT+5wIgdc95e+xAZqNj21EUbkZExbpJ/gZjy7cr1r5pbahPA5I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aefree%2fpi-markdown-utility@0.3.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":39945},"type":"module","gitHead":"fbeefe3b5fcb79e7b2f794618c6b106eb7e4b09f","scripts":{"test":"tsx tests/executables-validation.ts && tsx tests/unwrap-markdown-validation.ts","unwrap":"tsx unwrap-markdown-cli.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:587b9b1d-3103-4aeb-828b-873dd606a857"}},"repository":{"url":"git+https://github.com/aefreedman/pi-markdown-utility.git","type":"git"},"_npmVersion":"11.5.1","description":"Pi utility tools for opening and structurally formatting Markdown files.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"tsx":"4.23.9","typebox":"^1.3.10"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@earendil-works/pi-coding-agent":"0.87.0"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-markdown-utility_0.3.4_1790020862612_0.7981635662704496","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"pi":{"extensions":["./index.ts"]},"_id":"@aefree/pi-markdown-utility@0.4.0","bugs":{"url":"https://github.com/aefreedman/pi-markdown-utility/issues"},"dist":{"shasum":"58d332e8872ff59b02ebffe26eb1261fdb353766","tarball":"https://registry.npmjs.org/@aefree/pi-markdown-utility/-/pi-markdown-utility-0.4.0.tgz","fileCount":7,"integrity":"sha512-WEzmivgPYmP2fBDREls9x01zQeFR5MbEYIA9Z4N36TWEkwXnrbtNeNG7f+GIya376Ha7EncK7O2dUg/0ztI4Ng==","signatures":[{"sig":"MEQCIB7E3uf3r+dD/AHR3hc3gw0N5L+DTF/OcskmKI1GlbZuAiA9rWvY45tz6Zq1Z0lZQn2XatCwglLW1+MOF+YiGEHZGw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCXXWlUxzkTmuhaHEU6/nKas5D0giH6Gmv1H/W5TVFzWgIhAJ2Rq5C1XVGQFZ2L+eeNFbT+Vg8B2hhzByXKsdVCu9bR"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aefree%2fpi-markdown-utility@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":40856},"name":"@aefree/pi-markdown-utility","type":"module","engines":{"node":">=22.19.0"},"gitHead":"8bce32bdbb16bd4ee952aa7d4e9704591f5a306c","license":"MIT","scripts":{"test":"node tests/executables-validation.ts && node tests/unwrap-markdown-validation.ts && node tests/release-workflow-validation.mjs","unwrap":"tsx unwrap-markdown-cli.ts"},"version":"0.4.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"587b9b1d-3103-4aeb-828b-873dd606a857"}},"homepage":"https://github.com/aefreedman/pi-markdown-utility#readme","keywords":["pi-package"],"repository":{"url":"git+https://github.com/aefreedman/pi-markdown-utility.git","type":"git"},"_npmVersion":"11.5.1","description":"Pi utility tools for opening and structurally formatting Markdown files.","directories":{},"maintainers":[{"name":"aefree","email":"aaron@secretcrush.net"}],"_nodeVersion":"22.19.0","dependencies":{"tsx":"4.23.15"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typebox":"^1.3.10","@earendil-works/pi-coding-agent":"0.99.1"},"peerDependencies":{"typebox":"*","@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"typebox":{"optional":true},"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-markdown-utility_0.4.0_1790733324887_0.22146342026409038"}}},"time":{"created":"2026-08-06T12:26:09.773Z","modified":"2026-09-30T01:55:25.296Z","0.3.2":"2026-08-06T12:26:10.144Z","0.3.3":"2026-09-20T14:56:17.755Z","0.3.4":"2026-09-21T20:01:02.719Z","0.4.0":"2026-09-30T01:55:24.975Z"},"bugs":{"url":"https://github.com/aefreedman/pi-markdown-utility/issues"},"license":"MIT","homepage":"https://github.com/aefreedman/pi-markdown-utility#readme","keywords":["pi-package"],"repository":{"url":"git+https://github.com/aefreedman/pi-markdown-utility.git","type":"git"},"description":"Pi utility tools for opening and structurally formatting Markdown files.","maintainers":[{"name":"aefree","email":"aaron@secretcrush.net"}],"readme":"# Pi Markdown Utility\n\nSmall Pi extension package for opening generated Markdown outputs and removing baked-in column wrapping without disturbing Markdown structure.\n\n## Features\n\n- Tracks the most recent successful `.md` file written or edited in the current Pi session.\n- `/markdown-settings [code|glow]` configures the global Markdown opener.\n- `/open-last-md` opens the last tracked Markdown file with the configured opener.\n- `/open-md <path>` opens a specific Markdown file with the configured opener.\n- `open_markdown_output` lets the agent open a Markdown file when explicitly asked.\n- `unwrap_markdown` previews, checks, or removes column-width wrapping from Markdown prose inside the active workspace.\n- A reusable CLI supports the same preview/check/write workflow for manual use and CI.\n\n## Configuration\n\nThe opener defaults to VS Code. Run `/markdown-settings` to choose interactively, `/markdown-settings glow` to set it directly, or edit `markdownUtility.openWith` in `~/.pi/agent/settings.json` or trusted project `.pi/settings.json`:\n\n```json\n{\n  \"markdownUtility\": {\n    \"openWith\": \"glow\"\n  }\n}\n```\n\nSupported values:\n\n- `\"code\"` (default): opens the file with the VS Code `code` CLI.\n- `\"glow\"`: opens a new terminal window, runs `glow --tui <file>`, and keeps the terminal open after Glow exits.\n\n### Executable overrides and macOS discovery\n\nSet `PI_MARKDOWN_UTILITY_CODE_EXECUTABLE` or `PI_MARKDOWN_UTILITY_GLOW_EXECUTABLE` to an executable path when the corresponding command is not available on `PATH`. An override is used instead of automatic discovery. On Windows, point the VS Code override at `Code.exe`, not a `.cmd` wrapper; Markdown filenames are always passed as literal process arguments and never through `cmd.exe` parsing.\n\nOn macOS, without an override, the package tries the bare `code` or `glow` command first. For VS Code it then tries the standard application CLI at `/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code` and Homebrew locations `/opt/homebrew/bin/code` and `/usr/local/bin/code`. For Glow it also tries the standard Homebrew locations `/opt/homebrew/bin/glow` and `/usr/local/bin/glow`. Missing executables report the applicable PATH/override remedy before an opener or terminal is launched.\n\n## Markdown unwrapping\n\nThe formatter joins ordinary prose within existing paragraph boundaries. It preserves YAML frontmatter, headings, list structure, tables, blockquotes, fenced and indented code, reference definitions, explicit hard breaks, and other structural blocks. Ambiguous structured blocks are left unchanged rather than rewritten speculatively.\n\nThe agent-facing `unwrap_markdown` tool accepts workspace-relative Markdown files or directories and supports:\n\n- `preview`: report files that would change without writing;\n- `check`: perform the same read-only check for validation workflows; and\n- `write`: update files, only when explicitly requested.\n\nFor direct command-line use from the package root:\n\n```bash\nnpm run unwrap -- --root <workspace> --preview <workspace-relative-path>\nnpm run unwrap -- --root <workspace> --check <workspace-relative-path>\nnpm run unwrap -- --root <workspace> --write <workspace-relative-path>\n```\n\nThe CLI uses `--root` as its workspace boundary, defaulting to its current working directory when omitted. Paths may not escape that boundary, and recursive scans ignore symbolic links.\n\nThe standalone CLI and formatter do not require Pi or TypeBox. The CLI script uses the packaged `tsx` runtime dependency because Node does not execute TypeScript inside `node_modules` natively. No global executable is installed: use the package-root script above, or `npm --prefix <package-path> run unwrap -- --root <workspace> --preview <path>`.\n\n## Requirements\n\n- Node.js >=22.19.0 for the Pi extension, standalone CLI, and native TypeScript offline tests.\n- The latest stable Pi Coding Agent; validated with Pi 0.99.1. Older Pi releases are not a supported baseline.\n- The Pi extension requires the host's `typebox` runtime package (validated with 1.3.10). Pi and TypeBox are optional npm peers to avoid installing duplicate host packages, not optional when loading the extension.\n- For `openWith: \"code\"`: VS Code `code` CLI available on `PATH`, discoverable at a standard macOS location, or set through `PI_MARKDOWN_UTILITY_CODE_EXECUTABLE`.\n- For `openWith: \"glow\"`: `glow` CLI available on `PATH`, discoverable at a standard macOS Homebrew location, or set through `PI_MARKDOWN_UTILITY_GLOW_EXECUTABLE`; and a terminal launcher available (`wt.exe`/Windows Terminal on Windows, Terminal on macOS, or a common Linux terminal such as `x-terminal-emulator`, `gnome-terminal`, `konsole`, or `xterm`). On Windows, the launcher prefers PowerShell 7 (`pwsh.exe`) and falls back to Windows PowerShell.\n\n## Install\n\nFrom npm:\n\n```bash\npi install @aefree/pi-markdown-utility\n```\n\nFrom GitHub:\n\n```bash\npi install git:https://github.com/aefreedman/pi-markdown-utility.git\n```\n\nLocal development install:\n\n```bash\npi install <path-to-pi-markdown-utility>\n```\n\nProject-local install:\n\n```bash\npi install -l <path-to-pi-markdown-utility>\n```\n\n## Testing\n\n```bash\nnpm test\n```\n\nThe test suite covers executable discovery, prose transformation, Markdown structure preservation, line-ending retention, idempotence, recursive path handling, write behavior, and workspace-boundary enforcement.\n\n## Notes\n\n- State is session-local; restarting Pi clears the last-output pointer.\n- Known issue: on Windows Terminal, `glow --tui <file>` may initially render before terminal sizing has settled, so word wrap can be wrong until Glow reloads the document. Press `r` in Glow to reload/reflow the view.\n- The package is intentionally operator-focused and lightweight.\n\n## License\n\nMIT. See `LICENSE`.\n","readmeFilename":"README.md"}