open-kioku 0.1.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.
Files changed (2) hide show
  1. package/bin/ok.js +57 -0
  2. package/package.json +35 -0
package/bin/ok.js ADDED
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawnSync } = require('child_process');
4
+ const path = require('path');
5
+ const os = require('os');
6
+ const fs = require('fs');
7
+
8
+ const ARCH_MAP = {
9
+ 'x64': 'x64',
10
+ 'arm64': 'arm64',
11
+ };
12
+
13
+ const OS_MAP = {
14
+ 'darwin': 'darwin',
15
+ 'linux': 'linux',
16
+ 'win32': 'win32',
17
+ };
18
+
19
+ function getBinaryPath() {
20
+ const osType = OS_MAP[os.platform()];
21
+ const archType = ARCH_MAP[os.arch()];
22
+
23
+ if (!osType || !archType) {
24
+ console.error(`Unsupported platform: ${os.platform()} ${os.arch()}`);
25
+ process.exit(1);
26
+ }
27
+
28
+ const packageName = `@open-kioku/${osType}-${archType}`;
29
+
30
+ try {
31
+ const packageJsonPath = require.resolve(`${packageName}/package.json`);
32
+ const packageDir = path.dirname(packageJsonPath);
33
+ const ext = osType === 'win32' ? '.exe' : '';
34
+ const binPath = path.join(packageDir, `ok${ext}`);
35
+
36
+ if (!fs.existsSync(binPath)) {
37
+ console.error(`Error: Binary not found at expected path: ${binPath}`);
38
+ process.exit(1);
39
+ }
40
+ return binPath;
41
+ } catch (err) {
42
+ console.error(`Error: Failed to resolve optional dependency ${packageName}.`);
43
+ console.error(`Please ensure you installed open-kioku properly, and that your package manager supports optionalDependencies.`);
44
+ process.exit(1);
45
+ }
46
+ }
47
+
48
+ const binPath = getBinaryPath();
49
+ const args = process.argv.slice(2);
50
+ const result = spawnSync(binPath, args, { stdio: 'inherit' });
51
+
52
+ if (result.error) {
53
+ console.error(`Failed to execute binary: ${result.error.message}`);
54
+ process.exit(1);
55
+ }
56
+
57
+ process.exit(result.status !== null ? result.status : 1);
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "open-kioku",
3
+ "version": "0.1.3",
4
+ "description": "A blazing-fast, language-aware codebase index and semantic search engine for AI agents (MCP)",
5
+ "bin": {
6
+ "ok": "./bin/ok.js",
7
+ "open-kioku": "./bin/ok.js"
8
+ },
9
+ "optionalDependencies": {
10
+ "@open-kioku/darwin-x64": "0.1.3",
11
+ "@open-kioku/darwin-arm64": "0.1.3",
12
+ "@open-kioku/linux-x64": "0.1.3",
13
+ "@open-kioku/linux-arm64": "0.1.3",
14
+ "@open-kioku/win32-x64": "0.1.3"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/shivyadavus/open-kioku.git"
19
+ },
20
+ "keywords": [
21
+ "mcp",
22
+ "ai",
23
+ "llm",
24
+ "semantic-search",
25
+ "tree-sitter",
26
+ "code-index",
27
+ "context"
28
+ ],
29
+ "author": "Open Kioku",
30
+ "license": "Elastic-2.0",
31
+ "bugs": {
32
+ "url": "https://github.com/shivyadavus/open-kioku/issues"
33
+ },
34
+ "homepage": "https://shivyadavus.github.io/open-kioku/demo/index.html"
35
+ }