@vividcodeai/pick 0.1.11-win32-x64 → 0.1.11

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/bin/pick.js ADDED
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from "module";
3
+ import { spawn } from "child_process";
4
+ import { existsSync } from "fs";
5
+ import { join, dirname } from "path";
6
+ import { fileURLToPath } from "url";
7
+
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const require = createRequire(import.meta.url);
10
+
11
+ const PLATFORM_PACKAGES = {
12
+ "linux-x64": "@vividcodeai/pick-linux-x64",
13
+ "linux-arm64": "@vividcodeai/pick-linux-arm64",
14
+ "darwin-x64": "@vividcodeai/pick-darwin-x64",
15
+ "darwin-arm64": "@vividcodeai/pick-darwin-arm64",
16
+ "win32-x64": "@vividcodeai/pick-win32-x64",
17
+ "win32-arm64": "@vividcodeai/pick-win32-arm64",
18
+ };
19
+
20
+ const BINARY_NAME = process.platform === "win32" ? "pick.exe" : "pick";
21
+
22
+ function getTargetTriple(platform, arch) {
23
+ if (platform === "linux" && arch === "x64") return "x86_64-unknown-linux-gnu";
24
+ if (platform === "linux" && arch === "arm64") return "aarch64-unknown-linux-gnu";
25
+ if (platform === "darwin" && arch === "x64") return "x86_64-apple-darwin";
26
+ if (platform === "darwin" && arch === "arm64") return "aarch64-apple-darwin";
27
+ if (platform === "win32" && arch === "x64") return "x86_64-pc-windows-msvc";
28
+ if (platform === "win32" && arch === "arm64") return "aarch64-pc-windows-msvc";
29
+ return null;
30
+ }
31
+
32
+ function main() {
33
+ const platform = process.platform;
34
+ const arch = process.arch;
35
+ const mapKey = `${platform}-${arch}`;
36
+ const pkgName = PLATFORM_PACKAGES[mapKey];
37
+
38
+ if (!pkgName) {
39
+ console.error(`Unsupported platform: ${platform} ${arch}`);
40
+ process.exit(1);
41
+ }
42
+
43
+ let pkgPath;
44
+ try {
45
+ pkgPath = dirname(require.resolve(`${pkgName}/package.json`));
46
+ } catch {
47
+ console.error(
48
+ `Platform package ${pkgName} not installed. Try: npm install -g ${pkgName}`
49
+ );
50
+ process.exit(1);
51
+ }
52
+
53
+ const binaryPath = join(pkgPath, "vendor", BINARY_NAME);
54
+ if (!existsSync(binaryPath)) {
55
+ console.error(`Binary not found at ${binaryPath}`);
56
+ process.exit(1);
57
+ }
58
+
59
+ const child = spawn(binaryPath, process.argv.slice(2), {
60
+ stdio: "inherit",
61
+ env: { ...process.env, PICK_MANAGED_BY_NPM: "1" },
62
+ });
63
+
64
+ child.on("exit", (code) => process.exit(code));
65
+ }
66
+
67
+ main();
package/package.json CHANGED
@@ -1,23 +1,34 @@
1
1
  {
2
2
  "name": "@vividcodeai/pick",
3
- "version": "0.1.11-win32-x64",
3
+ "version": "0.1.11",
4
+ "description": "Pick CLI - An AI coding assistant that runs locally on your computer",
4
5
  "license": "MIT",
5
- "os": [
6
- "win32"
7
- ],
8
- "cpu": [
9
- "x64"
10
- ],
6
+ "bin": {
7
+ "pick": "bin/pick.js"
8
+ },
9
+ "type": "module",
10
+ "engines": {
11
+ "node": ">=16"
12
+ },
11
13
  "files": [
12
- "vendor"
14
+ "bin/pick.js"
13
15
  ],
14
16
  "repository": {
15
17
  "type": "git",
16
- "url": "git+https://github.com/vividcode-ai/pick.git"
18
+ "url": "git+https://github.com/vividcode-ai/pick.git",
19
+ "directory": "npm/pick"
17
20
  },
18
21
  "publishConfig": {
19
22
  "registry": "https://registry.npmjs.org",
20
23
  "access": "public",
21
24
  "provenance": true
25
+ },
26
+ "optionalDependencies": {
27
+ "@vividcodeai/pick-linux-x64": "npm:@vividcodeai/pick@0.1.11-linux-x64",
28
+ "@vividcodeai/pick-linux-arm64": "npm:@vividcodeai/pick@0.1.11-linux-arm64",
29
+ "@vividcodeai/pick-darwin-x64": "npm:@vividcodeai/pick@0.1.11-darwin-x64",
30
+ "@vividcodeai/pick-darwin-arm64": "npm:@vividcodeai/pick@0.1.11-darwin-arm64",
31
+ "@vividcodeai/pick-win32-x64": "npm:@vividcodeai/pick@0.1.11-win32-x64",
32
+ "@vividcodeai/pick-win32-arm64": "npm:@vividcodeai/pick@0.1.11-win32-arm64"
22
33
  }
23
34
  }
package/vendor/pick.exe DELETED
Binary file