The OSINT investigator's workbench. One case, one folder, every tool. Local-first: your media and your investigations never leave your machine.
JavaScript
M0: skeleton — FastAPI backend, case workspace with entities, Svelte 5 shell
OsintMeThatdc0c8adf91ce
diff --git a/.gitignore b/.gitignoreindex 686d6eb..037a18a 100644--- a/.gitignore+++ b/.gitignore@@ -71,3 +71,10 @@ data/# Misc*.bak*.orig++# Ozimut build artifacts (frontend builds into the Python package)+src/ozimut/static/++# Claude Code+CLAUDE.md+.claude/diff --git a/README.md b/README.mdnew file mode 100644index 0000000..42583e9--- /dev/null+++ b/README.md@@ -0,0 +1,66 @@+# Ozimut++**The OSINT investigator's workbench.** One case, one folder, every tool.+Local-first: your media and your investigations never leave your machine.++Built for the open-source-investigation community — GeoConfirmed contributors,+journalists, researchers.++> Close Ozimut. Reopen the case six months later. Everything is there: the+> downloaded media, the annotated proofs, the entities and their links, the+> notes, the exports — in one plain folder you can zip, git, or share.++## v1 — Proof Studio++| Tool | What it does |+|------|--------------|+| **Media Library** | Import local files or download by URL (X, Telegram, TikTok, YouTube… via yt-dlp) → clean local file + metadata + SHA-256. |+| **Satellite** | Coordinates → imagery crop with crosshair and recorded provenance (provider, zoom, date, attribution). Esri World Imagery by default, bring-your-own-key providers supported. |+| **Proof Composer** | Compose panels side by side, annotate with colored shapes (same color = same feature), comments, legend → export `proof.png` + a re-editable spec. |+| **Post Composer** | Turn a proof into a publishable post: coordinates in all formats, plus code, attribution, character count. Copy-paste ready — Ozimut never posts for you. |++Every tool works **one-shot** (no setup, scratch session) or inside a **case**+— a plain directory holding the whole investigation.++## Install & run++```bash+pip install ozimut+ozimut # starts on http://127.0.0.1:8477 and opens your browser+```++From source:++```bash+git clone https://github.com/ozimut/ozimut && cd ozimut+python3 -m venv .venv && .venv/bin/pip install -e ".[dev]"+cd frontend && npm install && npm run build && cd ..+.venv/bin/ozimut+```++Frontend development (hot reload, proxied API):++```bash+.venv/bin/ozimut --no-browser & # backend on :8477+cd frontend && npm run dev # UI on :5173+```++## Principles++1. **Local-first, privacy-first** — no account, no telemetry, no upload; the+ server binds to `127.0.0.1` only.+2. **The case is the product** — plain JSON + media files, versionable,+ portable.+3. **One tab = one tool**, useful in 30 seconds.+4. **Orchestrator, not replacer** — integrate specialized services, don't clone+ them.+5. **Tools emit facts, the analyst decides** — no automated "magic button".+6. **Honest output** — every artifact records how it was produced.+7. **Free and open source** — no paid keys required, ever. Optional+ bring-your-own-key providers.++Full spec: [docs/SPEC.md](docs/SPEC.md).++## License++AGPL-3.0 (see [SPEC §9](docs/SPEC.md) — final confirmation pending).diff --git a/frontend/index.html b/frontend/index.htmlnew file mode 100644index 0000000..aeaf123--- /dev/null+++ b/frontend/index.html@@ -0,0 +1,13 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>Ozimut</title>+ <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='14' fill='%230e1420'/%3E%3Cpath d='M16 4 L19 16 L16 28 L13 16 Z' fill='%23e8a33d'/%3E%3Ccircle cx='16' cy='16' r='2.5' fill='%23e6edf3'/%3E%3C/svg%3E" />+ </head>+ <body>+ <div id="app"></div>+ <script type="module" src="/src/main.js"></script>+ </body>+</html>diff --git a/frontend/package-lock.json b/frontend/package-lock.jsonnew file mode 100644index 0000000..12eddac--- /dev/null+++ b/frontend/package-lock.json@@ -0,0 +1,1328 @@+{+ "name": "ozimut-frontend",+ "version": "0.1.0",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "ozimut-frontend",+ "version": "0.1.0",+ "dependencies": {+ "konva": "^9.3.0",+ "leaflet": "^1.9.4"+ },+ "devDependencies": {+ "@sveltejs/vite-plugin-svelte": "^4.0.0",+ "svelte": "^5.0.0",+ "vite": "^5.4.0"+ }+ },+ "node_modules/@esbuild/aix-ppc64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz",+ "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "aix"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/android-arm": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz",+ "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/android-arm64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz",+ "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/android-x64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz",+ "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/darwin-arm64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz",+ "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/darwin-x64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz",+ "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/freebsd-arm64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz",+ "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/freebsd-x64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz",+ "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-arm": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz",+ "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-arm64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz",+ "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-ia32": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz",+ "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-loong64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz",+ "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-mips64el": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz",+ "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==",+ "cpu": [+ "mips64el"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-ppc64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz",+ "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-riscv64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz",+ "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-s390x": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz",+ "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/linux-x64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz",+ "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/netbsd-x64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz",+ "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/openbsd-x64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz",+ "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/sunos-x64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz",+ "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "sunos"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/win32-arm64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz",+ "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/win32-ia32": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz",+ "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@esbuild/win32-x64": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz",+ "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@jridgewell/gen-mapping": {+ "version": "0.3.13",+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",+ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/sourcemap-codec": "^1.5.0",+ "@jridgewell/trace-mapping": "^0.3.24"+ }+ },+ "node_modules/@jridgewell/remapping": {+ "version": "2.3.5",+ "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",+ "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/gen-mapping": "^0.3.5",+ "@jridgewell/trace-mapping": "^0.3.24"+ }+ },+ "node_modules/@jridgewell/resolve-uri": {+ "version": "3.1.2",+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.0.0"+ }+ },+ "node_modules/@jridgewell/sourcemap-codec": {+ "version": "1.5.5",+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@jridgewell/trace-mapping": {+ "version": "0.3.31",+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/resolve-uri": "^3.1.0",+ "@jridgewell/sourcemap-codec": "^1.4.14"+ }+ },+ "node_modules/@rollup/rollup-android-arm-eabi": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.2.tgz",+ "integrity": "sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ]+ },+ "node_modules/@rollup/rollup-android-arm64": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.2.tgz",+ "integrity": "sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ]+ },+ "node_modules/@rollup/rollup-darwin-arm64": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.2.tgz",+ "integrity": "sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ]+ },+ "node_modules/@rollup/rollup-darwin-x64": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz",+ "integrity": "sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ]+ },+ "node_modules/@rollup/rollup-freebsd-arm64": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.2.tgz",+ "integrity": "sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ]+ },+ "node_modules/@rollup/rollup-freebsd-x64": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.2.tgz",+ "integrity": "sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ]+ },+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.2.tgz",+ "integrity": "sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.2.tgz",+ "integrity": "sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-arm64-gnu": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.2.tgz",+ "integrity": "sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-arm64-musl": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.2.tgz",+ "integrity": "sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-loong64-gnu": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.2.tgz",+ "integrity": "sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-loong64-musl": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.2.tgz",+ "integrity": "sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-ppc64-gnu": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.2.tgz",+ "integrity": "sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-ppc64-musl": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.2.tgz",+ "integrity": "sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.2.tgz",+ "integrity": "sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-riscv64-musl": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.2.tgz",+ "integrity": "sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-s390x-gnu": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.2.tgz",+ "integrity": "sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-x64-gnu": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.2.tgz",+ "integrity": "sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-linux-x64-musl": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.2.tgz",+ "integrity": "sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/@rollup/rollup-openbsd-x64": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.2.tgz",+ "integrity": "sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openbsd"+ ]+ },+ "node_modules/@rollup/rollup-openharmony-arm64": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz",+ "integrity": "sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ]+ },+ "node_modules/@rollup/rollup-win32-arm64-msvc": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.2.tgz",+ "integrity": "sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@rollup/rollup-win32-ia32-msvc": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.2.tgz",+ "integrity": "sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@rollup/rollup-win32-x64-gnu": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.2.tgz",+ "integrity": "sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@rollup/rollup-win32-x64-msvc": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.2.tgz",+ "integrity": "sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/@sveltejs/acorn-typescript": {+ "version": "1.0.11",+ "resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.11.tgz",+ "integrity": "sha512-LFuZUkjJ9iF7JZye/aG5XM0SFcQ5VyL0oVX4WJ9dc0Va3R3s0OauX1BESVCb+YN/ol8TAfqGDDAQsTG627Y5kw==",+ "dev": true,+ "license": "MIT",+ "peerDependencies": {+ "acorn": "^8.9.0"+ }+ },+ "node_modules/@sveltejs/vite-plugin-svelte": {+ "version": "4.0.4",+ "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-4.0.4.tgz",+ "integrity": "sha512-0ba1RQ/PHen5FGpdSrW7Y3fAMQjrXantECALeOiOdBdzR5+5vPP6HVZRLmZaQL+W8m++o+haIAKq5qT+MiZ7VA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@sveltejs/vite-plugin-svelte-inspector": "^3.0.0-next.0||^3.0.0",+ "debug": "^4.3.7",+ "deepmerge": "^4.3.1",+ "kleur": "^4.1.5",+ "magic-string": "^0.30.12",+ "vitefu": "^1.0.3"+ },+ "engines": {+ "node": "^18.0.0 || ^20.0.0 || >=22"+ },+ "peerDependencies": {+ "svelte": "^5.0.0-next.96 || ^5.0.0",+ "vite": "^5.0.0"+ }+ },+ "node_modules/@sveltejs/vite-plugin-svelte-inspector": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-3.0.1.tgz",+ "integrity": "sha512-2CKypmj1sM4GE7HjllT7UKmo4Q6L5xFRd7VMGEWhYnZ+wc6AUVU01IBd7yUi6WnFndEwWoMNOd6e8UjoN0nbvQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "debug": "^4.3.7"+ },+ "engines": {+ "node": "^18.0.0 || ^20.0.0 || >=22"+ },+ "peerDependencies": {+ "@sveltejs/vite-plugin-svelte": "^4.0.0-next.0||^4.0.0",+ "svelte": "^5.0.0-next.96 || ^5.0.0",+ "vite": "^5.0.0"+ }+ },+ "node_modules/@types/estree": {+ "version": "1.0.9",+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",+ "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@types/trusted-types": {+ "version": "2.0.7",+ "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",+ "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/acorn": {+ "version": "8.17.0",+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz",+ "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "acorn": "bin/acorn"+ },+ "engines": {+ "node": ">=0.4.0"+ }+ },+ "node_modules/aria-query": {+ "version": "5.3.1",+ "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.1.tgz",+ "integrity": "sha512-Z/ZeOgVl7bcSYZ/u/rh0fOpvEpq//LZmdbkXyc7syVzjPAhfOa9ebsdTSjEBDU4vs5nC98Kfduj1uFo0qyET3g==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/axobject-query": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz",+ "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">= 0.4"+ }+ },+ "node_modules/clsx": {+ "version": "2.1.1",+ "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",+ "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/debug": {+ "version": "4.4.3",+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ms": "^2.1.3"+ },+ "engines": {+ "node": ">=6.0"+ },+ "peerDependenciesMeta": {+ "supports-color": {+ "optional": true+ }+ }+ },+ "node_modules/deepmerge": {+ "version": "4.3.1",+ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",+ "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/devalue": {+ "version": "5.8.1",+ "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.8.1.tgz",+ "integrity": "sha512-4CXDYRBGqN+57wVJkuXBYmpAVUSg3L6JAQa/DFqm238G73E1wuyc/JhGQJzN7vUf/CMphYau2zXbfWzDR5aTEw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/esbuild": {+ "version": "0.21.5",+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz",+ "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "bin": {+ "esbuild": "bin/esbuild"+ },+ "engines": {+ "node": ">=12"+ },+ "optionalDependencies": {+ "@esbuild/aix-ppc64": "0.21.5",+ "@esbuild/android-arm": "0.21.5",+ "@esbuild/android-arm64": "0.21.5",+ "@esbuild/android-x64": "0.21.5",+ "@esbuild/darwin-arm64": "0.21.5",+ "@esbuild/darwin-x64": "0.21.5",+ "@esbuild/freebsd-arm64": "0.21.5",+ "@esbuild/freebsd-x64": "0.21.5",+ "@esbuild/linux-arm": "0.21.5",+ "@esbuild/linux-arm64": "0.21.5",+ "@esbuild/linux-ia32": "0.21.5",+ "@esbuild/linux-loong64": "0.21.5",+ "@esbuild/linux-mips64el": "0.21.5",+ "@esbuild/linux-ppc64": "0.21.5",+ "@esbuild/linux-riscv64": "0.21.5",+ "@esbuild/linux-s390x": "0.21.5",+ "@esbuild/linux-x64": "0.21.5",+ "@esbuild/netbsd-x64": "0.21.5",+ "@esbuild/openbsd-x64": "0.21.5",+ "@esbuild/sunos-x64": "0.21.5",+ "@esbuild/win32-arm64": "0.21.5",+ "@esbuild/win32-ia32": "0.21.5",+ "@esbuild/win32-x64": "0.21.5"+ }+ },+ "node_modules/esm-env": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz",+ "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/esrap": {+ "version": "2.2.13",+ "resolved": "https://registry.npmjs.org/esrap/-/esrap-2.2.13.tgz",+ "integrity": "sha512-m8jH5hZgJE2RRUK/jjkGPcJEDAV+dYnZYFkosQaPTcE+Yw4xynXHOo6FUdwaWBtdR3b1MMa7wEDTSHeR2VWsGA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/sourcemap-codec": "^1.4.15"+ },+ "peerDependencies": {+ "@typescript-eslint/types": "^8.2.0"+ },+ "peerDependenciesMeta": {+ "@typescript-eslint/types": {+ "optional": true+ }+ }+ },+ "node_modules/fsevents": {+ "version": "2.3.3",+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"+ }+ },+ "node_modules/is-reference": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz",+ "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/estree": "^1.0.6"+ }+ },+ "node_modules/kleur": {+ "version": "4.1.5",+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",+ "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/konva": {+ "version": "9.3.22",+ "resolved": "https://registry.npmjs.org/konva/-/konva-9.3.22.tgz",+ "integrity": "sha512-yQI5d1bmELlD/fowuyfOp9ff+oamg26WOCkyqUyc+nczD/lhRa3EvD2MZOoc4c1293TAubW9n34fSQLgSeEgSw==",+ "funding": [+ {+ "type": "patreon",+ "url": "https://www.patreon.com/lavrton"+ },+ {+ "type": "opencollective",+ "url": "https://opencollective.com/konva"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/lavrton"+ }+ ],+ "license": "MIT"+ },+ "node_modules/leaflet": {+ "version": "1.9.4",+ "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz",+ "integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==",+ "license": "BSD-2-Clause"+ },+ "node_modules/locate-character": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz",+ "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/magic-string": {+ "version": "0.30.21",+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",+ "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/sourcemap-codec": "^1.5.5"+ }+ },+ "node_modules/ms": {+ "version": "2.1.3",+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/nanoid": {+ "version": "3.3.15",+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.15.tgz",+ "integrity": "sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "bin": {+ "nanoid": "bin/nanoid.cjs"+ },+ "engines": {+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"+ }+ },+ "node_modules/picocolors": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/postcss": {+ "version": "8.5.16",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.16.tgz",+ "integrity": "sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/postcss/"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/postcss"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "nanoid": "^3.3.12",+ "picocolors": "^1.1.1",+ "source-map-js": "^1.2.1"+ },+ "engines": {+ "node": "^10 || ^12 || >=14"+ }+ },+ "node_modules/rollup": {+ "version": "4.62.2",+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz",+ "integrity": "sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@types/estree": "1.0.9"+ },+ "bin": {+ "rollup": "dist/bin/rollup"+ },+ "engines": {+ "node": ">=18.0.0",+ "npm": ">=8.0.0"+ },+ "optionalDependencies": {+ "@rollup/rollup-android-arm-eabi": "4.62.2",+ "@rollup/rollup-android-arm64": "4.62.2",+ "@rollup/rollup-darwin-arm64": "4.62.2",+ "@rollup/rollup-darwin-x64": "4.62.2",+ "@rollup/rollup-freebsd-arm64": "4.62.2",+ "@rollup/rollup-freebsd-x64": "4.62.2",+ "@rollup/rollup-linux-arm-gnueabihf": "4.62.2",+ "@rollup/rollup-linux-arm-musleabihf": "4.62.2",+ "@rollup/rollup-linux-arm64-gnu": "4.62.2",+ "@rollup/rollup-linux-arm64-musl": "4.62.2",+ "@rollup/rollup-linux-loong64-gnu": "4.62.2",+ "@rollup/rollup-linux-loong64-musl": "4.62.2",+ "@rollup/rollup-linux-ppc64-gnu": "4.62.2",+ "@rollup/rollup-linux-ppc64-musl": "4.62.2",+ "@rollup/rollup-linux-riscv64-gnu": "4.62.2",+ "@rollup/rollup-linux-riscv64-musl": "4.62.2",+ "@rollup/rollup-linux-s390x-gnu": "4.62.2",+ "@rollup/rollup-linux-x64-gnu": "4.62.2",+ "@rollup/rollup-linux-x64-musl": "4.62.2",+ "@rollup/rollup-openbsd-x64": "4.62.2",+ "@rollup/rollup-openharmony-arm64": "4.62.2",+ "@rollup/rollup-win32-arm64-msvc": "4.62.2",+ "@rollup/rollup-win32-ia32-msvc": "4.62.2",+ "@rollup/rollup-win32-x64-gnu": "4.62.2",+ "@rollup/rollup-win32-x64-msvc": "4.62.2",+ "fsevents": "~2.3.2"+ }+ },+ "node_modules/source-map-js": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",+ "dev": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/svelte": {+ "version": "5.56.4",+ "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.56.4.tgz",+ "integrity": "sha512-/d0QHehmRuJW8gVz395MTkPcPozxzdjBMBE8oEYGz8O3b9KTMzzQ9ZHJQLuFKOHOPQbU6kx/X4iid/EBBzH7iw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/remapping": "^2.3.4",+ "@jridgewell/sourcemap-codec": "^1.5.0",+ "@sveltejs/acorn-typescript": "^1.0.10",+ "@types/estree": "^1.0.5",+ "@types/trusted-types": "^2.0.7",+ "acorn": "^8.12.1",+ "aria-query": "5.3.1",+ "axobject-query": "^4.1.0",+ "clsx": "^2.1.1",+ "devalue": "^5.8.1",+ "esm-env": "^1.2.1",+ "esrap": "^2.2.12",+ "is-reference": "^3.0.3",+ "locate-character": "^3.0.0",+ "magic-string": "^0.30.11",+ "zimmerframe": "^1.1.2"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/vite": {+ "version": "5.4.21",+ "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz",+ "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "esbuild": "^0.21.3",+ "postcss": "^8.4.43",+ "rollup": "^4.20.0"+ },+ "bin": {+ "vite": "bin/vite.js"+ },+ "engines": {+ "node": "^18.0.0 || >=20.0.0"+ },+ "funding": {+ "url": "https://github.com/vitejs/vite?sponsor=1"+ },+ "optionalDependencies": {+ "fsevents": "~2.3.3"+ },+ "peerDependencies": {+ "@types/node": "^18.0.0 || >=20.0.0",+ "less": "*",+ "lightningcss": "^1.21.0",+ "sass": "*",+ "sass-embedded": "*",+ "stylus": "*",+ "sugarss": "*",+ "terser": "^5.4.0"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ },+ "less": {+ "optional": true+ },+ "lightningcss": {+ "optional": true+ },+ "sass": {+ "optional": true+ },+ "sass-embedded": {+ "optional": true+ },+ "stylus": {+ "optional": true+ },+ "sugarss": {+ "optional": true+ },+ "terser": {+ "optional": true+ }+ }+ },+ "node_modules/vitefu": {+ "version": "1.1.3",+ "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.3.tgz",+ "integrity": "sha512-ub4okH7Z5KLjb6hDyjqrGXqWtWvoYdU3IGm/NorpgHncKoLTCfRIbvlhBm7r0YstIaQRYlp4yEbFqDcKSzXSSg==",+ "dev": true,+ "license": "MIT",+ "workspaces": [+ "tests/deps/*",+ "tests/projects/*",+ "tests/projects/workspace/packages/*"+ ],+ "peerDependencies": {+ "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"+ },+ "peerDependenciesMeta": {+ "vite": {+ "optional": true+ }+ }+ },+ "node_modules/zimmerframe": {+ "version": "1.1.4",+ "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.4.tgz",+ "integrity": "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==",+ "dev": true,+ "license": "MIT"+ }+ }+}diff --git a/frontend/package.json b/frontend/package.jsonnew file mode 100644index 0000000..b6fe3d3--- /dev/null+++ b/frontend/package.json@@ -0,0 +1,20 @@+{+ "name": "ozimut-frontend",+ "private": true,+ "version": "0.1.0",+ "type": "module",+ "scripts": {+ "dev": "vite",+ "build": "vite build",+ "preview": "vite preview"+ },+ "devDependencies": {+ "@sveltejs/vite-plugin-svelte": "^4.0.0",+ "svelte": "^5.0.0",+ "vite": "^5.4.0"+ },+ "dependencies": {+ "konva": "^9.3.0",+ "leaflet": "^1.9.4"+ }+}diff --git a/frontend/src/App.svelte b/frontend/src/App.sveltenew file mode 100644index 0000000..b9bbfc5--- /dev/null+++ b/frontend/src/App.svelte@@ -0,0 +1,161 @@+<script>+ import { uiState, refreshCaseList } from './lib/state.svelte.js';+ import Icon from './components/Icon.svelte';+ import CaseSwitcher from './components/CaseSwitcher.svelte';+ import CaseSidebar from './components/CaseSidebar.svelte';+ import Toasts from './components/Toasts.svelte';+ import MediaLibrary from './tools/MediaLibrary.svelte';+ import Satellite from './tools/Satellite.svelte';+ import ProofComposer from './tools/ProofComposer.svelte';+ import PostComposer from './tools/PostComposer.svelte';++ const TOOLS = [+ { id: 'media', label: 'Media', icon: 'media', component: MediaLibrary },+ { id: 'satellite', label: 'Satellite', icon: 'satellite', component: Satellite },+ { id: 'proof', label: 'Proof', icon: 'proof', component: ProofComposer },+ { id: 'post', label: 'Post', icon: 'post', component: PostComposer },+ ];++ const ActiveTool = $derived(TOOLS.find((t) => t.id === uiState.tool)?.component ?? MediaLibrary);++ refreshCaseList().catch(() => {});+</script>++<div class="shell">+ <header class="topbar">+ <div class="brand">+ <svg width="22" height="22" viewBox="0 0 32 32" aria-hidden="true">+ <circle cx="16" cy="16" r="14" fill="var(--bg-2)" stroke="var(--border-strong)" />+ <path d="M16 4 L19 16 L16 28 L13 16 Z" fill="var(--accent)" />+ <circle cx="16" cy="16" r="2.5" fill="var(--text-1)" />+ </svg>+ <span class="brand-name">Ozimut</span>+ </div>+ <CaseSwitcher />+ <div class="spacer"></div>+ <span class="local-badge" title="Server bound to 127.0.0.1 — nothing leaves this machine">+ <span class="dot"></span> local only+ </span>+ <button+ class="btn btn-ghost btn-sm"+ title="Toggle case sidebar"+ onclick={() => (uiState.sidebarOpen = !uiState.sidebarOpen)}+ >+ <Icon name="panelRight" size={16} />+ </button>+ </header>++ <div class="main">+ <nav class="rail">+ {#each TOOLS as tool (tool.id)}+ <button+ class="rail-btn"+ class:active={uiState.tool === tool.id}+ onclick={() => (uiState.tool = tool.id)}+ title={tool.label}+ >+ <Icon name={tool.icon} size={21} />+ <span>{tool.label}</span>+ </button>+ {/each}+ </nav>++ <main class="canvas">+ <ActiveTool />+ </main>++ {#if uiState.sidebarOpen}+ <CaseSidebar />+ {/if}+ </div>+</div>++<Toasts />++<style>+ .shell {+ display: flex;+ flex-direction: column;+ height: 100%;+ }+ .topbar {+ height: var(--topbar-h);+ flex-shrink: 0;+ display: flex;+ align-items: center;+ gap: 16px;+ padding: 0 14px;+ border-bottom: 1px solid var(--border);+ background: var(--bg-1);+ }+ .brand {+ display: flex;+ align-items: center;+ gap: 9px;+ padding-right: 6px;+ }+ .brand-name {+ font-weight: 800;+ letter-spacing: 0.02em;+ font-size: var(--fs-lg);+ }+ .spacer {+ flex: 1;+ }+ .local-badge {+ display: flex;+ align-items: center;+ gap: 6px;+ font-size: var(--fs-xs);+ font-weight: 600;+ color: var(--text-3);+ user-select: none;+ }+ .dot {+ width: 7px;+ height: 7px;+ border-radius: 50%;+ background: var(--ok);+ box-shadow: 0 0 6px var(--ok);+ }+ .main {+ flex: 1;+ display: flex;+ min-height: 0;+ }+ .rail {+ width: var(--rail-w);+ flex-shrink: 0;+ display: flex;+ flex-direction: column;+ gap: 4px;+ padding: 10px 8px;+ border-right: 1px solid var(--border);+ background: var(--bg-1);+ }+ .rail-btn {+ display: flex;+ flex-direction: column;+ align-items: center;+ gap: 4px;+ padding: 10px 4px 8px;+ border-radius: var(--r-md);+ color: var(--text-3);+ font-size: var(--fs-xs);+ font-weight: 600;+ transition: background 0.15s var(--ease), color 0.15s var(--ease);+ }+ .rail-btn:hover {+ color: var(--text-1);+ background: var(--bg-2);+ }+ .rail-btn.active {+ color: var(--accent);+ background: var(--accent-soft);+ }+ .canvas {+ flex: 1;+ min-width: 0;+ background: var(--bg-0);+ }+</style>diff --git a/frontend/src/app.css b/frontend/src/app.cssnew file mode 100644index 0000000..e4d0a1f--- /dev/null+++ b/frontend/src/app.css@@ -0,0 +1,358 @@+/* ============================================================+ Ozimut design system — dark, focused, an investigator's desk.+ Every component consumes these tokens; no hardcoded colors.+ ============================================================ */++:root {+ /* -- palette ------------------------------------------------ */+ --bg-0: #0b0f17; /* app background (deep night) */+ --bg-1: #101623; /* panels, sidebar */+ --bg-2: #161e2e; /* raised: cards, inputs */+ --bg-3: #1d2739; /* hover states, active rows */+ --border: rgba(148, 163, 196, 0.14);+ --border-strong: rgba(148, 163, 196, 0.28);++ --text-1: #e8edf6; /* primary text */+ --text-2: #9aa7bd; /* secondary text */+ --text-3: #5d6b84; /* hints, placeholders */++ --accent: #e8a33d; /* azimuth amber */+ --accent-hover: #f4b558;+ --accent-soft: rgba(232, 163, 61, 0.14);+ --accent-text: #0b0f17; /* text on accent */++ --ok: #4ade80;+ --ok-soft: rgba(74, 222, 128, 0.12);+ --warn: #fbbf24;+ --danger: #f87171;+ --danger-soft: rgba(248, 113, 113, 0.12);+ --info: #60a5fa;+ --info-soft: rgba(96, 165, 250, 0.12);++ /* annotation palette — high-contrast on both photo & satellite */+ --anno-1: #ff5252;+ --anno-2: #40c4ff;+ --anno-3: #ffd740;+ --anno-4: #69f0ae;+ --anno-5: #e040fb;+ --anno-6: #ff9e40;++ /* -- typography --------------------------------------------- */+ --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,+ "Helvetica Neue", Arial, sans-serif;+ --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono",+ Menlo, Consolas, monospace;++ --fs-xs: 0.72rem;+ --fs-sm: 0.8rem;+ --fs-md: 0.9rem;+ --fs-lg: 1.05rem;+ --fs-xl: 1.35rem;++ /* -- geometry ------------------------------------------------ */+ --r-sm: 6px;+ --r-md: 10px;+ --r-lg: 14px;+ --rail-w: 76px;+ --sidebar-w: 320px;+ --topbar-h: 52px;++ --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.4);+ --shadow-2: 0 8px 28px rgba(0, 0, 0, 0.5);++ --ease: cubic-bezier(0.25, 0.7, 0.3, 1);++ color-scheme: dark;+}++/* -- reset ------------------------------------------------------ */+*,+*::before,+*::after {+ box-sizing: border-box;+}++html,+body {+ margin: 0;+ height: 100%;+ overflow: hidden;+}++body {+ font-family: var(--font-sans);+ font-size: var(--fs-md);+ line-height: 1.5;+ color: var(--text-1);+ background: var(--bg-0);+ -webkit-font-smoothing: antialiased;+}++#app {+ height: 100%;+}++h1, h2, h3, h4, p {+ margin: 0;+}++button {+ font: inherit;+ color: inherit;+ background: none;+ border: none;+ padding: 0;+ cursor: pointer;+}++input,+textarea,+select {+ font: inherit;+}++img {+ max-width: 100%;+ display: block;+}++a {+ color: var(--info);+ text-decoration: none;+}+a:hover {+ text-decoration: underline;+}++::selection {+ background: var(--accent-soft);+}++/* -- scrollbars -------------------------------------------------- */+* {+ scrollbar-width: thin;+ scrollbar-color: var(--bg-3) transparent;+}+*::-webkit-scrollbar {+ width: 10px;+ height: 10px;+}+*::-webkit-scrollbar-thumb {+ background: var(--bg-3);+ border-radius: 5px;+ border: 2px solid var(--bg-0);+}+*::-webkit-scrollbar-track {+ background: transparent;+}++/* ============================================================+ Shared primitives — used across every tool for consistency.+ ============================================================ */++.btn {+ display: inline-flex;+ align-items: center;+ gap: 7px;+ padding: 7px 14px;+ border-radius: var(--r-sm);+ font-size: var(--fs-sm);+ font-weight: 600;+ letter-spacing: 0.01em;+ background: var(--bg-2);+ border: 1px solid var(--border);+ color: var(--text-1);+ transition: background 0.15s var(--ease), border-color 0.15s var(--ease),+ transform 0.1s var(--ease);+ white-space: nowrap;+ user-select: none;+}+.btn:hover:not(:disabled) {+ background: var(--bg-3);+ border-color: var(--border-strong);+}+.btn:active:not(:disabled) {+ transform: translateY(1px);+}+.btn:disabled {+ opacity: 0.45;+ cursor: not-allowed;+}++.btn-primary {+ background: var(--accent);+ border-color: transparent;+ color: var(--accent-text);+}+.btn-primary:hover:not(:disabled) {+ background: var(--accent-hover);+ border-color: transparent;+}++.btn-danger {+ color: var(--danger);+}+.btn-danger:hover:not(:disabled) {+ background: var(--danger-soft);+ border-color: var(--danger);+}++.btn-ghost {+ background: transparent;+ border-color: transparent;+ color: var(--text-2);+}+.btn-ghost:hover:not(:disabled) {+ background: var(--bg-2);+ color: var(--text-1);+}++.btn-sm {+ padding: 4px 9px;+ font-size: var(--fs-xs);+}++.input,+.textarea,+.select {+ width: 100%;+ padding: 8px 11px;+ border-radius: var(--r-sm);+ background: var(--bg-2);+ border: 1px solid var(--border);+ color: var(--text-1);+ font-size: var(--fs-sm);+ transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);+}+.input::placeholder,+.textarea::placeholder {+ color: var(--text-3);+}+.input:focus,+.textarea:focus,+.select:focus {+ outline: none;+ border-color: var(--accent);+ box-shadow: 0 0 0 3px var(--accent-soft);+}+.textarea {+ resize: vertical;+ min-height: 72px;+ line-height: 1.55;+}++.mono {+ font-family: var(--font-mono);+ font-size: 0.92em;+}++.label {+ display: block;+ font-size: var(--fs-xs);+ font-weight: 600;+ text-transform: uppercase;+ letter-spacing: 0.07em;+ color: var(--text-3);+ margin-bottom: 5px;+}++.card {+ background: var(--bg-1);+ border: 1px solid var(--border);+ border-radius: var(--r-md);+}++.badge {+ display: inline-flex;+ align-items: center;+ gap: 4px;+ padding: 2px 8px;+ border-radius: 99px;+ font-size: var(--fs-xs);+ font-weight: 600;+ background: var(--bg-3);+ color: var(--text-2);+}+.badge.accent {+ background: var(--accent-soft);+ color: var(--accent);+}+.badge.ok {+ background: var(--ok-soft);+ color: var(--ok);+}+.badge.info {+ background: var(--info-soft);+ color: var(--info);+}+.badge.danger {+ background: var(--danger-soft);+ color: var(--danger);+}++/* Empty states — every tool has one, they must feel designed. */+.empty {+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ gap: 10px;+ padding: 48px 24px;+ color: var(--text-3);+ text-align: center;+}+.empty .empty-icon {+ opacity: 0.5;+}+.empty h3 {+ color: var(--text-2);+ font-size: var(--fs-lg);+ font-weight: 600;+}+.empty p {+ font-size: var(--fs-sm);+ max-width: 380px;+}++/* Tool page scaffold */+.tool {+ display: flex;+ flex-direction: column;+ height: 100%;+ min-width: 0;+}+.tool-header {+ display: flex;+ align-items: center;+ gap: 12px;+ padding: 14px 20px 12px;+ border-bottom: 1px solid var(--border);+}+.tool-header h2 {+ font-size: var(--fs-lg);+ font-weight: 700;+ letter-spacing: -0.01em;+}+.tool-header .sub {+ font-size: var(--fs-sm);+ color: var(--text-3);+}+.tool-body {+ flex: 1;+ min-height: 0;+ overflow: auto;+}++@keyframes fade-up {+ from {+ opacity: 0;+ transform: translateY(6px);+ }+ to {+ opacity: 1;+ transform: none;+ }+}+.fade-up {+ animation: fade-up 0.22s var(--ease);+}diff --git a/frontend/src/components/CaseSidebar.svelte b/frontend/src/components/CaseSidebar.sveltenew file mode 100644index 0000000..ccb0a3c--- /dev/null+++ b/frontend/src/components/CaseSidebar.svelte@@ -0,0 +1,256 @@+<script>+ import { api } from '../lib/api.js';+ import { caseState, reloadCase, toast } from '../lib/state.svelte.js';+ import Icon from './Icon.svelte';++ const ENTITY_ICONS = {+ person: 'user',+ organization: 'layers',+ alias: 'user',+ account: 'globe',+ email: 'note',+ phone: 'hash',+ place: 'pin',+ event: 'clock',+ media: 'image',+ proof: 'proof',+ domain: 'globe',+ ip: 'hash',+ vehicle: 'grip',+ note: 'note',+ };++ let notes = $state('');+ let notesLoadedFor = $state(null);+ let saveTimer;+ let saved = $state(true);+ let section = $state({ notes: true, entities: true });++ $effect(() => {+ const id = caseState.current?.id;+ if (id && id !== notesLoadedFor) {+ notesLoadedFor = id;+ api.get(`/api/cases/${id}/notes`).then((r) => (notes = r.text));+ } else if (!id) {+ notesLoadedFor = null;+ notes = '';+ }+ });++ function onNotesInput() {+ saved = false;+ clearTimeout(saveTimer);+ const id = caseState.current?.id;+ saveTimer = setTimeout(async () => {+ if (!id) return;+ try {+ await api.put(`/api/cases/${id}/notes`, { text: notes });+ saved = true;+ } catch (e) {+ toast(`Notes not saved: ${e.message}`, 'danger');+ }+ }, 700);+ }++ async function confirmEntity(entity) {+ await api.patch(`/api/cases/${caseState.current.id}/entities/${entity.id}`, {+ status: 'confirmed',+ });+ await reloadCase();+ }++ async function removeEntity(entity) {+ await api.del(`/api/cases/${caseState.current.id}/entities/${entity.id}`);+ await reloadCase();+ toast(`Removed “${entity.label}”`, 'info');+ }++ const entities = $derived(caseState.current?.entities ?? []);+ const suggested = $derived(entities.filter((e) => e.provenance?.status === 'suggested'));+ const confirmed = $derived(entities.filter((e) => e.provenance?.status !== 'suggested'));+</script>++<aside class="sidebar">+ {#if !caseState.current}+ <div class="empty">+ <div class="empty-icon"><Icon name="folder" size={34} /></div>+ <h3>No case open</h3>+ <p>+ Use any tool right away — a scratch session is created when needed. Open or create a case+ to keep an investigation together.+ </p>+ </div>+ {:else}+ <div class="case-head">+ <h3>{caseState.current.name}</h3>+ <span class="path mono">{caseState.current.id}</span>+ </div>++ <div class="sections">+ <!-- Notes -->+ <button class="section-head" onclick={() => (section.notes = !section.notes)}>+ <Icon name={section.notes ? 'chevronDown' : 'chevronRight'} size={13} />+ <span>Notes</span>+ {#if !saved}<span class="badge">saving…</span>{/if}+ </button>+ {#if section.notes}+ <textarea+ class="textarea notes mono"+ bind:value={notes}+ oninput={onNotesInput}+ placeholder="Case notes (markdown)…"+ ></textarea>+ {/if}++ <!-- Entities -->+ <button class="section-head" onclick={() => (section.entities = !section.entities)}>+ <Icon name={section.entities ? 'chevronDown' : 'chevronRight'} size={13} />+ <span>Entities</span>+ <span class="count">{entities.length}</span>+ </button>+ {#if section.entities}+ {#if suggested.length}+ <div class="suggest-note">Suggested by tools — confirm or dismiss:</div>+ {#each suggested as e (e.id)}+ <div class="entity suggested">+ <Icon name={ENTITY_ICONS[e.type] ?? 'note'} size={14} />+ <div class="e-body">+ <span class="e-label">{e.label}</span>+ <span class="e-type">{e.type} · by {e.provenance?.by}</span>+ </div>+ <button class="btn btn-ghost btn-sm" title="Confirm" onclick={() => confirmEntity(e)}>+ <Icon name="check" size={13} />+ </button>+ <button class="btn btn-ghost btn-sm" title="Dismiss" onclick={() => removeEntity(e)}>+ <Icon name="x" size={13} />+ </button>+ </div>+ {/each}+ {/if}+ {#each confirmed as e (e.id)}+ <div class="entity">+ <Icon name={ENTITY_ICONS[e.type] ?? 'note'} size={14} />+ <div class="e-body">+ <span class="e-label">{e.label}</span>+ <span class="e-type">{e.type}</span>+ </div>+ <button class="btn btn-ghost btn-sm del" title="Delete" onclick={() => removeEntity(e)}>+ <Icon name="trash" size={13} />+ </button>+ </div>+ {:else}+ {#if !suggested.length}+ <div class="none">Tools file entities here as you work.</div>+ {/if}+ {/each}+ {/if}+ </div>+ {/if}+</aside>++<style>+ .sidebar {+ width: var(--sidebar-w);+ flex-shrink: 0;+ border-left: 1px solid var(--border);+ background: var(--bg-1);+ display: flex;+ flex-direction: column;+ overflow: hidden;+ }+ .case-head {+ padding: 16px 16px 12px;+ border-bottom: 1px solid var(--border);+ }+ .case-head h3 {+ font-size: var(--fs-md);+ font-weight: 700;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .path {+ font-size: var(--fs-xs);+ color: var(--text-3);+ }+ .sections {+ flex: 1;+ overflow-y: auto;+ padding: 8px;+ }+ .section-head {+ display: flex;+ align-items: center;+ gap: 6px;+ width: 100%;+ padding: 8px 8px 6px;+ font-size: var(--fs-xs);+ font-weight: 700;+ text-transform: uppercase;+ letter-spacing: 0.07em;+ color: var(--text-2);+ }+ .section-head:hover {+ color: var(--text-1);+ }+ .count {+ margin-left: auto;+ color: var(--text-3);+ font-weight: 600;+ }+ .notes {+ min-height: 130px;+ font-size: var(--fs-xs);+ margin: 0 4px 10px;+ width: calc(100% - 8px);+ }+ .entity {+ display: flex;+ align-items: center;+ gap: 9px;+ padding: 6px 8px;+ border-radius: var(--r-sm);+ color: var(--text-2);+ }+ .entity:hover {+ background: var(--bg-2);+ }+ .entity.suggested {+ background: var(--accent-soft);+ border: 1px dashed var(--accent);+ margin-bottom: 4px;+ }+ .e-body {+ flex: 1;+ min-width: 0;+ display: flex;+ flex-direction: column;+ }+ .e-label {+ font-size: var(--fs-sm);+ color: var(--text-1);+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .e-type {+ font-size: var(--fs-xs);+ color: var(--text-3);+ }+ .del {+ opacity: 0;+ }+ .entity:hover .del {+ opacity: 1;+ }+ .suggest-note {+ font-size: var(--fs-xs);+ color: var(--accent);+ padding: 2px 8px 6px;+ }+ .none {+ font-size: var(--fs-xs);+ color: var(--text-3);+ padding: 4px 8px 12px;+ }+</style>diff --git a/frontend/src/components/CaseSwitcher.svelte b/frontend/src/components/CaseSwitcher.sveltenew file mode 100644index 0000000..4e2b62f--- /dev/null+++ b/frontend/src/components/CaseSwitcher.svelte@@ -0,0 +1,250 @@+<script>+ import {+ caseState,+ refreshCaseList,+ openCase,+ createCase,+ promoteCase,+ closeCase,+ toast,+ } from '../lib/state.svelte.js';+ import Icon from './Icon.svelte';+ import Modal from './Modal.svelte';++ let open = $state(false);+ let modal = $state(null); // 'create' | 'promote' | null+ let nameInput = $state('');+ let busy = $state(false);++ async function toggle() {+ open = !open;+ if (open) await refreshCaseList();+ }++ async function pick(id) {+ open = false;+ await openCase(id);+ }++ async function submit() {+ if (!nameInput.trim() || busy) return;+ busy = true;+ try {+ if (modal === 'create') {+ await createCase(nameInput.trim());+ toast(`Case “${nameInput.trim()}” created`, 'ok');+ } else if (modal === 'promote') {+ await promoteCase(nameInput.trim());+ }+ modal = null;+ nameInput = '';+ } catch (e) {+ toast(e.message, 'danger');+ } finally {+ busy = false;+ }+ }++ const named = $derived(caseState.list.filter((c) => !c.scratch));+ const scratches = $derived(caseState.list.filter((c) => c.scratch));+</script>++<div class="switcher">+ <button class="current" onclick={toggle} title="Switch case">+ <Icon name={caseState.current ? 'folderOpen' : 'folder'} size={16} />+ {#if caseState.current}+ <span class="name">{caseState.current.name}</span>+ {#if caseState.current.scratch}<span class="badge accent">scratch</span>{/if}+ {:else}+ <span class="name none">No case — one-shot mode</span>+ {/if}+ <Icon name="chevronDown" size={14} />+ </button>++ {#if caseState.current?.scratch}+ <button+ class="btn btn-primary btn-sm"+ onclick={() => {+ modal = 'promote';+ nameInput = '';+ }}+ >+ <Icon name="upload" size={13} /> Keep as case…+ </button>+ {/if}++ {#if open}+ <button class="backdrop" onclick={() => (open = false)} aria-label="Close menu"></button>+ <div class="menu card fade-up">+ <button+ class="item new"+ onclick={() => {+ open = false;+ modal = 'create';+ nameInput = '';+ }}+ >+ <Icon name="plus" size={15} /> New case…+ </button>+ {#if caseState.current}+ <button class="item" onclick={() => { closeCase(); open = false; }}>+ <Icon name="x" size={15} /> Close case (one-shot mode)+ </button>+ {/if}+ {#if named.length}+ <div class="section">Cases</div>+ {#each named as c (c.id)}+ <button class="item" class:active={c.id === caseState.current?.id} onclick={() => pick(c.id)}>+ <Icon name="folder" size={15} />+ <span class="grow">{c.name}</span>+ <span class="meta">{c.entity_count} entities</span>+ </button>+ {/each}+ {/if}+ {#if scratches.length}+ <div class="section">Scratch sessions</div>+ {#each scratches as c (c.id)}+ <button class="item" class:active={c.id === caseState.current?.id} onclick={() => pick(c.id)}>+ <Icon name="clock" size={15} />+ <span class="grow">{c.id}</span>+ </button>+ {/each}+ {/if}+ {#if !named.length && !scratches.length}+ <div class="hint">No cases yet — tools work without one.</div>+ {/if}+ </div>+ {/if}+</div>++{#if modal}+ <Modal+ title={modal === 'create' ? 'New case' : 'Keep this session as a case'}+ onclose={() => (modal = null)}+ >+ <form+ onsubmit={(e) => {+ e.preventDefault();+ submit();+ }}+ >+ <label class="label" for="case-name">Case name</label>+ <!-- svelte-ignore a11y_autofocus -->+ <input+ id="case-name"+ class="input"+ placeholder="e.g. Kharkiv strike — March 2026"+ bind:value={nameInput}+ autofocus+ />+ <div class="actions">+ <button type="button" class="btn" onclick={() => (modal = null)}>Cancel</button>+ <button type="submit" class="btn btn-primary" disabled={!nameInput.trim() || busy}>+ {modal === 'create' ? 'Create' : 'Promote'}+ </button>+ </div>+ </form>+ </Modal>+{/if}++<style>+ .switcher {+ position: relative;+ display: flex;+ align-items: center;+ gap: 10px;+ }+ .current {+ display: flex;+ align-items: center;+ gap: 8px;+ padding: 6px 12px;+ border-radius: var(--r-sm);+ color: var(--text-1);+ font-size: var(--fs-sm);+ font-weight: 600;+ border: 1px solid transparent;+ max-width: 380px;+ }+ .current:hover {+ background: var(--bg-2);+ border-color: var(--border);+ }+ .name {+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .name.none {+ color: var(--text-3);+ font-weight: 500;+ }+ .backdrop {+ position: fixed;+ inset: 0;+ z-index: 90;+ cursor: default;+ }+ .menu {+ position: absolute;+ top: calc(100% + 6px);+ left: 0;+ min-width: 300px;+ max-height: 420px;+ overflow: auto;+ z-index: 100;+ box-shadow: var(--shadow-2);+ padding: 6px;+ }+ .section {+ font-size: var(--fs-xs);+ font-weight: 700;+ text-transform: uppercase;+ letter-spacing: 0.07em;+ color: var(--text-3);+ padding: 10px 10px 4px;+ }+ .item {+ display: flex;+ align-items: center;+ gap: 9px;+ width: 100%;+ padding: 8px 10px;+ border-radius: var(--r-sm);+ font-size: var(--fs-sm);+ color: var(--text-1);+ text-align: left;+ }+ .item:hover {+ background: var(--bg-2);+ }+ .item.active {+ background: var(--accent-soft);+ color: var(--accent);+ }+ .item.new {+ color: var(--accent);+ font-weight: 600;+ }+ .grow {+ flex: 1;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .meta {+ font-size: var(--fs-xs);+ color: var(--text-3);+ }+ .hint {+ padding: 14px 10px;+ color: var(--text-3);+ font-size: var(--fs-sm);+ }+ .actions {+ display: flex;+ justify-content: flex-end;+ gap: 8px;+ margin-top: 16px;+ }+</style>diff --git a/frontend/src/components/Icon.svelte b/frontend/src/components/Icon.sveltenew file mode 100644index 0000000..5759f62--- /dev/null+++ b/frontend/src/components/Icon.svelte@@ -0,0 +1,67 @@+<script>+ /** Inline icon set (24×24, stroke-based, lucide-style). No external assets. */+ let { name, size = 18, stroke = 1.8 } = $props();++ const paths = {+ // navigation / tools+ media: 'M4 5h16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Zm0 11 4.5-4.5a1 1 0 0 1 1.4 0L14 15.5m-1.5-1.5 2.6-2.6a1 1 0 0 1 1.4 0L21 15M9 9.5h.01',+ satellite: 'M12 3a9 9 0 1 0 9 9M12 7a5 5 0 1 0 5 5m-5-1.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM17 3l4 4m0-4-4 4',+ proof: 'M4 4h7v7H4V4Zm9 0h7v7h-7V4ZM4 13h7v7H4v-7Zm11.5 0v7m-3.5-3.5h7',+ post: 'M20 4 9 15m11-11-6.5 17-2.7-7.5L3 10.5 20 4Z',+ // ui+ plus: 'M12 5v14m-7-7h14',+ folder: 'M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z',+ folderOpen: 'M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v1M3 7v11a2 2 0 0 0 2 2h13a2 2 0 0 0 2-1.5l1.6-6A1.5 1.5 0 0 0 20.1 10H6.4a2 2 0 0 0-1.9 1.4L3 16',+ x: 'M6 6l12 12M18 6 6 18',+ chevronRight: 'm9 6 6 6-6 6',+ chevronDown: 'm6 9 6 6 6-6',+ panelRight: 'M4 4h16a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Zm11 0v16',+ search: 'M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14Zm9 16-4.35-4.35',+ trash: 'M4 7h16m-2 0-1 13H7L6 7m3 0V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2m-6 4v6m4-6v6',+ download: 'M12 3v12m0 0 4-4m-4 4-4-4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2',+ upload: 'M12 15V3m0 0 4 4m-4-4-4 4M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2',+ link: 'M10 14a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7M14 10a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7',+ copy: 'M8 8h11a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Zm-4 8V4a1 1 0 0 1 1-1h12',+ check: 'm4.5 12.5 5 5 10-11',+ note: 'M6 3h9l5 5v13a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm8 0v6h6M9 13h6m-6 4h4',+ pin: 'M12 21s-7-6.1-7-11a7 7 0 0 1 14 0c0 4.9-7 11-7 11Zm0-8.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z',+ crosshair: 'M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm0-1v4m0 12v4M2 12h4m12 0h4',+ user: 'M12 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm-8 17c0-4 3.6-6.5 8-6.5s8 2.5 8 6.5',+ layers: 'm12 3 9 5-9 5-9-5 9-5Zm-9 9.5 9 5 9-5M3 17l9 5 9-5',+ video: 'M4 6h11a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Zm12 4 5-3v10l-5-3',+ image: 'M4 5h16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Zm2 12 4-4a1 1 0 0 1 1.4 0l4.6 4M9 9.5h.01',+ audio: 'M9 18V6l10-2v11.5M9 18a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Zm10-2.5a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z',+ file: 'M6 3h9l5 5v13a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm8 0v6h6',+ hash: 'M9 4 7 20M17 4l-2 16M4 9h17M3 15h17',+ globe: 'M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm-9 9h18M12 3c2.5 2.5 3.8 5.7 3.8 9S14.5 18.5 12 21c-2.5-2.5-3.8-5.7-3.8-9S9.5 5.5 12 3Z',+ settings: 'M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6Zm8.4 3a8.4 8.4 0 0 0-.1-1.2l2-1.5-2-3.5-2.4 1a8.5 8.5 0 0 0-2-1.2L15.5 3h-4l-.4 2.6a8.5 8.5 0 0 0-2 1.2l-2.4-1-2 3.5 2 1.5a8.6 8.6 0 0 0 0 2.4l-2 1.5 2 3.5 2.4-1a8.5 8.5 0 0 0 2 1.2l.4 2.6h4l.4-2.6a8.5 8.5 0 0 0 2-1.2l2.4 1 2-3.5-2-1.5c.1-.4.1-.8.1-1.2Z',+ compass: 'M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm3.5 5.5-2 5-5 2 2-5 5-2Z',+ arrowRight: 'M4 12h16m0 0-6-6m6 6-6 6',+ edit: 'M14 5.5 18.5 10M4 20l1-4.5L16.5 4a2.1 2.1 0 0 1 3 3L8 18.5 4 20Z',+ external: 'M14 4h6v6m0-6L10 14M9 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-3',+ grip: 'M9 6h.01M9 12h.01M9 18h.01M15 6h.01M15 12h.01M15 18h.01',+ alert: 'M12 3 2.5 19.5h19L12 3Zm0 7v4m0 3.5h.01',+ clock: 'M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm0 4v5l3.5 2',+ eye: 'M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Zm9.5-3a3 3 0 1 1 0 6 3 3 0 0 1 0-6Z',+ square: 'M5 5h14a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Z',+ circle: 'M12 4a8 8 0 1 1 0 16 8 8 0 0 1 0-16Z',+ line: 'M5 19 19 5',+ arrow: 'M5 19 19 5m0 0h-8m8 0v8',+ text: 'M5 6V4h14v2M12 4v16m-3 0h6',+ hand: 'M8 12V6a1.5 1.5 0 0 1 3 0v5m0-6.5a1.5 1.5 0 0 1 3 0V11m0-5a1.5 1.5 0 0 1 3 0v9a6 6 0 0 1-6 6h-1a6 6 0 0 1-5-2.7L3.5 15A1.6 1.6 0 0 1 6 13.2l2 1.8',+ };+</script>++<svg+ width={size}+ height={size}+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width={stroke}+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+>+ <path d={paths[name] ?? paths.alert} />+</svg>diff --git a/frontend/src/components/Modal.svelte b/frontend/src/components/Modal.sveltenew file mode 100644index 0000000..cc2d2c3--- /dev/null+++ b/frontend/src/components/Modal.svelte@@ -0,0 +1,62 @@+<script>+ import Icon from './Icon.svelte';++ let { title, onclose, width = '440px', children } = $props();++ function onkeydown(e) {+ if (e.key === 'Escape') onclose?.();+ }+</script>++<svelte:window {onkeydown} />++<div class="overlay" onclick={(e) => e.target === e.currentTarget && onclose?.()} role="presentation">+ <div class="modal fade-up" style:width role="dialog" aria-label={title}>+ <header>+ <h3>{title}</h3>+ <button class="btn btn-ghost btn-sm" onclick={onclose} aria-label="Close">+ <Icon name="x" size={15} />+ </button>+ </header>+ <div class="content">+ {@render children?.()}+ </div>+ </div>+</div>++<style>+ .overlay {+ position: fixed;+ inset: 0;+ background: rgba(4, 7, 12, 0.72);+ backdrop-filter: blur(3px);+ display: flex;+ align-items: center;+ justify-content: center;+ z-index: 900;+ }+ .modal {+ background: var(--bg-1);+ border: 1px solid var(--border-strong);+ border-radius: var(--r-lg);+ box-shadow: var(--shadow-2);+ max-width: calc(100vw - 40px);+ max-height: calc(100vh - 80px);+ display: flex;+ flex-direction: column;+ }+ header {+ display: flex;+ align-items: center;+ justify-content: space-between;+ padding: 14px 18px 10px;+ }+ h3 {+ font-size: var(--fs-lg);+ font-weight: 700;+ }+ .content {+ padding: 4px 18px 18px;+ overflow: auto;+ }+</style>diff --git a/frontend/src/components/Toasts.svelte b/frontend/src/components/Toasts.sveltenew file mode 100644index 0000000..b19cb38--- /dev/null+++ b/frontend/src/components/Toasts.svelte@@ -0,0 +1,55 @@+<script>+ import { uiState } from '../lib/state.svelte.js';+ import Icon from './Icon.svelte';++ const icons = { info: 'compass', ok: 'check', danger: 'alert', warn: 'alert' };+</script>++<div class="toasts">+ {#each uiState.toasts as t (t.id)}+ <div class="toast {t.kind} fade-up">+ <Icon name={icons[t.kind] ?? 'compass'} size={15} />+ <span>{t.message}</span>+ </div>+ {/each}+</div>++<style>+ .toasts {+ position: fixed;+ bottom: 18px;+ left: 50%;+ transform: translateX(-50%);+ display: flex;+ flex-direction: column;+ align-items: center;+ gap: 8px;+ z-index: 1000;+ pointer-events: none;+ }+ .toast {+ display: flex;+ align-items: center;+ gap: 9px;+ padding: 9px 16px;+ border-radius: var(--r-md);+ background: var(--bg-2);+ border: 1px solid var(--border-strong);+ box-shadow: var(--shadow-2);+ font-size: var(--fs-sm);+ font-weight: 500;+ max-width: 480px;+ }+ .toast.ok {+ border-color: var(--ok);+ color: var(--ok);+ }+ .toast.danger {+ border-color: var(--danger);+ color: var(--danger);+ }+ .toast.warn {+ border-color: var(--warn);+ color: var(--warn);+ }+</style>diff --git a/frontend/src/lib/api.js b/frontend/src/lib/api.jsnew file mode 100644index 0000000..eb4c5d6--- /dev/null+++ b/frontend/src/lib/api.js@@ -0,0 +1,40 @@+/** Thin fetch wrapper for the local Ozimut API. */++class ApiError extends Error {+ constructor(status, detail) {+ super(detail || `HTTP ${status}`);+ this.status = status;+ }+}++async function request(method, path, body, opts = {}) {+ const init = { method, headers: {} };+ if (body instanceof FormData) {+ init.body = body;+ } else if (body !== undefined) {+ init.headers['Content-Type'] = 'application/json';+ init.body = JSON.stringify(body);+ }+ const res = await fetch(path, { ...init, ...opts });+ if (!res.ok) {+ let detail = '';+ try {+ detail = (await res.json()).detail;+ } catch {+ /* non-json error body */+ }+ throw new ApiError(res.status, detail);+ }+ if (res.status === 204) return null;+ return res.json();+}++export const api = {+ get: (path) => request('GET', path),+ post: (path, body) => request('POST', path, body),+ put: (path, body) => request('PUT', path, body),+ patch: (path, body) => request('PATCH', path, body),+ del: (path) => request('DELETE', path),+};++export { ApiError };diff --git a/frontend/src/lib/state.svelte.js b/frontend/src/lib/state.svelte.jsnew file mode 100644index 0000000..e7b6fca--- /dev/null+++ b/frontend/src/lib/state.svelte.js@@ -0,0 +1,85 @@+/**+ * Global app state (Svelte 5 runes).+ *+ * `caseState.current` is the open case (or null). Tools read it to know where+ * to file their outputs; one-shot mode transparently creates a scratch case+ * on first write (see ensureCase).+ */+import { api } from './api.js';++export const caseState = $state({+ current: null, // { id, name, scratch, entities, links, ... }+ list: [],+ loading: false,+});++export const uiState = $state({+ tool: 'media', // 'media' | 'satellite' | 'proof' | 'post'+ sidebarOpen: true,+ toasts: [],+ // cross-tool handoffs (the workbench glue):+ composeQueue: [], // media paths queued for the Proof Composer+ postProof: null, // proof spec handed to the Post Composer+});++let toastSeq = 0;++export function toast(message, kind = 'info', timeout = 3800) {+ const id = ++toastSeq;+ uiState.toasts.push({ id, message, kind });+ setTimeout(() => {+ const i = uiState.toasts.findIndex((t) => t.id === id);+ if (i !== -1) uiState.toasts.splice(i, 1);+ }, timeout);+}++export async function refreshCaseList() {+ caseState.list = await api.get('/api/cases');+}++export async function openCase(id) {+ caseState.loading = true;+ try {+ caseState.current = await api.get(`/api/cases/${id}`);+ } finally {+ caseState.loading = false;+ }+}++export async function reloadCase() {+ if (caseState.current) {+ caseState.current = await api.get(`/api/cases/${caseState.current.id}`);+ }+}++export async function createCase(name) {+ const created = await api.post('/api/cases', { name });+ await refreshCaseList();+ await openCase(created.id);+ return created;+}++/**+ * One-shot mode: make sure some case exists to receive tool output.+ * Creates a scratch case silently if none is open (spec §3.3).+ */+export async function ensureCase() {+ if (caseState.current) return caseState.current;+ const scratch = await api.post('/api/cases/scratch');+ await refreshCaseList();+ await openCase(scratch.id);+ toast('Scratch session started — promote it to keep your work', 'info');+ return caseState.current;+}++export async function promoteCase(name) {+ if (!caseState.current?.scratch) return;+ const promoted = await api.post(`/api/cases/${caseState.current.id}/promote`, { name });+ await refreshCaseList();+ await openCase(promoted.id);+ toast(`Promoted to case “${name}”`, 'ok');+}++export function closeCase() {+ caseState.current = null;+}diff --git a/frontend/src/main.js b/frontend/src/main.jsnew file mode 100644index 0000000..130d994--- /dev/null+++ b/frontend/src/main.js@@ -0,0 +1,7 @@+import { mount } from 'svelte';+import './app.css';+import App from './App.svelte';++const app = mount(App, { target: document.getElementById('app') });++export default app;diff --git a/frontend/src/tools/MediaLibrary.svelte b/frontend/src/tools/MediaLibrary.sveltenew file mode 100644index 0000000..b57d9eb--- /dev/null+++ b/frontend/src/tools/MediaLibrary.svelte@@ -0,0 +1,13 @@+<script>+ import Icon from '../components/Icon.svelte';+</script>++<div class="tool">+ <div class="tool-body">+ <div class="empty" style="height: 100%">+ <div class="empty-icon"><Icon name="media" size={40} /></div>+ <h3>MediaLibrary</h3>+ <p>Coming in this milestone.</p>+ </div>+ </div>+</div>diff --git a/frontend/src/tools/PostComposer.svelte b/frontend/src/tools/PostComposer.sveltenew file mode 100644index 0000000..4127cb0--- /dev/null+++ b/frontend/src/tools/PostComposer.svelte@@ -0,0 +1,13 @@+<script>+ import Icon from '../components/Icon.svelte';+</script>++<div class="tool">+ <div class="tool-body">+ <div class="empty" style="height: 100%">+ <div class="empty-icon"><Icon name="post" size={40} /></div>+ <h3>PostComposer</h3>+ <p>Coming in this milestone.</p>+ </div>+ </div>+</div>diff --git a/frontend/src/tools/ProofComposer.svelte b/frontend/src/tools/ProofComposer.sveltenew file mode 100644index 0000000..3142d23--- /dev/null+++ b/frontend/src/tools/ProofComposer.svelte@@ -0,0 +1,13 @@+<script>+ import Icon from '../components/Icon.svelte';+</script>++<div class="tool">+ <div class="tool-body">+ <div class="empty" style="height: 100%">+ <div class="empty-icon"><Icon name="proof" size={40} /></div>+ <h3>ProofComposer</h3>+ <p>Coming in this milestone.</p>+ </div>+ </div>+</div>diff --git a/frontend/src/tools/Satellite.svelte b/frontend/src/tools/Satellite.sveltenew file mode 100644index 0000000..e7da8cb--- /dev/null+++ b/frontend/src/tools/Satellite.svelte@@ -0,0 +1,13 @@+<script>+ import Icon from '../components/Icon.svelte';+</script>++<div class="tool">+ <div class="tool-body">+ <div class="empty" style="height: 100%">+ <div class="empty-icon"><Icon name="satellite" size={40} /></div>+ <h3>Satellite</h3>+ <p>Coming in this milestone.</p>+ </div>+ </div>+</div>diff --git a/frontend/vite.config.js b/frontend/vite.config.jsnew file mode 100644index 0000000..d4f3568--- /dev/null+++ b/frontend/vite.config.js@@ -0,0 +1,17 @@+import { defineConfig } from 'vite';+import { svelte } from '@sveltejs/vite-plugin-svelte';++// Builds straight into the Python package so `pip install .` ships the UI.+export default defineConfig({+ plugins: [svelte()],+ build: {+ outDir: '../src/ozimut/static',+ emptyOutDir: true,+ },+ server: {+ proxy: {+ '/api': 'http://127.0.0.1:8477',+ '/files': 'http://127.0.0.1:8477',+ },+ },+});diff --git a/pyproject.toml b/pyproject.tomlnew file mode 100644index 0000000..c0e8132--- /dev/null+++ b/pyproject.toml@@ -0,0 +1,46 @@+[build-system]+requires = ["hatchling"]+build-backend = "hatchling.build"++[project]+name = "ozimut"+version = "0.1.0"+description = "The OSINT investigator's workbench — local-first media, geolocation proofs and case management."+readme = "README.md"+requires-python = ">=3.11"+license = { text = "AGPL-3.0-only" }+authors = [{ name = "OsintMeThat" }]+keywords = ["osint", "geoint", "geolocation", "investigation", "verification"]+classifiers = [+ "Development Status :: 3 - Alpha",+ "Environment :: Web Environment",+ "Intended Audience :: Other Audience",+ "Operating System :: OS Independent",+ "Programming Language :: Python :: 3.11",+ "Programming Language :: Python :: 3.12",+]+dependencies = [+ "fastapi>=0.111",+ "uvicorn[standard]>=0.30",+ "pydantic>=2.7",+ "httpx>=0.27",+ "pillow>=10.3",+ "yt-dlp>=2024.4.9",+ "python-multipart>=0.0.9",+]++[project.optional-dependencies]+dev = ["pytest>=8", "pytest-asyncio>=0.23", "httpx>=0.27"]++[project.scripts]+ozimut = "ozimut.cli:main"++[project.urls]+Homepage = "https://github.com/ozimut/ozimut"++[tool.hatch.build.targets.wheel]+packages = ["src/ozimut"]++[tool.pytest.ini_options]+testpaths = ["tests"]+asyncio_mode = "auto"diff --git a/src/ozimut/__init__.py b/src/ozimut/__init__.pynew file mode 100644index 0000000..2291617--- /dev/null+++ b/src/ozimut/__init__.py@@ -0,0 +1,3 @@+"""Ozimut — the OSINT investigator's workbench."""++__version__ = "0.1.0"diff --git a/src/ozimut/__main__.py b/src/ozimut/__main__.pynew file mode 100644index 0000000..4e28416--- /dev/null+++ b/src/ozimut/__main__.py@@ -0,0 +1,3 @@+from .cli import main++main()diff --git a/src/ozimut/api/__init__.py b/src/ozimut/api/__init__.pynew file mode 100644index 0000000..e69de29diff --git a/src/ozimut/api/cases.py b/src/ozimut/api/cases.pynew file mode 100644index 0000000..382a9f0--- /dev/null+++ b/src/ozimut/api/cases.py@@ -0,0 +1,159 @@+"""REST API for case lifecycle, notes, entities and links."""++from __future__ import annotations++from typing import Any++from fastapi import APIRouter, HTTPException+from pydantic import BaseModel, Field++from ..workspace import Case, CaseError++router = APIRouter(prefix="/api/cases", tags=["cases"])+++def get_case(case_id: str) -> Case:+ try:+ return Case.open(case_id)+ except CaseError as exc:+ raise HTTPException(status_code=404, detail=str(exc)) from exc+++class CreateCase(BaseModel):+ name: str = Field(min_length=1, max_length=120)+++class PromoteCase(BaseModel):+ name: str = Field(min_length=1, max_length=120)+++class Notes(BaseModel):+ text: str+++class EntityIn(BaseModel):+ type: str = Field(min_length=1, max_length=40)+ label: str = Field(min_length=1, max_length=300)+ attrs: dict[str, Any] = Field(default_factory=dict)+ status: str = "confirmed"+++class EntityPatch(BaseModel):+ type: str | None = None+ label: str | None = None+ attrs: dict[str, Any] | None = None+ status: str | None = None+++class LinkIn(BaseModel):+ from_id: str+ to_id: str+ type: str = Field(min_length=1, max_length=60)+ status: str = "confirmed"+++def list_cases() -> list[dict[str, Any]]:+ return Case.list_all()+++def create_case(body: CreateCase) -> dict[str, Any]:+ try:+ case = Case.create(body.name)+ except CaseError as exc:+ raise HTTPException(status_code=409, detail=str(exc)) from exc+ return {"id": case.id, **case.read()}++[email protected]("/scratch")+def create_scratch() -> dict[str, Any]:+ case = Case.create("Scratch session", scratch=True)+ return {"id": case.id, **case.read()}++[email protected]("/{case_id}")+def read_case(case_id: str) -> dict[str, Any]:+ case = get_case(case_id)+ return {"id": case.id, "scratch": case.is_scratch, **case.read()}++[email protected]("/{case_id}/promote")+def promote_case(case_id: str, body: PromoteCase) -> dict[str, Any]:+ case = get_case(case_id)+ try:+ promoted = case.promote(body.name)+ except CaseError as exc:+ raise HTTPException(status_code=409, detail=str(exc)) from exc+ return {"id": promoted.id, **promoted.read()}++[email protected]("/{case_id}")+def rename_case(case_id: str, body: CreateCase) -> dict[str, Any]:+ case = get_case(case_id)+ case.rename(body.name)+ return {"id": case.id, **case.read()}++[email protected]("/{case_id}")+def delete_case(case_id: str) -> dict[str, str]:+ get_case(case_id).delete()+ return {"status": "deleted"}++[email protected]("/{case_id}/notes")+def read_notes(case_id: str) -> dict[str, str]:+ return {"text": get_case(case_id).read_notes()}++[email protected]("/{case_id}/notes")+def write_notes(case_id: str, body: Notes) -> dict[str, str]:+ get_case(case_id).write_notes(body.text)+ return {"status": "saved"}++[email protected]("/{case_id}/entities")+def add_entity(case_id: str, body: EntityIn) -> dict[str, Any]:+ case = get_case(case_id)+ return case.add_entity(+ body.type, body.label, body.attrs, by="user", status=body.status # type: ignore[arg-type]+ )++[email protected]("/{case_id}/entities/{entity_id}")+def update_entity(case_id: str, entity_id: str, body: EntityPatch) -> dict[str, Any]:+ case = get_case(case_id)+ patch = {k: v for k, v in body.model_dump().items() if v is not None}+ try:+ return case.update_entity(entity_id, patch)+ except CaseError as exc:+ raise HTTPException(status_code=404, detail=str(exc)) from exc++[email protected]("/{case_id}/entities/{entity_id}")+def remove_entity(case_id: str, entity_id: str) -> dict[str, str]:+ try:+ get_case(case_id).remove_entity(entity_id)+ except CaseError as exc:+ raise HTTPException(status_code=404, detail=str(exc)) from exc+ return {"status": "deleted"}++[email protected]("/{case_id}/links")+def add_link(case_id: str, body: LinkIn) -> dict[str, Any]:+ case = get_case(case_id)+ try:+ return case.add_link(+ body.from_id, body.to_id, body.type, by="user", status=body.status # type: ignore[arg-type]+ )+ except CaseError as exc:+ raise HTTPException(status_code=404, detail=str(exc)) from exc++[email protected]("/{case_id}/links/{link_id}")+def remove_link(case_id: str, link_id: str) -> dict[str, str]:+ try:+ get_case(case_id).remove_link(link_id)+ except CaseError as exc:+ raise HTTPException(status_code=404, detail=str(exc)) from exc+ return {"status": "deleted"}diff --git a/src/ozimut/cli.py b/src/ozimut/cli.pynew file mode 100644index 0000000..845a0b9--- /dev/null+++ b/src/ozimut/cli.py@@ -0,0 +1,38 @@+"""`ozimut` command: start the local server and open the browser."""++from __future__ import annotations++import argparse+import threading+import webbrowser++import uvicorn++from . import __version__++DEFAULT_PORT = 8477 # spells OZIM on a phone keypad, and stays out of common ranges+++def main() -> None:+ parser = argparse.ArgumentParser(prog="ozimut", description="Ozimut — the OSINT investigator's workbench")+ parser.add_argument("--port", type=int, default=DEFAULT_PORT)+ parser.add_argument("--no-browser", action="store_true", help="don't open the browser")+ parser.add_argument("--version", action="version", version=f"ozimut {__version__}")+ args = parser.parse_args()++ url = f"http://127.0.0.1:{args.port}"+ if not args.no_browser:+ threading.Timer(0.8, webbrowser.open, args=(url,)).start()++ print(f"Ozimut {__version__} — {url} (local only, nothing leaves this machine)")+ uvicorn.run(+ "ozimut.server:create_app",+ factory=True,+ host="127.0.0.1", # local-first: never bind beyond localhost+ port=args.port,+ log_level="warning",+ )+++if __name__ == "__main__":+ main()diff --git a/src/ozimut/config.py b/src/ozimut/config.pynew file mode 100644index 0000000..473509f--- /dev/null+++ b/src/ozimut/config.py@@ -0,0 +1,69 @@+"""Application configuration and workspace-root resolution.++Everything Ozimut persists lives under one root directory (default ``~/Ozimut``,+overridable with the ``OZIMUT_HOME`` environment variable):++ ~/Ozimut/+ ├── cases/ # named investigations+ ├── scratch/ # one-shot sessions (promotable to cases)+ └── settings.json++No database server — plain files only (spec §4).+"""++from __future__ import annotations++import json+import os+from pathlib import Path+from typing import Any++DEFAULT_SETTINGS: dict[str, Any] = {+ # Extra XYZ tile providers added by the user (spec §6 v1 notes).+ # Each: {"id", "label", "url" ({x}/{y}/{z} template), "attribution", "max_zoom"}+ "tile_providers": [],+ # Optional user-supplied API keys, keyed by provider id. Never required.+ "api_keys": {},+}+++def workspace_root() -> Path:+ root = Path(os.environ.get("OZIMUT_HOME", "~/Ozimut")).expanduser()+ return root+++def cases_dir() -> Path:+ return workspace_root() / "cases"+++def scratch_dir() -> Path:+ return workspace_root() / "scratch"+++def settings_path() -> Path:+ return workspace_root() / "settings.json"+++def ensure_workspace() -> None:+ """Create the workspace skeleton if missing (idempotent)."""+ cases_dir().mkdir(parents=True, exist_ok=True)+ scratch_dir().mkdir(parents=True, exist_ok=True)+ if not settings_path().exists():+ save_settings(DEFAULT_SETTINGS)+++def load_settings() -> dict[str, Any]:+ try:+ data = json.loads(settings_path().read_text(encoding="utf-8"))+ except (OSError, json.JSONDecodeError):+ return dict(DEFAULT_SETTINGS)+ merged = dict(DEFAULT_SETTINGS)+ merged.update(data)+ return merged+++def save_settings(settings: dict[str, Any]) -> None:+ settings_path().parent.mkdir(parents=True, exist_ok=True)+ settings_path().write_text(+ json.dumps(settings, indent=2, ensure_ascii=False) + "\n", encoding="utf-8"+ )diff --git a/src/ozimut/server.py b/src/ozimut/server.pynew file mode 100644index 0000000..62b7ea4--- /dev/null+++ b/src/ozimut/server.py@@ -0,0 +1,52 @@+"""FastAPI application: API routers + built frontend served as static files."""++from __future__ import annotations++from pathlib import Path++from fastapi import FastAPI+from fastapi.responses import FileResponse, JSONResponse+from fastapi.staticfiles import StaticFiles++from . import __version__, config++STATIC_DIR = Path(__file__).parent / "static"+++def create_app() -> FastAPI:+ config.ensure_workspace()++ app = FastAPI(title="Ozimut", version=__version__, docs_url="/api/docs")++ from .api import cases++ app.include_router(cases.router)++ @app.get("/api/health")+ def health() -> dict[str, str]:+ return {"status": "ok", "version": __version__}++ # Built frontend (frontend/ builds into src/ozimut/static/).+ if (STATIC_DIR / "index.html").exists():+ app.mount("/assets", StaticFiles(directory=STATIC_DIR / "assets"), name="assets")++ @app.get("/{path:path}", include_in_schema=False)+ def spa(path: str): # SPA fallback: serve index.html for app routes+ candidate = STATIC_DIR / path+ if path and candidate.is_file() and candidate.is_relative_to(STATIC_DIR):+ return FileResponse(candidate)+ return FileResponse(STATIC_DIR / "index.html")++ else: # dev without a built frontend: make it obvious, not broken++ @app.get("/", include_in_schema=False)+ def no_frontend() -> JSONResponse:+ return JSONResponse(+ {+ "ozimut": __version__,+ "hint": "frontend not built — run `npm run build` in frontend/ "+ "or use the Vite dev server (npm run dev)",+ }+ )++ return appdiff --git a/src/ozimut/workspace.py b/src/ozimut/workspace.pynew file mode 100644index 0000000..b50d9ba--- /dev/null+++ b/src/ozimut/workspace.py@@ -0,0 +1,292 @@+"""Case workspace: create/list/open cases, scratch cases, entities and links.++A case is a plain directory (spec §4):++ <case>/+ ├── case.json # metadata + entities + links+ ├── notes.md # free-form case notes+ ├── media/ # imported/downloaded media + sidecar metadata+ ├── satellite/ # imagery crops + provenance+ ├── proofs/ # composed proofs (PNG + editable JSON spec)+ └── exports/ # post drafts, reports++One-shot mode uses a *scratch* case under ``scratch/`` — same layout, same code+path — which can be promoted (moved) into ``cases/`` at any time (spec §3.3).+"""++from __future__ import annotations++import json+import re+import shutil+import uuid+from datetime import datetime, timezone+from pathlib import Path+from typing import Any, Literal++from . import config++CASE_SUBDIRS = ("media", "satellite", "proofs", "exports")++EntityStatus = Literal["confirmed", "suggested"]++# Extensible vocabulary (spec §5); free strings are accepted, these are the+# well-known ones the UI knows how to render.+ENTITY_TYPES = (+ "person", "organization", "alias", "account", "email", "phone", "domain",+ "ip", "vehicle", "place", "event", "media", "proof", "note",+)+++def _now() -> str:+ return datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")+++def _slugify(name: str) -> str:+ slug = re.sub(r"[^a-z0-9]+", "-", name.lower()).strip("-")+ return slug or "case"+++def _new_id(prefix: str) -> str:+ return f"{prefix}_{uuid.uuid4().hex[:10]}"+++class CaseError(Exception):+ """Raised for invalid case operations; maps to HTTP 4xx in the API layer."""+++class Case:+ """Handle over one case directory. All reads/writes go through here."""++ def __init__(self, path: Path):+ self.path = path++ # -- identity ---------------------------------------------------------++ @property+ def id(self) -> str:+ return self.path.name++ @property+ def is_scratch(self) -> bool:+ return self.path.parent == config.scratch_dir()++ # -- creation / loading ------------------------------------------------++ @classmethod+ def create(cls, name: str, *, scratch: bool = False) -> "Case":+ parent = config.scratch_dir() if scratch else config.cases_dir()+ parent.mkdir(parents=True, exist_ok=True)+ slug = _new_id("scratch") if scratch else _slugify(name)+ path = parent / slug+ if path.exists():+ raise CaseError(f"case '{slug}' already exists")+ path.mkdir()+ for sub in CASE_SUBDIRS:+ (path / sub).mkdir()+ case = cls(path)+ case._write_json(+ {+ "ozimut": {"schema": 1},+ "name": name,+ "created_at": _now(),+ "updated_at": _now(),+ "entities": [],+ "links": [],+ }+ )+ (path / "notes.md").write_text(f"# {name}\n\n", encoding="utf-8")+ return case++ @classmethod+ def open(cls, case_id: str) -> "Case":+ for parent in (config.cases_dir(), config.scratch_dir()):+ path = parent / case_id+ if (path / "case.json").exists():+ return cls(path)+ raise CaseError(f"case '{case_id}' not found")++ @classmethod+ def list_all(cls) -> list[dict[str, Any]]:+ out: list[dict[str, Any]] = []+ for parent, scratch in ((config.cases_dir(), False), (config.scratch_dir(), True)):+ if not parent.is_dir():+ continue+ for path in sorted(parent.iterdir()):+ if not (path / "case.json").exists():+ continue+ case = cls(path)+ data = case.read()+ out.append(+ {+ "id": case.id,+ "name": data.get("name", case.id),+ "scratch": scratch,+ "created_at": data.get("created_at"),+ "updated_at": data.get("updated_at"),+ "entity_count": len(data.get("entities", [])),+ }+ )+ out.sort(key=lambda c: c.get("updated_at") or "", reverse=True)+ return out++ # -- json io -----------------------------------------------------------++ @property+ def json_path(self) -> Path:+ return self.path / "case.json"++ def read(self) -> dict[str, Any]:+ return json.loads(self.json_path.read_text(encoding="utf-8"))++ def _write_json(self, data: dict[str, Any]) -> None:+ data["updated_at"] = _now()+ tmp = self.json_path.with_suffix(".json.tmp")+ tmp.write_text(json.dumps(data, indent=2, ensure_ascii=False) + "\n", encoding="utf-8")+ tmp.replace(self.json_path)++ # -- notes -------------------------------------------------------------++ @property+ def notes_path(self) -> Path:+ return self.path / "notes.md"++ def read_notes(self) -> str:+ try:+ return self.notes_path.read_text(encoding="utf-8")+ except OSError:+ return ""++ def write_notes(self, text: str) -> None:+ self.notes_path.write_text(text, encoding="utf-8")++ # -- lifecycle -----------------------------------------------------------++ def rename(self, name: str) -> None:+ data = self.read()+ data["name"] = name+ self._write_json(data)++ def promote(self, name: str) -> "Case":+ """Move a scratch case into cases/ under a proper name (spec §3.3)."""+ if not self.is_scratch:+ raise CaseError("only scratch cases can be promoted")+ slug = _slugify(name)+ dest = config.cases_dir() / slug+ if dest.exists():+ raise CaseError(f"case '{slug}' already exists")+ dest.parent.mkdir(parents=True, exist_ok=True)+ shutil.move(str(self.path), str(dest))+ promoted = Case(dest)+ promoted.rename(name)+ return promoted++ def delete(self) -> None:+ shutil.rmtree(self.path)++ # -- entities & links (spec §5) -----------------------------------------++ def add_entity(+ self,+ type_: str,+ label: str,+ attrs: dict[str, Any] | None = None,+ *,+ by: str,+ status: EntityStatus = "confirmed",+ source: str | None = None,+ ) -> dict[str, Any]:+ data = self.read()+ entity = {+ "id": _new_id("e"),+ "type": type_,+ "label": label,+ "attrs": attrs or {},+ "provenance": {"by": by, "at": _now(), "status": status},+ }+ if source:+ entity["provenance"]["source"] = source+ data["entities"].append(entity)+ self._write_json(data)+ return entity++ def update_entity(self, entity_id: str, patch: dict[str, Any]) -> dict[str, Any]:+ data = self.read()+ for entity in data["entities"]:+ if entity["id"] == entity_id:+ for key in ("type", "label"):+ if key in patch:+ entity[key] = patch[key]+ if "attrs" in patch:+ entity["attrs"].update(patch["attrs"])+ if patch.get("status") in ("confirmed", "suggested"):+ entity["provenance"]["status"] = patch["status"]+ self._write_json(data)+ return entity+ raise CaseError(f"entity '{entity_id}' not found")++ def remove_entity(self, entity_id: str) -> None:+ data = self.read()+ before = len(data["entities"])+ data["entities"] = [e for e in data["entities"] if e["id"] != entity_id]+ if len(data["entities"]) == before:+ raise CaseError(f"entity '{entity_id}' not found")+ data["links"] = [+ l for l in data["links"] if entity_id not in (l["from"], l["to"])+ ]+ self._write_json(data)++ def find_entity(self, *, attr: str, value: Any) -> dict[str, Any] | None:+ for entity in self.read()["entities"]:+ if entity["attrs"].get(attr) == value:+ return entity+ return None++ def add_link(+ self,+ from_id: str,+ to_id: str,+ type_: str,+ *,+ by: str,+ status: EntityStatus = "confirmed",+ ) -> dict[str, Any]:+ data = self.read()+ ids = {e["id"] for e in data["entities"]}+ for eid in (from_id, to_id):+ if eid not in ids:+ raise CaseError(f"entity '{eid}' not found")+ link = {+ "id": _new_id("l"),+ "from": from_id,+ "to": to_id,+ "type": type_,+ "provenance": {"by": by, "at": _now(), "status": status},+ }+ data["links"].append(link)+ self._write_json(data)+ return link++ def remove_link(self, link_id: str) -> None:+ data = self.read()+ before = len(data["links"])+ data["links"] = [l for l in data["links"] if l["id"] != link_id]+ if len(data["links"]) == before:+ raise CaseError(f"link '{link_id}' not found")+ self._write_json(data)++ # -- helpers -------------------------------------------------------------++ def subdir(self, name: str) -> Path:+ if name not in CASE_SUBDIRS:+ raise CaseError(f"unknown case subdir '{name}'")+ path = self.path / name+ path.mkdir(exist_ok=True)+ return path++ def resolve_inside(self, relative: str) -> Path:+ """Resolve a case-relative path, refusing traversal outside the case."""+ candidate = (self.path / relative).resolve()+ if not candidate.is_relative_to(self.path.resolve()):+ raise CaseError("path escapes the case directory")+ return candidatediff --git a/tests/conftest.py b/tests/conftest.pynew file mode 100644index 0000000..8558fb7--- /dev/null+++ b/tests/conftest.py@@ -0,0 +1,16 @@+import os+import tempfile++import pytest+from fastapi.testclient import TestClient+++def client(monkeypatch):+ """API client backed by a throwaway workspace root."""+ with tempfile.TemporaryDirectory() as home:+ monkeypatch.setenv("OZIMUT_HOME", home)+ from ozimut.server import create_app++ with TestClient(create_app()) as c:+ yield cdiff --git a/tests/test_cases_api.py b/tests/test_cases_api.pynew file mode 100644index 0000000..dd84924--- /dev/null+++ b/tests/test_cases_api.py@@ -0,0 +1,84 @@+"""Case lifecycle, notes, entities and links through the REST API."""+++def test_health(client):+ assert client.get("/api/health").json()["status"] == "ok"+++def test_case_lifecycle(client):+ created = client.post("/api/cases", json={"name": "Kharkiv Strike"}).json()+ assert created["id"] == "kharkiv-strike"+ assert created["entities"] == []++ # duplicate name → 409+ assert client.post("/api/cases", json={"name": "Kharkiv Strike"}).status_code == 409++ listed = client.get("/api/cases").json()+ assert [c["id"] for c in listed] == ["kharkiv-strike"]++ client.patch("/api/cases/kharkiv-strike", json={"name": "Kharkiv Strike v2"})+ assert client.get("/api/cases/kharkiv-strike").json()["name"] == "Kharkiv Strike v2"++ assert client.delete("/api/cases/kharkiv-strike").json()["status"] == "deleted"+ assert client.get("/api/cases/kharkiv-strike").status_code == 404+++def test_scratch_promote(client):+ scratch = client.post("/api/cases/scratch").json()+ assert scratch["id"].startswith("scratch_")+ assert client.get(f"/api/cases/{scratch['id']}").json()["scratch"] is True++ promoted = client.post(+ f"/api/cases/{scratch['id']}/promote", json={"name": "Real Case"}+ ).json()+ assert promoted["id"] == "real-case"+ assert client.get("/api/cases/real-case").json()["scratch"] is False+ # old scratch id is gone+ assert client.get(f"/api/cases/{scratch['id']}").status_code == 404+++def test_notes_roundtrip(client):+ case = client.post("/api/cases", json={"name": "Notes"}).json()+ client.put(f"/api/cases/{case['id']}/notes", json={"text": "# hello\n\nworld"})+ assert client.get(f"/api/cases/{case['id']}/notes").json()["text"] == "# hello\n\nworld"+++def test_entities_and_links(client):+ cid = client.post("/api/cases", json={"name": "Graph"}).json()["id"]++ person = client.post(+ f"/api/cases/{cid}/entities", json={"type": "person", "label": "John Doe"}+ ).json()+ account = client.post(+ f"/api/cases/{cid}/entities",+ json={"type": "account", "label": "@johnd", "status": "suggested"},+ ).json()+ assert person["provenance"]["status"] == "confirmed"+ assert account["provenance"]["status"] == "suggested"++ # confirm the suggestion (spec §3.5: analyst decides)+ patched = client.patch(+ f"/api/cases/{cid}/entities/{account['id']}", json={"status": "confirmed"}+ ).json()+ assert patched["provenance"]["status"] == "confirmed"++ link = client.post(+ f"/api/cases/{cid}/links",+ json={"from_id": person["id"], "to_id": account["id"], "type": "owns"},+ ).json()+ assert link["type"] == "owns"++ # unknown entity in a link → 404+ assert (+ client.post(+ f"/api/cases/{cid}/links",+ json={"from_id": person["id"], "to_id": "e_nope", "type": "owns"},+ ).status_code+ == 404+ )++ # deleting an entity cascades to its links+ client.delete(f"/api/cases/{cid}/entities/{account['id']}")+ data = client.get(f"/api/cases/{cid}").json()+ assert len(data["entities"]) == 1+ assert data["links"] == []