@botpress/adk 1.19.0-beta.4 → 1.19.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
  }
@@ -1432,27 +1450,16 @@ var AGENT0_OPEN_CODE_PERMISSION_POLICY = Object.freeze({
1432
1450
  [AGENT0_HIDDEN_OPENCODE_SKILL]: "deny"
1433
1451
  },
1434
1452
  lsp: "allow",
1453
+ external_directory: "deny",
1435
1454
  repo_clone: "deny",
1436
1455
  repo_overview: "allow",
1437
1456
  [AGENT0_BUILT_IN_MCP_PERMISSION]: "allow"
1438
1457
  });
1439
- function buildAgent0OpenCodePermissionConfig(options = {}) {
1440
- return {
1441
- ...Object.fromEntries(Object.entries(AGENT0_OPEN_CODE_PERMISSION_POLICY).map(([key, value]) => [
1442
- key,
1443
- typeof value === "string" ? value : { ...value }
1444
- ])),
1445
- external_directory: buildAgent0ExternalDirectoryPermission(options.externalSkillPaths ?? [])
1446
- };
1447
- }
1448
- function buildAgent0ExternalDirectoryPermission(skillPaths) {
1449
- return Object.fromEntries([
1450
- ["*", "deny"],
1451
- ...skillPaths.map(toRecursivePathPattern).toSorted().map((pattern) => [pattern, "allow"])
1452
- ]);
1453
- }
1454
- function toRecursivePathPattern(path) {
1455
- return `${path.replace(/[\\/]+$/, "")}/**`;
1458
+ function buildAgent0OpenCodePermissionConfig() {
1459
+ return Object.fromEntries(Object.entries(AGENT0_OPEN_CODE_PERMISSION_POLICY).map(([key, value]) => [
1460
+ key,
1461
+ typeof value === "string" ? value : { ...value }
1462
+ ]));
1456
1463
  }
1457
1464
 
1458
1465
  // src/agent0/runtime/project-discovery.ts
@@ -1576,7 +1583,7 @@ function buildAgent0OpenCodeConfig(options) {
1576
1583
  ...options.agent0Config || options.cognitiveModels !== undefined ? { enabled_providers: enabledProviders } : {},
1577
1584
  ...Object.keys(provider).length ? { provider } : {},
1578
1585
  mcp: builtIns.mcp,
1579
- permission: buildAgent0OpenCodePermissionConfig({ externalSkillPaths: builtIns.skills.paths }),
1586
+ permission: buildAgent0OpenCodePermissionConfig(),
1580
1587
  default_agent: builtIns.defaultAgent,
1581
1588
  agent: builtIns.agent,
1582
1589
  ...Object.keys(builtIns.command).length ? { command: builtIns.command } : {},
@@ -2071,12 +2078,12 @@ function createAgent0RuntimeClient(options) {
2071
2078
  },
2072
2079
  async listCommands() {
2073
2080
  return {
2074
- commands: listAgent0BuiltInCommands(),
2081
+ commands: listAgent0BuiltInCommands(options.projectPath),
2075
2082
  warnings: []
2076
2083
  };
2077
2084
  },
2078
2085
  async runCommand(sessionId, input) {
2079
- const command = getAgent0BuiltInCommand(input.command);
2086
+ const command = getAgent0BuiltInCommand(options.projectPath, input.command);
2080
2087
  if (!command) {
2081
2088
  throw new Agent0RuntimeClientError("ENGINE_INVALID_RESPONSE", `Unknown Agent(0) command: ${input.command}`);
2082
2089
  }
@@ -2430,16 +2437,22 @@ function normalizeQuestionAnswers(value) {
2430
2437
  return [...answer];
2431
2438
  });
2432
2439
  }
2433
- function listAgent0BuiltInCommands() {
2434
- 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]) => ({
2435
2445
  name,
2436
2446
  ...command.description ? { description: command.description } : {},
2437
2447
  hints: extractAgent0CommandHints(command.template),
2438
2448
  ...typeof command.subtask === "boolean" ? { subtask: command.subtask } : {}
2439
2449
  })).toSorted((left, right) => left.name.localeCompare(right.name));
2440
2450
  }
2441
- function getAgent0BuiltInCommand(name) {
2442
- return loadAgent0BuiltInCommandConfig()[name];
2451
+ function getAgent0BuiltInCommand(projectPath, name) {
2452
+ const commandsRoot = resolveAgent0ProjectPlaybooksRoot(projectPath);
2453
+ if (!commandsRoot)
2454
+ return;
2455
+ return loadAgent0BuiltInCommandConfig(commandsRoot)[name];
2443
2456
  }
2444
2457
  function extractAgent0CommandHints(template) {
2445
2458
  const hints = new Set;
@@ -3161,6 +3174,8 @@ export {
3161
3174
  startAgent0RuntimeClient,
3162
3175
  startAgent0OpenCodeProcess,
3163
3176
  sanitizeAgent0OpenCodeBaseEnv,
3177
+ resolveAgent0ProjectSkillsRoot,
3178
+ resolveAgent0ProjectPlaybooksRoot,
3164
3179
  resolveAgent0OpenCodeBinary,
3165
3180
  resolveAgent0BuiltInSkillsRootCandidates,
3166
3181
  resolveAgent0BuiltInSkillsRoot,
@@ -3181,6 +3196,8 @@ export {
3181
3196
  getAgent0ProjectPaths,
3182
3197
  getAgent0ProjectHash,
3183
3198
  getAgent0ProjectDiscoveryGitShimFilename,
3199
+ getAgent0ProjectCapabilitiesRoot,
3200
+ getAgent0ProjectCapabilitiesManifestPath,
3184
3201
  getAgent0HomeDir,
3185
3202
  getAgent0ConfigPath,
3186
3203
  ensureAgent0ProjectDiscoveryGitShim,
@@ -3217,10 +3234,15 @@ export {
3217
3234
  AGENT0_SCREENSHOT_RAW_TOOL_PERMISSION,
3218
3235
  AGENT0_SCREENSHOT_MCP_TOOL_PERMISSION,
3219
3236
  AGENT0_PROVIDER_CATALOG,
3237
+ AGENT0_PROJECT_SKILLS_DIR,
3238
+ AGENT0_PROJECT_PLAYBOOKS_DIR,
3220
3239
  AGENT0_PROJECT_ID_CACHE_GUARD_ENV,
3240
+ AGENT0_PROJECT_DIR,
3241
+ AGENT0_PROJECT_CAPABILITIES_MANIFEST,
3242
+ AGENT0_PROJECT_CAPABILITIES_DIR,
3221
3243
  AGENT0_HIDDEN_OPENCODE_SKILL,
3222
3244
  AGENT0_CONFIG_SCHEMA_VERSION,
3223
3245
  AGENT0_BUILT_IN_MCP_PERMISSION
3224
3246
  };
3225
3247
 
3226
- //# debugId=6C6BA416A743B9CE64756E2164756E21
3248
+ //# debugId=5A9AB7B1FC2F63C264756E2164756E21