Files
genshin-assistant/package.json
T
AzuTear c7138b541d feat(native): C# input/capture sidecar replacing the PowerShell helper
Implements ADR-008. native/input-helper is a self-contained .NET 9 console exe
speaking the identical JSON-over-stdin/stdout protocol as the old PowerShell
helper (ping/cursor/runtime/focus/click/scroll/bounds/capture), so the
InputHelperService interface is unchanged.

- Win32 interop compiled once (native exe), not per call.
- PerMonitorV2 DPI via manifest so click/capture coordinates stay correct on
  mixed-DPI multi-monitor setups.
- capture returns base64 PNG bytes inline (imageBase64) instead of writing a
  temp file per frame; the client handles both base64 and the PowerShell path.
- InputHelperClient prefers the exe and falls back to the embedded PowerShell
  helper when the exe is absent, so the app still runs without the .NET build.
- main.ts resolves the exe (INPUT_HELPER_EXE env -> packaged resources/input-helper
  -> native/input-helper/bin/publish). electron-builder ships it via extraResources.
- npm run helper:build; README documents the build + fallback.

Verified end-to-end through the compiled client: sidecar spawns, runtime info
and a base64 primary-screen capture return correctly. Build stays green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 21:33:26 +02:00

67 lines
2.1 KiB
JSON

{
"name": "genshin-artifact-assistant",
"version": "0.1.0",
"private": true,
"description": "Local Windows assistant for scanning Genshin artifacts and suggesting no-brainer builds.",
"main": "dist-electron/main.js",
"type": "module",
"scripts": {
"predev": "powershell -NoProfile -ExecutionPolicy Bypass -File scripts\\kill-stale-instances.ps1 && tsc -p tsconfig.electron.json && copy electron\\preload.cjs dist-electron\\preload.cjs",
"dev": "concurrently -k \"vite --host 127.0.0.1\" \"wait-on tcp:5173 && cross-env VITE_DEV_SERVER_URL=http://127.0.0.1:5173 electron .\"",
"dev:admin": ".\\dev-admin.cmd",
"build": "tsc && vite build && tsc -p tsconfig.electron.json && copy electron\\\\preload.cjs dist-electron\\\\preload.cjs",
"preview": "vite preview --host 127.0.0.1",
"start": "electron .",
"lint": "tsc --noEmit",
"test": "vitest run",
"eval": "vitest run src/eval/ocrEval.test.ts",
"helper:build": "dotnet publish native/input-helper/InputHelper.csproj -c Release -o native/input-helper/bin/publish",
"data:genshin": "node scripts/generate-genshin-data.cjs"
},
"dependencies": {
"@vitejs/plugin-react": "^4.3.4",
"electron": "33.2.1",
"genshin-db": "^5.2.12",
"lucide-react": "^0.468.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tesseract.js": "^7.0.0",
"vite": "^6.0.3"
},
"devDependencies": {
"@types/node": "^22.10.2",
"@types/react": "^18.3.17",
"@types/react-dom": "^18.3.5",
"concurrently": "^9.1.0",
"cross-env": "^7.0.3",
"typescript": "^5.7.2",
"vitest": "^2.1.8",
"wait-on": "^8.0.1"
},
"build": {
"appId": "local.genshin.artifact-assistant",
"productName": "Genshin Artifact Assistant",
"directories": {
"output": "outputs/dist"
},
"files": [
"dist/**/*",
"dist-electron/**/*",
"package.json"
],
"extraResources": [
{
"from": "native/input-helper/bin/publish",
"to": "input-helper",
"filter": [
"**/*"
]
}
],
"win": {
"target": "nsis",
"requestedExecutionLevel": "requireAdministrator"
}
}
}