@poolzin/pool-bot 2026.3.22 → 2026.3.24

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.
Files changed (159) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/dist/.buildstamp +1 -1
  3. package/dist/acp/bindings-store.js +209 -0
  4. package/dist/acp/control-plane/runtime-cache.js +54 -0
  5. package/dist/acp/control-plane/runtime-options.js +215 -0
  6. package/dist/acp/control-plane/session-actor-queue.js +36 -0
  7. package/dist/acp/policy.js +52 -0
  8. package/dist/acp/runtime/errors.js +47 -0
  9. package/dist/acp/runtime/registry.js +86 -0
  10. package/dist/acp/runtime/types.js +1 -0
  11. package/dist/acp/translator.js +97 -0
  12. package/dist/agents/btw.js +280 -0
  13. package/dist/agents/failover-error.js +145 -47
  14. package/dist/agents/fast-mode.js +24 -0
  15. package/dist/agents/live-model-errors.js +23 -0
  16. package/dist/agents/model-auth-env-vars.js +44 -0
  17. package/dist/agents/model-auth-markers.js +69 -0
  18. package/dist/agents/models-config.providers.discovery.js +180 -0
  19. package/dist/agents/models-config.providers.static.js +480 -0
  20. package/dist/auto-reply/reply/typing-policy.js +15 -0
  21. package/dist/browser/browser-profile-manager.js +319 -0
  22. package/dist/browser/cdp-proxy-bypass.js +129 -0
  23. package/dist/browser/cdp-timeouts.js +41 -0
  24. package/dist/browser/chrome-extension-validator.js +406 -0
  25. package/dist/browser/chrome-mcp-snapshot.js +222 -0
  26. package/dist/browser/chrome-mcp.js +421 -0
  27. package/dist/browser/chrome-mcp.snapshot.js +133 -0
  28. package/dist/browser/errors.js +67 -0
  29. package/dist/browser/form-fields.js +22 -0
  30. package/dist/browser/output-atomic.js +44 -0
  31. package/dist/browser/profile-capabilities.js +47 -0
  32. package/dist/browser/safe-filename.js +25 -0
  33. package/dist/browser/snapshot-roles.js +60 -0
  34. package/dist/build-info.json +3 -3
  35. package/dist/channels/account-snapshot-fields.js +176 -0
  36. package/dist/channels/draft-stream-controls.js +89 -0
  37. package/dist/channels/inbound-debounce-policy.js +28 -0
  38. package/dist/channels/typing-lifecycle.js +39 -0
  39. package/dist/cli/program/command-registry.js +52 -0
  40. package/dist/commands/agent-binding.js +123 -0
  41. package/dist/commands/agents.commands.bind.js +280 -0
  42. package/dist/commands/backup-shared.js +186 -0
  43. package/dist/commands/backup-verify.js +236 -0
  44. package/dist/commands/backup.js +166 -0
  45. package/dist/commands/channel-account-context.js +15 -0
  46. package/dist/commands/channel-account.js +190 -0
  47. package/dist/commands/gateway-install-token.js +117 -0
  48. package/dist/commands/oauth-tls-preflight.js +121 -0
  49. package/dist/commands/ollama-setup.js +402 -0
  50. package/dist/commands/security-owner-only.js +86 -0
  51. package/dist/commands/self-hosted-provider-setup.js +207 -0
  52. package/dist/commands/session-store-targets.js +12 -0
  53. package/dist/commands/sessions-cleanup.js +97 -0
  54. package/dist/control-ui/assets/{index-Dvkl4Xlx.js → index-D7shnQwQ.js} +404 -388
  55. package/dist/control-ui/assets/index-D7shnQwQ.js.map +1 -0
  56. package/dist/control-ui/index.html +1 -1
  57. package/dist/cron/cron-filters.js +150 -0
  58. package/dist/cron/heartbeat-policy.js +26 -0
  59. package/dist/gateway/device-pairing-security.js +197 -0
  60. package/dist/gateway/event-deduplication.js +167 -0
  61. package/dist/gateway/hooks-mapping.js +46 -7
  62. package/dist/gateway/run-tracker.js +253 -0
  63. package/dist/gateway/server-methods/nodes.js +14 -0
  64. package/dist/gateway/websocket-preauth-security.js +188 -0
  65. package/dist/hooks/module-loader.js +28 -0
  66. package/dist/infra/agent-command-binding.js +144 -0
  67. package/dist/infra/backup.js +328 -0
  68. package/dist/infra/channel-account-context.js +173 -0
  69. package/dist/infra/errors.js +53 -13
  70. package/dist/infra/exec-approvals-security.js +217 -0
  71. package/dist/infra/security/command-analyzer.js +257 -0
  72. package/dist/infra/session-cleanup.js +143 -0
  73. package/dist/plugins/loader.js +16 -8
  74. package/dist/security/external-content.js +51 -1
  75. package/dist/sessions/session-costs.js +228 -0
  76. package/dist/shared/param-key.js +16 -0
  77. package/dist/shared/poll-params.js +58 -0
  78. package/dist/shared/polls.js +55 -0
  79. package/docs/DASHBOARD-GAP-ANALYSIS-AND-PLAN.md +430 -0
  80. package/docs/FEATURES.md +523 -0
  81. package/docs/FINAL-IMPLEMENTATION-REVIEW.md +274 -0
  82. package/docs/FINAL-IMPLEMENTATION-SUMMARY.md +356 -0
  83. package/docs/FINAL-PROFESSIONAL-EVALUATION.md +312 -0
  84. package/docs/IMPLEMENTATION-PRIORITY-EVALUATION.md +298 -0
  85. package/docs/IMPLEMENTATION-PROGRESS.md +237 -0
  86. package/docs/IMPLEMENTATION-REVIEW-PHASE1-2.md +381 -0
  87. package/docs/IMPLEMENTATION-REVIEW-PHASE4.md +389 -0
  88. package/docs/IMPLEMENTATION-REVIEW-PHASE5.md +420 -0
  89. package/docs/IMPLEMENTATION-REVIEW-PHASE6.md +422 -0
  90. package/docs/IMPLEMENTATION-REVIEW-PHASE7-FINAL.md +184 -0
  91. package/docs/MIKRODASH-ANALYSIS.md +412 -0
  92. package/docs/OPENCLAW-GAP-ANALYSIS-FINAL.md +431 -0
  93. package/docs/OPENCLAW-VS-POOLBOT-ANALYSIS.md +351 -0
  94. package/docs/PHASE-7-SUMMARY.md +144 -0
  95. package/docs/POOLBOT-OFFICE-PLAN.md +697 -0
  96. package/docs/PROJECT-FINAL-STATUS.md +237 -0
  97. package/docs/README.md +116 -0
  98. package/docs/REAL-IMPROVEMENTS-EVALUATION.md +477 -0
  99. package/docs/SECURITY-HARDENING-IMPLEMENTATION.md +161 -0
  100. package/docs/channels/googlechat.md +235 -206
  101. package/docs/channels/irc.md +332 -0
  102. package/docs/channels/nostr.md +255 -168
  103. package/docs/components/command-palette.md +166 -0
  104. package/docs/components/login-gate.md +219 -0
  105. package/docs/getting-started/installation.md +191 -0
  106. package/docs/getting-started/introduction.md +120 -0
  107. package/docs/improvements/USAGE-GUIDE.md +359 -0
  108. package/docs/plans/2026-03-15-openclaw-features-implementation.md +1632 -0
  109. package/docs/reference/deadcode-detection.md +72 -0
  110. package/extensions/acpx/node_modules/.bin/acpx +21 -0
  111. package/extensions/agency-agents/node_modules/.bin/vite +4 -4
  112. package/extensions/agency-agents/node_modules/.bin/vitest +2 -2
  113. package/extensions/googlechat/node_modules/.bin/tsc +21 -0
  114. package/extensions/googlechat/node_modules/.bin/tsserver +21 -0
  115. package/extensions/googlechat/node_modules/.bin/vitest +21 -0
  116. package/extensions/googlechat/package.json +11 -28
  117. package/extensions/googlechat/src/googlechat-channel.test.ts +60 -0
  118. package/extensions/googlechat/src/googlechat-channel.ts +120 -0
  119. package/extensions/googlechat/src/index.ts +14 -0
  120. package/extensions/irc/node_modules/.bin/tsc +21 -0
  121. package/extensions/irc/node_modules/.bin/tsserver +21 -0
  122. package/extensions/irc/node_modules/.bin/vitest +21 -0
  123. package/extensions/irc/package.json +16 -8
  124. package/extensions/irc/src/index.ts +14 -0
  125. package/extensions/irc/src/irc-channel.test.ts +43 -0
  126. package/extensions/irc/src/irc-channel.ts +191 -0
  127. package/extensions/keyed-async-queue/node_modules/.bin/tsc +21 -0
  128. package/extensions/keyed-async-queue/node_modules/.bin/tsserver +21 -0
  129. package/extensions/keyed-async-queue/node_modules/.bin/vitest +21 -0
  130. package/extensions/keyed-async-queue/package.json +20 -0
  131. package/extensions/keyed-async-queue/src/index.ts +14 -0
  132. package/extensions/keyed-async-queue/src/queue.test.ts +135 -0
  133. package/extensions/keyed-async-queue/src/queue.ts +200 -0
  134. package/extensions/memory-core/node_modules/.bin/tsc +21 -0
  135. package/extensions/memory-core/node_modules/.bin/tsserver +21 -0
  136. package/extensions/memory-core/node_modules/.bin/vitest +21 -0
  137. package/extensions/memory-core/package.json +11 -8
  138. package/extensions/memory-core/src/index.ts +14 -0
  139. package/extensions/memory-core/src/memory-manager.test.ts +124 -0
  140. package/extensions/memory-core/src/memory-manager.ts +186 -0
  141. package/extensions/nostr/node_modules/.bin/tsc +2 -2
  142. package/extensions/nostr/node_modules/.bin/tsserver +2 -2
  143. package/extensions/nostr/node_modules/.bin/vitest +21 -0
  144. package/extensions/nostr/package.json +15 -24
  145. package/extensions/nostr/src/index.ts +14 -0
  146. package/extensions/nostr/src/nostr-channel.test.ts +55 -0
  147. package/extensions/nostr/src/nostr-channel.ts +228 -0
  148. package/extensions/page-agent/node_modules/.bin/vitest +2 -2
  149. package/extensions/test-utils/node_modules/.bin/jiti +21 -0
  150. package/extensions/test-utils/node_modules/.bin/playwright +21 -0
  151. package/extensions/test-utils/node_modules/.bin/tsx +21 -0
  152. package/extensions/test-utils/node_modules/.bin/vite +21 -0
  153. package/extensions/test-utils/node_modules/.bin/vitest +21 -0
  154. package/extensions/test-utils/node_modules/.bin/yaml +21 -0
  155. package/extensions/xyops/node_modules/.bin/vitest +2 -2
  156. package/package.json +2 -1
  157. package/dist/control-ui/assets/index-Dvkl4Xlx.js.map +0 -1
  158. package/extensions/googlechat/node_modules/.bin/poolbot +0 -21
  159. package/extensions/memory-core/node_modules/.bin/poolbot +0 -21
@@ -1,235 +1,322 @@
1
- ---
2
- summary: "Nostr DM channel via NIP-04 encrypted messages"
3
- read_when:
4
- - You want Pool Bot to receive DMs via Nostr
5
- - You're setting up decentralized messaging
6
- ---
7
- # Nostr
1
+ # Nostr Channel
8
2
 
9
- **Status:** Optional plugin (disabled by default).
3
+ Integração com o protocolo Nostr para comunicação descentralizada e resistente à censura.
10
4
 
11
- Nostr is a decentralized protocol for social networking. This channel enables Pool Bot to receive and respond to encrypted direct messages (DMs) via NIP-04.
5
+ ## Features
12
6
 
13
- ## Install (on demand)
7
+ - 🔐 **Criptografia** - Chaves públicas/privadas
8
+ - 📡 **Multi-Relay** - Conecte a múltiplos relays
9
+ - ✉️ **DMs Criptografadas** - NIP-04 direct messages
10
+ - 📝 **Text Notes** - Publicar notas (Kind 1)
11
+ - 👤 **Perfil** - Metadata de usuário (Kind 0)
12
+ - 🔍 **Subscribe** - Inscrição em eventos
13
+ - ⚡ **Tempo Real** - Atualizações em tempo real
14
14
 
15
- ### Onboarding (recommended)
15
+ ## O que é Nostr?
16
16
 
17
- - The onboarding wizard (`poolbot onboard`) and `poolbot channels add` list optional channel plugins.
18
- - Selecting Nostr prompts you to install the plugin on demand.
17
+ Nostr (Notes and Other Stuff Transmitted by Relays) é um protocolo descentralizado para comunicação resistente à censura.
19
18
 
20
- Install defaults:
19
+ ### Conceitos Chave
21
20
 
22
- - **Dev channel + git checkout available:** uses the local plugin path.
23
- - **Stable/Beta:** downloads from npm.
21
+ - **Relays** - Servidores que retransmitem mensagens
22
+ - **Keys** - Chaves criptográficas (pública/privada)
23
+ - **Events** - Mensagens assinadas criptograficamente
24
+ - **Kinds** - Tipos de eventos (0=perfil, 1=nota, 4=DM)
24
25
 
25
- You can always override the choice in the prompt.
26
+ ## Configuração
26
27
 
27
- ### Manual install
28
+ ### 1. Gerar Chaves
28
29
 
29
30
  ```bash
30
- poolbot plugins install @poolbot/nostr
31
+ # Gerar novo par de chaves
32
+ poolbot nostr generate-keys
33
+
34
+ # Ou usar chaves existentes
35
+ poolbot config set channels.nostr.privateKey YOUR_HEX_KEY
36
+ poolbot config set channels.nostr.publicKey YOUR_HEX_PUBKEY
31
37
  ```
32
38
 
33
- Use a local checkout (dev workflows):
39
+ ### 2. Configurar Relays
34
40
 
35
41
  ```bash
36
- poolbot plugins install --link <path-to-poolbot>/extensions/nostr
37
- ```
42
+ # Adicionar relays
43
+ poolbot config set channels.nostr.relays '["wss://relay.damus.io","wss://nos.lol","wss://relay.nostr.band"]'
38
44
 
39
- Restart the Gateway after installing or enabling plugins.
40
-
41
- ## Quick setup
45
+ # Habilitar canal
46
+ poolbot config set channels.nostr.enabled true
47
+ ```
42
48
 
43
- 1) Generate a Nostr keypair (if needed):
49
+ ### 3. Configurar Perfil (Opcional)
44
50
 
45
51
  ```bash
46
- # Using nak
47
- nak key generate
52
+ poolbot config set channels.nostr.profile '{"name":"Pool Bot","about":"AI Bot on Nostr","picture":"https://..."}'
48
53
  ```
49
54
 
50
- 2) Add to config:
55
+ ## Uso
51
56
 
52
- ```json
53
- {
54
- "channels": {
55
- "nostr": {
56
- "privateKey": "${NOSTR_PRIVATE_KEY}"
57
- }
58
- }
59
- }
57
+ ### Publicar Nota
58
+
59
+ ```typescript
60
+ import { createNostrChannel } from '@poolbot/nostr'
61
+
62
+ const channel = createNostrChannel({
63
+ relays: ['wss://relay.damus.io', 'wss://nos.lol'],
64
+ privateKey: 'your-hex-private-key', // Opcional para apenas ler
65
+ })
66
+
67
+ await channel.connect()
68
+
69
+ // Publicar nota
70
+ await channel.sendMessage({
71
+ text: 'Hello Nostr! 🚀',
72
+ })
60
73
  ```
61
74
 
62
- 3) Export the key:
75
+ ### Direct Message (DM)
63
76
 
64
- ```bash
65
- export NOSTR_PRIVATE_KEY="nsec1..."
66
- ```
67
-
68
- 4) Restart the Gateway.
69
-
70
- ## Configuration reference
71
-
72
- | Key | Type | Default | Description |
73
- | --- | --- | --- | --- |
74
- | `privateKey` | string | required | Private key in `nsec` or hex format |
75
- | `relays` | string[] | `['wss://relay.damus.io', 'wss://nos.lol']` | Relay URLs (WebSocket) |
76
- | `dmPolicy` | string | `pairing` | DM access policy |
77
- | `allowFrom` | string[] | `[]` | Allowed sender pubkeys |
78
- | `enabled` | boolean | `true` | Enable/disable channel |
79
- | `name` | string | - | Display name |
80
- | `profile` | object | - | NIP-01 profile metadata |
81
-
82
- ## Profile metadata
83
-
84
- Profile data is published as a NIP-01 `kind:0` event. You can manage it from the Control UI (Channels -> Nostr -> Profile) or set it directly in config.
85
-
86
- Example:
87
-
88
- ```json
89
- {
90
- "channels": {
91
- "nostr": {
92
- "privateKey": "${NOSTR_PRIVATE_KEY}",
93
- "profile": {
94
- "name": "poolbot",
95
- "displayName": "Pool Bot",
96
- "about": "Personal assistant DM bot",
97
- "picture": "https://example.com/avatar.png",
98
- "banner": "https://example.com/banner.png",
99
- "website": "https://example.com",
100
- "nip05": "poolbot@example.com",
101
- "lud16": "poolbot@example.com"
102
- }
103
- }
104
- }
105
- }
77
+ ```typescript
78
+ // Enviar DM criptografada (NIP-04)
79
+ await channel.sendDirectMessage(
80
+ 'recipient-public-key-hex',
81
+ 'Secret message!'
82
+ )
106
83
  ```
107
84
 
108
- Notes:
85
+ ### Receber Mensagens
109
86
 
110
- - Profile URLs must use `https://`.
111
- - Importing from relays merges fields and preserves local overrides.
87
+ ```typescript
88
+ // Subscribe a todas as menções
89
+ await channel.receiveMessages((msg) => {
90
+ console.log(`From ${msg.from}: ${msg.text}`)
91
+ })
112
92
 
113
- ## Access control
93
+ // Subscribe com filtro
94
+ await channel.subscribe({
95
+ kinds: [1], // Text notes
96
+ authors: ['your-pubkey'], // Suas notas
97
+ })
98
+ ```
114
99
 
115
- ### DM policies
100
+ ### Obter Perfil
116
101
 
117
- - **pairing** (default): unknown senders get a pairing code.
118
- - **allowlist**: only pubkeys in `allowFrom` can DM.
119
- - **open**: public inbound DMs (requires `allowFrom: ["*"]`).
120
- - **disabled**: ignore inbound DMs.
102
+ ```typescript
103
+ const profile = await channel.getProfile()
104
+ console.log(profile)
105
+ // { name: 'Pool Bot', about: 'AI Bot...', picture: '...' }
106
+ ```
121
107
 
122
- ### Allowlist example
108
+ ## Config Options
123
109
 
124
- ```json
125
- {
126
- "channels": {
127
- "nostr": {
128
- "privateKey": "${NOSTR_PRIVATE_KEY}",
129
- "dmPolicy": "allowlist",
130
- "allowFrom": ["npub1abc...", "npub1xyz..."]
131
- }
132
- }
110
+ ```typescript
111
+ type NostrConfig = {
112
+ relays: string[] // Lista de relays
113
+ privateKey?: string // Private key (hex) - opcional
114
+ publicKey?: string // Public key (hex)
115
+ subscribeFilter?: Filter // Filtro de subscription
133
116
  }
134
117
  ```
135
118
 
136
- ## Key formats
119
+ ## Kinds Suportados
137
120
 
138
- Accepted formats:
121
+ | Kind | Tipo | Descrição |
122
+ |------|----------------|------------------------|
123
+ | 0 | Metadata | Perfil do usuário |
124
+ | 1 | Text Note | Nota de texto |
125
+ | 4 | Encrypted DM | Mensagem direta (NIP-04) |
126
+ | 7 | Reaction | Reação (like) |
139
127
 
140
- - **Private key:** `nsec...` or 64-char hex
141
- - **Pubkeys (`allowFrom`):** `npub...` or hex
128
+ ## Relays Recomendados
142
129
 
143
- ## Relays
130
+ ### Principais
144
131
 
145
- Defaults: `relay.damus.io` and `nos.lol`.
132
+ ```
133
+ wss://relay.damus.io - Damus relay
134
+ wss://nos.lol - Nos.lol relay
135
+ wss://relay.nostr.band - Nostr Band
136
+ wss://relay.snort.social - Snort
137
+ wss://purplepag.es - Purple Pages
138
+ ```
139
+
140
+ ### Brasileiros
141
+
142
+ ```
143
+ wss://relay.nostr.com.br - Nostr Brasil
144
+ ```
145
+
146
+ ### Especializados
147
+
148
+ ```
149
+ wss://filter.nostr.wine - Filtros avançados
150
+ wss://cache.primal.net - Cache/History
151
+ ```
152
+
153
+ ## Exemplos
154
+
155
+ ### Bot de Resposta Automática
146
156
 
147
- ```json
148
- {
149
- "channels": {
150
- "nostr": {
151
- "privateKey": "${NOSTR_PRIVATE_KEY}",
152
- "relays": [
153
- "wss://relay.damus.io",
154
- "wss://relay.primal.net",
155
- "wss://nostr.wine"
156
- ]
157
- }
157
+ ```typescript
158
+ await channel.receiveMessages((msg) => {
159
+ if (msg.text.includes('!hello')) {
160
+ channel.sendMessage({
161
+ text: `Hello ${msg.from}!`,
162
+ })
158
163
  }
159
- }
164
+ })
165
+ ```
166
+
167
+ ### Bridge Nostr <-> Telegram
168
+
169
+ ```typescript
170
+ // Nostr -> Telegram
171
+ await channel.receiveMessages((msg) => {
172
+ telegramChannel.sendMessage({
173
+ text: `[Nostr] ${msg.from}: ${msg.text}`,
174
+ })
175
+ })
176
+
177
+ // Telegram -> Nostr
178
+ telegramChannel.receiveMessages((msg) => {
179
+ channel.sendMessage({
180
+ text: `[Telegram] ${msg.from}: ${msg.text}`,
181
+ })
182
+ })
160
183
  ```
161
184
 
162
- Tips:
185
+ ### Publicar Agenda Diária
163
186
 
164
- - Use 2-3 relays for redundancy.
165
- - Avoid too many relays (latency, duplication).
166
- - Paid relays can improve reliability.
167
- - Local relays are fine for testing (`ws://localhost:7777`).
187
+ ```typescript
188
+ cron.schedule('0 8 * * *', async () => {
189
+ await channel.sendMessage({
190
+ text: 'Bom dia! Agenda de hoje:\n- Meeting 10h\n- Deploy 15h',
191
+ })
192
+ })
193
+ ```
168
194
 
169
- ## Protocol support
195
+ ## NIPs Suportados
170
196
 
171
- | NIP | Status | Description |
172
- | --- | --- | --- |
173
- | NIP-01 | Supported | Basic event format + profile metadata |
174
- | NIP-04 | Supported | Encrypted DMs (`kind:4`) |
175
- | NIP-17 | Planned | Gift-wrapped DMs |
176
- | NIP-44 | Planned | Versioned encryption |
197
+ ### NIP-01: Basic Protocol
198
+ - Publicar eventos
199
+ - Subscribe a eventos
200
+ - Múltiplos relays
177
201
 
178
- ## Testing
202
+ ### NIP-04: Encrypted Direct Message
203
+ - ✅ Enviar DMs criptografadas
204
+ - ✅ Receber DMs criptografadas
179
205
 
180
- ### Local relay
206
+ ### NIP-05: DNS-based Verification
207
+ - ⏳ Verificação por DNS (future)
208
+
209
+ ### NIP-19: bech32-encoded Entities
210
+ - ✅ Suporte a npub/nsec format
211
+
212
+ ## Security
213
+
214
+ ### Gerenciamento de Chaves
181
215
 
182
216
  ```bash
183
- # Start strfry
184
- docker run -p 7777:7777 ghcr.io/hoytech/strfry
185
- ```
217
+ # Nunca compartilhe sua private key!
218
+ # Armazene em local seguro
186
219
 
187
- ```json
188
- {
189
- "channels": {
190
- "nostr": {
191
- "privateKey": "${NOSTR_PRIVATE_KEY}",
192
- "relays": ["ws://localhost:7777"]
193
- }
194
- }
195
- }
220
+ # Usar variável de ambiente
221
+ export NOSTR_PRIVATE_KEY="your-key"
222
+
223
+ # Ou arquivo seguro
224
+ poolbot config set channels.nostr.privateKey --secure
196
225
  ```
197
226
 
198
- ### Manual test
227
+ ### Best Practices
199
228
 
200
- 1) Note the bot pubkey (npub) from logs.
201
- 2) Open a Nostr client (Damus, Amethyst, etc.).
202
- 3) DM the bot pubkey.
203
- 4) Verify the response.
229
+ 1. **Nunca commit keys** no git
230
+ 2. **Use env vars** para produção
231
+ 3. **Rotação de chaves** periódica
232
+ 4. **Múltiplos relays** para redundância
233
+ 5. **Valide eventos** recebidos
204
234
 
205
235
  ## Troubleshooting
206
236
 
207
- ### Not receiving messages
237
+ ### Erro de Conexão
208
238
 
209
- - Verify the private key is valid.
210
- - Ensure relay URLs are reachable and use `wss://` (or `ws://` for local).
211
- - Confirm `enabled` is not `false`.
212
- - Check Gateway logs for relay connection errors.
239
+ ```
240
+ Error: Nostr connection failed
241
+ ```
213
242
 
214
- ### Not sending responses
243
+ **Solução:**
244
+ - Verificar URLs dos relays
245
+ - Testar com wscat: `wscat -c wss://relay.damus.io`
246
+ - Verificar firewall
215
247
 
216
- - Check relay accepts writes.
217
- - Verify outbound connectivity.
218
- - Watch for relay rate limits.
248
+ ### Não consegue publicar
249
+
250
+ ```
251
+ Failed to publish to any relay
252
+ ```
219
253
 
220
- ### Duplicate responses
254
+ **Solução:**
255
+ - Verificar se private key está configurada
256
+ - Testar relay individualmente
257
+ - Verificar rate limits do relay
221
258
 
222
- - Expected when using multiple relays.
223
- - Messages are deduplicated by event ID; only the first delivery triggers a response.
259
+ ### DMs não funcionam
224
260
 
225
- ## Security
261
+ ```
262
+ Cannot send DM without private key
263
+ ```
264
+
265
+ **Solução:**
266
+ - Configurar privateKey no config
267
+ - Verificar formato hex da chave
268
+ - Verificar pubkey do recipient
269
+
270
+ ## Comandos CLI
271
+
272
+ ```bash
273
+ # Gerar chaves
274
+ poolbot nostr generate-keys
275
+
276
+ # Publicar nota
277
+ poolbot nostr publish "Hello world!"
278
+
279
+ # Ver perfil
280
+ poolbot nostr profile
281
+
282
+ # Listar relays
283
+ poolbot nostr relays
284
+
285
+ # Testar conexão
286
+ poolbot nostr test
287
+ ```
288
+
289
+ ## API Reference
290
+
291
+ ### Methods
292
+
293
+ - `connect()` - Conectar aos relays
294
+ - `disconnect()` - Desconectar
295
+ - `publishEvent(event)` - Publicar evento
296
+ - `sendMessage(message)` - Publicar nota (Kind 1)
297
+ - `sendDirectMessage(pubkey, message)` - DM (Kind 4)
298
+ - `subscribe(filter)` - Inscrever em eventos
299
+ - `receiveMessages(callback)` - Configurar receiver
300
+ - `getPresences()` - Obter presenças
301
+ - `getProfile()` - Obter perfil
302
+ - `getPublicKey()` - Obter pubkey
303
+
304
+ ### Events
305
+
306
+ - `connect` - Conectado aos relays
307
+ - `disconnect` - Desconectado
308
+ - `message` - Nova mensagem recebida
309
+ - `error` - Erro
310
+
311
+ ## Arquivos Relacionados
226
312
 
227
- - Never commit private keys.
228
- - Use environment variables for keys.
229
- - Consider `allowlist` for production bots.
313
+ - `extensions/nostr/src/nostr-channel.ts` - Implementação
314
+ - `extensions/nostr/src/index.ts` - Entry point
315
+ - `extensions/nostr/package.json` - Dependências (nostr-tools)
230
316
 
231
- ## Limitations (MVP)
317
+ ## Links Relacionados
232
318
 
233
- - Direct messages only (no group chats).
234
- - No media attachments.
235
- - NIP-04 only (NIP-17 gift-wrap planned).
319
+ - [Nostr Protocol](https://github.com/nostr-protocol/nostr)
320
+ - [NIPs](https://github.com/nostr-protocol/nips)
321
+ - [nostr-tools](https://github.com/nbd-wtf/nostr-tools)
322
+ - [Damus](https://damus.io/)
@@ -0,0 +1,166 @@
1
+ # Command Palette
2
+
3
+ A Command Palette é uma interface de navegação rápida acessível via `Cmd+K` (Mac) ou `Ctrl+K` (Windows/Linux) que permite navegar e executar ações rapidamente no dashboard do Pool Bot.
4
+
5
+ ## Features
6
+
7
+ - 🔍 **Busca Fuzzy** - Encontre comandos e navegação rapidamente
8
+ - ⌨️ **Atalhos de Teclado** - Navegação completa sem mouse
9
+ - 📂 **Categorização** - Itens organizados por categoria
10
+ - 🚀 **Acesso Rápido** - Execute ações sem navegar por menus
11
+
12
+ ## Categorias
13
+
14
+ ### Navigation
15
+ Acesso rápido às principais seções:
16
+ - **Overview** - Visão geral do sistema
17
+ - **Sessions** - Gerenciamento de sessões
18
+ - **Scheduled** - Jobs agendados (Cron)
19
+ - **Skills** - Habilidades e comandos
20
+ - **Settings** - Configurações
21
+ - **Agents** - Gerenciamento de agentes
22
+ - **Nodes** - Nós de processamento *(Novo)*
23
+ - **Exec Approvals** - Aprovações pendentes *(Novo)*
24
+ - **Pair Device** - Pairing de dispositivos *(Novo)*
25
+ - **Usage** - Analytics de uso *(Novo)*
26
+ - **Logs** - Logs do sistema *(Novo)*
27
+ - **Debug** - Ferramentas de debug *(Novo)*
28
+
29
+ ### Search
30
+ Comandos slash disponíveis:
31
+ - `/fast` - Toggle fast mode
32
+ - `/btw` - By the way (contexto)
33
+ - `/verbose` - Modo verboso
34
+ - `/stop` - Parar sessão
35
+ - `/model` - Mudar modelo
36
+ - `/skill` - Executar skill
37
+ - `/export` - Exportar chat
38
+ - `/focus` - Focus mode
39
+
40
+ ### Skills
41
+ Atalhos para skills frequentes:
42
+ - **Shell Command** - Executar comando shell
43
+ - **Debug Mode** - Toggle debug
44
+ - **Focus Mode** - Toggle focus
45
+ - **Export Chat** - Exportar conversa
46
+
47
+ ## Uso
48
+
49
+ ### Abrir Command Palette
50
+
51
+ ```
52
+ Mac: Cmd+K
53
+ Windows/Linux: Ctrl+K
54
+ ```
55
+
56
+ ### Navegar
57
+
58
+ ```
59
+ ↓ / Tab - Próximo item
60
+ ↑ / Shift+Tab - Item anterior
61
+ Enter - Selecionar item
62
+ Esc - Fechar
63
+ ```
64
+
65
+ ### Buscar
66
+
67
+ Digite para filtrar itens:
68
+ - `nodes` - Filtra por "Nodes"
69
+ - `setti` - Filtra por "Settings"
70
+ - `/exp` - Filtra comandos slash começando com /exp
71
+
72
+ ## Exemplo de Uso
73
+
74
+ 1. Pressione `Cmd+K`
75
+ 2. Digite `nodes`
76
+ 3. Pressione `Enter` para navegar para Nodes Management
77
+
78
+ ## API
79
+
80
+ ### Programmatic Usage
81
+
82
+ ```typescript
83
+ import { getPaletteItems, filteredItems } from './command-palette'
84
+
85
+ // Obter todos os itens
86
+ const allItems = getPaletteItems()
87
+
88
+ // Filtrar itens
89
+ const filtered = filteredItems('nodes')
90
+
91
+ // Navegar programaticamente
92
+ props.onNavigate('nodes')
93
+ ```
94
+
95
+ ### Props do Componente
96
+
97
+ ```typescript
98
+ type CommandPaletteProps = {
99
+ open: boolean // Palette aberta?
100
+ query: string // Texto da busca
101
+ activeIndex: number // Índice do item ativo
102
+ onToggle: () => void // Toggle open/close
103
+ onQueryChange: (q: string) => void // Mudar busca
104
+ onActiveIndexChange: (i: number) => void // Mudar índice
105
+ onNavigate: (tab: string) => void // Navegar
106
+ onSlashCommand: (cmd: string) => void // Executar comando
107
+ }
108
+ ```
109
+
110
+ ## Customização
111
+
112
+ ### Adicionar Novos Itens
113
+
114
+ Edite `ui/src/ui/views/command-palette.ts`:
115
+
116
+ ```typescript
117
+ const PALETTE_ITEMS: PaletteItem[] = [
118
+ // ... itens existentes
119
+ {
120
+ id: "nav-custom",
121
+ label: "Custom Page",
122
+ icon: "star",
123
+ category: "navigation",
124
+ action: "nav:custom",
125
+ description: "Custom navigation",
126
+ },
127
+ ];
128
+ ```
129
+
130
+ ### Adicionar Skills
131
+
132
+ ```typescript
133
+ {
134
+ id: "skill-custom",
135
+ label: "Custom Skill",
136
+ icon: "zap",
137
+ category: "skills",
138
+ action: "/skill custom",
139
+ description: "Run custom skill",
140
+ }
141
+ ```
142
+
143
+ ## Testes
144
+
145
+ ```bash
146
+ # Rodar testes
147
+ pnpm test -- command-palette.test.ts
148
+
149
+ # Testes incluem:
150
+ # - Filtragem de itens
151
+ # - Navegação por categoria
152
+ # - Busca por descrição
153
+ # - Atalhos de teclado
154
+ ```
155
+
156
+ ## Arquivos Relacionados
157
+
158
+ - `ui/src/ui/views/command-palette.ts` - Componente principal
159
+ - `ui/src/ui/views/command-palette.test.ts` - Testes unitários
160
+ - `ui/src/ui/chat/slash-commands.ts` - Comandos slash
161
+
162
+ ## Links Relacionados
163
+
164
+ - [Dashboard](/components/dashboard)
165
+ - [Navegação](/guides/navigation)
166
+ - [Atalhos de Teclado](/guides/keyboard-shortcuts)