@ricsam/r5d-macos-vm 0.0.133 → 0.0.161

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/README.md CHANGED
@@ -27,7 +27,7 @@ r5d-macos-vm create build-mac \
27
27
  --disk-bytes 85899345920
28
28
  ```
29
29
 
30
- Complete macOS Setup Assistant in the VM, then double-click `/Volumes/My Shared Files/r5d Setup/Install r5d.command`. The shared bootstrap opens a visible Terminal, installs Homebrew and the r5d command-line tools, and starts worker enrollment. On another device, visit `https://r5d.dev/auth` and enter the displayed code, or scan its QR code. The worker starts only after authorization succeeds.
30
+ Complete macOS Setup Assistant in the VM, then double-click `/Volumes/My Shared Files/r5d Setup/Install r5d.command`. It installs development tools and a visible executor launcher. The installation operator must provision the private `~/Library/Application Support/r5d/executor.json` and matching manager, workspace, and network configuration. The launcher invokes `r5d-worker executor` with that file; there is no device-pairing endpoint.
31
31
 
32
32
  Useful commands:
33
33
 
@@ -77,5 +77,5 @@ print
77
77
  touch "$STATE_DIR/bootstrap-complete"
78
78
  chmod 600 "$STATE_DIR/bootstrap-complete"
79
79
  print
80
- print "Tools installed. The visible r5d worker Terminal is opening for authorization and startup…"
80
+ print "Tools installed. The visible r5d worker Terminal is opening for configured executor startup…"
81
81
  print "You may close this setup window."
@@ -1,7 +1,7 @@
1
1
  r5d macOS VM guest setup
2
2
 
3
- After completing macOS Setup Assistant, open “Install r5d.command from this
4
- folder. It installs the development tools, asks you to authorize the worker,
5
- and configures a visible r5d-worker Terminal at each graphical login.
6
-
7
- The installer is idempotent and safe to run again after an interrupted step.
3
+ After completing macOS Setup Assistant, open “Install r5d.command”. It installs
4
+ local tools and a visible executor launcher. The installation operator must
5
+ provision a private executor.json in ~/Library/Application Support/r5d together
6
+ with matching manager, workspace, and private network access configuration.
7
+ The launcher uses that configuration and does not perform device enrollment.
@@ -1,103 +1,13 @@
1
1
  #!/bin/zsh
2
2
  set -euo pipefail
3
-
4
- export PATH="/opt/homebrew/bin:$HOME/.bun/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
3
+ export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
5
4
  STATE_DIR="$HOME/Library/Application Support/r5d"
6
- LOCK_DIR="$STATE_DIR/worker-credential-authority.lock"
7
- BOOT_SESSION_ID="$(/usr/sbin/sysctl -n kern.bootsessionuuid 2>/dev/null | /usr/bin/tr '[:upper:]' '[:lower:]' || true)"
8
- if [[ ! "$BOOT_SESSION_ID" =~ ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$ ]]; then
9
- BOOT_SESSION_ID="unknown"
5
+ CONFIG_FILE="$STATE_DIR/executor.json"
6
+ if [[ ! -f "$CONFIG_FILE" || -L "$CONFIG_FILE" ]]; then
7
+ print -u2 "This VM needs its installation's private executor configuration at: $CONFIG_FILE"
8
+ print -u2 "Have the installation operator provision the executor and its matching workspace and manager services."
9
+ exit 1
10
10
  fi
11
- RECOVERY_GUARD="$STATE_DIR/worker-lock-recovery-$BOOT_SESSION_ID.lock"
12
-
13
- mkdir -p "$STATE_DIR"
14
- chmod 700 "$STATE_DIR"
15
-
16
- while ! mkdir "$LOCK_DIR" 2>/dev/null; do
17
- existing_pid="$(cat "$LOCK_DIR/pid" 2>/dev/null || true)"
18
- if [[ "$existing_pid" == <-> ]] && kill -0 "$existing_pid" 2>/dev/null; then
19
- existing_command="$(ps -ww -p "$existing_pid" -o command= 2>/dev/null || true)"
20
- if [[ -n "$existing_command" && "$existing_command" == *"start-worker.command"* ]]; then
21
- print "An r5d-worker credential authority is already running in another Terminal (PID $existing_pid)."
22
- read -r "?Press Return to close this window: "
23
- exit 0
24
- fi
25
- fi
26
-
27
- # A newly-created lock may not have its PID file yet. Never reap that
28
- # acquisition window; only recover ownerless locks that have stayed stale.
29
- lock_modified_at="$(stat -f %m "$LOCK_DIR" 2>/dev/null || print 0)"
30
- current_epoch="$(date +%s)"
31
- if [[ "$lock_modified_at" == <-> ]] && (( current_epoch - lock_modified_at < 60 )); then
32
- sleep 1
33
- continue
34
- fi
35
-
36
- if ! mkdir "$RECOVERY_GUARD" 2>/dev/null; then
37
- recovery_modified_at="$(stat -f %m "$RECOVERY_GUARD" 2>/dev/null || print 0)"
38
- if [[ "$recovery_modified_at" == <-> ]] && (( current_epoch - recovery_modified_at >= 60 )); then
39
- print "A prior worker-lock recovery was interrupted in this boot session. Reboot the VM before retrying."
40
- read -r "?Press Return to close this window: "
41
- exit 1
42
- fi
43
- sleep 1
44
- continue
45
- fi
46
-
47
- # Re-read under the boot-scoped recovery guard. Without this second check,
48
- # two stale-lock contenders can move a newly acquired live lock (ABA).
49
- guarded_pid="$(cat "$LOCK_DIR/pid" 2>/dev/null || true)"
50
- if [[ "$guarded_pid" == <-> ]] && kill -0 "$guarded_pid" 2>/dev/null; then
51
- guarded_command="$(ps -ww -p "$guarded_pid" -o command= 2>/dev/null || true)"
52
- if [[ -n "$guarded_command" && "$guarded_command" == *"start-worker.command"* ]]; then
53
- rmdir "$RECOVERY_GUARD" 2>/dev/null || true
54
- print "An r5d-worker credential authority is already running in another Terminal (PID $guarded_pid)."
55
- read -r "?Press Return to close this window: "
56
- exit 0
57
- fi
58
- fi
59
- stale_lock="$LOCK_DIR.stale.$$.$RANDOM"
60
- if mv "$LOCK_DIR" "$stale_lock" 2>/dev/null; then
61
- rm -rf "$stale_lock"
62
- fi
63
- rmdir "$RECOVERY_GUARD" 2>/dev/null || true
64
- done
65
-
66
- print $$ > "$LOCK_DIR/pid"
67
- chmod 600 "$LOCK_DIR/pid"
68
- cleanup() { rm -rf "$LOCK_DIR"; }
69
- trap cleanup EXIT INT TERM HUP
70
-
71
- print "Starting r5d-worker (__WORKER_LABEL__)"
72
- print "Keep this Terminal open while the VM is available to r5d.dev."
73
- print
74
-
75
- auth_source="$(r5dctl --json auth status 2>/dev/null | /usr/bin/sed -n 's/.*"source"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' | /usr/bin/head -n 1 || true)"
76
- if [[ "$auth_source" != "device" ]]; then
77
- if [[ -n "$auth_source" ]]; then
78
- print "The shared r5d config currently uses '$auth_source' authentication. This VM requires its own revocable device credential."
79
- print
80
- fi
81
- print "Authorize this VM before its worker starts."
82
- print
83
- r5dctl auth login --no-open --device-name "r5d macOS VM (__VM_NAME__)" --worker-label "__WORKER_LABEL__"
84
- print
85
- fi
86
-
87
- r5d-worker start --label "__WORKER_LABEL__" &
88
- worker_pid=$!
89
- trap 'kill -INT "$worker_pid" 2>/dev/null || true' INT TERM HUP
90
- set +e
91
- wait "$worker_pid"
92
- worker_status=$?
93
- set -e
94
- print
95
- if [[ "$worker_status" == "77" ]]; then
96
- print "r5d-worker staged a credential rotation without publishing the new secret."
97
- print "Shut down and restart the entire r5d macOS VM before opening this launcher again."
98
- print "Closing this window, logging out, or reopening Terminal is not sufficient."
99
- else
100
- print "r5d-worker stopped with status $worker_status."
101
- fi
102
- read -r "?Press Return to close this window: "
103
- exit "$worker_status"
11
+ print "Starting configured r5d executor (__WORKER_LABEL__)"
12
+ print "Keep this Terminal open while this execution service is in use."
13
+ exec r5d-worker executor "$CONFIG_FILE"
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-macos-vm",
3
- "version": "0.0.133",
3
+ "version": "0.0.161",
4
4
  "type": "commonjs"
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-macos-vm",
3
- "version": "0.0.133",
3
+ "version": "0.0.161",
4
4
  "type": "module"
5
5
  }
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "0.0.133",
4
- "url": "https://downloads.r5d.dev/r5d-macos-vm/0.0.133/R5DMacOSVM.app.zip",
5
- "sha256": "551554fac14cdb6588769c2485ef76e8ab1346618967b83c21861bc3551b9487",
6
- "byteLength": 191303,
3
+ "packageVersion": "0.0.161",
4
+ "url": "https://downloads.r5d.dev/r5d-macos-vm/0.0.161/R5DMacOSVM.app.zip",
5
+ "sha256": "4372906f9fed75dc94910adc559ea8e2021573eba755fa0501af63d4b84b1e1d",
6
+ "byteLength": 191297,
7
7
  "archiveName": "R5DMacOSVM.app.zip",
8
8
  "appName": "R5DMacOSVM.app",
9
9
  "executableName": "R5DMacOSVM",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-macos-vm",
3
- "version": "0.0.133",
3
+ "version": "0.0.161",
4
4
  "type": "module",
5
5
  "main": "./dist/cjs/cli.cjs",
6
6
  "module": "./dist/mjs/cli.mjs",