@poolzin/pool-bot 2026.3.21 → 2026.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -0
- package/dist/acp/bindings-store.js +209 -0
- package/dist/acp/control-plane/runtime-cache.js +54 -0
- package/dist/acp/control-plane/runtime-options.js +215 -0
- package/dist/acp/control-plane/session-actor-queue.js +36 -0
- package/dist/acp/runtime/errors.js +47 -0
- package/dist/acp/runtime/registry.js +86 -0
- package/dist/acp/runtime/types.js +1 -0
- package/dist/acp/translator.js +97 -0
- package/dist/agents/failover-error.js +145 -47
- package/dist/browser/browser-profile-manager.js +319 -0
- package/dist/browser/cdp-proxy-bypass.js +129 -0
- package/dist/browser/cdp-timeouts.js +41 -0
- package/dist/browser/chrome-extension-validator.js +406 -0
- package/dist/browser/chrome-mcp-snapshot.js +222 -0
- package/dist/browser/chrome-mcp.js +421 -0
- package/dist/browser/chrome-mcp.snapshot.js +133 -0
- package/dist/browser/errors.js +67 -0
- package/dist/browser/form-fields.js +22 -0
- package/dist/browser/output-atomic.js +44 -0
- package/dist/browser/profile-capabilities.js +47 -0
- package/dist/browser/safe-filename.js +25 -0
- package/dist/browser/snapshot-roles.js +60 -0
- package/dist/build-info.json +3 -3
- package/dist/commands/security-owner-only.js +86 -0
- package/dist/control-ui/assets/{index-Dvkl4Xlx.js → index-D7shnQwQ.js} +404 -388
- package/dist/control-ui/assets/index-D7shnQwQ.js.map +1 -0
- package/dist/control-ui/index.html +1 -1
- package/dist/cron/cron-filters.js +150 -0
- package/dist/gateway/device-pairing-security.js +197 -0
- package/dist/gateway/event-deduplication.js +167 -0
- package/dist/gateway/run-tracker.js +253 -0
- package/dist/gateway/server-methods/nodes.js +14 -0
- package/dist/gateway/websocket-preauth-security.js +188 -0
- package/dist/infra/errors.js +53 -13
- package/dist/infra/exec-approvals-security.js +217 -0
- package/dist/infra/security/command-analyzer.js +257 -0
- package/dist/plugins/loader.js +16 -8
- package/dist/security/external-content.js +51 -1
- package/dist/sessions/session-costs.js +228 -0
- package/dist/shared/param-key.js +16 -0
- package/dist/shared/poll-params.js +58 -0
- package/dist/shared/polls.js +55 -0
- package/docs/DASHBOARD-GAP-ANALYSIS-AND-PLAN.md +430 -0
- package/docs/FEATURES.md +523 -0
- package/docs/FINAL-IMPLEMENTATION-REVIEW.md +274 -0
- package/docs/FINAL-IMPLEMENTATION-SUMMARY.md +356 -0
- package/docs/FINAL-PROFESSIONAL-EVALUATION.md +312 -0
- package/docs/IMPLEMENTATION-PRIORITY-EVALUATION.md +298 -0
- package/docs/IMPLEMENTATION-PROGRESS.md +237 -0
- package/docs/IMPLEMENTATION-REVIEW-PHASE1-2.md +381 -0
- package/docs/IMPLEMENTATION-REVIEW-PHASE4.md +389 -0
- package/docs/IMPLEMENTATION-REVIEW-PHASE5.md +420 -0
- package/docs/IMPLEMENTATION-REVIEW-PHASE6.md +422 -0
- package/docs/IMPLEMENTATION-REVIEW-PHASE7-FINAL.md +184 -0
- package/docs/MIKRODASH-ANALYSIS.md +412 -0
- package/docs/OPENCLAW-GAP-ANALYSIS-FINAL.md +431 -0
- package/docs/OPENCLAW-VS-POOLBOT-ANALYSIS.md +351 -0
- package/docs/PHASE-7-SUMMARY.md +144 -0
- package/docs/POOLBOT-OFFICE-PLAN.md +697 -0
- package/docs/PROJECT-FINAL-STATUS.md +237 -0
- package/docs/README.md +116 -0
- package/docs/REAL-IMPROVEMENTS-EVALUATION.md +477 -0
- package/docs/SECURITY-HARDENING-IMPLEMENTATION.md +161 -0
- package/docs/channels/googlechat.md +235 -206
- package/docs/channels/irc.md +332 -0
- package/docs/channels/nostr.md +255 -168
- package/docs/components/command-palette.md +166 -0
- package/docs/components/login-gate.md +219 -0
- package/docs/getting-started/installation.md +191 -0
- package/docs/getting-started/introduction.md +120 -0
- package/docs/improvements/USAGE-GUIDE.md +359 -0
- package/docs/plans/2026-03-15-openclaw-features-implementation.md +1632 -0
- package/docs/reference/deadcode-detection.md +72 -0
- package/extensions/acpx/node_modules/.bin/acpx +21 -0
- package/extensions/agency-agents/node_modules/.bin/vite +4 -4
- package/extensions/agency-agents/node_modules/.bin/vitest +2 -2
- package/extensions/googlechat/node_modules/.bin/tsc +21 -0
- package/extensions/googlechat/node_modules/.bin/tsserver +21 -0
- package/extensions/googlechat/node_modules/.bin/vitest +21 -0
- package/extensions/googlechat/package.json +11 -28
- package/extensions/googlechat/src/googlechat-channel.test.ts +60 -0
- package/extensions/googlechat/src/googlechat-channel.ts +120 -0
- package/extensions/googlechat/src/index.ts +14 -0
- package/extensions/irc/node_modules/.bin/tsc +21 -0
- package/extensions/irc/node_modules/.bin/tsserver +21 -0
- package/extensions/irc/node_modules/.bin/vitest +21 -0
- package/extensions/irc/package.json +16 -8
- package/extensions/irc/src/index.ts +14 -0
- package/extensions/irc/src/irc-channel.test.ts +43 -0
- package/extensions/irc/src/irc-channel.ts +191 -0
- package/extensions/keyed-async-queue/node_modules/.bin/tsc +21 -0
- package/extensions/keyed-async-queue/node_modules/.bin/tsserver +21 -0
- package/extensions/keyed-async-queue/node_modules/.bin/vitest +21 -0
- package/extensions/keyed-async-queue/package.json +20 -0
- package/extensions/keyed-async-queue/src/index.ts +14 -0
- package/extensions/keyed-async-queue/src/queue.test.ts +135 -0
- package/extensions/keyed-async-queue/src/queue.ts +200 -0
- package/extensions/memory-core/node_modules/.bin/tsc +21 -0
- package/extensions/memory-core/node_modules/.bin/tsserver +21 -0
- package/extensions/memory-core/node_modules/.bin/vitest +21 -0
- package/extensions/memory-core/package.json +11 -8
- package/extensions/memory-core/src/index.ts +14 -0
- package/extensions/memory-core/src/memory-manager.test.ts +124 -0
- package/extensions/memory-core/src/memory-manager.ts +186 -0
- package/extensions/nostr/node_modules/.bin/tsc +2 -2
- package/extensions/nostr/node_modules/.bin/tsserver +2 -2
- package/extensions/nostr/node_modules/.bin/vitest +21 -0
- package/extensions/nostr/package.json +15 -24
- package/extensions/nostr/src/index.ts +14 -0
- package/extensions/nostr/src/nostr-channel.test.ts +55 -0
- package/extensions/nostr/src/nostr-channel.ts +228 -0
- package/extensions/page-agent/node_modules/.bin/vitest +2 -2
- package/extensions/test-utils/node_modules/.bin/jiti +21 -0
- package/extensions/test-utils/node_modules/.bin/playwright +21 -0
- package/extensions/test-utils/node_modules/.bin/tsx +21 -0
- package/extensions/test-utils/node_modules/.bin/vite +21 -0
- package/extensions/test-utils/node_modules/.bin/vitest +21 -0
- package/extensions/test-utils/node_modules/.bin/yaml +21 -0
- package/extensions/xyops/node_modules/.bin/vitest +2 -2
- package/package.json +2 -1
- package/dist/control-ui/assets/index-Dvkl4Xlx.js.map +0 -1
- package/extensions/googlechat/node_modules/.bin/poolbot +0 -21
- package/extensions/memory-core/node_modules/.bin/poolbot +0 -21
|
@@ -0,0 +1,697 @@
|
|
|
1
|
+
# PoolBot Office — Plano de Implementação Completo
|
|
2
|
+
|
|
3
|
+
**Data:** 2026-03-13
|
|
4
|
+
**Analista:** Build Agent
|
|
5
|
+
**Status:** ✅ Planning Complete
|
|
6
|
+
**Baseado em:** OpenClaw Office v2026.3.8-1
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 📊 RESUMO EXECUTIVO
|
|
11
|
+
|
|
12
|
+
**PoolBot Office** será o frontend visual de monitoramento e gerenciamento para o sistema Multi-Agent do PoolBot, baseado na arquitetura do OpenClaw Office.
|
|
13
|
+
|
|
14
|
+
**Metáfora Central:**
|
|
15
|
+
- Agent = Funcionário Digital
|
|
16
|
+
- Office = Runtime do Agent
|
|
17
|
+
- Desk = Session
|
|
18
|
+
- Meeting Pod = Contexto de Colaboração
|
|
19
|
+
|
|
20
|
+
**Diferencial PoolBot:**
|
|
21
|
+
- ✅ Integração nativa com 50+ channels (Telegram, Discord, Slack, etc.)
|
|
22
|
+
- ✅ 339+ skills OpenClaw integradas
|
|
23
|
+
- ✅ Gateway health endpoints HTTP
|
|
24
|
+
- ✅ Suporte a remote gateway (Tailscale, SSH tunnel)
|
|
25
|
+
- ✅ UI brasileira/latam friendly
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 🎯 ARQUITETURA DO SISTEMA
|
|
30
|
+
|
|
31
|
+
### Visão Geral
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
35
|
+
│ PoolBot Office │
|
|
36
|
+
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
|
|
37
|
+
│ │ Virtual │ │ Console │ │ Chat │ │
|
|
38
|
+
│ │ Office │ │ Dashboard │ │ Interface │ │
|
|
39
|
+
│ │ (2D + 3D) │ │ Management │ │ (Docked) │ │
|
|
40
|
+
│ └──────────────┘ └──────────────┘ └──────────────┘ │
|
|
41
|
+
└─────────────────────────────────────────────────────────────┘
|
|
42
|
+
│
|
|
43
|
+
│ WebSocket (/gateway-ws)
|
|
44
|
+
│
|
|
45
|
+
▼
|
|
46
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
47
|
+
│ PoolBot Gateway │
|
|
48
|
+
│ - Agent Runtime │
|
|
49
|
+
│ - Channel Management (Telegram, Discord, Slack, etc.) │
|
|
50
|
+
│ - Skills (339+ OpenClaw) │
|
|
51
|
+
│ - Cron Jobs │
|
|
52
|
+
│ - Health Endpoints (/health, /healthz, /ready, /readyz) │
|
|
53
|
+
└─────────────────────────────────────────────────────────────┘
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 📁 ESTRUTURA DE DIRETÓRIOS
|
|
59
|
+
|
|
60
|
+
### Estrutura Base (Copiada do OpenClaw Office)
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
poolbot-office/
|
|
64
|
+
├── bin/
|
|
65
|
+
│ ├── poolbot-office.js # CLI principal
|
|
66
|
+
│ ├── poolbot-office-config.js # Configuração
|
|
67
|
+
│ └── poolbot-office-server.js # Servidor HTTP
|
|
68
|
+
├── src/
|
|
69
|
+
│ ├── components/
|
|
70
|
+
│ │ ├── chat/ # Chat interface
|
|
71
|
+
│ │ │ ├── ChatDialog.tsx
|
|
72
|
+
│ │ │ ├── ChatDockBar.tsx
|
|
73
|
+
│ │ │ ├── AgentSelector.tsx
|
|
74
|
+
│ │ │ ├── MessageBubble.tsx
|
|
75
|
+
│ │ │ ├── StreamingIndicator.tsx
|
|
76
|
+
│ │ │ ├── SessionSwitcher.tsx
|
|
77
|
+
│ │ │ └── ChatTimelineDrawer.tsx
|
|
78
|
+
│ │ ├── console/ # Console dashboard
|
|
79
|
+
│ │ │ ├── dashboard/ # Dashboard page
|
|
80
|
+
│ │ │ ├── agents/ # Agents management
|
|
81
|
+
│ │ │ ├── channels/ # Channels management
|
|
82
|
+
│ │ │ ├── skills/ # Skills marketplace
|
|
83
|
+
│ │ │ ├── cron/ # Cron jobs
|
|
84
|
+
│ │ │ └── settings/ # Settings pages
|
|
85
|
+
│ │ ├── layout/ # Layout components
|
|
86
|
+
│ │ │ ├── AppShell.tsx
|
|
87
|
+
│ │ │ ├── TopBar.tsx
|
|
88
|
+
│ │ │ └── Sidebar.tsx
|
|
89
|
+
│ │ ├── office-2d/ # 2D office view
|
|
90
|
+
│ │ │ ├── OfficeLayout2D.tsx
|
|
91
|
+
│ │ │ ├── AgentDesk.tsx
|
|
92
|
+
│ │ │ ├── furniture/ # Furniture components
|
|
93
|
+
│ │ │ └── CollaborationLines.tsx
|
|
94
|
+
│ │ ├── office-3d/ # 3D office view
|
|
95
|
+
│ │ │ ├── OfficeLayout3D.tsx
|
|
96
|
+
│ │ │ ├── AgentCharacter.tsx
|
|
97
|
+
│ │ │ ├── SkillHologram.tsx
|
|
98
|
+
│ │ │ ├── SpawnPortal.tsx
|
|
99
|
+
│ │ │ └── ToolScreen.tsx
|
|
100
|
+
│ │ ├── overlays/ # Overlay components
|
|
101
|
+
│ │ │ └── SpeechBubble.tsx
|
|
102
|
+
│ │ ├── panels/ # Side panels
|
|
103
|
+
│ │ │ ├── AgentDetailPanel.tsx
|
|
104
|
+
│ │ │ ├── TokenLineChart.tsx
|
|
105
|
+
│ │ │ ├── CostPieChart.tsx
|
|
106
|
+
│ │ │ ├── ActivityHeatmap.tsx
|
|
107
|
+
│ │ │ └── EventTimeline.tsx
|
|
108
|
+
│ │ └── shared/ # Shared components
|
|
109
|
+
│ │ ├── SvgAvatar.tsx
|
|
110
|
+
│ │ ├── ToastContainer.tsx
|
|
111
|
+
│ │ └── CollapsibleSection.tsx
|
|
112
|
+
│ ├── gateway/ # Gateway communication
|
|
113
|
+
│ │ ├── WebSocketClient.ts
|
|
114
|
+
│ │ ├── types.ts
|
|
115
|
+
│ │ └── utils.ts
|
|
116
|
+
│ ├── hooks/ # React hooks
|
|
117
|
+
│ │ ├── useSidebarLayout.ts
|
|
118
|
+
│ │ ├── useWebSocket.ts
|
|
119
|
+
│ │ └── useAgentStatus.ts
|
|
120
|
+
│ ├── i18n/ # Internationalization
|
|
121
|
+
│ │ ├── locales/
|
|
122
|
+
│ │ │ ├── en/
|
|
123
|
+
│ │ │ └── pt-BR/ # 🇧🇷 Português brasileiro
|
|
124
|
+
│ │ └── index.ts
|
|
125
|
+
│ ├── lib/ # Utilities
|
|
126
|
+
│ │ ├── avatar-generator.ts
|
|
127
|
+
│ │ ├── color-utils.ts
|
|
128
|
+
│ │ └── format-utils.ts
|
|
129
|
+
│ ├── store/ # State management (Zustand)
|
|
130
|
+
│ │ ├── office-store.ts
|
|
131
|
+
│ │ ├── agent-store.ts
|
|
132
|
+
│ │ ├── chat-store.ts
|
|
133
|
+
│ │ └── console-stores/
|
|
134
|
+
│ ├── styles/ # Global styles
|
|
135
|
+
│ │ └── globals.css
|
|
136
|
+
│ ├── App.tsx # Main app component
|
|
137
|
+
│ └── main.tsx # Entry point
|
|
138
|
+
├── public/ # Static assets
|
|
139
|
+
│ ├── favicon.ico
|
|
140
|
+
│ └── assets/
|
|
141
|
+
├── package.json
|
|
142
|
+
├── tsconfig.json
|
|
143
|
+
├── vite.config.ts
|
|
144
|
+
└── README.md
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 🔧 TECH STACK
|
|
150
|
+
|
|
151
|
+
### Base (Mesma do OpenClaw Office)
|
|
152
|
+
|
|
153
|
+
| Camada | Tecnologia | Versão |
|
|
154
|
+
|--------|------------|--------|
|
|
155
|
+
| **Build Tool** | Vite | 6.x |
|
|
156
|
+
| **UI Framework** | React | 19.x |
|
|
157
|
+
| **2D Rendering** | SVG + CSS Animations | - |
|
|
158
|
+
| **3D Rendering** | React Three Fiber (R3F) | 9.5.x |
|
|
159
|
+
| **3D Helpers** | @react-three/drei | 10.7.x |
|
|
160
|
+
| **Post-Processing** | @react-three/postprocessing | 3.0.x |
|
|
161
|
+
| **State Management** | Zustand | 5.0.x |
|
|
162
|
+
| **State Utils** | Immer | 10.1.x |
|
|
163
|
+
| **Styling** | Tailwind CSS | 4.1.x |
|
|
164
|
+
| **Routing** | React Router | 7.x |
|
|
165
|
+
| **Charts** | Recharts | 2.15.x |
|
|
166
|
+
| **i18n** | i18next + react-i18next | 25.8.x |
|
|
167
|
+
| **Icons** | Lucide React | 0.575.x |
|
|
168
|
+
| **Markdown** | react-markdown + remark-gfm | 10.1.x |
|
|
169
|
+
| **3D Engine** | Three.js | 0.183.x |
|
|
170
|
+
| **Real-time** | WebSocket Nativo | - |
|
|
171
|
+
|
|
172
|
+
### PoolBot-Specific
|
|
173
|
+
|
|
174
|
+
| Componente | Tecnologia | Notas |
|
|
175
|
+
|------------|------------|-------|
|
|
176
|
+
| **Gateway** | PoolBot Gateway | Porta 18789 (padrão) |
|
|
177
|
+
| **Auth** | Token-based | Mesmo schema do PoolBot |
|
|
178
|
+
| **Channels** | 50+ channels | Telegram, Discord, Slack, etc. |
|
|
179
|
+
| **Skills** | 339+ OpenClaw | Todas integradas |
|
|
180
|
+
| **Health** | HTTP endpoints | /health, /healthz, /ready, /readyz |
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## 🚀 IMPLEMENTAÇÃO POR FASES
|
|
185
|
+
|
|
186
|
+
### Fase 1: Fundação (16-20h)
|
|
187
|
+
|
|
188
|
+
#### 1.1 Setup do Projeto (4h)
|
|
189
|
+
```bash
|
|
190
|
+
# Criar estrutura base
|
|
191
|
+
mkdir -p poolbot-office/{bin,src,public}
|
|
192
|
+
cd poolbot-office
|
|
193
|
+
|
|
194
|
+
# Inicializar projeto
|
|
195
|
+
pnpm init
|
|
196
|
+
pnpm add -D typescript vite @vitejs/plugin-react tailwindcss @tailwindcss/vite
|
|
197
|
+
pnpm add react react-dom react-router-dom
|
|
198
|
+
pnpm add zustand immer
|
|
199
|
+
pnpm add lucide-react react-markdown remark-gfm
|
|
200
|
+
pnpm add @react-three/fiber @react-three/drei @react-three/postprocessing three
|
|
201
|
+
pnpm add i18next react-i18next i18next-browser-languagedetector
|
|
202
|
+
pnpm add recharts
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
**Arquivos Criados:**
|
|
206
|
+
- `package.json` (PoolBot Office)
|
|
207
|
+
- `tsconfig.json`
|
|
208
|
+
- `vite.config.ts`
|
|
209
|
+
- `tailwind.config.ts`
|
|
210
|
+
- `src/main.tsx`
|
|
211
|
+
- `src/App.tsx`
|
|
212
|
+
|
|
213
|
+
#### 1.2 CLI e Servidor (6h)
|
|
214
|
+
**Arquivos:**
|
|
215
|
+
- `bin/poolbot-office.js` (CLI principal)
|
|
216
|
+
- `bin/poolbot-office-config.js` (Configuração)
|
|
217
|
+
- `bin/poolbot-office-server.js` (Servidor HTTP)
|
|
218
|
+
|
|
219
|
+
**Features:**
|
|
220
|
+
```javascript
|
|
221
|
+
// poolbot-office --help
|
|
222
|
+
PoolBot Office — Visual Agent Monitoring
|
|
223
|
+
|
|
224
|
+
Usage:
|
|
225
|
+
poolbot-office [options]
|
|
226
|
+
|
|
227
|
+
Options:
|
|
228
|
+
-t, --token <token> Gateway auth token (auto-detected from ~/.poolbot)
|
|
229
|
+
-g, --gateway <url> Gateway WebSocket URL (default: ws://localhost:18789)
|
|
230
|
+
-p, --port <port> Server port (default: 5180)
|
|
231
|
+
--host <host> Bind address (default: 0.0.0.0)
|
|
232
|
+
-h, --help Show help
|
|
233
|
+
|
|
234
|
+
Examples:
|
|
235
|
+
poolbot-office # Auto-detect local gateway
|
|
236
|
+
poolbot-office --token abc123 # Explicit token
|
|
237
|
+
poolbot-office -g ws://remote:18789 # Remote gateway
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
**Auto-Detect Token:**
|
|
241
|
+
```javascript
|
|
242
|
+
// Detecta token automaticamente de ~/.poolbot/credentials/
|
|
243
|
+
import { readFileSync } from 'node:fs';
|
|
244
|
+
import { homedir } from 'node:os';
|
|
245
|
+
import { join } from 'node:path';
|
|
246
|
+
|
|
247
|
+
function detectPoolBotToken() {
|
|
248
|
+
try {
|
|
249
|
+
const credentialsPath = join(homedir(), '.poolbot', 'credentials', 'gateway.json');
|
|
250
|
+
const credentials = JSON.parse(readFileSync(credentialsPath, 'utf-8'));
|
|
251
|
+
return credentials.token;
|
|
252
|
+
} catch {
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
#### 1.3 Gateway WebSocket Client (6h)
|
|
259
|
+
**Arquivos:**
|
|
260
|
+
- `src/gateway/WebSocketClient.ts`
|
|
261
|
+
- `src/gateway/types.ts`
|
|
262
|
+
- `src/gateway/utils.ts`
|
|
263
|
+
|
|
264
|
+
**Features:**
|
|
265
|
+
- ✅ Conexão WebSocket para `/gateway-ws`
|
|
266
|
+
- ✅ Auto-reconnect com exponential backoff
|
|
267
|
+
- ✅ Heartbeat/ping-pong
|
|
268
|
+
- ✅ Message queue offline
|
|
269
|
+
- ✅ Type-safe events
|
|
270
|
+
|
|
271
|
+
**Eventos Suportados:**
|
|
272
|
+
```typescript
|
|
273
|
+
// PoolBot Gateway Events
|
|
274
|
+
interface GatewayEvents {
|
|
275
|
+
// Agent events
|
|
276
|
+
'agent.spawn': (agent: Agent) => void;
|
|
277
|
+
'agent.despawn': (agentId: string) => void;
|
|
278
|
+
'agent.status': (status: AgentStatus) => void;
|
|
279
|
+
|
|
280
|
+
// Session events
|
|
281
|
+
'session.created': (session: Session) => void;
|
|
282
|
+
'session.updated': (session: Session) => void;
|
|
283
|
+
|
|
284
|
+
// Message events
|
|
285
|
+
'message.new': (message: Message) => void;
|
|
286
|
+
'message.streaming': (chunk: MessageChunk) => void;
|
|
287
|
+
|
|
288
|
+
// Tool events
|
|
289
|
+
'tool.call': (toolCall: ToolCall) => void;
|
|
290
|
+
'tool.result': (toolResult: ToolResult) => void;
|
|
291
|
+
|
|
292
|
+
// Channel events
|
|
293
|
+
'channel.status': (status: ChannelStatus) => void;
|
|
294
|
+
'channel.qr': (qr: QRCode) => void;
|
|
295
|
+
|
|
296
|
+
// System events
|
|
297
|
+
'gateway.health': (health: HealthStatus) => void;
|
|
298
|
+
'gateway.error': (error: GatewayError) => void;
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
### Fase 2: Virtual Office (24-32h)
|
|
305
|
+
|
|
306
|
+
#### 2.1 2D Office Layout (12-16h)
|
|
307
|
+
**Arquivos:**
|
|
308
|
+
- `src/components/office-2d/OfficeLayout2D.tsx`
|
|
309
|
+
- `src/components/office-2d/AgentDesk.tsx`
|
|
310
|
+
- `src/components/office-2d/furniture/` (Desk, Chair, Plant, etc.)
|
|
311
|
+
- `src/components/office-2d/CollaborationLines.tsx`
|
|
312
|
+
|
|
313
|
+
**Features:**
|
|
314
|
+
- ✅ SVG floor plan isométrico
|
|
315
|
+
- ✅ Desk zones (fixed + hot desks)
|
|
316
|
+
- ✅ Meeting areas
|
|
317
|
+
- ✅ Furniture (desks, chairs, sofas, plants, coffee cups)
|
|
318
|
+
- ✅ Agent avatars com status animations
|
|
319
|
+
- ✅ Collaboration lines entre agents
|
|
320
|
+
|
|
321
|
+
**Avatar Generator:**
|
|
322
|
+
```typescript
|
|
323
|
+
// Gera avatar determinístico baseado no agent ID
|
|
324
|
+
function generateAvatar(agentId: string): SVGElement {
|
|
325
|
+
const hash = hashCode(agentId);
|
|
326
|
+
const colors = [
|
|
327
|
+
'#FF6B6B', '#4ECDC4', '#45B7D1', '#FFA07A', '#98D8C8',
|
|
328
|
+
'#F7DC6F', '#BB8FCE', '#F1948A', '#82E0AA', '#85C1E9'
|
|
329
|
+
];
|
|
330
|
+
|
|
331
|
+
return `
|
|
332
|
+
<svg viewBox="0 0 100 100">
|
|
333
|
+
<circle cx="50" cy="50" r="45" fill="${colors[hash % colors.length]}" />
|
|
334
|
+
<text x="50" y="65" text-anchor="middle" fill="white" font-size="40">
|
|
335
|
+
${agentId.charAt(0).toUpperCase()}
|
|
336
|
+
</text>
|
|
337
|
+
</svg>
|
|
338
|
+
`;
|
|
339
|
+
}
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
#### 2.2 3D Office Layout (12-16h)
|
|
343
|
+
**Arquivos:**
|
|
344
|
+
- `src/components/office-3d/OfficeLayout3D.tsx`
|
|
345
|
+
- `src/components/office-3d/AgentCharacter.tsx`
|
|
346
|
+
- `src/components/office-3d/SkillHologram.tsx`
|
|
347
|
+
- `src/components/office-3d/SpawnPortal.tsx`
|
|
348
|
+
- `src/components/office-3d/ToolScreen.tsx`
|
|
349
|
+
|
|
350
|
+
**Features:**
|
|
351
|
+
- ✅ React Three Fiber scene
|
|
352
|
+
- ✅ Character models (low-poly)
|
|
353
|
+
- ✅ Skill holograms (floating UI)
|
|
354
|
+
- ✅ Spawn portal effects
|
|
355
|
+
- ✅ Post-processing (bloom, SSAO)
|
|
356
|
+
- ✅ Camera controls (orbit, zoom)
|
|
357
|
+
|
|
358
|
+
**Performance:**
|
|
359
|
+
- ✅ 60 FPS em GPU integrada
|
|
360
|
+
- ✅ LOD (Level of Detail) para distância
|
|
361
|
+
- ✅ Instanced rendering para furniture
|
|
362
|
+
- ✅ Lazy loading de assets 3D
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
### Fase 3: Chat Interface (12-16h)
|
|
367
|
+
|
|
368
|
+
#### 3.1 Chat Components (8-10h)
|
|
369
|
+
**Arquivos:**
|
|
370
|
+
- `src/components/chat/ChatDockBar.tsx`
|
|
371
|
+
- `src/components/chat/AgentSelector.tsx`
|
|
372
|
+
- `src/components/chat/MessageBubble.tsx`
|
|
373
|
+
- `src/components/chat/StreamingIndicator.tsx`
|
|
374
|
+
- `src/components/chat/SessionSwitcher.tsx`
|
|
375
|
+
|
|
376
|
+
**Features:**
|
|
377
|
+
- ✅ Bottom-docked chat bar
|
|
378
|
+
- ✅ Agent selector dropdown
|
|
379
|
+
- ✅ Streaming message display
|
|
380
|
+
- ✅ Markdown rendering
|
|
381
|
+
- ✅ Syntax highlighting (code blocks)
|
|
382
|
+
- ✅ Typing indicators
|
|
383
|
+
|
|
384
|
+
#### 3.2 Chat History (4-6h)
|
|
385
|
+
**Arquivos:**
|
|
386
|
+
- `src/components/chat/ChatTimelineDrawer.tsx`
|
|
387
|
+
- `src/components/chat/ChatDialog.tsx`
|
|
388
|
+
|
|
389
|
+
**Features:**
|
|
390
|
+
- ✅ Chat history drawer
|
|
391
|
+
- ✅ Timeline view
|
|
392
|
+
- ✅ Search messages
|
|
393
|
+
- ✅ Filter by agent/session
|
|
394
|
+
- ✅ Export conversation (MD, JSON, HTML)
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
### Fase 4: Console Dashboard (20-28h)
|
|
399
|
+
|
|
400
|
+
#### 4.1 Dashboard Page (6-8h)
|
|
401
|
+
**Arquivos:**
|
|
402
|
+
- `src/components/console/dashboard/DashboardPage.tsx`
|
|
403
|
+
- `src/components/console/dashboard/StatsCards.tsx`
|
|
404
|
+
- `src/components/console/dashboard/AlertBanners.tsx`
|
|
405
|
+
|
|
406
|
+
**Features:**
|
|
407
|
+
- ✅ Overview stats (agents, channels, sessions, tokens)
|
|
408
|
+
- ✅ Alert banners (channel down, high CPU, etc.)
|
|
409
|
+
- ✅ Channel overview cards
|
|
410
|
+
- ✅ Skill usage stats
|
|
411
|
+
- ✅ Quick navigation
|
|
412
|
+
|
|
413
|
+
#### 4.2 Agents Management (8-10h)
|
|
414
|
+
**Arquivos:**
|
|
415
|
+
- `src/components/console/agents/AgentsPage.tsx`
|
|
416
|
+
- `src/components/console/agents/AgentList.tsx`
|
|
417
|
+
- `src/components/console/agents/AgentDetail.tsx`
|
|
418
|
+
- `src/components/console/agents/tabs/` (Overview, Channels, Cron, Skills, Tools, Files)
|
|
419
|
+
|
|
420
|
+
**Features:**
|
|
421
|
+
- ✅ Agent list (create/delete/edit)
|
|
422
|
+
- ✅ Agent detail tabs
|
|
423
|
+
- ✅ Channel assignments
|
|
424
|
+
- ✅ Cron jobs per agent
|
|
425
|
+
- ✅ Skills installed
|
|
426
|
+
- ✅ Tools available
|
|
427
|
+
- ✅ Files attached
|
|
428
|
+
|
|
429
|
+
#### 4.3 Channels Management (4-6h)
|
|
430
|
+
**Arquivos:**
|
|
431
|
+
- `src/components/console/channels/ChannelsPage.tsx`
|
|
432
|
+
- `src/components/console/channels/ChannelCard.tsx`
|
|
433
|
+
- `src/components/console/channels/ChannelConfigDialog.tsx`
|
|
434
|
+
|
|
435
|
+
**Features:**
|
|
436
|
+
- ✅ Channel cards (Telegram, Discord, Slack, etc.)
|
|
437
|
+
- ✅ Configuration dialogs
|
|
438
|
+
- ✅ Stats per channel
|
|
439
|
+
- ✅ WhatsApp QR binding
|
|
440
|
+
- ✅ Channel status (online/offline)
|
|
441
|
+
|
|
442
|
+
#### 4.4 Skills Marketplace (4-6h)
|
|
443
|
+
**Arquivos:**
|
|
444
|
+
- `src/components/console/skills/SkillsPage.tsx`
|
|
445
|
+
- `src/components/console/skills/SkillCard.tsx`
|
|
446
|
+
- `src/components/console/skills/SkillDetailDialog.tsx`
|
|
447
|
+
|
|
448
|
+
**Features:**
|
|
449
|
+
- ✅ Skill marketplace (339+ skills)
|
|
450
|
+
- ✅ Search/filter skills
|
|
451
|
+
- ✅ Install options
|
|
452
|
+
- ✅ Skill detail dialogs
|
|
453
|
+
- ✅ Category browsing
|
|
454
|
+
|
|
455
|
+
#### 4.5 Cron Jobs (2-4h)
|
|
456
|
+
**Arquivos:**
|
|
457
|
+
- `src/components/console/cron/CronPage.tsx`
|
|
458
|
+
- `src/components/console/cron/CronList.tsx`
|
|
459
|
+
|
|
460
|
+
**Features:**
|
|
461
|
+
- ✅ Scheduled task management
|
|
462
|
+
- ✅ Cron expression editor
|
|
463
|
+
- ✅ Execution history
|
|
464
|
+
- ✅ Statistics (success/failure)
|
|
465
|
+
|
|
466
|
+
#### 4.6 Settings (6-8h)
|
|
467
|
+
**Arquivos:**
|
|
468
|
+
- `src/components/console/settings/SettingsPage.tsx`
|
|
469
|
+
- `src/components/console/settings/` (Providers, Appearance, Gateway, Developer, Advanced, About)
|
|
470
|
+
|
|
471
|
+
**Features:**
|
|
472
|
+
- ✅ Provider management (add/edit/model editor)
|
|
473
|
+
- ✅ System-discovered providers (OpenAI Codex OAuth, etc.)
|
|
474
|
+
- ✅ Appearance (theme, language)
|
|
475
|
+
- ✅ Gateway config (local/remote)
|
|
476
|
+
- ✅ Developer tools (debug mode, logs)
|
|
477
|
+
- ✅ Advanced settings
|
|
478
|
+
- ✅ About page (version, credits)
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
### Fase 5: State Management (8-12h)
|
|
483
|
+
|
|
484
|
+
#### 5.1 Zustand Stores (6-8h)
|
|
485
|
+
**Arquivos:**
|
|
486
|
+
- `src/store/office-store.ts`
|
|
487
|
+
- `src/store/agent-store.ts`
|
|
488
|
+
- `src/store/chat-store.ts`
|
|
489
|
+
- `src/store/console-stores/` (Agents, Channels, Skills, Cron, Settings)
|
|
490
|
+
|
|
491
|
+
**Features:**
|
|
492
|
+
- ✅ Centralized state
|
|
493
|
+
- ✅ Immer integration (mutable syntax)
|
|
494
|
+
- ✅ Persistence (localStorage)
|
|
495
|
+
- ✅ DevTools support
|
|
496
|
+
|
|
497
|
+
**Exemplo:**
|
|
498
|
+
```typescript
|
|
499
|
+
import { create } from 'zustand';
|
|
500
|
+
import { immer } from 'zustand/middleware/immer';
|
|
501
|
+
|
|
502
|
+
interface AgentState {
|
|
503
|
+
agents: Agent[];
|
|
504
|
+
selectedAgentId: string | null;
|
|
505
|
+
actions: {
|
|
506
|
+
addAgent: (agent: Agent) => void;
|
|
507
|
+
removeAgent: (agentId: string) => void;
|
|
508
|
+
updateAgentStatus: (agentId: string, status: AgentStatus) => void;
|
|
509
|
+
setSelectedAgent: (agentId: string | null) => void;
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
export const useAgentStore = create<AgentState>()(
|
|
514
|
+
immer((set) => ({
|
|
515
|
+
agents: [],
|
|
516
|
+
selectedAgentId: null,
|
|
517
|
+
actions: {
|
|
518
|
+
addAgent: (agent) => set((state) => {
|
|
519
|
+
state.agents.push(agent);
|
|
520
|
+
}),
|
|
521
|
+
removeAgent: (agentId) => set((state) => {
|
|
522
|
+
state.agents = state.agents.filter(a => a.id !== agentId);
|
|
523
|
+
}),
|
|
524
|
+
updateAgentStatus: (agentId, status) => set((state) => {
|
|
525
|
+
const agent = state.agents.find(a => a.id === agentId);
|
|
526
|
+
if (agent) agent.status = status;
|
|
527
|
+
}),
|
|
528
|
+
setSelectedAgent: (agentId) => set((state) => {
|
|
529
|
+
state.selectedAgentId = agentId;
|
|
530
|
+
}),
|
|
531
|
+
},
|
|
532
|
+
}))
|
|
533
|
+
);
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
#### 5.2 React Hooks (2-4h)
|
|
537
|
+
**Arquivos:**
|
|
538
|
+
- `src/hooks/useSidebarLayout.ts`
|
|
539
|
+
- `src/hooks/useWebSocket.ts`
|
|
540
|
+
- `src/hooks/useAgentStatus.ts`
|
|
541
|
+
|
|
542
|
+
**Features:**
|
|
543
|
+
- ✅ Reusable hooks
|
|
544
|
+
- ✅ Type-safe
|
|
545
|
+
- ✅ Error handling
|
|
546
|
+
- ✅ Loading states
|
|
547
|
+
|
|
548
|
+
---
|
|
549
|
+
|
|
550
|
+
### Fase 6: Internationalization (4-6h)
|
|
551
|
+
|
|
552
|
+
#### 6.1 i18n Setup (2-3h)
|
|
553
|
+
**Arquivos:**
|
|
554
|
+
- `src/i18n/index.ts`
|
|
555
|
+
- `src/i18n/locales/en/translations.json`
|
|
556
|
+
- `src/i18n/locales/pt-BR/translations.json`
|
|
557
|
+
|
|
558
|
+
**Features:**
|
|
559
|
+
- ✅ Português brasileiro (padrão)
|
|
560
|
+
- ✅ English
|
|
561
|
+
- ✅ Runtime language switching
|
|
562
|
+
- ✅ Pluralization
|
|
563
|
+
- ✅ Context-based translations
|
|
564
|
+
|
|
565
|
+
**Exemplo:**
|
|
566
|
+
```json
|
|
567
|
+
{
|
|
568
|
+
"office": {
|
|
569
|
+
"title": "Escritório Virtual",
|
|
570
|
+
"agents": {
|
|
571
|
+
"one": "{{count}} agente",
|
|
572
|
+
"other": "{{count}} agentes"
|
|
573
|
+
},
|
|
574
|
+
"status": {
|
|
575
|
+
"idle": "Ocioso",
|
|
576
|
+
"working": "Trabalhando",
|
|
577
|
+
"speaking": "Falando",
|
|
578
|
+
"error": "Erro"
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
#### 6.2 Translation Components (2-3h)
|
|
585
|
+
**Arquivos:**
|
|
586
|
+
- `src/components/shared/Trans.tsx`
|
|
587
|
+
- `src/i18n/useTranslation.ts`
|
|
588
|
+
|
|
589
|
+
**Features:**
|
|
590
|
+
- ✅ `<Trans>` component
|
|
591
|
+
- ✅ `useTranslation()` hook
|
|
592
|
+
- ✅ Language switcher UI
|
|
593
|
+
|
|
594
|
+
---
|
|
595
|
+
|
|
596
|
+
### Fase 7: Polish & Optimization (8-12h)
|
|
597
|
+
|
|
598
|
+
#### 7.1 Performance Optimization (4-6h)
|
|
599
|
+
**Features:**
|
|
600
|
+
- ✅ Code splitting (lazy loading)
|
|
601
|
+
- ✅ Image optimization
|
|
602
|
+
- ✅ 3D asset compression
|
|
603
|
+
- ✅ Memoization (React.memo, useMemo, useCallback)
|
|
604
|
+
- ✅ Virtual scrolling para listas longas
|
|
605
|
+
|
|
606
|
+
#### 7.2 Responsive Design (2-3h)
|
|
607
|
+
**Features:**
|
|
608
|
+
- ✅ Mobile-optimized
|
|
609
|
+
- ✅ Automatic 2D fallback (no mobile)
|
|
610
|
+
- ✅ Touch-friendly UI
|
|
611
|
+
- ✅ PWA support (installable)
|
|
612
|
+
|
|
613
|
+
#### 7.3 Accessibility (2-3h)
|
|
614
|
+
**Features:**
|
|
615
|
+
- ✅ ARIA labels
|
|
616
|
+
- ✅ Keyboard navigation
|
|
617
|
+
- ✅ Screen reader support
|
|
618
|
+
- ✅ High contrast mode
|
|
619
|
+
- ✅ Focus indicators
|
|
620
|
+
|
|
621
|
+
---
|
|
622
|
+
|
|
623
|
+
## 📊 CRONOGRAMA
|
|
624
|
+
|
|
625
|
+
| Fase | Tarefa | Horas | Status |
|
|
626
|
+
|------|--------|-------|--------|
|
|
627
|
+
| **1** | Fundação | 16-20h | ⏳ Pendente |
|
|
628
|
+
| **2** | Virtual Office | 24-32h | ⏳ Pendente |
|
|
629
|
+
| **3** | Chat Interface | 12-16h | ⏳ Pendente |
|
|
630
|
+
| **4** | Console Dashboard | 20-28h | ⏳ Pendente |
|
|
631
|
+
| **5** | State Management | 8-12h | ⏳ Pendente |
|
|
632
|
+
| **6** | Internationalization | 4-6h | ⏳ Pendente |
|
|
633
|
+
| **7** | Polish & Optimization | 8-12h | ⏳ Pendente |
|
|
634
|
+
| **TOTAL** | | **92-126h** | |
|
|
635
|
+
|
|
636
|
+
---
|
|
637
|
+
|
|
638
|
+
## 🎯 MVP (Minimum Viable Product)
|
|
639
|
+
|
|
640
|
+
**Funcionalidades Mínimas para Release:**
|
|
641
|
+
|
|
642
|
+
1. ✅ CLI + Servidor HTTP (Fase 1)
|
|
643
|
+
2. ✅ WebSocket Client (Fase 1)
|
|
644
|
+
3. ✅ 2D Office Layout (Fase 2.1)
|
|
645
|
+
4. ✅ Chat DockBar (Fase 3.1)
|
|
646
|
+
5. ✅ Dashboard Page (Fase 4.1)
|
|
647
|
+
6. ✅ Agents List (Fase 4.2)
|
|
648
|
+
7. ✅ i18n pt-BR/EN (Fase 6)
|
|
649
|
+
|
|
650
|
+
**Total MVP:** 40-52 horas
|
|
651
|
+
|
|
652
|
+
---
|
|
653
|
+
|
|
654
|
+
## 🚀 RELEASE PLAN
|
|
655
|
+
|
|
656
|
+
### v0.1.0 — MVP (2 semanas)
|
|
657
|
+
- ✅ CLI + Servidor
|
|
658
|
+
- ✅ 2D Office
|
|
659
|
+
- ✅ Chat básico
|
|
660
|
+
- ✅ Dashboard simples
|
|
661
|
+
- ✅ pt-BR/EN
|
|
662
|
+
|
|
663
|
+
### v0.2.0 — Console Completo (3 semanas)
|
|
664
|
+
- ✅ Agents management
|
|
665
|
+
- ✅ Channels management
|
|
666
|
+
- ✅ Skills marketplace
|
|
667
|
+
- ✅ Cron jobs
|
|
668
|
+
- ✅ Settings
|
|
669
|
+
|
|
670
|
+
### v0.3.0 — 3D Office (2 semanas)
|
|
671
|
+
- ✅ 3D scene
|
|
672
|
+
- ✅ Character models
|
|
673
|
+
- ✅ Skill holograms
|
|
674
|
+
- ✅ Spawn effects
|
|
675
|
+
|
|
676
|
+
### v1.0.0 — Production Ready (1 semana)
|
|
677
|
+
- ✅ Performance optimization
|
|
678
|
+
- ✅ Responsive design
|
|
679
|
+
- ✅ Accessibility
|
|
680
|
+
- ✅ Documentation
|
|
681
|
+
|
|
682
|
+
---
|
|
683
|
+
|
|
684
|
+
## 📝 PRÓXIMOS PASSOS
|
|
685
|
+
|
|
686
|
+
1. **Aprovar plano** — Confirmar escopo e cronograma
|
|
687
|
+
2. **Setup inicial** — Criar estrutura do projeto
|
|
688
|
+
3. **Implementar Fase 1** — Fundação (CLI + WebSocket)
|
|
689
|
+
4. **Iterar** — Desenvolver fases subsequentes
|
|
690
|
+
5. **Testar** — Validação contínua
|
|
691
|
+
6. **Publicar** — NPM package `@poolzin/poolbot-office`
|
|
692
|
+
|
|
693
|
+
---
|
|
694
|
+
|
|
695
|
+
**Assinado:** Build Agent
|
|
696
|
+
**Data:** 2026-03-13
|
|
697
|
+
**Próxima Revisão:** Após aprovação do plano
|