@auroraflow/code 0.0.4 → 0.0.6

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,17 +1,21 @@
1
1
  {
2
2
  "name": "@auroraflow/code",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Aurora Code is Aurora's local coding agent.",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
7
7
  "aurora": "bin/aurora.js"
8
8
  },
9
9
  "type": "module",
10
+ "scripts": {
11
+ "postinstall": "node scripts/install_posix_launcher.js"
12
+ },
10
13
  "engines": {
11
14
  "node": ">=16"
12
15
  },
13
16
  "files": [
14
- "bin/aurora.js"
17
+ "bin/aurora.js",
18
+ "scripts/install_posix_launcher.js"
15
19
  ],
16
20
  "repository": {
17
21
  "type": "git",
@@ -20,11 +24,11 @@
20
24
  },
21
25
  "packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319",
22
26
  "optionalDependencies": {
23
- "@auroraflow/code-linux-x64": "0.0.4",
24
- "@auroraflow/code-linux-arm64": "0.0.4",
25
- "@auroraflow/code-darwin-x64": "0.0.4",
26
- "@auroraflow/code-darwin-arm64": "0.0.4",
27
- "@auroraflow/code-win32-x64": "0.0.4",
28
- "@auroraflow/code-win32-arm64": "0.0.4"
27
+ "@auroraflow/code-linux-x64": "0.0.6",
28
+ "@auroraflow/code-linux-arm64": "0.0.6",
29
+ "@auroraflow/code-darwin-x64": "0.0.6",
30
+ "@auroraflow/code-darwin-arm64": "0.0.6",
31
+ "@auroraflow/code-win32-x64": "0.0.6",
32
+ "@auroraflow/code-win32-arm64": "0.0.6"
29
33
  }
30
34
  }
@@ -0,0 +1,106 @@
1
+ #!/usr/bin/env node
2
+ // Replaces the installed Unix npm shim with a launcher that execs the native binary.
3
+
4
+ import { chmodSync, existsSync, readFileSync, writeFileSync } from "node:fs";
5
+ import path from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
+
8
+ if (process.platform === "win32") {
9
+ process.exit(0);
10
+ }
11
+
12
+ const __filename = fileURLToPath(import.meta.url);
13
+ const packageRoot = path.resolve(path.dirname(__filename), "..");
14
+ const binDir = path.join(packageRoot, "bin");
15
+ const entryPath = path.join(binDir, "aurora.js");
16
+ const nodeEntryPath = path.join(binDir, "aurora-node.js");
17
+
18
+ if (!existsSync(entryPath)) {
19
+ process.exit(0);
20
+ }
21
+
22
+ if (!existsSync(nodeEntryPath)) {
23
+ writeFileSync(nodeEntryPath, readFileSync(entryPath));
24
+ chmodSync(nodeEntryPath, 0o755);
25
+ }
26
+
27
+ const launcher = `#!/bin/sh
28
+ # Aurora Code POSIX launcher. Generated at npm install time.
29
+
30
+ set -e
31
+
32
+ resolve_dir() {
33
+ CDPATH= cd -- "$1" 2>/dev/null && pwd -P
34
+ }
35
+
36
+ SELF=$0
37
+ while [ -L "$SELF" ]; do
38
+ LINK=$(readlink "$SELF")
39
+ case "$LINK" in
40
+ /*) SELF=$LINK ;;
41
+ *) SELF=$(dirname -- "$SELF")/$LINK ;;
42
+ esac
43
+ done
44
+
45
+ BIN_DIR=$(resolve_dir "$(dirname -- "$SELF")")
46
+ PACKAGE_ROOT=$(resolve_dir "$BIN_DIR/..")
47
+
48
+ case "$(uname -s)" in
49
+ Darwin) OS=apple-darwin ;;
50
+ Linux) OS=unknown-linux-gnu ;;
51
+ *) exec node "$BIN_DIR/aurora-node.js" "$@" ;;
52
+ esac
53
+
54
+ case "$(uname -m)" in
55
+ arm64|aarch64) ARCH=aarch64 ;;
56
+ x86_64|amd64) ARCH=x86_64 ;;
57
+ *) exec node "$BIN_DIR/aurora-node.js" "$@" ;;
58
+ esac
59
+
60
+ TARGET="$ARCH-$OS"
61
+ case "$TARGET" in
62
+ aarch64-apple-darwin) NATIVE_PACKAGE="@auroraflow/code-darwin-arm64" ;;
63
+ x86_64-apple-darwin) NATIVE_PACKAGE="@auroraflow/code-darwin-x64" ;;
64
+ aarch64-unknown-linux-gnu) NATIVE_PACKAGE="@auroraflow/code-linux-arm64" ;;
65
+ x86_64-unknown-linux-gnu) NATIVE_PACKAGE="@auroraflow/code-linux-x64" ;;
66
+ *) exec node "$BIN_DIR/aurora-node.js" "$@" ;;
67
+ esac
68
+
69
+ NATIVE_ROOT="$PACKAGE_ROOT/node_modules/$NATIVE_PACKAGE/vendor/$TARGET"
70
+ BINARY="$NATIVE_ROOT/bin/aurora"
71
+ if [ ! -x "$BINARY" ]; then
72
+ NATIVE_ROOT="$PACKAGE_ROOT/vendor/$TARGET"
73
+ BINARY="$NATIVE_ROOT/bin/aurora"
74
+ fi
75
+
76
+ if [ ! -x "$BINARY" ]; then
77
+ exec node "$BIN_DIR/aurora-node.js" "$@"
78
+ fi
79
+
80
+ if [ -z "\${AURORA_HOME+x}" ] || [ -z "$AURORA_HOME" ]; then
81
+ AURORA_HOME="$HOME/.aurora"
82
+ fi
83
+
84
+ export AURORA_HOME
85
+ export CODEX_HOME="$AURORA_HOME"
86
+ export AURORA_MANAGED_BY_NPM=1
87
+ export CODEX_MANAGED_BY_NPM=1
88
+ export AURORA_MANAGED_PACKAGE_ROOT="$PACKAGE_ROOT"
89
+ export CODEX_MANAGED_PACKAGE_ROOT="$PACKAGE_ROOT"
90
+
91
+ if [ -d "$NATIVE_ROOT/aurora-path" ]; then
92
+ PATH="$NATIVE_ROOT/aurora-path:$PATH"
93
+ elif [ -d "$NATIVE_ROOT/path" ]; then
94
+ PATH="$NATIVE_ROOT/path:$PATH"
95
+ fi
96
+ export PATH
97
+
98
+ if [ -t 1 ]; then
99
+ printf '\\033]0;aurora\\007'
100
+ fi
101
+
102
+ exec "$BINARY" "$@"
103
+ `;
104
+
105
+ writeFileSync(entryPath, launcher);
106
+ chmodSync(entryPath, 0o755);