feat: explain-permissions v1.2.0 — Cross-Platform-Notifications (az-fleet-wla)
- notify() mit Plattform-Zweigen: Linux notify-send (unverändert), macOS osascript, Windows PowerShell-Toast via WinRT + PowerShell-AUMID (keine App-Registrierung nötig); Titel/Text über env des Child-Prozesses (injektionssicher), XML-Escape via SecurityElement - fail-soft Spawn in Node UND Bun (try/catch + error-Listener decken beide ENOENT-Semantiken ab) — fehlendes Binary/headless = stiller No-Op - Log-Pfad-Entscheidung: Windows %LOCALAPPDATA%\opencode\ (idiomatisch, roamt nicht, Fallback ~\AppData\Local), sonst XDG-State unverändert; dokumentiert im README - Live verifiziert: Linux permission.asked -> ask/ask.explained/replied im Audit-Log + Toast; Fail-Soft win32/darwin-Zweige in node+bun ohne Crash
This commit is contained in:
@@ -54,12 +54,40 @@ Pin auf ein Tag (z. B. `explain-permissions/v1.1.0`) oder `main`; anonymes
|
||||
| `OPENCODE_EXPLAIN_INJECT=0` | System-Prompt-Regel abschalten | an |
|
||||
| `OPENCODE_EXPLAIN_ENFORCE=1` | Hartes Erzwingen der Erklärung aktivieren (Call ohne vorherige Erklärung → Fehler) | aus |
|
||||
| `OPENCODE_EXPLAIN_DEBUG=1` | Permission-Events ins Log schreiben | aus |
|
||||
| `OPENCODE_EXPLAIN_LOG_PATH=…` | Anderer Log-Pfad | `~/.local/state/opencode/explain-permissions.jsonl` |
|
||||
| `OPENCODE_EXPLAIN_LOG_PATH=…` | Anderer Log-Pfad | plattformabhängig (siehe unten) |
|
||||
|
||||
## Notifications je Plattform (v1.2.0)
|
||||
|
||||
| Plattform | Mechanismus | Anmerkung |
|
||||
|---|---|---|
|
||||
| Linux | `notify-send` (libnotify) | wie bisher |
|
||||
| macOS | `osascript display notification` | Boardmittel, keine Abhängigkeit |
|
||||
| Windows | PowerShell-Toast (WinRT) via `-EncodedCommand` | AppUserModelID = PowerShell-AUMID — **keine App-Registrierung nötig**; Titel/Text laufen über env-Variablen des Child-Prozesses (injektionssicher), XML-Escaping in PowerShell |
|
||||
|
||||
Alle Zweige sind **fail-soft**: fehlendes Binary, headless Session oder
|
||||
Spawn-Fehler sind stille No-Ops — kein Crash, kein Log-Müll. Node und Bun
|
||||
behandeln ENOENT beim Spawn unterschiedlich (asynchrones `error`-Event vs.
|
||||
synchroner Wurf); das Plugin deckt beide Semantiken ab (try/catch plus
|
||||
error-Listener) und läuft damit in beiden Runtime-Welten.
|
||||
|
||||
## Log-Pfad-Entscheidung (v1.2.0)
|
||||
|
||||
| Plattform | Default-Pfad | Begründung |
|
||||
|---|---|---|
|
||||
| Windows | `%LOCALAPPDATA%\opencode\explain-permissions.jsonl` | idiomatisch, roamt nicht, liegt neben anderen App-States; Fallback `~\AppData\Local\…`, falls `LOCALAPPDATA` nicht gesetzt |
|
||||
| Linux/macOS | `~/.local/state/opencode/explain-permissions.jsonl` | XDG-State-Konvention (unverändert seit v1.1.0) |
|
||||
|
||||
`~/.local/state` würde zwar überall funktionieren (auch auf Windows), aber
|
||||
`%LOCALAPPDATA%` ist auf Windows der etablierte Ort für pro-Nutzer-State —
|
||||
Pilotnutzer-Support findet Dateien dort, wo Windows sie erwartet.
|
||||
|
||||
## Audit-Log ansehen
|
||||
|
||||
```bash
|
||||
# Linux/macOS
|
||||
tail -f ~/.local/state/opencode/explain-permissions.jsonl | jq .
|
||||
# Windows (PowerShell)
|
||||
Get-Content "$env:LOCALAPPDATA\opencode\explain-permissions.jsonl" -Wait
|
||||
```
|
||||
|
||||
Relevante Events:
|
||||
@@ -77,6 +105,10 @@ Chat-Session im laufenden Prozess reicht nicht. Der Audit-Log-Eintrag
|
||||
|
||||
## Versionierung
|
||||
|
||||
- `explain-permissions/v1.2.0` — Cross-Platform-Notifications (Linux
|
||||
notify-send / macOS osascript / Windows PowerShell-Toast mit PowerShell-AUMID,
|
||||
keine App-Registrierung), fail-soft Spawn in Node- und Bun-Runtimes,
|
||||
Windows-Log-Pfad `%LOCALAPPDATA%\opencode\` (Entscheidung siehe oben).
|
||||
- `explain-permissions/v1.1.0` — Baseline, exakt der Stand der lokalen
|
||||
Solo-Datei vom 17.09.2026 (Inhaltsgleichheit per SHA-256 verifiziert).
|
||||
- Fortlaufende Versionsnummer in `PLUGIN_VERSION` im Dateikopf; Änderungen
|
||||
|
||||
Reference in New Issue
Block a user