@ftarganski/omni-ai 1.1.8 → 1.1.10
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 +306 -1118
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,412 +1,122 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/Ftarganski/omni-ai/main/docs/images/logo.png" alt="omni-ai" width="140" />
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
# omni-ai
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
**Provider-agnostic AI agents and skills framework for TypeScript monorepos.**
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Como funciona
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
cd meu-projeto
|
|
13
|
-
omni run backend-dev "crie o módulo de pedidos com CRUD e GraphQL"
|
|
14
|
-
│
|
|
15
|
-
▼
|
|
16
|
-
CLI (omni)
|
|
17
|
-
│ lê config/omni-ai.yaml ← provider, modelo e agentsDir
|
|
18
|
-
│ resolve "backend-dev" ← busca agents/**/*.yaml por name:
|
|
19
|
-
│ instancia o provider ← AnthropicProvider / OpenAIProvider
|
|
20
|
-
│ monta o SkillRegistry ← read-file, write-file, search-code...
|
|
21
|
-
│ cria o Agent → agent.run()
|
|
22
|
-
│
|
|
23
|
-
└─ Loop agentico:
|
|
24
|
-
1. Envia systemPrompt + input para o LLM
|
|
25
|
-
2. LLM retorna texto ou tool calls
|
|
26
|
-
3. Skills são executadas (lê/escreve arquivos no meu-projeto/)
|
|
27
|
-
4. Resultados voltam para o LLM
|
|
28
|
-
5. Repete até concluir ou atingir maxIterations
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
As skills (`read-file`, `write-file`, `search-code`, etc.) operam sempre no **diretório onde você executou o comando** (`process.cwd()`). O config e os agents ficam no repositório `omni-ai`.
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## Instalação
|
|
36
|
-
|
|
37
|
-
### Pré-requisitos
|
|
38
|
-
|
|
39
|
-
| Ferramenta | Versão mínima |
|
|
40
|
-
|------------|---------------|
|
|
41
|
-
| Node.js | 22.x |
|
|
42
|
-
| pnpm | 9.x |
|
|
43
|
-
|
|
44
|
-
### 1. Clonar e instalar
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
git clone https://github.com/Ftarganski/omni-ai.git
|
|
48
|
-
cd omni-ai
|
|
49
|
-
pnpm install
|
|
50
|
-
pnpm build
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### 2. Configurar o provider
|
|
54
|
-
|
|
55
|
-
**Opção A — wizard interativo (recomendado):**
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
omni init
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
**Opção B — manual:**
|
|
8
|
+
Configure any LLM provider — Anthropic, OpenAI, GitHub Copilot, Google Gemini, Groq, Ollama, or any self-hosted endpoint — and compose reusable agents for your projects via CLI or programmatic API.
|
|
62
9
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
Edite `config/omni-ai.yaml` e `.env` de acordo com o provider escolhido. Veja a seção [Providers](#providers) abaixo.
|
|
69
|
-
|
|
70
|
-
### 3. Disponibilizar o CLI globalmente
|
|
71
|
-
|
|
72
|
-
**Opção A — via npm (pacote publicado):**
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
npm install -g @ftarganski/omni-ai
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
**Opção B — via link local (desenvolvimento):**
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
# Na raiz do omni-ai, uma vez só
|
|
82
|
-
pnpm build
|
|
83
|
-
npm link bundle/omni-ai
|
|
84
|
-
```
|
|
10
|
+
[](https://www.npmjs.com/package/@ftarganski/omni-ai)
|
|
11
|
+
[](https://github.com/Ftarganski/omni-ai/blob/main/LICENSE)
|
|
12
|
+
[](https://nodejs.org)
|
|
13
|
+
[](https://www.typescriptlang.org)
|
|
14
|
+
</div>
|
|
85
15
|
|
|
86
|
-
|
|
16
|
+
<br />
|
|
87
17
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
# A partir do próprio omni-ai (ou de qualquer projeto)
|
|
92
|
-
omni list agents
|
|
93
|
-
omni list providers
|
|
94
|
-
omni list skills
|
|
95
|
-
```
|
|
18
|
+
<div align="center">
|
|
19
|
+
<img src="https://raw.githubusercontent.com/Ftarganski/omni-ai/main/docs/images/banner.png" alt="omni-ai — run AI agents for backend, frontend, UX and QA" width="100%" />
|
|
20
|
+
</div>
|
|
96
21
|
|
|
97
22
|
---
|
|
98
23
|
|
|
99
|
-
##
|
|
24
|
+
## Why omni-ai
|
|
100
25
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
# Com sessão de memória (persiste entre runs)
|
|
109
|
-
omni run backend-dev "continue o módulo de pedidos" --session user1:feature1
|
|
110
|
-
|
|
111
|
-
# Modo verbose — mostra iterações e tokens por step
|
|
112
|
-
omni run qa-backend "valide src/orders/orders.service.ts" --verbose
|
|
113
|
-
|
|
114
|
-
# Salvar output em arquivo
|
|
115
|
-
omni run backend-dev "crie módulo de notificações" --output implementacao.md
|
|
116
|
-
```
|
|
26
|
+
- **Provider-agnostic** — swap LLM providers with one line in your config, no code changes
|
|
27
|
+
- **21 ready-made agents** — backend (NestJS), frontend (React), UX audit, QA validation
|
|
28
|
+
- **Composable skills** — 20+ tools (filesystem, git, HTTP, accessibility audit, image analysis) that agents call as needed
|
|
29
|
+
- **Session memory** — SQLite-backed persistent sessions with semantic search and token compaction
|
|
30
|
+
- **Extensible** — define custom agents in YAML, skills in TypeScript, providers via `IProvider`
|
|
31
|
+
- **MCP-compatible** — expose skills as MCP tools or consume any MCP server as skills
|
|
117
32
|
|
|
118
33
|
---
|
|
119
34
|
|
|
120
|
-
##
|
|
121
|
-
|
|
122
|
-
### `omni run`
|
|
35
|
+
## How It Works
|
|
123
36
|
|
|
124
37
|
```
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
# Frontend — gera componente
|
|
143
|
-
omni run frontend-dev "crie a página de listagem de pedidos com filtros e paginação"
|
|
144
|
-
|
|
145
|
-
# UX — audita e corrige problemas
|
|
146
|
-
omni run ux-lead "audite o componente OrderForm"
|
|
147
|
-
|
|
148
|
-
# QA — valida código gerado
|
|
149
|
-
omni run qa-lead "valide todos os arquivos em src/orders/"
|
|
150
|
-
|
|
151
|
-
# Com memória entre sessões
|
|
152
|
-
omni run backend-dev "o que você implementou no módulo de customers?" --session dev1:customers
|
|
153
|
-
|
|
154
|
-
# Agente específico + output em arquivo
|
|
155
|
-
omni run backend-schema "crie o schema para a entidade Invoice" --output invoice-schema.md
|
|
38
|
+
cd my-project
|
|
39
|
+
omni run backend-dev "create the orders module with CRUD and GraphQL"
|
|
40
|
+
│
|
|
41
|
+
▼
|
|
42
|
+
CLI (omni)
|
|
43
|
+
│ reads config/omni-ai.yaml ← provider, model, agentsDir
|
|
44
|
+
│ resolves "backend-dev" ← finds agents/**/*.yaml by name:
|
|
45
|
+
│ instantiates the provider ← AnthropicProvider / OpenAIProvider
|
|
46
|
+
│ builds the SkillRegistry ← read-file, write-file, search-code…
|
|
47
|
+
│ creates the Agent → agent.run()
|
|
48
|
+
│
|
|
49
|
+
└─ Agentic loop:
|
|
50
|
+
1. Sends systemPrompt + input to the LLM
|
|
51
|
+
2. LLM returns text or tool calls
|
|
52
|
+
3. Skills execute (read/write files in my-project/)
|
|
53
|
+
4. Results return to the LLM
|
|
54
|
+
5. Repeats until done or maxIterations reached
|
|
156
55
|
```
|
|
157
56
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
### `omni list`
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
omni list agents # Lista todos os agentes disponíveis (nome + descrição)
|
|
164
|
-
omni list skills # Lista todas as skills registradas
|
|
165
|
-
omni list providers # Lista os providers registrados e seus tipos
|
|
166
|
-
```
|
|
57
|
+
Skills always operate within **the directory where you run the command** (`process.cwd()`), never outside it.
|
|
167
58
|
|
|
168
59
|
---
|
|
169
60
|
|
|
170
|
-
|
|
61
|
+
## Quick Start
|
|
171
62
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
```
|
|
175
|
-
omni chain "<prompt>" <agent1> <agent2> [agent3...]
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
| Opção | Tipo | Descrição |
|
|
179
|
-
|-------|------|-----------|
|
|
180
|
-
| `--config <path>` | string | Caminho para o `omni-ai.yaml` |
|
|
181
|
-
| `--output <file>` | string | Salva o output final em arquivo |
|
|
182
|
-
| `--verbose` | flag | Imprime o output de cada agente intermediário |
|
|
183
|
-
| `--stream` | flag | Transmite tokens em tempo real para cada agente da cadeia |
|
|
184
|
-
|
|
185
|
-
**Exemplos:**
|
|
63
|
+
### 1. Install
|
|
186
64
|
|
|
187
65
|
```bash
|
|
188
|
-
|
|
189
|
-
omni chain "crie módulo de orders" backend-schema backend-dev qa-backend
|
|
190
|
-
|
|
191
|
-
# Geração de componente + auditoria UX
|
|
192
|
-
omni chain "crie a página de listagem de pedidos" frontend-dev ux-reviewer
|
|
193
|
-
|
|
194
|
-
# Com output salvo
|
|
195
|
-
omni chain "crie o módulo de customers" backend-schema backend-dev qa-backend --output customers.md
|
|
196
|
-
|
|
197
|
-
# Verbose — mostra output intermediário de cada agente
|
|
198
|
-
omni chain "crie módulo de invoices" backend-schema backend-dev --verbose
|
|
199
|
-
|
|
200
|
-
# Streaming em tempo real ao longo da cadeia
|
|
201
|
-
omni chain "crie e revise o módulo de orders" backend-dev qa-backend --stream
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
**Output visual:**
|
|
205
|
-
|
|
206
|
-
```
|
|
207
|
-
◆ backend-schema [anthropic / claude-sonnet-4-6]
|
|
208
|
-
... (3 iterações)
|
|
209
|
-
|
|
210
|
-
↓ saída passada para: backend-dev
|
|
211
|
-
|
|
212
|
-
◆ backend-dev [anthropic / claude-sonnet-4-6]
|
|
213
|
-
... (8 iterações)
|
|
214
|
-
|
|
215
|
-
↓ saída passada para: qa-backend
|
|
216
|
-
|
|
217
|
-
◆ qa-backend [anthropic / claude-sonnet-4-6]
|
|
218
|
-
... (4 iterações)
|
|
219
|
-
|
|
220
|
-
<output final do qa-backend>
|
|
221
|
-
|
|
222
|
-
Tokens: 18.400 entrada · 5.200 saída · ~$0.084
|
|
66
|
+
npm install -g @ftarganski/omni-ai
|
|
223
67
|
```
|
|
224
68
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
### `omni init`
|
|
228
|
-
|
|
229
|
-
Wizard interativo que gera `config/omni-ai.yaml` e atualiza o `.env` sem editar arquivos manualmente.
|
|
69
|
+
### 2. Configure (interactive wizard)
|
|
230
70
|
|
|
231
71
|
```bash
|
|
232
72
|
omni init
|
|
233
73
|
```
|
|
234
74
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
1. Perguntar qual provider usar (Copilot, Anthropic, OpenAI ou Custom/self-hosted)
|
|
238
|
-
2. Solicitar a API key ou token via campo oculto (não aparece no terminal)
|
|
239
|
-
3. Permitir selecionar o modelo padrão
|
|
240
|
-
4. Opcionalmente configurar um segundo provider para agentes específicos
|
|
241
|
-
5. Gerar `config/omni-ai.yaml` e atualizar `.env` preservando entradas existentes
|
|
242
|
-
6. Exibir os próximos passos com exemplos de comandos
|
|
243
|
-
|
|
244
|
-
**Quando usar:** na primeira vez que configurar o omni-ai, ou quando quiser trocar ou adicionar um provider.
|
|
245
|
-
|
|
246
|
-
> Se `config/omni-ai.yaml` já existir, o wizard pergunta antes de sobrescrever.
|
|
247
|
-
|
|
248
|
-
---
|
|
249
|
-
|
|
250
|
-
### `omni serve`
|
|
251
|
-
|
|
252
|
-
Inicia um servidor HTTP local para executar agentes via REST ou SSE.
|
|
253
|
-
|
|
254
|
-
```
|
|
255
|
-
omni serve [opções]
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
| Opção | Tipo | Descrição |
|
|
259
|
-
|-------|------|-----------|
|
|
260
|
-
| `--port <number>` | number | Porta (padrão: 3000) |
|
|
261
|
-
| `--config <path>` | string | Caminho para `omni-ai.yaml` |
|
|
262
|
-
|
|
263
|
-
**Endpoints:**
|
|
264
|
-
|
|
265
|
-
| Método | Rota | Descrição |
|
|
266
|
-
|--------|------|-----------|
|
|
267
|
-
| `GET` | `/health` | Status do servidor e versão |
|
|
268
|
-
| `GET` | `/agents` | Lista todos os agentes disponíveis |
|
|
269
|
-
| `POST` | `/run` | Executa um agente (JSON response) |
|
|
270
|
-
| `POST` | `/run/stream` | Executa um agente com streaming SSE |
|
|
271
|
-
|
|
272
|
-
```bash
|
|
273
|
-
# Iniciar o servidor
|
|
274
|
-
omni serve --port 4000
|
|
275
|
-
|
|
276
|
-
# Executar um agente via API
|
|
277
|
-
curl -X POST http://localhost:3000/run \
|
|
278
|
-
-H "Content-Type: application/json" \
|
|
279
|
-
-d '{"agent": "backend-dev", "prompt": "liste os endpoints do módulo de orders"}'
|
|
280
|
-
|
|
281
|
-
# Com sessão
|
|
282
|
-
curl -X POST http://localhost:3000/run \
|
|
283
|
-
-d '{"agent": "backend-dev", "prompt": "continue o módulo de customers", "session": "dev1:customers"}'
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
---
|
|
287
|
-
|
|
288
|
-
### `omni watch`
|
|
289
|
-
|
|
290
|
-
Reexecuta um agente automaticamente quando arquivos do projeto mudam.
|
|
291
|
-
|
|
292
|
-
```
|
|
293
|
-
omni watch <agent> "<prompt>" [opções]
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
| Opção | Tipo | Descrição |
|
|
297
|
-
|-------|------|-----------|
|
|
298
|
-
| `--config <path>` | string | Caminho para `omni-ai.yaml` |
|
|
299
|
-
| `--glob <pattern>` | string | Glob dos arquivos a observar (padrão: `src/**/*.{ts,js,yaml,json}`) |
|
|
300
|
-
| `--debounce <ms>` | number | Delay de debounce em ms (padrão: 500) |
|
|
301
|
-
| `--stream` | flag | Transmite tokens em tempo real |
|
|
302
|
-
|
|
303
|
-
```bash
|
|
304
|
-
# Reexecuta qa-backend sempre que um .ts muda
|
|
305
|
-
omni watch qa-backend "valide os arquivos modificados" --glob "src/**/*.ts"
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
---
|
|
309
|
-
|
|
310
|
-
### `omni eval`
|
|
311
|
-
|
|
312
|
-
Avalia um agente contra um dataset de pares `(input, expected)`.
|
|
313
|
-
|
|
314
|
-
```
|
|
315
|
-
omni eval <agent> <dataset.json> [opções]
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
| Opção | Tipo | Descrição |
|
|
319
|
-
|-------|------|-----------|
|
|
320
|
-
| `--config <path>` | string | Caminho para `omni-ai.yaml` |
|
|
321
|
-
| `--concurrency <n>` | number | Avaliações paralelas (padrão: 3) |
|
|
322
|
-
| `--output <file>` | string | Salva relatório JSON em arquivo |
|
|
323
|
-
|
|
324
|
-
**Formato do dataset:**
|
|
325
|
-
|
|
326
|
-
```json
|
|
327
|
-
[
|
|
328
|
-
{ "input": "qual é a capital do Brasil?", "expected": "Brasília" },
|
|
329
|
-
{ "input": "o que é TypeScript?", "expected": "superset tipado de JavaScript" }
|
|
330
|
-
]
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
**Saída:**
|
|
334
|
-
|
|
335
|
-
```
|
|
336
|
-
◆ omni eval agent: backend-dev dataset: qa.json
|
|
337
|
-
|
|
338
|
-
✓ q1 exact
|
|
339
|
-
✓ q2 contains
|
|
340
|
-
✗ q3 miss
|
|
75
|
+
The wizard asks for your provider and API key, then generates `config/omni-ai.yaml` and `.env`.
|
|
341
76
|
|
|
342
|
-
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
---
|
|
346
|
-
|
|
347
|
-
### `omni export`
|
|
348
|
-
|
|
349
|
-
Exporta o histórico de uma sessão como Markdown ou JSON.
|
|
350
|
-
|
|
351
|
-
```
|
|
352
|
-
omni export <sessionId> [opções]
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
| Opção | Tipo | Descrição |
|
|
356
|
-
|-------|------|-----------|
|
|
357
|
-
| `--format <format>` | `markdown` \| `json` | Formato de saída (padrão: `markdown`) |
|
|
358
|
-
| `--output <file>` | string | Salva em arquivo em vez de stdout |
|
|
359
|
-
| `--limit <n>` | number | Limita às últimas N mensagens |
|
|
77
|
+
**Or configure manually:**
|
|
360
78
|
|
|
361
79
|
```bash
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
# Exportar como JSON para arquivo
|
|
366
|
-
omni export dev1:customers --format json --output session.json
|
|
80
|
+
cp config/omni-ai.example.yaml config/omni-ai.yaml
|
|
81
|
+
cp .env.example .env
|
|
82
|
+
# edit both files with your provider and key
|
|
367
83
|
```
|
|
368
84
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
### `omni mcp serve`
|
|
372
|
-
|
|
373
|
-
Expõe todas as skills registradas como ferramentas MCP sobre stdio. Permite que clientes MCP (como Claude Desktop) chamem as skills diretamente.
|
|
85
|
+
### 3. Run your first agent
|
|
374
86
|
|
|
375
87
|
```bash
|
|
376
|
-
|
|
377
|
-
|
|
88
|
+
# enter your project directory
|
|
89
|
+
cd /path/to/my-project
|
|
378
90
|
|
|
379
|
-
|
|
91
|
+
# list available agents
|
|
92
|
+
omni list agents
|
|
380
93
|
|
|
381
|
-
|
|
94
|
+
# run an agent
|
|
95
|
+
omni run backend-dev "create the orders module with CRUD"
|
|
382
96
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
"mcpServers": {
|
|
386
|
-
"omni-ai": {
|
|
387
|
-
"command": "omni",
|
|
388
|
-
"args": ["mcp", "serve"]
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
}
|
|
97
|
+
# chain agents in a pipeline
|
|
98
|
+
omni chain "create orders module" backend-schema backend-dev qa-backend
|
|
392
99
|
```
|
|
393
100
|
|
|
394
101
|
---
|
|
395
102
|
|
|
396
103
|
## Providers
|
|
397
104
|
|
|
398
|
-
###
|
|
105
|
+
### Supported Providers
|
|
399
106
|
|
|
400
|
-
|
|
107
|
+
| Provider | Type | Key Required | Notes |
|
|
108
|
+
|----------|------|-------------|-------|
|
|
109
|
+
| GitHub Copilot | `copilot` | GitHub token | No separate account needed |
|
|
110
|
+
| Anthropic (Claude) | `anthropic` | Anthropic API key | Claude Opus, Sonnet, Haiku |
|
|
111
|
+
| OpenAI (GPT) | `openai` | OpenAI API key | GPT-4o, o1, o3-mini |
|
|
112
|
+
| Google Gemini | `google` | Google API key | Gemini 2.0 Flash, 1.5 Pro |
|
|
113
|
+
| Groq | `groq` | Groq API key | Llama, DeepSeek (free tier) |
|
|
114
|
+
| Ollama | `ollama` | None | Local models, no API key |
|
|
115
|
+
| Custom / Azure | `custom` | Varies | Any OpenAI-compatible endpoint |
|
|
401
116
|
|
|
402
|
-
|
|
403
|
-
# 1. Autenticar com GitHub CLI (se ainda não fez)
|
|
404
|
-
gh auth login
|
|
117
|
+
### Configuration Examples
|
|
405
118
|
|
|
406
|
-
|
|
407
|
-
gh auth token
|
|
408
|
-
# Copia o valor e cola no .env abaixo
|
|
409
|
-
```
|
|
119
|
+
**GitHub Copilot** (recommended if you already have a GitHub subscription):
|
|
410
120
|
|
|
411
121
|
```bash
|
|
412
122
|
# .env
|
|
@@ -416,7 +126,6 @@ GITHUB_TOKEN=ghp_...
|
|
|
416
126
|
```yaml
|
|
417
127
|
# config/omni-ai.yaml
|
|
418
128
|
defaultProvider: copilot
|
|
419
|
-
|
|
420
129
|
providers:
|
|
421
130
|
- name: copilot
|
|
422
131
|
type: copilot
|
|
@@ -425,11 +134,7 @@ providers:
|
|
|
425
134
|
defaultModel: gpt-4o
|
|
426
135
|
```
|
|
427
136
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
---
|
|
431
|
-
|
|
432
|
-
### Anthropic (Claude)
|
|
137
|
+
**Anthropic (Claude):**
|
|
433
138
|
|
|
434
139
|
```bash
|
|
435
140
|
# .env
|
|
@@ -437,9 +142,7 @@ ANTHROPIC_API_KEY=sk-ant-api03-...
|
|
|
437
142
|
```
|
|
438
143
|
|
|
439
144
|
```yaml
|
|
440
|
-
# config/omni-ai.yaml
|
|
441
145
|
defaultProvider: anthropic
|
|
442
|
-
|
|
443
146
|
providers:
|
|
444
147
|
- name: anthropic
|
|
445
148
|
type: anthropic
|
|
@@ -447,140 +150,10 @@ providers:
|
|
|
447
150
|
defaultModel: claude-sonnet-4-6
|
|
448
151
|
```
|
|
449
152
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
**Modelos disponíveis:**
|
|
453
|
-
|
|
454
|
-
| Modelo | ID | Uso recomendado |
|
|
455
|
-
|--------|----|-----------------|
|
|
456
|
-
| Claude Opus 4.7 | `claude-opus-4-7` | Raciocínio complexo, contexto longo |
|
|
457
|
-
| Claude Sonnet 4.6 | `claude-sonnet-4-6` | Qualidade/velocidade balanceados ✓ |
|
|
458
|
-
| Claude Haiku 4.5 | `claude-haiku-4-5-20251001` | Tarefas rápidas e de baixo custo |
|
|
459
|
-
|
|
460
|
-
> **Atenção:** A API Anthropic requer `temperature <= 1.0`. O adapter valida isso automaticamente.
|
|
461
|
-
|
|
462
|
-
---
|
|
463
|
-
|
|
464
|
-
### OpenAI (GPT)
|
|
465
|
-
|
|
466
|
-
```bash
|
|
467
|
-
# .env
|
|
468
|
-
OPENAI_API_KEY=sk-proj-...
|
|
469
|
-
```
|
|
470
|
-
|
|
471
|
-
```yaml
|
|
472
|
-
# config/omni-ai.yaml
|
|
473
|
-
defaultProvider: openai
|
|
474
|
-
|
|
475
|
-
providers:
|
|
476
|
-
- name: openai
|
|
477
|
-
type: openai
|
|
478
|
-
apiKey: ${OPENAI_API_KEY}
|
|
479
|
-
defaultModel: gpt-4o
|
|
480
|
-
```
|
|
481
|
-
|
|
482
|
-
Como obter: [platform.openai.com](https://platform.openai.com) → API keys
|
|
483
|
-
|
|
484
|
-
**Modelos disponíveis:**
|
|
485
|
-
|
|
486
|
-
| Modelo | ID | Uso recomendado |
|
|
487
|
-
|--------|----|-----------------|
|
|
488
|
-
| GPT-4o | `gpt-4o` | Multimodal, raciocínio forte |
|
|
489
|
-
| GPT-4o mini | `gpt-4o-mini` | Rápido, custo eficiente |
|
|
490
|
-
| o1 | `o1` | Raciocínio avançado |
|
|
491
|
-
| o3-mini | `o3-mini` | Raciocínio rápido |
|
|
492
|
-
|
|
493
|
-
---
|
|
494
|
-
|
|
495
|
-
### Google Gemini
|
|
496
|
-
|
|
497
|
-
```bash
|
|
498
|
-
# .env
|
|
499
|
-
GOOGLE_API_KEY=AIza...
|
|
500
|
-
```
|
|
501
|
-
|
|
502
|
-
```yaml
|
|
503
|
-
# config/omni-ai.yaml
|
|
504
|
-
defaultProvider: google
|
|
505
|
-
|
|
506
|
-
providers:
|
|
507
|
-
- name: google
|
|
508
|
-
type: google
|
|
509
|
-
apiKey: ${GOOGLE_API_KEY}
|
|
510
|
-
defaultModel: gemini-2.0-flash
|
|
511
|
-
```
|
|
512
|
-
|
|
513
|
-
Como obter: [aistudio.google.com](https://aistudio.google.com) → Get API key
|
|
514
|
-
|
|
515
|
-
**Modelos disponíveis:**
|
|
516
|
-
|
|
517
|
-
| Modelo | ID | Uso recomendado |
|
|
518
|
-
|--------|----|-----------------|
|
|
519
|
-
| Gemini 2.0 Flash | `gemini-2.0-flash` | Rápido, multimodal, custo baixo ✓ |
|
|
520
|
-
| Gemini 1.5 Pro | `gemini-1.5-pro` | Contexto longo (1M tokens) |
|
|
521
|
-
|
|
522
|
-
---
|
|
523
|
-
|
|
524
|
-
### Groq (inferência ultrarrápida)
|
|
525
|
-
|
|
526
|
-
```bash
|
|
527
|
-
# .env
|
|
528
|
-
GROQ_API_KEY=gsk_...
|
|
529
|
-
```
|
|
530
|
-
|
|
531
|
-
```yaml
|
|
532
|
-
# config/omni-ai.yaml
|
|
533
|
-
providers:
|
|
534
|
-
- name: groq
|
|
535
|
-
type: groq
|
|
536
|
-
apiKey: ${GROQ_API_KEY}
|
|
537
|
-
defaultModel: llama-3.3-70b-versatile
|
|
538
|
-
```
|
|
539
|
-
|
|
540
|
-
Como obter: [console.groq.com](https://console.groq.com) → API Keys
|
|
541
|
-
|
|
542
|
-
---
|
|
543
|
-
|
|
544
|
-
### Ollama (local / self-hosted)
|
|
545
|
-
|
|
546
|
-
```yaml
|
|
547
|
-
# config/omni-ai.yaml
|
|
548
|
-
providers:
|
|
549
|
-
- name: ollama
|
|
550
|
-
type: ollama
|
|
551
|
-
defaultModel: llama3.2
|
|
552
|
-
# baseUrl padrão: http://localhost:11434/v1
|
|
553
|
-
```
|
|
554
|
-
|
|
555
|
-
Não requer API key. Requer [Ollama](https://ollama.com) em execução local.
|
|
556
|
-
|
|
557
|
-
---
|
|
558
|
-
|
|
559
|
-
### Custom / self-hosted (Azure, vLLM, LM Studio...)
|
|
560
|
-
|
|
561
|
-
Qualquer endpoint compatível com a API OpenAI de chat completions:
|
|
562
|
-
|
|
563
|
-
```yaml
|
|
564
|
-
# config/omni-ai.yaml
|
|
565
|
-
providers:
|
|
566
|
-
- name: azure
|
|
567
|
-
type: custom
|
|
568
|
-
baseUrl: https://meu-recurso.openai.azure.com/openai/deployments/gpt-4o
|
|
569
|
-
apiKey: ${AZURE_API_KEY}
|
|
570
|
-
defaultModel: gpt-4o
|
|
571
|
-
```
|
|
572
|
-
|
|
573
|
-
Endpoints compatíveis: **Azure OpenAI**, **LM Studio**, **vLLM**, **Together AI**, **Mistral AI**, **Perplexity**.
|
|
574
|
-
|
|
575
|
-
---
|
|
576
|
-
|
|
577
|
-
### Múltiplos providers
|
|
578
|
-
|
|
579
|
-
Você pode declarar vários providers e cada agente pode usar um diferente:
|
|
153
|
+
**Multiple providers** (each agent can use a different one):
|
|
580
154
|
|
|
581
155
|
```yaml
|
|
582
156
|
defaultProvider: copilot
|
|
583
|
-
|
|
584
157
|
providers:
|
|
585
158
|
- name: copilot
|
|
586
159
|
type: copilot
|
|
@@ -593,243 +166,194 @@ providers:
|
|
|
593
166
|
defaultModel: claude-sonnet-4-6
|
|
594
167
|
|
|
595
168
|
- name: ollama
|
|
596
|
-
type:
|
|
597
|
-
baseUrl: http://localhost:11434/v1
|
|
169
|
+
type: ollama # no API key required
|
|
598
170
|
defaultModel: llama3.2
|
|
599
171
|
```
|
|
600
172
|
|
|
601
|
-
|
|
173
|
+
In any agent YAML, add `provider: anthropic` to override the default for that agent only.
|
|
602
174
|
|
|
603
175
|
---
|
|
604
176
|
|
|
605
|
-
##
|
|
177
|
+
## CLI Reference
|
|
606
178
|
|
|
607
|
-
### `omni
|
|
179
|
+
### `omni run` — Run a single agent
|
|
608
180
|
|
|
609
|
-
```
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
# Provider padrão para todos os agentes (a menos que o agente sobrescreva)
|
|
613
|
-
defaultProvider: copilot
|
|
181
|
+
```bash
|
|
182
|
+
omni run <agent> "<prompt>" [options]
|
|
183
|
+
```
|
|
614
184
|
|
|
615
|
-
|
|
616
|
-
|
|
185
|
+
| Option | Description |
|
|
186
|
+
|--------|-------------|
|
|
187
|
+
| `--config <path>` | Path to `omni-ai.yaml` (auto-detected by default) |
|
|
188
|
+
| `--session <id>` | Session ID `"resourceId:threadId"` — enables SQLite memory across runs |
|
|
189
|
+
| `--output <file>` | Save output to a file |
|
|
190
|
+
| `--verbose` | Show each iteration, tool calls, and token count |
|
|
191
|
+
| `--stream` | Stream tokens in real time |
|
|
617
192
|
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
agents:
|
|
626
|
-
# Agente inline — definido diretamente no config (não precisa de arquivo YAML separado)
|
|
627
|
-
- name: code-reviewer
|
|
628
|
-
description: Revisa código para qualidade, bugs e segurança
|
|
629
|
-
systemPrompt: |
|
|
630
|
-
Você é um revisor de código especialista...
|
|
631
|
-
skills:
|
|
632
|
-
- read-file
|
|
633
|
-
- search-code
|
|
634
|
-
maxIterations: 5
|
|
635
|
-
|
|
636
|
-
# Agente com override de provider/modelo
|
|
637
|
-
- name: doc-writer
|
|
638
|
-
description: Gera documentação
|
|
639
|
-
provider: anthropic # sobrescreve defaultProvider só para este agente
|
|
640
|
-
model: claude-haiku-4-5-20251001 # sobrescreve defaultModel
|
|
641
|
-
systemPrompt: |
|
|
642
|
-
Você é um redator técnico...
|
|
643
|
-
maxIterations: 3
|
|
193
|
+
```bash
|
|
194
|
+
omni run backend-dev "create the customers module with CRUD and GraphQL"
|
|
195
|
+
omni run frontend-dev "create the orders listing page with filters and pagination"
|
|
196
|
+
omni run ux-lead "audit the OrderForm component"
|
|
197
|
+
omni run qa-lead "validate all files in src/orders/"
|
|
198
|
+
omni run backend-dev "what did you implement in the last session?" --session dev1:orders
|
|
644
199
|
```
|
|
645
200
|
|
|
646
|
-
|
|
201
|
+
---
|
|
647
202
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
└─ defaultModel: gpt-4o ← se aplica a todos os agentes
|
|
653
|
-
|
|
654
|
-
agents/backend/backend-dev.yaml
|
|
655
|
-
├─ provider: (ausente) → usa defaultProvider (copilot)
|
|
656
|
-
├─ provider: anthropic → sobrescreve só para este agente
|
|
657
|
-
├─ model: (ausente) → usa defaultModel do provider resolvido
|
|
658
|
-
└─ model: gpt-4o-mini → sobrescreve só para este agente
|
|
203
|
+
### `omni chain` — Pipeline multiple agents
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
omni chain "<prompt>" <agent1> <agent2> [agent3...]
|
|
659
207
|
```
|
|
660
208
|
|
|
661
|
-
|
|
209
|
+
The output of each agent becomes the input of the next.
|
|
662
210
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
| `description` | `string` | obrigatório | O que o agente faz |
|
|
667
|
-
| `provider` | `string` | herda | Nome do provider — omita para usar `defaultProvider` |
|
|
668
|
-
| `model` | `string` | herda | ID do modelo — omita para usar `defaultModel` do provider |
|
|
669
|
-
| `systemPrompt` | `string` | obrigatório | Instruções do agente |
|
|
670
|
-
| `skills` | `string[]` | `[]` | Skills que o agente pode chamar como ferramentas |
|
|
671
|
-
| `maxIterations` | `number` | `10` | Máximo de iterações do loop agentico |
|
|
672
|
-
| `temperature` | `number` | padrão do provider | Temperatura de amostragem (0–2; max 1.0 para Anthropic) |
|
|
211
|
+
```bash
|
|
212
|
+
# Schema → implementation → validation
|
|
213
|
+
omni chain "create orders module" backend-schema backend-dev qa-backend
|
|
673
214
|
|
|
674
|
-
|
|
215
|
+
# Component generation + UX audit
|
|
216
|
+
omni chain "create orders listing page" frontend-dev ux-reviewer
|
|
675
217
|
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
| Agente | Arquivo | O que faz |
|
|
681
|
-
|--------|---------|-----------|
|
|
682
|
-
| `backend-dev` | `agents/backend/backend-dev.yaml` | Orquestrador — feature NestJS completa: schema → serviço → resolver → listeners → tests |
|
|
683
|
-
| `backend-schema` | `agents/backend/backend-schema.yaml` | Schema DynamoDB OneTable com `defineSchema()` |
|
|
684
|
-
| `backend-service` | `agents/backend/backend-service.yaml` | NestJS service com CRUD, eventos, error helpers, caching |
|
|
685
|
-
| `backend-resolver` | `agents/backend/backend-resolver.yaml` | GraphQL resolver com padrão federation + SDL |
|
|
686
|
-
| `backend-listener` | `agents/backend/backend-listener.yaml` | Event listeners com `@OnEventCatcher` |
|
|
687
|
-
| `backend-test` | `agents/backend/backend-test.yaml` | Testes Jest de integração com DynamoDB local real |
|
|
688
|
-
| `backend-atom-app` | `agents/backend/backend-atom-app.yaml` | Conectores Atom framework (sessões, ARNs, roteamento de mensagens) |
|
|
689
|
-
|
|
690
|
-
### Frontend (5 agentes)
|
|
691
|
-
|
|
692
|
-
| Agente | Arquivo | O que faz |
|
|
693
|
-
|--------|---------|-----------|
|
|
694
|
-
| `frontend-dev` | `agents/frontend/frontend-dev.yaml` | Orquestrador — feature React completa: route → componentes → hooks |
|
|
695
|
-
| `frontend-ui-component` | `agents/frontend/frontend-ui-component.yaml` | Componentes UI primitivos estilo shadcn/ui com CVA + Radix |
|
|
696
|
-
| `frontend-module-component` | `agents/frontend/frontend-module-component.yaml` | Componentes de feature conectados a dados (TanStack Query) |
|
|
697
|
-
| `frontend-page-route` | `agents/frontend/frontend-page-route.yaml` | Páginas TanStack Router com layouts responsivos |
|
|
698
|
-
| `frontend-custom-hook` | `agents/frontend/frontend-custom-hook.yaml` | Custom React hooks tipados e SSR-safe |
|
|
699
|
-
|
|
700
|
-
### UX (5 agentes)
|
|
701
|
-
|
|
702
|
-
| Agente | Arquivo | O que faz |
|
|
703
|
-
|--------|---------|-----------|
|
|
704
|
-
| `ux-lead` | `agents/ux/ux-lead.yaml` | Orquestrador — auditoria UX completa em 10 dimensões, corrige críticos e documenta os demais |
|
|
705
|
-
| `ux-reviewer` | `agents/ux/ux-reviewer.yaml` | Revisão UX detalhada com findings por severidade (Critical / Moderate / Low) |
|
|
706
|
-
| `ux-states` | `agents/ux/ux-states.yaml` | Componentes de estado: Skeleton, Empty, Error e Success |
|
|
707
|
-
| `ux-forms` | `agents/ux/ux-forms.yaml` | Formulários com validação, autocomplete, acessibilidade e estados de loading |
|
|
708
|
-
| `ux-motion` | `agents/ux/ux-motion.yaml` | Micro-interações e transições com `motion-safe:` obrigatório |
|
|
709
|
-
|
|
710
|
-
### QA (4 agentes)
|
|
711
|
-
|
|
712
|
-
| Agente | Arquivo | O que faz |
|
|
713
|
-
|--------|---------|-----------|
|
|
714
|
-
| `qa-lead` | `agents/qa/qa-lead.yaml` | Orquestrador — classifica arquivos, delega aos agentes especializados e emite veredicto de merge |
|
|
715
|
-
| `qa-frontend` | `agents/qa/qa-frontend.yaml` | Valida React/TypeScript: imports, tokens Tailwind, responsividade, acessibilidade |
|
|
716
|
-
| `qa-ux` | `agents/qa/qa-ux.yaml` | Valida UX: feedback states, formulários, motion, content tone |
|
|
717
|
-
| `qa-backend` | `agents/qa/qa-backend.yaml` | Valida NestJS: services, resolvers, schema GraphQL, listeners, testes |
|
|
218
|
+
# With output saved to file
|
|
219
|
+
omni chain "create customers module" backend-schema backend-dev qa-backend --output customers.md
|
|
220
|
+
```
|
|
718
221
|
|
|
719
|
-
|
|
222
|
+
**Visual output:**
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
◆ backend-schema [anthropic / claude-sonnet-4-6]
|
|
226
|
+
... (3 iterations)
|
|
720
227
|
|
|
721
|
-
|
|
228
|
+
↓ output passed to: backend-dev
|
|
722
229
|
|
|
723
|
-
|
|
230
|
+
◆ backend-dev [anthropic / claude-sonnet-4-6]
|
|
231
|
+
... (8 iterations)
|
|
724
232
|
|
|
725
|
-
|
|
233
|
+
↓ output passed to: qa-backend
|
|
726
234
|
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
| `read-file` | Lê o conteúdo completo de um arquivo |
|
|
730
|
-
| `write-file` | Escreve ou sobrescreve um arquivo (cria diretórios automaticamente) |
|
|
731
|
-
| `list-directory` | Lista arquivos em um diretório (recursivo, filtro por extensão) |
|
|
235
|
+
◆ qa-backend [anthropic / claude-sonnet-4-6]
|
|
236
|
+
... (4 iterations)
|
|
732
237
|
|
|
733
|
-
|
|
238
|
+
Tokens: 18,400 input · 5,200 output · ~$0.084
|
|
239
|
+
```
|
|
734
240
|
|
|
735
|
-
|
|
736
|
-
|-------|-----------|
|
|
737
|
-
| `search-code` | Busca texto ou regex em arquivos TypeScript/TSX |
|
|
241
|
+
---
|
|
738
242
|
|
|
739
|
-
|
|
243
|
+
### Other Commands
|
|
740
244
|
|
|
741
|
-
|
|
|
742
|
-
|
|
743
|
-
| `
|
|
245
|
+
| Command | Description |
|
|
246
|
+
|---------|-------------|
|
|
247
|
+
| `omni list agents` | List all available agents with names and descriptions |
|
|
248
|
+
| `omni list skills` | List all registered skills |
|
|
249
|
+
| `omni list providers` | List registered providers and their types |
|
|
250
|
+
| `omni init` | Interactive wizard to generate `omni-ai.yaml` and `.env` |
|
|
251
|
+
| `omni serve [--port N]` | Start a local HTTP server (REST + SSE) to call agents via API |
|
|
252
|
+
| `omni watch <agent> "<prompt>"` | Re-run an agent automatically on file changes |
|
|
253
|
+
| `omni eval <agent> <dataset.json>` | Evaluate an agent against an `(input, expected)` dataset |
|
|
254
|
+
| `omni export <sessionId>` | Export session history as Markdown or JSON |
|
|
255
|
+
| `omni mcp serve` | Expose all registered skills as MCP tools over stdio |
|
|
744
256
|
|
|
745
|
-
|
|
257
|
+
---
|
|
746
258
|
|
|
747
|
-
|
|
748
|
-
|-------|-----------|
|
|
749
|
-
| `git-status` | Retorna o status atual do repositório |
|
|
750
|
-
| `git-diff` | Retorna o diff de um arquivo ou do repositório |
|
|
751
|
-
| `git-log` | Lista commits recentes com autoria e mensagem |
|
|
752
|
-
| `git-commit-message` | Gera mensagem de commit a partir de um diff (chamada LLM) |
|
|
259
|
+
## Built-in Agents (21)
|
|
753
260
|
|
|
754
|
-
|
|
261
|
+
### Backend — NestJS / TypeScript (7 agents)
|
|
755
262
|
|
|
756
|
-
|
|
|
757
|
-
|
|
758
|
-
| `
|
|
263
|
+
| Agent | What it does |
|
|
264
|
+
|-------|-------------|
|
|
265
|
+
| `backend-dev` | Orchestrator — full NestJS feature: schema → service → resolver → listeners → tests |
|
|
266
|
+
| `backend-schema` | DynamoDB OneTable schema with `defineSchema()` |
|
|
267
|
+
| `backend-service` | NestJS service with CRUD, events, error helpers, caching |
|
|
268
|
+
| `backend-resolver` | GraphQL resolver with federation pattern + SDL |
|
|
269
|
+
| `backend-listener` | Event listeners with `@OnEventCatcher` |
|
|
270
|
+
| `backend-test` | Jest integration tests with real local DynamoDB |
|
|
271
|
+
| `backend-atom-app` | Atom framework connectors (sessions, ARNs, message routing) |
|
|
759
272
|
|
|
760
|
-
|
|
273
|
+
### Frontend — React / TypeScript (5 agents)
|
|
761
274
|
|
|
762
|
-
|
|
|
763
|
-
|
|
764
|
-
| `
|
|
275
|
+
| Agent | What it does |
|
|
276
|
+
|-------|-------------|
|
|
277
|
+
| `frontend-dev` | Orchestrator — full React feature: route → components → hooks |
|
|
278
|
+
| `frontend-ui-component` | Primitive UI components (shadcn/ui style, CVA + Radix) |
|
|
279
|
+
| `frontend-module-component` | Feature components connected to data (TanStack Query) |
|
|
280
|
+
| `frontend-page-route` | TanStack Router pages with responsive layouts |
|
|
281
|
+
| `frontend-custom-hook` | Typed, SSR-safe custom React hooks |
|
|
765
282
|
|
|
766
|
-
|
|
283
|
+
### UX (5 agents)
|
|
767
284
|
|
|
768
|
-
|
|
|
769
|
-
|
|
770
|
-
| `
|
|
771
|
-
| `
|
|
772
|
-
| `
|
|
773
|
-
| `
|
|
285
|
+
| Agent | What it does |
|
|
286
|
+
|-------|-------------|
|
|
287
|
+
| `ux-lead` | Orchestrator — full UX audit across 10 dimensions, fixes critical issues |
|
|
288
|
+
| `ux-reviewer` | Detailed UX review with findings by severity (Critical / Moderate / Low) |
|
|
289
|
+
| `ux-states` | State components: Skeleton, Empty, Error, Success |
|
|
290
|
+
| `ux-forms` | Forms with validation, autocomplete, accessibility, loading states |
|
|
291
|
+
| `ux-motion` | Micro-interactions and transitions (always `motion-safe:`) |
|
|
774
292
|
|
|
775
|
-
|
|
293
|
+
### QA (4 agents)
|
|
776
294
|
|
|
777
|
-
|
|
|
778
|
-
|
|
779
|
-
| `
|
|
780
|
-
| `
|
|
781
|
-
| `
|
|
295
|
+
| Agent | What it does |
|
|
296
|
+
|-------|-------------|
|
|
297
|
+
| `qa-lead` | Orchestrator — classifies files, delegates to specialists, emits merge verdict |
|
|
298
|
+
| `qa-frontend` | Validates React/TypeScript: imports, Tailwind tokens, responsiveness, a11y |
|
|
299
|
+
| `qa-ux` | Validates UX: feedback states, forms, motion, content tone |
|
|
300
|
+
| `qa-backend` | Validates NestJS: services, resolvers, GraphQL schema, listeners, tests |
|
|
782
301
|
|
|
783
|
-
|
|
302
|
+
---
|
|
784
303
|
|
|
785
|
-
|
|
786
|
-
|-------|-----------|
|
|
787
|
-
| `find-test-pattern` | Localiza padrões em arquivos de teste |
|
|
788
|
-
| `analyze-test-coverage` | Analisa cobertura de testes por módulo |
|
|
304
|
+
## Skills Library
|
|
789
305
|
|
|
790
|
-
|
|
306
|
+
Skills are the tools agents call during the agentic loop. All operate within `cwd` — never outside the target project.
|
|
791
307
|
|
|
792
|
-
|
|
308
|
+
| Category | Subpath | Skills |
|
|
309
|
+
|----------|---------|--------|
|
|
310
|
+
| Filesystem | `/skills/fs` | `read-file`, `write-file`, `list-directory` |
|
|
311
|
+
| Code | `/skills/code` | `search-code` (text/regex across TypeScript files) |
|
|
312
|
+
| UX | `/skills/ux` | `audit-accessibility` (heuristic a11y scan of TSX) |
|
|
313
|
+
| Git | `/skills/git` | `git-status`, `git-diff`, `git-log`, `git-commit-message` |
|
|
314
|
+
| HTTP | `/skills/http` | `http-request` (Bearer, Basic, OAuth2 client-credentials) |
|
|
315
|
+
| Multimodal | `/skills/multimodal` | `analyze-image` (screenshots, diagrams, mockups) |
|
|
316
|
+
| Backend | `/skills/backend` | `find-code-pattern`, `analyze-nestjs-module`, `analyze-dynamo-schema`, `analyze-graphql-schema` |
|
|
317
|
+
| Frontend | `/skills/frontend` | `find-component-pattern`, `analyze-component`, `analyze-module-structure` |
|
|
318
|
+
| QA | `/skills/qa` | `find-test-pattern`, `analyze-test-coverage` |
|
|
793
319
|
|
|
794
320
|
---
|
|
795
321
|
|
|
796
|
-
##
|
|
322
|
+
## Memory & Sessions
|
|
797
323
|
|
|
798
|
-
### Via CLI
|
|
324
|
+
### Via CLI
|
|
799
325
|
|
|
800
326
|
```bash
|
|
801
|
-
#
|
|
802
|
-
omni run backend-dev "
|
|
327
|
+
# First run — session is created and stored in ~/.omni-ai/sessions.db
|
|
328
|
+
omni run backend-dev "create the orders module with CRUD" --session dev1:orders
|
|
803
329
|
|
|
804
|
-
#
|
|
805
|
-
omni run backend-dev "
|
|
330
|
+
# Second run — agent loads session history as context
|
|
331
|
+
omni run backend-dev "add the search listener to the orders module" --session dev1:orders
|
|
806
332
|
|
|
807
|
-
#
|
|
808
|
-
omni run backend-dev "
|
|
333
|
+
# Query previous context
|
|
334
|
+
omni run backend-dev "which files did you create in the last session?" --session dev1:orders
|
|
809
335
|
```
|
|
810
336
|
|
|
811
|
-
|
|
337
|
+
Session ID format: `"resourceId:threadId"`. Use `resourceId` for user/project and `threadId` for the feature or conversation.
|
|
812
338
|
|
|
813
|
-
### Via API
|
|
339
|
+
### Via Programmatic API
|
|
814
340
|
|
|
815
341
|
```typescript
|
|
816
342
|
import { createRuntime } from "@ftarganski/omni-ai";
|
|
817
343
|
import { SQLiteMemoryStore, ObservationMaskingCompactor } from "@ftarganski/omni-ai/memory";
|
|
818
344
|
|
|
819
|
-
const runtime = await createRuntime({
|
|
820
|
-
skills: [/* suas skills extras */],
|
|
821
|
-
});
|
|
345
|
+
const runtime = await createRuntime({ skills: [] });
|
|
822
346
|
|
|
823
|
-
//
|
|
824
|
-
const result = await runtime.run("backend-dev", "
|
|
347
|
+
// Simple run, no memory
|
|
348
|
+
const result = await runtime.run("backend-dev", "create the customers module");
|
|
825
349
|
console.log(result.output);
|
|
826
350
|
|
|
827
|
-
//
|
|
351
|
+
// With cross-session persistence
|
|
828
352
|
const store = new SQLiteMemoryStore({ path: "./sessions.db" });
|
|
829
353
|
|
|
830
354
|
const result2 = await runtime.run(
|
|
831
355
|
"backend-dev",
|
|
832
|
-
"
|
|
356
|
+
"add search to the customers module",
|
|
833
357
|
{
|
|
834
358
|
session: { resourceId: "user-42", threadId: "feature-customers" },
|
|
835
359
|
memoryStore: store,
|
|
@@ -837,223 +361,76 @@ const result2 = await runtime.run(
|
|
|
837
361
|
);
|
|
838
362
|
```
|
|
839
363
|
|
|
840
|
-
###
|
|
364
|
+
### Token Compaction
|
|
841
365
|
|
|
842
|
-
|
|
366
|
+
Without compaction, each iteration re-sends the full history:
|
|
843
367
|
|
|
844
368
|
```
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
369
|
+
Iteration 1: 1,000 tokens
|
|
370
|
+
Iteration 2: 3,500 tokens
|
|
371
|
+
Iteration 3: 8,200 tokens → Total: 26,700 tokens
|
|
372
|
+
Iteration 4: 14,000 tokens
|
|
849
373
|
```
|
|
850
374
|
|
|
851
|
-
|
|
375
|
+
With `ObservationMaskingCompactor` (zero LLM cost):
|
|
852
376
|
|
|
853
377
|
```
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
378
|
+
Iteration 1: 1,000 tokens
|
|
379
|
+
Iteration 2: 3,500 tokens
|
|
380
|
+
Iteration 3: 1,800 tokens ← old tool results masked
|
|
381
|
+
Iteration 4: 2,100 tokens → Total: 8,400 tokens (68% reduction)
|
|
858
382
|
```
|
|
859
383
|
|
|
860
|
-
| Compactor |
|
|
861
|
-
|
|
862
|
-
| `ObservationMaskingCompactor` |
|
|
863
|
-
| `SummaryCompactor` | LLM
|
|
384
|
+
| Compactor | Strategy | LLM calls | Best for |
|
|
385
|
+
|-----------|----------|-----------|----------|
|
|
386
|
+
| `ObservationMaskingCompactor` | Replaces old tool result bodies with `[masked ~N tokens]` | 0 | File-intensive agents |
|
|
387
|
+
| `SummaryCompactor` | LLM summarizes old messages, keeps N recent verbatim | 1 per trigger | Long conversations, multi-step reasoning |
|
|
864
388
|
|
|
865
389
|
---
|
|
866
390
|
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
`SemanticMemoryStore` substitui a busca por palavras-chave (FTS5) por similaridade de coseno usando embeddings do provider.
|
|
870
|
-
|
|
871
|
-
```typescript
|
|
872
|
-
import { createRuntime } from "@ftarganski/omni-ai";
|
|
873
|
-
import { SQLiteMemoryStore, SemanticMemoryStore } from "@ftarganski/omni-ai/memory";
|
|
874
|
-
import { OpenAIProvider } from "@ftarganski/omni-ai/provider-openai";
|
|
875
|
-
|
|
876
|
-
// Provider com suporte a embeddings (capabilities.embedding = true)
|
|
877
|
-
const embeddingProvider = new OpenAIProvider({ apiKey: process.env.OPENAI_API_KEY! });
|
|
878
|
-
|
|
879
|
-
// Persiste mensagens no SQLite + busca semântica em memória
|
|
880
|
-
const store = new SemanticMemoryStore(
|
|
881
|
-
embeddingProvider,
|
|
882
|
-
new SQLiteMemoryStore({ path: "./sessions.db" })
|
|
883
|
-
);
|
|
884
|
-
|
|
885
|
-
const runtime = await createRuntime({ skills, memoryStore: store });
|
|
886
|
-
```
|
|
887
|
-
|
|
888
|
-
**Busca por similaridade:**
|
|
391
|
+
## Programmatic API
|
|
889
392
|
|
|
890
393
|
```typescript
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
5 // topK
|
|
895
|
-
);
|
|
896
|
-
// results: [{ content: "...", score: 0.91 }, ...]
|
|
897
|
-
```
|
|
898
|
-
|
|
899
|
-
**`VectorIndex`** — índice vetorial in-memory para uso direto:
|
|
900
|
-
|
|
901
|
-
```typescript
|
|
902
|
-
import { VectorIndex } from "@ftarganski/omni-ai/memory";
|
|
903
|
-
|
|
904
|
-
const index = new VectorIndex<string>();
|
|
905
|
-
index.add("doc1", embeddingVector1);
|
|
906
|
-
index.add("doc2", embeddingVector2);
|
|
907
|
-
|
|
908
|
-
const results = index.query(queryVector, 3); // [{ id: "doc1", score: 0.94 }, ...]
|
|
909
|
-
```
|
|
910
|
-
|
|
911
|
-
---
|
|
912
|
-
|
|
913
|
-
## Estrutura do repositório
|
|
914
|
-
|
|
915
|
-
```
|
|
916
|
-
omni-ai/
|
|
917
|
-
│
|
|
918
|
-
├── packages/ # pacotes npm (pnpm workspaces)
|
|
919
|
-
│ ├── core/ # @omni-ai/core
|
|
920
|
-
│ │ └── src/
|
|
921
|
-
│ │ ├── types.ts # IProvider, ISkill, IAgent, IMemoryStore...
|
|
922
|
-
│ │ ├── config/
|
|
923
|
-
│ │ │ ├── schema.ts # Zod schema do omni-ai.yaml
|
|
924
|
-
│ │ │ └── loader.ts # loadConfig() com substituição de env vars
|
|
925
|
-
│ │ ├── agents/
|
|
926
|
-
│ │ │ ├── agent.ts # Loop agentico + integração de memória
|
|
927
|
-
│ │ │ └── loader.ts # loadAgent() — carrega YAML + resolve provider
|
|
928
|
-
│ │ ├── providers/registry.ts # ProviderRegistry (factory por type string)
|
|
929
|
-
│ │ ├── skills/registry.ts # SkillRegistry
|
|
930
|
-
│ │ └── bootstrap.ts # createRuntime() — API de alto nível
|
|
931
|
-
│ │
|
|
932
|
-
│ ├── provider-anthropic/ # @omni-ai/provider-anthropic
|
|
933
|
-
│ │ └── src/
|
|
934
|
-
│ │ ├── provider.ts # AnthropicProvider implements IProvider
|
|
935
|
-
│ │ ├── mappers.ts # Conversão omni-ai ↔ Anthropic SDK types
|
|
936
|
-
│ │ └── index.ts # Registra "anthropic" no ProviderRegistry
|
|
937
|
-
│ │
|
|
938
|
-
│ ├── provider-openai/ # @omni-ai/provider-openai
|
|
939
|
-
│ │ └── src/
|
|
940
|
-
│ │ ├── provider.ts # OpenAIProvider implements IProvider
|
|
941
|
-
│ │ ├── mappers.ts # Conversão omni-ai ↔ OpenAI SDK types
|
|
942
|
-
│ │ └── index.ts # Registra "openai" e "copilot" no ProviderRegistry
|
|
943
|
-
│ │
|
|
944
|
-
│ ├── memory/ # @omni-ai/memory
|
|
945
|
-
│ │ └── src/
|
|
946
|
-
│ │ ├── stores/
|
|
947
|
-
│ │ │ ├── in-memory.ts # InMemoryStore (padrão, sem persistência)
|
|
948
|
-
│ │ │ ├── sqlite.ts # SQLiteMemoryStore (arquivo local, FTS5)
|
|
949
|
-
│ │ │ └── semantic-memory-store.ts # SemanticMemoryStore (busca por cosine similarity)
|
|
950
|
-
│ │ ├── compactors/
|
|
951
|
-
│ │ │ ├── observation-masking.ts # Mascara tool results antigos (zero LLM)
|
|
952
|
-
│ │ │ └── summary.ts # Resumo por LLM (1 chamada por trigger)
|
|
953
|
-
│ │ ├── vector.ts # VectorIndex + cosineSimilarity
|
|
954
|
-
│ │ └── utils.ts # estimateTokens() compartilhado
|
|
955
|
-
│ │
|
|
956
|
-
│ ├── skills-fs/ # @omni-ai/skills-fs
|
|
957
|
-
│ │ └── src/
|
|
958
|
-
│ │ ├── read-file.ts # Lê arquivo (com validação de path traversal)
|
|
959
|
-
│ │ ├── write-file.ts # Escreve arquivo (com validação de path)
|
|
960
|
-
│ │ └── list-directory.ts # Lista diretório (com validação de path)
|
|
961
|
-
│ │
|
|
962
|
-
│ ├── skills-code/ # @omni-ai/skills-code
|
|
963
|
-
│ │ └── src/
|
|
964
|
-
│ │ └── search-code.ts # Busca texto/regex em arquivos TypeScript
|
|
965
|
-
│ │
|
|
966
|
-
│ ├── skills-ux/ # @omni-ai/skills-ux
|
|
967
|
-
│ │ └── src/
|
|
968
|
-
│ │ └── audit-accessibility.ts # Scan heurístico a11y de componentes TSX
|
|
969
|
-
│ │
|
|
970
|
-
│ └── cli/ # @omni-ai/cli
|
|
971
|
-
│ └── src/
|
|
972
|
-
│ ├── bin.ts # Entry point, carrega .env
|
|
973
|
-
│ ├── commands/
|
|
974
|
-
│ │ ├── run.ts # omni run <agent> "<prompt>"
|
|
975
|
-
│ │ ├── chain.ts # omni chain "<prompt>" <agent1> <agent2>...
|
|
976
|
-
│ │ ├── list.ts # omni list agents|skills|providers
|
|
977
|
-
│ │ └── init.ts # omni init — wizard interativo
|
|
978
|
-
│ └── utils/
|
|
979
|
-
│ ├── format.ts # Output formatado (tokens, iterações, erros)
|
|
980
|
-
│ └── config-path.ts # Resolve caminho do omni-ai.yaml
|
|
981
|
-
│
|
|
982
|
-
├── agents/ # Definições YAML dos agentes (21 agentes)
|
|
983
|
-
│ ├── backend/ # 7 agentes NestJS/TypeScript
|
|
984
|
-
│ ├── frontend/ # 5 agentes React/TypeScript
|
|
985
|
-
│ ├── ux/ # 5 agentes UX
|
|
986
|
-
│ └── qa/ # 4 agentes QA
|
|
987
|
-
│
|
|
988
|
-
├── docs/ # Documentação
|
|
989
|
-
│ ├── providers/
|
|
990
|
-
│ │ ├── anthropic.md # Setup detalhado Anthropic
|
|
991
|
-
│ │ ├── openai.md # Setup detalhado OpenAI
|
|
992
|
-
│ │ └── copilot.md # Setup detalhado GitHub Copilot
|
|
993
|
-
│ └── templates/
|
|
994
|
-
│ ├── agent.yaml # Template para novos agentes
|
|
995
|
-
│ └── skill.ts # Template para novas skills
|
|
996
|
-
│
|
|
997
|
-
├── config/
|
|
998
|
-
│ └── omni-ai.example.yaml # Template de configuração (copie → omni-ai.yaml)
|
|
999
|
-
│
|
|
1000
|
-
├── .env.example # Template de variáveis de ambiente
|
|
1001
|
-
└── tsconfig.ide.json # Paths para resolução de tipos no VS Code
|
|
1002
|
-
```
|
|
1003
|
-
|
|
1004
|
-
---
|
|
1005
|
-
|
|
1006
|
-
## Usando de outro projeto
|
|
1007
|
-
|
|
1008
|
-
O `omni-ai` é um repositório central — os agentes e o config ficam nele. Você usa o CLI de dentro de qualquer projeto alvo.
|
|
1009
|
-
|
|
1010
|
-
### Setup único (instalação global)
|
|
1011
|
-
|
|
1012
|
-
```bash
|
|
1013
|
-
npm install -g @ftarganski/omni-ai
|
|
1014
|
-
```
|
|
1015
|
-
|
|
1016
|
-
### Uso do dia a dia
|
|
1017
|
-
|
|
1018
|
-
```bash
|
|
1019
|
-
# 1. Entrar no projeto alvo
|
|
1020
|
-
cd /caminho/para/meu-projeto
|
|
1021
|
-
|
|
1022
|
-
# 2. Rodar agentes normalmente
|
|
1023
|
-
omni run backend-dev "crie o módulo de produtos"
|
|
1024
|
-
omni run frontend-dev "crie a página de listagem de produtos"
|
|
1025
|
-
omni run qa-lead "valide src/products/"
|
|
1026
|
-
omni run ux-reviewer "audite src/components/modules/Products/"
|
|
1027
|
-
```
|
|
394
|
+
import { createRuntime, parallel } from "@ftarganski/omni-ai";
|
|
395
|
+
import { readFileSkill, writeFileSkill } from "@ftarganski/omni-ai/skills/fs";
|
|
396
|
+
import { searchCodeSkill } from "@ftarganski/omni-ai/skills/code";
|
|
1028
397
|
|
|
1029
|
-
|
|
398
|
+
const runtime = await createRuntime({
|
|
399
|
+
skills: [readFileSkill, writeFileSkill, searchCodeSkill],
|
|
400
|
+
});
|
|
1030
401
|
|
|
1031
|
-
|
|
402
|
+
// Single agent run
|
|
403
|
+
const result = await runtime.run("backend-dev", "create the invoices module");
|
|
404
|
+
console.log(`Done in ${result.iterations} iterations`);
|
|
405
|
+
console.log(result.output);
|
|
1032
406
|
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
407
|
+
// Run multiple agents in parallel
|
|
408
|
+
const outcome = await parallel(runtime, {
|
|
409
|
+
agents: ["backend-dev", "qa-backend", "ux-reviewer"],
|
|
410
|
+
input: "review the orders module for quality, tests, and accessibility",
|
|
411
|
+
});
|
|
1036
412
|
|
|
1037
|
-
|
|
1038
|
-
|
|
413
|
+
for (const [agent, res] of Object.entries(outcome.results)) {
|
|
414
|
+
if ("error" in res) console.error(`${agent}: ${res.error}`);
|
|
415
|
+
else console.log(`${agent} (${res.iterations} iterations):\n${res.output}`);
|
|
416
|
+
}
|
|
1039
417
|
```
|
|
1040
418
|
|
|
1041
419
|
---
|
|
1042
420
|
|
|
1043
|
-
##
|
|
421
|
+
## Extending the Framework
|
|
1044
422
|
|
|
1045
|
-
###
|
|
1046
|
-
|
|
1047
|
-
Copie `docs/templates/agent.yaml` para `agents/<domínio>/<domínio>-<função>.yaml`:
|
|
423
|
+
### Custom Agent (YAML, no rebuild needed)
|
|
1048
424
|
|
|
1049
425
|
```yaml
|
|
426
|
+
# agents/my-domain/my-agent.yaml
|
|
1050
427
|
name: my-agent
|
|
1051
|
-
description:
|
|
1052
|
-
# provider: anthropic #
|
|
1053
|
-
# model: gpt-4o-mini #
|
|
428
|
+
description: What this agent does in one line
|
|
429
|
+
# provider: anthropic # optional — inherits defaultProvider
|
|
430
|
+
# model: gpt-4o-mini # optional — inherits defaultModel
|
|
1054
431
|
systemPrompt: |
|
|
1055
|
-
|
|
1056
|
-
|
|
432
|
+
You are a specialist in...
|
|
433
|
+
Describe constraints, output format, and behavior.
|
|
1057
434
|
skills:
|
|
1058
435
|
- read-file
|
|
1059
436
|
- search-code
|
|
@@ -1062,50 +439,33 @@ maxIterations: 10
|
|
|
1062
439
|
temperature: 0.2
|
|
1063
440
|
```
|
|
1064
441
|
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
### Criar uma skill personalizada
|
|
442
|
+
Available immediately via `omni run my-agent "..."` — no rebuild required.
|
|
1068
443
|
|
|
1069
|
-
|
|
444
|
+
### Custom Skill (TypeScript)
|
|
1070
445
|
|
|
1071
446
|
```typescript
|
|
1072
447
|
import type { ISkill } from "@ftarganski/omni-ai";
|
|
1073
448
|
import { z } from "zod";
|
|
1074
449
|
|
|
1075
450
|
const InputSchema = z.object({
|
|
1076
|
-
query: z.string().describe("
|
|
451
|
+
query: z.string().describe("Search term"),
|
|
1077
452
|
});
|
|
1078
453
|
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
export const myDatabaseSkill: ISkill<Input, string[]> = {
|
|
454
|
+
export const myDatabaseSkill: ISkill<z.infer<typeof InputSchema>, string[]> = {
|
|
1082
455
|
name: "search-database",
|
|
1083
|
-
description: "
|
|
456
|
+
description: "Searches records in an external database",
|
|
1084
457
|
|
|
1085
|
-
async execute(input
|
|
458
|
+
async execute(input) {
|
|
1086
459
|
const { query } = InputSchema.parse(input);
|
|
1087
|
-
// sua lógica aqui
|
|
1088
460
|
return await fetchFromExternalApi(query);
|
|
1089
461
|
},
|
|
1090
462
|
};
|
|
1091
|
-
```
|
|
1092
|
-
|
|
1093
|
-
Registre a skill ao criar o runtime:
|
|
1094
|
-
|
|
1095
|
-
```typescript
|
|
1096
|
-
import { createRuntime } from "@ftarganski/omni-ai";
|
|
1097
|
-
import { myDatabaseSkill } from "./my-database-skill.js";
|
|
1098
463
|
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
});
|
|
464
|
+
// Register when creating the runtime
|
|
465
|
+
const runtime = await createRuntime({ skills: [myDatabaseSkill] });
|
|
1102
466
|
```
|
|
1103
467
|
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
### Criar um provider personalizado
|
|
1107
|
-
|
|
1108
|
-
Implemente `IProvider` de `@ftarganski/omni-ai`:
|
|
468
|
+
### Custom Provider
|
|
1109
469
|
|
|
1110
470
|
```typescript
|
|
1111
471
|
import type { IProvider, CompletionRequest, CompletionResponse } from "@ftarganski/omni-ai";
|
|
@@ -1133,13 +493,11 @@ class MyProvider implements IProvider {
|
|
|
1133
493
|
}
|
|
1134
494
|
}
|
|
1135
495
|
|
|
1136
|
-
// Registrar o type string para o omni-ai.yaml
|
|
1137
496
|
registerProvider("my-provider", (config) => new MyProvider(config));
|
|
1138
497
|
```
|
|
1139
498
|
|
|
1140
|
-
Adicione o `docs/providers/<nome>.md` e declare no `omni-ai.yaml`:
|
|
1141
|
-
|
|
1142
499
|
```yaml
|
|
500
|
+
# config/omni-ai.yaml
|
|
1143
501
|
providers:
|
|
1144
502
|
- name: my-provider
|
|
1145
503
|
type: my-provider
|
|
@@ -1149,46 +507,15 @@ providers:
|
|
|
1149
507
|
|
|
1150
508
|
---
|
|
1151
509
|
|
|
1152
|
-
##
|
|
1153
|
-
|
|
1154
|
-
### Agentes paralelos — `parallel()`
|
|
1155
|
-
|
|
1156
|
-
Executa múltiplos agentes ao mesmo tempo no mesmo input e agrega os resultados.
|
|
1157
|
-
|
|
1158
|
-
```typescript
|
|
1159
|
-
import { createRuntime, parallel } from "@ftarganski/omni-ai";
|
|
1160
|
-
|
|
1161
|
-
const runtime = await createRuntime({ skills });
|
|
1162
|
-
|
|
1163
|
-
const result = await parallel(runtime, {
|
|
1164
|
-
agents: ["backend-dev", "qa-backend", "ux-reviewer"],
|
|
1165
|
-
input: "revise o módulo de orders para qualidade, testes e acessibilidade",
|
|
1166
|
-
});
|
|
1167
|
-
|
|
1168
|
-
for (const [agent, outcome] of Object.entries(result.results)) {
|
|
1169
|
-
if ("error" in outcome) {
|
|
1170
|
-
console.error(`${agent}: ${outcome.error}`);
|
|
1171
|
-
} else {
|
|
1172
|
-
console.log(`${agent} (${outcome.iterations} iterações):\n${outcome.output}\n`);
|
|
1173
|
-
}
|
|
1174
|
-
}
|
|
510
|
+
## Advanced
|
|
1175
511
|
|
|
1176
|
-
|
|
1177
|
-
```
|
|
1178
|
-
|
|
1179
|
-
Um agente com falha não cancela os demais — `parallel()` usa `Promise.allSettled` internamente.
|
|
512
|
+
### Skill Middleware
|
|
1180
513
|
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
### SkillMiddleware
|
|
1184
|
-
|
|
1185
|
-
Intercepção configurável ao redor de cada chamada de skill. Útil para logging, rate-limiting, cache e auditoria.
|
|
514
|
+
Configurable interception around every skill call — logging, rate-limiting, caching, auditing.
|
|
1186
515
|
|
|
1187
516
|
```typescript
|
|
1188
|
-
import { createRuntime } from "@ftarganski/omni-ai";
|
|
1189
517
|
import type { SkillMiddlewareFn } from "@ftarganski/omni-ai";
|
|
1190
518
|
|
|
1191
|
-
// Middleware de logging
|
|
1192
519
|
const loggingMiddleware: SkillMiddlewareFn = async (name, input, ctx, next) => {
|
|
1193
520
|
console.time(`skill:${name}`);
|
|
1194
521
|
const result = await next();
|
|
@@ -1196,31 +523,14 @@ const loggingMiddleware: SkillMiddlewareFn = async (name, input, ctx, next) => {
|
|
|
1196
523
|
return result;
|
|
1197
524
|
};
|
|
1198
525
|
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
const cachingMiddleware: SkillMiddlewareFn = async (name, input, ctx, next) => {
|
|
1202
|
-
const key = `${name}:${JSON.stringify(input)}`;
|
|
1203
|
-
if (cache.has(key)) return cache.get(key);
|
|
1204
|
-
const result = await next();
|
|
1205
|
-
cache.set(key, result);
|
|
1206
|
-
return result;
|
|
1207
|
-
};
|
|
1208
|
-
|
|
1209
|
-
const runtime = await createRuntime({ skills });
|
|
1210
|
-
|
|
1211
|
-
// Middleware configurado por agente no YAML ou programaticamente
|
|
1212
|
-
const result = await runtime.run("backend-dev", "revise os arquivos em src/", {
|
|
1213
|
-
middleware: [loggingMiddleware, cachingMiddleware],
|
|
526
|
+
const result = await runtime.run("backend-dev", "review src/", {
|
|
527
|
+
middleware: [loggingMiddleware],
|
|
1214
528
|
});
|
|
1215
529
|
```
|
|
1216
530
|
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
---
|
|
531
|
+
### MCP Integration
|
|
1220
532
|
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
#### Servidor: expor skills como ferramentas MCP
|
|
533
|
+
**Expose skills as MCP tools:**
|
|
1224
534
|
|
|
1225
535
|
```typescript
|
|
1226
536
|
import { createMcpServer } from "@ftarganski/omni-ai/mcp";
|
|
@@ -1231,57 +541,54 @@ const server = createMcpServer([readFileSkill, writeFileSkill], { name: "omni-ai
|
|
|
1231
541
|
await server.connect(new StdioServerTransport());
|
|
1232
542
|
```
|
|
1233
543
|
|
|
1234
|
-
|
|
544
|
+
**Or via CLI:**
|
|
1235
545
|
|
|
1236
546
|
```bash
|
|
1237
547
|
omni mcp serve
|
|
1238
548
|
```
|
|
1239
549
|
|
|
1240
|
-
|
|
550
|
+
**Claude Desktop integration (`claude_desktop_config.json`):**
|
|
551
|
+
|
|
552
|
+
```json
|
|
553
|
+
{
|
|
554
|
+
"mcpServers": {
|
|
555
|
+
"omni-ai": {
|
|
556
|
+
"command": "omni",
|
|
557
|
+
"args": ["mcp", "serve"]
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
**Consume an external MCP server as skills:**
|
|
1241
564
|
|
|
1242
565
|
```typescript
|
|
1243
566
|
import { connectMcpSkills } from "@ftarganski/omni-ai/mcp";
|
|
1244
567
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
1245
|
-
import { createRuntime } from "@ftarganski/omni-ai";
|
|
1246
568
|
|
|
1247
|
-
// Conecta a um servidor MCP externo e descobre seus tools
|
|
1248
569
|
const transport = new StdioClientTransport({ command: "npx", args: ["-y", "@my/mcp-server"] });
|
|
1249
570
|
const mcpSkills = await connectMcpSkills(transport);
|
|
1250
571
|
|
|
1251
|
-
// Usa os tools remotos como qualquer ISkill nativa
|
|
1252
572
|
const runtime = await createRuntime({ skills: mcpSkills });
|
|
1253
|
-
const result = await runtime.run("backend-dev", "pesquise na documentação o contrato da API");
|
|
1254
573
|
```
|
|
1255
574
|
|
|
1256
575
|
---
|
|
1257
576
|
|
|
1258
|
-
##
|
|
577
|
+
## TypeScript Interfaces
|
|
1259
578
|
|
|
1260
579
|
```typescript
|
|
1261
|
-
|
|
580
|
+
import type {
|
|
581
|
+
IProvider, ISkill, IAgent, IMemoryStore,
|
|
582
|
+
CompletionRequest, CompletionResponse,
|
|
583
|
+
AgentConfig, AgentRunOptions, AgentRunResult,
|
|
584
|
+
SessionId, SkillMiddlewareFn,
|
|
585
|
+
} from "@ftarganski/omni-ai";
|
|
1262
586
|
|
|
1263
587
|
interface IProvider {
|
|
1264
588
|
readonly name: string;
|
|
1265
589
|
readonly capabilities: ProviderCapabilities;
|
|
1266
590
|
complete(request: CompletionRequest): Promise<CompletionResponse>;
|
|
1267
|
-
embed?(request: EmbeddingRequest): Promise<EmbeddingResponse>;
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
interface ProviderCapabilities {
|
|
1271
|
-
chat: boolean;
|
|
1272
|
-
embedding: boolean;
|
|
1273
|
-
streaming: boolean; // suporte a onToken em CompletionRequest
|
|
1274
|
-
toolUse: boolean;
|
|
1275
|
-
vision: boolean;
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
interface CompletionRequest {
|
|
1279
|
-
messages: Message[];
|
|
1280
|
-
model?: string;
|
|
1281
|
-
temperature?: number;
|
|
1282
|
-
systemPrompt?: string;
|
|
1283
|
-
tools?: ToolDefinition[];
|
|
1284
|
-
onToken?: (chunk: string) => void; // habilita streaming chunk a chunk
|
|
591
|
+
embed?(request: EmbeddingRequest): Promise<EmbeddingResponse>;
|
|
1285
592
|
}
|
|
1286
593
|
|
|
1287
594
|
interface ISkill<TInput = unknown, TOutput = unknown> {
|
|
@@ -1290,37 +597,23 @@ interface ISkill<TInput = unknown, TOutput = unknown> {
|
|
|
1290
597
|
execute(input: TInput, ctx: SkillContext): Promise<TOutput>;
|
|
1291
598
|
}
|
|
1292
599
|
|
|
1293
|
-
interface IAgent {
|
|
1294
|
-
readonly config: AgentConfig;
|
|
1295
|
-
run(options: AgentRunOptions): Promise<AgentRunResult>;
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
// Intercepta a execução de cada skill — chame next() para continuar a cadeia
|
|
1299
|
-
type SkillMiddlewareFn = (
|
|
1300
|
-
name: string,
|
|
1301
|
-
input: unknown,
|
|
1302
|
-
ctx: SkillContext,
|
|
1303
|
-
next: () => Promise<unknown>
|
|
1304
|
-
) => Promise<unknown>;
|
|
1305
|
-
|
|
1306
600
|
interface AgentConfig {
|
|
1307
601
|
name: string;
|
|
1308
602
|
description: string;
|
|
1309
|
-
provider?: string; //
|
|
1310
|
-
model?: string; //
|
|
603
|
+
provider?: string; // optional — inherits defaultProvider
|
|
604
|
+
model?: string; // optional — inherits defaultModel
|
|
1311
605
|
systemPrompt: string;
|
|
1312
606
|
skills?: string[];
|
|
1313
|
-
maxIterations?: number; //
|
|
607
|
+
maxIterations?: number; // default: 10
|
|
1314
608
|
temperature?: number;
|
|
1315
|
-
|
|
1316
|
-
middleware?: SkillMiddlewareFn[]; // interceptação de tool calls
|
|
609
|
+
middleware?: SkillMiddlewareFn[];
|
|
1317
610
|
}
|
|
1318
611
|
|
|
1319
612
|
interface AgentRunOptions {
|
|
1320
613
|
input: string;
|
|
1321
614
|
context?: Record<string, unknown>;
|
|
1322
|
-
session?: SessionId;
|
|
1323
|
-
onToken?: (chunk: string) => void; //
|
|
615
|
+
session?: SessionId;
|
|
616
|
+
onToken?: (chunk: string) => void; // enables real-time token streaming
|
|
1324
617
|
}
|
|
1325
618
|
|
|
1326
619
|
interface AgentRunResult {
|
|
@@ -1330,163 +623,58 @@ interface AgentRunResult {
|
|
|
1330
623
|
}
|
|
1331
624
|
|
|
1332
625
|
interface SessionId {
|
|
1333
|
-
resourceId: string; //
|
|
1334
|
-
threadId: string; //
|
|
626
|
+
resourceId: string; // stable identifier (e.g. user ID, workspace ID)
|
|
627
|
+
threadId: string; // conversation or feature identifier
|
|
1335
628
|
}
|
|
1336
629
|
```
|
|
1337
630
|
|
|
1338
631
|
---
|
|
1339
632
|
|
|
1340
|
-
##
|
|
1341
|
-
|
|
1342
|
-
O npm publica um único pacote com subpath exports:
|
|
633
|
+
## Package Exports
|
|
1343
634
|
|
|
1344
635
|
```
|
|
1345
|
-
@ftarganski/omni-ai ← core: Agent, Runtime, ISkill, IProvider
|
|
1346
|
-
@ftarganski/omni-ai/skills ← todas as skills
|
|
636
|
+
@ftarganski/omni-ai ← core: Agent, Runtime, ISkill, IProvider…
|
|
1347
637
|
@ftarganski/omni-ai/skills/fs ← read-file, write-file, list-directory
|
|
1348
|
-
@ftarganski/omni-ai/skills/git ← git-diff, git-log, git-status, git-commit-message
|
|
1349
638
|
@ftarganski/omni-ai/skills/code ← search-code
|
|
1350
|
-
@ftarganski/omni-ai/skills/http ← http-request
|
|
1351
639
|
@ftarganski/omni-ai/skills/ux ← audit-accessibility
|
|
1352
|
-
@ftarganski/omni-ai/skills/
|
|
1353
|
-
@ftarganski/omni-ai/skills/
|
|
1354
|
-
@ftarganski/omni-ai/skills/
|
|
640
|
+
@ftarganski/omni-ai/skills/git ← git-diff, git-log, git-status, git-commit-message
|
|
641
|
+
@ftarganski/omni-ai/skills/http ← http-request
|
|
642
|
+
@ftarganski/omni-ai/skills/multimodal ← analyze-image
|
|
643
|
+
@ftarganski/omni-ai/skills/backend ← analyze-dynamo-schema, analyze-graphql-schema…
|
|
644
|
+
@ftarganski/omni-ai/skills/frontend ← analyze-component, analyze-module-structure…
|
|
1355
645
|
@ftarganski/omni-ai/skills/qa ← analyze-test-coverage, find-test-pattern
|
|
1356
|
-
@ftarganski/omni-ai/memory ← SQLiteMemoryStore,
|
|
1357
|
-
@ftarganski/omni-ai/mcp ← createMcpServer, connectMcpSkills
|
|
646
|
+
@ftarganski/omni-ai/memory ← SQLiteMemoryStore, SemanticMemoryStore, compactors, VectorIndex
|
|
647
|
+
@ftarganski/omni-ai/mcp ← createMcpServer, connectMcpSkills
|
|
1358
648
|
@ftarganski/omni-ai/provider-anthropic ← AnthropicProvider
|
|
1359
649
|
@ftarganski/omni-ai/provider-openai ← OpenAIProvider (+ Copilot, Groq, Ollama)
|
|
1360
650
|
@ftarganski/omni-ai/provider-google ← GoogleProvider
|
|
1361
|
-
bin: omni
|
|
1362
|
-
```
|
|
1363
|
-
|
|
1364
|
-
Internamente o repositório é um monorepo com pacotes separados (`packages/core`, `packages/skills`, etc.) que são bundlados pelo tsup no pacote único publicado.
|
|
1365
|
-
|
|
1366
|
-
---
|
|
1367
|
-
|
|
1368
|
-
## Comandos de desenvolvimento
|
|
1369
|
-
|
|
1370
|
-
```bash
|
|
1371
|
-
# Instalar dependências
|
|
1372
|
-
pnpm install
|
|
1373
|
-
|
|
1374
|
-
# Build de todos os pacotes
|
|
1375
|
-
pnpm build
|
|
1376
|
-
|
|
1377
|
-
# Type-check sem build
|
|
1378
|
-
pnpm typecheck
|
|
1379
|
-
|
|
1380
|
-
# Lint em todos os pacotes
|
|
1381
|
-
pnpm lint
|
|
1382
|
-
|
|
1383
|
-
# Rodar testes
|
|
1384
|
-
pnpm test
|
|
1385
|
-
|
|
1386
|
-
# Build de um pacote interno específico
|
|
1387
|
-
pnpm --filter @omni-ai/core build
|
|
1388
|
-
|
|
1389
|
-
# Reconstruir e testar o CLI
|
|
1390
|
-
pnpm build && omni list agents
|
|
651
|
+
bin: omni ← full CLI
|
|
1391
652
|
```
|
|
1392
653
|
|
|
1393
|
-
### Publicar uma nova versão
|
|
1394
|
-
|
|
1395
|
-
```bash
|
|
1396
|
-
pnpm release # patch: 1.0.0 → 1.0.1
|
|
1397
|
-
pnpm release minor # minor: 1.0.0 → 1.1.0
|
|
1398
|
-
pnpm release major # major: 1.0.0 → 2.0.0
|
|
1399
|
-
```
|
|
1400
|
-
|
|
1401
|
-
O script cria a branch `release/x.x.x`, commita o bump de versão e abre o PR para `main`. Ao mergear, o GitHub Actions publica automaticamente no npm e cria a GitHub Release.
|
|
1402
|
-
|
|
1403
|
-
---
|
|
1404
|
-
|
|
1405
|
-
## Roadmap
|
|
1406
|
-
|
|
1407
|
-
### Concluído
|
|
1408
|
-
|
|
1409
|
-
**Pacote publicado**
|
|
1410
|
-
- [x] `@ftarganski/omni-ai` — pacote único com todos os subpaths, bin `omni`, bundlado via tsup
|
|
1411
|
-
|
|
1412
|
-
**Internamente (monorepo, não publicados)**
|
|
1413
|
-
- [x] core — interfaces, ProviderRegistry, SkillRegistry, config schema (Zod), `parallel()`, `SkillMiddleware`
|
|
1414
|
-
- [x] memory — InMemoryStore, SQLiteMemoryStore, SemanticMemoryStore, VectorIndex, ObservationMaskingCompactor, SummaryCompactor
|
|
1415
|
-
- [x] mcp — servidor MCP (expõe skills como tools) e cliente MCP (`McpSkill`, `connectMcpSkills`)
|
|
1416
|
-
- [x] provider-anthropic — adapter completo com mapeamento de tipos, tool use e streaming
|
|
1417
|
-
- [x] provider-openai — cobre OpenAI, GitHub Copilot, Groq, Ollama e qualquer endpoint OpenAI-compatible
|
|
1418
|
-
- [x] provider-google — adapter Google Gemini com chat, vision e embeddings
|
|
1419
|
-
- [x] skills — 20 skills em 8 subpaths: fs, code, ux, git, http, multimodal, backend, frontend, qa
|
|
1420
|
-
- [x] cli — `omni run`, `omni list`, `omni chain`, `omni init`, `omni new`, `omni serve`, `omni watch`, `omni eval`, `omni export`, `omni mcp serve`
|
|
1421
|
-
|
|
1422
|
-
**Core**
|
|
1423
|
-
- [x] Bootstrap `createRuntime()` — API de alto nível para uso programático
|
|
1424
|
-
- [x] 21 agentes prontos — backend (7), frontend (5), ux (5), qa (4)
|
|
1425
|
-
- [x] Herança de provider/modelo — agentes herdam do config, podem sobrescrever
|
|
1426
|
-
- [x] Agentes inline — definição direta no `omni-ai.yaml`
|
|
1427
|
-
- [x] Streaming de tokens em tempo real
|
|
1428
|
-
- [x] Memória e sessões — SQLite persistente com FTS5 e busca semântica por embeddings
|
|
1429
|
-
- [x] Compactors — redução automática de contexto (masking + summarization)
|
|
1430
|
-
- [x] Retry automático com backoff exponencial + fallback de provider
|
|
1431
|
-
- [x] `SkillMiddleware` — cadeia de interceptação configurável por agente
|
|
1432
|
-
- [x] `parallel()` — execução concorrente de múltiplos agentes com agregação de resultados
|
|
1433
|
-
- [x] Suporte multimodal — `ContentPart[]` em mensagens; `analyze-image` skill
|
|
1434
|
-
- [x] Compatibilidade MCP — `omni mcp serve` (stdio), `McpSkill` para consumir servers externos
|
|
1435
|
-
- [x] 296 testes automatizados — 41 arquivos, cobertura ≥ 80% em todas as métricas
|
|
1436
|
-
- [x] Biome — linting e formatação unificados em todos os pacotes
|
|
1437
|
-
- [x] CI/CD — GitHub Actions: lint → build → typecheck → test; branch protection; publish workflow
|
|
1438
|
-
|
|
1439
|
-
### Próximos passos
|
|
1440
|
-
|
|
1441
|
-
**CLI & DX**
|
|
1442
|
-
- [x] `omni new` — scaffold interativo para criar agente, skill ou provider a partir de template
|
|
1443
|
-
- [x] `omni eval` — avaliação em lote: roda agente contra dataset de `(input, expected)` e reporta acurácia
|
|
1444
|
-
- [x] `omni serve` — inicia servidor HTTP local para chamar agentes via REST ou SSE (sem CLI)
|
|
1445
|
-
- [x] `omni watch` — reexecuta agente automaticamente quando arquivos do projeto mudam (modo dev)
|
|
1446
|
-
- [x] `omni export` — exporta histórico de sessão em markdown ou JSON
|
|
1447
|
-
|
|
1448
|
-
**Providers & resiliência**
|
|
1449
|
-
- [x] `@omni-ai/provider-google` — adapter para Gemini 1.5 / 2.0 (chat, vision, embeddings)
|
|
1450
|
-
- [x] Suporte a Groq — modelos Llama/DeepSeek via LPU (free tier, sem cartão)
|
|
1451
|
-
- [x] Suporte a Ollama — modelos locais sem API key (Llama, Qwen, Phi, DeepSeek)
|
|
1452
|
-
- [x] Retry automático com backoff exponencial — recuperação transparente de rate-limit e erros 5xx
|
|
1453
|
-
- [x] Fallback de provider — rota pedidos para um provider secundário quando o primário falha
|
|
1454
|
-
|
|
1455
|
-
**Skills**
|
|
1456
|
-
- [x] `@omni-ai/skills-git` — git status, diff, log, commit message (para agentes de review e release)
|
|
1457
|
-
- [x] `@omni-ai/skills-http` — chamadas HTTP autenticadas (OAuth/Bearer) para integrar APIs externas
|
|
1458
|
-
- [x] Suporte multimodal — skill `analyze-image` para análise de screenshots, diagramas e mockups
|
|
1459
|
-
|
|
1460
|
-
**Core**
|
|
1461
|
-
- [x] Compatibilidade MCP (Model Context Protocol) — expor skills como tools MCP e consumir servidores MCP externos
|
|
1462
|
-
- [x] Agentes paralelos — `parallel()` wrapper para rodar agentes concorrentemente e agregar resultados
|
|
1463
|
-
- [x] `SkillMiddleware` — hooks de interceptação para logging, rate-limiting e cache de tool calls
|
|
1464
|
-
- [x] Publicação npm — publicar os pacotes `@omni-ai/*` no registro público do npm
|
|
1465
|
-
|
|
1466
654
|
---
|
|
1467
655
|
|
|
1468
656
|
## Troubleshooting
|
|
1469
657
|
|
|
1470
658
|
**`omni: command not found`**
|
|
1471
|
-
|
|
659
|
+
The CLI is not globally linked. Run `npm install -g @ftarganski/omni-ai`.
|
|
1472
660
|
|
|
1473
661
|
**`Provider "anthropic" not found in config`**
|
|
1474
|
-
|
|
662
|
+
`config/omni-ai.yaml` does not exist or does not declare the provider. Run `omni init`.
|
|
1475
663
|
|
|
1476
664
|
**`Error: ANTHROPIC_API_KEY is not set`**
|
|
1477
|
-
|
|
665
|
+
The environment variable is not loaded. Verify `.env` exists and contains the key. The CLI loads `.env` automatically.
|
|
1478
666
|
|
|
1479
667
|
**`maxIterations exceeded`**
|
|
1480
|
-
|
|
668
|
+
The agent hit the iteration limit without finishing. Increase `maxIterations` in the agent YAML or make the prompt more specific.
|
|
1481
669
|
|
|
1482
|
-
**
|
|
1483
|
-
Use `ObservationMaskingCompactor` via
|
|
670
|
+
**High token consumption**
|
|
671
|
+
Use `ObservationMaskingCompactor` via the programmatic API. Reduces context by up to 70% for file-intensive agents.
|
|
1484
672
|
|
|
1485
673
|
**`Access denied: path resolves outside the working directory`**
|
|
1486
|
-
|
|
674
|
+
The agent attempted to access a file outside `cwd`. Run the command from inside the target project directory.
|
|
1487
675
|
|
|
1488
|
-
**Build
|
|
1489
|
-
|
|
676
|
+
**Build fails with `Cannot find module`**
|
|
677
|
+
A referenced package has not been built yet. Run `pnpm build` at the root.
|
|
1490
678
|
|
|
1491
679
|
---
|
|
1492
680
|
|