nb5p (Discord #feedback, 10-31): the 模型指纹 page stays blank in the desktop app while `magpie web` (Chromium) shows it. Cause, Linux: magpie frames a plugin page in <iframe sandbox="allow-scripts">, so the service document has an opaque origin. WebKitGTK (2.52.6, magpie's Linux window) then matches nothing to CSP 'self', and the service's policy was 'self' alone for scripts, styles and images: the bundle was never requested. Chromium and macOS WebKit match 'self' there, so web mode and the Mac app worked. The service now names its own validated listener (http://127.0.0.1:<port> or localhost:<port>) and, when proxied, the validated launcher origin, in every fetch directive. Nothing else is allowed: script-src keeps its nonce and no 'unsafe-inline', and object-src/base-uri/form-action are 'none'. Two Windows faults on the same path: - boot.js took the window's http://wails.localhost for a remote web page and showed "upgrade magpie" instead of going to the local service. Every *.localhost, localhost, ::1 and 127.x now count as this computer (the service still checks Host and Origin and its bearer token). - server.ts kept assets inside ui/ with startsWith(resolve(uiDir) + "/"), which never holds for backslash paths, so every asset was a 404 on Windows, in web mode too. It now uses path.relative, and still refuses .., encoded .. and a backslash escape. integration.md says the same about the CSP. dist rebuilt with Bun 1.4.2 on mote (the old source rebuilt to the committed dist byte for byte, so the dist diff is only this change). Run: - mote (macOS 27): bun run build, typecheck, bun test: 33 pass. - win-run (Windows 11): bun test: 33 pass. - Linux, the real app: a dev magpie (-tags dev,gtk3) in WSL magpie-desktop under a sandbox HOME, with this plugin installed. Old plugin: the frame reached the service and no script ran, blank. New: the service page rendered and connected to magpie. - macOS, a WKWebView with a wails:// scheme over a real dev backend on mote, sandboxed frame: renders with the old and the new policy. Broken by hand: - the new CSP test is red on the old server.ts (no own origin in script-src etc.); - the boot test for wails.localhost is red on the old boot.js; - the asset test is red on Windows with the old containment check. Not tried: the real Windows Wails app (WebView2) end to end, and the reporter's own machine; their platform isn't stated, and Linux is the one where this reproduces.
98 lines
2.4 KiB
JSON
98 lines
2.4 KiB
JSON
{
|
|
"name": "@magpie-community/page-fingerprint",
|
|
"version": "0.2.1",
|
|
"description": "Check for suspected model substitution with numeric response fingerprints in Magpie, powered by lm-detector.",
|
|
"type": "module",
|
|
"license": "MIT",
|
|
"main": "dist/plugin.js",
|
|
"files": [
|
|
"dist",
|
|
"page",
|
|
"README.md",
|
|
"README.zh-CN.md",
|
|
"LICENSE",
|
|
"integration.md",
|
|
"THIRD_PARTY_NOTICES.md"
|
|
],
|
|
"engines": {
|
|
"bun": ">=1.4.2"
|
|
},
|
|
"scripts": {
|
|
"dev": "bun --watch src/cli.ts",
|
|
"start": "bun src/cli.ts",
|
|
"build": "bun scripts/build.ts",
|
|
"typecheck": "tsc --noEmit",
|
|
"test": "bun test",
|
|
"check": "bun run typecheck && bun run test && bun run build",
|
|
"format": "prettier --write src web scripts tests page *.json *.ts *.md",
|
|
"rebuild": "bun scripts/rebuild.ts"
|
|
},
|
|
"magpie": {
|
|
"page": {
|
|
"title": "Fingerprint",
|
|
"titles": {
|
|
"zh": "模型指纹",
|
|
"zh-TW": "模型指紋",
|
|
"ja": "モデル指紋",
|
|
"de": "Modell-Fingerabdruck"
|
|
},
|
|
"file": "page/index.html",
|
|
"service": {
|
|
"port": 3488,
|
|
"option": "port"
|
|
}
|
|
},
|
|
"actions": [
|
|
{
|
|
"id": "fingerprint",
|
|
"menu": "provider",
|
|
"title": "Fingerprint",
|
|
"titles": {
|
|
"zh": "检测指纹",
|
|
"zh-TW": "檢測指紋",
|
|
"ja": "指紋を検査",
|
|
"de": "Fingerabdruck prüfen"
|
|
}
|
|
}
|
|
],
|
|
"options": {
|
|
"port": 3488
|
|
},
|
|
"permissions": []
|
|
},
|
|
"devDependencies": {
|
|
"react": "19.3.1",
|
|
"react-dom": "19.3.1",
|
|
"@phosphor-icons/react": "2.1.10",
|
|
"@types/bun": "1.4.4",
|
|
"@types/react": "19.3.0",
|
|
"@types/react-dom": "19.3.0",
|
|
"@vitejs/plugin-react": "5.2.0",
|
|
"prettier": "3.9.10",
|
|
"typescript": "5.9.3",
|
|
"vite": "7.3.7"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/magpie-community/plugins.git",
|
|
"directory": "packages/fingerprint"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/magpie-community/plugins/issues"
|
|
},
|
|
"author": "KaranocaVe (https://github.com/KaranocaVe)",
|
|
"homepage": "https://github.com/KaranocaVe/magpie-fingerprint#readme",
|
|
"keywords": [
|
|
"magpie",
|
|
"magpie-page",
|
|
"magpie-plugin",
|
|
"llm",
|
|
"fingerprint",
|
|
"model-detection"
|
|
],
|
|
"publishConfig": {
|
|
"access": "public"
|
|
},
|
|
"packageManager": "bun@1.4.4"
|
|
}
|