Compare commits

..
Author SHA1 Message Date
SAPHID 587a7fc8c3 Render React content in Framey panel toasts 2026-10-26 00:06:00 +00:00
Alex Southwell 081d133084 Merge pull request #257 from saphid/test/framey-css-sgdb
Framey: pin CSS Loader and SteamGridDB compatibility checks
2026-10-26 00:00:41 +00:00
Alex Southwell 94e050d5a0 Merge pull request #263 from saphid/feat/framey-safe-ui-shims
Expand isolated Framey controls and cache fallbacks
2026-10-25 23:50:11 +00:00
Alex Southwell cd6ecf073f Merge pull request #265 from saphid/fleet/n781xzqt5q
Verify Framey in unworn VR and fix live settings and reopen bugs
2026-10-25 23:48:49 +00:00
SAPHID 3d6bd463ce Merge remote-tracking branch 'origin/test/framey-css-sgdb' into test/framey-css-sgdb 2026-10-25 23:39:17 +00:00
SAPHID 981173a1f2 Merge remote-tracking branch 'origin/main' into test/framey-css-sgdb
# Conflicts:
#	tests/e2e/test_framey.py
2026-10-25 23:38:57 +00:00
SAPHID 9146234758 Merge remote-tracking branch 'origin/main' into fix/pr263-main-sync 2026-10-25 23:35:28 +00:00
SAPHID c6e54041e0 Merge remote-tracking branch 'origin/main' into fix/pr257-main-sync
# Conflicts:
#	tests/e2e/test_framey.py
2026-10-25 23:33:05 +00:00
SAPHID e67a90b397 Record real Framey VR evidence and restored device state 2026-10-25 23:31:50 +00:00
Alex Southwell 91f60c26e3 Merge pull request #261 from saphid/fleet/kp0z857q58
Framey: support legacy Decky panels and keyword RPC
2026-10-25 23:31:28 +00:00
SAPHID cb9ad1b6cb Drain stale mirror frames and record native scroll delivery 2026-10-25 23:27:34 +00:00
SAPHID 285871bc39 Add locked unattended Framey VR capture and native input checks 2026-10-25 23:25:07 +00:00
SAPHID 779f9c5a53 Preserve coordinator sync of legacy bridge 2026-10-25 23:24:32 +00:00
SAPHID 43112f5143 Merge current main and preserve parameterized routes 2026-10-25 23:24:01 +00:00
SAPHID 0e6c00525d Expand isolated Framey controls and cache fallbacks 2026-10-25 23:23:47 +00:00
SAPHID 416c574240 Merge remote-tracking branch 'origin/main' into fleet/n781xzqt5q 2026-10-25 23:22:33 +00:00
Alex Southwell d77e2bd056 Merge pull request #260 from saphid/docs/framey-route-sample
Framey: demonstrate local routes in author sample
2026-10-25 23:21:51 +00:00
Alex Southwell 2a6736a02c Merge pull request #258 from saphid/docs/v0436-smoke-evidence
Record v0.4.36 real Frame smoke evidence
2026-10-25 23:20:31 +00:00
Alex Southwell c8ef81ad93 Merge pull request #259 from saphid/fix/framey-store-stale-list
Framey: clear stale store choices during refresh
2026-10-25 23:17:09 +00:00
SAPHID e529d60554 Merge remote-tracking branch 'origin/main' into fix/pr261-main-sync
# Conflicts:
#	tests/page/framey_actions.mjs
2026-10-25 23:16:34 +00:00
SAPHID e9273beaa1 Keep CSS Loader fixture neutral about legacy panel support 2026-10-25 23:16:00 +00:00
SAPHID 48b404bc3b Merge remote-tracking branch 'origin/main' into fleet/n781xzqt5q 2026-10-25 23:14:50 +00:00
SAPHID aeb991bc1c Fix Framey sample settings path and same-plugin reopen 2026-10-25 23:14:50 +00:00
Alex Southwell 63820d1909 Merge pull request #256 from saphid/feat/framey-steamgriddb
Framey: support local plugin routes with parameters
2026-10-25 23:12:51 +00:00
SAPHID 1aaa3c8c06 Support legacy Decky panels and keyword backend calls 2026-10-25 23:12:28 +00:00
SAPHID be18ed1a8b Show local route navigation in Framey author sample 2026-10-25 23:11:01 +00:00
SAPHID 3f4aaf539c Clear stale Framey store listings during refresh 2026-10-25 23:09:14 +00:00
SAPHID 3acc2d91e6 Record v0.4.36 real Frame release smoke 2026-10-25 23:08:07 +00:00
SAPHID 0867debebd Pin CSS Loader and SteamGridDB store compatibility cases 2026-10-25 23:07:09 +00:00
SAPHID e400cb1dcf Support local Framey routes with named parameters 2026-10-25 23:04:02 +00:00
Alex Southwell 1701e622dc Merge pull request #255 from saphid/release/v0.4.36
Prepare Frame Control v0.4.36
2026-10-25 22:58:26 +00:00
SAPHID 31edf6b737 Prepare Frame Control v0.4.36 2026-10-25 22:49:34 +00:00
Alex Southwell 005ad9b71d Merge pull request #253 from saphid/fix/framey-store-version-race
Reject store versions changed after review
2026-10-25 22:48:38 +00:00
Alex Southwell aaf2668882 Merge pull request #252 from saphid/test/framey-bluetooth-store
Provide Steam token fallbacks for Bluetooth panel
2026-10-25 22:39:14 +00:00
Alex Southwell cfb0310e9b Merge pull request #254 from saphid/fix/appimage-smoke-isolation
Isolate AppImage release smoke state
2026-10-25 22:32:18 +00:00
SAPHID 493ab35635 Keep stale version check within existing store flow 2026-10-25 22:29:45 +00:00
SAPHID 313d1ec9c8 Merge shipped HLTB support into Bluetooth compatibility 2026-10-25 22:25:48 +00:00
SAPHID 6ee7bacc47 Merge remote-tracking branch 'origin/main' into fix/appimage-smoke-isolation 2026-10-25 22:23:50 +00:00
SAPHID 027bbfa701 Isolate AppImage smoke network and extraction state 2026-10-25 22:23:49 +00:00
SAPHID 0f8d69a263 Use readable Bluetooth label fallbacks 2026-10-25 22:22:44 +00:00
Alex Southwell 2a9d4f886e Merge pull request #251 from saphid/feat/framey-hltb-compat
Extend Framey shim for HLTB settings panel
2026-10-25 22:22:27 +00:00
SAPHID 34cd35056b Reject store versions changed after review 2026-10-25 22:20:44 +00:00
Alex Southwell 734cd4f36c Merge pull request #250 from saphid/test/appimage-launch-ci
Smoke test the Linux AppImage in release CI
2026-10-25 22:20:18 +00:00
SAPHID 44ca81f527 Provide Steam token fallbacks for Bluetooth panel 2026-10-25 22:17:12 +00:00
SAPHID 3e5349ec39 Extend Framey shim for HLTB settings panel 2026-10-25 22:14:11 +00:00
SAPHID 3c184f5741 Smoke test packaged Linux AppImage in release CI 2026-10-25 22:10:57 +00:00
Alex Southwell 93bffc21d7 Merge pull request #249 from saphid/release/v0.4.35
Prepare Frame Control v0.4.35
2026-10-25 21:50:02 +00:00
SAPHID 8423a309ff Document API v1 Framey limits for v0.4.35 2026-10-25 21:42:29 +00:00
SAPHID 698a3b11d9 Merge remote-tracking branch 'origin/main' into release/v0.4.35 2026-10-25 21:42:13 +00:00
Alex Southwell 5952bf8e9d Merge pull request #247 from saphid/feat/framey-api-v1-panels
Host modern Decky API v1 plugin panels in Framey
2026-10-25 21:41:58 +00:00
SAPHID d186dfbc60 Merge remote-tracking branch 'origin/main' into feat/framey-api-v1-panels
# Conflicts:
#	docs/frame-plugin-author.md
#	docs/framey-loader.md
2026-10-25 21:33:37 +00:00
SAPHID c7e76fdd64 Document v0.4.35 Framey coverage limits 2026-10-25 21:33:29 +00:00
SAPHID 559eec96b3 Merge remote-tracking branch 'origin/main' into release/v0.4.35 2026-10-25 21:32:22 +00:00
Alex Southwell 020f93a187 Merge pull request #248 from saphid/docs/framey-sample-panels
Show Framey settings and quick action in author sample
2026-10-25 21:32:00 +00:00
Alex Southwell 69a912cc7d Merge pull request #245 from saphid/feat/framey-plugin-cache
Persist bounded Framey plugin cache across panel reopen
2026-10-25 21:31:53 +00:00
SAPHID aa6078c11a Keep fake Frame store test scoped to remote installs 2026-10-25 21:31:01 +00:00
SAPHID 01d1fba915 Merge remote-tracking branch 'origin/main' into release/v0.4.35 2026-10-25 21:28:14 +00:00
Alex Southwell e89ff39cff Merge pull request #246 from saphid/fix/framey-store-catalog-edges
Handle root tags and ambiguous Decky store IDs
2026-10-25 21:27:24 +00:00
SAPHID 4cfbd5883f Merge remote-tracking branch 'origin/main' into feat/framey-api-v1-panels
# Conflicts:
#	docs/framey-loader.md
2026-10-25 21:25:09 +00:00
SAPHID 33fdd9d296 Show Framey settings and quick action in author sample 2026-10-25 21:23:09 +00:00
SAPHID 45bd789cb7 Reconcile Framey cache bridge with session shim 2026-10-25 21:21:13 +00:00
SAPHID 1db65d6c82 Merge remote-tracking branch 'origin/main' into feat/framey-plugin-cache 2026-10-25 21:20:22 +00:00
SAPHID 6b6ec64381 Host modern Decky API v1 plugin panels in Framey 2026-10-25 21:20:14 +00:00
SAPHID 1e9aa42282 Prepare Frame Control v0.4.35 2026-10-25 21:19:04 +00:00
Alex Southwell 1e69ca4194 Merge pull request #244 from saphid/fix/framey-session-cache
Give isolated Framey panels a session cache
2026-10-25 21:17:49 +00:00
SAPHID 8296657a45 Handle root tags and ambiguous Decky store IDs 2026-10-25 21:13:56 +00:00
SAPHID 2b2d72ac9a Persist bounded Framey plugin cache across panel reopen 2026-10-25 21:12:30 +00:00
SAPHID fe4e09032d Provide session cache to isolated Framey panels 2026-10-25 21:09:45 +00:00
Alex Southwell 1356ea4df1 Merge pull request #243 from saphid/docs/framey-steam-status-browser
Record local Steam Status Framey frontend result
2026-10-25 11:04:33 +00:00
SAPHID c79ba7571f Record local Steam Status Framey frontend check 2026-10-25 10:55:46 +00:00
Alex Southwell 76dcd0c426 Merge pull request #242 from saphid/release/v0.4.34
Prepare Frame Control v0.4.34
2026-10-25 10:43:24 +00:00
SAPHID f668a10982 Prepare Frame Control v0.4.34 release 2026-10-25 10:35:56 +00:00
Alex Southwell 29f2f57bc0 Merge pull request #236 from saphid/feat/framey-ui-controls
Support more Decky settings controls in Framey
2026-10-25 10:35:17 +00:00
Alex Southwell a257ec0bf9 Merge pull request #241 from saphid/docs/framey-official-api-audit
Document official Decky frontend compatibility by manifest
2026-10-25 10:31:17 +00:00
Alex Southwell 99504554e0 Merge pull request #240 from saphid/feat/framey-sample-recovery
Recover Framey sample settings from damaged data
2026-10-25 10:28:41 +00:00
Alex Southwell b53293eddd Merge pull request #239 from saphid/feat/framey-zip-collisions
Reject colliding Decky plugin ZIP paths
2026-10-25 10:23:20 +00:00
Alex Southwell 229f17696e Merge pull request #238 from saphid/feat/framey-official-fixtures
Test official Decky plugin archives in fake Frame
2026-10-25 10:22:58 +00:00
SAPHID f6a88f1a51 Merge remote-tracking branch 'origin/main' into feat/framey-ui-controls
# Conflicts:
#	docs/frame-plugin-author.md
#	tests/page/framey_actions.mjs
#	ui/framey-host.js
2026-10-25 10:19:20 +00:00
Alex Southwell b7caa7d7d3 Merge pull request #237 from saphid/fix/framey-disabled-controls
Honor disabled state in Framey plugin controls
2026-10-25 10:18:09 +00:00
SAPHID a61dfdd3ab Recover sample Decky settings from damaged data 2026-10-25 10:17:29 +00:00
SAPHID 840f53f032 Reject colliding Decky plugin ZIP paths 2026-10-25 10:16:03 +00:00
SAPHID 5932b6a8a4 Document official Decky frontend API compatibility audit 2026-10-25 10:15:48 +00:00
SAPHID 3f2e32db87 Test pinned official Decky plugins in fake Frame 2026-10-25 10:14:14 +00:00
SAPHID a6a1e0b258 Honor disabled state in Framey plugin controls 2026-10-25 10:09:57 +00:00
SAPHID db74e3be96 Support more Decky panel controls in Framey 2026-10-25 10:09:56 +00:00
Alex SouthwellandSAPHID faf7bc6224 Prepare Frame Control 0.4.33 (#235)
* Prepare Frame Control 0.4.33

* Record Framey sample and Decky recovery limits

---------

Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 09:51:10 +00:00
Alex SouthwellandSAPHID 289a971c90 Add Decky settings sample for Framey plugin authors (#233)
* Provide Decky automatic JSX runtime in Framey panel

* Add Decky settings sample for Framey authors

* Use official Decky settings path in sample backend

---------

Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 09:39:01 +00:00
Alex SouthwellandSAPHID f2f6085887 Allow Decky plugin removal when loader is stopped (#234)
* Allow safe Decky plugin removal when loader is stopped

* Stop failed Decky unit before recovery removal

---------

Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 09:34:39 +00:00
Alex SouthwellandSAPHID d1541099b8 Clear stale Framey job IDs after app restart (#232)
Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 09:30:52 +00:00
Alex SouthwellandSAPHID 0440959834 Provide Decky automatic JSX runtime in Framey panel (#231)
Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 09:26:47 +00:00
Alex SouthwellandSAPHID 482d031a18 Serialize managed Decky changes across desktop and headset (#230)
Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 09:24:48 +00:00
Alex SouthwellandSAPHID 20a5ced63d Test Framey settings persistence across plugin lifecycle (#229)
Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 09:20:19 +00:00
Alex SouthwellandSAPHID 02fe664583 Prepare Frame Control 0.4.32 (#228)
Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 08:06:51 +00:00
Alex SouthwellandSAPHID e2ffcd34f3 Support Decky panel routes and toasts in Framey (#227)
* Host Decky plugin panels in Frame Control VR

* Record Framey VR verification limits

* Lock Frame before worn checks and clean private captures

* Browse and search the full Decky store in VR

* Show Decky plugin job progress in VR

* Show plugin quick actions and settings in Framey panel

* Add local Decky routes and toasts to Framey

---------

Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 07:56:38 +00:00
Alex SouthwellandSAPHID 2002b9d70e Show Decky plugin quick actions and settings in VR (#226)
* Host Decky plugin panels in Frame Control VR

* Record Framey VR verification limits

* Lock Frame before worn checks and clean private captures

* Browse and search the full Decky store in VR

* Show Decky plugin job progress in VR

* Show plugin quick actions and settings in Framey panel

---------

Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 07:46:32 +00:00
Alex SouthwellandSAPHID 9b86264813 Show Decky plugin install progress and errors in VR (#225)
* Host Decky plugin panels in Frame Control VR

* Record Framey VR verification limits

* Lock Frame before worn checks and clean private captures

* Browse and search the full Decky store in VR

* Show Decky plugin job progress in VR

---------

Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 07:38:25 +00:00
Alex SouthwellandSAPHID ba97a67580 Browse and search Decky store in VR (#224)
* Host Decky plugin panels in Frame Control VR

* Record Framey VR verification limits

* Lock Frame before worn checks and clean private captures

* Browse and search the full Decky store in VR

---------

Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 07:28:23 +00:00
Alex SouthwellandSAPHID c7a17478a3 Host Decky plugin panels in Frame Control VR (#223)
* Host Decky plugin panels in Frame Control VR

* Record Framey VR verification limits

* Lock Frame before worn checks and clean private captures

---------

Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 07:16:05 +00:00
Alex SouthwellandSAPHID a625800d62 Bump Frame Control to 0.4.31 (#222)
Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 07:04:38 +00:00
Alex SouthwellandSAPHID f0f39ac823 Prepare Frame Control 0.4.31 and record round-two validation (#221)
* Prepare Frame Control 0.4.31 with round-two validation

* State the x86 Linux runtime limit in smoke evidence

---------

Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 06:54:03 +00:00
Alex SouthwellandSAPHID 1252ecc7af Add read-only large status screen to headset panel (#220)
Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 06:46:01 +00:00
Alex SouthwellandSAPHID 7b53af1c18 Fix OBS lifecycle cleanup and validate real headset capture (#219)
Co-authored-by: SAPHID <saphid@users.noreply.github.com>
2026-10-25 06:42:11 +00:00
109 changed files with 7506 additions and 173 deletions

No files matched your search

+6 -1
View File
@@ -46,7 +46,7 @@ jobs:
python ui/frame_wireless_doctor.py --json > "$RUNNER_TEMP/linux-wireless-doctor.json"
python -c 'import json, os; from pathlib import Path; d=json.loads((Path(os.environ["RUNNER_TEMP"]) / "linux-wireless-doctor.json").read_text()); assert d["supported"] and d["selected"] is None and d["schema"] == 1'
- name: App syntax
run: node --check app/main.js && node --check app/build/make-icon.js && node --check app/build/fetch-deps.js && node --check app/preload.js && node --check app/install-link.js && node --check app/updater.js
run: node --check app/main.js && node --check app/obs-source.js && node --check app/build/make-icon.js && node --check app/build/fetch-deps.js && node --check app/preload.js && node --check app/install-link.js && node --check app/updater.js
- name: App tests
run: node --test app/test/*.test.js
- name: Website
@@ -71,6 +71,11 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/setup-node@v4
with:
node-version: "24"
- name: OBS lifecycle tests
run: node app/test/obs-source.test.js
- name: Server tests
run: python -m unittest discover -s tests -v
+4 -1
View File
@@ -10,7 +10,7 @@ on:
push:
tags: ["v*"]
pull_request:
paths: ["app/**", "desktop/**", "mac/frame-mac-view/**", ".github/workflows/release.yml"]
paths: ["app/**", "desktop/**", "mac/frame-mac-view/**", "scripts/check-appimage-launch.py", ".github/workflows/release.yml"]
workflow_dispatch:
# A newer push to the same pull request supersedes a build still in progress.
@@ -110,6 +110,9 @@ jobs:
run: npm ci && npm run ${{ matrix.script }}
env:
CSC_IDENTITY_AUTO_DISCOVERY: "false"
- name: Launch the built Linux AppImage
if: matrix.os == 'ubuntu-latest'
run: python3 scripts/check-appimage-launch.py app/dist/Frame-Control-linux-x86_64.AppImage
# The installer, not just the unpacked build: its 7-Zip payload once dropped
# the OpenXR layer's arm64 library without any error. Install it silently
# and compare every installed file with the unpacked build.
+24 -53
View File
@@ -311,57 +311,28 @@ ipcMain.handle("update:install", (e) => { if (fromUi(e)) installUpdate(); });
// pipe lets it stop SSH on every platform, including Windows where SIGTERM
// terminates Python without running its cleanup block.
const OBS_SCRIPT = path.join(SCRIPTS, "obs-headset-source.py");
let obsChild = null;
let obsState = { state: "idle", alias: "", error: "" };
function publicObs() { return { ...obsState, supported: true }; }
function setObs(state, alias = "", error = "") {
obsState = { state, alias, error };
if (win && !win.isDestroyed()) win.webContents.send("obs:state", publicObs());
return publicObs();
}
function stopObs() {
if (!obsChild) return publicObs();
setObs("stopping", obsState.alias);
if (obsChild.stdin && !obsChild.stdin.writableEnded) obsChild.stdin.end();
return publicObs();
}
ipcMain.handle("obs:status", (e) => fromUi(e) ? publicObs() : null);
ipcMain.handle("obs:start", async (e) => {
if (!fromUi(e)) return null;
if (obsChild) return publicObs();
const alias = activeAlias();
if (!ALIAS_RE.test(alias)) throw new Error("Select a valid headset first.");
if (!fs.existsSync(OBS_SCRIPT)) throw new Error("The OBS helper is missing; reinstall Frame Control.");
const env = { ...process.env, PATH: await loginPath() };
const executable = python || await findPython(env);
if (!executable) throw new Error(PYTHON_HELP);
// A concurrent click or a headset switch may have happened while finding Python.
if (obsChild) return publicObs();
if (alias !== activeAlias()) throw new Error("The selected headset changed; try again.");
const child = spawn(executable, [...PY_FLAGS, OBS_SCRIPT, "--frame", alias, "--control-stdin"],
{ env, stdio: ["pipe", "ignore", "pipe"], windowsHide: true });
obsChild = child;
setObs("starting", alias);
let output = "";
child.stderr.on("data", (chunk) => {
output = (output + chunk.toString("utf8")).slice(-2048);
if (obsChild === child && output.includes("Frame Control OBS stream is ready")) setObs("running", alias);
});
child.once("error", (err) => {
if (obsChild !== child) return;
obsChild = null;
setObs("failed", alias, `Could not start OBS source: ${err.message}`);
});
child.once("exit", (code, signal) => {
if (obsChild !== child) return;
const stopping = obsState.state === "stopping" || quitting;
obsChild = null;
setObs(stopping ? "idle" : "failed", alias,
stopping ? "" : `OBS source stopped (${signal || code}). ${output.trim().split("\n").pop() || "Check SteamVR and SSH."}`);
});
return publicObs();
const { createObsSource } = require("./obs-source");
const obsSource = createObsSource({
spawn,
// Keep the button hidden until native Windows/Frame streaming is verified.
supported: !IS_WIN,
prepare: async alias => {
if (!fs.existsSync(OBS_SCRIPT)) throw new Error("The OBS helper is missing; reinstall Frame Control.");
const env = { ...process.env, PATH: await loginPath() };
const executable = python || await findPython(env);
if (!executable) throw new Error(PYTHON_HELP);
if (quitting || alias !== activeAlias()) throw new Error("The selected headset changed; try again.");
return { executable, args: [...PY_FLAGS, OBS_SCRIPT], env };
},
onState: state => {
if (win && !win.isDestroyed()) win.webContents.send("obs:state", state);
},
});
ipcMain.handle("obs:stop", (e) => fromUi(e) ? stopObs() : null);
const publicObs = () => obsSource.status();
const stopObs = () => obsSource.stop();
ipcMain.handle("obs:status", e => fromUi(e) ? publicObs() : null);
ipcMain.handle("obs:start", (e, port) => fromUi(e) ? obsSource.start(activeAlias(), port) : null);
ipcMain.handle("obs:stop", e => fromUi(e) ? stopObs() : null);
// The page reports the headsets it knows (the server's Devices tab), so the Frame
// menu can switch between them. Only plain names and ids go into the menu.
@@ -373,7 +344,7 @@ ipcMain.on("devices:changed", (e, list) => {
.map(d => ({ id: d.id.slice(0, 80), name: String(d.name || d.alias).slice(0, 60), alias: d.alias, active: !!d.active }));
if (JSON.stringify(next) === JSON.stringify(devices)) return;
devices = next;
if (obsChild && obsState.alias !== activeAlias()) stopObs();
if (obsSource.status().alias && obsSource.status().alias !== activeAlias()) stopObs();
buildMenu();
});
const activeAlias = () => (devices.find(d => d.active) || {}).alias || FRAME;
@@ -765,11 +736,11 @@ if (!app.requestSingleInstanceLock()) {
app.on("before-quit", (event) => {
quitting = true;
stopServer();
if (!obsChild || obsQuitReady) return;
if (!obsSource.child || obsQuitReady) { stopObs(); return; }
event.preventDefault();
if (obsQuitWaiting) return;
obsQuitWaiting = true;
const child = obsChild;
const child = obsSource.child;
let timer;
child.once("close", () => {
clearTimeout(timer);
+59
View File
@@ -0,0 +1,59 @@
// Own one Python relay. Async preparation can be cancelled before a process exists.
const ALIAS = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
function createObsSource({ prepare, spawn, onState = () => {}, supported = true }) {
let child = null, attempt = 0;
let state = { state: 'idle', alias: '', port: 15099, error: '', supported };
const status = () => ({ ...state });
function set(next, alias = state.alias, port = state.port, error = '') {
state = { state: next, alias, port, error, supported };
onState(status()); return status();
}
function stop() {
++attempt;
if (!child) return set('idle');
set('stopping');
if (child.stdin && !child.stdin.writableEnded) child.stdin.end();
return status();
}
async function start(alias, port = 15099) {
if (!supported) return status();
if (!ALIAS.test(alias || '')) throw new Error('Select a valid headset first.');
if (!Number.isInteger(port) || port < 1024 || port > 65535) throw new Error('OBS port must be a whole number from 1024 to 65535.');
if (child || state.state === 'starting') return status();
const id = ++attempt;
set('starting', alias, port);
try {
const { executable, args = [], env } = await prepare(alias);
if (id !== attempt) return status();
const proc = spawn(executable, [...args, '--frame', alias, '--port', String(port), '--control-stdin'],
{ env, stdio: ['pipe', 'ignore', 'pipe'], windowsHide: true });
child = proc;
// The helper may exit between a click and closing its control pipe.
proc.stdin.on('error', () => {});
let output = '';
proc.stderr.on('data', chunk => {
output = (output + chunk.toString('utf8')).slice(-2048);
if (child === proc && state.state === 'starting' && output.includes('Frame Control OBS stream is ready'))
set('running', alias, port);
});
proc.once('error', error => {
if (child !== proc) return;
child = null; set('failed', alias, port, `Could not start OBS source: ${error.message}`);
});
// close follows stderr EOF, so the final failure message is available.
proc.once('close', (code, signal) => {
if (child !== proc) return;
const stopping = state.state === 'stopping';
child = null;
set(stopping ? 'idle' : 'failed', alias, port,
stopping ? '' : `OBS source stopped (${signal || code}). ${output.trim().split('\n').pop() || 'Check SteamVR and SSH.'}`);
});
return status();
} catch (error) {
if (id !== attempt) return status();
return set('failed', alias, port, error.message);
}
}
return { start, stop, status, get child() { return child; } };
}
module.exports = { createObsSource };
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "frame-control",
"version": "0.4.31",
"version": "0.4.36",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "frame-control",
"version": "0.4.31",
"version": "0.4.36",
"license": "MIT",
"devDependencies": {
"electron": "^44.4.5",
+2 -1
View File
@@ -1,7 +1,7 @@
{
"name": "frame-control",
"productName": "Frame Control",
"version": "0.4.31",
"version": "0.4.36",
"description": "Desktop app for managing a Valve Steam Frame over SSH",
"private": true,
"main": "main.js",
@@ -36,6 +36,7 @@
},
"files": [
"main.js",
"obs-source.js",
"preload.js",
"install-link.js",
"updater.js",
+1 -1
View File
@@ -23,7 +23,7 @@ contextBridge.exposeInMainWorld("frameApp", {
restartServer: () => ipcRenderer.invoke("server:restart"), // the "couldn't start" page's Try Again
obs: {
status: () => ipcRenderer.invoke("obs:status"),
start: () => ipcRenderer.invoke("obs:start"),
start: (port) => ipcRenderer.invoke("obs:start", port),
stop: () => ipcRenderer.invoke("obs:stop"),
onState: (cb) => {
ipcRenderer.removeAllListeners("obs:state");
+86
View File
@@ -0,0 +1,86 @@
const test = require('node:test');
const assert = require('node:assert/strict');
const { EventEmitter } = require('node:events');
const { createObsSource } = require('../obs-source');
function fixture(prepare) {
const states = [], children = [];
const source = createObsSource({
prepare: prepare || (async () => ({ executable: 'python', args: ['helper.py'], env: {} })),
spawn(executable, args, options) {
const child = new EventEmitter();
child.stderr = new EventEmitter(); child.stdin = new EventEmitter();
child.stdin.end = () => { child.stdin.writableEnded = true; };
children.push({ child, executable, args, options }); return child;
},
onState: s => states.push(s),
});
return { source, states, children };
}
test('Stop during Python discovery cancels the pending start', async () => {
let resolve;
const f = fixture(() => new Promise(r => { resolve = r; }));
const pending = f.source.start('frame', 15100);
assert.equal(f.source.status().state, 'starting');
f.source.stop();
resolve({ executable: 'python', args: ['helper.py'], env: {} });
await pending;
assert.equal(f.children.length, 0);
assert.equal(f.source.status().state, 'idle');
});
test('late stderr cannot undo Stop; closing allows a fresh start on another port', async () => {
const f = fixture(); await f.source.start('frame', 15100);
const { child, args } = f.children[0];
assert.deepEqual(args.slice(-5), ['--frame', 'frame', '--port', '15100', '--control-stdin']);
child.stderr.emit('data', Buffer.from('Frame Control OBS stream is '));
child.stderr.emit('data', Buffer.from('ready\n'));
assert.equal(f.source.status().state, 'running');
f.source.stop();
child.stderr.emit('data', Buffer.from('last ffmpeg warning\n'));
assert.equal(f.source.status().state, 'stopping');
child.emit('close', 0, null);
assert.equal(f.source.status().state, 'idle');
await f.source.start('other-frame', 15101);
assert.equal(f.source.status().port, 15101);
// An old child cannot overwrite the replacement's state.
child.emit('close', 255, null);
assert.equal(f.source.status().state, 'starting');
});
test('concurrent starts spawn once and preparation failures are retryable', async () => {
let attempts = 0;
const f = fixture(async () => {
if (++attempts === 1) throw new Error('Python missing');
return { executable: 'python', args: [], env: {} };
});
assert.equal((await f.source.start('frame')).state, 'failed');
assert.match(f.source.status().error, /Python missing/);
await Promise.all([f.source.start('frame'), f.source.start('frame')]);
assert.equal(f.children.length, 1);
});
test('invalid ports and aliases cannot spawn; errors and closed pipes remain visible', async () => {
const f = fixture();
for (const port of [0, 1023, 65536, 15099.5, '15100']) {
await assert.rejects(f.source.start('frame', port), /port/i);
}
await assert.rejects(f.source.start('-bad'), /headset/i);
assert.equal(f.children.length, 0);
await f.source.start('frame');
const { child } = f.children[0];
child.stdin.emit('error', Object.assign(new Error('closed pipe'), { code: 'EPIPE' }));
child.stderr.emit('data', Buffer.from('network lost\n'));
child.emit('close', 255, null);
assert.equal(f.source.status().state, 'failed');
assert.match(f.source.status().error, /network lost/);
});
test('an unverified host hides the controls and cannot spawn a relay', async () => {
let spawned = false;
const source = createObsSource({ supported: false, prepare: async () => ({}), spawn: () => { spawned = true; } });
assert.equal(source.status().supported, false);
await source.start('frame');
assert.equal(spawned, false);
});
+8 -7
View File
@@ -1,15 +1,15 @@
# What we have tested
Current for Frame Control **v0.4.31**, 25 October 2026. “Real Frame + physical PC” means an actual headset and a non-virtual computer. “VM only” means a Windows virtual machine, sometimes connected to the real Frame. A CI test or a simulated device is **not** a physical hardware test. The date/version column is the last relevant check, not a promise that every new release was retested on that platform. See each link for the exact procedure and limits.
Current for Frame Control **v0.4.36**, 25 October 2026. “Real Frame + physical PC” means an actual headset and a non-virtual computer. “VM only” means a Windows virtual machine, sometimes connected to the real Frame. A CI test or a simulated device is **not** a physical hardware test. The date/version column is the last relevant check, not a promise that every new release was retested on that platform. See each link for the exact procedure and limits.
| Feature | Real Frame + physical PC tested | VM only | Untested or limited | Last check and proof |
|---|---|---|---|---|
| Core title smoke test | Linux lxso2 installed, launched and removed reserved native/Proton titles on the real Frame; all 13 steps passed | No | Unworn headset; visible rendering and controller input not checked. Other feature paths retain their separate limits below | 25 Oct, v0.4.31 candidate source `1255ef2`, Frame OS 0.5.6 build `20261022.6153909`: [sanitized results](evidence/round2-smoke-2026-10-25.json) |
| Core title smoke test | Linux lxso2 installed, launched and removed reserved native/Proton titles on the real Frame; all 13 steps passed | No | Unworn headset; visible rendering and controller input not checked. Other feature paths retain their separate limits below | 25 Oct, v0.4.36 tag `1701e62`, Frame OS 0.5.6 build `20261022.6153909`: [release smoke evidence](evidence/v0436-release-smoke-2026-10-25.md); [earlier detailed results](evidence/round2-smoke-2026-10-25.json) |
| Windows desktop in the headset | No physical Windows PC test | Windows 11 VM sent a whole desktop to a real Frame; this used an intermediate fix, not the final native DLL | Physical GPU, capture and controller input; individual windows unavailable in bundled DXGI build | 24 Oct, v0.4.10 installer + candidate fix: [VM log](evidence/windows-vm-2026-10-24.md), [PC guide](pc-in-headset.md) |
| Linux desktop in the headset | No | No | Native Linux PC capture is disabled; lxso2 lacked a desktop portal and PipeWire session. The separate Steam `-pipewire` helper is not Frame Control's PC capture | 24 Oct, v0.4.17: [host audit](evidence/linux-pc-host-lxso2-2026-10-24.md), [Steam helper PR #163](https://github.com/saphid/frame-control/pull/163) |
| Mac desktop in the headset | A physical Mac sent its screen/window to a real Frame | No | Current v0.4.26 Mac installer and worn-headset controller input have not been repeated | 28 Sep, pre-v0.4 / Frame OS 0.4.1: [Mac guide and measurement](streaming.md#b-show-the-macs-desktop-inside-the-frame) |
| OBS headset source on Linux | Real Frame to OBS 30 on a Linux host; H.264 video and a synthetic 440 Hz output tone reached a saved recording | No | Real game audio, audible monitoring, perceptual A/V sync and awake headset view | 25 Oct, PR #174 head, shipped in v0.4.22: [OBS log](evidence/obs-media-source-real-2026-10-25.md) |
| OBS headset source on Windows | No physical Windows PC test | No OBS/Frame VM end-to-end test | App Start/Stop path has automated Windows checks only | 25 Oct, v0.4.23: [Windows PR #179](https://github.com/saphid/frame-control/pull/179), [OBS guide](obs-headset-source.md) |
| OBS headset source on Linux | Real Frame to OBS 30.0.2 on a Linux host: 187.367 s, 720p30 H.264/AAC stereo, 5,621 frames, no encoder skips; room passthrough appeared in the recording | No | Synthetic tone was measured, not real game audio or audible listening. Default audio led by about 0.43 s in this setup; a measured +480 ms OBS offset removed residual skew at test resolution. Source-image latency was 1.431 s in one trial; other hosts and long sessions are unverified | 25 Oct, v0.4.30 package plus PR #219 runtime: [validation](evidence/obs-validation-2026-10-25.md) |
| OBS headset source on Windows | No physical Windows PC test | Windows 11 VM helper fixture passed, but a native bridge to the real Frame sent no packets | In-app OBS controls remain hidden; native Windows OBS and firewall path are unverified | 25 Oct, PR #219: [validation](evidence/obs-validation-2026-10-25.md), [OBS guide](obs-headset-source.md) |
| OBS headset source on macOS | No | No | Helper and OBS Media Source not tested on a Mac with a Frame | 25 Oct, v0.4.22: [OBS PR #174](https://github.com/saphid/frame-control/pull/174), [OBS guide](obs-headset-source.md) |
| OBS headset source on a SteamOS / Steam Machine PC | No SteamOS PC or Flatpak OBS runtime test | No SteamOS host VM test | v0.4.27 AppImage launched on Ubuntu x86_64 under Xvfb; the helper sent H.264/AAC from a real Frame to a local UDP receiver. SteamOS read-only root, desktop UI and Flatpak OBS remain unverified | 25 Oct, v0.4.27: [host test](evidence/obs-steamos-host-2026-10-25.md), [OBS guide](obs-headset-source.md#steamos--steam-machine-pc-host) |
| Wired connection doctor | No physical PC/Frame cable test of the doctor | No | Synthetic route/SSH tests; a separate Mac USB-C address observation does not test the doctor or game stream | 25 Oct, v0.4.23: [PR #178](https://github.com/saphid/frame-control/pull/178), [wired guide](wired-connection.md) |
@@ -19,10 +19,11 @@ Current for Frame Control **v0.4.31**, 25 October 2026. “Real Frame + physical
| Keyboard and trackpad from Frame Control | A Linux PC sent a click and ASCII keys to a temporary focused window on the real Frame | No | Worn-headset interaction, Unicode delivery and pixel-accurate pointing | 24 Oct, v0.4.19: [received-event log](evidence/pad-gamescope-2026-10-24.md), [PR #66](https://github.com/saphid/frame-control/pull/66) |
| Backup and restore after reset | Same-headset backup, no-op save restore and Return to Game Mode checks | No | Restore **after a factory reset**, replacement restore and Android data restore have not been tested on a headset. No headset reset was done | 24 Oct, v0.4.17: [backup guide](backup-and-recovery.md), [Return to Game Mode log](evidence/return-game-mode-packaged-2026-10-24.json) |
| Android game backup import | F-Droid Basic APK with synthetic main and patch OBBs installed, transferred and read back on a real Frame | No | v0.4.30 restricted split-APK backup route has generated-fixture and existing merger tests only; no real split game or RE4 gameplay test | 20 Oct OBB headset check; 25 Oct, v0.4.30 split fixtures: [OBB device evidence](evidence/android-import/device.json), [split PR #206](https://github.com/saphid/frame-control/pull/206), [guide](android-backups.md) |
| Passthrough in recordings | No active-passthrough mirror check | No | Standby frame was uniform; whether visible room pixels enter `/dev/video99` is **unknown**. Raw cameras are never captured by Frame Control | 25 Oct, v0.4.21: [headset log](evidence/round3-headset-2026-10-25.md), [recording guide](recording.md#does-record-include-passthrough) |
| Passthrough in recordings | Real room pixels in OBS and a production MP4 after safe SteamVR wake | No | **Yes** for the checked 0.5.6 mirror. Raw cameras are not opened. Other games/modes and Steam clips may differ | 25 Oct: [validation](evidence/obs-validation-2026-10-25.md), [recording guide](recording.md#does-record-include-passthrough) |
| Open at login | No Frame needed; Linux autostart file toggled on a physical Linux host with an isolated config directory | No | A full login session and physical Windows/macOS host login have not been checked; OS API calls were unit tested | 25 Oct, v0.4.26: [PR #189](https://github.com/saphid/frame-control/pull/189) |
| Local Frame Control extensions | Example panel displayed live Frame status in a browser preview; the real Frame served a read-only example in the experimental headset panel | No | No wearer-visible extension view; third-party extensions and physical Windows/macOS extension folders untested | 25 Oct, v0.4.29: [PR #194](https://github.com/saphid/frame-control/pull/194), [PR #201](https://github.com/saphid/frame-control/pull/201), [extension guide](extensions.md) |
| Experimental Frame Control SteamVR panel | Real Frame OS 0.5.6 installed its user service, registered an overlay, served authenticated live status and a read-only extension, saved a screenshot and short MP4, and removed owned resources | No | Headset was unworn in standby: overlay reported `not_visible`, stereo capture was dark; wearer-visible pixels and controller input are unverified | 25 Oct, v0.4.29: [PR #198](https://github.com/saphid/frame-control/pull/198), [PR #201](https://github.com/saphid/frame-control/pull/201), [panel guide](headset-app.md) |
| Experimental Decky Loader manager | Real Frame OS 0.5.6 ARM64 user-service install, status, update and remove completed; ProtonDB Badges loaded in Decky backend and Steam shared UI registry | No | Decky and plugin UI in the VR shell, wearer-visible badges, controller input and other plugins remain unverified | 25 Oct, v0.4.29: [PR #195](https://github.com/saphid/frame-control/pull/195), [PR #202](https://github.com/saphid/frame-control/pull/202), [headset findings](decky-frame.md) |
| Experimental Frame Control SteamVR panel | Real Frame OS 0.5.6 installed its user service, registered an overlay, served authenticated live status and a read-only extension, saved a screenshot and short MP4, and removed owned resources | No | Headset was unworn in standby: overlay reported `not_visible`, stereo capture was dark; wearer-visible pixels and controller input are unverified. The new large read-only status screen has browser layout and packaging checks only | 25 Oct, v0.4.29 device check and v0.4.31 status screen: [PR #198](https://github.com/saphid/frame-control/pull/198), [PR #201](https://github.com/saphid/frame-control/pull/201), [PR #220](https://github.com/saphid/frame-control/pull/220), [panel guide](headset-app.md) |
| Experimental Decky Loader manager | Real Frame OS 0.5.6 ARM64 user-service install, status, update and remove completed; seven official-store plugin backends loaded, and ProtonDB Badges completed managed store install/update/remove | No | v0.4.33 shared transaction lock and stopped-loader plugin removal have Linux and CI tests, but no live recovery test on the Frame. v0.4.35 treats `_root` store tags as root-required and hides duplicate IDs; this has test coverage, not a live store check. v0.4.36 stops a store install or update when the catalog hash changed after review; this was tested with a fake Frame, not with a live store change on the headset. Plugin pages, settings, routes, toasts and controller input in VR remain unverified; some plugins need root, x86_64 binaries or Deck-specific hardware | 25 Oct, v0.4.31 hardware and v0.4.36 tests: [PR #208](https://github.com/saphid/frame-control/pull/208), [PR #230](https://github.com/saphid/frame-control/pull/230), [PR #234](https://github.com/saphid/frame-control/pull/234), [PR #246](https://github.com/saphid/frame-control/pull/246), [PR #253](https://github.com/saphid/frame-control/pull/253), [compatibility table](decky-frame.md) |
| Experimental Framey VR plugin panels and store | No live real-Frame panel test | No | ProtonDB Badges settings rendered and sent a setting call in local Chromium. Official Steam Status rendered in local Chromium; a session-only cache avoided its earlier storage errors. A later local browser check restored a bounded per-plugin cache after panel reopen; live Decky and offline behavior were not tested. Fake Frame tests cover setting read/write through update and reinstall and install/remove two pinned official API v2 archives plus the modern API v1 Storage Cleaner archive. Page tests cover the official JSX runtime, disabled controls, text fields, sliders, grouped dropdowns and an author sample bundle with a settings tab and read-only backend quick action. The sample is not published in the store. The 11-archive manifest audit found only ProtonDB Badges API v2 in that set. Storage Cleaner 1.4.0 showed an empty-data panel and four disabled cleanup buttons in local Chromium with a stub backend; no cleanup action was tested. HLTB for Deck 2.0.12 built a shallow settings view and Bluetooth 3.1.1 built its initial panel in local frontend tests without effects or backend calls. Their badges, search, pairing and Bluetooth changes remain unverified. A hash match, local panel and fake Frame install do not prove VR use. Wearer-visible pixels, controller input and live settings persistence remain unverified | 25 Oct, v0.4.32–0.4.36: [#223](https://github.com/saphid/frame-control/pull/223), [#224](https://github.com/saphid/frame-control/pull/224), [#225](https://github.com/saphid/frame-control/pull/225), [#226](https://github.com/saphid/frame-control/pull/226), [#227](https://github.com/saphid/frame-control/pull/227), [#229](https://github.com/saphid/frame-control/pull/229), [#231](https://github.com/saphid/frame-control/pull/231), [#232](https://github.com/saphid/frame-control/pull/232), [#233](https://github.com/saphid/frame-control/pull/233), [#236](https://github.com/saphid/frame-control/pull/236), [#237](https://github.com/saphid/frame-control/pull/237), [#238](https://github.com/saphid/frame-control/pull/238), [#239](https://github.com/saphid/frame-control/pull/239), [#240](https://github.com/saphid/frame-control/pull/240), [#241](https://github.com/saphid/frame-control/pull/241), [#243](https://github.com/saphid/frame-control/pull/243), [#244](https://github.com/saphid/frame-control/pull/244), [#245](https://github.com/saphid/frame-control/pull/245), [#247](https://github.com/saphid/frame-control/pull/247), [#248](https://github.com/saphid/frame-control/pull/248), [#251](https://github.com/saphid/frame-control/pull/251), [#252](https://github.com/saphid/frame-control/pull/252), [#253](https://github.com/saphid/frame-control/pull/253), [browser/fake Frame evidence](evidence/framey-browser-2026-10-25.md), [guide](framey-loader.md) |
Release notes must preserve these limits until a newer recorded check changes them. When a feature is retested, add its date, exact app/Frame version, host type and proof here. The older [v0.3.1 matrix](support-matrix.html) is a historical snapshot and does not describe current coverage.
+44 -3
View File
@@ -42,6 +42,39 @@ files or behavior. The official store's digest checks the archive in transit;
it does not certify plugin code. Plugins run with the headset user's access.
For a new plugin, follow the [Frame plugin and extension guide](frame-plugin-author.md).
### Which of these plugins can open a Framey panel?
The separate Framey panel accepts a Frame Control store install with a supported
API v1/v2 frontend or a legacy Decky IIFE frontend in `dist/index.js`.
A backend load does not bypass this frontend check. We downloaded the 11 versions above
again on 25 October 2026 and matched every ZIP's SHA-256 to the official store
catalogue. All 11 had a frontend bundle, but their manifests differed:
| Manifest in the checked archive | Plugins | Framey panel result |
| --- | --- | --- |
| API v2 | ProtonDB Badges 1.3.4 | Eligible; settings rendered in local Chromium. No worn VR check. |
| API v1 | Bluetooth 3.1.1, HLTB for Deck 2.0.12, SteamGridDB 1.8.1, Storage Cleaner 1.4.0, Wine Cellar 0.2.1, MagicPods 2.0.21 | Storage Cleaner rendered its empty-data panel in local Chromium. HLTB started and built a settings view in a local host test; its Steam game page patches have no target. Other panels remain untested. Wine Cellar and MagicPods fail the ARM64 archive check. None has a worn VR result. |
| No `api_version` field | CSS Loader 2.1.3, Animation Changer 1.3.2, Audio Loader 1.6.1, PowerTools 2.0.3 | CSS Loader's legacy IIFE passes the Framey panel packaging check; its theme UI remains untested. Animation Changer's panel remains untested. Audio Loader and PowerTools request root and are blocked. |
The [archive audit record](evidence/framey-official-archive-audit-2026-10-25.json)
has each store ID, exact version, SHA-256, manifest field, and bundle check.
The archive audit itself is static PC inspection. Later local host and fake
Frame tests cover the Storage Cleaner, HLTB, CSS Loader and SteamGridDB cases noted above; none shows
that a plugin is visible or usable in the headset. The earlier real Frame backend checks in the table above
remain the only device evidence for these versions. A new store version needs a
new check because its manifest and binaries can change.
Pinned CSS Loader 2.1.3 and SteamGridDB 1.8.1 archives now pass the fake Frame
managed install/remove flow. CSS Loader's `plugin.json` has no `api_version` and
its older IIFE bundle passes the Framey packaging check added in
[#261](https://github.com/saphid/frame-control/pull/261). The fixture does not
render its theme controls. SteamGridDB declares API v1 and its bundle passes Framey's packaging
check, but it looks up Steam library modules while loading and patches game
context menus. Those modules and menus do not exist in Framey's isolated
iframe, so its artwork picker cannot be called a usable VR panel. Framey does
not apply its Steam library changes. These checks did not run CSS themes or
modify game artwork on the real Frame.
The new store transaction was also exercised on the same real Frame:
**managed loader install → ProtonDB Badges 1.3.4 store install → status →
store update → store remove → managed loader remove**. Status reported the
@@ -57,9 +90,12 @@ change Frame Control owned plugin folders under
hash and archive paths, blocks root plugins and non-ARM64 binaries, and rolls
back an update if the service restart fails. The current VR shell does not
provide Decky's Steam Deck Quick Access Menu. Frame Control's headset panel
shows installed plugins and store actions, but plugin pages, settings, routes,
and Decky toasts are **not** available there yet. The panel itself still needs
a worn-headset visual and controller check.
shows installed plugins and store actions. Its separate Framey iframe hosts
API v2 pages and API v1 bundles that use Decky's modern frontend initializer,
with settings, local routes, and panel toasts where supported.
Steam route patches and system notifications remain unavailable. The panel
still needs a worn-headset visual and controller check. See the
[current compatibility table](frame-plugin-author.md#framey-decky-api-compatibility).
## What was checked on the real headset
@@ -142,6 +178,9 @@ on Steam Deck hardware may fail even if the loader runs. Frame Control lists
plugins already present in its managed folder and the upstream `~/homebrew`
folder. The opt-in store manager installs compatible archives only into its
own folder. It cannot make Steam Deck QAM plugin pages visible in Frame VR.
The experimental [Framey panel host](framey-loader.md) can render compatible
plugin settings inside Frame Control's separate SteamVR dashboard panel.
The real headset still needs a worn-user visibility and controller check.
The latest tested release was
[Decky 3.3.0](https://github.com/SteamDeckHomebrew/decky-loader/releases/tag/v3.3.0),
@@ -160,6 +199,8 @@ It preserves plugin files and settings so unrelated user data is not deleted.
Open **Official plugin store** to review a plugin, then confirm each install,
update, or remove. Root and x86-only plugins are blocked. The manager only
removes plugin folders that it installed; it leaves other Decky folders alone.
The desktop app and headset panel share one lock for managed Decky changes.
If another change is in progress, wait for it to finish and try again.
Restart Steam or the headset to clear the frontend already injected into its
current web helper process. No action wipes the headset.
@@ -0,0 +1,20 @@
# API v1 panel check, 25 October 2026
The unmodified official Storage Cleaner 1.4.0 archive (store ID 50, SHA-256
`1afa1a6f129c5d419de0e0bf0f6db8d8e50385a5659179346e996031ea372591`)
declares `api_version: 1`, but its bundled frontend connects to Decky's modern
frontend API. Framey admitted that bundle from a local store receipt and
rendered it in Chromium inside an iframe with `sandbox="allow-scripts
allow-popups"`.
A test parent returned empty lists and `0B` for the plugin's two list and two
size backend calls. Chromium reported `framey:ready`, displayed Shader Cache
and Compatibility Data sections, and showed all four cleanup buttons disabled.
No cleanup action was invoked. The backend was a stub; the test did not run the
plugin's Python code or connect to a headset.
This confirms a panel shell for this exact archive with empty data. Storage
Cleaner may remove compatibility data and local game saves when used with a
real backend. Its cleanup actions, game names, SteamClient app details, VR
visibility, and controller input remain unverified on Frame. Do not infer that
its deletion controls are safe or complete in VR from this browser check.
@@ -0,0 +1,16 @@
# Bluetooth 3.1.1 compatibility fixture, 25 October 2026
The unmodified official Decky store archive for Bluetooth 3.1.1 (store ID 18,
SHA-256 `f07f7b74f31da15b5e3a8234a3f00faa01365b56b8f496aca7bb79120be7b8a5`)
passes Frame Control's archive rules. The fake Frame e2e harness installed it
through the store API, verified the managed receipt and frontend bytes, then
removed it. An earlier real Frame check recorded the backend's `Bluetooth
plugin loaded` line while SteamVR was in standby.
In a local Node host test, its official frontend starts and builds an initial
panel tree. Framey supplies empty Steam token maps and readable English
fallbacks for the three Bluetooth labels that lack plugin-owned fallbacks.
The test leaves React effects and click
handlers inert and sends no backend calls. It does not inspect paired devices,
change Bluetooth state, exercise a controller, or prove the panel is visible in
VR. No worn-headset check has passed for this plugin.
@@ -0,0 +1,36 @@
# Framey loader evidence, 25 October 2026
## Local browser and fake Frame
The official Decky store returned 116 validated entries. ProtonDB Badges was
entry 14, release 1.3.4, SHA-256
`90a3453ac02709cad64096e7539fd8141fa56f99ae3441fc24a4990dc9684358`.
Its published ZIP passed Frame Control's store manifest and path validator. The current
`dist/index.js` bundle was loaded in an opaque-origin iframe in local Chromium
with the Framey React/DFL shim. The [browser screenshot](framey-browser-2026-10-25.png)
shows the plugin's settings panel. A pointer click on **Enable Badge on
Library** issued `set_setting('settings', …)` through the iframe's request
bridge. The local test parent returned a stub backend reply; it did not use a
real headset or Decky backend. A separate fake Frame CEF fixture returned
`get_setting` and `set_setting` responses through Frame Control's CDP bridge;
that fixture does not model the real Decky process.
The disposable fake Frame end-to-end harness passed the store catalogue,
acknowledgement and HTTP auth checks, hash-verified install, update, and
removal through the real Frame Control HTTP server and SSH transaction. The
full fake Frame suite passed 48 tests; the full unit suite passed 1,559 tests
(16 skipped). Unit tests covered unsafe archives,
unmanaged-folder preservation, asset isolation, backend-call scope,
and safe aborts of the worn-headset check.
## Real headset status
Read-only SSH on Frame OS 0.5.6 found battery at 98–99%. SteamVR activity was
initially 3 (standby), briefly 0, then 3 again. During the active probe the
shared `/tmp/frame-test.lock` belonged to `obs-aacapv3evh-20261025`. It later
became free after SteamVR returned to standby. Framey did not acquire, replace,
or remove it. The active probe found no installed Frame Control VR panel or
Framey plugin; the scripted worn check exited before acquiring a lock or
altering the headset. There is **no** wearer-visible VR
menu screenshot, controller-input proof, or live settings-persistence result
from this round.
Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

@@ -0,0 +1,19 @@
# Framey cache check, 25 October 2026
The official Steam Status 1.2.3 ZIP pinned in
`tests/fixtures/framey-official/123.zip` was loaded through Framey's local
HTTP panel in Chromium. The iframe retained `sandbox="allow-scripts
allow-popups"`, so its native storage remained unavailable. The new Framey
storage facade accepted a set/get probe without a `SecurityError`. Steam
Status rendered and issued four `get_settings` calls to a stub parent backend.
Its `steamstat_last_status` cache entry was about 33 KiB, below the bridge's
128 KiB cap. After reopening the iframe, the parent supplied the saved cache
snapshot and the plugin wrote the same cache key again. The browser log had
zero `SecurityError` or `localStorage` errors.
The parent was a local test page with in-memory Decky backend replies. One
public status fetch also failed in the test browser, so this check does not
establish offline correctness or the freshness of Steam Status data. The
per-plugin save/reopen protocol, stale panel session rejection, and cache
limits are covered by `tests/page/framey_cache.mjs`. Frame OS persistence,
live Decky settings, VR visibility, and controller input remain unverified.
+25
View File
@@ -0,0 +1,25 @@
# Legacy Decky frontend bridge
The exact official MusicControl 1.1.6 archive (`12.zip` in the test fixtures)
has no `api_version` field and returns its initializer from a Decky IIFE.
Framey now wraps that expression in an ES module inside the existing
opaque-origin iframe. It passes a legacy `serverAPI` to the initializer.
Local Chromium ran the unchanged official frontend, including React effects,
with all backend calls rejected and network access blocked. It emitted
`framey:ready` without a JavaScript startup error during the observation window.
This proves initialization, not playback, MPRIS access, or a useful populated UI.
The fake Frame installed, packed, checked the frontend bytes and removed this
exact archive. Its synthetic Sample Panel also read a legacy keyword argument,
wrote a setting, and read that setting through the modern API. This exercised
the real HTTP → SSH → CDP path with a fake Decky backend. The RPC contract was
checked against Decky's `handle_plugin_method_call_legacy`: it calls with a
keyword object and returns `{success, result}`. Invalid argument shapes and
unmanaged plugin IDs are rejected.
Verification: `python3 -m unittest discover -s tests -p 'test_framey*.py'`
(21 passed), `node tests/page/framey_actions.mjs`, and
`scripts/e2e.sh test_framey` (2 passed). No official Python backend code or
headset state was changed by these checks. Real Frame backend behavior,
controller input, playback and worn VR use remain unverified.
@@ -0,0 +1,116 @@
{
"checkedAtUtc": "2026-10-25",
"source": "https://plugins.deckbrew.xyz/plugins",
"method": "Downloaded exact current official store versions; local SHA-256 matched each store hash; inspected ZIP plugin.json and dist/index.js without running plugin code.",
"limit": "Static inspection on PC. Prior backend load results are documented in docs/decky-frame.md; VR visibility and controller input remain unverified.",
"plugins": [
{
"storeId": 7,
"name": "CSS Loader",
"storeVersion": "2.1.3",
"sha256": "99beaf1374af82408e6d056e0b0147e5fca544e1035fa7ab88419231697bc231",
"manifestApiVersion": null,
"manifestFlags": [],
"frontendBundle": true
},
{
"storeId": 14,
"name": "ProtonDB Badges",
"storeVersion": "1.3.4",
"sha256": "90a3453ac02709cad64096e7539fd8141fa56f99ae3441fc24a4990dc9684358",
"manifestApiVersion": 2,
"manifestFlags": [],
"frontendBundle": true
},
{
"storeId": 16,
"name": "Audio Loader",
"storeVersion": "1.6.1",
"sha256": "fd5a090c2e2cd4da6723d7bd08937ab31b9f8d4663510431713da531343e303f",
"manifestApiVersion": null,
"manifestFlags": [
"_root"
],
"frontendBundle": true
},
{
"storeId": 18,
"name": "Bluetooth",
"storeVersion": "3.1.1",
"sha256": "f07f7b74f31da15b5e3a8234a3f00faa01365b56b8f496aca7bb79120be7b8a5",
"manifestApiVersion": 1,
"manifestFlags": [],
"frontendBundle": true
},
{
"storeId": 21,
"name": "PowerTools",
"storeVersion": "2.0.3",
"sha256": "47614f53b8c538c4caa15f89a01e4ab106fa328e89f78545bacb3166d104d964",
"manifestApiVersion": null,
"manifestFlags": [
"root",
"global-dfl"
],
"frontendBundle": true
},
{
"storeId": 23,
"name": "Animation Changer",
"storeVersion": "1.3.2",
"sha256": "f2c62b90ca60d8a80b6d0f75d8027552b1509c7a05842c6f4a24a9072846d133",
"manifestApiVersion": null,
"manifestFlags": [],
"frontendBundle": true
},
{
"storeId": 26,
"name": "HLTB for Deck",
"storeVersion": "2.0.12",
"sha256": "bd54a23b0b8ec0798aa590e5be236522a593529d7680e77fb888e2971bf3d558",
"manifestApiVersion": 1,
"manifestFlags": [],
"frontendBundle": true
},
{
"storeId": 36,
"name": "SteamGridDB",
"storeVersion": "1.8.1",
"sha256": "e84f5b1f111af8862b06218479491fbf61036e1bfd9f16f93f9901e9b9ebc5e0",
"manifestApiVersion": 1,
"manifestFlags": [
"debug"
],
"frontendBundle": true
},
{
"storeId": 50,
"name": "Storage Cleaner",
"storeVersion": "1.4.0",
"sha256": "1afa1a6f129c5d419de0e0bf0f6db8d8e50385a5659179346e996031ea372591",
"manifestApiVersion": 1,
"manifestFlags": [],
"frontendBundle": true
},
{
"storeId": 68,
"name": "Wine Cellar",
"storeVersion": "0.2.1",
"sha256": "7e077b933c234414d172b5c6d1c804b026bf39fa4e18e6663495a282637031e8",
"manifestApiVersion": 1,
"manifestFlags": [
"debug"
],
"frontendBundle": true
},
{
"storeId": 82,
"name": "MagicPods",
"storeVersion": "2.0.21",
"sha256": "abe2eef5788cb3ff6e73fcb9783e30a54b127e28c761a9bf99e64ab5fc4be9ab",
"manifestApiVersion": 1,
"manifestFlags": [],
"frontendBundle": true
}
]
}
@@ -0,0 +1,26 @@
# Framey session cache browser check, 25 October 2026
Frame Control v0.4.34's opaque Framey iframe made the official Steam Status
1.2.3 frontend log `SecurityError` for its `localStorage` cache. This follow-up
used a per-panel memory substitute. It did **not** change the iframe's sandbox
flags or give plugin code Frame Control's UI key.
A local Chromium page loaded the unmodified official Steam Status 1.2.3 archive
from `tests/fixtures/framey-official/123.zip` (SHA-256
`9053308e04a74f44745b45b9f4f50af3673348d367e7b14bacc5677de707ac4e`).
The page used `sandbox="allow-scripts allow-popups"` and returned `{}` for
four `get_settings` calls. That reply was a stub, not the Decky backend.
The iframe sent `framey:ready`. Its test script wrote and read a cache item.
The parent could not read the iframe document (`contentDocument` was null).
The plugin displayed Steam Status, Store, Community, WebAPI, Connection
Managers and Players Online. Its public status request returned HTTP 200.
No cache `SecurityError` appeared in the captured console, while the
same archive had logged that error with the v0.4.34 host.
Node host tests also checked item updates, removal, clear, key order, string
conversion, quota rejection, and preservation of an existing item after a
rejected write. The substitute keeps at most 256 items and 512 KiB of keys and
values **in memory**. Closing or reloading the panel loses this cache. This
check did not test offline behavior, persistent plugin settings, a live Decky
backend, SteamVR visibility, controller input, or headset performance.
@@ -0,0 +1,28 @@
# Steam Status in the local Framey browser, 25 October 2026
This check used the unmodified official Steam Status 1.2.3 archive already
pinned in `tests/fixtures/framey-official/123.zip`. Its SHA-256 is
`9053308e04a74f44745b45b9f4f50af3673348d367e7b14bacc5677de707ac4e`.
The archive declares Decky API v2. No headset was contacted for this check.
On a Linux PC, we extracted the archive to a disposable plugin folder with a
Frame Control store receipt. A local HTTP server served the page from
`framey_panel.panel(123)`, Frame Control's React 18.3.1 runtime and its
`framey-host.js`. A parent page put the panel in an iframe with
`sandbox="allow-scripts"` and returned `{}` for the plugin's `get_settings`
backend calls. This was a **stub**, not the Decky service.
Chromium reported `framey:ready` and four `get_settings` calls. The page showed
Steam Status, Store, Community, WebAPI, Connection Managers, Players Online,
and other controls. Its own public `https://steamstatus.schelstraete.org/api/v1/status`
request returned HTTP 200 and populated the status view. A click on **Refresh**
sent Framey's trusted pointer event to the parent; this test did not prove a
fresh status fetch or settings write. The [browser screenshot](framey-steam-status-browser-2026-10-25.png)
contains only the local test page and public service data.
The plugin logged `SecurityError` while reading and writing `localStorage` in
the opaque-origin iframe. It caught the errors and rendered anyway. Its cache
and offline behavior in Framey are **not verified**. The real Decky backend,
live settings, SteamVR visibility, controller input and headset performance
were not tested. This result supports only local frontend rendering for this
exact archive and Frame Control v0.4.34 host code.
Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

@@ -0,0 +1,119 @@
# Framey unattended VR evidence, 25 October 2026 UTC
The committed runner exited **0** on the real Frame, using the existing
`ssh lxso2 'ssh frame …'` route from lxso1. No person wore the headset.
Frame OS **0.5.6**, build **20261022.6153909**, ARM64, SteamVR **2.18.2**,
Decky **3.3.0**. The run began at **23:27:34 UTC**; the Frame's own clock/logs
use UTC+11 and therefore show 26 October.
```sh
python3 scripts/framey-vr-check.py --via lxso2 --exercise --output /tmp/framey-vr-verified
```
[Full machine result](result.json) records source commit
`cb9ad1b6cb7302008783d5f7fe42fa77a4dd43af`, bundle digest, before/after
SteamVR listings, power settings, input observations, and private image hashes.
The checked app code includes the sample settings-path and iframe-reopen fixes
and main through `d77e2bd`. This is source-bundle testing, not a newly published
release/AppImage test. The sample has a random test name and store-shaped local
receipt; it is not presented as an official catalogue listing.
| Check | Observed | Scope |
| --- | --- | --- |
| Overlay registration and visibility | `IVROverlay_027.IsOverlayVisible=true` | Actual Frame Control gamescope overlay, not a browser fixture |
| Transform | type **5**, DashboardTab; absolute getter returns **18**, WrongTransformType | Dashboard owns placement; no transform/dock setters used |
| Texture queries | main size 0×0; image read **24**, InvalidTexture | Direct texture refresh not established; compositor capture used instead |
| Stereo compositor | Before/after SHA-256 differ; final image visibly contains Framey tabs, quick action and saved result | Actual `IVRScreenshots_001` production screenshot path |
| OBS mirror | Current run's random name and “Saved setting is on” appear after draining 60 frames | `/dev/video99` pixels; OBS app itself was not launched in this task |
| OpenVR click | Move/down/up reaches intended control; iframe pointer event is trusted | `IVROverlayView_003.PostOverlayEvent`, no DOM `.click()` |
| Live setting | off → on; real backend file `{"enabled":true}`; fresh iframe reads on | Actual Framey HTTP → Steam CEF → Decky websocket → Python backend; no stubs |
| Tabs/quick action | Settings/Panel clicked; “Saved setting is on” returned | Actual shipped host controls and sample action |
| Slider | 10 → **50** | Native OpenVR click on actual DFL slider, diagnostic UI-only value |
| Text | **framey-ci** | OpenVR pointer focus, then CDP `Input.insertText`; not SteamVR keyboard proof |
| Smooth scroll attempt | `scrollBefore=0`, `scrollAfter=0` | No scrolling established by this attempt; do not count it as a pass |
| Battery | **99% → 99%** | Probed only under the owned lock |
| Power restoration | original pause **false**, timeout **5.000000**, exact values read back | Temporary values false/120; no idle-suspend timer or proximity changes |
| Cleanup | `cleanupErrors=[]`, `powerRecoveryRemoved=true`, `lockReleased=true` | Temporary managed services, sample/settings/profile, timer and restore script removed |
`IsDashboardVisible` and `IsActiveDashboardOverlay` are false while the panel is
visible in these captures: this is an existing placed/docked panel. They cannot
be used alone as a Framey visibility verdict. Activity changes from standby 3
to active 0 without wearing the headset, so activity alone is not worn proof.
Native OpenVR events also produce trusted pointers, so `event.isTrusted` alone
is not physical-controller proof. The worn script now requires explicit
`--worn-confirmed` and reports trusted pointer input with that narrower name.
![Actual compositor panel, room masked](stereo-left-panel-redacted.png)
![Actual mirror panel, room masked](mirror-panel-redacted.png)
These are inset panel crops from the raw captures, with all other pixels
replaced by solid black. No UI content was synthesized. [Image provenance](images.json)
contains source hashes, mask polygons, crops and published hashes. Raw images
remain private under `/tmp/framey-vr-verified` on lxso1. They are not committed.
## Bugs found and fixed
1. The author sample used `decky.decky_SETTINGS_DIR`, absent from real Decky
3.3.0. The actual iframe displayed its backend `AttributeError`. Decky's
[pinned module](https://github.com/SteamDeckHomebrew/decky-loader/blob/v3.3.0/backend/decky_loader/plugin/imports/decky.py)
exports `DECKY_PLUGIN_SETTINGS_DIR`. The sample, docs and Python test fixture
now use that name. The old fixture invented the same wrong attribute and
masked the failure. The live fixed backend save/reopen is in `result.json`.
2. Reopening the same plugin changed only `#session`, so Chromium retained the
old document/host/cache session. It could retain an error and eventually
show a false “No compatible panel loaded” message. A fresh query parameter
forces a new document while keeping the fragment session. The cache
regression now checks document URLs, rather than manually assuming a new
iframe. The real reopen with the saved setting passed.
## Methods tried and limits
Read-only `vrcmd` stats/overlay listings, the shipped OpenVR ABI, compositor
logs and actual CEF/Chromium targets were inspected first. A simple
`--handlewakeup` initially produced the Frame Control status panel in a stereo
screenshot. The full test uses a bounded screen timeout so it stays active.
Decky's service startup reloads Steam's web helper. During exploratory service
recreation, SteamVR logged `UpdateInputFocus: Failed to give focus to panel`
and returned a hidden, zero-sized main overlay despite a successful focus
request. Retagging only the test browser's `STEAM_GAME` property recovered it;
no Steam, SteamVR, gamescope or headset restart was needed. The final run did
not need this recovery. The runner records it when used.
The first mirror image was demonstrably stale: it contained a previous test's
random plugin name while the contemporaneous stereo image contained the current
one. Reading 60 frames before selecting the mirror image fixed that observation;
the final two published images contain the same current run name.
The diagnostic itself initially failed its cleanup check because an idle
systemd watchdog service was already unloaded. It restored power and removed
the test services, retained the lock, then the exact owned remainder was cleaned
up. Cleanup now checks `LoadState` and tolerates an already-unloaded transient
unit. Subsequent full runs, including the committed run here, exited 0 with no
cleanup errors. A four-minute power-recovery timer was created and cancelled;
forced host death or network loss was not fault injected.
A null driver or virtual tracked controller was not needed for pointer delivery
and was not installed. No root/system files, tracking/proximity configuration,
Steam global binaries, or spatial transforms were edited. PR #113 was untouched.
This check does not establish every official plugin, sustained frame rate,
backend persistence across Steam/Decky reboot, physical controller tracking or
haptics, a functioning virtual keyboard, native scrolling, comfort or legibility
through the optics. Follow the [three-minute worn checklist](../../framey-vr-check.md#three-minute-worn-checklist).
## Local checks
- Full Python suite after integrating current main and worn-confirmation gate:
**1,595 tests, 16 skipped, OK**. The final added scroll/mirror helpers also
passed the **24 focused Framey tests** and the real-device run above.
- App and website test commands passed under **Node 24.22.1**, matching CI's
Node major. System Node 22 cancelled unrelated Meta sign-in timer tests;
those files were not changed. Node 24 was used for final app verification.
- `git diff --check` and Python compilation passed. Hosted CI status belongs to
the PR; local checks do not substitute for its macOS/Windows/ARM64 jobs.
A separate [locked cleanup audit](cleanup-verification.json) confirms both test
services inactive, no panel bundle or Decky binary, no test plugins/profiles or
remaining timers, power restored to false/5, battery 99→99, and its own lock
released. It also removed the stale DevTools discovery file created during the
earlier exploratory use of the original browser profile.
@@ -0,0 +1,2 @@
{"batteryBefore": [99], "headsetService": {"code": 4, "out": "inactive", "err": ""}, "deckyService": {"code": 4, "out": "inactive", "err": ""}, "panelBundleExists": false, "deckyBinaryExists": false, "testPluginFolders": [], "testProfiles": [], "timers": {"code": 0, "out": "", "err": ""}, "pause": {"code": 0, "out": "power.pauseCompositorOnStandby=false", "err": ""}, "timeout": {"code": 0, "out": "power.turnOffScreensTimeout=5.000000", "err": ""}, "removedOwnedStaleDevToolsDiscovery": true, "batteryAfter": [99], "lockReleased": true}
@@ -0,0 +1,80 @@
[
{
"source": "stereo-private.png",
"sourceSha256": "25944a3f3ffe0c217ef25cbc3f5e08a104f9d8901075b755c928ec5049a4cb3c",
"published": "stereo-left-panel-redacted.png",
"publishedSha256": "0de6fbf0f31d0587c8ba91817406acf455b8adb10d343bd56daa605f9a3051c7",
"maskPolygon": [
[
50,
435
],
[
910,
365
],
[
940,
920
],
[
700,
910
],
[
350,
945
],
[
90,
1000
]
],
"crop": [
50,
365,
941,
1001
],
"background": "solid black; only inset panel pixels retained"
},
{
"source": "mirror-private.png",
"sourceSha256": "44d193943ca3164269feeea38f5cbfb0d58cefb79d6c0e8231eab4a5069985b8",
"published": "mirror-panel-redacted.png",
"publishedSha256": "86fa296a36171efca6a9aa627ec3589496df73f3c03f8f9428454c411a904a77",
"maskPolygon": [
[
455,
445
],
[
1420,
390
],
[
1470,
940
],
[
1150,
910
],
[
850,
940
],
[
495,
1020
]
],
"crop": [
455,
390,
1471,
1021
],
"background": "solid black; only inset panel pixels retained"
}
]
Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

@@ -0,0 +1,189 @@
{
"schema": 1,
"time": "2026-10-25T23:27:34.130334+00:00",
"controllerHardwareVerified": false,
"wornVisualComfortVerified": false,
"sourceCommit": "cb9ad1b6cb7302008783d5f7fe42fa77a4dd43af",
"before": {
"battery": [
99
],
"dashboardVisible": false,
"stats": [
{
"activity_level": 3,
"operation": "status",
"version": "2.18.2",
"version_timestamp": 1791331621
}
],
"overlays": "---- OVERLAYS ---- \n'system.HeadsetView' -- 'Headset View', 2048x1280 not_visible VROverlayType_Basic \n'system.toast' -- 'Toast', not_visible VROverlayType_Basic \n'system.cursor.ibeam' -- 'system.cursor.ibeam', 64x64 not_visible VROverlayType_Basic \n flags=0x00200000 +premult overlayhandle=0x0000000d00000002\n'system.pointer' -- 'system.pointer', 64x64 not_visible VROverlayType_Basic \n flags=0x00200000 +premult overlayhandle=0x0000000e00000003\n'system.pointer.secondary' -- 'system.pointer.secondary', 64x64 not_visible VROverlayType_Basic \n flags=0x00200000 +premult overlayhandle=0x0000000f00000004\n'system.standalone' -- 'Standalone Overlay Manager', not_visible VROverlayType_Basic \n'valve.steam.desktopgame.0' -- 'Gamescope', not_visible VROverlayType_Dashboard_Main \n flags=0x29A20000 +smoothscroll, +premult, +keyboard, +clickstab overlayhandle=0x0000001100000006\n'valve.steam.desktopgame.0.thumb' -- 'Gamescope (Thumb)', 256x256 not_visible VROverlayType_Dashboard_Thumbnail \n flags=0x20200000 +premult overlayhandle=0x0000001200000007\n'valve.steam.desktopgame.0.layer1' -- 'Gamescope Layer', not_visible VROverlayType_Subview \n flags=0x28200000 +premult, +clickstab overlayhandle=0x0000001300000008\n'valve.steam.desktopgame.0.layer2' -- 'Gamescope Layer', not_visible VROverlayType_Subview \n flags=0x28200000 +premult, +clickstab overlayhandle=0x0000001400000009\n'valve.steam.desktopgame.0.layer3' -- 'Gamescope Layer', not_visible VROverlayType_Subview \n flags=0x28200000 +premult, +clickstab overlayhandle=0x000000150000000a\n'valve.steam.desktopgame.0.layer4' -- 'Gamescope Layer', not_visible VROverlayType_Subview \n flags=0x28200000 +premult, +clickstab overlayhandle=0x000000160000000b\n'valve.steam.desktopgame.0.layer5' -- 'Gamescope Layer', not_visible VROverlayType_Subview \n flags=0x28200000 +premult, +clickstab overlayhandle=0x000000170000000c\n'valve.steam.desktopgame.0.layer6' -- 'Gamescope Layer', not_visible VROverlayType_Subview \n flags=0x28200000 +premult, +clickstab overlayhandle=0x000000180000000d\n'valve.steam.desktopgame.0.layer7' -- 'Gamescope Layer', not_visible VROverlayType_Subview \n flags=0x28200000 +premult, +clickstab overlayhandle=0x000000190000000e\n'valve.steam.desktopgame.0.layer8' -- 'Gamescope Layer', not_visible VROverlayType_Subview \n flags=0x28200000 +premult, +clickstab overlayhandle=0x0000001a0000000f\n'gamescope.gamescope-0.cursor.0' -- 'Mouse Cursor', not_visible VROverlayType_Basic \n flags=0x60000000 overlayhandle=0x0000001b00000010\n'system.systemui' -- 'systemui', 1860x2048 not_visible VROverlayType_Basic \n flags=0x08230008 -dash, +interactive, +smoothscroll, +premult, +clickstab overlayhandle=0x0000001c00000011\n'system.vrwebhelper.controllerbinding' -- 'controllerbinding', 2400x1350 not_visible VROverlayType_Dashboard_Main \n flags=0x09228108 -dash, +scrollwheel, +dash, +smoothscroll, +premult, +keyboard, +clickstab overlayhandle=0x0000003800000012\n'system.vrwebhelper.controllerbinding.thumb' -- 'controllerbinding (Thumb)', 16x16 not_visible VROverlayType_Dashboard_Thumbnail \n'valve.steam.gamepadui.main' -- 'SteamVR', 0x0 not_visible VROverlayType_Dashboard_Main \n flags=0x69A28000 +dash, +smoothscroll, +premult, +keyboard, +clickstab overlayhandle=0x000001a400000014\n'valve.steam.gamepadui.main.thumb' -- 'Webhelper (Thumb)', 300x300 not_visible VROverlayType_Dashboard_Thumbnail \n flags=0x20200000 +premult overlayhandle=0x000001a500000015\n'valve.steam.browserview_MainBrowser_2' -- 'data:text/html,<body><%2Fbody>', 0x0 not_visible VROverlayType_Subview \n flags=0x69A20000 +smoothscroll, +premult, +keyboard, +clickstab overlayhandle=0x000001a600000016\n'valve.steam.gamepadui.keyboard' -- 'SteamVR - Keyboard', 0x0 not_visible VROverlayType_Basic \n flags=0x31A30000 +interactive, +smoothscroll, +premult, +keyboard, +2cursor overlayhandle=0x000001a700000017\n'valve.steam.gamepadui.bar' -- 'SteamVR - valve.steam.gamepadui.bar (85370000)', 0x0 not_visible VROverlayType_Basic \n flags=0x69A20000 +smoothscroll, +premult, +keyboard, +clickstab overlayhandle=0x000001a800000018\n'valve.steam.gamepadui.barpopup.85370001' -- 'SteamVR - valve.steam.gamepadui.barpopup.85370001 (85370001)', 0x0 not_visible VROverlayType_Basic \n flags=0x69A20000 +smoothscroll, +premult, +keyboard, +clickstab overlayhandle=0x000001a900000019\n'valve.steam.gamepadui.tooltip.85370002' -- 'SteamVR - valve.steam.gamepadui.tooltip.85370002 (85370002)', 0x0 not_visible VROverlayType_Basic \n flags=0x69A20000 +smoothscroll, +premult, +keyboard, +clickstab overlayhandle=0x000001aa0000001a\n'valve.steam.gamepadui.volumelevel' -- 'SteamVR - valve.steam.gamepadui.volumelevel (85370003)', 0x0 not_visible VROverlayType_Basic \n flags=0x69A20000 +smoothscroll, +premult, +keyboard, +clickstab overlayhandle=0x000001ab0000001b\n'valve.steam.gamepadui.floatingfooterLine truncated
"pause": "power.pauseCompositorOnStandby=false",
"timeout": "power.turnOffScreensTimeout=5.000000"
},
"powerRecovery": {
"timer": "framey-vr-5e068da08ef73637-restore.timer",
"script": "/tmp/framey-vr-5e068da08ef73637-restore.py",
"originalPause": "false",
"originalTimeout": "5.000000"
},
"deckyInstall": {
"message": "Decky Loader v3.3.0 is running as a user service. The VR menu is experimental."
},
"panelInstall": {
"message": "Installed Frame Control on the headset. Asked SteamVR to show Frame Control. Select its panel in the dashboard if it is hidden.",
"version": "4968ad070054d005",
"overlay": "valve.steam.desktopgame.2001947813"
},
"overlay": {
"state": {
"interface": "IVROverlay_027",
"visible": true,
"dashboardVisible": false,
"activeDashboard": false,
"texture": {
"error": 0,
"width": 0,
"height": 0
},
"transform": {
"error": 18,
"typeError": 0,
"type": 5,
"origin": 0,
"matrix": [
[
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0
]
]
},
"input": {
"error": 0,
"method": 1,
"scaleError": 0,
"scale": [
1920.0,
1080.0
]
}
},
"imageRead": {
"error": 24,
"width": 0,
"height": 0
}
},
"beforeStereoSha256": "5d0635d02e44d7cf2d5c249e72ea01c5cd161996427c1012cfd1c42fa5aa5751",
"input": {
"clickTransport": "IVROverlayView_003.PostOverlayEvent",
"textTransport": "CDP Input.insertText after OpenVR focus",
"controllerHardwareVerified": false,
"initialText": "PanelSettings\nQuick actions\nRead saved setting\nFramey settings sample\nExample setting\nStored by the Decky Python backend\nReload saved setting\nAbout this setting\n\nSaved setting: off",
"savedText": "Framey sample\n\nSetting saved\n\nDismiss\nPanelSettings\nQuick actions\nRead saved setting\nFramey settings sample\nExample setting\nStored by the Decky Python backend\nReload saved setting\nAbout this setting\n\nSaved setting: on",
"pointerEvents": [
{
"trusted": true,
"x": 594.6666870117188,
"y": 280.0625
}
],
"trustedOverlayPointer": true,
"diskSetting": {
"enabled": true
},
"reopenedText": "PanelSettings\nQuick actions\nRead saved setting\nFramey settings sample\nExample setting\nStored by the Decky Python backend\nReload saved setting\nAbout this setting\n\nSaved setting: on",
"reopenedChecked": true,
"quickActionText": "PanelSettings\nQuick actions\nRead saved setting\n\nSaved setting is on\n\nFramey settings sample\nExample setting\nStored by the Decky Python backend\nReload saved setting\nAbout this setting\n\nSaved setting: on",
"sliderValue": "50",
"textValue": "framey-ci",
"scrollBefore": 0,
"scrollAfter": 0,
"nativeScrollMoved": false,
"finalOverlay": {
"interface": "IVROverlay_027",
"visible": true,
"dashboardVisible": false,
"activeDashboard": false,
"texture": {
"error": 0,
"width": 0,
"height": 0
},
"transform": {
"error": 18,
"typeError": 0,
"type": 5,
"origin": 0,
"matrix": [
[
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0
]
]
},
"input": {
"error": 0,
"method": 1,
"scaleError": 0,
"scale": [
1920.0,
1080.0
]
}
},
"passed": true
},
"stereoSha256": "25944a3f3ffe0c217ef25cbc3f5e08a104f9d8901075b755c928ec5049a4cb3c",
"compositorChanged": true,
"mirrorSha256": "44d193943ca3164269feeea38f5cbfb0d58cefb79d6c0e8231eab4a5069985b8",
"passed": true,
"after": {
"battery": [
99
],
"dashboardVisible": false,
"stats": [
{
"activity_level": 0,
"operation": "status",
"version": "2.18.2",
"version_timestamp": 1791331621
}
],
"overlays": "---- OVERLAYS ---- \n'system.HeadsetView' -- 'Headset View', 2048x1280 not_visible VROverlayType_Basic \n'system.toast' -- 'Toast', not_visible VROverlayType_Basic \n'system.cursor.ibeam' -- 'system.cursor.ibeam', 64x64 not_visible VROverlayType_Basic \n flags=0x00200000 +premult overlayhandle=0x0000000d00000002\n'system.pointer' -- 'system.pointer', 64x64 not_visible VROverlayType_Basic \n flags=0x00200000 +premult overlayhandle=0x0000000e00000003\n'system.pointer.secondary' -- 'system.pointer.secondary', 64x64 not_visible VROverlayType_Basic \n flags=0x00200000 +premult overlayhandle=0x0000000f00000004\n'system.standalone' -- 'Standalone Overlay Manager', not_visible VROverlayType_Basic \n'valve.steam.desktopgame.0' -- 'Gamescope', not_visible VROverlayType_Dashboard_Main \n flags=0x29A20000 +smoothscroll, +premult, +keyboard, +clickstab overlayhandle=0x0000001100000006\n'valve.steam.desktopgame.0.thumb' -- 'Gamescope (Thumb)', 256x256 not_visible VROverlayType_Dashboard_Thumbnail \n flags=0x20200000 +premult overlayhandle=0x0000001200000007\n'valve.steam.desktopgame.0.layer1' -- 'Gamescope Layer', not_visible VROverlayType_Subview \n flags=0x28200000 +premult, +clickstab overlayhandle=0x0000001300000008\n'valve.steam.desktopgame.0.layer2' -- 'Gamescope Layer', not_visible VROverlayType_Subview \n flags=0x28200000 +premult, +clickstab overlayhandle=0x0000001400000009\n'valve.steam.desktopgame.0.layer3' -- 'Gamescope Layer', not_visible VROverlayType_Subview \n flags=0x28200000 +premult, +clickstab overlayhandle=0x000000150000000a\n'valve.steam.desktopgame.0.layer4' -- 'Gamescope Layer', not_visible VROverlayType_Subview \n flags=0x28200000 +premult, +clickstab overlayhandle=0x000000160000000b\n'valve.steam.desktopgame.0.layer5' -- 'Gamescope Layer', not_visible VROverlayType_Subview \n flags=0x28200000 +premult, +clickstab overlayhandle=0x000000170000000c\n'valve.steam.desktopgame.0.layer6' -- 'Gamescope Layer', not_visible VROverlayType_Subview \n flags=0x28200000 +premult, +clickstab overlayhandle=0x000000180000000d\n'valve.steam.desktopgame.0.layer7' -- 'Gamescope Layer', not_visible VROverlayType_Subview \n flags=0x28200000 +premult, +clickstab overlayhandle=0x000000190000000e\n'valve.steam.desktopgame.0.layer8' -- 'Gamescope Layer', not_visible VROverlayType_Subview \n flags=0x28200000 +premult, +clickstab overlayhandle=0x0000001a0000000f\n'gamescope.gamescope-0.cursor.0' -- 'Mouse Cursor', not_visible VROverlayType_Basic \n flags=0x60000000 overlayhandle=0x0000001b00000010\n'system.systemui' -- 'systemui', 1860x2048 not_visible VROverlayType_Basic \n flags=0x08230008 -dash, +interactive, +smoothscroll, +premult, +clickstab overlayhandle=0x0000001c00000011\n'system.vrwebhelper.controllerbinding' -- 'controllerbinding', 2400x1350 not_visible VROverlayType_Dashboard_Main \n flags=0x09228108 -dash, +scrollwheel, +dash, +smoothscroll, +premult, +keyboard, +clickstab overlayhandle=0x0000003800000012\n'system.vrwebhelper.controllerbinding.thumb' -- 'controllerbinding (Thumb)', 16x16 not_visible VROverlayType_Dashboard_Thumbnail \n'valve.steam.gamepadui.main' -- 'SteamVR', 0x0 not_visible VROverlayType_Dashboard_Main \n flags=0x69A28000 +dash, +smoothscroll, +premult, +keyboard, +clickstab overlayhandle=0x000001c600000014\n'valve.steam.gamepadui.main.thumb' -- 'Webhelper (Thumb)', 300x300 not_visible VROverlayType_Dashboard_Thumbnail \n flags=0x20200000 +premult overlayhandle=0x000001c700000015\n'valve.steam.browserview_MainBrowser_2' -- 'data:text/html,<body><%2Fbody>', 0x0 not_visible VROverlayType_Subview \n flags=0x69A20000 +smoothscroll, +premult, +keyboard, +clickstab overlayhandle=0x000001c800000016\n'valve.steam.gamepadui.keyboard' -- 'SteamVR - Keyboard', 0x0 not_visible VROverlayType_Basic \n flags=0x31A30000 +interactive, +smoothscroll, +premult, +keyboard, +2cursor overlayhandle=0x000001c900000017\n'valve.steam.gamepadui.bar' -- 'SteamVR - valve.steam.gamepadui.bar (85430000)', 0x0 not_visible VROverlayType_Basic \n flags=0x69A20000 +smoothscroll, +premult, +keyboard, +clickstab overlayhandle=0x000001ca00000018\n'valve.steam.gamepadui.barpopup.85430001' -- 'SteamVR - valve.steam.gamepadui.barpopup.85430001 (85430001)', 0x0 not_visible VROverlayType_Basic \n flags=0x69A20000 +smoothscroll, +premult, +keyboard, +clickstab overlayhandle=0x000001cb00000019\n'valve.steam.gamepadui.tooltip.85430002' -- 'SteamVR - valve.steam.gamepadui.tooltip.85430002 (85430002)', 0x0 not_visible VROverlayType_Basic \n flags=0x69A20000 +smoothscroll, +premult, +keyboard, +clickstab overlayhandle=0x000001cc0000001a\n'valve.steam.gamepadui.volumelevel' -- 'SteamVR - valve.steam.gamepadui.volumelevel (85430003)', 0x0 not_visible VROverlayType_Basic \n flags=0x69A20000 +smoothscroll, +premult, +keyboard, +clickstab overlayhandle=0x000001cd0000001b\n'valve.steam.gamepadui.floatingfooterLine truncated
"pause": "power.pauseCompositorOnStandby=false",
"timeout": "power.turnOffScreensTimeout=5.000000"
},
"powerRecoveryRemoved": true,
"lockReleased": true,
"cleanupErrors": []
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

+125
View File
@@ -0,0 +1,125 @@
# OBS end-to-end validation — 25 October 2026
**Passthrough: yes.** Real room pixels behind SteamVR panels appeared in the
live `/dev/video99` mirror, the saved OBS recording, and a decoded frame at
four seconds in a production MP4. The Frame was safely woken with
`vrcmd --handlewakeup`; no camera, power or compositor settings were changed.
This establishes the checked SteamVR mirror, not every game/mode or Steam's
own clips. Treat recordings as potentially showing the room.
## Environment and provenance
- Host: lxso2, Linux x86_64. Real OBS 30.0.2 in disposable Ubuntu 24.04/Xvfb,
using software llvmpipe rendering and the Media Source `ffmpeg_source`.
- Frame: SteamOS 0.5.6, build `20261022.6153909`, SteamVR 2.18.2, reachable
with the existing `ssh frame` connection. Hardware use was serialized with
coordinator mppkd9qczt through `/tmp/frame-test.lock` and a unique owner.
- Released v0.4.30 AppImage SHA-256:
`b1335bb06130f2cce64a0dd40a8cb60a52c68effc258dc4bc35f8c40c822d5bb`.
The long recording started through this app's actual Electron IPC, Python
helper and SSH stream. Robustness checks then used that released runtime
with the final changed resources and repacked `app.asar`; this was not a
newly built AppImage. No OBS plugin or host FFmpeg is required by the app.
- Windows release ZIP SHA-256:
`a393cc1653f14f162b4a3e56803f7fe9bea7b04904d18577b0b2d7d7c2d95b03`.
Checked against release SHA256SUMS; bundled Python 3.12.14.
Machine-readable measurements and the manual stimulus/analysis programs are
in [obs-validation-2026-10-25/](obs-validation-2026-10-25/).
Room images and videos remain private under `/tmp/obs-aacapv3evh` on lxso2;
only their hashes are committed in `private-artifacts.json`.
## Recording, sound, sync and latency
| Check | Measured result | What it establishes |
| --- | --- | --- |
| Real OBS recording | 187.367 s; 15,784,412 bytes; H.264 1280×720 at 30 fps; 5,621 decoded video frames; AAC 48 kHz stereo | More than three minutes through the packaged Linux path |
| OBS dropped frames | 0 encoder skips; 90 render lag/stall frames, approximately 1.6% of recording frames | The software-rendered host was not lossless; this is not a hardware-rendered performance benchmark |
| Audio | 1 kHz stimulus; FFT peak 996.094 Hz at 11.719 Hz bin resolution; peak −13.207 dBFS; 0 clipped samples; measured harmonic energy −81.32 dB relative to fundamental | Non-silent, no numerical clipping or large harmonic distortion in the checked tone; no listening or real-game quality verdict |
| Baseline A/V | Audio leads video by median 426.67 ms; range 360–426.67 ms across 36 pulses | Default OBS setup needs sync checking; not suitable for a claim of automatic accurate sync |
| Live image latency | 1,431.4 ms, n=1; clock exchange RTT 3.409 ms; screenshot polling about 20–35 ms | Overlay submission to OBS source screenshot, not physical headset motion-to-photon latency |
| Production MP4 | 5.121 s; 1920×1080, 30 fps, 153 video frames; AAC stereo; request to saved result 7.435 s | A separate production recorder saved room passthrough pixels too |
The manual stimulus places an owned black/white OpenVR marker over the mirror
and plays a 200 ms, 1 kHz tone every five seconds through the Frame's default
output. `pa_simple_get_latency` estimates when the submitted samples play;
marker submission is aligned to that estimate. This measures software output,
not an externally measured loudspeaker/physical-display event. Most submission
jitter was below 0.2 ms; compositor timing and the 30 fps/10 ms analysis grids
still limit precision. FFmpeg decodes both tracks; the analysis detects marker
edges and groups AAC pre-echo onsets within 100 ms.
A separate initial +400 ms OBS Sync Offset trial left 83.33 ms of audio lead.
Changing the offset during an already active source from 0 to +367 ms did not
improve that run (366.67 ms before, 370 ms after). Do not assume a universal
offset or that a live setting change has taken effect: reopen the source and
verify another recording. Three subsequent fresh-source trials, setting the offset **before activating**
the Media Source, measured 480 ms audio lead at 0 ms, 70 ms lead at +400 ms,
and **0 ms at +480 ms** across three pulses (30 fps video and 10 ms audio
analysis resolution). This proves a setup-specific workaround, not a universal
default. See `calibration-initial.json`. Full trial measurements are retained. Zero OBS
buffering caused missing/distorted sound and was rejected. Zero mux delay
and alternate timestamp experiments did not improve latency and were not
merged. The default capture/encoding settings remain unchanged.
## Robustness and fixes
| Failure or scenario | Fix / result | Proof |
| --- | --- | --- |
| Stop during asynchronous Python discovery could still launch later | Cancel the pending generation; expose Stop while starting | Controller regression test |
| Late stderr containing an earlier ready message changed stopping back to running | Only accept ready while starting; ignore stale child events | Original released block reproduced in `race-before.json`; controller regression |
| A non-responsive SSH process defeated timeout termination | Bounded terminate/wait then kill; SSH connection/keepalive bounds | Real SSH child deliberately stopped with SIGSTOP; clear UI failure in 15.009 s including 5 s forced cleanup; both processes gone |
| Timeout with the app's stdin still open aborted Python at shutdown | Read the control descriptor directly, avoiding a blocked buffered-stdin daemon lock | Previously reproduced fatal shutdown; final real stall shows `The Frame OBS video stopped for 10 seconds`; subprocess regression holds stdin open |
| Three Start/Stop cycles | First packets 0.890 / 0.701 / 0.709 s; Stop to idle 61.7 / 52.7 / 53.0 ms | Final patched packaged runtime, ports 15101–15103, `robustness.json` |
| Restart after stall | First packet 0.691 s | Same runtime and real Frame |
| Quit while streaming | No surviving helper at 2.021 s | Same runtime; final audit found no test FFmpeg/stimulus process |
| Port 15099 occupied | App now offers a validated alternate port and matching copyable URL | OBS occupied 15099 while real packets arrived on alternate ports; UDP cannot identify or guarantee the receiver |
| OBS before/after Start; receiver restarts | Live decoding verified, including recreated sources while relay stays active; an already-open stalled receiver may need hide/show or properties OK | Documented recovery, not automatic OBS control |
| Standby/wake | Safe wake changed a blank mirror to visible room/panels | Private mirror and saved recordings |
A forced SSH stall tests the transport failure and error/cleanup behavior.
It does **not** prove real Wi-Fi loss or full headset suspend/resume. No physical
network interface was disabled and no headset reset was performed. There is
no automatic reconnect: restore connectivity and press Start. Valid blank
standby frames do not trigger a packet timeout.
## Windows and macOS
**Windows controls remain hidden.** A disposable Windows 11 VM ran the final
helper using the released app's bundled Python and a native executable SSH
fixture. It stayed alive for three seconds without a UDP receiver, then sent
1,316-byte packets when a receiver opened. Closing its control pipe returned
exit 0 with no surviving SSH child (`windows-pipe.json`; stop measured below
the VM timer's resolution in the final run). The helper hides the SSH console
and tolerates Winsock's delayed UDP receiver-unreachable error.
The real-headset Windows attempt delivered zero packets through a temporary
host SSH bridge. Native Windows OBS, direct Windows-to-Frame SSH, firewall
behavior and packaged app Start/Stop have therefore not passed end to end.
No local FFmpeg was installed; encoding belongs on the Frame. No firewall
exception, headset authorized key, or Windows scheduled task was installed.
**macOS:** no physical Mac or macOS VM was available. Python tests and the
five controller lifecycle tests run in the macOS CI matrix; these cannot
establish capture performance, audio quality, packaged launch or OBS behavior
on a physical Mac.
## Validation and remaining limits
Local suite: **1,514 Python tests passed, 16 skipped**, 46 app tests and 18
site tests passed. The latest helper additionally passed all 11 focused OBS
tests; the controller passed all five focused lifecycle tests. Cross-platform
CI results belong to the linked PR, not these host measurements.
Still unverified: perceptual listening, real-game audio routing, accurate
default A/V sync, broad latency/performance across hosts, hours-long sessions,
physical Wi-Fi drop/full suspend recovery, physical macOS and native Windows
OBS. The app/docs now explain copyable URL/format, receiver recovery, port
selection, passthrough privacy and OBS Virtual Camera's video-only limit.
The Discord guide provides the corresponding audio-sharing choices.
Cleanup completed: Steam and vrcompositor remained running, battery 98%,
no test FFmpeg/stimulus process remained, UDP ports 15099/15101/15102/15103/15105
were bindable, task guest SSH config and the temporary bridge were removed,
and the owned headset lock was released. The disposable Windows VM was
stopped with its disk retained. See `cleanup.json`.
@@ -0,0 +1,23 @@
import json,subprocess,sys,statistics
from pathlib import Path
import numpy as np
from scipy import signal
video=Path(sys.argv[1]); root=video.parent
v=np.frombuffer(subprocess.check_output(['ffmpeg','-v','error','-i',str(video),'-map','0:v','-vf','scale=64:36','-pix_fmt','rgb24','-f','rawvideo','-']),dtype=np.uint8).reshape(-1,36,64,3)
a=np.frombuffer(subprocess.check_output(['ffmpeg','-v','error','-i',str(video),'-map','0:a','-ac','1','-ar','48000','-f','f32le','-']),dtype='<f4')
# Locate the high contrast square marker, excluding the background's low variations.
gray=v.astype(float).mean(axis=3); spread=np.percentile(gray,98,axis=0)-np.percentile(gray,2,axis=0)
y,x=np.unravel_index(spread.argmax(),spread.shape); track=gray[:,y,x]; lo,hi=np.percentile(track,[2,98]); white=track>(lo+hi)/2;onsets=np.where(np.diff(white.astype(int))==1)[0]+1
rms=np.sqrt(np.mean(a[:len(a)//480*480].reshape(-1,480)**2,axis=1)); audible=rms>.003;beeps=(np.where(np.diff(audible.astype(int))==1)[0]+1)/100
beeps=beeps[np.r_[True,np.diff(beeps)>.1]]
visual=onsets/30; offsets=[]
for t in visual:
if len(beeps):
b=beeps[np.argmin(abs(beeps-t))]
if abs(b-t)<2:offsets.append(float((b-t)*1000))
active=a[abs(a)>.003]; peaks,props=signal.find_peaks(rms,height=.003,distance=100)
# Spectrum of one well inside a tone, with Hann window; harmonic distortion estimate.
start=int((beeps[2]+.05)*48000) if len(beeps)>2 else 0;sample=a[start:start+4096];freq=np.fft.rfftfreq(len(sample),1/48000);power=abs(np.fft.rfft(sample*np.hanning(len(sample))))**2
base=power[(freq>960)&(freq<1040)].sum();harm=sum(power[(freq>h*1000-40)&(freq<h*1000+40)].sum() for h in range(2,10))
result={'duration_s':len(v)/30,'video_frames':len(v),'marker_pixel_xy':[int(x),int(y)],'marker_levels':[float(lo),float(hi)],'visual_markers_s':visual.tolist(),'audio_onsets_s':beeps.tolist(),'audio_minus_video_ms':offsets,'offset_median_ms':statistics.median(offsets) if offsets else None,'offset_min_max_ms':[min(offsets),max(offsets)] if offsets else None,'peak_dbfs':float(20*np.log10(abs(a).max())),'clipped_samples':int((abs(a)>=.999).sum()),'tone_frequency_hz':float(freq[power.argmax()]),'harmonics_to_fundamental_db':float(10*np.log10(harm/base)),'rms_peak':float(rms.max())}
(root/(video.stem+'-analysis.json')).write_text(json.dumps(result,indent=2));np.save(root/(video.stem+'-marker-spread.npy'),spread);print(json.dumps(result,indent=2))
@@ -0,0 +1,136 @@
{
"duration_s": 187.36666666666667,
"video_frames": 5621,
"marker_pixel_xy": [
50,
0
],
"marker_levels": [
0.0,
255.0
],
"visual_markers_s": [
9.766666666666667,
14.766666666666667,
19.766666666666666,
24.766666666666666,
29.766666666666666,
34.766666666666666,
39.766666666666666,
44.766666666666666,
49.766666666666666,
54.766666666666666,
59.766666666666666,
64.76666666666667,
69.76666666666667,
74.76666666666667,
79.76666666666667,
84.76666666666667,
89.76666666666667,
94.76666666666667,
99.76666666666667,
104.76666666666667,
109.76666666666667,
114.76666666666667,
119.76666666666667,
124.76666666666667,
129.76666666666668,
134.76666666666668,
139.76666666666668,
144.7,
149.7,
154.7,
159.7,
164.7,
169.7,
174.7,
179.7,
184.7
],
"audio_onsets_s": [
9.34,
14.34,
19.34,
24.34,
29.34,
34.34,
39.34,
44.34,
49.34,
54.34,
59.34,
64.34,
69.34,
74.34,
79.34,
84.34,
89.34,
94.34,
99.34,
104.34,
109.34,
114.34,
119.34,
124.34,
129.34,
134.34,
139.34,
144.34,
149.34,
154.34,
159.34,
164.34,
169.34,
174.34,
179.34,
184.34
],
"audio_minus_video_ms": [
-426.66666666666765,
-426.66666666666765,
-426.66666666666583,
-426.66666666666583,
-426.66666666666583,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666623,
-426.6666666666765,
-426.6666666666765,
-426.6666666666765,
-359.9999999999852,
-359.9999999999852,
-359.9999999999852,
-359.9999999999852,
-359.9999999999852,
-359.9999999999852,
-359.9999999999852,
-359.9999999999852,
-359.9999999999852
],
"offset_median_ms": -426.6666666666623,
"offset_min_max_ms": [
-426.6666666666765,
-359.9999999999852
],
"peak_dbfs": -13.2072114944458,
"clipped_samples": 0,
"tone_frequency_hz": 996.09375,
"harmonics_to_fundamental_db": -81.32048537168609,
"rms_peak": 0.15280573070049286
}
@@ -0,0 +1,123 @@
[
{
"duration_s": 21.033333333333335,
"video_frames": 631,
"marker_pixel_xy": [
50,
0
],
"marker_levels": [
0.0,
255.0
],
"visual_markers_s": [
4.9,
9.9,
14.9,
19.9
],
"audio_onsets_s": [
4.42,
9.42,
14.42,
19.42
],
"audio_minus_video_ms": [
-480.00000000000045,
-480.00000000000045,
-480.00000000000045,
-479.9999999999969
],
"offset_median_ms": -480.00000000000045,
"offset_min_max_ms": [
-480.00000000000045,
-479.9999999999969
],
"peak_dbfs": -13.202757835388184,
"clipped_samples": 0,
"tone_frequency_hz": 996.09375,
"harmonics_to_fundamental_db": -83.94567523863627,
"rms_peak": 0.15256504714488983,
"offset_ms": 0,
"recording": "2026-10-25 06-31-15.mkv"
},
{
"duration_s": 21.066666666666666,
"video_frames": 632,
"marker_pixel_xy": [
50,
0
],
"marker_levels": [
0.0,
255.0
],
"visual_markers_s": [
10.6,
15.6,
20.6
],
"audio_onsets_s": [
5.62,
10.53,
15.53,
20.53
],
"audio_minus_video_ms": [
-70.00000000000028,
-70.00000000000028,
-70.00000000000028
],
"offset_median_ms": -70.00000000000028,
"offset_min_max_ms": [
-70.00000000000028,
-70.00000000000028
],
"peak_dbfs": -13.215741157531738,
"clipped_samples": 0,
"tone_frequency_hz": 996.09375,
"harmonics_to_fundamental_db": -83.99685616364809,
"rms_peak": 0.15322808921337128,
"offset_ms": 400,
"recording": "2026-10-25 06-31-46.mkv"
},
{
"duration_s": 21.0,
"video_frames": 630,
"marker_pixel_xy": [
50,
0
],
"marker_levels": [
0.0,
255.0
],
"visual_markers_s": [
7.6,
12.6,
17.6
],
"audio_onsets_s": [
7.6,
12.6,
17.6
],
"audio_minus_video_ms": [
0.0,
0.0,
0.0
],
"offset_median_ms": 0.0,
"offset_min_max_ms": [
0.0,
0.0
],
"peak_dbfs": -13.219660758972168,
"clipped_samples": 0,
"tone_frequency_hz": 996.09375,
"harmonics_to_fundamental_db": -83.85259564406981,
"rms_peak": 0.15266509354114532,
"offset_ms": 480,
"recording": "2026-10-25 06-32-18.mkv"
}
]
@@ -0,0 +1,22 @@
import json,sys,time,subprocess,os
from pathlib import Path
sys.path.insert(0,'/tmp/obs-aacapv3evh');from control import OBS
r=Path('/tmp/obs-aacapv3evh');o=OBS();
try:o.request('RemoveInput',{'inputName':'Frame mirror'})
except RuntimeError:pass
time.sleep(1)
h=subprocess.Popen([sys.executable,'scripts/obs-headset-source.py','--control-stdin'],stdin=subprocess.PIPE,stderr=(r/'calibration-initial-helper.log').open('w'))
p=subprocess.Popen(['ssh','frame','XDG_RUNTIME_DIR=/run/user/1000 timeout 100 python3 /tmp/obs-aacapv3evh/stimulus.py'],stdout=(r/'calibration-initial-stimulus.jsonl').open('w'),stderr=(r/'calibration-initial-stimulus.log').open('w'))
results=[]
try:
for offset in (0,400,480):
name='Frame calibration '+str(offset)
data=o.request('CreateInput',{'sceneName':'Scene','inputName':name,'inputKind':'ffmpeg_source','inputSettings':{'is_local_file':False,'input':'udp://127.0.0.1:15099','input_format':'mpegts','buffering_mb':2,'restart_on_activate':True},'sceneItemEnabled':False})
o.request('SetInputAudioSyncOffset',{'inputName':name,'inputAudioSyncOffset':offset})
print('setting',o.request('GetInputAudioSyncOffset',{'inputName':name}),flush=True)
o.request('SetSceneItemEnabled',{'sceneName':'Scene','sceneItemId':data['sceneItemId'],'sceneItemEnabled':True})
time.sleep(7);o.request('StartRecord');time.sleep(21);rec=o.request('StopRecord');video=r/Path(rec['outputPath']).name
env=dict(os.environ,PYTHONPATH=str(r/'deps'));a=json.loads(subprocess.check_output([sys.executable,str(r/'analyse.py'),str(video)],env=env));a.update(offset_ms=offset,recording=video.name);results.append(a);print(json.dumps(a),flush=True)
o.request('RemoveInput',{'inputName':name})
finally:
h.stdin.close();h.wait(timeout=10);p.terminate();p.wait(timeout=10);(r/'calibration-initial-result.json').write_text(json.dumps(results,indent=2))
@@ -0,0 +1,88 @@
{
"offset_ms": 367,
"records": [
{
"duration_s": 19.966666666666665,
"video_frames": 599,
"marker_pixel_xy": [
50,
0
],
"marker_levels": [
0.0,
255.0
],
"visual_markers_s": [
6.133333333333334,
7.266666666666667,
12.266666666666667,
17.266666666666666
],
"audio_onsets_s": [
6.9,
11.9,
16.9
],
"audio_minus_video_ms": [
766.6666666666666,
-366.66666666666623,
-366.66666666666714,
-366.66666666666714
],
"offset_median_ms": -366.6666666666667,
"offset_min_max_ms": [
-366.66666666666714,
766.6666666666666
],
"peak_dbfs": -13.215461730957031,
"clipped_samples": 0,
"tone_frequency_hz": 996.09375,
"harmonics_to_fundamental_db": -84.12980132719696,
"rms_peak": 0.15284518897533417,
"phase": "before",
"recording": "2026-10-25 06-28-11.mkv"
},
{
"duration_s": 20.066666666666666,
"video_frames": 602,
"marker_pixel_xy": [
50,
0
],
"marker_levels": [
0.0,
255.0
],
"visual_markers_s": [
4.4,
9.4,
14.4,
19.4
],
"audio_onsets_s": [
4.03,
9.03,
14.03,
19.03
],
"audio_minus_video_ms": [
-370.0000000000001,
-370.000000000001,
-370.000000000001,
-369.99999999999744
],
"offset_median_ms": -370.00000000000057,
"offset_min_max_ms": [
-370.000000000001,
-369.99999999999744
],
"peak_dbfs": -13.167834281921387,
"clipped_samples": 0,
"tone_frequency_hz": 996.09375,
"harmonics_to_fundamental_db": -82.16381051643725,
"rms_peak": 0.15364883840084076,
"phase": "after",
"recording": "2026-10-25 06-28-34.mkv"
}
]
}
@@ -0,0 +1,16 @@
{
"bindable_udp_ports": [
15099,
15101,
15102,
15103,
15105
],
"remote_task_ffmpeg_and_stimulus_processes": 0,
"steam_and_vrcompositor_running": true,
"battery_percent": 98,
"headset_lock_released": true,
"guest_task_ssh_host_block_removed": true,
"temporary_ssh_bridge_stopped": true,
"persistent_headset_authentication_changes": false
}
@@ -0,0 +1,46 @@
{
"duration_s": 36.06666666666667,
"video_frames": 1082,
"marker_pixel_xy": [
50,
0
],
"marker_levels": [
0.0,
255.0
],
"visual_markers_s": [
9.433333333333334,
14.433333333333334,
19.433333333333334,
24.433333333333334,
29.433333333333334,
34.43333333333333
],
"audio_onsets_s": [
9.35,
14.35,
19.35,
24.35,
29.35,
34.35
],
"audio_minus_video_ms": [
-83.33333333333393,
-83.33333333333393,
-83.33333333333215,
-83.33333333333215,
-83.33333333333215,
-83.3333333333286
],
"offset_median_ms": -83.33333333333215,
"offset_min_max_ms": [
-83.33333333333393,
-83.3333333333286
],
"peak_dbfs": -13.15299129486084,
"clipped_samples": 0,
"tone_frequency_hz": 996.09375,
"harmonics_to_fundamental_db": -82.4335935832891,
"rms_peak": 0.15312190353870392
}
@@ -0,0 +1,13 @@
{
"clock": {
"rtt": 0.0034094941802322865,
"offset_remote_minus_host": -2894789.9195547644
},
"hits": [
{
"source_index": 1000,
"delay_ms": 1431.418131571263,
"query_ms": 11.743285227566957
}
]
}
@@ -0,0 +1,25 @@
{
"programs": [
],
"streams": [
{
"codec_name": "h264",
"width": 1920,
"height": 1080,
"r_frame_rate": "30/1",
"nb_read_frames": "153"
},
{
"codec_name": "aac",
"sample_rate": "48000",
"channels": 2,
"r_frame_rate": "0/0",
"nb_read_frames": "233"
}
],
"format": {
"duration": "5.121000",
"size": "3932019"
}
}
@@ -0,0 +1,10 @@
{
"elapsed_s": 7.434504003729671,
"result": {
"state": "saved",
"file": "/tmp/obs-aacapv3evh/mp4/rec-20261025-062251.mp4",
"audio": true,
"seconds": 5,
"message": "Saved rec-20261025-062251.mp4 to /tmp OBS evidence"
}
}
@@ -0,0 +1,210 @@
{
"result": {
"outputPath": "/evidence/2026-10-25 06-08-22.mkv"
},
"samples": [
{
"elapsed": 30.000104404054582,
"obs": {
"activeFps": 30.000000300000007,
"availableDiskSpace": 9068.64453125,
"averageFrameRenderTime": 18.458413,
"cpuUsage": 20.24916849878798,
"memoryUsage": 543.7109375,
"outputSkippedFrames": 0,
"outputTotalFrames": 959,
"renderSkippedFrames": 4,
"renderTotalFrames": 1783,
"webSocketSessionIncomingMessages": 14,
"webSocketSessionOutgoingMessages": 16
},
"record": {
"outputActive": true,
"outputBytes": 2243010,
"outputDuration": 30866,
"outputPaused": false,
"outputTimecode": "00:00:30.866"
},
"app": {
"state": "running",
"alias": "frame",
"error": "",
"supported": true
}
},
{
"elapsed": 60.002103955019265,
"obs": {
"activeFps": 30.000000300000007,
"availableDiskSpace": 8942.09375,
"averageFrameRenderTime": 13.660508,
"cpuUsage": 23.863888888888887,
"memoryUsage": 544.56640625,
"outputSkippedFrames": 0,
"outputTotalFrames": 1859,
"renderSkippedFrames": 5,
"renderTotalFrames": 2683,
"webSocketSessionIncomingMessages": 16,
"webSocketSessionOutgoingMessages": 18
},
"record": {
"outputActive": true,
"outputBytes": 4951606,
"outputDuration": 60866,
"outputPaused": false,
"outputTimecode": "00:01:00.866"
},
"app": {
"state": "running",
"alias": "frame",
"error": "",
"supported": true
}
},
{
"elapsed": 90.0040782331489,
"obs": {
"activeFps": 30.000000300000007,
"availableDiskSpace": 8900.6015625,
"averageFrameRenderTime": 12.110281,
"cpuUsage": 23.680555555555557,
"memoryUsage": 545.74609375,
"outputSkippedFrames": 0,
"outputTotalFrames": 2759,
"renderSkippedFrames": 13,
"renderTotalFrames": 3583,
"webSocketSessionIncomingMessages": 18,
"webSocketSessionOutgoingMessages": 20
},
"record": {
"outputActive": true,
"outputBytes": 7552329,
"outputDuration": 90866,
"outputPaused": false,
"outputTimecode": "00:01:30.866"
},
"app": {
"state": "running",
"alias": "frame",
"error": "",
"supported": true
}
},
{
"elapsed": 120.0062853959389,
"obs": {
"activeFps": 30.000000300000007,
"availableDiskSpace": 8603.08984375,
"averageFrameRenderTime": 14.892247,
"cpuUsage": 24.66111111111111,
"memoryUsage": 546.52734375,
"outputSkippedFrames": 0,
"outputTotalFrames": 3659,
"renderSkippedFrames": 13,
"renderTotalFrames": 4483,
"webSocketSessionIncomingMessages": 20,
"webSocketSessionOutgoingMessages": 22
},
"record": {
"outputActive": true,
"outputBytes": 10124530,
"outputDuration": 120866,
"outputPaused": false,
"outputTimecode": "00:02:00.866"
},
"app": {
"state": "running",
"alias": "frame",
"error": "",
"supported": true
}
},
{
"elapsed": 150.00849257130176,
"obs": {
"activeFps": 30.000000300000007,
"availableDiskSpace": 8484.58203125,
"averageFrameRenderTime": 15.3434,
"cpuUsage": 23.169444444444444,
"memoryUsage": 548.5546875,
"outputSkippedFrames": 0,
"outputTotalFrames": 4559,
"renderSkippedFrames": 78,
"renderTotalFrames": 5383,
"webSocketSessionIncomingMessages": 22,
"webSocketSessionOutgoingMessages": 24
},
"record": {
"outputActive": true,
"outputBytes": 12643085,
"outputDuration": 150833,
"outputPaused": false,
"outputTimecode": "00:02:30.833"
},
"app": {
"state": "running",
"alias": "frame",
"error": "",
"supported": true
}
},
{
"elapsed": 180.01099411491305,
"obs": {
"activeFps": 30.000000300000007,
"availableDiskSpace": 8382.75,
"averageFrameRenderTime": 31.402812,
"cpuUsage": 23.717094301899365,
"memoryUsage": 548.51953125,
"outputSkippedFrames": 0,
"outputTotalFrames": 5459,
"renderSkippedFrames": 90,
"renderTotalFrames": 6283,
"webSocketSessionIncomingMessages": 24,
"webSocketSessionOutgoingMessages": 26
},
"record": {
"outputActive": true,
"outputBytes": 15130232,
"outputDuration": 180833,
"outputPaused": false,
"outputTimecode": "00:03:00.833"
},
"app": {
"state": "running",
"alias": "frame",
"error": "",
"supported": true
}
},
{
"elapsed": 185.01674677524716,
"obs": {
"activeFps": 30.000000300000007,
"availableDiskSpace": 8366.79296875,
"averageFrameRenderTime": 22.859219,
"cpuUsage": 23.766666666666666,
"memoryUsage": 510.28515625,
"outputSkippedFrames": 0,
"outputTotalFrames": 5609,
"renderSkippedFrames": 90,
"renderTotalFrames": 6433,
"webSocketSessionIncomingMessages": 26,
"webSocketSessionOutgoingMessages": 28
},
"record": {
"outputActive": true,
"outputBytes": 15580161,
"outputDuration": 185833,
"outputPaused": false,
"outputTimecode": "00:03:05.833"
},
"app": {
"state": "running",
"alias": "frame",
"error": "",
"supported": true
}
}
]
}
@@ -0,0 +1,26 @@
[
{
"name": "2026-10-25 06-08-22.mkv",
"bytes": 15784412,
"sha256": "f2760ed28bf48274cc8c936428edbc389cd3a9f4b9cd2a61e699a04bf4487b50",
"published": false
},
{
"name": "rec-20261025-062251.mp4",
"bytes": 3932019,
"sha256": "c71de1a49b75159c587fddd012361b9e6626a4d5cc41b79696343a17b73c151a",
"published": false
},
{
"name": "mirror-wake.png",
"bytes": 1741004,
"sha256": "0754466948d5b9e8448f9ed67c8582e19802367df6ed4002afc64f42e1763f53",
"published": false
},
{
"name": "private-mp4-frame4.png",
"bytes": 1002068,
"sha256": "08d87bc9ab0e62115b42cca7dfcf7e4db11848a0ede273034a92a69297c6775b",
"published": false
}
]
@@ -0,0 +1,15 @@
{
"baseline": "d79efb4",
"after_stop": {
"state": "stopping",
"alias": "frame",
"error": "",
"supported": true
},
"after_late_stderr": {
"state": "running",
"alias": "frame",
"error": "",
"supported": true
}
}
@@ -0,0 +1,70 @@
[
{
"test": "start-stop",
"cycle": 1,
"port": 15101,
"first_packet_s": 0.890392117202282,
"packet_bytes": 1316,
"stop_s": 0.06173023069277406,
"state": {
"state": "idle",
"alias": "frame",
"port": 15101,
"error": "",
"supported": true
}
},
{
"test": "start-stop",
"cycle": 2,
"port": 15102,
"first_packet_s": 0.7008698149584234,
"packet_bytes": 1316,
"stop_s": 0.0526565620675683,
"state": {
"state": "idle",
"alias": "frame",
"port": 15102,
"error": "",
"supported": true
}
},
{
"test": "start-stop",
"cycle": 3,
"port": 15103,
"first_packet_s": 0.7092029112391174,
"packet_bytes": 1316,
"stop_s": 0.052990387193858624,
"state": {
"state": "idle",
"alias": "frame",
"port": 15103,
"error": "",
"supported": true
}
},
{
"test": "stalled-ssh",
"ssh_pid": 3025339,
"elapsed_s": 15.008651106152683,
"state": {
"state": "failed",
"alias": "frame",
"port": 15105,
"error": "OBS source stopped (1). The Frame OBS video stopped for 10 seconds",
"supported": true
},
"helper_gone": true,
"ssh_gone": true
},
{
"test": "restart-after-stall",
"first_packet_s": 0.6910299891605973
},
{
"test": "quit-streaming",
"checked_after_s": 2.020789209753275,
"surviving_helpers": []
}
]
@@ -0,0 +1,46 @@
import ctypes as C, json, math, os, signal, struct, subprocess, sys, threading, time
# Put frame_media_player.py and its two imports beside this helper on the Frame.
sys.path.insert(0, os.path.dirname(__file__))
from frame_media_player import Overlay, OverlayBusy
os.environ['XDG_RUNTIME_DIR']='/run/user/1000'
class Spec(C.Structure):
_fields_=[('format',C.c_int),('rate',C.c_uint32),('channels',C.c_uint8)]
class Attr(C.Structure):
_fields_=[(k,C.c_uint32) for k in ('maxlength','tlength','prebuf','minreq','fragsize')]
p=C.CDLL('libpulse-simple.so.0'); p.pa_simple_new.restype=C.c_void_p
p.pa_simple_new.argtypes=[C.c_char_p,C.c_char_p,C.c_int,C.c_char_p,C.c_char_p,C.POINTER(Spec),C.c_void_p,C.POINTER(Attr),C.POINTER(C.c_int)]
p.pa_simple_write.argtypes=[C.c_void_p,C.c_void_p,C.c_size_t,C.POINTER(C.c_int)]
p.pa_simple_get_latency.argtypes=[C.c_void_p,C.POINTER(C.c_int)];p.pa_simple_get_latency.restype=C.c_uint64
p.pa_simple_free.argtypes=[C.c_void_p]
err=C.c_int(); spec=Spec(3,48000,2); attr=Attr(0xffffffff,9600,0,1920,0xffffffff)
stream=p.pa_simple_new(None,b'OBS validation',1,None,b'aligned marker',C.byref(spec),None,C.byref(attr),C.byref(err))
if not stream: raise RuntimeError('pulse '+str(err.value))
vr=Overlay(); handle=vr.create('framecontrol.obs.validation.aacapv3evh',2,1.5,order=100)
quit=threading.Event(); events=[]
signal.signal(signal.SIGTERM,lambda *_:quit.set())
def wake():
while not quit.is_set():
subprocess.run(['/opt/steamvr/bin/linuxarm64/vrcmd','--handlewakeup'],stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)
quit.wait(1)
threading.Thread(target=wake,daemon=True).start()
try:
previous=False
for i in range(19000):
if quit.is_set():break
tone= i>=500 and (i-500)%500<20
block=b''.join(struct.pack('<hh',int(5000*math.sin(2*math.pi*1000*(i*480+j)/48000)) if tone else 0,int(5000*math.sin(2*math.pi*1000*(i*480+j)/48000)) if tone else 0) for j in range(480))
b=C.create_string_buffer(block)
if p.pa_simple_write(stream,b,len(block),C.byref(err)):raise RuntimeError('write '+str(err.value))
if tone != previous or i==0:
latency=p.pa_simple_get_latency(stream,C.byref(err))/1e6
expected=time.monotonic()+latency-.01
time.sleep(max(0,expected-time.monotonic()))
before=time.monotonic()
try:vr.pixels(handle,(b'\xff\xff\xff\xff' if tone else b'\x00\x00\x00\xff')*64*64,64,64)
except OverlayBusy:continue
after=time.monotonic()
event={'tone':tone,'index':i,'expected_audio':expected,'visual_submit':before,'visual_return':after,'submit_minus_audio_ms':(before-expected)*1000,'pulse_latency_ms':latency*1000}
print(json.dumps(event),flush=True); events.append(event)
previous=tone
finally:
quit.set();vr.close();p.pa_simple_free(stream)
@@ -0,0 +1,10 @@
{
"alive_without_receiver": true,
"platform": "win32",
"has_udp_connreset": false,
"packet_bytes": 1316,
"ssh_pid": 2668,
"stop_seconds": 0.0,
"helper_exit": 0,
"ssh_child_alive": false
}
@@ -0,0 +1,24 @@
# v0.4.36 release smoke on a real Frame
On 25 October 2026 at 22:59 UTC, the release branch ran
`scripts/frame-smoke.sh` from a physical Linux host against a real Steam Frame.
The script and its Python implementation were byte-identical to the
`v0.4.36` tag `1701e622dc1f9888560412a058fe816b19ca7e79`.
The headset reported Frame OS 0.5.6, build `20261022.6153909`.
The test acquired `/tmp/frame-test.lock` with a unique owner marker before
reading device status or changing test titles. Its first read showed SteamVR
activity level 3 (standby), proximity raw 6.3125, and battery 99%. The test
ran only while that lock was owned. It released only its own marker and lock
after the final cleanup.
All **13 of 13** smoke steps passed: cleanup of reserved leftovers, devkit
service read, status read, install/launch/remove for reserved ARM64, x86_64
and Windows test titles, and final cleanup. The test did not pair a key. The
test output was saved locally under `/tmp/frame-v0436-smoke-results/`; this
summary omits the headset identifier and private device status fields.
The headset was in standby. This test does not show wearer-visible game or
Framey pixels, controller input, live Decky settings, or plugin actions.
See [release v0.4.36](https://github.com/saphid/frame-control/releases/tag/v0.4.36)
for the tagged installer and checksum checks.
+69 -1
View File
@@ -26,9 +26,77 @@ The current Frame SteamVR shell does not expose Decky's Steam Deck Quick Access
Menu. A backend `Loaded` log only proves backend startup. Test any frontend
page, setting, notification, route, and controller input while wearing a Frame
before describing it as working in VR. Until a QAM bridge is verified, a Frame
Control extension is the practical route for a visible read-only VR panel.
Control extension is the simplest route for a self-contained read-only VR panel.
Frame Control now has an experimental [Framey panel host](framey-loader.md)
for API v2 Decky frontend bundles and API v1 bundles that use Decky's modern
frontend API initializer. It renders common settings controls in the
separate SteamVR dashboard panel, but Steam library and store page patches
remain unavailable. Wearer-visible use is not yet verified.
The [settings sample](../examples/framey-settings/README.md) shows an official
Decky JSX build, backend persistence, a toggle and a local toast. Framey offers
only official-store-owned plugins in its VR panel.
For persistent backend settings, use Decky's `decky.DECKY_PLUGIN_SETTINGS_DIR` rather
than assuming an environment variable or Steam Deck home path. Validate stored
types when reading, write through a temporary file before replacing the old
file, and give the panel a safe default if settings are missing or damaged.
Removing a managed plugin leaves its Decky settings behind; document how users
can reset data your plugin owns.
To test safely, use a separate Frame Control managed Decky install, verify the
ZIP digest from the official store, install one plugin at a time, and inspect
`journalctl --user -u frame-control-decky.service`. Remove only your own
plugin folder when you finish. See the current [compatibility table](decky-frame.md).
## Framey Decky API compatibility
Framey hosts a plugin's frontend in an isolated iframe in the Frame Control
SteamVR panel. The table describes the current implementation and its tests;
none of these frontend controls has passed a worn-headset check yet.
| Decky API or UI feature | Framey behavior | Verified in |
| --- | --- | --- |
| `definePlugin` with `content`, `titleView` | Renders a React panel and optional title | Local browser with ProtonDB Badges; host unit test |
| API v1 manifest with the modern Decky API initializer | Attempts to render the plugin's panel; recognized legacy IIFE bundles also use the legacy bridge | Pinned Storage Cleaner 1.4.0 archive, fake Frame install/pack test, local Chromium with stub backend. Cleanup actions were not tested. |
| Legacy Decky IIFE frontend, with no API manifest field | Wraps the returned initializer as an ES module inside the same opaque iframe; passes `serverAPI` and preserves the legacy title | MusicControl 1.1.6 exact official archive, local Chromium startup with backend methods blocked; fake Frame installation/pack/removal |
| Legacy `serverAPI.callPluginMethod(method, kwargs)` | Uses Decky's `loader/call_legacy_plugin_method` RPC, preserving keyword arguments and `{success, result}` replies | Fake Frame HTTP/CDP read/write with a synthetic backend; no official plugin backend action or worn VR result |
| Official `@decky/rollup` JSX (`SP_JSX.jsx`, `jsxs`, `Fragment`) | Creates React elements in the isolated panel | Sample bundle smoke test; host unit test |
| `PanelSection`, rows, buttons, toggles, dropdowns | Local touch-sized controls; disabled controls stay inert during a backend call | Local browser and host unit test |
| `TextField`, `SliderField`, grouped `Dropdown` options | Native text, range and select controls in the panel; disabled state, numeric slider callback and basic input types | Host unit test; worn VR use unverified |
| `Tabs`, `SidebarNavigation`, spinners, dialog/menu wrappers, progress bars | Local tab navigation and ordinary HTML controls; no Steam navigation or controller focus tree | Host tests and catalog frontend smoke checks in local Chromium |
| `SteamClient` subscriptions and `DFL.Router.MainRunningApp` | Explicit inert registration methods return disposable handles; no events or attached running game. Mutating Steam/power methods are unavailable. | Host contract tests; these are safe fallbacks, not live Steam functionality |
| `DialogCheckbox`, `DialogButtonPrimary` | Native checkbox and button controls in the panel | Host unit test; Storage Cleaner empty-data browser check |
| Optional `settings`, `frameyQuickActions` | Separate settings tab; up to eight actions with result text | Host unit test; these fields are Framey additions |
| `serverAPI.call` / `callable` | Calls only that plugin's Decky Python backend via the headset service | Fake Frame e2e for setting read/write across CEF calls, update, and reinstall; host unit test. Real Decky persistence remains unverified. |
| `toaster.toast` | Visible toast inside the plugin panel; plain text or React nodes for title, body, icon, logo and subtext; `dismiss` and optional `onClick` | Host unit test; no Steam system notification or worn VR check |
| `localStorage` | Synchronous, per-plugin cache backed by the Frame Control panel origin. Up to 64 keys, 64 KiB per value and 128 KiB total; `clear()` removes only this plugin's cache. Falls back to memory if panel storage is denied. | Parent/iframe round-trip and reopen in the local host test; real headset persistence remains unverified. |
| IndexedDB / localForage | IndexedDB is deliberately absent inside the opaque iframe so feature detection chooses the bounded localStorage driver. Plugins requiring IndexedDB directly remain unsupported. | HLTB official frontend in local Chromium: its previous `IDBFactory.open` SecurityError disappeared. No live HLTB data request was run. |
| `routerHook.addRoute` / `removeRoute`, `Navigation.Navigate` / `NavigateBack`, `useParams` | Local routes inside this plugin panel, with named segments such as `/plugin/game/:appid/:view?`; `useParams()` reads the current segment values | Host unit test; VR navigation unverified |
| `routerHook.addPatch`, global components | No-op; cannot patch Steam routes | Not applicable |
| `findModuleChild`, `Navigation.CloseSideMenus` | Steam module lookup returns `null`; close returns to this plugin's main panel | Pinned HLTB for Deck 2.0.12 entry point and shallow settings view in local host test. Steam library patch and live HLTB search remain unverified. |
| Steam library/store patches, CEF tab injection | Unavailable; no matching target in the isolated panel | Frame CEF inspection |
| `fetchNoCors`, Decky event listeners, file picker, root calls | Unavailable | Not supported by Framey |
Keep routes local to the panel and give every operation a visible result. A
plugin that calls `Navigation.Navigate('/decky/store')` will not open the
Frame Control store; only paths registered by that same plugin can navigate.
Optional route segments must be at the end. Framey accepts local path segments
only; query strings, external URLs, Steam library routes and duplicate parameter
names are rejected. Removing an active route returns to the plugin panel.
Toasts stay inside the panel, so keep essential errors in the plugin UI too.
An API v1 manifest does not guarantee a working Framey panel. Test the exact
store archive and do not assume SteamClient app details, library patches, or
destructive actions work in VR. The
[Storage Cleaner browser check](evidence/framey-api-v1-browser-2026-10-25.md)
used empty stub data and did not invoke its cleanup actions.
Use the Decky Python backend for settings that must survive browser cache loss.
The Framey `localStorage` bridge is for disposable frontend caches, including
the cache read attempted by Steam Status 1.2.3. It does not expose another
plugin's cache or the Frame Control UI key. A real Steam Status panel reopen
and a worn-headset settings check are still needed.
HLTB for Deck 2.0.12 demonstrates the limit of the panel shim: its official
bundle can start and produce a settings view with Framey's Steam module lookup
stub, but its game page and context menu patches have no Steam target in the
isolated panel. The tests do not call its HLTB network search or Python backend.
Do not claim game length badges work in VR from this result.
+197
View File
@@ -0,0 +1,197 @@
# Framey loader on Steam Frame
Framey is an experimental bridge for Decky store plugins inside Frame Control's
SteamVR dashboard panel. It is opt in. The panel and Decky backend are ordinary
user services under `~/.local/share/frame-control`; neither needs root or a
read-write SteamOS root filesystem. Decky's standard Quick Access menu still
does not appear in the separate SteamVR CEF target.
## Use in the headset
Install **Frame Control in VR** and **Decky Loader on Frame** from Frame Control
on your computer. Open the Frame Control tab in SteamVR, then choose **Decky
plugins → Open official store**. Search the catalogue, confirm an install, and
choose **Open panel** from the installed plugin list. The panel contains the
plugin's own controls and settings. Update and Remove affect only plugin
folders that Frame Control's store manager installed.
Removing a plugin keeps its Decky settings. Removing the Frame Control headset
panel or Decky backend keeps plugin folders until each is removed separately.
Frame Control's existing official-store manager downloads a published ZIP from
Decky's content-addressed CDN, verifies its store SHA-256 hash and manifest,
rejects unsafe ZIP members, path collisions, special files and root plugins,
and swaps one managed plugin
folder with rollback on failure. It rejects non-ARM64 ELF and Windows binaries.
The Decky user service restarts after a file change. Framey's panel host accepts
API v2 bundles and API v1 bundles using Decky's modern frontend initializer,
with `dist/index.js`. Legacy `(function (...) {...})(DFL, SP_REACT)` bundles are
also accepted: their returned initializer receives the legacy `serverAPI`, and
keyword backend calls use Decky's legacy RPC. The wrapper runs as a blob ES
module inside the same sandbox; it does not require `eval`. Other installed plugins remain manageable but have no
Framey panel. API v1 admission is a compatibility attempt, not a guarantee
that the plugin's controls work in VR. The store manager does not currently
screen a plugin's runtime network downloads.
## What the compatibility host supplies
The plugin bundle runs in an opaque-origin iframe in the Frame Control SteamVR
panel. It receives React 18.3.1, a small `DFL` panel-control shim, and the
Decky API v2 `call`/`callable` interface. Backend methods are sent by the
authenticated parent to Steam's existing `SharedJSContext` CDP client, then
through Decky's *existing* websocket connection. Framey never opens a second
Decky websocket, because Decky allows only one frontend connection. The iframe
does not receive Frame Control's UI key. React and ReactDOM are bundled for
offline use under their MIT licenses in `ui/vendor`.
Framey gives each plugin a bounded `localStorage` substitute because browser
storage is denied to an opaque-origin iframe. The parent panel keeps a separate
cache for each plugin: up to 64 keys, 64 KiB per value and 128 KiB total. It
restores the cache when a panel reopens if the parent's browser storage is
available. If storage is denied or cleared, the cache lasts only for the current
panel. Use the plugin backend for settings that must survive cache loss.
The host currently supplies sections, rows, buttons, toggles, text fields,
sliders, grouped dropdowns,
scroll containers, a modal, locale information, local panel routes and toasts,
and backend calls for the plugin that owns the panel. Steam library/store page
patches, global Steam UI components, file pickers, and privileged root methods
have no VR target. A plugin that depends on them can render only part of its UI
or show an incompatibility message. A Decky plugin's Python backend still runs as
the headset user when Decky loads it, so review third-party code before opting
in. The panel iframe can make HTTPS requests subject to ordinary browser CORS.
ProtonDB Badges' current API v2 bundle rendered its settings in a local Chromium
browser with a stubbed backend reply on 25 October 2026. Its controls accepted
pointer input. This does **not** verify SteamVR visibility, controller input,
live Decky settings persistence, or badges on Steam game pages. The last item
has no supported injection target in the Frame Control panel.
The [browser and fake Frame evidence](evidence/framey-browser-2026-10-25.md)
records exactly what was exercised.
The pinned official Steam Status 1.2.3 frontend also
[rendered in local Chromium](evidence/framey-steam-status-browser-2026-10-25.md)
with a stubbed settings reply. Its public status request worked, but its cache
logged `localStorage` errors in Framey's v0.4.34 opaque iframe. A later
[local browser check](evidence/framey-session-cache-2026-10-25.md) confirmed
that a panel-lifetime substitute avoids those errors while preserving the
opaque origin. A [second browser check](evidence/framey-cache-browser-2026-10-25.md)
tested the per-plugin cache after reopening a panel. These checks used a stub
backend and no worn headset.
Fake Frame CI also installs and removes pinned official ProtonDB Badges 1.3.4,
Steam Status 1.2.3, and Storage Cleaner 1.4.0 archives, checks their API v1/v2
manifests and frontend bytes, and verifies they can be packed as Framey panels.
It does not execute their actual backend code or prove their frontend controls
work in VR. Storage Cleaner rendered an
[empty-data panel in local Chromium](evidence/framey-api-v1-browser-2026-10-25.md).
Its cleanup actions were not tested; they may remove local game saves.
Framey also supplies local tabs/sidebar pages, spinners, dialog/menu wrappers
and progress bars. Its explicit SteamClient subscription fallbacks return
disposable handles without emitting fabricated events. There is no attached
running game in `DFL.Router`, and power, app launch and hardware mutation methods
are not supplied. Plugins that need live Steam stores still require integration
work. IndexedDB is hidden because the browser exposes it but denies access in
an opaque iframe; localForage can then select Framey's bounded localStorage.
Direct IndexedDB users remain unsupported.
The fake Frame integration test now writes a Decky setting through Framey's
scoped backend endpoint, reads it in a new CEF request, updates the plugin,
then checks it again. It also confirms removal blocks method calls and a
reinstall can read the retained setting. This tests the bridge and fixture;
real Decky settings persistence on a worn Frame is still unverified.
The in-headset **Open official store** view loads the full official catalogue.
Search matches names, authors, and descriptions. Filters show non-root plugins
or installed plugins, and Previous/Next buttons browse 20 results per page.
The root label is a compatibility warning; other APIs are checked only when a
plugin is opened. Both `root` and `_root`
store tags mark a plugin as needing root, and duplicate store IDs are omitted
because an ID alone could select a different archive than the visible row.
The store still needs the managed Decky user service running
before its Install or Update buttons are enabled. If a plugin prevents Decky
from starting, Remove remains available for Frame Control-owned plugins while
the managed service is stopped; it does not restart the service.
Install, Update, and Remove show the current job stage in the headset panel.
The store verifies each downloaded archive and the headset applies it with a
rollback if Decky cannot start. The panel remembers the current job ID for this
browser session, so **Check result** can resume polling after a navigation or
temporary connection error. Refresh the installed list before starting another
operation after an error. The headset panel and desktop app send the hash of
the version you saw; if the official store changes that version before the job
starts, Frame Control stops before downloading or changing the headset. Refresh
the store and review the new version before retrying. If Frame Control restarts, it cannot recover the old
job result. The panel clears that job ID and asks you to refresh the installed
list before making another change.
## For plugin authors
Start with the [Framey settings sample](../examples/framey-settings/README.md)
for a buildable Decky API v2 panel and Python settings backend.
Publish a normal [Decky store](https://plugins.deckbrew.xyz/) API v2 release
with `plugin.json`, a single `dist/index.js` ESM frontend entry point, and a
Python backend if needed. Give the frontend a `content` React element returned
by `definePlugin`, and build settings as panel controls from `@decky/ui`.
Backend calls through `@decky/api` reach only that plugin's own backend.
For best VR compatibility, keep the panel self-contained and use `PanelSection`,
`PanelSectionRow`, `ButtonItem`, `ToggleField`, and `DropdownItem`. Handle a
missing Steam UI route, store overlay, or `SteamClient` object gracefully.
Avoid root, remote binary downloads, Steam library patches, and assumptions
about Steam Deck hardware. Declare settings defaults so a fresh user service
can render without pre-existing files. Test your ZIP with the store validator
and the fake Frame flow before asking users to install it.
An API v2 plugin's normal `content` is its default VR panel. Framey also shows
an optional `settings` React element under a **Settings** tab and an optional
`titleView` above it. For one-tap headset controls, return
`frameyQuickActions: [{label: 'Refresh data', onClick: refreshData}]` from the
plugin initializer. Framey displays up to eight actions and reports a pending,
success, or failure state. These descriptor fields are Framey additions; Decky
ignores them. Use a plugin backend method through `@decky/api` for work needing
persistent state, and keep a quick action safe to repeat.
See the [API v2 compatibility table](frame-plugin-author.md#framey-api-v2-compatibility)
for tested behavior and remaining limits.
The [Frame Control extension API](extensions.md) is an alternative for a
Frame-specific panel. It needs only a local manifest, HTML, and the read-only
`status` bridge; it does not need Decky.
## Removal
Use **Remove** on each installed Framey plugin, then **Remove managed Decky**
and **Remove** under Frame Control in VR. These operations remove only
Frame Control-owned folders and services. Settings, the Chromium profile, and
other users' plugins are preserved. To remove one managed plugin manually,
first inspect its `.frame-control-store.json` receipt in
`~/.local/share/frame-control/decky/plugins/<folder>`, then delete only that
folder and run `systemctl --user try-restart frame-control-decky.service`.
The Decky and headset service manual removal commands are in
[Decky on Frame](decky-frame.md#opt-in-and-remove) and
[Frame Control in the headset](headset-app.md#remove).
## Fast worn-headset check
With an already installed Framey plugin and someone wearing the headset, run
`python3 scripts/framey-worn-check.py --worn-confirmed` from a paired computer. The script
atomically acquires `/tmp/frame-test.lock` before reading battery or SteamVR
activity. If another job owns the lock, it makes no sensor reads. It releases
its own lock without starting the interaction when the headset is in standby.
Within 35 seconds, use a controller
to open a managed plugin panel and touch one setting. The script records a
fresh trusted pointer event, the panel-ready event, SteamVR overlay visibility,
and a stereo screenshot with varied pixels. It deletes its own short-lived
challenge and releases only its own lock. It records the screenshot hash and
color count, then removes the private temporary image from both devices.
Pixel variety alone cannot prove the UI text was legible; a person must still
confirm the view in the headset. The script does not install or remove a plugin,
alter Steam settings, or wake the headset.
## Unattended VR checks
The [unattended check](framey-vr-check.md) can wake, inspect and capture the
real compositor, send OpenVR mouse input, and exercise a temporary sample
against live Decky with restoration and shared-lock protection. Its
[device evidence](evidence/framey-vr-2026-10-25/README.md) distinguishes these
checks from physical controller and wearer validation. A trusted pointer event
and active-headset telemetry are both reproducible without wearing the Frame;
they must not be labelled as physical controller proof.
+115
View File
@@ -0,0 +1,115 @@
# Checking Framey without wearing the Frame
Use the existing paired SSH alias, directly or through lxso2. Start with the
read-only check, then a temporary wake. A full input exercise is opt in:
```sh
python3 scripts/framey-vr-check.py --via lxso2 --output /tmp/framey-inspect
python3 scripts/framey-vr-check.py --via lxso2 --wake --output /tmp/framey-wake
python3 scripts/framey-vr-check.py --via lxso2 --exercise --output /tmp/framey-exercise
```
Omit `--via` when the computer can already `ssh frame`; use `--host` for another
paired alias. No SSH trust or credentials are changed. The output folder is
private by default. Stereo screenshots and the OBS mirror can contain room
pixels. Review/redact them before committing or sharing. JSON reports have
screenshot hashes and no UI access keys.
The runner acquires `/tmp/frame-test.lock` by atomic `mkdir`, writes a random
owner, then reads battery and SteamVR state. A foreign lock prevents sensor
reads, wake, installation and input. Unknown battery or below 20% aborts.
Battery is read again before release. The default check never wakes or
installs anything; it returns nonzero when the panel is absent/hidden.
`--wake` saves the exact current `power.pauseCompositorOnStandby` and
`power.turnOffScreensTimeout`, sets them to `0` and `120`, calls the supported
`vrcmd --handlewakeup` and requests the Frame Control dashboard panel. It reads
OpenVR state, captures a stereo compositor screenshot through the production
`ui/frame_vrshot.py` API, and captures `/dev/video99`, the same SteamVR mirror
used by OBS. The mirror reader drains 60 frames before selecting its image,
because the first loopback buffer can contain a previous session. It restores the saved power values and reads them back. It hides
the test dashboard if the dashboard was originally closed. It does not change
the proximity sensor, tracking driver, display hardware, root filesystem,
room setup, or spatial panel placement. An unreachable suspended Frame still
needs a physical wake; an SSH command cannot reach it.
`--exercise` requires the managed headset panel and Decky services to be absent;
it refuses to replace an existing installation. It creates a random test
plugin folder, checks that its settings folder does not exist, and installs
the repository's actual sample frontend/backend, with only the plugin name
and receipt changed to distinguish this test. It installs the verified official
ARM64 Decky release through Frame Control's existing installer, followed by the
normal headset app bundle. Only the test bundle's browser startup is modified:
loopback-only `--remote-debugging-port=0` and a disposable `/tmp` browser profile.
Production browser startup is unchanged. Decky's installer can reload Steam's
web helper; this is not a Steam/SteamVR restart, but its current UI can change.
The test should run while the headset is unattended.
CDP opens the actual plugin through `openFrameyPanel`, observes the opaque
iframe through its own debugging target, and reads control geometry. OpenVR's
`IVROverlayView_003.PostOverlayEvent` supplies mouse move/down/up to the
actual gamescope overlay. The check verifies delivery to the intended element
and a trusted pointer event, toggles the sample, reads its real Decky settings
file, reopens a fresh iframe, and checks the saved value. It also clicks the
Settings/Panel tabs and quick action. A smooth-scroll event is attempted and its measured scroll offset is reported.
Temporary controls exercise the shipped
`DFL.SliderField` and `DFL.TextField`; their values remain UI-only. Text uses
CDP `Input.insertText` after OpenVR pointer focus. This is synthetic input,
not proof of a physical controller or the SteamVR virtual keyboard.
SteamVR can leave a recreated panel hidden with a stale focus request. The
exercise retries once by removing and reapplying `STEAM_GAME` on its own test
browser window, then requests focus again. It never retags another application.
The report records whether this recovery was needed. Registration, dashboard
visibility, actual panel visibility, and pixel capture are separate checks.
A visible docked panel can report `IsDashboardVisible=false` and
`IsActiveDashboardOverlay=false`. A zero-sized main texture or failed image
read must not be described as a texture-refresh measurement. The compositor
before/after images provide independent pixel evidence.
Normal cleanup removes only the test-created managed services and random
plugin/profile paths, restores power, cancels its power watchdog, checks battery
and settings, then releases its own lock. A four-minute independent systemd
user timer restores the saved power values even if the controlling process is
killed or disconnected. It deliberately leaves the lock and test artifacts
for recovery. `recovery.json` records the host, owner, timer, remote restore
script and original values as soon as the timer starts. The final report is
`result.json`. Cleanup errors force a nonzero exit and retain the lock; inspect
that report before manually releasing it. Never remove another job's lock.
A power watchdog is not a promise to complete service cleanup after a hard
kill. The next owner must finish that recorded cleanup first.
Exit 0 means the requested machine checks and cleanup passed. It never means
a wearer has approved readability, comfort, controller rays, haptics or text
entry on the VR keyboard. The [real-device evidence](evidence/framey-vr-2026-10-25/README.md)
records the exact tested version and limits. No public CI runner should contact
the shared headset: run this command on a paired, serialized self-hosted worker.
Ordinary CI runs `tests/test_framey_vr_check.py`, the sample backend tests, and
the same-plugin navigation regression without a headset.
## Three-minute worn checklist
1. **0:00–0:30:** Coordinate the shared lock. With an installed managed panel,
Decky backend and harmless sample, wear the headset and open SteamVR →
Frame Control. Check the panel is in front of you, both eyes agree, text is
legible, and the size is comfortable. Do not use a save-cleaning plugin.
2. **0:30–1:15:** Run
`python3 scripts/framey-worn-check.py --via lxso2 --worn-confirmed`. Within its 35-second
interaction window, use the physical controller to open the sample and
toggle **Example setting**. Confirm the laser aims where expected and the
script records a fresh input/panel event and visible stereo output. The flag
is the operator’s statement; sensor activity and trusted pointers can also
be produced synthetically and cannot identify controller hardware.
3. **1:15–2:15:** Use the controller to open Settings, return to Panel, invoke
**Read saved setting**, close/reopen the plugin, and confirm the value
remains. Try controller scroll, a slider and a harmless text field in an
installed compatible plugin; check SteamVR's actual keyboard and Back.
4. **2:15–3:00:** Restore the original sample setting. Switch away and back,
close/reopen the Frame Control panel, and confirm controller input still
works. Record comfort/legibility, controller model, any haptic behavior,
keyboard behavior and the command's JSON separately. Confirm battery and
release only your lock. Do not infer these human checks from synthetic input.
The watchdog's creation and cancellation are exercised on the real Frame.
A forced host kill/network loss followed by timer recovery has not been fault
injected. Its saved recovery script remains available on a cleanup failure.
+12 -2
View File
@@ -14,8 +14,13 @@ panel. **Show in SteamVR** requests that dashboard tab; the wearer can select
it again from SteamVR's dashboard. Closing the panel stops its browser and
server. The service is not enabled at boot.
The page shows battery, free home storage and SteamVR status. It can request
SteamVR's main Game Mode dashboard, list and force quit a running game after an
The page shows battery, free home storage and SteamVR status.
The **Large status screen** uses large read-only values for battery, SteamVR,
free home storage and Frame OS, with a refresh button and clear unknown values.
It is an at-a-glance view, not a crash diagnosis or a Decky plugin page.
The headset must still be worn to verify that a person can see and use it.
The page can request SteamVR's main Game Mode dashboard, list and force quit a running game after an
unsaved-progress confirmation, save an OpenVR screenshot to
`~/Pictures/FrameControl`, and record the SteamVR mirror to
`~/Videos/FrameControl`. Recordings have a 20-minute limit and use a separate
@@ -28,6 +33,11 @@ It offers the version 1 read-only `capabilities` and `status` bridge from
[the extension guide](extensions.md). Installing an extension still means
copying its folder to the Frame; the panel does not download third-party code.
The opt-in [Framey loader](framey-loader.md) hosts compatible Decky plugin
panels and settings in a separate sandboxed iframe on this SteamVR page. The
existing official Decky store manager installs and removes their code. The
frontend host is browser-tested, but wearer-visible VR use remains unverified.
The panel also lists Decky plugins and can install, update, or remove compatible
plugins from the official store when the opt-in managed loader is running.
Each change asks for confirmation. The Frame VR shell does not show Decky's
+1
View File
@@ -31,6 +31,7 @@ Lepton (Android 11, podman container "lepton-dev") ← its own panel, app 305600
| `gamescopectl screenshot <file>` (with `WAYLAND_DISPLAY=gamescope-0`) captures gamescope's flat layer. | Frame Control's capture |
| The **headset view** (both eyes, fully composited: room, panels, dashboard, controllers) comes from OpenVR `IVRScreenshots::RequestScreenshot(VRScreenshotType_Stereo)`. It's callable from `python3` with `ctypes` against `/opt/steamvr/bin/linuxarm64/libopenvr_api.so` as an overlay app. The compositor appends `.png`, writing a 1920×1080 side-by-side image (960×1080 per eye) plus a left-eye preview, in about 0.3s. In standby the frame is blank. `vrcmd --screenshot` and `vrcmd --compositorcmd screenshot_request` wrote nothing, even with `steamvr/rawCapturePath` set. | `ui/frame_vrshot.py` |
| SteamVR's `steamvr-v4l2cam.service` (`/opt/steamvr/bin/linuxarm64/v4l2cam --output=99`) copies the headset view (the `system.HeadsetView` mirror, one undistorted image) into the v4l2loopback device `/dev/video99` ("SteamVR"), 1920×1080 RGB24. `ffmpeg -f v4l2 -i /dev/video99` reads it at about 70 new frames/s; the first frame read can be black. The Frame's hardware encoder (`iris_encoder`, `/dev/video-enc0`) crashes ffmpeg's `h264_v4l2m2m`, so encode with `libx264 -preset ultrafast -tune zerolatency`: 720p30 takes about 0.7 of a core and 1080p60 about 1.7 (of 8). gamescope also publishes a PipeWire `gamescope` video source, but the Frame's GStreamer has no `pipewiresrc`. **Verified 2026-09-26.** | Frame Control's live video (`/api/stream`) |
| **Passthrough in the mirror: yes on SteamOS 0.5.6**, build `20261022.6153909`, SteamVR 2.18.2. After `vrcmd --handlewakeup`, `/dev/video99` showed real room pixels behind panels. They also appeared in OBS's saved recording and a five-second production MP4. No camera setting was changed, and the private room images were not published. Other games/modes and Steam clips were not established. **Verified 2026-10-25.** | [OBS validation](evidence/obs-validation-2026-10-25.md) |
| Battery: `/sys/class/power_supply/max1720x_bat_7-36` gives µV/µA (current is positive while charging), `time_to_full_now`/`time_to_empty_now` in seconds, and `temp` in tenths of °C. The charger shows up as `tcpm-source-psy-…` (`type=USB`, `usb_type=C PD [PD_PPS]`), for example 12 V × 1.67 A. | Frame Control's battery card |
| `vrcmd --stats` reports `activity_level` (3 = standby). | Telling whether the headset is being worn |
| **Testing VR apps without wearing the headset.** In standby SteamVR keeps OpenXR sessions hidden, so they render one frame and stop. `vrcmd` (in `/opt/steamvr/bin/linuxarm64`) settings use `section.key`: `vrcmd --set-settings-bool power.pauseCompositorOnStandby 0` and `vrcmd --set-settings-float power.turnOffScreensTimeout 3600`, then `vrcmd --handlewakeup`, keep the compositor running, and the scene app becomes visible. If it stays `visible-blurred`, the Steam dashboard is open: `SteamClient.OpenVR.VROverlay.HideDashboard()` in Steam's `SharedJSContext` (CDP on 8080) closes it. The headset view then captures with `ui/frame_vrshot.py`. Restore afterwards with `--set-settings-bool power.pauseCompositorOnStandby 1` and `--set-settings-float power.turnOffScreensTimeout 5`. The bool setter reads `true` as false, so use 1/0. A Steam launch that stalls in standby at `ShowInterstitials` or `CreatingProcess` (see `console_log.txt`) continues with `SteamClient.Apps.ContinueGameAction(<action id>, "<appid>", "<task>")`. **Verified 2026-09-27.** | Proving VR output remotely, [webxr-chromium.md](webxr-chromium.md) |
+43 -9
View File
@@ -1,7 +1,7 @@
# Headset view in OBS
Frame Control can send SteamVR's headset mirror and the Frame's output audio to
OBS on a Windows, Linux or macOS computer. The helper uses the same `/dev/video99` video
OBS on a Linux or macOS computer. A checkout helper is also available for Windows tests. The helper uses the same `/dev/video99` video
source and default-output monitor as **Capture & Live → Record**. It sends a
local MPEG-TS stream; no port is opened to the LAN or internet.
@@ -11,7 +11,10 @@ local MPEG-TS stream; no port is opened to the LAN or internet.
**Start OBS source**. Keep Frame Control open; **Stop OBS source**, switching
headsets, or quitting the app closes its SSH stream. It uses the selected
headset and the app's bundled helper.
3. In OBS, add a **Media Source**, clear **Local File**, set **Input** to
3. Expand **OBS setup** in the app to copy the Input URL and format. The port
can be changed before Start if another program uses 15099. Use that same
port in OBS. The sender cannot identify which program is listening.
4. In OBS, add a **Media Source**, clear **Local File**, set **Input** to
`udp://127.0.0.1:15099`, and set **Input Format** to `mpegts`. The source
carries video and AAC audio. Use OBS's audio mixer to choose monitoring and
recording levels.
@@ -24,9 +27,12 @@ run:
```
Ctrl+C stops the checkout helper. The app closes a control pipe when you click
Stop or quit; the helper then closes its SSH child, including on Windows. On
Windows, install Python 3 and OpenSSH Client if Frame Control cannot find them.
The Windows app Start/Stop path still needs a physical Windows/Frame test.
Stop or quit; the helper then closes its SSH child, including on Windows. Encoding runs on the Frame; the computer does not need FFmpeg. The desktop
app bundles Python. A source checkout needs Python 3.8+ and OpenSSH Client.
The Windows button is hidden: native Windows/Frame streaming and OBS have
not passed an end-to-end test. A Windows 11 VM passed the helper control-pipe,
late UDP receiver and child-cleanup fixture; its real-headset bridge delivered
zero packets. These are separate results, not native Windows support.
If no first packet arrives within 20 seconds, or an active stream sends no
packet for 10 seconds, the helper closes SSH and shows an error instead of
leaving **Start OBS source** waiting or a frozen source running indefinitely.
@@ -43,18 +49,22 @@ udp://127.0.0.1:15099` in a second terminal while the helper is running.
This is the composited, undistorted one-eye **SteamVR mirror**, not a raw
passthrough camera feed. The mirror may be blank when the headset is idle or
unworn. Whether active passthrough pixels appear in it is still unverified.
unworn. **Room passthrough is verified** in this mirror and the saved OBS/MP4 outputs
on SteamOS 0.5.6 after a safe SteamVR wake. Check the picture before sharing;
other games and modes may differ.
The helper does not send a microphone. It is designed for one local OBS
receiver. **Verified 2026-10-25:** the helper bundled in the Linux AppImage
sent a real Frame stream to OBS 30's Media Source. OBS recorded 37.6 seconds
with H.264 video and AAC audio; a brief 440 Hz tone played to the Frame's
default output was present in the saved audio. The headset was in standby, so
the video showed the standby mirror. Nobody listened to OBS's monitoring output,
and audio/video sync and active passthrough remain unverified. See the
the video showed the standby mirror. That initial check did not assess listening quality, A/V sync or active
passthrough. The full validation below supersedes those gaps with measurements
and a positive passthrough result, while listening remains unverified. See the
[test evidence](evidence/obs-media-source-real-2026-10-25.md).
The [follow-up Linux/Frame transport check](evidence/obs-followup-2026-10-25.md)
measured packet continuity and a short MP4 recording on the current SteamOS
build. The headset was still in standby.
build. The newer [full OBS validation](evidence/obs-validation-2026-10-25.md)
records more than three minutes and measures audio, sync, latency and cleanup.
## SteamOS / Steam Machine PC host
@@ -108,3 +118,27 @@ The real Frame/OBS check above proved that a synthetic tone from the Frame's
output reached the Media Source recording. It did **not** use a running game,
listen to the audio, reproduce the reported Game Capture failure, or measure
audio/video sync. Real game audio while the headset is awake remains unverified.
## Check sync and recover a blank source
Make a short recording of a visible click, clap or other simultaneous marker
and sound before streaming. Open **Advanced Audio Properties** in OBS. If audio
arrives early, hide/deactivate this Media Source, add a positive **Sync Offset
(ms)** in Advanced Audio Properties, then show/reactivate it, record again,
and check the result. Changing the offset during playback did not correct
the tested OBS 30 source. Setting it before activation did: a +480 ms offset
reduced a 480 ms lead to 0 ms within the test resolution in three pulses. The 2026-10-25 Linux software-rendering test measured
about 0.4 seconds of audio lead with default OBS settings. This is a measured
setup result, not a universal offset. Do not apply it blindly to another host.
Start Frame Control's source before adding or activating the OBS Media Source.
After Stop/Start or a connection failure, hide and show the Media Source, or
reopen its properties and click OK, to reopen its UDP receiver. Keep only one
receiver on a port. If another application owns 15099, stop the relay, choose
another port in **OBS setup**, and change the OBS Input to match. Sending UDP
packets does not confirm that OBS has received or decoded them.
A stalled stream ends with an error. Wake or reconnect the Frame and press
Start again; automatic reconnection is not implemented. Standby can produce
valid but blank frames, so it does not necessarily trigger a packet timeout.
A fully suspended Frame cannot be woken over an unavailable SSH connection.
+4 -4
View File
@@ -20,10 +20,10 @@ compatibility](steamos-2026-10-compat.md). For the charge-limit result, see
No charging control was written. An 80% limit is **not supported** by Frame
Control; see [charge-limit.md](charge-limit.md) and the
[headset check](evidence/round3-headset-2026-10-25.md).
- Active passthrough in the recording mirror remains **unknown**: the only
captured mirror frame was uniform while the headset was unworn in standby.
A worn, active passthrough check is still needed; see the
[headset check](evidence/round3-headset-2026-10-25.md).
- Passthrough in the MP4 and OBS mirror is **verified on 0.5.6**: after a safe
SteamVR wake, room pixels appeared behind panels in the actual mirror and
saved outputs. Per-game behavior and Steam's own clips remain unverified;
see the [OBS validation](evidence/obs-validation-2026-10-25.md).
## Verified on device (2026-09-25)
+12 -11
View File
@@ -52,18 +52,19 @@ Recording and **Live** can run together; both read the same device.
### Does Record include passthrough?
**Record captures SteamVR's `system.HeadsetView` mirror from `/dev/video99`.**
Frame Control does not open the headset's passthrough cameras or add a separate
camera layer to the MP4. If SteamVR puts passthrough into that mirror, it will
appear in the recording; Frame Control cannot force or promise that result.
Steam's own **Steam clips** use a separate game recording path and may differ.
**Yes, the MP4 recording and OBS mirror can include room passthrough.** On
25 October 2026, SteamOS 0.5.6 build `20261022.6153909`, a safe SteamVR wake
produced real room pixels behind panels in `/dev/video99`. Room pixels also
appeared in decoded frames of both the OBS recording and a five-second MP4
made with the packaged production recorder. The private room images are not
published. See the [test record](evidence/obs-validation-2026-10-25.md).
On 25 October 2026, the Frame was in standby. A frame captured from
`/dev/video99` was black, as expected in standby, so this check **did not
establish whether active passthrough appears in the mirror**. A wearer-visible
passthrough session and its simultaneous mirror frame are still needed for a
yes-or-no answer about passthrough pixels. See the
[live compatibility evidence](evidence/steamos-compat-live-2026-10-25.md).
Both paths read SteamVR's `system.HeadsetView` mirror. Frame Control does not
open raw passthrough cameras or add a camera layer. The observed mirror includes
SteamVR's composited room and panels; it is not limited to a game's image.
This does not promise that every game or passthrough mode appears the same way.
The mirror can be blank in standby. Steam's own **Steam clips** use a separate
game recording path and were not checked for passthrough in this test.
## Steam clips
+6
View File
@@ -20,6 +20,12 @@ count. So a build reaches people only when you publish it, after testing it.
GitHub temporarily show its tag as `untagged-…`. The workflow finds that
draft by its exact version title, restores the tag association and retries
the affected upload; it refuses ambiguous matches.
The Linux build runs `scripts/check-appimage-launch.py` before upload. It
starts the built x86_64 AppImage on an isolated Xvfb display, checks that
its bundled server answers, and checks that the server stops on exit. The
check disables telemetry and update requests, and keeps extraction in its
temporary profile. This CI test does not test a physical display, FUSE mount
or a headset.
2. Download the draft's installers and test them. An installed copy of the
previous version won't offer the draft, so install it directly.
+1 -1
View File
@@ -17,4 +17,4 @@ Frame Control sends the Frame's **output audio**, not its microphone. Discord
audio routing differs by computer and requires a separate virtual audio device
if you want game sound in the call. This guide has not been verified in a real
Discord call. The SteamVR mirror can be blank while the headset is idle, and
active passthrough in that mirror remains unverified.
the mirror can include real room passthrough behind panels. Check the scene before sharing.
+1
View File
@@ -0,0 +1 @@
node_modules/
+53
View File
@@ -0,0 +1,53 @@
# Framey settings sample
This is a small Decky API v2 plugin for authors. Its panel uses the official
`@decky/api`, `@decky/ui`, and `@decky/rollup` packages. A toggle calls a Python
backend method, stores one boolean under `decky.DECKY_PLUGIN_SETTINGS_DIR`,
and reads it back when the panel opens. The backend rejects other keys and
values. The frontend also shows a local toast after a successful save. A
Framey settings tab exposes the same toggle, and a read-only quick action
fetches the saved value without changing it. These two fields are Framey
additions; Decky's own menu still uses the main panel content. The quick
action calls the backend, so it reads the persisted setting rather than a
browser cache. A missing, damaged, or old non-boolean value reads as the
caller's default;
the next save atomically replaces the sample's settings file.
The **About this setting** button opens a local detail page at
`/framey-sample/details/saved-setting`. It demonstrates `routerHook.addRoute`,
`Navigation.Navigate`, `useParams`, `NavigateBack`, and removal of the route in
`onDismount`. The `:topic?` segment is optional. Framey keeps this navigation
inside the plugin panel; it does not open a Steam library page. Put optional
segments at the end of the path and do not use query strings. This detail page
has not been checked with headset controllers.
## Build
From this directory, run:
```sh
pnpm install --frozen-lockfile
pnpm build
pnpm exec tsc --noEmit
```
The committed `dist/index.js` is the built frontend. For a Decky release ZIP,
put `plugin.json`, `main.py`, and `dist/index.js` inside one top-level plugin
folder. Publish it through the official Decky store if you want Frame Control's
managed installer to offer it. Framey deliberately opens only plugins that the
official store installed and marked as owned; copying this example into the
plugin directory does not enable its VR panel.
## Test and adapt
Run `python3 -m unittest discover -s tests -p test_framey_sample.py` from the
repository root. It checks backend persistence and evaluates the built bundle
against Framey's actual host script, including the quick action's scoped
backend call and local route registration/navigation. The fake Frame store flow is exercised by
the repository's e2e suite. No worn-headset visibility or controller-input test
has passed for this sample yet.
The plugin needs no root access or system changes. Its settings remain after
the managed plugin folder is removed, following Decky's settings behavior.
For a production plugin, add explicit migrations for every supported schema,
explain how users can reset settings, and test every UI path in a worn headset.
+91
View File
@@ -0,0 +1,91 @@
const manifest = {"name":"Framey Settings Sample"};
const API_VERSION = 2;
const internalAPIConnection = window.__DECKY_SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_deckyLoaderAPIInit;
if (!internalAPIConnection) {
throw new Error('[@decky/api]: Failed to connect to the loader as as the loader API was not initialized. This is likely a bug in Decky Loader.');
}
let api;
try {
api = internalAPIConnection.connect(API_VERSION, manifest.name);
}
catch {
api = internalAPIConnection.connect(1, manifest.name);
console.warn(`[@decky/api] Requested API version ${API_VERSION} but the running loader only supports version 1. Some features may not work.`);
}
if (api._version != API_VERSION) {
console.warn(`[@decky/api] Requested API version ${API_VERSION} but the running loader only supports version ${api._version}. Some features may not work.`);
}
const callable = api.callable;
const routerHook = api.routerHook;
const toaster = api.toaster;
const definePlugin = (fn) => {
return (...args) => {
return fn(...args);
};
};
const getSetting = callable('get_setting');
const setSetting = callable('set_setting');
function Content() {
const [enabled, setEnabled] = SP_REACT.useState(false);
const [busy, setBusy] = SP_REACT.useState(true);
const [message, setMessage] = SP_REACT.useState('Loading setting…');
async function refresh() {
setBusy(true);
try {
const value = await getSetting('enabled', false);
setEnabled(value);
setMessage(`Saved setting: ${value ? 'on' : 'off'}`);
}
catch (error) {
setMessage(`Could not read setting: ${String(error)}`);
}
finally {
setBusy(false);
}
}
SP_REACT.useEffect(() => { void refresh(); }, []);
async function change(value) {
setBusy(true);
try {
await setSetting('enabled', value);
setEnabled(value);
setMessage(`Saved setting: ${value ? 'on' : 'off'}`);
toaster.toast({ title: 'Framey sample', body: 'Setting saved' });
}
catch (error) {
setMessage(`Could not save setting: ${String(error)}`);
}
finally {
setBusy(false);
}
}
return SP_JSX.jsxs(DFL.PanelSection, { title: "Framey settings sample", children: [SP_JSX.jsx(DFL.PanelSectionRow, { children: SP_JSX.jsx(DFL.ToggleField, { label: "Example setting", description: "Stored by the Decky Python backend", checked: enabled, disabled: busy, onChange: (value) => { void change(value); } }) }), SP_JSX.jsx(DFL.PanelSectionRow, { children: SP_JSX.jsx(DFL.ButtonItem, { disabled: busy, onClick: () => { void refresh(); }, children: "Reload saved setting" }) }), SP_JSX.jsx(DFL.PanelSectionRow, { children: SP_JSX.jsx(DFL.ButtonItem, { onClick: () => DFL.Navigation.Navigate('/framey-sample/details/saved-setting'), children: "About this setting" }) }), SP_JSX.jsx(DFL.PanelSectionRow, { children: SP_JSX.jsx("p", { role: "status", children: message }) })] });
}
function Details() {
const { topic } = DFL.useParams();
return SP_JSX.jsxs(DFL.PanelSection, { title: "Sample detail page", children: [SP_JSX.jsx(DFL.PanelSectionRow, { children: SP_JSX.jsxs("p", { children: ["Topic: ", topic || 'overview'] }) }), SP_JSX.jsx(DFL.PanelSectionRow, { children: SP_JSX.jsx("p", { children: "The toggle is stored by this plugin's Decky backend in the user's settings directory." }) }), SP_JSX.jsx(DFL.PanelSectionRow, { children: SP_JSX.jsx(DFL.ButtonItem, { onClick: () => DFL.Navigation.NavigateBack(), children: "Back to setting" }) })] });
}
var index = definePlugin(() => {
routerHook.addRoute('/framey-sample/details/:topic?', Details);
return Object.assign({
name: 'Framey Settings Sample',
icon: SP_JSX.jsx("span", { "aria-hidden": "true", children: "\u2699" }),
content: SP_JSX.jsx(Content, {}),
onDismount: () => routerHook.removeRoute('/framey-sample/details/:topic?'),
}, {
// Framey additions are ignored by Decky's own menu. Keep the main content
// usable there too, while showing authors the extra VR settings view.
settings: SP_JSX.jsx(Content, {}),
frameyQuickActions: [{
label: 'Read saved setting',
onClick: async () => {
const enabled = await getSetting('enabled', false);
return `Saved setting is ${enabled ? 'on' : 'off'}`;
},
}],
});
});
export { index as default };
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["decky://decky/plugin/Framey%20Settings%20Sample/node_modules/.pnpm/@decky+api@1.1.3/node_modules/@decky/api/dist/index.js","decky://decky/plugin/Framey%20Settings%20Sample/src/index.tsx"],"sourcesContent":["import _manifest from '@decky/manifest';\nexport * from \"./types\";\nconst manifest = _manifest;\nconst API_VERSION = 2;\nif (!manifest?.name) {\n throw new Error('[@decky/api]: Failed to find plugin manifest.');\n}\nconst internalAPIConnection = window.__DECKY_SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_deckyLoaderAPIInit;\nif (!internalAPIConnection) {\n throw new Error('[@decky/api]: Failed to connect to the loader as as the loader API was not initialized. This is likely a bug in Decky Loader.');\n}\nlet api;\ntry {\n api = internalAPIConnection.connect(API_VERSION, manifest.name);\n}\ncatch {\n api = internalAPIConnection.connect(1, manifest.name);\n console.warn(`[@decky/api] Requested API version ${API_VERSION} but the running loader only supports version 1. Some features may not work.`);\n}\nif (api._version != API_VERSION) {\n console.warn(`[@decky/api] Requested API version ${API_VERSION} but the running loader only supports version ${api._version}. Some features may not work.`);\n}\nexport const call = api.call;\nexport const callable = api.callable;\nexport const addEventListener = api.addEventListener;\nexport const removeEventListener = api.removeEventListener;\nexport const routerHook = api.routerHook;\nexport const toaster = api.toaster;\nexport const openFilePicker = api.openFilePicker;\nexport const executeInTab = api.executeInTab;\nexport const injectCssIntoTab = api.injectCssIntoTab;\nexport const removeCssFromTab = api.removeCssFromTab;\nexport const fetchNoCors = api.fetchNoCors;\nexport const getExternalResourceURL = api.getExternalResourceURL;\nexport const useQuickAccessVisible = api.useQuickAccessVisible;\nexport const definePlugin = (fn) => {\n return (...args) => {\n return fn(...args);\n };\n};\n","import {callable, definePlugin, routerHook, toaster} from '@decky/api';\nimport {ButtonItem, Navigation, PanelSection, PanelSectionRow, ToggleField, useParams} from '@decky/ui';\nimport {useEffect, useState} from 'react';\n\nconst getSetting = callable<[key: string, fallback: boolean], boolean>('get_setting');\nconst setSetting = callable<[key: string, value: boolean], boolean>('set_setting');\n\nfunction Content() {\n const [enabled, setEnabled] = useState(false);\n const [busy, setBusy] = useState(true);\n const [message, setMessage] = useState('Loading setting…');\n\n async function refresh() {\n setBusy(true);\n try {\n const value = await getSetting('enabled', false);\n setEnabled(value);\n setMessage(`Saved setting: ${value ? 'on' : 'off'}`);\n } catch (error) {\n setMessage(`Could not read setting: ${String(error)}`);\n } finally {\n setBusy(false);\n }\n }\n\n useEffect(() => {void refresh();}, []);\n\n async function change(value: boolean) {\n setBusy(true);\n try {\n await setSetting('enabled', value);\n setEnabled(value);\n setMessage(`Saved setting: ${value ? 'on' : 'off'}`);\n toaster.toast({title: 'Framey sample', body: 'Setting saved'});\n } catch (error) {\n setMessage(`Could not save setting: ${String(error)}`);\n } finally {\n setBusy(false);\n }\n }\n\n return <PanelSection title=\"Framey settings sample\">\n <PanelSectionRow>\n <ToggleField label=\"Example setting\" description=\"Stored by the Decky Python backend\"\n checked={enabled} disabled={busy} onChange={(value: boolean) => {void change(value);}} />\n </PanelSectionRow>\n <PanelSectionRow><ButtonItem disabled={busy} onClick={() => {void refresh();}}>Reload saved setting</ButtonItem></PanelSectionRow>\n <PanelSectionRow><ButtonItem onClick={() => Navigation.Navigate('/framey-sample/details/saved-setting')}>About this setting</ButtonItem></PanelSectionRow>\n <PanelSectionRow><p role=\"status\">{message}</p></PanelSectionRow>\n </PanelSection>;\n}\n\nfunction Details() {\n const {topic} = useParams<{topic?: string}>();\n return <PanelSection title=\"Sample detail page\">\n <PanelSectionRow><p>Topic: {topic || 'overview'}</p></PanelSectionRow>\n <PanelSectionRow><p>The toggle is stored by this plugin's Decky backend in the user's settings directory.</p></PanelSectionRow>\n <PanelSectionRow><ButtonItem onClick={() => Navigation.NavigateBack()}>Back to setting</ButtonItem></PanelSectionRow>\n </PanelSection>;\n}\n\nexport default definePlugin(() => {\n routerHook.addRoute('/framey-sample/details/:topic?', Details);\n return Object.assign({\n name: 'Framey Settings Sample',\n icon: <span aria-hidden=\"true\">⚙</span>,\n content: <Content />,\n onDismount: () => routerHook.removeRoute('/framey-sample/details/:topic?'),\n}, {\n // Framey additions are ignored by Decky's own menu. Keep the mainLine truncated
+42
View File
@@ -0,0 +1,42 @@
"""Small, unprivileged Decky backend for the Framey author example."""
import json
import os
from pathlib import Path
import tempfile
import decky
def settings_file():
# Decky provides this per-plugin path through its official Python module.
return Path(decky.DECKY_PLUGIN_SETTINGS_DIR) / 'settings.json'
class Plugin:
async def get_setting(self, key: str, default=False):
if key != 'enabled':
raise ValueError('Unknown setting')
try:
stored = json.loads(settings_file().read_text(encoding='utf-8'))
except (FileNotFoundError, json.JSONDecodeError, UnicodeDecodeError):
return default
value = stored.get(key) if isinstance(stored, dict) else None
return value if type(value) is bool else default
async def set_setting(self, key: str, value: bool):
if key != 'enabled' or type(value) is not bool:
raise ValueError('Expected an enabled boolean')
target = settings_file()
target.parent.mkdir(mode=0o700, parents=True, exist_ok=True)
temporary = None
try:
with tempfile.NamedTemporaryFile('w', encoding='utf-8', dir=target.parent,
prefix='.settings-', delete=False) as output:
temporary = Path(output.name)
json.dump({'enabled': value}, output)
output.write('\n')
temporary.chmod(0o600)
os.replace(temporary, target)
finally:
if temporary is not None:
temporary.unlink(missing_ok=True)
return True
+20
View File
@@ -0,0 +1,20 @@
{
"name": "framey-settings-sample",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"build": "rollup -c"
},
"dependencies": {
"@decky/api": "^1.1.3",
"@decky/ui": "^4.11.0",
"react": "^19.1.1"
},
"devDependencies": {
"@decky/rollup": "^1.0.2",
"@types/react": "^19.1.1",
"rollup": "^4.53.3",
"typescript": "^5.6.2"
}
}
+6
View File
@@ -0,0 +1,6 @@
{
"name": "Framey Settings Sample",
"author": "Frame Control contributors",
"flags": [],
"api_version": 2
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,3 @@
import deckyPlugin from '@decky/rollup';
export default deckyPlugin({});
+81
View File
@@ -0,0 +1,81 @@
import {callable, definePlugin, routerHook, toaster} from '@decky/api';
import {ButtonItem, Navigation, PanelSection, PanelSectionRow, ToggleField, useParams} from '@decky/ui';
import {useEffect, useState} from 'react';
const getSetting = callable<[key: string, fallback: boolean], boolean>('get_setting');
const setSetting = callable<[key: string, value: boolean], boolean>('set_setting');
function Content() {
const [enabled, setEnabled] = useState(false);
const [busy, setBusy] = useState(true);
const [message, setMessage] = useState('Loading setting…');
async function refresh() {
setBusy(true);
try {
const value = await getSetting('enabled', false);
setEnabled(value);
setMessage(`Saved setting: ${value ? 'on' : 'off'}`);
} catch (error) {
setMessage(`Could not read setting: ${String(error)}`);
} finally {
setBusy(false);
}
}
useEffect(() => {void refresh();}, []);
async function change(value: boolean) {
setBusy(true);
try {
await setSetting('enabled', value);
setEnabled(value);
setMessage(`Saved setting: ${value ? 'on' : 'off'}`);
toaster.toast({title: 'Framey sample', body: 'Setting saved'});
} catch (error) {
setMessage(`Could not save setting: ${String(error)}`);
} finally {
setBusy(false);
}
}
return <PanelSection title="Framey settings sample">
<PanelSectionRow>
<ToggleField label="Example setting" description="Stored by the Decky Python backend"
checked={enabled} disabled={busy} onChange={(value: boolean) => {void change(value);}} />
</PanelSectionRow>
<PanelSectionRow><ButtonItem disabled={busy} onClick={() => {void refresh();}}>Reload saved setting</ButtonItem></PanelSectionRow>
<PanelSectionRow><ButtonItem onClick={() => Navigation.Navigate('/framey-sample/details/saved-setting')}>About this setting</ButtonItem></PanelSectionRow>
<PanelSectionRow><p role="status">{message}</p></PanelSectionRow>
</PanelSection>;
}
function Details() {
const {topic} = useParams<{topic?: string}>();
return <PanelSection title="Sample detail page">
<PanelSectionRow><p>Topic: {topic || 'overview'}</p></PanelSectionRow>
<PanelSectionRow><p>The toggle is stored by this plugin's Decky backend in the user's settings directory.</p></PanelSectionRow>
<PanelSectionRow><ButtonItem onClick={() => Navigation.NavigateBack()}>Back to setting</ButtonItem></PanelSectionRow>
</PanelSection>;
}
export default definePlugin(() => {
routerHook.addRoute('/framey-sample/details/:topic?', Details);
return Object.assign({
name: 'Framey Settings Sample',
icon: <span aria-hidden="true">⚙</span>,
content: <Content />,
onDismount: () => routerHook.removeRoute('/framey-sample/details/:topic?'),
}, {
// Framey additions are ignored by Decky's own menu. Keep the main content
// usable there too, while showing authors the extra VR settings view.
settings: <Content />,
frameyQuickActions: [{
label: 'Read saved setting',
onClick: async () => {
const enabled = await getSetting('enabled', false);
return `Saved setting is ${enabled ? 'on' : 'off'}`;
},
}],
});
});
+13
View File
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"outDir": "dist",
"module": "ESNext",
"target": "ES2020",
"jsx": "react-jsx",
"moduleResolution": "node",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["src"]
}
+114
View File
@@ -0,0 +1,114 @@
#!/usr/bin/env python3
"""Launch a built Linux AppImage on Xvfb and check its bundled server.
This checks the packaged app without a headset or a desktop login session.
The profile and display are temporary, and every process started by this check
is stopped before it exits.
"""
import hashlib
import os
from pathlib import Path
import re
import shutil
import signal
import socket
import subprocess
import sys
import tempfile
import time
import urllib.error
import urllib.request
def server_port(profile):
for log in (profile / "config").rglob("server.log"):
ports = re.findall(r"--port (\d+)", log.read_text(errors="replace"))
if ports:
return int(ports[-1])
return None
def port_closed(port):
try:
with socket.create_connection(("127.0.0.1", port), timeout=1):
return False
except OSError:
return True
def check(appimage):
if not appimage.is_file() or not os.access(appimage, os.X_OK):
raise RuntimeError(f"AppImage is missing or cannot run: {appimage}")
if not shutil.which("xvfb-run"):
raise RuntimeError("xvfb-run is required for the AppImage smoke check")
digest = hashlib.sha256(appimage.read_bytes()).hexdigest()
with tempfile.TemporaryDirectory(prefix="frame-appimage-smoke-") as directory:
profile = Path(directory)
(profile / "tmp").mkdir()
env = dict(os.environ)
env.update(
APPIMAGE_EXTRACT_AND_RUN="1", ELECTRON_DISABLE_SANDBOX="1",
TMPDIR=str(profile / "tmp"),
XDG_CONFIG_HOME=str(profile / "config"),
XDG_CACHE_HOME=str(profile / "cache"),
XDG_DATA_HOME=str(profile / "data"),
FRAME_ALIAS="frame-control-appimage-smoke-no-headset",
FRAME_CONTROL_TELEMETRY="0", FRAME_CONTROL_NO_UPDATE_CHECK="1",
DO_NOT_TRACK="1",
)
output = profile / "app.log"
port = None
passed = False
with output.open("w") as log:
proc = subprocess.Popen(
["xvfb-run", "-a", "-s", "-screen 0 1280x800x24 -nolisten tcp",
str(appimage), "--no-sandbox"],
cwd=profile, env=env, stdout=log, stderr=subprocess.STDOUT,
start_new_session=True,
)
try:
deadline = time.monotonic() + 60
while time.monotonic() < deadline:
if proc.poll() is not None:
raise RuntimeError(f"AppImage exited {proc.returncode} before its server answered")
port = server_port(profile)
if port is not None:
try:
with urllib.request.urlopen(f"http://127.0.0.1:{port}/", timeout=2) as response:
if response.status == 200 and response.headers.get("Server", "").startswith("FrameControl/1"):
passed = True
break
except (OSError, urllib.error.URLError):
pass
time.sleep(0.5)
if not passed:
raise RuntimeError("AppImage server did not answer within 60 seconds")
except BaseException:
log.flush()
print(output.read_text(errors="replace")[-1500:], file=sys.stderr)
raise
finally:
try:
os.killpg(proc.pid, signal.SIGTERM)
except ProcessLookupError:
pass
try:
proc.wait(timeout=15)
except subprocess.TimeoutExpired:
os.killpg(proc.pid, signal.SIGKILL)
proc.wait(timeout=10)
if port is not None:
for _ in range(20):
if port_closed(port):
break
time.sleep(0.5)
else:
raise RuntimeError(f"AppImage server stayed on port {port} after shutdown")
print(f"AppImage SHA-256 {digest}: HTTP 200, FrameControl/1, server stopped")
if __name__ == "__main__":
if len(sys.argv) != 2:
raise SystemExit("usage: check-appimage-launch.py path/to/AppImage")
check(Path(sys.argv[1]).resolve())
+310
View File
@@ -0,0 +1,310 @@
#!/usr/bin/env python3
"""Bounded real-Frame VR diagnostics. No device writes without the shared lock.
Default: inspect only. --wake: reversible wake + stereo capture. --exercise:
temporary clean user-service install, live sample settings and OpenVR input.
Exit 0 means requested machine checks passed, never a worn/controller verdict.
"""
import argparse
import base64
import datetime
import hashlib
import io
import json
from pathlib import Path
import secrets
import shlex
import subprocess
import sys
import tarfile
import time
import signal
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / 'ui'))
import frame_decky
import frame_headset
LOCK = '/tmp/frame-test.lock'
VRCMD = '/opt/steamvr/bin/linuxarm64/vrcmd'
KEY = 'valve.steam.desktopgame.2001947813'
class Remote:
def __init__(self, host, via=None):
self.argv = ['ssh', '-o', 'BatchMode=yes', '-o', 'ConnectTimeout=8',
'-o', 'ServerAliveInterval=5', '-o', 'ServerAliveCountMax=2', host]
self.via = via
def __call__(self, command, stdin=None, text=True, timeout=30):
argv = self.argv + [command]
if self.via:
argv = ['ssh', '-o', 'BatchMode=yes', '-o', 'ConnectTimeout=8', self.via,
shlex.join(argv)]
result = subprocess.run(argv, input=stdin, capture_output=True, text=text, timeout=timeout)
if result.returncode:
raise RuntimeError((result.stderr or result.stdout).strip())
return result.stdout
def python(self, source, timeout=30):
return json.loads(self('python3 -', stdin=source, timeout=timeout))
PROBE = '''
import json,pathlib,subprocess,ctypes as C
lib=C.CDLL('/opt/steamvr/bin/linuxarm64/libopenvr_api.so')
lib.VR_InitInternal2.argtypes=[C.POINTER(C.c_int),C.c_int,C.c_char_p]
lib.VR_GetGenericInterface.argtypes=[C.c_char_p,C.POINTER(C.c_int)]
lib.VR_GetGenericInterface.restype=C.c_void_p
error=C.c_int();lib.VR_InitInternal2(C.byref(error),3,None)
if error.value: raise RuntimeError('OpenVR unavailable')
try:
table=lib.VR_GetGenericInterface(b'FnTable:IVROverlay_027',C.byref(error))
if error.value or not table: raise RuntimeError('Overlay ABI unavailable')
dashboard=bool(C.CFUNCTYPE(C.c_bool)(C.cast(table,C.POINTER(C.c_void_p))[66])())
finally: lib.VR_ShutdownInternal()
battery=[]
for p in pathlib.Path('/sys/class/power_supply').glob('*/capacity'):
if (p.parent/'type').read_text().strip()=='Battery': battery.append(int(p.read_text()))
def cmd(*args):
p=subprocess.run(args,capture_output=True,text=True,timeout=8)
if p.returncode: raise RuntimeError(p.stderr or p.stdout)
return p.stdout.strip()
vr='/opt/steamvr/bin/linuxarm64/vrcmd'
print(json.dumps({'battery':battery,'dashboardVisible':dashboard,'stats':json.loads(cmd(vr,'--stats')),
'overlays':cmd(vr,'--overlays'),
'pause':cmd(vr,'--settings-bool','power.pauseCompositorOnStandby'),
'timeout':cmd(vr,'--settings-float','power.turnOffScreensTimeout')}))
'''
def settings(state):
pause = state['pause'].split('=', 1)[1]
timeout = state['timeout'].split('=', 1)[1]
if pause not in ('true', 'false') or not 0 <= float(timeout) <= 86400:
raise RuntimeError('Cannot safely save original SteamVR power values')
return pause, timeout
def diagnostic_source():
return (ROOT / 'scripts/framey_openvr.py').read_text() + '''
import json
vr=Overlay()
try: print(json.dumps({'state':vr.snapshot(),'imageRead':vr.image_hash()}))
finally: vr.close()
'''
def debug_bundle(original, profile):
"""Only the test-owned browser gets CDP and a disposable profile."""
out = io.BytesIO()
with tarfile.open(fileobj=io.BytesIO(original), mode='r:gz') as src, tarfile.open(fileobj=out, mode='w:gz') as dst:
for item in src.getmembers():
data = src.extractfile(item).read()
if item.name == 'ui/frame_headset_runtime.py':
code = data.decode()
needle = "'--noerrdialogs', '--window-size=1200,800',"
if needle not in code:
raise RuntimeError('Runtime changed; review test browser setup')
code = code.replace(needle, "'--noerrdialogs', '--remote-debugging-port=0', '--window-size=1200,800',")
code = code.replace("str(BASE / 'profile')", repr(profile))
data = code.encode()
item.size = len(data)
dst.addfile(item, io.BytesIO(data))
return out.getvalue()
def exercise_source(profile, plugin_id, folder):
# Runs entirely on the headset. The normal iframe, HTTP handler, CEF bridge
# and Decky Python backend are used. CDP observes DOM/coordinates; OpenVR
# delivers clicks. No JS .click() or backend stubs.
return (ROOT/'scripts/framey_openvr.py').read_text() + '\n' + (ROOT/'scripts/framey_vr_input.py').read_text() + '\n' + (
'print(json.dumps(exercise(%r,%r,%r)))\n' % (profile, plugin_id, folder))
def main(argv=None):
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--host', default='frame')
parser.add_argument('--via', help='Existing paired SSH host, e.g. lxso2')
parser.add_argument('--wake', action='store_true')
parser.add_argument('--exercise', action='store_true', help='Temporary user installs; requires no managed panel/Decky install')
parser.add_argument('--output', type=Path, required=True, help='Private evidence folder (screenshots may contain room pixels)')
args = parser.parse_args(argv)
args.output.mkdir(parents=True, exist_ok=True, mode=0o700)
report = {'schema': 1, 'time': datetime.datetime.now(datetime.timezone.utc).isoformat(),
'controllerHardwareVerified': False, 'wornVisualComfortVerified': False}
git = subprocess.run(['git','rev-parse','HEAD'],cwd=ROOT,capture_output=True,text=True)
report['sourceCommit'] = git.stdout.strip() if git.returncode == 0 else None
remote = Remote(args.host, args.via)
token = 'framey-vr-' + secrets.token_hex(8)
folder = token
profile = '/tmp/' + token + '-profile'
locked = power_changed = plugin_created = decky_created = panel_created = watchdog = False
original_bundle = frame_headset.bundle
before = None
previous_term = signal.signal(signal.SIGTERM, lambda *_: (_ for _ in ()).throw(RuntimeError('Terminated; cleaning up')))
try:
remote('mkdir ' + LOCK + ' && { printf %s ' + shlex.quote(token) + ' > ' + LOCK + '/owner || { rmdir ' + LOCK + '; exit 1; }; }')
locked = True
before = remote.python(PROBE)
report['before'] = before
pause, timeout = settings(before)
if not before['battery'] or min(before['battery']) < 20:
raise RuntimeError('Battery unknown or below 20%')
if args.wake or args.exercise:
# Independent systemd timer restores power even if the controller is
# killed or SSH disappears. It retains the test lock for recovery.
recovery = '/tmp/' + token + '-restore.py'
restore_source = ("import pathlib,subprocess\n"
"p=pathlib.Path('/tmp/frame-test.lock/owner')\n"
"if p.exists() and p.read_text()==" + repr(token) + ":\n"
" subprocess.run([" + repr(VRCMD) + ", '--set-settings-bool','power.pauseCompositorOnStandby'," + repr('1' if pause == 'true' else '0') + "],check=True)\n"
" subprocess.run([" + repr(VRCMD) + ", '--set-settings-float','power.turnOffScreensTimeout'," + repr(timeout) + "],check=True)\n")
remote('umask 077; cat > ' + shlex.quote(recovery), stdin=restore_source)
remote('systemd-run --user --quiet --unit=' + token + '-restore --on-active=240s /usr/bin/python3 ' + shlex.quote(recovery))
watchdog = True
report['powerRecovery'] = {'timer':token+'-restore.timer','script':recovery,
'originalPause':pause,'originalTimeout':timeout}
(args.output/'recovery.json').write_text(json.dumps({'host':args.host,'via':args.via,'lockOwner':token,**report['powerRecovery']},indent=2)+'\n')
if args.exercise:
d, h = frame_decky.status(remote), frame_headset.status(remote)
if d['managed'] or h['managed'] or d['upstreamInstall']:
raise RuntimeError('Exercise needs absent managed services; existing installs left intact')
# Refuse every collision, including retained plugin settings.
files = {name: base64.b64encode((ROOT/'examples/framey-settings'/name).read_bytes()).decode()
for name in ('plugin.json', 'main.py', 'dist/index.js')}
source = '''
import base64,json,pathlib
base=pathlib.Path.home()/'.local/share/frame-control/decky'
folder=%r
p=base/'plugins'/folder
if p.exists() or (base/'settings'/folder).exists(): raise RuntimeError('Test path collision')
p.mkdir(parents=True); (p/'dist').mkdir()
for name,data in %r.items(): (p/name).write_bytes(base64.b64decode(data))
manifest=json.loads((p/'plugin.json').read_text());manifest['name']='Framey VR Check '+folder
(p/'plugin.json').write_text(json.dumps(manifest))
(p/'.frame-control-store.json').write_text(json.dumps({'storeId':2000000001,'version':'local-vr-check'}))
print(json.dumps({'created':True}))
''' % (folder, files)
remote.python(source)
plugin_created = True
decky_created = True
report['deckyInstall'] = frame_decky.change(remote, 'install')
# Decky reloads its Steam frontend; install the panel afterwards.
time.sleep(3)
frame_headset.bundle = lambda: debug_bundle(original_bundle(), profile)
panel_created = True
report['panelInstall'] = frame_headset.change(remote, 'install')
if args.wake or args.exercise:
power_changed = True # before first setter, so partial failure restores
remote(VRCMD + ' --set-settings-bool power.pauseCompositorOnStandby 0')
remote(VRCMD + ' --set-settings-float power.turnOffScreensTimeout 120')
remote(VRCMD + ' --handlewakeup')
remote(VRCMD + ' --showdashboard ' + KEY)
time.sleep(2)
report['overlay'] = remote.python(diagnostic_source())
if args.exercise and not report['overlay']['state']['visible']:
report['retaggedTestWindow'] = True
remote.python('''
import json,pathlib,subprocess,time,os
p=pathlib.Path.home()/'.local/share/frame-control/headset/state.json'
w=json.loads(p.read_text())['window'];env={**os.environ,'DISPLAY':':0'}
subprocess.run(['xprop','-id',w,'-remove','STEAM_GAME'],env=env,check=True)
time.sleep(1)
subprocess.run(['xprop','-id',w,'-f','STEAM_GAME','32c','-set','STEAM_GAME','2001947813'],env=env,check=True)
time.sleep(1)
subprocess.run(['/opt/steamvr/bin/linuxarm64/vrcmd','--showdashboard','valve.steam.desktopgame.2001947813'],capture_output=True,check=True)
time.sleep(2)
print('{}')
''')
report['overlay'] = remote.python(diagnostic_source())
if args.wake or args.exercise:
shot = remote.python((ROOT/'ui/frame_vrshot.py').read_text(), timeout=20)['path']
try:
image = remote('cat ' + shlex.quote(shot), text=False, timeout=20)
(args.output/'before-stereo-private.png').write_bytes(image)
report['beforeStereoSha256'] = hashlib.sha256(image).hexdigest()
finally:
remote('rm -f ' + shlex.quote(shot))
if args.exercise:
report['input'] = remote.python(exercise_source(profile, 2000000001, folder), timeout=100)
if args.wake or args.exercise:
shot = remote.python((ROOT/'ui/frame_vrshot.py').read_text(), timeout=20)['path']
try:
image = remote('cat ' + shlex.quote(shot), text=False, timeout=20)
(args.output/'stereo-private.png').write_bytes(image)
report['stereoSha256'] = hashlib.sha256(image).hexdigest()
report['compositorChanged'] = report['stereoSha256'] != report.get('beforeStereoSha256')
finally:
remote('rm -f ' + shlex.quote(shot))
# Same SteamVR mirror used by OBS; FFmpeg is already on the Frame.
mirror = remote("ffmpeg -hide_banner -loglevel error -f v4l2 -i /dev/video99 -vf 'select=gte(n\\,60)' -frames:v 1 -f image2pipe -vcodec png -", text=False, timeout=20)
(args.output/'mirror-private.png').write_bytes(mirror)
report['mirrorSha256'] = hashlib.sha256(mirror).hexdigest()
report['passed'] = bool(report['overlay']['state']['visible'])
if args.exercise:
report['passed'] = report['passed'] and report['input']['passed'] and report.get('compositorChanged',False)
except Exception as exc:
report['error'] = str(exc)
report['passed'] = False
finally:
frame_headset.bundle = original_bundle
cleanup = []
def clean(name, action):
try: action()
except Exception as exc: cleanup.append({'step':name,'error':str(exc)})
if locked:
if panel_created:
clean('remove test panel', lambda: frame_headset.change(remote, 'remove') if frame_headset.status(remote)['managed'] else None)
if decky_created:
clean('remove test Decky', lambda: frame_decky.change(remote, 'remove') if frame_decky.status(remote)['managed'] else None)
if plugin_created:
# Only random per-run paths created after collision checks.
clean('remove test files', lambda: remote.python('''
import pathlib,shutil,json
base=pathlib.Path.home()/'.local/share/frame-control/decky'
for parent in ('plugins','settings','data','logs'):
p=base/parent/%r
if p.is_dir() and not p.is_symlink(): shutil.rmtree(p)
p=pathlib.Path(%r)
if p.is_dir() and not p.is_symlink(): shutil.rmtree(p)
print('{}')
''' % (folder, profile)))
if power_changed:
clean('restore compositor pause', lambda: remote(VRCMD + ' --set-settings-bool power.pauseCompositorOnStandby ' + ('1' if pause == 'true' else '0')))
clean('restore screen timeout', lambda: remote(VRCMD + ' --set-settings-float power.turnOffScreensTimeout ' + shlex.quote(timeout)))
clean('restore dashboard visibility', lambda: remote(VRCMD + ' --hidedashboard') if not before['dashboardVisible'] else None)
try:
report['after'] = remote.python(PROBE)
if power_changed and settings(report['after']) != settings(before):
cleanup.append({'step':'read back power settings','error':'Original values not restored'})
except Exception as exc: cleanup.append({'step':'after probe','error':str(exc)})
if watchdog and not cleanup:
clean('stop power recovery timer', lambda: remote.python('''
import subprocess,json
unit=%r
timer=subprocess.run(['systemctl','--user','show',unit+'.timer','--property=LoadState','--value'],capture_output=True,text=True)
if timer.stdout.strip()=='loaded': subprocess.run(['systemctl','--user','stop',unit+'.timer'],check=True,capture_output=True)
p=subprocess.run(['systemctl','--user','show',unit+'.service','--property=LoadState','--value'],capture_output=True,text=True)
if p.stdout.strip()=='loaded': subprocess.run(['systemctl','--user','stop',unit+'.service'],check=True,capture_output=True)
print('{}')
''' % (token+'-restore')))
if not cleanup:
clean('remove power recovery script', lambda: remote('rm -f ' + shlex.quote(recovery)))
report['powerRecoveryRemoved'] = not cleanup
if not cleanup: (args.output/'recovery.json').unlink(missing_ok=True)
if not cleanup:
clean('release owned lock', lambda: remote('test "$(cat ' + LOCK + '/owner)" = ' + shlex.quote(token) + ' && rm ' + LOCK + '/owner && rmdir ' + LOCK))
report['lockReleased'] = not cleanup
else:
report['lockRetainedForRecovery'] = token
report['cleanupErrors'] = cleanup
report['passed'] = bool(report.get('passed') and not cleanup)
(args.output/'result.json').write_text(json.dumps(report, indent=2)+'\n')
signal.signal(signal.SIGTERM, previous_term)
print(json.dumps(report, indent=2))
return 0 if report['passed'] else 1
if __name__ == '__main__':
sys.exit(main())
+186
View File
@@ -0,0 +1,186 @@
#!/usr/bin/env python3
"""Bounded, opt-in real Frame check. Run only while someone wears the headset.
Requires an already installed Frame Control VR panel, Decky user service, and
one Framey-managed plugin. It never installs, restarts, or removes a service.
"""
import argparse
import datetime
import hashlib
import json
from pathlib import Path
import re
import secrets
import shlex
import subprocess
import sys
import time
ROOT = Path(__file__).resolve().parents[1]
SSH = ['ssh', '-o', 'BatchMode=yes', '-o', 'ConnectTimeout=5', 'frame']
LOCK = '/tmp/frame-test.lock'
VIA = None
def ssh_argv(command):
argv = [*SSH, command]
return ['ssh', '-o', 'BatchMode=yes', '-o', 'ConnectTimeout=8', VIA, shlex.join(argv)] if VIA else argv
def remote(command, stdin=None, timeout=15):
run = subprocess.run(ssh_argv(command), input=stdin, capture_output=True,
text=True, timeout=timeout)
if run.returncode:
raise RuntimeError((run.stderr or run.stdout).strip() or f'SSH exited {run.returncode}')
return run.stdout
PROBE = r'''
import json, pathlib, subprocess
power=[]
for item in pathlib.Path('/sys/class/power_supply').glob('*/capacity'):
try:
if (item.parent/'type').read_text().strip() == 'Battery':
power.append({'name':item.parent.name,'percent':int(item.read_text().strip())})
except (OSError,ValueError): pass
stats=subprocess.run(['/opt/steamvr/bin/linuxarm64/vrcmd','--stats'],capture_output=True,text=True,timeout=5)
try: activity=json.loads(stats.stdout)[0]['activity_level'] if stats.returncode == 0 else None
except (ValueError,KeyError,IndexError,TypeError): activity=None
panels=subprocess.run(['/opt/steamvr/bin/linuxarm64/vrcmd','--overlays'],capture_output=True,text=True,timeout=5)
panel=next((line.strip() for line in panels.stdout.splitlines() if 'valve.steam.desktopgame.2001947813' in line),None)
base=pathlib.Path.home()/'.local/share/frame-control/decky/plugins'
plugins=[]
if base.is_dir() and not base.is_symlink():
for folder in base.iterdir():
if folder.is_symlink(): continue
try:
p=json.loads((folder/'.frame-control-store.json').read_text())
manifest=json.loads((folder/'plugin.json').read_text())
if isinstance(p.get('storeId'),int): plugins.append({'id':p['storeId'],'name':manifest['name']})
except (OSError,ValueError,KeyError): pass
service=subprocess.run(['systemctl','--user','is-active','frame-control-headset.service'],capture_output=True,text=True)
print(json.dumps({'battery':power,'activity':activity,'panel':panel,
'panelService':service.returncode==0,'plugins':plugins}))
'''
OVERLAY_PROBE = r'''
import ctypes as C, json
vr=C.CDLL('/opt/steamvr/bin/linuxarm64/libopenvr_api.so')
vr.VR_InitInternal2.argtypes=[C.POINTER(C.c_int),C.c_int,C.c_char_p]
vr.VR_GetGenericInterface.argtypes=[C.c_char_p,C.POINTER(C.c_int)]
vr.VR_GetGenericInterface.restype=C.c_void_p
error=C.c_int()
vr.VR_InitInternal2(C.byref(error),3,None)
result={'visible':None,'dashboardVisible':None,'error':error.value}
if not error.value:
try:
table=C.cast(vr.VR_GetGenericInterface(b'FnTable:IVROverlay_028',C.byref(error)),C.POINTER(C.c_void_p))
if not error.value and table:
handle=C.c_uint64()
find=C.CFUNCTYPE(C.c_int,C.c_char_p,C.POINTER(C.c_uint64))(table[0])
if find(b'valve.steam.desktopgame.2001947813',C.byref(handle))==0:
result['visible']=bool(C.CFUNCTYPE(C.c_bool,C.c_uint64)(table[45])(handle))
result['dashboardVisible']=bool(C.CFUNCTYPE(C.c_bool)(table[68])())
finally: vr.VR_ShutdownInternal()
print(json.dumps(result))
'''
def probe():
return json.loads(remote('python3 -', stdin=PROBE))
def check_file():
code = "import pathlib;print((pathlib.Path.home()/'.local/share/frame-control/headset/worn-check.json').read_text())"
return json.loads(remote('python3 -c ' + shlex.quote(code)))
def color_count(text):
return len(set(re.findall(r'#[0-9A-Fa-f]{6,8}', text)))
def main(worn_confirmed=False):
result = {'time':datetime.datetime.now(datetime.timezone.utc).isoformat(), 'proof':'operator-confirmed worn check', 'operatorWornConfirmed':worn_confirmed}
token = 'framey-' + secrets.token_hex(12)
locked = False
challenge = False
try:
if not worn_confirmed:
raise RuntimeError('A wearer must be present; pass --worn-confirmed only after checking in person. Wake/activity and trusted pointer events alone do not prove wearing or controller hardware.')
# Do not read even standby status until this task owns the device lock.
remote('mkdir ' + LOCK + ' && { printf %s ' + shlex.quote(token) +
' > ' + LOCK + '/owner || { rm -f ' + LOCK + '/owner; rmdir ' + LOCK + '; exit 1; }; }')
locked = True
before = probe()
result['before'] = before
if not before['battery'] or min(x['percent'] for x in before['battery']) < 20:
raise RuntimeError('Battery capacity unavailable or below 20%; no device session started')
if before['activity'] is None or before['activity'] >= 3:
raise RuntimeError('SteamVR is in standby; no worn-headset check started')
if not before['panelService'] or not before['plugins']:
raise RuntimeError('Install and open the Frame Control panel and a Framey plugin before this check')
after_lock = probe()
if after_lock['activity'] >= 3 or min(x['percent'] for x in after_lock['battery']) < 20:
raise RuntimeError('Activity or battery changed after acquiring the lock')
state = json.dumps({'nonce':token,'started':time.time()})
code = "import pathlib; p=pathlib.Path.home()/'.local/share/frame-control/headset/worn-check.json'; p.write_text(" + repr(state) + ")"
remote('python3 -c ' + shlex.quote(code))
challenge = True
print('In the worn headset: open SteamVR dashboard → Frame Control → a managed Decky plugin → Open panel. Touch a setting with the controller. Waiting up to 35 seconds.', flush=True)
deadline = time.monotonic() + 35
while time.monotonic() < deadline:
state = check_file()
if state.get('nonce') == token and state.get('panel') and state.get('input'):
break
time.sleep(1)
result['interaction'] = state
result['after'] = probe()
result['activeHeadset'] = isinstance(result['after']['activity'], int) and result['after']['activity'] < 3
result['overlay'] = json.loads(remote('python3 -', stdin=OVERLAY_PROBE, timeout=15))
result['panelVisible'] = result['overlay']['visible'] is True
installed_ids = {p['id'] for p in before['plugins']}
result['trustedPointerInput'] = bool(state.get('input', {}).get('at', 0) > state.get('started', 0))
result['pluginPanelReady'] = bool(state.get('panel', {}).get('at', 0) > state.get('started', 0)
and state['panel'].get('pluginId') in installed_ids)
if result['panelVisible'] and result['pluginPanelReady']:
shot = json.loads(remote('python3 -', stdin=(ROOT/'ui/frame_vrshot.py').read_text(), timeout=20))['path']
local = Path('/tmp')/('framey-worn-' + token + '.png')
try:
with local.open('wb') as out:
copy = subprocess.run(ssh_argv('cat ' + shlex.quote(shot)), stdout=out, stderr=subprocess.PIPE, timeout=20)
if copy.returncode: raise RuntimeError('Could not copy the SteamVR screenshot')
result['screenshotSha256'] = hashlib.sha256(local.read_bytes()).hexdigest()
pixels = subprocess.run(['convert', str(local), '-resize', '64x64!', 'txt:-'],
capture_output=True, text=True, timeout=15)
result['screenshotColors'] = color_count(pixels.stdout) if pixels.returncode == 0 else None
finally:
local.unlink(missing_ok=True)
remote('rm -f ' + shlex.quote(shot))
result['passed'] = (result['activeHeadset'] and result['panelVisible'] and result['trustedPointerInput'] and
result['pluginPanelReady'] and (result.get('screenshotColors') or 0) > 8)
except Exception as exc:
result['error'] = str(exc)
finally:
if challenge:
code = "import json,pathlib; p=pathlib.Path.home()/'.local/share/frame-control/headset/worn-check.json'; d=json.loads(p.read_text()); p.unlink() if d.get('nonce')==" + repr(token) + " else None"
try: remote('python3 -c ' + shlex.quote(code))
except Exception as exc: result['challengeCleanupError'] = str(exc)
if locked:
try:
remote('test "$(cat ' + LOCK + '/owner)" = ' + shlex.quote(token) +
' && rm ' + LOCK + '/owner && rmdir ' + LOCK)
result['lockReleased'] = True
except Exception as exc: result['lockCleanupError'] = str(exc)
print(json.dumps(result, indent=2))
return 0 if result.get('passed') else 1
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--host', default='frame')
parser.add_argument('--via', help='Paired SSH hop, e.g. lxso2')
parser.add_argument('--worn-confirmed', action='store_true', help='Operator confirms someone is wearing the Frame')
args = parser.parse_args()
SSH[-1] = args.host
VIA = args.via
sys.exit(main(args.worn_confirmed))
+117
View File
@@ -0,0 +1,117 @@
"""Small OpenVR diagnostic client; runs on the Frame, never polls another app's events.
Indices/signatures are for IVROverlay_027 and IVROverlayView_003 from Valve's
shipped openvr_capi.h, not interchangeable with IVROverlay_028.
"""
import ctypes as C
import hashlib
KEY = b'valve.steam.desktopgame.2001947813'
class Vector(C.Structure):
_fields_ = [('x', C.c_float), ('y', C.c_float)]
class Matrix(C.Structure):
_fields_ = [('m', (C.c_float * 4) * 3)]
class Mouse(C.Structure):
_fields_ = [('x', C.c_float), ('y', C.c_float), ('button', C.c_uint32)]
class Scroll(C.Structure):
_fields_ = [('xdelta',C.c_float),('ydelta',C.c_float),('unused',C.c_uint32),('viewportscale',C.c_float)]
class Data(C.Union):
_fields_ = [('mouse', Mouse), ('scroll', Scroll), ('reserved', C.c_uint64 * 6)]
class Event(C.Structure):
_pack_ = 4 # Linux OpenVR preserves its historical 4-byte event packing.
_fields_ = [('eventType', C.c_uint32), ('device', C.c_uint32),
('age', C.c_float), ('data', Data)]
class Overlay:
def __init__(self):
self.vr = C.CDLL('/opt/steamvr/bin/linuxarm64/libopenvr_api.so')
self.vr.VR_InitInternal2.argtypes = [C.POINTER(C.c_int), C.c_int, C.c_char_p]
self.vr.VR_GetGenericInterface.argtypes = [C.c_char_p, C.POINTER(C.c_int)]
self.vr.VR_GetGenericInterface.restype = C.c_void_p
error = C.c_int()
self.vr.VR_InitInternal2(C.byref(error), 3, None) # background, no scene focus
if error.value:
raise RuntimeError('OpenVR init: ' + str(error.value))
try:
self.table = self.interface(b'FnTable:IVROverlay_027')
self.handle = C.c_uint64()
rc = self.fn(0, C.c_int, C.c_char_p, C.POINTER(C.c_uint64))(KEY, C.byref(self.handle))
if rc:
raise RuntimeError('Frame Control overlay not found: ' + str(rc))
except Exception:
self.close()
raise
def interface(self, version):
error = C.c_int()
ptr = self.vr.VR_GetGenericInterface(version, C.byref(error))
if error.value or not ptr:
raise RuntimeError('OpenVR interface unavailable: ' + version.decode())
return C.cast(ptr, C.POINTER(C.c_void_p))
def fn(self, index, result, *args):
return C.CFUNCTYPE(result, *args)(self.table[index])
def snapshot(self):
h = self.handle
width, height = C.c_uint32(), C.c_uint32()
texture_error = self.fn(64, C.c_int, C.c_uint64, C.POINTER(C.c_uint32), C.POINTER(C.c_uint32))(h, C.byref(width), C.byref(height))
transform_type = C.c_int()
type_error = self.fn(31,C.c_int,C.c_uint64,C.POINTER(C.c_int))(h,C.byref(transform_type))
origin, matrix = C.c_int(), Matrix()
transform_error = self.fn(33, C.c_int, C.c_uint64, C.POINTER(C.c_int), C.POINTER(Matrix))(h, C.byref(origin), C.byref(matrix))
scale, method = Vector(), C.c_int()
scale_error = self.fn(49, C.c_int, C.c_uint64, C.POINTER(Vector))(h, C.byref(scale))
method_error = self.fn(47, C.c_int, C.c_uint64, C.POINTER(C.c_int))(h, C.byref(method))
return {'interface': 'IVROverlay_027',
'visible': bool(self.fn(43, C.c_bool, C.c_uint64)(h)),
'dashboardVisible': bool(self.fn(66, C.c_bool)()),
'activeDashboard': bool(self.fn(67, C.c_bool, C.c_uint64)(h)),
'texture': {'error': texture_error, 'width': width.value, 'height': height.value},
'transform': {'error': transform_error, 'typeError':type_error,'type':transform_type.value,'origin': origin.value,
'matrix': [list(row) for row in matrix.m]},
'input': {'error': method_error, 'method': method.value,
'scaleError': scale_error, 'scale': [scale.x, scale.y]}}
def post_mouse(self, kind, x, y, button=0):
# PostOverlayEvent is the supported overlay-view injection API. It is
# not a tracked controller and its void return does not prove delivery.
view = self.interface(b'FnTable:IVROverlayView_003')
event = Event(kind, 0xFFFFFFFF, 0, Data(mouse=Mouse(x, y, button)))
C.CFUNCTYPE(None, C.c_uint64, C.POINTER(Event))(view[2])(self.handle, C.byref(event))
def post_scroll(self, xdelta, ydelta):
view = self.interface(b'FnTable:IVROverlayView_003')
event = Event(309, 0xFFFFFFFF, 0, Data(scroll=Scroll(xdelta, ydelta, 0, 1)))
C.CFUNCTYPE(None, C.c_uint64, C.POINTER(Event))(view[2])(self.handle, C.byref(event))
def image_hash(self):
width, height = C.c_uint32(), C.c_uint32()
call = self.fn(6, C.c_int, C.c_uint64, C.c_void_p, C.c_uint32,
C.POINTER(C.c_uint32), C.POINTER(C.c_uint32))
rc = call(self.handle, None, 0, C.byref(width), C.byref(height))
size = width.value * height.value * 4
result = {'error': rc, 'width': width.value, 'height': height.value}
if 0 < size <= 32 * 1024 * 1024:
pixels = C.create_string_buffer(size)
rc = call(self.handle, pixels, size, C.byref(width), C.byref(height))
result['error'] = rc
if not rc:
result['sha256'] = hashlib.sha256(pixels.raw).hexdigest()
return result
def close(self):
self.vr.VR_ShutdownInternal()
+140
View File
@@ -0,0 +1,140 @@
"""Headset-side real input exercise, appended after framey_openvr.py by the runner."""
import json
from pathlib import Path
import sys
import time
import urllib.request
def exercise(profile, plugin_id, folder):
sys.path.insert(0, str(Path.home()/'.local/share/frame-control/headset/bundle/ui'))
import frame_steam
port = int((Path(profile)/'DevToolsActivePort').read_text().splitlines()[0])
frame_steam.CDP = f'http://127.0.0.1:{port}/json'
parent = frame_steam.Page('Frame Control VR [fc-headset]')
panel = None
vr = Overlay()
result = {'clickTransport':'IVROverlayView_003.PostOverlayEvent',
'textTransport':'CDP Input.insertText after OpenVR focus',
'controllerHardwareVerified':False}
def wait(read, accept, seconds=15):
deadline = time.monotonic() + seconds
while time.monotonic() < deadline:
value = read()
if accept(value): return value
time.sleep(.25)
raise RuntimeError('Timed out waiting for live UI: ' + str(value))
def connect_panel():
def target():
targets = json.load(urllib.request.urlopen(frame_steam.CDP, timeout=5))
return next((p['title'] for p in targets if p.get('type') == 'iframe'
and '/framey/panel/' + str(plugin_id) in p.get('url','')), None)
page = frame_steam.Page(wait(target, bool))
page.eval('window.__vrClickCount=0;addEventListener("pointerup",e=>{window.__vrClickCount++;window.__vrLastTarget=e.target;});true')
return page
def command(page, method, params):
page.next_id += 1
page._send(json.dumps({'id':page.next_id,'method':method,'params':params}))
while True:
msg = json.loads(page._recv())
if msg.get('id') == page.next_id:
if 'error' in msg: raise RuntimeError(str(msg['error']))
return msg.get('result', {})
def text(): return panel.eval('document.body.innerText')
def click(selector):
# Account for CSS pixels, iframe position, border, HiDPI scaling, and
# OpenVR's bottom-left mouse origin; read geometry after scrolling.
panel.eval(f'document.querySelector({json.dumps(selector)}).scrollIntoView({{block:"center"}})')
time.sleep(.3) # let Chromium present the scrolled iframe before native input
pos = panel.eval(f'(()=>{{let r=document.querySelector({json.dumps(selector)}).getBoundingClientRect();return {{x:r.x+r.width/2,y:r.y+r.height/2}}}})()')
outer = parent.eval('(()=>{let f=byId("frameyFrame"),r=f.getBoundingClientRect();return {x:r.x+f.clientLeft,y:r.y+f.clientTop,w:innerWidth,h:innerHeight}})()')
sx, sy = vr.snapshot()['input']['scale']
x = (outer['x'] + pos['x']) * sx / outer['w']
y = sy - (outer['y'] + pos['y']) * sy / outer['h']
if not 0 <= x <= sx or not 0 <= y <= sy:
raise RuntimeError('Control is outside the visible viewport')
count = panel.eval('__vrClickCount')
vr.post_mouse(300, x, y)
vr.post_mouse(301, x, y, 1)
vr.post_mouse(302, x, y, 1)
wait(lambda:panel.eval('__vrClickCount'), lambda n:n > count, seconds=3)
hit = panel.eval(f'!!window.__vrLastTarget?.closest({json.dumps(selector)})')
if not hit:
raise RuntimeError('Native click hit another element: ' + str(panel.eval('({tag:__vrLastTarget?.tagName,text:__vrLastTarget?.textContent?.slice(0,100)})')))
try:
parent.eval(f'(async()=>{{await refreshDecky();openFrameyPanel({plugin_id},"Framey VR Check");return true}})()')
wait(lambda:parent.eval('byId("frameyPanelStatus").innerText'), lambda s:s == 'Plugin panel ready')
panel = connect_panel()
initial = wait(text, lambda s:'Saved setting: off' in s or 'Could not read setting:' in s)
if 'Could not read setting:' in initial: raise RuntimeError(initial)
result['initialText'] = initial
panel.eval('window.__vrEvents=[];addEventListener("pointerup",e=>__vrEvents.push({trusted:e.isTrusted,x:e.clientX,y:e.clientY}));true')
click('input[type=checkbox]')
result['savedText'] = wait(text, lambda s:'Saved setting: on' in s)
result['pointerEvents'] = panel.eval('__vrEvents')
result['trustedOverlayPointer'] = any(e['trusted'] for e in result['pointerEvents'])
disk = Path.home()/'.local/share/frame-control/decky/settings'/folder/'settings.json'
result['diskSetting'] = json.loads(disk.read_text())
# Fresh browser document, same normal parent API; no backend stub.
panel.sock.close(); panel = None
parent.eval(f'openFrameyPanel({plugin_id},"Framey VR Check")')
wait(lambda:parent.eval('byId("frameyPanelStatus").innerText'), lambda s:s == 'Plugin panel ready')
panel = connect_panel()
result['reopenedText'] = wait(text, lambda s:'Saved setting: on' in s)
result['reopenedChecked'] = panel.eval('document.querySelector("input[type=checkbox]").checked')
# Settings tab and quick action are real host controls too.
click('nav button:nth-child(2)')
wait(text, lambda s:'Saved setting: on' in s)
click('nav button:nth-child(1)')
wait(text, lambda s:'Saved setting: on' in s)
panel.eval('[...document.querySelectorAll("button")].find(b=>b.textContent==="Read saved setting").id="vr-quick"')
click('#vr-quick')
result['quickActionText'] = wait(text, lambda s:'Saved setting is on' in s)
# Isolated diagnostic controls use the actual shipped DFL shims. Their
# values are UI-only; they never change a user's settings or plugin.
panel.eval('''(()=>{
const mount=document.createElement('div');mount.id='vr-controls';document.body.prepend(mount);
function Controls(){const R=SP_REACT,[v,S]=R.useState(10),[t,T]=R.useState('');return R.createElement('section',null,
R.createElement(DFL.SliderField,{label:'VR test slider',min:0,max:100,value:v,showValue:true,onChange:S}),
R.createElement(DFL.TextField,{label:'VR test text',value:t,onChange:e=>T(e.target.value)}),
R.createElement('p',{id:'vr-control-values'},v+':'+t));}
SP_REACTDOM.createRoot(mount).render(SP_REACT.createElement(Controls));return true;
})()''')
wait(lambda:panel.eval('!!document.querySelector("#vr-controls input[type=range]")'), bool)
click('#vr-controls input[type=range]')
result['sliderValue'] = wait(lambda:panel.eval('document.querySelector("#vr-controls input[type=range]").value'), lambda v:v != '10')
click('#vr-controls input[type=text]')
# CDP only types text; OpenVR supplies pointer focus into the field.
command(parent, 'Input.insertText', {'text':'framey-ci'})
result['textValue'] = wait(lambda:panel.eval('document.querySelector("#vr-controls input[type=text]").value'), lambda v:v == 'framey-ci')
panel.eval('window.scrollTo(0,0)')
result['scrollBefore'] = panel.eval('scrollY')
vr.post_scroll(0,-3)
time.sleep(.5)
result['scrollAfter'] = panel.eval('scrollY')
result['nativeScrollMoved'] = result['scrollAfter'] != result['scrollBefore']
panel.eval('document.getElementById("vr-controls").remove()')
# Scroll saved status into the visible iframe for compositor evidence.
panel.eval('document.querySelector("[role=status]").scrollIntoView({block:"center"})')
result['finalOverlay'] = vr.snapshot()
result['passed'] = (result['trustedOverlayPointer'] and result['diskSetting'] == {'enabled':True}
and result['reopenedChecked'] and result['sliderValue'] != '10'
and result['textValue'] == 'framey-ci')
return result
except Exception as exc:
result['error'] = str(exc)
result['passed'] = False
if panel:
result['failureText'] = text()
result['focus'] = panel.eval('({tag:document.activeElement?.tagName,type:document.activeElement?.type})')
return result
finally:
vr.close()
parent.sock.close()
if panel: panel.sock.close()
+37 -17
View File
@@ -5,6 +5,7 @@ OBS opens udp://127.0.0.1:15099 with input format mpegts. Nothing is bound to
the network: this process sends MPEG-TS packets to the computer's loopback.
"""
import argparse
import os
import shlex
import signal
import socket
@@ -18,6 +19,7 @@ PACKET = 188
DATAGRAM = PACKET * 7
STARTUP_TIMEOUT = 20
STREAM_STALL = 10
CHILD_STOP_TIMEOUT = 5
def remote_command(height=720, fps=30, audio=True):
@@ -58,19 +60,34 @@ def relay(source, destination, on_packet=None):
return total
def watch_control(stream, proc, stopped):
def stop_child(proc):
"""Bound cleanup even if a stalled SSH process does not handle termination."""
if proc.poll() is not None:
return
try:
proc.terminate()
proc.wait(timeout=CHILD_STOP_TIMEOUT)
except subprocess.TimeoutExpired:
proc.kill()
proc.wait()
except ProcessLookupError:
pass # another shutdown path already reaped it
def watch_control(fd, proc, stopped):
"""A desktop app closes its pipe to stop SSH, including on Windows.
Windows TerminateProcess does not run Python's finally block. The pipe also
closes if the app crashes, so the SSH connection is closed in either case.
Read the descriptor directly: a blocked daemon must not hold sys.stdin's
buffered-I/O lock when a timeout makes the main thread exit.
"""
try:
stream.read(1)
os.read(fd, 1)
except OSError:
pass
stopped.set()
if proc.poll() is None:
proc.terminate()
stop_child(proc)
class StreamWatchdog:
@@ -111,8 +128,7 @@ class StreamWatchdog:
self.condition.wait(left)
else:
return
if self.proc.poll() is None:
self.proc.terminate()
stop_child(self.proc)
def main(argv=None):
@@ -129,16 +145,19 @@ def main(argv=None):
if not args.frame or args.frame.startswith('-') or any(c.isspace() for c in args.frame):
parser.error('frame must be one SSH host or alias')
command = remote_command(args.height, args.fps, not args.no_audio)
ssh = ['ssh', '-T', '-o', 'BatchMode=yes', args.frame, 'bash', '-lc', shlex.quote(command)]
ssh = ['ssh', '-T', '-o', 'BatchMode=yes', '-o', 'ConnectTimeout=10',
'-o', 'ServerAliveInterval=5', '-o', 'ServerAliveCountMax=2',
args.frame, 'bash', '-lc', shlex.quote(command)]
target = ('127.0.0.1', args.port)
print(f'Sending Frame view to udp://127.0.0.1:{args.port} for OBS; press Ctrl+C to stop.', file=sys.stderr)
signal.signal(signal.SIGTERM, lambda *_: sys.exit(0))
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as udp:
proc = subprocess.Popen(ssh, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE)
options = {'creationflags': subprocess.CREATE_NO_WINDOW} if sys.platform == 'win32' else {}
proc = subprocess.Popen(ssh, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, **options)
stopped = threading.Event()
watchdog = StreamWatchdog(proc)
if args.control_stdin:
threading.Thread(target=watch_control, args=(sys.stdin.buffer, proc, stopped), daemon=True).start()
threading.Thread(target=watch_control, args=(sys.stdin.fileno(), proc, stopped), daemon=True).start()
try:
amount = relay(proc.stdout, _Sender(udp, target), watchdog.packet)
code = proc.wait(timeout=10)
@@ -155,13 +174,7 @@ def main(argv=None):
finally:
watchdog.close()
proc.stdout.close()
if proc.poll() is None:
proc.terminate()
try:
proc.wait(timeout=5)
except subprocess.TimeoutExpired:
proc.kill()
proc.wait()
stop_child(proc)
class _Sender:
@@ -170,7 +183,14 @@ class _Sender:
self.ready = False
def send(self, data):
self.sock.sendto(data, self.target)
try:
self.sock.sendto(data, self.target)
except ConnectionResetError:
# Winsock can report a previous ICMP "port unreachable" here while
# OBS is closed. Keep sending so opening the receiver can recover.
if sys.platform != 'win32':
raise
return
if not self.ready:
self.ready = True
print('Frame Control OBS stream is ready', file=sys.stderr, flush=True)
+184
View File
@@ -0,0 +1,184 @@
"""Verified Decky-store-shaped install flow through the real HTTP server and fake Frame SSH."""
import hashlib
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
import io
import json
import os
import shlex
import subprocess
import threading
import zipfile
from harness import FrameTestCase, ROOT, Server, api, finished, ok, require, ssh
from framey_official import LEGACY_PLUGINS, PLUGINS as PANEL_PLUGINS, archive as official_archive
OFFICIAL_PLUGINS = PANEL_PLUGINS + LEGACY_PLUGINS
require() # Skip the module outside the disposable fake Frame, like its peers.
def archive(version):
raw = io.BytesIO()
with zipfile.ZipFile(raw, 'w') as bundle:
bundle.writestr('sample-panel/plugin.json', json.dumps({'name':'Sample Panel','api_version':2,'flags':[]}))
bundle.writestr('sample-panel/dist/index.js',
f"export default () => ({{content: SP_REACT.createElement('p', null, 'Sample {version}')}});")
bundle.writestr('sample-panel/README.txt', ''.join(hashlib.sha256(f'{version}-{n}'.encode()).hexdigest() for n in range(35)))
return raw.getvalue()
ARTIFACTS = {hashlib.sha256(a).hexdigest(): a for a in (archive('1.0.0'), archive('1.1.0'))}
HASHES = list(ARTIFACTS)
for plugin in OFFICIAL_PLUGINS:
data = official_archive(plugin)
assert hashlib.sha256(data).hexdigest() == plugin['sha256']
ARTIFACTS[plugin['sha256']] = data
class StoreFixture(BaseHTTPRequestHandler):
release = 0
def log_message(self, *_):
pass
def do_GET(self):
if self.path == '/plugins':
records = [{'id':999,'name':'Sample Panel','author':'Fixture',
'description':'A harmless panel','tags':[],
'versions':[{'name':['1.0.0','1.1.0'][self.release],
'hash':HASHES[self.release]}]}]
records.extend({'id':plugin['id'], 'name':plugin['name'], 'author':'Official Decky store',
'description':'Pinned official archive', 'tags':[],
'versions':[{'name':plugin['version'], 'hash':plugin['sha256']}]}
for plugin in OFFICIAL_PLUGINS)
body = json.dumps(records).encode()
content_type = 'application/json'
elif self.path.startswith('/versions/') and self.path.endswith('.zip'):
body = ARTIFACTS.get(self.path.split('/')[-1][:-4])
content_type = 'application/zip'
else:
body = None
self.send_response(200 if body is not None else 404)
self.send_header('Content-Type', content_type if body is not None else 'text/plain')
self.end_headers()
self.wfile.write(body or b'not found')
class FrameyFlow(FrameTestCase):
@classmethod
def setUpClass(cls):
require()
StoreFixture.release = 0
cls.fixture = ThreadingHTTPServer(('127.0.0.1', 0), StoreFixture)
cls.thread = threading.Thread(target=cls.fixture.serve_forever, daemon=True)
cls.thread.start()
port = cls.fixture.server_port
cls.previous = {key:os.environ.get(key) for key in ('FRAMEY_STORE_URL','FRAMEY_CDN_URL')}
os.environ['FRAMEY_STORE_URL'] = f'http://127.0.0.1:{port}/plugins'
os.environ['FRAMEY_CDN_URL'] = f'http://127.0.0.1:{port}/versions/'
Server.stop()
super().setUpClass()
@classmethod
def tearDownClass(cls):
Server.stop()
cls.fixture.shutdown()
for key, value in cls.previous.items():
if value is None: os.environ.pop(key, None)
else: os.environ[key] = value
def backend(self):
code = '''import json,pathlib
h=pathlib.Path.home(); b=h/'.local/share/frame-control/decky/.frame-control'; b.mkdir(parents=True,exist_ok=True)
(b/'receipt.json').write_text(json.dumps({'managedBy':'Frame Control','version':'v3.3.0'}))
(b.parent/'plugins').mkdir(exist_ok=True)
u=h/'.config/systemd/user/frame-control-decky.service'; u.parent.mkdir(parents=True,exist_ok=True); u.write_text('[Service]')'''
ssh('python3 -c ' + shlex.quote(code))
ssh('mkdir -p ~/.local/share/frame-control/headset/bundle/ui')
source = (ROOT/'ui/frame_steam.py').read_bytes()
copy = subprocess.run(['ssh','frame','cat > ~/.local/share/frame-control/headset/bundle/ui/frame_steam.py'],
input=source, capture_output=True, timeout=20)
self.assertEqual(copy.returncode, 0, copy.stderr)
def test_store_install_update_remove_and_guards(self):
self.backend()
status, _, _ = api('GET', '/api/decky/store', headers={'X-Frame-UI':''})
self.assertEqual(status, 403)
catalogue = ok('GET', '/api/decky/store')['plugins']
self.assertEqual((catalogue[0]['version'], catalogue[0]['sha256']), ('1.0.0', HASHES[0]))
status, _, _ = api('POST', '/api/decky/plugin', {'action':'install','id':999})
self.assertEqual(status, 400) # Third-party code needs explicit acknowledgement.
job = finished(ok('POST', '/api/decky/plugin',
{'action':'install','id':999,'acknowledged':True}))
self.assertFalse(job.get('error'), job)
self.assertEqual(ok('GET', '/api/decky')['plugins'][0]['version'], '1.0.0')
self.assertIn('Sample 1.0.0', ssh('cat ~/.local/share/frame-control/decky/plugins/sample-panel/dist/index.js'))
status, _, _ = api('POST', '/api/framey/method', {'id':999,'method':'get_setting','args':[]},
headers={'X-Frame-UI':''})
self.assertEqual(status, 403)
status, _, _ = api('POST', '/api/framey/method', {'id':999,'method':'x;alert(1)','args':[]})
self.assertEqual(status, 400)
self.assertEqual(ok('POST', '/api/framey/method',
{'id':999,'method':'get_setting','args':['theme','dark']})['result'], 'dark')
self.assertTrue(ok('POST', '/api/framey/method',
{'id':999,'method':'set_setting','args':['theme','light']})['result'])
self.assertEqual(ok('POST', '/api/framey/method',
{'id':999,'method':'get_setting','args':['theme','dark']})['result'], 'light')
self.assertEqual(ok('POST', '/api/framey/method',
{'id':999,'method':'get_setting','args':[{'key':'theme','default':'dark'}],
'legacy':True})['result'], {'success':True,'result':'light'})
self.assertEqual(ok('POST', '/api/framey/method',
{'id':999,'method':'set_setting','args':[{'key':'legacy','value':'saved'}],
'legacy':True})['result'], {'success':True,'result':True})
self.assertEqual(ok('POST', '/api/framey/method',
{'id':999,'method':'get_setting','args':['legacy','default']})['result'], 'saved')
StoreFixture.release = 1
job = finished(ok('POST', '/api/decky/plugin',
{'action':'update','id':999,'acknowledged':True}))
self.assertFalse(job.get('error'), job)
self.assertEqual(ok('GET', '/api/decky')['plugins'][0]['version'], '1.1.0')
self.assertEqual(ok('POST', '/api/framey/method',
{'id':999,'method':'get_setting','args':['theme','dark']})['result'], 'light')
job = finished(ok('POST', '/api/decky/plugin',
{'action':'remove','id':999,'acknowledged':True}))
self.assertFalse(job.get('error'), job)
self.assertEqual(ok('GET', '/api/decky')['plugins'], [])
self.assertEqual(ssh('test -e ~/.local/share/frame-control/decky/plugins/sample-panel && echo yes || echo no').strip(), 'no')
status, _, _ = api('POST', '/api/framey/method',
{'id':999,'method':'get_setting','args':['theme','dark']})
self.assertEqual(status, 400) # No method calls while the plugin is removed.
job = finished(ok('POST', '/api/decky/plugin',
{'action':'install','id':999,'acknowledged':True}))
self.assertFalse(job.get('error'), job)
self.assertEqual(ok('POST', '/api/framey/method',
{'id':999,'method':'get_setting','args':['theme','dark']})['result'], 'light')
stale = finished(ok('POST', '/api/decky/plugin',
{'action':'update','id':999,'sha256':HASHES[0],
'acknowledged':True}))
self.assertIn('version changed', stale.get('error', ''))
self.assertEqual(ok('GET', '/api/decky')['plugins'][0]['version'], '1.1.0')
def test_pinned_official_plugins_install_and_remove(self):
self.backend()
catalog = {plugin['id']:plugin for plugin in ok('GET', '/api/decky/store')['plugins']}
for plugin in OFFICIAL_PLUGINS:
with self.subTest(plugin=plugin['name']):
self.assertEqual(catalog[plugin['id']]['sha256'], plugin['sha256'])
job = finished(ok('POST', '/api/decky/plugin',
{'action':'install','id':plugin['id'],'acknowledged':True}))
self.assertFalse(job.get('error'), job)
found = [item for item in ok('GET', '/api/decky')['plugins']
if item['storeId'] == plugin['id']]
self.assertEqual(len(found), 1)
self.assertEqual(found[0]['version'], plugin['version'])
installed = f"~/.local/share/frame-control/decky/plugins/{plugin['folder']}"
with zipfile.ZipFile(io.BytesIO(official_archive(plugin))) as bundle:
expected = hashlib.sha256(bundle.read(plugin['folder']+'/dist/index.js')).hexdigest()
self.assertEqual(ssh(f'sha256sum {installed}/dist/index.js').split()[0], expected)
self.assertEqual(json.loads(ssh(f'cat {installed}/plugin.json')).get('api_version', 'legacy'), plugin['api_version'])
job = finished(ok('POST', '/api/decky/plugin',
{'action':'remove','id':plugin['id'],'acknowledged':True}))
self.assertFalse(job.get('error'), job)
self.assertFalse(any(item['storeId'] == plugin['id']
for item in ok('GET', '/api/decky')['plugins']))
+10 -1
View File
@@ -3,9 +3,11 @@
Stable NRestarts=0 and inactive keep-awake are harness assumptions, not observed
device behavior. Real Frame query forms come from the historical doctor runbook
(2026-09-28, BUILD_ID 20260925.6191901). No service control is emulated here.
(2026-09-28, BUILD_ID 20260925.6191901). The Framey e2e fixture emulates only
the Decky test unit's active/start/stop answers; no real service is launched.
"""
import sys
from pathlib import Path
args = sys.argv[1:]
if args in (['--user', 'show', 'steam.service', '-p', 'NRestarts', '--value'],
@@ -13,5 +15,12 @@ if args in (['--user', 'show', 'steam.service', '-p', 'NRestarts', '--value'],
print('0')
elif args == ['--user', 'show', 'fc-keep-awake.service', '-p', 'ActiveState', '--value']:
print('inactive')
elif args in (['--user', 'is-active', 'frame-control-decky.service'],
['--user', 'is-active', '--quiet', 'frame-control-decky.service'],
['--user', 'stop', 'frame-control-decky.service'],
['--user', 'start', 'frame-control-decky.service']) and \
(Path.home()/'.config/systemd/user/frame-control-decky.service').is_file():
if args[1] == 'is-active' and '--quiet' not in args:
print('active')
else:
sys.exit(1)
@@ -25,6 +25,31 @@ function newShortcutId(steam) {
}
function build(steam) {
// Synthetic Decky API for Framey's CDP bridge test. This does not model the
// real loader or prove frontend visibility on a headset.
const deckyBackend = {async call(route, plugin, method, ...args) {
if (!['loader/call_plugin_method','loader/call_legacy_plugin_method'].includes(route) || plugin !== 'Sample Panel')
throw Error('unexpected Decky plugin route');
const settings = (steam.decky_settings ||= {});
const owned = (settings[plugin] ||= {});
if (route === 'loader/call_legacy_plugin_method') {
const kwargs = args[0];
if (method === 'get_setting')
return {success:true, result:Object.hasOwn(owned, kwargs.key) ? owned[kwargs.key] : kwargs.default};
if (method === 'set_setting') {
owned[kwargs.key] = kwargs.value;
return {success:true, result:true};
}
return {success:false, result:'method unavailable in fake Decky backend'};
}
if (method === 'get_setting')
return Object.hasOwn(owned, args[0]) ? owned[args[0]] : args[1];
if (method === 'set_setting') {
owned[args[0]] = args[1];
return true;
}
throw Error('method unavailable in fake Decky backend');
}};
const findShortcut = id => steam.shortcuts.find(s => s.appid === Number(id));
const gameOverview = a => ({
appid: a.appid, display_name: a.display_name, sort_as: a.display_name, app_type: a.app_type ?? 1,
@@ -66,6 +91,7 @@ function build(steam) {
value,
});
return {
window: {DeckyBackend: deckyBackend}, DeckyBackend: deckyBackend,
...require('./canvas_stub').surface(),
collectionStore: {
GetUserCollectionsByName(name) { return steam.collections.filter(c => c.name === name).map(collection); },
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+31
View File
@@ -0,0 +1,31 @@
# Pinned Decky store test archives
These are unmodified ZIPs downloaded from the official Decky store CDN on
2026-10-25. Each ZIP includes its upstream `LICENSE`. They are test data, not
plugins shipped or installed by Frame Control. The fake Frame tests serve them
from a local fixture so CI does not depend on the store being online.
| File | Official plugin | Version | Store SHA-256 |
| --- | --- | --- | --- |
| `12.zip` | MusicControl | 1.1.6 | `246b89fd653c60a735b1cc401d1b0937d5cb969eea9024561661ff741f081d62` |
| `14.zip` | ProtonDB Badges | 1.3.4 | `90a3453ac02709cad64096e7539fd8141fa56f99ae3441fc24a4990dc9684358` |
| `123.zip` | Steam Status | 1.2.3 | `9053308e04a74f44745b45b9f4f50af3673348d367e7b14bacc5677de707ac4e` |
| `50.zip` | Storage Cleaner | 1.4.0 | `1afa1a6f129c5d419de0e0bf0f6db8d8e50385a5659179346e996031ea372591` |
| `18.zip` | Bluetooth | 3.1.1 | `f07f7b74f31da15b5e3a8234a3f00faa01365b56b8f496aca7bb79120be7b8a5` |
| `26.zip` | HLTB for Deck | 2.0.12 | `bd54a23b0b8ec0798aa590e5be236522a593529d7680e77fb888e2971bf3d558` |
The matching source projects are
[MusicControl](https://github.com/nikurasu/MusicControl),
[ProtonDB Badges](https://github.com/bschelst/protondb-decky),
[Steam Status](https://github.com/bschelst/steamstatus-decky),
[Storage Cleaner](https://github.com/mcarlucci/decky-storage-cleaner),
[Bluetooth](https://github.com/Outpox/Bluetooth), and
[HLTB for Deck](https://github.com/morwy/hltb-for-deck).
The test verifies the ZIP digest, archive policy, API v1/v2 manifest, installed
frontend bytes, managed store receipt, and removal. Separate local host tests
start Bluetooth's frontend and its initial panel without running effects or
actions, and start HLTB's frontend and shallow settings view with a stub Steam
module lookup. They do **not** run plugin Python backends, Bluetooth actions,
HLTB searches, or prove JavaScript panels render in the VR shell. The
Bluetooth result and limits are in
[the fixture evidence](../../../docs/evidence/framey-bluetooth-fixture-2026-10-25.md).
+30
View File
@@ -0,0 +1,30 @@
"""Pinned official Decky store archives used only in disposable test fixtures."""
from pathlib import Path
ROOT = Path(__file__).parent / 'fixtures/framey-official'
PLUGINS = (
{'id': 12, 'name': 'MusicControl', 'version': '1.1.6', 'api_version': 'legacy', 'folder': 'MusicControl', 'sha256': '246b89fd653c60a735b1cc401d1b0937d5cb969eea9024561661ff741f081d62'},
{'id': 14, 'name': 'ProtonDB Badges', 'version': '1.3.4', 'api_version': 2,
'folder': 'protondb-decky', 'sha256': '90a3453ac02709cad64096e7539fd8141fa56f99ae3441fc24a4990dc9684358'},
{'id': 123, 'name': 'Steam Status', 'version': '1.2.3', 'api_version': 2,
'folder': 'steamstatus-decky', 'sha256': '9053308e04a74f44745b45b9f4f50af3673348d367e7b14bacc5677de707ac4e'},
{'id': 50, 'name': 'Storage Cleaner', 'version': '1.4.0', 'api_version': 1,
'folder': 'decky-storage-cleaner', 'sha256': '1afa1a6f129c5d419de0e0bf0f6db8d8e50385a5659179346e996031ea372591'},
{'id': 18, 'name': 'Bluetooth', 'version': '3.1.1', 'api_version': 1,
'folder': 'Bluetooth', 'sha256': 'f07f7b74f31da15b5e3a8234a3f00faa01365b56b8f496aca7bb79120be7b8a5'},
{'id': 26, 'name': 'HLTB for Deck', 'version': '2.0.12', 'api_version': 1,
'folder': 'hltb-for-deck', 'sha256': 'bd54a23b0b8ec0798aa590e5be236522a593529d7680e77fb888e2971bf3d558'},
{'id': 36, 'name': 'SteamGridDB', 'version': '1.8.1', 'api_version': 1,
'folder': 'decky-steamgriddb', 'sha256': 'e84f5b1f111af8862b06218479491fbf61036e1bfd9f16f93f9901e9b9ebc5e0'},
)
# This archive has a legacy IIFE frontend with no manifest API version.
LEGACY_PLUGINS = (
{'id': 7, 'name': 'CSS Loader', 'version': '2.1.3', 'api_version': 'legacy',
'folder': 'SDH-CssLoader', 'sha256': '99beaf1374af82408e6d056e0b0147e5fca544e1035fa7ab88419231697bc231'},
)
def archive(plugin):
return (ROOT / f"{plugin['id']}.zip").read_bytes()
+208
View File
@@ -0,0 +1,208 @@
import assert from 'node:assert/strict';
import {readFileSync} from 'node:fs';
import vm from 'node:vm';
const source=readFileSync(new URL('../../ui/framey-host.js',import.meta.url),'utf8');
const testSource=source.replace(/\n start\(\);\n\}\)\(\);\s*$/, '\n window.__surface=PluginSurface; window.__legacy=legacyServerAPI;\n})();');
assert.notEqual(testSource,source);
const states=[];
const React={Fragment:'fragment',Component:class {},createElement:(type,props,...children)=>({type,props:props||{},children}),
useState:value=>[value,next=>states.push(next)], useEffect(){},isValidElement:value=>!!value?.type};
class Element {constructor(){this.children=[];this.textContent='';this.attributes={};}
append(...children){this.children.push(...children);}setAttribute(key,value){this.attributes[key]=value;}
remove(){this.removed=true;}}
const elements=new Map();
const roots=new Map();
const window={React,ReactDOM:{createRoot:node=>{
const root={render(value){this.value=value;},unmount(){this.unmounted=true;}};
roots.set(node,root);return root;
}},addEventListener(){}};
const listeners=[];const messages=[];const parent={postMessage:message=>messages.push(message)};
const context=vm.createContext({window,document:{getElementById:id=>{
if(!elements.has(id))elements.set(id,new Element());return elements.get(id);},createElement:()=>new Element()},
navigator:{language:'en'}, parent,addEventListener:(type,handler)=>listeners.push({type,handler}),
setTimeout:()=>1,clearTimeout(){}});
vm.runInContext(testSource,context);
// Official @decky/rollup bundles use the automatic JSX runtime, including keyed lists.
const jsx=window.SP_JSX.jsx('p',{id:'message',children:'Saved'},'message-key');
assert.equal(jsx.type,'p');
assert.equal(jsx.props.id,'message');
assert.equal(jsx.props.key,'message-key');
assert.deepEqual(jsx.children,['Saved']);
const fragments=window.SP_JSX.jsxs(window.SP_JSX.Fragment,{children:['one','two']});
assert.equal(fragments.type,React.Fragment);
assert.deepEqual(fragments.children,[['one','two']]);
const nodes=(tree,type)=>Array.isArray(tree)?tree.flatMap(child=>nodes(child,type)):
[...(tree?.type===type?[tree]:[]),...(tree?.children||[]).flatMap(child=>nodes(child,type))];
// Disabled controls stay inert even if a caller invokes their handlers directly.
let changed=0;
const toggle=nodes(window.DFL.ToggleField({label:'Enabled',checked:true,disabled:true,
onChange:()=>changed++}),'input')[0];
const options=[{label:'Modes',options:[{label:'Slow',data:'slow'},{label:'Fast',data:'fast'}]}];
const dropdown=nodes(window.DFL.Dropdown({rgOptions:options,selectedOption:'fast',disabled:true,
onChange:()=>changed++}),'select')[0];
const button=nodes(window.DFL.ButtonItem({label:'Reload',description:'Read setting',disabled:true,
onClick:()=>changed++}),'button')[0];
const input=nodes(window.DFL.TextField({label:'Alias',value:'Old',placeholder:'New',disabled:true,
onChange:()=>changed++}),'input')[0];
const slider=nodes(window.DFL.SliderField({label:'Speed',value:2,min:0,max:10,step:2,disabled:true,
onChange:()=>changed++}),'input')[0];
const checkbox=nodes(window.DFL.DialogCheckbox({label:'Game',disabled:true,
onChange:()=>changed++}),'input')[0];
for(const control of [toggle,dropdown,button,input,slider,checkbox])assert.equal(control.props.disabled,true);
assert.equal(input.props.value,'Old');
assert.equal(slider.props.type,'range');
assert.equal(dropdown.props.value,'1');
assert.equal(nodes(dropdown,'optgroup').length,1);
toggle.props.onChange({target:{checked:false}});
dropdown.props.onChange({target:{value:'0'}});
button.props.onClick({});
input.props.onChange({target:{value:'New'}});
slider.props.onChange({target:{value:'4'}});
checkbox.props.onChange({target:{checked:true}});
assert.equal(changed,0);
let entered='';
const readyInput=nodes(window.DFL.TextField({label:'Alias',value:'Old',onChange:e=>{entered=e.target.value;}}),'input')[0];
readyInput.props.onChange({target:{value:'New'}});assert.equal(entered,'New');
let speed=0;
const readySlider=nodes(window.DFL.SliderField({label:'Speed',value:2,onChange:v=>{speed=v;}}),'input')[0];
readySlider.props.onChange({target:{value:'4'}});assert.equal(speed,4);
let selected;
const readyDropdown=nodes(window.DFL.Dropdown({rgOptions:options,selectedOption:'fast',
onChange:option=>{selected=option;}}),'select')[0];
readyDropdown.props.onChange({target:{value:'0'}});assert.equal(selected.data,'slow');
const readyButton=nodes(window.DFL.ButtonItem({label:'Reload',onClick:()=>changed++}),'button')[0];
assert.equal(readyButton.props.disabled,false);
readyButton.props.onClick({});assert.equal(changed,1);
let called=0;
const plugin={content:{type:'content'},settings:{type:'settings'},titleView:{type:'title'},
frameyQuickActions:[{label:'Refresh data',onClick:async()=>{called++;return 'Fresh';}},
{label:'invalid'},...Array.from({length:9},(_,i)=>({label:`Action ${i}`,onClick:()=>{}}))]};
const tree=window.__surface({plugin});
const buttons=nodes(tree,'button');
assert.equal(buttons.length,9); // Panel, Settings, and seven valid actions inside the first eight entries.
assert.equal(nodes(tree,'nav')[0].props['aria-label'],'Plugin views');
assert.equal(nodes(tree,'section')[0].props['aria-label'],'Plugin quick actions');
assert.equal(nodes(tree,'header').length,1);
await buttons[2].props.onClick();
assert.equal(called,1);
assert.deepEqual(states.slice(-3),[0,'Refresh data…','Fresh',null].slice(-3));
assert.equal(nodes(window.__surface({plugin:{settings:{type:'settings'}}}),'nav').length,1);
// API v2 backend calls remain request-scoped and errors return to the caller.
const api=window.__DECKY_SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_deckyLoaderAPIInit.connect(2,'Test');
const reply=api.call('get_setting','mode','default');
const call=messages.find(message=>message.type==='framey:call');
assert.equal(call.method,'get_setting');
assert.deepEqual(Array.from(call.args),['mode','default']);
listeners.find(x=>x.type==='message').handler({source:parent,data:{type:'framey:reply',id:call.id,result:'dark'}});
assert.equal(await reply,'dark');
await assert.rejects(api.call('x;alert(1)'),/Invalid backend method/);
const toast=api.toaster.toast({title:'Saved',body:'Mode updated',duration:4000});
const toastNode=elements.get('framey-toasts').children[0];
assert.equal(toastNode.attributes.role,'status');
assert.equal(toastNode.children[0].textContent,'Saved');
assert.equal(toastNode.children[1].textContent,'Mode updated');
toast.dismiss();assert.equal(toastNode.removed,true);
// Decky's toast fields are ReactNode values. Keep JSX in the panel instead of
// showing "[object Object]", and release their React roots on dismissal.
const heading=React.createElement('em',null,'Saved');
const detail=React.createElement('span',null,'Mode updated');
const icon=React.createElement('svg',null);
const rich=api.toaster.toast({title:heading,body:[detail,' again'],icon,
subtext:'Open settings',showToast:true});
const richNode=elements.get('framey-toasts').children[1];
assert.equal(roots.get(richNode.children[0]).value,icon);
assert.equal(roots.get(richNode.children[1]).value,heading);
assert.deepEqual(Array.from(roots.get(richNode.children[2]).value),[detail,' again']);
assert.equal(richNode.children[3].textContent,'Open settings');
rich.dismiss();rich.dismiss();
assert.equal(richNode.removed,true);
for(const node of richNode.children.slice(0,3))assert.equal(roots.get(node).unmounted,true);
let opened=0;
const actionable=api.toaster.toast({title:'Open',onClick:()=>opened++});
const actionNode=elements.get('framey-toasts').children[2];
actionNode.children.at(-1).onclick();
assert.equal(opened,1);
assert.equal(actionNode.removed,true);
actionable.dismiss();
const hidden=api.toaster.toast({title:heading,showToast:false});
assert.equal(elements.get('framey-toasts').children.length,3);
hidden.dismiss();
function LocalRoute(){return React.createElement('p',null,'Route content');}
const undo=api.routerHook.addRoute('/plugin/details',LocalRoute);
assert.equal(window.DFL.Navigation.Navigate('/plugin/details'),true);
assert.equal(nodes(window.__surface({plugin}),LocalRoute).length,1);
assert.equal(window.DFL.Navigation.Navigate('/decky/store'),false);
assert.equal(window.DFL.findModuleChild(()=>true),null);
window.DFL.Navigation.CloseSideMenus();
assert.equal(nodes(window.__surface({plugin}),LocalRoute).length,0);
undo();assert.equal(window.DFL.Navigation.Navigate('/plugin/details'),false);
// Legacy backend methods preserve Decky keyword arguments and success envelopes.
const legacyReply=window.__legacy.callPluginMethod('get_setting',{key:'theme'});
const legacyCall=messages.filter(message=>message.type==='framey:call').at(-1);
assert.equal(legacyCall.legacy,true);
assert.deepEqual(JSON.parse(JSON.stringify(legacyCall.args)),[{key:'theme'}]);
listeners.find(x=>x.type==='message').handler({source:parent,data:{type:'framey:reply',id:legacyCall.id,
result:{success:true,result:'dark'}}});
assert.equal((await legacyReply).result,'dark');
assert.equal((await window.__legacy.callPluginMethod('get_setting',[])).success,false);
const failedLegacy=window.__legacy.callPluginMethod('get_setting',{});
const failedCall=messages.filter(message=>message.type==='framey:call').at(-1);
listeners.find(x=>x.type==='message').handler({source:parent,data:{type:'framey:reply',id:failedCall.id,error:'Unavailable'}});
assert.equal((await failedLegacy).success,false);
// Local UI controls work without Steam components or fabricated hardware data.
const tabChanges=[];
const tabs=window.DFL.Tabs({tabs:[{id:'one',title:'One',content:'First'},
{id:'two',title:'Two',content:'Second'},{id:'locked',title:'Locked',disabled:true}],
activeTab:'two',onShowTab:id=>tabChanges.push(id)});
assert.equal(nodes(tabs,'button')[1].props['aria-selected'],true);
assert.deepEqual(nodes(tabs,'div').at(-1).children,['Second']);
nodes(tabs,'button')[0].props.onClick();
nodes(tabs,'button')[2].props.onClick();
assert.deepEqual(tabChanges,['one']);
assert.equal(window.DFL.Spinner({}).props.role,'status');
assert.equal(window.DFL.ProgressBar({nProgress:120}).props.value,100);
assert.equal(window.DFL.joinClassNames('one',null,'two'),'one two');
let eventCount=0;
const unsubscribe=window.SteamClient.GameSessions.RegisterForAppLifetimeNotifications(()=>eventCount++);
assert.equal(typeof unsubscribe,'function');
assert.equal(unsubscribe.unregister,unsubscribe);
unsubscribe.unregister();unsubscribe();assert.equal(eventCount,0);
assert.equal(window.SteamClient.System.ShutdownPC,undefined);
assert.equal(window.DFL.Router.MainRunningApp,undefined);
assert.equal(window.indexedDB,undefined); // localForage must use bounded plugin storage.
const unpatch=window.DFL.beforePatch({},'method',()=>{});
assert.equal(unpatch.unpatch,unpatch);unpatch.unpatch();
assert.equal(typeof window.DFL.showModal({type:'p'}).Close,'function');
let selectedMenuItem=0;
window.DFL.MenuItem({onSelected:()=>selectedMenuItem++}).props.onClick({});
window.DFL.MenuItem({disabled:true,onSelected:()=>selectedMenuItem++}).props.onClick({});
window.DFL.MenuItem({bDisabled:true,onSelected:()=>selectedMenuItem++}).props.onClick({});
window.DFL.MenuItem({onClick:()=>selectedMenuItem++,onSelected:()=>selectedMenuItem++}).props.onClick({});
assert.equal(selectedMenuItem,2);
for (const [locale,expected] of [['de-DE','german'],['zh-CN','schinese'],['zh-TW','tchinese'],
['pt-BR','brazilian'],['en-US','english'],['xx-ZZ','english']]) {
context.navigator.language=locale;
assert.equal(await window.SteamClient.Settings.GetCurrentLanguage(),expected);
}
function GameRoute(){return React.createElement('p',null,window.DFL.useParams().appid);}
const removeGame=api.routerHook.addRoute('/plugin/game/:appid/:view?',GameRoute);
assert.equal(window.DFL.Navigation.Navigate('/plugin/game/123'),true);
assert.equal(window.DFL.useParams().appid,'123');
assert.equal(window.DFL.useParams().view,undefined);
assert.equal(nodes(window.__surface({plugin}),GameRoute).length,1);
assert.equal(window.DFL.Navigation.Navigate('/plugin/game/123/art'),true);
assert.equal(window.DFL.useParams().view,'art');
assert.equal(window.DFL.Navigation.Navigate('/plugin/game/123/art/extra'),false);
assert.equal(window.DFL.Navigation.Navigate('/plugin/game/123?admin=1'),false);
assert.equal(window.DFL.Navigation.Navigate('/plugin/game//art'),false);
assert.throws(()=>api.routerHook.addRoute('/plugin/:id/:id',GameRoute));
assert.throws(()=>api.routerHook.addRoute('/plugin/:id?/art',GameRoute));
removeGame();
assert.equal(window.DFL.useParams().appid,undefined);
assert.equal(nodes(window.__surface({plugin}),GameRoute).length,0);
+43
View File
@@ -0,0 +1,43 @@
// Start the unmodified official Bluetooth frontend and build its initial UI.
// Effects and click handlers are inert: no Bluetooth/backend operation runs.
import assert from 'node:assert/strict';
import {readFileSync} from 'node:fs';
import vm from 'node:vm';
const bundle=readFileSync(process.argv[2],'utf8');
const official=bundle.replace(/export \{ index as default \};\s*\/\/# sourceMappingURL=index.js.map\s*$/,
'window.__official = index;');
assert.notEqual(official,bundle);
const source=readFileSync(new URL('../../ui/framey-host.js',import.meta.url),'utf8');
const host=source.replace(/\n start\(\);\n\}\)\(\);\s*$/, '\n})();');
assert.notEqual(host,source);
const react=new Proxy({Fragment:'fragment',Component:class {},
createElement:(type,props,...children)=>({type,props,children}),
createContext:value=>({Provider:()=>{},Consumer:()=>{},_currentValue:value}),
useState:value=>[value,()=>{}],useReducer:(_,value)=>[value,()=>{}],
useEffect(){},useRef:value=>({current:value}),useMemo:fn=>fn(),
useCallback:fn=>fn,forwardRef:fn=>fn,memo:fn=>fn},
{get:(target,key)=>target[key]??(()=>{})});
const window={React:react,ReactDOM:{createRoot:()=>({render(){}})},location:{hash:''}};
const elements=new Map();
const messages=[];
const context=vm.createContext({window,navigator:{language:'en'},parent:{postMessage:message=>messages.push(message)},
document:{getElementById:id=>{if(!elements.has(id))elements.set(id,{});return elements.get(id);}},
addEventListener(){},setTimeout:()=>1,clearTimeout(){},console,URL,Blob});
vm.runInContext(host,context);
context.DFL=window.DFL;
context.SP_REACT=window.SP_REACT;
context.SP_JSX=window.SP_JSX;
context.LocalizationManager=window.LocalizationManager;
assert.equal(window.LocalizationManager.m_mapTokens.size,0);
assert.equal(window.LocalizationManager.m_mapFallbackTokens.get('Settings_Bluetooth_Devices'),'Devices');
vm.runInContext(official,context,{timeout:2000});
const plugin=window.__official();
assert.equal(plugin.content?.type?.name,'Content');
const panel=plugin.content.type();
assert.equal(panel.type,'div');
const text=JSON.stringify(panel);
assert.match(text,/Bluetooth/);
assert.match(text,/Devices/); // Readable fallback when Steam tokens are absent.
assert.doesNotMatch(text,/Settings_Bluetooth_Devices/);
assert.equal(messages.filter(message=>message.type==='framey:call').length,0);
+69
View File
@@ -0,0 +1,69 @@
import assert from 'node:assert/strict';
import {readFileSync} from 'node:fs';
import vm from 'node:vm';
const html=readFileSync(new URL('../../ui/headset.html',import.meta.url),'utf8');
const parentSource=html.match(/<script>([\s\S]*?)<\/script>/)[1].split('refresh();refreshGames();')[0];
const hostSource=readFileSync(new URL('../../ui/framey-host.js',import.meta.url),'utf8')
.replace(/\n start\(\);\n\}\)\(\);\s*$/, '\n})();');
assert.match(hostSource,/framey:cache:init/);
const values=new Map();
const localStorage={getItem:key=>values.get(key)??null,setItem:(key,value)=>values.set(key,value)};
const elements=new Map();
const el=id=>{if(!elements.has(id))elements.set(id,{id,hidden:false,removeAttribute(){},scrollIntoView(){}});
return elements.get(id);};
const parentListeners=[];
const parent=vm.createContext({document:{getElementById:el,createElement:()=>({})},
location:{hash:'',pathname:'/'},history:{replaceState(){}},
sessionStorage:{getItem:()=>null,setItem(){}},localStorage,
window:{addEventListener:(type,fn)=>parentListeners.push({type,fn})},
setTimeout(){},setInterval(){},fetch(){throw Error('No network expected');},console});
vm.runInContext(parentSource,parent);
vm.runInContext('deckyState={plugins:[{storeId:14}]};openFrameyPanel(14,"Steam Status")',parent);
let session=vm.runInContext('frameySession',parent);
const firstURL=new URL(el('frameyFrame').src,'http://127.0.0.1');
const onParent=parentListeners.find(x=>x.type==='message').fn;
function iframe(){
const listeners=[];const queued=[];let live=false;
const frameWindow={location:{hash:`#${session}`},React:{Fragment:'fragment',Component:class {},createElement:()=>({}),isValidElement:()=>true},
ReactDOM:{createRoot:()=>({render(){}})}};
const proxy={postMessage:message=>listeners.find(x=>x.type==='message')?.fn({source:hostParent,data:message})};
el('frameyFrame').contentWindow=proxy;
const hostParent={postMessage:message=>live?onParent({source:proxy,data:message}):queued.push(message)};
const context=vm.createContext({window:frameWindow,document:{getElementById:()=>({})},
navigator:{language:'en'},parent:hostParent,DOMException,
addEventListener:(type,fn)=>listeners.push({type,fn}),setTimeout(){},clearTimeout(){}});
vm.runInContext(hostSource,context);
for(const message of queued)onParent({source:proxy,data:message});
live=true;
const send=message=>onParent({source:proxy,data:message});
return {storage:frameWindow.localStorage,send};
}
let first=iframe();
assert.equal(first.storage.getItem('status-cache'),null);
first.storage.setItem('status-cache','{"online":true}');
assert.equal(values.get('framey-plugin-cache-v1:14'),'{"status-cache":"{\\"online\\":true}"}');
first.storage.setItem('temporary','discard');
first.storage.removeItem('temporary');
const oldSession=session;
vm.runInContext('openFrameyPanel(14,"Steam Status")',parent);
session=vm.runInContext('frameySession',parent);
assert.notEqual(session,oldSession);
const reopenedURL=new URL(el('frameyFrame').src,'http://127.0.0.1');
// Fragment-only navigation preserves the old document, host and cache session.
assert.notEqual(reopenedURL.pathname+reopenedURL.search,firstURL.pathname+firstURL.search);
assert.equal(reopenedURL.searchParams.get('session'),session);
assert.equal(reopenedURL.hash.slice(1),session);
let reopened=iframe();
assert.equal(reopened.storage.getItem('status-cache'),'{"online":true}');
assert.equal(reopened.storage.length,1);
assert.equal(reopened.storage.key(0),'status-cache');
assert.throws(()=>reopened.storage.setItem('huge','x'.repeat(65537)),/Framey plugin cache is full/);
// A malformed or over-limit message from a plugin must not poison saved data.
reopened.send({type:'framey:cache:save',session,entries:{huge:'x'.repeat(65537)}});
assert.equal(values.get('framey-plugin-cache-v1:14'),'{"status-cache":"{\\"online\\":true}"}');
reopened.send({type:'framey:cache:save',session:oldSession,entries:{poison:'yes'}});
assert.equal(values.get('framey-plugin-cache-v1:14'),'{"status-cache":"{\\"online\\":true}"}');
reopened.storage.clear();
assert.equal(values.get('framey-plugin-cache-v1:14'),'{}');
+57
View File
@@ -0,0 +1,57 @@
// Execute the pinned official HLTB frontend's entry point with Framey's API.
// This checks module startup only; it never makes network or backend calls.
import assert from 'node:assert/strict';
import {readFileSync} from 'node:fs';
import {inflateRawSync} from 'node:zlib';
import vm from 'node:vm';
const host=readFileSync(new URL('../../ui/framey-host.js',import.meta.url),'utf8');
const hostTest=host.replace(/\n start\(\);\n\}\)\(\);\s*$/, '\n})();');
assert.notEqual(hostTest,host);
const zip=readFileSync(new URL('../fixtures/framey-official/26.zip',import.meta.url));
const eocd=zip.lastIndexOf(Buffer.from([0x50,0x4b,0x05,0x06]));
assert.ok(eocd>0);
let offset=zip.readUInt32LE(eocd+16),bundle;
for(let i=0;i<zip.readUInt16LE(eocd+10);i++){
assert.equal(zip.readUInt32LE(offset),0x02014b50);
const nameLength=zip.readUInt16LE(offset+28),extraLength=zip.readUInt16LE(offset+30);
const commentLength=zip.readUInt16LE(offset+32);
const name=zip.subarray(offset+46,offset+46+nameLength).toString();
if(name==='hltb-for-deck/dist/index.js'){
const local=zip.readUInt32LE(offset+42);
assert.equal(zip.readUInt32LE(local),0x04034b50);
const start=local+30+zip.readUInt16LE(local+26)+zip.readUInt16LE(local+28);
const compressed=zip.subarray(start,start+zip.readUInt32LE(offset+20));
bundle=(zip.readUInt16LE(offset+10)===8?inflateRawSync(compressed):compressed).toString();
}
offset+=46+nameLength+extraLength+commentLength;
}
assert.ok(bundle);
const official=bundle.replace(/export \{ index as default \};\s*\/\/# sourceMappingURL=index.js.map\s*$/,
'window.__official = index;');
assert.notEqual(official,bundle);
const react=new Proxy({Fragment:'fragment',Component:class {},
createElement:(type,props,...children)=>({type,props,children}),
createContext:value=>({Provider:()=>{},Consumer:()=>{},_currentValue:value}),
forwardRef:fn=>fn,memo:fn=>fn,useState:value=>[value,()=>{}],
useContext:ctx=>ctx?._currentValue,useMemo:fn=>fn(),useCallback:fn=>fn,
useRef:value=>({current:value}),useEffect(){}},
{get:(target,key)=>target[key]??(()=>{})});
const window={React:react,ReactDOM:{createRoot:()=>({render(){}})},location:{hash:''}};
const elements=new Map();
const context=vm.createContext({window,navigator:{language:'en'},parent:{postMessage(){}},
document:{getElementById:id=>{if(!elements.has(id))elements.set(id,{});return elements.get(id);}},
addEventListener(){},setTimeout:()=>1,clearTimeout(){},console,URL,Blob});
vm.runInContext(hostTest,context);
context.DFL=window.DFL;
context.SP_REACT=window.SP_REACT;
context.SP_JSX=window.SP_JSX;
vm.runInContext(official,context,{timeout:2000});
const plugin=window.__official();
assert.equal(typeof window.DFL.findModuleChild,'function');
assert.equal(window.DFL.findModuleChild(()=>{}),null); // Steam has no matching module in the VR panel.
assert.equal(plugin.content?.type?.name,'QuickAccessView');
const panel=plugin.content.type();
assert.ok(panel?.type); // Read-only settings render with empty local data.
assert.equal(typeof plugin.onDismount,'function');
plugin.onDismount();
+44
View File
@@ -0,0 +1,44 @@
import assert from 'node:assert/strict';
import {readFileSync} from 'node:fs';
import vm from 'node:vm';
const host=readFileSync(new URL('../../ui/framey-host.js',import.meta.url),'utf8')
.replace(/\n start\(\);\n\}\)\(\);\s*$/, '\n})();');
const bundle=readFileSync(new URL('../../examples/framey-settings/dist/index.js',import.meta.url),'utf8');
assert.match(bundle,/SP_JSX\.jsx/);
const React={Fragment:Symbol('fragment'),Component:class {},
createElement:(type,props,...children)=>({type,props:props||{},children}),
useState:value=>[value,()=>{}],useEffect(){},isValidElement:value=>!!value?.type};
const window={React,ReactDOM:{createRoot:()=>({render(){}})},addEventListener(){}};
const listeners=[];
const calls=[];
const parent={postMessage(message){
if(message.type!=='framey:call')return;
calls.push(message);
listeners.find(x=>x.type==='message').handler({source:parent,
data:{type:'framey:reply',id:message.id,result:true}});
}};
const context=vm.createContext({window,document:{getElementById:()=>({})},
navigator:{language:'en'},parent,addEventListener:(type,handler)=>listeners.push({type,handler}),
setTimeout:()=>1,clearTimeout(){}});
vm.runInContext(host,context);
Object.assign(context,{SP_REACT:window.SP_REACT,SP_JSX:window.SP_JSX,DFL:window.DFL});
vm.runInContext(bundle.replace(/export \{ index as default \};/, 'window.sample = index;'),context);
const plugin=window.sample();
assert.equal(plugin.name,'Framey Settings Sample');
assert.equal(typeof plugin.content.type,'function');
const content=plugin.content.type();
assert.equal(content.type,window.DFL.PanelSection);
assert.equal(content.props.title,'Framey settings sample');
assert.equal(content.children[0][0].type,window.DFL.PanelSectionRow);
assert.equal(plugin.settings.type,plugin.content.type);
assert.equal(plugin.frameyQuickActions[0].label,'Read saved setting');
assert.equal(await plugin.frameyQuickActions[0].onClick(),'Saved setting is on');
assert.equal(calls[0].method,'get_setting');
assert.deepEqual(Array.from(calls[0].args),['enabled',false]);
assert.equal(window.DFL.Navigation.Navigate('/framey-sample/details/saved-setting'),true);
assert.equal(window.DFL.useParams().topic,'saved-setting');
assert.equal(window.DFL.Navigation.Navigate('/library/home'),false);
plugin.onDismount();
assert.equal(window.DFL.useParams().topic,undefined);
assert.equal(window.DFL.Navigation.Navigate('/framey-sample/details/saved-setting'),false);
+119
View File
@@ -0,0 +1,119 @@
import assert from 'node:assert/strict';
import {readFileSync} from 'node:fs';
import vm from 'node:vm';
const html = readFileSync(new URL('../../ui/headset.html', import.meta.url), 'utf8');
const script = html.match(/<script>([\s\S]*?)<\/script>/)[1].split('refresh();refreshGames();')[0];
class Element {
constructor(id='') {this.id=id; this.value=''; this.textContent=''; this.children=[]; this.disabled=false; this.hidden=false;}
append(...nodes) {this.children.push(...nodes);}
replaceChildren(...nodes) {this.children=nodes; this.textContent='';}
scrollIntoView() {}
removeAttribute(name) {delete this[name];}
}
const elements = new Map();
elements.set('deckyStoreFilter',Object.assign(new Element('deckyStoreFilter'),{value:'all'}));
const document = {getElementById(id) {if(!elements.has(id)) elements.set(id,new Element(id)); return elements.get(id);},
createElement() {return new Element();}, hidden:false};
const session = new Map();
const ctx = vm.createContext({document, location:{hash:'',pathname:'/'},
sessionStorage:{getItem:key=>session.get(key)||'',setItem:(key,value)=>session.set(key,value),removeItem:key=>session.delete(key)},
history:{replaceState(){}}, confirm:()=>true,
window:{addEventListener(){}}, setInterval(){}, setTimeout(){},
fetch(){throw Error('No network expected');}, console});
vm.runInContext(script,ctx);
const el=id=>document.getElementById(id);
const fixtures=Array.from({length:43},(_,i)=>({id:i+1,name:`Plugin ${i+1}`,author:i===42?'Special Author':'Maker',
description:'A panel',version:'1.0',root:i===0}));
ctx.fixtures=fixtures;
vm.runInContext('deckyStore=fixtures; deckyState={running:true,plugins:[{storeId:2,version:"1.0"}]}; showDeckyStore()',ctx);
assert.equal(el('deckyStoreSummary').textContent,'43 plugins found');
assert.equal(el('deckyStoreList').children.length,20);
assert.equal(el('deckyStorePage').textContent,'Page 1 of 3');
el('deckyStoreNext').onclick();
assert.equal(el('deckyStoreList').children.length,20);
el('deckyStoreNext').onclick();
assert.equal(el('deckyStoreList').children.length,3);
assert.equal(el('deckyStoreNext').disabled,true);
el('deckySearch').value='special author'; el('deckySearch').oninput();
assert.equal(el('deckyStoreSummary').textContent,'1 plugin found');
assert.match(el('deckyStoreList').children[0].children[0].textContent,/Plugin 43/);
assert.equal(el('deckyStorePage').textContent,'Page 1 of 1');
el('deckySearch').value=''; el('deckyStoreFilter').value='installed'; el('deckyStoreFilter').onchange();
assert.equal(el('deckyStoreSummary').textContent,'1 plugin found');
assert.match(el('deckyStoreList').children[0].children[0].textContent,/Plugin 2/);
el('deckyStoreFilter').value='compatible'; el('deckyStoreFilter').onchange();
assert.equal(el('deckyStoreSummary').textContent,'42 plugins found');
el('deckySearch').value='no matching plugin'; el('deckySearch').oninput();
assert.equal(el('deckyStoreList').textContent,'No plugins match this search.');
// The page polls the actual job endpoint and keeps a separate visible result.
ctx.mockApi=async (path,body) => {
if(path==='/api/decky/plugin'){assert.equal(body.sha256,'a'.repeat(64));return {job:'job-1'};}
if(path.startsWith('/api/job'))return {done:true,message:'Installed Plugin 2'};
if(path==='/api/decky')return {running:true,plugins:[{storeId:2,name:'Plugin 2',version:'1.0'}]};
throw Error(`unexpected ${path}`);
};
vm.runInContext('api=mockApi',ctx);
await vm.runInContext('deckyChange("install",{id:2,name:"Plugin 2",sha256:"a".repeat(64)})',ctx);
assert.equal(el('deckyJobStatus').textContent,'Installed Plugin 2');
assert.equal(el('deckyJobProgress').value,100);
assert.equal(el('deckyJobCheck').hidden,true);
assert.equal(session.has('frameyPluginJob'),false);
// A stopped Decky service must still offer recovery by removing its owned plugin.
ctx.mockApi=async path => path==='/api/decky' ?
{managed:true,running:false,plugins:[{storeId:2,name:'Plugin 2',version:'1.0'}]} :
Promise.reject(Error(`unexpected ${path}`));
vm.runInContext('api=mockApi',ctx);
await vm.runInContext('refreshDecky()',ctx);
assert.equal(el('deckyInstalled').children[0].children[2].disabled,false);
el('deckySearch').value='';el('deckyStoreFilter').value='all';
vm.runInContext('showDeckyStore()',ctx);
assert.equal(el('deckyStoreList').children[1].children[1].disabled,true);
ctx.mockApi=async (path,body) => {
if(path==='/api/decky/plugin'){assert.equal(body.sha256,'b'.repeat(64));return {job:'job-2'};}
if(path.startsWith('/api/job'))return {done:true,error:'archive digest mismatch'};
if(path==='/api/decky')return {running:true,plugins:[]};
throw Error(`unexpected ${path}`);
};
vm.runInContext('api=mockApi',ctx);
await vm.runInContext('deckyChange("update",{id:2,name:"Plugin 2",sha256:"b".repeat(64)})',ctx);
assert.match(el('deckyJobStatus').textContent,/Error: archive digest mismatch/);
assert.equal(session.has('frameyPluginJob'),false);
// A failed refresh must remove old install buttons. A late older response
// must not replace the newer catalog the wearer just requested.
ctx.mockApi=async path => {assert.equal(path,'/api/decky/store');throw Error('offline');};
vm.runInContext('api=mockApi',ctx);
await vm.runInContext('loadDeckyStore()',ctx);
assert.match(el('deckyStoreSummary').textContent,/Store unavailable: offline/);
assert.equal(el('deckyStoreList').children.length,0);
let finishOld, finishNew;
ctx.mockApi=path => {assert.equal(path,'/api/decky/store');
return new Promise(resolve=>{if(!finishOld)finishOld=resolve;else finishNew=resolve;});};
vm.runInContext('api=mockApi',ctx);
const old=vm.runInContext('loadDeckyStore()',ctx);
const current=vm.runInContext('loadDeckyStore()',ctx);
assert.equal(el('deckyStoreList').children.length,0);
assert.equal(el('deckyStoreSummary').textContent,'Loading official Decky store…');
finishNew({plugins:[{id:98,name:'Current',version:'2.0',description:'Latest'}]});
await current;
finishOld({plugins:[{id:97,name:'Stale',version:'1.0',description:'Older'}]});
await old;
assert.match(el('deckyStoreList').children[0].children[0].textContent,/Current/);
assert.doesNotMatch(el('deckyStoreList').children[0].children[0].textContent,/Stale/);
// A saved job does not survive a server restart. Clear it instead of offering
// Check result forever for an ID that the new server cannot know.
session.set('frameyPluginJob',JSON.stringify({job:'old-job',action:'install',name:'Plugin 2'}));
ctx.mockApi=async path => {
if(path.startsWith('/api/job'))throw Error('no such job (the app may have restarted)');
if(path==='/api/decky')return {running:true,plugins:[]};
throw Error(`unexpected ${path}`);
};
vm.runInContext('api=mockApi',ctx);
await vm.runInContext('checkDeckyJob()',ctx);
assert.match(el('deckyJobStatus').textContent,/app restarted and lost this job result/);
assert.equal(el('deckyJobCheck').hidden,true);
assert.equal(session.has('frameyPluginJob'),false);
+111 -3
View File
@@ -11,10 +11,12 @@ import sys
import tempfile
import unittest
from unittest.mock import patch
import warnings
import zipfile
sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'ui'))
import frame_decky_store
import frame_decky
def archive(flags=(), extra=None):
@@ -30,14 +32,23 @@ def archive(flags=(), extra=None):
class ArchiveTests(unittest.TestCase):
def test_catalog_selects_valid_visible_latest_versions(self):
records = [{'id': 42, 'name': 'Example', 'visible': True, 'versions':
records = [{'id': 42, 'name': 'Example', 'author': 'Panel Author', 'visible': True, 'versions':
[{'name': '1.0', 'hash': 'a' * 64}], 'tags': []},
{'id': 43, 'name': 'Hidden', 'visible': False, 'versions':
[{'name': '1.0', 'hash': 'b' * 64}]},
{'id': 44, 'name': 'Unsafe', 'visible': True, 'versions':
[{'name': '1.0; touch /tmp/bad', 'hash': 'c' * 64}]}]
with patch.object(frame_decky_store.urllib.request, 'urlopen', return_value=io.BytesIO(json.dumps(records).encode())):
self.assertEqual([p['id'] for p in frame_decky_store.catalog()], [42])
self.assertEqual([(p['id'], p['author']) for p in frame_decky_store.catalog()], [(42, 'Panel Author')])
def test_catalog_marks_underscore_root_and_omits_ambiguous_store_ids(self):
records = [{'id': 42, 'name': 'Needs root', 'tags': ['_root'],
'versions': [{'name': '1.0', 'hash': 'a' * 64}]},
{'id': 43, 'name': 'First', 'versions': [{'name': '1.0', 'hash': 'b' * 64}]},
{'id': 43, 'name': 'Second', 'versions': [{'name': '2.0', 'hash': 'c' * 64}]}]
with patch.object(frame_decky_store.urllib.request, 'urlopen',
return_value=io.BytesIO(json.dumps(records).encode())):
self.assertEqual([(p['id'], p['root']) for p in frame_decky_store.catalog()], [(42, True)])
def test_accepts_hashed_non_root_archive(self):
data, digest = archive()
@@ -53,6 +64,22 @@ class ArchiveTests(unittest.TestCase):
with self.assertRaises(ValueError):
frame_decky_store.archive_info(data, hashlib.sha256(data).hexdigest(), 'Example')
def test_rejects_zip_path_collisions_and_non_object_manifest(self):
for name in ('Example/dist/index.js', 'Example/./dist/index.js',
'Example//dist/index.js'):
with self.subTest(name=name), warnings.catch_warnings():
warnings.simplefilter('ignore', UserWarning)
data, digest = archive(extra=(name, 'replacement'))
with self.assertRaisesRegex(ValueError, 'Unsafe|duplicate'):
frame_decky_store.archive_info(data, digest, 'Example')
stream = io.BytesIO()
with zipfile.ZipFile(stream, 'w') as bundle:
bundle.writestr('Example/plugin.json', '[]')
bundle.writestr('Example/dist/index.js', ' ' * 1200)
data = stream.getvalue()
with self.assertRaisesRegex(ValueError, 'manifest'):
frame_decky_store.archive_info(data, hashlib.sha256(data).hexdigest(), 'Example')
@unittest.skipIf(os.name == 'nt', 'remote plugin transaction runs on Linux')
class StoreTransaction(unittest.TestCase):
@@ -111,17 +138,98 @@ class StoreTransaction(unittest.TestCase):
self.assertNotEqual(result.returncode, 0)
self.assertTrue(external.exists())
def test_remove_while_service_is_stopped_does_not_restart_it(self):
data, _ = archive()
self.assertEqual(self.apply('install', data).returncode, 0)
fake = Path(self.tmp.name) / 'systemctl'
fake.write_text('#!/bin/sh\nif [ "$2" = is-active ]; then exit 1; fi\n'
'echo "$*" >> "$HOME/service-calls"\nexit 0\n')
result = self.apply('remove')
self.assertEqual(result.returncode, 0, result.stderr)
self.assertFalse(self.folder.exists())
self.assertEqual((Path(self.tmp.name) / 'service-calls').read_text().splitlines(),
['--user stop frame-control-decky.service'])
def test_shared_lock_rejects_plugin_and_loader_changes(self):
import fcntl
lock_path = Path(self.tmp.name) / '.local/share/frame-control/decky-transaction.lock'
lock_path.parent.mkdir(parents=True, exist_ok=True)
data, _ = archive()
with lock_path.open('w+b') as held:
fcntl.flock(held, fcntl.LOCK_EX | fcntl.LOCK_NB)
plugin = self.apply('install', data)
loader = subprocess.run([sys.executable, '-', 'remove', 'none', 'none', 'none'],
input=frame_decky.APPLY, text=True, capture_output=True,
env=self.env, timeout=15)
self.assertNotEqual(plugin.returncode, 0)
self.assertNotEqual(loader.returncode, 0)
self.assertIn('Another Decky change is in progress', plugin.stderr)
self.assertIn('Another Decky change is in progress', loader.stderr)
self.assertFalse(self.folder.exists())
installed = self.apply('install', data)
self.assertEqual(installed.returncode, 0, installed.stderr)
self.assertEqual(self.apply('remove').returncode, 0)
def test_remote_apply_rejects_colliding_zip_paths(self):
for name in ('Example/dist/index.js', 'Example/./dist/index.js'):
with self.subTest(name=name), warnings.catch_warnings():
warnings.simplefilter('ignore', UserWarning)
data, _ = archive(extra=(name, 'replacement'))
result = self.apply('install', data)
self.assertNotEqual(result.returncode, 0)
self.assertFalse(self.folder.exists())
class StoreHost(unittest.TestCase):
def test_reviewed_archive_changed_before_install_does_not_download(self):
state = {'managed': True, 'running': True, 'plugins': []}
catalog = [{'id': 42, 'name': 'Example', 'root': False,
'sha256': 'b' * 64, 'version': '2.0'}]
with patch.object(frame_decky_store.frame_decky, 'status', return_value=state), \
patch.object(frame_decky_store, 'catalog', return_value=catalog), \
patch.object(frame_decky_store.urllib.request, 'urlopen',
side_effect=AssertionError('No download expected')):
with self.assertRaisesRegex(ValueError, 'version changed'):
frame_decky_store.change(lambda *args, **kwargs: self.fail('No headset write expected'),
'install', 42, reviewed_hash='a' * 64)
def test_stopped_managed_service_allows_removing_owned_plugin(self):
state = {'managed': True, 'running': False, 'plugins':
[{'storeId': 42, 'folder': 'Example', 'name': 'Example', 'version': '1.0'}]}
calls = []
with patch.object(frame_decky_store.frame_decky, 'status', return_value=state), \
patch.object(frame_decky_store, 'catalog') as network:
result = frame_decky_store.change(lambda command, **kwargs: calls.append(command) or '{}',
'remove', 42)
self.assertEqual(result, {})
self.assertEqual(len(calls), 1)
network.assert_not_called()
def test_renamed_store_plugin_cannot_be_installed_twice(self):
state = {'managed': True, 'running': True, 'plugins':
[{'storeId': 42, 'folder': 'OldFolder', 'name': 'Old Name', 'version': '1.0'}]}
catalog = [{'id': 42, 'name': 'New Name', 'root': False, 'sha256': 'a' * 64, 'version': '2.0'}]
with patch.object(frame_decky_store.frame_decky, 'status', return_value=state), \
patch.object(frame_decky_store, 'catalog', return_value=catalog) as network, \
patch.object(frame_decky_store.urllib.request, 'urlopen', side_effect=AssertionError('No download expected')):
with self.assertRaisesRegex(ValueError, 'already installed'):
frame_decky_store.change(lambda *args, **kwargs: self.fail('No headset write expected'),
'install', 42)
network.assert_not_called()
def test_owned_plugin_can_be_removed_without_store_network(self):
state = {'managed': True, 'running': True, 'plugins':
[{'storeId': 42, 'folder': 'Example', 'name': 'Example', 'version': '1.0'}]}
def ssh(command, **kwargs):
return '{}'
progress = []
with patch.object(frame_decky_store.frame_decky, 'status', return_value=state), \
patch.object(frame_decky_store, 'catalog') as network:
frame_decky_store.change(ssh, 'remove', 42)
frame_decky_store.change(ssh, 'remove', 42, lambda stage, percent: progress.append((stage, percent)))
network.assert_not_called()
self.assertEqual(progress, [('Checking installed plugins', 5), ('Removing plugin on Frame', 80)])
if __name__ == '__main__':
+83
View File
@@ -0,0 +1,83 @@
"""Pinned official Decky bundles remain valid Framey panel inputs."""
import sandbox # noqa: F401
import base64
import hashlib
import json
from pathlib import Path
import re
import shutil
import subprocess
import sys
import tempfile
import unittest
from unittest.mock import patch
import zipfile
import io
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'ui'))
import frame_decky_store
import framey_panel
from framey_official import LEGACY_PLUGINS, PLUGINS, archive
class OfficialBundles(unittest.TestCase):
def test_legacy_css_loader_store_archive_has_unversioned_frontend(self):
plugin = LEGACY_PLUGINS[0]
data = archive(plugin)
self.assertEqual(hashlib.sha256(data).hexdigest(), plugin['sha256'])
self.assertEqual(frame_decky_store.archive_info(data, plugin['sha256'], plugin['name']), plugin['folder'])
with tempfile.TemporaryDirectory() as root, zipfile.ZipFile(io.BytesIO(data)) as bundle:
manifest = json.loads(bundle.read(plugin['folder'] + '/plugin.json'))
self.assertNotIn('api_version', manifest)
frontend = bundle.read(plugin['folder'] + '/dist/index.js')
self.assertIn(b'deckyFrontendLib.definePlugin', frontend)
bundle.extractall(root)
folder = Path(root) / plugin['folder']
(folder / '.frame-control-store.json').write_text(json.dumps({'storeId': plugin['id']}))
with patch.object(framey_panel, 'PLUGINS', Path(root)):
page = framey_panel.panel(plugin['id']).decode()
encoded = re.search(r'<script id="framey-bundle" type="application/json">([^<]+)</script>', page)
self.assertIsNotNone(encoded)
self.assertEqual(base64.b64decode(encoded.group(1)), frontend)
@unittest.skipUnless(shutil.which('node'), 'Node is needed for the official frontend check')
def test_bluetooth_initial_panel_uses_safe_token_fallback(self):
with zipfile.ZipFile(io.BytesIO(archive(next(p for p in PLUGINS if p['id'] == 18)))) as bundle:
with tempfile.TemporaryDirectory() as folder:
frontend = Path(folder) / 'index.js'
frontend.write_bytes(bundle.read('Bluetooth/dist/index.js'))
script = Path(__file__).parent / 'page/framey_bluetooth.mjs'
result = subprocess.run(['node', str(script), str(frontend)],
capture_output=True, text=True, timeout=10)
self.assertEqual(result.returncode, 0, result.stderr)
@unittest.skipUnless(shutil.which('node'), 'Node is needed for the official frontend check')
def test_hltb_frontend_starts_with_framey_module_stub(self):
script = Path(__file__).parent / 'page/framey_hltb.mjs'
result = subprocess.run(['node', str(script)], capture_output=True, text=True, timeout=10)
self.assertEqual(result.returncode, 0, result.stderr)
def test_pinned_store_archives_install_and_pack_into_framey_panel(self):
with tempfile.TemporaryDirectory() as root:
plugins = Path(root)
for plugin in PLUGINS:
with self.subTest(plugin=plugin['name']):
data = archive(plugin)
self.assertEqual(hashlib.sha256(data).hexdigest(), plugin['sha256'])
self.assertEqual(frame_decky_store.archive_info(data, plugin['sha256'], plugin['name']),
plugin['folder'])
with zipfile.ZipFile(io.BytesIO(data)) as z:
manifest = json.loads(z.read(plugin['folder'] + '/plugin.json'))
self.assertEqual(manifest.get('api_version', 'legacy'), plugin['api_version'])
z.extractall(plugins)
folder = plugins / plugin['folder']
(folder / '.frame-control-store.json').write_text(json.dumps({'storeId': plugin['id']}))
with patch.object(framey_panel, 'PLUGINS', plugins):
page = framey_panel.panel(plugin['id']).decode()
encoded = re.search(r'<script id="framey-bundle" type="application/json">([^<]+)</script>', page)
self.assertIsNotNone(encoded)
self.assertEqual(base64.b64decode(encoded.group(1)), (folder / 'dist/index.js').read_bytes())
if __name__ == '__main__':
unittest.main()
+152
View File
@@ -0,0 +1,152 @@
"""Framey hosts store-owned modern Decky frontends and scopes backend calls."""
import sandbox # noqa: F401
import gzip
import http.client
import io
import json
from pathlib import Path
import subprocess
import sys
import tempfile
import tarfile
import threading
import unittest
from unittest.mock import patch
sys.path.insert(0, str(Path(__file__).resolve().parents[1]/'ui'))
import framey_panel
import frame_headset
import server
class Panel(unittest.TestCase):
def test_opaque_origin_plugin_cache_is_scoped_and_bounded(self):
result = subprocess.run(['node', str(Path(__file__).parent/'page/framey_cache.mjs')],
capture_output=True, text=True, timeout=10)
self.assertEqual(result.returncode, 0, result.stderr)
def test_vr_store_browsing_and_search(self):
result = subprocess.run(['node', str(Path(__file__).parent/'page/framey_store.mjs')],
capture_output=True, text=True, timeout=10)
self.assertEqual(result.returncode, 0, result.stderr)
def test_plugin_quick_actions_and_settings(self):
result = subprocess.run(['node', str(Path(__file__).parent/'page/framey_actions.mjs')],
capture_output=True, text=True, timeout=10)
self.assertEqual(result.returncode, 0, result.stderr)
def setUp(self):
tmp = tempfile.TemporaryDirectory()
self.addCleanup(tmp.cleanup)
self.plugins = Path(tmp.name)/'plugins'
self.folder = self.plugins/'protondb-decky'
(self.folder/'dist').mkdir(parents=True)
(self.folder/'.frame-control-store.json').write_text(json.dumps({'storeId':14,'version':'1.3.4'}))
(self.folder/'plugin.json').write_text(json.dumps({'name':'ProtonDB Badges','api_version':2,'flags':[]}))
(self.folder/'dist/index.js').write_text("export default () => ({content: SP_REACT.createElement('p', null, 'OK')});")
home = patch.object(framey_panel, 'PLUGINS', self.plugins)
home.start()
self.addCleanup(home.stop)
def test_owned_api_v2_bundle_is_embedded_without_ui_key(self):
page = framey_panel.panel(14).decode()
self.assertIn('framey-bundle', page)
self.assertIn('/framey-runtime/host.js', page)
self.assertIn('framey-toasts', page)
self.assertNotIn('X-Frame-UI', page)
self.assertNotIn('SP_REACT.createElement', page) # bundled code is base64, not executable HTML.
with self.assertRaises(FileNotFoundError):
framey_panel.panel(15)
def test_legacy_iife_is_admitted_without_api_manifest(self):
(self.folder/'plugin.json').write_text(json.dumps({'name':'Legacy', 'flags':[]}))
(self.folder/'dist/index.js').write_text(
'(function(DFL, React){return DFL.definePlugin(serverAPI=>({content:React.createElement("p",null,"Legacy")}));})(DFL, SP_REACT);')
self.assertIn('framey-bundle', framey_panel.panel(14).decode())
(self.folder/'dist/index.js').write_text('window.unrecognized = true;')
with self.assertRaises(FileNotFoundError):
framey_panel.panel(14)
def test_legacy_keyword_rpc_is_scoped_and_validated(self):
import shlex
def fake_ssh(command, stdin=None, **_):
payload = json.loads(shlex.split(command)[2])
self.assertEqual(payload, {'name':'Legacy', 'method':'read_setting',
'args':[{'key':'mode'}], 'legacy':True})
self.assertIn('loader/call_legacy_plugin_method', stdin)
return json.dumps({'result':{'success':True, 'result':'dark'}})
with patch.object(framey_panel.frame_decky, 'status', return_value={
'plugins':[{'storeId':14,'name':'Legacy'}]}):
self.assertEqual(framey_panel.call_method(fake_ssh, 14, 'read_setting', [{'key':'mode'}], True),
{'result':{'success':True, 'result':'dark'}})
for args, legacy in [([],True), ([[]],True), ([{},{}],True), ([{}],'true')]:
with self.assertRaises(framey_panel.PanelError):
framey_panel.call_method(fake_ssh, 14, 'read_setting', args, legacy)
def test_unsupported_root_symlink_and_unmanaged_are_refused(self):
manifest = self.folder/'plugin.json'
manifest.write_text(json.dumps({'name':'ProtonDB Badges','api_version':0}))
with self.assertRaises(FileNotFoundError): framey_panel.panel(14)
manifest.write_text(json.dumps({'name':'ProtonDB Badges','api_version':1}))
with self.assertRaises(FileNotFoundError): framey_panel.panel(14)
(self.folder/'dist/index.js').write_text(
'// __DECKY_SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_deckyLoaderAPIInit\n'
"export default () => ({content: SP_REACT.createElement('p', null, 'OK')});")
self.assertIn('framey-bundle', framey_panel.panel(14).decode())
manifest.write_text(json.dumps({'name':'ProtonDB Badges','api_version':2,'flags':['root']}))
with self.assertRaises(FileNotFoundError): framey_panel.panel(14)
manifest.write_text(json.dumps({'name':'ProtonDB Badges','api_version':2,'flags':[]}))
dist = self.folder/'dist'
dist.rename(self.folder/'saved-dist')
dist.symlink_to(self.folder/'saved-dist')
with self.assertRaises(FileNotFoundError): framey_panel.panel(14)
dist.unlink()
(self.folder/'.frame-control-store.json').unlink()
with self.assertRaises(FileNotFoundError): framey_panel.panel(14)
def test_backend_method_is_scoped_to_store_receipt(self):
def fake_ssh(command, stdin=None, **_):
self.assertIn('python3 - ', command)
self.assertEqual(stdin, framey_panel.METHOD_SCRIPT)
return json.dumps({'result':{'theme':'dark'}})
with patch.object(framey_panel.frame_decky, 'status', return_value={
'plugins':[{'storeId':14,'name':'ProtonDB Badges'}]}):
self.assertEqual(framey_panel.call_method(fake_ssh,14,'get_setting',['theme','dark']),
{'result':{'theme':'dark'}})
with self.assertRaises(framey_panel.PanelError): framey_panel.call_method(fake_ssh,15,'get_setting',[])
with self.assertRaises(framey_panel.PanelError): framey_panel.call_method(fake_ssh,14,'x;alert(1)',[])
compile(framey_panel.METHOD_SCRIPT, '<remote method>', 'exec')
def test_headset_bundle_contains_runtime_and_licenses(self):
packed = frame_headset.bundle()
self.assertGreater(len(packed), 100_000)
self.assertLess(len(packed), frame_headset.MAX_ARCHIVE)
with tarfile.open(fileobj=io.BytesIO(gzip.decompress(packed))) as archive:
names = set(archive.getnames())
self.assertTrue({'ui/framey_panel.py','ui/framey-host.js',
'ui/vendor/react-18.3.1.min.js','ui/vendor/react-dom-18.3.1.min.js',
'ui/vendor/REACT-LICENSE.txt','ui/vendor/REACT-DOM-LICENSE.txt'} <= names)
def test_http_panel_is_sandboxable_and_missing_plugin_is_404(self):
httpd = server.ThreadingHTTPServer(('127.0.0.1', 0), server.Handler)
thread = threading.Thread(target=httpd.serve_forever, daemon=True)
thread.start()
self.addCleanup(httpd.server_close)
self.addCleanup(httpd.shutdown)
def get(path):
conn = http.client.HTTPConnection('127.0.0.1', httpd.server_port, timeout=5)
try:
conn.request('GET', path)
reply = conn.getresponse()
return reply.status, dict(reply.getheaders()), reply.read()
finally:
conn.close()
status, headers, body = get('/framey/panel/14')
self.assertEqual(status, 200)
self.assertIn('blob:', headers['Content-Security-Policy'])
self.assertIn(b'framey-bundle', body)
self.assertEqual(get('/framey/panel/15')[0], 404)
if __name__ == '__main__':
unittest.main()
+62
View File
@@ -0,0 +1,62 @@
"""The author example stores settings as a normal Decky user plugin."""
import asyncio
import importlib.util
from pathlib import Path
import subprocess
import sys
import tempfile
import types
import unittest
from unittest.mock import patch
EXAMPLE = Path(__file__).resolve().parents[1] / 'examples/framey-settings/main.py'
def backend(settings_dir):
decky = types.ModuleType('decky')
decky.DECKY_PLUGIN_SETTINGS_DIR = settings_dir
spec = importlib.util.spec_from_file_location('framey_sample', EXAMPLE)
module = importlib.util.module_from_spec(spec)
with patch.dict(sys.modules, {'decky': decky}):
spec.loader.exec_module(module)
return module.Plugin()
class SamplePlugin(unittest.TestCase):
def test_frontend_bundle_loads_in_framey_host(self):
result = subprocess.run(['node', str(Path(__file__).parent / 'page/framey_sample.mjs')],
capture_output=True, text=True, timeout=10)
self.assertEqual(result.returncode, 0, result.stderr)
def test_setting_survives_backend_instance_restart(self):
with tempfile.TemporaryDirectory() as folder:
first = backend(folder)
self.assertFalse(asyncio.run(first.get_setting('enabled', False)))
self.assertTrue(asyncio.run(first.set_setting('enabled', True)))
second = backend(folder)
self.assertTrue(asyncio.run(second.get_setting('enabled', False)))
self.assertTrue((Path(folder) / 'settings.json').is_file())
def test_backend_rejects_unknown_keys_and_non_boolean_values(self):
with tempfile.TemporaryDirectory() as folder:
plugin = backend(folder)
with self.assertRaises(ValueError): asyncio.run(plugin.get_setting('other'))
with self.assertRaises(ValueError): asyncio.run(plugin.set_setting('enabled', 'yes'))
self.assertFalse((Path(folder) / 'settings.json').exists())
def test_corrupt_or_old_setting_uses_default_and_can_be_replaced(self):
with tempfile.TemporaryDirectory() as folder:
plugin = backend(folder)
path = Path(folder) / 'settings.json'
for data in ('broken JSON', '[]', '{"enabled": "yes"}'):
with self.subTest(data=data):
path.write_text(data)
self.assertFalse(asyncio.run(plugin.get_setting('enabled', False)))
self.assertTrue(asyncio.run(plugin.get_setting('enabled', True)))
self.assertTrue(asyncio.run(plugin.set_setting('enabled', True)))
self.assertTrue(asyncio.run(backend(folder).get_setting('enabled', False)))
if __name__ == '__main__':
unittest.main()
+74
View File
@@ -0,0 +1,74 @@
"""Safety gates for unattended device work; no headset or OpenVR loaded."""
import importlib.util
import contextlib
import io
import json
from pathlib import Path
import tempfile
import unittest
from unittest.mock import patch
PATH = Path(__file__).resolve().parents[1]/'scripts/framey-vr-check.py'
spec = importlib.util.spec_from_file_location('framey_vr_check', PATH)
check = importlib.util.module_from_spec(spec)
spec.loader.exec_module(check)
class Safety(unittest.TestCase):
def test_foreign_lock_prevents_sensor_reads_and_cleanup(self):
with tempfile.TemporaryDirectory() as folder, patch.object(check, 'Remote') as factory:
remote = factory.return_value
remote.side_effect = RuntimeError('File exists')
with contextlib.redirect_stdout(io.StringIO()):
self.assertEqual(check.main(['--exercise','--output',folder]), 1)
remote.python.assert_not_called()
self.assertEqual(remote.call_count, 1)
self.assertIn('mkdir /tmp/frame-test.lock', remote.call_args.args[0])
self.assertFalse(json.loads((Path(folder)/'result.json').read_text())['passed'])
def test_low_battery_never_wakes_or_installs_and_releases_lock(self):
state = {'battery':[19], 'pause':'power.pauseCompositorOnStandby=true',
'timeout':'power.turnOffScreensTimeout=17.000000','dashboardVisible':False}
with tempfile.TemporaryDirectory() as folder, patch.object(check, 'Remote') as factory, \
patch.object(check.frame_decky, 'change') as install:
remote = factory.return_value
remote.python.return_value = state
with contextlib.redirect_stdout(io.StringIO()):
self.assertEqual(check.main(['--exercise','--output',folder]), 1)
install.assert_not_called()
self.assertEqual(remote.call_count, 2)
self.assertIn('rmdir /tmp/frame-test.lock', remote.call_args.args[0])
self.assertFalse(any('--handlewakeup' in c.args[0] for c in remote.call_args_list))
def test_power_restore_after_partial_setter_failure(self):
state = {'battery':[99], 'pause':'power.pauseCompositorOnStandby=true',
'timeout':'power.turnOffScreensTimeout=17.000000','dashboardVisible':False}
with tempfile.TemporaryDirectory() as folder, patch.object(check, 'Remote') as factory:
remote = factory.return_value
remote.python.return_value = state
def run(cmd, **_):
if '--set-settings-float power.turnOffScreensTimeout 120' in cmd:
raise RuntimeError('setter failed')
return ''
remote.side_effect = run
with contextlib.redirect_stdout(io.StringIO()):
self.assertEqual(check.main(['--wake','--output',folder]), 1)
commands = [c.args[0] for c in remote.call_args_list]
self.assertTrue(any('--set-settings-bool power.pauseCompositorOnStandby 1' in c for c in commands))
self.assertTrue(any('--set-settings-float power.turnOffScreensTimeout 17.000000' in c for c in commands))
self.assertIn('rmdir /tmp/frame-test.lock', commands[-1])
def test_exact_linux_event_abi_and_debug_profile(self):
import ctypes
overlay_spec = importlib.util.spec_from_file_location('framey_openvr', PATH.with_name('framey_openvr.py'))
overlay = importlib.util.module_from_spec(overlay_spec); overlay_spec.loader.exec_module(overlay)
self.assertEqual(ctypes.sizeof(overlay.Event), 60)
self.assertEqual(overlay.Event.data.offset, 12)
original = check.frame_headset.bundle()
patched = check.debug_bundle(original, '/tmp/owned-profile')
import tarfile
with tarfile.open(fileobj=io.BytesIO(patched),mode='r:gz') as archive:
source=archive.extractfile('ui/frame_headset_runtime.py').read().decode()
self.assertIn("'--remote-debugging-port=0'", source)
self.assertIn("'/tmp/owned-profile'", source)
self.assertNotIn("str(BASE / 'profile')", source)
+63
View File
@@ -0,0 +1,63 @@
"""The real-device check must abort before touching a standby or busy Frame."""
import sandbox # noqa: F401
import contextlib
import importlib.util
import io
from pathlib import Path
import unittest
from unittest.mock import patch
MODULE = Path(__file__).resolve().parents[1]/'scripts/framey-worn-check.py'
spec = importlib.util.spec_from_file_location('framey_worn_check', MODULE)
worn = importlib.util.module_from_spec(spec)
spec.loader.exec_module(worn)
class WornGate(unittest.TestCase):
def run_gate(self, state, remote_side_effect=None):
out = io.StringIO()
with patch.object(worn, 'probe', return_value=state) as probe, \
patch.object(worn, 'remote', side_effect=remote_side_effect) as remote, \
contextlib.redirect_stdout(out):
result = worn.main(worn_confirmed=True)
return result, out.getvalue(), remote, probe
def test_no_wearer_confirmation_means_no_sensor_or_input_claim(self):
with patch.object(worn,'remote') as remote, contextlib.redirect_stdout(io.StringIO()) as out:
self.assertEqual(worn.main(),1)
remote.assert_not_called()
self.assertIn('trusted pointer events alone do not prove',out.getvalue())
def test_standby_is_read_only_under_owned_lock_and_releases_it(self):
state = {'battery':[{'percent':99}], 'activity':3, 'panelService':True,
'plugins':[{'id':14,'name':'ProtonDB Badges'}], 'panel':None}
code, report, remote, probe = self.run_gate(state)
self.assertEqual(code, 1)
self.assertIn('standby', report)
probe.assert_called_once()
self.assertEqual(remote.call_count, 2)
self.assertIn('mkdir /tmp/frame-test.lock', remote.call_args_list[0].args[0])
self.assertIn('rmdir /tmp/frame-test.lock', remote.call_args_list[1].args[0])
def test_low_battery_releases_owned_lock(self):
state = {'battery':[{'percent':19}], 'activity':0, 'panelService':True,
'plugins':[{'id':14,'name':'ProtonDB Badges'}], 'panel':None}
code, report, remote, probe = self.run_gate(state)
self.assertEqual(code, 1)
self.assertIn('below 20%', report)
probe.assert_called_once()
self.assertEqual(remote.call_count, 2)
def test_foreign_lock_prevents_all_sensor_reads_and_is_never_removed(self):
state = {'battery':[{'percent':99}], 'activity':0, 'panelService':True,
'plugins':[{'id':14,'name':'ProtonDB Badges'}], 'panel':None}
code, report, remote, probe = self.run_gate(state, RuntimeError('File exists'))
self.assertEqual(code, 1)
self.assertIn('File exists', report)
probe.assert_not_called()
self.assertEqual(remote.call_count, 1)
self.assertIn('mkdir /tmp/frame-test.lock', remote.call_args.args[0])
def test_screenshot_palette_counts_distinct_colors(self):
self.assertEqual(worn.color_count('0 #ff00aa 1 #ff00aa 2 #00ff00'), 2)
+68 -1
View File
@@ -68,6 +68,9 @@ class ObsSourceTests(unittest.TestCase):
def terminate(self):
self.stopped.set()
def wait(self, timeout=None):
return 255
for ready in (False, True):
with self.subTest(ready=ready):
child = Child()
@@ -80,7 +83,71 @@ class ObsSourceTests(unittest.TestCase):
finally:
watchdog.close()
@unittest.skipIf(sys.platform == 'win32', 'the packaged Start/Stop control is Linux/macOS only')
def test_shutdown_kills_an_unresponsive_ssh_child(self):
proc = mock.Mock()
proc.poll.return_value = None
proc.wait.side_effect = [subprocess.TimeoutExpired('ssh', 5), 137]
obs.stop_child(proc)
proc.terminate.assert_called_once()
proc.kill.assert_called_once()
self.assertEqual(proc.wait.call_count, 2)
def test_windows_sender_ignores_absent_receiver_and_hides_ssh_console(self):
proc = mock.Mock()
proc.stdout = io.BytesIO(bytes(range(188)) * 7)
proc.poll.return_value = proc.wait.return_value = 0
# These are the actual Python Winsock control and subprocess constants.
with mock.patch.object(obs.sys, 'platform', 'win32'), \
mock.patch.object(obs.subprocess, 'CREATE_NO_WINDOW', 0x08000000, create=True), \
mock.patch.object(obs.socket, 'socket') as socket_factory, \
mock.patch.object(obs.subprocess, 'Popen', return_value=proc) as popen:
self.assertEqual(obs.main(['--frame', 'test-frame']), 0)
udp = socket_factory.return_value.__enter__.return_value
self.assertEqual(popen.call_args.kwargs['creationflags'], 0x08000000)
udp.sendto.assert_called_once()
def test_windows_recovers_from_an_unreachable_udp_receiver(self):
udp = mock.Mock()
udp.sendto.side_effect = [ConnectionResetError(10054, 'receiver closed'), 188]
sender = obs._Sender(udp, ('127.0.0.1', 15099))
with mock.patch.object(obs.sys, 'platform', 'win32'):
sender.send(b'G' * 188)
self.assertFalse(sender.ready)
sender.send(b'G' * 188)
self.assertTrue(sender.ready)
self.assertEqual(udp.sendto.call_count, 2)
@unittest.skipIf(sys.platform == 'win32', 'the fake SSH executable uses a POSIX shebang')
def test_stall_exits_cleanly_even_while_app_control_pipe_stays_open(self):
with tempfile.TemporaryDirectory() as folder:
directory = Path(folder)
fake = directory / 'ssh'
fake.write_text("#!/usr/bin/env python3\n"
"import signal,sys,time\n"
"signal.signal(signal.SIGTERM, signal.SIG_IGN)\n"
"sys.stdout.buffer.write(b'G'*1316);sys.stdout.buffer.flush()\n"
"while True: time.sleep(1)\n")
fake.chmod(0o755)
wrapper = ("import importlib.util; "
f"s=importlib.util.spec_from_file_location('obs', {str(SCRIPT)!r}); "
"o=importlib.util.module_from_spec(s);s.loader.exec_module(o); "
"o.STARTUP_TIMEOUT=o.STREAM_STALL=o.CHILD_STOP_TIMEOUT=0.15; "
"o.main(['--frame','fake-frame','--control-stdin'])")
env = {**os.environ, 'PATH': str(directory) + os.pathsep + os.environ.get('PATH', '')}
process = subprocess.Popen([sys.executable, '-c', wrapper], stdin=subprocess.PIPE,
stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, env=env)
try:
# Keep stdin OPEN: real Electron does this until the helper exits.
self.assertEqual(process.wait(timeout=4), 1)
error = process.stderr.read().decode(errors='replace')
self.assertIn('video stopped', error)
self.assertNotIn('Fatal Python error', error)
finally:
if process.poll() is None:
process.kill(); process.wait(timeout=5)
process.stdin.close(); process.stderr.close()
@unittest.skipIf(sys.platform == 'win32', 'the fake SSH executable uses a POSIX shebang')
def test_relay_stops_its_ssh_child_on_app_signal_or_control_pipe(self):
for mode in ('signal', 'control-pipe'):
with self.subTest(mode=mode):
+10 -1
View File
@@ -63,7 +63,7 @@ print(json.dumps({'arch':platform.machine(), 'frameOS':os_release.get('VERSION_I
APPLY = r'''
import hashlib, json, os, pathlib, subprocess, sys
import fcntl, hashlib, json, os, pathlib, subprocess, sys
action, token, digest, version = sys.argv[1:]
home = pathlib.Path.home()
base = home / '.local/share/frame-control/decky'
@@ -72,6 +72,7 @@ binary = base / 'PluginLoader'
receipt = base / '.frame-control/receipt.json'
legacy = base / 'settings/release.json'
stage = pathlib.Path('/tmp/frame-control-decky-' + token)
transaction_lock = None
def systemd(*args):
p = subprocess.run(['systemctl','--user',*args], capture_output=True, text=True, timeout=20)
if p.returncode: raise RuntimeError((p.stderr or p.stdout).strip() or 'systemd failed')
@@ -79,6 +80,13 @@ def owned():
try: return json.loads((receipt if receipt.exists() else legacy).read_text()).get('managedBy') == 'Frame Control' and service.is_file()
except (OSError, ValueError): return False
try:
# The desktop and headset servers are separate processes. Lock the shared
# user-service transaction on the Frame before inspecting or changing it.
base.parent.mkdir(parents=True, exist_ok=True)
lock_path = base.parent / 'decky-transaction.lock'
transaction_lock = os.fdopen(os.open(lock_path, os.O_CREAT | os.O_RDWR | os.O_NOFOLLOW, 0o600), 'r+b')
try: fcntl.flock(transaction_lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
except BlockingIOError: raise RuntimeError('Another Decky change is in progress; try again after it finishes')
if action == 'remove':
if not owned(): raise RuntimeError('No Frame Control managed Decky install to remove')
systemd('disable','--now','frame-control-decky.service')
@@ -141,6 +149,7 @@ try:
print(json.dumps({'message':'Decky Loader '+version+' is running as a user service. The VR menu is experimental.'}))
finally:
stage.unlink(missing_ok=True)
if transaction_lock is not None: transaction_lock.close()
'''
+78 -21
View File
@@ -6,6 +6,7 @@ digest validates transport, not plugin trust; store plugins run as the user.
import hashlib
import io
import json
import os
import re
import secrets
import urllib.request
@@ -24,8 +25,16 @@ SHA = re.compile(r'[0-9a-f]{64}\Z')
VERSION = re.compile(r'[A-Za-z0-9][A-Za-z0-9._+\-]{0,39}\Z')
def _urls():
# Deterministic fixture URLs exist only inside the disposable fake Frame host.
if os.environ.get('FRAME_E2E_CONTAINER') == '1':
return (os.environ.get('FRAMEY_STORE_URL', STORE_URL),
os.environ.get('FRAMEY_CDN_URL', CDN))
return STORE_URL, CDN
def catalog():
request = urllib.request.Request(STORE_URL, headers={'User-Agent': 'Frame-Control'})
request = urllib.request.Request(_urls()[0], headers={'User-Agent': 'Frame-Control'})
with urllib.request.urlopen(request, timeout=15) as response:
raw = response.read(MAX_STORE + 1)
if len(raw) > MAX_STORE:
@@ -45,11 +54,18 @@ def catalog():
if not latest:
continue
tags = item.get('tags') if isinstance(item.get('tags'), list) else []
author = item.get('author') if isinstance(item.get('author'), str) else ''
result.append({'id': item['id'], 'name': item['name'][:100],
'description': str(item.get('description') or '')[:300],
'author': author[:100],
'version': latest['name'][:40], 'sha256': latest['hash'],
'root': 'root' in tags})
return result
'root': 'root' in tags or '_root' in tags})
# A repeated store ID makes a clicked row ambiguous: change() resolves by ID
# and could install a different archive than the one the user reviewed.
counts = {}
for item in result:
counts[item['id']] = counts.get(item['id'], 0) + 1
return [item for item in result if counts[item['id']] == 1]
def archive_info(data, expected_hash, expected_name):
@@ -66,13 +82,20 @@ def archive_info(data, expected_hash, expected_name):
folder = manifests[0].split('/')[0]
if not SAFE_FOLDER.fullmatch(folder):
raise ValueError('Invalid plugin folder')
seen = set()
for entry in files:
name = entry.filename
mode = entry.external_attr >> 16
if ('\\' in name or name.startswith('/') or '..' in name.split('/') or
name.split('/')[0] != folder or entry.file_size > 30 * 1024 * 1024 or
mode & 0o170000 == 0o120000):
kind = mode & 0o170000
parts = name.split('/')
if entry.is_dir() and parts[-1] == '':
parts = parts[:-1]
if ('\\' in name or name.startswith('/') or
any(part in ('', '.', '..') for part in parts) or name in seen or
parts[0] != folder or entry.file_size > 30 * 1024 * 1024 or
kind not in (0, 0o040000, 0o100000)):
raise ValueError('Unsafe plugin archive member')
seen.add(name)
if entry.is_dir():
continue
with archive.open(entry) as source:
@@ -82,6 +105,8 @@ def archive_info(data, expected_hash, expected_name):
if header[:2] == b'MZ':
raise ValueError('Plugin contains a Windows binary: ' + name)
manifest = json.loads(archive.read(manifests[0]))
if not isinstance(manifest, dict):
raise ValueError('Invalid plugin manifest')
if manifest.get('name') != expected_name:
raise ValueError('Plugin name differs from the official store')
flags = manifest.get('flags', [])
@@ -93,7 +118,7 @@ def archive_info(data, expected_hash, expected_name):
APPLY = r'''
import hashlib,json,pathlib,shutil,subprocess,sys,zipfile
import fcntl,hashlib,json,os,pathlib,shutil,subprocess,sys,zipfile
action,token,plugin_id,digest,folder,version = sys.argv[1:]
base=pathlib.Path.home()/'.local/share/frame-control/decky/plugins'
unit=pathlib.Path.home()/'.config/systemd/user/frame-control-decky.service'
@@ -102,6 +127,7 @@ archive=pathlib.Path('/tmp/frame-control-decky-plugin-'+token)
stage=base/('.frame-control-stage-'+token)
backup=base/('.frame-control-old-'+token)
marker='.frame-control-store.json'
transaction_lock=None
def owned():
if target.is_symlink() or not target.is_dir(): return False
try: return json.loads((target/marker).read_text()).get('storeId') == int(plugin_id)
@@ -109,12 +135,19 @@ def owned():
def service(*args):
p=subprocess.run(['systemctl','--user',*args],capture_output=True,text=True,timeout=25)
if p.returncode: raise RuntimeError((p.stderr or p.stdout).strip()[-400:] or 'Decky service failed')
if not unit.is_file(): raise RuntimeError('Install Frame Control managed Decky first')
if action not in ('install','update','remove'): raise RuntimeError('Invalid plugin action')
if action=='install' and (target.exists() or target.is_symlink()): raise RuntimeError('Plugin folder already exists')
if action in ('update','remove') and not owned(): raise RuntimeError('Only a Frame Control store plugin can be changed')
running=subprocess.run(['systemctl','--user','is-active','--quiet','frame-control-decky.service']).returncode==0
try:
# A desktop request and a headset-panel request must not change the same
# Decky user service at once. Keep this lock until rollback/cleanup ends.
base.parent.parent.mkdir(parents=True,exist_ok=True)
lock_path=base.parent.parent/'decky-transaction.lock'
transaction_lock=os.fdopen(os.open(lock_path,os.O_CREAT|os.O_RDWR|os.O_NOFOLLOW,0o600),'r+b')
try: fcntl.flock(transaction_lock,fcntl.LOCK_EX|fcntl.LOCK_NB)
except BlockingIOError: raise RuntimeError('Another Decky change is in progress; try again after it finishes')
if not unit.is_file(): raise RuntimeError('Install Frame Control managed Decky first')
if action not in ('install','update','remove'): raise RuntimeError('Invalid plugin action')
if action=='install' and (target.exists() or target.is_symlink()): raise RuntimeError('Plugin folder already exists')
if action in ('update','remove') and not owned(): raise RuntimeError('Only a Frame Control store plugin can be changed')
running=subprocess.run(['systemctl','--user','is-active','--quiet','frame-control-decky.service']).returncode==0
if action!='remove':
data=archive.read_bytes()
if not 1024<len(data)<=50*1024*1024 or hashlib.sha256(data).hexdigest()!=digest:
@@ -123,16 +156,24 @@ try:
files=z.infolist()
if not files or len(files)>3000 or sum(f.file_size for f in files)>150*1024*1024:
raise RuntimeError('Plugin archive too large')
if any(f.filename.split('/')[0]!=folder or f.filename.startswith('/') or
'..' in f.filename.split('/') or '\\' in f.filename or
f.file_size>30*1024*1024 or f.external_attr>>16&0o170000==0o120000 for f in files):
raise RuntimeError('Unsafe plugin archive')
seen=set()
for f in files:
parts=f.filename.split('/')
if f.is_dir() and parts[-1]=='': parts=parts[:-1]
kind=f.external_attr>>16&0o170000
if (not parts or parts[0]!=folder or f.filename.startswith('/') or
any(part in ('','.','..') for part in parts) or '\\' in f.filename or
f.filename in seen or f.file_size>30*1024*1024 or
kind not in (0,0o040000,0o100000)):
raise RuntimeError('Unsafe plugin archive')
seen.add(f.filename)
stage.mkdir(mode=0o700)
z.extractall(stage)
unpacked=stage/folder
if not unpacked.is_dir(): raise RuntimeError('Missing plugin folder')
(unpacked/marker).write_text(json.dumps({'storeId':int(plugin_id),'sha256':digest,'version':version})+'\n')
if running: service('stop','frame-control-decky.service')
# Stop even a failed unit before removal to cancel any pending auto-restart.
if running or action=='remove': service('stop','frame-control-decky.service')
try:
if action!='install': target.rename(backup)
if action!='remove': (stage/folder).rename(target)
@@ -148,25 +189,37 @@ try:
finally:
archive.unlink(missing_ok=True)
if stage.exists(): shutil.rmtree(stage)
if transaction_lock is not None: transaction_lock.close()
'''
def change(ssh, action, plugin_id):
def change(ssh, action, plugin_id, report=lambda stage, percent=None: None, reviewed_hash=None):
if action not in ('install', 'update', 'remove') or type(plugin_id) is not int or plugin_id <= 0:
raise ValueError('Choose a valid store plugin action')
if reviewed_hash is not None and (action == 'remove' or not isinstance(reviewed_hash, str)
or not SHA.fullmatch(reviewed_hash)):
raise ValueError('Invalid reviewed store version')
report('Checking installed plugins', 5)
state = frame_decky.status(ssh)
if not state['managed'] or not state['running']:
raise ValueError('Start Frame Control managed Decky before changing plugins')
if not state['managed']:
raise ValueError('Install Frame Control managed Decky before changing plugins')
if action != 'remove' and not state['running']:
raise ValueError('Start Frame Control managed Decky before installing or updating plugins')
installed = [p for p in state['plugins'] if p.get('storeId') == plugin_id]
if action == 'install' and installed:
raise ValueError('This store plugin is already installed; use Update or Remove')
if action == 'remove':
if len(installed) != 1:
raise ValueError('Only an installed Frame Control store plugin can be removed')
folder = installed[0]['folder']
plugin = {'sha256': '0' * 64, 'version': 'removed'}
else:
report('Reading official store', 15)
plugin = next((item for item in catalog() if item['id'] == plugin_id), None)
if not plugin:
raise ValueError('Plugin is not in the official Decky store')
if reviewed_hash is not None and plugin['sha256'] != reviewed_hash:
raise ValueError('The official store version changed; refresh the store and review it again')
if plugin['root']:
raise ValueError('Root plugins are not supported by the Frame user service')
existing_name = [p for p in state['plugins'] if p.get('name') == plugin['name']]
@@ -176,9 +229,11 @@ def change(ssh, action, plugin_id):
raise ValueError('Only an installed Frame Control store plugin can be updated')
data = None
if action != 'remove':
url = CDN + plugin['sha256'] + '.zip'
report('Downloading plugin archive', 30)
url = _urls()[1] + plugin['sha256'] + '.zip'
with urllib.request.urlopen(urllib.request.Request(url, headers={'User-Agent': 'Frame-Control'}), timeout=35) as response:
data = response.read(MAX_ZIP + 1)
report('Verifying plugin archive', 50)
folder = archive_info(data, plugin['sha256'], plugin['name'])
if action == 'update' and installed[0]['folder'] != folder:
raise ValueError('The store changed its plugin folder; remove the old version before installing')
@@ -188,7 +243,9 @@ def change(ssh, action, plugin_id):
remote = '/tmp/frame-control-decky-plugin-' + token
try:
if data is not None:
report('Sending archive to Frame', 65)
ssh('umask 077; cat > ' + remote, stdin=data, text=False, timeout=120)
report({'install':'Installing', 'update':'Updating', 'remove':'Removing'}[action] + ' plugin on Frame', 80)
return json.loads(ssh(f'python3 - {action} {token} {plugin_id} {plugin["sha256"]} {folder} {plugin["version"]}',
stdin=APPLY, timeout=90))
finally:
+413
View File
@@ -0,0 +1,413 @@
/* Framey panel compatibility layer. The iframe has an opaque origin and no UI key. */
(() => {
'use strict';
const R = window.SP_REACT = window.React;
window.SP_REACTDOM = window.ReactDOM;
const jsx = (type, props, key) => {
const {children, ...elementProps} = props || {};
if (key !== undefined) elementProps.key = key;
return Object.prototype.hasOwnProperty.call(props || {}, 'children')
? R.createElement(type, elementProps, children)
: R.createElement(type, elementProps);
};
window.SP_JSX = {jsx, jsxs:jsx, Fragment:R.Fragment};
// Steam normally fills these token maps. Official plugins can safely use
// their own fallback strings when the isolated panel has no Steam tokens.
window.LocalizationManager = {m_rgLocalesToUse:[navigator.language || 'en'],
m_mapTokens:new Map(), m_mapFallbackTokens:new Map([
['Settings_Bluetooth_Connected','Connected'],
['Settings_Bluetooth_NotConnected','Not connected'],
['Settings_Bluetooth_Devices','Devices'],
])};
const root = document.getElementById('framey-root');
const error = document.getElementById('framey-error');
const toastRoot = document.getElementById('framey-toasts');
const pending = new Map();
const routes = new Map();
const routeListeners = new Set();
let currentRoute = null;
let currentParams = {};
let nextId = 0;
let plugin;
// A sandboxed iframe has an opaque origin, so its native localStorage getter
// throws SecurityError. Keep the familiar synchronous API inside the iframe;
// the parent stores only this plugin's bounded snapshot under its own origin.
const cache = new Map();
const cacheLimit = 128 * 1024;
const cacheSession = window.location?.hash.slice(1) || '';
let acceptSeed;
const seeded = new Promise(resolve => {acceptSeed = resolve;});
const storage = {
get length() {return cache.size;},
key(index) {return [...cache.keys()][index] ?? null;},
getItem(key) {return cache.get(String(key)) ?? null;},
setItem(key, value) {
const name = String(key), data = String(value);
const next = new Map(cache); next.set(name, data);
if (next.size > 64 || name.length > 256 || data.length > 65536 ||
JSON.stringify(Object.fromEntries(next)).length > cacheLimit)
throw new DOMException('Framey plugin cache is full', 'QuotaExceededError');
cache.set(name, data); persistCache();
},
removeItem(key) {cache.delete(String(key)); persistCache();},
clear() {cache.clear(); persistCache();},
};
function persistCache() {
parent.postMessage({type:'framey:cache:save', session:cacheSession,
entries:Object.fromEntries(cache)}, '*');
}
Object.defineProperty(window, 'localStorage', {configurable:true, value:storage});
// localForage otherwise chooses the browser's exposed-but-denied IndexedDB
// driver in an opaque iframe. Let it detect the bounded localStorage driver.
Object.defineProperty(window, 'indexedDB', {configurable:true, value:undefined});
parent.postMessage({type:'framey:cache:init', session:cacheSession}, '*');
setTimeout(() => {acceptSeed?.(); acceptSeed = null;}, 1000); // Open if storage is unavailable.
function ask(method, args, legacy=false) {
if (!/^[A-Za-z][A-Za-z0-9_]{0,63}$/.test(method)) return Promise.reject(Error('Invalid backend method'));
const id = ++nextId;
return new Promise((resolve, reject) => {
const timer = setTimeout(() => { pending.delete(id); reject(Error('Decky backend timed out')); }, 30000);
pending.set(id, {resolve, reject, timer});
parent.postMessage({type:'framey:call', id, method, args, legacy}, '*');
});
}
addEventListener('message', event => {
if (event.source === parent && event.data?.type === 'framey:cache:seed' &&
event.data.session === cacheSession && acceptSeed) {
const entries = event.data.entries;
if (entries && typeof entries === 'object' && !Array.isArray(entries)) {
for (const [key, value] of Object.entries(entries))
if (key.length <= 256 && typeof value === 'string' && value.length <= 65536)
cache.set(key, value);
}
acceptSeed(); acceptSeed = null;
return;
}
if (event.source !== parent || !event.data || event.data.type !== 'framey:reply') return;
const item = pending.get(event.data.id);
if (!item) return;
pending.delete(event.data.id); clearTimeout(item.timer);
if (event.data.error) item.reject(Error(event.data.error)); else item.resolve(event.data.result);
});
addEventListener('unload', () => { try { plugin?.onDismount?.(); } catch (_) {} });
addEventListener('pointerup', event => {
if (event.isTrusted) parent.postMessage({type:'framey:input'}, '*');
}, {passive:true});
const passthrough = tag => ({children, ...props}) => R.createElement(tag, props, children);
const Field = ({label, description, children}) => R.createElement('label', null,
R.createElement('strong', null, label), description && R.createElement('small', null, description), children);
const ToggleField = ({label, description, checked, disabled, onChange}) => R.createElement(Field, {label, description},
R.createElement('input', {type:'checkbox', checked:!!checked, disabled:!!disabled,
onChange:e=>{if(!disabled)onChange?.(e.target.checked);}}));
const DropdownItem = ({label, description, rgOptions=[], selectedOption, disabled, strDefaultLabel, onChange}) => {
const choices=[];
const option = entry => {
const index=choices.push(entry)-1;
return R.createElement('option', {key:index, value:String(index)}, entry.label);
};
const entries=(Array.isArray(rgOptions) ? rgOptions : []).map(entry =>
Array.isArray(entry.options) ? R.createElement('optgroup', {key:String(entry.label), label:String(entry.label)},
entry.options.map(option)) : option(entry));
const selected=choices.findIndex(entry=>Object.is(entry.data, selectedOption));
return R.createElement(Field, {label, description}, R.createElement('select', {
value:selected < 0 ? '' : String(selected), disabled:!!disabled,
onChange:e=>{const entry=choices[Number(e.target.value)];if(!disabled && entry)onChange?.(entry);}},
selected < 0 && R.createElement('option', {value:'', disabled:true}, strDefaultLabel || 'Choose an option'),
entries));
};
const ButtonItem = ({label, description, children, disabled, onClick}) => R.createElement(Field, {label, description},
R.createElement('button', {type:'button', disabled:!!disabled,
onClick:e=>{if(!disabled)onClick?.(e);}}, children || label));
const DialogCheckbox = ({label, checked, defaultChecked, disabled, onChange}) =>
R.createElement('label', null,
R.createElement('input', {type:'checkbox', checked, defaultChecked, disabled:!!disabled,
onChange:e=>{if(!disabled)onChange?.(e.target.checked);}}), label);
const TextField = ({label, description, value, placeholder, disabled, bIsPassword,
mustBeNumeric, mustBeURL, mustBeEmail, onChange}) => R.createElement(Field, {label, description},
R.createElement('input', {type:bIsPassword?'password':mustBeNumeric?'number':mustBeURL?'url':mustBeEmail?'email':'text',
value, placeholder, disabled:!!disabled, onChange:e=>{if(!disabled)onChange?.(e);}}));
const SliderField = ({label, description, value, min=0, max=100, step=1, disabled, showValue,
valueSuffix='', onChange}) => R.createElement(Field, {label, description},
R.createElement('input', {type:'range', value, min, max, step, disabled:!!disabled,
'aria-label':typeof label==='string'?label:undefined,
onChange:e=>{if(!disabled)onChange?.(Number(e.target.value));}}),
showValue && R.createElement('span', null, String(value) + valueSuffix));
const PanelSection = ({title, children}) => R.createElement('section', null,
title && R.createElement('h2', null, title), children);
const Spinner = ({children}) => R.createElement('p', {role:'status'}, children || 'Loading…');
const Tabs = ({tabs=[], activeTab, onShowTab}) => {
const [selected, setSelected] = R.useState(tabs[0]?.id);
const current = tabs.find(tab=>tab.id === (activeTab ?? selected)) || tabs[0];
return R.createElement('div', null,
R.createElement('div', {role:'tablist'}, ...tabs.map(tab=>R.createElement('button', {
type:'button', key:tab.id, role:'tab', 'aria-selected':tab===current,
disabled:!!tab.disabled, onClick:()=>{if(!tab.disabled){setSelected(tab.id);onShowTab?.(tab.id);}}}, tab.title))),
R.createElement('div', {role:'tabpanel'}, current?.content));
};
const SidebarNavigation = ({pages=[], title}) => R.createElement('section', null,
title && R.createElement('h2', null, title), R.createElement(Tabs, {
tabs:pages.filter(page=>page.visible!==false).map((page,index)=>({
id:page.route || String(index), title:page.title, content:page.content}))}));
const ProgressBar = ({nProgress=0, value, max=100}) => R.createElement('progress', {
value:Math.max(0,Math.min(max,Number(value ?? nProgress)||0)), max});
const MenuItem = ({children, disabled, bDisabled, onClick, onSelected}) =>
R.createElement('button', {type:'button',disabled:!!(disabled || bDisabled),
onClick:event=>{if(!disabled && !bDisabled)(onClick || onSelected)?.(event);}}, children);
const ConfirmModal = ({strTitle, strOKButtonText, onOK, children}) => R.createElement('section', null,
R.createElement('h2', null, strTitle), children,
R.createElement('button', {type:'button', onClick:()=>{onOK?.(); closeModal();}}, strOKButtonText || 'Close'));
const modalRoot = window.ReactDOM.createRoot(document.getElementById('framey-modal'));
const closeModal = () => modalRoot.render(null);
const localPath = path => typeof path === 'string' && path.length <= 120 &&
/^\/[A-Za-z0-9/_-]+$/.test(path) && !path.includes('//');
const routePattern = path => typeof path === 'string' && path.length <= 120 &&
/^\/(?:[A-Za-z0-9_-]+|:[A-Za-z][A-Za-z0-9_]*\??)(?:\/(?:[A-Za-z0-9_-]+|:[A-Za-z][A-Za-z0-9_]*\??))*$/.test(path) &&
!/\?\//.test(path) &&
new Set([...path.matchAll(/:([A-Za-z][A-Za-z0-9_]*)\??/g)].map(match => match[1])).size ===
[...path.matchAll(/:([A-Za-z][A-Za-z0-9_]*)\??/g)].length;
function matchRoute(pattern, path) {
const expected = pattern.slice(1).split('/');
const actual = path.slice(1).split('/');
if (actual.length > expected.length) return null;
const params = {};
for (let index = 0; index < expected.length; index++) {
const segment = expected[index], value = actual[index];
if (segment[0] === ':') {
const optional = segment.endsWith('?'), name = segment.slice(1, optional ? -1 : undefined);
if (value === undefined) { if (!optional) return null; }
else params[name] = value;
} else if (segment !== value) return null;
}
return params;
}
function activeRoute(path) {
if (routes.has(path)) return {component:routes.get(path), params:{}};
for (const [pattern, component] of routes) {
const params = matchRoute(pattern, path);
if (params) return {component, params};
}
return null;
}
function navigate(path) {
if (path !== null && !localPath(path)) return false;
const match = path === null ? null : activeRoute(path);
if (path !== null && !match) return false;
currentRoute = path;
currentParams = match?.params || {};
for (const listener of routeListeners) listener(path);
return true;
}
const routerHook = {
addRoute(path, component) {
if (!routePattern(path) ||
(typeof component !== 'function' && !R.isValidElement(component)))
throw Error('Framey route needs a local path and React component');
routes.set(path, component);
return () => routerHook.removeRoute(path);
},
removeRoute(path) {routes.delete(path); if(currentRoute && !activeRoute(currentRoute)) navigate(null);},
// Steam routes and global components have no equivalent in the isolated panel.
addPatch:()=>()=>{}, removePatch:()=>{}, addGlobalComponent:()=>{}, removeGlobalComponent:()=>{},
};
const noPatch = () => {const undo=()=>{};undo.unpatch=undo;return undo;};
const showModal = element => {
modalRoot.render(R.createElement('section', null,
R.createElement('button', {type:'button',onClick:closeModal}, 'Close'), element));
return {Close:closeModal};
};
const DFL = window.DFL = {
definePlugin: init => init,
PanelSection, PanelSectionRow: passthrough('div'), Field, ToggleField, DropdownItem,
Dropdown: DropdownItem, ButtonItem, DialogCheckbox, TextField, SliderField,
Focusable: passthrough('div'), ScrollPanel: passthrough('div'), ScrollPanelGroup: passthrough('div'),
DialogButton: passthrough('button'), DialogButtonPrimary: passthrough('button'), ConfirmModal,
DialogButtonSecondary: passthrough('button'), Button: ButtonItem, GamepadButton: passthrough('button'),
Toggle: ToggleField, Spinner, SteamSpinner:Spinner, Tabs, SidebarNavigation,
Marquee:passthrough('span'), DialogBody:passthrough('div'), DialogBodyText:passthrough('p'),
DialogHeader:passthrough('h2'), DialogSubHeader:passthrough('h3'), DialogFooter:passthrough('footer'),
DialogLabel:passthrough('label'), DialogControlsSection:passthrough('section'),
DialogControlsSectionHeader:passthrough('h3'), ModalRoot:passthrough('section'),
Menu:passthrough('div'), MenuGroup:passthrough('section'), MenuItem,
ProgressBar, ProgressBarWithInfo:ProgressBar,
gamepadDialogClasses:{}, quickAccessMenuClasses:{}, gamepadTabbedPageClasses:{},
gamepadSliderClasses:{}, gamepadContextMenuClasses:{}, scrollPanelClasses:{},
quickAccessControlsClasses:{}, mainMenuAppRunningClasses:{}, libraryAssetImageClasses:{},
joinClassNames:(...names)=>names.filter(Boolean).join(' '),
sleep:ms=>new Promise(resolve=>setTimeout(resolve,Math.max(0,Number(ms)||0))),
staticClasses: {Title:'framey-title'},
Navigation: {Navigate:navigate, NavigateBack:()=>navigate(null), CloseSideMenus:()=>navigate(null),
NavigateToExternalWeb: url => { if (/^https:\/\//.test(url)) window.open(url, '_blank', 'noopener'); }},
showModal, showContextMenu:showModal,
// Steam app, library, and store patches have no target inside this panel.
afterPatch:noPatch, beforePatch:noPatch, replacePatch:noPatch, createReactTreePatcher:noPatch,
findInReactTree: () => null, findModuleExport: () => null, findModuleChild: () => null,
findModule:()=>null, findModuleByExport:()=>null, findClassModule:()=>null,
findClass:()=>null, findSP:()=>null, fakeRenderComponent:()=>null,
appDetailsClasses: {}, appDetailsHeaderClasses: {},
useParams: () => currentParams,
};
// No Steam game is attached to an isolated panel. Subscriptions have a
// disposable handle but emit no fabricated game, power, or input events.
const subscription = () => {const dispose=()=>{};dispose.unregister=dispose;return dispose;};
const register = names => Object.fromEntries(names.map(name=>[name,subscription]));
const steamLanguage = () => {
const locale = (navigator.language || 'en').toLowerCase();
if (/^zh-(tw|hk|mo|hant)/.test(locale)) return 'tchinese';
if (locale.startsWith('pt-br')) return 'brazilian';
if (locale.startsWith('es-419')) return 'latam';
return ({en:'english',de:'german',fr:'french',es:'spanish',it:'italian',ja:'japanese',
ko:'koreana',zh:'schinese',ru:'russian',pl:'polish',pt:'portuguese',nl:'dutch',
da:'danish',fi:'finnish',sv:'swedish',no:'norwegian',cs:'czech',hu:'hungarian',
ro:'romanian',th:'thai',tr:'turkish',vi:'vietnamese',uk:'ukrainian',id:'indonesian'
})[locale.split('-')[0]] || 'english';
};
window.SteamClient = {
Settings:{GetCurrentLanguage:async()=>steamLanguage(),
...register(['RegisterForSettingsChanges'])},
Apps:register(['RegisterForAppDetails','RegisterForGameActionTaskChange',
'RegisterForGameActionStart','RegisterForGameActionEnd']),
GameSessions:register(['RegisterForAppLifetimeNotifications','RegisterForScreenshotNotification']),
System:{...register(['RegisterForOnResumeFromSuspend','RegisterForOnSuspendRequest']),
UI:register(['RegisterForFocusChangeEvents'])},
Input:register(['RegisterForControllerInputMessages','RegisterForControllerStateChanges']),
User:register(['RegisterForLoginStateChange','RegisterForPrepareForSystemSuspendProgress',
'RegisterForResumeSuspendedGamesProgress','RegisterForCurrentUserChanges']),
Overlay:register(['RegisterForOverlayActivated']),
UI:register(['RegisterForUIModeChanged']),
};
DFL.Router = {...DFL.Navigation, MainRunningApp:undefined};
DFL.DialogButton.render = () => ({type: DFL.DialogButton});
const toaster = {toast: ({title, body, subtext, icon, logo, duration, showToast=true, onClick}={}) => {
const data = {title, body, subtext, icon, logo};
if (!showToast) return {data, dismiss(){}};
const item = document.createElement('section');
item.setAttribute('role','status');
const roots = [];
const addContent = (tag, value) => {
if (value === null || value === undefined || value === false) return;
const node = document.createElement(tag);
if (R.isValidElement(value) || Array.isArray(value)) {
const root = window.ReactDOM.createRoot(node);
roots.push(root);
root.render(value);
} else if (typeof value === 'string' || typeof value === 'number') {
node.textContent = String(value);
} else return;
item.append(node);
};
addContent('span', logo);
addContent('span', icon);
addContent('strong', title || 'Plugin notice');
addContent('p', body);
addContent('small', subtext);
const close = document.createElement('button'); close.type='button'; close.textContent='Dismiss';
let dismissed = false;
const dismiss = () => {
if (dismissed) return;
dismissed = true;
clearTimeout(timer);
for (const root of roots) root.unmount();
item.remove();
};
close.onclick=dismiss; item.append(close);
if (typeof onClick === 'function') {
const open = document.createElement('button'); open.type='button'; open.textContent='Open';
open.onclick=()=>{onClick(); dismiss();}; item.append(open);
}
toastRoot.append(item);
const timer = setTimeout(dismiss, Math.min(30000,Math.max(3000,Number(duration)||5000)));
return {data,dismiss};
}};
class PanelBoundary extends R.Component {
constructor(props) { super(props); this.state = {failure:null}; }
static getDerivedStateFromError(failure) { return {failure}; }
render() { return this.state.failure ? R.createElement('p', null,
`This Decky panel is not compatible with Framey: ${this.state.failure.message}`) : this.props.children; }
}
function PluginSurface({plugin}) {
const [view, setView] = R.useState(plugin.content ? 'panel' : 'settings');
const [route, setRoute] = R.useState(currentRoute);
R.useEffect(() => {routeListeners.add(setRoute); return () => routeListeners.delete(setRoute);}, []);
const [running, setRunning] = R.useState(null);
const [message, setMessage] = R.useState('');
const actions = Array.isArray(plugin.frameyQuickActions) ? plugin.frameyQuickActions.slice(0, 8)
.filter(action => action && typeof action.label === 'string' && action.label.length <= 80 &&
typeof action.onClick === 'function') : [];
async function runAction(action, index) {
if (running !== null) return;
setRunning(index); setMessage(`${action.label}…`);
try {
const result = await action.onClick();
setMessage(typeof result === 'string' && result.length < 200 ? result : `${action.label} done`);
} catch (failure) { setMessage(`${action.label} failed: ${failure.message || failure}`); }
finally { setRunning(null); }
}
return R.createElement(R.Fragment, null,
plugin.titleView && R.createElement('header', null, plugin.titleView),
route && R.createElement('button', {type:'button', onClick:()=>navigate(null)}, 'Back to plugin'),
plugin.settings && R.createElement('nav', {'aria-label':'Plugin views'},
R.createElement('button', {type:'button', 'aria-current':view === 'panel' ? 'page' : undefined,
onClick:()=>setView('panel')}, 'Panel'),
R.createElement('button', {type:'button', 'aria-current':view === 'settings' ? 'page' : undefined,
onClick:()=>setView('settings')}, 'Settings')),
actions.length > 0 && R.createElement('section', {'aria-label':'Plugin quick actions'},
R.createElement('h2', null, 'Quick actions'),
...actions.map((action, index) => R.createElement('button', {key:index, type:'button',
disabled:running !== null, onClick:()=>runAction(action,index)}, action.label))),
message && R.createElement('p', {role:'status'}, message),
R.createElement('div', null, route ? (typeof activeRoute(route)?.component === 'function' ?
R.createElement(activeRoute(route).component) : activeRoute(route)?.component) :
(view === 'settings' ? plugin.settings : plugin.content)));
}
window.__DECKY_SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_deckyLoaderAPIInit = {
connect: (version, name) => ({
_version: Math.min(version, 2),
call: (method, ...args) => ask(method, args),
callable: method => (...args) => ask(method, args),
addEventListener: () => {}, removeEventListener: () => {},
routerHook, toaster,
fetchNoCors: () => Promise.reject(Error('Decky proxy fetch is unavailable in Framey')),
executeInTab: () => Promise.reject(Error('Steam tab injection is unavailable in Framey')),
injectCssIntoTab: () => Promise.reject(Error('Steam tab injection is unavailable in Framey')),
removeCssFromTab: () => Promise.reject(Error('Steam tab injection is unavailable in Framey')),
getExternalResourceURL: () => null,
useQuickAccessVisible: () => true,
}),
};
const legacyServerAPI = {
routerHook, toaster,
callPluginMethod: (method, kwargs={}) => {
if (!kwargs || typeof kwargs !== 'object' || Array.isArray(kwargs))
return Promise.resolve({success:false, result:'Legacy plugin arguments must be an object'});
// Decky's legacy route takes keyword arguments and returns this envelope.
return ask(method, [kwargs], true).catch(failure=>({success:false, result:String(failure.message || failure)}));
},
fetchNoCors: () => Promise.reject(Error('Decky proxy fetch is unavailable in Framey')),
};
async function start() {
try {
await seeded;
const bytes = Uint8Array.from(atob(document.getElementById('framey-bundle').textContent), c=>c.charCodeAt(0));
// Old Decky builds are expressions returning the initializer, rather than
// ES modules. A module wrapper preserves the sandbox and avoids eval.
const legacy = /^\s*\(function\s*\(/.test(new TextDecoder().decode(bytes));
const url = URL.createObjectURL(new Blob(legacy ?
['const __frameyLegacy =\n', bytes, '\nexport default __frameyLegacy;'] : [bytes], {type:'text/javascript'}));
let module;
try { module = await import(url); } finally { URL.revokeObjectURL(url); }
if (typeof module.default !== 'function') throw Error('The Decky frontend has no plugin entry point');
plugin = await module.default(legacyServerAPI);
if (legacy && plugin?.title && !plugin.titleView) plugin.titleView = plugin.title;
if (!plugin?.content && !plugin?.settings) throw Error('The Decky plugin has no panel to display');
window.ReactDOM.createRoot(root).render(R.createElement(PanelBoundary, null,
R.createElement(PluginSurface, {plugin})));
parent.postMessage({type:'framey:ready'}, '*');
} catch (failure) {
error.textContent = `This Decky panel is not compatible with Framey: ${failure.message}`;
parent.postMessage({type:'framey:error', message:failure.message}, '*');
}
}
start();
})();
Loaded 100 of 109 files, more files were not shown because too many files have changed in this diff. Show more