@runflow-ai/cli 0.2.19 → 0.2.21

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 (37) hide show
  1. package/CLI-DOCS.md +23 -132
  2. package/README.md +354 -41
  3. package/dist/commands/agents/agents.command.d.ts +1 -0
  4. package/dist/commands/agents/agents.command.js +39 -20
  5. package/dist/commands/agents/agents.command.js.map +1 -1
  6. package/dist/commands/agents/git.service.js +8 -2
  7. package/dist/commands/agents/git.service.js.map +1 -1
  8. package/dist/commands/agents/types.d.ts +1 -0
  9. package/dist/commands/agents/types.js.map +1 -1
  10. package/dist/commands/create/create.command.d.ts +19 -0
  11. package/dist/commands/create/create.command.js +316 -0
  12. package/dist/commands/create/create.command.js.map +1 -0
  13. package/dist/commands/kb/kb.command.d.ts +27 -0
  14. package/dist/commands/kb/kb.command.js +596 -0
  15. package/dist/commands/kb/kb.command.js.map +1 -0
  16. package/dist/commands/login/login.command.d.ts +2 -0
  17. package/dist/commands/login/login.command.js +26 -4
  18. package/dist/commands/login/login.command.js.map +1 -1
  19. package/dist/commands/profiles/profiles.command.d.ts +7 -0
  20. package/dist/commands/profiles/profiles.command.js +104 -0
  21. package/dist/commands/profiles/profiles.command.js.map +1 -0
  22. package/dist/commands/prompts/prompts.command.d.ts +16 -0
  23. package/dist/commands/prompts/prompts.command.js +468 -29
  24. package/dist/commands/prompts/prompts.command.js.map +1 -1
  25. package/dist/commands/switch/switch.command.d.ts +5 -0
  26. package/dist/commands/switch/switch.command.js +78 -0
  27. package/dist/commands/switch/switch.command.js.map +1 -0
  28. package/dist/common/config.d.ts +25 -2
  29. package/dist/common/config.js +94 -16
  30. package/dist/common/config.js.map +1 -1
  31. package/dist/common/help.d.ts +1 -1
  32. package/dist/common/help.js +4 -1
  33. package/dist/common/help.js.map +1 -1
  34. package/dist/index.js +11 -3
  35. package/dist/index.js.map +1 -1
  36. package/package.json +27 -23
  37. package/QUICK-TEST-GUIDE.md +0 -273
@@ -1,273 +0,0 @@
1
- # 🚀 Quick Test Guide - rf test
2
-
3
- ## TL;DR
4
-
5
- ```bash
6
- cd seu-agente/
7
- rf test
8
- ```
9
-
10
- That's it! 🎉
11
-
12
- ---
13
-
14
- ## Passo a Passo Completo
15
-
16
- ### 1. Instale ou atualize a CLI
17
-
18
- ```bash
19
- # Se ainda não tem instalado
20
- npm install -g @runflow-ai/cli
21
-
22
- # Se já tem, atualize
23
- npm update -g @runflow-ai/cli
24
- ```
25
-
26
- ### 2. Entre no diretório do agente
27
-
28
- ```bash
29
- cd smartfit-agents/agent-com-rag/
30
- # ou qualquer agente com .runflow/rf.json
31
- ```
32
-
33
- ### 3. Execute o comando test
34
-
35
- ```bash
36
- rf test
37
- ```
38
-
39
- **Output esperado:**
40
-
41
- ```
42
- 🧪 Runflow Test Server
43
- Starting local observability server...
44
-
45
- ✓ Found agent config
46
- Agent: Agent com RAG (Agentic)
47
-
48
- ✓ Local server running on port 3421
49
-
50
- ✓ Opening browser...
51
-
52
- 📊 Test Portal Ready!
53
-
54
- 🌐 Portal: https://platform.runflow.ai/local-test/agents/fbc4c76d-57b3-40c3-a165-c4edcbf28434/test-monitor?apiUrl=http://localhost:3421&agentName=Agent%20com%20RAG
55
- 📡 API: http://localhost:3421
56
- 💾 Storage: /Users/danrleymorais/projects/runflow/runflow-sdk-repo/smartfit-agents/agent-com-rag/.runflow/traces
57
-
58
- ⚠️ Note: Your browser may show a warning about
59
- mixed content (HTTPS → HTTP). Click "Allow" if prompted.
60
-
61
- Press Ctrl+C to stop
62
- ```
63
-
64
- ### 4. Teste no navegador
65
-
66
- O portal abre automaticamente em `https://platform.runflow.ai` com:
67
- - Interface de teste (40% esquerda)
68
- - Monitoramento em tempo real (60% direita)
69
-
70
- **Features disponíveis:**
71
- - ✅ Enviar mensagens para o agente
72
- - ✅ Ver lista de threads (conversas)
73
- - ✅ Ver execuções por thread
74
- - ✅ Visualizar traces detalhados (árvore hierárquica)
75
- - ✅ Métricas: tokens, custo, duração
76
-
77
- ### 5. Execute seu agente (em outro terminal)
78
-
79
- ```bash
80
- # Terminal 2
81
- cd seu-agente/
82
- npm run dev
83
- # ou
84
- node agent.ts
85
- ```
86
-
87
- As execuções aparecerão automaticamente no portal! 🎯
88
-
89
- ---
90
-
91
- ## 🧪 Testando com dados de exemplo
92
-
93
- Para testar a visualização sem executar o agente, use o trace de exemplo:
94
-
95
- ```bash
96
- # 1. Crie o diretório de traces
97
- mkdir -p .runflow/traces/2025-11-06
98
-
99
- # 2. Copie o arquivo de exemplo
100
- cp /path/to/runflow-cli/docs/trace-example.json .runflow/traces/2025-11-06/session-test-1730894400000.json
101
-
102
- # 3. Edite o agentId no arquivo para corresponder ao seu
103
- # Substitua "fbc4c76d-..." pelo agentId do seu .runflow/rf.json
104
-
105
- # 4. Inicie o servidor
106
- rf test
107
- ```
108
-
109
- Agora você verá threads e execuções de exemplo no portal! ✨
110
-
111
- ---
112
-
113
- ## 🎛️ Opções Avançadas
114
-
115
- ### Porta customizada
116
-
117
- ```bash
118
- rf test --port 5000
119
- ```
120
-
121
- ### Sem abrir navegador
122
-
123
- ```bash
124
- rf test --no-browser
125
-
126
- # Depois abra manualmente:
127
- open https://platform.runflow.ai/agents/SEU_AGENT_ID/test-monitor?apiUrl=http://localhost:3421&mode=local
128
- ```
129
-
130
- ### Múltiplos agentes simultaneamente
131
-
132
- ```bash
133
- # Terminal 1
134
- cd agent-1/
135
- rf test --port 3500
136
-
137
- # Terminal 2
138
- cd agent-2/
139
- rf test --port 3600
140
-
141
- # Terminal 3
142
- cd agent-3/
143
- rf test --port 3700
144
- ```
145
-
146
- Cada um abrirá em uma aba diferente do navegador! 🔥
147
-
148
- ---
149
-
150
- ## 🐛 Troubleshooting
151
-
152
- ### Erro: "No agentId found"
153
-
154
- ```bash
155
- ❌ No agentId found in .runflow/rf.json
156
- Run "rf clone <agentId>" first
157
- ```
158
-
159
- **Solução:**
160
- ```bash
161
- # Clone um agente primeiro
162
- rf agents list
163
- # Selecione um agente e clone
164
- ```
165
-
166
- ### Erro: "Failed to start server after 3 attempts"
167
-
168
- ```bash
169
- ❌ Failed to start server after 3 attempts
170
- All ports are busy. Try again later.
171
- ```
172
-
173
- **Solução:**
174
- ```bash
175
- # Tente porta específica
176
- rf test --port 5000
177
-
178
- # Ou mate processos ocupando portas
179
- lsof -ti:3000,3001,3002 | xargs kill
180
- ```
181
-
182
- ### Portal não mostra dados
183
-
184
- **Verificações:**
185
- 1. ✅ Servidor está rodando? `curl http://localhost:3421/health`
186
- 2. ✅ Diretório de traces existe? `ls .runflow/traces/`
187
- 3. ✅ AgentId correto na URL?
188
- 4. ✅ Console do navegador tem erros?
189
-
190
- **Solução comum:**
191
- ```bash
192
- # Recarregue a página permitindo mixed content
193
- # Chrome: Click no shield icon → "Load unsafe scripts"
194
- # Firefox: Click no shield icon → "Disable protection"
195
- ```
196
-
197
- ### Mixed Content Warning
198
-
199
- O navegador pode avisar sobre **mixed content** (HTTPS → HTTP):
200
-
201
- **Chrome:**
202
- 1. Click no ícone de shield na barra de endereço
203
- 2. Click em "Load unsafe scripts"
204
-
205
- **Firefox:**
206
- 1. Click no ícone de shield
207
- 2. Click em "Disable protection for now"
208
-
209
- **Safari:**
210
- 1. Safari → Preferences → Advanced
211
- 2. Enable "Show Develop menu"
212
- 3. Develop → Disable Cross-Origin Restrictions
213
-
214
- ---
215
-
216
- ## 📊 Estrutura de Dados
217
-
218
- ### Storage Local
219
-
220
- ```
221
- .runflow/
222
- ├── rf.json # Config do agente
223
- └── traces/ # Traces
224
- ├── 2025-11-06/
225
- │ ├── session-abc123-1730894400000.json # Sessão 1
226
- │ └── session-xyz789-1730894500000.json # Sessão 2
227
- └── 2025-11-07/
228
- └── ...
229
- ```
230
-
231
- ### Formato de Trace
232
-
233
- Ver [`docs/trace-example.json`](docs/trace-example.json) para exemplo completo.
234
-
235
- **Estrutura básica:**
236
- ```json
237
- {
238
- "sessionId": "session-uuid-timestamp",
239
- "agentId": "agent-uuid",
240
- "createdAt": "2025-11-06T10:00:00Z",
241
- "threads": {
242
- "user@email.com": {
243
- "threadId": "user@email.com",
244
- "executions": [
245
- {
246
- "executionId": "exec-uuid",
247
- "inputMessage": "Hello",
248
- "outputMessage": "Hi!",
249
- "status": "success",
250
- "traces": [ /* árvore de traces */ ]
251
- }
252
- ]
253
- }
254
- }
255
- }
256
- ```
257
-
258
- ---
259
-
260
- ## ✨ Próximos Passos
261
-
262
- 1. **Teste básico:** `rf test` e envie mensagens no portal
263
- 2. **Execute agente:** Em outro terminal, rode seu agente
264
- 3. **Monitore:** Veja execuções em tempo real
265
- 4. **Debug:** Analise traces detalhados
266
- 5. **Itere:** Faça mudanças e teste novamente
267
-
268
- **Happy testing!** 🚀
269
-
270
- Para mais detalhes, veja:
271
- - [`docs/TEST-COMMAND.md`](docs/TEST-COMMAND.md) - Documentação completa
272
- - [`CLI-DOCS.md`](CLI-DOCS.md) - Todos os comandos da CLI
273
-