@pleaseai/csp
Advanced tools
+97
| #!/usr/bin/env node | ||
| // Launcher for the platform-specific `csp` Rust binary. Resolves the binary | ||
| // shipped by the matching @pleaseai/csp-<platform> optional dependency and | ||
| // execs it, forwarding argv, stdio, and the exit code. Modeled on Biome's | ||
| // distribution launcher (ADR-0003 / T023). | ||
| const { spawnSync } = require('node:child_process') | ||
| const process = require('node:process') | ||
| /** | ||
| * Map the current platform/arch (plus libc on Linux) to the optional-dependency | ||
| * package name and the binary filename it ships. | ||
| */ | ||
| function resolvePlatformPackage() { | ||
| const { platform, arch } = process | ||
| if (platform === 'win32') { | ||
| if (arch === 'x64') { | ||
| return { pkg: '@pleaseai/csp-win32-x64', binary: 'csp.exe' } | ||
| } | ||
| } | ||
| else if (platform === 'darwin') { | ||
| if (arch === 'arm64') { | ||
| return { pkg: '@pleaseai/csp-darwin-arm64', binary: 'csp' } | ||
| } | ||
| if (arch === 'x64') { | ||
| return { pkg: '@pleaseai/csp-darwin-x64', binary: 'csp' } | ||
| } | ||
| } | ||
| else if (platform === 'linux') { | ||
| const musl = isMusl() | ||
| if (arch === 'x64') { | ||
| return musl | ||
| ? { pkg: '@pleaseai/csp-linux-x64-musl', binary: 'csp' } | ||
| : { pkg: '@pleaseai/csp-linux-x64', binary: 'csp' } | ||
| } | ||
| if (arch === 'arm64') { | ||
| // arm64 ships glibc only for now; musl arm64 falls back to it. | ||
| return { pkg: '@pleaseai/csp-linux-arm64', binary: 'csp' } | ||
| } | ||
| } | ||
| return null | ||
| } | ||
| /** Best-effort libc detection: report.glibcVersionRuntime is absent on musl. */ | ||
| function isMusl() { | ||
| try { | ||
| const report = typeof process.report?.getReport === 'function' | ||
| ? process.report.getReport() | ||
| : null | ||
| if (report && report.header && report.header.glibcVersionRuntime) { | ||
| return false | ||
| } | ||
| // No glibc runtime reported → assume musl (e.g. Alpine). | ||
| return report !== null | ||
| } | ||
| catch { | ||
| return false | ||
| } | ||
| } | ||
| function main() { | ||
| const target = resolvePlatformPackage() | ||
| if (target === null) { | ||
| process.stderr.write( | ||
| `csp: unsupported platform ${process.platform}/${process.arch}.\n` | ||
| + 'See https://github.com/pleaseai/code-search/releases for prebuilt binaries.\n', | ||
| ) | ||
| process.exit(1) | ||
| } | ||
| let binaryPath | ||
| try { | ||
| binaryPath = require.resolve(`${target.pkg}/${target.binary}`) | ||
| } | ||
| catch { | ||
| process.stderr.write( | ||
| `csp: the platform package "${target.pkg}" is not installed.\n` | ||
| + 'It should have been pulled in automatically as an optional dependency. ' | ||
| + 'Try reinstalling without --no-optional, or download a binary from ' | ||
| + 'https://github.com/pleaseai/code-search/releases.\n', | ||
| ) | ||
| process.exit(1) | ||
| } | ||
| const result = spawnSync(binaryPath, process.argv.slice(2), { | ||
| stdio: 'inherit', | ||
| windowsHide: true, | ||
| }) | ||
| if (result.error) { | ||
| throw result.error | ||
| } | ||
| process.exit(result.status ?? 1) | ||
| } | ||
| main() |
+37
-3
| { | ||
| "name": "@pleaseai/csp", | ||
| "version": "0.0.0", | ||
| "description": "Placeholder to reserve the name and enable npm Trusted Publishing; real releases (>=0.1.0) are published via GitHub Actions OIDC.", | ||
| "version": "0.1.4", | ||
| "description": "Fast and accurate hybrid code search for agents (Rust binary, npm-distributed).", | ||
| "license": "MIT", | ||
| "homepage": "https://github.com/pleaseai/code-search", | ||
| "repository": { "type": "git", "url": "https://github.com/pleaseai/code-search.git" } | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/pleaseai/code-search.git" | ||
| }, | ||
| "bugs": { | ||
| "url": "https://github.com/pleaseai/code-search/issues" | ||
| }, | ||
| "keywords": [ | ||
| "code-search", | ||
| "hybrid-search", | ||
| "semantic-search", | ||
| "bm25", | ||
| "embeddings", | ||
| "mcp", | ||
| "agent", | ||
| "rag", | ||
| "tree-sitter" | ||
| ], | ||
| "bin": { | ||
| "csp": "bin/csp.js" | ||
| }, | ||
| "files": [ | ||
| "bin/csp.js" | ||
| ], | ||
| "engines": { | ||
| "node": ">=22.0.0" | ||
| }, | ||
| "optionalDependencies": { | ||
| "@pleaseai/csp-darwin-arm64": "0.1.4", | ||
| "@pleaseai/csp-darwin-x64": "0.1.4", | ||
| "@pleaseai/csp-linux-x64": "0.1.4", | ||
| "@pleaseai/csp-linux-arm64": "0.1.4", | ||
| "@pleaseai/csp-linux-x64-musl": "0.1.4", | ||
| "@pleaseai/csp-win32-x64": "0.1.4" | ||
| } | ||
| } |
| Placeholder package. See https://github.com/pleaseai/code-search |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
3785
774.13%88
Infinity%1
-50%0
-100%6
Infinity%1
Infinity%0
-100%1
Infinity%