@botpress/adk 1.19.0-beta.3 → 1.19.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -209,7 +209,7 @@ When building a triage, routing, classification, extraction, or Q&A agent, the r
209
209
 
210
210
  ## ADK Knowledge Sources
211
211
 
212
- The \`adk\` skill is preloaded as \`.agents/skills/adk/SKILL.md\`. Treat it as the index, not the whole manual. Before authoring a primitive, read the relevant reference file under \`.agents/skills/adk/references/\`:
212
+ The \`adk\` skill is preloaded as \`.agent0/capabilities/skills/adk/SKILL.md\`. Treat it as the index, not the whole manual. Before authoring a primitive, read the relevant reference file under \`.agent0/capabilities/skills/adk/references/\`:
213
213
  - \`agent-config.md\` before changing \`agent.config.ts\`
214
214
  - \`conversations.md\` before writing or modifying conversations
215
215
  - \`triggers.md\` before event-driven behavior
@@ -229,7 +229,7 @@ Use ADK imports from \`@botpress/runtime\` for generated agent code. Use Botpres
229
229
 
230
230
  ## Command Playbooks
231
231
 
232
- Generated projects include OpenCode command playbooks in \`.opencode/commands/\`. Use them as workflow guidance:
232
+ Agent(0) command playbooks are available in \`.agent0/capabilities/playbooks/\`. Use them as workflow guidance:
233
233
  - \`adk-build.md\` for decomposing a feature into primitives and building it
234
234
  - \`adk-validate.md\` for static validation of a primitive or feature
235
235
  - \`adk-test.md\` for invoking the built behavior
@@ -283,10 +283,16 @@ Warm, direct, and efficient. No filler. Bias to action over questions; when you
283
283
  // src/agent0/capabilities/builtins.ts
284
284
  var AGENT0_DEFAULT_AGENT = "default";
285
285
  var AGENT0_PRIMARY_AGENT_STEPS = 64;
286
+ var AGENT0_PROJECT_DIR = ".agent0";
287
+ var AGENT0_PROJECT_CAPABILITIES_DIR = "capabilities";
288
+ var AGENT0_PROJECT_SKILLS_DIR = "skills";
289
+ var AGENT0_PROJECT_PLAYBOOKS_DIR = "playbooks";
290
+ var AGENT0_PROJECT_CAPABILITIES_MANIFEST = "manifest.json";
286
291
  var AGENT0_SCREENSHOT_MCP_TOOL_PERMISSION = "adk_adk_take_screenshot";
287
292
  var AGENT0_SCREENSHOT_RAW_TOOL_PERMISSION = "adk_take_screenshot";
288
293
  function buildAgent0BuiltInCapabilities(options) {
289
- const skillsRoot = resolveAgent0BuiltInSkillsRoot();
294
+ const skillsRoot = resolveAgent0ProjectSkillsRoot(options.agentPath);
295
+ const commandsRoot = resolveAgent0ProjectPlaybooksRoot(options.agentPath);
290
296
  return {
291
297
  mcp: {
292
298
  adk: {
@@ -296,11 +302,11 @@ function buildAgent0BuiltInCapabilities(options) {
296
302
  }
297
303
  },
298
304
  skills: {
299
- paths: resolveAgent0BuiltInSkillPaths(skillsRoot),
305
+ paths: skillsRoot ? resolveAgent0BuiltInSkillPaths(skillsRoot) : [],
300
306
  urls: []
301
307
  },
302
- instructions: resolveAgent0BuiltInInstructionFiles(skillsRoot),
303
- command: loadAgent0BuiltInCommandConfig(),
308
+ instructions: skillsRoot ? resolveAgent0BuiltInInstructionFiles(skillsRoot) : [],
309
+ command: commandsRoot ? loadAgent0BuiltInCommandConfig(commandsRoot) : {},
304
310
  agent: {
305
311
  default: {
306
312
  description: "Agent(0) - helps build and debug Botpress ADK agents",
@@ -330,6 +336,18 @@ function buildAgent0BuiltInCapabilities(options) {
330
336
  defaultAgent: AGENT0_DEFAULT_AGENT
331
337
  };
332
338
  }
339
+ function getAgent0ProjectCapabilitiesRoot(projectPath) {
340
+ return join(projectPath, AGENT0_PROJECT_DIR, AGENT0_PROJECT_CAPABILITIES_DIR);
341
+ }
342
+ function getAgent0ProjectCapabilitiesManifestPath(projectPath) {
343
+ return join(getAgent0ProjectCapabilitiesRoot(projectPath), AGENT0_PROJECT_CAPABILITIES_MANIFEST);
344
+ }
345
+ function resolveAgent0ProjectSkillsRoot(projectPath) {
346
+ return firstExistingDirectory([join(getAgent0ProjectCapabilitiesRoot(projectPath), AGENT0_PROJECT_SKILLS_DIR)]);
347
+ }
348
+ function resolveAgent0ProjectPlaybooksRoot(projectPath) {
349
+ return firstExistingDirectory([join(getAgent0ProjectCapabilitiesRoot(projectPath), AGENT0_PROJECT_PLAYBOOKS_DIR)]);
350
+ }
333
351
  function resolveAgent0BuiltInSkillsRoot() {
334
352
  return firstExistingDirectory(resolveAgent0BuiltInSkillsRootCandidates(moduleDir()));
335
353
  }
@@ -2060,12 +2078,12 @@ function createAgent0RuntimeClient(options) {
2060
2078
  },
2061
2079
  async listCommands() {
2062
2080
  return {
2063
- commands: listAgent0BuiltInCommands(),
2081
+ commands: listAgent0BuiltInCommands(options.projectPath),
2064
2082
  warnings: []
2065
2083
  };
2066
2084
  },
2067
2085
  async runCommand(sessionId, input) {
2068
- const command = getAgent0BuiltInCommand(input.command);
2086
+ const command = getAgent0BuiltInCommand(options.projectPath, input.command);
2069
2087
  if (!command) {
2070
2088
  throw new Agent0RuntimeClientError("ENGINE_INVALID_RESPONSE", `Unknown Agent(0) command: ${input.command}`);
2071
2089
  }
@@ -2419,16 +2437,22 @@ function normalizeQuestionAnswers(value) {
2419
2437
  return [...answer];
2420
2438
  });
2421
2439
  }
2422
- function listAgent0BuiltInCommands() {
2423
- return Object.entries(loadAgent0BuiltInCommandConfig()).map(([name, command]) => ({
2440
+ function listAgent0BuiltInCommands(projectPath) {
2441
+ const commandsRoot = resolveAgent0ProjectPlaybooksRoot(projectPath);
2442
+ if (!commandsRoot)
2443
+ return [];
2444
+ return Object.entries(loadAgent0BuiltInCommandConfig(commandsRoot)).map(([name, command]) => ({
2424
2445
  name,
2425
2446
  ...command.description ? { description: command.description } : {},
2426
2447
  hints: extractAgent0CommandHints(command.template),
2427
2448
  ...typeof command.subtask === "boolean" ? { subtask: command.subtask } : {}
2428
2449
  })).toSorted((left, right) => left.name.localeCompare(right.name));
2429
2450
  }
2430
- function getAgent0BuiltInCommand(name) {
2431
- return loadAgent0BuiltInCommandConfig()[name];
2451
+ function getAgent0BuiltInCommand(projectPath, name) {
2452
+ const commandsRoot = resolveAgent0ProjectPlaybooksRoot(projectPath);
2453
+ if (!commandsRoot)
2454
+ return;
2455
+ return loadAgent0BuiltInCommandConfig(commandsRoot)[name];
2432
2456
  }
2433
2457
  function extractAgent0CommandHints(template) {
2434
2458
  const hints = new Set;
@@ -3150,6 +3174,8 @@ export {
3150
3174
  startAgent0RuntimeClient,
3151
3175
  startAgent0OpenCodeProcess,
3152
3176
  sanitizeAgent0OpenCodeBaseEnv,
3177
+ resolveAgent0ProjectSkillsRoot,
3178
+ resolveAgent0ProjectPlaybooksRoot,
3153
3179
  resolveAgent0OpenCodeBinary,
3154
3180
  resolveAgent0BuiltInSkillsRootCandidates,
3155
3181
  resolveAgent0BuiltInSkillsRoot,
@@ -3170,6 +3196,8 @@ export {
3170
3196
  getAgent0ProjectPaths,
3171
3197
  getAgent0ProjectHash,
3172
3198
  getAgent0ProjectDiscoveryGitShimFilename,
3199
+ getAgent0ProjectCapabilitiesRoot,
3200
+ getAgent0ProjectCapabilitiesManifestPath,
3173
3201
  getAgent0HomeDir,
3174
3202
  getAgent0ConfigPath,
3175
3203
  ensureAgent0ProjectDiscoveryGitShim,
@@ -3206,10 +3234,15 @@ export {
3206
3234
  AGENT0_SCREENSHOT_RAW_TOOL_PERMISSION,
3207
3235
  AGENT0_SCREENSHOT_MCP_TOOL_PERMISSION,
3208
3236
  AGENT0_PROVIDER_CATALOG,
3237
+ AGENT0_PROJECT_SKILLS_DIR,
3238
+ AGENT0_PROJECT_PLAYBOOKS_DIR,
3209
3239
  AGENT0_PROJECT_ID_CACHE_GUARD_ENV,
3240
+ AGENT0_PROJECT_DIR,
3241
+ AGENT0_PROJECT_CAPABILITIES_MANIFEST,
3242
+ AGENT0_PROJECT_CAPABILITIES_DIR,
3210
3243
  AGENT0_HIDDEN_OPENCODE_SKILL,
3211
3244
  AGENT0_CONFIG_SCHEMA_VERSION,
3212
3245
  AGENT0_BUILT_IN_MCP_PERMISSION
3213
3246
  };
3214
3247
 
3215
- //# debugId=1EFA6274C1909E3064756E2164756E21
3248
+ //# debugId=5A9AB7B1FC2F63C264756E2164756E21