1
🔄 Dois Pipelines Separados
In-REPL Toast Queue
Mensagens de status no footer da UI do terminal
OS/Terminal Notifier
Notificacoes nativas de desktop (iTerm2, Kitty, Ghostty, bell)
2
📊 Ordenacao por Prioridade
| Prioridade | Rank | Comportamento |
|---|---|---|
| immediate | 0 | Preempta o display atual |
| high | 1 | Enfileirado, ganha sobre medium/low |
| medium | 2 | Ganha sobre low |
| low | 3 | Exibido por ultimo |
💡 Conceito-chave: fold
O campo fold mescla notificacoes de mesma chave como Array.reduce(). Notificacoes immediate empurram itens deslocados de volta para a fila.
3
🎣 Catalogo de 14 Hooks
| Hook | Key | Prioridade |
|---|---|---|
| Rate limit warning | rate-limit-warning | high |
| Limit reached | limit-reached | immediate |
| Model deprecation | model-deprecation-warning | high |
| LSP error | lsp-error-{source} | medium |
| Fast mode | fast-mode | high |
| MCP connectivity | mcp-connectivity | medium |
| IDE status | ide-status | medium |
| Settings errors | settings-error-* | high |
4
📢 Roteamento de Canais OS
iterm2OSC 9 sequence
kittyThree-step OSC 99 sequence
ghosttySingle OSC sequence
terminal_bellBEL (intencionalmente sem wrapper para tmux)
disabledNo-op
💡 BEL sem wrapper
BEL permanece sem wrapper para que bell-action do tmux seja acionado nativamente.
5
📦 Collapsing de Background Tasks
Apenas completions bem-sucedidas sao colapsadas. Tasks falhadas e mortas permanecem individuais. Modo verbose ignora collapsing.
Sucesso
Colapsado
Falha
Individual
Killed
Individual
6
🔒 MCP Channel Notifications (Kairos)
Gate de seguranca de 6 camadas:
1. Capability
2. Runtime flag
3. Auth
4. Org policy
5. Session opt-in
6. Allowlist
7
🗺️ Arvore de Decisao addNotification
flowchart TD
A["addNotification(notif)"] --> B{priority === immediate?}
B -->|Yes| C["clearTimeout(currentTimeoutId)"]
C --> D["Set new timeout\n(timeoutMs ?? 8000 ms)"]
D --> E["setAppState: current = notif\nqueue = prev items filtered"]
B -->|No| G{notif.fold defined?}
G -->|Yes| H{current.key === notif.key?}
H -->|Yes| I["fold(current, notif)\nreset timeout"]
H -->|No| J{queue has same key?}
J -->|Yes| K["fold queue item"]
J -->|No| L{key already in queue?}
G -->|No| L
L -->|Yes, duplicate| M["return prev (no-op)"]
L -->|No| Q["append notif to queue"]
Q --> R["processQueue()"]
📋 Resumo do Modulo
✅
Dois pipelines: toast queue para status interativo, OS notifier para sessoes em background
✅
Queue usa dequeuing baseado em prioridade, nao FIFO
✅
Notificacoes
immediate preemptam o display
✅
BEL permanece sem wrapper para compatibilidade com tmux
✅
Background bash completions colapsam no nivel da message-list
✅
MCP channel notifications passam por gate de seguranca de 6 camadas