From 9052f1731b108a8b49f1924b8886213b99d697f1 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Wed, 15 Jul 2026 13:33:49 -0700 Subject: [PATCH] Fix ac-host vault discovery --- .devcontainer/config.fish | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/.devcontainer/config.fish b/.devcontainer/config.fish index 61c84741b9..d046238c4f 100644 --- a/.devcontainer/config.fish +++ b/.devcontainer/config.fish @@ -3203,18 +3203,33 @@ end # 🖥️ Machine Info / SSH Helpers # Read machine configs from vault/machines.json -function __ac_machines_file --description "Resolve machines.json with local cache fallback" - set -l machines_file "/workspaces/aesthetic-computer/aesthetic-computer-vault/machines.json" - set -l machines_cache "$HOME/.cache/ac/machines.json" - - if test -f $machines_file - mkdir -p (dirname $machines_cache) - cp $machines_file $machines_cache 2>/dev/null - echo $machines_file - return 0 - end - - if test -f $machines_cache +function __ac_machines_file --description "Resolve machines.json with local cache fallback" + set -l machines_cache "$HOME/.cache/ac/machines.json" + + # The vault is a sibling checkout in the devcontainer, but lives inside + # the repo on native Macs. Prefer explicit environment configuration and + # then try both supported layouts so ac-host works in either environment. + set -l candidates + if set -q AESTHETIC_VAULT + set -a candidates "$AESTHETIC_VAULT/machines.json" + end + if set -q AC_ROOT + set -a candidates "$AC_ROOT/aesthetic-computer-vault/machines.json" + end + set -a candidates \ + "/workspaces/aesthetic-computer/aesthetic-computer-vault/machines.json" \ + "$HOME/aesthetic-computer/aesthetic-computer-vault/machines.json" + + for machines_file in $candidates + if test -f $machines_file + mkdir -p (dirname $machines_cache) + cp $machines_file $machines_cache 2>/dev/null + echo $machines_file + return 0 + end + end + + if test -f $machines_cache echo $machines_cache return 0 end -- 2.51.2