{"_id":"@cyberxninja-omp/pi-natives","name":"@cyberxninja-omp/pi-natives","dist-tags":{"latest":"17.5.3"},"versions":{"17.5.3":{"name":"@cyberxninja-omp/pi-natives","version":"17.5.3","description":"Native Rust bindings for PDF conversion, audio, WebRTC, grep, clipboard, image processing, syntax highlighting, PTY, and shell operations via N-API","type":"module","homepage":"https://omp.sh","author":{"name":"Can Boluk"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/can1357/oh-my-pi.git","directory":"packages/natives"},"bugs":{"url":"https://github.com/can1357/oh-my-pi/issues"},"keywords":["napi","rust","native","grep","text-processing","clipboard","image","pty","shell","syntax-highlighting"],"main":"./native/index.js","types":"./native/index.d.ts","scripts":{"build":"bun ../../scripts/bazel-natives.ts host --dest native","build:bindings":"bun scripts/build-bindings.ts","check":"biome check . && bun run check:types","check:types":"tsgo -p tsconfig.json --noEmit","lint":"biome lint .","test":"bun test --parallel","fix":"biome check --write --unsafe .","fmt":"biome format --write .","gen:native":"bun scripts/embed-native.ts","gen:native:reset":"bun scripts/embed-native.ts --reset","gen:npm":"bun scripts/gen-npm-packages.ts","bench":"bun bench/grep.ts"},"devDependencies":{"@napi-rs/cli":"3.7.2","@types/bun":"^1.3.14"},"engines":{"bun":">=1.3.14"},"napi":{"binaryName":"pi_natives","triples":{}},"exports":{".":{"types":"./native/index.d.ts","import":"./native/index.js"},"./desktop":{"types":"./native/desktop.d.ts","import":"./native/desktop.js"},"./clipboard":{"types":"./native/clipboard.d.ts","import":"./native/clipboard.js"}},"optionalDependencies":{"@cyberxninja-omp/pi-natives-linux-x64":"17.5.3","@cyberxninja-omp/pi-natives-linux-arm64":"17.5.3","@cyberxninja-omp/pi-natives-darwin-x64":"17.5.3","@cyberxninja-omp/pi-natives-darwin-arm64":"17.5.3","@cyberxninja-omp/pi-natives-win32-x64":"17.5.3"},"_id":"@cyberxninja-omp/pi-natives@17.5.3","_integrity":"sha512-uTsCunD+oXaGz43UpENN30GN22lAsEKrrI9BMhcGmQ4ECx7rO/Plr20Qo5EfUW48xVn7GqgmJWV1+euckB3x3A==","_resolved":"/tmp/cxn-pack-bVdXMJ/cyberxninja-omp-pi-natives-17.5.3.tgz","_from":"file:/tmp/cxn-pack-bVdXMJ/cyberxninja-omp-pi-natives-17.5.3.tgz","_nodeVersion":"24.3.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-uTsCunD+oXaGz43UpENN30GN22lAsEKrrI9BMhcGmQ4ECx7rO/Plr20Qo5EfUW48xVn7GqgmJWV1+euckB3x3A==","shasum":"5c6a4d5ff58da9bc41538611ea1e35c273431b18","tarball":"https://registry.npmjs.org/@cyberxninja-omp/pi-natives/-/pi-natives-17.5.3.tgz","fileCount":11,"unpackedSize":123556,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCj/e8LzonVvTQcqErODrSBs2AaXk4Umle1fbhhEPYj1QIhAJ+/rSYWG55GG0a426YByWlqqBMx6RB1qwJB4kf/iH2s"}]},"_npmUser":{"name":"cyberxninja","email":"jailbreaker20th@gmail.com"},"directories":{},"maintainers":[{"name":"cyberxninja","email":"jailbreaker20th@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-natives_17.5.3_1787233037025_0.6974640421885414"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-20T13:37:16.802Z","17.5.3":"2026-08-20T13:37:17.180Z","modified":"2026-08-20T13:37:17.436Z"},"maintainers":[{"name":"cyberxninja","email":"jailbreaker20th@gmail.com"}],"description":"Native Rust bindings for PDF conversion, audio, WebRTC, grep, clipboard, image processing, syntax highlighting, PTY, and shell operations via N-API","homepage":"https://omp.sh","keywords":["napi","rust","native","grep","text-processing","clipboard","image","pty","shell","syntax-highlighting"],"repository":{"type":"git","url":"git+https://github.com/can1357/oh-my-pi.git","directory":"packages/natives"},"author":{"name":"Can Boluk"},"bugs":{"url":"https://github.com/can1357/oh-my-pi/issues"},"license":"MIT","readme":"# @cyberxninja-omp/pi-natives\n\nNative Rust functionality via N-API.\n\n## What's Inside\n\n- **Grep**: Regex-based search powered by ripgrep's engine with native file walking and matching\n- **Find**: Glob-based file/directory discovery with gitignore support (pure TypeScript via `globPaths`)\n- **SIXEL**: Terminal image encoding for SIXEL-capable terminals (decode, resize, encode in one pass)\n- **Audio**: Cross-platform low-latency microphone capture and gapless speaker playback\n- **WebRTC**: Native Opus media, SDP offer/answer negotiation, and data-channel events for live sessions\n- **File locking**: Process-owned cross-process locks with in-memory kernel names on Linux/Windows and `flock(2)` sidecars on other Unix platforms\n- **PDF**: In-memory PDF-to-Markdown extraction with OCR-page classification via `pdf-inspector`\n\nGeneral-purpose image processing (decode/resize/encode for files and buffers)\nlives in [`Bun.Image`](https://bun.com/docs/runtime/image) on the JS side; this\ncrate only ships the SIXEL encoder because no built-in equivalent exists for\nthat terminal protocol.\n\n## Usage\n\n```typescript\nimport { encodeSixel, grep, pdfToMarkdown } from \"@cyberxninja-omp/pi-natives\";\n\n// Grep for a pattern\nconst results = await grep({\n\tpattern: \"TODO\",\n\tpath: \"/path/to/project\",\n\tglob: \"*.ts\",\n\tcontext: 2,\n});\n\n// Find files\nconst files = await find({\n\tpattern: \"*.rs\",\n\tpath: \"/path/to/project\",\n\tfileType: \"file\",\n});\n\n// SIXEL encode for a terminal cell box (px)\nconst sequence = encodeSixel(pngBytes, widthPx, heightPx);\n\n// Extract PDF text and identify pages that still need OCR\nconst pdf = await pdfToMarkdown(pdfBytes);\nconsole.log(pdf.markdown, pdf.pagesNeedingOcr);\n```\n\n## Building\n\n```bash\n# Build native addon from workspace root (requires Rust)\nbun run build\n\n# Type check\nbun run check\n```\n\n## Architecture\n\n`@cyberxninja-omp/pi-natives` publishes a small core package plus generated\nplatform-specific optional dependency packages:\n\n```\ncrates/pi-natives/       # Rust source (workspace member)\n  src/lib.rs             # N-API exports\n  src/sixel.rs           # SIXEL terminal-image encoding\n  Cargo.toml             # Rust dependencies\nnative/                  # Core loader files and local/CI native build outputs\n  index.js               # Public native export surface\n  loader-state.js        # Platform, ISA variant, and addon resolution\n  embedded-addon.js      # Standalone binary embed stub/generated metadata\n  pi_natives.<platform>-<arch>-modern.node   # x64 modern ISA (local/CI artifact)\n  pi_natives.<platform>-<arch>-baseline.node # x64 baseline ISA (local/CI artifact)\n  pi_natives.<platform>-<arch>.node          # non-x64 build artifact\nnpm/<platform>-<arch>/   # Generated at publish time, not committed\n  package.json           # @cyberxninja-omp/pi-natives-<platform>-<arch>\n  *.node                 # Only that platform's addon binary or x64 ISA variants\n```\n\nThe published core package contains only the JS loader, declarations, README,\nand `package.json`. Release publishing generates one leaf package per supported\n`os`/`cpu` pair and injects those leaves into the core manifest as pinned\n`optionalDependencies`, so package managers install only the host platform's\nnative addon. x64 leaves include every built ISA variant, and the loader keeps\nchoosing between `baseline` and `modern` at runtime.\n","readmeFilename":"README.md","_rev":"1-e1a63b67e68fdb367c1332e5e20dfc2d"}