@grepai/cli 0.4.1 → 0.4.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grepai/cli",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "CLI for semantic code search. It uses vector embeddings to understand code meaning, enabling natural language queries that find relevant code—even when naming conventions vary.",
5
5
  "homepage": "https://github.com/bismuth1991/grepai-ts#readme",
6
6
  "bugs": {
@@ -13,23 +13,28 @@
13
13
  "url": "git+https://github.com/bismuth1991/grepai-ts.git"
14
14
  },
15
15
  "bin": {
16
- "grepai": "./bin/grepai"
16
+ "grepai": "./index.js"
17
17
  },
18
18
  "files": [
19
- "bin/",
20
- "install.js"
19
+ "index.js"
21
20
  ],
22
21
  "publishConfig": {
23
22
  "access": "public"
24
23
  },
25
24
  "scripts": {
26
- "postinstall": "node install.js",
27
25
  "publish:npm": "bun publish"
28
26
  },
27
+ "dependencies": {
28
+ "tree-sitter": "0.25.0",
29
+ "tree-sitter-typescript": "0.23.2"
30
+ },
29
31
  "optionalDependencies": {
30
- "@grepai/cli-darwin-arm64": "0.4.1",
31
- "@grepai/cli-linux-arm64-musl": "0.4.1",
32
- "@grepai/cli-linux-x64": "0.4.1",
33
- "@grepai/cli-linux-x64-musl": "0.4.1"
32
+ "@libsql/darwin-arm64": "0.4.7",
33
+ "@libsql/darwin-x64": "0.4.7",
34
+ "@libsql/linux-arm64-gnu": "0.4.7",
35
+ "@libsql/linux-arm64-musl": "0.4.7",
36
+ "@libsql/linux-x64-gnu": "0.4.7",
37
+ "@libsql/linux-x64-musl": "0.4.7",
38
+ "@libsql/win32-x64-msvc": "0.4.7"
34
39
  }
35
40
  }
package/bin/.gitkeep DELETED
File without changes
package/bin/grepai DELETED
Binary file
package/install.js DELETED
@@ -1,93 +0,0 @@
1
- const { existsSync, symlinkSync, mkdirSync, chmodSync } = require('fs')
2
- const { execSync } = require('child_process')
3
- const path = require('path')
4
-
5
- function detectLibc() {
6
- if (process.platform !== 'linux') {
7
- return null
8
- }
9
-
10
- if (process.report?.getReport()?.header?.glibcVersionRuntime) {
11
- return 'glibc'
12
- }
13
-
14
- try {
15
- const ldd = execSync('ldd --version 2>&1', { encoding: 'utf8' })
16
- if (/musl/i.test(ldd)) {
17
- return 'musl'
18
- }
19
- if (/GLIBC|GNU libc/i.test(ldd)) {
20
- return 'glibc'
21
- }
22
- } catch {}
23
-
24
- if (existsSync('/etc/alpine-release')) {
25
- return 'musl'
26
- }
27
-
28
- try {
29
- const ldso = execSync('ls /lib/ld-musl-* 2>/dev/null', {
30
- encoding: 'utf8',
31
- })
32
- if (ldso.trim()) {
33
- return 'musl'
34
- }
35
- } catch {}
36
-
37
- return 'glibc'
38
- }
39
-
40
- function getPlatformKey() {
41
- const os = process.platform
42
- const arch = process.arch
43
- const libc = detectLibc()
44
-
45
- return libc ? `${os}-${arch}-${libc}` : `${os}-${arch}`
46
- }
47
-
48
- const PLATFORMS = {
49
- 'darwin-arm64': '@grepai/cli-darwin-arm64',
50
- 'linux-arm64-musl': '@grepai/cli-linux-arm64-musl',
51
- 'linux-x64-glibc': '@grepai/cli-linux-x64',
52
- 'linux-x64-musl': '@grepai/cli-linux-x64-musl',
53
- }
54
-
55
- const key = getPlatformKey()
56
- const pkg = PLATFORMS[key]
57
-
58
- if (!pkg) {
59
- console.error(`@grepai/cli: unsupported platform ${key}`)
60
- console.error(
61
- `@grepai/cli: supported platforms: ${Object.keys(PLATFORMS).join(', ')}`,
62
- )
63
- process.exit(1)
64
- }
65
-
66
- const binDir = path.join(__dirname, 'bin')
67
- const target = path.join(binDir, 'grepai')
68
-
69
- let source
70
- try {
71
- source = require.resolve(pkg)
72
- } catch (error) {
73
- const message = error && error.message ? error.message : String(error)
74
- console.error(
75
- `@grepai/cli: failed to resolve platform package ${pkg}: ${message}`,
76
- )
77
- process.exit(1)
78
- }
79
-
80
- if (!existsSync(target)) {
81
- mkdirSync(binDir, { recursive: true })
82
-
83
- try {
84
- symlinkSync(source, target)
85
- chmodSync(target, 0o755)
86
- } catch (error) {
87
- const message = error && error.message ? error.message : String(error)
88
- console.error(
89
- `@grepai/cli: failed to prepare executable at ${target}: ${message}`,
90
- )
91
- process.exit(1)
92
- }
93
- }