From 2f592cba51c73fde4e325fd0503da48cef1532db Mon Sep 17 00:00:00 2001 From: Quinta0 <0pietroquintavalle0@gmail.com> Date: Sat, 5 Dec 2026 13:59:52 +0100 Subject: [PATCH 1/2] Hitscan Hyperlight compatibility --- package-lock.json | 726 ++++++++++++++++++ package.json | 4 +- patches/@openmouse+protocol+0.68.1.patch | 300 ++++++++ src/device/traits.ts | 6 +- .../devices/cards/availability.test.ts | 4 +- 5 files changed, 1034 insertions(+), 6 deletions(-) create mode 100644 patches/@openmouse+protocol+0.68.1.patch diff --git a/package-lock.json b/package-lock.json index ba137ae5..47e64de6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "preact": "^10.29.8" }, "devDependencies": { + "patch-package": "^8.0.1", "picomatch": "file:vendor/picomatch-safe", "typescript": "^5.8.3", "vite": "^6.3.5" @@ -930,6 +931,145 @@ "license": "MIT", "optional": true }, + "node_modules/@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.9.tgz", + "integrity": "sha512-a/hy+pNsFUTR+Iz8TCJvXudKVLAnz/DyeSUo10I5yvFDQJBFU2s9uqQpoSrJlroHUKoKqzg+epxyP9lqFdzfBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "get-intrinsic": "^1.3.0", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, "node_modules/core-js": { "version": "3.51.0", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.51.0.tgz", @@ -944,6 +1084,39 @@ "url": "https://opencollective.com/core-js" } }, + "node_modules/cross-spawn": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.1.2.tgz", + "integrity": "sha512-8BPK2r+sKWC8sDinRwLwrFMq2lXTBBwzYYEB9LiCznfMurOi4FOvQflq3XOLGG+HPdMSVpe+k/s96+AtDEOgPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/dompurify": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.5.1.tgz", @@ -953,6 +1126,54 @@ "@types/trusted-types": "^2.0.7" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/esbuild": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", @@ -1019,6 +1240,44 @@ "integrity": "sha512-zdxgIEddhfsyCaWpJ2SdXEP8ZMrKJ6+5jl4OupODcywU0IhRk6gdXuVGcPICyfx2H97hVK7xmJtRLPjkxAX8Vw==", "license": "MIT" }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-yarn-workspace-root": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "micromatch": "^4.0.2" + } + }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -1034,6 +1293,230 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.12.tgz", + "integrity": "sha512-iuyGF2E4oafQfPsRrG2wtY2ILupMhvtdrhzrxB+0VcjsPpSPttpfYdjnGFGsTi5MaJFjI1jOKHPQ6UTbTj9TAw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/json-stable-stringify": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.3.0.tgz", + "integrity": "sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/jsonfile": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", + "dev": true, + "license": "Public Domain", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.11" + } + }, "node_modules/lucide-react": { "version": "1.43.0", "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-1.43.0.tgz", @@ -1043,6 +1526,40 @@ "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/nanoid": { "version": "3.3.18", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz", @@ -1062,6 +1579,73 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/patch-package": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.1.tgz", + "integrity": "sha512-VsKRIA8f5uqHQ7NGhwIna6Bx6D9s/1iXlA1hthBVBEbkq+t4kXD0HHt+rJhf/Z+Ci0F/HCB2hvn0qLdLG+Qxlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^4.1.2", + "ci-info": "^3.7.0", + "cross-spawn": "^7.0.3", + "find-yarn-workspace-root": "^2.0.0", + "fs-extra": "^10.0.0", + "json-stable-stringify": "^1.0.2", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.6", + "open": "^7.4.2", + "semver": "^7.5.3", + "slash": "^2.0.0", + "tmp": "^0.2.4", + "yaml": "^2.2.2" + }, + "bin": { + "patch-package": "index.js" + }, + "engines": { + "node": ">=14", + "npm": ">5" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -1212,6 +1796,70 @@ "fsevents": "~2.3.2" } }, + "node_modules/semver": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/source-map-js": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", @@ -1222,6 +1870,19 @@ "node": ">=0.10.0" } }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/tinyglobby": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", @@ -1239,6 +1900,29 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/tmp": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.7.tgz", + "integrity": "sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.14" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, "node_modules/typescript": { "version": "5.9.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", @@ -1253,6 +1937,16 @@ "node": ">=14.17" } }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/vite": { "version": "6.4.6", "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.6.tgz", @@ -1341,6 +2035,38 @@ "integrity": "sha512-rLcLXA2sx6+9dE88NHFubwTtGxpK4yYBLj6qHPdFoCaLr0cXGb4efOqtKLlm4loGA4OEKHIQKMKzZkKyOh5ctw==", "license": "Apache-2.0" }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/yaml": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz", + "integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, "vendor/picomatch-safe": { "name": "@openmouse/picomatch-safe", "version": "4.0.7", diff --git a/package.json b/package.json index aef3d4f5..ed4c8237 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "size": "node build/check-bundle-size.ts", "sync:devices": "node scripts/sync-supported-devices.mjs", "check": "npm run build && npm run size && npm test", - "preview": "vite preview" + "preview": "vite preview", + "postinstall": "patch-package" }, "dependencies": { "@openmouse/keyboard-protocol": "1.10.0", @@ -21,6 +22,7 @@ "preact": "^10.29.8" }, "devDependencies": { + "patch-package": "^8.0.1", "picomatch": "file:vendor/picomatch-safe", "typescript": "^5.8.3", "vite": "^6.3.5" diff --git a/patches/@openmouse+protocol+0.68.1.patch b/patches/@openmouse+protocol+0.68.1.patch new file mode 100644 index 00000000..7a8cca43 --- /dev/null +++ b/patches/@openmouse+protocol+0.68.1.patch @@ -0,0 +1,300 @@ +diff --git a/node_modules/@openmouse/protocol/dist/drivers/hitscan/hid.d.ts b/node_modules/@openmouse/protocol/dist/drivers/hitscan/hid.d.ts +index c7eeb78..4529651 100644 +--- a/node_modules/@openmouse/protocol/dist/drivers/hitscan/hid.d.ts ++++ b/node_modules/@openmouse/protocol/dist/drivers/hitscan/hid.d.ts +@@ -13,8 +13,11 @@ type LiftOffDistance = NonNullable; + * + * Settings are checksummed records in a flash image, so every setter writes + * one record and reads it back. Only settings whose meaning was traced to a +- * named UI handler in Hitscan Utility 1.0.2 are exposed; sleep, sensor mode +- * and the LED fields stay raw. Nothing here has run on hardware yet. ++ * named UI handler in Hitscan Utility 1.0.2 are exposed; sensor mode and the ++ * LED fields stay raw. Record layouts, button order, sleep units and battery ++ * bytes are checked against Hyperlight captures, and the client has run on a ++ * Hyperlight wired and through its receiver: reads, polling, sleep and button ++ * writes, with settings kept across a power cycle. The 8K receiver is untested. + */ + export declare class HitscanHidClient { + readonly device: HIDDevice; +@@ -28,6 +31,8 @@ export declare class HitscanHidClient { + private readonly notify?; + private lastStatus; + private firmware; ++ /** Cleared when a wired mouse leaves the battery query unanswered. */ ++ private wiredBattery; + constructor(device: HIDDevice, options?: HitscanClientOptions); + static isSupported(device: HIDDevice): boolean; + private readonly onInput; +@@ -58,6 +63,7 @@ export declare class HitscanHidClient { + getDpiOptions(): number[]; + getSupportedPollingRates(): number[]; + getDebounceMaxMs(): number; ++ getSleepOptions(): number[]; + readStatus(live?: boolean): Promise; + private readLiveStatus; + /** Polling rate, stage count and active stage: the first three records. */ +@@ -65,8 +71,9 @@ export declare class HitscanHidClient { + /** Unqueued: callers hold the queue. A corrupt record fails rather than guessing stage 1. */ + private readActiveStage; + /** +- * Wireless only. The reply layout is inferred from CompX, so an unanswered +- * or unrecognized query reports an unknown battery instead of failing the read. ++ * An unanswered or unrecognized query reports an unknown battery instead of ++ * failing the read. A Hyperlight answers on the cable too (charging flag set); ++ * a wired mouse that does not answer is not asked again, so polls stay fast. + */ + private readBattery; + private liftOffScale; +@@ -83,6 +90,8 @@ export declare class HitscanHidClient { + setLiftOffDistance(value: LiftOffDistance): Promise; + setLiftOffScale(code: number): Promise; + setDebounceTime(milliseconds: number): Promise; ++ /** Writes only 0xB7, as the utility does; the auto-sleep switch is left alone. */ ++ setSleepTimeout(seconds: number): Promise; + setMotionSync(enabled: boolean): Promise; + setAngleSnapping(enabled: boolean): Promise; + setRippleControl(enabled: boolean): Promise; +diff --git a/node_modules/@openmouse/protocol/dist/drivers/hitscan/hid.js b/node_modules/@openmouse/protocol/dist/drivers/hitscan/hid.js +index cecf855..52d53d0 100644 +--- a/node_modules/@openmouse/protocol/dist/drivers/hitscan/hid.js ++++ b/node_modules/@openmouse/protocol/dist/drivers/hitscan/hid.js +@@ -1,4 +1,4 @@ +-import { HITSCAN_REPORT_ID, HITSCAN_PAYLOAD_LENGTH, HITSCAN_COMMAND, HITSCAN_CONFIG_LENGTH, HITSCAN_VENDOR_ID, HITSCAN_PRODUCTS, HITSCAN_MODELS, HITSCAN_ADDRESS, HITSCAN_SETTING_ADDRESS, HITSCAN_3395_DPI_VALUES, HITSCAN_DEBOUNCE_MAX_MS, HITSCAN_LIFT_OFF_MILLIMETRES, HITSCAN_BUTTON_NAMES, HITSCAN_BUTTON_OPTIONS, HitscanConfig, hitscanChecksumIsValid, hitscanMatchesResponse, hitscanParseReadResponse, hitscanBuildCommand, hitscanBuildReadChunks, hitscanBuildWriteChunks, hitscanEncodeRecord, hitscanEncodeScalar, hitscanEncodePollingRate, hitscanDecodePollingRate, hitscanEncode3395Dpi, hitscanDecode3395Dpi, hitscanDecodeLiftOff, hitscanPollingRatesFor, hitscanEncodeButton, hitscanDecodeButton, hitscanButtonActionForLabel, hitscanButtonLabel, hitscanDecodeBattery, hitscanDecodeVersion, hitscanFormatVersion, } from "@openmouse/protocol/hitscan"; ++import { HITSCAN_REPORT_ID, HITSCAN_PAYLOAD_LENGTH, HITSCAN_COMMAND, HITSCAN_CONFIG_LENGTH, HITSCAN_VENDOR_ID, HITSCAN_PRODUCTS, HITSCAN_MODELS, HITSCAN_ADDRESS, HITSCAN_SETTING_ADDRESS, HITSCAN_3395_DPI_VALUES, HITSCAN_DEBOUNCE_MAX_MS, HITSCAN_SLEEP_SECONDS, HITSCAN_SLEEP_UNIT_SECONDS, HITSCAN_LIFT_OFF_MILLIMETRES, HITSCAN_BUTTON_NAMES, HITSCAN_BUTTON_OPTIONS, HitscanConfig, hitscanChecksumIsValid, hitscanMatchesResponse, hitscanParseReadResponse, hitscanBuildCommand, hitscanBuildReadChunks, hitscanBuildWriteChunks, hitscanEncodeRecord, hitscanEncodeScalar, hitscanEncodePollingRate, hitscanDecodePollingRate, hitscanEncode3395Dpi, hitscanDecode3395Dpi, hitscanDecodeLiftOff, hitscanPollingRatesFor, hitscanEncodeButton, hitscanDecodeButton, hitscanButtonActionForLabel, hitscanButtonLabel, hitscanDecodeBattery, hitscanDecodeVersion, hitscanFormatVersion, } from "@openmouse/protocol/hitscan"; + /** Every shipped model profile (MID 1 and 2) is the same 3395 configuration. */ + const MODEL = HITSCAN_MODELS.get(1); + const STAGE_STRIDE = 4; +@@ -10,8 +10,11 @@ const LIFT_OFF_STOPS = { 1: "Low", 2: "High" }; + * + * Settings are checksummed records in a flash image, so every setter writes + * one record and reads it back. Only settings whose meaning was traced to a +- * named UI handler in Hitscan Utility 1.0.2 are exposed; sleep, sensor mode +- * and the LED fields stay raw. Nothing here has run on hardware yet. ++ * named UI handler in Hitscan Utility 1.0.2 are exposed; sensor mode and the ++ * LED fields stay raw. Record layouts, button order, sleep units and battery ++ * bytes are checked against Hyperlight captures, and the client has run on a ++ * Hyperlight wired and through its receiver: reads, polling, sleep and button ++ * writes, with settings kept across a power cycle. The 8K receiver is untested. + */ + export class HitscanHidClient { + device; +@@ -25,6 +28,8 @@ export class HitscanHidClient { + notify; + lastStatus = null; + firmware = null; ++ /** Cleared when a wired mouse leaves the battery query unanswered. */ ++ wiredBattery = true; + constructor(device, options = {}) { + this.device = device; + this.timeoutMs = options.replyTimeoutMs ?? 100; +@@ -207,6 +212,9 @@ export class HitscanHidClient { + getDebounceMaxMs() { + return HITSCAN_DEBOUNCE_MAX_MS; + } ++ getSleepOptions() { ++ return [...HITSCAN_SLEEP_SECONDS]; ++ } + readStatus(live = false) { + return this.run(async () => { + if (live && this.lastStatus) +@@ -256,10 +264,11 @@ export class HitscanHidClient { + family: "hitscan", + hideUnsupportedPollingRates: true, + hideSignalCard: true, +- hideSleepCard: true, + showAdvancedSection: true, + ...(wireless ? { forceShowBattery: true } : {}), +- statusNote: "Hitscan support was recovered from the vendor utility and has not been tested on hardware yet.", ++ ...(HITSCAN_PRODUCTS.get(this.device.productId)?.verified ? {} : { ++ statusNote: "Hitscan support was recovered from the vendor utility and has not been tested on hardware yet.", ++ }), + dpiStageEditor: { + maxStages: MODEL.maxDpiStages, + countEditable: true, +@@ -281,6 +290,10 @@ export class HitscanHidClient { + connectionType: wireless ? "Wireless" : "Wired", + connectionDetail: wireless ? (this.transport() === "8k-receiver" ? "8K receiver" : "2.4 GHz receiver") : "Wired USB", + debounceMs: config.scalar(HITSCAN_SETTING_ADDRESS.debounce), ++ // Off (0xB5 = 0) or an unreadable record leaves the timeout unknown. ++ sleepTimeout: flag(HITSCAN_SETTING_ADDRESS.autoSleep) === true ++ ? (config.scalar(HITSCAN_SETTING_ADDRESS.sleepSelection) ?? 0) * HITSCAN_SLEEP_UNIT_SECONDS || null ++ : null, + liftOffDistance: liftOffCode === null ? null : LIFT_OFF_STOPS[liftOffCode], + supportedLiftOffDistances: ["Low", "High"], + liftOffScale: liftOffCode === null ? null : this.liftOffScale(liftOffCode), +@@ -325,14 +338,20 @@ export class HitscanHidClient { + return stage; + } + /** +- * Wireless only. The reply layout is inferred from CompX, so an unanswered +- * or unrecognized query reports an unknown battery instead of failing the read. ++ * An unanswered or unrecognized query reports an unknown battery instead of ++ * failing the read. A Hyperlight answers on the cable too (charging flag set); ++ * a wired mouse that does not answer is not asked again, so polls stay fast. + */ + async readBattery() { +- if (!this.isWireless()) ++ const wired = !this.isWireless(); ++ if (wired && !this.wiredBattery) + return null; + return await this.exchangeNow(hitscanBuildCommand(HITSCAN_COMMAND.battery)) +- .then(reply => hitscanDecodeBattery(reply), () => null); ++ .then(reply => hitscanDecodeBattery(reply), () => { ++ if (wired) ++ this.wiredBattery = false; ++ return null; ++ }); + } + liftOffScale(code) { + return { +@@ -459,6 +478,18 @@ export class HitscanHidClient { + return milliseconds; + }); + } ++ /** Writes only 0xB7, as the utility does; the auto-sleep switch is left alone. */ ++ setSleepTimeout(seconds) { ++ return this.run(async () => { ++ if (!HITSCAN_SLEEP_SECONDS.includes(seconds)) { ++ throw new Error(`Auto sleep must be one of ${HITSCAN_SLEEP_SECONDS.join(", ")} seconds.`); ++ } ++ await this.writeScalar(HITSCAN_SETTING_ADDRESS.sleepSelection, seconds / HITSCAN_SLEEP_UNIT_SECONDS); ++ if (this.lastStatus?.sleepTimeout !== null) ++ this.patch({ sleepTimeout: seconds }); ++ return seconds; ++ }); ++ } + setMotionSync(enabled) { + return this.setFlag(HITSCAN_SETTING_ADDRESS.motionSync, "motionSync", enabled); + } +diff --git a/node_modules/@openmouse/protocol/dist/hitscan/buttons.d.ts b/node_modules/@openmouse/protocol/dist/hitscan/buttons.d.ts +index b9cf640..643d256 100644 +--- a/node_modules/@openmouse/protocol/dist/hitscan/buttons.d.ts ++++ b/node_modules/@openmouse/protocol/dist/hitscan/buttons.d.ts +@@ -45,10 +45,10 @@ export declare function hitscanEncodeButton(action: HitscanButtonAction): Hitsca + export declare function hitscanDecodeButton(values: ArrayLike): HitscanButtonAction; + /** + * Physical buttons, in key-record order (`0x60 + 4*i`). `KeyNumber=6` in the +- * shipped Config.ini. The order follows the CompX key table this layout shares +- * with Teevolution; shipped defaults corroborate Left, Right and Back. ++ * shipped Config.ini. A Hyperlight's factory flash holds Forward (`01 10 00`) ++ * at 0x6c and Back (`01 08 00`) at 0x70, so Forward comes before Back. + */ +-export declare const HITSCAN_BUTTON_NAMES: readonly ["Left", "Right", "Middle", "Back", "Forward", "DPI"]; ++export declare const HITSCAN_BUTTON_NAMES: readonly ["Left", "Right", "Middle", "Forward", "Back", "DPI"]; + /** UI labels for the named actions, in display order. Shortcut and macro stay read-only. */ + export declare const HITSCAN_BUTTON_OPTIONS: ReadonlyArray; + export declare function hitscanButtonActionForLabel(label: string): HitscanButtonAction | null; +diff --git a/node_modules/@openmouse/protocol/dist/hitscan/buttons.js b/node_modules/@openmouse/protocol/dist/hitscan/buttons.js +index 5cae790..bc00293 100644 +--- a/node_modules/@openmouse/protocol/dist/hitscan/buttons.js ++++ b/node_modules/@openmouse/protocol/dist/hitscan/buttons.js +@@ -52,10 +52,10 @@ export function hitscanDecodeButton(values) { + } + /** + * Physical buttons, in key-record order (`0x60 + 4*i`). `KeyNumber=6` in the +- * shipped Config.ini. The order follows the CompX key table this layout shares +- * with Teevolution; shipped defaults corroborate Left, Right and Back. ++ * shipped Config.ini. A Hyperlight's factory flash holds Forward (`01 10 00`) ++ * at 0x6c and Back (`01 08 00`) at 0x70, so Forward comes before Back. + */ +-export const HITSCAN_BUTTON_NAMES = ["Left", "Right", "Middle", "Back", "Forward", "DPI"]; ++export const HITSCAN_BUTTON_NAMES = ["Left", "Right", "Middle", "Forward", "Back", "DPI"]; + /** UI labels for the named actions, in display order. Shortcut and macro stay read-only. */ + export const HITSCAN_BUTTON_OPTIONS = [ + ["Left Click", { kind: "mouse", button: "left" }], +diff --git a/node_modules/@openmouse/protocol/dist/hitscan/index.d.ts b/node_modules/@openmouse/protocol/dist/hitscan/index.d.ts +index 0680106..0fb6f00 100644 +--- a/node_modules/@openmouse/protocol/dist/hitscan/index.d.ts ++++ b/node_modules/@openmouse/protocol/dist/hitscan/index.d.ts +@@ -18,7 +18,7 @@ export declare const HITSCAN_NOTIFICATION = 10; + export declare const HITSCAN_VENDOR_ID = 14192; + export declare const HITSCAN_PRODUCTS: ReadonlyMap; + /** MID is returned at runtime; the shipped file gives neither model a retail name. */ + export declare const HITSCAN_MODELS: ReadonlyMap 68 %. + */ + export declare function hitscanDecodeBattery(reply: Bytes): { + percent: number | null; +diff --git a/node_modules/@openmouse/protocol/dist/hitscan/index.js b/node_modules/@openmouse/protocol/dist/hitscan/index.js +index a57db08..d922550 100644 +--- a/node_modules/@openmouse/protocol/dist/hitscan/index.js ++++ b/node_modules/@openmouse/protocol/dist/hitscan/index.js +@@ -17,8 +17,8 @@ export const HITSCAN_NOTIFICATION = 0x0a; + /** Base64-decoded shipped Config.ini, normalized by the app's config reader. */ + export const HITSCAN_VENDOR_ID = 0x3770; + export const HITSCAN_PRODUCTS = new Map([ +- [0x0100, { transport: "wired", verified: false }], +- [0x0200, { transport: "receiver", verified: false }], ++ [0x0100, { transport: "wired", verified: true }], ++ [0x0200, { transport: "receiver", verified: true }], + [0x0300, { transport: "8k-receiver", verified: false }], + ]); + /** MID is returned at runtime; the shipped file gives neither model a retail name. */ +@@ -253,10 +253,10 @@ export class HitscanConfig { + } + } + /** +- * GetBatteryLevel (0x04) returns payload[5], payload[6] and BE16 payload[7..8]. +- * The DLL does not name them; this is the same reply shape CompX mice use +- * (percent, charging flag, millivolts), and this command table, framing and +- * flash layout match CompX's byte for byte. Unverified on Hitscan hardware. ++ * GetBatteryLevel (0x04) returns percent, charging flag and BE16 millivolts at ++ * payload[5..8], the CompX shape. A Hyperlight answers `3c 01 0f a3` on the ++ * cable (60 %, charging, 4003 mV) and `23 00 0e ee` on battery (35 %, 3822 mV). ++ * The percentage is coarse: it held at 60 while the utility showed 65 -> 68 %. + */ + export function hitscanDecodeBattery(reply) { + if (!hitscanChecksumIsValid(reply) || reply[0] !== HITSCAN_COMMAND.battery) +diff --git a/node_modules/@openmouse/protocol/dist/hitscan/settings.d.ts b/node_modules/@openmouse/protocol/dist/hitscan/settings.d.ts +index 8b493d5..379ca3d 100644 +--- a/node_modules/@openmouse/protocol/dist/hitscan/settings.d.ts ++++ b/node_modules/@openmouse/protocol/dist/hitscan/settings.d.ts +@@ -36,8 +36,12 @@ export declare const HITSCAN_3395_DPI_VALUES: readonly number[]; + * Unknown flags, unequal axes, and out-of-range records remain unrecognized. + */ + export declare function hitscanDecode3395Dpi(bytes: Uint8Array | readonly number[]): number | null; +-/** Exact dropdown-index mapping; physical duration units remain unverified. */ +-export declare const HITSCAN_SLEEP_SELECTION_VALUES: readonly [3, 6, 30, 60, 90, 120, 150, 180, 210, 240]; ++/** ++ * 0xB7 counts 10-second units: Hyperlight captures write 12 for 2 min and 30 ++ * for 5 min. The list is the utility's menu (10 s .. 45 min) in seconds. ++ */ ++export declare const HITSCAN_SLEEP_UNIT_SECONDS = 10; ++export declare const HITSCAN_SLEEP_SECONDS: readonly [10, 30, 60, 120, 300, 600, 900, 1800, 2700]; + /** Menu handlers write 0..8 ms; see HID-SETTINGS.md. Spinbox variants are not modelled. */ + export declare const HITSCAN_DEBOUNCE_MAX_MS = 8; + /** +diff --git a/node_modules/@openmouse/protocol/dist/hitscan/settings.js b/node_modules/@openmouse/protocol/dist/hitscan/settings.js +index 36c3b1a..7a0630a 100644 +--- a/node_modules/@openmouse/protocol/dist/hitscan/settings.js ++++ b/node_modules/@openmouse/protocol/dist/hitscan/settings.js +@@ -69,8 +69,12 @@ export function hitscanDecode3395Dpi(bytes) { + const canonical = hitscanEncode3395Dpi(dpi).record; + return canonical.subarray(0, 3).every((byte, index) => byte === bytes[index]) ? dpi : null; + } +-/** Exact dropdown-index mapping; physical duration units remain unverified. */ +-export const HITSCAN_SLEEP_SELECTION_VALUES = [3, 6, 30, 60, 90, 120, 150, 180, 210, 240]; ++/** ++ * 0xB7 counts 10-second units: Hyperlight captures write 12 for 2 min and 30 ++ * for 5 min. The list is the utility's menu (10 s .. 45 min) in seconds. ++ */ ++export const HITSCAN_SLEEP_UNIT_SECONDS = 10; ++export const HITSCAN_SLEEP_SECONDS = [10, 30, 60, 120, 300, 600, 900, 1800, 2700]; + /** Menu handlers write 0..8 ms; see HID-SETTINGS.md. Spinbox variants are not modelled. */ + export const HITSCAN_DEBOUNCE_MAX_MS = 8; + /** diff --git a/src/device/traits.ts b/src/device/traits.ts index 5dacd182..16f75237 100644 --- a/src/device/traits.ts +++ b/src/device/traits.ts @@ -117,9 +117,9 @@ const BY_FAMILY: Readonly>> = { // The NJ07/NJ08 family keeps the sleep timer in its config block and has no // debounce setting in the vendor panel, so only the sleep card. ajazz: { advancedSection: true, sleep: true }, - // Hitscan stores a 0-8 ms debounce in flash and publishes its own ceiling. - // Its sleep units are unresolved, so the driver hides the sleep card. - hitscan: { advancedSection: true, debounce: true }, + // Hitscan stores a 0-8 ms debounce and a sleep timer (10 s units) in flash + // and publishes its own ceiling and sleep list. + hitscan: { advancedSection: true, sleep: true, debounce: true }, // LEOBOG GM3 keeps both in its vendor configuration block: a six-step button // debounce and a 1-20 minute auto-sleep timer (plus an off switch). Its // advancedSection already comes from ui.showAdvancedSection, but the cards diff --git a/src/features/devices/cards/availability.test.ts b/src/features/devices/cards/availability.test.ts index c6148c5b..9c1b23c6 100644 --- a/src/features/devices/cards/availability.test.ts +++ b/src/features/devices/cards/availability.test.ts @@ -464,13 +464,13 @@ test("the Atlantis family (Lamzu Atlantis, Scyrox V8S) gets debounce and sleep", assert.equal(traitsFor({ ...STATUS, ...status }).directMode, true, "the debounce ceiling comes from the driver"); }); -test("the Hitscan family alone gives the advanced section and debounce, not sleep or signal", () => { +test("the Hitscan family alone gives the advanced section, debounce and sleep, not signal", () => { // No ui flags beyond the family, so the result comes from the traits entry. const status = { brand: "Hitscan", ui: { family: "hitscan" }, debounceMs: 4, sleepTimeout: 60, signalStrength: 80 } as const; const has = cardAvailability(snapshot({ status })); assert.equal(traitsFor({ ...STATUS, ...status }).advancedSection, true); assert.equal(has.debounce, true); - assert.equal(has.sleep, false); + assert.equal(has.sleep, true); assert.equal(has.signal, false); }); From 3c846ab71ceb48e15c23e4b04924e7e68bdc2b71 Mon Sep 17 00:00:00 2001 From: Quinta0 <0pietroquintavalle0@gmail.com> Date: Sat, 5 Dec 2026 20:19:20 +0100 Subject: [PATCH 2/2] Sleep option list is now [10, 30, 60, 120, 300, 600, 900, 1800] --- patches/@openmouse+protocol+0.68.1.patch | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/patches/@openmouse+protocol+0.68.1.patch b/patches/@openmouse+protocol+0.68.1.patch index 7a8cca43..92f65999 100644 --- a/patches/@openmouse+protocol+0.68.1.patch +++ b/patches/@openmouse+protocol+0.68.1.patch @@ -264,7 +264,7 @@ diff --git a/node_modules/@openmouse/protocol/dist/hitscan/settings.d.ts b/node_ index 8b493d5..379ca3d 100644 --- a/node_modules/@openmouse/protocol/dist/hitscan/settings.d.ts +++ b/node_modules/@openmouse/protocol/dist/hitscan/settings.d.ts -@@ -36,8 +36,12 @@ export declare const HITSCAN_3395_DPI_VALUES: readonly number[]; +@@ -36,8 +36,13 @@ export declare const HITSCAN_3395_DPI_VALUES: readonly number[]; * Unknown flags, unequal axes, and out-of-range records remain unrecognized. */ export declare function hitscanDecode3395Dpi(bytes: Uint8Array | readonly number[]): number | null; @@ -272,10 +272,11 @@ index 8b493d5..379ca3d 100644 -export declare const HITSCAN_SLEEP_SELECTION_VALUES: readonly [3, 6, 30, 60, 90, 120, 150, 180, 210, 240]; +/** + * 0xB7 counts 10-second units: Hyperlight captures write 12 for 2 min and 30 -+ * for 5 min. The list is the utility's menu (10 s .. 45 min) in seconds. ++ * for 5 min. The list is the utility's menu in seconds, up to 30 min; its ++ * 45 min entry would be 270 units, which does not fit the one-byte record. + */ +export declare const HITSCAN_SLEEP_UNIT_SECONDS = 10; -+export declare const HITSCAN_SLEEP_SECONDS: readonly [10, 30, 60, 120, 300, 600, 900, 1800, 2700]; ++export declare const HITSCAN_SLEEP_SECONDS: readonly [10, 30, 60, 120, 300, 600, 900, 1800]; /** Menu handlers write 0..8 ms; see HID-SETTINGS.md. Spinbox variants are not modelled. */ export declare const HITSCAN_DEBOUNCE_MAX_MS = 8; /** @@ -283,7 +284,7 @@ diff --git a/node_modules/@openmouse/protocol/dist/hitscan/settings.js b/node_mo index 36c3b1a..7a0630a 100644 --- a/node_modules/@openmouse/protocol/dist/hitscan/settings.js +++ b/node_modules/@openmouse/protocol/dist/hitscan/settings.js -@@ -69,8 +69,12 @@ export function hitscanDecode3395Dpi(bytes) { +@@ -69,8 +69,13 @@ export function hitscanDecode3395Dpi(bytes) { const canonical = hitscanEncode3395Dpi(dpi).record; return canonical.subarray(0, 3).every((byte, index) => byte === bytes[index]) ? dpi : null; } @@ -291,10 +292,11 @@ index 36c3b1a..7a0630a 100644 -export const HITSCAN_SLEEP_SELECTION_VALUES = [3, 6, 30, 60, 90, 120, 150, 180, 210, 240]; +/** + * 0xB7 counts 10-second units: Hyperlight captures write 12 for 2 min and 30 -+ * for 5 min. The list is the utility's menu (10 s .. 45 min) in seconds. ++ * for 5 min. The list is the utility's menu in seconds, up to 30 min; its ++ * 45 min entry would be 270 units, which does not fit the one-byte record. + */ +export const HITSCAN_SLEEP_UNIT_SECONDS = 10; -+export const HITSCAN_SLEEP_SECONDS = [10, 30, 60, 120, 300, 600, 900, 1800, 2700]; ++export const HITSCAN_SLEEP_SECONDS = [10, 30, 60, 120, 300, 600, 900, 1800]; /** Menu handlers write 0..8 ms; see HID-SETTINGS.md. Spinbox variants are not modelled. */ export const HITSCAN_DEBOUNCE_MAX_MS = 8; /**