Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

notepat-remote: env-info bridge + closed-door status readout

When the case doors are closed (piece unfocused), the interior now
displays a centered three-row diagnostic overlay:
row 1 — ONLINE · UDP+WS / OFFLINE (session-server transport state)
row 2 — PACKED / LIVE (whether we're in the chunked amxd bundle or
loaded fresh from aesthetic.computer)
row 3 — UPDATE AVAILABLE (only shown if packed and the baked-in
git hash differs from /.commit-ref served by lith)

bios gets a new env-info channel: fetches /.commit-ref on DAW bridge
setup, caches \`{packMode, packGit, packDate, latestCommit}\`, and
pushes to the worker as send({type:"env:info"}) both eagerly and on
\`env:request\` from the piece. disk.mjs dispatches as an act() event
with \`e.env\`.

+117
+41
system/public/aesthetic.computer/bios.mjs
··· 4639 4639 console.log(`🎹 acSetLiveTrackColor ${n} → rgb(${rgb.join(",")})`); 4640 4640 try { send({ type: "live:track-color", content: rgb }); } catch (_e) {} 4641 4641 }; 4642 + 4643 + // 🎹 Env info for the piece — packed vs live, build hash, and the 4644 + // latest commit the server is currently serving (so a packed bundle 4645 + // can know whether its baked-in version is behind). Fetched lazily 4646 + // once then cached — piece asks via send({type:"env:request"}). 4647 + const envInfo = { 4648 + packMode: !!window.acPACK_MODE, 4649 + packGit: window.acPACK_GIT || null, 4650 + packDate: window.acPACK_DATE || null, 4651 + latestCommit: null, 4652 + }; 4653 + let envLatestFetched = false; 4654 + async function _dawFetchLatestCommit() { 4655 + if (envLatestFetched) return; 4656 + envLatestFetched = true; 4657 + try { 4658 + const r = await fetch( 4659 + "https://aesthetic.computer/.commit-ref", 4660 + { cache: "no-cache", mode: "cors" }, 4661 + ); 4662 + if (!r.ok) return; 4663 + const hash = (await r.text()).trim(); 4664 + if (hash) envInfo.latestCommit = hash; 4665 + } catch (_e) { /* offline */ } 4666 + } 4667 + function _dawSendEnvInfo() { 4668 + try { send({ type: "env:info", content: { ...envInfo } }); } catch (_e) {} 4669 + } 4670 + // Kick off the fetch immediately; when it resolves, push to the 4671 + // piece. The piece also re-requests on boot (via env:request) 4672 + // which will re-send whatever we've got. 4673 + _dawFetchLatestCommit().then(_dawSendEnvInfo); 4674 + window.acDawEnvRequest = _dawSendEnvInfo; 4642 4675 } 4643 4676 4644 4677 function requestBeat(time) { ··· 5319 5352 if (type === "daw:request-track-color") { 5320 5353 if (typeof window !== "undefined" && window.max?.outlet) { 5321 5354 try { window.max.outlet("requestTrackColor", 1); } catch (_e) {} 5355 + } 5356 + return; 5357 + } 5358 + // Piece asks bios for the current build env (pack mode, git hash, 5359 + // latest commit on the server for staleness checks). 5360 + if (type === "env:request") { 5361 + if (typeof window !== "undefined" && typeof window.acDawEnvRequest === "function") { 5362 + try { window.acDawEnvRequest(); } catch (_e) {} 5322 5363 } 5323 5364 return; 5324 5365 }
+56
system/public/aesthetic.computer/disks/notepat-remote.mjs
··· 106 106 // middle). Lerps each paint toward the focus target. 107 107 let doorPhase = 0; 108 108 109 + // Build env from bios (populated via e.is("env:info"). null until the 110 + // bridge pushes the info, then: 111 + // { packMode, packGit, packDate, latestCommit } 112 + let envInfo = null; 113 + 109 114 // Live track color, pushed in by the Max patcher via 110 115 // `window.acSetLiveTrackColor(int)` once `live.observer` resolves the 111 116 // device's parent track. Null until that lands; paint falls back to the ··· 234 239 // because their initial fires can land before we've mounted. 235 240 send({ type: "daw:request-focus" }); 236 241 send({ type: "daw:request-track-color" }); 242 + send({ type: "env:request" }); 237 243 // Also open AC's session-scoped socket + udp purely so the transport 238 244 // status indicator can show UDP connectivity. Callbacks are no-ops — 239 245 // the notepat:midi subscription flows through the raw WS above. ··· 325 331 if (Array.isArray(rgb) && rgb.length === 3) { 326 332 liveTrackColor = rgb.slice(); 327 333 console.log(`[track-color] received rgb(${rgb.join(",")})`); 334 + } 335 + return; 336 + } 337 + 338 + // Build env info from bios (packed vs live + version). 339 + if (e.is("env:info")) { 340 + envInfo = e.env || null; 341 + if (envInfo) { 342 + console.log( 343 + `[env] packMode=${envInfo.packMode} packGit=${(envInfo.packGit || "").slice(0, 9)} latest=${(envInfo.latestCommit || "").slice(0, 9)}`, 344 + ); 328 345 } 329 346 return; 330 347 } ··· 710 727 if (doorW > 0) { 711 728 ink(...chrome).line(doorW - 1, 0, doorW - 1, H - 1); 712 729 ink(...chrome).line(W - doorW, 0, W - doorW, H - 1); 730 + } 731 + 732 + // Once doors are nearly closed, display the piece's diagnostic 733 + // readout on top of them: transport online state + build mode + 734 + // staleness hint if the packed amxd is behind the live commit. 735 + if (doorPhase > 0.85) { 736 + const readoutAlpha = floor((doorPhase - 0.85) / 0.15 * 255); 737 + const udpOk = !!netUdp?.connected; 738 + const wsOk = wsState === "open"; 739 + const online = udpOk || wsOk; 740 + const transportLine = online 741 + ? (udpOk && wsOk ? "ONLINE · UDP+WS" : udpOk ? "ONLINE · UDP" : "ONLINE · WS") 742 + : "OFFLINE"; 743 + const transportColor = online ? [130, 230, 160] : [255, 110, 110]; 744 + const modeLine = envInfo 745 + ? (envInfo.packMode ? "PACKED" : "LIVE") 746 + : "…"; 747 + const stale = envInfo && envInfo.packMode && envInfo.packGit && 748 + envInfo.latestCommit && envInfo.packGit !== envInfo.latestCommit; 749 + 750 + // Centered three-row readout, MatrixChunky8 keeps it legible at W≈150. 751 + const lineH = 9; 752 + const totalH = stale ? lineH * 3 + 4 : lineH * 2 + 2; 753 + let ty = floor((H - totalH) / 2); 754 + const writeCentered = (text, color, font) => { 755 + const charW = font === "MatrixChunky8" ? 5 : 6; 756 + const tx = floor((W - text.length * charW) / 2); 757 + ink(...color, readoutAlpha).write( 758 + text, { x: tx, y: ty }, 759 + undefined, undefined, false, font, 760 + ); 761 + ty += lineH; 762 + }; 763 + writeCentered(transportLine, transportColor, "MatrixChunky8"); 764 + writeCentered(modeLine, chrome, "MatrixChunky8"); 765 + if (stale) { 766 + ty += 2; 767 + writeCentered("UPDATE AVAILABLE", [255, 180, 90], "MatrixChunky8"); 768 + } 713 769 } 714 770 } 715 771
+20
system/public/aesthetic.computer/lib/disk.mjs
··· 10715 10715 } 10716 10716 } 10717 10717 10718 + // Build env info from bios: { packMode, packGit, packDate, latestCommit } 10719 + // Piece reads e.env in act() to know whether it's in the packed offline 10720 + // bundle or the live URL, and whether its build hash matches the latest 10721 + // the server is serving (for an "update available" nudge). 10722 + if (type === "env:info") { 10723 + if (!cachedAPI) return; 10724 + const $api = cachedAPI; 10725 + const data = { 10726 + device: "env", 10727 + env: content, 10728 + is: (e) => e === "env:info", 10729 + }; 10730 + $api.event = data; 10731 + try { 10732 + act($api); 10733 + } catch (e) { 10734 + console.warn("️ ✒ Act failure (env:info)", e); 10735 + } 10736 + } 10737 + 10718 10738 if (type === "visibility-change") { 10719 10739 // 🧨 Just in case of a regression... 23.06.02.21.12 10720 10740 // Because the `bios` focus event changed from visibility behavior.
system/public/m4l/notepat.com.amxd

This is a binary file and will not be displayed.