Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: ac-usb flash fetches AC auth token for chat + API access

Calls device-token API with handle to get the AC auth token.
Writes it to config.json as 'token' so chat and other API
calls work immediately after boot.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+9 -1
+9 -1
fedac/native/ac-usb
··· 166 166 GITHUB_PAT=$(grep 'oauth_token:' "${HOME}/.config/gh/hosts.yml" 2>/dev/null | head -1 | awk '{print $2}' || true) 167 167 fi 168 168 [ -z "${GITHUB_PAT}" ] && GITHUB_PAT="${GH_TOKEN:-${GITHUB_TOKEN:-}}" 169 + # AC auth token: fetch from device-token API using handle 170 + AC_TOKEN="" 171 + if [ -n "${HANDLE}" ]; then 172 + AC_TOKEN=$(curl -s "https://aesthetic.computer/.netlify/functions/device-token?handle=${HANDLE}" 2>/dev/null \ 173 + | node -e "let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{try{const j=JSON.parse(d);process.stdout.write(j.token||'')}catch{}})" 2>/dev/null || true) 174 + [ -n "${AC_TOKEN}" ] && echo " AC auth token: yes (${#AC_TOKEN} chars)" 175 + fi 169 176 # Always write config.json with at least the handle 170 177 CONFIG_JSON=$(node -e " 171 - const c = {handle: '${HANDLE}'}; 178 + const c = {handle: '${HANDLE}', piece: 'notepat'}; 172 179 if ('${CLAUDE_TOKEN}') c.claudeToken = '${CLAUDE_TOKEN}'; 173 180 if ('${GITHUB_PAT}') c.githubPat = '${GITHUB_PAT}'; 181 + if ('${AC_TOKEN}') c.token = '${AC_TOKEN}'; 174 182 process.stdout.write(JSON.stringify(c)); 175 183 " 2>/dev/null || true) 176 184 if [ -z "${CONFIG_JSON}" ]; then