@jian-ai/remote-control 0.7.2 → 0.8.1

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.
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env bash
2
+ # Build a universal (arm64 + x86_64) computer-helper for the npm package.
3
+ # Run on macOS with Xcode CLT. Used by Publish CI and local packaging.
4
+ set -euo pipefail
5
+
6
+ ROOT="$(cd "$(dirname "$0")" && pwd)"
7
+ SRC="$ROOT/computer-helper.swift"
8
+ OUT="${1:-$ROOT/computer-helper}"
9
+ MIN_OS="${MACOSX_DEPLOYMENT_TARGET:-13.0}"
10
+ TMP="$(mktemp -d "${TMPDIR:-/tmp}/jian-computer-helper.XXXXXX")"
11
+ cleanup() { rm -rf "$TMP"; }
12
+ trap cleanup EXIT
13
+
14
+ if [[ "$(uname -s)" != "Darwin" ]]; then
15
+ echo "build-helper.sh must run on macOS (swiftc + lipo)." >&2
16
+ exit 1
17
+ fi
18
+ if ! command -v swiftc >/dev/null 2>&1; then
19
+ echo "swiftc not found. Install Xcode Command Line Tools." >&2
20
+ exit 1
21
+ fi
22
+ if [[ ! -f "$SRC" ]]; then
23
+ echo "Missing source: $SRC" >&2
24
+ exit 1
25
+ fi
26
+
27
+ swiftc -O \
28
+ -target "arm64-apple-macosx${MIN_OS}" \
29
+ -framework AppKit -framework Carbon \
30
+ -o "$TMP/computer-helper-arm64" "$SRC"
31
+
32
+ swiftc -O \
33
+ -target "x86_64-apple-macosx${MIN_OS}" \
34
+ -framework AppKit -framework Carbon \
35
+ -o "$TMP/computer-helper-x86_64" "$SRC"
36
+
37
+ lipo -create -output "$OUT" "$TMP/computer-helper-arm64" "$TMP/computer-helper-x86_64"
38
+ chmod 755 "$OUT"
39
+
40
+ # Ad-hoc sign so Gatekeeper is quieter for LaunchAgent children; Developer ID overlays this in CI when secrets exist.
41
+ if command -v codesign >/dev/null 2>&1; then
42
+ codesign --force -s - --identifier com.jian.remote.computer-helper "$OUT" 2>/dev/null || true
43
+ fi
44
+
45
+ echo "Built universal helper: $OUT"
46
+ lipo -info "$OUT"
Binary file