OKAMI OS Documentação Documentation
← Site GitHub
Começar / Visão geral

// começar · 01

O que é o OKAMI OS? What is OKAMI OS?

OKAMI OS é um painel open source para acompanhar agentes de IA em uma interface só. Ele roda local com dados mock, mostra como o estado do agente deve chegar à UI e pode receber dados reais por API, SSE ou uma bridge opcional. OKAMI OS is an open source panel for monitoring AI agents in one interface. It runs locally with mock data, shows how agent state should reach the UI, and can receive real data through API, SSE or an optional bridge.

i
Escolha o caminho certo para o que você quer fazer Choose the right path for what you want to do Quer apenas ver a interface funcionando? Comece pelo quick start. Quer plugar seu agente? Leia o contrato de estado, as rotas HTTP e o stream SSE. Quer adaptar o coletor? Vá para runtime bridge e segurança. Just want to see the interface running? Start with quickstart. Want to plug in your agent? Read the state contract, HTTP routes and SSE stream. Want to adapt the collector? Go to runtime bridge and security.

Rode primeiro em modo mock. Conecte depois. Run mock mode first. Connect later.

O projeto não exige runtime real para abrir a interface. Se nenhuma API estiver configurada, o hook useMissionControl usa src/data/mockMissionControl.js. Isso permite testar layout, navegação, Pixel Office, docs e gráficos antes de plugar dados reais. The project does not require a real runtime to open the UI. If no API is configured, useMissionControl uses src/data/mockMissionControl.js. This lets you test layout, navigation, Pixel Office, docs and charts before plugging in real data.

installnode >= 18
git clone https://github.com/OkamiOps/Okami-Monitor.git okami-os
cd okami-os
npm install
cp .env.example .env.local
npm run dev:all
01 Abrir frontendOpen frontend

Vite sobe em http://localhost:5173.Vite runs at http://localhost:5173.

02 Abrir backendOpen backend

Express escuta em 127.0.0.1:3001.Express listens on 127.0.0.1:3001.

03 Usar mockUse mock

Sem API configurada, a UI usa dados locais.Without an API, the UI uses local data.

04 Abrir AgentesOpen Agents

Configure acesso do painel, servidor SSH e agentes externos quando precisar de dados reais.Configure panel access, SSH server and external agents when you need real data.

Variáveis que mudam o modo de execução. Variables that change runtime behavior.

O arquivo .env.example define o contrato mínimo. Em desenvolvimento, vite.config.js encaminha /api para http://127.0.0.1:3001. Em produção, same-origin assume que existe uma função/proxy atendendo o caminho /api. The .env.example file defines the minimum contract. In development, vite.config.js proxies /api to http://127.0.0.1:3001. In production, same-origin assumes a function/proxy is serving the /api path.

VITE_OKAMI_API_BASE_URLsame-origin por padrão. Em dev o Vite encaminha /api; em produção a função Pages faz o proxy. URL direta exige bearer válido.same-origin by default. In dev Vite proxies /api; in production the Pages function proxies it. Direct URLs require a valid bearer.
VITE_OKAMI_API_TOKENBearer opcional enviado pelo cliente quando a API direta exige token.Optional bearer sent by the client when a direct API requires a token.
VITE_OKAMI_POLL_INTERVAL_MSIntervalo do fallback de polling quando SSE fecha.Polling fallback interval when SSE closes.
OKAMI_API_PORTPorta do backend Express. Padrão: 3001.Express backend port. Default: 3001.
OKAMI_API_TOKENToken estático opcional aceito pelo backend além das Okami API Keys geradas no painel.Optional static token accepted by the backend in addition to panel-generated Okami API Keys.
OKAMI_DATA_DIRDiretório local para config, registries, hashes de auth e secrets cifrados. Padrão: server/.data.Local directory for config, registries, auth hashes and encrypted secrets. Default: server/.data.
OKAMI_TRUST_LOCAL_DEV1 libera loopback em desenvolvimento para facilitar o primeiro uso. Use 0 para exigir key também localmente.1 trusts loopback during development for first-run ease. Use 0 to require a key locally too.
OKAMI_STREAM_INTERVAL_MSIntervalo de coleta do stream SSE. Padrão: 8000.SSE stream collection interval. Default: 8000.
OKAMI_ALLOWED_ORIGINSLista CORS separada por vírgula. Vazio libera origem em dev.Comma-separated CORS allowlist. Empty allows dev origins.
OKAMI_BACKEND_URLBackend real usado pelo proxy de Cloudflare Pages.Real backend used by the Cloudflare Pages proxy.
OKAMI_BACKEND_PROXY_TOKENToken exigido pelo backend quando configurado.Token required by the backend when configured.

Como o repositório está organizado. How the repository is organized.

src/App.jsxSPA principal: navegação, 14 views, tela Agentes unificada, modais, tabelas e ações.Main SPA: navigation, 14 views, unified Agents screen, modals, tables and actions.
src/PixelOfficeCanvas.jsxCanvas Phaser 4 com escritório pixel-art, agentes e mini Kanban.Phaser 4 canvas with pixel-art office, agents and mini Kanban.
src/lib/useMissionControl.jsSSE, fallback polling, mock-first e estado da UI.SSE, polling fallback, mock-first and UI state.
src/lib/apiClient.jsCliente HTTP para auth, state, SSH, Kanban, registries, agentes e arquivos.HTTP client for auth, state, SSH, Kanban, registries, agents and files.
src/data/mockMissionControl.jsDataset local que deixa a UI funcional sem backend.Local dataset that keeps the UI working without a backend.
server/index.jsAPI Express, auth/scopes, SSE, agente runtime registry, rotas Hermes e comandos permitidos.Express API, auth/scopes, SSE, agent runtime registry, Hermes routes and allowed commands.
server/hermesCollector.jsColeta e normaliza sessões, analytics, docs, skills, jobs e Kanban.Collects and normalizes sessions, analytics, docs, skills, jobs and Kanban.
server/sshBridge.jsWrapper ssh2 com key/password, timeout e exec remoto.ssh2 wrapper with key/password, timeout and remote exec.
server/store.jsConfig, registries, hashes de API Key e secrets cifrados em server/.data.Config, registries, API Key hashes and encrypted secrets in server/.data.
functions/api/[[path]].jsProxy Cloudflare Pages para encaminhar /api ao backend real.Cloudflare Pages proxy that forwards /api to the real backend.

As 14 telas visíveis do cockpit. The 14 visible cockpit screens.

A navegação é definida em navGroups dentro de src/App.jsx. Cada view recebe o mesmo estado base de useMissionControl e decide quais blocos renderizar. Navigation is defined in navGroups inside src/App.jsx. Each view receives the same base state from useMissionControl and decides which blocks to render.

#overviewOverview

Saúde geral, métricas, modelos, atividade recente e estado do runtime.Overall health, metrics, models, recent activity and runtime state.

#usageUsage

Tokens, estimativas de custo, forecast e concentração por modelo/provedor.Tokens, cost estimates, forecast and concentration by model/provider.

#kanbanKanban

Quadro operacional com Backlog, Todo, In Progress, Blocked, Triage, Review e Done.Operational board with Backlog, Todo, In Progress, Blocked, Triage, Review and Done.

#officeOffice

Comando de agentes, cards, inspetor, subagentes e monitor por agente.Agent command view, cards, inspector, subagents and per-agent monitor.

#pixelPixel

Escritório interativo com Phaser, sprites, reuniões, falas e mini Kanban.Interactive office with Phaser, sprites, meetings, dialogue and mini Kanban.

#profilesPerfis

Documentos de identidade, memória e contexto por agente/perfil.Identity, memory and context documents per agent/profile.

#sessionsSessions

Sessões recentes, status, duração, tokens, tool calls e origem.Recent sessions, status, duration, tokens, tool calls and source.

#cronCron

Leitura e edição assistida de crontab e timers systemd permitidos.Assisted reading and editing of allowed crontab and systemd timers.

#configAgentes

Acesso do painel, servidor SSH, agentes conectados, arquivos do agente e Okami API Keys.Panel access, SSH server, connected agents, agent files and Okami API Keys.

#skillsSkills

Uso de skills, docs relacionados e edição de conteúdo quando permitido.Skill usage, related docs and editable content when allowed.

#logsLogs

Linhas normalizadas, níveis, mensagens humanas e leitura rápida de falhas.Normalized lines, levels, human messages and quick failure reading.

#appsApps

Registry editável de apps e endpoints úteis do seu ambiente.Editable registry of apps and useful endpoints in your environment.

#cliCLIs

Verificação de ferramentas locais/remotas como Node, Python, GitHub CLI e Codex.Checks for local/remote tools such as Node, Python, GitHub CLI and Codex.

#docsDocs

Base viva de runbooks, agent briefs, system design e textos editáveis.Living base for runbooks, agent briefs, system design and editable text.

A aba Agentes é o centro de conexão do painel. The Agents tab is the panel connection center.

No código atual, a view visível Agentes mantém o hash #config por compatibilidade, mas substitui as antigas telas separadas de Config, Agentes e Hermes. Ela prepara o acesso ao painel, conecta o servidor onde os agentes rodam e registra agentes externos sem exigir que o usuário edite secrets manualmente. In the current code, the visible Agents view keeps the #config hash for compatibility, but replaces the older separate Config, Agents and Hermes screens. It prepares panel access, connects the server where agents run and registers external agents without making users edit secrets manually.

panel

Acesso do painelPanel access

Mostra status de auth, permite bootstrap em ambiente autorizado e guarda a Okami API Key no navegador quando necessário.Shows auth status, allows bootstrap in authorized environments and stores the Okami API Key in the browser when needed.

server

Servidor dos agentesAgent server

Configura host SSH, usuário, porta, pasta base, método de auth, roteamento, orçamento diário e auditoria.Configures SSH host, user, port, base folder, auth method, routing, daily budget and audit settings.

runtime

Agentes conectadosConnected agents

Registra agentes como OpenClaw, OpenHuman, Claude, Codex, OpenCode ou qualquer runtime compatível.Registers agents such as OpenClaw, OpenHuman, Claude, Codex, OpenCode or any compatible runtime.

files

Arquivos do agenteAgent files

Lista arquivos declarados pelo runtime e permite salvar mudanças somente dentro das raízes permitidas.Lists files declared by the runtime and allows writes only inside permitted roots.

POST /api/mission-control/agent-runtimes/:id/connectautomatic access
{
  "runtime": {
    "id": "opencode",
    "name": "OpenCode",
    "family": "coding-cli",
    "command": "opencode status",
    "home": "~/.agents/workspaces/opencode",
    "workspacePath": "~/.agents/workspaces/opencode",
    "configPath": "~/.agents/registry.json",
    "recommendedScopes": ["read", "write"]
  }
}
Key automáticaAo conectar um agente, o backend cria uma Okami API Key, guarda o token cifrado no vault e registra apenas prefixo, fingerprint e escopos.When an agent is connected, the backend creates an Okami API Key, stores the token encrypted in the vault and registers only prefix, fingerprint and scopes.
.okami.envSe o SSH já estiver configurado, o servidor tenta aplicar OKAMI_API_KEY, OKAMI_API_BASE_URL, OKAMI_AGENT_ID e OKAMI_AGENT_NAME no workspace do agente com permissão 600.If SSH is already configured, the server tries to write OKAMI_API_KEY, OKAMI_API_BASE_URL, OKAMI_AGENT_ID and OKAMI_AGENT_NAME into the agent workspace with 600 permissions.
AvançadoA criação manual de keys continua disponível em Acesso e keys (avançado), mas não é o fluxo principal para usuários comuns.Manual key creation remains available under Access and keys (advanced), but it is not the main flow for regular users.
CompatibilidadeA UI parte de agentes conhecidos, mas aceita runtimes externos com identificador, comando de health, pasta, workspace e arquivo principal.The UI starts with known agents, but accepts external runtimes with an id, health command, home folder, workspace and primary file.

Fluxo de dados no frontend. Frontend data flow.

01App.jsxhash routing + 14 views
02useMissionControlSSE + polling + mock
03apiClientauth + REST + runtimes
04mockMissionControlfallback state
05ToastProviderasync feedback
06MarkdownLitesafe lightweight render

InicializaçãoInitialization

O app lê window.location.hash para escolher a view inicial. Se o hash não existe ou é inválido, abre overview.The app reads window.location.hash to choose the initial view. If the hash is missing or invalid, it opens overview.

SincronizaçãoSynchronization

Em produção same-origin, a UI abre EventSource em /api/mission-control/stream. Em dev ou URL direta, usa polling em /state quando SSE não é a melhor opção.In same-origin production, the UI opens EventSource at /api/mission-control/stream. In dev or direct URL mode, it uses /state polling when SSE is not the best option.

FallbackFallback

Sem backend ou sem token utilizável, o app mantém a interface viva com createDemoMissionControl(), atualizando dados locais sem gerar spam de erro no console.Without a backend or usable token, the app keeps the interface alive with createDemoMissionControl(), refreshing local data without console error spam.

Contrato de estado que alimenta a UI. State contract that feeds the UI.

O shape abaixo é o centro do projeto. O painel não depende de uma infraestrutura específica: qualquer backend pode preencher esse contrato e a UI passa a mostrar seus agentes. The shape below is the center of the project. The panel does not depend on a specific infrastructure: any backend can fill this contract and the UI will show your agents.

GET /api/mission-control/stateminimum shape
{
  "status": { "label": "Runtime online", "healthy": true, "updatedAt": "..." },
  "metrics": [{ "label": "tokens hoje", "value": "304.3k", "delta": "+18%" }],
  "tokenSeries": { "input": [1200, 1500], "output": [320, 410] },
  "overview": { "serviceHealth": [], "queue": [], "incidents": [] },
  "models": [{ "name": "gpt-5.4", "share": 10 }],
  "activity": [{ "actor": "agent", "message": "...", "status": "OK" }],
  "subscriptions": [],
  "agents": [],
  "agentRuntimes": [],
  "liveEvents": [],
  "kanban": { "Backlog": [], "Todo": [], "Done": [] },
  "apiKeys": [],
  "apps": [],
  "docs": [],
  "hermes": {},
  "cliTools": []
}
agentsid, name, role, color, status, currentTask, workspace, tool, logs, workEvents, subagents, tasks
agentRuntimesid, name, family, command, home, workspacePath, configPath, recommendedScopes, configs, apiKey
kanbancolumns keyed by status; cards include title, meta, priority, owner, estimate, board
hermesanalytics, sessions, logLines, profileDocs, skillDocs, configFiles, jobs, routes, commands
docsid, title, body, updated, coverage, source, content
apiKeysid, name, tokenPrefix, scopes, createdAt, lastUsedAt, revokedAt

Rotas reais do backend Express. Real Express backend routes.

O backend roda em server/index.js. As rotas públicas cobrem health e status de auth; as demais exigem token de proxy, token estático, loopback confiável em dev ou uma Okami API Key com escopo suficiente. The backend runs in server/index.js. Public routes cover health and auth status; the others require a proxy token, static token, trusted loopback in dev or an Okami API Key with enough scope.

GET/api/healthHealthcheck simples da API.Simple API healthcheck.
GET/api/auth/statusInforma se existe auth configurada, bootstrap disponível, proxy, token estático e trust local.Reports configured auth, bootstrap availability, proxy, static token and local trust.
POST/api/auth/bootstrapCria a primeira key admin somente por loopback/proxy autorizado e enquanto não houver key ativa.Creates the first admin key only through authorized loopback/proxy while no active key exists.
GET/api/auth/keysLista keys por prefixo, escopos e status. Requer admin.Lists keys by prefix, scopes and status. Requires admin.
POST/api/auth/keysCria Okami API Key. O token completo aparece apenas na resposta de criação.Creates an Okami API Key. The full token appears only in the creation response.
DELETE/api/auth/keys/:idRevoga uma key sem apagar o histórico de auditoria.Revokes a key without deleting its audit history.
GET/api/mission-control/stateSnapshot completo para a UI.Complete snapshot for the UI.
GET/api/mission-control/streamSSE com eventos state, heartbeat e error.SSE with state, heartbeat and error events.
GET/api/mission-control/agent-runtimesLista agentes/runtimes registrados localmente.Lists locally registered agents/runtimes.
PUT/api/mission-control/agent-runtimes/:idCria ou atualiza runtime externo normalizado.Creates or updates a normalized external runtime.
POST/api/mission-control/agent-runtimes/:id/connectGera Okami API Key do agente, salva secret cifrado e tenta aplicar .okami.env via SSH.Generates the agent Okami API Key, stores the encrypted secret and tries to write .okami.env through SSH.
DELETE/api/mission-control/agent-runtimes/:idRemove runtime externo do registry local.Deletes an external runtime from the local registry.
GET/api/mission-control/appsLista de apps do registry local.List apps from the local registry.
PUT/api/mission-control/apps/:idCria ou atualiza app no registry.Creates or updates an app in the registry.
DELETE/api/mission-control/apps/:idRemove app do registry.Deletes an app from the registry.
GET/api/mission-control/docsLista documentos salvos localmente.Lists locally saved documents.
PUT/api/mission-control/docs/:idCria ou atualiza documento.Creates or updates a document.
DELETE/api/mission-control/docs/:idRemove documento.Deletes a document.
PUT/api/mission-control/apis/:idSalva configuração de provedor/API.Saves provider/API configuration.
DELETE/api/mission-control/apis/:idRemove configuração de provedor/API do registry.Deletes provider/API configuration from the registry.
POST/api/mission-control/apis/:id/testRetorna o status do registro; teste real de provider ainda não foi implementado.Returns registry status; real provider testing is not implemented yet.
POST/api/mission-control/apis/:id/rotateReservado para rotação real de secret; hoje responde 501.Reserved for real secret rotation; currently returns 501.
GET/api/hermes/configLê config do runtime bridge.Reads runtime bridge config.
PUT/api/hermes/configSalva config sem gravar senha crua.Saves config without storing raw password.
POST/api/hermes/ssh/keysRecebe private key e guarda em vault local.Receives a private key and stores it in the local vault.
POST/api/hermes/ssh/passwordGuarda senha SSH como secret local.Stores SSH password as a local secret.
POST/api/hermes/ssh/testTesta conexão SSH com latência.Tests SSH connection with latency.
GET/api/hermes/statusExecuta comandos seguros para status básico.Runs safe commands for basic status.
GET/api/hermes/logsLê tails de logs do runtime.Reads runtime log tails.
GET/api/hermes/kanban/tasksColeta tasks do Kanban real.Collects real Kanban tasks.
POST/api/hermes/kanban/tasksCria task no runtime quando o bridge permite.Creates a runtime task when the bridge allows it.
POST/api/hermes/commandExecuta somente comandos allowlisted.Runs allowlisted commands only.
POST/api/hermes/files/writeEscreve arquivos apenas dentro das raízes permitidas dos agentes.Writes files only inside the allowed agent roots.
POST/api/hermes/cron/saveAtualiza crontab remoto com linha validada.Updates remote crontab with a validated line.
POST/api/hermes/systemd-timer/saveAtualiza override de timer systemd.Updates a systemd timer override.

Escopos de API KeyAPI Key scopes

adminGerencia keys e executa conexão automática de agentes.Manages keys and runs automatic agent connection.
readLê state, stream e registries.Reads state, stream and registries.
writeCria, atualiza e remove apps, docs, APIs e agent runtimes.Creates, updates and deletes apps, docs, APIs and agent runtimes.
sshConfigura SSH, salva secrets, testa conexão, executa comandos allowlisted e escreve arquivos permitidos.Configures SSH, saves secrets, tests connection, runs allowlisted commands and writes allowed files.
kanbanCria tarefas no Kanban remoto quando a bridge está configurada.Creates tasks in the remote Kanban when the bridge is configured.
logsLê tails de logs do runtime conectado.Reads log tails from the connected runtime.

Como o stream ao vivo funciona. How the live stream works.

stream envelopetext/event-stream
event: state
data: {"status":{"healthy":true},"agents":[]}

event: heartbeat
data: {"t":1782130000000}

event: error
data: {"message":"SSH timeout"}
initial

Push inicialInitial push

Ao abrir a conexão, o backend tenta enviar o primeiro snapshot completo.When the connection opens, the backend tries to send the first complete snapshot.

diff

Hash leveLight hash

A API compara tamanho do JSON e lastUpdated para evitar push repetido.The API compares JSON length and lastUpdated to avoid repeated pushes.

alive

Heartbeat

Se nada mudou, envia heartbeat e ping para manter a conexão aberta.If nothing changed, it sends heartbeat and ping to keep the connection open.

fallback

Polling

Se EventSource fechar de vez, o cliente chama /state por intervalo.If EventSource closes, the client calls /state on an interval.

Store local, registries e secrets. Local store, registries and secrets.

O backend usa server/.data para persistir configuração local. Essa pasta deve permanecer fora do Git. Ela permite salvar preferências, apps, docs, APIs e credenciais sem colocar segredos no repositório. The backend uses server/.data to persist local configuration. This folder must stay out of Git. It lets you save preferences, apps, docs, APIs and credentials without putting secrets in the repository.

config.jsonruntime configsshHost, sshUser, hermesHome, routingMode
secrets.jsonvault refsvault://ssh-key/* · vault://ssh-password/* · vault://agent-api-key/*
registry.jsonapps/docs/apis/runtimeseditable local registries, including agentRuntimes
auth.jsonapi key hashestokenPrefix, tokenHash, scopes, createdAt, lastUsedAt, revokedAt
secret.keyAES-256-GCMlocal encryption key for secrets.json
fingerprintSHA256secret preview without raw value

Conecte qualquer runtime compatível ao painel. Connect any compatible runtime to the panel.

O backend ainda usa o prefixo /api/hermes/* por compatibilidade histórica, mas a função é genérica: coletar dados do ambiente do usuário, normalizar no contrato de estado e manter credenciais isoladas no backend. The backend still uses the /api/hermes/* prefix for historical compatibility, but the function is generic: collect data from the user's environment, normalize it into the state contract and keep credentials isolated in the backend.

AuthKey SSH recomendada; password existe como fallback e fica no vault local.SSH key recommended; password exists as fallback and stays in the local vault.
TimeoutComandos usam timeout para evitar UI presa em operação remota.Commands use timeouts to avoid a remote operation freezing the UI.
RedactionTokens, API keys e env vars são mascarados antes de chegar ao painel.Tokens, API keys and env vars are masked before reaching the panel.
ScopeEscrita de arquivo é bloqueada fora de diretórios permitidos.File writing is blocked outside allowed directories.

O que o collector tenta lerWhat the collector tries to read

state.dbsessions, messages, models, sources, tool calls, token totals
kanban.dbboards, tasks, status, owner, priority, events, logs
profilesSOUL.md, MEMORY.md, USER.md, profile docs, identity files
skills.usage.json, SKILL.md, usage counters, profile ownership
jobscrontab -l, systemctl list-timers, unit names
logstail from runtime log directory with redaction
configsconfig.yaml, .env redacted, settings.json
commandsdoctor, config, status, insights, sessions stats

Pixel Office

O Pixel Office fica em src/PixelOfficeCanvas.jsx. Ele usa Phaser 4 em modo Canvas, carrega sprites de agentes, tiles/objetos do escritório, desenha zonas, mesas, paredes, mini Kanban e movimenta pessoas por rotas ortogonais. Pixel Office lives in src/PixelOfficeCanvas.jsx. It uses Phaser 4 in Canvas mode, loads agent sprites, office tiles/objects, draws zones, desks, walls, mini Kanban and moves people through orthogonal routes.

Pixel Office board view
assetspublic/*office.mp4, rpg characters, modern-office, tmj
sceneOfficeScenepreload, create, update
peoplebuildOfficePeopleagents + tasks into avatars
interactiononSelectAgentclick avatar to open inspector

Tokens visuais e convenções de UI. Visual tokens and UI conventions.

Colors--ok-bg-0..3, --ok-fg*, --ok-orange, --ok-magenta, --ok-cyan, --ok-success.
TypeSpace Grotesk para títulos; JetBrains Mono para labels, comandos e tabelas.Space Grotesk for titles; JetBrains Mono for labels, commands and tables.
ShapeCantos retos por padrão. Pílulas só quando representam status curto.Sharp corners by default. Pills only for short status labels.
Color rhythmCiano, magenta, laranja e verde devem alternar função; evite seção inteira monocromática.Cyan, magenta, orange and green should rotate by function; avoid fully monochrome sections.
MotionTransições curtas com --ok-ease; evite animação que esconda informação.Short transitions with --ok-ease; avoid animation that hides information.
ComponentsBotões, cards, tabs, filter bars, modal, toast, skeleton, markdown lite e terminal cards.Buttons, cards, tabs, filter bars, modal, toast, skeleton, markdown lite and terminal cards.

Build, preview e proxy de produção. Build, preview and production proxy.

production buildvite
npm run build
npm run preview

O repositório inclui functions/api/[[path]].js para Cloudflare Pages. A função copia headers seguros, remove hop-by-hop headers, injeta x-okami-proxy-token e encaminha chamadas para OKAMI_BACKEND_URL. Se o proxy não estiver configurado, retorna 503. The repository includes functions/api/[[path]].js for Cloudflare Pages. The function copies safe headers, removes hop-by-hop headers, injects x-okami-proxy-token and forwards calls to OKAMI_BACKEND_URL. If the proxy is not configured, it returns 503.

headerspublic/_headersX-Frame-Options, nosniff, no-referrer, permissions policy
proxysame-origin /apifrontend can call /api without public backend URL
tokenbackend proxy tokenrequired when production backend is protected

Cuidados de segurança ao conectar dados reais. Security notes for real data integrations.

  • Não versione server/.data, .env.local, private keys, senhas ou dumps de sessão.Do not version server/.data, .env.local, private keys, passwords or session dumps.
  • Trate Okami API Keys como credenciais reais: o token completo aparece uma única vez e o backend persiste somente hash, prefixo e escopos.Treat Okami API Keys as real credentials: the full token is shown once and the backend stores only hash, prefix and scopes.
  • Prefira usuário SSH com permissões mínimas para leitura e comandos específicos.Prefer an SSH user with minimal permissions for reading and specific commands.
  • Revise o allowlist de /api/hermes/command antes de liberar para outras pessoas.Review the /api/hermes/command allowlist before exposing it to other people.
  • Mantenha OKAMI_TRUST_LOCAL_DEV=0 se o ambiente local for compartilhado ou exposto por túnel.Keep OKAMI_TRUST_LOCAL_DEV=0 if the local environment is shared or exposed through a tunnel.
  • Mantenha o backend atrás de token, VPN, Cloudflare Access ou rede privada quando usar dados reais.Keep the backend behind a token, VPN, Cloudflare Access or private network when using real data.
  • Redija logs e documentos antes de renderizar conteúdo em ambientes compartilhados.Redact logs and documents before rendering content in shared environments.

Problemas comuns. Common issues.

mock

A UI só mostra dados mock.The UI only shows mock data.

Verifique VITE_OKAMI_API_BASE_URL, se o backend está rodando e se /api/mission-control/state responde.Check VITE_OKAMI_API_BASE_URL, whether the backend is running and whether /api/mission-control/state responds.

sse

Stream fecha ou não atualiza.Stream closes or does not update.

Teste /stream, confirme proxy sem buffering e reduza temporariamente OKAMI_STREAM_INTERVAL_MS.Test /stream, confirm proxy without buffering and temporarily reduce OKAMI_STREAM_INTERVAL_MS.

ssh

SSH falha no teste.SSH test fails.

Confirme host, porta, user, private key completa, passphrase e se a chave pública correspondente está autorizada no runtime.Confirm host, port, user, full private key, passphrase and whether the matching public key is authorized in the runtime.

pixel

Pixel Office em branco.Pixel Office is blank.

Verifique assets em public/, console do navegador e se Phaser conseguiu medir o container.Check assets under public/, browser console and whether Phaser could measure the container.

write

Arquivo não salva.File does not save.

A rota aceita somente raízes permitidas: runtime configurado, ~/.agents, ~/.codex, ~/.claude, ~/.openclaw, ~/.openhuman e runtimes registrados.The route accepts only allowed roots: configured runtime, ~/.agents, ~/.codex, ~/.claude, ~/.openclaw, ~/.openhuman and registered runtimes.

build

Build quebra.Build fails.

Rode npm install, confirme Node >= 18 e execute npm run build antes de abrir PR.Run npm install, confirm Node >= 18 and execute npm run build before opening a PR.

Como contribuir sem quebrar o painel. How to contribute without breaking the panel.

Checklist de PRPR checklist

  • Preserve o modo mock-first: a UI precisa abrir sem backend real.Preserve mock-first mode: the UI must open without a real backend.
  • Não introduza segredos em arquivos versionados.Do not introduce secrets into versioned files.
  • Use tokens --ok-* e mantenha ciano, magenta, laranja e verde em equilíbrio.Use --ok-* tokens and keep cyan, magenta, orange and green balanced.
  • Para nova view, adicione item em navGroups, componente em viewComponents e estado mock correspondente.For a new view, add an item in navGroups, a component in viewComponents and corresponding mock state.
  • Para nova rota, documente método, path, payload, auth e fallback mock.For a new route, document method, path, payload, auth and mock fallback.
  • Rode npm run build e teste hash navigation, troca PT/EN e Pixel Office.Run npm run build and test hash navigation, PT/EN switching and Pixel Office.