agent-devkit 0.2.0 → 0.3.0

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 (172) hide show
  1. package/README.md +48 -6
  2. package/bin/agent.mjs +133 -7
  3. package/package.json +1 -1
  4. package/runtime/README.md +187 -5
  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 +35 -4
  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 +1 -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 +145 -7
  121. package/runtime/cli/aikit/contribution.py +132 -2
  122. package/runtime/cli/aikit/doctor_runtime.py +85 -0
  123. package/runtime/cli/aikit/eval.py +356 -10
  124. package/runtime/cli/aikit/human_output.py +310 -4
  125. package/runtime/cli/aikit/interactive_wizard.py +148 -0
  126. package/runtime/cli/aikit/knowledge_base.py +1067 -0
  127. package/runtime/cli/aikit/llm.py +12 -4
  128. package/runtime/cli/aikit/local_artifacts.py +444 -0
  129. package/runtime/cli/aikit/local_llm.py +161 -0
  130. package/runtime/cli/aikit/main.py +15 -0
  131. package/runtime/cli/aikit/mcp_manifest.py +798 -0
  132. package/runtime/cli/aikit/mcp_tools.py +643 -5
  133. package/runtime/cli/aikit/memory.py +405 -0
  134. package/runtime/cli/aikit/mini_brain.py +20 -1
  135. package/runtime/cli/aikit/natural_prompt_runtime.py +125 -1
  136. package/runtime/cli/aikit/ollama.py +64 -15
  137. package/runtime/cli/aikit/onboarding.py +551 -0
  138. package/runtime/cli/aikit/output.py +67 -0
  139. package/runtime/cli/aikit/prompt_injection.py +12 -1
  140. package/runtime/cli/aikit/roadmap_cli.py +1 -1
  141. package/runtime/cli/aikit/secrets.py +3 -2
  142. package/runtime/cli/aikit/setup_wizard_payload.py +3 -0
  143. package/runtime/cli/aikit/shared_memory.py +415 -0
  144. package/runtime/cli/aikit/specialist_readiness.py +152 -0
  145. package/runtime/cli/aikit/tasks.py +104 -1
  146. package/runtime/cli/aikit/team.py +380 -0
  147. package/runtime/cli/aikit/toolchain.py +7 -2
  148. package/runtime/cli/aikit/workflows.py +115 -14
  149. package/runtime/providers/knowledge-github.yaml +40 -0
  150. package/runtime/providers/knowledge-google-drive.yaml +32 -0
  151. package/runtime/providers/knowledge-local.yaml +26 -0
  152. package/runtime/providers/knowledge-notion.yaml +32 -0
  153. package/runtime/providers/knowledge-obsidian.yaml +24 -0
  154. package/runtime/providers/knowledge-onedrive.yaml +36 -0
  155. package/runtime/providers/knowledge-s3.yaml +45 -0
  156. package/runtime/providers/knowledge-sharepoint.yaml +39 -0
  157. package/runtime/providers/knowledge-supabase.yaml +43 -0
  158. package/runtime/providers/knowledge-vector.yaml +39 -0
  159. package/runtime/requirements.txt +6 -0
  160. package/runtime/scripts/docker-cli-qa.sh +453 -0
  161. package/runtime/scripts/release-catalog-snapshot.json +55 -4
  162. package/runtime/scripts/release-gate.py +54 -13
  163. package/runtime/tooling/toolchain.yaml +92 -0
  164. package/runtime/vendor/skills/napkin/napkin.md +21 -7
  165. package/runtime/workflows/azure-card-analysis/README.md +3 -0
  166. package/runtime/workflows/azure-card-analysis/workflow.yaml +30 -0
  167. package/runtime/workflows/daily-pr-review/README.md +3 -0
  168. package/runtime/workflows/daily-pr-review/workflow.yaml +31 -0
  169. package/runtime/workflows/incident-analysis/README.md +3 -0
  170. package/runtime/workflows/incident-analysis/workflow.yaml +33 -0
  171. package/runtime/workflows/release-prep/README.md +3 -0
  172. 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.0
30
34
  ```
31
35
 
32
36
  ## Quick Start
@@ -41,12 +45,13 @@ agent llm list
41
45
  agent commands list
42
46
  ```
43
47
 
44
- Agent DevKit `v0.2.0` also includes deterministic runtime discovery and
48
+ Agent DevKit `v0.3.0` also includes deterministic runtime discovery and
45
49
  integration commands:
46
50
 
47
51
  ```bash
48
52
  agent roadmap
49
53
  agent catalog search pr
54
+ agent plan "review this Azure card"
50
55
  agent route explain "review the PRs waiting for me"
51
56
  agent eval run routing
52
57
  agent secrets doctor
@@ -72,6 +77,43 @@ Natural-language mode requires an LLM backend. Deterministic commands such as
72
77
  `agent agents list`, `agent capabilities list`, `agent doctor`, `agent provider`
73
78
  and `agent run` do not require an LLM.
74
79
 
80
+ Running `agent` without arguments starts the local onboarding status and wizard:
81
+ memory, personality, LLM backends, Ollama, toolchain, sources and next actions.
82
+ Use `agent onboard minimal` for identity, coordinator LLM, Qwen3-0.6B via
83
+ Ollama and local memory. Use `agent onboard complete` to include toolchain,
84
+ providers/sources, specialist catalog, local automations, tasks, notifications,
85
+ knowledge and shared memory. Both commands return plans; external installs
86
+ still require explicit opt-in.
87
+
88
+ The canonical executable remains `agent`, but the local public agent name can be
89
+ changed during onboarding, with `agent --rename <name>`, with
90
+ `agent personality edit --rename <name>`, or through a natural-language prompt
91
+ such as `agent "mude seu nome para ianota10"`. To expose an executable alias,
92
+ use `agent alias add <name>`.
93
+
94
+ Useful operational commands:
95
+
96
+ ```bash
97
+ agent plan "analyze Azure card 7914"
98
+ agent execute --dry-run "summarize these logs"
99
+ agent workflow install daily-pr-review --dry-run
100
+ agent local-llm doctor
101
+ agent local-llm install qwen3:0.6b --dry-run
102
+ agent skill create my-skill --description "Local skill"
103
+ agent script create hello --command "echo hello"
104
+ agent team init
105
+ agent team doctor
106
+ agent knowledge init
107
+ agent knowledge search "runbook procedure"
108
+ agent shared-memory create --title "Support runbooks"
109
+ agent shared-memory submit <memory-id> --title "New runbook" --content "..." --key <contributor-key>
110
+ agent shared-memory review <memory-id> <submission-id>
111
+ agent shared-memory publish <memory-id> <submission-id> --yes --owner-key <owner-key>
112
+ agent contribute pr my-extension --dry-run
113
+ agent mcp manifest
114
+ agent mcp serve
115
+ ```
116
+
75
117
  ## Complete Configuration Tutorial
76
118
 
77
119
  There are three practical ways to use agents from the CLI:
@@ -187,10 +229,10 @@ agent llm doctor openrouter
187
229
  ```bash
188
230
  agent ollama status
189
231
  agent ollama models
190
- agent ollama pull qwen2.5-coder --dry-run
191
- agent ollama pull qwen2.5-coder --yes
232
+ agent ollama pull qwen3:0.6b --dry-run
233
+ agent ollama pull qwen3:0.6b --yes
192
234
  ollama serve
193
- agent llm configure ollama --base-url http://localhost:11434/v1 --model qwen2.5-coder --set-default
235
+ agent llm configure ollama --base-url http://localhost:11434/v1 --model qwen3:0.6b --set-default
194
236
  agent llm doctor ollama
195
237
  ```
196
238
 
@@ -304,7 +346,7 @@ agent llm configure openrouter --api-key-env OPENROUTER_API_KEY --model openai/g
304
346
  Local or host-authenticated backends:
305
347
 
306
348
  ```bash
307
- agent llm configure ollama --base-url http://localhost:11434/v1 --model qwen2.5-coder --set-default
349
+ agent llm configure ollama --base-url http://localhost:11434/v1 --model qwen3:0.6b --set-default
308
350
  agent llm configure codex-cli --set-default
309
351
  agent llm configure claude-code --set-default
310
352
  ```
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.0",
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
+ mini-cerebro Qwen3-0.6B via Ollama 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:
@@ -224,10 +257,10 @@ final.
224
257
  ```bash
225
258
  agent ollama status
226
259
  agent ollama models
227
- agent ollama pull qwen2.5-coder --dry-run
228
- agent ollama pull qwen2.5-coder --yes
260
+ agent ollama pull qwen3:0.6b --dry-run
261
+ agent ollama pull qwen3:0.6b --yes
229
262
  ollama serve
230
- agent llm configure ollama --base-url http://localhost:11434/v1 --model qwen2.5-coder --set-default
263
+ agent llm configure ollama --base-url http://localhost:11434/v1 --model qwen3:0.6b --set-default
231
264
  agent llm doctor ollama
232
265
  ```
233
266
 
@@ -270,6 +303,11 @@ Existem dois modos de execucao:
270
303
  - `agent "<prompt>"`: entrada em linguagem natural; monta um plano multiagente,
271
304
  usa capabilities deterministicas quando possivel e exige backend LLM apenas
272
305
  quando nenhuma rota local atende a tarefa.
306
+ - `agent plan "<prompt>"`: gera o plano multiagente explicito sem executar LLM,
307
+ automacao ou escrita externa.
308
+ - `agent execute "<prompt>"` e `agent orchestrate "<prompt>"`: executam pelo
309
+ runtime agentico com roteamento, wizard de provider/source, modelo local
310
+ quando permitido e review gate.
273
311
  - `agent run <agent> <capability>`: execucao deterministica; nao exige LLM.
274
312
 
275
313
  Exemplo em linguagem natural:
@@ -309,6 +347,123 @@ saidas:
309
347
  agent inspect azure-devops-orchestrator read-card
310
348
  ```
311
349
 
350
+ Comandos operacionais da `v0.2.1`:
351
+
352
+ ```bash
353
+ agent catalog list --type workflow
354
+ agent catalog rebuild-index
355
+ agent workflow show daily-pr-review
356
+ agent workflow install daily-pr-review --dry-run
357
+ agent local-llm doctor
358
+ agent local-llm install qwen3:0.6b --dry-run
359
+ agent skill create minha-skill --description "Skill local"
360
+ agent script create hello --command "echo hello"
361
+ agent agents create meu-agente --description "Agente local"
362
+ agent team init
363
+ agent team doctor
364
+ agent contribute pr minha-extensao --dry-run
365
+ ```
366
+
367
+ O MCP stdio embutido fica disponivel sempre que o CLI esta instalado:
368
+
369
+ ```bash
370
+ agent mcp manifest
371
+ agent mcp tools
372
+ agent mcp serve
373
+ ```
374
+
375
+ As ferramentas MCP expõem catalogo, onboarding, doctor, route explain, plano
376
+ agentico, evals, workflows, LLM local, artefatos locais, sources, wizards,
377
+ memoria local e memoria compartilhada. As operacoes com risco de escrita
378
+ externa continuam bloqueadas ou em dry-run por padrao.
379
+
380
+ ## Memoria compartilhada
381
+
382
+ Memorias compartilhadas sao workspaces locais em `.agent-devkit/shared-memory`.
383
+ O criador e o dono da memoria; outros agentes recebem uma URL local e uma chave
384
+ de contribuidor, enviam novidades para `incoming`, e o dono revisa antes de
385
+ publicar em `accepted`.
386
+
387
+ ```bash
388
+ agent shared-memory create --title "Runbooks de suporte"
389
+ agent shared-memory submit <memory-id> --title "Novo runbook" --content "..." --key <contributor-key>
390
+ agent shared-memory review <memory-id> <submission-id>
391
+ agent shared-memory publish <memory-id> <submission-id> --yes --owner-key <owner-key>
392
+ ```
393
+
394
+ ## Modo equipe
395
+
396
+ O modo equipe cria uma configuracao versionavel de projeto em
397
+ `.agent-devkit/team.yaml`. Esse arquivo pode guardar defaults de providers,
398
+ sources, workflows, permissoes, limites de LLM local e politica de prompt
399
+ injection, mas nunca valores de credenciais.
400
+
401
+ ```bash
402
+ agent team init
403
+ agent team status
404
+ agent team doctor
405
+ agent team onboard
406
+ agent team profile list
407
+ agent team profile show default
408
+ agent team profile export default --path ./team-profile.yaml
409
+ agent team profile import ./team-profile.yaml
410
+ ```
411
+
412
+ Segredos continuam pessoais, em `~/.agent-devkit`, por referencia segura:
413
+
414
+ ```bash
415
+ agent secret set azure-devops pat --env AZURE_DEVOPS_PAT
416
+ ```
417
+
418
+ ## Knowledge fabric local
419
+
420
+ A `v0.3.0` introduz uma base de conhecimento compartilhada file-first. A fonte
421
+ canonica e um diretorio `knowledge-base/` com Markdown, JSON e YAML; indices
422
+ lexicais ou semanticos sao derivados e podem ser recriados.
423
+
424
+ ```bash
425
+ agent knowledge init
426
+ agent knowledge doctor
427
+ agent knowledge snapshot create --title "Runbook" --content "# Runbook..."
428
+ agent knowledge review runbook
429
+ agent knowledge publish runbook --yes --owner-agent knowledge-owner
430
+ agent knowledge snapshot list
431
+ agent knowledge snapshot show runbook
432
+ agent knowledge snapshot score runbook
433
+ agent knowledge snapshot submit runbook
434
+ agent knowledge review list
435
+ agent knowledge curate
436
+ agent knowledge sync
437
+ agent knowledge reindex
438
+ agent knowledge search "runbook procedimento"
439
+ agent knowledge index
440
+ agent knowledge-base create --provider github
441
+ agent knowledge-base join kb_01JZ... --provider s3
442
+ ```
443
+
444
+ Snapshots sao tratados como conteudo externo nao confiavel. A revisao bloqueia
445
+ segredos, PII obvia e sinais de prompt injection antes de publicar localmente.
446
+
447
+ Os providers `knowledge-*` documentam o storage previsto para GitHub, S3,
448
+ Supabase Storage, Google Drive, SharePoint, OneDrive, Notion, Obsidian,
449
+ filesystem local e indice vetorial derivado. Providers remotos ficam em
450
+ `draft`, exigem opt-in e fallback para plano/manual enquanto nao houver
451
+ credencial e implementacao ativa.
452
+
453
+ ## QA destrutivo em Docker
454
+
455
+ Para validar instalacao limpa, bootstrap de dependencias, onboarding, memoria,
456
+ knowledge-base, MCP, desinstalacao e remocao da `.agent-devkit` sem tocar no
457
+ host:
458
+
459
+ ```bash
460
+ npm run docker:qa
461
+ ```
462
+
463
+ O script empacota o runtime local, instala o tarball em um container
464
+ `node:20-bookworm`, executa os fluxos criticos e remove o home local criado no
465
+ container.
466
+
312
467
  ## Configurar providers
313
468
 
314
469
  Providers tambem sao configurados por referencia. Configure apenas o que for
@@ -430,6 +585,10 @@ Comandos uteis:
430
585
  agent commands list
431
586
  agent inspect azure-devops-orchestrator read-card
432
587
  agent memory show
588
+ agent memory backup create --title "Antes da migracao"
589
+ export AGENT_DEVKIT_BACKUP_PASSPHRASE="frase longa"
590
+ agent memory backup create --title "Antes da migracao" --encrypted --passphrase-env AGENT_DEVKIT_BACKUP_PASSPHRASE
591
+ agent memory backup restore <backup-id> --yes
433
592
  agent memory reset --all
434
593
  ```
435
594
 
@@ -699,6 +858,9 @@ e ignorado pelo Git. Para Azure DevOps, `AZURE_DEVOPS_ORG` e
699
858
  rastreio de requests, padroes de erro e relatorios de logs.
700
859
  - [`execution-reviewer`](agents/execution-reviewer/): agente runtime de
701
860
  revisao final, revisao de planos e revisao de resultados antes da conclusao.
861
+ - [`contribution-reviewer`](agents/contribution-reviewer/): agente runtime para
862
+ validar extensoes locais, revisar riscos de contribuicao upstream e planejar
863
+ PRs em modo report-only.
702
864
  - [`excel-workbook-builder`](agents/excel-workbook-builder/): especialista em
703
865
  templates, preenchimento, conciliacao, revisao e exportacao de planilhas
704
866
  Excel.
@@ -708,10 +870,27 @@ e ignorado pelo Git. Para Azure DevOps, `AZURE_DEVOPS_ORG` e
708
870
  - [`github-pr-reviewer`](agents/github-pr-reviewer/): especialista em Pull
709
871
  Requests GitHub para listar revisoes pendentes, inspecionar PRs, revisar diffs
710
872
  em modo report-only e criar automacoes locais conservadoras.
873
+ - [`knowledge-infra-builder`](agents/knowledge-infra-builder/): especialista em
874
+ criar e diagnosticar a infraestrutura file-first da knowledge base
875
+ compartilhada.
876
+ - [`knowledge-author`](agents/knowledge-author/): especialista em criar
877
+ snapshots de conhecimento reutilizavel, sanitizado e revisavel.
711
878
  - [`knowledge-generator`](agents/knowledge-generator/): especialista em gerar
712
879
  knowledge versionavel a partir de arquivos, pastas, projetos e documentacoes.
880
+ - [`knowledge-reviewer`](agents/knowledge-reviewer/): especialista em revisar
881
+ snapshots, bloqueando segredo, PII indevida, duplicidade e prompt injection.
882
+ - [`knowledge-curator`](agents/knowledge-curator/): especialista em curadoria
883
+ continua, deduplicacao, arquivamento e reindexacao derivada da knowledge base.
884
+ - [`knowledge-owner`](agents/knowledge-owner/): autoridade de publicacao
885
+ controlada da knowledge base principal apos revisao.
713
886
  - [`local-llm-operator`](agents/local-llm-operator/): agente runtime para
714
887
  diagnosticar, selecionar e delegar tarefas operacionais a LLMs locais.
888
+ - [`local-memory-manager`](agents/local-memory-manager/): agente runtime para
889
+ inspecionar e curar memoria local, preferencias, sessoes e identidade sem
890
+ expor segredos.
891
+ - [`memory-sync-manager`](agents/memory-sync-manager/): especialista em
892
+ planejar backup, restore e sincronizacao seletiva da memoria local e
893
+ personalidade.
715
894
  - [`notification-operator`](agents/notification-operator/): agente runtime para
716
895
  formatar, enviar e configurar notificacoes locais de tarefas com payload
717
896
  canonico.
@@ -728,6 +907,9 @@ e ignorado pelo Git. Para Azure DevOps, `AZURE_DEVOPS_ORG` e
728
907
  especialista em inspecao local e auditoria report-only de projetos Supabase,
729
908
  cobrindo RLS, Auth, Storage, migrations, Edge Functions e planos de correcao
730
909
  sem aplicar mudancas reais.
910
+ - [`shared-memory-curator`](agents/shared-memory-curator/): agente runtime para
911
+ criar memorias compartilhadas, revisar contribuicoes externas e publicar
912
+ apenas conteudo aprovado pelo dono.
731
913
  - [`provider-configurator`](agents/provider-configurator/): agente runtime que
732
914
  conduz wizard de providers, sources e referencias seguras de credenciais.
733
915
  - [`presentation-deck-builder`](agents/presentation-deck-builder/):
package/runtime/agent CHANGED
@@ -14,11 +14,13 @@ SESSION_SHORTCUTS = {"-s", "--sessions"}
14
14
  AGENT_PROMPT_FLAGS = {"--llm", "--no-llm-fallback", "--session", "--new-session"}
15
15
  EXPLAIN_FLAGS = {"--explain"}
16
16
  GLOBAL_PROMPT_FLAGS = {"--json", "--dry-run"}
17
+ RENAME_FLAGS = {"--rename"}
18
+ AGENTIC_PROMPT_COMMANDS = {"plan", "execute", "orchestrate"}
17
19
 
18
20
 
19
21
  def normalize_args(argv: list[str]) -> list[str]:
20
22
  if not argv:
21
- return ["agent"]
23
+ return ["onboard"]
22
24
  commands = set(DETERMINISTIC_COMMANDS) | set(LLM_COMMANDS)
23
25
  leading: list[str] = []
24
26
  remaining = list(argv)
@@ -26,14 +28,20 @@ def normalize_args(argv: list[str]) -> list[str]:
26
28
  leading.append(remaining.pop(0))
27
29
  if leading:
28
30
  if not remaining:
29
- return [*leading, "agent"]
31
+ return [*leading, "onboard"]
30
32
  if remaining[0] in SESSION_SHORTCUTS:
31
33
  return [*leading, *remaining]
32
34
  if remaining[0] in EXPLAIN_FLAGS:
33
35
  return [*leading, "route", "explain", *remaining[1:]]
36
+ if remaining[0] in RENAME_FLAGS:
37
+ return [*leading, "personality", "edit", *remaining]
38
+ if remaining[0] in AGENTIC_PROMPT_COMMANDS:
39
+ prompt_flags, prompt_args = split_global_prompt_flags(remaining[1:])
40
+ return [*leading, remaining[0], *prompt_flags, *prompt_args]
34
41
  if remaining[0] in commands:
35
42
  return [*leading, *remaining]
36
- return [*leading, "agent", *remaining]
43
+ prompt_flags, prompt_args = split_global_prompt_flags(remaining)
44
+ return [*leading, *prompt_flags, "agent", *prompt_args]
37
45
  first = remaining[0]
38
46
  if first in {"--help", "-h", "--version", "-v"}:
39
47
  return remaining
@@ -41,11 +49,29 @@ def normalize_args(argv: list[str]) -> list[str]:
41
49
  return remaining
42
50
  if first in EXPLAIN_FLAGS:
43
51
  return ["route", "explain", *remaining[1:]]
52
+ if first in RENAME_FLAGS:
53
+ return ["personality", "edit", *remaining]
44
54
  if first in AGENT_PROMPT_FLAGS:
45
- return ["agent", *remaining]
55
+ prompt_flags, prompt_args = split_global_prompt_flags(remaining)
56
+ return [*prompt_flags, "agent", *prompt_args]
57
+ if first in AGENTIC_PROMPT_COMMANDS:
58
+ prompt_flags, prompt_args = split_global_prompt_flags(remaining[1:])
59
+ return [first, *prompt_flags, *prompt_args]
46
60
  if first in commands:
47
61
  return remaining
48
- return ["agent", *remaining]
62
+ prompt_flags, prompt_args = split_global_prompt_flags(remaining)
63
+ return [*prompt_flags, "agent", *prompt_args]
64
+
65
+
66
+ def split_global_prompt_flags(argv: list[str]) -> tuple[list[str], list[str]]:
67
+ leading: list[str] = []
68
+ remaining: list[str] = []
69
+ for item in argv:
70
+ if item in GLOBAL_PROMPT_FLAGS:
71
+ leading.append(item)
72
+ else:
73
+ remaining.append(item)
74
+ return leading, remaining
49
75
 
50
76
 
51
77
  if __name__ == "__main__":
@@ -71,6 +71,8 @@ agents/<agent-id>/
71
71
  artefatos Docker locais sem executar build, push ou deploy real.
72
72
  - `execution-loop-builder`: especialista em planejar, gerar, revisar e
73
73
  registrar loops de execucao controlados com budgets e criterios de parada.
74
+ - `contribution-reviewer`: agente runtime para validar extensoes locais,
75
+ revisar riscos de contribuicao upstream e planejar PRs em modo report-only.
74
76
  - `drawio-diagram-builder`: especialista em diagramas Draw.io editaveis a
75
77
  partir de fontes reais, entrevista, geracao, revisao e refinamento.
76
78
  - `elasticsearch-log-analyzer`: especialista em logs no Elasticsearch.
@@ -83,10 +85,24 @@ agents/<agent-id>/
83
85
  - `github-pr-reviewer`: especialista em Pull Requests GitHub, revisao
84
86
  report-only, permissao explicita para comentarios/aprovacoes e automacoes
85
87
  locais conservadoras.
88
+ - `knowledge-infra-builder`: especialista em criar e diagnosticar a
89
+ infraestrutura file-first da knowledge base compartilhada.
90
+ - `knowledge-author`: especialista em criar snapshots de conhecimento
91
+ reutilizavel, sanitizado e revisavel.
86
92
  - `knowledge-generator`: especialista em gerar knowledge versionavel a partir de
87
93
  fontes locais e documentacoes.
94
+ - `knowledge-reviewer`: especialista em revisar snapshots, bloqueando segredo,
95
+ PII indevida, duplicidade e prompt injection.
96
+ - `knowledge-curator`: especialista em curadoria continua, deduplicacao,
97
+ arquivamento e reindexacao derivada da knowledge base.
98
+ - `knowledge-owner`: autoridade de publicacao controlada da knowledge base
99
+ principal apos revisao.
88
100
  - `local-llm-operator`: agente runtime para diagnosticar, selecionar e delegar
89
101
  tarefas operacionais a LLMs locais como Ollama.
102
+ - `local-memory-manager`: agente runtime para inspecionar e curar memoria local,
103
+ preferencias, sessoes e identidade sem expor segredos.
104
+ - `memory-sync-manager`: especialista em planejar backup, restore e
105
+ sincronizacao seletiva da memoria local e personalidade.
90
106
  - `n1-support-agent`: especialista N1 para runbooks operacionais a partir de
91
107
  cards Azure DevOps.
92
108
  - `n2-support-agent`: especialista N2 para investigacao de causa raiz e geracao
@@ -106,6 +122,8 @@ agents/<agent-id>/
106
122
  Server.
107
123
  - `sqlserver-change-operator`: especialista em mudancas controladas em SQL
108
124
  Server.
125
+ - `shared-memory-curator`: agente runtime para criar memorias compartilhadas,
126
+ revisar contribuicoes externas e publicar apenas conteudo aprovado pelo dono.
109
127
  - `software-specification-analyst`: especialista em analise de requisitos,
110
128
  entrevistas, analise de projetos e especificacoes completas de software.
111
129
  - `task-orchestrator`: agente runtime que planeja prompts livres, seleciona
@@ -0,0 +1,8 @@
1
+ # AGENTS.md
2
+
3
+ Instrucoes especificas para o agente `contribution-reviewer`.
4
+
5
+ Este agente revisa contribuicoes locais antes de qualquer tentativa de upstream.
6
+ Ele deve operar em modo report-only por padrao, bloquear segredos, paths locais,
7
+ URLs privadas e PII, e nunca abrir PR sem confirmacao explicita fora do fluxo de
8
+ teste.