@reverso-agent/cli 0.2.5
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/README.md +114 -0
- package/bin/reverso.js +9 -0
- package/dist/chunk-FYS2JH42.js +31 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +30188 -0
- package/dist/pdf-6D45UFOZ.js +30446 -0
- package/package.json +39 -0
package/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Reverso CLI
|
|
2
|
+
|
|
3
|
+
CLI do agente investigativo Reverso — OSINT com LLM. Processa documentos, gera entendimento e conduz investigações com leads, allegations e findings rastreáveis.
|
|
4
|
+
|
|
5
|
+
## Instalação
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# npm
|
|
9
|
+
npm install -g @reverso-agent/cli
|
|
10
|
+
|
|
11
|
+
# pnpm
|
|
12
|
+
pnpm add -g @reverso-agent/cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Requisitos: Node.js >= 18.
|
|
16
|
+
|
|
17
|
+
Verificar:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
reverso --version
|
|
21
|
+
reverso --help
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Configuração
|
|
25
|
+
|
|
26
|
+
É obrigatória uma chave de API do OpenRouter. Use uma das opções abaixo (em ordem de prioridade):
|
|
27
|
+
|
|
28
|
+
**Opção A — Variável de ambiente (recomendado)**
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
export OPENROUTER_API_KEY=sk-...
|
|
32
|
+
# ou adicione ao ~/.zshrc / ~/.bashrc
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Opção B — Arquivo global**
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
mkdir -p ~/.reverso
|
|
39
|
+
echo "OPENROUTER_API_KEY=sk-..." > ~/.reverso/.env
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Opção C — Por projeto**
|
|
43
|
+
|
|
44
|
+
Crie um arquivo `.env` na pasta da investigação com `OPENROUTER_API_KEY=sk-...`.
|
|
45
|
+
|
|
46
|
+
Modelo padrão: `google/gemini-2.5-flash` (alterável via `--model` onde disponível).
|
|
47
|
+
|
|
48
|
+
## Primeiros passos
|
|
49
|
+
|
|
50
|
+
Fluxo recomendado numa pasta de investigação:
|
|
51
|
+
|
|
52
|
+
1. **init** — Lê previews em `source/.artifacts`, gera entendimento inicial e cria `agent.md`.
|
|
53
|
+
2. **agent-setup** — Ajusta instruções do agente (ex.: foco em pessoa ou tema).
|
|
54
|
+
3. **dig** — Encontra possíveis leads a partir dos previews (top 3 sugestões, comparação com leads existentes).
|
|
55
|
+
4. **create-lead** — Registra um lead com Inquiry Plan em `investigation/leads`.
|
|
56
|
+
5. **inquiry** — Executa a investigação do lead e gera allegations/findings e conclusão.
|
|
57
|
+
|
|
58
|
+
O CLI detecta automaticamente a pasta de investigação (presença de `source/` ou `investigation/` a partir do diretório atual). Para forçar um caminho: `reverso --filesystem /caminho/para/root <comando>`.
|
|
59
|
+
|
|
60
|
+
### Exemplo completo
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
mkdir minha-investigacao && cd minha-investigacao
|
|
64
|
+
mkdir source
|
|
65
|
+
# Copie PDFs para source/
|
|
66
|
+
|
|
67
|
+
reverso doc-process process-all # processa PDFs e gera previews
|
|
68
|
+
reverso init # gera entendimento
|
|
69
|
+
reverso agent-setup --text "Foco na pessoa X"
|
|
70
|
+
reverso dig # encontra leads
|
|
71
|
+
reverso create-lead --idea "cartel combinacao"
|
|
72
|
+
reverso inquiry --lead cartel-combinacao
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Comandos
|
|
76
|
+
|
|
77
|
+
- **reverso init** — Entendimento inicial a partir dos previews. Saída: `agent.md`.
|
|
78
|
+
- **reverso agent-setup** — Atualiza `agent.md` com novas instruções (`--text "..."`).
|
|
79
|
+
- **reverso dig** — Deep-dive nos previews, sugere leads. Saída: relatório em `reports/dig-<timestamp>.md`.
|
|
80
|
+
- **reverso create-lead** — Cria lead com Inquiry Plan (`--idea "..."` opcional). Saída: `investigation/leads/lead-<slug>.md`.
|
|
81
|
+
- **reverso inquiry** — Executa a investigação de um lead. Saída: allegations, findings e conclusão no lead.
|
|
82
|
+
- **reverso doc-process** — Processamento de documentos. Subcomandos: `process-all`, `queue-status`, `queue-clear`, `rerun`, `watch`. Use `reverso doc-process --help` para detalhes.
|
|
83
|
+
|
|
84
|
+
Flags globais: `--filesystem <path>`, `--feedback plain|compact|visual` (padrão: visual). Use `reverso <comando> --help` para opções de cada comando.
|
|
85
|
+
|
|
86
|
+
## Saídas esperadas
|
|
87
|
+
|
|
88
|
+
Estrutura típica após o fluxo (relativa ao root da investigação):
|
|
89
|
+
|
|
90
|
+
- **init / agent-setup**: `agent.md`
|
|
91
|
+
- **dig**: `reports/dig-<timestamp>.md`
|
|
92
|
+
- **create-lead**: `investigation/leads/lead-<slug>.md`
|
|
93
|
+
- **inquiry**: `investigation/allegations/*.md`, `investigation/findings/*.md`, e conclusão atualizada no lead
|
|
94
|
+
|
|
95
|
+
## Publicação e atualização de versão
|
|
96
|
+
|
|
97
|
+
Pacote *scoped* (`@reverso-agent/cli`). Para publicar no npm com 2FA ativada é preciso informar o código OTP quando o npm pedir.
|
|
98
|
+
|
|
99
|
+
Guia completo (login, 2FA/OTP, erros comuns, CI): **[PUBLISH-NPM.md](./PUBLISH-NPM.md)**.
|
|
100
|
+
|
|
101
|
+
Resumo:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
cd lab/agent-cli
|
|
105
|
+
pnpm typecheck
|
|
106
|
+
pnpm build
|
|
107
|
+
npm pack # gera .tgz para teste local
|
|
108
|
+
npm install -g ./reverso-agent-cli-*.tgz # teste de instalação global
|
|
109
|
+
# Se OK:
|
|
110
|
+
npm version patch # 0.2.4 → 0.2.5 (ou minor/major)
|
|
111
|
+
npm publish --access public # informe o OTP quando solicitado
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Teste em pasta fora do repositório antes de publicar (ex.: `mkdir /tmp/test-reverso && cd /tmp/test-reverso && reverso --help`).
|
package/bin/reverso.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Wrapper para satisfazer validação do npm: bin deve apontar para um arquivo em bin/
|
|
3
|
+
import { pathToFileURL } from 'node:url'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
6
|
+
|
|
7
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
8
|
+
const entry = path.join(__dirname, '..', 'dist', 'index.js')
|
|
9
|
+
await import(pathToFileURL(entry).href)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
__commonJS,
|
|
30
|
+
__toESM
|
|
31
|
+
};
|
package/dist/index.d.ts
ADDED