@baizor/gamedev 0.0.0-placeholder → 0.1.2

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/cli.js ADDED
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+
3
+ "use strict";
4
+
5
+ const { execFileSync } = require("child_process");
6
+ const path = require("path");
7
+
8
+ const PLATFORM_PACKAGES = {
9
+ "darwin-arm64": "game-dev-cli-darwin-arm64",
10
+ "darwin-x64": "game-dev-cli-darwin-x64",
11
+ "linux-arm64": "game-dev-cli-linux-arm64",
12
+ "linux-x64": "game-dev-cli-linux-x64",
13
+ "win32-x64": "game-dev-cli-windows-x64",
14
+ };
15
+
16
+ const BINARY_NAME = process.platform === "win32" ? "ai-game-dev.exe" : "ai-game-dev";
17
+
18
+ function getBinaryPath() {
19
+ const platformKey = `${process.platform}-${process.arch}`;
20
+ const packageName = PLATFORM_PACKAGES[platformKey];
21
+
22
+ if (!packageName) {
23
+ throw new Error(
24
+ `Unsupported platform: ${platformKey}. ` +
25
+ `Supported: ${Object.keys(PLATFORM_PACKAGES).join(", ")}`
26
+ );
27
+ }
28
+
29
+ // Try to find the binary in the platform-specific package
30
+ try {
31
+ const packageDir = path.dirname(require.resolve(`${packageName}/package.json`));
32
+ return path.join(packageDir, "bin", BINARY_NAME);
33
+ } catch {
34
+ throw new Error(
35
+ `Could not find the binary for your platform (${platformKey}).\n` +
36
+ `Expected package: ${packageName}\n\n` +
37
+ `This can happen if:\n` +
38
+ ` - Your package manager doesn't install optionalDependencies\n` +
39
+ ` - You're on an unsupported platform\n\n` +
40
+ `Try reinstalling: npm install @baizor/gamedev`
41
+ );
42
+ }
43
+ }
44
+
45
+ try {
46
+ const binaryPath = getBinaryPath();
47
+ const result = execFileSync(binaryPath, process.argv.slice(2), {
48
+ stdio: "inherit",
49
+ env: process.env,
50
+ });
51
+ } catch (err) {
52
+ if (err.status !== undefined) {
53
+ // Binary exited with a non-zero code — just forward the exit code
54
+ process.exit(err.status);
55
+ }
56
+ // Actual error (binary not found, etc.)
57
+ console.error(err.message);
58
+ process.exit(1);
59
+ }
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+
3
+ "use strict";
4
+
5
+ // Verify the correct platform binary was installed.
6
+ // This runs as a postinstall script and should never block installation.
7
+
8
+ const PLATFORM_PACKAGES = {
9
+ "darwin-arm64": "game-dev-cli-darwin-arm64",
10
+ "darwin-x64": "game-dev-cli-darwin-x64",
11
+ "linux-arm64": "game-dev-cli-linux-arm64",
12
+ "linux-x64": "game-dev-cli-linux-x64",
13
+ "win32-x64": "game-dev-cli-windows-x64",
14
+ };
15
+
16
+ const platformKey = `${process.platform}-${process.arch}`;
17
+ const packageName = PLATFORM_PACKAGES[platformKey];
18
+
19
+ if (!packageName) {
20
+ console.warn(
21
+ `[gamedev] Warning: no prebuilt binary for ${platformKey}. ` +
22
+ `The CLI may not work on this platform.`
23
+ );
24
+ process.exit(0);
25
+ }
26
+
27
+ try {
28
+ require.resolve(`${packageName}/package.json`);
29
+ } catch {
30
+ console.warn(
31
+ `[gamedev] Warning: platform package ${packageName} not found. ` +
32
+ `This may happen if optionalDependencies were skipped. ` +
33
+ `Try reinstalling with: npm install @baizor/gamedev`
34
+ );
35
+ }
package/package.json CHANGED
@@ -1,13 +1,28 @@
1
1
  {
2
2
  "name": "@baizor/gamedev",
3
- "version": "0.0.0-placeholder",
4
- "description": "gamedev CLI placeholder",
5
- "main": "index.js",
3
+ "version": "0.1.2",
4
+ "description": "AI Game Dev CLI - AI agent for game developers",
5
+ "license": "MIT",
6
+ "bin": {
7
+ "gamedev": "bin/cli.js"
8
+ },
9
+ "files": [
10
+ "bin/"
11
+ ],
12
+ "dependencies": {
13
+ "@anthropic-ai/claude-agent-sdk": "0.3.197"
14
+ },
15
+ "optionalDependencies": {
16
+ "game-dev-cli-darwin-arm64": "0.1.2",
17
+ "game-dev-cli-darwin-x64": "0.1.2",
18
+ "game-dev-cli-linux-arm64": "0.1.2",
19
+ "game-dev-cli-linux-x64": "0.1.2",
20
+ "game-dev-cli-windows-x64": "0.1.2"
21
+ },
6
22
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
23
+ "postinstall": "node bin/postinstall.js"
8
24
  },
9
- "keywords": [],
10
- "author": "",
11
- "license": "MIT",
12
- "type": "commonjs"
25
+ "engines": {
26
+ "node": ">=18.0.0"
27
+ }
13
28
  }