dymium-auth-plugin
v1.4.3
Published
OpenCode plugin for Dymium/GhostLLM — injects auth tokens and taps reasoning_content streams
Maintainers
Readme
dymium-auth-plugin
OpenCode plugin for Dymium/GhostLLM authentication with automatic token refresh.
Overview
This plugin intercepts API requests to the dymium provider in OpenCode and:
- Reads fresh tokens from
~/.local/share/opencode/auth.jsonon every request - Injects Authorization header (
Bearer <token>) for each request - Logs reasoning transparency signals from OpenCode message-part events for debug observability
- Taps raw SSE streams on chat/responses endpoints and logs GhostLLM reasoning/PII metadata directly
- Emits canonical summary lines for downstream UI/log consumers (stable
PII Protection: ...format)
Problem Solved
When using OpenCode with Dymium/GhostLLM and short-lived credentials:
- the plugin guarantees fresh token injection per request,
- and can observe PII transparency reasoning lines without changing response semantics.
Installation
With DymiumProvider (Recommended)
The DymiumProvider macOS app automatically installs and manages this plugin.
Manual Installation
Add to your
~/.config/opencode/opencode.json:{ "plugin": [ "dymium-auth-plugin@latest" ], "provider": { "dymium": { "npm": "@ai-sdk/openai-compatible", "api": "http://your-llm-endpoint:3000/v1", "models": { ... } } } }Ensure
~/.local/share/opencode/auth.jsonhas a dymium entry:{ "dymium": { "type": "api", "key": "your-jwt-token" } }
How It Works
┌─────────────────────┐
│ OpenCode │
│ (dymium provider) │
└─────────┬───────────┘
│ API Request
▼
┌─────────────────────┐
│ dymium-auth-plugin │
├─────────────────────┤
│ 1. Read token │◀── ~/.dymium/token or auth.json
│ 2. Set Auth header │
│ 3. Send request │
│ 4. Log reasoning evt│
└─────────┬───────────┘
│
▼
┌─────────────────────┐
│ kubectl port-fwd │
│ → Istio Gateway │
│ → GhostLLM Backend │
└─────────────────────┘GhostLLM Streaming Transparency
When OpenCode emits reasoning part updates (for example from delta.reasoning_content), the plugin logs:
ReasoningDelta: ...formessage.part.deltaeventsReasoningPart: ...formessage.part.updatedreasoning parts
Additionally, for streaming chat/responses calls, the plugin now performs a non-blocking SSE observer on a cloned response stream and logs:
SSE.Reasoning: ...for rawdelta.reasoning_content/delta.reasoning_detailsSSE.PII.Details: {...}when a structured maskedProtected details:line is presentSSE.GhostLLMPII: {...}when aghostllm_piiobject appears in stream payloadsPII Protection: ...canonical status/summary lines (for stable UI parsing)
This is observability-only and does not alter content/tool-call semantics or OpenCode response handling.
Debug Logging
Logs written to ~/.local/share/dymium-opencode-plugin/debug.log (not stdout to avoid polluting OpenCode UI).
Related Projects
- DymiumProvider - Tray app for token + OpenCode config management
License
MIT
