Real-time observability layer for OpenCode agent sessions inside VS Code.
- Live Timeline — watch agent events in real-time
- Tool Monitor — see which tool is running and for how long
- File Activity — track which files are being modified
- Session Status — connection state, model, duration
- Live Diff — view changes as they happen
- TODO Panel — track task progress
- Permission Requests — approve/deny agent actions
- Status Bar — quick glance at agent state
# No terminal, inicie o servidor OpenCode
opencode serveO servidor fica em http://127.0.0.1:4096 (padrão).
code --install-extension /mnt/dados/projetos/opencode-agent-observatory/opencode-agent-observatory-0.1.0.vsixOu arraste o arquivo .vsix para dentro do VS Code.
Após instalar:
- Na Activity Bar (barra lateral esquerda), clique no ícone 👁️ "OpenCode Observatory"
- O painel abre mostrando:
- Status: Connected/Disconnected
- Timeline: eventos em tempo real
- Current Action: ferramenta em execução
- Files: arquivos sendo modificados
- TODO: tarefas do agente
| Comando | O que faz |
|---|---|
OpenCode: Open Observatory |
Abre o painel |
OpenCode: Connect |
Conecta ao servidor |
OpenCode: Disconnect |
Desconecta |
OpenCode: Select Session |
Escolhe qual sessão monitorar |
OpenCode: Abort Session |
Aborta sessão ativa |
OpenCode: Clear Timeline |
Limpa histórico de eventos |
opencode serve ← terminal 1: servidor
code . ← terminal 2: VS Code com extensão instalada
← extensão auto-conecta
← você vê o agente trabalhando em tempo real
cd /mnt/dados/projetos/opencode-agent-observatory
npm install
cd webview && npm install && npm run build && cd ..
npm run watch ← terminal 1: compila em watch mode
code . ← terminal 2: abre o projeto
F5 ← inicia Extension Development HostNo Extension Development Host, a extensão carrega do código fonte, não do .vsix.
┌─────────────────────────────────────────────┐
│ ● RUNNING — Session: abc123 │
│ v1.18.11 · claude-opus-4-7 │
├─────────────────────────────────────────────┤
│ TIMELINE │ CURRENT ACTION │
│ │ │
│ ✓ 17:42:01 Session │ ⚙ edit_file │
│ ✓ 17:42:03 READ │ src/app.ts │
│ ● 17:42:07 EDIT │ 2.3s │
│ ○ 17:42:10 TEST │ │
├───────────────────────┴───────────────────────┤
│ FILES │ TODO │
│ M src/app.ts │ ✓ Setup project │
│ A src/utils.ts │ ● Implement state │
│ │ ○ Add tests │
└──────────────────────────┴────────────────────┘
O agente trabalha no terminal/OpenCode, e você acompanha visualmente pelo VS Code sem precisar olhar o terminal.
VS Code ←→ Extension Host ←→ OpenCodeConnection (SSE) ←→ OpenCode Server
↕
StateStore (centralized)
↕
Webview (postMessage)
- read-mostly: observa, não modifica
- SSE-first: EventSource para tempo real, polling como fallback
- Reconexão exponencial: 1s → 2s → 4s → ... → 30s max
- Sem secrets: redator_remove API keys automaticamente
- Webview isolada: CSP + nonce, sem acesso direto a filesystem/rede
| Setting | Default | Description |
|---|---|---|
opencodeObservatory.server.url |
http://127.0.0.1:4096 |
OpenCode server URL |
opencodeObservatory.autoConnect |
true |
Auto-connect on startup |
opencodeObservatory.debug |
false |
Enable debug logging |
npm install
npm run compile # compile extension
cd webview && npm install && npm run build # compile webview
npm run package # create .vsixMIT