agent-devkit 0.2.0 → 0.3.1

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 (177) hide show
  1. package/README.md +66 -13
  2. package/bin/agent.mjs +133 -7
  3. package/package.json +1 -1
  4. package/runtime/README.md +205 -13
  5. package/runtime/agent +31 -5
  6. package/runtime/agents/README.md +18 -0
  7. package/runtime/agents/contribution-reviewer/AGENTS.md +8 -0
  8. package/runtime/agents/contribution-reviewer/README.md +8 -0
  9. package/runtime/agents/contribution-reviewer/agent.yaml +40 -0
  10. package/runtime/agents/contribution-reviewer/capabilities/plan-contribution-pr/capability.yaml +27 -0
  11. package/runtime/agents/contribution-reviewer/capabilities/plan-contribution-pr/decision-rules.md +5 -0
  12. package/runtime/agents/contribution-reviewer/capabilities/plan-contribution-pr/workflow.md +6 -0
  13. package/runtime/agents/contribution-reviewer/capabilities/review-contribution/capability.yaml +25 -0
  14. package/runtime/agents/contribution-reviewer/capabilities/review-contribution/decision-rules.md +5 -0
  15. package/runtime/agents/contribution-reviewer/capabilities/review-contribution/workflow.md +5 -0
  16. package/runtime/agents/contribution-reviewer/capabilities/validate-local-contribution/capability.yaml +26 -0
  17. package/runtime/agents/contribution-reviewer/capabilities/validate-local-contribution/decision-rules.md +5 -0
  18. package/runtime/agents/contribution-reviewer/capabilities/validate-local-contribution/workflow.md +6 -0
  19. package/runtime/agents/contribution-reviewer/infra/README.md +6 -0
  20. package/runtime/agents/contribution-reviewer/knowledge/context.md +8 -0
  21. package/runtime/agents/contribution-reviewer/knowledge/system.md +8 -0
  22. package/runtime/agents/contribution-reviewer/templates/README.md +3 -0
  23. package/runtime/agents/knowledge-author/AGENTS.md +7 -0
  24. package/runtime/agents/knowledge-author/README.md +7 -0
  25. package/runtime/agents/knowledge-author/agent.yaml +37 -0
  26. package/runtime/agents/knowledge-author/capabilities/create-knowledge-snapshot/capability.yaml +30 -0
  27. package/runtime/agents/knowledge-author/capabilities/create-knowledge-snapshot/decision-rules.md +6 -0
  28. package/runtime/agents/knowledge-author/capabilities/create-knowledge-snapshot/workflow.md +7 -0
  29. package/runtime/agents/knowledge-author/infra/.gitkeep +1 -0
  30. package/runtime/agents/knowledge-author/knowledge/context.md +4 -0
  31. package/runtime/agents/knowledge-author/knowledge/system.md +4 -0
  32. package/runtime/agents/knowledge-author/templates/.gitkeep +1 -0
  33. package/runtime/agents/knowledge-curator/AGENTS.md +7 -0
  34. package/runtime/agents/knowledge-curator/README.md +6 -0
  35. package/runtime/agents/knowledge-curator/agent.yaml +37 -0
  36. package/runtime/agents/knowledge-curator/capabilities/curate-knowledge-base/capability.yaml +29 -0
  37. package/runtime/agents/knowledge-curator/capabilities/curate-knowledge-base/decision-rules.md +6 -0
  38. package/runtime/agents/knowledge-curator/capabilities/curate-knowledge-base/workflow.md +7 -0
  39. package/runtime/agents/knowledge-curator/infra/.gitkeep +1 -0
  40. package/runtime/agents/knowledge-curator/knowledge/context.md +4 -0
  41. package/runtime/agents/knowledge-curator/knowledge/system.md +4 -0
  42. package/runtime/agents/knowledge-curator/templates/.gitkeep +1 -0
  43. package/runtime/agents/knowledge-infra-builder/AGENTS.md +8 -0
  44. package/runtime/agents/knowledge-infra-builder/README.md +8 -0
  45. package/runtime/agents/knowledge-infra-builder/agent.yaml +38 -0
  46. package/runtime/agents/knowledge-infra-builder/capabilities/create-knowledge-base/capability.yaml +30 -0
  47. package/runtime/agents/knowledge-infra-builder/capabilities/create-knowledge-base/decision-rules.md +6 -0
  48. package/runtime/agents/knowledge-infra-builder/capabilities/create-knowledge-base/workflow.md +7 -0
  49. package/runtime/agents/knowledge-infra-builder/infra/.gitkeep +1 -0
  50. package/runtime/agents/knowledge-infra-builder/knowledge/context.md +4 -0
  51. package/runtime/agents/knowledge-infra-builder/knowledge/system.md +4 -0
  52. package/runtime/agents/knowledge-infra-builder/templates/.gitkeep +1 -0
  53. package/runtime/agents/knowledge-owner/AGENTS.md +7 -0
  54. package/runtime/agents/knowledge-owner/README.md +6 -0
  55. package/runtime/agents/knowledge-owner/agent.yaml +37 -0
  56. package/runtime/agents/knowledge-owner/capabilities/publish-knowledge-snapshot/capability.yaml +28 -0
  57. package/runtime/agents/knowledge-owner/capabilities/publish-knowledge-snapshot/decision-rules.md +6 -0
  58. package/runtime/agents/knowledge-owner/capabilities/publish-knowledge-snapshot/workflow.md +7 -0
  59. package/runtime/agents/knowledge-owner/infra/.gitkeep +1 -0
  60. package/runtime/agents/knowledge-owner/knowledge/context.md +4 -0
  61. package/runtime/agents/knowledge-owner/knowledge/system.md +4 -0
  62. package/runtime/agents/knowledge-owner/templates/.gitkeep +1 -0
  63. package/runtime/agents/knowledge-reviewer/AGENTS.md +7 -0
  64. package/runtime/agents/knowledge-reviewer/README.md +7 -0
  65. package/runtime/agents/knowledge-reviewer/agent.yaml +36 -0
  66. package/runtime/agents/knowledge-reviewer/capabilities/review-knowledge-snapshot/capability.yaml +26 -0
  67. package/runtime/agents/knowledge-reviewer/capabilities/review-knowledge-snapshot/decision-rules.md +6 -0
  68. package/runtime/agents/knowledge-reviewer/capabilities/review-knowledge-snapshot/workflow.md +7 -0
  69. package/runtime/agents/knowledge-reviewer/infra/.gitkeep +1 -0
  70. package/runtime/agents/knowledge-reviewer/knowledge/context.md +4 -0
  71. package/runtime/agents/knowledge-reviewer/knowledge/system.md +4 -0
  72. package/runtime/agents/knowledge-reviewer/templates/.gitkeep +1 -0
  73. package/runtime/agents/local-memory-manager/AGENTS.md +5 -0
  74. package/runtime/agents/local-memory-manager/README.md +7 -0
  75. package/runtime/agents/local-memory-manager/agent.yaml +38 -0
  76. package/runtime/agents/local-memory-manager/capabilities/curate-local-memory/capability.yaml +19 -0
  77. package/runtime/agents/local-memory-manager/capabilities/curate-local-memory/decision-rules.md +5 -0
  78. package/runtime/agents/local-memory-manager/capabilities/curate-local-memory/workflow.md +6 -0
  79. package/runtime/agents/local-memory-manager/capabilities/inspect-local-memory/capability.yaml +19 -0
  80. package/runtime/agents/local-memory-manager/capabilities/inspect-local-memory/decision-rules.md +5 -0
  81. package/runtime/agents/local-memory-manager/capabilities/inspect-local-memory/workflow.md +5 -0
  82. package/runtime/agents/local-memory-manager/infra/.gitkeep +1 -0
  83. package/runtime/agents/local-memory-manager/knowledge/context.md +4 -0
  84. package/runtime/agents/local-memory-manager/knowledge/system.md +4 -0
  85. package/runtime/agents/local-memory-manager/templates/.gitkeep +1 -0
  86. package/runtime/agents/memory-sync-manager/AGENTS.md +7 -0
  87. package/runtime/agents/memory-sync-manager/README.md +7 -0
  88. package/runtime/agents/memory-sync-manager/agent.yaml +37 -0
  89. package/runtime/agents/memory-sync-manager/capabilities/plan-memory-backup/capability.yaml +29 -0
  90. package/runtime/agents/memory-sync-manager/capabilities/plan-memory-backup/decision-rules.md +6 -0
  91. package/runtime/agents/memory-sync-manager/capabilities/plan-memory-backup/workflow.md +7 -0
  92. package/runtime/agents/memory-sync-manager/infra/.gitkeep +1 -0
  93. package/runtime/agents/memory-sync-manager/knowledge/context.md +4 -0
  94. package/runtime/agents/memory-sync-manager/knowledge/system.md +4 -0
  95. package/runtime/agents/memory-sync-manager/templates/.gitkeep +1 -0
  96. package/runtime/agents/shared-memory-curator/AGENTS.md +5 -0
  97. package/runtime/agents/shared-memory-curator/README.md +6 -0
  98. package/runtime/agents/shared-memory-curator/agent.yaml +38 -0
  99. package/runtime/agents/shared-memory-curator/capabilities/create-shared-memory/capability.yaml +19 -0
  100. package/runtime/agents/shared-memory-curator/capabilities/create-shared-memory/decision-rules.md +5 -0
  101. package/runtime/agents/shared-memory-curator/capabilities/create-shared-memory/workflow.md +5 -0
  102. package/runtime/agents/shared-memory-curator/capabilities/publish-shared-submission/capability.yaml +19 -0
  103. package/runtime/agents/shared-memory-curator/capabilities/publish-shared-submission/decision-rules.md +5 -0
  104. package/runtime/agents/shared-memory-curator/capabilities/publish-shared-submission/workflow.md +5 -0
  105. package/runtime/agents/shared-memory-curator/capabilities/review-shared-submission/capability.yaml +19 -0
  106. package/runtime/agents/shared-memory-curator/capabilities/review-shared-submission/decision-rules.md +5 -0
  107. package/runtime/agents/shared-memory-curator/capabilities/review-shared-submission/workflow.md +5 -0
  108. package/runtime/agents/shared-memory-curator/infra/.gitkeep +1 -0
  109. package/runtime/agents/shared-memory-curator/knowledge/context.md +5 -0
  110. package/runtime/agents/shared-memory-curator/knowledge/system.md +4 -0
  111. package/runtime/agents/shared-memory-curator/templates/.gitkeep +1 -0
  112. package/runtime/cli/README.md +47 -8
  113. package/runtime/cli/aikit/__init__.py +1 -1
  114. package/runtime/cli/aikit/agent_registry.py +4 -2
  115. package/runtime/cli/aikit/agentic_commands.py +158 -0
  116. package/runtime/cli/aikit/app_home.py +2 -0
  117. package/runtime/cli/aikit/audit.py +16 -6
  118. package/runtime/cli/aikit/catalog.py +278 -8
  119. package/runtime/cli/aikit/cli_dispatch.py +489 -13
  120. package/runtime/cli/aikit/cli_parser.py +146 -8
  121. package/runtime/cli/aikit/contribution.py +132 -2
  122. package/runtime/cli/aikit/doctor_runtime.py +85 -0
  123. package/runtime/cli/aikit/embedded_mini_brain.py +351 -0
  124. package/runtime/cli/aikit/eval.py +356 -10
  125. package/runtime/cli/aikit/human_output.py +310 -4
  126. package/runtime/cli/aikit/interactive_wizard.py +146 -0
  127. package/runtime/cli/aikit/knowledge_base.py +1067 -0
  128. package/runtime/cli/aikit/llm.py +40 -6
  129. package/runtime/cli/aikit/local_artifacts.py +444 -0
  130. package/runtime/cli/aikit/local_llm.py +176 -0
  131. package/runtime/cli/aikit/local_llm_operator.py +15 -5
  132. package/runtime/cli/aikit/main.py +15 -0
  133. package/runtime/cli/aikit/mcp_manifest.py +798 -0
  134. package/runtime/cli/aikit/mcp_tools.py +643 -5
  135. package/runtime/cli/aikit/memory.py +405 -0
  136. package/runtime/cli/aikit/mini_brain.py +56 -25
  137. package/runtime/cli/aikit/model_router.py +42 -9
  138. package/runtime/cli/aikit/natural_prompt_runtime.py +194 -2
  139. package/runtime/cli/aikit/ollama.py +64 -15
  140. package/runtime/cli/aikit/onboarding.py +551 -0
  141. package/runtime/cli/aikit/output.py +67 -0
  142. package/runtime/cli/aikit/prompt_injection.py +12 -1
  143. package/runtime/cli/aikit/review_gate.py +14 -2
  144. package/runtime/cli/aikit/roadmap_cli.py +1 -1
  145. package/runtime/cli/aikit/secrets.py +3 -2
  146. package/runtime/cli/aikit/setup_wizard_payload.py +3 -0
  147. package/runtime/cli/aikit/shared_memory.py +415 -0
  148. package/runtime/cli/aikit/specialist_readiness.py +152 -0
  149. package/runtime/cli/aikit/tasks.py +104 -1
  150. package/runtime/cli/aikit/team.py +380 -0
  151. package/runtime/cli/aikit/toolchain.py +7 -2
  152. package/runtime/cli/aikit/workflows.py +115 -14
  153. package/runtime/models/qwen2.5-0.5b-instruct/manifest.json +30 -0
  154. package/runtime/providers/knowledge-github.yaml +40 -0
  155. package/runtime/providers/knowledge-google-drive.yaml +32 -0
  156. package/runtime/providers/knowledge-local.yaml +26 -0
  157. package/runtime/providers/knowledge-notion.yaml +32 -0
  158. package/runtime/providers/knowledge-obsidian.yaml +24 -0
  159. package/runtime/providers/knowledge-onedrive.yaml +36 -0
  160. package/runtime/providers/knowledge-s3.yaml +45 -0
  161. package/runtime/providers/knowledge-sharepoint.yaml +39 -0
  162. package/runtime/providers/knowledge-supabase.yaml +43 -0
  163. package/runtime/providers/knowledge-vector.yaml +39 -0
  164. package/runtime/requirements.txt +6 -0
  165. package/runtime/scripts/docker-cli-qa.sh +453 -0
  166. package/runtime/scripts/release-catalog-snapshot.json +55 -4
  167. package/runtime/scripts/release-gate.py +54 -13
  168. package/runtime/tooling/toolchain.yaml +92 -0
  169. package/runtime/vendor/skills/napkin/napkin.md +21 -7
  170. package/runtime/workflows/azure-card-analysis/README.md +3 -0
  171. package/runtime/workflows/azure-card-analysis/workflow.yaml +30 -0
  172. package/runtime/workflows/daily-pr-review/README.md +3 -0
  173. package/runtime/workflows/daily-pr-review/workflow.yaml +31 -0
  174. package/runtime/workflows/incident-analysis/README.md +3 -0
  175. package/runtime/workflows/incident-analysis/workflow.yaml +33 -0
  176. package/runtime/workflows/release-prep/README.md +3 -0
  177. package/runtime/workflows/release-prep/workflow.yaml +30 -0
package/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  Agent DevKit is a CLI runtime for specialist AI agents, capabilities,
4
4
  provider-aware automations and local host adapters for Codex and Claude.
5
+ On first run, the npm wrapper creates a local Python environment under
6
+ `~/.agent-devkit/python` (or `AGENT_DEVKIT_HOME`) and installs the bundled
7
+ `requirements.txt` dependencies.
5
8
 
6
9
  The npm package installs the canonical command:
7
10
 
@@ -18,6 +21,7 @@ npm install -g agent-devkit
18
21
  Validate the installation:
19
22
 
20
23
  ```bash
24
+ agent
21
25
  agent --version
22
26
  agent -v
23
27
  agent doctor
@@ -26,7 +30,7 @@ agent doctor
26
30
  Expected version for this release:
27
31
 
28
32
  ```text
29
- agent 0.2.0
33
+ agent 0.3.1
30
34
  ```
31
35
 
32
36
  ## Quick Start
@@ -41,12 +45,17 @@ agent llm list
41
45
  agent commands list
42
46
  ```
43
47
 
44
- Agent DevKit `v0.2.0` also includes deterministic runtime discovery and
45
- integration commands:
48
+ Agent DevKit `v0.3.1` also includes the embedded Qwen2.5-0.5B mini-brain
49
+ contract for local bootstrap conversations without Ollama, Claude, Codex or API
50
+ keys. The npm package stays small; `agent setup mini-brain --yes` downloads the
51
+ GGUF into `.agent-devkit/models` after explicit opt-in.
52
+ The `v0.3.0` deterministic runtime discovery and integration commands remain
53
+ available:
46
54
 
47
55
  ```bash
48
56
  agent roadmap
49
57
  agent catalog search pr
58
+ agent plan "review this Azure card"
50
59
  agent route explain "review the PRs waiting for me"
51
60
  agent eval run routing
52
61
  agent secrets doctor
@@ -68,9 +77,48 @@ Run a natural-language task:
68
77
  agent "analise o problema relatado no card 9900"
69
78
  ```
70
79
 
71
- Natural-language mode requires an LLM backend. Deterministic commands such as
72
- `agent agents list`, `agent capabilities list`, `agent doctor`, `agent provider`
73
- and `agent run` do not require an LLM.
80
+ Natural-language mode can start with the embedded mini-brain. Stronger
81
+ coordinator/reviewer backends remain optional for higher-level work.
82
+ Deterministic commands such as `agent agents list`, `agent capabilities list`,
83
+ `agent doctor`, `agent provider` and `agent run` do not require an external LLM.
84
+
85
+ Running `agent` without arguments starts the local onboarding status and wizard:
86
+ memory, personality, LLM backends, Ollama, toolchain, sources and next actions.
87
+ Use `agent onboard minimal` for identity, optional coordinator LLM, installable
88
+ mini-brain and local memory. Use `agent onboard complete` to include toolchain,
89
+ providers/sources, specialist catalog, local automations, tasks, notifications,
90
+ knowledge and shared memory. Both commands return plans; external installs
91
+ still require explicit opt-in.
92
+
93
+ The canonical executable remains `agent`, but the local public agent name can be
94
+ changed during onboarding, with `agent --rename <name>`, with
95
+ `agent personality edit --rename <name>`, or through a natural-language prompt
96
+ such as `agent "mude seu nome para ianota10"`. To expose an executable alias,
97
+ use `agent alias add <name>`.
98
+
99
+ Useful operational commands:
100
+
101
+ ```bash
102
+ agent plan "analyze Azure card 7914"
103
+ agent execute --dry-run "summarize these logs"
104
+ agent workflow install daily-pr-review --dry-run
105
+ agent setup mini-brain --yes
106
+ agent local-llm doctor
107
+ agent local-llm install qwen3:0.6b --dry-run
108
+ agent skill create my-skill --description "Local skill"
109
+ agent script create hello --command "echo hello"
110
+ agent team init
111
+ agent team doctor
112
+ agent knowledge init
113
+ agent knowledge search "runbook procedure"
114
+ agent shared-memory create --title "Support runbooks"
115
+ agent shared-memory submit <memory-id> --title "New runbook" --content "..." --key <contributor-key>
116
+ agent shared-memory review <memory-id> <submission-id>
117
+ agent shared-memory publish <memory-id> <submission-id> --yes --owner-key <owner-key>
118
+ agent contribute pr my-extension --dry-run
119
+ agent mcp manifest
120
+ agent mcp serve
121
+ ```
74
122
 
75
123
  ## Complete Configuration Tutorial
76
124
 
@@ -182,20 +230,25 @@ agent llm configure openrouter --api-key-env OPENROUTER_API_KEY --model openai/g
182
230
  agent llm doctor openrouter
183
231
  ```
184
232
 
185
- ### Option F: Ollama local backend
233
+ ### Embedded mini-brain and Ollama local backend
186
234
 
187
235
  ```bash
236
+ agent setup mini-brain --yes
237
+ agent local-llm doctor
188
238
  agent ollama status
189
239
  agent ollama models
190
- agent ollama pull qwen2.5-coder --dry-run
191
- agent ollama pull qwen2.5-coder --yes
240
+ agent ollama pull qwen3:0.6b --dry-run
241
+ agent ollama pull qwen3:0.6b --yes
192
242
  ollama serve
193
- agent llm configure ollama --base-url http://localhost:11434/v1 --model qwen2.5-coder --set-default
243
+ agent llm configure ollama --base-url http://localhost:11434/v1 --model qwen3:0.6b --set-default
194
244
  agent llm doctor ollama
195
245
  ```
196
246
 
197
- Ollama is treated as an operational worker for repetitive local tasks. Codex and
198
- Claude remain the preferred coordinators and reviewers for high-level planning,
247
+ Agent DevKit includes an installable embedded mini-brain for initial
248
+ conversation, onboarding and setup without external authentication. The GGUF is
249
+ downloaded to `.agent-devkit/models` only after opt-in. Ollama is still treated
250
+ as an optional operational worker for repetitive local tasks. Codex and Claude
251
+ remain the preferred coordinators and reviewers for high-level planning,
199
252
  software changes, documents, automation decisions and final review.
200
253
 
201
254
  ### Switch or override the backend
@@ -304,7 +357,7 @@ agent llm configure openrouter --api-key-env OPENROUTER_API_KEY --model openai/g
304
357
  Local or host-authenticated backends:
305
358
 
306
359
  ```bash
307
- agent llm configure ollama --base-url http://localhost:11434/v1 --model qwen2.5-coder --set-default
360
+ agent llm configure ollama --base-url http://localhost:11434/v1 --model qwen3:0.6b --set-default
308
361
  agent llm configure codex-cli --set-default
309
362
  agent llm configure claude-code --set-default
310
363
  ```
package/bin/agent.mjs CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { spawnSync } from "node:child_process";
4
- import { accessSync, constants } from "node:fs";
4
+ import { accessSync, constants, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
5
+ import os from "node:os";
5
6
  import path from "node:path";
6
7
  import { fileURLToPath } from "node:url";
7
8
 
@@ -9,6 +10,8 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
10
  const packageRoot = path.resolve(__dirname, "..");
10
11
  const runtimeRoot = path.join(packageRoot, "runtime");
11
12
  const runtimeAgent = path.join(runtimeRoot, "agent");
13
+ const runtimeRequirements = path.join(runtimeRoot, "requirements.txt");
14
+ const packageJson = JSON.parse(readFileSync(path.join(packageRoot, "package.json"), "utf8"));
12
15
 
13
16
  function canExecute(command) {
14
17
  const result = spawnSync(command, ["--version"], {
@@ -22,13 +25,130 @@ function resolvePython() {
22
25
  if (process.env.AGENT_DEVKIT_PYTHON) {
23
26
  return process.env.AGENT_DEVKIT_PYTHON;
24
27
  }
25
- if (canExecute("python3")) {
26
- return "python3";
28
+ const basePython = canExecute("python3") ? "python3" : (canExecute("python") ? "python" : null);
29
+ if (!basePython) {
30
+ return null;
27
31
  }
28
- if (canExecute("python")) {
29
- return "python";
32
+ if (!existsSync(runtimeRequirements)) {
33
+ return basePython;
34
+ }
35
+ return ensureBundledPython(basePython);
36
+ }
37
+
38
+ function resolveAppHome() {
39
+ if (process.env.AGENT_DEVKIT_HOME) return process.env.AGENT_DEVKIT_HOME;
40
+ if (process.env.AI_DEVKIT_CONFIG_HOME) return process.env.AI_DEVKIT_CONFIG_HOME;
41
+ if (process.env.AIKIT_CONFIG_HOME) return process.env.AIKIT_CONFIG_HOME;
42
+ return path.join(os.homedir(), ".agent-devkit");
43
+ }
44
+
45
+ function venvPythonPath(venvRoot) {
46
+ if (process.platform === "win32") {
47
+ return path.join(venvRoot, "Scripts", "python.exe");
48
+ }
49
+ return path.join(venvRoot, "bin", "python");
50
+ }
51
+
52
+ function runOrFail(command, args, message, options = {}) {
53
+ const result = spawnSync(command, args, {
54
+ stdio: ["ignore", "pipe", "pipe"],
55
+ shell: false,
56
+ text: true,
57
+ ...options,
58
+ });
59
+ if (result.status === 0) {
60
+ return result;
61
+ }
62
+ const details = [result.stdout, result.stderr].filter(Boolean).join("\n").trim();
63
+ throw new Error(`${message}${details ? `\n${details}` : ""}`);
64
+ }
65
+
66
+ function commandOk(command, args) {
67
+ const result = spawnSync(command, args, {
68
+ stdio: "ignore",
69
+ shell: false,
70
+ });
71
+ return result.status === 0;
72
+ }
73
+
74
+ function canAutoInstallPythonVenv() {
75
+ return (
76
+ process.platform === "linux"
77
+ && typeof process.getuid === "function"
78
+ && process.getuid() === 0
79
+ && process.env.AGENT_DEVKIT_DISABLE_SYSTEM_BOOTSTRAP !== "1"
80
+ && canExecute("apt-get")
81
+ );
82
+ }
83
+
84
+ function tryInstallPythonVenvPackage() {
85
+ if (!canAutoInstallPythonVenv()) {
86
+ return false;
87
+ }
88
+ if (!commandOk("apt-get", ["update"])) {
89
+ return false;
90
+ }
91
+ return commandOk("apt-get", ["install", "-y", "python3-venv"]);
92
+ }
93
+
94
+ function createVenv(basePython, venvRoot) {
95
+ const result = spawnSync(basePython, ["-m", "venv", venvRoot], {
96
+ stdio: ["ignore", "pipe", "pipe"],
97
+ shell: false,
98
+ text: true,
99
+ });
100
+ if (result.status === 0) {
101
+ return;
102
+ }
103
+ if (tryInstallPythonVenvPackage()) {
104
+ runOrFail(basePython, ["-m", "venv", venvRoot], "Failed to create Agent DevKit Python environment.");
105
+ return;
106
+ }
107
+ const details = [result.stdout, result.stderr].filter(Boolean).join("\n").trim();
108
+ throw new Error(`Failed to create Agent DevKit Python environment.${details ? `\n${details}` : ""}`);
109
+ }
110
+
111
+ function pythonImportsOk(python) {
112
+ const result = spawnSync(
113
+ python,
114
+ ["-c", "import yaml, jsonschema, bs4, pypdf, reportlab"],
115
+ { stdio: "ignore", shell: false },
116
+ );
117
+ return result.status === 0;
118
+ }
119
+
120
+ function ensureBundledPython(basePython) {
121
+ const appHome = resolveAppHome();
122
+ const venvRoot = process.env.AGENT_DEVKIT_PYTHON_ENV || path.join(appHome, "python");
123
+ const python = venvPythonPath(venvRoot);
124
+ const marker = path.join(venvRoot, ".agent-devkit-deps.json");
125
+ mkdirSync(appHome, { recursive: true });
126
+
127
+ if (!existsSync(python)) {
128
+ createVenv(basePython, venvRoot);
129
+ }
130
+ if (pythonImportsOk(python) && markerMatches(marker)) {
131
+ return python;
132
+ }
133
+ runOrFail(
134
+ python,
135
+ ["-m", "pip", "install", "--upgrade", "pip", "-r", runtimeRequirements],
136
+ "Failed to install Agent DevKit Python dependencies.",
137
+ );
138
+ writeFileSync(marker, JSON.stringify({ version: packageJson.version, requirements: "runtime/requirements.txt" }, null, 2));
139
+ return python;
140
+ }
141
+
142
+ function markerMatches(marker) {
143
+ if (!existsSync(marker)) {
144
+ return false;
145
+ }
146
+ try {
147
+ const payload = JSON.parse(readFileSync(marker, "utf8"));
148
+ return payload.version === packageJson.version;
149
+ } catch {
150
+ return false;
30
151
  }
31
- return null;
32
152
  }
33
153
 
34
154
  try {
@@ -38,7 +158,13 @@ try {
38
158
  process.exit(1);
39
159
  }
40
160
 
41
- const python = resolvePython();
161
+ let python = null;
162
+ try {
163
+ python = resolvePython();
164
+ } catch (error) {
165
+ console.error(error instanceof Error ? error.message : "Agent DevKit Python bootstrap failed.");
166
+ process.exit(1);
167
+ }
42
168
  if (!python) {
43
169
  console.error("Agent DevKit requires Python 3.11+ available as python3 or python.");
44
170
  console.error("Set AGENT_DEVKIT_PYTHON to a Python executable if it is installed in a custom location.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-devkit",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Agent DevKit CLI runtime for specialist AI agents, capabilities and provider-aware automations.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/runtime/README.md CHANGED
@@ -22,13 +22,19 @@ npm install -g agent-devkit
22
22
  Valide a instalacao:
23
23
 
24
24
  ```bash
25
+ agent
25
26
  agent --version
26
27
  agent -v
27
28
  agent doctor
28
29
  ```
29
30
 
30
31
  O pacote instala o comando canonico `agent`. O nome do pacote npm e
31
- `agent-devkit`.
32
+ `agent-devkit`. Na primeira execucao, o wrapper npm prepara um ambiente Python
33
+ local em `~/.agent-devkit/python` (ou no `AGENT_DEVKIT_HOME`) e instala as
34
+ dependencias de `requirements.txt`, para evitar setup manual de bibliotecas
35
+ Python. Ao executar apenas `agent`, o CLI entra no onboarding local: verifica
36
+ memoria, personalidade, backends LLM, Ollama, toolchain, sources, tasks e
37
+ proximas acoes sem exigir prompt manual.
32
38
 
33
39
  ## Primeiro uso
34
40
 
@@ -44,18 +50,27 @@ agent commands list
44
50
  agent doctor
45
51
  ```
46
52
 
47
- Na `v0.2.0`, o runtime tambem expoe superficies deterministicas para
53
+ Na `v0.3.0`, o runtime tambem expoe superficies deterministicas para
48
54
  descoberta, avaliacao e integracao por hosts:
49
55
 
50
56
  ```bash
57
+ agent onboard minimal
58
+ agent onboard complete
51
59
  agent roadmap
52
60
  agent catalog search pr
61
+ agent plan "analise o card 7914 do azure"
53
62
  agent route explain "revise as prs que recebi hoje"
54
63
  agent eval run routing
55
64
  agent secrets doctor
56
65
  agent mcp tools
57
66
  ```
58
67
 
68
+ `agent onboard minimal` planeja o setup essencial: identidade, coordenador LLM
69
+ opcional, mini-cerebro local instalavel sob demanda e memoria local. `agent onboard complete`
70
+ inclui tambem toolchain, providers/sources, catalogo de agentes, automacoes
71
+ locais, tarefas, notificacoes, knowledge e memoria compartilhada. Ambos
72
+ retornam plano deterministico; instalacoes externas continuam exigindo opt-in.
73
+
59
74
  Instale os artefatos locais do Agent DevKit no projeto em que voce trabalha:
60
75
 
61
76
  ```bash
@@ -78,6 +93,24 @@ Esse modo usa backend LLM. Se nenhum backend estiver configurado, a CLI informa
78
93
  como configurar uma LLM ou como executar uma capability deterministica com
79
94
  `agent run`.
80
95
 
96
+ O nome publico do agente e configuravel localmente sem mudar o comando
97
+ canonico. O comando continua sendo `agent`, mas a identidade pode ser alterada
98
+ no onboarding, por flag ou por linguagem natural:
99
+
100
+ ```bash
101
+ agent --rename Ianota
102
+ agent personality edit --rename Ianota
103
+ agent "mude seu nome para ianota10"
104
+ agent "qual seu nome?"
105
+ ```
106
+
107
+ Se voce quiser tambem chamar o executavel por outro nome, crie um alias local:
108
+
109
+ ```bash
110
+ agent alias add jarvis
111
+ ~/.agent-devkit/bin/jarvis "qual seu nome?"
112
+ ```
113
+
81
114
  ## Tutorial completo de configuracao
82
115
 
83
116
  Existem tres formas principais de usar agentes pelo CLI:
@@ -214,20 +247,29 @@ Uso:
214
247
  agent "roteie este pedido para o agente especialista adequado"
215
248
  ```
216
249
 
217
- ### Opcao F: usar Ollama local
250
+ ### Mini cerebro embarcado e Ollama local
218
251
 
219
- O Agent DevKit consegue diagnosticar Ollama, listar modelos, planejar pull e
220
- usar o backend local como trabalhador operacional. Claude/Codex continuam sendo
221
- os coordenadores e revisores preferenciais para decisao, especificacao e entrega
222
- final.
252
+ O Agent DevKit vem com um mini cerebro local baseado no contrato
253
+ `Qwen/Qwen2.5-0.5B-Instruct` para conversa inicial, onboarding, setup e tarefas
254
+ simples sem depender de Claude, Codex, API externa ou Ollama. O pacote npm
255
+ inclui o manifest do modelo; o GGUF e baixado para `.agent-devkit/models` sob
256
+ demanda com `agent setup mini-brain --yes`.
257
+
258
+ Ollama continua suportado como pool opcional de workers locais. O Agent DevKit
259
+ consegue diagnosticar Ollama, listar modelos, planejar pull e usar o backend
260
+ local como trabalhador operacional quando ele estiver configurado ou tiver
261
+ modelos instalados. Claude/Codex continuam sendo os coordenadores e revisores
262
+ preferenciais para decisao, especificacao e entrega final.
223
263
 
224
264
  ```bash
265
+ agent setup mini-brain --yes
266
+ agent local-llm doctor
225
267
  agent ollama status
226
268
  agent ollama models
227
- agent ollama pull qwen2.5-coder --dry-run
228
- agent ollama pull qwen2.5-coder --yes
269
+ agent ollama pull qwen3:0.6b --dry-run
270
+ agent ollama pull qwen3:0.6b --yes
229
271
  ollama serve
230
- agent llm configure ollama --base-url http://localhost:11434/v1 --model qwen2.5-coder --set-default
272
+ agent llm configure ollama --base-url http://localhost:11434/v1 --model qwen3:0.6b --set-default
231
273
  agent llm doctor ollama
232
274
  ```
233
275
 
@@ -270,6 +312,11 @@ Existem dois modos de execucao:
270
312
  - `agent "<prompt>"`: entrada em linguagem natural; monta um plano multiagente,
271
313
  usa capabilities deterministicas quando possivel e exige backend LLM apenas
272
314
  quando nenhuma rota local atende a tarefa.
315
+ - `agent plan "<prompt>"`: gera o plano multiagente explicito sem executar LLM,
316
+ automacao ou escrita externa.
317
+ - `agent execute "<prompt>"` e `agent orchestrate "<prompt>"`: executam pelo
318
+ runtime agentico com roteamento, wizard de provider/source, modelo local
319
+ quando permitido e review gate.
273
320
  - `agent run <agent> <capability>`: execucao deterministica; nao exige LLM.
274
321
 
275
322
  Exemplo em linguagem natural:
@@ -287,9 +334,10 @@ executa a task primaria pelo runner existente e revisa a conclusao pelo
287
334
  `review_gate`.
288
335
 
289
336
  Para tarefas operacionais como resumo, classificacao, extracao e normalizacao,
290
- o runtime pode delegar uma subtarefa limitada ao `local-llm-operator` usando
291
- Ollama. O resultado local aparece em `local_llm_execution` e e usado apenas como
292
- contexto de apoio pelo coordenador principal.
337
+ o runtime pode usar o mini cerebro embarcado para bootstrap/conversa simples ou
338
+ delegar uma subtarefa limitada ao `local-llm-operator` usando Ollama quando
339
+ disponivel. O resultado local aparece em `local_llm_execution` e e usado apenas
340
+ como contexto de apoio pelo coordenador principal.
293
341
 
294
342
  Quando `review_gate.required = true`, o Agent DevKit exige uma segunda revisao
295
343
  concreta pelo `execution-reviewer`, preferindo `claude-code` ou `codex-cli`.
@@ -309,6 +357,123 @@ saidas:
309
357
  agent inspect azure-devops-orchestrator read-card
310
358
  ```
311
359
 
360
+ Comandos operacionais da `v0.2.1`:
361
+
362
+ ```bash
363
+ agent catalog list --type workflow
364
+ agent catalog rebuild-index
365
+ agent workflow show daily-pr-review
366
+ agent workflow install daily-pr-review --dry-run
367
+ agent local-llm doctor
368
+ agent local-llm install qwen3:0.6b --dry-run
369
+ agent skill create minha-skill --description "Skill local"
370
+ agent script create hello --command "echo hello"
371
+ agent agents create meu-agente --description "Agente local"
372
+ agent team init
373
+ agent team doctor
374
+ agent contribute pr minha-extensao --dry-run
375
+ ```
376
+
377
+ O MCP stdio embutido fica disponivel sempre que o CLI esta instalado:
378
+
379
+ ```bash
380
+ agent mcp manifest
381
+ agent mcp tools
382
+ agent mcp serve
383
+ ```
384
+
385
+ As ferramentas MCP expõem catalogo, onboarding, doctor, route explain, plano
386
+ agentico, evals, workflows, LLM local, artefatos locais, sources, wizards,
387
+ memoria local e memoria compartilhada. As operacoes com risco de escrita
388
+ externa continuam bloqueadas ou em dry-run por padrao.
389
+
390
+ ## Memoria compartilhada
391
+
392
+ Memorias compartilhadas sao workspaces locais em `.agent-devkit/shared-memory`.
393
+ O criador e o dono da memoria; outros agentes recebem uma URL local e uma chave
394
+ de contribuidor, enviam novidades para `incoming`, e o dono revisa antes de
395
+ publicar em `accepted`.
396
+
397
+ ```bash
398
+ agent shared-memory create --title "Runbooks de suporte"
399
+ agent shared-memory submit <memory-id> --title "Novo runbook" --content "..." --key <contributor-key>
400
+ agent shared-memory review <memory-id> <submission-id>
401
+ agent shared-memory publish <memory-id> <submission-id> --yes --owner-key <owner-key>
402
+ ```
403
+
404
+ ## Modo equipe
405
+
406
+ O modo equipe cria uma configuracao versionavel de projeto em
407
+ `.agent-devkit/team.yaml`. Esse arquivo pode guardar defaults de providers,
408
+ sources, workflows, permissoes, limites de LLM local e politica de prompt
409
+ injection, mas nunca valores de credenciais.
410
+
411
+ ```bash
412
+ agent team init
413
+ agent team status
414
+ agent team doctor
415
+ agent team onboard
416
+ agent team profile list
417
+ agent team profile show default
418
+ agent team profile export default --path ./team-profile.yaml
419
+ agent team profile import ./team-profile.yaml
420
+ ```
421
+
422
+ Segredos continuam pessoais, em `~/.agent-devkit`, por referencia segura:
423
+
424
+ ```bash
425
+ agent secret set azure-devops pat --env AZURE_DEVOPS_PAT
426
+ ```
427
+
428
+ ## Knowledge fabric local
429
+
430
+ A `v0.3.0` introduz uma base de conhecimento compartilhada file-first. A fonte
431
+ canonica e um diretorio `knowledge-base/` com Markdown, JSON e YAML; indices
432
+ lexicais ou semanticos sao derivados e podem ser recriados.
433
+
434
+ ```bash
435
+ agent knowledge init
436
+ agent knowledge doctor
437
+ agent knowledge snapshot create --title "Runbook" --content "# Runbook..."
438
+ agent knowledge review runbook
439
+ agent knowledge publish runbook --yes --owner-agent knowledge-owner
440
+ agent knowledge snapshot list
441
+ agent knowledge snapshot show runbook
442
+ agent knowledge snapshot score runbook
443
+ agent knowledge snapshot submit runbook
444
+ agent knowledge review list
445
+ agent knowledge curate
446
+ agent knowledge sync
447
+ agent knowledge reindex
448
+ agent knowledge search "runbook procedimento"
449
+ agent knowledge index
450
+ agent knowledge-base create --provider github
451
+ agent knowledge-base join kb_01JZ... --provider s3
452
+ ```
453
+
454
+ Snapshots sao tratados como conteudo externo nao confiavel. A revisao bloqueia
455
+ segredos, PII obvia e sinais de prompt injection antes de publicar localmente.
456
+
457
+ Os providers `knowledge-*` documentam o storage previsto para GitHub, S3,
458
+ Supabase Storage, Google Drive, SharePoint, OneDrive, Notion, Obsidian,
459
+ filesystem local e indice vetorial derivado. Providers remotos ficam em
460
+ `draft`, exigem opt-in e fallback para plano/manual enquanto nao houver
461
+ credencial e implementacao ativa.
462
+
463
+ ## QA destrutivo em Docker
464
+
465
+ Para validar instalacao limpa, bootstrap de dependencias, onboarding, memoria,
466
+ knowledge-base, MCP, desinstalacao e remocao da `.agent-devkit` sem tocar no
467
+ host:
468
+
469
+ ```bash
470
+ npm run docker:qa
471
+ ```
472
+
473
+ O script empacota o runtime local, instala o tarball em um container
474
+ `node:20-bookworm`, executa os fluxos criticos e remove o home local criado no
475
+ container.
476
+
312
477
  ## Configurar providers
313
478
 
314
479
  Providers tambem sao configurados por referencia. Configure apenas o que for
@@ -430,6 +595,10 @@ Comandos uteis:
430
595
  agent commands list
431
596
  agent inspect azure-devops-orchestrator read-card
432
597
  agent memory show
598
+ agent memory backup create --title "Antes da migracao"
599
+ export AGENT_DEVKIT_BACKUP_PASSPHRASE="frase longa"
600
+ agent memory backup create --title "Antes da migracao" --encrypted --passphrase-env AGENT_DEVKIT_BACKUP_PASSPHRASE
601
+ agent memory backup restore <backup-id> --yes
433
602
  agent memory reset --all
434
603
  ```
435
604
 
@@ -699,6 +868,9 @@ e ignorado pelo Git. Para Azure DevOps, `AZURE_DEVOPS_ORG` e
699
868
  rastreio de requests, padroes de erro e relatorios de logs.
700
869
  - [`execution-reviewer`](agents/execution-reviewer/): agente runtime de
701
870
  revisao final, revisao de planos e revisao de resultados antes da conclusao.
871
+ - [`contribution-reviewer`](agents/contribution-reviewer/): agente runtime para
872
+ validar extensoes locais, revisar riscos de contribuicao upstream e planejar
873
+ PRs em modo report-only.
702
874
  - [`excel-workbook-builder`](agents/excel-workbook-builder/): especialista em
703
875
  templates, preenchimento, conciliacao, revisao e exportacao de planilhas
704
876
  Excel.
@@ -708,10 +880,27 @@ e ignorado pelo Git. Para Azure DevOps, `AZURE_DEVOPS_ORG` e
708
880
  - [`github-pr-reviewer`](agents/github-pr-reviewer/): especialista em Pull
709
881
  Requests GitHub para listar revisoes pendentes, inspecionar PRs, revisar diffs
710
882
  em modo report-only e criar automacoes locais conservadoras.
883
+ - [`knowledge-infra-builder`](agents/knowledge-infra-builder/): especialista em
884
+ criar e diagnosticar a infraestrutura file-first da knowledge base
885
+ compartilhada.
886
+ - [`knowledge-author`](agents/knowledge-author/): especialista em criar
887
+ snapshots de conhecimento reutilizavel, sanitizado e revisavel.
711
888
  - [`knowledge-generator`](agents/knowledge-generator/): especialista em gerar
712
889
  knowledge versionavel a partir de arquivos, pastas, projetos e documentacoes.
890
+ - [`knowledge-reviewer`](agents/knowledge-reviewer/): especialista em revisar
891
+ snapshots, bloqueando segredo, PII indevida, duplicidade e prompt injection.
892
+ - [`knowledge-curator`](agents/knowledge-curator/): especialista em curadoria
893
+ continua, deduplicacao, arquivamento e reindexacao derivada da knowledge base.
894
+ - [`knowledge-owner`](agents/knowledge-owner/): autoridade de publicacao
895
+ controlada da knowledge base principal apos revisao.
713
896
  - [`local-llm-operator`](agents/local-llm-operator/): agente runtime para
714
897
  diagnosticar, selecionar e delegar tarefas operacionais a LLMs locais.
898
+ - [`local-memory-manager`](agents/local-memory-manager/): agente runtime para
899
+ inspecionar e curar memoria local, preferencias, sessoes e identidade sem
900
+ expor segredos.
901
+ - [`memory-sync-manager`](agents/memory-sync-manager/): especialista em
902
+ planejar backup, restore e sincronizacao seletiva da memoria local e
903
+ personalidade.
715
904
  - [`notification-operator`](agents/notification-operator/): agente runtime para
716
905
  formatar, enviar e configurar notificacoes locais de tarefas com payload
717
906
  canonico.
@@ -728,6 +917,9 @@ e ignorado pelo Git. Para Azure DevOps, `AZURE_DEVOPS_ORG` e
728
917
  especialista em inspecao local e auditoria report-only de projetos Supabase,
729
918
  cobrindo RLS, Auth, Storage, migrations, Edge Functions e planos de correcao
730
919
  sem aplicar mudancas reais.
920
+ - [`shared-memory-curator`](agents/shared-memory-curator/): agente runtime para
921
+ criar memorias compartilhadas, revisar contribuicoes externas e publicar
922
+ apenas conteudo aprovado pelo dono.
731
923
  - [`provider-configurator`](agents/provider-configurator/): agente runtime que
732
924
  conduz wizard de providers, sources e referencias seguras de credenciais.
733
925
  - [`presentation-deck-builder`](agents/presentation-deck-builder/):