agent-devkit 0.1.5 → 0.1.6

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 (87) hide show
  1. package/README.md +2 -2
  2. package/package.json +1 -1
  3. package/runtime/README.md +74 -5
  4. package/runtime/agents/README.md +8 -0
  5. package/runtime/agents/execution-reviewer/AGENTS.md +8 -0
  6. package/runtime/agents/execution-reviewer/README.md +13 -0
  7. package/runtime/agents/execution-reviewer/agent.yaml +25 -0
  8. package/runtime/agents/execution-reviewer/capabilities/review-agent-result/capability.yaml +15 -0
  9. package/runtime/agents/execution-reviewer/capabilities/review-agent-result/decision-rules.md +6 -0
  10. package/runtime/agents/execution-reviewer/capabilities/review-agent-result/workflow.md +7 -0
  11. package/runtime/agents/execution-reviewer/capabilities/review-final-output/capability.yaml +15 -0
  12. package/runtime/agents/execution-reviewer/capabilities/review-final-output/decision-rules.md +6 -0
  13. package/runtime/agents/execution-reviewer/capabilities/review-final-output/workflow.md +7 -0
  14. package/runtime/agents/execution-reviewer/capabilities/review-plan/capability.yaml +15 -0
  15. package/runtime/agents/execution-reviewer/capabilities/review-plan/decision-rules.md +6 -0
  16. package/runtime/agents/execution-reviewer/capabilities/review-plan/workflow.md +7 -0
  17. package/runtime/agents/execution-reviewer/infra/README.md +4 -0
  18. package/runtime/agents/execution-reviewer/knowledge/context.md +6 -0
  19. package/runtime/agents/execution-reviewer/knowledge/system.md +18 -0
  20. package/runtime/agents/execution-reviewer/templates/README.md +4 -0
  21. package/runtime/agents/local-llm-operator/AGENTS.md +8 -0
  22. package/runtime/agents/local-llm-operator/README.md +12 -0
  23. package/runtime/agents/local-llm-operator/agent.yaml +26 -0
  24. package/runtime/agents/local-llm-operator/capabilities/delegate-operational-task/capability.yaml +15 -0
  25. package/runtime/agents/local-llm-operator/capabilities/delegate-operational-task/decision-rules.md +6 -0
  26. package/runtime/agents/local-llm-operator/capabilities/delegate-operational-task/workflow.md +7 -0
  27. package/runtime/agents/local-llm-operator/capabilities/inspect-local-models/capability.yaml +15 -0
  28. package/runtime/agents/local-llm-operator/capabilities/inspect-local-models/decision-rules.md +5 -0
  29. package/runtime/agents/local-llm-operator/capabilities/inspect-local-models/workflow.md +6 -0
  30. package/runtime/agents/local-llm-operator/capabilities/select-local-worker/capability.yaml +15 -0
  31. package/runtime/agents/local-llm-operator/capabilities/select-local-worker/decision-rules.md +6 -0
  32. package/runtime/agents/local-llm-operator/capabilities/select-local-worker/workflow.md +7 -0
  33. package/runtime/agents/local-llm-operator/infra/README.md +4 -0
  34. package/runtime/agents/local-llm-operator/knowledge/context.md +6 -0
  35. package/runtime/agents/local-llm-operator/knowledge/system.md +18 -0
  36. package/runtime/agents/local-llm-operator/templates/README.md +4 -0
  37. package/runtime/agents/provider-configurator/AGENTS.md +8 -0
  38. package/runtime/agents/provider-configurator/README.md +5 -0
  39. package/runtime/agents/provider-configurator/agent.yaml +25 -0
  40. package/runtime/agents/provider-configurator/capabilities/collect-provider-credentials/capability.yaml +15 -0
  41. package/runtime/agents/provider-configurator/capabilities/collect-provider-credentials/decision-rules.md +6 -0
  42. package/runtime/agents/provider-configurator/capabilities/collect-provider-credentials/workflow.md +7 -0
  43. package/runtime/agents/provider-configurator/capabilities/configure-provider-source/capability.yaml +15 -0
  44. package/runtime/agents/provider-configurator/capabilities/configure-provider-source/decision-rules.md +6 -0
  45. package/runtime/agents/provider-configurator/capabilities/configure-provider-source/workflow.md +8 -0
  46. package/runtime/agents/provider-configurator/capabilities/validate-provider-readiness/capability.yaml +15 -0
  47. package/runtime/agents/provider-configurator/capabilities/validate-provider-readiness/decision-rules.md +6 -0
  48. package/runtime/agents/provider-configurator/capabilities/validate-provider-readiness/workflow.md +7 -0
  49. package/runtime/agents/provider-configurator/infra/README.md +5 -0
  50. package/runtime/agents/provider-configurator/knowledge/context.md +8 -0
  51. package/runtime/agents/provider-configurator/knowledge/system.md +19 -0
  52. package/runtime/agents/provider-configurator/templates/README.md +4 -0
  53. package/runtime/agents/task-orchestrator/AGENTS.md +8 -0
  54. package/runtime/agents/task-orchestrator/README.md +7 -0
  55. package/runtime/agents/task-orchestrator/agent.yaml +31 -0
  56. package/runtime/agents/task-orchestrator/capabilities/coordinate-execution/capability.yaml +15 -0
  57. package/runtime/agents/task-orchestrator/capabilities/coordinate-execution/decision-rules.md +6 -0
  58. package/runtime/agents/task-orchestrator/capabilities/coordinate-execution/workflow.md +7 -0
  59. package/runtime/agents/task-orchestrator/capabilities/plan-task/capability.yaml +15 -0
  60. package/runtime/agents/task-orchestrator/capabilities/plan-task/decision-rules.md +6 -0
  61. package/runtime/agents/task-orchestrator/capabilities/plan-task/workflow.md +8 -0
  62. package/runtime/agents/task-orchestrator/capabilities/select-specialists/capability.yaml +15 -0
  63. package/runtime/agents/task-orchestrator/capabilities/select-specialists/decision-rules.md +6 -0
  64. package/runtime/agents/task-orchestrator/capabilities/select-specialists/workflow.md +7 -0
  65. package/runtime/agents/task-orchestrator/infra/README.md +5 -0
  66. package/runtime/agents/task-orchestrator/knowledge/context.md +9 -0
  67. package/runtime/agents/task-orchestrator/knowledge/system.md +20 -0
  68. package/runtime/agents/task-orchestrator/templates/README.md +4 -0
  69. package/runtime/cli/README.md +76 -11
  70. package/runtime/cli/aikit/__init__.py +1 -1
  71. package/runtime/cli/aikit/agent_executor.py +66 -0
  72. package/runtime/cli/aikit/agent_registry.py +80 -0
  73. package/runtime/cli/aikit/app_home.py +87 -2
  74. package/runtime/cli/aikit/audit.py +44 -0
  75. package/runtime/cli/aikit/control_router.py +298 -0
  76. package/runtime/cli/aikit/decision_store.py +17 -0
  77. package/runtime/cli/aikit/diagnostics.py +2 -1
  78. package/runtime/cli/aikit/execution_reviewer.py +174 -0
  79. package/runtime/cli/aikit/install.py +4 -3
  80. package/runtime/cli/aikit/local_llm_operator.py +112 -0
  81. package/runtime/cli/aikit/lock.py +4 -1
  82. package/runtime/cli/aikit/main.py +355 -80
  83. package/runtime/cli/aikit/model_router.py +13 -4
  84. package/runtime/cli/aikit/orchestrator.py +535 -0
  85. package/runtime/cli/aikit/sessions.py +37 -0
  86. package/runtime/cli/aikit/sources.py +6 -2
  87. package/runtime/cli/aikit/wizard_state.py +503 -0
@@ -0,0 +1,6 @@
1
+ # Decision Rules
2
+
3
+ - Rejeitar valores que aparentem token, PAT, senha ou API key.
4
+ - Preferir variavel de ambiente para credenciais simples.
5
+ - Nunca imprimir credenciais resolvidas.
6
+
@@ -0,0 +1,7 @@
1
+ # Workflow
2
+
3
+ 1. Listar metodos de autenticacao suportados pelo provider.
4
+ 2. Perguntar se o usuario usara variavel de ambiente, arquivo ou cadeia nativa.
5
+ 3. Validar que a resposta e referencia, nao segredo bruto.
6
+ 4. Retornar referencias para persistencia segura.
7
+
@@ -0,0 +1,15 @@
1
+ id: provider-configurator.configure-provider-source
2
+ kind: capability
3
+ name: Configure Provider Source
4
+ version: 0.1.6
5
+ status: draft
6
+ purpose: Conduzir wizard para configurar uma source reutilizavel de provider.
7
+ write_policy: local-config-write
8
+ entrypoint:
9
+ workflow: workflow.md
10
+ inputs:
11
+ required: [provider]
12
+ optional: [prompt, route, agent_id, capability_id, reason]
13
+ outputs:
14
+ artifacts: [source-config]
15
+
@@ -0,0 +1,6 @@
1
+ # Decision Rules
2
+
3
+ - Nao criar source sem opt-in.
4
+ - Nao persistir valor bruto de segredo.
5
+ - Se o usuario negar, registrar decisao e seguir sem a ferramenta.
6
+
@@ -0,0 +1,8 @@
1
+ # Workflow
2
+
3
+ 1. Criar wizard persistente para o provider.
4
+ 2. Pedir opt-in ao usuario.
5
+ 3. Coletar campos de configuracao e referencias de credenciais.
6
+ 4. Criar source reutilizavel.
7
+ 5. Retomar o prompt original quando aplicavel.
8
+
@@ -0,0 +1,15 @@
1
+ id: provider-configurator.validate-provider-readiness
2
+ kind: capability
3
+ name: Validate Provider Readiness
4
+ version: 0.1.6
5
+ status: draft
6
+ purpose: Validar se um provider ou source esta pronto para uso sem expor segredo.
7
+ write_policy: read-only
8
+ entrypoint:
9
+ workflow: workflow.md
10
+ inputs:
11
+ required: [provider]
12
+ optional: [source_id]
13
+ outputs:
14
+ artifacts: [readiness-report]
15
+
@@ -0,0 +1,6 @@
1
+ # Decision Rules
2
+
3
+ - Diagnostico nao deve vazar segredo.
4
+ - Provider opcional ausente nao bloqueia plano quando houver fallback.
5
+ - Provider obrigatorio ausente deve acionar wizard.
6
+
@@ -0,0 +1,7 @@
1
+ # Workflow
2
+
3
+ 1. Ler registry de provider/source.
4
+ 2. Verificar campos obrigatorios e referencias de credencial.
5
+ 3. Reportar `ok`, `partial` ou `missing`.
6
+ 4. Nao resolver nem exibir valores de segredo.
7
+
@@ -0,0 +1,5 @@
1
+ # Infra
2
+
3
+ Este agente usa providers globais, source registry e decision store do runtime
4
+ local.
5
+
@@ -0,0 +1,8 @@
1
+ # Context
2
+
3
+ O estado dos wizards fica em `~/.agent-devkit/state/wizards`. A configuracao
4
+ final de source fica em `~/.agent-devkit/config.json` com referencias seguras.
5
+ `~/.ai-devkit` continua aceito como home legado quando ja existir.
6
+
7
+ Este agente e global: nenhum agente de dominio deve implementar seu proprio
8
+ fluxo de credencial hardcoded.
@@ -0,0 +1,19 @@
1
+ # System
2
+
3
+ Voce e o Provider Configurator do Agent DevKit.
4
+
5
+ Missao:
6
+
7
+ - detectar provider/source ausente;
8
+ - pedir opt-in antes de usar uma ferramenta externa;
9
+ - coletar configuracao uma pergunta por vez;
10
+ - criar source reutilizavel quando o usuario autorizar;
11
+ - registrar opt-out persistente quando o usuario negar.
12
+
13
+ Guardrails:
14
+
15
+ - nunca salvar token, senha, PAT ou API key em claro;
16
+ - aceitar apenas referencias como variavel de ambiente, arquivo local ou cadeia
17
+ nativa;
18
+ - permitir que o agente siga sem a ferramenta quando o usuario negar.
19
+
@@ -0,0 +1,4 @@
1
+ # Templates
2
+
3
+ Templates futuros para respostas de configuracao de provider.
4
+
@@ -0,0 +1,8 @@
1
+ # AGENTS.md
2
+
3
+ Instrucoes locais para o agente `task-orchestrator`.
4
+
5
+ Este agente coordena planos multiagente. Ele nao executa operacoes de dominio
6
+ diretamente; seleciona especialistas, configura dependencias pendentes e exige
7
+ revisao final quando o trabalho envolve decisao, escrita, codigo ou documento.
8
+
@@ -0,0 +1,7 @@
1
+ # Task Orchestrator
2
+
3
+ Agente de runtime responsavel por transformar prompts em planos multiagente,
4
+ selecionar especialistas, coordenar execucao e encaminhar revisao final.
5
+
6
+ Ele e a superficie versionada do coordenador usado por `agent "<prompt>"`.
7
+
@@ -0,0 +1,31 @@
1
+ id: task-orchestrator
2
+ kind: runtime-agent
3
+ name: Task Orchestrator
4
+ version: 0.1.6
5
+ status: draft
6
+ owner: agent-devkit
7
+
8
+ purpose: >
9
+ Coordenar prompts livres, selecionar agentes especialistas, montar planos de
10
+ execucao, identificar configuracoes pendentes e acionar revisao final.
11
+
12
+ default_context:
13
+ - knowledge/system.md
14
+ - knowledge/context.md
15
+
16
+ capabilities:
17
+ - plan-task
18
+ - select-specialists
19
+ - coordinate-execution
20
+
21
+ agent_surface:
22
+ orchestrated_agents:
23
+ - provider-configurator/configure-provider-source
24
+ - local-llm-operator/select-local-worker
25
+ - execution-reviewer/review-final-output
26
+
27
+ write_policy:
28
+ default_mode: plan-first
29
+ external_writes: delegated
30
+ requires_review: true
31
+
@@ -0,0 +1,15 @@
1
+ id: task-orchestrator.coordinate-execution
2
+ kind: capability
3
+ name: Coordinate Execution
4
+ version: 0.1.6
5
+ status: draft
6
+ purpose: Coordenar execucao de tarefas planejadas, bloqueios e revisao final.
7
+ write_policy: delegated
8
+ entrypoint:
9
+ workflow: workflow.md
10
+ inputs:
11
+ required: [execution_plan]
12
+ optional: [dry_run]
13
+ outputs:
14
+ artifacts: [orchestration-trace]
15
+
@@ -0,0 +1,6 @@
1
+ # Decision Rules
2
+
3
+ - Bloquear escrita externa sem permissao explicita.
4
+ - Nao concluir plano com configuracao obrigatoria pendente.
5
+ - Revisao final e obrigatoria para codigo, documentos, automacoes e decisoes.
6
+
@@ -0,0 +1,7 @@
1
+ # Workflow
2
+
3
+ 1. Verificar configuracoes pendentes.
4
+ 2. Executar apenas tarefas prontas e permitidas.
5
+ 3. Registrar tarefas executadas e bloqueadas.
6
+ 4. Acionar `execution-reviewer` quando a revisao for obrigatoria.
7
+
@@ -0,0 +1,15 @@
1
+ id: task-orchestrator.plan-task
2
+ kind: capability
3
+ name: Plan Task
4
+ version: 0.1.6
5
+ status: draft
6
+ purpose: Criar um plano multiagente a partir de um prompt livre.
7
+ write_policy: read-only
8
+ entrypoint:
9
+ workflow: workflow.md
10
+ inputs:
11
+ required: [prompt]
12
+ optional: [dry_run, project]
13
+ outputs:
14
+ artifacts: [execution-plan]
15
+
@@ -0,0 +1,6 @@
1
+ # Decision Rules
2
+
3
+ - Preferir capability deterministica quando houver rota confiavel.
4
+ - Pedir configuracao via `provider-configurator` quando faltar provider/source.
5
+ - Nao chamar LLM para tarefas que podem ser roteadas localmente.
6
+
@@ -0,0 +1,8 @@
1
+ # Workflow
2
+
3
+ 1. Normalizar o prompt sem preservar segredos.
4
+ 2. Detectar rota deterministica quando existir.
5
+ 3. Selecionar agente de dominio e especialistas.
6
+ 4. Incluir configuracoes pendentes e revisao final.
7
+ 5. Retornar plano sem executar escrita externa.
8
+
@@ -0,0 +1,15 @@
1
+ id: task-orchestrator.select-specialists
2
+ kind: capability
3
+ name: Select Specialists
4
+ version: 0.1.6
5
+ status: draft
6
+ purpose: Escolher agentes especialistas e capabilities candidatas para um plano.
7
+ write_policy: read-only
8
+ entrypoint:
9
+ workflow: workflow.md
10
+ inputs:
11
+ required: [prompt]
12
+ optional: [route, domain_agent]
13
+ outputs:
14
+ artifacts: [specialist-selection]
15
+
@@ -0,0 +1,6 @@
1
+ # Decision Rules
2
+
3
+ - Nao emitir `agent_id` inexistente em `agents/`.
4
+ - Preferir agente especifico a agente generico.
5
+ - Nao selecionar especialista apenas por substring ambigua.
6
+
@@ -0,0 +1,7 @@
1
+ # Workflow
2
+
3
+ 1. Carregar registry de agentes.
4
+ 2. Pontuar agentes por rota, ancora explicita e capabilities.
5
+ 3. Selecionar tarefas especialistas com `agent_id` e `capability_id` reais.
6
+ 4. Marcar tarefa primaria quando aplicavel.
7
+
@@ -0,0 +1,5 @@
1
+ # Infra
2
+
3
+ Este agente usa o runtime local do Agent DevKit e nao acessa sistemas externos
4
+ diretamente.
5
+
@@ -0,0 +1,9 @@
1
+ # Context
2
+
3
+ O runtime Python executa a orquestracao, mas esta pasta define a superficie
4
+ agent-native versionada do coordenador.
5
+
6
+ Planos devem referenciar capabilities reais e manter rastreabilidade via
7
+ `execution_plan`, `specialist_tasks`, `configuration_tasks`, `review_task` e
8
+ `orchestration_trace`.
9
+
@@ -0,0 +1,20 @@
1
+ # System
2
+
3
+ Voce e o Task Orchestrator do Agent DevKit.
4
+
5
+ Missao:
6
+
7
+ - entender o pedido do usuario;
8
+ - selecionar agentes especialistas;
9
+ - criar plano de execucao pequeno e auditavel;
10
+ - acionar configuracao quando faltar provider/source;
11
+ - delegar tarefas operacionais para modelos locais quando apropriado;
12
+ - exigir revisao final antes de concluir trabalho relevante.
13
+
14
+ Guardrails:
15
+
16
+ - nao executar escrita externa diretamente;
17
+ - nao inventar configuracao ausente;
18
+ - usar agentes reais registrados em `agents/`;
19
+ - manter o plano agnostico de cliente, projeto e credenciais.
20
+
@@ -0,0 +1,4 @@
1
+ # Templates
2
+
3
+ Templates futuros do coordenador de tarefas.
4
+
@@ -48,9 +48,36 @@ agent run azure-devops-orchestrator read-card --project "Projeto" --id 123 --inc
48
48
  backends. `agent providers` e `agent provider` leem o registry local de
49
49
  providers e diagnosticam metadados disponiveis no processo atual. `agent
50
50
  credential` resolve referencias de credenciais sem imprimir valores. `agent`
51
- e a entrada em linguagem natural e exige backend LLM configurado; se nao
52
- houver backend disponivel, retorna uma mensagem instrutiva para usar `agent run`
53
- ou configurar um backend.
51
+ e a entrada em linguagem natural: ele cria um `execution_plan` multiagente,
52
+ seleciona coordenador, especialistas, configurador de provider e revisor, e usa
53
+ capabilities deterministicas quando a rota estiver pronta. Backend LLM so e
54
+ necessario quando a tarefa nao puder ser resolvida por rota/capability local; se
55
+ nao houver backend disponivel, retorna uma mensagem instrutiva para usar
56
+ `agent run` ou configurar um backend.
57
+
58
+ Em `--json`, respostas de `agent "<prompt>"` incluem:
59
+
60
+ - `execution_plan`: contrato `ai-devkit.agentic-plan/v1`;
61
+ - `specialist_tasks`: capabilities escolhidas por agente;
62
+ - `configuration_tasks`: providers/fontes que precisam de opt-in;
63
+ - `review_task`: revisao final exigida pelo runtime;
64
+ - `orchestration_trace`: trilha resumida de coordenacao.
65
+
66
+ Os papeis de runtime tambem sao agentes reais versionados em `agents/`:
67
+ `task-orchestrator`, `provider-configurator`, `local-llm-operator` e
68
+ `execution-reviewer`. Eles aparecem em `agent agents list` e suas capabilities
69
+ podem ser inspecionadas como qualquer outro agente.
70
+
71
+ Quando o plano identifica uma tarefa operacional repetitiva e ha Ollama
72
+ configurado, o runtime delega essa parte ao `local-llm-operator` e injeta o
73
+ resultado como contexto para o coordenador principal. Essa delegacao nunca faz
74
+ escrita externa, aprovacao, decisao de permissao ou revisao final.
75
+
76
+ Quando `review_gate.required = true`, a conclusao passa pelo
77
+ `execution-reviewer` usando um reviewer independente, preferindo `claude-code`
78
+ ou `codex-cli`. Sem reviewer configurado, quando o reviewer retorna
79
+ `REVIEW BLOCKED`, ou quando nao retorna `REVIEW OK`, a execucao termina como
80
+ `needs-review` e nao como `ok`.
54
81
 
55
82
  ## Instalacao global e por projeto
56
83
 
@@ -87,7 +114,7 @@ Destinos criados:
87
114
 
88
115
  - `.ai-devkit/config.yaml`: configuracao minima da instalacao, sem segredos.
89
116
  - `.ai-devkit/ai-devkit.lock`: lock por projeto com runtime, commit e perfis.
90
- - `~/.ai-devkit/runtime.lock`: lock global com runtime, commit e canal local.
117
+ - `~/.agent-devkit/runtime.lock`: lock global com runtime, commit e canal local.
91
118
  - `.codex/plugins/ai-devkit`: bundle local do plugin Codex.
92
119
  - `.codex/skills/ai-devkit-router`: skill de roteamento para Codex.
93
120
  - `.claude/plugins/ai-devkit`: bundle local do plugin Claude Code.
@@ -124,7 +151,7 @@ agent install project --target . --host all --profiles sustentacao,infra
124
151
 
125
152
  Arquivos gerados:
126
153
 
127
- - global: `~/.ai-devkit/runtime.lock`
154
+ - global: `~/.agent-devkit/runtime.lock`
128
155
  - projeto: `<project>/.ai-devkit/ai-devkit.lock`
129
156
 
130
157
  O lock registra `source`, `repository`, `ref`, `commit`, `git_ref`, `dirty`,
@@ -309,9 +336,17 @@ agent --llm claude-code "analise este incidente"
309
336
  agent --llm openai "crie um plano de testes"
310
337
  ```
311
338
 
312
- A configuracao padrao fica em `~/.ai-devkit/config.json`. Para automacao e
313
- testes, use `AIKIT_CONFIG_HOME` ou `AI_DEVKIT_CONFIG_HOME` para apontar outro
314
- diretorio.
339
+ A configuracao padrao fica em `~/.agent-devkit/config.json`. Para automacao e
340
+ testes, use `AGENT_DEVKIT_HOME`, `AI_DEVKIT_CONFIG_HOME` ou `AIKIT_CONFIG_HOME`
341
+ para apontar outro diretorio. `~/.ai-devkit` continua aceito como home legado
342
+ quando ja existir.
343
+
344
+ Para migrar explicitamente o home legado para o caminho canonico:
345
+
346
+ ```bash
347
+ agent config migrate-home --dry-run
348
+ agent config migrate-home
349
+ ```
315
350
 
316
351
  ## Providers
317
352
 
@@ -337,7 +372,7 @@ agent provider unset topdesk
337
372
  `provider configure` grava apenas referencias seguras, como `env:VAR` e
338
373
  `env-file:/caminho#VAR`; valores de segredos nunca sao persistidos nem exibidos.
339
374
  Use `--session-only` para validar uma configuracao sem escrever em
340
- `~/.ai-devkit/config.json`. Arquivos passados com `--env-file` precisam conter
375
+ `~/.agent-devkit/config.json`. Arquivos passados com `--env-file` precisam conter
341
376
  ao menos um campo reconhecido pelo provider selecionado.
342
377
 
343
378
  Quando um prompt ou capability exige uma source/provider ausente, o runtime
@@ -350,10 +385,31 @@ agent --json "analise o card 7914 do projeto sustentacao no azure"
350
385
  agent --json run topdesk-orchestrator read-incident --number "I 2606 001"
351
386
  ```
352
387
 
388
+ Fluxo de continuidade:
389
+
390
+ ```bash
391
+ agent wizard list
392
+ agent wizard show <wizard-id>
393
+ agent wizard answer <wizard-id> sim
394
+ agent wizard answer <wizard-id> <resposta>
395
+ agent wizard cancel <wizard-id>
396
+ ```
397
+
398
+ Quando a ultima resposta valida e recebida, o wizard salva uma source
399
+ reutilizavel em `~/.agent-devkit/config.json`, sem segredos em claro, e retoma o
400
+ prompt original. Use `agent wizard answer <wizard-id> <resposta> --no-run` para
401
+ salvar a configuracao sem retomar a execucao.
402
+
403
+ Em terminal interativo, `agent "<prompt>"` conduz essas perguntas diretamente.
404
+ Com `--json`, pipes ou automacao, ele retorna `needs-input` com `wizard_id` para
405
+ que o fluxo seja continuado de forma explicita e nao bloqueante.
406
+
353
407
  ## Decisoes, ferramentas e integracoes
354
408
 
355
- Opt-ins e opt-outs ficam em `~/.ai-devkit/config/decisions.json` e podem ser
356
- gerenciados por comando ou prompt:
409
+ Opt-ins e opt-outs ficam em `~/.agent-devkit/config/decisions.json` e podem ser
410
+ gerenciados por comando ou prompt. O roteamento por prompt usa os catalogos de
411
+ toolchain, providers, skills e backends LLM; nao depende de uma lista fixa de
412
+ alvos.
357
413
 
358
414
  ```bash
359
415
  agent decisions list
@@ -364,9 +420,18 @@ agent integrations list
364
420
  agent skills list
365
421
  agent "mostre minhas decisoes"
366
422
  agent "desative o azure devops por enquanto"
423
+ agent "desative topdesk"
424
+ agent "habilite gh-cli"
425
+ agent "desative a skill security-review"
426
+ agent "desative openrouter"
367
427
  agent "reative o ollama"
428
+ agent "liste llms"
429
+ agent "esqueca minha decisao sobre anthropic"
368
430
  ```
369
431
 
432
+ Quando um nome e ambiguo entre categorias, o retorno fica `needs-input` e inclui
433
+ `matches` para o usuario informar a categoria ou o id exato.
434
+
370
435
  ## Credential Resolver
371
436
 
372
437
  O resolver de credenciais opera por referencias e origens, sem retornar valores
@@ -1,3 +1,3 @@
1
1
  """Public CLI implementation for AI DevKit."""
2
2
 
3
- __version__ = "0.1.5"
3
+ __version__ = "0.1.6"
@@ -0,0 +1,66 @@
1
+ """Execution helpers for multi-agent plans."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any, Callable
6
+
7
+
8
+ RunCapability = Callable[[dict[str, Any], str, list[str]], dict[str, Any]]
9
+ LoadAgent = Callable[[str], dict[str, Any]]
10
+
11
+
12
+ def execute_plan_tasks(
13
+ plan: dict[str, Any],
14
+ *,
15
+ load_agent: LoadAgent,
16
+ run_capability: RunCapability,
17
+ ) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]:
18
+ executed: list[dict[str, Any]] = []
19
+ blocked: list[dict[str, Any]] = []
20
+ for task in plan.get("specialist_tasks") or []:
21
+ if not task.get("primary"):
22
+ continue
23
+ if not task.get("executable"):
24
+ blocked.append(blocked_task(task, "Capability has no executable runner."))
25
+ continue
26
+ if str(task.get("write_policy") or "") not in {"read_only", "dry_run"}:
27
+ blocked.append(blocked_task(task, "Capability requires explicit confirmation for external write effects."))
28
+ continue
29
+ try:
30
+ agent = load_agent(str(task["agent_id"]))
31
+ result = run_capability(agent, str(task["capability_id"]), list(task.get("args") or []))
32
+ except Exception as exc: # pragma: no cover - converted to user-facing payload.
33
+ blocked.append(blocked_task(task, str(exc)))
34
+ continue
35
+ item = public_task_result(task, result)
36
+ if result.get("ok"):
37
+ executed.append(item)
38
+ else:
39
+ blocked.append(item)
40
+ return executed, blocked
41
+
42
+
43
+ def public_task_result(task: dict[str, Any], result: dict[str, Any]) -> dict[str, Any]:
44
+ return {
45
+ "id": task.get("id"),
46
+ "agent_id": task.get("agent_id"),
47
+ "capability_id": task.get("capability_id"),
48
+ "status": result.get("status"),
49
+ "ok": bool(result.get("ok")),
50
+ "provider": task.get("provider"),
51
+ "write_policy": task.get("write_policy"),
52
+ "result": result,
53
+ }
54
+
55
+
56
+ def blocked_task(task: dict[str, Any], reason: str) -> dict[str, Any]:
57
+ return {
58
+ "id": task.get("id"),
59
+ "agent_id": task.get("agent_id"),
60
+ "capability_id": task.get("capability_id"),
61
+ "status": "blocked",
62
+ "ok": False,
63
+ "provider": task.get("provider"),
64
+ "write_policy": task.get("write_policy"),
65
+ "reason": reason,
66
+ }
@@ -0,0 +1,80 @@
1
+ """Agent and capability registry helpers for orchestration."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from pathlib import Path
6
+ from typing import Any
7
+
8
+ import yaml
9
+
10
+
11
+ def load_agent_registry(root: Path) -> dict[str, Any]:
12
+ agents_dir = root / "agents"
13
+ agents: dict[str, dict[str, Any]] = {}
14
+ capabilities: dict[str, dict[str, Any]] = {}
15
+ if not agents_dir.exists():
16
+ return {"agents": agents, "capabilities": capabilities}
17
+ for agent_path in sorted(path for path in agents_dir.iterdir() if path.is_dir()):
18
+ manifest_path = agent_path / "agent.yaml"
19
+ if not manifest_path.exists():
20
+ continue
21
+ agent = read_yaml(manifest_path)
22
+ agent_id = str(agent.get("id") or agent_path.name)
23
+ agent["id"] = agent_id
24
+ agent["path"] = str(agent_path.relative_to(root))
25
+ agent["capabilities_index"] = {}
26
+ for capability_path in sorted((agent_path / "capabilities").glob("*/capability.yaml")):
27
+ capability = read_yaml(capability_path)
28
+ capability_id = str(capability.get("id") or capability_path.parent.name)
29
+ short_id = capability_id.rsplit(".", 1)[-1]
30
+ public_capability = {
31
+ "id": capability_id,
32
+ "short_id": short_id,
33
+ "agent_id": agent_id,
34
+ "name": capability.get("name") or short_id,
35
+ "purpose": compact(str(capability.get("purpose") or "")),
36
+ "write_policy": capability.get("write_policy"),
37
+ "inputs": capability.get("inputs") or {},
38
+ "outputs": capability.get("outputs") or {},
39
+ "integration": capability.get("integration") or {},
40
+ "requires": capability.get("requires") or {},
41
+ "has_runner": bool(((capability.get("entrypoint") or {}).get("runner"))),
42
+ "path": str(capability_path.parent.relative_to(root)),
43
+ }
44
+ agent["capabilities_index"][short_id] = public_capability
45
+ capabilities[f"{agent_id}/{short_id}"] = public_capability
46
+ agents[agent_id] = public_agent(agent)
47
+ return {"agents": agents, "capabilities": capabilities}
48
+
49
+
50
+ def public_agent(agent: dict[str, Any]) -> dict[str, Any]:
51
+ surface = agent.get("agent_surface") if isinstance(agent.get("agent_surface"), dict) else {}
52
+ return {
53
+ "id": agent.get("id"),
54
+ "name": agent.get("name") or agent.get("id"),
55
+ "kind": agent.get("kind"),
56
+ "status": agent.get("status"),
57
+ "purpose": compact(str(agent.get("purpose") or "")),
58
+ "depends_on_agents": list(agent.get("depends_on_agents") or []),
59
+ "orchestrated_agents": list(surface.get("orchestrated_agents") or []),
60
+ "capabilities": list(agent.get("capabilities") or []),
61
+ "capabilities_index": dict(agent.get("capabilities_index") or {}),
62
+ "write_policy": agent.get("write_policy"),
63
+ "path": agent.get("path"),
64
+ }
65
+
66
+
67
+ def find_capability(registry: dict[str, Any], agent_id: str, capability_id: str) -> dict[str, Any] | None:
68
+ return (registry.get("capabilities") or {}).get(f"{agent_id}/{capability_id}")
69
+
70
+
71
+ def read_yaml(path: Path) -> dict[str, Any]:
72
+ data = yaml.safe_load(path.read_text(encoding="utf-8")) or {}
73
+ return data if isinstance(data, dict) else {}
74
+
75
+
76
+ def compact(value: str, *, limit: int = 240) -> str:
77
+ text = " ".join(value.split())
78
+ if len(text) <= limit:
79
+ return text
80
+ return text[: limit - 3].rstrip() + "..."