@poolzin/pool-bot 2026.3.22 → 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 +54 -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
package/docs/channels/nostr.md
CHANGED
|
@@ -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
|
-
|
|
3
|
+
Integração com o protocolo Nostr para comunicação descentralizada e resistente à censura.
|
|
10
4
|
|
|
11
|
-
|
|
5
|
+
## Features
|
|
12
6
|
|
|
13
|
-
|
|
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
|
-
|
|
15
|
+
## O que é Nostr?
|
|
16
16
|
|
|
17
|
-
|
|
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
|
-
|
|
19
|
+
### Conceitos Chave
|
|
21
20
|
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
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
|
-
|
|
26
|
+
## Configuração
|
|
26
27
|
|
|
27
|
-
###
|
|
28
|
+
### 1. Gerar Chaves
|
|
28
29
|
|
|
29
30
|
```bash
|
|
30
|
-
|
|
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
|
-
|
|
39
|
+
### 2. Configurar Relays
|
|
34
40
|
|
|
35
41
|
```bash
|
|
36
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
# Habilitar canal
|
|
46
|
+
poolbot config set channels.nostr.enabled true
|
|
47
|
+
```
|
|
42
48
|
|
|
43
|
-
|
|
49
|
+
### 3. Configurar Perfil (Opcional)
|
|
44
50
|
|
|
45
51
|
```bash
|
|
46
|
-
|
|
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
|
-
|
|
55
|
+
## Uso
|
|
51
56
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
75
|
+
### Direct Message (DM)
|
|
63
76
|
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
85
|
+
### Receber Mensagens
|
|
109
86
|
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
93
|
+
// Subscribe com filtro
|
|
94
|
+
await channel.subscribe({
|
|
95
|
+
kinds: [1], // Text notes
|
|
96
|
+
authors: ['your-pubkey'], // Suas notas
|
|
97
|
+
})
|
|
98
|
+
```
|
|
114
99
|
|
|
115
|
-
###
|
|
100
|
+
### Obter Perfil
|
|
116
101
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
102
|
+
```typescript
|
|
103
|
+
const profile = await channel.getProfile()
|
|
104
|
+
console.log(profile)
|
|
105
|
+
// { name: 'Pool Bot', about: 'AI Bot...', picture: '...' }
|
|
106
|
+
```
|
|
121
107
|
|
|
122
|
-
|
|
108
|
+
## Config Options
|
|
123
109
|
|
|
124
|
-
```
|
|
125
|
-
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
-
##
|
|
119
|
+
## Kinds Suportados
|
|
137
120
|
|
|
138
|
-
|
|
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
|
-
|
|
141
|
-
- **Pubkeys (`allowFrom`):** `npub...` or hex
|
|
128
|
+
## Relays Recomendados
|
|
142
129
|
|
|
143
|
-
|
|
130
|
+
### Principais
|
|
144
131
|
|
|
145
|
-
|
|
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
|
-
```
|
|
148
|
-
{
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
|
|
185
|
+
### Publicar Agenda Diária
|
|
163
186
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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
|
-
##
|
|
195
|
+
## NIPs Suportados
|
|
170
196
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
-
|
|
202
|
+
### NIP-04: Encrypted Direct Message
|
|
203
|
+
- ✅ Enviar DMs criptografadas
|
|
204
|
+
- ✅ Receber DMs criptografadas
|
|
179
205
|
|
|
180
|
-
###
|
|
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
|
-
#
|
|
184
|
-
|
|
185
|
-
```
|
|
217
|
+
# Nunca compartilhe sua private key!
|
|
218
|
+
# Armazene em local seguro
|
|
186
219
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
-
###
|
|
227
|
+
### Best Practices
|
|
199
228
|
|
|
200
|
-
1
|
|
201
|
-
2
|
|
202
|
-
3
|
|
203
|
-
4
|
|
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
|
-
###
|
|
237
|
+
### Erro de Conexão
|
|
208
238
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
- Check Gateway logs for relay connection errors.
|
|
239
|
+
```
|
|
240
|
+
Error: Nostr connection failed
|
|
241
|
+
```
|
|
213
242
|
|
|
214
|
-
|
|
243
|
+
**Solução:**
|
|
244
|
+
- Verificar URLs dos relays
|
|
245
|
+
- Testar com wscat: `wscat -c wss://relay.damus.io`
|
|
246
|
+
- Verificar firewall
|
|
215
247
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
248
|
+
### Não consegue publicar
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
Failed to publish to any relay
|
|
252
|
+
```
|
|
219
253
|
|
|
220
|
-
|
|
254
|
+
**Solução:**
|
|
255
|
+
- Verificar se private key está configurada
|
|
256
|
+
- Testar relay individualmente
|
|
257
|
+
- Verificar rate limits do relay
|
|
221
258
|
|
|
222
|
-
|
|
223
|
-
- Messages are deduplicated by event ID; only the first delivery triggers a response.
|
|
259
|
+
### DMs não funcionam
|
|
224
260
|
|
|
225
|
-
|
|
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
|
-
-
|
|
228
|
-
-
|
|
229
|
-
-
|
|
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
|
-
##
|
|
317
|
+
## Links Relacionados
|
|
232
318
|
|
|
233
|
-
-
|
|
234
|
-
-
|
|
235
|
-
-
|
|
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)
|