vibervn-context-engine 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/cli.js +62 -0
  2. package/package.json +25 -0
package/bin/cli.js ADDED
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execFileSync } = require('child_process')
4
+ const { existsSync } = require('fs')
5
+ const path = require('path')
6
+
7
+ const PLATFORMS = {
8
+ 'linux-x64': 'vibervn-context-engine-linux-x64',
9
+ 'linux-arm64': 'vibervn-context-engine-linux-arm64',
10
+ 'darwin-arm64': 'vibervn-context-engine-darwin-arm64',
11
+ 'win32-x64': 'vibervn-context-engine-win32-x64',
12
+ }
13
+
14
+ const platformKey = `${process.platform}-${process.arch}`
15
+ const packageName = PLATFORMS[platformKey]
16
+
17
+ if (!packageName) {
18
+ console.error(
19
+ `Unsupported platform: ${process.platform} ${process.arch}\n` +
20
+ `Supported platforms: ${Object.keys(PLATFORMS).join(', ')}`
21
+ )
22
+ process.exit(1)
23
+ }
24
+
25
+ let binPath
26
+ try {
27
+ const binName = process.platform === 'win32' ? 'context-engine-rs.exe' : 'context-engine-rs'
28
+ binPath = path.join(
29
+ path.dirname(require.resolve(`${packageName}/package.json`)),
30
+ 'bin',
31
+ binName
32
+ )
33
+ } catch {
34
+ console.error(
35
+ `Could not find the binary package "${packageName}".\n` +
36
+ `This usually means it was not installed (e.g., --no-optional was used) or your platform is unsupported.\n` +
37
+ `Try reinstalling: npm install -g vibervn-context-engine`
38
+ )
39
+ process.exit(1)
40
+ }
41
+
42
+ if (!existsSync(binPath)) {
43
+ console.error(
44
+ `Binary not found at "${binPath}".\n` +
45
+ `The platform package "${packageName}" is installed but the binary is missing.\n` +
46
+ `Try reinstalling: npm install -g vibervn-context-engine`
47
+ )
48
+ process.exit(1)
49
+ }
50
+
51
+ try {
52
+ execFileSync(binPath, process.argv.slice(2), {
53
+ stdio: 'inherit',
54
+ env: process.env,
55
+ })
56
+ process.exit(0)
57
+ } catch (e) {
58
+ if (e.signal) {
59
+ process.kill(process.pid, e.signal)
60
+ }
61
+ process.exit(e.status ?? 1)
62
+ }
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "vibervn-context-engine",
3
+ "version": "0.1.0",
4
+ "description": "Local semantic code context engine — indexes large repos and serves a codebase-retrieval MCP tool",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/nullmastermind/vibervn-context-engine.git"
9
+ },
10
+ "bin": {
11
+ "vibervn-context-engine": "bin/cli.js"
12
+ },
13
+ "files": [
14
+ "bin"
15
+ ],
16
+ "engines": {
17
+ "node": ">=18"
18
+ },
19
+ "optionalDependencies": {
20
+ "vibervn-context-engine-linux-x64": "0.1.0",
21
+ "vibervn-context-engine-linux-arm64": "0.1.0",
22
+ "vibervn-context-engine-darwin-arm64": "0.1.0",
23
+ "vibervn-context-engine-win32-x64": "0.1.0"
24
+ }
25
+ }